Abstract EFL object class.
All EFL objects inherit from this class, which provides basic functionality like naming, debugging, hierarchy traversal, event emission and life cycle management.
Life Cycle Objects are created with efl_add() and mostly disposed of with efl_del(). As an optimization, efl_add() accepts a list of initialization functions which the programmer can use to further customize the object before it is fully constructed. Also, objects can have a parent which will keep them alive as long as the parent is alive, so the programmer does not need to keep track of references. (See the Efl.Object.parent property for details). Due to the above characteristics, EFL objects undergo the following phases during their Life Cycle: - Construction: The Efl.Object.constructor method is called. Afterwards, any user-supplied initialization methods are called. - Finalization: The Efl.Object.finalize method is called and Efl.Object.finalized is set to true
when it returns. Object is usable at this point. - Invalidation: The object has lost its parent. The Efl.Object.invalidate method is called so all the object's relationships can be terminated. Efl.Object.invalidated is set to true
. - Destruction: The object has no parent and it can be destroyed. The Efl.Object.destructor method is called, use it to return any resources the object might have gathered during its life.
Since 1.22
allow_parent_unref (get, set)
Allow an object to be deleted by unref even if it has a parent.
Eina_Bool efl_allow_parent_unref_get(const Eo *obj); void efl_allow_parent_unref_set(Eo *obj, Eina_Bool allow);
Get an iterator on all children.
Eina_Iterator *efl_children_iterator_new(Eo *obj);
comment (get, set)
A human readable comment for the object.
const char *efl_comment_get(const Eo *obj); void efl_comment_set(Eo *obj, const char *comment);
Make an object a composite object of another.
Eina_Bool efl_composite_attach(Eo *obj, Efl_Object *comp_obj);
Detach a composite object from another object.
Eina_Bool efl_composite_detach(Eo *obj, Efl_Object *comp_obj);
Check if an object is part of a composite object.
Eina_Bool efl_composite_part_is(Eo *obj);
Implement this method to provide optional initialization code for your object.
Efl_Object *efl_constructor(Eo *obj);
Build a read-only name for this object used for debugging.
void efl_debug_name_override(Eo *obj, Eina_Strbuf *sb);
Implement this method to provide deinitialization code for your object if you need it.
void efl_destructor(Eo *obj);
Remove an event callback forwarder for a specified event and object.
void efl_event_callback_forwarder_del(Eo *obj, const Efl_Event_Description desc, Efl_Object *new_obj);
event_callback_forwarder_priority_add
Add an event callback forwarder that will make this object emit an event whenever another object (source
) emits it. The event is said to be forwarded fromsource
to this object.
void efl_event_callback_forwarder_priority_add(Eo *obj, const Efl_Event_Description desc, Efl_Callback_Priority priority, Efl_Object *source);
Stop the current callback call.
void efl_event_callback_stop(Eo *obj);
Freeze events of this object.
void efl_event_freeze(Eo *obj);
event_freeze_count (get)
int efl_event_freeze_count_get(const Eo *obj);
event_global_freeze static
Globally freeze events for ALL EFL OBJECTS.
void efl_event_global_freeze();
event_global_freeze_count (get) static
int efl_event_global_freeze_count_get();
event_global_thaw static
Globally thaw events for ALL EFL OBJECTS.
void efl_event_global_thaw();
Thaw events of object.
void efl_event_thaw(Eo *obj);
Implement this method to finish the initialization of your object after all (if any) user-provided configuration methods have been executed.
Efl_Object *efl_finalize(Eo *obj);
finalized (get)
Eina_Bool efl_finalized_get(const Eo *obj);
Implement this method to perform special actions when your object loses its parent, if you need to.
void efl_invalidate(Eo *obj);
invalidated (get)
Eina_Bool efl_invalidated_get(const Eo *obj);
invalidating (get)
Eina_Bool efl_invalidating_get(const Eo *obj);
name (get, set)
The name of the object.
const char *efl_name_get(const Eo *obj); void efl_name_set(Eo *obj, const char *name);
Find a child object with the given name and return it.
Efl_Object *efl_name_find(const Eo *obj, const char *search);
parent (get, set)
The parent of an object.
Efl_Object *efl_parent_get(const Eo *obj); void efl_parent_set(Eo *obj, Efl_Object *parent);
Searches upwards in the object tree for a provider which knows the given class/interface.
Efl_Object *efl_provider_find(const Eo *obj, const Efl_Class *klass);
Will register a manager of a specific class to be answered by Efl.Object.provider_find.
Eina_Bool efl_provider_register(Eo *obj, const Efl_Class *klass, const Efl_Object *provider);
Will unregister a manager of a specific class that was previously registered and answered by Efl.Object.provider_find.
Eina_Bool efl_provider_unregister(Eo *obj, const Efl_Class *klass, const Efl_Object *provider);
Object is being deleted. See Efl.Object.destructor.
EFL_EVENT_DEL(void, @hot)
Object has been fully destroyed. It can not be used beyond this point. This event should only serve to clean up any reference you keep to the object.
EFL_EVENT_DESTRUCT(void, @hot)
Object is being invalidated and losing its parent. See Efl.Object.invalidate.
EFL_EVENT_INVALIDATE(void, @hot)
Object has lost its last reference, only parent relationship is keeping it alive. Advanced usage.
EFL_EVENT_NOREF(void, @hot)
Object has acquired a second reference. It has multiple owners now. Triggered whenever increasing the refcount from one to two, it will not trigger by further increasing the refcount beyond two.
EFL_EVENT_OWNERSHIP_SHARED(void, @hot)
Object has lost a reference and only one is left. It has just one owner now. Triggered whenever the refcount goes from two to one.
EFL_EVENT_OWNERSHIP_UNIQUE(void, @hot)