tevent.h - plan9port - [fork] Plan 9 from user space | |
git clone git://src.adamsgaard.dk/plan9port | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
tevent.h (1562B) | |
--- | |
1 #ifndef _EVENT_H_ | |
2 #define _EVENT_H_ 1 | |
3 #if defined(__cplusplus) | |
4 extern "C" { | |
5 #endif | |
6 | |
7 typedef struct Event Event; | |
8 typedef struct Menu Menu; | |
9 | |
10 enum | |
11 { | |
12 Emouse = 1, | |
13 Ekeyboard = 2 | |
14 }; | |
15 | |
16 enum | |
17 { | |
18 MAXSLAVE = 32, | |
19 EMAXMSG = 128+8192 /* size of 9p header+data */ | |
20 }; | |
21 | |
22 struct Mouse | |
23 { | |
24 int buttons; /* bit array: LMR=124 */ | |
25 Point xy; | |
26 ulong msec; | |
27 }; | |
28 | |
29 struct Event | |
30 { | |
31 int kbdc; | |
32 Mouse mouse; | |
33 int n; /* number of characters in message … | |
34 void *v; /* data unpacked by general event… | |
35 uchar data[EMAXMSG]; /* message from an arbitrary … | |
36 }; | |
37 | |
38 struct Menu | |
39 { | |
40 char **item; | |
41 char *(*gen)(int); | |
42 int lasthit; | |
43 }; | |
44 | |
45 /* | |
46 * Events | |
47 */ | |
48 extern void einit(ulong); | |
49 extern ulong estart(ulong, int, int); | |
50 extern ulong estartfn(ulong, int, int, int (*fn)(int, Event*, uc… | |
51 extern ulong etimer(ulong, int); | |
52 extern ulong event(Event*); | |
53 extern ulong eread(ulong, Event*); | |
54 extern Mouse emouse(void); | |
55 extern int ekbd(void); | |
56 extern int ecanread(ulong); | |
57 extern int ecanmouse(void); | |
58 extern int ecankbd(void); | |
59 extern void eresized(int); /* supplied by user */ | |
60 extern int emenuhit(int, Mouse*, Menu*); | |
61 extern int eatomouse(Mouse*, char*, int); | |
62 extern Rectangle getrect(int, Mouse*); | |
63 struct Cursor; | |
64 struct Cursor2; | |
65 extern void esetcursor(struct Cursor*); | |
66 extern void esetcursor2(struct Cursor*, struct Cursor2*); | |
67 extern void emoveto(Point); | |
68 extern Rectangle egetrect(int, Mouse*); | |
69 extern void edrawgetrect(Rectangle, int); | |
70 extern int ereadmouse(Mouse*); | |
71 extern int eatomouse(Mouse*, char*, int); | |
72 | |
73 #if defined(__cplusplus) | |
74 } | |
75 #endif | |
76 #endif |