+#ifndef ELM_GEN_H_
+# define ELM_GEN_H_
+
#include <Elementary.h>
#include <Elementary_Cursor.h>
#include "elm_priv.h"
#define ELM_GEN_ITEM_FROM_INLIST(it) \
((it) ? EINA_INLIST_CONTAINER_GET(it, Elm_Gen_Item) : NULL)
+#define SWIPE_MOVES 12
+
typedef struct Elm_Gen_Item_Type Elm_Gen_Item_Type;
typedef struct Elm_Gen_Item_Tooltip Elm_Gen_Item_Tooltip;
typedef struct _Widget_Data Widget_Data;
Ecore_Timer *long_timer;
int relcount;
int walking;
+ int generation;
const char *mouse_cursor;
struct
Eina_Bool highlighted : 1;
Eina_Bool disabled : 1;
Eina_Bool dragging : 1;
- Eina_Bool delete_me : 1;
Eina_Bool down : 1;
Eina_Bool group : 1;
Eina_Bool reorder : 1;
Eina_Bool mode_set : 1; /* item uses style mode for highlight/select */
};
+
+typedef struct _Pan Pan;
+struct _Pan
+{
+ Evas_Object_Smart_Clipped_Data __clipped_data;
+ Widget_Data *wd;
+ Ecore_Job *resize_job;
+};
+
+struct _Widget_Data
+{
+ Eina_Inlist_Sorted_State *state;
+ Evas_Object *obj; /* the genlist object */
+ Evas_Object *scr; /* a smart scroller object which is used internally in genlist */
+ Evas_Object *pan_smart; /* "elm_genlist_pan" evas smart object. this is an extern pan of smart scroller(scr). */
+ Eina_List *selected;
+ Eina_List *group_items; /* list of groups index items */
+ Eina_Inlist *items; /* inlist of all items */
+ Elm_Gen_Item *reorder_it; /* item currently being repositioned */
+ Elm_Gen_Item *last_selected_item;
+ Pan *pan; /* pan_smart object's smart data */
+ Ecore_Job *calc_job;
+ int walking;
+ int item_width, item_height;
+ int group_item_width, group_item_height;
+ int minw, minh;
+ long count;
+ Evas_Coord pan_x, pan_y;
+ Eina_Bool reorder_mode : 1; /* a flag for reorder mode enable/disable */
+ Eina_Bool on_hold : 1;
+ Eina_Bool multi : 1; /* a flag for item multi selection */
+ Eina_Bool no_select : 1;
+ Eina_Bool wasselected : 1;
+ Eina_Bool always_select : 1;
+ Eina_Bool clear_me : 1;
+ Eina_Bool h_bounce : 1;
+ Eina_Bool v_bounce : 1;
+ Ecore_Cb del_cb, calc_cb, sizing_cb;
+ Ecore_Cb clear_cb;
+ ////////////////////////////////////
+ Eina_Inlist *blocks; /* inlist of all blocks. a block consists of a certain number of items. maximum number of items in a block is 'max_items_per_block'. */
+ Evas_Coord reorder_old_pan_y, w, h, realminw, prev_viewport_w;
+ Ecore_Job *update_job;
+ Ecore_Idle_Enterer *queue_idle_enterer;
+ Ecore_Idler *must_recalc_idler;
+ Eina_List *queue;
+ Elm_Gen_Item *show_item, *anchor_item, *mode_item, *reorder_rel, *expanded_item;
+ Eina_Inlist *item_cache; /* an inlist of edje object it cache. */
+ Evas_Coord anchor_y;
+ Evas_Coord reorder_start_y; /* reorder it's initial y coordinate in the pan. */
+ Elm_List_Mode mode;
+ Ecore_Timer *multi_timer, *scr_hold_timer;
+ Ecore_Animator *reorder_move_animator;
+ const char *mode_type;
+ const char *mode_item_style;
+ unsigned int start_time;
+ Evas_Coord prev_x, prev_y, prev_mx, prev_my;
+ Evas_Coord cur_x, cur_y, cur_mx, cur_my;
+ Eina_Bool mouse_down : 1;
+ Eina_Bool multi_down : 1;
+ Eina_Bool multi_timeout : 1;
+ Eina_Bool multitouched : 1;
+ Eina_Bool longpressed : 1;
+ Eina_Bool bring_in : 1;
+ Eina_Bool compress : 1;
+ Eina_Bool height_for_width : 1;
+ Eina_Bool homogeneous : 1;
+ Eina_Bool swipe : 1;
+ Eina_Bool reorder_pan_move : 1;
+ Eina_Bool auto_scroll_enabled : 1;
+ Eina_Bool pan_resized : 1;
+ struct
+ {
+ Evas_Coord x, y;
+ } history[SWIPE_MOVES];
+ int multi_device;
+ int item_cache_count;
+ int item_cache_max; /* maximum number of cached items */
+ int movements;
+ int max_items_per_block; /* maximum number of items per block */
+ double longpress_timeout; /* longpress timeout. this value comes from _elm_config by default. this can be changed by elm_genlist_longpress_timeout_set() */
+ int generation;
+
+ /* The stuff below directly come from gengrid without any thinking */
+ unsigned int nmax;
+ Evas_Coord reorder_item_x, reorder_item_y;
+ Evas_Coord old_pan_x, old_pan_y;
+ long items_lost;
+ double align_x, align_y;
+
+ Eina_Bool horizontal : 1;
+ Eina_Bool move_effect_enabled : 1;
+ Eina_Bool reorder_item_changed : 1;
+};
+
+Elm_Gen_Item *
+_elm_genlist_item_new(Widget_Data *wd,
+ const Elm_Gen_Item_Class *itc,
+ const void *data,
+ Elm_Gen_Item *parent,
+ Evas_Smart_Cb func,
+ const void *func_data);
+
+Evas_Object *
+_elm_genlist_item_widget_get(const Elm_Gen_Item *it);
+
+void
+_elm_genlist_page_relative_set(Evas_Object *obj,
+ double h_pagerel,
+ double v_pagerel);
+
+void
+_elm_genlist_page_relative_get(const Evas_Object *obj,
+ double *h_pagerel,
+ double *v_pagerel);
+
+void
+_elm_genlist_page_size_set(Evas_Object *obj,
+ Evas_Coord h_pagesize,
+ Evas_Coord v_pagesize);
+
+void
+_elm_genlist_current_page_get(const Evas_Object *obj,
+ int *h_pagenumber,
+ int *v_pagenumber);
+
+void
+_elm_genlist_last_page_get(const Evas_Object *obj,
+ int *h_pagenumber,
+ int *v_pagenumber);
+
+void
+_elm_genlist_page_show(const Evas_Object *obj,
+ int h_pagenumber,
+ int v_pagenumber);
+
+void
+_elm_genlist_page_bring_in(const Evas_Object *obj,
+ int h_pagenumber,
+ int v_pagenumber);
+
+void
+_elm_genlist_item_unrealize(Elm_Gen_Item *it,
+ Eina_Bool calc);
+void
+_elm_genlist_item_del_serious(Elm_Gen_Item *it);
+
+void
+_elm_genlist_item_del_notserious(Elm_Gen_Item *it);
+
+#endif
#include "elm_priv.h"
#include "els_scroller.h"
#include "elm_gen.h"
-#include "elm_genlist.h"
/* --
* TODO:
Eina_Bool moving : 1;
};
+#if 0
struct _Widget_Data
{
Eina_Inlist_Sorted_State *state;
unsigned int nmax;
long items_lost;
+ int generation;
+
Eina_Bool horizontal : 1;
Eina_Bool longpressed : 1;
Eina_Bool reorder_item_changed : 1;
Eina_Bool move_effect_enabled : 1;
};
+#endif
static const char *widtype = NULL;
static void _item_highlight(Elm_Gen_Item *it);
if (!wd->selected)
{
prev = ELM_GEN_ITEM_FROM_INLIST(wd->items->last);
- while ((prev) && (prev->delete_me))
+ while ((prev) && (prev->generation < wd->generation))
prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
elm_gengrid_item_selected_set(prev, EINA_TRUE);
elm_gengrid_item_show(prev);
if (!wd->selected)
{
next = ELM_GEN_ITEM_FROM_INLIST(wd->items);
- while ((next) && (next->delete_me))
+ while ((next) && (next->generation < wd->generation))
next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
elm_gengrid_item_selected_set(next, EINA_TRUE);
elm_gengrid_item_show(next);
if (!wd->selected)
{
prev = ELM_GEN_ITEM_FROM_INLIST(wd->items->last);
- while ((prev) && (prev->delete_me))
+ while ((prev) && (prev->generation < wd->generation))
prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
}
else prev = elm_gengrid_item_prev_get(wd->last_selected_item);
if (!wd->selected)
{
next = ELM_GEN_ITEM_FROM_INLIST(wd->items);
- while ((next) && (next->delete_me))
+ while ((next) && (next->generation < wd->generation))
next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
}
else next = elm_gengrid_item_next_get(wd->last_selected_item);
static void
_item_highlight(Elm_Gen_Item *it)
{
- if ((it->wd->no_select) || (it->delete_me) || (it->highlighted)) return;
+ if ((it->wd->no_select) || (it->generation < it->wd->generation) || (it->highlighted)) return;
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
it->highlighted = EINA_TRUE;
}
char buf[1024];
char style[1024];
- if ((it->realized) || (it->delete_me)) return;
+ if ((it->realized) || (it->generation < it->wd->generation)) return;
VIEW(it) = edje_object_add(evas_object_evas_get(WIDGET(it)));
edje_object_scale_set(VIEW(it), elm_widget_scale_get(WIDGET(it)) *
_elm_config->scale);
static void
_item_unselect(Elm_Gen_Item *it)
{
- if ((it->delete_me) || (!it->highlighted)) return;
+ if ((it->generation < it->wd->generation) || (!it->highlighted)) return;
edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
it->highlighted = EINA_FALSE;
if (it->selected)
elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
elm_widget_event_hook_set(obj, _event_hook);
+ wd->generation = 1;
wd->scr = elm_smart_scroller_add(e);
elm_smart_scroller_widget_set(wd->scr, obj);
elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base",
elm_gengrid_item_item_class_get(const Elm_Gen_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
- if (it->delete_me) return NULL;
+ if (it->generation < it->wd->generation) return NULL;
return it->itc;
}
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
EINA_SAFETY_ON_NULL_RETURN(itc);
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
it->itc = itc;
elm_gengrid_item_update(it);
}
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
if (it->disabled == disabled) return;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
it->disabled = !!disabled;
if (it->realized)
{
elm_gengrid_item_disabled_get(const Elm_Gen_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
- if (it->delete_me) return EINA_FALSE;
+ if (it->generation < it->wd->generation) return EINA_FALSE;
return it->disabled;
}
Evas_Coord minx = 0, miny = 0;
if (!wd) return;
- if ((!it) || (it->delete_me)) return;
+ if ((!it) || (it->generation < it->wd->generation)) return;
_pan_min_get(wd->pan_smart, &minx, &miny);
if (wd->horizontal)
elm_gengrid_item_bring_in(Elm_Gen_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
Evas_Coord minx = 0, miny = 0;
Widget_Data *wd = it->wd;
#include "elm_priv.h"
#include "els_scroller.h"
#include "elm_gen.h"
-#include "elm_genlist.h"
-#define SWIPE_MOVES 12
#define MAX_ITEMS_PER_BLOCK 32
#define REORDER_EFFECT_TIME 0.5
Eina_Bool move_effect_enabled : 1;
};
-struct _Widget_Data
-{
- Eina_Inlist_Sorted_State *state;
- Evas_Object *obj; /* the genlist object */
- Evas_Object *scr; /* a smart scroller object which is used internally in genlist */
- Evas_Object *pan_smart; /* "elm_genlist_pan" evas smart object. this is an extern pan of smart scroller(scr). */
- Eina_List *selected;
- Eina_List *group_items; /* list of groups index items */
- Eina_Inlist *items; /* inlist of all items */
- Elm_Gen_Item *reorder_it; /* item currently being repositioned */
- Elm_Gen_Item *last_selected_item;
- Pan *pan; /* pan_smart object's smart data */
- Ecore_Job *calc_job;
- int walking;
- int item_width, item_height;
- int group_item_width, group_item_height;
- int minw, minh;
- long count;
- Evas_Coord pan_x, pan_y;
- Eina_Bool reorder_mode : 1; /* a flag for reorder mode enable/disable */
- Eina_Bool on_hold : 1;
- Eina_Bool multi : 1; /* a flag for item multi selection */
- Eina_Bool no_select : 1;
- Eina_Bool wasselected : 1;
- Eina_Bool always_select : 1;
- Eina_Bool clear_me : 1;
- Eina_Bool h_bounce : 1;
- Eina_Bool v_bounce : 1;
- Ecore_Cb del_cb, calc_cb, sizing_cb;
- Ecore_Cb clear_cb;
- ////////////////////////////////////
- Eina_Inlist *blocks; /* inlist of all blocks. a block consists of a certain number of items. maximum number of items in a block is 'max_items_per_block'. */
- Evas_Coord reorder_old_pan_y, w, h, realminw, prev_viewport_w;
- Ecore_Job *update_job;
- Ecore_Idle_Enterer *queue_idle_enterer;
- Ecore_Idler *must_recalc_idler;
- Eina_List *queue;
- Elm_Gen_Item *show_item, *anchor_item, *mode_item, *reorder_rel, *expanded_item;
- Eina_Inlist *item_cache; /* an inlist of edje object it cache. */
- Evas_Coord anchor_y;
- Evas_Coord reorder_start_y; /* reorder it's initial y coordinate in the pan. */
- Elm_List_Mode mode;
- Ecore_Timer *multi_timer, *scr_hold_timer;
- Ecore_Animator *reorder_move_animator;
- const char *mode_type;
- const char *mode_item_style;
- unsigned int start_time;
- Evas_Coord prev_x, prev_y, prev_mx, prev_my;
- Evas_Coord cur_x, cur_y, cur_mx, cur_my;
- Eina_Bool mouse_down : 1;
- Eina_Bool multi_down : 1;
- Eina_Bool multi_timeout : 1;
- Eina_Bool multitouched : 1;
- Eina_Bool longpressed : 1;
- Eina_Bool bring_in : 1;
- Eina_Bool compress : 1;
- Eina_Bool height_for_width : 1;
- Eina_Bool homogeneous : 1;
- Eina_Bool swipe : 1;
- Eina_Bool reorder_pan_move : 1;
- Eina_Bool auto_scroll_enabled : 1;
- Eina_Bool pan_resized : 1;
- struct
- {
- Evas_Coord x, y;
- } history[SWIPE_MOVES];
- int multi_device;
- int item_cache_count;
- int item_cache_max; /* maximum number of cached items */
- int movements;
- int max_items_per_block; /* maximum number of items per block */
- double longpress_timeout; /* longpress timeout. this value comes from _elm_config by default. this can be changed by elm_genlist_longpress_timeout_set() */
-};
-
struct _Item_Block
{
EINA_INLIST;
static void _item_move_before(Elm_Gen_Item *it,
Elm_Gen_Item *before);
static void _item_auto_scroll(Widget_Data *wd);
+static void _elm_genlist_clear(Evas_Object *obj, Eina_Bool standby);
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
if (!wd->selected)
{
prev = ELM_GEN_ITEM_FROM_INLIST(wd->items->last);
- while ((prev) && (prev->delete_me))
+ while ((prev) && (prev->generation < wd->generation))
prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
}
else prev = elm_genlist_item_prev_get(wd->last_selected_item);
if (!wd->selected)
{
next = ELM_GEN_ITEM_FROM_INLIST(wd->items);
- while ((next) && (next->delete_me))
+ while ((next) && (next->generation < wd->generation))
next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
}
else next = elm_genlist_item_next_get(wd->last_selected_item);
_item_highlight(Elm_Gen_Item *it)
{
const char *selectraise;
- if ((it->wd->no_select) || (it->delete_me) || (it->highlighted) ||
+ if ((it->wd->no_select) || (it->generation < it->wd->generation) || (it->highlighted) ||
(it->disabled) || (it->display_only) || (it->item->mode_view))
return;
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
static void
_item_unhighlight(Elm_Gen_Item *it)
{
- if ((it->delete_me) || (!it->highlighted)) return;
+ if ((it->generation < it->wd->generation) || (!it->highlighted)) return;
edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
if (!it->item->nostacking)
{
static void
_item_unselect(Elm_Gen_Item *it)
{
- if ((it->delete_me) || (!it->selected)) return;
+ if ((it->generation < it->wd->generation) || (!it->selected)) return;
it->selected = EINA_FALSE;
it->wd->selected = eina_list_remove(it->wd->selected, it);
evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
if (!data) return;
if (!obj) return;
Elm_Gen_Item *it = data;
- if ((it->delete_me) || (!it->realized) || (!it->item->mode_view)) return;
+ if ((it->generation < it->wd->generation) || (!it->realized) || (!it->item->mode_view)) return;
char buf[1024];
Evas *te = evas_object_evas_get(obj);
int depth, tsize = 20;
Item_Cache *itc = NULL;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
//evas_event_freeze(evas_object_evas_get(it->wd->obj));
if (it->realized)
{
itb->num = in;
EINA_LIST_FOREACH(itb->items, l, it)
{
- if (it->delete_me) continue;
+ if (it->generation < it->wd->generation) continue;
showme |= it->item->showme;
if (!itb->realized)
{
&cvw, &cvh);
EINA_LIST_FOREACH(itb->items, l, it)
{
- if (it->delete_me) continue;
+ if (it->generation < it->wd->generation) continue;
else if (it->wd->reorder_it == it) continue;
it->x = 0;
it->y = y;
{
char buf[1024];
- if ((it->item->mode_view) || (it->delete_me)) return;
+ if ((it->item->mode_view) || (it->generation < it->wd->generation)) return;
evas_event_freeze(evas_object_evas_get(it->wd->obj));
it->item->mode_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
elm_widget_translate_hook_set(obj, _translate_hook);
+ wd->generation = 1;
wd->scr = elm_smart_scroller_add(e);
elm_smart_scroller_widget_set(wd->scr, obj);
elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base",
void
_item_select(Elm_Gen_Item *it)
{
- if ((it->wd->no_select) || (it->delete_me) || (it->mode_set)) return;
+ if ((it->wd->no_select) || (it->generation < it->wd->generation) || (it->mode_set)) return;
if (!it->selected)
{
it->selected = EINA_TRUE;
it->walking++;
it->wd->walking++;
if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), it);
- if (!it->delete_me)
+ if (it->generation == it->wd->generation)
evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it);
it->walking--;
it->wd->walking--;
evas_object_unref(WIDGET(it));
if ((it->wd->clear_me) && (!it->wd->walking))
- elm_genlist_clear(WIDGET(it));
+ _elm_genlist_clear(WIDGET(it), EINA_TRUE);
else
{
- if ((!it->walking) && (it->delete_me))
+ if ((!it->walking) && (it->generation < it->wd->generation))
{
if (!it->relcount) it->del_cb(it);
}
it = elm_widget_item_new(wd->obj, Elm_Gen_Item);
if (!it) return NULL;
it->wd = wd;
+ it->generation = wd->generation;
it->itc = itc;
it->base.data = data;
it->parent = parent;
if (it->item->rel)
{
it->item->rel->relcount--;
- if ((it->item->rel->delete_me) && (!it->item->rel->relcount))
+ if ((it->item->rel->generation < it->wd->generation) && (!it->item->rel->relcount))
_item_del(it->item->rel);
it->item->rel = NULL;
}
_elm_genlist_item_compare_data, func, func_data);
}
-EAPI void
-elm_genlist_clear(Evas_Object *obj)
+static void
+_elm_genlist_clear(Evas_Object *obj, Eina_Bool standby)
{
+ Eina_Inlist *next, *l;
+
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+ if (!standby) wd->generation++;
+
if (wd->state)
{
eina_inlist_sorted_state_free(wd->state);
if (wd->walking > 0)
{
- Elm_Gen_Item *it;
wd->clear_me = 1;
- EINA_INLIST_FOREACH(wd->items, it)
- it->delete_me = 1;
return;
}
evas_event_freeze(evas_object_evas_get(wd->obj));
- while (wd->items)
+ for (l = wd->items, next = l ? l->next : NULL;
+ l;
+ l = next, next = next ? next->next : NULL)
{
- Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items);
- it->del_cb(it);
+ Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(l);
+
+ if (it->generation < wd->generation)
+ {
+ it->del_cb(it);
+ }
}
wd->clear_me = 0;
if (wd->calc_job)
}
EAPI void
+elm_genlist_clear(Evas_Object *obj)
+{
+ _elm_genlist_clear(obj, EINA_FALSE);
+}
+
+EAPI void
elm_genlist_multi_select_set(Evas_Object *obj,
Eina_Bool multi)
{
if (!wd) return NULL;
if (!wd->items) return NULL;
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items);
- while ((it) && (it->delete_me))
+ while ((it) && (it->generation < wd->generation))
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
return it;
}
if (!wd) return NULL;
if (!wd->items) return NULL;
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items->last);
- while ((it) && (it->delete_me))
+ while ((it) && (it->generation < wd->generation))
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
return it;
}
while (it)
{
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
- if ((it) && (!it->delete_me)) break;
+ if ((it) && (it->generation == it->wd->generation)) break;
}
return (Elm_Gen_Item *)it;
}
while (it)
{
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
- if ((it) && (!it->delete_me)) break;
+ if ((it) && (it->generation == it->wd->generation)) break;
}
return (Elm_Gen_Item *)it;
}
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
Widget_Data *wd = it->wd;
if (!wd) return;
- if ((it->delete_me) || (it->disabled)) return;
+ if ((it->generation < wd->generation) || (it->disabled)) return;
selected = !!selected;
if (it->selected == selected) return;
Eina_List *l;
Evas_Object *obj;
if (it->disabled == disabled) return;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
it->disabled = !!disabled;
if (it->selected)
elm_genlist_item_selected_set(it, EINA_FALSE);
elm_genlist_item_disabled_get(const Elm_Gen_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
- if (it->delete_me) return EINA_FALSE;
+ if (it->generation < it->wd->generation) return EINA_FALSE;
return it->disabled;
}
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
if (it->display_only == display_only) return;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
it->display_only = display_only;
it->item->mincalcd = EINA_FALSE;
it->item->updateme = EINA_TRUE;
elm_genlist_item_display_only_get(const Elm_Gen_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
- if (it->delete_me) return EINA_FALSE;
+ if (it->generation < it->wd->generation) return EINA_FALSE;
return it->display_only;
}
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
Evas_Coord gith = 0;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
if ((it->item->queued) || (!it->item->mincalcd))
{
it->wd->show_item = it;
elm_genlist_item_promote(Elm_Gen_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
_item_move_before(it, elm_genlist_first_item_get(WIDGET(it)));
}
elm_genlist_item_demote(Elm_Gen_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
_item_move_after(it, elm_genlist_last_item_get(WIDGET(it)));
}
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
Evas_Coord gith = 0;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
if ((it->item->queued) || (!it->item->mincalcd))
{
it->wd->show_item = it;
Evas_Coord ow, oh;
Evas_Coord gith = 0;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
if ((it->item->queued) || (!it->item->mincalcd))
{
it->wd->show_item = it;
Evas_Coord ow, oh;
Evas_Coord gith = 0;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
if ((it->item->queued) || (!it->item->mincalcd))
{
it->wd->show_item = it;
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
Evas_Coord ow, oh;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
if ((it->item->queued) || (!it->item->mincalcd))
{
it->wd->show_item = it;
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
Evas_Coord ow, oh;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
if ((it->item->queued) || (!it->item->mincalcd))
{
it->wd->show_item = it;
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
if (!it->item->block) return;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
it->item->mincalcd = EINA_FALSE;
it->item->updateme = EINA_TRUE;
it->item->block->updateme = EINA_TRUE;
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
if (!it->item->block) return;
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_LABEL))
_item_label_realize(it, it->base.view, &it->labels, parts);
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
if (!it->item->block) return;
EINA_SAFETY_ON_NULL_RETURN(itc);
- if (it->delete_me) return;
+ if (it->generation < it->wd->generation) return;
it->itc = itc;
it->item->nocache = EINA_TRUE;
elm_genlist_item_update(it);
elm_genlist_item_item_class_get(const Elm_Gen_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
- if (it->delete_me) return NULL;
+ if (it->generation < it->wd->generation) return NULL;
return it->itc;
}
if (!wd) return;
if (!mode_type) return;
- if ((it->delete_me) || (it->disabled)) return;
+ if ((it->generation < it->wd->generation) || (it->disabled)) return;
if ((wd->mode_item == it) &&
(!strcmp(mode_type, wd->mode_type)) &&
_elm_genlist_item_del_notserious(Elm_Gen_Item *it)
{
elm_widget_item_pre_notify_del(it);
- it->delete_me = EINA_TRUE;
+ it->generation = it->wd->generation - 1; /* This means that the item is deleted */
if (it->selected) it->wd->selected = eina_list_remove(it->wd->selected, it);
if (it->itc->func.del)