2010-08-25 16:53:46 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
2010-11-12 09:32:04 +00:00
|
|
|
ClutterActor *stage;
|
|
|
|
ClutterScript *ui;
|
2010-08-25 16:53:46 +00:00
|
|
|
|
|
|
|
gchar *filename = "script-ui.json";
|
|
|
|
GError *error = NULL;
|
|
|
|
|
2010-11-12 09:32:04 +00:00
|
|
|
clutter_init (&argc, &argv);
|
|
|
|
|
|
|
|
ui = clutter_script_new ();
|
|
|
|
|
2010-08-26 16:07:21 +00:00
|
|
|
/* load a JSON file into the script */
|
2010-08-25 16:53:46 +00:00
|
|
|
clutter_script_load_from_file (ui, filename, &error);
|
|
|
|
|
|
|
|
if (error != NULL)
|
|
|
|
{
|
|
|
|
g_critical ("Error loading ClutterScript file %s\n%s", filename, error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
|
2010-08-26 16:07:21 +00:00
|
|
|
/* retrieve objects from the script */
|
2010-08-25 16:53:46 +00:00
|
|
|
clutter_script_get_objects (ui,
|
|
|
|
"stage", &stage,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
clutter_actor_show (stage);
|
|
|
|
|
|
|
|
clutter_main ();
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|