]> Pileus Git - ~andy/gtk/blob - gdk/linux-fb/gdkinputprivate.h
applied patch from Andreas Persenius <ndap@swipnet.se> that updates the
[~andy/gtk] / gdk / linux-fb / gdkinputprivate.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 Lesser 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser 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-2000.  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_INPUTPRIVATE_H__
28 #define __GDK_INPUTPRIVATE_H__
29
30 #include "config.h"
31 #include "gdkinput.h"
32 #include "gdkevents.h"
33 #include "gdkfb.h"
34
35 typedef struct _GdkAxisInfo    GdkAxisInfo;
36 typedef struct _GdkInputVTable GdkInputVTable;
37 typedef struct _GdkDevicePrivate GdkDevicePrivate;
38 typedef struct _GdkInputWindow GdkInputWindow;
39
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,
44                     guint   index,
45                     guint   keyval,
46                     GdkModifierType modifiers);
47         
48   GdkTimeCoord* (*motion_events) (GdkWindow *window,
49                                   guint32 deviceid,
50                                   guint32 start,
51                                   guint32 stop,
52                                   gint *nevents_return);
53   void (*get_pointer)   (GdkWindow       *window,
54                          guint32          deviceid,
55                          gdouble         *x,
56                          gdouble         *y,
57                          gdouble         *pressure,
58                          gdouble         *xtilt,
59                          gdouble         *ytilt,
60                          GdkModifierType *mask);
61   gint (*grab_pointer) (GdkWindow *     window,
62                         gint            owner_events,
63                         GdkEventMask    event_mask,
64                         GdkWindow *     confine_to,
65                         guint32         time);
66   void (*ungrab_pointer) (guint32 time);
67
68   void (*configure_event) (GdkEventConfigure *event, GdkWindow *window);
69   void (*enter_event) (GdkEventCrossing *event, GdkWindow *window);
70   gint (*other_event) (GdkEvent *event, GdkWindow *window);
71   /* Handle an unidentified event. Returns TRUE if handled, FALSE
72      otherwise */
73   gint (*window_none_event) (GdkEvent *event);
74   gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
75   gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
76 };
77
78 /* information about a device axis */
79 struct _GdkAxisInfo
80 {
81   /* reported x resolution */
82   gint xresolution;
83
84   /* reported x minimum/maximum values */
85   gint xmin_value, xmax_value;
86
87   /* calibrated resolution (for aspect ration) - only relative values
88      between axes used */
89   gint resolution;
90   
91   /* calibrated minimum/maximum values */
92   gint min_value, max_value;
93 };
94
95 #define GDK_INPUT_NUM_EVENTC 6
96
97 struct _GdkDevicePrivate {
98   GdkDevice  info;
99 };
100
101 struct _GdkInputWindow
102 {
103   /* gdk window */
104   GdkWindow *window;
105
106   /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
107   GdkExtensionMode mode;
108
109   /* position relative to root window */
110   gint root_x;
111   gint root_y;
112
113   /* rectangles relative to window of windows obscuring this one */
114   GdkRectangle *obscuring;
115   gint num_obscuring;
116
117   /* Is there a pointer grab for this window ? */
118   gint grabbed;
119 };
120
121 /* Global data */
122
123 extern const GdkDevice gdk_input_core_info;
124 extern GList *gdk_input_devices;
125 extern GList *gdk_input_windows;
126
127 extern GdkInputVTable gdk_input_vtable;
128 /* information about network port and host for gxid daemon */
129 extern gchar           *gdk_input_gxid_host;
130 extern gint             gdk_input_gxid_port;
131 extern gint             gdk_input_ignore_core;
132
133 /* Function declarations */
134
135 GdkDevicePrivate * gdk_input_find_device    (guint32           id);
136 GdkInputWindow *   gdk_input_window_find    (GdkWindow        *window);
137 void               gdk_input_window_destroy (GdkWindow        *window);
138 void               gdk_input_init           (void);
139 void               gdk_input_exit           (void);
140 gint               gdk_input_enable_window  (GdkWindow        *window,
141                                              GdkDevicePrivate *gdkdev);
142 gint               gdk_input_disable_window (GdkWindow        *window,
143                                              GdkDevicePrivate *gdkdev);
144
145 GdkDevicePrivate *gdk_input_find_device (guint32 id);
146 GdkInputWindow *gdk_input_window_find (GdkWindow *window);
147 void gdk_input_window_destroy (GdkWindow *window);
148 void gdk_input_exit           (void);
149
150 #endif /* __GDK_INPUTPRIVATE_H__ */