mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
2007-10-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/json/json-object.c: Automatically transform every delimiter into an underscore. * clutter/clutter-script.c: Implement the "parent_texture" property translation for ClutterCloneTextures, using the passed id of the parent texture.
This commit is contained in:
parent
f6c83a224e
commit
143a5937e2
@ -1,3 +1,12 @@
|
||||
2007-10-16 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/json/json-object.c: Automatically transform every
|
||||
delimiter into an underscore.
|
||||
|
||||
* clutter/clutter-script.c: Implement the "parent_texture"
|
||||
property translation for ClutterCloneTextures, using the
|
||||
passed id of the parent texture.
|
||||
|
||||
2007-10-16 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-timeline.[ch]: Added ClutterTimeline:duration,
|
||||
|
@ -127,6 +127,7 @@
|
||||
#include "clutter-behaviour.h"
|
||||
#include "clutter-container.h"
|
||||
#include "clutter-stage.h"
|
||||
#include "clutter-texture.h"
|
||||
|
||||
#include "clutter-script.h"
|
||||
#include "clutter-script-private.h"
|
||||
@ -333,7 +334,9 @@ construct_timeline (ClutterScript *script,
|
||||
PropertyInfo *pinfo = g_slice_new0 (PropertyInfo);
|
||||
GValue value = { 0, };
|
||||
|
||||
pinfo->property_name = g_strdup (name);
|
||||
pinfo->property_name = g_strdelimit (g_strdup (name),
|
||||
G_STR_DELIMITERS,
|
||||
'-');
|
||||
|
||||
json_node_get_value (node, &value);
|
||||
g_value_init (&pinfo->value, G_VALUE_TYPE (&value));
|
||||
@ -417,7 +420,9 @@ parse_member_to_property (ClutterScript *script,
|
||||
{
|
||||
case JSON_NODE_VALUE:
|
||||
retval = g_slice_new0 (PropertyInfo);
|
||||
retval->property_name = g_strdup (name);
|
||||
retval->property_name = g_strdelimit (g_strdup (name),
|
||||
G_STR_DELIMITERS,
|
||||
'-');
|
||||
|
||||
json_node_get_value (node, &value);
|
||||
g_value_init (&retval->value, G_VALUE_TYPE (&value));
|
||||
@ -576,6 +581,7 @@ parse_member_to_property (ClutterScript *script,
|
||||
|
||||
retval = g_slice_new0 (PropertyInfo);
|
||||
retval->property_name = g_strdup (name);
|
||||
|
||||
g_value_init (&retval->value, CLUTTER_TYPE_GEOMETRY);
|
||||
g_value_set_boxed (&retval->value, &geom);
|
||||
}
|
||||
@ -723,6 +729,26 @@ translate_property (ClutterScript *script,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (strcmp (name, "parent_texture") == 0)
|
||||
{
|
||||
GObject *texture;
|
||||
const gchar *string;
|
||||
|
||||
if (G_VALUE_HOLDS (src, G_TYPE_STRING))
|
||||
string = g_value_get_string (src);
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
texture = clutter_script_get_object (script, string);
|
||||
if (!texture)
|
||||
return FALSE;
|
||||
|
||||
g_value_init (dest, CLUTTER_TYPE_TEXTURE);
|
||||
g_value_set_object (dest, texture);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* pixbufs are specified using the path to the file name; the
|
||||
* path can be absolute or relative to the current directory.
|
||||
* we need to load the pixbuf from the file and print a
|
||||
|
@ -147,6 +147,8 @@ json_object_add_member (JsonObject *object,
|
||||
const gchar *member_name,
|
||||
JsonNode *node)
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (member_name != NULL);
|
||||
g_return_if_fail (node != NULL);
|
||||
@ -159,7 +161,8 @@ json_object_add_member (JsonObject *object,
|
||||
return;
|
||||
}
|
||||
|
||||
g_hash_table_replace (object->members, g_strdup (member_name), node);
|
||||
name = g_strdelimit (g_strdup (member_name), G_STR_DELIMITERS, '_');
|
||||
g_hash_table_replace (object->members, name, node);
|
||||
}
|
||||
|
||||
/* FIXME: yuck. we really need to depend on GLib 2.14 */
|
||||
@ -222,10 +225,17 @@ JsonNode *
|
||||
json_object_get_member (JsonObject *object,
|
||||
const gchar *member_name)
|
||||
{
|
||||
gchar *name;
|
||||
JsonNode *retval;
|
||||
|
||||
g_return_val_if_fail (object != NULL, NULL);
|
||||
g_return_val_if_fail (member_name != NULL, NULL);
|
||||
|
||||
return g_hash_table_lookup (object->members, member_name);
|
||||
name = g_strdelimit (g_strdup (member_name), G_STR_DELIMITERS, '_');
|
||||
retval = g_hash_table_lookup (object->members, name);
|
||||
g_free (name);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -241,10 +251,17 @@ gboolean
|
||||
json_object_has_member (JsonObject *object,
|
||||
const gchar *member_name)
|
||||
{
|
||||
gchar *name;
|
||||
gboolean retval;
|
||||
|
||||
g_return_val_if_fail (object != NULL, FALSE);
|
||||
g_return_val_if_fail (member_name != NULL, FALSE);
|
||||
|
||||
return (g_hash_table_lookup (object->members, member_name) != NULL);
|
||||
|
||||
name = g_strdelimit (g_strdup (member_name), G_STR_DELIMITERS, '_');
|
||||
retval = (g_hash_table_lookup (object->members, name) != NULL);
|
||||
g_free (name);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -274,8 +291,12 @@ void
|
||||
json_object_remove_member (JsonObject *object,
|
||||
const gchar *member_name)
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (member_name != NULL);
|
||||
|
||||
g_hash_table_remove (object->members, member_name);
|
||||
name = g_strdelimit (g_strdup (member_name), G_STR_DELIMITERS, '_');
|
||||
g_hash_table_remove (object->members, name);
|
||||
g_free (name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user