]> Pileus Git - ~andy/gtk/blob - gdk/gdkdeviceprivate.h
Remove remaining single-include guards
[~andy/gtk] / gdk / gdkdeviceprivate.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
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 #ifndef __GDK_DEVICE_PRIVATE_H__
21 #define __GDK_DEVICE_PRIVATE_H__
22
23 #include <gdk/gdkdevice.h>
24 #include <gdk/gdkevents.h>
25
26 G_BEGIN_DECLS
27
28 #define GDK_DEVICE_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE, GdkDeviceClass))
29 #define GDK_IS_DEVICE_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE))
30 #define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
31
32 typedef struct _GdkDeviceClass GdkDeviceClass;
33
34 struct _GdkDeviceClass
35 {
36   GObjectClass parent_class;
37
38   gboolean (* get_history) (GdkDevice      *device,
39                             GdkWindow      *window,
40                             guint32         start,
41                             guint32         stop,
42                             GdkTimeCoord ***events,
43                             guint          *n_events);
44
45   void (* get_state) (GdkDevice       *device,
46                       GdkWindow       *window,
47                       gdouble         *axes,
48                       GdkModifierType *mask);
49
50   void (* set_window_cursor) (GdkDevice *device,
51                               GdkWindow *window,
52                               GdkCursor *cursor);
53
54   void (* warp)              (GdkDevice  *device,
55                               GdkScreen  *screen,
56                               gint        x,
57                               gint        y);
58   gboolean (* query_state)   (GdkDevice        *device,
59                               GdkWindow        *window,
60                               GdkWindow       **root_window,
61                               GdkWindow       **child_window,
62                               gint             *root_x,
63                               gint             *root_y,
64                               gint             *win_x,
65                               gint             *win_y,
66                               GdkModifierType  *mask);
67   GdkGrabStatus (* grab)     (GdkDevice        *device,
68                               GdkWindow        *window,
69                               gboolean          owner_events,
70                               GdkEventMask      event_mask,
71                               GdkWindow        *confine_to,
72                               GdkCursor        *cursor,
73                               guint32           time_);
74   void          (*ungrab)    (GdkDevice        *device,
75                               guint32           time_);
76
77   GdkWindow * (* window_at_position) (GdkDevice       *device,
78                                       gint            *win_x,
79                                       gint            *win_y,
80                                       GdkModifierType *mask,
81                                       gboolean         get_toplevel);
82   void (* select_window_events)      (GdkDevice       *device,
83                                       GdkWindow       *window,
84                                       GdkEventMask     event_mask);
85 };
86
87 void  _gdk_device_set_associated_device (GdkDevice *device,
88                                          GdkDevice *relative);
89
90 void  _gdk_device_reset_axes (GdkDevice   *device);
91 guint _gdk_device_add_axis   (GdkDevice   *device,
92                               GdkAtom      label_atom,
93                               GdkAxisUse   use,
94                               gdouble      min_value,
95                               gdouble      max_value,
96                               gdouble      resolution);
97
98 void _gdk_device_set_keys    (GdkDevice   *device,
99                               guint        num_keys);
100
101 GdkAxisUse _gdk_device_get_axis_use (GdkDevice *device,
102                                      guint      index);
103
104 gboolean   _gdk_device_translate_window_coord (GdkDevice *device,
105                                                GdkWindow *window,
106                                                guint      index,
107                                                gdouble    value,
108                                                gdouble   *axis_value);
109
110 gboolean   _gdk_device_translate_screen_coord (GdkDevice *device,
111                                                GdkWindow *window,
112                                                gint       window_root_x,
113                                                gint       window_root_y,
114                                                guint      index,
115                                                gdouble    value,
116                                                gdouble   *axis_value);
117
118 gboolean   _gdk_device_translate_axis         (GdkDevice *device,
119                                                guint      index,
120                                                gdouble    value,
121                                                gdouble   *axis_value);
122
123 GdkTimeCoord ** _gdk_device_allocate_history  (GdkDevice *device,
124                                                guint      n_events);
125
126 void _gdk_input_check_extension_events (GdkDevice *device);
127
128
129 G_END_DECLS
130
131 #endif /* __GDK_DEVICE_PRIVATE_H__ */