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 Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef __GDK_INPUT_H__
20 #define __GDK_INPUT_H__
23 #include <X11/extensions/XInput.h>
26 typedef struct _GdkAxisInfo GdkAxisInfo;
27 typedef struct _GdkInputVTable GdkInputVTable;
28 typedef struct _GdkDevicePrivate GdkDevicePrivate;
29 typedef struct _GdkInputWindow GdkInputWindow;
31 struct _GdkInputVTable {
32 gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
33 void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
34 GdkTimeCoord* (*motion_events) (GdkWindow *window,
38 gint *nevents_return);
39 void (*get_pointer) (GdkWindow *window,
46 GdkModifierType *mask);
47 gint (*grab_pointer) (GdkWindow * window,
49 GdkEventMask event_mask,
50 GdkWindow * confine_to,
52 void (*ungrab_pointer) (guint32 time);
54 void (*configure_event) (XConfigureEvent *xevent, GdkWindow *window);
55 void (*enter_event) (XCrossingEvent *xevent, GdkWindow *window);
56 gint (*other_event) (GdkEvent *event, XEvent *xevent, GdkWindow *window);
57 /* Handle an unidentified event. Returns TRUE if handled, FALSE
59 gint (*window_none_event) (GdkEvent *event, XEvent *xevent);
60 gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
61 gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
64 /* information about a device axis */
67 /* reported x resolution */
70 /* reported x minimum/maximum values */
71 gint xmin_value, xmax_value;
73 /* calibrated resolution (for aspect ration) - only relative values
77 /* calibrated minimum/maximum values */
78 gint min_value, max_value;
81 #define GDK_INPUT_NUM_EVENTC 6
83 struct _GdkDevicePrivate {
87 /* information about the axes */
90 /* reverse lookup on axis use type */
91 gint axis_for_use[GDK_AXIS_LAST];
93 /* Information about XInput device */
96 int buttonpress_type, buttonrelease_type, motionnotify_type,
97 proximityin_type, proximityout_type, changenotify_type;
99 /* true if we need to select a different set of events, but
100 can't because this is the core pointer */
103 /* Mask of buttons (used for button grabs) */
106 /* true if we've claimed the device as active. (used only for XINPUT_GXI) */
108 #endif /* !XINPUT_NONE */
111 struct _GdkInputWindow
116 /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
117 GdkExtensionMode mode;
119 /* position relative to root window */
123 /* rectangles relative to window of windows obscuring this one */
124 GdkRectangle *obscuring;
127 /* Is there a pointer grab for this window ? */
133 extern GdkInputVTable gdk_input_vtable;
134 /* information about network port and host for gxid daemon */
135 extern gchar *gdk_input_gxid_host;
136 extern gint gdk_input_gxid_port;
137 extern gint gdk_input_ignore_core;
139 /* Function declarations */
141 void gdk_input_window_destroy (GdkWindow *window);
143 #endif __GDK_INPUT_H__