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