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 #define PACKETDATA (PK_CONTEXT | PK_CURSOR | PK_BUTTONS | PK_X | PK_Y | PK_NORMAL_PRESSURE | PK_ORIENTATION)
32 #define PACKETMODE (PK_BUTTONS)
35 typedef struct _GdkAxisInfo GdkAxisInfo;
36 typedef struct _GdkInputVTable GdkInputVTable;
37 typedef struct _GdkDevicePrivate GdkDevicePrivate;
38 typedef struct _GdkInputWindow GdkInputWindow;
40 struct _GdkInputVTable {
41 gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
42 void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
43 void (*set_key) (guint32 deviceid,
46 GdkModifierType modifiers);
48 GdkTimeCoord* (*motion_events) (GdkWindow *window,
52 gint *nevents_return);
53 void (*get_pointer) (GdkWindow *window,
60 GdkModifierType *mask);
61 gint (*grab_pointer) (GdkWindow * window,
63 GdkEventMask event_mask,
64 GdkWindow * confine_to,
66 void (*ungrab_pointer) (guint32 time);
68 void (*configure_event) (GdkEventConfigure *event, GdkWindow *window);
69 void (*enter_event) (GdkEventCrossing *event, GdkWindow *window);
70 gint (*other_event) (GdkEvent *event, MSG *xevent);
71 gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
72 gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
75 /* information about a device axis */
78 /* reported x resolution */
81 /* reported x minimum/maximum values */
82 gint xmin_value, xmax_value;
84 /* calibrated resolution (for aspect ration) - only relative values
88 /* calibrated minimum/maximum values */
89 gint min_value, max_value;
92 #define GDK_INPUT_NUM_EVENTC 6
94 struct _GdkDevicePrivate {
97 /* information about the axes */
100 /* reverse lookup on axis use type */
101 gint axis_for_use[GDK_AXIS_LAST];
103 /* true if we need to select a different set of events, but
104 * can't because this is the core pointer
108 /* State of buttons */
111 gint *last_axis_data;
118 /* The cursor's CSR_PKTDATA */
122 /* Azimuth and altitude axis */
123 AXIS orientation_axes[2];
126 struct _GdkInputWindow
131 /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
132 GdkExtensionMode mode;
134 /* position relative to root window */
138 /* rectangles relative to window of windows obscuring this one */
139 GdkRectangle *obscuring;
142 /* Is there a pointer grab for this window ? */
148 extern GdkInputVTable gdk_input_vtable;
149 extern gint gdk_input_ignore_core;
150 extern gint gdk_input_ignore_wintab;
152 /* Function declarations */
154 void gdk_input_window_destroy (GdkWindow *window);
156 #endif /* __GDK_INPUT_H__ */