Script
Object Hierarchy:
Description:
public class Script :
Object
The Script structure contains only private data
Namespace: Clutter
Package: clutter-1.0
Content:
Properties:
-
public string filename { owned get; }
The path of the currently parsed file. If
filename_set is false then the value of this property is undefined.
-
public bool filename_set { get; }
Whether the filename property is set. If
this property is true then the currently parsed data comes from a file, and the file name is stored inside the
filename property.
Creation methods:
-
public Script ()
Creates a new Script instance.
Script can be used to load objects definitions for scenegraph elements, like actors,
or behavioural elements, like behaviours and timelines. The definitions must be encoded using the JavaScript Object Notation (JSON)
language.
Methods:
-
public void add_search_paths (string[] paths)
Adds paths to the list of search paths held by script.
-
public void add_states (string? name, State state)
Associates a State to the
Script instance using the given name.
-
public void connect_signals (void* user_data)
Connects all the signals defined into a UI definition file to their handlers.
-
public void connect_signals_full (ScriptConnectFunc func)
Connects all the signals defined into a UI definition file to their handlers.
-
public void ensure_objects ()
Ensure that every object defined inside script is correctly constructed. You should rarely
need to use this function.
-
public weak Object get_object (string name)
Retrieves the object bound to name. This function does not increment the reference count of
the returned object.
-
public int get_objects (...)
Retrieves a list of objects for the given names. After script, object names/return location
pairs should be listed, with a null pointer ending the list, like:
-
public weak State get_states (string? name)
Retrieves the State for the given state_name
.
-
public virtual Type get_type_from_name (string type_name)
Looks up a type by name, using the virtual function that
Script has for that purpose. This function should rarely be used.
-
public List<weak Object> list_objects ()
Retrieves all the objects created by script.
-
public uint load_from_data (string data, ssize_t length) throws Error
Loads the definitions from data into script and merges with the currently
loaded ones, if any.
-
public uint load_from_file (string filename) throws Error
Loads the definitions from filename into script and merges with the currently
loaded ones, if any.
-
public string lookup_filename (string filename)
Looks up filename inside the search paths of script. If filename
is found, its full path will be returned .
-
public void unmerge_objects (uint merge_id)
Unmerges the objects identified by merge_id.