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 #include "gdkinternals.h" 24 25 #include <X11/Xlib.h> 26 27 G_BEGIN_DECLS 28 29 #define GDK_TYPE_EVENT_TRANSLATOR (_gdk_x11_event_translator_get_type ()) 30 #define GDK_EVENT_TRANSLATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_EVENT_TRANSLATOR, GdkEventTranslator)) 31 #define GDK_IS_EVENT_TRANSLATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_EVENT_TRANSLATOR)) 32 #define GDK_EVENT_TRANSLATOR_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDK_TYPE_EVENT_TRANSLATOR, GdkEventTranslatorIface)) 33 34 typedef struct _GdkEventTranslatorIface GdkEventTranslatorIface; 35 typedef struct _GdkEventTranslator GdkEventTranslator; /* Dummy typedef */ 36 37 struct _GdkEventTranslatorIface 38 { 39 GTypeInterface iface; 40 41 /* VMethods */ 42 GdkEvent * (* translate_event) (GdkEventTranslator *translator, 43 GdkDisplay *display, 44 const XEvent *xevent); 45 46 GdkEventMask (* get_handled_events) (GdkEventTranslator *translator); 47 void (* select_surface_events) (GdkEventTranslator *translator, 48 Window window, 49 GdkEventMask event_mask); 50 GdkSurface * (* get_surface) (GdkEventTranslator *translator, 51 const 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 const XEvent *xevent); 59 GdkEventMask _gdk_x11_event_translator_get_handled_events (GdkEventTranslator *translator); 60 void _gdk_x11_event_translator_select_surface_events (GdkEventTranslator *translator, 61 Window window, 62 GdkEventMask event_mask); 63 GdkSurface * _gdk_x11_event_translator_get_surface (GdkEventTranslator *translator, 64 GdkDisplay *display, 65 const XEvent *xevent); 66 67 G_END_DECLS 68 69 #endif /* __GDK_EVENT_TRANSLATOR_H__ */ 70