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 Library 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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library 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-1999. 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__
31 #include <X11/extensions/XInput.h>
34 typedef struct _GdkAxisInfo GdkAxisInfo;
35 typedef struct _GdkInputVTable GdkInputVTable;
36 typedef struct _GdkDevicePrivate GdkDevicePrivate;
37 typedef struct _GdkInputWindow GdkInputWindow;
39 struct _GdkInputVTable {
40 gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
41 void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
42 void (*set_key) (guint32 deviceid,
45 GdkModifierType modifiers);
47 GdkTimeCoord* (*motion_events) (GdkWindow *window,
51 gint *nevents_return);
52 void (*get_pointer) (GdkWindow *window,
59 GdkModifierType *mask);
60 gint (*grab_pointer) (GdkWindow * window,
62 GdkEventMask event_mask,
63 GdkWindow * confine_to,
65 void (*ungrab_pointer) (guint32 time);
67 void (*configure_event) (XConfigureEvent *xevent, GdkWindow *window);
68 void (*enter_event) (XCrossingEvent *xevent, GdkWindow *window);
69 gint (*other_event) (GdkEvent *event, XEvent *xevent, GdkWindow *window);
70 /* Handle an unidentified event. Returns TRUE if handled, FALSE
72 gint (*window_none_event) (GdkEvent *event, XEvent *xevent);
73 gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
74 gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
77 /* information about a device axis */
80 /* reported x resolution */
83 /* reported x minimum/maximum values */
84 gint xmin_value, xmax_value;
86 /* calibrated resolution (for aspect ration) - only relative values
90 /* calibrated minimum/maximum values */
91 gint min_value, max_value;
94 #define GDK_INPUT_NUM_EVENTC 6
96 struct _GdkDevicePrivate {
100 /* information about the axes */
103 /* reverse lookup on axis use type */
104 gint axis_for_use[GDK_AXIS_LAST];
106 /* Information about XInput device */
109 /* minimum key code for device */
112 int buttonpress_type, buttonrelease_type, keypress_type,
113 keyrelease_type, motionnotify_type, proximityin_type,
114 proximityout_type, changenotify_type;
116 /* true if we need to select a different set of events, but
117 can't because this is the core pointer */
120 /* Mask of buttons (used for button grabs) */
123 /* true if we've claimed the device as active. (used only for XINPUT_GXI) */
125 #endif /* !XINPUT_NONE */
128 struct _GdkInputWindow
133 /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
134 GdkExtensionMode mode;
136 /* position relative to root window */
140 /* rectangles relative to window of windows obscuring this one */
141 GdkRectangle *obscuring;
144 /* Is there a pointer grab for this window ? */
150 extern GdkInputVTable gdk_input_vtable;
151 /* information about network port and host for gxid daemon */
152 extern gchar *gdk_input_gxid_host;
153 extern gint gdk_input_gxid_port;
154 extern gint gdk_input_ignore_core;
156 /* Function declarations */
158 void gdk_input_window_destroy (GdkWindow *window);
160 #endif /* __GDK_INPUT_H__ */