1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
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/.
27 #ifndef __GDK_INPUTPRIVATE_H__
28 #define __GDK_INPUTPRIVATE_H__
32 #include "gdkevents.h"
35 typedef struct _GdkAxisInfo GdkAxisInfo;
36 typedef struct _GdkInputVTable GdkInputVTable;
37 typedef struct _GdkDevicePrivate GdkDevicePrivate;
38 typedef struct _GdkInputWindow GdkInputWindow;
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,
46 GdkModifierType modifiers);
48 GdkTimeCoord* (*motion_events) (GdkWindow *window,
52 gint *nevents_return);
53 void (*get_pointer) (GdkWindow *window,
60 GdkModifierType *mask);
61 gint (*grab_pointer) (GdkWindow * window,
63 GdkEventMask event_mask,
64 GdkWindow * confine_to,
66 void (*ungrab_pointer) (guint32 time);
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
73 gint (*window_none_event) (GdkEvent *event);
74 gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
75 gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
78 /* information about a device axis */
81 /* reported x resolution */
84 /* reported x minimum/maximum values */
85 gint xmin_value, xmax_value;
87 /* calibrated resolution (for aspect ration) - only relative values
91 /* calibrated minimum/maximum values */
92 gint min_value, max_value;
95 #define GDK_INPUT_NUM_EVENTC 6
97 struct _GdkDevicePrivate {
101 struct _GdkInputWindow
106 /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
107 GdkExtensionMode mode;
109 /* position relative to root window */
113 /* rectangles relative to window of windows obscuring this one */
114 GdkRectangle *obscuring;
117 /* Is there a pointer grab for this window ? */
123 extern const GdkDevice gdk_input_core_info;
124 extern GList *gdk_input_devices;
125 extern GList *gdk_input_windows;
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;
133 /* Function declarations */
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);
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);
150 #endif /* __GDK_INPUTPRIVATE_H__ */