8 #define GL_GLEXT_PROTOTYPES
15 #include <X11/extensions/xf86vmode.h>
20 #define SYM_TYPE_NONE 0x00
21 #define SYM_TYPE_MOUSE 0x01
22 #define SYM_TYPE_KEY 0x02
23 #define SYM_TYPE_SKEY 0x03
24 #define SYM_TYPE_MOD 0x04
26 #define EVENT_NONE 0x00
27 #define EVENT_BUTTON_DOWN 0x01
28 #define EVENT_BUTTON_UP 0x02
29 #define EVENT_KEY_DOWN 0x03
30 #define EVENT_KEY_UP 0x04
31 #define EVENT_MOUSE_MOTION 0x05
33 #define MOUSE_BUTTON_LEFT 0x00
34 #define MOUSE_BUTTON_RIGHT 0x01
35 #define MOUSE_BUTTON_CENTRE 0x02
36 #define MOUSE_BUTTON_UP 0x03
37 #define MOUSE_BUTTON_DOWN 0x04
38 #define MOUSE_MOTION 0x05
40 #define SYM_MOD_CTRL 0x01
41 #define SYM_MOD_ALT 0x02
42 #define SYM_MOD_SHIFT 0x04
43 #define SYM_MOD_SUPER 0x08
45 #define SYM_KEY_SPACE 0x01
46 #define SYM_KEY_ESCAPE 0x02
47 #define SYM_KEY_TAB 0x03
48 #define SYM_KEY_KP0 0x04
49 #define SYM_KEY_KP1 0x05
50 #define SYM_KEY_KP2 0x06
51 #define SYM_KEY_KP3 0x07
52 #define SYM_KEY_KP4 0x08
53 #define SYM_KEY_KP5 0x09
54 #define SYM_KEY_KP6 0x0A
55 #define SYM_KEY_KP7 0x0B
56 #define SYM_KEY_KP8 0x0C
57 #define SYM_KEY_KP9 0x0D
58 #define SYM_KEY_UP 0x0E
59 #define SYM_KEY_DOWN 0x0F
60 #define SYM_KEY_LEFT 0x10
61 #define SYM_KEY_RIGHT 0x11
62 #define SYM_KEY_F1 0x12
63 #define SYM_KEY_F2 0x13
64 #define SYM_KEY_F3 0x14
65 #define SYM_KEY_F4 0x15
66 #define SYM_KEY_F5 0x16
67 #define SYM_KEY_F6 0x17
68 #define SYM_KEY_F7 0x18
69 #define SYM_KEY_F8 0x19
70 #define SYM_KEY_F9 0x1A
71 #define SYM_KEY_F10 0x1B
72 #define SYM_KEY_F11 0x1C
73 #define SYM_KEY_F12 0x1D
74 #define SYM_KEY_BCKSPC 0x1E
75 #define SYM_KEY_DELETE 0x1F
76 #define SYM_KEY_ENTER 0x20
77 #define SYM_KEY_RETURN SYM_KEY_ENTER
78 #define SYM_KEY_KPEQ 0x21
79 #define SYM_KEY_KPMUL 0x22
80 #define SYM_KEY_KPADD 0x23
81 #define SYM_KEY_KPSUB 0x24
82 #define SYM_KEY_KPDOT 0x25
83 #define SYM_KEY_KPDIV 0x26
85 #ifndef _HAVE_CURSOR_TYPE
86 #define _HAVE_CURSOR_TYPE
88 typedef struct cursor_s
{
89 struct material_s
*mat
;
122 XSetWindowAttributes attr
;
124 XF86VidModeModeInfo deskMode
;
125 XF86VidModeModeInfo
**modes
;
141 #ifndef _HAVE_CAMERA_TYPE
142 #define _HAVE_CAMERA_TYPE
143 typedef struct camera_s
{
152 #ifndef _HAVE_SYM_TYPE
153 #define _HAVE_SYM_TYPE
154 typedef struct sym_s
{
161 #ifndef _HAVE_BIND_TYPE
162 #define _HAVE_BIND_TYPE
163 typedef struct bind_s
{
170 #ifndef _HAVE_EVENT_TYPE
171 #define _HAVE_EVENT_TYPE
172 typedef struct event_s
{
182 #ifndef _HAVE_ACTION_TYPE
183 #define _HAVE_ACTION_TYPE
184 typedef struct action_s
{
185 struct action_s
*prev
;
186 struct action_s
*next
;
190 void (*func
)(event_t
*e
);
191 void (*r_func
)(event_t
*e
);
192 void (*a_func
)(event_t
*e
);
197 /* defined in wm.c */
200 /* defined in wm.c */
201 void wm_capture(char* file
);
203 /* defined in wm_x11.c and wm_w32.c */
209 void wm_destroy(void);
210 void wm_toggle_fullscreen(int fs
);
211 void wm_cursor(char* file
, int width
, int height
, int offset_x
, int offset_y
);
213 void wm_ungrab(void);
214 void wm_title(char* title
);
216 /* defined in camera.c */
217 void camera_view_matrix(matrix_t
*mat
);
218 camera_t
*camera_get(void);
219 void camera_set_pos(v3_t
*p
);
220 void camera_set_yaw(GLfloat yaw
);
221 void camera_set_pitch(GLfloat pitch
);
223 /* defined in kmap.c */
224 int kmap_strtobind(bind_t
*bind
, char* str
);
225 int kmap_bindtostr(char* str
, int size
, bind_t
*bind
);
226 int kmap_equal(bind_t
*b1
, bind_t
*b2
);
227 int kmap_triggers(bind_t
*eb
, bind_t
*ab
);
229 /* defined in events.c */
230 int events_init(void);
231 void events_exit(void);
232 void events_set_mousegrab(uint8_t g
);
233 uint8_t events_get_mousegrab(void);
234 void events_get_mouse(int p
[2]);
235 void event_set_bind(char* name
, char* value
);
236 void event_set_func(char* name
, void (*func
)(event_t
*e
));
237 void event_set_r_func(char* name
, void (*func
)(event_t
*e
));
238 void event_set_a_func(char* name
, void (*func
)(event_t
*e
));
239 void event_set_com(char* name
, char* com
);
240 void event_remove(char* name
);
241 void event_create(char* name
, char* bind
, char* com
, void (*func
)(event_t
*e
), void (*r_func
)(event_t
*e
), void (*a_func
)(event_t
*e
));
242 void events_trigger_active(void);
243 void events_handle(event_t
*e
);
245 /* defined in wm_x11.c and wm_w32.c */
246 void events_main(void);
250 /* defined in wm.c and dummy.c */
251 int wm_width_setter(char* value
);
252 int wm_height_setter(char* value
);
253 int wm_cap_setter(char* value
);
254 int wm_fullscreen_setter(char* value
);
256 /* defined in opengl.c and dummy.c */
257 int opengl_anisotropic_setter(char* value
);
258 int opengl_bilinear_setter(char* value
);
259 int opengl_trilinear_setter(char* value
);
260 int opengl_mipmap_setter(char* value
);
261 int opengl_particles_setter(char* value
);
262 int opengl_particles_max_setter(char* value
);
263 int opengl_bumpmap_setter(char* value
);
265 /* defined in events.c and dummy.c */
266 void events_save(file_t
*f
);
267 int event_bind(array_t
*a
);
269 /* defined in ui.c and dummy.c */
270 int ui_scale_setter(char* value
);
271 int ui_autoscale_setter(char* value
);