Data Structures | |
struct | _Efl_Op_Description |
struct | _Efl_Object_Ops |
This structure holds the ops and the size of the ops. More... | |
struct | _Efl_Class_Description |
This structure holds the class description. More... | |
struct | _Efl_Object_Property_Reflection |
This structure holds one line of the reflection table. More... | |
struct | _Efl_Object_Property_Reflection_Ops |
This structure holds the reflection table and the size of this table. More... | |
Macros | |
#define | EFL_DEFINE_CLASS(class_get_func_name, class_desc, parent_class, ...) |
A convenient macro to be used for creating the class_get function. More... | |
#define | EO_VERSION 2 |
The current version of EO. | |
#define | EFL_OPS_DEFINE(ops, ...) |
Define an array of override functions for efl_object_override. More... | |
Typedefs | |
typedef enum _Efl_Class_Type | Efl_Class_Type |
A convenience typedef for _Efl_Class_Type. | |
typedef struct _Efl_Op_Description | Efl_Op_Description |
typedef struct _Efl_Object_Ops | Efl_Object_Ops |
typedef Eina_Error(* | Efl_Object_Property_Reflection_Setter) (Eo *obj, Eina_Value value) |
Setter type which is used to set an Eina_Value, this function should access one particular property field. | |
typedef Eina_Value(* | Efl_Object_Property_Reflection_Getter) (const Eo *obj) |
Getter type which is used to get an Eina_Value, this function should access one particular property field. | |
typedef struct _Efl_Object_Property_Reflection | Efl_Object_Property_Reflection |
typedef struct _Efl_Object_Property_Reflection_Ops | Efl_Object_Property_Reflection_Ops |
typedef struct _Efl_Class_Description | Efl_Class_Description |
A convenience typedef for _Efl_Class_Description. | |
Enumerations | |
enum | _Efl_Class_Type { EFL_CLASS_TYPE_REGULAR = 0, EFL_CLASS_TYPE_REGULAR_NO_INSTANT, EFL_CLASS_TYPE_INTERFACE, EFL_CLASS_TYPE_MIXIN, EFL_CLASS_TYPE_INVALID } |
An enum representing the possible types of an Eo class. More... | |
Functions | |
EAPI const Efl_Class * | efl_class_new (const Efl_Class_Description *desc, const Efl_Class *parent,...) |
Create a new class. More... | |
EAPI Eina_Bool | efl_class_functions_set (const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Property_Reflection_Ops *reflection_table) |
Set the functions of a class. More... | |
EAPI Eina_Bool | efl_object_override (Eo *obj, const Efl_Object_Ops *ops) |
Override Eo functions of this object. More... | |
EAPI Eina_Bool | efl_isa (const Eo *obj, const Efl_Class *klass) |
Check if an object "is a" klass. More... | |
EAPI const char * | efl_class_name_get (const Efl_Class *klass) |
Gets the name of the passed class. More... | |
EAPI size_t | efl_class_memory_size_get (const Efl_Class *klass) |
Gets the amount of memory this class object would use. More... | |
EAPI const char * | efl_debug_name_get (const Eo *obj_id) |
Gets a debug name for this object. More... | |
#define EFL_DEFINE_CLASS | ( | class_get_func_name, | |
class_desc, | |||
parent_class, | |||
... | |||
) |
A convenient macro to be used for creating the class_get function.
This macro is fairly simple and makes for better code.
class_get_func_name | the name of the wanted class_get function name. |
class_desc | the class description. |
parent_class | The parent class for the function. See efl_class_new() for more information. |
... | List of extensions. See efl_class_new() for more information. |
You must use this macro if you want thread safety in class creation.
#define EFL_OPS_DEFINE | ( | ops, | |
... | |||
) |
Define an array of override functions for efl_object_override.
ops | A name for the Efl_Object_Ops local variable to define |
... | A comma separated list of Efl_Object_Op overrides, using #EFL_OBJECT_OP_FUNC or #EFL_OBJECT_OP_CLASS_FUNC |
This can be used as follows:
enum _Efl_Class_Type |
EAPI const Efl_Class* efl_class_new | ( | const Efl_Class_Description * | desc, |
const Efl_Class * | parent, | ||
... | |||
) |
Create a new class.
desc | the class description to create the class with. |
parent | the class to inherit from. |
... | A NULL terminated list of extensions (interfaces, mixins and the classes of any composite objects). |
Use EFL_DEFINE_CLASS. This will provide thread safety and other features easily.
EAPI Eina_Bool efl_class_functions_set | ( | const Efl_Class * | klass_id, |
const Efl_Object_Ops * | object_ops, | ||
const Efl_Object_Property_Reflection_Ops * | reflection_table | ||
) |
Set the functions of a class.
klass_id | the class whose functions we are setting. |
object_ops | The function structure we are setting for object functions |
class_ops | The function structure we are setting for class functions |
reflection_table | The reflection table to use within eo |
This should only be called from within the initializer function. The reflection_table contains a getter and setter per property name. Which are called when either efl_property_reflection_set() or efl_property_reflection_get() is called.
References _Efl_Object_Ops::count, EINA_FALSE, EINA_TRUE, and ERR.
EAPI Eina_Bool efl_object_override | ( | Eo * | obj, |
const Efl_Object_Ops * | ops | ||
) |
Override Eo functions of this object.
ops | The op description to override with. |
This lets you override all of the Eo functions of this object (this one included) and replace them with ad-hoc implementation. The contents of the array are copied so they can reside on the stack for instance.
You are only allowed to override functions that are defined in the class or any of its interfaces (that is, efl_isa returning true).
If ops
is #NULL, this will revert the obj
to its original class without any function overrides.
It is not possible to override a function table of an object when it's already been overridden. Call efl_object_override(obj, NULL) first if you really need to do that.
References EINA_FALSE, EINA_TRUE, and ERR.
Referenced by efl_reuse().
Check if an object "is a" klass.
obj | The object to check |
klass | The klass to check against. |
EINA_TRUE
if obj implements klass or is an Efl_Class which inherits from/implements klass, EINA_FALSE
otherwise.Notice: This function does not support composite objects. Note: that an Efl_Class is also an Efl_Object, so if you pass an Efl_Class as obj, it will check if that class contain klass.
References EFL_ID_DOMAIN_SHARED, EINA_FALSE, EINA_LIKELY, eina_lock_release(), eina_lock_take(), EINA_TRUE, EINA_UNLIKELY, and ERR.
Referenced by ecore_con_client_fd_get(), ecore_con_client_flush(), ecore_con_server_fd_get(), ecore_con_server_flush(), ecore_exe_auto_limits_set(), ecore_exe_callback_pre_free_set(), ecore_exe_close_stdin(), ecore_exe_data_get(), ecore_exe_data_set(), ecore_exe_event_data_get(), ecore_exe_flags_get(), ecore_exe_free(), ecore_exe_hup(), ecore_exe_interrupt(), ecore_exe_kill(), ecore_exe_pid_get(), ecore_exe_quit(), ecore_exe_send(), ecore_exe_signal(), ecore_exe_tag_get(), ecore_exe_tag_set(), ecore_exe_terminate(), ecore_ipc_client_ip_get(), ecore_ipc_server_ip_get(), edje_edit_sound_tones_list_get(), elm_config_focus_move_policy_get(), elm_fileselector_button_path_set(), elm_fileselector_entry_path_set(), elm_flip_perspective_set(), elm_gengrid_wheel_disabled_get(), elm_layout_signal_callback_add(), elm_layout_signal_callback_del(), elm_layout_text_set(), elm_object_focus_region_show_mode_get(), elm_object_focus_region_show_mode_set(), elm_object_focus_set(), elm_object_focused_object_get(), elm_object_orientation_mode_disabled_get(), elm_object_orientation_mode_disabled_set(), elm_win_resize_object_add(), evas_device_parent_get(), evas_object_data_del(), evas_object_data_get(), evas_object_data_set(), evas_object_del(), evas_object_name_get(), evas_object_name_set(), evas_object_smart_clipped_clipper_get(), evas_object_smart_type_check(), evas_object_smart_type_check_ptr(), evas_object_top_at_pointer_get(), and evas_textblock_text_utf8_to_markup().
Gets the name of the passed class.
[in] | klass | The class (or object) to work on. |
Referenced by efl_del(), efl_object_shutdown(), and evas_object_del().
Gets the amount of memory this class object would use.
[in] | klass | The class (or object) to work on. |
References EFL_CLASS_TYPE_MIXIN, EINA_FALSE, eina_freeq_ptr_main_add(), eina_list_append(), eina_list_data_find_list(), eina_list_data_get(), EINA_LIST_FOREACH, eina_list_free(), eina_list_last(), eina_list_next(), eina_list_prepend(), eina_list_prev(), eina_list_remove_list(), eina_spinlock_free(), eina_thread_self(), EINA_TRASH_CLEAN, EINA_TRUE, EINA_UNUSED, ERR, mmap(), munmap(), and _Efl_Class_Description::name.
Gets a debug name for this object.
obj_id | The object (or class) |
Note that subclasses can override Efl.Object "debug_name_override" to provide more meaningful debug strings. The standard format includes the class name, the object ID (this obj_id
), the reference count and optionally the object name (as defined by Efl.Object.name).
This might return a temporary string, as created by eina_slstr, which means that a main loop should probably be running.
References efl_cast(), EFL_CLASS_TYPE_INTERFACE, EFL_CLASS_TYPE_MIXIN, EFL_CLASS_TYPE_REGULAR, EFL_CLASS_TYPE_REGULAR_NO_INSTANT, efl_super(), EINA_FALSE, eina_strbuf_append_printf(), and eina_strbuf_new().
Referenced by efl_del(), and evas_object_smart_callback_description_find().