4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
8 * Copyright (C) 2006 OpenedHand
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.
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.
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/>.
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
28 #ifndef __CLUTTER_STAGE_H__
29 #define __CLUTTER_STAGE_H__
31 #include <clutter/clutter-types.h>
32 #include <clutter/clutter-group.h>
36 #define CLUTTER_TYPE_STAGE (clutter_stage_get_type())
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))
44 typedef struct _ClutterStageClass ClutterStageClass;
45 typedef struct _ClutterStagePrivate ClutterStagePrivate;
50 * The #ClutterStage structure contains only private data
51 * and should be accessed using the provided API
58 ClutterGroup parent_instance;
60 ClutterStagePrivate *priv;
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
70 * The #ClutterStageClass structure contains only private data
75 struct _ClutterStageClass
78 ClutterGroupClass parent_class;
82 void (* fullscreen) (ClutterStage *stage);
83 void (* unfullscreen) (ClutterStage *stage);
84 void (* activate) (ClutterStage *stage);
85 void (* deactivate) (ClutterStage *stage);
87 gboolean (* delete_event) (ClutterStage *stage,
91 /* padding for future expansion */
92 gpointer _padding_dummy[31];
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)
105 * Stage perspective definition. #ClutterPerspective is only used by
106 * the fixed point version of clutter_stage_set_perspective().
110 struct _ClutterPerspective
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)
125 * Fog settings used to create the depth cueing effect.
129 * Deprecated: 1.10: The fog-related API in #ClutterStage has been
130 * deprecated as well.
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;
142 ClutterActor * clutter_stage_new (void);
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,
155 const gchar * clutter_stage_get_title (ClutterStage *stage);
156 void clutter_stage_set_user_resizable (ClutterStage *stage,
158 gboolean clutter_stage_get_user_resizable (ClutterStage *stage);
160 void clutter_stage_set_minimum_size (ClutterStage *stage,
163 void clutter_stage_get_minimum_size (ClutterStage *stage,
166 void clutter_stage_set_no_clear_hint (ClutterStage *stage,
168 gboolean clutter_stage_get_no_clear_hint (ClutterStage *stage);
169 void clutter_stage_set_use_alpha (ClutterStage *stage,
171 gboolean clutter_stage_get_use_alpha (ClutterStage *stage);
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,
178 gboolean clutter_stage_get_throttle_motion_events (ClutterStage *stage);
179 void clutter_stage_set_motion_events_enabled (ClutterStage *stage,
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);
188 ClutterActor * clutter_stage_get_actor_at_pos (ClutterStage *stage,
189 ClutterPickMode pick_mode,
192 guchar * clutter_stage_read_pixels (ClutterStage *stage,
198 void clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
199 cairo_rectangle_int_t *clip);
201 void clutter_stage_ensure_current (ClutterStage *stage);
202 void clutter_stage_ensure_viewport (ClutterStage *stage);
203 void clutter_stage_ensure_redraw (ClutterStage *stage);
207 #endif /* __CLUTTER_STAGE_H__ */