diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-04-10 17:12:51 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-04-10 17:12:51 +0200 |
commit | 1fe3143e4c43ce2c74e0cfdd70b1bd556bbb9e1b (patch) | |
tree | 1507caffb47917cb57aeb1382dab568eb833dba2 /sys/src/9/pc/screen.h | |
parent | 7b309d2e280675b6ce39f9b53cef6577e295c4f4 (diff) |
kernel: cleanup the software mouse cursor mess
The swcursor used a 32x32 image for saving/restoring
screen contents for no reason.
Add a doflush argument to swcursorhide(), so that
disabling software cursor with a double buffered
softscreen is properly hidden. The doflush parameter
should be set to 0 in all other cases as swcursordraw()
will flushes both (current and previours) locations.
Make sure swcursorinit() and swcursorhide() clear the
visibility flag, even when gscreen is nil.
Remove the cursor locking and just do everything within
the drawlock. All cursor functions such as curson(),
cursoff() and setcursor() will be called drawlock
locked. This also means &cursor can be read.
Fix devmouse cursor reads and writes. We now have the
global cursor variable that is only modified under
the drawlock. So copy under drawlock.
Move the pc software cursor implementation into vgasoft
driver, so screen.c does not need to handle it as
a special case.
Remove unused functions such as drawhasclients().
Diffstat (limited to 'sys/src/9/pc/screen.h')
-rw-r--r-- | sys/src/9/pc/screen.h | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/sys/src/9/pc/screen.h b/sys/src/9/pc/screen.h index 0774f87c1..d852e5ad5 100644 --- a/sys/src/9/pc/screen.h +++ b/sys/src/9/pc/screen.h @@ -1,11 +1,6 @@ -typedef struct Cursor Cursor; -typedef struct Cursorinfo Cursorinfo; -struct Cursorinfo { - Cursor; - Lock; -}; - /* devmouse.c */ +typedef struct Cursor Cursor; +extern Cursor cursor; extern void mousetrack(int, int, int, ulong); extern void absmousetrack(int, int, int, ulong); extern Point mousexy(void); @@ -15,9 +10,6 @@ extern int m3mouseputc(Queue*, int); extern int m5mouseputc(Queue*, int); extern int mouseputc(Queue*, int); -extern Cursorinfo cursor; -extern Cursor arrow; - /* * Generic VGA registers. */ @@ -134,11 +126,11 @@ extern void mouseresize(void); extern void mouseredraw(void); /* screen.c */ -extern int hwaccel; /* use hw acceleration */ -extern int hwblank; /* use hw blanking */ -extern int panning; /* use virtual screen panning */ -extern void addvgaseg(char*, ulong, ulong); -extern Memdata* attachscreen(Rectangle*, ulong*, int*, int*, int*); +extern int hwaccel; /* use hw acceleration */ +extern int hwblank; /* use hw blanking */ +extern int panning; /* use virtual screen panning */ +extern void addvgaseg(char*, ulong, ulong); +extern Memdata* attachscreen(Rectangle*, ulong*, int*, int*, int*); extern void flushmemscreen(Rectangle); extern void cursoron(void); extern void cursoroff(void); @@ -148,20 +140,12 @@ extern int screenaperture(int, int); extern Rectangle physgscreenr; /* actual monitor size */ extern void blankscreen(int); extern char* rgbmask2chan(char *buf, int depth, u32int rm, u32int gm, u32int bm); - extern void bootscreeninit(void); extern void bootscreenconf(VGAscr*); -extern VGAcur swcursor; -extern void swcursorinit(void); -extern void swcursorhide(void); -extern void swcursoravoid(Rectangle); -extern void swcursorunhide(void); - /* devdraw.c */ extern void deletescreenimage(void); extern void resetscreenimage(void); -extern int drawhasclients(void); extern void setscreenimageclipr(Rectangle); extern void drawflush(void); extern QLock drawlock; @@ -171,15 +155,13 @@ extern void vgascreenwin(VGAscr*); extern void vgaimageinit(ulong); extern void vgalinearpci(VGAscr*); extern void vgalinearaddr(VGAscr*, ulong, int); - extern void vgablank(VGAscr*, int); - extern Lock vgascreenlock; #define ishwimage(i) (vgascreen[0].gscreendata && (i)->data->bdata == vgascreen[0].gscreendata->bdata) /* swcursor.c */ -void swcursorhide(void); +void swcursorhide(int); void swcursoravoid(Rectangle); void swcursordraw(Point); void swcursorload(Cursor *); |