]> Pileus Git - ~andy/gtk/blob - gdk/win32/gdkinput.h
This is an implementation of Idea #13 from
[~andy/gtk] / gdk / win32 / gdkinput.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_H__
28 #define __GDK_INPUT_H__
29
30 typedef struct _GdkAxisInfo    GdkAxisInfo;
31 typedef struct _GdkInputVTable GdkInputVTable;
32 typedef struct _GdkDevicePrivate GdkDevicePrivate;
33 typedef struct _GdkInputWindow GdkInputWindow;
34
35 struct _GdkInputVTable {
36   gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
37   void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
38   void (*set_key)  (guint32 deviceid,
39                     guint   index,
40                     guint   keyval,
41                     GdkModifierType modifiers);
42         
43   GdkTimeCoord* (*motion_events) (GdkWindow *window,
44                                   guint32 deviceid,
45                                   guint32 start,
46                                   guint32 stop,
47                                   gint *nevents_return);
48   void (*get_pointer)   (GdkWindow       *window,
49                          guint32          deviceid,
50                          gdouble         *x,
51                          gdouble         *y,
52                          gdouble         *pressure,
53                          gdouble         *xtilt,
54                          gdouble         *ytilt,
55                          GdkModifierType *mask);
56   gint (*grab_pointer) (GdkWindow *     window,
57                         gint            owner_events,
58                         GdkEventMask    event_mask,
59                         GdkWindow *     confine_to,
60                         guint32         time);
61   void (*ungrab_pointer) (guint32 time);
62
63   void (*configure_event) (GdkEventConfigure *event, GdkWindow *window);
64   void (*enter_event) (GdkEventCrossing *event, GdkWindow *window);
65   gint (*other_event) (GdkEvent *event, MSG *xevent);
66   gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
67   gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
68 };
69
70 /* information about a device axis */
71 struct _GdkAxisInfo
72 {
73   /* reported x resolution */
74   gint xresolution;
75
76   /* reported x minimum/maximum values */
77   gint xmin_value, xmax_value;
78
79   /* calibrated resolution (for aspect ration) - only relative values
80      between axes used */
81   gint resolution;
82   
83   /* calibrated minimum/maximum values */
84   gint min_value, max_value;
85 };
86
87 struct _GdkInputWindow
88 {
89   /* gdk window */
90   GdkWindow *window;
91
92   /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
93   GdkExtensionMode mode;
94
95   /* position relative to root window */
96   gint16 root_x;
97   gint16 root_y;
98
99   /* rectangles relative to window of windows obscuring this one */
100   GdkRectangle *obscuring;
101   gint num_obscuring;
102
103   /* Is there a pointer grab for this window ? */
104   gint grabbed;
105 };
106
107 /* Global data */
108
109 extern GdkInputVTable gdk_input_vtable;
110 extern gint             gdk_input_ignore_core;
111 extern gint             gdk_input_ignore_wintab;
112
113 /* Function declarations */
114
115 void gdk_input_window_destroy (GdkWindow *window);
116
117 #endif /* __GDK_INPUT_H__ */