]> Pileus Git - ~andy/gtk/blob - gdk/win32/gdkinput-win32.h
Include the build directory.
[~andy/gtk] / gdk / win32 / gdkinput-win32.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 /*
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/. 
25  */
26
27 #ifndef __GDK_INPUT_WIN32_H__
28 #define __GDK_INPUT_WIN32_H__
29
30 #ifdef HAVE_WINTAB
31 #include <wintab.h>
32 #endif
33
34 typedef struct _GdkAxisInfo    GdkAxisInfo;
35 typedef struct _GdkDevicePrivate GdkDevicePrivate;
36 typedef struct _GdkInputWindow GdkInputWindow;
37
38 /* information about a device axis */
39 struct _GdkAxisInfo
40 {
41   /* reported x resolution */
42   gint xresolution;
43
44   /* reported x minimum/maximum values */
45   gint xmin_value, xmax_value;
46
47   /* calibrated resolution (for aspect ration) - only relative values
48      between axes used */
49   gint resolution;
50   
51   /* calibrated minimum/maximum values */
52   gint min_value, max_value;
53 };
54
55 #define GDK_INPUT_NUM_EVENTC 6
56
57 struct _GdkDevicePrivate
58 {
59   GdkDevice info;
60
61   /* information about the axes */
62   GdkAxisInfo *axes;
63
64   /* minimum key code for device */
65   gint min_keycode;            
66
67   int buttonpress_type, buttonrelease_type, keypress_type,
68       keyrelease_type, motionnotify_type, proximityin_type, 
69       proximityout_type, changenotify_type;
70
71   /* true if we need to select a different set of events, but
72      can't because this is the core pointer */
73   gint needs_update;
74
75   /* Mask of buttons (used for button grabs) */
76   gint button_state;
77
78   /* true if we've claimed the device as active. (used only for XINPUT_GXI) */
79   gint claimed;
80
81   gint *last_axis_data;
82   gint last_buttons;
83 #ifdef HAVE_WINTAB
84   /* WINTAB stuff: */
85   HCTX hctx;
86   /* Cursor number */
87   UINT cursor;
88   /* The cursor's CSR_PKTDATA */
89   WTPKT pktdata;
90   /* CSR_NPBTNMARKS */
91   UINT npbtnmarks[2];
92   /* Azimuth and altitude axis */
93   AXIS orientation_axes[2];
94 #endif
95 };
96
97 struct _GdkInputWindow
98 {
99   /* gdk window */
100   GdkWindow *window;
101
102   /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
103   GdkExtensionMode mode;
104
105   /* position relative to root window */
106   gint root_x;
107   gint root_y;
108
109   /* rectangles relative to window of windows obscuring this one */
110   GdkRectangle *obscuring;
111   gint num_obscuring;
112
113   /* Is there a pointer grab for this window ? */
114   gint grabbed;
115 };
116
117 /* Global data */
118
119 #define GDK_IS_CORE(d) (((GdkDevice *)(d)) == gdk_core_pointer)
120
121 extern GList *gdk_input_devices;
122 extern GList *gdk_input_windows;
123
124 extern gint   gdk_input_ignore_core;
125
126 extern GdkDevice gdk_input_core_info;
127
128 /* Function declarations */
129
130 void gdk_input_window_destroy (GdkWindow *window);
131 GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
132                                               gint       n_events);
133
134 /* The following functions are provided by each implementation
135  * (just wintab for now)
136  */
137 gint             _gdk_input_window_none_event(GdkEvent         *event,
138                                               MSG              *msg);
139 void             _gdk_input_configure_event  (GdkEventConfigure *event,
140                                               GdkWindow         *window);
141 void             _gdk_input_enter_event      (GdkEventCrossing  *event,
142                                               GdkWindow         *window);
143 gint             _gdk_input_other_event      (GdkEvent         *event,
144                                               MSG              *msg,
145                                               GdkWindow        *window);
146
147 /* These should be in gdkinternals.h */
148
149 GdkInputWindow   *gdk_input_window_find      (GdkWindow        *window);
150
151 gint             _gdk_input_enable_window     (GdkWindow        *window,
152                                               GdkDevicePrivate *gdkdev);
153 gint             _gdk_input_disable_window    (GdkWindow        *window,
154                                               GdkDevicePrivate *gdkdev);
155 gint             _gdk_input_grab_pointer     (GdkWindow        *window,
156                                               gint              owner_events,
157                                               GdkEventMask      event_mask,
158                                               GdkWindow        *confine_to,
159                                               guint32           time);
160 void             _gdk_input_ungrab_pointer   (guint32           time);
161 gboolean         _gdk_device_get_history     (GdkDevice         *device,
162                                               GdkWindow         *window,
163                                               guint32            start,
164                                               guint32            stop,
165                                               GdkTimeCoord    ***events,
166                                               gint              *n_events);
167
168
169 #define GDK_MAX_DEVICE_CLASSES 13
170
171 gint             gdk_input_common_init        (gint              include_core);
172 gint             gdk_input_common_other_event (GdkEvent          *event,
173                                                MSG               *msg,
174                                                GdkInputWindow    *input_window,
175                                                GdkWindow         *window);
176
177 #endif /* __GDK_INPUT_WIN32_H__ */