Generic object system. More...
Modules | |
Eo's Debug information helper. | |
Eo's Event Handling | |
Eo Class | |
Eo's Class class. | |
Eo's Base class. | |
Data Structures | |
struct | _Eo_Op_Call_Data |
struct | _Eo_Call_Cache_Index |
struct | _Eo_Call_Cache_Entry |
struct | _Eo_Call_Cache_Off |
struct | _Eo_Call_Cache |
struct | _Eo_Event |
Parameter passed in event callbacks holding extra event parameters. More... | |
struct | _Eo_Callback_Array_Item |
An item in an array of callback desc/func. More... | |
struct | _Eo_Dbg_Info |
The structure for the debug info used by Eo. More... | |
Macros | |
#define | _EO_CLASS_EO_CLASS_TYPE |
#define | _EO_BASE_EO_CLASS_TYPE |
#define | EO_CLASS EO_BASE_CLASS |
#define | EO_NOOP ((Eo_Op) 0) |
A special Eo_Op meaning "No operation". | |
#define | EO_CLASS_DESCRIPTION_NOOPS() { NULL, 0} |
#define | EO_CLASS_DESCRIPTION_OPS(op_descs) { op_descs, EINA_C_ARRAY_LENGTH(op_descs) } |
#define | EO_CALL_CACHE_SIZE 1 |
#define | EO_FUNC_CALL(...) __VA_ARGS__ |
#define | EO_FUNC_COMMON_OP_FUNC(Name) ((const void *) Name) |
#define | EO_FUNC_COMMON_OP(Obj, Name, DefRet) |
#define | _EO_API_BEFORE_HOOK |
#define | _EO_API_AFTER_HOOK |
#define | _EO_API_CALL_HOOK(x) x |
#define | _EO_FUNC_BODY(Name, ObjType, Ret, DefRet) |
#define | _EO_VOID_FUNC_BODY(Name, ObjType) |
#define | _EO_FUNC_BODYV(Name, ObjType, Ret, DefRet, Arguments, ...) |
#define | _EO_VOID_FUNC_BODYV(Name, ObjType, Arguments, ...) |
#define | EO_FUNC_BODY(Name, Ret, DefRet) _EO_FUNC_BODY(Name, Eo *, Ret, DefRet) |
#define | EO_VOID_FUNC_BODY(Name) _EO_VOID_FUNC_BODY(Name, Eo *) |
#define | EO_FUNC_BODYV(Name, Ret, DefRet, Arguments, ...) _EO_FUNC_BODYV(Name, Eo *, Ret, DefRet, EO_FUNC_CALL(Arguments), __VA_ARGS__) |
#define | EO_VOID_FUNC_BODYV(Name, Arguments, ...) _EO_VOID_FUNC_BODYV(Name, Eo *, EO_FUNC_CALL(Arguments), __VA_ARGS__) |
#define | EO_FUNC_BODY_CONST(Name, Ret, DefRet) _EO_FUNC_BODY(Name, const Eo *, Ret, DefRet) |
#define | EO_VOID_FUNC_BODY_CONST(Name) _EO_VOID_FUNC_BODY(Name, const Eo *) |
#define | EO_FUNC_BODYV_CONST(Name, Ret, DefRet, Arguments, ...) _EO_FUNC_BODYV(Name, const Eo *, Ret, DefRet, EO_FUNC_CALL(Arguments), __VA_ARGS__) |
#define | EO_VOID_FUNC_BODYV_CONST(Name, Arguments, ...) _EO_VOID_FUNC_BODYV(Name, const Eo *, EO_FUNC_CALL(Arguments), __VA_ARGS__) |
#define | _EO_OP_API_ENTRY(a) (void*)a |
#define | EO_OP_FUNC(_api, _private) { _EO_OP_API_ENTRY(_api), (void*)_private, EO_OP_TYPE_REGULAR } |
#define | EO_OP_CLASS_FUNC(_api, _private) { _EO_OP_API_ENTRY(_api), (void*)_private, EO_OP_TYPE_CLASS } |
#define | EO_OP_FUNC_OVERRIDE(_api, _private) { _EO_OP_API_ENTRY(_api), (void*)_private, EO_OP_TYPE_REGULAR_OVERRIDE } |
#define | EO_OP_CLASS_FUNC_OVERRIDE(_api, _private) { _EO_OP_API_ENTRY(_api), (void*)_private, EO_OP_TYPE_CLASS_OVERRIDE } |
#define | eo_self _eo_self_get() |
#define | _eo_add_common(klass, parent, is_ref, ...) |
#define | eo_add(klass, parent, ...) _eo_add_common(klass, parent, EINA_FALSE, ##__VA_ARGS__) |
Create a new object and call its constructor(If it exits). More... | |
#define | eo_add_ref(klass, parent, ...) _eo_add_common(klass, parent, EINA_TRUE, ##__VA_ARGS__) |
Create a new object and call its constructor(If it exists). More... | |
#define | eo_data_xref(obj, klass, ref_obj) eo_data_xref_internal(__FILE__, __LINE__, obj, klass, ref_obj) |
Use this macro if you want to associate a referencer object. More... | |
#define | eo_data_ref(obj, klass) eo_data_xref_internal(__FILE__, __LINE__, obj, klass, (const Eo *)obj) |
Use this macro if you don't want to associate a referencer object. More... | |
#define | eo_data_xunref(obj, data, ref_obj) eo_data_xunref_internal(obj, data, ref_obj) |
Use this function if you used eo_data_xref to reference the data. More... | |
#define | eo_data_unref(obj, data) eo_data_xunref_internal(obj, data, obj) |
Use this function if you used eo_data_ref to reference the data. More... | |
#define | eo_xref(obj, ref_obj) eo_xref_internal(__FILE__, __LINE__, obj, ref_obj) |
Convenience macro around eo_xref_internal() More... | |
Typedefs | |
typedef struct _Eo_Object | _Eo_Object |
typedef struct _Eo_Opaque | Eo |
The basic Object type. | |
typedef Eo | Eo_Class |
The basic class type - should be removed, just for compat. | |
typedef Eo | Eo_Base |
typedef enum _Eo_Op_Type | Eo_Op_Type |
typedef void(* | Eo_Del_Intercept) (Eo *obj_id) |
A function to be called on object deletion/destruction instead of normal destruction taking place. More... | |
typedef unsigned int | Eo_Op |
The Eo operation type id. | |
typedef struct _Eo_Op_Call_Data | Eo_Op_Call_Data |
typedef struct _Eo_Call_Cache_Index | Eo_Call_Cache_Index |
typedef struct _Eo_Call_Cache_Entry | Eo_Call_Cache_Entry |
typedef struct _Eo_Call_Cache_Off | Eo_Call_Cache_Off |
typedef struct _Eo_Call_Cache | Eo_Call_Cache |
typedef struct _Eo_Event | Eo_Event |
Parameter passed in event callbacks holding extra event parameters. | |
typedef void(* | Eo_Event_Cb) (void *data, const Eo_Event *event) |
An event callback prototype. More... | |
typedef struct _Eo_Callback_Array_Item | Eo_Callback_Array_Item |
An item in an array of callback desc/func. More... | |
typedef struct _Eo_Dbg_Info | Eo_Dbg_Info |
The structure for the debug info used by Eo. | |
typedef short | Eo_Callback_Priority |
Callback priority value. More... | |
Enumerations | |
enum | _Eo_Op_Type { EO_OP_TYPE_INVALID = -1, EO_OP_TYPE_REGULAR = 0, EO_OP_TYPE_CLASS, EO_OP_TYPE_REGULAR_OVERRIDE, EO_OP_TYPE_CLASS_OVERRIDE } |
Functions | |
EAPI Eina_Bool | eo_init (void) |
Init the eo subsystem. More... | |
EAPI Eina_Bool | eo_shutdown (void) |
Shutdown the eo subsystem. More... | |
EAPI Eo_Op | _eo_api_op_id_get (const void *api_func) |
EAPI Eina_Bool | _eo_call_resolve (Eo *obj, const char *func_name, Eo_Op_Call_Data *call, Eo_Call_Cache *callcache, const char *file, int line) |
EAPI void | _eo_call_end (Eo_Op_Call_Data *call) |
EAPI Eo * | _eo_add_end (Eo *obj, Eina_Bool is_ref, Eina_Bool is_fallback) |
EAPI Eo * | eo_super (const Eo *obj, const Eo_Class *cur_klass) |
EAPI const Eo_Class * | eo_class_get (const Eo *obj) |
Gets the class of the object. More... | |
EAPI Eo * | _eo_self_get (void) |
EAPI Eo * | _eo_add_internal_start (const char *file, int line, const Eo_Class *klass_id, Eo *parent, Eina_Bool ref, Eina_Bool is_fallback) |
EAPI void * | eo_data_scope_get (const Eo *obj, const Eo_Class *klass) |
Get a pointer to the data of an object for a specific class. More... | |
EAPI void * | eo_data_xref_internal (const char *file, int line, const Eo *obj, const Eo_Class *klass, const Eo *ref_obj) |
Get a pointer to the data of an object for a specific class and increment the data reference count. More... | |
EAPI void | eo_data_xunref_internal (const Eo *obj, void *data, const Eo *ref_obj) |
Decrement the object data reference count by 1. More... | |
EAPI Eo * | eo_ref (const Eo *obj) |
Increment the object's reference count by 1. More... | |
EAPI void | eo_unref (const Eo *obj) |
Decrement the object's reference count by 1 and free it if needed. More... | |
EAPI int | eo_ref_get (const Eo *obj) |
Return the ref count of the object passed. More... | |
EAPI void | eo_del_intercept_set (Eo *obj, Eo_Del_Intercept del_intercept_func) |
Set a deletion interceptor function. More... | |
EAPI Eo_Del_Intercept | eo_del_intercept_get (const Eo *obj) |
Get the deletion interceptor function. More... | |
EAPI Eo * | eo_xref_internal (const char *file, int line, Eo *obj, const Eo *ref_obj) |
Increment the object's reference count by 1 (and associate the ref with ref_obj) More... | |
EAPI void | eo_xunref (Eo *obj, const Eo *ref_obj) |
Decrement the object's reference count by 1 and free it if needed. More... | |
EAPI void | eo_manual_free_set (Eo *obj, Eina_Bool manual_free) |
Enable or disable the manual free feature. More... | |
EAPI Eina_Bool | eo_manual_free (Eo *obj) |
Frees the object. More... | |
EAPI Eina_Bool | eo_destructed_is (const Eo *obj) |
Checks if the object was already descructed (only relevant for manual_free objects). More... | |
Variables | |
EAPI Eina_Spinlock | _eo_class_creation_lock |
This variable is used for locking purposes in the class_get function defined in EO_DEFINE_CLASS. More... | |
EAPI unsigned int | _eo_init_generation |
This variable stores the current eo init generation. More... | |
EAPI Eina_Spinlock | _eo_class_creation_lock |
This variable is used for locking purposes in the class_get function defined in EO_DEFINE_CLASS. More... | |
EAPI unsigned int | _eo_init_generation = 1 |
This variable stores the current eo init generation. More... | |
Generic object system.
#define EO_FUNC_COMMON_OP | ( | Obj, | |
Name, | |||
DefRet | |||
) |
#define _EO_FUNC_BODY | ( | Name, | |
ObjType, | |||
Ret, | |||
DefRet | |||
) |
#define _EO_VOID_FUNC_BODY | ( | Name, | |
ObjType | |||
) |
#define _EO_FUNC_BODYV | ( | Name, | |
ObjType, | |||
Ret, | |||
DefRet, | |||
Arguments, | |||
... | |||
) |
#define _EO_VOID_FUNC_BODYV | ( | Name, | |
ObjType, | |||
Arguments, | |||
... | |||
) |
#define _eo_add_common | ( | klass, | |
parent, | |||
is_ref, | |||
... | |||
) |
#define eo_add | ( | klass, | |
parent, | |||
... | |||
) | _eo_add_common(klass, parent, EINA_FALSE, ##__VA_ARGS__) |
Create a new object and call its constructor(If it exits).
The object returned by this function will always have 1 ref (reference count) irrespective of whether the parent is NULL or not. If the object is created using this function, then it would automatically gets deleted when the parent object is deleted. There is no need to call eo_unref on the child. This is convenient in C.
If you want a more "consistent" behaviour, take a look at eo_add_ref.
klass | the class of the object to create. |
parent | the parent to set to the object. |
... | The ops to run. |
Referenced by ecore_con_eet_client_new(), ecore_con_eet_server_new(), ecore_con_server_add(), ecore_con_server_connect(), ecore_con_url_new(), ecore_exe_pipe_run(), ecore_init(), ecore_main_fd_handler_active_set(), ecore_poller_add(), ecore_timer_add(), ecore_timer_loop_add(), edje_3d_object_add(), edje_audio_channel_mute_get(), edje_edit_object_add(), eio_init(), elm_fileselector_entry_path_get(), elm_fileselector_path_set(), elm_fileselector_selected_set(), elm_layout_table_clear(), elm_web_add(), elm_win_add(), elm_win_fake_add(), emotion_object_add(), evas_device_add(), evas_new(), evas_object_box_add(), evas_object_grid_add(), evas_object_polygon_add(), evas_object_rectangle_add(), evas_object_smart_add(), evas_object_table_add(), evas_object_text_add(), evas_object_textblock_add(), and evas_object_textgrid_add().
#define eo_add_ref | ( | klass, | |
parent, | |||
... | |||
) | _eo_add_common(klass, parent, EINA_TRUE, ##__VA_ARGS__) |
Create a new object and call its constructor(If it exists).
The object returned by this function has 1 ref for itself, 1 ref from the parent (if exists) and possible other refs if were added during construction. If a child object is created using this, then it won't get deleted when the parent object is deleted until you manually remove the ref by calling eo_unref().
klass | the class of the object to create. |
parent | the parent to set to the object. |
... | The ops to run. |
#define eo_data_xref | ( | obj, | |
klass, | |||
ref_obj | |||
) | eo_data_xref_internal(__FILE__, __LINE__, obj, klass, ref_obj) |
Use this macro if you want to associate a referencer object.
Convenience macro around eo_data_xref_internal()
Referenced by elm_layout_table_clear().
#define eo_data_ref | ( | obj, | |
klass | |||
) | eo_data_xref_internal(__FILE__, __LINE__, obj, klass, (const Eo *)obj) |
Use this macro if you don't want to associate a referencer object.
Convenience macro around eo_data_xref_internal()
Referenced by edje_edit_object_add(), evas_gl_new(), evas_object_smart_callback_description_find(), evas_object_smart_data_set(), and evas_object_smart_member_add().
#define eo_data_xunref | ( | obj, | |
data, | |||
ref_obj | |||
) | eo_data_xunref_internal(obj, data, ref_obj) |
Use this function if you used eo_data_xref to reference the data.
Convenience macro around eo_data_xunref_internal()
#define eo_data_unref | ( | obj, | |
data | |||
) | eo_data_xunref_internal(obj, data, obj) |
Use this function if you used eo_data_ref to reference the data.
Convenience macro around eo_data_unref_internal()
Referenced by evas_gl_free(), evas_gl_new(), evas_object_smart_data_set(), and evas_object_smart_member_del().
#define eo_xref | ( | obj, | |
ref_obj | |||
) | eo_xref_internal(__FILE__, __LINE__, obj, ref_obj) |
Convenience macro around eo_xref_internal()
Eo_Del_Intercept |
A function to be called on object deletion/destruction instead of normal destruction taking place.
obj_id | The object needing destruction |
typedef void(* Eo_Event_Cb) (void *data, const Eo_Event *event) |
An event callback prototype.
return EO_CALLBACK_STOP
to stop calling additional callbacks for the event, EO_CALLBACK_CONTINUE
to continue.
typedef struct _Eo_Callback_Array_Item Eo_Callback_Array_Item |
An item in an array of callback desc/func.
See also eo_event_callback_array_add.
typedef short Eo_Callback_Priority |
Callback priority value.
Range is -32k - 32k. The lower the number, the higher the priority.
See EO_CALLBACK_PRIORITY_AFTER, EO_CALLBACK_PRIORITY_BEFORE EO_CALLBACK_PRIORITY_DEFAULT
enum _Eo_Op_Type |
Init the eo subsystem.
EINA_TRUE
if eo is init, EINA_FALSE
otherwise.References _eo_class_creation_lock, EINA_FALSE, eina_hash_pointer_new(), eina_hash_string_superfast_new(), eina_init(), eina_log_domain_register(), EINA_LOG_ERR, eina_log_timing(), eina_magic_string_static_set(), eina_spinlock_new(), and EINA_TRUE.
Referenced by ecore_audio_init(), ecore_init(), ector_init(), and evas_init().
Shutdown the eo subsystem.
EINA_TRUE
if eo is init, EINA_FALSE
otherwise.References eina_log_timing(), and EINA_TRUE.
Gets the class of the object.
obj | The object to work on |
Referenced by elm_fileselector_entry_path_get(), elm_fileselector_path_get(), and elm_fileselector_path_set().
Get a pointer to the data of an object for a specific class.
The data reference count is not incremented. The pointer must be used only in the scope of the function and its callees.
obj | the object to work on. |
klass | the klass associated with the data. |
References ERR.
Referenced by ecore_con_client_data_get(), ecore_con_client_data_set(), ecore_con_client_del(), ecore_con_client_fd_get(), ecore_con_eet_client_connect_callback_add(), ecore_con_eet_client_connect_callback_del(), ecore_con_eet_client_disconnect_callback_add(), ecore_con_eet_client_disconnect_callback_del(), ecore_con_eet_server_connect_callback_add(), ecore_con_eet_server_connect_callback_del(), ecore_con_eet_server_disconnect_callback_add(), ecore_con_eet_server_disconnect_callback_del(), ecore_con_server_data_get(), ecore_con_server_data_set(), ecore_con_server_del(), ecore_con_ssl_client_upgrade(), ecore_con_ssl_server_cafile_add(), ecore_con_ssl_server_cert_add(), ecore_con_ssl_server_crl_add(), ecore_con_ssl_server_privkey_add(), ecore_con_ssl_server_upgrade(), ecore_con_ssl_server_verify(), ecore_con_ssl_server_verify_basic(), ecore_con_ssl_server_verify_name_get(), ecore_con_ssl_server_verify_name_set(), ecore_con_url_additional_header_add(), ecore_con_url_additional_headers_clear(), ecore_con_url_cookies_clear(), ecore_con_url_cookies_file_add(), ecore_con_url_cookies_ignore_old_session_set(), ecore_con_url_cookies_init(), ecore_con_url_cookies_jar_file_set(), ecore_con_url_cookies_jar_write(), ecore_con_url_cookies_session_clear(), ecore_con_url_custom_new(), ecore_con_url_data_get(), ecore_con_url_data_set(), ecore_con_url_fd_set(), ecore_con_url_ftp_upload(), ecore_con_url_ftp_use_epsv_set(), ecore_con_url_http_version_set(), ecore_con_url_httpauth_set(), ecore_con_url_proxy_password_set(), ecore_con_url_proxy_set(), ecore_con_url_proxy_username_set(), ecore_con_url_received_bytes_get(), ecore_con_url_response_headers_get(), ecore_con_url_ssl_ca_set(), ecore_con_url_ssl_verify_peer_set(), ecore_con_url_status_code_get(), ecore_con_url_time(), ecore_con_url_timeout_set(), ecore_con_url_verbose_set(), 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_idler_del(), ecore_poller_del(), edje_edit_sound_tones_list_get(), edje_evas_global_perspective_get(), edje_perspective_global_set(), edje_perspective_set(), elm_image_animated_get(), elm_image_animated_play_get(), elm_image_animated_play_set(), elm_image_animated_set(), elm_layout_content_swallow_list_get(), elm_layout_table_clear(), elm_win_util_dialog_add(), eo_base_legacy_only_event_description_get(), evas_device_add(), evas_device_class_set(), evas_device_description_set(), evas_device_emulation_source_get(), evas_device_emulation_source_set(), evas_device_list(), evas_device_name_set(), evas_device_parent_set(), evas_device_pop(), evas_device_push(), evas_device_subclass_set(), evas_event_callback_del(), evas_event_callback_del_full(), evas_event_callback_priority_add(), evas_event_feed_axis_update(), evas_event_feed_hold(), evas_event_feed_key_down(), evas_event_feed_key_down_with_keycode(), evas_event_feed_key_up(), evas_event_feed_key_up_with_keycode(), evas_event_feed_mouse_cancel(), evas_event_feed_mouse_down(), evas_event_feed_mouse_in(), evas_event_feed_mouse_move(), evas_event_feed_mouse_out(), evas_event_feed_mouse_up(), evas_event_feed_mouse_wheel(), evas_event_input_mouse_move(), evas_event_thaw_eval(), evas_font_path_global_list(), evas_map_util_clockwise_get(), evas_map_util_points_populate_from_object(), evas_map_util_points_populate_from_object_full(), evas_object_del(), evas_object_event_callback_del(), evas_object_event_callback_del_full(), evas_object_event_callback_priority_add(), evas_object_layer_get(), evas_object_name_get(), evas_object_name_set(), evas_object_ref(), evas_object_ref_get(), evas_object_smart_callback_del(), evas_object_smart_callback_del_full(), evas_object_smart_callback_description_find(), evas_object_smart_callback_priority_add(), evas_object_smart_callbacks_descriptions_get(), evas_object_smart_interface_data_get(), evas_object_smart_member_add(), evas_object_smart_member_del(), evas_object_smart_members_get(), evas_object_stack_above(), evas_object_stack_below(), evas_object_textblock_add(), evas_object_textblock_line_number_geometry_get(), evas_object_textblock_replace_char_get(), evas_object_textblock_replace_char_set(), evas_object_textblock_style_get(), evas_object_textblock_style_set(), evas_object_textblock_style_user_peek(), evas_object_textblock_style_user_pop(), evas_object_textblock_style_user_push(), evas_object_textblock_text_markup_get(), evas_object_textblock_text_markup_prepend(), evas_object_textblock_text_markup_set(), evas_object_textblock_valign_get(), evas_object_textblock_valign_set(), evas_object_top_at_pointer_get(), evas_object_unref(), evas_output_framespace_get(), evas_output_framespace_set(), evas_output_method_get(), evas_output_method_set(), evas_output_size_get(), evas_output_size_set(), evas_output_viewport_get(), evas_output_viewport_set(), evas_post_event_callback_push(), evas_post_event_callback_remove(), evas_post_event_callback_remove_full(), evas_render_updates_free(), evas_smart_legacy_type_register(), evas_textblock_cursor_at_format_set(), evas_textblock_cursor_char_coord_set(), evas_textblock_cursor_char_geometry_get(), evas_textblock_cursor_char_next(), evas_textblock_cursor_char_prev(), evas_textblock_cursor_content_get(), evas_textblock_cursor_copy(), evas_textblock_cursor_eol_get(), evas_textblock_cursor_format_append(), evas_textblock_cursor_format_get(), evas_textblock_cursor_format_is_visible_get(), evas_textblock_cursor_format_item_geometry_get(), evas_textblock_cursor_format_next(), evas_textblock_cursor_format_prepend(), evas_textblock_cursor_format_prev(), evas_textblock_cursor_geometry_bidi_get(), evas_textblock_cursor_geometry_get(), evas_textblock_cursor_is_format(), evas_textblock_cursor_line_coord_set(), evas_textblock_cursor_line_geometry_get(), evas_textblock_cursor_line_set(), evas_textblock_cursor_paragraph_next(), evas_textblock_cursor_paragraph_prev(), evas_textblock_cursor_paragraph_text_get(), evas_textblock_cursor_paragraph_text_length_get(), evas_textblock_cursor_pen_geometry_get(), evas_textblock_cursor_range_delete(), evas_textblock_cursor_range_formats_get(), evas_textblock_cursor_range_geometry_get(), evas_textblock_cursor_range_simple_geometry_get(), evas_textblock_cursor_range_text_get(), evas_textblock_cursor_visible_range_get(), evas_textblock_cursor_word_end(), evas_textblock_cursor_word_start(), evas_textblock_node_format_first_get(), evas_textblock_node_format_last_get(), evas_textblock_node_format_list_get(), evas_textblock_node_format_remove_pair(), evas_textblock_node_format_text_get(), evas_textblock_string_escape_get(), evas_textblock_style_set(), and evas_textblock_text_utf8_to_markup().
EAPI void* eo_data_xref_internal | ( | const char * | file, |
int | line, | ||
const Eo * | obj, | ||
const Eo_Class * | klass, | ||
const Eo * | ref_obj | ||
) |
Get a pointer to the data of an object for a specific class and increment the data reference count.
obj | the object to work on. |
klass | the klass associated with the data. |
ref_obj | the object that references the data. |
file | the call's filename. |
line | the call's line number. |
References ERR.
Decrement the object data reference count by 1.
obj | the object to work on. |
data | a pointer to the data to unreference |
file | the call's filename. |
line | the call's line number. |
Increment the object's reference count by 1.
obj | the object to work on. |
It's very easy to get a refcount leak and start leaking memory because of a forgotten unref or an extra ref. That is why there are eo_xref and eo_xunref that will make debugging easier in such a case. Therefor, these functions should only be used in small scopes, i.e at the start of some section in which the object may get freed, or if you know what you are doing.
References EINA_UNLIKELY.
Referenced by elm_fileselector_button_is_save_get(), elm_fileselector_button_path_set(), elm_fileselector_entry_selected_set(), eo_xref_internal(), evas_device_push(), evas_event_feed_hold(), evas_event_feed_mouse_cancel(), evas_event_feed_mouse_down(), evas_event_feed_mouse_in(), evas_event_feed_mouse_move(), evas_event_feed_mouse_out(), evas_event_feed_mouse_wheel(), evas_event_thaw_eval(), evas_free(), evas_object_ref(), and evas_smart_legacy_type_register().
Decrement the object's reference count by 1 and free it if needed.
obj | the object to work on. |
References EINA_UNLIKELY, and ERR.
Referenced by ecore_timer_del(), elm_fileselector_button_is_save_get(), elm_fileselector_button_path_set(), eo_xunref(), evas_device_emulation_source_get(), evas_device_pop(), evas_event_feed_hold(), evas_event_feed_mouse_cancel(), evas_event_feed_mouse_in(), evas_free(), evas_object_unref(), and evas_smart_legacy_type_register().
Return the ref count of the object passed.
obj | the object to work on. |
Referenced by evas_free().
EAPI void eo_del_intercept_set | ( | Eo * | obj, |
Eo_Del_Intercept | del_intercept_func | ||
) |
Set a deletion interceptor function.
obj | The object to set the interceptor on |
del_intercept_func | The interceptor function to call |
This sets the function del_intercept_func
to be called when an object is about to go from a reference count of 1 to 0, thus triggering actual destruction of the object. Instead of going to a reference count of 0 and being destroyed, the object will stay alive with a reference count of 1 and this intercept function will be called instead. It is the job of this interceptor function to handle any further deletion of of the object from here.
Note that by default objects have no interceptor function set, and thus will be destroyed as normal. To return an object to this state, simply set the del_intercept_func
to NULL which is the default.
A good use for this feature is to ensure an object is destroyed by its owning main loop and not in a foreign loop. This makes it possible to safely unrefor delete objects from any loop as an interceptor can be set on an object that will abort destruction and instead queue the object on its owning loop to be destroyed at some time in the future and now set the intercept function to NULL so it is not called again on the next "real deletion".
Referenced by elm_config_web_backend_get().
EAPI Eo_Del_Intercept eo_del_intercept_get | ( | const Eo * | obj | ) |
Get the deletion interceptor function.
obj | The object to get the interceptor of |
This returns the interceptor function set by eo_del_intercept_set(). Note that objects by default have no interceptor (NULL) set, but certain classes may set one up in a constructor, so it is important to be able to get the interceptor function to know if this has happend and if you want to override this interceptor, be sure to call it after your own interceptor function has finished. It would generally be a bad idea though to override these functions.
References EINA_INLIST_FOREACH, EINA_INLIST_GET, eina_inlist_prepend(), eina_inlist_remove(), EINA_LIKELY, EINA_TRUE, EINA_UNLIKELY, EO_CLASS_TYPE_MIXIN, and ERR.
Increment the object's reference count by 1 (and associate the ref with ref_obj)
obj | the object to work on. |
ref_obj | the object that references obj. |
file | the call's filename. |
line | the call's line number. |
People should not use this function, use eo_xref instead. A compile flag my make it and eobj_xunref() behave the same as eobj_ref() and eobj_unref() respectively. So this should be used wherever possible.
References EINA_INLIST_GET, eina_inlist_prepend(), and eo_ref().
Decrement the object's reference count by 1 and free it if needed.
Will free the ref associated with ref_obj).
obj | the object to work on. |
ref_obj | the object that references obj. |
This function only enforces the checks for object association. I.e don't rely on it. If such enforces are compiled out, this function behaves the same as eo_unref().
References EINA_INLIST_FOREACH, EINA_INLIST_GET, eina_inlist_remove(), eo_unref(), and ERR.
Enable or disable the manual free feature.
obj | the object to work on. |
manual_free | indicates if the free is manual (EINA_TRUE) or automatic (EINA_FALSE). |
The developer is in charge to call the function eo_manual_free to free the memory allocated for this object.
Do not use, unless you really know what you are doing. It's used by Evas because evas wants to keep its private data available even after the object is deleted. Setting this to true makes Eo destruct the object but not free the private data or the object itself.
Referenced by ecore_poller_del(), and evas_object_del().
Frees the object.
obj | the object to work on. This function must be called by the developer if the function eo_manual_free_set has been called before with the parameter EINA_TRUE. An error will be printed if this function is called when the manual free option is not set to EINA_TRUE or the number of refs is not 0. |
References EINA_FALSE, EINA_TRUE, and ERR.
Referenced by ecore_poller_del().
Checks if the object was already descructed (only relevant for manual_free objects).
obj | the object to check. This function checks if the object was already destructed (but not alraedy freed). It should only be used with objects that are supposed to be manually freed, but not yet freed (but possibly destructed). |
References EINA_FALSE.
Referenced by ecore_poller_del().
EAPI Eina_Spinlock _eo_class_creation_lock |
This variable is used for locking purposes in the class_get function defined in EO_DEFINE_CLASS.
This is just to work around the fact that we need to init locks before using them. Don't touch it if you don't know what you are doing.
Referenced by eo_init().
EAPI unsigned int _eo_init_generation |
This variable stores the current eo init generation.
That is, how many times we have completed full init/shutdown cycles. Starts at 1 and incremeted on every call to shutdown that actually shuts down eo.
_eo_class_creation_lock |
This variable is used for locking purposes in the class_get function defined in EO_DEFINE_CLASS.
This is just to work around the fact that we need to init locks before using them. Don't touch it if you don't know what you are doing.
Referenced by eo_init().
_eo_init_generation = 1 |
This variable stores the current eo init generation.
That is, how many times we have completed full init/shutdown cycles. Starts at 1 and incremeted on every call to shutdown that actually shuts down eo.