#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
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;
};
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);
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";
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)
{
}
else
edje_object_signal_emit(wd->base, "elm,state,inactive", "elm");
->>>>>>> remotes/origin/upstream
}
static void
{
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;
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;
}
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
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)
{
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");
}
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)
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;
}
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;
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;
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);
}
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);
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;
}
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");
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;
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);
}
}
_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)
{
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");
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);
}
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;i<n;i++)
- {
- indx[i] = minh;
- }
- extraIndex=n-N;
- if (extraIndex < 0)
- {
- free(indx);
- indx = NULL;
- return;
- }
-
- group_count = _group_count(obj, extraIndex, adj_pos);
- if (group_count <= 0)
- {
- if (indx)
- free(indx);
- indx = NULL;
- return;
- }
-
- PlacementPart place[adj_pos];
- remainder = extraIndex%group_count;
- numberofparts=(extraIndex/group_count)+(remainder == 0? 0: 1);
-
- for (i=0;i<numberofparts; i++)
- {
- place[i].count=group_count+1;
- count = (int)(((float)(i+1)/(float)(numberofparts+1))*N);
- place[i].start= count +i*group_count-1;
- }
- if (remainder)
- place[numberofparts-1].count=remainder+1;
-
- for (i=0;i<numberofparts;i++)
- {
- for (j=0;j<place[i].count; j++)
- {
- indx[((place[i].start)+j)]= MIN_PIXEL_VALUE;
- }
- indx[(place[i].start+(place[i].count)/2)] = minh-place[i].count+1;
- }
- count = 0;
- EINA_LIST_FOREACH(wd->items, 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)
{
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;
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
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)
{
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;
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)
{
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)
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
}
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
}
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__)
{
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);
}
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;
}
return wd->horizontal;
}
-
->>>>>>> remotes/origin/upstream
* 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()
* @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.
EAPI int elm_index_item_level_get(const Evas_Object *obj);
/**
-<<<<<<< HEAD
-=======
* Set the selected state of an item.
*
* @param it The index item
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.
*
* @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
*
* @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
*
* @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, <b>after the item
- * having @p relative as data</b>.
- *
- * @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);
/**
* @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
*
* @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, <b>after the item
- * having @p relative as data</b>.
- *
- * @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);
/**
* @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
*
* @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
*
* @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 <b>by #index item handles</b>
* @param cmp_data_func A @b fallback function to be called for the
* 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
*
* @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, <b>using item data</b>.
*
* @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.
*
* @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.
*
* @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);
/**
* @ingroup Index
*/
EAPI Eina_Bool elm_index_horizontal_get(const Evas_Object *obj);
->>>>>>> remotes/origin/upstream
/**
* @}