Debian Codegraph @

gdk/x11/gdkeventtranslator.h

raw
1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 2009 Carlos Garnacho <[email protected]>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef __GDK_EVENT_TRANSLATOR_H__
19 #define __GDK_EVENT_TRANSLATOR_H__
20
21 #include "gdktypes.h"
22 #include "gdkdisplay.h"
23
24 #include <X11/Xlib.h>
25
26 G_BEGIN_DECLS
27
28 #define GDK_TYPE_EVENT_TRANSLATOR (_gdk_x11_event_translator_get_type ())
29 #define GDK_EVENT_TRANSLATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_EVENT_TRANSLATOR, GdkEventTranslator))
30 #define GDK_IS_EVENT_TRANSLATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_EVENT_TRANSLATOR))
31 #define GDK_EVENT_TRANSLATOR_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDK_TYPE_EVENT_TRANSLATOR, GdkEventTranslatorIface))
32
33 typedef struct _GdkEventTranslatorIface GdkEventTranslatorIface;
34 typedef struct _GdkEventTranslator GdkEventTranslator; /* Dummy typedef */
35
36 struct _GdkEventTranslatorIface
37 {
38 GTypeInterface iface;
39
40 /* VMethods */
41 gboolean (* translate_event) (GdkEventTranslator *translator,
42 GdkDisplay *display,
43 GdkEvent *event,
44 XEvent *xevent);
45
46 GdkEventMask (* get_handled_events) (GdkEventTranslator *translator);
47 void (* select_window_events) (GdkEventTranslator *translator,
48 Window window,
49 GdkEventMask event_mask);
50 GdkWindow * (* get_window) (GdkEventTranslator *translator,
51 XEvent *xevent);
52 };
53
54 GType _gdk_x11_event_translator_get_type (void) G_GNUC_CONST;
55
56 GdkEvent * _gdk_x11_event_translator_translate (GdkEventTranslator *translator,
57 GdkDisplay *display,
58 XEvent *xevent);
59 GdkEventMask _gdk_x11_event_translator_get_handled_events (GdkEventTranslator *translator);
60 void _gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator,
61 Window window,
62 GdkEventMask event_mask);
63 GdkWindow * _gdk_x11_event_translator_get_window (GdkEventTranslator *translator,
64 GdkDisplay *display,
65 XEvent *xevent);
66
67 G_END_DECLS
68
69 #endif /* __GDK_EVENT_TRANSLATOR_H__ */