1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
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.
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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GDK_DEVICE_PRIVATE_H__
21 #define __GDK_DEVICE_PRIVATE_H__
23 #include "gdkdevice.h"
24 #include "gdkdevicemanager.h"
25 #include "gdkevents.h"
29 #define GDK_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE, GdkDeviceClass))
30 #define GDK_IS_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE))
31 #define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
33 typedef struct _GdkDeviceKey GdkDeviceKey;
38 GdkModifierType modifiers;
43 GObject parent_instance;
46 GdkInputSource source;
51 GdkDeviceManager *manager;
53 /* Paired master for master,
54 * associated master for slaves
56 GdkDevice *associated;
62 struct _GdkDeviceClass
64 GObjectClass parent_class;
66 gboolean (* get_history) (GdkDevice *device,
70 GdkTimeCoord ***events,
73 void (* get_state) (GdkDevice *device,
76 GdkModifierType *mask);
78 void (* set_window_cursor) (GdkDevice *device,
82 void (* warp) (GdkDevice *device,
86 gboolean (* query_state) (GdkDevice *device,
88 GdkWindow **root_window,
89 GdkWindow **child_window,
94 GdkModifierType *mask);
95 GdkGrabStatus (* grab) (GdkDevice *device,
97 gboolean owner_events,
98 GdkEventMask event_mask,
99 GdkWindow *confine_to,
102 void (*ungrab) (GdkDevice *device,
105 GdkWindow * (* window_at_position) (GdkDevice *device,
108 GdkModifierType *mask,
109 gboolean get_toplevel);
110 void (* select_window_events) (GdkDevice *device,
112 GdkEventMask event_mask);
115 void _gdk_device_set_associated_device (GdkDevice *device,
116 GdkDevice *relative);
118 void _gdk_device_reset_axes (GdkDevice *device);
119 guint _gdk_device_add_axis (GdkDevice *device,
126 void _gdk_device_set_keys (GdkDevice *device,
129 GdkAxisUse _gdk_device_get_axis_use (GdkDevice *device,
132 gboolean _gdk_device_translate_window_coord (GdkDevice *device,
136 gdouble *axis_value);
138 gboolean _gdk_device_translate_screen_coord (GdkDevice *device,
144 gdouble *axis_value);
146 gboolean _gdk_device_translate_axis (GdkDevice *device,
149 gdouble *axis_value);
151 GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
154 void _gdk_device_add_slave (GdkDevice *device,
156 void _gdk_device_remove_slave (GdkDevice *device,
158 gboolean _gdk_device_query_state (GdkDevice *device,
160 GdkWindow **root_window,
161 GdkWindow **child_window,
166 GdkModifierType *mask);
167 GdkWindow * _gdk_device_window_at_position (GdkDevice *device,
170 GdkModifierType *mask,
171 gboolean get_toplevel);
175 #endif /* __GDK_DEVICE_PRIVATE_H__ */