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, see <http://www.gnu.org/licenses/>.
18 #ifndef __GDK_DEVICE_PRIVATE_H__
19 #define __GDK_DEVICE_PRIVATE_H__
21 #include "gdkdevice.h"
22 #include "gdkdevicemanager.h"
23 #include "gdkevents.h"
27 #define GDK_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE, GdkDeviceClass))
28 #define GDK_IS_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE))
29 #define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
31 typedef struct _GdkDeviceClass GdkDeviceClass;
32 typedef struct _GdkDeviceKey GdkDeviceKey;
37 GdkModifierType modifiers;
42 GObject parent_instance;
45 GdkInputSource source;
50 GdkDeviceManager *manager;
52 /* Paired master for master,
53 * associated master for slaves
55 GdkDevice *associated;
61 struct _GdkDeviceClass
63 GObjectClass parent_class;
65 gboolean (* get_history) (GdkDevice *device,
69 GdkTimeCoord ***events,
72 void (* get_state) (GdkDevice *device,
75 GdkModifierType *mask);
77 void (* set_window_cursor) (GdkDevice *device,
81 void (* warp) (GdkDevice *device,
85 void (* query_state) (GdkDevice *device,
87 GdkWindow **root_window,
88 GdkWindow **child_window,
93 GdkModifierType *mask);
94 GdkGrabStatus (* grab) (GdkDevice *device,
96 gboolean owner_events,
97 GdkEventMask event_mask,
98 GdkWindow *confine_to,
101 void (*ungrab) (GdkDevice *device,
104 GdkWindow * (* window_at_position) (GdkDevice *device,
107 GdkModifierType *mask,
108 gboolean get_toplevel);
109 void (* select_window_events) (GdkDevice *device,
111 GdkEventMask event_mask);
114 void _gdk_device_set_associated_device (GdkDevice *device,
115 GdkDevice *relative);
117 void _gdk_device_reset_axes (GdkDevice *device);
118 guint _gdk_device_add_axis (GdkDevice *device,
124 void _gdk_device_get_axis_info (GdkDevice *device,
130 gdouble *resolution);
132 void _gdk_device_set_keys (GdkDevice *device,
135 gboolean _gdk_device_translate_window_coord (GdkDevice *device,
139 gdouble *axis_value);
141 gboolean _gdk_device_translate_screen_coord (GdkDevice *device,
147 gdouble *axis_value);
149 gboolean _gdk_device_translate_axis (GdkDevice *device,
152 gdouble *axis_value);
154 GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
157 void _gdk_device_add_slave (GdkDevice *device,
159 void _gdk_device_remove_slave (GdkDevice *device,
161 void _gdk_device_query_state (GdkDevice *device,
163 GdkWindow **root_window,
164 GdkWindow **child_window,
169 GdkModifierType *mask);
170 GdkWindow * _gdk_device_window_at_position (GdkDevice *device,
173 GdkModifierType *mask,
174 gboolean get_toplevel);
178 #endif /* __GDK_DEVICE_PRIVATE_H__ */