cluttermm 1.3.3
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions
Clutter::Script Class Reference
Inheritance diagram for Clutter::Script:
Inheritance graph
[legend]
Collaboration diagram for Clutter::Script:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Script ()
ClutterScript* gobj ()
 Provides access to the underlying C GObject.
const ClutterScript* gobj () const
 Provides access to the underlying C GObject.
ClutterScript* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
guint load_from_data (const Glib::ustring& data)
 Loads the definitions from data into script and merges with the currently loaded ones, if any.
guint load_from_file (const std::string& filename)
 Loads the definitions from filename into script and merges with the currently loaded ones, if any.
void add_search_paths (const std::vector< Glib::ustring >& paths)
Glib::ustring lookup_filename (const Glib::ustring& filename)
 Looks up filename inside the search paths of script.
template<class T_Object >
void get_object (const Glib::ustring& name, Glib::RefPtr< T_Object >& derived_object)
 Get a RefPtr to an object from the ClutterScript JSON file.
std::vector< Glib::RefPtr
< Glib::Object > > 
list_objects ()
std::vector< Glib::RefPtr
< const Glib::Object > > 
list_objects () const
void unmerge_object (guint merge_id)
 Unmerges the objects identified by merge_id.
void ensure_objects ()
 Ensure that every object defined inside script is correctly constructed.
Glib::PropertyProxy_ReadOnly
< std::string
property_filename () const
 The path of the currently parsed file.
Glib::PropertyProxy_ReadOnly
< bool > 
property_filename_set () const
 Whether the :filename property is set.

Static Public Member Functions

static Glib::RefPtr< Scriptcreate ()
static std::string get_script_id (const Glib::RefPtr< const Glib::Object >& object)
 Retrieves the Clutter script id, if any.

Protected Member Functions

 Script ()
Glib::RefPtr< Glib::Object > get_object_checked (const Glib::ustring& name, GType type)
GObject* get_cobject (const Glib::ustring& name)
virtual GType get_type_from_name_vfunc (const Glib::ustring& type_name)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Clutter::Scriptwrap (ClutterScript* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Constructor & Destructor Documentation

virtual Clutter::Script::~Script ( ) [virtual]
Clutter::Script::Script ( ) [protected]

Member Function Documentation

void Clutter::Script::add_search_paths ( const std::vector< Glib::ustring > &  paths)
static Glib::RefPtr<Script> Clutter::Script::create ( ) [static]
void Clutter::Script::ensure_objects ( )

Ensure that every object defined inside script is correctly constructed.

You should rarely need to use this function.

Since cluttermm 0.6:
GObject* Clutter::Script::get_cobject ( const Glib::ustring &  name) [protected]
template <class T_Object >
void Clutter::Script::get_object ( const Glib::ustring &  name,
Glib::RefPtr< T_Object > &  derived_object 
) [inline]

Get a RefPtr to an object from the ClutterScript JSON file.

For instance:

 Glib::RefPtr<Clutter::Rectangle> aRectangleRef;
 scriptObject->get_object("myRectangle", aRectangleRef);

This method prints a warning message to the console if the object doesn't exist or has the wrong type, so you don't need to check that manually.

Parameters:
nameThe name of the object.
Return values:
derived_objectA RefPtr to the object, or 0 on failure.
Glib::RefPtr<Glib::Object> Clutter::Script::get_object_checked ( const Glib::ustring &  name,
GType  type 
) [protected]
static std::string Clutter::Script::get_script_id ( const Glib::RefPtr< const Glib::Object > &  object) [static]

Retrieves the Clutter script id, if any.

Since cluttermm 0.6:
Parameters:
gobjectA Object.
Returns:
The script id, or 0 if object was not defined inside a UI definition file. The returned string is owned by the object and should never be modified or freed.
virtual GType Clutter::Script::get_type_from_name_vfunc ( const Glib::ustring &  type_name) [protected, virtual]
ClutterScript* Clutter::Script::gobj ( ) [inline]

Provides access to the underlying C GObject.

const ClutterScript* Clutter::Script::gobj ( ) const [inline]

Provides access to the underlying C GObject.

ClutterScript* Clutter::Script::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

std::vector<Glib::RefPtr<Glib::Object> > Clutter::Script::list_objects ( )
std::vector<Glib::RefPtr<const Glib::Object> > Clutter::Script::list_objects ( ) const
guint Clutter::Script::load_from_data ( const Glib::ustring &  data)

Loads the definitions from data into script and merges with the currently loaded ones, if any.

Since cluttermm 0.6:
Parameters:
dataA buffer containing the definitions.
lengthThe length of the buffer, or -1 if data is a NUL-terminated buffer.
Returns:
On error, zero is returned and error is set accordingly. On success, the merge id for the UI definitions is returned. You can use the merge id with clutter_script_unmerge().
guint Clutter::Script::load_from_file ( const std::string filename)

Loads the definitions from filename into script and merges with the currently loaded ones, if any.

Since cluttermm 0.6:
Parameters:
filenameThe full path to the definition file.
Returns:
On error, zero is returned and error is set accordingly. On success, the merge id for the UI definitions is returned. You can use the merge id with clutter_script_unmerge().
Glib::ustring Clutter::Script::lookup_filename ( const Glib::ustring &  filename)

Looks up filename inside the search paths of script.

If filename is found, its full path will be returned .

Since cluttermm 0.8:
Parameters:
filenameThe name of the file to lookup.
Returns:
The full path of filename or 0 if no path was found.
Glib::PropertyProxy_ReadOnly<std::string> Clutter::Script::property_filename ( ) const

The path of the currently parsed file.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly<bool> Clutter::Script::property_filename_set ( ) const

Whether the :filename property is set.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
void Clutter::Script::unmerge_object ( guint  merge_id)

Unmerges the objects identified by merge_id.

Since cluttermm 0.6:
Parameters:
merge_idMerge id returned when loading a UI definition.

Friends And Related Function Documentation

Glib::RefPtr< Clutter::Script > wrap ( ClutterScript *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: