From: Goun Lee Date: Thu, 8 Mar 2012 10:44:30 +0000 (+0900) Subject: [index]Fixed conflicts (elm_index.c/elm_index.h) X-Git-Tag: REL_F_I9500_20120317_1~18^2~41^2~3^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af1e1480aa9bb4392a57388041c84d97f66113ec;p=framework%2Fuifw%2Felementary.git [index]Fixed conflicts (elm_index.c/elm_index.h) --- diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c index 5edfda3..da1022e 100644 --- a/src/lib/elm_index.c +++ b/src/lib/elm_index.c @@ -2,17 +2,7 @@ #include "elm_priv.h" #include "els_box.h" -<<<<<<< HEAD -#define MIN_GRP_SIZE 2 //for symmetry it is 2, otherwise it can be 1 and zero have no meaning. -#define MIN_PIXEL_VALUE 1 //Min pixel value is highly dependent on touch sensitivity support. -#define MIN_OBJ_HEIGHT 24 //should be taken from .edc file. - -typedef struct _Widget_Data Widget_Data; - -typedef struct _PlacementPart PlacementPart; -======= typedef struct _Widget_Data Widget_Data; ->>>>>>> remotes/origin/upstream typedef struct _Elm_Index_Item Elm_Index_Item; struct _Widget_Data @@ -22,25 +12,11 @@ struct _Widget_Data Evas_Object *bx[2]; // 2 - for now all that's supported Eina_List *items; // 1 list. yes N levels, but only 2 for now and # of items will be small int level; -<<<<<<< HEAD - int tot_items_count[2]; - int min_obj_height, max_grp_size; - int min_1st_level_obj_height; - int items_count; - Evas_Coord dx, dy; - Evas_Coord pwidth, pheight; - Ecore_Timer *delay; - const char *special_char; - Eina_Bool level_active[2]; - Eina_Bool horizontal : 1; - Eina_Bool active : 1; -======= Evas_Coord dx, dy; Ecore_Timer *delay; Eina_Bool level_active[2]; Eina_Bool horizontal : 1; Eina_Bool autohide_disabled : 1; ->>>>>>> remotes/origin/upstream Eina_Bool down : 1; Eina_Bool indicator_disabled : 1; }; @@ -48,26 +24,12 @@ struct _Widget_Data struct _Elm_Index_Item { ELM_WIDGET_ITEM; -<<<<<<< HEAD - const char *letter, *vis_letter; - int level, size; - Eina_Bool selected : 1; -}; - -struct _PlacementPart -{ - int start; - int count; -}; - -======= const char *letter; int level; Evas_Smart_Cb func; Eina_Bool selected : 1; }; ->>>>>>> remotes/origin/upstream static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); @@ -77,10 +39,6 @@ static void _sizing_eval(Evas_Object *obj); static void _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level); static void _index_box_clear(Evas_Object *obj, Evas_Object *box, int level); static void _item_free(Elm_Index_Item *it); -<<<<<<< HEAD -static void _index_process(Evas_Object *obj); -======= ->>>>>>> remotes/origin/upstream static const char SIG_CHANGED[] = "changed"; static const char SIG_DELAY_CHANGED[] = "delay,changed"; @@ -219,11 +177,6 @@ _theme_hook(Evas_Object *obj) edje_object_scale_set(wd->base, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); _index_box_auto_fill(obj, wd->bx[0], 0); -<<<<<<< HEAD - if (wd->active) - if (wd->level == 1) - _index_box_auto_fill(obj, wd->bx[1], 1); -======= if (wd->autohide_disabled) { @@ -232,7 +185,6 @@ _theme_hook(Evas_Object *obj) } else edje_object_signal_emit(wd->base, "elm,state,inactive", "elm"); ->>>>>>> remotes/origin/upstream } static void @@ -251,21 +203,13 @@ _item_del_pre_hook(Elm_Object_Item *it) { Widget_Data *wd = elm_widget_data_get(WIDGET(it)); if (!wd) return EINA_FALSE; -<<<<<<< HEAD - _item_free((Elm_Index_Item *) it); -======= _item_free((Elm_Index_Item *)it); ->>>>>>> remotes/origin/upstream _index_box_clear(WIDGET(it), wd->bx[wd->level], wd->level); return EINA_TRUE; } static Elm_Index_Item * -<<<<<<< HEAD -_item_new(Evas_Object *obj, const char *letter, const void *item) -======= _item_new(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data) ->>>>>>> remotes/origin/upstream { Widget_Data *wd = elm_widget_data_get(obj); Elm_Index_Item *it; @@ -273,44 +217,22 @@ _item_new(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void * it = elm_widget_item_new(obj, Elm_Index_Item); if (!it) return NULL; elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook); -<<<<<<< HEAD - it->base.data = item; - it->level = wd->level; - if(wd->level == 0) - it->size = wd->min_obj_height; - else - it->size = wd->min_1st_level_obj_height; - if(letter) - { - it->letter = eina_stringshare_add(letter); - it->vis_letter = eina_stringshare_add(letter); - } -======= if (letter) it->letter = eina_stringshare_add(letter); it->func = func; it->base.data = data; it->level = wd->level; ->>>>>>> remotes/origin/upstream return it; } static Elm_Index_Item * -<<<<<<< HEAD -_item_find(Evas_Object *obj, const void *item) -======= _item_find(Evas_Object *obj, const void *data) ->>>>>>> remotes/origin/upstream { Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; Elm_Index_Item *it; if (!wd) return NULL; EINA_LIST_FOREACH(wd->items, l, it) -<<<<<<< HEAD - if (it->base.data == item) return it; -======= if (it->base.data == data) return it; ->>>>>>> remotes/origin/upstream return NULL; } @@ -321,10 +243,6 @@ _item_free(Elm_Index_Item *it) if (!wd) return; wd->items = eina_list_remove(wd->items, it); if (it->letter) eina_stringshare_del(it->letter); -<<<<<<< HEAD - if (it->vis_letter) eina_stringshare_del(it->vis_letter); -======= ->>>>>>> remotes/origin/upstream } // FIXME: always have index filled @@ -350,12 +268,6 @@ _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level) o = edje_object_add(evas_object_evas_get(obj)); VIEW(it) = o; edje_object_mirrored_set(VIEW(it), rtl); -<<<<<<< HEAD - if (i & 0x1) - _elm_theme_object_set(obj, o, "index", "item_odd/vertical", elm_widget_style_get(obj)); - else - _elm_theme_object_set(obj, o, "index", "item/vertical", elm_widget_style_get(obj)); -======= if (wd->horizontal) { @@ -376,19 +288,11 @@ _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level) elm_widget_style_get(obj)); } ->>>>>>> remotes/origin/upstream edje_object_part_text_set(o, "elm.text", it->letter); edje_object_size_min_restricted_calc(o, &mw, &mh, 0, 0); evas_object_size_hint_min_set(o, mw, mh); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); -<<<<<<< HEAD - edje_object_part_text_set(o, "elm.text", it->vis_letter); - evas_object_size_hint_min_set(o, mw, it->size); - evas_object_size_hint_max_set(o, mw, it->size); - evas_object_resize(o, mw, it->size); -======= ->>>>>>> remotes/origin/upstream elm_widget_sub_object_add(obj, o); evas_object_box_append(box, o); stacking = edje_object_data_get(o, "stacking"); @@ -399,11 +303,6 @@ _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level) } evas_object_show(o); i++; -<<<<<<< HEAD - if(level == 1) - wd->tot_items_count[1] = i; -======= ->>>>>>> remotes/origin/upstream evas_object_smart_calculate(box); // force a calc so we know the size evas_object_size_hint_min_get(box, &mw, &mh); if (mh > h) @@ -444,11 +343,7 @@ _delay_change(void *data) Elm_Object_Item *item; if (!wd) return ECORE_CALLBACK_CANCEL; wd->delay = NULL; -<<<<<<< HEAD - item = elm_index_item_selected_get(data, wd->level); -======= item = elm_index_selected_item_get(data, wd->level); ->>>>>>> remotes/origin/upstream if (item) evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, item); return ECORE_CALLBACK_CANCEL; } @@ -461,11 +356,6 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy) Eina_List *l; Evas_Coord x, y, w, h, bx, by, bw, bh, xx, yy; double cdv = 0.5; -<<<<<<< HEAD - double dmax = 0.0; - double dmin = 0.0; -======= ->>>>>>> remotes/origin/upstream Evas_Coord dist; char *label = NULL, *last = NULL; int i; @@ -476,12 +366,6 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy) it_closest = NULL; dist = 0x7fffffff; evas_object_geometry_get(wd->bx[i], &bx, &by, &bw, &bh); -<<<<<<< HEAD - - dmin = (double)(wd->min_1st_level_obj_height*wd->tot_items_count[1])/(2*(double)bh); - dmax = 1.0-dmin-0.08; -======= ->>>>>>> remotes/origin/upstream EINA_LIST_FOREACH(wd->items, l, it) { if (!((it->level == i) && (VIEW(it)))) continue; @@ -572,10 +456,6 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy) if (!last) last = strdup(""); edje_object_part_text_set(wd->base, "elm.text.body", label); edje_object_part_text_set(wd->base, "elm.text", last); -<<<<<<< HEAD - edje_object_signal_emit(wd->base, "hide_2nd_level", ""); -======= ->>>>>>> remotes/origin/upstream free(label); free(last); } @@ -601,16 +481,12 @@ _mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *eve evas_object_geometry_get(wd->base, &x, &y, &w, NULL); wd->dx = ev->canvas.x - x; wd->dy = ev->canvas.y - y; -<<<<<<< HEAD - elm_index_active_set(data, 1); -======= if (!wd->autohide_disabled) { _index_box_clear(data, wd->bx[1], 1); _index_box_auto_fill(data, wd->bx[0], 0); edje_object_signal_emit(wd->base, "elm,state,active", "elm"); } ->>>>>>> remotes/origin/upstream _sel_eval(data, ev->canvas.x, ev->canvas.y); edje_object_part_drag_value_set(wd->base, "elm.dragable.pointer", (!edje_object_mirrored_get(wd->base)) ? wd->dx : (wd->dx - w), wd->dy); @@ -624,16 +500,6 @@ _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Up *ev = event_info; Elm_Object_Item *item; -<<<<<<< HEAD - if (!wd) return; - if (ev->button != 1) return; - if (wd->level == 1 && wd->delay) ecore_timer_del(wd->delay); - wd->delay = NULL; - wd->down = 0; - item = elm_index_item_selected_get(data, wd->level); - if (item) evas_object_smart_callback_call(data, SIG_SELECTED, item); - elm_index_active_set(data, 0); -======= Elm_Index_Item *id_item; if (!wd) return; if (ev->button != 1) return; @@ -648,7 +514,6 @@ _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event } if (!wd->autohide_disabled) edje_object_signal_emit(wd->base, "elm,state,inactive", "elm"); ->>>>>>> remotes/origin/upstream edje_object_signal_emit(wd->base, "elm,state,level,0", "elm"); if (wd->items && !wd->indicator_disabled) edje_object_signal_emit(wd->base, "elm,indicator,state,inactive", "elm"); @@ -660,10 +525,6 @@ _mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *eve Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Move *ev = event_info; Evas_Coord minw = 0, minh = 0, x, y, dx, adx, w; -<<<<<<< HEAD - Elm_Object_Item *item; -======= ->>>>>>> remotes/origin/upstream char buf[1024]; if (!wd) return; if (!wd->down) return; @@ -695,13 +556,6 @@ _mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *eve wd->level = 0; snprintf(buf, sizeof(buf), "elm,state,level,%i", wd->level); edje_object_signal_emit(wd->base, buf, "elm"); -<<<<<<< HEAD - item = elm_index_item_selected_get(data, wd->level); - evas_object_smart_callback_call(data, SIG_CHANGED, NULL); - if (wd->delay) ecore_timer_del(wd->delay); - wd->delay = ecore_timer_add(0.2, _delay_change, data); -======= ->>>>>>> remotes/origin/upstream evas_object_smart_callback_call(data, SIG_LEVEL_DOWN, NULL); } } @@ -709,49 +563,6 @@ _mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *eve _sel_eval(data, ev->cur.canvas.x, ev->cur.canvas.y); } -<<<<<<< HEAD -static void -_index_box_refill_job(void *data) -{ - Widget_Data *wd = elm_widget_data_get((Evas_Object *)data); - if (!wd) return; - - const char *string; - Evas_Coord pw, ph; - - evas_object_geometry_get(wd->base, NULL, NULL, &pw, &ph); - string = edje_object_data_get(wd->base, "min_obj_height"); - wd->min_obj_height = MIN_OBJ_HEIGHT; - - wd->max_grp_size = wd->min_obj_height - 2*MIN_GRP_SIZE; - wd->items_count = ph/wd->min_obj_height; - - if(pw != wd->pwidth && ph != wd->pheight) - { - if(wd->down == 1) - { - wd->active = 0; - elm_index_active_set(data, 1); - } - _index_box_clear((Evas_Object *)data, wd->bx[0], 0); - evas_object_smart_calculate( wd->bx[0]); - elm_index_item_go((Evas_Object *)data, wd->level); - wd->pwidth = pw; - wd->pheight = ph; - } -} - -static void _index_object_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Widget_Data *wd; - if(!data) return; - wd = elm_widget_data_get((Evas_Object *)data); - if(!wd) return; - ecore_job_add(_index_box_refill_job, (Evas_Object *)data); -} - -======= ->>>>>>> remotes/origin/upstream EAPI Evas_Object * elm_index_add(Evas_Object *parent) { @@ -777,17 +588,7 @@ elm_index_add(Evas_Object *parent) wd->indicator_disabled = EINA_FALSE; wd->horizontal = EINA_FALSE; -<<<<<<< HEAD - wd->min_obj_height = 0; - wd->max_grp_size = 0; - wd->items_count = 0; - wd->tot_items_count[0] = 0; - wd->tot_items_count[1] = 0; - wd->special_char = edje_object_data_get(wd->base, "special_char"); - if(!wd->special_char) wd->special_char = eina_stringshare_add("*"); -======= wd->autohide_disabled = EINA_FALSE; ->>>>>>> remotes/origin/upstream wd->base = edje_object_add(e); _elm_theme_object_set(obj, wd->base, "index", "base/vertical", "default"); @@ -801,10 +602,6 @@ elm_index_add(Evas_Object *parent) evas_object_size_hint_min_set(o, minw, minh); edje_object_part_swallow(wd->base, "elm.swallow.event.0", o); elm_widget_sub_object_add(obj, o); -<<<<<<< HEAD - evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _index_object_resize, obj); -======= ->>>>>>> remotes/origin/upstream evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, _wheel, obj); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, obj); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); @@ -836,143 +633,12 @@ elm_index_add(Evas_Object *parent) } evas_object_smart_callbacks_descriptions_set(obj, _signals); -<<<<<<< HEAD - wd->min_1st_level_obj_height = MIN_OBJ_HEIGHT; -======= ->>>>>>> remotes/origin/upstream _mirrored_set(obj, elm_widget_mirrored_get(obj)); _sizing_eval(obj); return obj; } -<<<<<<< HEAD -static int -_group_count(Evas_Object *obj, int extraIndex, int adj_pos) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return 0; - int group_count = MIN_GRP_SIZE; - while(group_count <= wd->max_grp_size) - { - if(extraIndex <= wd->max_grp_size*adj_pos) - { - if(group_count*adj_pos>=extraIndex) return group_count; - } - else - return wd->max_grp_size; - - group_count += MIN_GRP_SIZE; - } - return group_count; -} - -static void -_index_process(Evas_Object *obj) -{ - int extraIndex; - int j,i, group_count; - Eina_List *l; - Elm_Index_Item *it; - int count; - int n; - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - if (wd->items_count == 0) return; - - const int adj_pos = (wd->items_count-1)*0.5; - n = wd->tot_items_count[wd->level]; - group_count = MIN_GRP_SIZE; - - int *indx = (int*)calloc(n, sizeof(int)); - if (!indx) return; - - const int minh = wd->min_obj_height; - EINA_LIST_FOREACH(wd->items, l, it) - { - it->vis_letter = eina_stringshare_add(it->letter); - it->size = minh; - } - int remainder; - int numberofparts; - int N = wd->items_count; - - for (i=0;iitems, l, it) - { - int size = indx[count]; - count++; - if (size == minh) - { - it->vis_letter = eina_stringshare_add(it->letter); - continue; - } - else if (size == 1) - { - eina_stringshare_del(it->vis_letter); - it->vis_letter = eina_stringshare_add(""); - } - else - { - eina_stringshare_del(it->vis_letter); - it->vis_letter = eina_stringshare_add(wd->special_char); - } - it->size = size; - } - if (indx) - { - free(indx); - indx = NULL; - } -} - -EAPI void -elm_index_active_set(Evas_Object *obj, Eina_Bool active) -======= EINA_DEPRECATED EAPI void elm_index_active_set(Evas_Object *obj, Eina_Bool active) { @@ -987,20 +653,10 @@ elm_index_active_get(const Evas_Object *obj) EAPI void elm_index_autohide_disabled_set(Evas_Object *obj, Eina_Bool disabled) ->>>>>>> remotes/origin/upstream { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; -<<<<<<< HEAD - if (wd->active == active) return; - wd->active = active; - wd->level = 0; - if (wd->active) - { - _index_box_clear(obj, wd->bx[1], 1); - _index_process(obj); -======= disabled = !!disabled; if (wd->autohide_disabled == disabled) return; wd->autohide_disabled = disabled; @@ -1008,34 +664,22 @@ elm_index_autohide_disabled_set(Evas_Object *obj, Eina_Bool disabled) if (wd->autohide_disabled) { _index_box_clear(obj, wd->bx[1], 1); ->>>>>>> remotes/origin/upstream _index_box_auto_fill(obj, wd->bx[0], 0); edje_object_signal_emit(wd->base, "elm,state,active", "elm"); } else edje_object_signal_emit(wd->base, "elm,state,inactive", "elm"); -<<<<<<< HEAD -} - -EAPI Eina_Bool -elm_index_active_get(const Evas_Object *obj) -======= //FIXME: Should be update indicator based on the indicator visiblility } EAPI Eina_Bool elm_index_autohide_disabled_get(const Evas_Object *obj) ->>>>>>> remotes/origin/upstream { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; -<<<<<<< HEAD - return wd->active; -======= return wd->autohide_disabled; ->>>>>>> remotes/origin/upstream } EAPI void @@ -1057,11 +701,6 @@ elm_index_item_level_get(const Evas_Object *obj) return wd->level; } -<<<<<<< HEAD -EAPI Elm_Object_Item * -elm_index_item_selected_get(const Evas_Object *obj, int level) -{ -======= EAPI void elm_index_item_selected_set(Elm_Object_Item *it, Eina_Bool selected) { @@ -1091,7 +730,6 @@ elm_index_item_selected_get(const Evas_Object *obj, int level) EAPI Elm_Object_Item * elm_index_selected_item_get(const Evas_Object *obj, int level) { ->>>>>>> remotes/origin/upstream ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; @@ -1100,90 +738,11 @@ elm_index_selected_item_get(const Evas_Object *obj, int level) EINA_LIST_FOREACH(wd->items, l, it) { if ((it->selected) && (it->level == level)) -<<<<<<< HEAD - return (Elm_Object_Item *) it; -======= return (Elm_Object_Item *)it; ->>>>>>> remotes/origin/upstream } return NULL; } -<<<<<<< HEAD -EAPI void -elm_index_item_append(Evas_Object *obj, const char *letter, const void *item) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Elm_Index_Item *it; - if (!wd) return; - it = _item_new(obj, letter, item); - if (!it) return; - wd->items = eina_list_append(wd->items, it); - wd->tot_items_count[wd->level]++; - _index_box_clear(obj, wd->bx[wd->level], wd->level); -} - -EAPI void -elm_index_item_prepend(Evas_Object *obj, const char *letter, const void *item) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Elm_Index_Item *it; - - if (!wd) return; - it = _item_new(obj, letter, item); - if (!it) return; - wd->items = eina_list_prepend(wd->items, it); - wd->tot_items_count[wd->level]++; - _index_box_clear(obj, wd->bx[wd->level], wd->level); -} - -EAPI void -elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Elm_Index_Item *it; - if (!wd) return; - if (!relative) - { - elm_index_item_append(obj, letter, item); - wd->tot_items_count[wd->level]++; - return; - } - it = _item_new(obj, letter, item); - if (!it) return; - wd->items = eina_list_append_relative(wd->items, it, relative); - wd->tot_items_count[wd->level]++; - _index_box_clear(obj, wd->bx[wd->level], wd->level); -} - -EAPI void -elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Elm_Index_Item *it; - if (!wd) return; - if (!relative) - { - elm_index_item_prepend(obj, letter, item); - wd->tot_items_count[wd->level]++; - return; - } - it = _item_new(obj, letter, item); - if (!it) return; - wd->items = eina_list_prepend_relative(wd->items, it, relative); - wd->tot_items_count[wd->level]++; - _index_box_clear(obj, wd->bx[wd->level], wd->level); -} - -EAPI void -elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, const void *item, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func) -{ - ELM_CHECK_WIDTYPE(obj, widtype); -======= EAPI Elm_Object_Item * elm_index_item_append(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data) { @@ -1259,30 +818,17 @@ EAPI Elm_Object_Item * elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; ->>>>>>> remotes/origin/upstream Widget_Data *wd = elm_widget_data_get(obj); Eina_List *lnear; Elm_Index_Item *it; int cmp; -<<<<<<< HEAD - if (!wd) return; - if (!(wd->items)) - { - elm_index_item_append(obj, letter, item); - return; - } - - it = _item_new(obj, letter, item); - if (!it) return; -======= if (!wd) return NULL; if (!(wd->items)) return elm_index_item_append(obj, letter, func, data); it = _item_new(obj, letter, func, data); if (!it) return NULL; ->>>>>>> remotes/origin/upstream lnear = eina_list_search_sorted_near_list(wd->items, cmp_func, it, &cmp); if (cmp < 0) @@ -1303,13 +849,8 @@ elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, Evas_Smart_Cb elm_widget_item_free(it); } } -<<<<<<< HEAD - - _index_box_clear(obj, wd->bx[wd->level], wd->level); -======= _index_box_clear(obj, wd->bx[wd->level], wd->level); return (Elm_Object_Item *)it; ->>>>>>> remotes/origin/upstream } EAPI void @@ -1319,20 +860,12 @@ elm_index_item_del(Evas_Object *obj __UNUSED__, Elm_Object_Item *it) } EAPI Elm_Object_Item * -<<<<<<< HEAD -elm_index_item_find(Evas_Object *obj, const void *item) -======= elm_index_item_find(Evas_Object *obj, const void *data) ->>>>>>> remotes/origin/upstream { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; -<<<<<<< HEAD - return (Elm_Object_Item *) _item_find(obj, item); -======= return (Elm_Object_Item *) _item_find(obj, data); ->>>>>>> remotes/origin/upstream } EAPI void @@ -1351,19 +884,11 @@ elm_index_item_clear(Evas_Object *obj) } EINA_LIST_FREE(clear, it) { -<<<<<<< HEAD - wd->tot_items_count[wd->level]--; -======= ->>>>>>> remotes/origin/upstream _item_free(it); elm_widget_item_free(it); } } -<<<<<<< HEAD -EAPI void -elm_index_item_go(Evas_Object *obj, int level) -======= EINA_DEPRECATED EAPI void elm_index_item_go(Evas_Object *obj, int level __UNUSED__) { @@ -1372,15 +897,10 @@ elm_index_item_go(Evas_Object *obj, int level __UNUSED__) EAPI void elm_index_level_go(Evas_Object *obj, int level __UNUSED__) ->>>>>>> remotes/origin/upstream { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; -<<<<<<< HEAD - if(level == 0) _index_process(obj); -======= ->>>>>>> remotes/origin/upstream _index_box_auto_fill(obj, wd->bx[0], 0); if (wd->level == 1) _index_box_auto_fill(obj, wd->bx[1], 1); } @@ -1434,11 +954,6 @@ EAPI const char * elm_index_item_letter_get(const Elm_Object_Item *it) { ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL); -<<<<<<< HEAD - return ((Elm_Index_Item *) it)->letter; -} - -======= return ((Elm_Index_Item *)it)->letter; } @@ -1464,5 +979,3 @@ elm_index_horizontal_get(const Evas_Object *obj) return wd->horizontal; } - ->>>>>>> remotes/origin/upstream diff --git a/src/lib/elm_index.h b/src/lib/elm_index.h index a5d8386..f9f5253 100644 --- a/src/lib/elm_index.h +++ b/src/lib/elm_index.h @@ -66,15 +66,6 @@ EAPI Evas_Object *elm_index_add(Evas_Object *parent); * Enable or disable auto hiding feature for a given index widget. * * @param obj The index object -<<<<<<< HEAD - * @param active @c EINA_TRUE to enable auto hiding, @c EINA_FALSE to disable - * - * @see elm_index_active_get() - * - * @ingroup Index - */ -EAPI void elm_index_active_set(Evas_Object *obj, Eina_Bool active); -======= * @param disabled @c EINA_TRUE to disable auto hiding, @c EINA_FALSE to enable * * @see elm_index_autohide_disabled_get() @@ -82,27 +73,18 @@ EAPI void elm_index_active_set(Evas_Object *obj, Eina_Bool acti * @ingroup Index */ EAPI void elm_index_autohide_disabled_set(Evas_Object *obj, Eina_Bool disabled); ->>>>>>> remotes/origin/upstream /** * Get whether auto hiding feature is enabled or not for a given index widget. * * @param obj The index object -<<<<<<< HEAD - * @return @c EINA_TRUE, if auto hiding is enabled, @c EINA_FALSE otherwise -======= * @return @c EINA_TRUE, if auto hiding is disabled, @c EINA_FALSE otherwise ->>>>>>> remotes/origin/upstream * * @see elm_index_active_set() for more details * * @ingroup Index */ -<<<<<<< HEAD -EAPI Eina_Bool elm_index_active_get(const Evas_Object *obj); -======= EAPI Eina_Bool elm_index_autohide_disabled_get(const Evas_Object *obj); ->>>>>>> remotes/origin/upstream /** * Set the items level for a given index widget. @@ -129,8 +111,6 @@ EAPI void elm_index_item_level_set(Evas_Object *obj, int level) EAPI int elm_index_item_level_get(const Evas_Object *obj); /** -<<<<<<< HEAD -======= * Set the selected state of an item. * * @param it The index item @@ -153,7 +133,6 @@ EAPI int elm_index_item_level_get(const Evas_Object *obj); EAPI void elm_index_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); /** ->>>>>>> remotes/origin/upstream * Returns the last selected item, for a given index widget. * * @param obj The index object. @@ -161,24 +140,16 @@ EAPI void elm_index_item_selected_set(Elm_Object_Item *it, Eina * * @ingroup Index */ -<<<<<<< HEAD -EAPI Elm_Object_Item *elm_index_item_selected_get(const Evas_Object *obj, int level); -======= EAPI Elm_Object_Item *elm_index_selected_item_get(const Evas_Object *obj, int level); ->>>>>>> remotes/origin/upstream /** * Append a new item on a given index widget. * * @param obj The index object. * @param letter Letter under which the item should be indexed -<<<<<<< HEAD - * @param item The item data to set for the index's item -======= * @param func The function to call when the item is selected. * @param data The item data to set for the index's item * @return A handle to the item added or @c NULL, on errors ->>>>>>> remotes/origin/upstream * * Despite the most common usage of the @p letter argument is for * single char strings, one could use arbitrary strings as index @@ -189,24 +160,16 @@ EAPI Elm_Object_Item *elm_index_selected_item_get(const Evas_Object *obj, i * * @ingroup Index */ -<<<<<<< HEAD -EAPI void elm_index_item_append(Evas_Object *obj, const char *letter, const void *item); -======= EAPI Elm_Object_Item *elm_index_item_append(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data); ->>>>>>> remotes/origin/upstream /** * Prepend a new item on a given index widget. * * @param obj The index object. * @param letter Letter under which the item should be indexed -<<<<<<< HEAD - * @param item The item data to set for the index's item -======= * @param func The function to call when the item is selected. * @param data The item data to set for the index's item * @return A handle to the item added or @c NULL, on errors ->>>>>>> remotes/origin/upstream * * Despite the most common usage of the @p letter argument is for * single char strings, one could use arbitrary strings as index @@ -217,18 +180,6 @@ EAPI Elm_Object_Item *elm_index_item_append(Evas_Object *obj, const char *l * * @ingroup Index */ -<<<<<<< HEAD -EAPI void elm_index_item_prepend(Evas_Object *obj, const char *letter, const void *item); - -/** - * Append a new item, on a given index widget, after the item - * having @p relative as data. - * - * @param obj The index object. - * @param letter Letter under which the item should be indexed - * @param item The item data to set for the index's item - * @param relative The index item to be the predecessor of this new one -======= EAPI Elm_Object_Item *elm_index_item_prepend(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data); /** @@ -240,7 +191,6 @@ EAPI Elm_Object_Item *elm_index_item_prepend(Evas_Object *obj, const char * * @param func The function to call when the item is clicked. * @param data The item data to set for the index's item * @return A handle to the item added or @c NULL, on errors ->>>>>>> remotes/origin/upstream * * Despite the most common usage of the @p letter argument is for * single char strings, one could use arbitrary strings as index @@ -254,18 +204,6 @@ EAPI Elm_Object_Item *elm_index_item_prepend(Evas_Object *obj, const char * * * @ingroup Index */ -<<<<<<< HEAD -EAPI void elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative); - -/** - * Prepend a new item, on a given index widget, after the item - * having @p relative as data. - * - * @param obj The index object. - * @param letter Letter under which the item should be indexed - * @param item The item data to set for the index's item - * @param relative The index item to be the successor of this new one -======= EAPI Elm_Object_Item *elm_index_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *letter, Evas_Smart_Cb func, const void *data); /** @@ -277,7 +215,6 @@ EAPI Elm_Object_Item *elm_index_item_insert_after(Evas_Object *obj, Elm_Obj * @param func The function to call when the item is clicked. * @param data The item data to set for the index's item * @return A handle to the item added or @c NULL, on errors ->>>>>>> remotes/origin/upstream * * Despite the most common usage of the @p letter argument is for * single char strings, one could use arbitrary strings as index @@ -291,11 +228,7 @@ EAPI Elm_Object_Item *elm_index_item_insert_after(Evas_Object *obj, Elm_Obj * * @ingroup Index */ -<<<<<<< HEAD -EAPI void elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative); -======= EAPI Elm_Object_Item *elm_index_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *letter, Evas_Smart_Cb func, const void *data); ->>>>>>> remotes/origin/upstream /** * Insert a new item into the given index widget, using @p cmp_func @@ -303,12 +236,8 @@ EAPI Elm_Object_Item *elm_index_item_insert_before(Evas_Object *obj, Elm_Ob * * @param obj The index object. * @param letter Letter under which the item should be indexed -<<<<<<< HEAD - * @param item The item data to set for the index's item -======= * @param func The function to call when the item is clicked. * @param data The item data to set for the index's item ->>>>>>> remotes/origin/upstream * @param cmp_func The comparing function to be used to sort index * items by #index item handles * @param cmp_data_func A @b fallback function to be called for the @@ -323,10 +252,7 @@ EAPI Elm_Object_Item *elm_index_item_insert_before(Evas_Object *obj, Elm_Ob * because all references to it will be lost. If this function is * not provided (@c NULL is given), index items will be @b * duplicated, if @p cmp_func returns @c 0. -<<<<<<< HEAD -======= * @return A handle to the item added or @c NULL, on errors ->>>>>>> remotes/origin/upstream * * Despite the most common usage of the @p letter argument is for * single char strings, one could use arbitrary strings as index @@ -337,30 +263,18 @@ EAPI Elm_Object_Item *elm_index_item_insert_before(Evas_Object *obj, Elm_Ob * * @ingroup Index */ -<<<<<<< HEAD -EAPI void elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, const void *item, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func); -======= EAPI Elm_Object_Item *elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func); ->>>>>>> remotes/origin/upstream /** * Find a given index widget's item, using item data. * * @param obj The index object -<<<<<<< HEAD - * @param item The item data pointed to by the desired index item -======= * @param data The item data pointed to by the desired index item ->>>>>>> remotes/origin/upstream * @return The index item handle, if found, or @c NULL otherwise * * @ingroup Index */ -<<<<<<< HEAD -EAPI Elm_Object_Item *elm_index_item_find(Evas_Object *obj, const void *item); -======= EAPI Elm_Object_Item *elm_index_item_find(Evas_Object *obj, const void *data); ->>>>>>> remotes/origin/upstream /** * Removes @b all items from a given index widget. @@ -382,11 +296,7 @@ EAPI void elm_index_item_clear(Evas_Object *obj); * * @ingroup Index */ -<<<<<<< HEAD -EAPI void elm_index_item_go(Evas_Object *obj, int level); -======= EAPI void elm_index_level_go(Evas_Object *obj, int level); ->>>>>>> remotes/origin/upstream /** * Get the letter (string) set on a given index widget item. @@ -422,11 +332,6 @@ EAPI void elm_index_indicator_disabled_set(Evas_Object *obj, Ein * * @ingroup Index */ -<<<<<<< HEAD -EAPI Eina_Bool elm_index_indicator_disabled_get(const Evas_Object *obj); - -EAPI void elm_index_button_image_invisible_set(Evas_Object *obj, Eina_Bool invisible); -======= EAPI Eina_Bool elm_index_indicator_disabled_get(const Evas_Object *obj); /** @@ -461,7 +366,6 @@ EAPI void elm_index_horizontal_set(Evas_Object *obj, Eina_B * @ingroup Index */ EAPI Eina_Bool elm_index_horizontal_get(const Evas_Object *obj); ->>>>>>> remotes/origin/upstream /** * @}