jackdanielz pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=7892aea2bcfa5fcd3a2fdc2ed4093daefb928344
commit 7892aea2bcfa5fcd3a2fdc2ed4093daefb928344 Author: Daniel Zaoui <daniel.za...@samsung.com> Date: Wed Mar 26 11:30:53 2014 +0200 Eolian: Integration of Separator --- src/lib/Makefile.am | 10 ++-- src/lib/elm_separator.c | 111 +++++++++-------------------------------- src/lib/elm_separator.eo | 37 ++++++++++++++ src/lib/elm_separator_eo.h | 5 ++ src/lib/elm_widget_separator.h | 6 +-- 5 files changed, 76 insertions(+), 93 deletions(-) diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 11640ac..18f5856 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -642,7 +642,9 @@ BUILT_SOURCES = \ elm_scroller.eo.c \ elm_scroller.eo.h \ elm_segment_control.eo.c \ - elm_segment_control.eo.h + elm_segment_control.eo.h \ + elm_separator.eo.c \ + elm_separator.eo.h EXTRA_DIST += \ elm_widget.eo \ @@ -703,7 +705,8 @@ EXTRA_DIST += \ elm_radio.eo \ elm_route.eo \ elm_scroller.eo \ - elm_segment_control.eo + elm_segment_control.eo \ + elm_separator.eo nodist_includesunstable_HEADERS = \ elm_widget.eo.h \ @@ -764,5 +767,6 @@ nodist_includesunstable_HEADERS = \ elm_radio.eo.h \ elm_route.eo.h \ elm_scroller.eo.h \ - elm_segment_control.eo.h + elm_segment_control.eo.h \ + elm_separator.eo.h diff --git a/src/lib/elm_separator.c b/src/lib/elm_separator.c index ae36625..63db3f6 100644 --- a/src/lib/elm_separator.c +++ b/src/lib/elm_separator.c @@ -8,19 +8,14 @@ #include "elm_widget_separator.h" #include "elm_widget_layout.h" -EAPI Eo_Op ELM_OBJ_SEPARATOR_BASE_ID = EO_NOOP; - #define MY_CLASS ELM_OBJ_SEPARATOR_CLASS #define MY_CLASS_NAME "Elm_Separator" #define MY_CLASS_NAME_LEGACY "elm_separator" -static void -_elm_separator_smart_theme(Eo *obj, void *_pd, va_list *list) +EOLIAN static Eina_Bool +_elm_separator_elm_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) { - Elm_Separator_Smart_Data *sd = _pd; - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - if (ret) *ret = EINA_FALSE; Eina_Bool int_ret; ELM_LAYOUT_DATA_GET(obj, ld); @@ -30,13 +25,13 @@ _elm_separator_smart_theme(Eo *obj, void *_pd, va_list *list) eina_stringshare_replace(&ld->group, "vertical"); eo_do_super(obj, MY_CLASS, elm_obj_widget_theme_apply(&int_ret)); - if (!int_ret) return; + if (!int_ret) return EINA_FALSE; - if (ret) *ret = EINA_TRUE; + return EINA_TRUE; } -static void -_elm_separator_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) +EOLIAN static void +_elm_separator_elm_layout_sizing_eval(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) { Evas_Coord minw = -1, minh = -1; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); @@ -47,9 +42,8 @@ _elm_separator_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list E evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); } -static void -_elm_separator_smart_add(Eo *obj, void *_pd EINA_UNUSED, - va_list *list EINA_UNUSED) +EOLIAN static void +_elm_separator_evas_smart_add(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) { eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); elm_widget_sub_object_parent_add(obj); @@ -71,28 +65,17 @@ elm_separator_add(Evas_Object *parent) return obj; } -static void -_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) +EOLIAN static void +_elm_separator_eo_base_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) { eo_do_super(obj, MY_CLASS, eo_constructor()); eo_do(obj, evas_obj_type_set(MY_CLASS_NAME_LEGACY)); } -EAPI void -elm_separator_horizontal_set(Evas_Object *obj, - Eina_Bool horizontal) -{ - ELM_SEPARATOR_CHECK(obj); - eo_do(obj, elm_obj_separator_horizontal_set(horizontal)); -} - -static void -_horizontal_set(Eo *obj, void *_pd, va_list *list) +EOLIAN static void +_elm_separator_horizontal_set(Eo *obj, Elm_Separator_Data *sd, Eina_Bool horizontal) { - Eina_Bool horizontal = va_arg(*list, int); - Elm_Separator_Smart_Data *sd = _pd; - horizontal = !!horizontal; if (sd->horizontal == horizontal) return; @@ -101,74 +84,28 @@ _horizontal_set(Eo *obj, void *_pd, va_list *list) eo_do(obj, elm_obj_widget_theme_apply(NULL)); } -EAPI Eina_Bool -elm_separator_horizontal_get(const Evas_Object *obj) +EOLIAN static Eina_Bool +_elm_separator_horizontal_get(Eo *obj EINA_UNUSED, Elm_Separator_Data *sd) { - ELM_SEPARATOR_CHECK(obj) EINA_FALSE; - Eina_Bool ret; - eo_do((Eo *) obj, elm_obj_separator_horizontal_get(&ret)); - return ret; + return sd->horizontal; } -static void -_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) +EOLIAN static Eina_Bool +_elm_separator_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Separator_Data *_pd EINA_UNUSED) { - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - Elm_Separator_Smart_Data *sd = _pd; - *ret = sd->horizontal; + return EINA_FALSE; } -static void -_elm_separator_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list) +EOLIAN static Eina_Bool +_elm_separator_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Separator_Data *_pd EINA_UNUSED) { - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - *ret = EINA_FALSE; + return EINA_FALSE; } -static void -_elm_separator_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list) +EOLIAN static void +_elm_separator_class_constructor(Eo_Class *klass) { - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - *ret = EINA_FALSE; -} - -static void -_class_constructor(Eo_Class *klass) -{ - const Eo_Op_Func_Description func_desc[] = { - EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor), - - EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_separator_smart_add), - - EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_THEME_APPLY), _elm_separator_smart_theme), - EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_separator_smart_focus_next_manager_is), - EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_separator_smart_focus_direction_manager_is), - - EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_separator_smart_sizing_eval), - - EO_OP_FUNC(ELM_OBJ_SEPARATOR_ID(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_SET), _horizontal_set), - EO_OP_FUNC(ELM_OBJ_SEPARATOR_ID(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_GET), _horizontal_get), - EO_OP_FUNC_SENTINEL - }; - eo_class_funcs_set(klass, func_desc); - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } -static const Eo_Op_Description op_desc[] = { - EO_OP_DESCRIPTION(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_SET, "Set the horizontal mode of a separator object."), - EO_OP_DESCRIPTION(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_GET, "Get the horizontal mode of a separator object."), - EO_OP_DESCRIPTION_SENTINEL -}; - -static const Eo_Class_Description class_desc = { - EO_VERSION, - MY_CLASS_NAME, - EO_CLASS_TYPE_REGULAR, - EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_SEPARATOR_BASE_ID, op_desc, ELM_OBJ_SEPARATOR_SUB_ID_LAST), - NULL, - sizeof(Elm_Separator_Smart_Data), - _class_constructor, - NULL -}; -EO_DEFINE_CLASS(elm_obj_separator_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL); +#include "elm_separator.eo.c" diff --git a/src/lib/elm_separator.eo b/src/lib/elm_separator.eo new file mode 100644 index 0000000..de9970b --- /dev/null +++ b/src/lib/elm_separator.eo @@ -0,0 +1,37 @@ +class Elm_Separator (Elm_Layout) +{ + eo_prefix: elm_obj_separator; + properties { + horizontal { + set { + /*@ + @brief Set the horizontal mode of a separator object + + @ingroup Separator */ + } + get { + /*@ + @brief Get the horizontal mode of a separator object + + @return If true, the separator is horizontal + + @see elm_separator_horizontal_set() + + @ingroup Separator */ + } + values { + Eina_Bool horizontal; /*@ If true, the separator is horizontal */ + } + } + } + implements { + class::constructor; + Eo_Base::constructor; + Evas_Smart::add; + Elm_Widget::focus_next_manager_is; + Elm_Widget::focus_direction_manager_is; + Elm_Widget::theme_apply; + Elm_Layout::sizing_eval; + } + +} diff --git a/src/lib/elm_separator_eo.h b/src/lib/elm_separator_eo.h index 30b60f4..4738873 100644 --- a/src/lib/elm_separator_eo.h +++ b/src/lib/elm_separator_eo.h @@ -1,3 +1,6 @@ +#include "elm_separator.eo.h" + +#if 0 #define ELM_OBJ_SEPARATOR_CLASS elm_obj_separator_class_get() const Eo_Class *elm_obj_separator_class_get(void) EINA_CONST; @@ -41,3 +44,5 @@ enum * @ingroup Separator */ #define elm_obj_separator_horizontal_get(ret) ELM_OBJ_SEPARATOR_ID(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret) +#endif + diff --git a/src/lib/elm_widget_separator.h b/src/lib/elm_widget_separator.h index e78145c..5c1448f 100644 --- a/src/lib/elm_widget_separator.h +++ b/src/lib/elm_widget_separator.h @@ -17,8 +17,8 @@ /** * Base layout smart data extended with separator instance data. */ -typedef struct _Elm_Separator_Smart_Data Elm_Separator_Smart_Data; -struct _Elm_Separator_Smart_Data +typedef struct _Elm_Separator_Data Elm_Separator_Data; +struct _Elm_Separator_Data { Eina_Bool horizontal : 1; }; @@ -28,7 +28,7 @@ struct _Elm_Separator_Smart_Data */ #define ELM_SEPARATOR_DATA_GET(o, sd) \ - Elm_Separator_Smart_Data * sd = eo_data_scope_get(o, ELM_OBJ_SEPARATOR_CLASS) + Elm_Separator_Data * sd = eo_data_scope_get(o, ELM_OBJ_SEPARATOR_CLASS) #define ELM_SEPARATOR_DATA_GET_OR_RETURN(o, ptr) \ ELM_SEPARATOR_DATA_GET(o, ptr); \ --