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-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.
23  */
24 
25 /*
26  * GTK+ DirectFB backend
27  * Copyright (C) 2001-2002  convergence integrated media GmbH
28  * Copyright (C) 2002       convergence GmbH
29  * Written by Denis Oliver Kropp <dok@convergence.de> and
30  *            Sven Neumann <sven@convergence.de>
31  */
32 
33 #ifndef __GDK_INPUT_DIRECTFB_H__
34 #define __GDK_INPUT_DIRECTFB_H__
35 
36 extern GdkModifierType _gdk_directfb_modifiers;
37 extern int _gdk_directfb_mouse_x, _gdk_directfb_mouse_y;
38 
39 typedef struct _GdkAxisInfo      GdkAxisInfo;
40 
41 /* information about a device axis */
42 struct _GdkAxisInfo
43 {
44   /* reported x resolution */
45   gint xresolution;
46 
47   /* reported x minimum/maximum values */
48   gint xmin_value, xmax_value;
49 
50   /* calibrated resolution (for aspect ration) - only relative values
51      between axes used */
52   gint resolution;
53 
54   /* calibrated minimum/maximum values */
55   gint min_value, max_value;
56 };
57 
58 #define GDK_INPUT_NUM_EVENTC 6
59 
60 struct _GdkDeviceClass
61 {
62   GObjectClass parent_class;
63 };
64 
65 struct _GdkInputWindow
66 {
67   /* gdk window */
68   GdkWindow *window;
69 
70   /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
71   GdkExtensionMode mode;
72 
73   /* position relative to root window */
74   gint root_x;
75   gint root_y;
76 
77   /* rectangles relative to window of windows obscuring this one */
78   GdkRectangle *obscuring;
79   gint num_obscuring;
80 
81   /* Is there a pointer grab for this window ? */
82   gint grabbed;
83 };
84 
85 /* Global data */
86 
87 #define GDK_IS_CORE(d) (((GdkDevice *)(d)) == _gdk_core_pointer)
88 
89 extern GList *_gdk_input_devices;
90 extern GList *_gdk_input_windows;
91 
92 extern gint   _gdk_input_ignore_core;
93 
94 /* Function declarations */
95 
96 /* The following functions are provided by each implementation
97  */
98 gint             _gdk_input_window_none_event(GdkEvent          *event,
99                                               gchar             *msg);
100 void             _gdk_input_configure_event  (GdkEventConfigure *event,
101                                               GdkWindow         *window);
102 void             _gdk_input_enter_event      (GdkEventCrossing  *event,
103                                               GdkWindow         *window);
104 gint             _gdk_input_other_event      (GdkEvent          *event,
105                                               gchar             *msg,
106                                               GdkWindow         *window);
107 
108 /* These should be in gdkinternals.h */
109 
110 GdkInputWindow  * gdk_input_window_find      (GdkWindow         *window);
111 
112 void              gdk_input_window_destroy   (GdkWindow         *window);
113 
114 gint             _gdk_input_enable_window    (GdkWindow         *window,
115                                               GdkDevice         *gdkdev);
116 gint             _gdk_input_disable_window   (GdkWindow         *window,
117                                               GdkDevice         *gdkdev);
118 gint             _gdk_input_grab_pointer     (GdkWindow         *window,
119                                               gint               owner_events,
120                                               GdkEventMask       event_mask,
121                                               GdkWindow         *confine_to,
122                                               guint32            time);
123 void             _gdk_input_ungrab_pointer   (guint32            time);
124 gboolean         _gdk_device_get_history     (GdkDevice         *device,
125                                               GdkWindow         *window,
126                                               guint32            start,
127                                               guint32            stop,
128                                               GdkTimeCoord    ***events,
129                                               gint              *n_events);
130 
131 gint             gdk_input_common_init        (gint              include_core);
132 gint             gdk_input_common_other_event (GdkEvent         *event,
133                                                gchar            *msg,
134                                                GdkInputWindow   *input_window,
135                                                GdkWindow        *window);
136 
137 void         _gdk_directfb_keyboard_init      (void);
138 void         _gdk_directfb_keyboard_exit      (void);
139 
140 void         gdk_directfb_translate_key_event (DFBWindowEvent   *dfb_event,
141                                                GdkEventKey      *event);
142 
143 #endif /* __GDK_INPUT_DIRECTFB_H__ */
144