vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

screen.h (1710B)


      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 {
     11 	Point	xy;		/* mouse.xy */
     12 	int	buttons;	/* mouse.buttons */
     13 	ulong	counter;	/* increments every update */
     14 	ulong	msec;		/* time of last event */
     15 };
     16 
     17 struct Mouseinfo
     18 {
     19 	Mousestate	mstate;
     20 	int	dx;
     21 	int	dy;
     22 	int	track;		/* dx & dy updated */
     23 	int	redraw;		/* update cursor on screen */
     24 	ulong	lastcounter;	/* value when /dev/mouse read */
     25 	ulong	lastresize;
     26 	ulong	resize;
     27 	Rendez	r;
     28 	Ref	ref;
     29 	QLock	qlk;
     30 	int	open;
     31 	int	inopen;
     32 	int	acceleration;
     33 	int	maxacc;
     34 	Mousestate	queue[16];	/* circular buffer of click events */
     35 	int	ri;		/* read index into queue */
     36 	int	wi;		/* write index into queue */
     37 	uchar	qfull;		/* queue is full */
     38 };
     39 
     40 struct Cursorinfo {
     41 	Lock	lk;
     42 	struct Cursor	cursor;
     43 };
     44 
     45 struct Screeninfo {
     46 	Lock		lk;
     47 	Memimage	*newsoft;
     48 	int		reshaped;
     49 	int		depth;
     50 	int		dibtype;
     51 };
     52 
     53 extern	Mouseinfo mouse;
     54 extern	Cursorinfo cursor;
     55 extern	Screeninfo screen;
     56 extern	Rectangle	mouserect;
     57 
     58 enum
     59 {
     60 	SnarfSize = 1<<20
     61 };
     62 
     63 uchar*	attachscreen(Rectangle*, ulong*, int*, int*, int*, void**);
     64 int	drawcanqlock(void);
     65 void	drawqlock(void);
     66 void	drawqunlock(void);
     67 void	getcolor(ulong, ulong*, ulong*, ulong*);
     68 char*	getsnarf(void);
     69 void	flushmemscreen(Rectangle);
     70 void	mousetrack(int, int, int, int);
     71 void	putsnarf(char*);
     72 int	setcolor(ulong, ulong, ulong, ulong);
     73 void	setcursor(struct Cursor*);
     74 void	setmouse(Point);
     75 void	terminit(int);
     76 void	termredraw(void);
     77 void	termreplacescreenimage(Memimage*);