1/* GDK - The GIMP Drawing Kit
2 * Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
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 "gdk/gdkdeviceprivate.h"
25
26#include <X11/Xlib.h>
27
28G_BEGIN_DECLS
29
30#define GDK_TYPE_EVENT_TRANSLATOR (_gdk_x11_event_translator_get_type ())
31#define GDK_EVENT_TRANSLATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_EVENT_TRANSLATOR, GdkEventTranslator))
32#define GDK_IS_EVENT_TRANSLATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_EVENT_TRANSLATOR))
33#define GDK_EVENT_TRANSLATOR_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDK_TYPE_EVENT_TRANSLATOR, GdkEventTranslatorIface))
34
35typedef struct _GdkEventTranslatorIface GdkEventTranslatorIface;
36typedef struct _GdkEventTranslator GdkEventTranslator; /* Dummy typedef */
37
38struct _GdkEventTranslatorIface
39{
40 GTypeInterface iface;
41
42 /* VMethods */
43 GdkEvent * (* translate_event) (GdkEventTranslator *translator,
44 GdkDisplay *display,
45 const XEvent *xevent);
46
47 GdkEventMask (* get_handled_events) (GdkEventTranslator *translator);
48 void (* select_surface_events) (GdkEventTranslator *translator,
49 Window window,
50 GdkEventMask event_mask);
51 GdkSurface * (* get_surface) (GdkEventTranslator *translator,
52 const XEvent *xevent);
53};
54
55GType _gdk_x11_event_translator_get_type (void) G_GNUC_CONST;
56
57GdkEvent * _gdk_x11_event_translator_translate (GdkEventTranslator *translator,
58 GdkDisplay *display,
59 const XEvent *xevent);
60GdkEventMask _gdk_x11_event_translator_get_handled_events (GdkEventTranslator *translator);
61void _gdk_x11_event_translator_select_surface_events (GdkEventTranslator *translator,
62 Window window,
63 GdkEventMask event_mask);
64GdkSurface * _gdk_x11_event_translator_get_surface (GdkEventTranslator *translator,
65 GdkDisplay *display,
66 const XEvent *xevent);
67
68G_END_DECLS
69
70#endif /* __GDK_EVENT_TRANSLATOR_H__ */
71

source code of gtk/gdk/x11/gdkeventtranslator.h