]> Pileus Git - ~andy/gtk/blob - gdk/broadway/gdkdisplay-broadway.h
Change FSF Address
[~andy/gtk] / gdk / broadway / gdkdisplay-broadway.h
1 /*
2  * gdkdisplay-broadway.h
3  * 
4  * Copyright 2001 Sun Microsystems Inc. 
5  *
6  * Erwann Chenede <erwann.chenede@sun.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20  */
21
22 #ifndef __GDK_BROADWAY_DISPLAY__
23 #define __GDK_BROADWAY_DISPLAY__
24
25 #include "gdkdisplayprivate.h"
26 #include "gdkkeys.h"
27 #include "gdkwindow.h"
28 #include "gdkinternals.h"
29 #include "gdkmain.h"
30 #include "broadway.h"
31
32 G_BEGIN_DECLS
33
34 typedef struct _GdkBroadwayDisplay GdkBroadwayDisplay;
35 typedef struct _GdkBroadwayDisplayClass GdkBroadwayDisplayClass;
36
37 typedef struct BroadwayInput BroadwayInput;
38
39 #define GDK_TYPE_BROADWAY_DISPLAY              (gdk_broadway_display_get_type())
40 #define GDK_BROADWAY_DISPLAY(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplay))
41 #define GDK_BROADWAY_DISPLAY_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplayClass))
42 #define GDK_IS_BROADWAY_DISPLAY(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_DISPLAY))
43 #define GDK_IS_BROADWAY_DISPLAY_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_DISPLAY))
44 #define GDK_BROADWAY_DISPLAY_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplayClass))
45
46 typedef struct {
47   char type;
48   guint32 serial;
49   guint64 time;
50 } BroadwayInputBaseMsg;
51
52 typedef struct {
53   BroadwayInputBaseMsg base;
54   guint32 mouse_window_id; /* The real window, not taking grabs into account */
55   guint32 event_window_id;
56   int root_x;
57   int root_y;
58   int win_x;
59   int win_y;
60   guint32 state;
61 } BroadwayInputPointerMsg;
62
63 typedef struct {
64   BroadwayInputPointerMsg pointer;
65   guint32 mode;
66 } BroadwayInputCrossingMsg;
67
68 typedef struct {
69   BroadwayInputPointerMsg pointer;
70   guint32 button;
71 } BroadwayInputButtonMsg;
72
73 typedef struct {
74   BroadwayInputPointerMsg pointer;
75   int dir;
76 } BroadwayInputScrollMsg;
77
78 typedef struct {
79   BroadwayInputBaseMsg base;
80   guint32 state;
81   int key;
82 } BroadwayInputKeyMsg;
83
84 typedef struct {
85   BroadwayInputBaseMsg base;
86   int res;
87 } BroadwayInputGrabReply;
88
89 typedef struct {
90   BroadwayInputBaseMsg base;
91   int id;
92   int x;
93   int y;
94   int width;
95   int height;
96 } BroadwayInputConfigureNotify;
97
98 typedef struct {
99   BroadwayInputBaseMsg base;
100   int width;
101   int height;
102 } BroadwayInputScreenResizeNotify;
103
104 typedef struct {
105   BroadwayInputBaseMsg base;
106   int id;
107 } BroadwayInputDeleteNotify;
108
109 typedef union {
110   BroadwayInputBaseMsg base;
111   BroadwayInputPointerMsg pointer;
112   BroadwayInputCrossingMsg crossing;
113   BroadwayInputButtonMsg button;
114   BroadwayInputScrollMsg scroll;
115   BroadwayInputKeyMsg key;
116   BroadwayInputGrabReply grab_reply;
117   BroadwayInputConfigureNotify configure_notify;
118   BroadwayInputDeleteNotify delete_notify;
119   BroadwayInputScreenResizeNotify screen_resize_notify;
120 } BroadwayInputMsg;
121
122 struct _GdkBroadwayDisplay
123 {
124   GdkDisplay parent_instance;
125   GdkScreen *default_screen;
126   GdkScreen **screens;
127
128   GHashTable *id_ht;
129   GList *toplevels;
130
131   GSource *event_source;
132   GdkWindow *mouse_in_toplevel;
133   int last_x, last_y; /* in root coords */
134   guint32 last_state;
135   GdkWindow *real_mouse_in_toplevel; /* Not affected by grabs */
136
137   /* Keyboard related information */
138   GdkKeymap *keymap;
139
140   /* drag and drop information */
141   GdkDragContext *current_dest_drag;
142
143   /* Input device */
144   /* input GdkDevice list */
145   GList *input_devices;
146
147   /* The offscreen window that has the pointer in it (if any) */
148   GdkWindow *active_offscreen_window;
149
150   GSocketService *service;
151   BroadwayOutput *output;
152   guint32 saved_serial;
153   guint64 last_seen_time;
154   BroadwayInput *input;
155   GList *input_messages;
156   guint process_input_idle;
157
158   /* Explicit pointer grabs: */
159   GdkWindow *pointer_grab_window;
160   guint32 pointer_grab_time;
161   gboolean pointer_grab_owner_events;
162
163   /* Future data, from the currently queued events */
164   int future_root_x;
165   int future_root_y;
166   GdkModifierType future_state;
167   int future_mouse_in_toplevel;
168 };
169
170 struct _GdkBroadwayDisplayClass
171 {
172   GdkDisplayClass parent_class;
173 };
174
175 GType      gdk_broadway_display_get_type            (void);
176
177 G_END_DECLS
178
179 #endif                          /* __GDK_BROADWAY_DISPLAY__ */