eolian: add any_value_ptr

Because pointer Eina_Values and value Eina_Values have slightly
different semantics (when it comes to resource management) it's
better to split them.
This commit is contained in:
Daniel Kolesa 2017-09-22 20:25:31 +02:00
parent 3d8081d085
commit 9009d3dae4
6 changed files with 13 additions and 8 deletions

View File

@ -7,7 +7,7 @@ interface Efl.Config ()
[[Set configuration]]
params {
name: string; [[Configuration option name]]
val: ptr(const(any_value)); [[Configuration option value]]
val: const(any_value_ptr); [[Configuration option value]]
}
return: bool; [[$false in case of error: value type was invalid, the
config can't be changed, config does not exist...]]
@ -17,14 +17,14 @@ interface Efl.Config ()
params {
name: string; [[Configuration option name]]
}
return: ptr(any_value) @owned; [[Configuration option value]]
return: any_value_ptr @owned; [[Configuration option value]]
}
config_list_get @const {
[[Returns a list of generic values under a given key.]]
params {
@in name: string; [[Configuration option name]]
}
return: iterator<ptr(any_value)> @owned; [[
return: iterator<any_value_ptr> @owned; [[
List of configuration option values]]
}
}

View File

@ -47,7 +47,7 @@ interface Efl.Model ()
]]
params {
@in property: string; [[Property name]]
@in value: ptr(const(any_value)); [[New value]]
@in value: const(any_value_ptr); [[New value]]
}
return: future<any_value>; [[Future returning the recorded value or error]]
}

View File

@ -93,7 +93,7 @@ class Elm.Prefs (Elm.Widget, Efl.File)
return: bool; [[$true, on success, $false otherwise]]
params {
@in name: string; [[The name of the item (as declared in the prefs collection)]]
@in value: ptr(const(any_value)); [[The value to set on the item. It should be typed as the item expects, preferably, or a conversion will take place]]
@in value: const(any_value_ptr); [[The value to set on the item. It should be typed as the item expects, preferably, or a conversion will take place]]
}
}
item_value_get @const {

View File

@ -142,7 +142,8 @@ static const char * const eo_complex_frees[] =
static const char *eo_obj_free = "efl_del";
static const char *eo_str_free = "free";
static const char *eo_strshare_free = "eina_stringshare_del";
static const char *eo_value_free = "eina_value_free";
static const char *eo_value_free = "eina_value_flush";
static const char *eo_value_ptr_free = "eina_value_free";
static Eina_Bool
_validate_type(Eolian_Type *tp)
@ -190,6 +191,9 @@ _validate_type(Eolian_Type *tp)
case KW_any_value:
tp->freefunc = eina_stringshare_add(eo_value_free);
break;
case KW_any_value_ptr:
tp->freefunc = eina_stringshare_add(eo_value_ptr_free);
break;
default:
break;
}

View File

@ -74,7 +74,8 @@ static const char * const ctypes[] =
"Eina_Accessor *", "Eina_Array *", "Eina_Iterator *", "Eina_Hash *",
"Eina_List *",
"Efl_Future *",
"Eina_Value", "char *", "const char *", "Eina_Stringshare *",
"Eina_Value", "Eina_Value *",
"char *", "const char *", "Eina_Stringshare *",
"void *",

View File

@ -52,7 +52,7 @@ enum Tokens
\
KW(accessor), KW(array), KW(iterator), KW(hash), KW(list), \
KW(future), \
KW(any_value), \
KW(any_value), KW(any_value_ptr), \
KW(mstring), KW(string), KW(stringshare), \
\
KW(void_ptr), \