Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-stage.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Authored By Matthew Allum  <mallum@openedhand.com>
7  *
8  * Copyright (C) 2006 OpenedHand
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22  */
23
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
26 #endif
27
28 #ifndef __CLUTTER_STAGE_H__
29 #define __CLUTTER_STAGE_H__
30
31 #include <clutter/clutter-types.h>
32 #include <clutter/clutter-group.h>
33
34 G_BEGIN_DECLS
35
36 #define CLUTTER_TYPE_STAGE              (clutter_stage_get_type())
37
38 #define CLUTTER_STAGE(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE, ClutterStage))
39 #define CLUTTER_STAGE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STAGE, ClutterStageClass))
40 #define CLUTTER_IS_STAGE(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE))
41 #define CLUTTER_IS_STAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STAGE))
42 #define CLUTTER_STAGE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STAGE, ClutterStageClass))
43
44 typedef struct _ClutterStageClass   ClutterStageClass;
45 typedef struct _ClutterStagePrivate ClutterStagePrivate;
46
47 /**
48  * ClutterStage:
49  *
50  * The #ClutterStage structure contains only private data
51  * and should be accessed using the provided API
52  *
53  * Since: 0.1
54  */
55 struct _ClutterStage
56 {
57   /*< private >*/
58   ClutterGroup parent_instance;
59
60   ClutterStagePrivate *priv;
61 };
62 /**
63  * ClutterStageClass:
64  * @fullscreen: handler for the #ClutterStage::fullscreen signal
65  * @unfullscreen: handler for the #ClutterStage::unfullscreen signal
66  * @activate: handler for the #ClutterStage::activate signal
67  * @deactivate: handler for the #ClutterStage::deactivate signal
68  * @delete_event: handler for the #ClutterStage::delete-event signal
69  *
70  * The #ClutterStageClass structure contains only private data
71  *
72  * Since: 0.1
73  */
74
75 struct _ClutterStageClass
76 {
77   /*< private >*/
78   ClutterGroupClass parent_class;
79
80   /*< public >*/
81   /* signals */
82   void (* fullscreen)   (ClutterStage *stage);
83   void (* unfullscreen) (ClutterStage *stage);
84   void (* activate)     (ClutterStage *stage);
85   void (* deactivate)   (ClutterStage *stage);
86
87   gboolean (* delete_event) (ClutterStage *stage,
88                              ClutterEvent *event);
89
90   /*< private >*/
91   /* padding for future expansion */
92   gpointer _padding_dummy[31];
93 };
94
95 /**
96  * ClutterPerspective:
97  * @fovy: the field of view angle, in degrees, in the y direction
98  * @aspect: the aspect ratio that determines the field of view in the x
99  *   direction. The aspect ratio is the ratio of x (width) to y (height)
100  * @z_near: the distance from the viewer to the near clipping
101  *   plane (always positive)
102  * @z_far: the distance from the viewer to the far clipping
103  *   plane (always positive)
104  *
105  * Stage perspective definition. #ClutterPerspective is only used by
106  * the fixed point version of clutter_stage_set_perspective().
107  *
108  * Since: 0.4
109  */
110 struct _ClutterPerspective
111 {
112   gfloat fovy;
113   gfloat aspect;
114   gfloat z_near;
115   gfloat z_far;
116 };
117
118 /**
119  * ClutterFog:
120  * @z_near: starting distance from the viewer to the near clipping
121  *   plane (always positive)
122  * @z_far: final distance from the viewer to the far clipping
123  *   plane (always positive)
124  *
125  * Fog settings used to create the depth cueing effect.
126  *
127  * Since: 0.6
128  *
129  * Deprecated: 1.10: The fog-related API in #ClutterStage has been
130  *   deprecated as well.
131  */
132 struct _ClutterFog
133 {
134   gfloat z_near;
135   gfloat z_far;
136 };
137
138 GType clutter_perspective_get_type (void) G_GNUC_CONST;
139 GType clutter_fog_get_type (void) G_GNUC_CONST;
140 GType clutter_stage_get_type (void) G_GNUC_CONST;
141
142 ClutterActor *  clutter_stage_new                               (void);
143
144 void            clutter_stage_set_perspective                   (ClutterStage          *stage,
145                                                                  ClutterPerspective    *perspective);
146 void            clutter_stage_get_perspective                   (ClutterStage          *stage,
147                                                                  ClutterPerspective    *perspective);
148 void            clutter_stage_set_fullscreen                    (ClutterStage          *stage,
149                                                                  gboolean               fullscreen);
150 gboolean        clutter_stage_get_fullscreen                    (ClutterStage          *stage);
151 void            clutter_stage_show_cursor                       (ClutterStage          *stage);
152 void            clutter_stage_hide_cursor                       (ClutterStage          *stage);
153 void            clutter_stage_set_title                         (ClutterStage          *stage,
154                                                                  const gchar           *title);
155 const gchar *   clutter_stage_get_title                         (ClutterStage          *stage);
156 void            clutter_stage_set_user_resizable                (ClutterStage          *stage,
157                                                                  gboolean               resizable);
158 gboolean        clutter_stage_get_user_resizable                (ClutterStage          *stage);
159
160 void            clutter_stage_set_minimum_size                  (ClutterStage          *stage,
161                                                                  guint                  width,
162                                                                  guint                  height);
163 void            clutter_stage_get_minimum_size                  (ClutterStage          *stage,
164                                                                  guint                 *width,
165                                                                  guint                 *height);
166 void            clutter_stage_set_no_clear_hint                 (ClutterStage          *stage,
167                                                                  gboolean               no_clear);
168 gboolean        clutter_stage_get_no_clear_hint                 (ClutterStage          *stage);
169 void            clutter_stage_set_use_alpha                     (ClutterStage          *stage,
170                                                                  gboolean               use_alpha);
171 gboolean        clutter_stage_get_use_alpha                     (ClutterStage          *stage);
172
173 void            clutter_stage_set_key_focus                     (ClutterStage          *stage,
174                                                                  ClutterActor          *actor);
175 ClutterActor *  clutter_stage_get_key_focus                     (ClutterStage          *stage);
176 void            clutter_stage_set_throttle_motion_events        (ClutterStage          *stage,
177                                                                  gboolean               throttle);
178 gboolean        clutter_stage_get_throttle_motion_events        (ClutterStage          *stage);
179 void            clutter_stage_set_motion_events_enabled         (ClutterStage          *stage,
180                                                                  gboolean               enabled);
181 gboolean        clutter_stage_get_motion_events_enabled         (ClutterStage          *stage);
182 void            clutter_stage_set_accept_focus                  (ClutterStage          *stage,
183                                                                  gboolean               accept_focus);
184 gboolean        clutter_stage_get_accept_focus                  (ClutterStage          *stage);
185 gboolean        clutter_stage_event                             (ClutterStage          *stage,
186                                                                  ClutterEvent          *event);
187
188 ClutterActor *  clutter_stage_get_actor_at_pos                  (ClutterStage          *stage,
189                                                                  ClutterPickMode        pick_mode,
190                                                                  gint                   x,
191                                                                  gint                   y);
192 guchar *        clutter_stage_read_pixels                       (ClutterStage          *stage,
193                                                                  gint                   x,
194                                                                  gint                   y,
195                                                                  gint                   width,
196                                                                  gint                   height);
197
198 void            clutter_stage_get_redraw_clip_bounds            (ClutterStage          *stage,
199                                                                  cairo_rectangle_int_t *clip);
200
201 void            clutter_stage_ensure_current                    (ClutterStage          *stage);
202 void            clutter_stage_ensure_viewport                   (ClutterStage          *stage);
203 void            clutter_stage_ensure_redraw                     (ClutterStage          *stage);
204
205 G_END_DECLS
206
207 #endif /* __CLUTTER_STAGE_H__ */