2007-10-18 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-script-private.h:
	* clutter/clutter-script.h:
	* clutter/clutter-script.c: Allow id-less objects: as long
	as they have a "type" member, a unique id will be provided.

	(json_object_end): Add merge id to the object information
	structure.

	(apply_behaviours), (add_children): Keep the unresolved
	objects around.

	(construct_stage), (clutter_script_construct_object): If an
	object has unresolved children or behaviours try resolving
	them when we ask for it.

	(json_parse_end), (clutter_script_ensure_objects): Ensure
	that the objects are fully constructed as best as we can when
	finished parsing.

	(object_info_free), (remove_by_merge_id):
	(clutter_script_unmerge_objects): Remove objects under the
	same merge id returned by the loading functions. (Fixes
	bug #558)
This commit is contained in:
Emmanuele Bassi
2007-10-18 12:31:07 +00:00
parent 1ccbe04505
commit f1105807fb
8 changed files with 315 additions and 124 deletions

View File

@ -82,21 +82,24 @@ struct _ClutterScriptClass
void (*_clutter_reserved8) (void);
};
GType clutter_script_get_type (void) G_GNUC_CONST;
GType clutter_script_get_type (void) G_GNUC_CONST;
ClutterScript *clutter_script_new (void);
guint clutter_script_load_from_file (ClutterScript *script,
const gchar *filename,
GError **error);
guint clutter_script_load_from_data (ClutterScript *script,
const gchar *data,
gsize length,
GError **error);
GObject * clutter_script_get_object (ClutterScript *script,
const gchar *name);
GList * clutter_script_get_objects (ClutterScript *script,
const gchar *first_name,
...) G_GNUC_NULL_TERMINATED;
ClutterScript *clutter_script_new (void);
guint clutter_script_load_from_file (ClutterScript *script,
const gchar *filename,
GError **error);
guint clutter_script_load_from_data (ClutterScript *script,
const gchar *data,
gsize length,
GError **error);
GObject * clutter_script_get_object (ClutterScript *script,
const gchar *name);
GList * clutter_script_get_objects (ClutterScript *script,
const gchar *first_name,
...) G_GNUC_NULL_TERMINATED;
void clutter_script_unmerge_objects (ClutterScript *script,
guint merge_id);
void clutter_script_ensure_objects (ClutterScript *script);
G_END_DECLS