mutter/tests/test-script.json
Emmanuele Bassi f04a0a4645 2007-11-30 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c (parse_units),
	(clutter_actor_parse_custom_node),
	(clutter_scriptable_iface_init): Override the parsing code
	for the x, y, width and height properties of ClutterActor,
	to allow strings with modifiers when defining the position
	and/or the dimensions of an actor. Bare integers are assumed
	as pixels; floating point values in the [0, 1] interval are
	assumed as percentages; strings can have these modifiers:

	  - px - pixels
	  - mm - millimeters
	  - pt - points (at the current resolution)
	  - %  - percentage of the stage

	* clutter/clutter-units.h: Fix the conversion macros

	* tests/test-script.json: Test the new values.
2007-11-30 09:27:10 +00:00

76 lines
1.8 KiB
JSON

{
"My Scene" : {
"id" : "main-stage",
"type" : "ClutterStage",
"color" : "white",
"width" : 500,
"height" : "400px",
"signals" : [
{ "name" : "key-press-event", "handler" : "clutter_main_quit" }
],
"children" : [
{
"id" : "red-button",
"type" : "ClutterRectangle",
"color" : "#ff0000ff",
"x" : 50, "y" : 50, "width" : 100, "height" : 100,
"visible" : true,
"reactive" : true,
"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,
"visible" : true,
"reactive" : true
"signals" : [
{ "name" : "button-press-event", "handler" : "clutter_main_quit" }
]
},
{
"id" : "red-hand",
"type" : "ClutterTexture",
"pixbuf" : "redhand.png",
"x" : "50%",
"y" : "50%",
"width" : "20mm",
"height" : "100px",
"opacity" : 100,
"visible" : true,
"behaviours" : [ "rotate-behaviour", "fade-behaviour" ]
},
{
"id" : "red-hand-clone",
"type" : "ClutterCloneTexture",
"parent-texture" : "red-hand",
"x" : 250,
"y" : 150,
"opacity" : 100,
"visible" : true
},
{
"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",
"visible" : true
}
"blue-button",
]
}
}