mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
2008-05-09 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-script-private.h: Add a flag for the default stage. * clutter/clutter-script.c: (json_object_end): If the "type" member is "ClutterStage" and we have a "is-default" member set to true then this is the default stage. (clutter_script_construct_object): Special case the default stage instead of each ClutterStage. (object_info_free): Ditto as above. * tests/test-script.json: Test the creation of a non-default stage and the ::destroy handler to quit.
This commit is contained in:
parent
4f9738d3a3
commit
d7a8fa8b53
18
ChangeLog
18
ChangeLog
@ -1,3 +1,21 @@
|
|||||||
|
2008-05-09 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
|
* clutter/clutter-script-private.h: Add a flag for the
|
||||||
|
default stage.
|
||||||
|
|
||||||
|
* clutter/clutter-script.c:
|
||||||
|
(json_object_end): If the "type" member is "ClutterStage"
|
||||||
|
and we have a "is-default" member set to true then this
|
||||||
|
is the default stage.
|
||||||
|
|
||||||
|
(clutter_script_construct_object): Special case the default
|
||||||
|
stage instead of each ClutterStage.
|
||||||
|
|
||||||
|
(object_info_free): Ditto as above.
|
||||||
|
|
||||||
|
* tests/test-script.json: Test the creation of a non-default
|
||||||
|
stage and the ::destroy handler to quit.
|
||||||
|
|
||||||
2008-05-09 Emmanuele Bassi <ebassi@openedhand.com>
|
2008-05-09 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
Bug #908 - Support transform from G_TYPE_INT to ClutterUnit
|
Bug #908 - Support transform from G_TYPE_INT to ClutterUnit
|
||||||
|
@ -50,9 +50,10 @@ typedef struct {
|
|||||||
|
|
||||||
guint merge_id;
|
guint merge_id;
|
||||||
|
|
||||||
guint is_toplevel : 1;
|
guint is_stage_default : 1;
|
||||||
guint has_unresolved : 1;
|
guint is_toplevel : 1;
|
||||||
guint is_unmerged : 1;
|
guint has_unresolved : 1;
|
||||||
|
guint is_unmerged : 1;
|
||||||
} ObjectInfo;
|
} ObjectInfo;
|
||||||
|
|
||||||
void object_info_free (gpointer data);
|
void object_info_free (gpointer data);
|
||||||
|
@ -729,6 +729,17 @@ json_object_end (JsonParser *parser,
|
|||||||
json_object_remove_member (object, "signals");
|
json_object_remove_member (object, "signals");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp (oinfo->class_name, "ClutterStage") == 0 &&
|
||||||
|
json_object_has_member (object, "is-default"))
|
||||||
|
{
|
||||||
|
val = json_object_get_member (object, "is-default");
|
||||||
|
oinfo->is_stage_default = json_node_get_boolean (val);
|
||||||
|
|
||||||
|
json_object_remove_member (object, "is-default");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
oinfo->is_stage_default = FALSE;
|
||||||
|
|
||||||
oinfo->is_toplevel = FALSE;
|
oinfo->is_toplevel = FALSE;
|
||||||
oinfo->is_unmerged = FALSE;
|
oinfo->is_unmerged = FALSE;
|
||||||
oinfo->has_unresolved = TRUE;
|
oinfo->has_unresolved = TRUE;
|
||||||
@ -1246,9 +1257,9 @@ clutter_script_construct_object (ClutterScript *script,
|
|||||||
|
|
||||||
if (oinfo->object)
|
if (oinfo->object)
|
||||||
object = oinfo->object;
|
object = oinfo->object;
|
||||||
else if (oinfo->gtype == CLUTTER_TYPE_STAGE)
|
else if (oinfo->gtype == CLUTTER_TYPE_STAGE && oinfo->is_stage_default)
|
||||||
{
|
{
|
||||||
/* the stage is a complex beast: we cannot create it using
|
/* the default stage is a complex beast: we cannot create it using
|
||||||
* g_object_newv() but we need clutter_script_construct_parameters()
|
* g_object_newv() but we need clutter_script_construct_parameters()
|
||||||
* to add the GParamSpec to the PropertyInfo pspec member, so
|
* to add the GParamSpec to the PropertyInfo pspec member, so
|
||||||
* that we don't have to implement every complex property (like
|
* that we don't have to implement every complex property (like
|
||||||
@ -1459,7 +1470,7 @@ object_info_free (gpointer data)
|
|||||||
oinfo->object = NULL;
|
oinfo->object = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oinfo->is_unmerged && oinfo->object)
|
if (oinfo->is_unmerged && oinfo->object && !oinfo->is_stage_default)
|
||||||
{
|
{
|
||||||
clutter_actor_destroy (CLUTTER_ACTOR (oinfo->object));
|
clutter_actor_destroy (CLUTTER_ACTOR (oinfo->object));
|
||||||
oinfo->object = NULL;
|
oinfo->object = NULL;
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
"My Scene" : {
|
"My Scene" : {
|
||||||
"id" : "main-stage",
|
"id" : "main-stage",
|
||||||
"type" : "ClutterStage",
|
"type" : "ClutterStage",
|
||||||
|
"title" : "ClutterScript test",
|
||||||
"color" : "white",
|
"color" : "white",
|
||||||
"signals" : [
|
"signals" : [
|
||||||
{ "name" : "key-press-event", "handler" : "clutter_main_quit" }
|
{ "name" : "key-press-event", "handler" : "clutter_main_quit" },
|
||||||
|
{ "name" : "destroy", "handler" : "clutter_main_quit" }
|
||||||
],
|
],
|
||||||
"children" : [
|
"children" : [
|
||||||
{
|
{
|
||||||
@ -16,7 +18,7 @@
|
|||||||
"rotation" : [
|
"rotation" : [
|
||||||
{ "z-axis" : [ 45.0, [ 75, 75 ] ] }
|
{ "z-axis" : [ 45.0, [ 75, 75 ] ] }
|
||||||
],
|
],
|
||||||
"behaviours" : [ "fade-behaviour", "path-behaviour" ],
|
"behaviours" : [ "fade-behaviour", "path-behaviour" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id" : "green-button",
|
"id" : "green-button",
|
||||||
|
Loading…
Reference in New Issue
Block a user