mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 01:36:10 -05:00
d7a8fa8b53
* 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.
80 lines
2.0 KiB
JSON
80 lines
2.0 KiB
JSON
{
|
|
"My Scene" : {
|
|
"id" : "main-stage",
|
|
"type" : "ClutterStage",
|
|
"title" : "ClutterScript test",
|
|
"color" : "white",
|
|
"signals" : [
|
|
{ "name" : "key-press-event", "handler" : "clutter_main_quit" },
|
|
{ "name" : "destroy", "handler" : "clutter_main_quit" }
|
|
],
|
|
"children" : [
|
|
{
|
|
"id" : "red-button",
|
|
"type" : "ClutterRectangle",
|
|
"color" : "#ff0000ff",
|
|
"x" : 50, "y" : 50, "width" : 100, "height" : 100,
|
|
"reactive" : true,
|
|
"rotation" : [
|
|
{ "z-axis" : [ 45.0, [ 75, 75 ] ] }
|
|
],
|
|
"behaviours" : [ "fade-behaviour", "path-behaviour" ]
|
|
},
|
|
{
|
|
"id" : "green-button",
|
|
"type" : "ClutterRectangle",
|
|
"color" : "#00ff00ff",
|
|
"border-width" : 5,
|
|
"border-color" : "#00cc00ff",
|
|
"x" : 200,
|
|
"y" : 50,
|
|
"width" : 100,
|
|
"height" : 100,
|
|
"reactive" : true,
|
|
"signals" : [
|
|
{ "name" : "button-press-event", "handler" : "clutter_main_quit" }
|
|
]
|
|
},
|
|
{
|
|
"id" : "red-hand",
|
|
"type" : "ClutterTexture",
|
|
"filename" : "redhand.png",
|
|
"x" : 100,
|
|
"y" : 100,
|
|
"width" : "20mm",
|
|
"height" : "100px",
|
|
"anchor-x" : "5mm",
|
|
"anchor-y" : "5pt",
|
|
"opacity" : 100,
|
|
"behaviours" : [ "rotate-behaviour", "fade-behaviour" ]
|
|
},
|
|
{
|
|
"id" : "red-hand-clone",
|
|
"type" : "ClutterCloneTexture",
|
|
"parent-texture" : "red-hand",
|
|
"x" : 250,
|
|
"y" : 150,
|
|
"opacity" : 100,
|
|
},
|
|
{
|
|
"id" : "label",
|
|
"type" : "ClutterLabel",
|
|
"x" : 50,
|
|
"y" : 200,
|
|
"width" : 400,
|
|
"text" : "Clutter\tScript",
|
|
"font-name" : "Sans 24px",
|
|
"color" : "black",
|
|
"alignment" : "center",
|
|
"wrap" : false,
|
|
"ellipsize" : "none",
|
|
"rotation" : [
|
|
{ "y-axis" : [ 60.0, [ 275, 100 ] ] },
|
|
{ "z-axis" : [ 45.0, [ 75, 75 ] ] }
|
|
]
|
|
},
|
|
"blue-button",
|
|
]
|
|
}
|
|
}
|