Debian Codegraph @

gdk/win32/gdkinput-win32.h

raw
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 #include <windows.h>
31 #include <wintab.h>
32
33 typedef struct _GdkAxisInfo GdkAxisInfo;
34 typedef struct _GdkDevicePrivate GdkDevicePrivate;
35
36 /* information about a device axis */
37 struct _GdkAxisInfo
38 {
39 /* calibrated resolution (for aspect ratio) - only relative values
40 between axes used */
41 gint resolution;
42
43 /* calibrated minimum/maximum values */
44 gint min_value, max_value;
45 };
46
47 struct _GdkDeviceClass
48 {
49 GObjectClass parent_class;
50 };
51
52 struct _GdkDevicePrivate
53 {
54 GdkDevice info;
55
56 /* information about the axes */
57 GdkAxisInfo *axes;
58
59 gint button_state;
60
61 gint *last_axis_data;
62
63 /* WINTAB stuff: */
64 HCTX hctx;
65 /* Cursor number */
66 UINT cursor;
67 /* The cursor's CSR_PKTDATA */
68 WTPKT pktdata;
69 /* Azimuth and altitude axis */
70 AXIS orientation_axes[2];
71 };
72
73 /* Addition used for extension_events mask */
74 #define GDK_ALL_DEVICES_MASK (1<<30)
75
76 struct _GdkInputWindow
77 {
78 /* gdk window */
79 GList *windows; /* GdkWindow:s with extension_events set */
80
81 GdkWindow *impl_window; /* an impl window */
82
83 /* position relative to root window */
84 gint root_x;
85 gint root_y;
86 };
87
88 /* Global data */
89
90 #define GDK_IS_CORE(d) (((GdkDevice *)(d)) == gdk_display_get_default ()->core_pointer)
91
92 extern GList *_gdk_input_devices;
93 extern GList *_gdk_input_windows;
94
95 extern gboolean _gdk_input_in_proximity;
96
97 /* Function declarations */
98 void _gdk_init_input_core (GdkDisplay *display);
99
100 GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
101 gint n_events);
102
103 /* The following functions are provided by each implementation
104 * (just wintab for now)
105 */
106 void _gdk_input_configure_event (GdkWindow *window);
107 gboolean _gdk_input_other_event (GdkEvent *event,
108 MSG *msg,
109 GdkWindow *window);
110
111 void _gdk_input_crossing_event (GdkWindow *window,
112 gboolean enter);
113
114
115 /* These should be in gdkinternals.h */
116
117 GdkInputWindow *_gdk_input_window_find (GdkWindow *window);
118
119 void _gdk_input_window_destroy (GdkWindow *window);
120
121 void _gdk_input_select_events (GdkWindow *impl_window);
122 gint _gdk_input_grab_pointer (GdkWindow *window,
123 gint owner_events,
124 GdkEventMask event_mask,
125 GdkWindow *confine_to,
126 guint32 time);
127 void _gdk_input_ungrab_pointer (guint32 time);
128 gboolean _gdk_device_get_history (GdkDevice *device,
129 GdkWindow *window,
130 guint32 start,
131 guint32 stop,
132 GdkTimeCoord ***events,
133 gint *n_events);
134
135 void _gdk_input_wintab_init_check (void);
136 void _gdk_input_set_tablet_active (void);
137 void _gdk_input_update_for_device_mode (GdkDevicePrivate *gdkdev);
138 void _gdk_input_check_proximity (void);
139
140 #endif /* __GDK_INPUT_WIN32_H__ */