1 #ifndef _XWIN_H_
2 #define _XWIN_H_
3 
4 
5 #define ES_SHIFT	0x01
6 #define ES_ALT		0x02
7 #define ES_CONTROL	0x04
8 
9 typedef enum {
10   ev_none,
11   ev_keypress,
12   ev_buttondown,
13   ev_buttonup,
14   ev_motion,
15   ev_resize,
16   ev_expose,
17   ev_quit
18 } XWin_Event_Type;
19 
20 typedef struct {
21   XWin_Event_Type type;
22   int x, y, w, h;
23   int button;
24   int shifts; /* button, key only */
25   int key;
26   int time; /* milliseconds.  button, motion only */
27 } XWin_Event;
28 
29 /* sets display_width, display_height, table_width/height to preferred */
30 int xwin_init (int argc, char **argv);
31 /* sets table_width, table_height to actual */
32 void xwin_create (int width, int height);
33 int xwin_nextevent (XWin_Event *event);
34 
35 void xwin_fixed_size (int width, int height);
36 void xwin_clip (int x, int y, int w, int h);
37 void xwin_noclip ();
38 int pixel_for (int r, int g, int b);
39 
40 #endif
41