update to 1.10.4
[profile/ivi/clutter.git] / clutter / x11 / clutter-stage-x11.h
1 /* Clutter.
2  * An OpenGL based 'interactive canvas' library.
3  * Authored By Matthew Allum  <mallum@openedhand.com>
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   guint is_foreign_xwin       : 1;
65   guint fullscreening         : 1;
66   guint is_cursor_visible     : 1;
67   guint viewport_initialized  : 1;
68   guint accept_focus          : 1;
69   guint fullscreen_on_realize : 1;
70 };
71
72 struct _ClutterStageX11Class
73 {
74   ClutterStageCoglClass parent_class;
75 };
76
77 #define CLUTTER_STAGE_X11_EVENT_MASK \
78   StructureNotifyMask | \
79   FocusChangeMask | \
80   ExposureMask | \
81   PropertyChangeMask | \
82   EnterWindowMask | \
83   LeaveWindowMask | \
84   KeyPressMask | \
85   KeyReleaseMask | \
86   ButtonPressMask | \
87   ButtonReleaseMask | \
88   PointerMotionMask;
89
90 GType _clutter_stage_x11_get_type (void) G_GNUC_CONST;
91
92 void  _clutter_stage_x11_update_foreign_event_mask (CoglOnscreen *onscreen,
93                                                     guint32 event_mask,
94                                                     void *user_data);
95 void  _clutter_stage_x11_events_device_changed (ClutterStageX11 *stage_x11,
96                                                 ClutterInputDevice *device,
97                                                 ClutterDeviceManager *device_manager);
98
99 /* Private to subclasses */
100 void            _clutter_stage_x11_set_user_time                (ClutterStageX11 *stage_x11,
101                                                                  guint32          user_time);
102 gboolean        _clutter_stage_x11_get_root_coords              (ClutterStageX11 *stage_x11,
103                                                                  gint            *root_x,
104                                                                  gint            *root_y);
105
106 G_END_DECLS
107
108 #endif /* __CLUTTER_STAGE_H__ */