Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

etk_object.h File Reference


Detailed Description


Data Structures

struct  Etk_Notification_Callback
 A callback called each time the value of the associated property is modified. More...
struct  Etk_Object
 [Object] The base class for all the objects and widgets of Etk More...

Defines

#define ETK_OBJECT_TYPE   (etk_object_type_get())
#define ETK_OBJECT(obj)   (ETK_OBJECT_CAST((obj), ETK_OBJECT_TYPE, Etk_Object))
#define ETK_IS_OBJECT(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_OBJECT_TYPE))

Functions

Etk_Object * etk_object_new (Etk_Type *object_type, const char *first_property,...)
 Creates a new object: it calls the corresponding constructors (from the constructor of the base class to the constructor of the more derived class) and then sets the values of the given properties.
Etk_Object * etk_object_new_valist (Etk_Type *object_type, const char *first_property, va_list args)
 Creates a new object: it calls the corresponding constructors (from the constructor of the base class to the constructor of the more derived class) and then sets the values of the given properties.
void etk_object_destroy (Etk_Object *object)
 Destroys the object: it first sets the weak-pointers to NULL, emits the "destroyed" signal, and then queues the object in the list of objects to free. Thus, the destructors will only be called at the beginning of the next main loop iteration (from the destructor of the more derived class to the destructor of the ultimate base class).
void etk_object_name_set (Etk_Object *object, const char *name)
 Sets the name of the object. The object can then be retrieved from his name with etk_object_name_find().
const char * etk_object_name_get (Etk_Object *object)
 Gets the name of the object.
Etk_Object * etk_object_name_find (const char *name)
 Finds the object called name.
Etk_Object * etk_object_check_cast (Etk_Object *object, Etk_Type *type)
 Checks if object can be cast to type. If object doesn't inherit from type, a warning is displayed in the console but the object is returned anyway.
Etk_Type * etk_object_object_type_get (Etk_Object *object)
 Gets the type of the object.
void etk_object_weak_pointer_add (Etk_Object *object, void **pointer_location)
 Adds a weak-pointer to the object. A weak-pointer is a pointer that will be automatically set to NULL when the object is destroyed.
void etk_object_weak_pointer_remove (Etk_Object *object, void **pointer_location)
 Removes a weak-pointer from the object.
void etk_object_data_set (Etk_Object *object, const char *key, void *value)
 Associates a data pointer to a key. The pointer will be carried by the object and could be retrieved later with etk_object_data_get(). If the object already has an association for the given key, the old data will be destroyed.
void etk_object_data_set_full (Etk_Object *object, const char *key, void *value, void(*free_cb)(void *data))
 Associates a data pointer to a key. The pointer will be carried by the object and could be retrieved later with etk_object_data_get(). If the object already has an association for the given key, the old data will be destroyed.
void * etk_object_data_get (Etk_Object *object, const char *key)
 Gets the pointer associated to the given key.
void etk_object_property_reset (Etk_Object *object, const char *property_name)
 Resets the default value of a property.
void etk_object_properties_set (Etk_Object *object, const char *first_property,...)
 Sets the values of several properties.
void etk_object_properties_set_valist (Etk_Object *object, const char *first_property, va_list args)
 Sets the values of several properties.
void etk_object_properties_get (Etk_Object *object, const char *first_property,...)
 Gets the values of several properties.
void etk_object_properties_get_valist (Etk_Object *object, const char *first_property, va_list args)
 Gets the values of several properties.
void etk_object_notify (Etk_Object *object, const char *property_name)
 Calls the object's notification callbacks associated the given property. It should be called each time the value of a property is changed.
void etk_object_notification_callback_add (Etk_Object *object, const char *property_name, void(*callback)(Etk_Object *object, const char *property_name, void *data), void *data)
 Adds a notification callback associated to a property of the object. The callback will be called each time the value of the property is changed (i.e. each time etk_object_notify(object, property_name) is called).
void etk_object_notification_callback_remove (Etk_Object *object, const char *property_name, void(*callback)(Etk_Object *object, const char *property_name, void *data))
 Removes a notification callback associated to a property of the object.

Variables

int ETK_OBJECT_DESTROYED_SIGNAL
 Symbols for signals.