]> git.decadent.org.uk Git - ion3.git/blob - ioncore/event.h
3a810c43a35a9d3998630a0c9c05f70020407ffc
[ion3.git] / ioncore / event.h
1 /*
2  * ion/ioncore/event.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2008. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_IONCORE_EVENT_H
10 #define ION_IONCORE_EVENT_H
11
12 #include <libmainloop/hooks.h>
13 #include "common.h"
14 #include "region.h"
15
16 #define IONCORE_EVENTMASK_PTRGRAB (ButtonPressMask|ButtonReleaseMask| \
17                                    ButtonMotionMask)
18
19 #define IONCORE_EVENTMASK_PTRLOOP (IONCORE_EVENTMASK_PTRGRAB|ExposureMask| \
20                                    KeyPressMask|KeyReleaseMask|            \
21                                    EnterWindowMask|FocusChangeMask)
22
23 #define IONCORE_EVENTMASK_NORMAL (ExposureMask|KeyPressMask|         \
24                                   ButtonPressMask|ButtonReleaseMask| \
25                                   FocusChangeMask|EnterWindowMask)
26
27 #define IONCORE_EVENTMASK_CWINMGR (IONCORE_EVENTMASK_NORMAL| \
28                                    SubstructureRedirectMask)
29
30 #define IONCORE_EVENTMASK_ROOT (IONCORE_EVENTMASK_CWINMGR| \
31                                 PropertyChangeMask|ColormapChangeMask)
32
33 #define IONCORE_EVENTMASK_CLIENTWIN (ColormapChangeMask|                  \
34                                      PropertyChangeMask|FocusChangeMask|  \
35                                      StructureNotifyMask|EnterWindowMask)
36
37 #define IONCORE_EVENTMASK_SCREEN (FocusChangeMask|EnterWindowMask|   \
38                                   KeyPressMask|KeyReleaseMask|       \
39                                   ButtonPressMask|ButtonReleaseMask)
40
41 extern void ioncore_x_connection_handler(int conn, void *unused);
42 extern void ioncore_flush();
43 extern void ioncore_get_event(XEvent *ev, long mask);
44
45 extern void ioncore_update_timestamp(XEvent *ev);
46 extern Time ioncore_get_timestamp();
47
48 /* Handlers to this hook should take XEvent* as parameter. */
49 extern WHook *ioncore_handle_event_alt;
50
51 extern void ioncore_mainloop();
52
53 #endif /* ION_IONCORE_EVENT_H */