|  |  |  | Clutter 1.0.0 Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Known Implementations | ||||
                    ClutterScriptable;
                    ClutterScriptableIface;
void                clutter_scriptable_set_id           (ClutterScriptable *scriptable,
                                                         const gchar *id);
const gchar *       clutter_scriptable_get_id           (ClutterScriptable *scriptable);
gboolean            clutter_scriptable_parse_custom_node
                                                        (ClutterScriptable *scriptable,
                                                         ClutterScript *script,
                                                         GValue *value,
                                                         const gchar *name,
                                                         JsonNode *node);
void                clutter_scriptable_set_custom_property
                                                        (ClutterScriptable *scriptable,
                                                         ClutterScript *script,
                                                         const gchar *name,
                                                         const GValue *value);
ClutterScriptable is implemented by ClutterTexture, ClutterStage, ClutterText, ClutterRectangle, ClutterGroup, ClutterBehaviourPath, ClutterCairoTexture, ClutterActor and ClutterClone.
The ClutterScriptableIface interface exposes the UI definition parsing process to external classes. By implementing this interface, a class can override the UI definition parsing and transform complex data types into GObject properties, or allow custom properties.
ClutterScriptable is available since Clutter 0.6
typedef struct {
  void         (* set_id)              (ClutterScriptable *scriptable,
                                        const gchar       *name);
  const gchar *(* get_id)              (ClutterScriptable *scriptable);
  gboolean     (* parse_custom_node)   (ClutterScriptable *scriptable,
                                        ClutterScript     *script,
                                        GValue            *value,
                                        const gchar       *name,
                                        JsonNode          *node);
  void         (* set_custom_property) (ClutterScriptable *scriptable,
                                        ClutterScript     *script,
                                        const gchar       *name,
                                        const GValue      *value);
} ClutterScriptableIface;
Interface for implementing "scriptable" objects. An object implementing this interface can override the parsing and properties setting sequence when loading a UI definition data with ClutterScript
| 
 | virtual function for setting the id of a scriptable object | 
| 
 | virtual function for getting the id of a scriptable object | 
| 
 | virtual function for parsing complex data containers into GObject properties | 
| 
 | virtual function for setting a custom property | 
Since 0.6
void clutter_scriptable_set_id (ClutterScriptable *scriptable, const gchar *id);
Sets id as the unique Clutter script it for this instance of
ClutterScriptableIface.
This name can be used by user interface designer applications to define a unique name for an object constructable using the UI definition language parsed by ClutterScript.
| 
 | a ClutterScriptable | 
| 
 | the ClutterScript id of the object | 
Since 0.6
const gchar * clutter_scriptable_get_id (ClutterScriptable *scriptable);
Retrieves the id of scriptable set using clutter_scriptable_set_id().
| 
 | a ClutterScriptable | 
| Returns : | the id of the object. The returned string is owned by the scriptable object and should never be modified of freed | 
Since 0.6
gboolean clutter_scriptable_parse_custom_node (ClutterScriptable *scriptable, ClutterScript *script, GValue *value, const gchar *name, JsonNode *node);
Parses the passed JSON node. The implementation must set the type
of the passed GValue pointer using g_value_init().
| 
 | a ClutterScriptable | 
| 
 | the ClutterScript creating the scriptable instance | 
| 
 | the generic value to be set | 
| 
 | the name of the node | 
| 
 | the JSON node to be parsed | 
| Returns : | TRUEif the node was successfully parsed,FALSEotherwise. | 
Since 0.6
void                clutter_scriptable_set_custom_property
                                                        (ClutterScriptable *scriptable,
                                                         ClutterScript *script,
                                                         const gchar *name,
                                                         const GValue *value);
Overrides the common properties setting. The underlying virtual function should be used when implementing custom properties.
| 
 | a ClutterScriptable | 
| 
 | the ClutterScript creating the scriptable instance | 
| 
 | the name of the property | 
| 
 | the value of the property | 
Since 0.6