2006-05-29 08:59:36 +00: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 22:34:25 +00:00
|
|
|
/**
|
|
|
|
* SECTION:clutter-stage
|
|
|
|
* @short_description: Top level visual element to which actors are placed.
|
|
|
|
*
|
|
|
|
* #ClutterStage is a top level 'window' on which child actors are placed
|
|
|
|
* and manipulated.
|
|
|
|
*/
|
|
|
|
|
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 13:38:31 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
#include "clutter-backend.h"
|
2006-05-29 08:59:36 +00:00
|
|
|
#include "clutter-stage.h"
|
|
|
|
#include "clutter-main.h"
|
|
|
|
#include "clutter-color.h"
|
2006-06-15 22:04:19 +00: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 13:38:31 +00: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 21:27:53 +00:00
|
|
|
#include "clutter-private.h"
|
|
|
|
#include "clutter-debug.h"
|
2007-02-13 23:31:57 +00:00
|
|
|
#include "clutter-version.h" /* For flavour */
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-25 11:47:30 +00:00
|
|
|
#include <GL/gl.h>
|
|
|
|
|
2006-06-08 21:28:05 +00:00
|
|
|
#include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
|
|
|
|
|
2007-03-29 10:41:23 +00:00
|
|
|
#define FIXED_PERSPECTIVE
|
2007-03-29 11:30:30 +00:00
|
|
|
#undef USING_GLES
|
2007-03-29 10:41:23 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
G_DEFINE_ABSTRACT_TYPE (ClutterStage, clutter_stage, CLUTTER_TYPE_GROUP);
|
2006-05-29 08:59:36 +00: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 13:38:31 +00:00
|
|
|
#define CLUTTER_STAGE_GET_PRIVATE(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_STAGE, ClutterStagePrivate))
|
2006-05-29 08:59:36 +00: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 13:38:31 +00:00
|
|
|
struct _ClutterStagePrivate
|
2006-05-29 08:59:36 +00:00
|
|
|
{
|
2007-03-22 18:21:59 +00:00
|
|
|
ClutterColor color;
|
|
|
|
|
|
|
|
guint is_fullscreen : 1;
|
|
|
|
guint is_offscreen : 1;
|
|
|
|
guint is_cursor_visible : 1;
|
2006-05-29 08:59:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_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 13:38:31 +00:00
|
|
|
|
|
|
|
PROP_COLOR,
|
2006-05-29 08:59:36 +00:00
|
|
|
PROP_FULLSCREEN,
|
2006-06-02 20:24:55 +00:00
|
|
|
PROP_OFFSCREEN,
|
2007-03-22 18:21:59 +00:00
|
|
|
PROP_CURSOR_VISIBLE
|
2006-05-29 08:59:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2007-03-23 09:59:02 +00:00
|
|
|
EVENT,
|
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 13:38:31 +00:00
|
|
|
BUTTON_PRESS_EVENT,
|
|
|
|
BUTTON_RELEASE_EVENT,
|
2007-03-22 18:21:59 +00:00
|
|
|
SCROLL_EVENT,
|
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 13:38:31 +00:00
|
|
|
KEY_PRESS_EVENT,
|
|
|
|
KEY_RELEASE_EVENT,
|
|
|
|
MOTION_EVENT,
|
2007-03-22 18:21:59 +00:00
|
|
|
STAGE_STATE_EVENT,
|
|
|
|
DELETE_EVENT,
|
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 13:38:31 +00:00
|
|
|
|
2006-05-29 08:59:36 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
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 13:38:31 +00:00
|
|
|
static guint stage_signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
2007-03-23 10:00:47 +00:00
|
|
|
static gboolean
|
2007-03-23 09:44:21 +00:00
|
|
|
clutter_stage_delete_event (ClutterStage *stage,
|
|
|
|
ClutterAnyEvent *event)
|
2007-03-22 18:21:59 +00:00
|
|
|
{
|
|
|
|
/* FIXME - destroy the main stage, probably attaching a weak ref
|
|
|
|
* to it from the backend, so that it gets destroyed too.
|
|
|
|
*/
|
|
|
|
CLUTTER_NOTE (EVENT, "Received a destroy notification");
|
2007-03-23 10:00:47 +00:00
|
|
|
|
|
|
|
/* we don't want to block */
|
|
|
|
return FALSE;
|
2007-03-22 18:21:59 +00:00
|
|
|
}
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-23 16:37:56 +00:00
|
|
|
static void
|
|
|
|
clutter_stage_paint (ClutterActor *actor)
|
|
|
|
{
|
|
|
|
/* chain up */
|
|
|
|
CLUTTER_NOTE (PAINT, "Chaining up to parent class paint");
|
|
|
|
|
|
|
|
if (CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint)
|
|
|
|
CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint (actor);
|
|
|
|
}
|
|
|
|
|
2006-05-29 08:59:36 +00:00
|
|
|
static void
|
|
|
|
clutter_stage_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2007-03-22 18:21:59 +00:00
|
|
|
ClutterStage *stage;
|
2006-05-29 08:59:36 +00:00
|
|
|
ClutterStagePrivate *priv;
|
2007-03-22 18:21:59 +00:00
|
|
|
ClutterActor *actor;
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
stage = CLUTTER_STAGE (object);
|
|
|
|
actor = CLUTTER_ACTOR (stage);
|
2006-05-29 08:59:36 +00:00
|
|
|
priv = stage->priv;
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
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 13:38:31 +00:00
|
|
|
case PROP_COLOR:
|
|
|
|
clutter_stage_set_color (stage, g_value_get_boxed (value));
|
|
|
|
break;
|
2006-06-02 20:24:55 +00:00
|
|
|
case PROP_OFFSCREEN:
|
2007-03-22 18:21:59 +00:00
|
|
|
if (CLUTTER_ACTOR_IS_REALIZED (actor))
|
|
|
|
{
|
|
|
|
clutter_actor_unrealize (actor);
|
|
|
|
priv->is_offscreen = g_value_get_boolean (value);
|
|
|
|
clutter_actor_realize (actor);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
priv->is_offscreen = g_value_get_boolean (value);
|
2006-06-02 20:24:55 +00:00
|
|
|
break;
|
2006-05-29 08:59:36 +00:00
|
|
|
case PROP_FULLSCREEN:
|
2007-03-22 18:21:59 +00:00
|
|
|
if (g_value_get_boolean (value))
|
|
|
|
clutter_stage_fullscreen (stage);
|
|
|
|
else
|
|
|
|
clutter_stage_unfullscreen (stage);
|
2006-05-29 08:59:36 +00:00
|
|
|
break;
|
2007-03-22 18:21:59 +00: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 08:59:36 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_stage_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
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 13:38:31 +00:00
|
|
|
ClutterColor color;
|
2006-05-29 08:59:36 +00:00
|
|
|
|
|
|
|
stage = CLUTTER_STAGE(object);
|
|
|
|
priv = stage->priv;
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
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 13:38:31 +00:00
|
|
|
case PROP_COLOR:
|
|
|
|
clutter_stage_get_color (stage, &color);
|
|
|
|
g_value_set_boxed (value, &color);
|
|
|
|
break;
|
2006-06-02 20:24:55 +00:00
|
|
|
case PROP_OFFSCREEN:
|
2007-03-22 18:21:59 +00:00
|
|
|
g_value_set_boolean (value, priv->is_offscreen);
|
2006-06-02 20:24:55 +00:00
|
|
|
break;
|
2006-05-29 08:59:36 +00:00
|
|
|
case PROP_FULLSCREEN:
|
2007-03-22 18:21:59 +00:00
|
|
|
g_value_set_boolean (value, priv->is_fullscreen);
|
2006-05-29 08:59:36 +00:00
|
|
|
break;
|
2007-03-22 18:21:59 +00:00
|
|
|
case PROP_CURSOR_VISIBLE:
|
|
|
|
g_value_set_boolean (value, priv->is_cursor_visible);
|
2006-05-29 08:59:36 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_stage_class_init (ClutterStageClass *klass)
|
|
|
|
{
|
2007-03-22 18:21:59 +00:00
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
2007-03-23 16:37:56 +00:00
|
|
|
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
|
2007-03-22 18:21:59 +00:00
|
|
|
ClutterStageClass *stage_class = CLUTTER_STAGE_CLASS (klass);
|
2006-05-29 08:59:36 +00:00
|
|
|
|
|
|
|
gobject_class->set_property = clutter_stage_set_property;
|
|
|
|
gobject_class->get_property = clutter_stage_get_property;
|
2007-03-22 18:21:59 +00:00
|
|
|
|
2007-03-23 16:37:56 +00:00
|
|
|
actor_class->paint = clutter_stage_paint;
|
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
stage_class->delete_event = clutter_stage_delete_event;
|
|
|
|
|
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 13:38:31 +00:00
|
|
|
/**
|
|
|
|
* ClutterStage:fullscreen
|
|
|
|
*
|
|
|
|
* Whether the stage should be fullscreen or not.
|
|
|
|
*/
|
2006-05-29 08:59:36 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
(gobject_class, PROP_FULLSCREEN,
|
|
|
|
g_param_spec_boolean ("fullscreen",
|
|
|
|
"Fullscreen",
|
2007-03-22 18:21:59 +00:00
|
|
|
"Whether the main stage is fullscreen",
|
2006-05-29 08:59:36 +00:00
|
|
|
FALSE,
|
2006-12-04 16:26:35 +00:00
|
|
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2006-06-02 20:24:55 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
(gobject_class, PROP_OFFSCREEN,
|
|
|
|
g_param_spec_boolean ("offscreen",
|
|
|
|
"Offscreen",
|
2007-03-22 18:21:59 +00:00
|
|
|
"Whether the main stage is renderer offscreen",
|
2006-06-02 20:24:55 +00:00
|
|
|
FALSE,
|
2006-12-04 16:26:35 +00:00
|
|
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
2006-06-02 20:24:55 +00:00
|
|
|
|
|
|
|
|
2006-05-29 08:59:36 +00:00
|
|
|
g_object_class_install_property
|
2007-03-22 18:21:59 +00:00
|
|
|
(gobject_class, PROP_CURSOR_VISIBLE,
|
|
|
|
g_param_spec_boolean ("cursor-visible",
|
|
|
|
"Cursor Visible",
|
|
|
|
"Whether the mouse pointer is visible on the main stage ",
|
2006-05-29 08:59:36 +00:00
|
|
|
FALSE,
|
2006-12-04 16:26:35 +00:00
|
|
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
2006-05-29 08:59:36 +00: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 13:38:31 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
(gobject_class, PROP_COLOR,
|
|
|
|
g_param_spec_boxed ("color",
|
|
|
|
"Color",
|
2007-03-22 18:21:59 +00: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 13:38:31 +00:00
|
|
|
CLUTTER_TYPE_COLOR,
|
2006-12-04 16:26:35 +00:00
|
|
|
CLUTTER_PARAM_READWRITE));
|
2007-03-23 09:59:02 +00:00
|
|
|
/**
|
|
|
|
* ClutterStage::event:
|
|
|
|
* @stage: the actor which received the event
|
|
|
|
* @event: a #ClutterEvent
|
|
|
|
*
|
|
|
|
* The ::event signal is emitted each time and event is received
|
|
|
|
* by the @stage.
|
|
|
|
*/
|
|
|
|
stage_signals[EVENT] =
|
|
|
|
g_signal_new ("event",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, event),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2006-12-13 18:12:09 +00:00
|
|
|
/**
|
|
|
|
* ClutterStage::button-press-event:
|
|
|
|
* @stage: the actor which received the event
|
|
|
|
* @event: a #ClutterButtonEvent
|
|
|
|
*
|
2007-03-22 18:21:59 +00:00
|
|
|
* The ::button-press-event signal is emitted each time a mouse button
|
2006-12-13 18:12:09 +00:00
|
|
|
* is pressed on @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 13:38:31 +00:00
|
|
|
stage_signals[BUTTON_PRESS_EVENT] =
|
|
|
|
g_signal_new ("button-press-event",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, button_press_event),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
2007-03-23 09:44:21 +00:00
|
|
|
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2006-12-13 18:12:09 +00:00
|
|
|
/**
|
|
|
|
* ClutterStage::button-release-event:
|
|
|
|
* @stage: the actor which received the event
|
|
|
|
* @event: a #ClutterButtonEvent
|
|
|
|
*
|
2007-03-22 18:21:59 +00:00
|
|
|
* The ::button-release-event signal is emitted each time a mouse button
|
2006-12-13 18:12:09 +00:00
|
|
|
* is released on @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 13:38:31 +00:00
|
|
|
stage_signals[BUTTON_RELEASE_EVENT] =
|
|
|
|
g_signal_new ("button-release-event",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, button_release_event),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
2007-03-23 09:44:21 +00:00
|
|
|
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2007-03-22 18:21:59 +00:00
|
|
|
/**
|
|
|
|
* ClutterStage::scroll-event:
|
|
|
|
* @stage: the actor which received the event
|
|
|
|
* @event: a #ClutterScrollEvent
|
|
|
|
*
|
|
|
|
* The ::scroll-event signal is emitted each time a the mouse is
|
|
|
|
* scrolled on @stage
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
stage_signals[SCROLL_EVENT] =
|
|
|
|
g_signal_new ("scroll-event",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, scroll_event),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
2007-03-23 09:44:21 +00:00
|
|
|
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2006-12-13 18:12:09 +00:00
|
|
|
/**
|
|
|
|
* ClutterStage::key-press-event:
|
|
|
|
* @stage: the actor which received the event
|
|
|
|
* @event: a #ClutterKeyEvent
|
|
|
|
*
|
2007-03-22 18:21:59 +00:00
|
|
|
* The ::key-press-event signal is emitted each time a keyboard button
|
2006-12-13 18:12:09 +00:00
|
|
|
* is pressed on @stage.
|
|
|
|
*/
|
|
|
|
stage_signals[KEY_PRESS_EVENT] =
|
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 13:38:31 +00:00
|
|
|
g_signal_new ("key-press-event",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, key_press_event),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
2007-03-23 09:44:21 +00:00
|
|
|
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2006-12-13 18:12:09 +00:00
|
|
|
/**
|
|
|
|
* ClutterStage::key-release-event:
|
|
|
|
* @stage: the actor which received the event
|
|
|
|
* @event: a #ClutterKeyEvent
|
|
|
|
*
|
2007-03-22 18:21:59 +00:00
|
|
|
* The ::key-release-event signal is emitted each time a keyboard button
|
2006-12-13 18:12:09 +00:00
|
|
|
* is released on @stage.
|
|
|
|
*/
|
|
|
|
stage_signals[KEY_RELEASE_EVENT] =
|
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 13:38:31 +00:00
|
|
|
g_signal_new ("key-release-event",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, key_release_event),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
2007-03-23 09:44:21 +00:00
|
|
|
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2006-12-13 18:12:09 +00:00
|
|
|
/**
|
|
|
|
* ClutterStage::motion-event:
|
|
|
|
* @stage: the actor which received the event
|
|
|
|
* @event: a #ClutterMotionEvent
|
|
|
|
*
|
2007-03-22 18:21:59 +00:00
|
|
|
* The ::motion-event signal is emitted each time the mouse pointer is
|
2006-12-13 18:12:09 +00:00
|
|
|
* moved on @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 13:38:31 +00:00
|
|
|
stage_signals[MOTION_EVENT] =
|
|
|
|
g_signal_new ("motion-event",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, motion_event),
|
|
|
|
NULL, NULL,
|
|
|
|
clutter_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
2007-03-23 09:44:21 +00:00
|
|
|
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2006-12-27 18:25:43 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
stage_signals[DELETE_EVENT] =
|
|
|
|
g_signal_new ("delete-event",
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (ClutterStageClass, delete_event),
|
2007-03-23 09:44:21 +00:00
|
|
|
_clutter_boolean_accumulator, NULL,
|
|
|
|
clutter_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_BOOLEAN, 1,
|
|
|
|
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
|
2007-03-22 18:21:59 +00: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 13:38:31 +00:00
|
|
|
g_type_class_add_private (gobject_class, sizeof (ClutterStagePrivate));
|
2006-05-29 08:59:36 +00: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 17:52:57 +00:00
|
|
|
|
|
|
|
/* a stage is a top-level object */
|
|
|
|
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IS_TOPLEVEL);
|
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 13:38:31 +00:00
|
|
|
|
|
|
|
self->priv = priv = CLUTTER_STAGE_GET_PRIVATE (self);
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
priv->is_offscreen = FALSE;
|
|
|
|
priv->is_fullscreen = FALSE;
|
|
|
|
priv->is_cursor_visible = FALSE;
|
2006-05-29 08:59:36 +00: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 13:38:31 +00:00
|
|
|
priv->color.red = 0xff;
|
|
|
|
priv->color.green = 0xff;
|
|
|
|
priv->color.blue = 0xff;
|
|
|
|
priv->color.alpha = 0xff;
|
|
|
|
|
2006-06-13 13:17:45 +00:00
|
|
|
clutter_actor_set_size (CLUTTER_ACTOR (self), 640, 480);
|
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 13:38:31 +00: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 18:21:59 +00: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 13:38:31 +00:00
|
|
|
*
|
2006-07-17 09:10:08 +00:00
|
|
|
* Return value: the main #ClutterStage. You should never
|
2007-03-22 18:21:59 +00: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 13:38:31 +00:00
|
|
|
*/
|
2006-06-13 13:17:45 +00: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 13:38:31 +00:00
|
|
|
clutter_stage_get_default (void)
|
|
|
|
{
|
2007-03-22 18:21:59 +00: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 13:38:31 +00:00
|
|
|
|
2007-03-23 17:55:13 +00:00
|
|
|
return _clutter_backend_get_stage (context->backend);
|
2006-05-29 08:59:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_stage_set_color
|
|
|
|
* @stage: A #ClutterStage
|
|
|
|
* @color: A #ClutterColor
|
|
|
|
*
|
|
|
|
* 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 13:38:31 +00:00
|
|
|
clutter_stage_set_color (ClutterStage *stage,
|
|
|
|
const ClutterColor *color)
|
2006-05-29 08:59:36 +00: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 13:38:31 +00:00
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
g_return_if_fail (color != NULL);
|
|
|
|
|
|
|
|
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 08:59:36 +00:00
|
|
|
|
2006-06-13 13:17:45 +00:00
|
|
|
if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (stage)))
|
|
|
|
clutter_actor_queue_redraw (CLUTTER_ACTOR (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 13:38:31 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (stage), "color");
|
2006-05-29 08:59:36 +00: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 13:38:31 +00:00
|
|
|
* clutter_stage_get_color
|
2006-05-29 08:59:36 +00: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 13:38:31 +00:00
|
|
|
* @color: return location for a #ClutterColor
|
2006-05-29 08:59:36 +00:00
|
|
|
*
|
2006-06-21 23:19:59 +00: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 13:38:31 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_get_color (ClutterStage *stage,
|
|
|
|
ClutterColor *color)
|
2006-05-29 08:59:36 +00: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 13:38:31 +00:00
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
g_return_if_fail (color != NULL);
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
|
|
|
|
color->red = priv->color.red;
|
|
|
|
color->green = priv->color.green;
|
|
|
|
color->blue = priv->color.blue;
|
|
|
|
color->alpha = priv->color.alpha;
|
2006-05-29 08:59:36 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 18:21:59 +00: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 08:59:36 +00:00
|
|
|
{
|
2007-03-22 18:21:59 +00:00
|
|
|
ClutterStagePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
priv = stage->priv;
|
|
|
|
if (!priv->is_fullscreen)
|
|
|
|
{
|
|
|
|
priv->is_fullscreen = TRUE;
|
|
|
|
|
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen)
|
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen (stage, TRUE);
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (stage), "fullscreen");
|
|
|
|
}
|
2006-05-29 08:59:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2007-03-22 18:21:59 +00:00
|
|
|
* clutter_stage_unfullscreen:
|
|
|
|
* @stage: a #ClutterStage
|
2006-05-29 08:59:36 +00:00
|
|
|
*
|
2007-03-22 18:21:59 +00: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 08:59:36 +00:00
|
|
|
{
|
2006-06-08 21:28:05 +00: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 13:38:31 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2006-06-08 21:28:05 +00:00
|
|
|
priv = stage->priv;
|
2007-03-22 18:21:59 +00:00
|
|
|
if (priv->is_fullscreen)
|
|
|
|
{
|
|
|
|
priv->is_fullscreen = FALSE;
|
2006-06-08 21:28:05 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen)
|
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen (stage, FALSE);
|
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 13:38:31 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
g_object_notify (G_OBJECT (stage), "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 13:38:31 +00:00
|
|
|
|
2007-03-22 18:21:59 +00: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 13:38:31 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
priv = stage->priv;
|
|
|
|
if (!priv->is_cursor_visible)
|
2006-06-08 21:28:05 +00:00
|
|
|
{
|
2007-03-22 18:21:59 +00:00
|
|
|
priv->is_cursor_visible = TRUE;
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible)
|
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible (stage, TRUE);
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
g_object_notify (G_OBJECT (stage), "cursor-visible");
|
2006-06-08 21:28:05 +00:00
|
|
|
}
|
2006-05-29 08:59:36 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
/**
|
|
|
|
* clutter_stage_hide_cursor:
|
|
|
|
* @stage:
|
|
|
|
*
|
|
|
|
* Hides the cursor as invisible on the stage window
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_stage_hide_cursor (ClutterStage *stage)
|
2007-01-23 20:29:11 +00:00
|
|
|
{
|
2007-03-22 18:21:59 +00:00
|
|
|
ClutterStagePrivate *priv;
|
2007-01-23 20:29:11 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
2007-01-23 20:29:11 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
priv = stage->priv;
|
|
|
|
if (priv->is_cursor_visible)
|
|
|
|
{
|
|
|
|
priv->is_cursor_visible = FALSE;
|
2007-01-23 20:29:11 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
if (CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible)
|
|
|
|
CLUTTER_STAGE_GET_CLASS (stage)->set_cursor_visible (stage, FALSE);
|
2007-01-23 20:29:11 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
g_object_notify (G_OBJECT (stage), "cursor-visible");
|
|
|
|
}
|
|
|
|
}
|
2007-01-23 20:29:11 +00:00
|
|
|
|
2007-03-22 18:21:59 +00: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 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
|
|
|
g_return_val_if_fail (x >= 0 && y >= 0, NULL);
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
klass = CLUTTER_STAGE_GET_CLASS (stage);
|
|
|
|
if (klass->draw_to_pixbuf)
|
|
|
|
{
|
|
|
|
GdkPixbuf *retval = NULL;
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
klass->draw_to_pixbuf (stage, retval, x, y, width, height);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-29 10:41:23 +00:00
|
|
|
#ifndef FIXED_PERSPECTIVE
|
|
|
|
/*
|
|
|
|
* Original floating point implementaiton of the perspective function,
|
|
|
|
* retained for reference purposes
|
|
|
|
*/
|
2007-03-25 11:47:30 +00:00
|
|
|
static inline void
|
|
|
|
frustum (GLfloat left,
|
|
|
|
GLfloat right,
|
|
|
|
GLfloat bottom,
|
|
|
|
GLfloat top,
|
|
|
|
GLfloat nearval,
|
|
|
|
GLfloat farval)
|
|
|
|
{
|
|
|
|
GLfloat x, y, a, b, c, d;
|
|
|
|
GLfloat m[16];
|
|
|
|
|
|
|
|
x = (2.0 * nearval) / (right - left);
|
|
|
|
y = (2.0 * nearval) / (top - bottom);
|
|
|
|
a = (right + left) / (right - left);
|
|
|
|
b = (top + bottom) / (top - bottom);
|
|
|
|
c = -(farval + nearval) / ( farval - nearval);
|
|
|
|
d = -(2.0 * farval * nearval) / (farval - nearval);
|
|
|
|
|
|
|
|
#define M(row,col) m[col*4+row]
|
|
|
|
M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F;
|
|
|
|
M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F;
|
|
|
|
M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d;
|
|
|
|
M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F;
|
|
|
|
#undef M
|
|
|
|
|
|
|
|
glMultMatrixf (m);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
perspective (GLfloat fovy,
|
|
|
|
GLfloat aspect,
|
|
|
|
GLfloat zNear,
|
|
|
|
GLfloat zFar)
|
|
|
|
{
|
|
|
|
GLfloat xmin, xmax, ymin, ymax;
|
|
|
|
|
2007-03-29 11:30:30 +00:00
|
|
|
ymax = zNear * tan (fovy * M_PI / 360.0);
|
2007-03-25 11:47:30 +00:00
|
|
|
ymin = -ymax;
|
|
|
|
xmin = ymin * aspect;
|
|
|
|
xmax = ymax * aspect;
|
|
|
|
|
2007-03-29 10:41:23 +00:00
|
|
|
printf ("%f, %f, %f, %f\n", xmin, xmax, ymin, ymax);
|
|
|
|
|
2007-03-25 11:47:30 +00:00
|
|
|
frustum (xmin, xmax, ymin, ymax, zNear, zFar);
|
|
|
|
}
|
2007-03-29 10:41:23 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fixed point implementation of the perspective function
|
|
|
|
*/
|
|
|
|
static inline void
|
|
|
|
perspectivex (ClutterAngle fovy,
|
|
|
|
ClutterFixed aspect,
|
|
|
|
ClutterFixed zNear,
|
|
|
|
ClutterFixed zFar)
|
|
|
|
{
|
|
|
|
ClutterFixed xmax, ymax;
|
|
|
|
ClutterFixed x, y, c, d;
|
|
|
|
|
2007-03-29 11:30:30 +00:00
|
|
|
#ifndef USING_GLES
|
|
|
|
GLfloat m[16];
|
|
|
|
#else
|
|
|
|
GLfixed m[16];
|
|
|
|
#endif
|
|
|
|
|
2007-03-29 10:41:23 +00:00
|
|
|
memset (&m[0], 0, sizeof (m));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Based on the original algorithm in perspective():
|
|
|
|
*
|
|
|
|
* 1) xmin = -xmax => xmax + xmin == 0 && xmax - xmin == 2 * xmax
|
|
|
|
* same true for y, hence: a == 0 && b == 0;
|
|
|
|
*
|
|
|
|
* 2) When working with small numbers, we can are loosing significant
|
|
|
|
* precision, hence we use clutter_qmulx() here, not the fast macro.
|
|
|
|
*/
|
2007-03-29 11:30:30 +00:00
|
|
|
ymax = clutter_qmulx (zNear, clutter_tani (fovy >> 1));
|
2007-03-29 10:41:23 +00:00
|
|
|
xmax = clutter_qmulx (ymax, aspect);
|
|
|
|
|
|
|
|
x = CFX_DIV (zNear, xmax);
|
|
|
|
y = CFX_DIV (zNear, ymax);
|
|
|
|
c = CFX_DIV (-(zFar + zNear), ( zFar - zNear));
|
|
|
|
d = CFX_DIV (-(clutter_qmulx (2*zFar, zNear)), (zFar - zNear));
|
|
|
|
|
|
|
|
#define M(row,col) m[col*4+row]
|
2007-03-29 11:30:30 +00:00
|
|
|
#ifndef USING_GLES
|
2007-03-29 10:41:23 +00:00
|
|
|
M(0,0) = CLUTTER_FIXED_TO_FLOAT (x);
|
|
|
|
M(1,1) = CLUTTER_FIXED_TO_FLOAT (y);
|
|
|
|
M(2,2) = CLUTTER_FIXED_TO_FLOAT (c);
|
|
|
|
M(2,3) = CLUTTER_FIXED_TO_FLOAT (d);
|
|
|
|
M(3,2) = -1.0F;
|
2007-03-29 11:30:30 +00:00
|
|
|
|
2007-03-29 10:41:23 +00:00
|
|
|
glMultMatrixf (m);
|
2007-03-29 11:30:30 +00:00
|
|
|
#else
|
|
|
|
M(0,0) = x;
|
|
|
|
M(1,1) = y;
|
|
|
|
M(2,2) = c;
|
|
|
|
M(2,3) = d;
|
|
|
|
M(3,2) = 1 + ~CFX_ONE;
|
|
|
|
|
|
|
|
glMultMatrixx (m);
|
|
|
|
#endif
|
|
|
|
#undef M
|
2007-03-29 10:41:23 +00:00
|
|
|
}
|
|
|
|
#endif
|
2007-03-25 11:47:30 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
_clutter_stage_sync_viewport (ClutterStage *stage)
|
|
|
|
{
|
|
|
|
ClutterActor *actor;
|
|
|
|
gint width, height;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
|
|
|
|
|
|
actor = CLUTTER_ACTOR (stage);
|
|
|
|
|
|
|
|
width = clutter_actor_get_width (actor);
|
|
|
|
height = clutter_actor_get_height (actor);
|
|
|
|
|
|
|
|
glViewport (0, 0, width, height);
|
|
|
|
|
|
|
|
glMatrixMode (GL_PROJECTION);
|
|
|
|
glLoadIdentity ();
|
2007-03-29 10:41:23 +00:00
|
|
|
|
|
|
|
#ifndef FIXED_PERSPECTIVE
|
2007-03-29 11:30:30 +00:00
|
|
|
perspective (60.0f, 1.0f, 0.1f, 100.0f);
|
2007-03-29 10:41:23 +00:00
|
|
|
#else
|
2007-03-29 11:30:30 +00:00
|
|
|
perspectivex (171, /* 60 degrees */
|
2007-03-29 10:41:23 +00:00
|
|
|
CFX_ONE,
|
|
|
|
CLUTTER_FLOAT_TO_FIXED (0.1),
|
|
|
|
CLUTTER_FLOAT_TO_FIXED (100.0));
|
|
|
|
#endif
|
2007-03-25 11:47:30 +00:00
|
|
|
|
|
|
|
glMatrixMode (GL_MODELVIEW);
|
|
|
|
glLoadIdentity ();
|
|
|
|
|
|
|
|
/* Then for 2D like transform */
|
|
|
|
|
|
|
|
/* camera distance from screen, 0.5 * tan (FOV) */
|
|
|
|
#define DEFAULT_Z_CAMERA 0.866025404f
|
|
|
|
|
|
|
|
glTranslatef (-0.5f, -0.5f, -DEFAULT_Z_CAMERA);
|
|
|
|
glScalef ( 1.0f / width,
|
|
|
|
-1.0f / height,
|
|
|
|
1.0f / width);
|
|
|
|
glTranslatef (0.0f, -1.0 * height, 0.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_stage_get_actor_at_pos:
|
|
|
|
* @stage:
|
|
|
|
* @x:
|
|
|
|
* @y:
|
|
|
|
*
|
|
|
|
* FIXME
|
|
|
|
*
|
|
|
|
* Return value: the actor at the specified coordinates, if any
|
|
|
|
*/
|
2007-03-22 18:21:59 +00:00
|
|
|
ClutterActor *
|
|
|
|
clutter_stage_get_actor_at_pos (ClutterStage *stage,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
2007-03-25 11:47:30 +00:00
|
|
|
ClutterActor *found = NULL;
|
|
|
|
GLuint buff[64] = { 0 };
|
|
|
|
GLint hits;
|
|
|
|
GLint view[4];
|
|
|
|
|
2007-03-22 18:21:59 +00:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
2007-03-25 11:47:30 +00:00
|
|
|
|
|
|
|
glSelectBuffer (sizeof (buff), buff);
|
|
|
|
glGetIntegerv (GL_VIEWPORT, view);
|
|
|
|
glRenderMode (GL_SELECT);
|
|
|
|
|
|
|
|
glInitNames ();
|
|
|
|
|
|
|
|
glPushName (0);
|
|
|
|
|
|
|
|
glMatrixMode (GL_PROJECTION);
|
|
|
|
glPushMatrix ();
|
|
|
|
glLoadIdentity ();
|
|
|
|
|
|
|
|
/* This is gluPickMatrix(x, y, 1.0, 1.0, view); */
|
|
|
|
glTranslatef ((view[2] - 2 * (x - view[0])),
|
|
|
|
(view[3] - 2 * (y - view[1])), 0);
|
|
|
|
glScalef (view[2], -view[3], 1.0);
|
|
|
|
|
2007-03-29 10:41:23 +00:00
|
|
|
#ifndef FIXED_PERSPECTIVE
|
2007-03-29 11:30:30 +00:00
|
|
|
perspective (60.0f, 1.0f, 0.1f, 100.0f);
|
2007-03-29 10:41:23 +00:00
|
|
|
#else
|
2007-03-29 11:30:30 +00:00
|
|
|
perspectivex (171, /* 60 degrees */
|
2007-03-29 10:41:23 +00:00
|
|
|
CFX_ONE,
|
|
|
|
CLUTTER_FLOAT_TO_FIXED (0.1),
|
|
|
|
CLUTTER_FLOAT_TO_FIXED (100.0));
|
|
|
|
#endif
|
2007-03-25 11:47:30 +00:00
|
|
|
|
|
|
|
glMatrixMode (GL_MODELVIEW);
|
2006-05-29 08:59:36 +00:00
|
|
|
|
2007-03-25 11:47:30 +00:00
|
|
|
clutter_actor_paint (CLUTTER_ACTOR (stage));
|
|
|
|
|
|
|
|
glMatrixMode (GL_PROJECTION);
|
|
|
|
glPopMatrix ();
|
|
|
|
|
|
|
|
hits = glRenderMode (GL_RENDER);
|
|
|
|
|
|
|
|
if (hits != 0)
|
2006-05-29 08:59:36 +00:00
|
|
|
{
|
2007-03-25 11:47:30 +00:00
|
|
|
#if 0
|
|
|
|
gint i
|
|
|
|
for (i = 0; i < hits; i++)
|
|
|
|
g_print ("Hit at %i\n", buff[i * 4 + 3]);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
found = clutter_group_find_child_by_id (CLUTTER_GROUP (stage),
|
|
|
|
buff[(hits-1) * 4 + 3]);
|
2006-05-29 08:59:36 +00:00
|
|
|
}
|
|
|
|
|
2007-03-25 11:47:30 +00:00
|
|
|
_clutter_stage_sync_viewport (stage);
|
|
|
|
|
|
|
|
return found;
|
2006-05-29 08:59:36 +00:00
|
|
|
}
|
2007-03-26 23:18:39 +00: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.
|
|
|
|
*
|
|
|
|
* Since: 0.2
|
|
|
|
*/
|
|
|
|
ClutterPerspective *
|
|
|
|
clutter_perspective_copy (const ClutterPerspective *perspective)
|
|
|
|
{
|
|
|
|
ClutterPerspective *result;
|
|
|
|
|
|
|
|
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 10:46:40 +00:00
|
|
|
* Since: 0.4
|
2007-03-26 23:18:39 +00: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;
|
|
|
|
|
|
|
|
if (!our_type)
|
|
|
|
our_type = g_boxed_type_register_static
|
|
|
|
("ClutterPerspective",
|
|
|
|
(GBoxedCopyFunc) clutter_perspective_copy,
|
|
|
|
(GBoxedFreeFunc) clutter_perspective_free);
|
|
|
|
return our_type;
|
|
|
|
}
|