forked from enlightenment/efl
Merge branch 'master' into devs/hermet/lottie
This commit is contained in:
commit
01c175bdba
|
@ -4,8 +4,7 @@
|
|||
eo_eolian_files = \
|
||||
lib/eo/efl_object.eo \
|
||||
lib/eo/efl_class.eo \
|
||||
lib/eo/efl_object_override.eo \
|
||||
lib/eo/efl_interface.eo
|
||||
lib/eo/efl_object_override.eo
|
||||
|
||||
eo_eolian_c = $(eo_eolian_files:%.eo=%.eo.c)
|
||||
eo_eolian_h = $(eo_eolian_files:%.eo=%.eo.h)
|
||||
|
@ -149,7 +148,8 @@ tests/eo/suite/eo_test_value.c \
|
|||
tests/eo/suite/eo_test_event.c \
|
||||
tests/eo/suite/eo_test_threaded_calls.c \
|
||||
tests/eo/suite/eo_test_init.c \
|
||||
tests/eo/suite/eo_test_lifecycle.c
|
||||
tests/eo/suite/eo_test_lifecycle.c \
|
||||
tests/eo/suite/eo_test_reflection.c
|
||||
|
||||
tests_eo_eo_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
|
||||
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
|
||||
|
|
|
@ -38,7 +38,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_other_call, _other_call),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -65,7 +65,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -882,7 +882,7 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf)
|
|||
eina_strbuf_append(buf, "#endif\n\n");
|
||||
}
|
||||
|
||||
eina_strbuf_append(buf, " return efl_class_functions_set(klass, opsp, copsp);\n");
|
||||
eina_strbuf_append(buf, " return efl_class_functions_set(klass, opsp, copsp, NULL);\n");
|
||||
|
||||
eina_strbuf_free(ops);
|
||||
eina_strbuf_free(cops);
|
||||
|
|
|
@ -25,7 +25,7 @@ public class EcoreEvas
|
|||
ecore_evas_init();
|
||||
handle = ecore_evas_new(IntPtr.Zero, 0, 0, 640, 480, IntPtr.Zero);
|
||||
if(handle == IntPtr.Zero)
|
||||
System.Console.WriteLine("Couldn't create a ecore evas");
|
||||
Eina.Log.Error("Couldn't create a ecore evas");
|
||||
ecore_evas_show(handle);
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ public class Globals {
|
|||
efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr extn45, IntPtr extn46, IntPtr extn47, IntPtr term);
|
||||
[DllImport(efl.Libs.Eo)] public static extern IntPtr
|
||||
efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr extn45, IntPtr extn46, IntPtr extn47, IntPtr extn48, IntPtr term);
|
||||
[DllImport(efl.Libs.Eo)] public static extern byte efl_class_functions_set(IntPtr klass_id, IntPtr object_ops, IntPtr class_ops);
|
||||
[DllImport(efl.Libs.Eo)] public static extern byte efl_class_functions_set(IntPtr klass_id, IntPtr object_ops, IntPtr class_ops, IntPtr reflection_ops);
|
||||
[DllImport(efl.Libs.Eo)] public static extern IntPtr efl_data_scope_get(IntPtr obj, IntPtr klass);
|
||||
[DllImport(efl.Libs.Eo)] public static extern IntPtr efl_super(IntPtr obj, IntPtr klass);
|
||||
[DllImport(efl.Libs.Eo)] public static extern IntPtr efl_class_get(IntPtr obj);
|
||||
|
@ -152,7 +152,7 @@ public class Globals {
|
|||
|
||||
public static System.Collections.Concurrent.ConcurrentDictionary<System.Type, System.IntPtr> klasses
|
||||
= new System.Collections.Concurrent.ConcurrentDictionary<System.Type, System.IntPtr>();
|
||||
|
||||
|
||||
public const int RTLD_NOW = 2;
|
||||
|
||||
public delegate byte class_initializer(IntPtr klass);
|
||||
|
@ -173,7 +173,7 @@ public class Globals {
|
|||
{
|
||||
return v != null;
|
||||
}
|
||||
|
||||
|
||||
public static IntPtr register_class(String class_name, IntPtr base_klass, System.Type type)
|
||||
{
|
||||
ClassDescription description;
|
||||
|
@ -189,7 +189,7 @@ public class Globals {
|
|||
{
|
||||
return Globals.class_initializer_call(kls, type);
|
||||
};
|
||||
|
||||
|
||||
description.class_initializer = Marshal.GetFunctionPointerForDelegate(init);
|
||||
|
||||
IntPtr description_ptr = Eina.MemoryNative.Alloc(Marshal.SizeOf(description));
|
||||
|
@ -197,15 +197,10 @@ public class Globals {
|
|||
|
||||
var interface_list = EoG.get_efl_interfaces(type);
|
||||
|
||||
System.Console.WriteLine ("Interafaces: {0}", interface_list.Count);
|
||||
|
||||
Eina.Log.Debug("Going to register!");
|
||||
Eina.Log.Debug($"Going to register new class named {class_name}");
|
||||
IntPtr klass = EoG.call_efl_class_new(description_ptr, base_klass, interface_list);
|
||||
if(klass == IntPtr.Zero)
|
||||
{
|
||||
Eina.Log.Error("klass was not registered");
|
||||
Console.WriteLine("klass was not registered");
|
||||
}
|
||||
else
|
||||
Eina.Log.Debug("Registered class successfully");
|
||||
return klass;
|
||||
|
@ -213,7 +208,7 @@ public class Globals {
|
|||
public static List<IntPtr> get_efl_interfaces(System.Type type)
|
||||
{
|
||||
System.Type base_type = type.BaseType;
|
||||
|
||||
|
||||
var ifaces_lst = new List<IntPtr>();
|
||||
var base_ifaces = base_type.GetInterfaces();
|
||||
var ifaces = type.GetInterfaces();
|
||||
|
@ -246,12 +241,12 @@ public class Globals {
|
|||
}
|
||||
public static byte class_initializer_call(IntPtr klass, System.Type type)
|
||||
{
|
||||
Console.WriteLine("class_intiailizer_call 0x{1} {0}", type, klass);
|
||||
Eina.Log.Debug($"called with 0x{klass.ToInt64()} {type}");
|
||||
Efl.Eo.NativeClass nativeClass = get_native_class(type.BaseType);
|
||||
|
||||
if (nativeClass != null)
|
||||
{
|
||||
Console.WriteLine("nativeClass != null");
|
||||
Eina.Log.Debug("nativeClass != null");
|
||||
var descs = nativeClass.GetEoOps(type);
|
||||
var count = descs.Count;
|
||||
|
||||
|
@ -265,13 +260,13 @@ public class Globals {
|
|||
if(nc != null)
|
||||
{
|
||||
var moredescs = nc.GetEoOps(type);
|
||||
Console.WriteLine("adding {0} more descs to registration", moredescs.Count);
|
||||
Eina.Log.Debug("adding {moredescs.Count} more descs to registration");
|
||||
descs.AddRange(moredescs);
|
||||
count = descs.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IntPtr descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0])*count);
|
||||
IntPtr ptr = descs_ptr;
|
||||
for(int i = 0; i != count; ++i)
|
||||
|
@ -284,12 +279,12 @@ public class Globals {
|
|||
ops.count = (UIntPtr)count;
|
||||
IntPtr ops_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(ops));
|
||||
Marshal.StructureToPtr(ops, ops_ptr, false);
|
||||
Efl.Eo.Globals.efl_class_functions_set(klass, ops_ptr, IntPtr.Zero);
|
||||
Efl.Eo.Globals.efl_class_functions_set(klass, ops_ptr, IntPtr.Zero, IntPtr.Zero);
|
||||
//EoKlass = klass;
|
||||
}
|
||||
else
|
||||
Console.WriteLine("nativeClass == null");
|
||||
|
||||
Eina.Log.Debug("nativeClass == null");
|
||||
|
||||
return 1;
|
||||
}
|
||||
public static IntPtr call_efl_class_new(IntPtr desc, IntPtr bk, List<IntPtr> il = null)
|
||||
|
@ -353,7 +348,6 @@ public class Globals {
|
|||
public static IntPtr instantiate_start(IntPtr klass, Efl.Object parent)
|
||||
{
|
||||
Eina.Log.Debug($"Instantiating from klass 0x{klass.ToInt64():x}");
|
||||
Console.WriteLine($"Instantiating from klass 0x{klass.ToInt64():x}");
|
||||
System.IntPtr parent_ptr = System.IntPtr.Zero;
|
||||
if(parent != null)
|
||||
parent_ptr = parent.NativeHandle;
|
||||
|
@ -363,9 +357,9 @@ public class Globals {
|
|||
{
|
||||
throw new Exception("Instantiation failed");
|
||||
}
|
||||
|
||||
Console.WriteLine($"Eo instance right after internal_start 0x{eo.ToInt64():x} with refcount {Efl.Eo.Globals.efl_ref_count(eo)}");
|
||||
Console.WriteLine($"Parent was 0x{parent_ptr.ToInt64()}");
|
||||
|
||||
Eina.Log.Debug($"Eo instance right after internal_start 0x{eo.ToInt64():x} with refcount {Efl.Eo.Globals.efl_ref_count(eo)}");
|
||||
Eina.Log.Debug($"Parent was 0x{parent_ptr.ToInt64()}");
|
||||
return eo;
|
||||
}
|
||||
|
||||
|
@ -529,7 +523,7 @@ public interface IWrapper
|
|||
get;
|
||||
}
|
||||
/// <summary>Pointer to internal Eo class.</summary>
|
||||
IntPtr NativeClass
|
||||
IntPtr NativeClass
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ class Efl.Composite_Model extends Efl.Loop_Model implements Efl.Ui.View
|
|||
Efl.Model.child_del;
|
||||
}
|
||||
constructors {
|
||||
.index;
|
||||
.index @optional;
|
||||
Efl.Ui.View.model;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,6 +99,6 @@ class Efl.View_Model extends Efl.Composite_Model
|
|||
Efl.Model.property { set; get; }
|
||||
}
|
||||
constructors {
|
||||
Efl.View_Model.children_bind;
|
||||
Efl.View_Model.children_bind @optional;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -607,6 +607,7 @@ _range_del_emit(Evas_Object *obj, Efl_Text_Cursor_Cursor *cur1, Efl_Text_Cursor_
|
|||
evas_textblock_cursor_range_delete(cur1, cur2);
|
||||
|
||||
efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
|
||||
efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL);
|
||||
if (tmp) free(tmp);
|
||||
}
|
||||
|
||||
|
@ -637,6 +638,7 @@ _delete_emit(Eo *obj, Evas_Textblock_Cursor *c, Efl_Ui_Internal_Text_Interactive
|
|||
evas_textblock_cursor_char_delete(c);
|
||||
|
||||
efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
|
||||
efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL);
|
||||
if (tmp) free(tmp);
|
||||
}
|
||||
|
||||
|
@ -1061,6 +1063,8 @@ end:
|
|||
if (changed_user)
|
||||
{
|
||||
efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
|
||||
/* FIXME: this is kinda gross */
|
||||
efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL);
|
||||
}
|
||||
(void) 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
interface Efl.Ui.Legacy extends Efl.Interface
|
||||
interface Efl.Ui.Legacy
|
||||
{
|
||||
[[The bg (background) widget is used for setting (solid) background decorations
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import efl_ui_list_view_types;
|
||||
|
||||
interface Efl.Ui.List_View_Model extends Efl.Interface
|
||||
interface Efl.Ui.List_View_Model
|
||||
{
|
||||
methods {
|
||||
@property load_range {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
interface Efl.Ui.List_View_Relayout extends Efl.Interface
|
||||
interface Efl.Ui.List_View_Relayout
|
||||
{
|
||||
methods {
|
||||
layout_do {
|
||||
|
|
|
@ -87,7 +87,7 @@ _custom_table_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _custom_table_calc)
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, NULL, &class_ops);
|
||||
return efl_class_functions_set(klass, NULL, &class_ops, NULL);
|
||||
};
|
||||
|
||||
static const Efl_Class_Description custom_table_class_desc = {
|
||||
|
|
|
@ -91,7 +91,7 @@ struct _Efl_Ui_Text_Data
|
|||
const char *hover_style; /**< style of a hover object */
|
||||
} anchor_hover;
|
||||
|
||||
Elm_Sel_Format cnp_mode;
|
||||
Efl_Ui_Selection_Format cnp_mode;
|
||||
Elm_Sel_Format drop_format;
|
||||
|
||||
struct {
|
||||
|
@ -599,8 +599,10 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj,
|
|||
Efl_Ui_Selection_Data *sel_data)
|
||||
{
|
||||
Efl_Text_Cursor_Cursor *cur, *start, *end;
|
||||
Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 };
|
||||
|
||||
char *buf = eina_slice_strdup(sel_data->content);
|
||||
size_t len = sel_data->content.len;
|
||||
|
||||
efl_text_interactive_selection_cursors_get(obj, &start, &end);
|
||||
if (!efl_text_cursor_equal(obj, start, end))
|
||||
|
@ -608,6 +610,10 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj,
|
|||
efl_canvas_text_range_delete(obj, start, end);
|
||||
}
|
||||
cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
|
||||
info.insert = EINA_TRUE;
|
||||
info.position = efl_text_cursor_position_get(obj, cur);
|
||||
info.length = len;
|
||||
info.content = buf;
|
||||
if (sel_data->format == EFL_UI_SELECTION_FORMAT_MARKUP)
|
||||
{
|
||||
efl_text_markup_interactive_cursor_markup_insert(obj, cur, buf);
|
||||
|
@ -616,6 +622,7 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj,
|
|||
{
|
||||
efl_text_cursor_text_insert(obj, cur, buf);
|
||||
}
|
||||
efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
|
@ -684,7 +691,7 @@ _get_drop_format(Evas_Object *obj)
|
|||
EFL_UI_TEXT_DATA_GET(obj, sd);
|
||||
|
||||
if ((sd->editable) && (!sd->single_line) && (!sd->password) && (!sd->disabled))
|
||||
return EFL_UI_SELECTION_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE;
|
||||
return EFL_UI_SELECTION_FORMAT_MARKUP | EFL_UI_SELECTION_FORMAT_IMAGE;
|
||||
return EFL_UI_SELECTION_FORMAT_MARKUP;
|
||||
}
|
||||
|
||||
|
@ -2120,6 +2127,9 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
|
|||
elm_widget_sub_object_parent_add(obj);
|
||||
|
||||
text_obj = efl_add(EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS, obj);
|
||||
efl_event_callback_forwarder_add(text_obj, EFL_UI_TEXT_EVENT_CHANGED_USER, obj);
|
||||
efl_event_callback_forwarder_add(text_obj, EFL_UI_TEXT_EVENT_CHANGED, obj);
|
||||
efl_event_callback_forwarder_add(text_obj, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, obj);
|
||||
sd->text_obj = text_obj;
|
||||
sd->text_guide_obj = efl_add(EFL_CANVAS_TEXT_CLASS, obj);
|
||||
sd->text_table = efl_add(EFL_UI_TABLE_CLASS, obj);
|
||||
|
@ -2132,7 +2142,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
|
|||
sd->auto_save = EINA_TRUE;
|
||||
sd->editable = EINA_TRUE;
|
||||
sd->sel_allow = EINA_TRUE;
|
||||
sd->drop_format = EFL_UI_SELECTION_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE;
|
||||
sd->drop_format = EFL_UI_SELECTION_FORMAT_MARKUP | EFL_UI_SELECTION_FORMAT_IMAGE;
|
||||
sd->last.scroll = EINA_SIZE2D(0, 0);
|
||||
sd->sel_handler_disabled = EINA_TRUE;
|
||||
|
||||
|
@ -2555,7 +2565,7 @@ _efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Ui_Selection_Format
|
|||
if (sd->cnp_mode == EFL_UI_SELECTION_FORMAT_TEXT)
|
||||
dnd_format = EFL_UI_SELECTION_FORMAT_TEXT;
|
||||
else if (cnp_mode == EFL_UI_SELECTION_FORMAT_IMAGE)
|
||||
dnd_format |= ELM_SEL_FORMAT_IMAGE;
|
||||
dnd_format |= EFL_UI_SELECTION_FORMAT_IMAGE;
|
||||
|
||||
elm_drop_target_del(obj, sd->drop_format,
|
||||
_dnd_enter_cb, NULL,
|
||||
|
@ -3892,13 +3902,14 @@ _decoration_defer_all(Eo *obj)
|
|||
}
|
||||
|
||||
static void
|
||||
_efl_ui_text_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
|
||||
_efl_ui_text_changed_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
if (efl_invalidated_get(event->object)) return;
|
||||
EFL_UI_TEXT_DATA_GET(data, sd);
|
||||
sd->text_changed = EINA_TRUE;
|
||||
sd->cursor_update = EINA_TRUE;
|
||||
_update_guide_text(data, sd);
|
||||
efl_event_callback_call(event->object, EFL_UI_TEXT_EVENT_CHANGED, NULL);
|
||||
elm_layout_sizing_eval(data);
|
||||
_decoration_defer(data);
|
||||
}
|
||||
|
|
|
@ -595,7 +595,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
|
|||
Efl.Part.part_get; [[Returns @Efl.Ui.Widget_Part.]]
|
||||
}
|
||||
constructors {
|
||||
.style;
|
||||
.style @optional;
|
||||
}
|
||||
events {
|
||||
moved: Efl.Object; [[Called when widget moved]]
|
||||
|
|
|
@ -23,6 +23,6 @@ class Efl.Ui.Widget_Factory extends Efl.Loop_Consumer implements Efl.Ui.Factory
|
|||
Efl.Ui.Model.Connect.connect;
|
||||
}
|
||||
constructors {
|
||||
.item_class;
|
||||
.item_class @optional;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -872,9 +872,9 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
|
|||
Efl.Part.part_get;
|
||||
}
|
||||
constructors {
|
||||
.win_name;
|
||||
.win_type;
|
||||
.accel_preference;
|
||||
.win_name @optional;
|
||||
.win_type @optional;
|
||||
.accel_preference @optional;
|
||||
}
|
||||
events {
|
||||
delete,request: void; [[Called when the window receives a delete request]]
|
||||
|
|
|
@ -279,7 +279,7 @@ _gl_filter_finished_cb(void *data, const Efl_Event *event)
|
|||
else _table_resize(data);
|
||||
elm_genlist_item_selected_set(sd->item, EINA_TRUE);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
sd->expanded = EINA_FALSE;
|
||||
elm_layout_signal_emit(sd->hover, "elm,action,hide,no_animate", "elm");
|
||||
|
@ -616,7 +616,7 @@ _elm_combobox_class_initializer(Efl_Class *klass)
|
|||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_combobox)
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description _elm_combobox_class_desc = {
|
||||
|
|
|
@ -229,6 +229,6 @@ class Elm.Glview extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.Ui.Legacy
|
|||
]]
|
||||
}
|
||||
constructors {
|
||||
.version_constructor;
|
||||
.version_constructor @optional;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,6 @@ class Elm.View.Form extends Efl.Object
|
|||
Efl.Object.destructor;
|
||||
}
|
||||
constructors {
|
||||
.model_set;
|
||||
.model_set @optional;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,6 @@ class Elm.View.List extends Efl.Object
|
|||
Efl.Object.destructor;
|
||||
}
|
||||
constructors {
|
||||
.genlist_set;
|
||||
.genlist_set @optional;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,7 +216,6 @@ typedef void (*Efl_Del_Intercept) (Eo *obj_id);
|
|||
|
||||
#include "efl_object_override.eo.h"
|
||||
#include "efl_object.eo.h"
|
||||
#include "efl_interface.eo.h"
|
||||
#define EO_CLASS EFL_OBJECT_CLASS
|
||||
|
||||
/** An event callback prototype. */
|
||||
|
@ -826,6 +825,40 @@ struct _Efl_Class_Description
|
|||
void (*class_constructor)(Efl_Class *klass); /**< The constructor of the class. */
|
||||
void (*class_destructor)(Efl_Class *klass); /**< The destructor of the class. */
|
||||
};
|
||||
/**
|
||||
* Setter type which is used to set an #Eina_Value, this function should access one particular property field
|
||||
*/
|
||||
typedef void (*Efl_Object_Property_Reflection_Setter)(Eo *obj, Eina_Value value);
|
||||
|
||||
/**
|
||||
* Getter type which is used to get an #Eina_Value, this function should access one particular property field
|
||||
*/
|
||||
typedef Eina_Value (*Efl_Object_Property_Reflection_Getter)(Eo *obj);
|
||||
|
||||
/**
|
||||
* @struct _Efl_Object_Property_Reflection
|
||||
*
|
||||
* This structure holds one line of the reflection table.
|
||||
* The two fields get and set might be NULL,
|
||||
* the property_name is a normal c string containing the name of the property
|
||||
* that the get and set function changes.
|
||||
*/
|
||||
typedef struct _Efl_Object_Property_Reflection{
|
||||
const char *property_name; /**< The name of the property */
|
||||
Efl_Object_Property_Reflection_Setter set; /**< The function used to set a generic #Eina_Value on this property of the object. */
|
||||
Efl_Object_Property_Reflection_Getter get; /**< The function used to retrieve a generic #Eina_Value from this property of the object. */
|
||||
} Efl_Object_Property_Reflection;
|
||||
|
||||
/**
|
||||
* @struct _Efl_Object_Property_Reflection_Ops
|
||||
*
|
||||
* This structure holds the reflection table and the size of this table.
|
||||
*/
|
||||
typedef struct _Efl_Object_Property_Reflection_Ops
|
||||
{
|
||||
const Efl_Object_Property_Reflection *table; /**< The reflection table. */
|
||||
size_t count; /**< Number of table lines descriptions. */
|
||||
} Efl_Object_Property_Reflection_Ops;
|
||||
|
||||
/**
|
||||
* @typedef Efl_Class_Description
|
||||
|
@ -856,13 +889,15 @@ EAPI const Efl_Class *efl_class_new(const Efl_Class_Description *desc, const Efl
|
|||
* @param klass_id the class whose functions we are setting.
|
||||
* @param object_ops The function structure we are setting for object functions
|
||||
* @param class_ops The function structure we are setting for class functions
|
||||
* @param reflection_table The reflection table to use within eo
|
||||
* @return True on success, False otherwise.
|
||||
*
|
||||
* 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.
|
||||
* @see #EFL_DEFINE_CLASS
|
||||
*/
|
||||
EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops);
|
||||
EAPI Eina_Bool efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops, const Efl_Object_Property_Reflection_Ops *reflection_table);
|
||||
|
||||
/**
|
||||
* @brief Override Eo functions of this object.
|
||||
|
@ -1944,6 +1979,25 @@ EAPI Eina_Bool efl_manual_free(Eo *obj);
|
|||
*/
|
||||
EAPI Eina_Bool efl_destructed_is(const Eo *obj);
|
||||
|
||||
/**
|
||||
* @brief Set the given #Eina_Value to the property with the specified \c property_name.
|
||||
* @param obj The object to set the property on
|
||||
* @param property_name The name of the property to modify.
|
||||
* @param value The value to set, the value passed here will be flushed by the function
|
||||
*
|
||||
*/
|
||||
EAPI void efl_property_reflection_set(Eo *obj, const char *property_name, Eina_Value value);
|
||||
|
||||
/**
|
||||
* @brief Retrieve an #Eina_Value containing the current value of the property specified with \c property_name.
|
||||
* @param obj The object to set the property on
|
||||
* @param property_name The name of the property to get.
|
||||
*
|
||||
* @return The value that got returned by the actual property in form of a generic Eina_Value. The user of this API is owning the returned Value.
|
||||
*/
|
||||
EAPI Eina_Value efl_property_reflection_get(Eo *obj, const char *property_name);
|
||||
|
||||
|
||||
/**
|
||||
* @addtogroup Efl_Class_Class Eo's Class class.
|
||||
* @{
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
interface Efl.Interface
|
||||
{
|
||||
[[An interface for other interfaces to inherit from.
|
||||
This is useful when you want to create interfaces and mixins that expose
|
||||
functions from a normal class such as @Efl.Object.constructor.]]
|
||||
}
|
||||
|
|
@ -819,7 +819,7 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Cla
|
|||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops)
|
||||
efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ops, const Efl_Object_Ops *class_ops, const Efl_Object_Property_Reflection_Ops *reflection_table)
|
||||
{
|
||||
EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass);
|
||||
Efl_Object_Ops empty_ops = { 0 };
|
||||
|
@ -832,6 +832,8 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_
|
|||
|
||||
if (!class_ops) class_ops = &empty_ops;
|
||||
|
||||
klass->reflection = reflection_table;
|
||||
|
||||
klass->ops_count = object_ops->count + class_ops->count;
|
||||
|
||||
klass->base_id = _eo_ops_last_id;
|
||||
|
@ -982,7 +984,7 @@ _efl_add_internal_end(Eo *eo_id, Eo *finalized_id)
|
|||
// fails or succeeds based on if service is there.
|
||||
//
|
||||
// until there is a better solution - don't complain here.
|
||||
//
|
||||
//
|
||||
// ERR("Object of class '%s' - Finalizing the object failed.",
|
||||
// klass->desc->name);
|
||||
goto cleanup;
|
||||
|
@ -1691,7 +1693,7 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
|
|||
/* If functions haven't been set, invoke it with an empty ops structure. */
|
||||
if (!klass->functions_set)
|
||||
{
|
||||
efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL);
|
||||
efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Mark which classes we implement */
|
||||
|
@ -3597,3 +3599,63 @@ static const Eina_Value_Type _EINA_VALUE_TYPE_OBJECT = {
|
|||
};
|
||||
|
||||
EOAPI const Eina_Value_Type *EINA_VALUE_TYPE_OBJECT = &_EINA_VALUE_TYPE_OBJECT;
|
||||
|
||||
static const Efl_Object_Property_Reflection*
|
||||
_efl_class_reflection_find(const _Efl_Class *klass, const char *property_name)
|
||||
{
|
||||
const _Efl_Class **klass_iter = klass->extensions;
|
||||
const Efl_Object_Property_Reflection_Ops *ref = klass->reflection;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; ref && i < ref->count; ++i)
|
||||
{
|
||||
if (eina_streq(property_name, ref->table[i].property_name))
|
||||
return &ref->table[i];
|
||||
}
|
||||
|
||||
if (klass->parent)
|
||||
{
|
||||
const Efl_Object_Property_Reflection *ref;
|
||||
|
||||
ref = _efl_class_reflection_find(klass->parent, property_name);
|
||||
if (ref) return ref;
|
||||
}
|
||||
|
||||
for (; *klass_iter; klass_iter++)
|
||||
{
|
||||
return _efl_class_reflection_find(*klass_iter, property_name);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
efl_property_reflection_set(Eo *obj_id, const char *property_name, Eina_Value value)
|
||||
{
|
||||
EO_OBJ_POINTER_GOTO(obj_id, obj, end);
|
||||
const Efl_Object_Property_Reflection *reflection = _efl_class_reflection_find(obj->klass, property_name);
|
||||
|
||||
if (!reflection || !reflection->set) goto end;
|
||||
|
||||
reflection->set(obj_id, value);
|
||||
EO_OBJ_DONE(obj_id);
|
||||
return;
|
||||
end:
|
||||
eina_value_flush(&value);
|
||||
EO_OBJ_DONE(obj_id);
|
||||
}
|
||||
|
||||
EAPI Eina_Value
|
||||
efl_property_reflection_get(Eo *obj_id, const char *property_name)
|
||||
{
|
||||
EO_OBJ_POINTER(obj_id, obj);
|
||||
const Efl_Object_Property_Reflection *reflection = _efl_class_reflection_find(obj->klass, property_name);
|
||||
|
||||
if (!reflection || !reflection->get) goto end;
|
||||
|
||||
return reflection->get(obj_id);
|
||||
end:
|
||||
EO_OBJ_DONE(obj_id);
|
||||
|
||||
return EINA_VALUE_EMPTY;
|
||||
}
|
||||
|
|
|
@ -5,4 +5,3 @@
|
|||
#include "Eo.h"
|
||||
|
||||
#include "efl_class.eo.c"
|
||||
#include "efl_interface.eo.c"
|
||||
|
|
|
@ -185,6 +185,8 @@ struct _Efl_Class
|
|||
|
||||
const _Efl_Class **mro;
|
||||
|
||||
const Efl_Object_Property_Reflection_Ops *reflection;
|
||||
|
||||
/* cached object for faster allocation */
|
||||
struct {
|
||||
Eina_Trash *trash;
|
||||
|
|
|
@ -4,8 +4,7 @@ eo_pub_deps = [eina]
|
|||
pub_eo_files = [
|
||||
'efl_object.eo',
|
||||
'efl_class.eo',
|
||||
'efl_object_override.eo',
|
||||
'efl_interface.eo'
|
||||
'efl_object_override.eo'
|
||||
]
|
||||
|
||||
eo_src = [
|
||||
|
|
|
@ -9,6 +9,7 @@ engine_src = files([
|
|||
'evas_ector_software.h',
|
||||
])
|
||||
|
||||
gen_src = []
|
||||
|
||||
pub_eo_files = [
|
||||
'evas_ector_software_buffer.eo'
|
||||
|
@ -17,7 +18,7 @@ pub_eo_files = [
|
|||
subdir('filters')
|
||||
|
||||
foreach eo_file : pub_eo_files
|
||||
engine_src += custom_target('eolian_gen_' + eo_file,
|
||||
gen_src += custom_target('eolian_gen_' + eo_file,
|
||||
input : eo_file,
|
||||
output : [eo_file + '.h'],
|
||||
depfile : eo_file + '.d',
|
||||
|
@ -28,6 +29,8 @@ foreach eo_file : pub_eo_files
|
|||
'-gchd', '@INPUT@'])
|
||||
endforeach
|
||||
|
||||
engine_src += gen_src
|
||||
|
||||
engine_deps = [draw, dl]
|
||||
|
||||
if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
|
||||
|
|
|
@ -70,7 +70,8 @@ foreach engine_conf : engines
|
|||
if engine == 'software_generic'
|
||||
software_generic = declare_dependency(
|
||||
include_directories: engine_include_dir,
|
||||
source : engine_src,
|
||||
sources : gen_src,
|
||||
dependencies : [eina, evas_pre] + engine_deps,
|
||||
link_with : tmp
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -25,7 +25,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(inherit_prot_print, _prot_print),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -39,7 +39,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -44,7 +44,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -172,7 +172,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -46,7 +46,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -98,7 +98,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_b_get, _b_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -23,7 +23,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -21,7 +21,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -21,7 +21,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -21,7 +21,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -25,7 +25,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -71,7 +71,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_class_print, _class_print),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, &cops);
|
||||
return efl_class_functions_set(klass, &ops, &cops, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -23,7 +23,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -66,7 +66,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_class_print2, _class_print2),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -17,7 +17,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(interface_ab_sum_get, NULL),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -18,7 +18,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, NULL),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -68,7 +68,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(interface2_ab_sum_get2, _ab_sum_get2),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -26,7 +26,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -41,7 +41,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -55,7 +55,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -54,7 +54,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -47,7 +47,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_b_get, _b_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -79,7 +79,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -20,6 +20,7 @@ static const Efl_Test_Case etc[] = {
|
|||
{ "Eo threaded eo calls", eo_test_threaded_calls },
|
||||
{ "Eo event calls", eo_test_event},
|
||||
{ "Eo lifecycle", eo_test_lifecycle},
|
||||
{ "Eo Reflection", eo_test_reflection},
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
|
|
@ -12,4 +12,5 @@ void eo_test_value(TCase *tc);
|
|||
void eo_test_threaded_calls(TCase *tc);
|
||||
void eo_test_event(TCase *tc);
|
||||
void eo_test_lifecycle(TCase *tc);
|
||||
void eo_test_reflection(TCase *tc);
|
||||
#endif /* _EO_SUITE_H */
|
||||
|
|
|
@ -89,7 +89,7 @@ _errorcase_class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_error_test, _test),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description errorcase_class_desc = {
|
||||
|
|
|
@ -29,7 +29,7 @@ _destructor_unref_class_initializer(Efl_Class *klass2)
|
|||
EFL_OBJECT_OP_FUNC(efl_destructor, _destructor_unref),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass2, &ops, NULL);
|
||||
return efl_class_functions_set(klass2, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
EFL_START_TEST(efl_destructor_unref)
|
||||
|
|
|
@ -203,7 +203,7 @@ _null_class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(NULL, _null_fct),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
EFL_START_TEST(eo_null_api)
|
||||
|
@ -240,7 +240,7 @@ _redefined_class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(null_fct, NULL),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
EFL_START_TEST(eo_api_redefined)
|
||||
|
@ -277,7 +277,7 @@ _dich_func_class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple_a_set, NULL),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
EFL_START_TEST(eo_dich_func_override)
|
||||
|
|
|
@ -23,6 +23,16 @@ _a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
|
|||
efl_event_callback_legacy_call(obj, EV_A_CHANGED, &pd->a);
|
||||
}
|
||||
|
||||
static void
|
||||
_a_set_reflect(Eo *obj, Eina_Value value)
|
||||
{
|
||||
int a;
|
||||
|
||||
eina_value_int_convert(&value, &a);
|
||||
simple_a_set(obj, a);
|
||||
eina_value_flush(&value);
|
||||
}
|
||||
|
||||
static int
|
||||
_a_get(Eo *obj EINA_UNUSED, void *class_data)
|
||||
{
|
||||
|
@ -31,6 +41,14 @@ _a_get(Eo *obj EINA_UNUSED, void *class_data)
|
|||
return pd->a;
|
||||
}
|
||||
|
||||
static Eina_Value
|
||||
_a_get_reflect(Eo *obj)
|
||||
{
|
||||
int a = simple_a_get(obj);
|
||||
|
||||
return eina_value_int_init(a);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_a_print(Eo *obj EINA_UNUSED, void *class_data)
|
||||
{
|
||||
|
@ -103,8 +121,14 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OPS_DEFINE(cops,
|
||||
EFL_OBJECT_OP_FUNC(simple_class_hi_print, _class_hi_print),
|
||||
);
|
||||
static const Efl_Object_Property_Reflection reflection_table[] = {
|
||||
{"simple_a", _a_set_reflect, _a_get_reflect},
|
||||
};
|
||||
static const Efl_Object_Property_Reflection_Ops ref_ops = {
|
||||
reflection_table, EINA_C_ARRAY_LENGTH(reflection_table)
|
||||
};
|
||||
|
||||
return efl_class_functions_set(klass, &ops, &cops);
|
||||
return efl_class_functions_set(klass, &ops, &cops, &ref_ops);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
@ -135,7 +159,7 @@ _class_initializer2(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _beef_get),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, NULL, &cops);
|
||||
return efl_class_functions_set(klass, NULL, &cops, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc2 = {
|
||||
|
@ -154,7 +178,7 @@ EFL_DEFINE_CLASS(simple2_class_get, &class_desc2, EO_CLASS, NULL)
|
|||
static Eina_Bool
|
||||
_class_initializer3(Efl_Class *klass)
|
||||
{
|
||||
return efl_class_functions_set(klass, NULL, NULL);
|
||||
return efl_class_functions_set(klass, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc3 = {
|
||||
|
@ -185,7 +209,7 @@ _searchable_class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_provider_find, _interface_get)
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc_searchable = {
|
||||
|
|
|
@ -32,7 +32,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_constructor, _singleton_efl_constructor),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -64,7 +64,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(domain_a_get, _a_get),
|
||||
EFL_OBJECT_OP_FUNC(domain_recursive, _recursive)
|
||||
);
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -472,7 +472,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_destructor, _man_des),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
EFL_START_TEST(eo_man_free)
|
||||
|
@ -1049,7 +1049,7 @@ _multi_class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(resolve_a_print, _a_print),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
EFL_START_TEST(efl_func_resolve)
|
||||
|
@ -1215,7 +1215,7 @@ _add_failures_class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(efl_finalize, _efl_add_failures_finalize),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
EFL_START_TEST(efl_add_failures)
|
||||
|
@ -1628,14 +1628,14 @@ static Eina_Bool
|
|||
_cast_inherit_class_initializer_1(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(inherit_value, _inherit_value_1), );
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cast_inherit_class_initializer_2(Efl_Class *klass)
|
||||
{
|
||||
EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(inherit_value, _inherit_value_2), );
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
EFL_START_TEST(efl_cast_test)
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <Eo.h>
|
||||
|
||||
#include "eo_suite.h"
|
||||
#include "eo_test_class_simple.h"
|
||||
|
||||
|
||||
EFL_START_TEST(eo_test_reflection_invalid)
|
||||
{
|
||||
Eina_Value numb_val = eina_value_int_init(1337);
|
||||
Eo *simple = efl_new(SIMPLE_CLASS);
|
||||
|
||||
simple_a_set(simple, 22);
|
||||
efl_property_reflection_set(simple, "simple_a_asdf", numb_val);
|
||||
fail_if(efl_property_reflection_get(simple, "simple_a_invalid").type != EINA_VALUE_EMPTY.type);
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
||||
EFL_START_TEST(eo_test_reflection_inherited)
|
||||
{
|
||||
const int numb = 42;
|
||||
int number_ref;
|
||||
Eina_Value numb_val = eina_value_int_init(numb);
|
||||
Eo *simple = efl_new(SIMPLE3_CLASS);
|
||||
|
||||
simple_a_set(simple, 22);
|
||||
efl_property_reflection_set(simple, "simple_a", numb_val);
|
||||
ck_assert_int_eq(simple_a_get(simple), numb);
|
||||
|
||||
simple_a_set(simple, 22);
|
||||
Eina_Value res = efl_property_reflection_get(simple, "simple_a");
|
||||
eina_value_int_convert(&res, &number_ref);
|
||||
ck_assert_int_eq(number_ref, 22);
|
||||
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
||||
EFL_START_TEST(eo_test_reflection_simple)
|
||||
{
|
||||
const int numb = 42;
|
||||
int number_ref;
|
||||
Eina_Value numb_val = eina_value_int_init(numb);
|
||||
Eo *simple = efl_new(SIMPLE_CLASS);
|
||||
|
||||
simple_a_set(simple, 22);
|
||||
efl_property_reflection_set(simple, "simple_a", numb_val);
|
||||
ck_assert_int_eq(simple_a_get(simple), numb);
|
||||
|
||||
simple_a_set(simple, 22);
|
||||
Eina_Value res = efl_property_reflection_get(simple, "simple_a");
|
||||
eina_value_int_convert(&res, &number_ref);
|
||||
ck_assert_int_eq(number_ref, 22);
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
||||
void eo_test_reflection(TCase *tc)
|
||||
{
|
||||
tcase_add_test(tc, eo_test_reflection_simple);
|
||||
tcase_add_test(tc, eo_test_reflection_inherited);
|
||||
tcase_add_test(tc, eo_test_reflection_invalid);
|
||||
}
|
|
@ -69,7 +69,7 @@ _class_initializer(Efl_Class *klass)
|
|||
EFL_OBJECT_OP_FUNC(thread_test_try_swap_stack, _try_swap_stack),
|
||||
);
|
||||
|
||||
return efl_class_functions_set(klass, &ops, NULL);
|
||||
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description class_desc = {
|
||||
|
|
|
@ -17,7 +17,8 @@ eo_suite_src = [
|
|||
'eo_test_event.c',
|
||||
'eo_test_threaded_calls.c',
|
||||
'eo_test_init.c',
|
||||
'eo_test_lifecycle.c'
|
||||
'eo_test_lifecycle.c',
|
||||
'eo_test_reflection.c'
|
||||
]
|
||||
|
||||
eo_suite = executable('eo_suite',
|
||||
|
|
|
@ -50,7 +50,7 @@ _class_simple_class_initializer(Efl_Class *klass)
|
|||
copsp = &cops;
|
||||
#endif
|
||||
|
||||
return efl_class_functions_set(klass, opsp, copsp);
|
||||
return efl_class_functions_set(klass, opsp, copsp, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description _class_simple_class_desc = {
|
||||
|
|
|
@ -33,7 +33,7 @@ _function_as_argument_class_initializer(Efl_Class *klass)
|
|||
copsp = &cops;
|
||||
#endif
|
||||
|
||||
return efl_class_functions_set(klass, opsp, copsp);
|
||||
return efl_class_functions_set(klass, opsp, copsp, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description _function_as_argument_class_desc = {
|
||||
|
|
|
@ -86,7 +86,7 @@ _override_class_initializer(Efl_Class *klass)
|
|||
copsp = &cops;
|
||||
#endif
|
||||
|
||||
return efl_class_functions_set(klass, opsp, copsp);
|
||||
return efl_class_functions_set(klass, opsp, copsp, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description _override_class_desc = {
|
||||
|
|
|
@ -61,7 +61,7 @@ _owning_class_initializer(Efl_Class *klass)
|
|||
copsp = &cops;
|
||||
#endif
|
||||
|
||||
return efl_class_functions_set(klass, opsp, copsp);
|
||||
return efl_class_functions_set(klass, opsp, copsp, NULL);
|
||||
}
|
||||
|
||||
static const Efl_Class_Description _owning_class_desc = {
|
||||
|
|
Loading…
Reference in New Issue