Evas_Object *part_obj EINA_UNUSED,
Elm_Object_Item *item);
static void _decorate_item_set(Elm_Gen_Item *);
-static void _internal_elm_genlist_clear(Evas_Object *obj, Eina_Bool standby);
+static void _internal_elm_genlist_clear(Evas_Object *obj);
static const Elm_Action key_actions[] = {
{"move", _key_action_move},
if (!it) return;
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if ((it->item->decorate_all_item_realized) ||
- (it->generation < sd->generation))
- return;
+ if (it->item->decorate_all_item_realized) return;
it->deco_all_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
edje_object_scale_set(it->deco_all_view, elm_widget_scale_get(WIDGET(it)) *
int tsize = 20;
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if (it->generation < sd->generation) return;
if (it->realized)
{
if (it->item->order_num_in != in)
EINA_LIST_FOREACH(itb->items, l, it)
{
sd = GL_IT(it)->wsd;
- if (it->generation < sd->generation) continue;
- else if (sd->reorder_it == it)
- continue;
+ if (sd->reorder_it == it) continue;
it->x = 0;
it->y = y;
while (eo_prev)
{
ELM_GENLIST_ITEM_DATA_GET(eo_prev, prev);
- if ((prev->generation == sd->generation) &&
- (!_is_no_select(prev)) &&
- (!elm_object_item_disabled_get(eo_prev)))
+ if ((!_is_no_select(prev)) && (!elm_object_item_disabled_get(eo_prev)))
break;
eo_prev = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev));
}
while ((eo_next))
{
ELM_GENLIST_ITEM_DATA_GET(eo_next, next);
- if ((next->generation == sd->generation) &&
- (!_is_no_select(next)) &&
- (!elm_object_item_disabled_get(eo_next)))
+ if ((_is_no_select(next)) && (!elm_object_item_disabled_get(eo_next)))
break;
eo_next = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next));
}
while (prev)
{
- if ((prev->generation == sd->generation) &&
- (!_is_no_select(prev)) &&
+ if ((!_is_no_select(prev)) &&
(!elm_object_item_disabled_get(EO_OBJ(prev))))
break;
prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
while ((next))
{
- if ((next->generation == sd->generation) &&
- (!_is_no_select(next)) &&
+ if ((!_is_no_select(next)) &&
(!elm_object_item_disabled_get(EO_OBJ(next))))
break;
next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
ELM_GENLIST_DATA_GET(obj, sd);
const char *focus_raise;
- if (it->generation < sd->generation)
- return;
-
if (_is_no_select(it) ||
(eo_it == sd->focused_item) ||
(eo_do(eo_it, elm_wdg_item_disabled_get())))
Evas_Object *obj = WIDGET(it);
ELM_GENLIST_DATA_GET(obj, sd);
- if (it->generation < sd->generation)
- return;
-
if (_is_no_select(it))
return;
return EINA_FALSE;
while ((next) &&
- (next->generation < sd->generation) &&
(!eo_do(EO_OBJ(next), elm_wdg_item_disabled_get())))
next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
}
if (_is_no_select(it) ||
(!sd->highlight) ||
- (it->generation < sd->generation) ||
(it->highlighted) || eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()) ||
(it->item->deco_it_view))
return;
{
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if ((it->generation < GL_IT(it)->wsd->generation) || (!it->highlighted))
- return;
+ if (!it->highlighted) return;
edje_object_signal_emit(VIEW(it), SIGNAL_UNSELECTED, "elm");
evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, EO_OBJ(it));
Elm_Object_Item *eo_it = EO_OBJ(it);
eo_do(eo_it, elm_wdg_item_pre_notify_del());
- it->generation = sd->generation - 1; /* This means that
- * the item is
- * deleted */
-
- if (it->walking > 0) return;
if (it->selected)
{
sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
if (it->tooltip.del_cb)
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
- sd->walking -= it->walking;
ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
if (GL_IT(it)->type == ELM_GENLIST_ITEM_GROUP)
sd->group_items = eina_list_remove(sd->group_items, it);
{
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if ((it->generation < sd->generation)) return;
it->unhighlight_cb(it); /* unhighlight the item first */
if (!it->selected) return; /* then check whether the item is selected */
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- it->walking++;
- sd->walking++;
- if (sd->focused_item != EO_OBJ(it))
- elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
- it->walking--;
- sd->walking--;
-
- if ((sd->clear_me) && (!sd->walking))
- {
- _internal_elm_genlist_clear(WIDGET(it), EINA_TRUE);
- return;
- }
-
if (sd->multi &&
((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) ||
(evas_key_modifier_is_set(ev->modifiers, "Control"))))
it->highlight_cb(it);
it->sel_cb(it);
}
+
+ if (sd->focused_item != EO_OBJ(it))
+ elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
}
static void
te = evas_object_evas_get(obj);
- if ((it->generation < sd->generation) || (!it->realized)
- || (!it->item->deco_it_view)) return;
+ if ((!it->realized) || (!it->item->deco_it_view)) return;
evas_event_freeze(te);
it->item->nocache_once = EINA_FALSE;
EINA_LIST_FOREACH(itb->items, l, it)
{
sd = GL_IT(it)->wsd;
- if (it->generation < sd->generation) continue;
show_me |= it->item->show_me;
if (!itb->realized)
{
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
Evas_Object *obj = sd->obj;
- if ((it->item->deco_it_view) || (it->generation <
- sd->generation)) return;
+ if (it->item->deco_it_view) return;
evas_event_freeze(evas_object_evas_get(obj));
it->item->deco_it_view = _view_create(it, it->itc->decorate_item_style);
elm_widget_can_focus_set(obj, EINA_TRUE);
elm_widget_on_show_region_hook_set(obj, _show_region_hook, NULL);
- priv->generation = 1;
-
if (!elm_layout_theme_set
(obj, "genlist", "base", elm_widget_style_get(obj)))
CRI("Failed to set layout!");
}
static void
-_internal_elm_genlist_clear(Evas_Object *obj,
- Eina_Bool standby)
+_internal_elm_genlist_clear(Evas_Object *obj)
{
Eina_Inlist *next, *l;
ELM_GENLIST_DATA_GET(obj, sd);
- if (!standby) sd->generation++;
-
_elm_genlist_item_unfocused(sd->focused_item);
if (sd->mode_item) sd->mode_item = NULL;
ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free);
- if (sd->walking > 0)
- {
- sd->clear_me = EINA_TRUE;
- return;
- }
-
evas_event_freeze(evas_object_evas_get(sd->obj));
for (l = sd->items, next = l ? l->next : NULL;
l;
l = next, next = next ? next->next : NULL)
{
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(l);
-
- if (it->generation < sd->generation)
- {
- Elm_Gen_Item *itn = NULL;
-
- if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next);
- if (itn) itn->walking++; /* prevent early death of subitem */
- it->del_cb(it);
- eo_del(EO_OBJ(it));
- if (itn) itn->walking--;
- }
+ eo_do(EO_OBJ(it), elm_wdg_item_del());
}
- sd->clear_me = EINA_FALSE;
sd->pan_changed = EINA_TRUE;
if (!sd->queue)
{
Elm_Object_Item *eo_it = EO_OBJ(it);
if (eo_do(eo_it, elm_wdg_item_disabled_get())) return;
-
- if (_is_no_select(it) ||
- (it->generation < sd->generation) ||
- (it->decorate_it_set))
- return;
+ if (_is_no_select(it) || (it->decorate_it_set)) return;
if (!sd->multi)
{
}
evas_object_ref(obj);
- it->walking++;
- sd->walking++;
if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it);
- if (it->generation == sd->generation)
- {
- evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, eo_it);
- elm_object_item_focus_set(eo_it, EINA_TRUE);
- _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS);
- }
+ evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, eo_it);
+ elm_object_item_focus_set(eo_it, EINA_TRUE);
+ _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS);
+
+ sd->last_selected_item = eo_it;
if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable))
{
}
}
- it->walking--;
- sd->walking--;
- if ((sd->clear_me) && (!sd->walking))
- _internal_elm_genlist_clear(WIDGET(it), EINA_TRUE);
- else
- {
- if ((!it->walking) && (it->generation < sd->generation))
- {
- it->del_cb(it);
- eo_del(eo_it);
- }
- else
- sd->last_selected_item = eo_it;
- }
-
evas_object_unref(obj);
}
Eina_List *l;
Evas_Object *obj;
- if (it->generation < GL_IT(it)->wsd->generation) return;
-
_item_unselect(it);
if (eo_it == GL_IT(it)->wsd->focused_item)
_elm_genlist_item_unfocused(eo_it);
{
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if (it->walking > 0)
+ // FIXME: relative will be better to be fixed. it is too harsh.
+ if (it->item->rel)
{
- // FIXME: relative will be better to be fixed. it is too harsh.
- if (it->item->rel)
- {
- it->item->rel->item->rel_revs =
- eina_list_remove(it->item->rel->item->rel_revs, it);
- it->item->rel = NULL;
- }
- if (it->item->rel_revs)
- {
- Elm_Gen_Item *tmp;
- EINA_LIST_FREE(it->item->rel_revs, tmp) tmp->item->rel = NULL;
- }
- elm_genlist_item_subitems_clear(eo_it);
- if (sd->show_item == it)
- sd->show_item = NULL;
+ it->item->rel->item->rel_revs =
+ eina_list_remove(it->item->rel->item->rel_revs, it);
+ it->item->rel = NULL;
+ }
+ if (it->item->rel_revs)
+ {
+ Elm_Gen_Item *tmp;
+ EINA_LIST_FREE(it->item->rel_revs, tmp) tmp->item->rel = NULL;
+ }
+ elm_genlist_item_subitems_clear(eo_it);
+ if (sd->show_item == it)
+ sd->show_item = NULL;
- _elm_genlist_item_del_not_serious(it);
- if (it->item->block)
- {
- if (it->realized) _elm_genlist_item_unrealize(it, EINA_FALSE);
- it->item->block->changed = EINA_TRUE;
- ecore_job_del(sd->calc_job);
- sd->calc_job = ecore_job_add(_calc_job, sd->obj);
- }
- if (it->parent)
- {
- it->parent->item->items =
- eina_list_remove(it->parent->item->items, eo_it);
- it->parent = NULL;
- }
- return EINA_FALSE;
+ _elm_genlist_item_del_not_serious(it);
+ if (it->item->block)
+ {
+ if (it->realized) _elm_genlist_item_unrealize(it, EINA_FALSE);
+ it->item->block->changed = EINA_TRUE;
+ ecore_job_del(sd->calc_job);
+ sd->calc_job = ecore_job_add(_calc_job, sd->obj);
+ }
+ if (it->parent)
+ {
+ it->parent->item->items =
+ eina_list_remove(it->parent->item->items, eo_it);
+ it->parent = NULL;
}
_item_del(it);
if (!eo_it) return NULL;
ELM_GENLIST_ITEM_DATA_GET(eo_it, it);
- it->generation = sd->generation;
it->itc = itc;
elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc);
EOLIAN static void
_elm_genlist_clear(Eo *obj, Elm_Genlist_Data *sd EINA_UNUSED)
{
- _internal_elm_genlist_clear(obj, EINA_FALSE);
+ _internal_elm_genlist_clear(obj);
}
EOLIAN static void
EOLIAN static Elm_Object_Item*
_elm_genlist_first_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
{
- Elm_Gen_Item *it;
-
- if (!sd->items) return NULL;
-
- it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
- while ((it) && (it->generation < sd->generation))
- it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
-
- return EO_OBJ(it);
+ return EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(sd->items));
}
EOLIAN static Elm_Object_Item*
if (!sd->items) return NULL;
it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
- while ((it) && (it->generation < sd->generation))
- it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
return EO_OBJ(it);
}
while (it)
{
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
- if ((it) && (it->generation == GL_IT(it)->wsd->generation)) break;
+ if (it) break;
}
if (it) return EO_OBJ(it);
while (it)
{
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
- if ((it) && (it->generation == GL_IT(it)->wsd->generation)) break;
+ if (it) break;
}
if (it) return EO_OBJ(it);
Eina_Bool selected)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
- ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if ((it->generation < sd->generation) ||
- eo_do(EO_OBJ(it), elm_wdg_item_disabled_get())) return;
+ if (eo_do(EO_OBJ(it), elm_wdg_item_disabled_get())) return;
selected = !!selected;
if (it->selected == selected) return;
Evas_Coord gith = 0;
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if (it->generation < sd->generation) return EINA_FALSE;
if ((sd->queue) ||
(!((sd->homogeneous) &&
(sd->mode == ELM_LIST_COMPRESS))))
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
- if (it->generation < GL_IT(it)->wsd->generation) return;
Elm_Object_Item *eo_first_item = elm_genlist_first_item_get(WIDGET(it));
ELM_GENLIST_ITEM_DATA_GET(eo_first_item, first_item);
_item_move_before(it, first_item);
_elm_genlist_item_demote(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
- if (it->generation < GL_IT(it)->wsd->generation) return;
Elm_Object_Item *eo_last_item = elm_genlist_last_item_get(WIDGET(it));
ELM_GENLIST_ITEM_DATA_GET(eo_last_item, last_item);
_item_move_after(it, last_item);
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
if (!it->item->block) return;
- if (it->generation < sd->generation) return;
it->item->mincalcd = EINA_FALSE;
it->item->updateme = EINA_TRUE;
it->item->block->updateme = EINA_TRUE;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
if (!it->item->block) return;
- if (it->generation < GL_IT(it)->wsd->generation) return;
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_TEXT))
{
EINA_SAFETY_ON_NULL_RETURN(itc);
it->itc = itc;
if (!it->item->block) return;
- if (it->generation < GL_IT(it)->wsd->generation) return;
it->item->nocache_once = EINA_TRUE;
ELM_SAFE_FREE(it->texts, elm_widget_stringlist_free);
_elm_genlist_item_item_class_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
{
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL);
- if (it->generation < GL_IT(it)->wsd->generation) return NULL;
return it->itc;
}
sd = GL_IT(it)->wsd;
if (!decorate_it_type) return;
- if ((it->generation < sd->generation) ||
- eo_do(eo_it, elm_wdg_item_disabled_get())) return;
+ if (eo_do(eo_it, elm_wdg_item_disabled_get())) return;
if (sd->decorate_all_mode) return;
if ((sd->mode_item == it) &&
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
- if (it->generation < sd->generation) return;
-
if ((mode >= ELM_OBJECT_SELECT_MODE_MAX) || (it->select_mode == mode))
return;