2006-05-29 04:59:36 -04:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 OpenedHand
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2006-06-21 18:34:25 -04:00
|
|
|
/**
|
|
|
|
* SECTION:clutter-stage
|
|
|
|
* @short_description: Top level visual element to which actors are placed.
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2006-06-21 18:34:25 -04:00
|
|
|
* #ClutterStage is a top level 'window' on which child actors are placed
|
|
|
|
* and manipulated.
|
|
|
|
*/
|
|
|
|
|
2007-10-12 04:17:00 -04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
#include "config.h"
|
2007-10-12 04:17:00 -04:00
|
|
|
#endif
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
#include "clutter-backend.h"
|
2006-05-29 04:59:36 -04:00
|
|
|
#include "clutter-stage.h"
|
|
|
|
#include "clutter-main.h"
|
|
|
|
#include "clutter-color.h"
|
2006-06-15 18:04:19 -04:00
|
|
|
#include "clutter-util.h"
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
#include "clutter-marshal.h"
|
|
|
|
#include "clutter-enum-types.h"
|
2006-11-21 Emmanuele Bassi <ebassi@openedhand.com>
* configure.ac: Enable debug messages also when
--enable-debug is set to "minimum".
* clutter/Makefile.am:
* clutter/clutter-debug.h: Move all debugging macros inside
this private header; make all debug macros depend on the
CLUTTER_ENABLE_DEBUG compile time define, controlled by
the --enable-debug configure switch; add G_LOG_DOMAIN define.
* clutter/clutter-main.c: Clean up the debug stuff; add
command line argument parsing using GOption; the debug
messages now are triggered like this:
CLUTTER_DEBUG=section:section:... clutter-app
or like this:
clutter-app --clutter-debug=section:section:...
where "section" is one of the sections listed in clutter-main.c,
or "all", for all sections; each section is bound to a flag,
which can be used to define a domain when adding a debug note
using the CLUTTER_NOTE() macro; the old CLUTTER_DBG() macro is
just a wrapper around that, under the CLUTTER_DEBUG_MISC domain;
CLUTTER_NOTE() is used like this:
CLUTTER_NOTE (DOMAIN, log-function);
where log function is g_printerr(), g_message(), g_warning(),
g_critical() or directly g_log() - for instance:
CLUTTER_NOTE (PANGO, g_warning ("Cache miss: %d", glyph));
will print the warning only if the "pango" flag has been
set to the CLUTTER_DEBUG envvar or passed to the --clutter-debug
command line argument.
similar to CLUTTER_SHOW_FPS, there's also the --clutter-show-fps
command line switch; also, the --display and --screen command
line switches have been added: the first overrides the DISPLAY
envvar and the second controls the X screen used by Clutter to
get the root window on the display.
* clutter/clutter-main.h:
* clutter/clutter-main.c: Add extended support for GOption
in Clutter; use clutter_init_with_args() to let Clutter
parse your own command line arguments; use instead
clutter_get_option_group() to get the GOptionGroup used by
Clutter if you want to do the parsing yourself with
g_option_context_parse(). The init sequence has been verified,
updated and moved into common functions where possible.
* clutter/pango/pangoclutter-render.c:
* clutter/*.c: Include "clutter-debug.h" where needed; use
CLUTTER_NOTE() instead of CLUTTER_DBG().
* examples/super-oh.c: Use the new clutter_init_with_args()
function, and add a --num-hands command line switch to
the SuperOH example code controlling the number of hands at
runtime.
2006-11-21 16:27:53 -05:00
|
|
|
#include "clutter-private.h"
|
|
|
|
#include "clutter-debug.h"
|
2007-02-13 18:31:57 -05:00
|
|
|
#include "clutter-version.h" /* For flavour */
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-04-27 17:13:06 -04:00
|
|
|
#include "cogl.h"
|
2007-03-25 07:47:30 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
G_DEFINE_ABSTRACT_TYPE (ClutterStage, clutter_stage, CLUTTER_TYPE_GROUP);
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
#define CLUTTER_STAGE_GET_PRIVATE(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_STAGE, ClutterStagePrivate))
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
struct _ClutterStagePrivate
|
2006-05-29 04:59:36 -04:00
|
|
|
{
|
2007-05-25 06:56:09 -04:00
|
|
|
ClutterColor color;
|
|
|
|
ClutterPerspective perspective;
|
2007-03-22 14:21:59 -04:00
|
|
|
|
2007-07-31 13:01:52 -04:00
|
|
|
guint is_fullscreen : 1;
|
|
|
|
guint is_offscreen : 1;
|
|
|
|
guint is_cursor_visible : 1;
|
|
|
|
guint is_user_resizable : 1;
|
2007-06-19 05:10:37 -04:00
|
|
|
|
|
|
|
gchar *title;
|
2007-08-13 16:48:01 -04:00
|
|
|
ClutterActor *key_focused_actor;
|
2006-05-29 04:59:36 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
PROP_COLOR,
|
2006-05-29 04:59:36 -04:00
|
|
|
PROP_FULLSCREEN,
|
2006-06-02 16:24:55 -04:00
|
|
|
PROP_OFFSCREEN,
|
2007-05-25 06:56:09 -04:00
|
|
|
PROP_CURSOR_VISIBLE,
|
|
|
|
PROP_PERSPECTIVE,
|
2007-06-19 05:10:37 -04:00
|
|
|
PROP_TITLE,
|
2007-07-26 16:08:09 -04:00
|
|
|
PROP_USER_RESIZE
|
2006-05-29 04:59:36 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2007-08-24 11:12:52 -04:00
|
|
|
FULLSCREEN,
|
|
|
|
UNFULLSCREEN,
|
|
|
|
ACTIVATE,
|
|
|
|
DEACTIVATE,
|
2006-05-29 04:59:36 -04:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2007-04-25 10:22:24 -04:00
|
|
|
static guint stage_signals[LAST_SIGNAL] = { 0, };
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
|
2007-03-23 12:37:56 -04:00
|
|
|
static void
|
2007-05-28 14:49:34 -04:00
|
|
|
clutter_stage_paint (ClutterActor *self)
|
2007-03-23 12:37:56 -04:00
|
|
|
{
|
2007-07-04 05:36:44 -04:00
|
|
|
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
|
|
|
|
2007-10-12 04:17:00 -04:00
|
|
|
cogl_paint_init (&priv->color);
|
2007-07-04 05:36:44 -04:00
|
|
|
|
2007-05-28 14:49:34 -04:00
|
|
|
CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint (self);
|
2007-03-23 12:37:56 -04:00
|
|
|
}
|
|
|
|
|
2006-05-29 04:59:36 -04:00
|
|
|
static void
|
2007-10-12 04:17:00 -04:00
|
|
|
clutter_stage_set_property (GObject *object,
|
2006-05-29 04:59:36 -04:00
|
|
|
guint prop_id,
|
2007-10-12 04:17:00 -04:00
|
|
|
const GValue *value,
|
2006-05-29 04:59:36 -04:00
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2007-05-25 06:56:09 -04:00
|
|
|
ClutterStage *stage;
|
2006-05-29 04:59:36 -04:00
|
|
|
ClutterStagePrivate *priv;
|
2007-05-25 06:56:09 -04:00
|
|
|
ClutterActor *actor;
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
stage = CLUTTER_STAGE (object);
|
|
|
|
actor = CLUTTER_ACTOR (stage);
|
2006-05-29 04:59:36 -04:00
|
|
|
priv = stage->priv;
|
|
|
|
|
2007-10-12 04:17:00 -04:00
|
|
|
switch (prop_id)
|
2006-05-29 04:59:36 -04:00
|
|
|
{
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
case PROP_COLOR:
|
|
|
|
clutter_stage_set_color (stage, g_value_get_boxed (value));
|
|
|
|
break;
|
2006-06-02 16:24:55 -04:00
|
|
|
case PROP_OFFSCREEN:
|
2007-05-25 06:56:09 -04:00
|
|
|
if (priv->is_offscreen == g_value_get_boolean (value))
|
|
|
|
return;
|
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
if (CLUTTER_ACTOR_IS_REALIZED (actor))
|
|
|
|
{
|
|
|
|
clutter_actor_unrealize (actor);
|
|
|
|
priv->is_offscreen = g_value_get_boolean (value);
|
|
|
|
clutter_actor_realize (actor);
|
2007-05-25 06:56:09 -04:00
|
|
|
|
|
|
|
if (!CLUTTER_ACTOR_IS_REALIZED (actor))
|
|
|
|
priv->is_offscreen = ~g_value_get_boolean (value);
|
2007-03-22 14:21:59 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
priv->is_offscreen = g_value_get_boolean (value);
|
2006-06-02 16:24:55 -04:00
|
|
|
break;
|
2006-05-29 04:59:36 -04:00
|
|
|
case PROP_FULLSCREEN:
|
2007-03-22 14:21:59 -04:00
|
|
|
if (g_value_get_boolean (value))
|
|
|
|
clutter_stage_fullscreen (stage);
|
|
|
|
else
|
|
|
|
clutter_stage_unfullscreen (stage);
|
2006-05-29 04:59:36 -04:00
|
|
|
break;
|
2007-03-22 14:21:59 -04:00
|
|
|
case PROP_CURSOR_VISIBLE:
|
|
|
|
if (g_value_get_boolean (value))
|
|
|
|
clutter_stage_show_cursor (stage);
|
|
|
|
else
|
|
|
|
clutter_stage_hide_cursor (stage);
|
2006-05-29 04:59:36 -04:00
|
|
|
break;
|
2007-05-25 06:56:09 -04:00
|
|
|
case PROP_PERSPECTIVE:
|
2007-10-12 04:17:00 -04:00
|
|
|
clutter_stage_set_perspectivex (stage, g_value_get_boxed (value));
|
2007-05-25 06:56:09 -04:00
|
|
|
break;
|
2007-06-19 05:10:37 -04:00
|
|
|
case PROP_TITLE:
|
2007-10-12 04:17:00 -04:00
|
|
|
clutter_stage_set_title (stage, g_value_get_string (value));
|
2007-06-19 05:10:37 -04:00
|
|
|
break;
|
2007-07-26 16:08:09 -04:00
|
|
|
case PROP_USER_RESIZE:
|
2007-07-31 13:01:52 -04:00
|
|
|
clutter_stage_set_user_resizable (stage, g_value_get_boolean (value));
|
2007-07-26 16:08:09 -04:00
|
|
|
break;
|
2006-05-29 04:59:36 -04:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-10-12 04:17:00 -04:00
|
|
|
clutter_stage_get_property (GObject *object,
|
2007-05-16 05:08:30 -04:00
|
|
|
guint prop_id,
|
2007-10-12 04:17:00 -04:00
|
|
|
GValue *value,
|
2007-05-16 05:08:30 -04:00
|
|
|
GParamSpec *pspec)
|
2006-05-29 04:59:36 -04:00
|
|
|
{
|
|
|
|
ClutterStage *stage;
|
|
|
|
ClutterStagePrivate *priv;
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
ClutterColor color;
|
2007-05-25 06:56:09 -04:00
|
|
|
ClutterPerspective perspective;
|
2006-05-29 04:59:36 -04:00
|
|
|
|
|
|
|
stage = CLUTTER_STAGE(object);
|
|
|
|
priv = stage->priv;
|
|
|
|
|
2007-10-12 04:17:00 -04:00
|
|
|
switch (prop_id)
|
2006-05-29 04:59:36 -04:00
|
|
|
{
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
case PROP_COLOR:
|
|
|
|
clutter_stage_get_color (stage, &color);
|
|
|
|
g_value_set_boxed (value, &color);
|
|
|
|
break;
|
2006-06-02 16:24:55 -04:00
|
|
|
case PROP_OFFSCREEN:
|
2007-03-22 14:21:59 -04:00
|
|
|
g_value_set_boolean (value, priv->is_offscreen);
|
2006-06-02 16:24:55 -04:00
|
|
|
break;
|
2006-05-29 04:59:36 -04:00
|
|
|
case PROP_FULLSCREEN:
|
2007-03-22 14:21:59 -04:00
|
|
|
g_value_set_boolean (value, priv->is_fullscreen);
|
2006-05-29 04:59:36 -04:00
|
|
|
break;
|
2007-03-22 14:21:59 -04:00
|
|
|
case PROP_CURSOR_VISIBLE:
|
|
|
|
g_value_set_boolean (value, priv->is_cursor_visible);
|
2006-05-29 04:59:36 -04:00
|
|
|
break;
|
2007-05-25 06:56:09 -04:00
|
|
|
case PROP_PERSPECTIVE:
|
|
|
|
clutter_stage_get_perspectivex (stage, &perspective);
|
|
|
|
g_value_set_boxed (value, &perspective);
|
|
|
|
break;
|
2007-06-19 05:10:37 -04:00
|
|
|
case PROP_TITLE:
|
|
|
|
g_value_set_string (value, priv->title);
|
|
|
|
break;
|
2007-07-26 16:08:09 -04:00
|
|
|
case PROP_USER_RESIZE:
|
2007-07-31 13:01:52 -04:00
|
|
|
g_value_set_boolean (value, priv->is_user_resizable);
|
2007-07-26 16:08:09 -04:00
|
|
|
break;
|
2006-05-29 04:59:36 -04:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
2007-10-12 04:17:00 -04:00
|
|
|
}
|
2006-05-29 04:59:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_stage_class_init (ClutterStageClass *klass)
|
|
|
|
{
|
2007-03-22 14:21:59 -04:00
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
2007-03-23 12:37:56 -04:00
|
|
|
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
|
2006-05-29 04:59:36 -04:00
|
|
|
|
|
|
|
gobject_class->set_property = clutter_stage_set_property;
|
|
|
|
gobject_class->get_property = clutter_stage_get_property;
|
2007-03-22 14:21:59 -04:00
|
|
|
|
2007-03-23 12:37:56 -04:00
|
|
|
actor_class->paint = clutter_stage_paint;
|
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
/**
|
2007-08-21 11:47:51 -04:00
|
|
|
* ClutterStage:fullscreen:
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
*
|
|
|
|
* Whether the stage should be fullscreen or not.
|
|
|
|
*/
|
2006-05-29 04:59:36 -04:00
|
|
|
g_object_class_install_property
|
|
|
|
(gobject_class, PROP_FULLSCREEN,
|
|
|
|
g_param_spec_boolean ("fullscreen",
|
|
|
|
"Fullscreen",
|
2007-03-22 14:21:59 -04:00
|
|
|
"Whether the main stage is fullscreen",
|
2006-05-29 04:59:36 -04:00
|
|
|
FALSE,
|
2006-12-04 11:26:35 -05:00
|
|
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
2007-08-21 11:47:51 -04:00
|
|
|
/**
|
|
|
|
* ClutterStage:offscreen:
|
|
|
|
*
|
|
|
|
* Whether the stage should be rendered in an offscreen buffer.
|
|
|
|
*/
|
2006-06-02 16:24:55 -04:00
|
|
|
g_object_class_install_property
|
|
|
|
(gobject_class, PROP_OFFSCREEN,
|
|
|
|
g_param_spec_boolean ("offscreen",
|
|
|
|
"Offscreen",
|
2007-03-22 14:21:59 -04:00
|
|
|
"Whether the main stage is renderer offscreen",
|
2006-06-02 16:24:55 -04:00
|
|
|
FALSE,
|
2006-12-04 11:26:35 -05:00
|
|
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
2007-08-21 11:47:51 -04:00
|
|
|
/**
|
|
|
|
* ClutterStage:cursor-visible:
|
|
|
|
*
|
|
|
|
* Whether the mouse pointer should be visible
|
|
|
|
*/
|
2006-05-29 04:59:36 -04:00
|
|
|
g_object_class_install_property
|
2007-03-22 14:21:59 -04:00
|
|
|
(gobject_class, PROP_CURSOR_VISIBLE,
|
|
|
|
g_param_spec_boolean ("cursor-visible",
|
|
|
|
"Cursor Visible",
|
|
|
|
"Whether the mouse pointer is visible on the main stage ",
|
2007-07-09 18:59:52 -04:00
|
|
|
TRUE,
|
2006-12-04 11:26:35 -05:00
|
|
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
2007-08-21 11:47:51 -04:00
|
|
|
/**
|
|
|
|
* ClutterStage:user-resizable:
|
|
|
|
*
|
|
|
|
* Whether the stage is able to be resized via user interaction.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
2007-07-26 16:08:09 -04:00
|
|
|
g_object_class_install_property
|
|
|
|
(gobject_class, PROP_USER_RESIZE,
|
2007-07-31 13:01:52 -04:00
|
|
|
g_param_spec_boolean ("user-resizable",
|
|
|
|
"User Resizable",
|
2007-07-26 16:08:09 -04:00
|
|
|
"Whether the stage is able to be resized via "
|
|
|
|
"user interaction",
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
2007-08-21 11:47:51 -04:00
|
|
|
/**
|
|
|
|
* ClutterStage:color:
|
|
|
|
*
|
|
|
|
* The color of the main stage.
|
|
|
|
*/
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
g_object_class_install_property
|
|
|
|
(gobject_class, PROP_COLOR,
|
|
|
|
g_param_spec_boxed ("color",
|
|
|
|
"Color",
|
2007-03-22 14:21:59 -04:00
|
|
|
"The color of the main stage",
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
CLUTTER_TYPE_COLOR,
|
2006-12-04 11:26:35 -05:00
|
|
|
CLUTTER_PARAM_READWRITE));
|
2007-06-19 05:10:37 -04:00
|
|
|
/**
|
|
|
|
* ClutterStage:title:
|
|
|
|
*
|
|
|
|
* The stages title - usually displayed in stage windows title decorations.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
2007-10-12 04:17:00 -04:00
|
|
|
g_object_class_install_property
|
2007-06-19 05:10:37 -04:00
|
|
|
(gobject_class, PROP_TITLE,
|
|
|
|
g_param_spec_string ("title",
|
|
|
|
"Title",
|
|
|
|
"Stage Title",
|
|
|
|
NULL,
|
|
|
|
CLUTTER_PARAM_READWRITE));
|
2007-08-24 11:12:52 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ClutterStage::fullscreen
|
|
|
|
* @stage: the stage which was fullscreened
|
|
|
|
*
|
|
|
|
* The ::fullscreen signal is emitted when the stage is made fullscreen.
|
|
|
|
*
|
|
|
|
* Since: 0.6
|
|
|
|
*/
|
|
|
|
stage_signals[FULLSCREEN] =
|
|
|
|
g_signal_new ("fullscreen",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, fullscreen),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ClutterStage::unfullscreen
|
|
|
|
* @stage: the stage which has left a fullscreen state.
|
|
|
|
*
|
|
|
|
* The ::unfullscreen signal is emitted when the stage leaves a fullscreen
|
|
|
|
* state.
|
|
|
|
*
|
|
|
|
* Since: 0.6
|
|
|
|
*/
|
|
|
|
stage_signals[UNFULLSCREEN] =
|
|
|
|
g_signal_new ("unfullscreen",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, unfullscreen),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ClutterStage::activate
|
|
|
|
* @stage: the stage which was activated
|
|
|
|
*
|
|
|
|
* The ::activate signal is emitted when the stage recieves key focus
|
|
|
|
* from the underlying window system.
|
|
|
|
*
|
|
|
|
* Since: 0.6
|
|
|
|
*/
|
|
|
|
stage_signals[ACTIVATE] =
|
|
|
|
g_signal_new ("activate",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, activate),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ClutterStage::deactivate
|
|
|
|
* @stage: the stage which was deactivated
|
|
|
|
*
|
|
|
|
* The ::activate signal is emitted when the stage loses key focus
|
|
|
|
* from the underlying window system.
|
|
|
|
*
|
|
|
|
* Since: 0.6
|
|
|
|
*/
|
|
|
|
stage_signals[DEACTIVATE] =
|
|
|
|
g_signal_new ("deactivate",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, deactivate),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
g_type_class_add_private (gobject_class, sizeof (ClutterStagePrivate));
|
2006-05-29 04:59:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_stage_init (ClutterStage *self)
|
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
2006-07-06 Emmanuele Bassi <ebassi@openedhand.com>
Big rework of the actor management semantics: now ClutterActor
objects behave like GtkObjects - that is they have an initial
"floating" reference that gets "sunk" when they are added to
a ClutterGroup. This makes a group responsible of de-allocating
each actor inside it, so you just have to destroy the group to
get every child actor destroyed. Also, now you can do:
clutter_group_add (group, clutter_video_texture_new ());
without having to care about reference counting and explicit
unreffing.
* clutter/clutter-private.h: Add private flags setter and
getter macros.
* clutter/clutter-actor.h:
* clutter/clutter-actor.c: Clean up; inherit from GInitiallyUnowned;
add a "visible" property; add the "destroy", "show" and "hide"
signals to ClutterActorClass.
(clutter_actor_show), (clutter_actor_hide): Refactor a bit; emit
the "show" and "hide" signals.
(clutter_actor_set_property), (clutter_actor_get_property),
(clutter_actor_class_init): Implement the "visible" property; add
signals.
(clutter_actor_finalize): Do not leak the actor's name, if it is
set.
(clutter_actor_dispose): Emit the "destroy" signal here.
(clutter_actor_init): Sink the initial floating flag if needed.
(clutter_actor_destroy): Add a function to explicitely destroy
a ClutterActor.
(clutter_actor_set_parent), (clutter_actor_get_parent),
(clutter_actor_unparent): Make set_parent require a valid parent;
add unparent; check on get_parent; ref_sink the actor when
setting its parent and unref it when unsetting it. Probably we'll
need a function that does reparenting as unparent+set_parent in
a single shot.
* clutter/clutter-group.h:
* clutter/clutter-group.c (clutter_group_dispose),
(clutter_group_finalize), (clutter_group_add),
(clutter_group_remove): Make the group destroy its children when
disposing it; clean up, and use the newly-available
clutter_actor_unparent().
* clutter/clutter-stage.h:
* clutter/clutter-stage.c (clutter_stage_init): ClutterStage is
a top-level actor; clean up.
* clutter/clutter-video-texture.h:
* clutter/clutter-video-texture.c: Clean up.
* examples/super-oh.c:
* examples/test.c:
* examples/video-player.c:
* examples/test-text.c:
* examples/video-cube.c: Remove the g_object_unref() call, as the
ClutterStage object is destroyed on clutter_main_quit().
2006-07-06 13:52:57 -04:00
|
|
|
|
|
|
|
/* a stage is a top-level object */
|
|
|
|
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IS_TOPLEVEL);
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
self->priv = priv = CLUTTER_STAGE_GET_PRIVATE (self);
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-07-31 13:01:52 -04:00
|
|
|
priv->is_offscreen = FALSE;
|
|
|
|
priv->is_fullscreen = FALSE;
|
|
|
|
priv->is_user_resizable = FALSE;
|
|
|
|
priv->is_cursor_visible = TRUE;
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
priv->color.red = 0xff;
|
|
|
|
priv->color.green = 0xff;
|
|
|
|
priv->color.blue = 0xff;
|
|
|
|
priv->color.alpha = 0xff;
|
2007-05-31 13:11:09 -04:00
|
|
|
|
2007-06-25 09:43:13 -04:00
|
|
|
priv->perspective.fovy = CFX_60; /* 60 Degrees */
|
2007-05-31 13:11:09 -04:00
|
|
|
priv->perspective.aspect = CFX_ONE;
|
|
|
|
priv->perspective.z_near = CLUTTER_FLOAT_TO_FIXED (0.1);
|
|
|
|
priv->perspective.z_far = CLUTTER_FLOAT_TO_FIXED (100.0);
|
2007-06-01 07:30:52 -04:00
|
|
|
|
2006-06-13 09:17:45 -04:00
|
|
|
clutter_actor_set_size (CLUTTER_ACTOR (self), 640, 480);
|
2007-08-13 16:48:01 -04:00
|
|
|
clutter_actor_set_reactive (CLUTTER_ACTOR (self));
|
2007-10-02 10:03:36 -04:00
|
|
|
clutter_stage_set_key_focus (self, NULL);
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_stage_get_default:
|
|
|
|
*
|
|
|
|
* Returns the main stage. #ClutterStage is a singleton, so
|
|
|
|
* the stage will be created the first time this function is
|
|
|
|
* called (typically, inside clutter_init()); all the subsequent
|
|
|
|
* calls to clutter_stage_get_default() will return the same
|
2007-03-22 14:21:59 -04:00
|
|
|
* instance.
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
*
|
2006-07-17 05:10:08 -04:00
|
|
|
* Return value: the main #ClutterStage. You should never
|
2007-03-22 14:21:59 -04:00
|
|
|
* destroy or unref the returned actor.
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
*/
|
2006-06-13 09:17:45 -04:00
|
|
|
ClutterActor *
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
clutter_stage_get_default (void)
|
|
|
|
{
|
2007-03-22 14:21:59 -04:00
|
|
|
ClutterMainContext *context;
|
|
|
|
|
|
|
|
context = clutter_context_get_default ();
|
|
|
|
g_assert (context != NULL);
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
|
2007-03-23 13:55:13 -04:00
|
|
|
return _clutter_backend_get_stage (context->backend);
|
2006-05-29 04:59:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_stage_set_color
|
|
|
|
* @stage: A #ClutterStage
|
|
|
|
* @color: A #ClutterColor
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2006-05-29 04:59:36 -04:00
|
|
|
* Set the stage color.
|
|
|
|
**/
|
|
|
|
void
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
clutter_stage_set_color (ClutterStage *stage,
|
|
|
|
const ClutterColor *color)
|
2006-05-29 04:59:36 -04:00
|
|
|
{
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
g_return_if_fail (color != NULL);
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
priv = stage->priv;
|
|
|
|
priv->color.red = color->red;
|
|
|
|
priv->color.green = color->green;
|
|
|
|
priv->color.blue = color->blue;
|
|
|
|
priv->color.alpha = color->alpha;
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2006-06-13 09:17:45 -04:00
|
|
|
if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (stage)))
|
|
|
|
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
g_object_notify (G_OBJECT (stage), "color");
|
2006-05-29 04:59:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
* clutter_stage_get_color
|
2006-05-29 04:59:36 -04:00
|
|
|
* @stage: A #ClutterStage
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
* @color: return location for a #ClutterColor
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2006-06-21 19:19:59 -04:00
|
|
|
* Retrieves the stage color.
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_get_color (ClutterStage *stage,
|
|
|
|
ClutterColor *color)
|
2006-05-29 04:59:36 -04:00
|
|
|
{
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
ClutterStagePrivate *priv;
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
g_return_if_fail (color != NULL);
|
|
|
|
|
|
|
|
priv = stage->priv;
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
color->red = priv->color.red;
|
|
|
|
color->green = priv->color.green;
|
|
|
|
color->blue = priv->color.blue;
|
|
|
|
color->alpha = priv->color.alpha;
|
2006-05-29 04:59:36 -04:00
|
|
|
}
|
|
|
|
|
2007-05-25 06:56:09 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_set_perspectivex
|
|
|
|
* @stage: A #ClutterStage
|
|
|
|
* @perspective: A #ClutterPerspective
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2007-05-25 06:56:09 -04:00
|
|
|
* Set the stage perspective.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
clutter_stage_set_perspectivex (ClutterStage *stage,
|
|
|
|
ClutterPerspective *perspective)
|
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
priv->perspective.fovy = perspective->fovy;
|
|
|
|
priv->perspective.aspect = perspective->aspect;
|
|
|
|
priv->perspective.z_near = perspective->z_near;
|
|
|
|
priv->perspective.z_far = perspective->z_far;
|
|
|
|
|
|
|
|
CLUTTER_SET_PRIVATE_FLAGS(stage, CLUTTER_ACTOR_SYNC_MATRICES);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_stage_get_perspectivex
|
|
|
|
* @stage: A #ClutterStage
|
|
|
|
* @perspective: return location for a #ClutterPerspective
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2007-05-25 06:56:09 -04:00
|
|
|
* Retrieves the stage perspective.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_get_perspectivex (ClutterStage *stage,
|
|
|
|
ClutterPerspective *perspective)
|
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
perspective->fovy = priv->perspective.fovy;
|
|
|
|
perspective->aspect = priv->perspective.aspect;
|
|
|
|
perspective->z_near = priv->perspective.z_near;
|
|
|
|
perspective->z_far = priv->perspective.z_far;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_stage_set_perspective
|
|
|
|
* @stage: A #ClutterStage
|
2007-07-24 13:34:06 -04:00
|
|
|
* @fovy: FIXME
|
|
|
|
* @aspect: FIXME
|
|
|
|
* @z_near: FIXME
|
|
|
|
* @z_far: FIXME
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2007-05-25 06:56:09 -04:00
|
|
|
* Set the stage perspective.
|
2007-07-24 13:34:06 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
2007-05-25 06:56:09 -04:00
|
|
|
void
|
2007-07-24 13:34:06 -04:00
|
|
|
clutter_stage_set_perspective (ClutterStage *stage,
|
|
|
|
gfloat fovy,
|
|
|
|
gfloat aspect,
|
|
|
|
gfloat z_near,
|
|
|
|
gfloat z_far)
|
2007-05-25 06:56:09 -04:00
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
2007-06-25 09:43:13 -04:00
|
|
|
priv->perspective.fovy = CLUTTER_FLOAT_TO_FIXED(fovy);
|
2007-05-25 06:56:09 -04:00
|
|
|
priv->perspective.aspect = CLUTTER_FLOAT_TO_FIXED(aspect);
|
|
|
|
priv->perspective.z_near = CLUTTER_FLOAT_TO_FIXED(z_near);
|
|
|
|
priv->perspective.z_far = CLUTTER_FLOAT_TO_FIXED(z_far);
|
|
|
|
|
|
|
|
CLUTTER_SET_PRIVATE_FLAGS(stage, CLUTTER_ACTOR_SYNC_MATRICES);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_stage_get_perspective
|
|
|
|
* @stage: A #ClutterStage
|
2007-07-04 10:00:41 -04:00
|
|
|
* @fovy: FIXME
|
|
|
|
* @aspect: FIXME
|
|
|
|
* @z_near: FIXME
|
|
|
|
* @z_far: FIXME
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2007-05-25 06:56:09 -04:00
|
|
|
* Retrieves the stage perspective.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_get_perspective (ClutterStage *stage,
|
|
|
|
gfloat *fovy,
|
|
|
|
gfloat *aspect,
|
|
|
|
gfloat *z_near,
|
|
|
|
gfloat *z_far)
|
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
2007-07-04 10:00:41 -04:00
|
|
|
|
|
|
|
if (fovy)
|
|
|
|
*fovy = CLUTTER_FIXED_TO_FLOAT (priv->perspective.fovy);
|
|
|
|
|
|
|
|
if (aspect)
|
|
|
|
*aspect = CLUTTER_FIXED_TO_FLOAT (priv->perspective.aspect);
|
|
|
|
|
|
|
|
if (z_near)
|
|
|
|
*z_near = CLUTTER_FIXED_TO_FLOAT (priv->perspective.z_near);
|
|
|
|
|
|
|
|
if (z_far)
|
|
|
|
*z_far = CLUTTER_FIXED_TO_FLOAT (priv->perspective.z_far);
|
2007-05-25 06:56:09 -04:00
|
|
|
}
|
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_fullscreen:
|
|
|
|
* @stage: a #ClutterStage
|
|
|
|
*
|
|
|
|
* Asks to place the stage window in the fullscreen state. Note that you
|
|
|
|
* shouldn't assume the window is definitely full screen afterward, because
|
|
|
|
* other entities (e.g. the user or window manager) could unfullscreen it
|
|
|
|
* again, and not all window managers honor requests to fullscreen windows.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_fullscreen (ClutterStage *stage)
|
2006-05-29 04:59:36 -04:00
|
|
|
{
|
2007-03-22 14:21:59 -04:00
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
if (!priv->is_fullscreen)
|
|
|
|
{
|
2007-10-12 04:17:00 -04:00
|
|
|
/* Only set if backend implements.
|
2007-10-08 12:18:33 -04:00
|
|
|
* Also see clutter_stage_event() for setting priv->is_fullscreen
|
2007-10-12 04:17:00 -04:00
|
|
|
* on state change event.
|
2007-10-08 12:18:33 -04:00
|
|
|
*/
|
2007-03-22 14:21:59 -04:00
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen)
|
2007-10-08 12:18:33 -04:00
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen (stage, TRUE);
|
2007-03-22 14:21:59 -04:00
|
|
|
}
|
2006-05-29 04:59:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2007-03-22 14:21:59 -04:00
|
|
|
* clutter_stage_unfullscreen:
|
|
|
|
* @stage: a #ClutterStage
|
2006-05-29 04:59:36 -04:00
|
|
|
*
|
2007-03-22 14:21:59 -04:00
|
|
|
* Asks to toggle off the fullscreen state for the stage window. Note that
|
|
|
|
* you shouldn't assume the window is definitely not full screen afterward,
|
|
|
|
* because other entities (e.g. the user or window manager) could fullscreen
|
|
|
|
* it again, and not all window managers honor requests to unfullscreen
|
|
|
|
* windows.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_unfullscreen (ClutterStage *stage)
|
2006-05-29 04:59:36 -04:00
|
|
|
{
|
2006-06-08 17:28:05 -04:00
|
|
|
ClutterStagePrivate *priv;
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2006-06-08 17:28:05 -04:00
|
|
|
priv = stage->priv;
|
2007-03-22 14:21:59 -04:00
|
|
|
if (priv->is_fullscreen)
|
|
|
|
{
|
2007-09-30 18:27:52 -04:00
|
|
|
/* Only set if backend implements */
|
2007-03-22 14:21:59 -04:00
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen)
|
2007-10-08 12:18:33 -04:00
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen (stage, FALSE);
|
2007-03-22 14:21:59 -04:00
|
|
|
}
|
|
|
|
}
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
|
2007-07-26 16:08:09 -04:00
|
|
|
/**
|
2007-07-31 13:01:52 -04:00
|
|
|
* clutter_stage_set_user_resizable:
|
2007-07-26 16:08:09 -04:00
|
|
|
* @stage: a #ClutterStage
|
2007-07-31 13:01:52 -04:00
|
|
|
* @resizable: whether if the stage should be user resizable.
|
2007-07-26 16:08:09 -04:00
|
|
|
*
|
|
|
|
* Sets if the stage is able to be resized by user interaction (i.e via
|
|
|
|
* window manager controls)
|
2007-07-31 13:01:52 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
2007-07-26 16:08:09 -04:00
|
|
|
*/
|
|
|
|
void
|
2007-07-31 13:01:52 -04:00
|
|
|
clutter_stage_set_user_resizable (ClutterStage *stage,
|
|
|
|
gboolean resizable)
|
2007-07-26 16:08:09 -04:00
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
|
|
|
|
if (clutter_feature_available (CLUTTER_FEATURE_STAGE_USER_RESIZE)
|
2007-07-31 13:01:52 -04:00
|
|
|
&& priv->is_user_resizable != resizable
|
2007-07-26 16:08:09 -04:00
|
|
|
&& CLUTTER_STAGE_GET_CLASS (stage)->set_user_resize)
|
|
|
|
{
|
2007-07-31 13:01:52 -04:00
|
|
|
priv->is_user_resizable = resizable;
|
2007-07-26 16:08:09 -04:00
|
|
|
|
2007-07-31 13:01:52 -04:00
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_user_resize (stage, resizable);
|
2007-07-26 16:08:09 -04:00
|
|
|
|
2007-07-31 13:01:52 -04:00
|
|
|
g_object_notify (G_OBJECT (stage), "user-resizable");
|
2007-07-26 16:08:09 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-31 13:01:52 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_get_user_resizable:
|
|
|
|
* @stage: a #ClutterStage
|
|
|
|
*
|
|
|
|
* Retrieves the value set with clutter_stage_set_user_resizable().
|
|
|
|
*
|
|
|
|
* Return value: %TRUE is the stage is resizable by the user.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
clutter_stage_get_user_resizable (ClutterStage *stage)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
|
|
|
|
|
|
|
|
return stage->priv->is_user_resizable;
|
|
|
|
}
|
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_show_cursor:
|
|
|
|
* @stage: a #ClutterStage
|
|
|
|
*
|
|
|
|
* Shows the cursor on the stage window
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_show_cursor (ClutterStage *stage)
|
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-color.h:
* clutter-color.c: Reimplement ClutterColor as a boxed type;
add convenience API for color handling, like: add, subtract,
shade, HSL color-space conversion, packing and unpacking.
* clutter-private.h: Update ClutterMainContext, and export the
main context pointer here.
* clutter-rectangle.h:
* clutter-rectangle.c: Update the color-related code; make
clutter_rectangle_new() and empty constructor and provide
clutter_rectangle_new_with_color(); provide color setter
and getter API.
* clutter-label.h:
* clutter-label.c: Rename the "font" property to "font-name";
update the color-related code to the new ClutterColor object;
rename clutter_label_new() to clutter_label_new_with_text(),
and add setters and getters for the properties.
* clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers
generators.
* clutter-stage.h:
* clutter-stage.c: Rework the API: provide a default constructor
for a singleton object, named clutter_stage_get_default(), which
supercedes the clutter_stage() function in clutter-main; provide
new events: button-press-event, button-release-event,
key-press-event and key-release-event; update the color-related
code;
(clutter_stage_snapshot): Allow negative width and height when
taking a snapshot (meaning: use full width/height).
(clutter_stage_get_element_at_pos): Rename clutter_stage_pick().
* clutter-element.c (clutter_element_paint): Clean up the
stage and color related code.
* clutter-event.h:
* clutter-event.c: Add generic ClutterAnyEvent type; add
clutter_event_new(), clutter_event_copy() and clutter_event_free();
make ClutterEvent a boxed type.
* clutter-main.h:
* clutter-main.c: Remove clutter_stage(); add clutter_main_quit(),
for cleanly quitting from clutter_main(); add multiple mainloops
support; allocate the ClutterCntx instead of adding it to the
stack; re-work the ClutterEvent dispatching.
* clutter-group.c (clutter_group_add), (clutter_group_remove): Keep
a reference on the element when added to a ClutterGroup.
* examples/rects.py
* examples/test.c:
* examples/test-text.c:
* examples/video-cube.c:
* examples/super-oh.c:
* examples/test-video.c: Update.
2006-06-05 09:38:31 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
priv = stage->priv;
|
|
|
|
if (!priv->is_cursor_visible)
|
2006-06-08 17:28:05 -04:00
|
|
|
{
|
2007-03-22 14:21:59 -04:00
|
|
|
priv->is_cursor_visible = TRUE;
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible)
|
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible (stage, TRUE);
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
g_object_notify (G_OBJECT (stage), "cursor-visible");
|
2006-06-08 17:28:05 -04:00
|
|
|
}
|
2006-05-29 04:59:36 -04:00
|
|
|
}
|
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_hide_cursor:
|
2007-07-24 13:34:06 -04:00
|
|
|
* @stage: a #ClutterStage
|
|
|
|
*
|
|
|
|
* Makes the cursor invisible on the stage window
|
2007-03-22 14:21:59 -04:00
|
|
|
*
|
2007-07-24 13:34:06 -04:00
|
|
|
* Since: 0.4
|
2007-03-22 14:21:59 -04:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_hide_cursor (ClutterStage *stage)
|
2007-01-23 15:29:11 -05:00
|
|
|
{
|
2007-03-22 14:21:59 -04:00
|
|
|
ClutterStagePrivate *priv;
|
2007-01-23 15:29:11 -05:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
2007-01-23 15:29:11 -05:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
priv = stage->priv;
|
|
|
|
if (priv->is_cursor_visible)
|
|
|
|
{
|
|
|
|
priv->is_cursor_visible = FALSE;
|
2007-01-23 15:29:11 -05:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible)
|
2007-07-09 18:59:52 -04:00
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible (stage, FALSE);
|
2007-01-23 15:29:11 -05:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
g_object_notify (G_OBJECT (stage), "cursor-visible");
|
|
|
|
}
|
|
|
|
}
|
2007-01-23 15:29:11 -05:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_snapshot
|
|
|
|
* @stage: A #ClutterStage
|
|
|
|
* @x: x coordinate of the first pixel that is read from stage
|
|
|
|
* @y: y coordinate of the first pixel that is read from stage
|
|
|
|
* @width: Width dimention of pixels to be read, or -1 for the
|
|
|
|
* entire stage width
|
|
|
|
* @height: Height dimention of pixels to be read, or -1 for the
|
|
|
|
* entire stage height
|
|
|
|
*
|
|
|
|
* Gets a pixel based representation of the current rendered stage.
|
|
|
|
*
|
|
|
|
* Return value: pixel representation as a #GdkPixbuf
|
|
|
|
**/
|
|
|
|
GdkPixbuf *
|
|
|
|
clutter_stage_snapshot (ClutterStage *stage,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
ClutterStageClass *klass;
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
|
|
|
g_return_val_if_fail (x >= 0 && y >= 0, NULL);
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
klass = CLUTTER_STAGE_GET_CLASS (stage);
|
|
|
|
if (klass->draw_to_pixbuf)
|
2007-06-19 10:10:25 -04:00
|
|
|
return klass->draw_to_pixbuf (stage, x, y, width, height);
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-03-22 14:21:59 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
2006-05-29 04:59:36 -04:00
|
|
|
|
2007-03-25 07:47:30 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_get_actor_at_pos:
|
2007-07-01 12:44:24 -04:00
|
|
|
* @stage: a #ClutterStage
|
|
|
|
* @x: X coordinate to check
|
|
|
|
* @y: Y coordinate to check
|
2007-03-25 07:47:30 -04:00
|
|
|
*
|
2007-07-01 12:44:24 -04:00
|
|
|
* Checks the scene at the coordinates @x and @y and returns a pointer
|
|
|
|
* to the #ClutterActor at those coordinates.
|
2007-03-25 07:47:30 -04:00
|
|
|
*
|
|
|
|
* Return value: the actor at the specified coordinates, if any
|
|
|
|
*/
|
2007-03-22 14:21:59 -04:00
|
|
|
ClutterActor *
|
|
|
|
clutter_stage_get_actor_at_pos (ClutterStage *stage,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
2007-08-13 16:48:01 -04:00
|
|
|
return _clutter_do_pick (stage, x, y, CLUTTER_PICK_ALL);
|
2006-05-29 04:59:36 -04:00
|
|
|
}
|
2007-03-26 19:18:39 -04:00
|
|
|
|
2007-04-25 10:22:24 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_event:
|
|
|
|
* @stage: a #ClutterStage
|
|
|
|
* @event: a #ClutterEvent
|
|
|
|
*
|
|
|
|
* This function is used to emit an event on the main stage.
|
|
|
|
* You should rarely need to use this function, except for
|
|
|
|
* synthetising events.
|
|
|
|
*
|
|
|
|
* Return value: the return value from the signal emission
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
clutter_stage_event (ClutterStage *stage,
|
|
|
|
ClutterEvent *event)
|
|
|
|
{
|
2007-10-08 12:18:33 -04:00
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
2007-04-25 10:22:24 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
2007-10-08 12:18:33 -04:00
|
|
|
priv = stage->priv;
|
|
|
|
|
2007-08-24 11:12:52 -04:00
|
|
|
if (event->type == CLUTTER_DELETE)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (event->type != CLUTTER_STAGE_STATE)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* emit raw event */
|
2007-10-10 09:04:34 -04:00
|
|
|
if (clutter_actor_event (CLUTTER_ACTOR (stage), event, FALSE))
|
2007-10-02 10:03:36 -04:00
|
|
|
return TRUE;
|
2007-08-24 11:12:52 -04:00
|
|
|
|
|
|
|
if (event->stage_state.changed_mask & CLUTTER_STAGE_STATE_FULLSCREEN)
|
|
|
|
{
|
|
|
|
if (event->stage_state.new_state & CLUTTER_STAGE_STATE_FULLSCREEN)
|
2007-10-08 12:18:33 -04:00
|
|
|
{
|
|
|
|
priv->is_fullscreen = TRUE;
|
|
|
|
g_signal_emit (stage, stage_signals[FULLSCREEN], 0);
|
2007-10-10 10:29:29 -04:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (stage), "fullscreen");
|
2007-10-08 12:18:33 -04:00
|
|
|
}
|
2007-08-24 11:12:52 -04:00
|
|
|
else
|
2007-10-08 12:18:33 -04:00
|
|
|
{
|
|
|
|
priv->is_fullscreen = FALSE;
|
|
|
|
g_signal_emit (stage, stage_signals[UNFULLSCREEN], 0);
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2007-10-10 10:29:29 -04:00
|
|
|
g_object_notify (G_OBJECT (stage), "fullscreen");
|
2007-10-08 12:18:33 -04:00
|
|
|
}
|
2007-08-24 11:12:52 -04:00
|
|
|
}
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2007-08-24 11:12:52 -04:00
|
|
|
if (event->stage_state.changed_mask & CLUTTER_STAGE_STATE_ACTIVATED)
|
|
|
|
{
|
|
|
|
if (event->stage_state.new_state & CLUTTER_STAGE_STATE_ACTIVATED)
|
|
|
|
g_signal_emit (stage, stage_signals[ACTIVATE], 0);
|
|
|
|
else
|
|
|
|
g_signal_emit (stage, stage_signals[DEACTIVATE], 0);
|
|
|
|
}
|
2007-04-25 10:22:24 -04:00
|
|
|
|
2007-08-13 16:48:01 -04:00
|
|
|
return TRUE;
|
2007-04-25 10:22:24 -04:00
|
|
|
}
|
|
|
|
|
2007-06-19 05:10:37 -04:00
|
|
|
/**
|
|
|
|
* clutter_stage_set_title
|
|
|
|
* @stage: A #ClutterStage
|
|
|
|
* @title: A utf8 string for the stage windows title.
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2007-06-19 05:10:37 -04:00
|
|
|
* Sets the stage title.
|
|
|
|
*
|
|
|
|
* Since 0.4
|
|
|
|
**/
|
2007-10-12 04:17:00 -04:00
|
|
|
void
|
2007-06-19 05:10:37 -04:00
|
|
|
clutter_stage_set_title (ClutterStage *stage,
|
|
|
|
const gchar *title)
|
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
|
|
|
|
g_free (priv->title);
|
|
|
|
priv->title = g_strdup (title);
|
|
|
|
|
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_title)
|
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_title (stage, priv->title);
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (stage), "title");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_stage_get_title
|
|
|
|
* @stage: A #ClutterStage
|
2007-10-12 04:17:00 -04:00
|
|
|
*
|
2007-06-19 05:10:37 -04:00
|
|
|
* Gets the stage title.
|
|
|
|
*
|
|
|
|
* Return value: pointer to the title string for the stage. The
|
|
|
|
* returned string is owned by the actor and should not
|
|
|
|
* be modified or freed.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
**/
|
|
|
|
G_CONST_RETURN gchar *
|
|
|
|
clutter_stage_get_title (ClutterStage *stage)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
|
|
|
|
|
|
|
return stage->priv->title;
|
|
|
|
}
|
|
|
|
|
2007-08-13 16:48:01 -04:00
|
|
|
static void
|
|
|
|
on_key_focused_weak_notify (gpointer data,
|
|
|
|
GObject *where_the_object_was)
|
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
2007-10-02 10:03:36 -04:00
|
|
|
ClutterStage *stage = CLUTTER_STAGE (data);
|
2007-08-13 16:48:01 -04:00
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
priv->key_focused_actor = NULL;
|
|
|
|
|
2007-10-12 04:17:00 -04:00
|
|
|
/* focused actor has dissapeared - fall back to stage
|
2007-08-13 16:48:01 -04:00
|
|
|
* FIXME: need some kind of signal dance/block here.
|
|
|
|
*/
|
2007-10-02 10:03:36 -04:00
|
|
|
clutter_stage_set_key_focus (stage, NULL);
|
2007-08-13 16:48:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-10-02 10:03:36 -04:00
|
|
|
clutter_stage_set_key_focus (ClutterStage *stage,
|
|
|
|
ClutterActor *actor)
|
2007-08-13 16:48:01 -04:00
|
|
|
{
|
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
|
|
|
|
if (priv->key_focused_actor == actor)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (priv->key_focused_actor)
|
|
|
|
{
|
2007-10-02 10:03:36 -04:00
|
|
|
g_object_weak_unref (G_OBJECT (priv->key_focused_actor),
|
2007-08-13 16:48:01 -04:00
|
|
|
on_key_focused_weak_notify,
|
|
|
|
stage);
|
2007-10-02 10:03:36 -04:00
|
|
|
g_signal_emit_by_name (priv->key_focused_actor, "focus-out");
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2007-10-02 10:03:36 -04:00
|
|
|
priv->key_focused_actor = NULL;
|
2007-08-13 16:48:01 -04:00
|
|
|
}
|
2007-10-02 10:03:36 -04:00
|
|
|
else
|
|
|
|
g_signal_emit_by_name (stage, "focus-out");
|
2007-08-13 16:48:01 -04:00
|
|
|
|
|
|
|
if (actor)
|
|
|
|
{
|
2007-10-02 10:03:36 -04:00
|
|
|
priv->key_focused_actor = actor;
|
|
|
|
|
|
|
|
g_object_weak_ref (G_OBJECT (actor),
|
2007-08-13 16:48:01 -04:00
|
|
|
on_key_focused_weak_notify,
|
|
|
|
stage);
|
2007-10-02 10:03:36 -04:00
|
|
|
g_signal_emit_by_name (priv->key_focused_actor, "focus-in");
|
2007-08-13 16:48:01 -04:00
|
|
|
}
|
2007-10-02 10:03:36 -04:00
|
|
|
else
|
|
|
|
g_signal_emit_by_name (stage, "focus-in");
|
2007-08-13 16:48:01 -04:00
|
|
|
}
|
|
|
|
|
2007-10-02 10:03:36 -04:00
|
|
|
ClutterActor *
|
|
|
|
clutter_stage_get_key_focus (ClutterStage *stage)
|
2007-08-13 16:48:01 -04:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
|
|
|
|
2007-10-02 10:03:36 -04:00
|
|
|
if (stage->priv->key_focused_actor)
|
|
|
|
return stage->priv->key_focused_actor;
|
2007-08-13 16:48:01 -04:00
|
|
|
|
2007-10-02 10:03:36 -04:00
|
|
|
return CLUTTER_ACTOR (stage);
|
2007-08-13 16:48:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-03-26 19:18:39 -04:00
|
|
|
/*** Perspective boxed type ******/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_perspective_copy:
|
|
|
|
* @perspective: a #ClutterPerspective
|
|
|
|
*
|
|
|
|
* Makes a copy of the perspective structure. The result must be
|
|
|
|
* freed using clutter_perspective_free().
|
|
|
|
*
|
|
|
|
* Return value: an allocated copy of @perspective.
|
|
|
|
*
|
2007-05-25 06:56:09 -04:00
|
|
|
* Since: 0.4
|
2007-03-26 19:18:39 -04:00
|
|
|
*/
|
|
|
|
ClutterPerspective *
|
|
|
|
clutter_perspective_copy (const ClutterPerspective *perspective)
|
|
|
|
{
|
|
|
|
ClutterPerspective *result;
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2007-03-26 19:18:39 -04:00
|
|
|
g_return_val_if_fail (perspective != NULL, NULL);
|
|
|
|
|
|
|
|
result = g_slice_new (ClutterPerspective);
|
|
|
|
*result = *perspective;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_perspective_free:
|
|
|
|
* @perspective: a #ClutterPerspective
|
|
|
|
*
|
|
|
|
* Frees a perspective structure created with clutter_perspective_copy().
|
|
|
|
*
|
2007-03-27 06:46:40 -04:00
|
|
|
* Since: 0.4
|
2007-03-26 19:18:39 -04:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_perspective_free (ClutterPerspective *perspective)
|
|
|
|
{
|
|
|
|
g_return_if_fail (perspective != NULL);
|
|
|
|
|
|
|
|
g_slice_free (ClutterPerspective, perspective);
|
|
|
|
}
|
|
|
|
|
|
|
|
GType
|
|
|
|
clutter_perspective_get_type (void)
|
|
|
|
{
|
|
|
|
static GType our_type = 0;
|
2007-10-12 04:17:00 -04:00
|
|
|
|
2007-03-26 19:18:39 -04:00
|
|
|
if (!our_type)
|
2007-10-12 04:17:00 -04:00
|
|
|
our_type = g_boxed_type_register_static
|
2007-03-26 19:18:39 -04:00
|
|
|
("ClutterPerspective",
|
|
|
|
(GBoxedCopyFunc) clutter_perspective_copy,
|
|
|
|
(GBoxedFreeFunc) clutter_perspective_free);
|
|
|
|
return our_type;
|
|
|
|
}
|
2007-05-25 06:56:09 -04:00
|
|
|
|