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_INPUTPRIVATE_H__
28 #define __GDK_INPUTPRIVATE_H__
32 #include "gdkevents.h"
38 #include <X11/extensions/XInput.h>
42 typedef struct _GdkAxisInfo GdkAxisInfo;
43 typedef struct _GdkDevicePrivate GdkDevicePrivate;
44 typedef struct _GdkInputWindow GdkInputWindow;
46 /* information about a device axis */
49 /* reported x resolution */
52 /* reported x minimum/maximum values */
53 gint xmin_value, xmax_value;
55 /* calibrated resolution (for aspect ration) - only relative values
59 /* calibrated minimum/maximum values */
60 gint min_value, max_value;
63 #define GDK_INPUT_NUM_EVENTC 6
65 struct _GdkDevicePrivate
75 /* information about the axes */
78 /* Information about XInput device */
81 /* minimum key code for device */
84 int buttonpress_type, buttonrelease_type, keypress_type,
85 keyrelease_type, motionnotify_type, proximityin_type,
86 proximityout_type, changenotify_type;
88 /* true if we need to select a different set of events, but
89 can't because this is the core pointer */
92 /* Mask of buttons (used for button grabs) */
95 /* true if we've claimed the device as active. (used only for XINPUT_GXI) */
97 #endif /* !XINPUT_NONE */
100 struct _GdkDeviceClass
102 GObjectClass parent_class;
105 struct _GdkInputWindow
110 /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
111 GdkExtensionMode mode;
113 /* position relative to root window */
117 /* rectangles relative to window of windows obscuring this one */
118 GdkRectangle *obscuring;
121 /* Is there a pointer grab for this window ? */
129 #define GDK_IS_CORE(d) (((GdkDevice *)(d)) == ((GdkDevicePrivate *)(d))->display->core_pointer)
131 /* Function declarations */
133 GdkInputWindow *_gdk_input_window_find (GdkWindow *window);
134 void _gdk_input_window_destroy (GdkWindow *window);
135 GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
137 void _gdk_init_input_core (GdkDisplay *display);
139 /* The following functions are provided by each implementation
140 * (xfree, gxi, and none)
142 gint _gdk_input_enable_window (GdkWindow *window,
143 GdkDevicePrivate *gdkdev);
144 gint _gdk_input_disable_window (GdkWindow *window,
145 GdkDevicePrivate *gdkdev);
146 void _gdk_input_configure_event (XConfigureEvent *xevent,
148 void _gdk_input_enter_event (XCrossingEvent *xevent,
150 gboolean _gdk_input_other_event (GdkEvent *event,
153 gint _gdk_input_grab_pointer (GdkWindow *window,
155 GdkEventMask event_mask,
156 GdkWindow *confine_to,
158 void _gdk_input_ungrab_pointer (GdkDisplay *display,
160 gboolean _gdk_device_get_history (GdkDevice *device,
164 GdkTimeCoord ***events,
169 #define GDK_MAX_DEVICE_CLASSES 13
171 gint _gdk_input_common_init (GdkDisplay *display,
173 GdkDevicePrivate * _gdk_input_find_device (GdkDisplay *display,
175 void _gdk_input_get_root_relative_geometry(Display *display,
181 void _gdk_input_common_find_events (GdkWindow *window,
182 GdkDevicePrivate *gdkdev,
184 XEventClass *classes,
186 void _gdk_input_common_select_events (GdkWindow *window,
187 GdkDevicePrivate *gdkdev);
188 gint _gdk_input_common_other_event (GdkEvent *event,
190 GdkInputWindow *input_window,
191 GdkDevicePrivate *gdkdev);
193 #endif /* !XINPUT_NONE */
195 #endif /* __GDK_INPUTPRIVATE_H__ */