eo: move all the key_ properties to C

This commit is contained in:
Daniel Kolesa 2017-04-26 16:18:49 +02:00
parent 20d1cf94c3
commit 6af8527117
5 changed files with 148 additions and 86 deletions

View File

@ -4,7 +4,6 @@ class Ecore.Audio.In.Tone (Ecore.Audio.In)
eo_prefix: ecore_audio_obj_in_tone;
implements {
Efl.Object.constructor;
Efl.Object.key_data { get; set; }
Ecore.Audio.In.length { set; }
Ecore.Audio.In.seek;
Ecore.Audio.In.read_internal;

View File

@ -122,4 +122,8 @@ _ecore_audio_in_tone_efl_object_constructor(Eo *eo_obj, Ecore_Audio_In_Tone_Data
return eo_obj;
}
#define ECORE_AUDIO_IN_TONE_EXTRA_OPS \
EFL_OBJECT_OP_FUNC(efl_key_data_set, _ecore_audio_in_tone_efl_object_key_data_set), \
EFL_OBJECT_OP_FUNC(efl_key_data_get, _ecore_audio_in_tone_efl_object_key_data_get)
#include "ecore_audio_in_tone.eo.c"

View File

@ -1441,6 +1441,117 @@ EOAPI void efl_wref_add(Eo *obj, Efl_Object **wref);
*/
EOAPI void efl_wref_del(Eo *obj, Efl_Object **wref);
/**
* @brief Generic data with string key on an object.
*
* The user is in charge of freeing the data.
*
* @param[in] key The key associated with the data
* @param[in] data The data to set
*/
EOAPI void efl_key_data_set(Eo *obj, const char * key, const void *data);
/**
* @brief Generic data with string key on an object.
*
* The user is in charge of freeing the data.
*
* @param[in] key The key associated with the data
*
* @return The data to set
*/
EOAPI void *efl_key_data_get(const Eo *obj, const char * key);
/**
* @brief Generic object reference with string key to object.
*
* The object will be automatically ref'd when set and unref'd when replaced or
* deleted or referring object is deleted. If the referenced object is deleted
* then the key is deleted automatically.
*
* This is the same key store used by key_data and key_value so keys are shared
* and can store only one thing
*
* @param[in] key The key associated with the object ref
* @param[in] objdata The object to set
*/
EOAPI void efl_key_ref_set(Eo *obj, const char * key, const Efl_Object *objdata);
/**
* @brief Generic object reference with string key to object.
*
* The object will be automatically ref'd when set and unref'd when replaced or
* deleted or referring object is deleted. If the referenced object is deleted
* then the key is deleted automatically.
*
* This is the same key store used by key_data and key_value so keys are shared
* and can store only one thing
*
* @param[in] key The key associated with the object ref
*
* @return The object to set
*/
EOAPI Efl_Object *efl_key_ref_get(const Eo *obj, const char * key);
/**
* @brief Generic weak object reference with string key to object.
*
* The object key will be removed if the object is removed, but will not take
* or removed references like key_obj.
*
* This is the same key store used by key_data and key_value so keys are shared
* and can store only one thing
*
* @param[in] key The key associated with the object ref
* @param[in] objdata The object to set
*/
EOAPI void efl_key_wref_set(Eo *obj, const char * key, const Efl_Object *objdata);
/**
* @brief Generic weak object reference with string key to object.
*
* The object key will be removed if the object is removed, but will not take
* or removed references like key_obj.
*
* This is the same key store used by key_data and key_value so keys are shared
* and can store only one thing
*
* @param[in] key The key associated with the object ref
*
* @return The object to set
*/
EOAPI Efl_Object *efl_key_wref_get(const Eo *obj, const char * key);
/**
* @brief Value on with string key on the object.
*
* This stores the value with the given string key on the object and it will be
* freed when replaced or deleted or the referring object is deleted.
*
* This is the same key store used by key_data and key_obj so keys are shared
* and can store only one thing
*
* @param[in] key The key associated with the value
* @param[in] value The value to set
*/
EOAPI void efl_key_value_set(Eo *obj, const char * key, Eina_Value *value);
/**
* @brief Value on with string key on the object.
*
* This stores the value with the given string key on the object and it will be
* freed when replaced or deleted or the referring object is deleted.
*
* This is the same key store used by key_data and key_obj so keys are shared
* and can store only one thing
*
* @param[in] key The key associated with the value
*
* @return The value to set
*/
EOAPI Eina_Value *efl_key_value_get(const Eo *obj, const char * key);
/**
* @brief Enable or disable the manual free feature.
* @param obj the object to work on.

View File

@ -156,90 +156,6 @@ abstract Efl.Object ()
}
return: Efl.Object; [[The first object found]]
}
@property key_data {
[[Generic data with string key on an object.
The user is in charge of freeing the data.
]]
keys {
key: string; [[The key associated with the data]]
}
set {
values {
data: const(void_ptr); [[The data to set]]
}
}
get {
values {
data: void_ptr; [[The data to set]]
}
}
}
@property key_ref {
[[Generic object reference with string key to object.
The object will be automatically ref'd when set and unref'd
when replaced or deleted or referring object is deleted. If
the referenced object is deleted then the key is deleted
automatically.
This is the same key store used by key_data and key_value so keys
are shared and can store only one thing
]]
keys {
key: string; [[The key associated with the object ref]]
}
set {
values {
objdata: const(Efl.Object); [[The object to set]]
}
}
get {
values {
objdata: Efl.Object; [[The object to set]]
}
}
}
@property key_wref {
[[Generic weak object reference with string key to object.
The object key will be removed if the object is removed, but
will not take or removed references like key_obj.
This is the same key store used by key_data and key_value so keys
are shared and can store only one thing
]]
keys {
key: string; [[The key associated with the object ref]]
}
set {
values {
objdata: const(Efl.Object); [[The object to set]]
}
}
get {
values {
objdata: Efl.Object; [[The object to set]]
}
}
}
@property key_value {
[[Value on with string key on the object.
This stores the value with the given string key on the object
and it will be freed when replaced or deleted or the referring
object is deleted.
This is the same key store used by key_data and key_obj so keys
are shared and can store only one thing
]]
keys {
key: string; [[The key associated with the value]]
}
values {
value: ptr(generic_value); [[The value to set]]
}
}
event_thaw {
[[Thaw events of object.

View File

@ -283,12 +283,18 @@ _efl_object_key_data_set(Eo *obj, Efl_Object_Data *pd, const char *key, const vo
_key_generic_set(obj, pd, key, data, DATA_PTR, EINA_TRUE);
}
EOAPI EFL_VOID_FUNC_BODYV(efl_key_data_set, EFL_FUNC_CALL(key, data),
const char *key, const void *data);
EOLIAN static void *
_efl_object_key_data_get(Eo *obj, Efl_Object_Data *pd, const char *key)
{
return _key_generic_get(obj, pd, key, DATA_PTR);
}
EOAPI EFL_FUNC_BODYV_CONST(efl_key_data_get, void *, NULL, EFL_FUNC_CALL(key),
const char *key);
EOLIAN static void
_efl_object_key_ref_set(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char *key, const Eo *objdata)
{
@ -303,12 +309,18 @@ _efl_object_key_ref_set(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char *ke
}
}
EOAPI EFL_VOID_FUNC_BODYV(efl_key_ref_set, EFL_FUNC_CALL(key, objdata),
const char *key, const Efl_Object *objdata);
EOLIAN static Eo *
_efl_object_key_ref_get(Eo *obj, Efl_Object_Data *pd, const char *key)
{
return _key_generic_get(obj, pd, key, DATA_OBJ);
}
EOAPI EFL_FUNC_BODYV_CONST(efl_key_ref_get, Efl_Object *, NULL,
EFL_FUNC_CALL(key), const char *key);
EOLIAN static void
_efl_object_key_wref_set(Eo *obj, Efl_Object_Data *pd, const char * key, const Efl_Object *objdata)
{
@ -322,24 +334,36 @@ _efl_object_key_wref_set(Eo *obj, Efl_Object_Data *pd, const char * key, const E
}
}
EOAPI EFL_VOID_FUNC_BODYV(efl_key_wref_set, EFL_FUNC_CALL(key, objdata),
const char *key, const Efl_Object *objdata);
EOLIAN static Eo *
_efl_object_key_wref_get(Eo *obj, Efl_Object_Data *pd, const char * key)
{
return _key_generic_get(obj, pd, key, DATA_OBJ_WEAK);
}
EOAPI EFL_FUNC_BODYV_CONST(efl_key_wref_get, Efl_Object *, NULL,
EFL_FUNC_CALL(key), const char *key);
EOLIAN static void
_efl_object_key_value_set(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char *key, Eina_Value *value)
{
_key_generic_set(obj, pd, key, value, DATA_VAL, EINA_TRUE);
}
EOAPI EFL_VOID_FUNC_BODYV(efl_key_value_set, EFL_FUNC_CALL(key, value),
const char *key, Eina_Value *value);
EOLIAN static Eina_Value *
_efl_object_key_value_get(Eo *obj, Efl_Object_Data *pd, const char *key)
{
return _key_generic_get(obj, pd, key, DATA_VAL);
}
EOAPI EFL_FUNC_BODYV_CONST(efl_key_value_get, Eina_Value *, NULL,
EFL_FUNC_CALL(key), const char *key);
EOLIAN static void
_efl_object_name_set(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char *name)
{
@ -1980,6 +2004,14 @@ _efl_object_future_link(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, Efl_Future *li
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_object_dbg_info_get), \
EFL_OBJECT_OP_FUNC(efl_future_link, _efl_object_future_link), \
EFL_OBJECT_OP_FUNC(efl_wref_add, _efl_object_wref_add), \
EFL_OBJECT_OP_FUNC(efl_wref_del, _efl_object_wref_del)
EFL_OBJECT_OP_FUNC(efl_wref_del, _efl_object_wref_del), \
EFL_OBJECT_OP_FUNC(efl_key_data_set, _efl_object_key_data_set), \
EFL_OBJECT_OP_FUNC(efl_key_data_get, _efl_object_key_data_get), \
EFL_OBJECT_OP_FUNC(efl_key_ref_set, _efl_object_key_ref_set), \
EFL_OBJECT_OP_FUNC(efl_key_ref_get, _efl_object_key_ref_get), \
EFL_OBJECT_OP_FUNC(efl_key_wref_set, _efl_object_key_wref_set), \
EFL_OBJECT_OP_FUNC(efl_key_wref_get, _efl_object_key_wref_get), \
EFL_OBJECT_OP_FUNC(efl_key_value_set, _efl_object_key_value_set), \
EFL_OBJECT_OP_FUNC(efl_key_value_get, _efl_object_key_value_get) \
#include "efl_object.eo.c"