1 /* event.c : Glue to access fields in GdkEvent.
2  *
3  * Authors: Rachel Hestilow  <hestilow@ximian.com>
4  *          Mike Kestner  <mkestner@ximian.com>
5  *
6  * Copyright (c) 2002 Rachel Hestilow
7  * Copyright (c) 2002 Mike Kestner
8  * Copyright (c) 2004 Novell, Inc.
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of version 2 of the Lesser GNU General
12  * Public License as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this program; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24 
25 
26 #include <gdk/gdkevents.h>
27 
28 /* Forward declarations */
29 GdkEventType gtksharp_gdk_event_get_event_type (GdkEvent *event);
30 GdkWindow* gtksharp_gdk_event_get_window (GdkEventAny *event);
31 gint8 gtksharp_gdk_event_get_send_event (GdkEventAny *event);
32 guint32 gtksharp_gdk_event_key_get_time (GdkEventKey *event);
33 guint gtksharp_gdk_event_key_get_state (GdkEventKey *event);
34 guint gtksharp_gdk_event_key_get_keyval (GdkEventKey *event);
35 guint16 gtksharp_gdk_event_key_get_hardware_keycode (GdkEventKey *event);
36 guint8 gtksharp_gdk_event_key_get_group (GdkEventKey *event);
37 guint32 gtksharp_gdk_event_button_get_time (GdkEventButton *event);
38 guint gtksharp_gdk_event_button_get_state (GdkEventButton *event);
39 guint gtksharp_gdk_event_button_get_button (GdkEventButton *event);
40 gdouble gtksharp_gdk_event_button_get_x (GdkEventButton *event);
41 gdouble gtksharp_gdk_event_button_get_y (GdkEventButton *event);
42 gdouble gtksharp_gdk_event_button_get_x_root (GdkEventButton *event);
43 gdouble gtksharp_gdk_event_button_get_y_root (GdkEventButton *event);
44 gdouble* gtksharp_gdk_event_button_get_axes (GdkEventButton *event);
45 GdkDevice* gtksharp_gdk_event_button_get_device (GdkEventButton *event);
46 guint32 gtksharp_gdk_event_scroll_get_time (GdkEventScroll *event);
47 guint gtksharp_gdk_event_scroll_get_state (GdkEventScroll *event);
48 guint gtksharp_gdk_event_scroll_get_direction (GdkEventScroll *event);
49 gdouble gtksharp_gdk_event_scroll_get_x (GdkEventScroll *event);
50 gdouble gtksharp_gdk_event_scroll_get_y (GdkEventScroll *event);
51 gdouble gtksharp_gdk_event_scroll_get_x_root (GdkEventScroll *event);
52 gdouble gtksharp_gdk_event_scroll_get_y_root (GdkEventScroll *event);
53 GdkDevice* gtksharp_gdk_event_scroll_get_device (GdkEventScroll *event);
54 guint32 gtksharp_gdk_event_motion_get_time (GdkEventMotion *event);
55 guint gtksharp_gdk_event_motion_get_state (GdkEventMotion *event);
56 guint16 gtksharp_gdk_event_motion_get_is_hint (GdkEventMotion *event);
57 gdouble gtksharp_gdk_event_motion_get_x (GdkEventMotion *event);
58 gdouble gtksharp_gdk_event_motion_get_y (GdkEventMotion *event);
59 gdouble gtksharp_gdk_event_motion_get_x_root (GdkEventMotion *event);
60 gdouble gtksharp_gdk_event_motion_get_y_root (GdkEventMotion *event);
61 gdouble* gtksharp_gdk_event_motion_get_axes (GdkEventMotion *event);
62 GdkDevice* gtksharp_gdk_event_motion_get_device (GdkEventMotion *event);
63 GdkRectangle* gtksharp_gdk_event_expose_get_area (GdkEventExpose *event);
64 gint gtksharp_gdk_event_expose_get_count (GdkEventExpose *event);
65 GdkRegion* gtksharp_gdk_event_expose_get_region (GdkEventExpose *event);
66 GdkVisibilityState gtksharp_gdk_event_visibility_get_state (GdkEventVisibility *event);
67 guint32 gtksharp_gdk_event_crossing_get_time (GdkEventCrossing *event);
68 guint gtksharp_gdk_event_crossing_get_state (GdkEventCrossing *event);
69 gboolean gtksharp_gdk_event_crossing_get_focus (GdkEventCrossing *event);
70 gdouble gtksharp_gdk_event_crossing_get_x (GdkEventCrossing *event);
71 gdouble gtksharp_gdk_event_crossing_get_y (GdkEventCrossing *event);
72 gdouble gtksharp_gdk_event_crossing_get_x_root (GdkEventCrossing *event);
73 gdouble gtksharp_gdk_event_crossing_get_y_root (GdkEventCrossing *event);
74 GdkNotifyType gtksharp_gdk_event_crossing_get_detail (GdkEventCrossing *event);
75 GdkCrossingMode gtksharp_gdk_event_crossing_get_mode (GdkEventCrossing *event);
76 GdkWindow* gtksharp_gdk_event_crossing_get_subwindow (GdkEventCrossing *event);
77 gint16 gtksharp_gdk_event_focus_get_in (GdkEventFocus *event);
78 gint gtksharp_gdk_event_configure_get_x (GdkEventConfigure *event);
79 gint gtksharp_gdk_event_configure_get_y (GdkEventConfigure *event);
80 gint gtksharp_gdk_event_configure_get_width (GdkEventConfigure *event);
81 gint gtksharp_gdk_event_configure_get_height (GdkEventConfigure *event);
82 guint32 gtksharp_gdk_event_property_get_time (GdkEventProperty *event);
83 GdkAtom gtksharp_gdk_event_property_get_atom (GdkEventProperty *event);
84 guint gtksharp_gdk_event_property_get_state (GdkEventProperty *event);
85 GdkNativeWindow gtksharp_gdk_event_selection_get_requestor (GdkEventSelection *event);
86 GdkAtom gtksharp_gdk_event_selection_get_property (GdkEventSelection *event);
87 GdkAtom gtksharp_gdk_event_selection_get_selection (GdkEventSelection *event);
88 GdkAtom gtksharp_gdk_event_selection_get_target (GdkEventSelection *event);
89 guint32 gtksharp_gdk_event_selection_get_time (GdkEventSelection *event);
90 guint32 gtksharp_gdk_event_dnd_get_time (GdkEventDND *event);
91 gshort gtksharp_gdk_event_dnd_get_x_root (GdkEventDND *event);
92 gshort gtksharp_gdk_event_dnd_get_y_root (GdkEventDND *event);
93 GdkDragContext* gtksharp_gdk_event_dnd_get_context (GdkEventDND *event);
94 GdkDevice* gtksharp_gdk_event_proximity_get_device (GdkEventProximity *event);
95 guint32 gtksharp_gdk_event_proximity_get_time (GdkEventProximity *event);
96 GdkAtom gtksharp_gdk_event_client_get_message_type (GdkEventClient *event);
97 gushort gtksharp_gdk_event_client_get_data_format (GdkEventClient *event);
98 gpointer gtksharp_gdk_event_client_get_data (GdkEventClient *event);
99 GdkWindowState gtksharp_gdk_event_window_state_get_changed_mask (GdkEventWindowState *event);
100 GdkWindowState gtksharp_gdk_event_window_state_get_new_window_state (GdkEventWindowState *event);
101 GdkSettingAction gtksharp_gdk_event_setting_get_action (GdkEventSetting *event);
102 char* gtksharp_gdk_event_setting_get_name (GdkEventSetting *event);
103 /* */
104 
105 GdkEventType
gtksharp_gdk_event_get_event_type(GdkEvent * event)106 gtksharp_gdk_event_get_event_type (GdkEvent *event)
107 {
108 	return event->type;
109 }
110 
111 GdkWindow*
gtksharp_gdk_event_get_window(GdkEventAny * event)112 gtksharp_gdk_event_get_window (GdkEventAny *event)
113 {
114 	return event->window;
115 }
116 
117 gint8
gtksharp_gdk_event_get_send_event(GdkEventAny * event)118 gtksharp_gdk_event_get_send_event (GdkEventAny *event)
119 {
120 	return event->send_event;
121 }
122 
123 guint32
gtksharp_gdk_event_key_get_time(GdkEventKey * event)124 gtksharp_gdk_event_key_get_time (GdkEventKey *event)
125 {
126 	return event->time;
127 }
128 
129 guint
gtksharp_gdk_event_key_get_state(GdkEventKey * event)130 gtksharp_gdk_event_key_get_state (GdkEventKey *event)
131 {
132 	return event->state;
133 }
134 
135 guint
gtksharp_gdk_event_key_get_keyval(GdkEventKey * event)136 gtksharp_gdk_event_key_get_keyval (GdkEventKey *event)
137 {
138 	return event->keyval;
139 }
140 
141 guint16
gtksharp_gdk_event_key_get_hardware_keycode(GdkEventKey * event)142 gtksharp_gdk_event_key_get_hardware_keycode (GdkEventKey *event)
143 {
144 	return event->hardware_keycode;
145 }
146 
147 guint8
gtksharp_gdk_event_key_get_group(GdkEventKey * event)148 gtksharp_gdk_event_key_get_group (GdkEventKey *event)
149 {
150 	return event->group;
151 }
152 
153 guint32
gtksharp_gdk_event_button_get_time(GdkEventButton * event)154 gtksharp_gdk_event_button_get_time (GdkEventButton *event)
155 {
156 	return event->time;
157 }
158 
159 guint
gtksharp_gdk_event_button_get_state(GdkEventButton * event)160 gtksharp_gdk_event_button_get_state (GdkEventButton *event)
161 {
162 	return event->state;
163 }
164 
165 guint
gtksharp_gdk_event_button_get_button(GdkEventButton * event)166 gtksharp_gdk_event_button_get_button (GdkEventButton *event)
167 {
168 	return event->button;
169 }
170 
171 GdkDevice*
gtksharp_gdk_event_button_get_device(GdkEventButton * event)172 gtksharp_gdk_event_button_get_device (GdkEventButton *event)
173 {
174 	return event->device;
175 }
176 
177 gdouble
gtksharp_gdk_event_button_get_x(GdkEventButton * event)178 gtksharp_gdk_event_button_get_x (GdkEventButton *event)
179 {
180 	return event->x;
181 }
182 
183 gdouble
gtksharp_gdk_event_button_get_y(GdkEventButton * event)184 gtksharp_gdk_event_button_get_y (GdkEventButton *event)
185 {
186 	return event->y;
187 }
188 
189 gdouble
gtksharp_gdk_event_button_get_x_root(GdkEventButton * event)190 gtksharp_gdk_event_button_get_x_root (GdkEventButton *event)
191 {
192 	return event->x_root;
193 }
194 
195 gdouble
gtksharp_gdk_event_button_get_y_root(GdkEventButton * event)196 gtksharp_gdk_event_button_get_y_root (GdkEventButton *event)
197 {
198 	return event->y_root;
199 }
200 
201 gdouble*
gtksharp_gdk_event_button_get_axes(GdkEventButton * event)202 gtksharp_gdk_event_button_get_axes (GdkEventButton *event)
203 {
204 	return event->axes;
205 }
206 
207 guint32
gtksharp_gdk_event_scroll_get_time(GdkEventScroll * event)208 gtksharp_gdk_event_scroll_get_time (GdkEventScroll *event)
209 {
210 	return event->time;
211 }
212 
213 guint
gtksharp_gdk_event_scroll_get_state(GdkEventScroll * event)214 gtksharp_gdk_event_scroll_get_state (GdkEventScroll *event)
215 {
216 	return event->state;
217 }
218 
219 GdkScrollDirection
gtksharp_gdk_event_scroll_get_direction(GdkEventScroll * event)220 gtksharp_gdk_event_scroll_get_direction (GdkEventScroll *event)
221 {
222 	return event->direction;
223 }
224 
225 GdkDevice*
gtksharp_gdk_event_scroll_get_device(GdkEventScroll * event)226 gtksharp_gdk_event_scroll_get_device (GdkEventScroll *event)
227 {
228 	return event->device;
229 }
230 
231 gdouble
gtksharp_gdk_event_scroll_get_x(GdkEventScroll * event)232 gtksharp_gdk_event_scroll_get_x (GdkEventScroll *event)
233 {
234 	return event->x;
235 }
236 
237 gdouble
gtksharp_gdk_event_scroll_get_y(GdkEventScroll * event)238 gtksharp_gdk_event_scroll_get_y (GdkEventScroll *event)
239 {
240 	return event->y;
241 }
242 
243 gdouble
gtksharp_gdk_event_scroll_get_x_root(GdkEventScroll * event)244 gtksharp_gdk_event_scroll_get_x_root (GdkEventScroll *event)
245 {
246 	return event->x_root;
247 }
248 
249 gdouble
gtksharp_gdk_event_scroll_get_y_root(GdkEventScroll * event)250 gtksharp_gdk_event_scroll_get_y_root (GdkEventScroll *event)
251 {
252 	return event->y_root;
253 }
254 
255 guint32
gtksharp_gdk_event_motion_get_time(GdkEventMotion * event)256 gtksharp_gdk_event_motion_get_time (GdkEventMotion *event)
257 {
258 	return event->time;
259 }
260 
261 guint
gtksharp_gdk_event_motion_get_state(GdkEventMotion * event)262 gtksharp_gdk_event_motion_get_state (GdkEventMotion *event)
263 {
264 	return event->state;
265 }
266 
267 guint16
gtksharp_gdk_event_motion_get_is_hint(GdkEventMotion * event)268 gtksharp_gdk_event_motion_get_is_hint (GdkEventMotion *event)
269 {
270 	return event->is_hint;
271 }
272 
273 GdkDevice*
gtksharp_gdk_event_motion_get_device(GdkEventMotion * event)274 gtksharp_gdk_event_motion_get_device (GdkEventMotion *event)
275 {
276 	return event->device;
277 }
278 
279 gdouble
gtksharp_gdk_event_motion_get_x(GdkEventMotion * event)280 gtksharp_gdk_event_motion_get_x (GdkEventMotion *event)
281 {
282 	return event->x;
283 }
284 
285 gdouble
gtksharp_gdk_event_motion_get_y(GdkEventMotion * event)286 gtksharp_gdk_event_motion_get_y (GdkEventMotion *event)
287 {
288 	return event->y;
289 }
290 
291 gdouble
gtksharp_gdk_event_motion_get_x_root(GdkEventMotion * event)292 gtksharp_gdk_event_motion_get_x_root (GdkEventMotion *event)
293 {
294 	return event->x_root;
295 }
296 
297 gdouble
gtksharp_gdk_event_motion_get_y_root(GdkEventMotion * event)298 gtksharp_gdk_event_motion_get_y_root (GdkEventMotion *event)
299 {
300 	return event->y_root;
301 }
302 
303 gdouble*
gtksharp_gdk_event_motion_get_axes(GdkEventMotion * event)304 gtksharp_gdk_event_motion_get_axes (GdkEventMotion *event)
305 {
306 	return event->axes;
307 }
308 
309 GdkRectangle*
gtksharp_gdk_event_expose_get_area(GdkEventExpose * event)310 gtksharp_gdk_event_expose_get_area (GdkEventExpose *event)
311 {
312 	return &event->area;
313 }
314 
315 gint
gtksharp_gdk_event_expose_get_count(GdkEventExpose * event)316 gtksharp_gdk_event_expose_get_count (GdkEventExpose *event)
317 {
318 	return event->count;
319 }
320 
321 GdkRegion*
gtksharp_gdk_event_expose_get_region(GdkEventExpose * event)322 gtksharp_gdk_event_expose_get_region (GdkEventExpose *event)
323 {
324 	return event->region;
325 }
326 
327 GdkVisibilityState
gtksharp_gdk_event_visibility_get_state(GdkEventVisibility * event)328 gtksharp_gdk_event_visibility_get_state (GdkEventVisibility *event)
329 {
330 	return event->state;
331 }
332 
333 gdouble
gtksharp_gdk_event_crossing_get_x(GdkEventCrossing * event)334 gtksharp_gdk_event_crossing_get_x (GdkEventCrossing *event)
335 {
336 	return event->x;
337 }
338 
339 gdouble
gtksharp_gdk_event_crossing_get_y(GdkEventCrossing * event)340 gtksharp_gdk_event_crossing_get_y (GdkEventCrossing *event)
341 {
342 	return event->y;
343 }
344 
345 gdouble
gtksharp_gdk_event_crossing_get_x_root(GdkEventCrossing * event)346 gtksharp_gdk_event_crossing_get_x_root (GdkEventCrossing *event)
347 {
348 	return event->x_root;
349 }
350 
351 gdouble
gtksharp_gdk_event_crossing_get_y_root(GdkEventCrossing * event)352 gtksharp_gdk_event_crossing_get_y_root (GdkEventCrossing *event)
353 {
354 	return event->y_root;
355 }
356 
357 guint32
gtksharp_gdk_event_crossing_get_time(GdkEventCrossing * event)358 gtksharp_gdk_event_crossing_get_time (GdkEventCrossing *event)
359 {
360 	return event->time;
361 }
362 
363 guint
gtksharp_gdk_event_crossing_get_state(GdkEventCrossing * event)364 gtksharp_gdk_event_crossing_get_state (GdkEventCrossing *event)
365 {
366 	return event->state;
367 }
368 
369 gboolean
gtksharp_gdk_event_crossing_get_focus(GdkEventCrossing * event)370 gtksharp_gdk_event_crossing_get_focus (GdkEventCrossing *event)
371 {
372 	return event->focus;
373 }
374 
375 GdkWindow*
gtksharp_gdk_event_crossing_get_subwindow(GdkEventCrossing * event)376 gtksharp_gdk_event_crossing_get_subwindow (GdkEventCrossing *event)
377 {
378 	return event->subwindow;
379 }
380 
381 GdkCrossingMode
gtksharp_gdk_event_crossing_get_mode(GdkEventCrossing * event)382 gtksharp_gdk_event_crossing_get_mode (GdkEventCrossing *event)
383 {
384 	return event->mode;
385 }
386 
387 GdkNotifyType
gtksharp_gdk_event_crossing_get_detail(GdkEventCrossing * event)388 gtksharp_gdk_event_crossing_get_detail (GdkEventCrossing *event)
389 {
390 	return event->detail;
391 }
392 
393 gint16
gtksharp_gdk_event_focus_get_in(GdkEventFocus * event)394 gtksharp_gdk_event_focus_get_in (GdkEventFocus *event)
395 {
396 	return event->in;
397 }
398 
399 gint
gtksharp_gdk_event_configure_get_x(GdkEventConfigure * event)400 gtksharp_gdk_event_configure_get_x (GdkEventConfigure *event)
401 {
402 	return event->x;
403 }
404 
405 gint
gtksharp_gdk_event_configure_get_y(GdkEventConfigure * event)406 gtksharp_gdk_event_configure_get_y (GdkEventConfigure *event)
407 {
408 	return event->y;
409 }
410 
411 gint
gtksharp_gdk_event_configure_get_width(GdkEventConfigure * event)412 gtksharp_gdk_event_configure_get_width (GdkEventConfigure *event)
413 {
414 	return event->width;
415 }
416 
417 gint
gtksharp_gdk_event_configure_get_height(GdkEventConfigure * event)418 gtksharp_gdk_event_configure_get_height (GdkEventConfigure *event)
419 {
420 	return event->height;
421 }
422 
423 guint32
gtksharp_gdk_event_property_get_time(GdkEventProperty * event)424 gtksharp_gdk_event_property_get_time (GdkEventProperty *event)
425 {
426 	return event->time;
427 }
428 
429 GdkAtom
gtksharp_gdk_event_property_get_atom(GdkEventProperty * event)430 gtksharp_gdk_event_property_get_atom (GdkEventProperty *event)
431 {
432 	return event->atom;
433 }
434 
435 guint
gtksharp_gdk_event_property_get_state(GdkEventProperty * event)436 gtksharp_gdk_event_property_get_state (GdkEventProperty *event)
437 {
438 	return event->state;
439 }
440 
441 GdkNativeWindow
gtksharp_gdk_event_selection_get_requestor(GdkEventSelection * event)442 gtksharp_gdk_event_selection_get_requestor (GdkEventSelection *event)
443 {
444 	return event->requestor;
445 }
446 
447 GdkAtom
gtksharp_gdk_event_selection_get_property(GdkEventSelection * event)448 gtksharp_gdk_event_selection_get_property (GdkEventSelection *event)
449 {
450 	return event->property;
451 }
452 
453 GdkAtom
gtksharp_gdk_event_selection_get_selection(GdkEventSelection * event)454 gtksharp_gdk_event_selection_get_selection (GdkEventSelection *event)
455 {
456 	return event->selection;
457 }
458 
459 GdkAtom
gtksharp_gdk_event_selection_get_target(GdkEventSelection * event)460 gtksharp_gdk_event_selection_get_target (GdkEventSelection *event)
461 {
462 	return event->target;
463 }
464 
465 guint32
gtksharp_gdk_event_selection_get_time(GdkEventSelection * event)466 gtksharp_gdk_event_selection_get_time (GdkEventSelection *event)
467 {
468 	return event->time;
469 }
470 
471 GdkDragContext*
gtksharp_gdk_event_dnd_get_context(GdkEventDND * event)472 gtksharp_gdk_event_dnd_get_context (GdkEventDND *event)
473 {
474 	return event->context;
475 }
476 
477 gshort
gtksharp_gdk_event_dnd_get_x_root(GdkEventDND * event)478 gtksharp_gdk_event_dnd_get_x_root (GdkEventDND *event)
479 {
480 	return event->x_root;
481 }
482 
483 gshort
gtksharp_gdk_event_dnd_get_y_root(GdkEventDND * event)484 gtksharp_gdk_event_dnd_get_y_root (GdkEventDND *event)
485 {
486 	return event->y_root;
487 }
488 
489 guint32
gtksharp_gdk_event_dnd_get_time(GdkEventDND * event)490 gtksharp_gdk_event_dnd_get_time (GdkEventDND *event)
491 {
492 	return event->time;
493 }
494 
495 GdkDevice*
gtksharp_gdk_event_proximity_get_device(GdkEventProximity * event)496 gtksharp_gdk_event_proximity_get_device (GdkEventProximity *event)
497 {
498 	return event->device;
499 }
500 
501 guint32
gtksharp_gdk_event_proximity_get_time(GdkEventProximity * event)502 gtksharp_gdk_event_proximity_get_time (GdkEventProximity *event)
503 {
504 	return event->time;
505 }
506 
507 GdkAtom
gtksharp_gdk_event_client_get_message_type(GdkEventClient * event)508 gtksharp_gdk_event_client_get_message_type (GdkEventClient *event)
509 {
510 	return event->message_type;
511 }
512 
513 gushort
gtksharp_gdk_event_client_get_data_format(GdkEventClient * event)514 gtksharp_gdk_event_client_get_data_format (GdkEventClient *event)
515 {
516 	return event->data_format;
517 }
518 
519 gpointer
gtksharp_gdk_event_client_get_data(GdkEventClient * event)520 gtksharp_gdk_event_client_get_data (GdkEventClient *event)
521 {
522 	return &event->data;
523 }
524 
525 GdkWindowState
gtksharp_gdk_event_window_state_get_changed_mask(GdkEventWindowState * event)526 gtksharp_gdk_event_window_state_get_changed_mask (GdkEventWindowState *event)
527 {
528 	return event->changed_mask;
529 }
530 
531 GdkWindowState
gtksharp_gdk_event_window_state_get_new_window_state(GdkEventWindowState * event)532 gtksharp_gdk_event_window_state_get_new_window_state (GdkEventWindowState *event)
533 {
534 	return event->new_window_state;
535 }
536 
537 GdkSettingAction
gtksharp_gdk_event_setting_get_action(GdkEventSetting * event)538 gtksharp_gdk_event_setting_get_action (GdkEventSetting *event)
539 {
540 	return event->action;
541 }
542 
543 char*
gtksharp_gdk_event_setting_get_name(GdkEventSetting * event)544 gtksharp_gdk_event_setting_get_name (GdkEventSetting *event)
545 {
546 	return event->name;
547 }
548 
549