diff options
author | Daniel Zaoui <daniel.zaoui@samsung.com> | 2014-03-25 08:15:53 +0200 |
---|---|---|
committer | Daniel Zaoui <daniel.zaoui@samsung.com> | 2014-03-31 08:14:03 +0300 |
commit | e24c010f3524d06ec569a55ddce5b134cf1be66f (patch) | |
tree | 37f078eb69bdd47410fc4f8cafea44440d37db16 | |
parent | ea8d9c7241ebfa4398eabe039ec2fb9fec2b1f8b (diff) | |
download | elementary-e24c010f3524d06ec569a55ddce5b134cf1be66f.tar.gz |
Eolian: Integration of MapBuf
-rw-r--r-- | src/lib/Makefile.am | 10 | ||||
-rw-r--r-- | src/lib/elm_mapbuf.c | 365 | ||||
-rw-r--r-- | src/lib/elm_mapbuf.eo | 194 | ||||
-rw-r--r-- | src/lib/elm_mapbuf_eo.h | 4 | ||||
-rw-r--r-- | src/lib/elm_widget_mapbuf.h | 6 |
5 files changed, 284 insertions, 295 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index cb66d4c6b..24844c424 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -612,7 +612,9 @@ BUILT_SOURCES = \ elm_menu.eo.c \ elm_menu.eo.h \ elm_panel.eo.c \ - elm_panel.eo.h + elm_panel.eo.h \ + elm_mapbuf.eo.c \ + elm_mapbuf.eo.h EXTRA_DIST += \ elm_widget.eo \ @@ -658,7 +660,8 @@ EXTRA_DIST += \ elm_map_pan.eo \ elm_map.eo \ elm_menu.eo \ - elm_panel.eo + elm_panel.eo \ + elm_mapbuf.eo nodist_includesunstable_HEADERS = \ elm_widget.eo.h \ @@ -704,5 +707,6 @@ nodist_includesunstable_HEADERS = \ elm_map_pan.eo.h \ elm_map.eo.h \ elm_menu.eo.h \ - elm_panel.eo.h + elm_panel.eo.h \ + elm_mapbuf.eo.h diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c index 7c6eb359b..d041eb2f5 100644 --- a/src/lib/elm_mapbuf.c +++ b/src/lib/elm_mapbuf.c @@ -8,8 +8,6 @@ #include "elm_widget_mapbuf.h" #include "elm_widget_container.h" -EAPI Eo_Op ELM_OBJ_MAPBUF_BASE_ID = EO_NOOP; - #define MY_CLASS ELM_OBJ_MAPBUF_CLASS #define MY_CLASS_NAME "Elm_Mapbuf" @@ -31,19 +29,16 @@ _sizing_eval(Evas_Object *obj) evas_object_size_hint_max_set(obj, maxw, maxh); } -static void -_elm_mapbuf_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list) +EOLIAN static Eina_Bool +_elm_mapbuf_elm_widget_theme_apply(Eo *obj, Elm_Mapbuf_Data *sd EINA_UNUSED) { - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - if (ret) *ret = EINA_FALSE; Eina_Bool int_ret = EINA_FALSE; - eo_do_super(obj, MY_CLASS, elm_obj_widget_theme_apply(&int_ret)); - if (!int_ret) return; + if (!int_ret) return EINA_FALSE; _sizing_eval(obj); - if (ret) *ret = EINA_TRUE; + return EINA_TRUE; } static void @@ -56,7 +51,7 @@ _changed_size_hints_cb(void *data, } static void -_elm_mapbuf_content_unset(Elm_Mapbuf_Smart_Data *sd, Evas_Object *obj, +_elm_mapbuf_content_unset(Elm_Mapbuf_Data *sd, Evas_Object *obj, Evas_Object *content) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); @@ -73,21 +68,16 @@ _elm_mapbuf_content_unset(Elm_Mapbuf_Smart_Data *sd, Evas_Object *obj, ELM_SAFE_FREE(sd->idler, ecore_idler_del); } -static void -_elm_mapbuf_smart_sub_object_del(Eo *obj, void *_pd, va_list *list) +EOLIAN static Eina_Bool +_elm_mapbuf_elm_widget_sub_object_del(Eo *obj, Elm_Mapbuf_Data *sd, Evas_Object *sobj) { - Elm_Mapbuf_Smart_Data *sd = _pd; - Evas_Object *sobj = va_arg(*list, Evas_Object *); - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - if (ret) *ret = EINA_FALSE; Eina_Bool int_ret = EINA_FALSE; - eo_do_super(obj, MY_CLASS, elm_obj_widget_sub_object_del(sobj, &int_ret)); - if (!int_ret) return; + if (!int_ret) return EINA_FALSE; if (sobj == sd->content) _elm_mapbuf_content_unset(sd, (Evas_Object *)obj, sobj); - if (ret) *ret = EINA_TRUE; + return EINA_TRUE; } static void @@ -124,7 +114,7 @@ _configure(Evas_Object *obj) } static void -_mapbuf_auto_eval(Evas_Object *obj, Elm_Mapbuf_Smart_Data *sd) +_mapbuf_auto_eval(Evas_Object *obj, Elm_Mapbuf_Data *sd) { Eina_Bool vis; Evas_Coord x, y, w, h; @@ -143,7 +133,7 @@ _mapbuf_auto_eval(Evas_Object *obj, Elm_Mapbuf_Smart_Data *sd) static Eina_Bool _mapbuf_move_end(void *data) { - Elm_Mapbuf_Smart_Data *sd = data; + Elm_Mapbuf_Data *sd = data; elm_mapbuf_smooth_set(sd->self, sd->smooth_saved); sd->idler = NULL; @@ -152,72 +142,58 @@ _mapbuf_move_end(void *data) } static void -_mapbuf_auto_smooth(Evas_Object *obj EINA_UNUSED, Elm_Mapbuf_Smart_Data *sd) +_mapbuf_auto_smooth(Evas_Object *obj EINA_UNUSED, Elm_Mapbuf_Data *sd) { if (!sd->automode) return ; if (!sd->idler) sd->idler = ecore_idler_add(_mapbuf_move_end, sd); sd->smooth = EINA_FALSE; } -static void -_elm_mapbuf_smart_move(Eo *obj, void *_pd, va_list *list) +EOLIAN static void +_elm_mapbuf_evas_smart_move(Eo *obj, Elm_Mapbuf_Data *sd, Evas_Coord x, Evas_Coord y) { - Evas_Coord x = va_arg(*list, Evas_Coord); - Evas_Coord y = va_arg(*list, Evas_Coord); eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y)); - _mapbuf_auto_eval(obj, _pd); - _mapbuf_auto_smooth(obj, _pd); + _mapbuf_auto_eval(obj, sd); + _mapbuf_auto_smooth(obj, sd); _configure(obj); } -static void -_elm_mapbuf_smart_resize(Eo *obj, void *_pd, va_list *list) +EOLIAN static void +_elm_mapbuf_evas_smart_resize(Eo *obj, Elm_Mapbuf_Data *sd, Evas_Coord w, Evas_Coord h) { - Evas_Coord w = va_arg(*list, Evas_Coord); - Evas_Coord h = va_arg(*list, Evas_Coord); eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h)); - ELM_MAPBUF_DATA_GET(obj, sd); if (sd->content) evas_object_resize(sd->content, w, h); - _mapbuf_auto_eval(obj, _pd); + _mapbuf_auto_eval(obj, sd); _configure(obj); } -static void -_elm_mapbuf_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED) +EOLIAN static void +_elm_mapbuf_evas_smart_show(Eo *obj, Elm_Mapbuf_Data *sd) { eo_do_super(obj, MY_CLASS, evas_obj_smart_show()); - _mapbuf_auto_eval(obj, _pd); + _mapbuf_auto_eval(obj, sd); _configure(obj); } -static void -_elm_mapbuf_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED) +EOLIAN static void +_elm_mapbuf_evas_smart_hide(Eo *obj, Elm_Mapbuf_Data *sd) { eo_do_super(obj, MY_CLASS, evas_obj_smart_hide()); - _mapbuf_auto_eval(obj, _pd); + _mapbuf_auto_eval(obj, sd); _configure(obj); } -static void -_elm_mapbuf_smart_content_set(Eo *obj, void *_pd, va_list *list) +EOLIAN static Eina_Bool +_elm_mapbuf_elm_container_content_set(Eo *obj, Elm_Mapbuf_Data *sd, const char *part, Evas_Object *content) { - Elm_Mapbuf_Smart_Data *sd = _pd; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - const char *part = va_arg(*list, const char *); - Evas_Object *content = va_arg(*list, Evas_Object *); - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - if (ret) *ret = EINA_FALSE; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - if (part && strcmp(part, "default")) return; - if (sd->content == content) - { - if (ret) *ret = EINA_TRUE; - return; - } + if (part && strcmp(part, "default")) return EINA_FALSE; + if (sd->content == content) return EINA_TRUE; evas_object_del(sd->content); sd->content = content; @@ -240,55 +216,41 @@ _elm_mapbuf_smart_content_set(Eo *obj, void *_pd, va_list *list) _sizing_eval(obj); _configure(obj); - if (ret) *ret = EINA_TRUE; + return EINA_TRUE; } -static void -_elm_mapbuf_smart_content_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) +EOLIAN static Evas_Object* +_elm_mapbuf_elm_container_content_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, const char *part) { - Elm_Mapbuf_Smart_Data *sd = _pd; - const char *part = va_arg(*list, const char *); - Evas_Object **ret = va_arg(*list, Evas_Object **); - *ret = NULL; - - if (part && strcmp(part, "default")) return; - *ret = sd->content; + if (part && strcmp(part, "default")) return NULL; + return sd->content; } -static void -_elm_mapbuf_smart_content_unset(Eo *obj, void *_pd, va_list *list) +EOLIAN static Evas_Object* +_elm_mapbuf_elm_container_content_unset(Eo *obj, Elm_Mapbuf_Data *sd, const char *part) { Evas_Object *content; - const char *part = va_arg(*list, const char *); - Evas_Object **ret = va_arg(*list, Evas_Object **); - if (ret) *ret = NULL; - - Elm_Mapbuf_Smart_Data *sd = _pd; - - if (part && strcmp(part, "default")) return; - if (!sd->content) return; + if (part && strcmp(part, "default")) return NULL; + if (!sd->content) return NULL; content = sd->content; elm_widget_sub_object_del(obj, content); _elm_mapbuf_content_unset(sd, obj, content); - if (ret) *ret = content; + return content; } -static void -_elm_mapbuf_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) +EOLIAN static void +_elm_mapbuf_evas_smart_del(Eo *obj, Elm_Mapbuf_Data *priv) { - Elm_Mapbuf_Smart_Data *priv = _pd; - ELM_SAFE_FREE(priv->idler, ecore_idler_del); ELM_SAFE_FREE(priv->map, evas_map_free); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } -static void -_elm_mapbuf_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) +EOLIAN static void +_elm_mapbuf_evas_smart_add(Eo *obj, Elm_Mapbuf_Data *priv) { - Elm_Mapbuf_Smart_Data *priv = _pd; Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(obj)); int i; @@ -327,24 +289,16 @@ elm_mapbuf_add(Evas_Object *parent) return obj; } -static void -_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) +EOLIAN static void +_elm_mapbuf_eo_base_constructor(Eo *obj, Elm_Mapbuf_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_mapbuf_enabled_set(Evas_Object *obj, - Eina_Bool enabled) -{ - ELM_MAPBUF_CHECK(obj); - eo_do(obj, elm_obj_mapbuf_enabled_set(enabled)); -} - static void -_internal_enable_set(Eo *obj, Elm_Mapbuf_Smart_Data *sd, Eina_Bool enabled) +_internal_enable_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool enabled) { if (sd->enabled == enabled) return; sd->enabled = enabled; @@ -359,119 +313,50 @@ _internal_enable_set(Eo *obj, Elm_Mapbuf_Smart_Data *sd, Eina_Bool enabled) _configure(obj); } -static void -_enabled_set(Eo *obj, void *_pd, va_list *list) +EOLIAN static void +_elm_mapbuf_enabled_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool enabled) { - Eina_Bool enabled = va_arg(*list, int); - Elm_Mapbuf_Smart_Data *sd = _pd; - _internal_enable_set(obj, sd, enabled); } -EAPI Eina_Bool -elm_mapbuf_enabled_get(const Evas_Object *obj) +EOLIAN static Eina_Bool +_elm_mapbuf_enabled_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd) { - ELM_MAPBUF_CHECK(obj) EINA_FALSE; - Eina_Bool ret = EINA_FALSE; - eo_do((Eo *) obj, elm_obj_mapbuf_enabled_get(&ret)); - return ret; + return sd->enabled; } -static void -_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) +EOLIAN static void +_elm_mapbuf_smooth_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool smooth) { - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - Elm_Mapbuf_Smart_Data *sd = _pd; - *ret = sd->enabled; -} - -EAPI void -elm_mapbuf_smooth_set(Evas_Object *obj, - Eina_Bool smooth) -{ - ELM_MAPBUF_CHECK(obj); - eo_do(obj, elm_obj_mapbuf_smooth_set(smooth)); -} - -static void -_smooth_set(Eo *obj, void *_pd, va_list *list) -{ - Eina_Bool smooth = va_arg(*list, int); - Elm_Mapbuf_Smart_Data *sd = _pd; - if (sd->smooth == smooth) return; sd->smooth = smooth; sd->smooth_saved = smooth; _configure(obj); } -EAPI Eina_Bool -elm_mapbuf_smooth_get(const Evas_Object *obj) +EOLIAN static Eina_Bool +_elm_mapbuf_smooth_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd) { - ELM_MAPBUF_CHECK(obj) EINA_FALSE; - Eina_Bool ret = EINA_FALSE; - eo_do((Eo *) obj, elm_obj_mapbuf_smooth_get(&ret)); - return ret; + return sd->smooth; } -static void -_smooth_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) -{ - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - Elm_Mapbuf_Smart_Data *sd = _pd; - *ret = sd->smooth; -} - -EAPI void -elm_mapbuf_alpha_set(Evas_Object *obj, - Eina_Bool alpha) -{ - ELM_MAPBUF_CHECK(obj); - eo_do(obj, elm_obj_mapbuf_alpha_set(alpha)); -} - -static void -_alpha_set(Eo *obj, void *_pd, va_list *list) +EOLIAN static void +_elm_mapbuf_alpha_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool alpha) { - Eina_Bool alpha = va_arg(*list, int); - Elm_Mapbuf_Smart_Data *sd = _pd; - if (sd->alpha == alpha) return; sd->alpha = alpha; _configure(obj); } -EAPI Eina_Bool -elm_mapbuf_alpha_get(const Evas_Object *obj) -{ - ELM_MAPBUF_CHECK(obj) EINA_FALSE; - Eina_Bool ret = EINA_FALSE; - eo_do((Eo *) obj, elm_obj_mapbuf_alpha_get(&ret)); - return ret; -} - -static void -_alpha_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) -{ - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - Elm_Mapbuf_Smart_Data *sd = _pd; - *ret = sd->alpha; -} - -EAPI void -elm_mapbuf_auto_set(Evas_Object *obj, - Eina_Bool on) +EOLIAN static Eina_Bool +_elm_mapbuf_alpha_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd) { - ELM_MAPBUF_CHECK(obj); - eo_do(obj, elm_obj_mapbuf_auto_set(on)); + return sd->alpha; } -static void -_auto_set(Eo *obj, void *_pd, va_list *list) +EOLIAN static void +_elm_mapbuf_auto_set(Eo *obj, Elm_Mapbuf_Data *sd, Eina_Bool on) { - Eina_Bool on = va_arg(*list, int); - Elm_Mapbuf_Smart_Data *sd = _pd; - if (sd->automode == on) return; sd->automode = on; if (on) @@ -482,39 +367,20 @@ _auto_set(Eo *obj, void *_pd, va_list *list) { ELM_SAFE_FREE(sd->idler, ecore_idler_del); - _internal_enable_set(obj, _pd, EINA_FALSE); + _internal_enable_set(obj, sd, EINA_FALSE); } _configure(obj); } -EAPI Eina_Bool -elm_mapbuf_auto_get(const Evas_Object *obj) +EOLIAN static Eina_Bool +_elm_mapbuf_auto_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd) { - ELM_MAPBUF_CHECK(obj) EINA_FALSE; - Eina_Bool ret = EINA_FALSE; - eo_do((Eo *) obj, elm_obj_mapbuf_auto_get(&ret)); - return ret; + return sd->automode; } -static void -_auto_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) +EOLIAN static void +_elm_mapbuf_point_color_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, int idx, int *r, int *g, int *b, int *a) { - Eina_Bool *ret = va_arg(*list, Eina_Bool *); - Elm_Mapbuf_Smart_Data *sd = _pd; - *ret = sd->automode; -} - -static void -_point_color_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) -{ - int idx = va_arg(*list, int); - int *r = va_arg(*list, int *); - int *g = va_arg(*list, int *); - int *b = va_arg(*list, int *); - int *a = va_arg(*list, int *); - - Elm_Mapbuf_Smart_Data *sd = _pd; - if ((idx < 0) || (idx >= 4)) { ERR("idx value should be 0 ~ 4"); @@ -526,26 +392,9 @@ _point_color_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) *a =sd->colors[idx].a; } -EAPI void -elm_mapbuf_point_color_get(Evas_Object *obj, int idx, - int *r, int *g, int *b, int *a) -{ - ELM_MAPBUF_CHECK(obj); - - eo_do(obj, elm_obj_mapbuf_point_color_get(idx, r, g, b, a)); -} - -static void -_point_color_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list) +EOLIAN static void +_elm_mapbuf_point_color_set(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, int idx, int r, int g, int b, int a) { - int idx = va_arg(*list, int); - int r = va_arg(*list, int); - int g = va_arg(*list, int); - int b = va_arg(*list, int); - int a = va_arg(*list, int); - - Elm_Mapbuf_Smart_Data *sd = _pd; - if ((idx < 0) || (idx >= 4)) { ERR("idx value should be 0 ~ 4"); @@ -559,72 +408,10 @@ _point_color_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list) _configure(obj); } -EAPI void -elm_mapbuf_point_color_set(Evas_Object *obj, int idx, - int r, int g, int b, int a) -{ - ELM_MAPBUF_CHECK(obj); - - eo_do(obj, elm_obj_mapbuf_point_color_set(idx, r, g, b, a)); -} - 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_mapbuf_smart_add), - EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_mapbuf_smart_del), - EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_mapbuf_smart_resize), - EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_mapbuf_smart_move), - EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_mapbuf_smart_show), - EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_mapbuf_smart_hide), - - EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_THEME_APPLY), _elm_mapbuf_smart_theme), - EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_mapbuf_smart_sub_object_del), - - EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_mapbuf_smart_content_set), - EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_mapbuf_smart_content_get), - EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_mapbuf_smart_content_unset), - - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_SET), _enabled_set), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_GET), _enabled_get), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_SET), _smooth_set), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_GET), _smooth_get), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_SET), _alpha_set), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_GET), _alpha_get), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_AUTO_SET), _auto_set), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_AUTO_GET), _auto_get), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_POINT_COLOR_SET), _point_color_set), - EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_POINT_COLOR_GET), _point_color_get), - EO_OP_FUNC_SENTINEL - }; - eo_class_funcs_set(klass, func_desc); - +_elm_mapbuf_class_constructor(Eo_Class *klass) +{ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } -static const Eo_Op_Description op_desc[] = { - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_SET, "Enable or disable the map."), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_GET, "Get a value whether map is enabled or not."), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_SET, "Enable or disable smooth map rendering."), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_GET, "Get a value whether smooth map rendering is enabled or not."), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_SET, "Set or unset alpha flag for map rendering."), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_GET, "Get a value whether alpha blending is enabled or not."), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_AUTO_SET, "Turn map on or off automatically based on object visibility."), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_AUTO_GET, "Get automatic mode state."), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_POINT_COLOR_SET, "Set a vertex color of the mapbuf"), - EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_POINT_COLOR_GET, "Get a vertex color of the mapbuf"), - 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_MAPBUF_BASE_ID, op_desc, ELM_OBJ_MAPBUF_SUB_ID_LAST), - NULL, - sizeof(Elm_Mapbuf_Smart_Data), - _class_constructor, - NULL -}; -EO_DEFINE_CLASS(elm_obj_mapbuf_class_get, &class_desc, ELM_OBJ_CONTAINER_CLASS, NULL); + +#include "elm_mapbuf.eo.c" diff --git a/src/lib/elm_mapbuf.eo b/src/lib/elm_mapbuf.eo new file mode 100644 index 000000000..37ba8b1bf --- /dev/null +++ b/src/lib/elm_mapbuf.eo @@ -0,0 +1,194 @@ +class Elm_Mapbuf (Elm_Container) +{ + eo_prefix: elm_obj_mapbuf; + properties { + auto { + set { + /*@ + Set or unset auto flag for map rendering. + + When a ampbuf object has "auto mode" enabled, then it will enable and + disable map mode based on current visibility. Mapbuf will track if you show + or hide it AND if the object is inside the canvas viewport or not when it + is moved or resized. Note that if you turn automode off, then map mode + will be in a disabled state at this point. When you turn it on for the + first time, the current state will be evaluated base on current properties + of the mapbuf object. + + Auto mode is disabled by default. + + @ingroup Mapbuf */ + } + get { + /*@ + Get a value whether auto mode is enabled or not. + + @return @c EINA_TRUE means autso mode is enabled. @c EINA_FALSE + indicates it's disabled. If @p obj is @c NULL, @c EINA_FALSE is returned. + + @see elm_mapbuf_auto_set() for details. + + @ingroup Mapbuf */ + } + values { + Eina_Bool on; /*@ @c EINA_TRUE to enable auto mode or @c EINA_FALSE + to disable it. */ + } + } + smooth { + set { + /*@ + Enable or disable smooth map rendering. + + This sets smoothing for map rendering. If the object is a type that has + its own smoothing settings, then both the smooth settings for this object + and the map must be turned off. + + By default smooth maps are enabled. + + @ingroup Mapbuf */ + } + get { + /*@ + Get a value whether smooth map rendering is enabled or not. + + @return @c EINA_TRUE means smooth map rendering is enabled. @c EINA_FALSE + indicates it's disabled. If @p obj is @c NULL, @c EINA_FALSE is returned. + + @see elm_mapbuf_smooth_set() for details. + + @ingroup Mapbuf */ + } + values { + Eina_Bool smooth; /*@ @c EINA_TRUE to enable smooth map rendering or @c EINA_FALSE + to disable it. */ + } + } + alpha { + set { + /*@ + Set or unset alpha flag for map rendering. + + This sets alpha flag for map rendering. If the object is a type that has + its own alpha settings, then this will take precedence. Only image objects + have this currently. It stops alpha blending of the map area, and is + useful if you know the object and/or all sub-objects is 100% solid. + + Alpha is enabled by default. + + @ingroup Mapbuf */ + } + get { + /*@ + Get a value whether alpha blending is enabled or not. + + @return @c EINA_TRUE means alpha blending is enabled. @c EINA_FALSE + indicates it's disabled. If @p obj is @c NULL, @c EINA_FALSE is returned. + + @see elm_mapbuf_alpha_set() for details. + + @ingroup Mapbuf */ + } + values { + Eina_Bool alpha; /*@ @c EINA_TRUE to enable alpha blending or @c EINA_FALSE + to disable it. */ + } + } + enabled { + set { + /*@ + Enable or disable the map. + + This enables the map that is set or disables it. On enable, the object + geometry will be saved, and the new geometry will change (position and + size) to reflect the map geometry set. + + Also, when enabled, alpha and smooth states will be used, so if the + content isn't solid, alpha should be enabled, for example, otherwise + a black rectangle will fill the content. + + When disabled, the stored map will be freed and geometry prior to + enabling the map will be restored. + + It's disabled by default. + + @see elm_mapbuf_alpha_set() + @see elm_mapbuf_smooth_set() + + @ingroup Mapbuf */ + } + get { + /*@ + Get a value whether map is enabled or not. + + @return @c EINA_TRUE means map is enabled. @c EINA_FALSE indicates + it's disabled. If @p obj is @c NULL, @c EINA_FALSE is returned. + + @see elm_mapbuf_enabled_set() for details. + + @ingroup Mapbuf */ + } + values { + Eina_Bool enabled; /*@ @c EINA_TRUE to enable map or @c EINA_FALSE to disable it. */ + } + } + } + methods { + point_color_set { + /*@ + Set the color of a vertex in the mapbuf + + This sets the color of the vertex in the mapbuf. Colors will be linearly + interpolated between vertex points through the mapbuf. Color will multiply + the "texture" pixels (like GL_MODULATE in OpenGL). The default color of + a vertex in a mapbuf is white solid (255, 255, 255, 255) which means it will + have no affect on modifying the texture pixels. + + @see evas_object_map_set() + @since 1.9 */ + + params { + @in int idx; /*@ index of point to change. Must be smaller than mapbuf size. */ + @in int r; /*@ red (0 - 255) */ + @in int g; /*@ green (0 - 255) */ + @in int b; /*@ blue (0 - 255) */ + @in int a; /*@ alpha (0 - 255) */ + } + } + point_color_get { + /*@ + Get the color set on a vertex in the mapbuf + + This gets the color set by elm_mapbuf_point_color_set() on the given vertex + of the mapbuf. + + @see elm_mapbuf_point_color_set() + + @since 1.9 */ + + params { + @in int idx; /*@ index of point get. Must be smaller than map size. */ + @out int r; /*@ pointer to red return */ + @out int g; /*@ pointer to green return */ + @out int b; /*@ pointer to blue return */ + @out int a; /*@ pointer to alpha return */ + } + } + } + implements { + class::constructor; + Eo_Base::constructor; + Evas_Smart::hide; + Evas_Smart::show; + Evas_Smart::move; + Evas_Smart::add; + Evas_Smart::del; + Evas_Smart::resize; + Elm_Widget::theme_apply; + Elm_Widget::sub_object_del; + Elm_Container::content_get; + Elm_Container::content_set; + Elm_Container::content_unset; + } + +} diff --git a/src/lib/elm_mapbuf_eo.h b/src/lib/elm_mapbuf_eo.h index b98ad8677..e3ce4f6cb 100644 --- a/src/lib/elm_mapbuf_eo.h +++ b/src/lib/elm_mapbuf_eo.h @@ -3,6 +3,9 @@ * * @{ */ +#include "elm_mapbuf.eo.h" + +#if 0 #define ELM_OBJ_MAPBUF_CLASS elm_obj_mapbuf_class_get() const Eo_Class *elm_obj_mapbuf_class_get(void) EINA_CONST; @@ -154,6 +157,7 @@ enum * @see elm_mapbuf_point_color_get */ #define elm_obj_mapbuf_point_color_get(idx, r, g, b, a) ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_POINT_COLOR_GET), EO_TYPECHECK(int, idx), EO_TYPECHECK(int *, r), EO_TYPECHECK(int *, g), EO_TYPECHECK(int *, b), EO_TYPECHECK(int *, a) +#endif /** * @} diff --git a/src/lib/elm_widget_mapbuf.h b/src/lib/elm_widget_mapbuf.h index f4adf22e7..429ff2b47 100644 --- a/src/lib/elm_widget_mapbuf.h +++ b/src/lib/elm_widget_mapbuf.h @@ -17,8 +17,8 @@ /** * Base widget smart data extended with mapbuf instance data. */ -typedef struct _Elm_Mapbuf_Smart_Data Elm_Mapbuf_Smart_Data; -struct _Elm_Mapbuf_Smart_Data +typedef struct _Elm_Mapbuf_Data Elm_Mapbuf_Data; +struct _Elm_Mapbuf_Data { Evas_Object *self; Evas_Object *content; @@ -41,7 +41,7 @@ struct _Elm_Mapbuf_Smart_Data */ #define ELM_MAPBUF_DATA_GET(o, sd) \ - Elm_Mapbuf_Smart_Data * sd = eo_data_scope_get(o, ELM_OBJ_MAPBUF_CLASS) + Elm_Mapbuf_Data * sd = eo_data_scope_get(o, ELM_OBJ_MAPBUF_CLASS) #define ELM_MAPBUF_DATA_GET_OR_RETURN(o, ptr) \ ELM_MAPBUF_DATA_GET(o, ptr); \ |