mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
2007-10-12 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-script.c (construct_timline), (parse_member_to_property): Transfer ownership of the implicit timelines to the behaviour, so that they get unreferenced when the behaviour is destroyed. (parse_member_to_property): Reverse the list of children and behaviours.
This commit is contained in:
parent
174bd04b49
commit
abc529aaec
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2007-10-12 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
|
* clutter/clutter-script.c (construct_timline),
|
||||||
|
(parse_member_to_property): Transfer ownership of the
|
||||||
|
implicit timelines to the behaviour, so that they get
|
||||||
|
unreferenced when the behaviour is destroyed.
|
||||||
|
|
||||||
|
(parse_member_to_property): Reverse the list of children
|
||||||
|
and behaviours.
|
||||||
|
|
||||||
2007-10-12 Tomas Frydrych <tf@o-hand.com>
|
2007-10-12 Tomas Frydrych <tf@o-hand.com>
|
||||||
|
|
||||||
Portability fixes:
|
Portability fixes:
|
||||||
|
@ -146,7 +146,6 @@ struct _ClutterScriptPrivate
|
|||||||
guint last_merge_id;
|
guint last_merge_id;
|
||||||
|
|
||||||
JsonParser *parser;
|
JsonParser *parser;
|
||||||
ObjectInfo *current;
|
|
||||||
|
|
||||||
gchar *filename;
|
gchar *filename;
|
||||||
guint is_filename : 1;
|
guint is_filename : 1;
|
||||||
@ -348,8 +347,8 @@ construct_timeline (ClutterScript *script,
|
|||||||
|
|
||||||
retval = CLUTTER_TIMELINE (clutter_script_construct_object (script, oinfo));
|
retval = CLUTTER_TIMELINE (clutter_script_construct_object (script, oinfo));
|
||||||
|
|
||||||
/* it needs to survive */
|
/* we transfer ownership to the alpha function later */
|
||||||
g_object_ref (retval);
|
oinfo->is_toplevel = FALSE;
|
||||||
object_info_free (oinfo);
|
object_info_free (oinfo);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
@ -434,6 +433,7 @@ parse_member_to_property (ClutterScript *script,
|
|||||||
ClutterTimeline *timeline = NULL;
|
ClutterTimeline *timeline = NULL;
|
||||||
ClutterAlphaFunc func = NULL;
|
ClutterAlphaFunc func = NULL;
|
||||||
JsonNode *val;
|
JsonNode *val;
|
||||||
|
gboolean unref_timeline = FALSE;
|
||||||
|
|
||||||
retval = g_slice_new (PropertyInfo);
|
retval = g_slice_new (PropertyInfo);
|
||||||
retval->property_name = g_strdup (name);
|
retval->property_name = g_strdup (name);
|
||||||
@ -452,17 +452,21 @@ parse_member_to_property (ClutterScript *script,
|
|||||||
CLUTTER_TIMELINE (clutter_script_get_object (script, id));
|
CLUTTER_TIMELINE (clutter_script_get_object (script, id));
|
||||||
}
|
}
|
||||||
else if (JSON_NODE_TYPE (val) == JSON_NODE_OBJECT)
|
else if (JSON_NODE_TYPE (val) == JSON_NODE_OBJECT)
|
||||||
timeline = construct_timeline (script, json_node_get_object (val));
|
{
|
||||||
|
timeline = construct_timeline (script, json_node_get_object (val));
|
||||||
|
unref_timeline = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val = json_object_get_member (object, "function");
|
val = json_object_get_member (object, "function");
|
||||||
if (val && json_node_get_string (val) != NULL)
|
if (val && json_node_get_string (val) != NULL)
|
||||||
func = resolve_alpha_func (json_node_get_string (val));
|
func = resolve_alpha_func (json_node_get_string (val));
|
||||||
|
|
||||||
alpha = g_object_new (CLUTTER_TYPE_ALPHA,
|
alpha = g_object_new (CLUTTER_TYPE_ALPHA, NULL);
|
||||||
"timeline", timeline,
|
|
||||||
NULL);
|
|
||||||
clutter_alpha_set_func (alpha, func, NULL, NULL);
|
clutter_alpha_set_func (alpha, func, NULL, NULL);
|
||||||
|
clutter_alpha_set_timeline (alpha, timeline);
|
||||||
|
if (unref_timeline)
|
||||||
|
g_object_unref (timeline);
|
||||||
|
|
||||||
g_value_init (&retval->value, CLUTTER_TYPE_ALPHA);
|
g_value_init (&retval->value, CLUTTER_TYPE_ALPHA);
|
||||||
g_value_set_object (&retval->value, G_OBJECT (alpha));
|
g_value_set_object (&retval->value, G_OBJECT (alpha));
|
||||||
@ -598,9 +602,9 @@ parse_member_to_property (ClutterScript *script,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name[0] == 'c') /* children */
|
if (name[0] == 'c') /* children */
|
||||||
info->children = children;
|
info->children = g_list_reverse (children);
|
||||||
else
|
else
|
||||||
info->behaviours = children;
|
info->behaviours = g_list_reverse (children);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user