eolian: rename any_value_ptr -> any_value_ref for consistency

This commit is contained in:
Daniel Kolesa 2019-09-20 18:02:07 +02:00
parent 7cbd08ee8c
commit 53a3326ddc
22 changed files with 50 additions and 50 deletions

View File

@ -156,7 +156,7 @@ _free_func_get(const Eolian_Type *type)
return "eina_stringshare_del";
case EOLIAN_TYPE_BUILTIN_ANY_VALUE:
return "eina_value_flush";
case EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR:
case EOLIAN_TYPE_BUILTIN_ANY_VALUE_REF:
return "eina_value_free";
case EOLIAN_TYPE_BUILTIN_STRBUF:
return "eina_strbuf_free";

View File

@ -70,10 +70,10 @@ struct marshall_annotation_visitor_generate
{"stringshare", false, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]";
}},
{"any_value_ptr", true, [&] {
{"any_value_ref", true, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]";
}},
{"any_value_ptr", false, [&] {
{"any_value_ref", false, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]";
}},
{"strbuf", true, [&] {
@ -108,10 +108,10 @@ struct marshall_annotation_visitor_generate
{"stringshare", false, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]";
}},
{"any_value_ptr", true, [&] {
{"any_value_ref", true, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]";
}},
{"any_value_ptr", false, [&] {
{"any_value_ref", false, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]";
}},
{"strbuf", true, [&] {

View File

@ -137,14 +137,14 @@ struct marshall_type_visitor_generate
r.base_type = "Eina.ValueNative";
return r;
}}
, {"any_value_ptr", true, [&]
, {"any_value_ref", true, [&]
{
regular_type_def r = regular;
r.namespaces.clear();
r.base_type = "Eina.Value";
return r;
}}
, {"any_value_ptr", false, [&]
, {"any_value_ref", false, [&]
{
regular_type_def r = regular;
r.namespaces.clear();

View File

@ -293,7 +293,7 @@ struct struct_internal_definition_generator
|| (regular && (regular->base_type == "string"
|| regular->base_type == "mstring"
|| regular->base_type == "stringshare"
|| regular->base_type == "any_value_ptr")))
|| regular->base_type == "any_value_ref")))
{
if (!as_generator(indent << scope_tab << "/// <summary>Internal wrapper for field " << field_name << "</summary>\n"
<< indent << scope_tab << "public System.IntPtr " << field_name << ";\n")

View File

@ -228,9 +228,9 @@ struct visitor_generate
, {"any_value", false, [&]
{ return regular_type_def{"Eina.Value", regular.base_qualifier, {}};
}}
, {"any_value_ptr", nullptr, [&]
, {"any_value_ref", nullptr, [&]
{ return regular_type_def{"Eina.Value", regular.base_qualifier, {}};
}} // FIXME add proper support for any_value_ptr
}} // FIXME add proper support for any_value_ref
};
std::string full_type_name = name_helpers::type_full_eolian_name(regular);
if(eina::optional<bool> b = call_match

View File

@ -161,7 +161,7 @@ ffi.cdef [[
EOLIAN_TYPE_BUILTIN_LIST,
EOLIAN_TYPE_BUILTIN_ANY_VALUE,
EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR,
EOLIAN_TYPE_BUILTIN_ANY_VALUE_REF,
EOLIAN_TYPE_BUILTIN_BINBUF,
EOLIAN_TYPE_BUILTIN_EVENT,
EOLIAN_TYPE_BUILTIN_MSTRING,
@ -962,7 +962,7 @@ M.type_builtin_type = {
LIST = 39,
ANY_VALUE = 40,
ANY_VALUE_PTR = 41,
ANY_VALUE_REF = 41,
BINBUF = 42,
EVENT = 43,
MSTRING = 44,

View File

@ -37,7 +37,7 @@ abstract Efl.Loop extends Efl.Task
}
begin {
[[Runs the application main loop.]]
return: any_value_ptr; [[Value set by quit()]]
return: any_value_ref; [[Value set by quit()]]
}
quit {
[[Quits the main loop once all the events currently on the queue have

View File

@ -9,7 +9,7 @@ interface @beta Efl.Config
name: string; [[Configuration option name.]]
}
values {
value: any_value_ptr @move;
value: any_value_ref @move;
[[The value. It will be empty if it doesn't exist. The caller
must free it after use (using $eina_value_free() in C).]]
}
@ -19,7 +19,7 @@ interface @beta Efl.Config
name: string; [[Configuration option name.]]
}
values {
value: const(any_value_ptr);
value: const(any_value_ref);
[[Configuration option value. May be $null if not found.]]
}
return: bool; [[$false in case of error: value type was invalid, the

View File

@ -59,7 +59,7 @@ interface @beta Efl.Model
See @.property.get, @[Efl.Model.properties,changed]
]]
return: future<any_value_ptr>; [[Return an error in case the property could not be set,
return: future<any_value_ref>; [[Return an error in case the property could not be set,
or the value that was set otherwise.]]
}
get {
@ -76,7 +76,7 @@ interface @beta Efl.Model
property: string; [[Property name]]
}
values {
value: any_value_ptr; [[Property value]]
value: any_value_ref; [[Property value]]
}
}
property_ready_get {
@ -94,7 +94,7 @@ interface @beta Efl.Model
params {
@in property: string; [[Property name.]]
}
return: future<any_value_ptr>; [[Future to be resolved when the property changes to anything other than
return: future<any_value_ref>; [[Future to be resolved when the property changes to anything other than
error:EAGAIN]]
}
children_slice_get {

View File

@ -4,7 +4,7 @@ function @beta EflUiViewModelPropertyGet {
@in view_model: const(Efl.Ui.View_Model); [[The ViewModel object the @.property.get is issued on.]]
@in property: stringshare; [[The property name the @.property.get is issued on.]]
}
return: any_value_ptr; [[The property value.]]
return: any_value_ref; [[The property value.]]
};
function @beta EflUiViewModelPropertySet {
@ -12,9 +12,9 @@ function @beta EflUiViewModelPropertySet {
params {
@in view_model: Efl.Ui.View_Model; [[The ViewModel object the @.property.set is issued on.]]
@in property: stringshare; [[The property name the @.property.set is issued on.]]
@in value: any_value_ptr @move; [[The new value to set.]]
@in value: any_value_ref @move; [[The new value to set.]]
}
return: future<any_value_ptr>; [[The value that was finally set.]]
return: future<any_value_ref>; [[The value that was finally set.]]
};
class @beta Efl.Ui.View_Model extends Efl.Composite_Model

View File

@ -280,7 +280,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
windows are closed.
]]
values {
exit_code: const(any_value_ptr); [[The exit code to use when exiting]]
exit_code: const(any_value_ref); [[The exit code to use when exiting]]
}
}
@property icon_object {
@ -596,7 +596,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
Note this is different from @.exit_on_close which exits when a given window is closed.
]]
values {
exit_code: const(any_value_ptr); [[The exit code to use when exiting.]]
exit_code: const(any_value_ref); [[The exit code to use when exiting.]]
}
}
activate {

View File

@ -340,7 +340,7 @@ typedef enum
EOLIAN_TYPE_BUILTIN_LIST,
EOLIAN_TYPE_BUILTIN_ANY_VALUE,
EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR,
EOLIAN_TYPE_BUILTIN_ANY_VALUE_REF,
EOLIAN_TYPE_BUILTIN_BINBUF,
EOLIAN_TYPE_BUILTIN_EVENT,
EOLIAN_TYPE_BUILTIN_MSTRING,

View File

@ -326,7 +326,7 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
case KW_mstring:
case KW_stringshare:
case KW_any_value:
case KW_any_value_ptr:
case KW_any_value_ref:
case KW_binbuf:
case KW_strbuf:
tp->ownable = EINA_TRUE;
@ -645,12 +645,12 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash)
return _reset_stable(vals, was_stable, EINA_FALSE);
}
/* any type past builtin value types and containers is not allowed,
* any_value is allowed but passed as const reference, any_value_ptr
* any_value is allowed but passed as const reference, any_value_ref
* is not; string is allowed, but mutable strings or stringshares are
* not and neither are string buffers, the type is never owned by the
* callee, so all strings passed in are unowned and read-only
*/
if (kwid >= KW_any_value_ptr && kwid != KW_string)
if (kwid >= KW_any_value_ref && kwid != KW_string)
{
_eo_parser_log(&tp->base, "forbidden event type");
return _reset_stable(vals, was_stable, EINA_FALSE);

View File

@ -60,7 +60,7 @@ enum Tokens
KW(void), \
\
KW(accessor), KW(array), KW(future), KW(iterator), KW(hash), KW(list), \
KW(any_value), KW(any_value_ptr), KW(binbuf), KW(event), \
KW(any_value), KW(any_value_ref), KW(binbuf), KW(event), \
KW(mstring), KW(string), KW(stringshare), KW(strbuf), \
\
KW(void_ptr), \

View File

@ -164,7 +164,7 @@ struct visitor_generate
else
return replace_base_type(r, " Eina_Binbuf const*");
}}
/* FIXME: handle any_value_ptr */
/* FIXME: handle any_value_ref */
, {"any_value", true, nullptr, nullptr, [&]
{
return regular_type_def{" ::efl::eina::value", regular.base_qualifier ^ qualifier_info::is_ref, {}};
@ -172,11 +172,11 @@ struct visitor_generate
, {"any_value", false, nullptr, nullptr, [&]
{ return regular_type_def{" ::efl::eina::value_view", regular.base_qualifier, {}};
}}
, {"any_value_ptr", true, nullptr, nullptr, [&]
, {"any_value_ref", true, nullptr, nullptr, [&]
{
return regular_type_def{" ::efl::eina::value", regular.base_qualifier ^ qualifier_info::is_ref, {}};
}}
, {"any_value_ptr", false, nullptr, nullptr, [&]
, {"any_value_ref", false, nullptr, nullptr, [&]
{ return regular_type_def{" ::efl::eina::value_view", regular.base_qualifier ^ qualifier_info::is_ref, {}};
}}
};

View File

@ -37,7 +37,7 @@ class @beta Efl.Canvas.Gesture_Manager extends Efl.Object
name: string; [[Property name.]]
}
values {
value: any_value_ptr; [[Value of the property.]]
value: any_value_ref; [[Value of the property.]]
}
}
}

View File

@ -48,7 +48,7 @@ abstract @beta Efl.Canvas.Gesture_Recognizer extends Efl.Object
name: string; [[Property name.]]
}
values {
value: any_value_ptr; [[Value of the property.]]
value: any_value_ref; [[Value of the property.]]
}
}
}

View File

@ -130,7 +130,7 @@ class Eolian_Type_Builtin_Type(IntEnum):
LIST = 39
ANY_VALUE = 40
ANY_VALUE_PTR = 41
ANY_VALUE_REF = 41
BINBUF = 42
EVENT = 43

View File

@ -141,8 +141,8 @@ internal class StructHelpers
complex.Fany_value = new Eina.Value(Eina.ValueType.Double);
complex.Fany_value.Set(-9007199254740992.0);
complex.Fany_value_ptr = new Eina.Value(Eina.ValueType.String);
complex.Fany_value_ptr.Set("abc");
complex.Fany_value_ref = new Eina.Value(Eina.ValueType.String);
complex.Fany_value_ref.Set("abc");
complex.Fbinbuf = new Eina.Binbuf();
complex.Fbinbuf.Append(126);
@ -180,7 +180,7 @@ internal class StructHelpers
Test.Assert(double_val == -9007199254740992.0);
string str_val = null;
Test.Assert(complex.Fany_value_ptr.Get(out str_val));
Test.Assert(complex.Fany_value_ref.Get(out str_val));
Test.Assert(str_val == "abc");
Test.Assert(complex.Fbinbuf.Length == 1);
@ -201,7 +201,7 @@ internal class StructHelpers
Test.Assert(complex.Fhash == null);
Test.Assert(complex.Fiterator == null);
Test.Assert(complex.Fany_value == null);
Test.Assert(complex.Fany_value_ptr == null);
Test.Assert(complex.Fany_value_ref == null);
Test.Assert(complex.Fbinbuf == null);
Test.Assert(complex.Fslice.Length == 0);

View File

@ -162,7 +162,7 @@ public static class TestEinaValueEolian {
}
// ValueType in eolian context is beta, so not allowed.
// Value does not have this problem as it is used as any_value/any_value_ptr
// Value does not have this problem as it is used as any_value/any_value_ref
#if EFL_BETA
public static void TestEolianEinaValueTypeMarshalling()
{

View File

@ -4117,8 +4117,8 @@ void struct_complex_with_values(Dummy_StructComplex *complex)
eina_value_setup(&complex->fany_value, EINA_VALUE_TYPE_DOUBLE);
eina_value_set(&complex->fany_value, -9007199254740992.0);
complex->fany_value_ptr = eina_value_new(EINA_VALUE_TYPE_STRING);
eina_value_set(complex->fany_value_ptr, "abc");
complex->fany_value_ref = eina_value_new(EINA_VALUE_TYPE_STRING);
eina_value_set(complex->fany_value_ref, "abc");
complex->fbinbuf = eina_binbuf_new();
eina_binbuf_append_char(complex->fbinbuf, 126);
@ -4152,7 +4152,7 @@ Eina_Bool check_and_modify_struct_complex(Dummy_StructComplex *complex)
return EINA_FALSE;
const char *str_val = NULL;
if (!eina_value_get(complex->fany_value_ptr, &str_val) || strcmp(str_val, "abc") != 0)
if (!eina_value_get(complex->fany_value_ref, &str_val) || strcmp(str_val, "abc") != 0)
return EINA_FALSE;
if (eina_binbuf_length_get(complex->fbinbuf) != 1 || eina_binbuf_string_get(complex->fbinbuf)[0] != 126)

View File

@ -79,7 +79,7 @@ struct @free(free) Dummy.StructComplex {
fhash: hash<string, string>;
fiterator: iterator<string>;
fany_value: any_value;
fany_value_ptr: any_value_ptr;
fany_value_ref: any_value_ref;
fbinbuf: binbuf;
fslice: slice<ubyte>;
// fslice: ptr(Eina.Slice); // TODO
@ -1243,13 +1243,13 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
/* Eina Values */
set_value_ptr {
params {
value: any_value_ptr;
value: any_value_ref;
}
}
set_value_ptr_own {
params {
value: any_value_ptr @move;
value: any_value_ref @move;
}
}
@ -1266,11 +1266,11 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
get_value_ptr_own {
return: any_value_ptr @move;
return: any_value_ref @move;
}
get_value_ptr {
return: any_value_ptr;
return: any_value_ref;
}
/* Commented out due to issues regarding eolian treatment of any_value.
@ -1287,13 +1287,13 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
out_value_ptr {
params {
@out value: any_value_ptr;
@out value: any_value_ref;
}
}
out_value_ptr_own {
params {
@out value: any_value_ptr @move;
@out value: any_value_ref @move;
}
}
@ -1595,7 +1595,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
/* Futures */
get_future {
return: future<any_value_ptr>;
return: future<any_value_ref>;
}
fulfill_promise {