File: screen.h

package info (click to toggle)
drawterm-9front 0~git20220608.bee4db6-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,256 kB
  • sloc: ansic: 57,635; makefile: 607; java: 492; objc: 436; xml: 174; asm: 19
file content (68 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
typedef struct Mouseinfo Mouseinfo;
typedef struct Mousestate Mousestate;
typedef struct Cursorinfo Cursorinfo;
typedef struct Screeninfo Screeninfo;

struct Mousestate {
	Point	xy;
	int	buttons;
	ulong	counter;
	ulong	msec;
};

struct Mouseinfo {
	Lock		lk;
	Mousestate	state;
	ulong		lastcounter;
	int		resize;		/* generate resize event */
	Rendez		r;
	int		open;
	Mousestate	queue[16];	/* circular buffer of click events */
	ulong		ri;		/* read index into queue */
	ulong		wi;		/* write index into queue */
};

struct Cursorinfo {
	Lock	lk;
	Point	offset;
	uchar	clr[2*16];
	uchar	set[2*16];
};

struct Screeninfo {
	Lock	lk;
	int	depth;
	int	dibtype;
};

extern	Memimage *gscreen;
extern	Mouseinfo mouse;
extern	Cursorinfo cursor;
extern	Cursorinfo arrow;
extern	Screeninfo screen;

void	screeninit(void);
void	screenload(Rectangle, int, uchar *, Point, int);

void	getcolor(ulong, ulong*, ulong*, ulong*);
void	setcolor(ulong, ulong, ulong, ulong);

void	setcursor(void);
void	mouseset(Point);
void	flushmemscreen(Rectangle);
Memdata*attachscreen(Rectangle*, ulong*, int*, int*, int*);
void	deletescreenimage(void);
void	resetscreenimage(void);

extern	QLock drawlock;
#define	ishwimage(i)	0

void	terminit(void);
void	screenresize(Rectangle);
void	screensize(Rectangle, ulong);

void	mouseresize(void);
void	mousetrack(int, int, int, ulong);
void	absmousetrack(int, int, int, ulong);
void	cpubody(void);
void	guimain(void);