cluttermm
1.17.3
|
Public Member Functions | |
virtual | ~Script () |
ClutterScript* | gobj () |
Provides access to the underlying C GObject. More... | |
const ClutterScript* | gobj () const |
Provides access to the underlying C GObject. More... | |
ClutterScript* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
guint | load_from_data (const Glib::ustring& data) |
Loads the definitions from data into script and merges with the currently loaded ones, if any. More... | |
guint | load_from_file (const std::string& filename) |
Loads the definitions from filename into script and merges with the currently loaded ones, if any. More... | |
guint | load_from_resource (const std::string& resource_path) |
Loads the definitions from a resource file into script and merges with the currently loaded ones, if any. More... | |
Glib::RefPtr< Glib::Object > | get_object (const Glib::ustring& name) |
Retrieves the object bound to name. More... | |
Glib::RefPtr< const Glib::Object > | get_object (const Glib::ustring& name) const |
Retrieves the object bound to name. More... | |
void | add_search_paths (const std::vector< std::string >& paths) |
Adds paths to the list of search paths held by the Script . More... | |
std::string | lookup_filename (const std::string& filename) |
Looks up filename inside the search paths of script. More... | |
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. More... | |
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. More... | |
void | ensure_objects () |
Ensure that every object defined inside script is correctly constructed. More... | |
void | set_translation_domain (const Glib::ustring& domain) |
Sets the translation domain for script. More... | |
Glib::ustring | get_translation_domain () const |
Retrieves the translation domain set using set_translation_domain(). More... | |
Glib::PropertyProxy_ReadOnly < std::string > | property_filename () const |
The path of the currently parsed file. More... | |
Glib::PropertyProxy_ReadOnly < bool > | property_filename_set () const |
Whether the :filename property is set. More... | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< Script > | create () |
static std::string | get_script_id (const Glib::RefPtr< const Glib::Object >& object) |
Retrieves the Clutter script id, if any. More... | |
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::Script > | wrap (ClutterScript* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
|
virtual |
|
protected |
void Clutter::Script::add_search_paths | ( | const std::vector< std::string > & | paths | ) |
Adds paths to the list of search paths held by the Script .
The search paths are used by lookup_filename(), which can be used to define search paths for the textures source file name or other custom, file-based properties.
Search | paths. |
|
static |
void Clutter::Script::ensure_objects | ( | ) |
Ensure that every object defined inside script is correctly constructed.
You should rarely need to use this function.
|
protected |
Glib::RefPtr<Glib::Object> Clutter::Script::get_object | ( | const Glib::ustring & | name | ) |
Retrieves the object bound to name.
This function does not increment the reference count of the returned object.
name | The name of the object to retrieve. |
0
if no object with the given name was available. Glib::RefPtr<const Glib::Object> Clutter::Script::get_object | ( | const Glib::ustring & | name | ) | const |
Retrieves the object bound to name.
This function does not increment the reference count of the returned object.
name | The name of the object to retrieve. |
0
if no object with the given name was available.
|
inline |
Get a RefPtr to an object from the ClutterScript JSON file.
For instance:
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.
name | The name of the object. |
derived_object | A RefPtr to the object, or 0 on failure. |
|
protected |
|
static |
Retrieves the Clutter script id, if any.
gobject | A Object. |
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. Glib::ustring Clutter::Script::get_translation_domain | ( | ) | const |
Retrieves the translation domain set using set_translation_domain().
0
.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
protectedvirtual |
|
inline |
Provides access to the underlying C GObject.
|
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.
data | A buffer containing the definitions. |
length | The length of the buffer, or -1 if data is a NUL-terminated buffer. |
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.
filename | The full path to the definition file. |
guint Clutter::Script::load_from_resource | ( | const std::string & | resource_path | ) |
Loads the definitions from a resource file into script and merges with the currently loaded ones, if any.
resource_path | The resource path of the file to parse. |
std::string Clutter::Script::lookup_filename | ( | const std::string & | filename | ) |
Looks up filename inside the search paths of script.
If filename is found, its full path will be returned .
filename | The name of the file to lookup. |
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.
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.
void Clutter::Script::set_translation_domain | ( | const Glib::ustring & | domain | ) |
Sets the translation domain for script.
domain | The translation domain, or 0 . |
void Clutter::Script::unmerge_object | ( | guint | merge_id | ) |
Unmerges the objects identified by merge_id.
merge_id | Merge id returned when loading a UI definition. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |