1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #ifndef __GDK_INPUT_H__
28 #define __GDK_INPUT_H__
30 #include <gdk/gdktypes.h>
34 #define GDK_TYPE_DEVICE (gdk_device_get_type ())
35 #define GDK_DEVICE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DEVICE, GdkDevice))
36 #define GDK_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DEVICE, GdkDeviceClass))
37 #define GDK_IS_DEVICE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DEVICE))
38 #define GDK_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DEVICE))
39 #define GDK_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DEVICE, GdkDeviceClass))
41 typedef struct _GdkDeviceKey GdkDeviceKey;
42 typedef struct _GdkDeviceAxis GdkDeviceAxis;
43 typedef struct _GdkDevice GdkDevice;
44 typedef struct _GdkDeviceClass GdkDeviceClass;
45 typedef struct _GdkTimeCoord GdkTimeCoord;
49 GDK_EXTENSION_EVENTS_NONE,
50 GDK_EXTENSION_EVENTS_ALL,
51 GDK_EXTENSION_EVENTS_CURSOR
84 GdkModifierType modifiers;
96 GObject parent_instance;
97 /* All fields are read-only */
100 GdkInputSource source;
102 gboolean has_cursor; /* TRUE if the X pointer follows device motion */
111 /* We don't allocate each coordinate this big, but we use it to
112 * be ANSI compliant and avoid accessing past the defined limits.
114 #define GDK_MAX_TIMECOORD_AXES 128
119 gdouble axes[GDK_MAX_TIMECOORD_AXES];
122 GType gdk_device_get_type (void) G_GNUC_CONST;
124 #ifndef GDK_MULTIHEAD_SAFE
125 /* Returns a list of GdkDevice * */
126 GList * gdk_devices_list (void);
127 #endif /* GDK_MULTIHEAD_SAFE */
129 /* Functions to configure a device */
130 void gdk_device_set_source (GdkDevice *device,
131 GdkInputSource source);
133 gboolean gdk_device_set_mode (GdkDevice *device,
136 void gdk_device_set_key (GdkDevice *device,
139 GdkModifierType modifiers);
141 void gdk_device_set_axis_use (GdkDevice *device,
144 void gdk_device_get_state (GdkDevice *device,
147 GdkModifierType *mask);
148 gboolean gdk_device_get_history (GdkDevice *device,
152 GdkTimeCoord ***events,
154 void gdk_device_free_history (GdkTimeCoord **events,
156 gboolean gdk_device_get_axis (GdkDevice *device,
161 void gdk_input_set_extension_events (GdkWindow *window,
163 GdkExtensionMode mode);
165 #ifndef GDK_MULTIHEAD_SAFE
166 GdkDevice *gdk_device_get_core_pointer (void);
171 #endif /* __GDK_INPUT_H__ */