}
static void
-_item_state_realize(Elm_Gen_Item *it,
- Evas_Object *target,
- Eina_List **source,
- const char *parts)
+_item_state_realize(Elm_Gen_Item *it, Evas_Object *target, const char *parts)
{
- if (it->itc->func.state_get)
- {
- const Eina_List *l;
- const char *key;
- char buf[4096];
+ Eina_List *src;
+ const char *key;
+ char buf[4096];
- if (!(*source))
- *source = elm_widget_stringlist_get
- (edje_object_data_get(target, "states"));
- EINA_LIST_FOREACH(*source, l, key)
- {
- if (parts && fnmatch(parts, key, FNM_PERIOD))
- continue;
+ if (!it->itc->func.state_get) return;
- Eina_Bool on = it->itc->func.state_get
- ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
+ src = elm_widget_stringlist_get(edje_object_data_get(target, "states"));
+ EINA_LIST_FREE(src, key)
+ {
+ if (parts && fnmatch(parts, key, FNM_PERIOD)) continue;
- if (on)
- {
- snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
- edje_object_signal_emit(target, buf, "elm");
- }
- else
- {
- snprintf(buf, sizeof(buf), "elm,state,%s,passive", key);
- edje_object_signal_emit(target, buf, "elm");
- }
+ Eina_Bool on = it->itc->func.state_get
+ ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
+
+ if (on)
+ {
+ snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
+ edje_object_signal_emit(target, buf, "elm");
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "elm,state,%s,passive", key);
+ edje_object_signal_emit(target, buf, "elm");
}
- edje_object_message_signal_process(target);
}
+ edje_object_message_signal_process(target);
}
/**
static void
_view_clear(Evas_Object *view, Eina_List **texts, Eina_List **contents,
- Eina_List **states, Eina_List **content_objs)
+ Eina_List **content_objs)
{
const char *part;
Evas_Object *c;
if (texts) ELM_SAFE_FREE(*texts, elm_widget_stringlist_free);
if (contents) ELM_SAFE_FREE(*contents, elm_widget_stringlist_free);
- if (states) ELM_SAFE_FREE(*states, elm_widget_stringlist_free);
EINA_LIST_FREE(*content_objs, c)
evas_object_del(c);
evas_object_smart_callback_call(WIDGET(it), SIG_UNREALIZED, EO_OBJ(it));
ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
- _view_clear(VIEW(it), &(it->texts), &(it->contents), &(it->states), &(it->content_objs));
+ _view_clear(VIEW(it), &(it->texts), &(it->contents), &(it->content_objs));
ELM_SAFE_FREE(it->item_focus_chain, eina_list_free);
eo_do(EO_OBJ(it), elm_wdg_item_track_cancel());
{
if (!view) return;
*contents = _item_content_realize(it, view, *contents, "contents", NULL);
+ _item_state_realize(it, view, NULL);
}
static void
edje_object_signal_emit
(it->deco_all_view, SIGNAL_FLIP_ENABLED, "elm");
_view_inflate(it->deco_all_view, it, &(GL_IT(it)->deco_all_contents));
- _item_state_realize
- (it, it->deco_all_view, &it->item->deco_all_states, NULL);
edje_object_part_swallow
(it->deco_all_view, "elm.swallow.decorate.content", VIEW(it));
if (it->has_contents != (!!it->content_objs))
it->item->mincalcd = EINA_FALSE;
it->has_contents = !!it->content_objs;
- _item_state_realize(it, VIEW(it), &it->states, NULL);
if (it->flipped)
{
edje_object_signal_emit(VIEW(it), SIGNAL_FLIP_ENABLED, "elm");
}
_view_clear(it->deco_all_view, &(GL_IT(it)->deco_all_texts), NULL,
- &(GL_IT(it)->deco_all_states), &(GL_IT(it)->deco_all_contents));
+ &(GL_IT(it)->deco_all_contents));
edje_object_signal_emit(VIEW(it), SIGNAL_DECORATE_DISABLED, "elm");
evas_event_freeze(evas_object_evas_get(obj));
- _view_clear(GL_IT(it)->deco_it_view, &(GL_IT(it)->deco_it_texts),
- NULL, &(GL_IT(it)->deco_it_states),
+ _view_clear(GL_IT(it)->deco_it_view, &(GL_IT(it)->deco_it_texts), NULL,
&(GL_IT(it)->deco_it_contents));
edje_object_part_unswallow(it->item->deco_it_view, VIEW(it));
_item_text_realize
(it, it->item->deco_it_view, &GL_IT(it)->deco_it_texts, NULL);
_view_inflate(it->item->deco_it_view, it, &GL_IT(it)->deco_it_contents);
- _item_state_realize
- (it, it->item->deco_it_view, &it->item->deco_it_states, NULL);
edje_object_part_swallow
(it->item->deco_it_view,
edje_object_data_get(it->item->deco_it_view, "mode_part"), VIEW(it));
}
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_STATE))
- _item_state_realize(it, VIEW(it), &it->states, parts);
+ _item_state_realize(it, VIEW(it), parts);
+
if (!it->item->mincalcd)
elm_genlist_item_update(eo_item);
}
ELM_SAFE_FREE(it->texts, elm_widget_stringlist_free);
ELM_SAFE_FREE(it->contents, elm_widget_stringlist_free);
- ELM_SAFE_FREE(it->states, elm_widget_stringlist_free);
if (it->item->deco_it_view)
{