efl_model : rename all efl_model based classes.

Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.

| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |

I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.

Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.

Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.

Reviewers: cedric, felipealmeida, woohyun, Hermet

Reviewed By: cedric

Subscribers: lauromoura

Tags: #efl, #do_not_merge

Differential Revision: https://phab.enlightenment.org/D7533
devs/larrylira/treeview
SangHyeon Jade Lee 4 years ago
parent c713bb90d3
commit 5525c89a3d
  1. 36
      src/Makefile_Ecore.am
  2. 6
      src/Makefile_Efl.am
  3. 10
      src/Makefile_Eio.am
  4. 18
      src/Makefile_Elementary.am
  5. 8
      src/examples/elementary/efl_ui_list_view_example_1.c
  6. 2
      src/examples/elementary/efl_ui_list_view_example_2.c
  7. 6
      src/examples/elementary/efl_ui_list_view_example_3.c
  8. 8
      src/examples/elementary/filemvc.c
  9. 4
      src/examples/elementary/fileviewlist.c
  10. 2
      src/examples/elementary/layout_model_connect.c
  11. 16
      src/lib/ecore/Ecore_Eo.h
  12. 90
      src/lib/ecore/efl_boolean_model.c
  13. 4
      src/lib/ecore/efl_boolean_model.eo
  14. 64
      src/lib/ecore/efl_composite_model.c
  15. 2
      src/lib/ecore/efl_composite_model.eo
  16. 10
      src/lib/ecore/efl_composite_model_private.h
  17. 50
      src/lib/ecore/efl_container_model.c
  18. 4
      src/lib/ecore/efl_container_model.eo
  19. 38
      src/lib/ecore/efl_container_model_item.c
  20. 12
      src/lib/ecore/efl_container_model_item.eo
  21. 14
      src/lib/ecore/efl_container_model_private.h
  22. 34
      src/lib/ecore/efl_generic_model.c
  23. 2
      src/lib/ecore/efl_generic_model.eo
  24. 20
      src/lib/ecore/efl_loop_model.c
  25. 2
      src/lib/ecore/efl_loop_model.eo
  26. 64
      src/lib/ecore/efl_select_model.c
  27. 4
      src/lib/ecore/efl_select_model.eo
  28. 226
      src/lib/ecore/efl_view_model.c
  29. 22
      src/lib/ecore/efl_view_model.eo
  30. 36
      src/lib/ecore/meson.build
  31. 2
      src/lib/eio/Eio_Eo.h
  32. 212
      src/lib/eio/efl_io_model.c
  33. 6
      src/lib/eio/efl_io_model.eo
  34. 24
      src/lib/eio/efl_io_model_private.h
  35. 6
      src/lib/eio/meson.build
  36. 2
      src/lib/eldbus/eldbus_model.eo
  37. 56
      src/lib/elementary/efl_ui_average_model.c
  38. 8
      src/lib/elementary/efl_ui_average_model.eo
  39. 102
      src/lib/elementary/efl_ui_exact_model.c
  40. 4
      src/lib/elementary/efl_ui_exact_model.eo
  41. 38
      src/lib/elementary/efl_ui_homogeneous_model.c
  42. 4
      src/lib/elementary/efl_ui_homogeneous_model.eo
  43. 16
      src/lib/elementary/efl_ui_size_model.c
  44. 6
      src/lib/elementary/efl_ui_size_model.eo
  45. 2
      src/lib/elementary/efl_ui_state_model.eo
  46. 28
      src/lib/elementary/elc_fileselector.c
  47. 6
      src/lib/elementary/elc_fileselector_button.c
  48. 2
      src/lib/elementary/elm_interface_fileselector.eo
  49. 8
      src/lib/elementary/elm_priv.h
  50. 18
      src/lib/elementary/meson.build
  51. 6
      src/tests/efl/efl_suite.c
  52. 6
      src/tests/efl/efl_suite.h
  53. 30
      src/tests/efl/efl_test_composite_model.c
  54. 14
      src/tests/efl/efl_test_container_model.c
  55. 58
      src/tests/efl/efl_test_view_model.c
  56. 6
      src/tests/efl/meson.build
  57. 10
      src/tests/eio/efl_io_model_test_file.c
  58. 10
      src/tests/eio/efl_io_model_test_monitor_add.c
  59. 4
      src/tests/eio/eio_suite.c
  60. 4
      src/tests/eio/eio_suite.h
  61. 4
      src/tests/eio/meson.build
  62. 34
      src/tests/elementary/efl_ui_model.c
  63. 4
      src/tests/elementary/efl_ui_test_layout.c

@ -42,14 +42,14 @@ ecore_eolian_files_public = \
lib/ecore/efl_bounce_interpolator.eo \
lib/ecore/efl_spring_interpolator.eo \
lib/ecore/efl_cubic_bezier_interpolator.eo \
lib/ecore/efl_model_loop.eo \
lib/ecore/efl_model_item.eo \
lib/ecore/efl_model_container.eo \
lib/ecore/efl_model_container_item.eo \
lib/ecore/efl_model_composite_boolean.eo \
lib/ecore/efl_model_composite_selection.eo \
lib/ecore/efl_model_composite.eo \
lib/ecore/efl_model_view.eo
lib/ecore/efl_loop_model.eo \
lib/ecore/efl_generic_model.eo \
lib/ecore/efl_container_model.eo \
lib/ecore/efl_container_model_item.eo \
lib/ecore/efl_boolean_model.eo \
lib/ecore/efl_select_model.eo \
lib/ecore/efl_composite_model.eo \
lib/ecore/efl_view_model.eo
ecore_eolian_files = \
$(ecore_eolian_files_legacy) \
@ -118,18 +118,18 @@ lib/ecore/efl_io_stderr.c \
lib/ecore/efl_io_file.c \
lib/ecore/efl_io_copier.c \
lib/ecore/efl_io_buffered_stream.c \
lib/ecore/efl_model_loop.c \
lib/ecore/efl_model_item.c \
lib/ecore/efl_model_container.c \
lib/ecore/efl_model_container_item.c \
lib/ecore/efl_model_container_private.h \
lib/ecore/efl_model_composite.c \
lib/ecore/efl_model_composite_boolean.c \
lib/ecore/efl_model_composite_selection.c \
lib/ecore/efl_model_composite_private.h \
lib/ecore/efl_loop_model.c \
lib/ecore/efl_generic_model.c \
lib/ecore/efl_container_model.c \
lib/ecore/efl_container_model_item.c \
lib/ecore/efl_container_model_private.h \
lib/ecore/efl_composite_model.c \
lib/ecore/efl_boolean_model.c \
lib/ecore/efl_select_model.c \
lib/ecore/efl_composite_model_private.h \
lib/ecore/efl_model_accessor_view.c \
lib/ecore/efl_model_accessor_view_private.h \
lib/ecore/efl_model_view.c \
lib/ecore/efl_view_model.c \
lib/ecore/efl_linear_interpolator.c \
lib/ecore/efl_accelerate_interpolator.c \
lib/ecore/efl_decelerate_interpolator.c \

@ -203,9 +203,9 @@ TESTS += tests/efl/efl_suite
tests_efl_efl_suite_SOURCES = \
tests/efl/efl_suite.c \
tests/efl/efl_test_model_container.c \
tests/efl/efl_test_model_composite.c \
tests/efl/efl_test_model_view.c \
tests/efl/efl_test_container_model.c \
tests/efl/efl_test_composite_model.c \
tests/efl/efl_test_view_model.c \
tests/efl/efl_suite.h
tests_efl_efl_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \

@ -2,7 +2,7 @@
### Library
eio_eolian_files = \
lib/eio/eio_model.eo \
lib/eio/efl_io_model.eo \
lib/eio/efl_io_manager.eo \
lib/eio/eio_sentry.eo
@ -38,8 +38,8 @@ lib/eio/eio_monitor.c \
lib/eio/eio_monitor_poll.c \
lib/eio/eio_single.c \
lib/eio/eio_xattr.c \
lib/eio/eio_model.c \
lib/eio/eio_model_private.h \
lib/eio/efl_io_model.c \
lib/eio/efl_io_model_private.h \
lib/eio/eio_private.h \
lib/eio/eio_sentry_private.h
@ -74,8 +74,8 @@ TESTS += tests/eio/eio_suite
tests_eio_eio_suite_SOURCES = \
tests/eio/eio_suite.c \
tests/eio/eio_model_test_file.c \
tests/eio/eio_model_test_monitor_add.c \
tests/eio/efl_io_model_test_file.c \
tests/eio/efl_io_model_test_monitor_add.c \
tests/eio/eio_test_monitor.c \
tests/eio/eio_test_sentry.c \
tests/eio/eio_test_file.c \

@ -169,17 +169,17 @@ elm_private_eolian_files = \
lib/elementary/efl_ui_focus_parent_provider.eo \
lib/elementary/efl_ui_focus_parent_provider_standard.eo \
lib/elementary/efl_ui_focus_parent_provider_gen.eo \
lib/elementary/efl_ui_model_state.eo \
lib/elementary/efl_ui_state_model.eo \
tests/elementary/focus_test.eo \
tests/elementary/focus_test_sub_main.eo \
lib/elementary/efl_ui_selection_manager.eo \
lib/elementary/efl_datetime_manager.eo \
lib/elementary/efl_ui_list_view_relayout.eo \
lib/elementary/efl_ui_list_view_precise_layouter.eo \
lib/elementary/efl_ui_model_size.eo \
lib/elementary/efl_ui_model_homogeneous.eo \
lib/elementary/efl_ui_model_exact.eo \
lib/elementary/efl_ui_model_average.eo \
lib/elementary/efl_ui_size_model.eo \
lib/elementary/efl_ui_homogeneous_model.eo \
lib/elementary/efl_ui_exact_model.eo \
lib/elementary/efl_ui_average_model.eo \
$(NULL)
# Legacy classes - not part of public EO API
@ -890,10 +890,10 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/efl_ui_widget_focus_manager.c \
lib/elementary/efl_ui_caching_factory.c \
lib/elementary/efl_ui_widget_factory.c \
lib/elementary/efl_ui_model_size.c \
lib/elementary/efl_ui_model_homogeneous.c \
lib/elementary/efl_ui_model_exact.c \
lib/elementary/efl_ui_model_average.c \
lib/elementary/efl_ui_size_model.c \
lib/elementary/efl_ui_homogeneous_model.c \
lib/elementary/efl_ui_exact_model.c \
lib/elementary/efl_ui_average_model.c \
$(NULL)

@ -45,11 +45,11 @@ static Efl_Model*
_make_model(Evas_Object *win)
{
Eina_Value vtext;
Efl_Model_Item *model, *child;
Efl_Generic_Model *model, *child;
unsigned int i, s;
char buf[256];
model = efl_add(EFL_MODEL_ITEM_CLASS, win);
model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
for (i = 0; i < (NUM_ITEMS); i++)
@ -74,7 +74,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
Efl_Ui_Factory *factory;
Evas_Object *win, *li;
Eo *model;
Efl_Model_Composite_Selection *selmodel;
Efl_Select_Model *selmodel;
win = elm_win_util_standard_add("list_view", "List_View");
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
@ -82,7 +82,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
elm_win_autodel_set(win, EINA_TRUE);
model = _make_model(win);
selmodel = efl_add(EFL_MODEL_COMPOSITE_SELECTION_CLASS, efl_main_loop_get()
selmodel = efl_add(EFL_SELECT_MODEL_CLASS, efl_main_loop_get()
, efl_ui_view_model_set(efl_added, model)
);

@ -31,7 +31,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
if (argv[1] != NULL) dirname = argv[1];
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
model = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname));
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
efl_ui_model_connect(factory, "efl.text", "filename");
efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");

@ -70,7 +70,7 @@ _bt_add_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
{
Priv_Data *priv = (Priv_Data*)data;
Eina_Value vtext, value;
Efl_Model_Item *child;
Efl_Generic_Model *child;
eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR);
@ -170,10 +170,10 @@ static Efl_Model*
_make_model()
{
Eina_Value vtext, value;
Efl_Model_Item *model, *child;
Efl_Generic_Model *model, *child;
unsigned int i, len;
model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
model = efl_add(EFL_GENERIC_MODEL_CLASS, efl_main_loop_get());
eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR);

@ -10,7 +10,7 @@
#include <Elementary.h>
#include <Efl.h>
#include <Eio.h>
#include <eio_model.eo.h>
#include <efl_io_model.eo.h>
#include <stdio.h>
#include <Eio.h>
#include <elm_view_form.h>
@ -38,7 +38,7 @@ _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
}
static int
_filter_cb(void *data EINA_UNUSED, Eio_Model *model, Eina_File_Direct_Info *info)
_filter_cb(void *data EINA_UNUSED, Efl_Io_Model *model, Eina_File_Direct_Info *info)
{
if (info->type == EINA_FILE_DIR && info->path[info->name_start] != '.') return 1;
@ -124,8 +124,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
//treemodel
priv.treemodel = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
eio_model_children_filter_set(priv.treemodel, NULL, _filter_cb, NULL);
priv.treemodel = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname));
efl_io_model_children_filter_set(priv.treemodel, NULL, _filter_cb, NULL);
//treeview
genlist = elm_genlist_add(win);

@ -11,7 +11,7 @@
#include <Elementary.h>
#include <Efl.h>
#include <Eio.h>
#include <eio_model.eo.h>
#include <efl_io_model.eo.h>
#include <stdio.h>
#define EFL_MODEL_TEST_FILENAME_PATH "/tmp"
@ -54,7 +54,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(genlist);
priv.filemodel = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
priv.filemodel = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname));
priv.fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, "double_label"));
elm_view_list_model_set(priv.fileview, priv.filemodel);
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, &priv);

@ -111,7 +111,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
if (argv[1] != NULL) dirname = argv[1];
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
priv->model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
priv->model = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname));
genlist = elm_genlist_add(win);
priv->fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL));

@ -109,14 +109,14 @@ EAPI Eo *efl_main_loop_get(void);
* @{
*/
#include "efl_model_loop.eo.h"
#include "efl_model_item.eo.h"
#include "efl_model_container.eo.h"
#include "efl_model_container_item.eo.h"
#include "efl_model_composite.eo.h"
#include "efl_model_composite_boolean.eo.h"
#include "efl_model_composite_selection.eo.h"
#include "efl_model_view.eo.h"
#include "efl_loop_model.eo.h"
#include "efl_generic_model.eo.h"
#include "efl_container_model.eo.h"
#include "efl_container_model_item.eo.h"
#include "efl_composite_model.eo.h"
#include "efl_boolean_model.eo.h"
#include "efl_select_model.eo.h"
#include "efl_view_model.eo.h"
/**
* @}

@ -4,18 +4,18 @@
#include <Efl_Core.h>
#include "efl_model_composite_private.h"
#include "efl_composite_model_private.h"
typedef struct _Efl_Model_Composite_Boolean_Data Efl_Model_Composite_Boolean_Data;
typedef struct _Efl_Model_Composite_Boolean_Value Efl_Model_Composite_Boolean_Value;
typedef struct _Efl_Boolean_Model_Data Efl_Boolean_Model_Data;
typedef struct _Efl_Boolean_Model_Value Efl_Boolean_Model_Value;
struct _Efl_Model_Composite_Boolean_Data
struct _Efl_Boolean_Model_Data
{
Efl_Model_Composite_Boolean_Data *parent;
Efl_Boolean_Model_Data *parent;
Eina_Hash *values;
};
struct _Efl_Model_Composite_Boolean_Value
struct _Efl_Boolean_Model_Value
{
Eina_Stringshare *property;
@ -29,41 +29,41 @@ struct _Efl_Model_Composite_Boolean_Value
};
static Eina_Iterator *
_efl_model_composite_boolean_efl_model_properties_get(const Eo *obj,
Efl_Model_Composite_Boolean_Data *pd)
_efl_boolean_model_efl_model_properties_get(const Eo *obj,
Efl_Boolean_Model_Data *pd)
{
EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(props,
obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS,
EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props,
obj, EFL_BOOLEAN_MODEL_CLASS,
eina_hash_iterator_key_new(pd->parent->values));
return props;
}
static Eina_Value *
_efl_model_composite_boolean_efl_model_property_get(const Eo *obj,
Efl_Model_Composite_Boolean_Data *pd,
const char *property)
_efl_boolean_model_efl_model_property_get(const Eo *obj,
Efl_Boolean_Model_Data *pd,
const char *property)
{
Efl_Model_Composite_Boolean_Value *v;
Efl_Boolean_Model_Value *v;
Eina_Stringshare *s;
Eina_Bool flag;
unsigned int index;
if (property == NULL) return NULL;
// If we do not have a parent set that his a COMPOSITE_BOOLEAN, then we should just forward up the call
// If we do not have a parent set that his a BOOLEAN, then we should just forward up the call
if (!pd->parent)
return efl_model_property_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS), property);
return efl_model_property_get(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS), property);
// Check if this is requesting a defined boolean property
// Property are defined and their value are stored on the parent COMPOSITE_BOOLEAN
// Property are defined and their value are stored on the parent BOOLEAN
s = eina_stringshare_add(property);
v = eina_hash_find(pd->parent->values, s);
eina_stringshare_del(s);
if (!v) // Not a property handle by this object, forward
return efl_model_property_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS), property);
return efl_model_property_get(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS), property);
index = efl_model_composite_index_get(obj);
index = efl_composite_model_index_get(obj);
// As an optimization we do optimistically allocate the boolean array
// Better would be to have a sparse boolean array
@ -76,11 +76,11 @@ _efl_model_composite_boolean_efl_model_property_get(const Eo *obj,
}
static Eina_Future *
_efl_model_composite_boolean_efl_model_property_set(Eo *obj,
Efl_Model_Composite_Boolean_Data *pd,
const char *property, Eina_Value *value)
_efl_boolean_model_efl_model_property_set(Eo *obj,
Efl_Boolean_Model_Data *pd,
const char *property, Eina_Value *value)
{
Efl_Model_Composite_Boolean_Value *v;
Efl_Boolean_Model_Value *v;
Eina_Stringshare *s;
Eina_Bool flag;
unsigned int index;
@ -89,25 +89,25 @@ _efl_model_composite_boolean_efl_model_property_set(Eo *obj,
return efl_loop_future_rejected(obj,
EFL_MODEL_ERROR_UNKNOWN);
// If we do not have a parent set that his a COMPOSITE_BOOLEAN, then we should just forward up the call
// If we do not have a parent set that his a BOOLEAN, then we should just forward up the call
if (!pd->parent)
return efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS),
return efl_model_property_set(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS),
property, value);
// Check if this is requesting a defined boolean property
// Property are defined and their value are stored on the parent COMPOSITE_BOOLEAN
// Property are defined and their value are stored on the parent BOOLEAN
s = eina_stringshare_add(property);
v = eina_hash_find(pd->parent->values, s);
eina_stringshare_del(s);
if (!v)
return efl_model_property_set(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS),
return efl_model_property_set(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS),
property, value);
if (!eina_value_bool_convert(value, &flag))
return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_UNKNOWN);
index = efl_model_composite_index_get(obj);
index = efl_composite_model_index_get(obj);
// We are optimistically allocating the boolean buffer now.
// Aligning it on 64bits
@ -139,7 +139,7 @@ _efl_model_composite_boolean_efl_model_property_set(Eo *obj,
static void
_boolean_value_free(void *data)
{
Efl_Model_Composite_Boolean_Value *value = data;
Efl_Boolean_Model_Value *value = data;
eina_stringshare_del(value->property);
value->property = NULL;
@ -152,41 +152,41 @@ _boolean_value_free(void *data)
}
static Eo *
_efl_model_composite_boolean_efl_object_constructor(Eo *obj, Efl_Model_Composite_Boolean_Data *pd)
_efl_boolean_model_efl_object_constructor(Eo *obj, Efl_Boolean_Model_Data *pd)
{
Eo *parent;
obj = efl_constructor(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS));
obj = efl_constructor(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS));
if (!obj) return NULL;
pd->values = eina_hash_stringshared_new(_boolean_value_free);
// Only add a reference to the parent if it is actually a COMPOSITE_BOOLEAN_CLASS
// Only add a reference to the parent if it is actually a BOOLEAN_MODEL_CLASS
// The root typically doesn't have any boolean property, only its child do
parent = efl_parent_get(obj);
if (efl_isa(parent, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS))
pd->parent = efl_data_scope_get(parent, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS);
if (efl_isa(parent, EFL_BOOLEAN_MODEL_CLASS))
pd->parent = efl_data_scope_get(parent, EFL_BOOLEAN_MODEL_CLASS);
return obj;
}
static void
_efl_model_composite_boolean_efl_object_destructor(Eo *obj, Efl_Model_Composite_Boolean_Data *pd)
_efl_boolean_model_efl_object_destructor(Eo *obj, Efl_Boolean_Model_Data *pd)
{
eina_hash_free(pd->values);
efl_destructor(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CLASS));
efl_destructor(efl_super(obj, EFL_BOOLEAN_MODEL_CLASS));
}
static void
_efl_model_composite_boolean_boolean_add(Eo *obj EINA_UNUSED,
Efl_Model_Composite_Boolean_Data *pd,
const char *name, Eina_Bool default_value)
_efl_boolean_model_boolean_add(Eo *obj EINA_UNUSED,
Efl_Boolean_Model_Data *pd,
const char *name, Eina_Bool default_value)
{
Efl_Model_Composite_Boolean_Value *value;
Efl_Boolean_Model_Value *value;
if (!name) return ;
value = calloc(1, sizeof (Efl_Model_Composite_Boolean_Value));
value = calloc(1, sizeof (Efl_Boolean_Model_Value));
if (!value) return ;
value->property = eina_stringshare_add(name);
@ -196,9 +196,9 @@ _efl_model_composite_boolean_boolean_add(Eo *obj EINA_UNUSED,
}
static void
_efl_model_composite_boolean_boolean_del(Eo *obj EINA_UNUSED,
Efl_Model_Composite_Boolean_Data *pd,
const char *name)
_efl_boolean_model_boolean_del(Eo *obj EINA_UNUSED,
Efl_Boolean_Model_Data *pd,
const char *name)
{
Eina_Stringshare *s;
@ -207,4 +207,4 @@ _efl_model_composite_boolean_boolean_del(Eo *obj EINA_UNUSED,
eina_stringshare_del(s);
}
#include "efl_model_composite_boolean.eo.c"
#include "efl_boolean_model.eo.c"

@ -1,6 +1,6 @@
class Efl.Model_Composite_Boolean extends Efl.Model_Composite
class Efl.Boolean_Model extends Efl.Composite_Model
{
[[Efl model composite boolean class]]
[[Efl boolean model class]]
methods {
boolean_add {
[[Add a new named boolean property with a defined default value.]]

@ -8,13 +8,13 @@
#include "ecore_private.h"
#include "efl_model_composite.eo.h"
#include "efl_composite_model.eo.h"
#define _CHILD_INDEX "child.index"
typedef struct _Efl_Model_Composite_Data Efl_Model_Composite_Data;
typedef struct _Efl_Composite_Model_Data Efl_Composite_Model_Data;
struct _Efl_Model_Composite_Data
struct _Efl_Composite_Model_Data
{
Efl_Model *source;
@ -25,7 +25,7 @@ struct _Efl_Model_Composite_Data
};
static void
_efl_model_composite_efl_object_destructor(Eo *obj, Efl_Model_Composite_Data *pd)
_efl_composite_model_efl_object_destructor(Eo *obj, Efl_Composite_Model_Data *pd)
{
if (pd->source)
{
@ -38,11 +38,11 @@ _efl_model_composite_efl_object_destructor(Eo *obj, Efl_Model_Composite_Data *pd
pd->source = NULL;
}
efl_destructor(efl_super(obj, EFL_MODEL_COMPOSITE_CLASS));
efl_destructor(efl_super(obj, EFL_COMPOSITE_MODEL_CLASS));
}
static Efl_Object *
_efl_model_composite_efl_object_finalize(Eo *obj, Efl_Model_Composite_Data *pd)
_efl_composite_model_efl_object_finalize(Eo *obj, Efl_Composite_Model_Data *pd)
{
if (pd->source == NULL)
{
@ -54,7 +54,7 @@ _efl_model_composite_efl_object_finalize(Eo *obj, Efl_Model_Composite_Data *pd)
}
static void
_efl_model_composite_index_set(Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd, unsigned int index)
_efl_composite_model_index_set(Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd, unsigned int index)
{
if (pd->set_index || !pd->source)
return ;
@ -63,7 +63,7 @@ _efl_model_composite_index_set(Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd
}
static unsigned int
_efl_model_composite_index_get(const Eo *obj, Efl_Model_Composite_Data *pd)
_efl_composite_model_index_get(const Eo *obj, Efl_Composite_Model_Data *pd)
{
Eina_Value *fetch = NULL;
unsigned int r = 0xFFFFFFFF;
@ -82,7 +82,7 @@ _efl_model_composite_index_get(const Eo *obj, Efl_Model_Composite_Data *pd)
}
static void
_efl_model_composite_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd, Efl_Model *model)
_efl_composite_model_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd, Efl_Model *model)
{
Eina_Iterator *properties;
const char *property;
@ -114,13 +114,13 @@ _efl_model_composite_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Model_Compos
}
static Efl_Model *
_efl_model_composite_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd)
_efl_composite_model_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd)
{
return pd->source;
}
static Eina_Future *
_efl_model_composite_efl_model_property_set(Eo *obj, Efl_Model_Composite_Data *pd,
_efl_composite_model_efl_model_property_set(Eo *obj, Efl_Composite_Model_Data *pd,
const char *property, Eina_Value *value)
{
if (pd->need_index && !strcmp(property, _CHILD_INDEX))
@ -136,7 +136,7 @@ _efl_model_composite_efl_model_property_set(Eo *obj, Efl_Model_Composite_Data *p
}
static Eina_Value *
_efl_model_composite_efl_model_property_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd,
_efl_composite_model_efl_model_property_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd,
const char *property)
{
if (pd->need_index && !strcmp(property, _CHILD_INDEX))
@ -149,7 +149,7 @@ _efl_model_composite_efl_model_property_get(const Eo *obj EINA_UNUSED, Efl_Model
}
static Eina_Iterator *
_efl_model_composite_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd)
_efl_composite_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd)
{
if (pd->need_index)
{
@ -164,13 +164,13 @@ _efl_model_composite_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Mod
}
static unsigned int
_efl_model_composite_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd)
_efl_composite_model_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd)
{
return efl_model_children_count_get(pd->source);
}
typedef struct _Efl_Model_Composite_Slice_Request Efl_Model_Composite_Slice_Request;
struct _Efl_Model_Composite_Slice_Request
typedef struct _Efl_Composite_Model_Slice_Request Efl_Composite_Model_Slice_Request;
struct _Efl_Composite_Model_Slice_Request
{
const Efl_Class *self;
Eo *parent;
@ -178,9 +178,9 @@ struct _Efl_Model_Composite_Slice_Request
};
static Eina_Value
_efl_model_composite_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
_efl_composite_model_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
{
Efl_Model_Composite_Slice_Request *req = data;
Efl_Composite_Model_Slice_Request *req = data;
unsigned int i, len;
Eina_Value r = EINA_VALUE_EMPTY;
Eo *target = NULL;
@ -195,7 +195,7 @@ _efl_model_composite_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
// can know if it needs to retain the information regarding its index.
composite = efl_add(req->self, req->parent,
efl_ui_view_model_set(efl_added, target),
efl_model_composite_index_set(efl_added, req->start + i));
efl_composite_model_index_set(efl_added, req->start + i));
eina_value_array_append(&r, composite);
}
@ -204,27 +204,27 @@ _efl_model_composite_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
}
static void
_efl_model_composite_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
_efl_composite_model_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
{
Efl_Model_Composite_Slice_Request *req = data;
Efl_Composite_Model_Slice_Request *req = data;
efl_unref(req->parent);
free(data);
}
static Eina_Future *
_efl_model_composite_efl_model_children_slice_get(Eo *obj,
Efl_Model_Composite_Data *pd,
_efl_composite_model_efl_model_children_slice_get(Eo *obj,
Efl_Composite_Model_Data *pd,
unsigned int start,
unsigned int count)
{
Efl_Model_Composite_Slice_Request *req;
Efl_Composite_Model_Slice_Request *req;
Eina_Future *f;
f = efl_model_children_slice_get(pd->source, start, count);
if (!f) return NULL;
req = malloc(sizeof (Efl_Model_Composite_Slice_Request));
req = malloc(sizeof (Efl_Composite_Model_Slice_Request));
if (!req) return efl_loop_future_rejected(obj, ENOMEM);
req->self = efl_class_get(obj);
@ -232,24 +232,24 @@ _efl_model_composite_efl_model_children_slice_get(Eo *obj,
req->start = start;
return efl_future_then(obj, f, .success_type = EINA_VALUE_TYPE_ARRAY,
.success = _efl_model_composite_then,
.free = _efl_model_composite_clean,
.success = _efl_composite_model_then,
.free = _efl_composite_model_clean,
.data = req);
}
static Efl_Object *
_efl_model_composite_efl_model_child_add(Eo *obj EINA_UNUSED,
Efl_Model_Composite_Data *pd)
_efl_composite_model_efl_model_child_add(Eo *obj EINA_UNUSED,
Efl_Composite_Model_Data *pd)
{
return efl_model_child_add(pd->source);
}
static void
_efl_model_composite_efl_model_child_del(Eo *obj EINA_UNUSED,
Efl_Model_Composite_Data *pd,
_efl_composite_model_efl_model_child_del(Eo *obj EINA_UNUSED,
Efl_Composite_Model_Data *pd,
Efl_Object *child)
{
efl_model_child_del(pd->source, child);
}
#include "efl_model_composite.eo.c"
#include "efl_composite_model.eo.c"

@ -1,4 +1,4 @@
class Efl.Model_Composite extends Efl.Model_Loop implements Efl.Ui.View
class Efl.Composite_Model extends Efl.Loop_Model implements Efl.Ui.View
{
[[Efl model for all composite class which provide a unified API to set source of data.

@ -1,15 +1,15 @@
#define EFL_MODEL_COMPOSITE_PROPERTIES(name, dyn, sta, ...) \
EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(name, NULL, NULL, (dyn), sta, ##__VA_ARGS__)
#define EFL_COMPOSITE_MODEL_PROPERTIES(name, dyn, sta, ...) \
EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, NULL, NULL, (dyn), sta, ##__VA_ARGS__)
#define EFL_MODEL_COMPOSITE_PROPERTIES_SUPER(name, obj, klass, dyn, ...) \
#define EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, obj, klass, dyn, ...) \
Eina_Iterator *name; \
do \
{ \
static const char *static_props__[] = { \
__VA_ARGS__ \
}; \
name = _efl_model_composite_properties_mix( \
name = _efl_composite_model_properties_mix( \
((obj) ? efl_model_properties_get(efl_super((obj), (klass))) : NULL), \
(dyn), \
EINA_C_ARRAY_ITERATOR_NEW(static_props__)); \
@ -18,7 +18,7 @@
static inline Eina_Iterator *
_efl_model_composite_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Eina_Iterator *sta)
_efl_composite_model_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Eina_Iterator *sta)
{
Eina_Iterator *its[3];
int i = 0;

@ -9,9 +9,9 @@
#include "ecore_internal.h"
#include "efl_model_container_private.h"
#include "efl_container_model_private.h"
#define MY_CLASS EFL_MODEL_CONTAINER_CLASS
#define MY_CLASS EFL_CONTAINER_MODEL_CLASS
void *
_value_copy_alloc(void *v, const Eina_Value_Type *type)
@ -65,8 +65,8 @@ _property_data_free_cb(void *data)
}
static Efl_Object *
_efl_model_container_efl_object_constructor(Eo *obj,
Efl_Model_Container_Data *sd)
_efl_container_model_efl_object_constructor(Eo *obj,
Efl_Container_Model_Data *sd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
if (!obj)
@ -79,8 +79,8 @@ _efl_model_container_efl_object_constructor(Eo *obj,
}
static void
_efl_model_container_efl_object_destructor(Eo *obj,
Efl_Model_Container_Data *sd)
_efl_container_model_efl_object_destructor(Eo *obj,
Efl_Container_Model_Data *sd)
{
Eina_Stringshare *key;
Eina_Iterator *it;
@ -98,8 +98,8 @@ _efl_model_container_efl_object_destructor(Eo *obj,
}
static const Eina_Value_Type *
_efl_model_container_child_property_value_type_get(Eo *obj EINA_UNUSED,
Efl_Model_Container_Data *sd,
_efl_container_model_child_property_value_type_get(Eo *obj EINA_UNUSED,
Efl_Container_Model_Data *sd,
const char *property)
{
Child_Property_Data *cpd;
@ -114,8 +114,8 @@ _efl_model_container_child_property_value_type_get(Eo *obj EINA_UNUSED,
}
static Eina_Iterator *
_efl_model_container_child_property_values_get(Eo *obj EINA_UNUSED,
Efl_Model_Container_Data *sd,
_efl_container_model_child_property_values_get(Eo *obj EINA_UNUSED,
Efl_Container_Model_Data *sd,
const char *property)
{
Child_Property_Data *cpd;
@ -130,8 +130,8 @@ _efl_model_container_child_property_values_get(Eo *obj EINA_UNUSED,
}
static Eina_Bool
_efl_model_container_child_property_add(Eo *obj,
Efl_Model_Container_Data *sd,
_efl_container_model_child_property_add(Eo *obj,
Efl_Container_Model_Data *sd,
const char *name,
const Eina_Value_Type *type,
Eina_Iterator *values)
@ -198,8 +198,8 @@ _efl_model_container_child_property_add(Eo *obj,
Efl_Model_Children_Event cevt = { 0 };
Efl_Model *child;
child = efl_add(EFL_MODEL_CONTAINER_ITEM_CLASS, obj,
efl_model_container_item_define(efl_added, sd, i));
child = efl_add(EFL_CONTAINER_MODEL_ITEM_CLASS, obj,
efl_container_model_item_define(efl_added, sd, i));
sd->childrens = eina_list_append(sd->childrens, child);
cevt.index = i;
@ -222,14 +222,14 @@ _efl_model_container_child_property_add(Eo *obj,
}
static Eina_Iterator *
_efl_model_container_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd)
_efl_container_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Container_Model_Data *sd)
{
return eina_hash_iterator_key_new(sd->properties);
}
static Eina_Future *
_efl_model_container_efl_model_property_set(Eo *obj,
Efl_Model_Container_Data *pd EINA_UNUSED,
_efl_container_model_efl_model_property_set(Eo *obj,
Efl_Container_Model_Data *pd EINA_UNUSED,
const char *property EINA_UNUSED,
Eina_Value *value EINA_UNUSED)
{
@ -238,16 +238,16 @@ _efl_model_container_efl_model_property_set(Eo *obj,
}
static Eina_Value *
_efl_model_container_efl_model_property_get(const Eo *obj EINA_UNUSED,
Efl_Model_Container_Data *pd EINA_UNUSED,
_efl_container_model_efl_model_property_get(const Eo *obj EINA_UNUSED,
Efl_Container_Model_Data *pd EINA_UNUSED,
const char *property EINA_UNUSED)
{
return eina_value_error_new(EFL_MODEL_ERROR_NOT_FOUND);
}
static Eina_Future *
_efl_model_container_efl_model_children_slice_get(Eo *obj,
Efl_Model_Container_Data *sd,
_efl_container_model_efl_model_children_slice_get(Eo *obj,
Efl_Container_Model_Data *sd,
unsigned int start,
unsigned int count)
{
@ -258,13 +258,13 @@ _efl_model_container_efl_model_children_slice_get(Eo *obj,
}
static unsigned int
_efl_model_container_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd)
_efl_container_model_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Container_Model_Data *sd)
{
return eina_list_count(sd->childrens);
}
static Eo *
_efl_model_container_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd EINA_UNUSED)
_efl_container_model_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Container_Model_Data *sd EINA_UNUSED)
{
EINA_LOG_WARN("child_add not supported by Efl.Model.Container");
eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED);
@ -273,10 +273,10 @@ _efl_model_container_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Model_Containe
}
static void
_efl_model_container_efl_model_child_del(Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd EINA_UNUSED, Eo *child EINA_UNUSED)
_efl_container_model_efl_model_child_del(Eo *obj EINA_UNUSED, Efl_Container_Model_Data *sd EINA_UNUSED, Eo *child EINA_UNUSED)
{
EINA_LOG_WARN("child_del not supported by Efl.Model.Container");
eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED);
}
#include "efl_model_container.eo.c"
#include "efl_container_model.eo.c"

@ -1,12 +1,12 @@
import eina_types;
class Efl.Model_Container extends Efl.Model_Loop
class Efl.Container_Model extends Efl.Loop_Model
{
[[
Class used to create data models from Eina containers.
Each container supplied represents a series of property values, each item
being the property value for a child object (@Efl.Model_Container_Item).
being the property value for a child object (@Efl.Container_Model_Item).
The data in the given containers are copied and stored internally.

@ -5,19 +5,19 @@
#include <Efl.h>
#include <Ecore.h>
#include "efl_model_container_private.h"
#include "efl_container_model_private.h"
#define MY_CLASS EFL_MODEL_CONTAINER_ITEM_CLASS
#define MY_CLASS EFL_CONTAINER_MODEL_ITEM_CLASS
static void
_efl_model_container_item_define(Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd, void *parent_data, unsigned int index)
_efl_container_model_item_define(Eo *obj EINA_UNUSED, Efl_Container_Model_Item_Data *sd, void *parent_data, unsigned int index)
{
sd->parent_data = parent_data;
sd->index = index;
}
EOLIAN static void
_efl_model_container_item_efl_object_invalidate(Eo *obj, Efl_Model_Container_Item_Data *sd)
_efl_container_model_item_efl_object_invalidate(Eo *obj, Efl_Container_Model_Item_Data *sd)
{
efl_invalidate(efl_super(obj, MY_CLASS));
@ -26,14 +26,14 @@ _efl_model_container_item_efl_object_invalidate(Eo *obj, Efl_Model_Container_Ite
}
static Eina_Iterator *
_efl_model_container_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd)
_efl_container_model_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Container_Model_Item_Data *sd)
{
// FIXME: Not to sure here, shouldn't we extend a child of the parent actually ?
return efl_model_properties_get(sd->parent_data->obj);
}
static Efl_Object *
_efl_model_container_item_efl_object_finalize(Eo *obj, Efl_Model_Container_Item_Data *pd)
_efl_container_model_item_efl_object_finalize(Eo *obj, Efl_Container_Model_Item_Data *pd)
{
if (!pd->parent_data)
return NULL;
@ -42,8 +42,8 @@ _efl_model_container_item_efl_object_finalize(Eo *obj, Efl_Model_Container_Item_
}
static Eina_Future *
_efl_model_container_item_efl_model_property_set(Eo *obj,
Efl_Model_Container_Item_Data *sd,
_efl_container_model_item_efl_model_property_set(Eo *obj,
Efl_Container_Model_Item_Data *sd,
const char *property, Eina_Value *value)
{
Eina_Stringshare *name;
@ -91,8 +91,8 @@ _efl_model_container_item_efl_model_property_set(Eo *obj,
}
static Eina_Value *
_efl_model_container_item_efl_model_property_get(const Eo *obj EINA_UNUSED,
Efl_Model_Container_Item_Data *sd,
_efl_container_model_item_efl_model_property_get(const Eo *obj EINA_UNUSED,
Efl_Container_Model_Item_Data *sd,
const char *property)
{
Eina_Stringshare *name;
@ -127,8 +127,8 @@ _efl_model_container_item_efl_model_property_get(const Eo *obj EINA_UNUSED,
}
EOLIAN static Eina_Future *
_efl_model_container_item_efl_model_children_slice_get(Eo *obj,
Efl_Model_Container_Item_Data *sd EINA_UNUSED,
_efl_container_model_item_efl_model_children_slice_get(Eo *obj,
Efl_Container_Model_Item_Data *sd EINA_UNUSED,
unsigned int start EINA_UNUSED,
unsigned int count EINA_UNUSED)
{
@ -136,15 +136,15 @@ _efl_model_container_item_efl_model_children_slice_get(Eo *obj,
}
EOLIAN static unsigned int
_efl_model_container_item_efl_model_children_count_get(const Eo *obj EINA_UNUSED,
Efl_Model_Container_Item_Data *sd EINA_UNUSED)
_efl_container_model_item_efl_model_children_count_get(const Eo *obj EINA_UNUSED,
Efl_Container_Model_Item_Data *sd EINA_UNUSED)
{
return 0;
}
EOLIAN static Eo *
_efl_model_container_item_efl_model_child_add(Eo *obj EINA_UNUSED,
Efl_Model_Container_Item_Data *sd EINA_UNUSED)
_efl_container_model_item_efl_model_child_add(Eo *obj EINA_UNUSED,
Efl_Container_Model_Item_Data *sd EINA_UNUSED)
{
EINA_LOG_WARN("child_add not supported by Efl.Model.Container.Item");
eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED);
@ -153,12 +153,12 @@ _efl_model_container_item_efl_model_child_add(Eo *obj EINA_UNUSED,
}
EOLIAN static void
_efl_model_container_item_efl_model_child_del(Eo *obj EINA_UNUSED,
Efl_Model_Container_Item_Data *sd EINA_UNUSED,
_efl_container_model_item_efl_model_child_del(Eo *obj EINA_UNUSED,
Efl_Container_Model_Item_Data *sd EINA_UNUSED,
Eo *child EINA_UNUSED)
{
EINA_LOG_WARN("child_del not supported by Efl.Model.Container.Item");
eina_error_set(EFL_MODEL_ERROR_NOT_SUPPORTED);
}
#include "efl_model_container_item.eo.c"
#include "efl_container_model_item.eo.c"

@ -1,19 +1,19 @@
class Efl.Model_Container_Item extends Efl.Object implements Efl.Model
class Efl.Container_Model_Item extends Efl.Object implements Efl.Model
{
[[
Used as a child of @Efl.Model_Container.
Used as a child of @Efl.Container_Model.
Provides the @Efl.Model API for elements of @Efl.Model_Container.
Provides the @Efl.Model API for elements of @Efl.Container_Model.
Should not be used in another context, so do not manually create objects
of this class.
]]
methods {
define {
[[Defines @Efl.Model_Container_Item internal data.]]
[[Defines @Efl.Container_Model_Item internal data.]]
params {
parent_data: void_ptr; [[Pointer to the private data of the
@Efl.Model_Container parent object.]]
index: uint; [[Index of this item within the @Efl.Model_Container
@Efl.Container_Model parent object.]]
index: uint; [[Index of this item within the @Efl.Container_Model
children.]]
}
}

@ -1,5 +1,5 @@
#ifndef EFL_MODEL_CONTAINER_PRIVATE_H__
#define EFL_MODEL_CONTAINER_PRIVATE_H__
#ifndef EFL_CONTAINER_MODEL_PRIVATE_H__
#define EFL_CONTAINER_MODEL_PRIVATE_H__
typedef struct _Child_Property_Data Child_Property_Data;
struct _Child_Property_Data
@ -8,8 +8,8 @@ struct _Child_Property_Data
Eina_Array *values;
};
typedef struct _Efl_Model_Container_Data Efl_Model_Container_Data;
struct _Efl_Model_Container_Data
typedef struct _Efl_Container_Model_Data Efl_Container_Model_Data;
struct _Efl_Container_Model_Data
{
Eo *obj;
@ -19,10 +19,10 @@ struct _Efl_Model_Container_Data
};
typedef struct _Efl_Model_Container_Item_Data Efl_Model_Container_Item_Data;
struct _Efl_Model_Container_Item_Data
typedef struct _Efl_Container_Model_Item_Data Efl_Container_Model_Item_Data;
struct _Efl_Container_Model_Item_Data
{
Efl_Model_Container_Data *parent_data;
Efl_Container_Model_Data *parent_data;
unsigned int index;
};

@ -7,10 +7,10 @@
#include "ecore_internal.h"
#define MY_CLASS EFL_MODEL_ITEM_CLASS
#define MY_CLASS EFL_GENERIC_MODEL_CLASS
typedef struct _Efl_Model_Item_Data Efl_Model_Item_Data;
struct _Efl_Model_Item_Data
typedef struct _Efl_Generic_Model_Data Efl_Generic_Model_Data;
struct _Efl_Generic_Model_Data
{
Eina_Hash *properties;
Eina_List *childrens;
@ -30,7 +30,7 @@ _stringshared_keys_free(const Eina_Hash *hash EINA_UNUSED, const void *key, void
}
static Efl_Object *
_efl_model_item_efl_object_constructor(Eo *obj, Efl_Model_Item_Data *sd)
_efl_generic_model_efl_object_constructor(Eo *obj, Efl_Generic_Model_Data *sd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
if (!obj)
@ -42,7 +42,7 @@ _efl_model_item_efl_object_constructor(Eo *obj, Efl_Model_Item_Data *sd)
}
static void
_efl_model_item_efl_object_destructor(Eo *obj, Efl_Model_Item_Data *sd)
_efl_generic_model_efl_object_destructor(Eo *obj, Efl_Generic_Model_Data *sd)
{
eina_list_free(sd->childrens);
eina_hash_foreach(sd->properties, _stringshared_keys_free, NULL);
@ -52,13 +52,13 @@ _efl_model_item_efl_object_destructor(Eo *obj, Efl_Model_Item_Data *sd)
}
static Eina_Iterator *
_efl_model_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Item_Data *pd)
_efl_generic_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Generic_Model_Data *pd)
{
return eina_hash_iterator_key_new(pd->properties);
}
static Eina_Future *
_efl_model_item_efl_model_property_set(Eo *obj, Efl_Model_Item_Data *pd, const char *property, Eina_Value *value)
_efl_generic_model_efl_model_property_set(Eo *obj, Efl_Generic_Model_Data *pd, const char *property, Eina_Value *value)
{
Eina_Stringshare *prop;
Eina_Value *exist;
@ -110,9 +110,9 @@ _efl_model_item_efl_model_property_set(Eo *obj, Efl_Model_Item_Data *pd, const c
}
static Eina_Value *
_efl_model_item_efl_model_property_get(const Eo *obj EINA_UNUSED,
Efl_Model_Item_Data *pd,
const char *property)
_efl_generic_model_efl_model_property_get(const Eo *obj EINA_UNUSED,
Efl_Generic_Model_Data *pd,
const char *property)
{
Eina_Stringshare *prop;
Eina_Value *value;
@ -128,7 +128,7 @@ _efl_model_item_efl_model_property_get(const Eo *obj EINA_UNUSED,
}
static Eina_Future *
_efl_model_item_efl_model_children_slice_get(Eo *obj, Efl_Model_Item_Data *pd, unsigned int start, unsigned int count)
_efl_generic_model_efl_model_children_slice_get(Eo *obj, Efl_Generic_Model_Data *pd, unsigned int start, unsigned int count)
{
Eina_Value v;
@ -137,21 +137,21 @@ _efl_model_item_efl_model_children_slice_get(Eo *obj, Efl_Model_Item_Data *pd, u
}
static unsigned int
_efl_model_item_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Model_Item_Data *pd)
_efl_generic_model_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_Generic_Model_Data *pd)
{
return eina_list_count(pd->childrens);
}
static Eo *
_efl_model_item_efl_model_child_add(Eo *obj, Efl_Model_Item_Data *sd)
_efl_generic_model_efl_model_child_add(Eo *obj, Efl_Generic_Model_Data *sd)
{
Efl_Model_Children_Event cevt;
Efl_Model *child;
child = efl_add(EFL_MODEL_ITEM_CLASS, obj);
child = efl_add(EFL_GENERIC_MODEL_CLASS, obj);
if (!child)
{
EINA_LOG_ERR("Could not allocate Efl.Model.Item");
EINA_LOG_ERR("Could not allocate Efl.Generic_Model");
eina_error_set(EFL_MODEL_ERROR_UNKNOWN);
return NULL;
}
@ -166,7 +166,7 @@ _efl_model_item_efl_model_child_add(Eo *obj, Efl_Model_Item_Data *sd)
}
static void
_efl_model_item_efl_model_child_del(Eo *obj, Efl_Model_Item_Data *sd, Eo *child)
_efl_generic_model_efl_model_child_del(Eo *obj, Efl_Generic_Model_Data *sd, Eo *child)
{
Efl_Model *data;
Eina_List *l;
@ -194,4 +194,4 @@ _efl_model_item_efl_model_child_del(Eo *obj, Efl_Model_Item_Data *sd, Eo *child)
}
}
#include "efl_model_item.eo.c"
#include "efl_generic_model.eo.c"