]> git.decadent.org.uk Git - ion3.git/blob - ioncore/event.h
b81edf1d38e507704de0d2e3812214c8bb813e79
[ion3.git] / ioncore / event.h
1 /*
2  * ion/ioncore/event.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2007. 
5  *
6  * Ion is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  */
11
12 #ifndef ION_IONCORE_EVENT_H
13 #define ION_IONCORE_EVENT_H
14
15 #include <libmainloop/hooks.h>
16 #include "common.h"
17 #include "region.h"
18
19 #define IONCORE_EVENTMASK_PTRGRAB (ButtonPressMask|ButtonReleaseMask| \
20                                    ButtonMotionMask)
21
22 #define IONCORE_EVENTMASK_PTRLOOP (IONCORE_EVENTMASK_PTRGRAB|ExposureMask| \
23                                    KeyPressMask|KeyReleaseMask|            \
24                                    EnterWindowMask|FocusChangeMask)
25
26 #define IONCORE_EVENTMASK_NORMAL (ExposureMask|KeyPressMask|         \
27                                   ButtonPressMask|ButtonReleaseMask| \
28                                   FocusChangeMask|EnterWindowMask)
29
30 #define IONCORE_EVENTMASK_CWINMGR (IONCORE_EVENTMASK_NORMAL| \
31                                    SubstructureRedirectMask)
32
33 #define IONCORE_EVENTMASK_ROOT (IONCORE_EVENTMASK_CWINMGR| \
34                                 PropertyChangeMask|ColormapChangeMask)
35
36 #define IONCORE_EVENTMASK_CLIENTWIN (ColormapChangeMask|                  \
37                                      PropertyChangeMask|FocusChangeMask|  \
38                                      StructureNotifyMask|EnterWindowMask)
39
40 #define IONCORE_EVENTMASK_SCREEN (FocusChangeMask|EnterWindowMask|   \
41                                   KeyPressMask|KeyReleaseMask|       \
42                                   ButtonPressMask|ButtonReleaseMask)
43
44 extern void ioncore_x_connection_handler(int conn, void *unused);
45 extern void ioncore_flush();
46 extern void ioncore_get_event(XEvent *ev, long mask);
47
48 extern void ioncore_update_timestamp(XEvent *ev);
49 extern Time ioncore_get_timestamp();
50
51 /* Handlers to this hook should take XEvent* as parameter. */
52 extern WHook *ioncore_handle_event_alt;
53
54 extern void ioncore_mainloop();
55
56 #endif /* ION_IONCORE_EVENT_H */