Debian Codegraph @

clutter/x11/clutter-stage-x11.h

raw
1 /* Clutter.
2 * An OpenGL based 'interactive canvas' library.
3 * Authored By Matthew Allum <[email protected]>
4 * Copyright (C) 2006-2007 OpenedHand
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 *
19 *
20 */
21
22 #ifndef __CLUTTER_STAGE_X11_H__
23 #define __CLUTTER_STAGE_X11_H__
24
25 #include <clutter/clutter-group.h>
26 #include <clutter/clutter-stage.h>
27 #include <X11/Xlib.h>
28 #include <X11/Xatom.h>
29
30 #include "clutter-backend-x11.h"
31 #include "cogl/clutter-stage-cogl.h"
32
33 G_BEGIN_DECLS
34
35 #define CLUTTER_TYPE_STAGE_X11 (_clutter_stage_x11_get_type ())
36 #define CLUTTER_STAGE_X11(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_X11, ClutterStageX11))
37 #define CLUTTER_IS_STAGE_X11(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_X11))
38 #define CLUTTER_STAGE_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STAGE_X11, ClutterStageX11Class))
39 #define CLUTTER_IS_STAGE_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STAGE_X11))
40 #define CLUTTER_STAGE_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STAGE_X11, ClutterStageX11Class))
41
42 typedef struct _ClutterStageX11 ClutterStageX11;
43 typedef struct _ClutterStageX11Class ClutterStageX11Class;
44
45 typedef enum
46 {
47 STAGE_X11_WITHDRAWN = 1 << 1
48 } ClutterStageX11State;
49
50 struct _ClutterStageX11
51 {
52 ClutterStageCogl parent_instance;
53
54 Window xwin;
55 gint xwin_width;
56 gint xwin_height; /* FIXME target_width / height */
57
58 gchar *title;
59
60 guint clipped_redraws_cool_off;
61
62 ClutterStageX11State wm_state;
63
64 int scale_factor;
65
66 guint is_foreign_xwin : 1;
67 guint fullscreening : 1;
68 guint is_cursor_visible : 1;
69 guint viewport_initialized : 1;
70 guint accept_focus : 1;
71 guint fullscreen_on_realize : 1;
72 };
73
74 struct _ClutterStageX11Class
75 {
76 ClutterStageCoglClass parent_class;
77 };
78
79 #define CLUTTER_STAGE_X11_EVENT_MASK \
80 StructureNotifyMask | \
81 FocusChangeMask | \
82 ExposureMask | \
83 PropertyChangeMask | \
84 EnterWindowMask | \
85 LeaveWindowMask | \
86 KeyPressMask | \
87 KeyReleaseMask | \
88 ButtonPressMask | \
89 ButtonReleaseMask | \
90 PointerMotionMask
91
92 GType _clutter_stage_x11_get_type (void) G_GNUC_CONST;
93
94 void _clutter_stage_x11_update_foreign_event_mask (CoglOnscreen *onscreen,
95 guint32 event_mask,
96 void *user_data);
97 void _clutter_stage_x11_events_device_changed (ClutterStageX11 *stage_x11,
98 ClutterInputDevice *device,
99 ClutterDeviceManager *device_manager);
100
101 /* Private to subclasses */
102 void _clutter_stage_x11_set_user_time (ClutterStageX11 *stage_x11,
103 guint32 user_time);
104 gboolean _clutter_stage_x11_get_root_coords (ClutterStageX11 *stage_x11,
105 gint *root_x,
106 gint *root_y);
107
108 G_END_DECLS
109
110 #endif /* __CLUTTER_STAGE_H__ */