xref: /plan9/sys/src/cmd/unix/drawterm/kern/screen.h (revision 96cbc34f1b36a29efdcfd47b10e70703a690febc)
1 typedef struct Mouseinfo Mouseinfo;
2 typedef struct Mousestate Mousestate;
3 typedef struct Cursorinfo Cursorinfo;
4 typedef struct Screeninfo Screeninfo;
5 
6 #define Mousequeue 16		/* queue can only have Mousequeue-1 elements */
7 #define Mousewindow 500		/* mouse event window in millisec */
8 
9 struct Mousestate {
10 	int	buttons;
11 	Point	xy;
12 	ulong	msec;
13 };
14 
15 struct Mouseinfo {
16 	Lock	lk;
17 	Mousestate queue[Mousequeue];
18 	int	ri, wi;
19 	int	lastb;
20 	int	trans;
21 	int	open;
22 	Rendez	r;
23 };
24 
25 struct Cursorinfo {
26 	Lock	lk;
27 	Point	offset;
28 	uchar	clr[2*16];
29 	uchar	set[2*16];
30 };
31 
32 struct Screeninfo {
33 	Lock		lk;
34 	Memimage	*newsoft;
35 	int		reshaped;
36 	int		depth;
37 	int		dibtype;
38 };
39 
40 extern	Memimage *gscreen;
41 extern	Mouseinfo mouse;
42 extern	Cursorinfo cursor;
43 extern	Screeninfo screen;
44 
45 void	screeninit(void);
46 void	screenload(Rectangle, int, uchar *, Point, int);
47 
48 void	getcolor(ulong, ulong*, ulong*, ulong*);
49 void	setcolor(ulong, ulong, ulong, ulong);
50 
51 void	refreshrect(Rectangle);
52 
53 void	cursorarrow(void);
54 void	setcursor(void);
55 void	mouseset(Point);
56 void	drawflushr(Rectangle);
57 void	flushmemscreen(Rectangle);
58 uchar *attachscreen(Rectangle*, ulong*, int*, int*, int*, void**);
59 
60 void	drawqlock(void);
61 void	drawqunlock(void);
62 int	drawcanqlock(void);
63 void	terminit(void);
64