forked from enlightenment/efl
add VIEW() and WIDGET() macros for use with Elm_Widget_Items to create more consistency, reduce typing, and increase readability
VIEW(X) = X->base.view (visible evas object) WIDGET(X) = X->base.widget (owner widget) also a demo of the oxford comma for seoz SVN revision: 64220
This commit is contained in:
parent
d1ff7eb555
commit
88bbad2635
|
@ -275,10 +275,10 @@ _item_sizing_eval(Elm_Ctxpopup_Item *item)
|
||||||
|
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
|
|
||||||
edje_object_size_min_restricted_calc(item->base.view, &min_w, &min_h, min_w,
|
edje_object_size_min_restricted_calc(VIEW(item), &min_w, &min_h, min_w,
|
||||||
min_h);
|
min_h);
|
||||||
evas_object_size_hint_min_set(item->base.view, min_w, min_h);
|
evas_object_size_hint_min_set(VIEW(item), min_w, min_h);
|
||||||
evas_object_size_hint_max_set(item->base.view, max_w, max_h);
|
evas_object_size_hint_max_set(VIEW(item), max_w, max_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -618,7 +618,7 @@ _sizing_eval(Evas_Object *obj)
|
||||||
EINA_LIST_FOREACH(wd->items, elist, item)
|
EINA_LIST_FOREACH(wd->items, elist, item)
|
||||||
{
|
{
|
||||||
_item_sizing_eval(item);
|
_item_sizing_eval(item);
|
||||||
evas_object_size_hint_min_get(item->base.view, &_box_size.x, &_box_size.y);
|
evas_object_size_hint_min_get(VIEW(item), &_box_size.x, &_box_size.y);
|
||||||
if (!wd->horizontal)
|
if (!wd->horizontal)
|
||||||
{
|
{
|
||||||
if (_box_size.x > box_size.x)
|
if (_box_size.x > box_size.x)
|
||||||
|
@ -721,22 +721,22 @@ _theme_hook(Evas_Object *obj)
|
||||||
EINA_LIST_FOREACH(wd->items, elist, item)
|
EINA_LIST_FOREACH(wd->items, elist, item)
|
||||||
{
|
{
|
||||||
if (item->label && item->icon)
|
if (item->label && item->icon)
|
||||||
_elm_theme_object_set(obj, item->base.view, "ctxpopup",
|
_elm_theme_object_set(obj, VIEW(item), "ctxpopup",
|
||||||
"icon_text_style_item",
|
"icon_text_style_item",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
else if (item->label)
|
else if (item->label)
|
||||||
_elm_theme_object_set(obj, item->base.view, "ctxpopup", "text_style_item",
|
_elm_theme_object_set(obj, VIEW(item), "ctxpopup", "text_style_item",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
else if (item->icon)
|
else if (item->icon)
|
||||||
_elm_theme_object_set(obj, item->base.view, "ctxpopup", "icon_style_item",
|
_elm_theme_object_set(obj, VIEW(item), "ctxpopup", "icon_style_item",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
if (item->label)
|
if (item->label)
|
||||||
edje_object_part_text_set(item->base.view, "elm.text", item->label);
|
edje_object_part_text_set(VIEW(item), "elm.text", item->label);
|
||||||
|
|
||||||
if (item->disabled)
|
if (item->disabled)
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm");
|
||||||
|
|
||||||
edje_object_message_signal_process(item->base.view);
|
edje_object_message_signal_process(VIEW(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
_elm_theme_object_set(obj, wd->bg, "ctxpopup", "bg",
|
_elm_theme_object_set(obj, wd->bg, "ctxpopup", "bg",
|
||||||
|
@ -943,7 +943,7 @@ _item_select_cb(void *data, Evas_Object *obj __UNUSED__,
|
||||||
if (item->disabled) return;
|
if (item->disabled) return;
|
||||||
|
|
||||||
if (item->func)
|
if (item->func)
|
||||||
item->func((void*) item->base.data, item->base.widget, data);
|
item->func((void*) item->base.data, WIDGET(item), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -955,8 +955,8 @@ _item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon)
|
||||||
item->icon = icon;
|
item->icon = icon;
|
||||||
if (!icon) return;
|
if (!icon) return;
|
||||||
|
|
||||||
edje_object_part_swallow(item->base.view, "elm.swallow.icon", item->icon);
|
edje_object_part_swallow(VIEW(item), "elm.swallow.icon", item->icon);
|
||||||
edje_object_message_signal_process(item->base.view);
|
edje_object_message_signal_process(VIEW(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -965,8 +965,8 @@ _item_label_set(Elm_Ctxpopup_Item *item, const char *label)
|
||||||
if (!eina_stringshare_replace(&item->label, label))
|
if (!eina_stringshare_replace(&item->label, label))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
edje_object_part_text_set(item->base.view, "elm.text", label);
|
edje_object_part_text_set(VIEW(item), "elm.text", label);
|
||||||
edje_object_message_signal_process(item->base.view);
|
edje_object_message_signal_process(VIEW(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -974,16 +974,16 @@ _item_new(Elm_Ctxpopup_Item *item, char *group_name)
|
||||||
{
|
{
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
item->base.view = edje_object_add(evas_object_evas_get(wd->base));
|
VIEW(item) = edje_object_add(evas_object_evas_get(wd->base));
|
||||||
_elm_theme_object_set(item->base.widget, item->base.view, "ctxpopup", group_name,
|
_elm_theme_object_set(WIDGET(item), VIEW(item), "ctxpopup", group_name,
|
||||||
elm_widget_style_get(item->base.widget));
|
elm_widget_style_get(WIDGET(item)));
|
||||||
edje_object_signal_callback_add(item->base.view, "elm,action,click", "",
|
edje_object_signal_callback_add(VIEW(item), "elm,action,click", "",
|
||||||
_item_select_cb, item);
|
_item_select_cb, item);
|
||||||
evas_object_size_hint_align_set(item->base.view, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
evas_object_show(item->base.view);
|
evas_object_show(VIEW(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1131,7 +1131,7 @@ elm_ctxpopup_item_icon_set(Elm_Object_Item *it, Evas_Object *icon)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *) it;
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *) it;
|
||||||
|
|
||||||
wd = elm_widget_data_get(ctxpopup_it->base.widget);
|
wd = elm_widget_data_get(WIDGET(ctxpopup_it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
_item_icon_set(ctxpopup_it, icon);
|
_item_icon_set(ctxpopup_it, icon);
|
||||||
|
@ -1140,7 +1140,7 @@ elm_ctxpopup_item_icon_set(Elm_Object_Item *it, Evas_Object *icon)
|
||||||
if (wd->visible)
|
if (wd->visible)
|
||||||
{
|
{
|
||||||
_scroller_size_reset(wd);
|
_scroller_size_reset(wd);
|
||||||
_sizing_eval(ctxpopup_it->base.widget);
|
_sizing_eval(WIDGET(ctxpopup_it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1160,7 +1160,7 @@ elm_ctxpopup_item_label_set(Elm_Object_Item *it, const char *label)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *) it;
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *) it;
|
||||||
|
|
||||||
wd = elm_widget_data_get(ctxpopup_it->base.widget);
|
wd = elm_widget_data_get(WIDGET(ctxpopup_it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
_item_label_set(ctxpopup_it, label);
|
_item_label_set(ctxpopup_it, label);
|
||||||
|
@ -1169,7 +1169,7 @@ elm_ctxpopup_item_label_set(Elm_Object_Item *it, const char *label)
|
||||||
if (wd->visible)
|
if (wd->visible)
|
||||||
{
|
{
|
||||||
_scroller_size_reset(wd);
|
_scroller_size_reset(wd);
|
||||||
_sizing_eval(ctxpopup_it->base.widget);
|
_sizing_eval(WIDGET(ctxpopup_it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1320,7 +1320,7 @@ elm_ctxpopup_item_append(Evas_Object *obj, const char *label,
|
||||||
|
|
||||||
_item_icon_set(item, icon);
|
_item_icon_set(item, icon);
|
||||||
_item_label_set(item, label);
|
_item_label_set(item, label);
|
||||||
elm_box_pack_end(wd->box, item->base.view);
|
elm_box_pack_end(wd->box, VIEW(item));
|
||||||
wd->items = eina_list_append(wd->items, item);
|
wd->items = eina_list_append(wd->items, item);
|
||||||
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
||||||
|
|
||||||
|
@ -1341,13 +1341,13 @@ elm_ctxpopup_item_del(Elm_Object_Item *it)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *) it;
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *) it;
|
||||||
|
|
||||||
wd = elm_widget_data_get(ctxpopup_it->base.widget);
|
wd = elm_widget_data_get(WIDGET(ctxpopup_it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if (ctxpopup_it->icon)
|
if (ctxpopup_it->icon)
|
||||||
evas_object_del(ctxpopup_it->icon);
|
evas_object_del(ctxpopup_it->icon);
|
||||||
if (ctxpopup_it->base.view)
|
if (VIEW(ctxpopup_it))
|
||||||
evas_object_del(ctxpopup_it->base.view);
|
evas_object_del(VIEW(ctxpopup_it));
|
||||||
|
|
||||||
eina_stringshare_del(ctxpopup_it->label);
|
eina_stringshare_del(ctxpopup_it->label);
|
||||||
|
|
||||||
|
@ -1359,12 +1359,12 @@ elm_ctxpopup_item_del(Elm_Object_Item *it)
|
||||||
|
|
||||||
if (eina_list_count(wd->items) < 1)
|
if (eina_list_count(wd->items) < 1)
|
||||||
{
|
{
|
||||||
evas_object_hide(ctxpopup_it->base.widget);
|
evas_object_hide(WIDGET(ctxpopup_it));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wd->visible)
|
if (wd->visible)
|
||||||
_sizing_eval(ctxpopup_it->base.widget);
|
_sizing_eval(WIDGET(ctxpopup_it));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1376,16 +1376,16 @@ elm_ctxpopup_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *) it;
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *) it;
|
||||||
|
|
||||||
wd = elm_widget_data_get(ctxpopup_it->base.widget);
|
wd = elm_widget_data_get(WIDGET(ctxpopup_it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if (disabled == ctxpopup_it->disabled)
|
if (disabled == ctxpopup_it->disabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (disabled)
|
if (disabled)
|
||||||
edje_object_signal_emit(ctxpopup_it->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(ctxpopup_it), "elm,state,disabled", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(ctxpopup_it->base.view, "elm,state,enabled", "elm");
|
edje_object_signal_emit(VIEW(ctxpopup_it), "elm,state,enabled", "elm");
|
||||||
|
|
||||||
ctxpopup_it->disabled = !!disabled;
|
ctxpopup_it->disabled = !!disabled;
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ static void
|
||||||
_item_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
_item_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||||
{
|
{
|
||||||
Elm_Hoversel_Item *item = data;
|
Elm_Hoversel_Item *item = data;
|
||||||
Evas_Object *obj2 = item->base.widget;
|
Evas_Object *obj2 = WIDGET(item);
|
||||||
|
|
||||||
elm_hoversel_hover_end(obj2);
|
elm_hoversel_hover_end(obj2);
|
||||||
if (item->func) item->func((void *)item->base.data, obj2, item);
|
if (item->func) item->func((void *)item->base.data, obj2, item);
|
||||||
|
@ -466,9 +466,9 @@ EAPI void
|
||||||
elm_hoversel_item_del(Elm_Hoversel_Item *item)
|
elm_hoversel_item_del(Elm_Hoversel_Item *item)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
elm_hoversel_hover_end(item->base.widget);
|
elm_hoversel_hover_end(WIDGET(item));
|
||||||
wd->items = eina_list_remove(wd->items, item);
|
wd->items = eina_list_remove(wd->items, item);
|
||||||
elm_widget_item_pre_notify_del(item);
|
elm_widget_item_pre_notify_del(item);
|
||||||
eina_stringshare_del(item->label);
|
eina_stringshare_del(item->label);
|
||||||
|
|
|
@ -208,7 +208,7 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
EINA_INLIST_FOREACH(wd->stack, it)
|
EINA_INLIST_FOREACH(wd->stack, it)
|
||||||
edje_object_mirrored_set(it->base.view, rtl);
|
edje_object_mirrored_set(VIEW(it), rtl);
|
||||||
edje_object_mirrored_set(wd->base, rtl);
|
edje_object_mirrored_set(wd->base, rtl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ _item_text_set_hook(Elm_Object_Item *it,
|
||||||
if (!pair)
|
if (!pair)
|
||||||
{
|
{
|
||||||
ERR("Failed to allocate new text part of the item! : naviframe=%p",
|
ERR("Failed to allocate new text part of the item! : naviframe=%p",
|
||||||
navi_it->base.widget);
|
WIDGET(navi_it));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eina_stringshare_replace(&pair->part, buf);
|
eina_stringshare_replace(&pair->part, buf);
|
||||||
|
@ -246,17 +246,17 @@ _item_text_set_hook(Elm_Object_Item *it,
|
||||||
}
|
}
|
||||||
|
|
||||||
eina_stringshare_replace(&pair->text, label);
|
eina_stringshare_replace(&pair->text, label);
|
||||||
edje_object_part_text_set(navi_it->base.view, buf, label);
|
edje_object_part_text_set(VIEW(navi_it), buf, label);
|
||||||
|
|
||||||
if (label)
|
if (label)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "elm,state,%s,show", buf);
|
snprintf(buf, sizeof(buf), "elm,state,%s,show", buf);
|
||||||
edje_object_signal_emit(navi_it->base.view, buf, "elm");
|
edje_object_signal_emit(VIEW(navi_it), buf, "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "elm,state,%s,hide", buf);
|
snprintf(buf, sizeof(buf), "elm,state,%s,hide", buf);
|
||||||
edje_object_signal_emit(navi_it->base.view, buf, "elm");
|
edje_object_signal_emit(VIEW(navi_it), buf, "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
_item_sizing_eval(navi_it);
|
_item_sizing_eval(navi_it);
|
||||||
|
@ -355,7 +355,7 @@ _item_content_unset_hook(Elm_Object_Item *it, const char *part)
|
||||||
!strcmp(part, "elm.swallow.next_btn"))
|
!strcmp(part, "elm.swallow.next_btn"))
|
||||||
{
|
{
|
||||||
WRN("You can not unset the content! : naviframe=%p",
|
WRN("You can not unset the content! : naviframe=%p",
|
||||||
navi_it->base.widget);
|
WIDGET(navi_it));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,10 +375,10 @@ _item_content_unset_hook(Elm_Object_Item *it, const char *part)
|
||||||
|
|
||||||
if (!content) return NULL;
|
if (!content) return NULL;
|
||||||
|
|
||||||
elm_widget_sub_object_del(navi_it->base.widget, content);
|
elm_widget_sub_object_del(WIDGET(navi_it), content);
|
||||||
edje_object_part_unswallow(navi_it->base.view, content);
|
edje_object_part_unswallow(VIEW(navi_it), content);
|
||||||
snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
|
snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
|
||||||
edje_object_signal_emit(navi_it->base.view, buf, "elm");
|
edje_object_signal_emit(VIEW(navi_it), buf, "elm");
|
||||||
evas_object_event_callback_del(content,
|
evas_object_event_callback_del(content,
|
||||||
EVAS_CALLBACK_DEL,
|
EVAS_CALLBACK_DEL,
|
||||||
_title_content_del);
|
_title_content_del);
|
||||||
|
@ -394,16 +394,16 @@ _item_signal_emit_hook(Elm_Object_Item *it,
|
||||||
{
|
{
|
||||||
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
||||||
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
||||||
edje_object_signal_emit(navi_it->base.view, emission, source);
|
edje_object_signal_emit(VIEW(navi_it), emission, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_item_title_visible_update(Elm_Naviframe_Item *navi_it)
|
_item_title_visible_update(Elm_Naviframe_Item *navi_it)
|
||||||
{
|
{
|
||||||
if (navi_it->title_visible)
|
if (navi_it->title_visible)
|
||||||
edje_object_signal_emit(navi_it->base.view, "elm,state,title,show", "elm");
|
edje_object_signal_emit(VIEW(navi_it), "elm,state,title,show", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(navi_it->base.view, "elm,state,title,hide", "elm");
|
edje_object_signal_emit(VIEW(navi_it), "elm,state,title,hide", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -425,12 +425,12 @@ _item_sizing_eval(Elm_Naviframe_Item *it)
|
||||||
Evas_Coord x, y, w, h;
|
Evas_Coord x, y, w, h;
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
|
|
||||||
wd = elm_widget_data_get(it->base.widget);
|
wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
evas_object_geometry_get(it->base.widget, &x, &y, &w, &h);
|
evas_object_geometry_get(WIDGET(it), &x, &y, &w, &h);
|
||||||
evas_object_move(it->base.view, x, y);
|
evas_object_move(VIEW(it), x, y);
|
||||||
evas_object_resize(it->base.view, w, h);
|
evas_object_resize(VIEW(it), w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -484,7 +484,7 @@ _title_clicked(void *data,
|
||||||
const char *source __UNUSED__)
|
const char *source __UNUSED__)
|
||||||
{
|
{
|
||||||
Elm_Naviframe_Item *it = data;
|
Elm_Naviframe_Item *it = data;
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_TITLE_CLICKED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_CLICKED, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -518,7 +518,7 @@ _title_content_del(void *data,
|
||||||
Elm_Naviframe_Content_Item_Pair *pair = data;
|
Elm_Naviframe_Content_Item_Pair *pair = data;
|
||||||
Elm_Naviframe_Item *it = pair->it;
|
Elm_Naviframe_Item *it = pair->it;
|
||||||
snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part);
|
snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part);
|
||||||
edje_object_signal_emit(it->base.view, buf, "elm");
|
edje_object_signal_emit(VIEW(it), buf, "elm");
|
||||||
it->content_list = eina_inlist_remove(it->content_list,
|
it->content_list = eina_inlist_remove(it->content_list,
|
||||||
EINA_INLIST_GET(pair));
|
EINA_INLIST_GET(pair));
|
||||||
eina_stringshare_del(pair->part);
|
eina_stringshare_del(pair->part);
|
||||||
|
@ -534,7 +534,7 @@ _title_prev_btn_del(void *data,
|
||||||
Elm_Naviframe_Item *it = data;
|
Elm_Naviframe_Item *it = data;
|
||||||
it->back_btn = EINA_FALSE;
|
it->back_btn = EINA_FALSE;
|
||||||
it->title_prev_btn = NULL;
|
it->title_prev_btn = NULL;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,prev_btn,hide", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -545,7 +545,7 @@ _title_next_btn_del(void *data,
|
||||||
{
|
{
|
||||||
Elm_Naviframe_Item *it = data;
|
Elm_Naviframe_Item *it = data;
|
||||||
it->title_next_btn = NULL;
|
it->title_next_btn = NULL;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,next_btn,hide", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -556,7 +556,7 @@ _item_content_del(void *data,
|
||||||
{
|
{
|
||||||
Elm_Naviframe_Item *it = data;
|
Elm_Naviframe_Item *it = data;
|
||||||
it->content = NULL;
|
it->content = NULL;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,content,hide", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -575,7 +575,7 @@ _title_content_set(Elm_Naviframe_Item *it,
|
||||||
pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
|
pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
|
||||||
if (!pair)
|
if (!pair)
|
||||||
{
|
{
|
||||||
ERR("Failed to allocate new content part of the item! : naviframe=%p", it->base.widget);
|
ERR("Failed to allocate new content part of the item! : naviframe=%p", WIDGET(it));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pair->it = it;
|
pair->it = it;
|
||||||
|
@ -590,14 +590,14 @@ _title_content_set(Elm_Naviframe_Item *it,
|
||||||
if (!content)
|
if (!content)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
|
snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
|
||||||
edje_object_signal_emit(it->base.view, buf, "elm");
|
edje_object_signal_emit(VIEW(it), buf, "elm");
|
||||||
pair->content = NULL;
|
pair->content = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pair->content != content)
|
if (pair->content != content)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_add(it->base.widget, content);
|
elm_widget_sub_object_add(WIDGET(it), content);
|
||||||
evas_object_event_callback_add(content,
|
evas_object_event_callback_add(content,
|
||||||
EVAS_CALLBACK_DEL,
|
EVAS_CALLBACK_DEL,
|
||||||
_title_content_del,
|
_title_content_del,
|
||||||
|
@ -606,9 +606,9 @@ _title_content_set(Elm_Naviframe_Item *it,
|
||||||
|
|
||||||
pair->content = content;
|
pair->content = content;
|
||||||
|
|
||||||
edje_object_part_swallow(it->base.view, part, content);
|
edje_object_part_swallow(VIEW(it), part, content);
|
||||||
snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
|
snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
|
||||||
edje_object_signal_emit(it->base.view, buf, "elm");
|
edje_object_signal_emit(VIEW(it), buf, "elm");
|
||||||
_item_sizing_eval(it);
|
_item_sizing_eval(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,19 +626,19 @@ _title_prev_btn_set(Elm_Naviframe_Item *it,
|
||||||
|
|
||||||
if (!btn)
|
if (!btn)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,prev_btn,hide",
|
"elm,state,prev_btn,hide",
|
||||||
"elm");
|
"elm");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
elm_widget_sub_object_add(it->base.widget, btn);
|
elm_widget_sub_object_add(WIDGET(it), btn);
|
||||||
evas_object_event_callback_add(btn,
|
evas_object_event_callback_add(btn,
|
||||||
EVAS_CALLBACK_DEL,
|
EVAS_CALLBACK_DEL,
|
||||||
_title_prev_btn_del,
|
_title_prev_btn_del,
|
||||||
it);
|
it);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.prev_btn", btn);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.prev_btn", btn);
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,prev_btn,show", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
|
||||||
it->back_btn = back_btn;
|
it->back_btn = back_btn;
|
||||||
|
|
||||||
_item_sizing_eval(it);
|
_item_sizing_eval(it);
|
||||||
|
@ -656,19 +656,19 @@ _title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn)
|
||||||
|
|
||||||
if (!btn)
|
if (!btn)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,next_btn,hide",
|
"elm,state,next_btn,hide",
|
||||||
"elm");
|
"elm");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
elm_widget_sub_object_add(it->base.widget, btn);
|
elm_widget_sub_object_add(WIDGET(it), btn);
|
||||||
evas_object_event_callback_add(btn,
|
evas_object_event_callback_add(btn,
|
||||||
EVAS_CALLBACK_DEL,
|
EVAS_CALLBACK_DEL,
|
||||||
_title_next_btn_del,
|
_title_next_btn_del,
|
||||||
it);
|
it);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.next_btn", btn);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.next_btn", btn);
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,next_btn,show", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
|
||||||
|
|
||||||
_item_sizing_eval(it);
|
_item_sizing_eval(it);
|
||||||
}
|
}
|
||||||
|
@ -682,7 +682,7 @@ _item_del(Elm_Naviframe_Item *it)
|
||||||
|
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
|
|
||||||
wd = elm_widget_data_get(it->base.widget);
|
wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if (it->title_prev_btn)
|
if (it->title_prev_btn)
|
||||||
|
@ -729,8 +729,8 @@ _pushed_finished(void *data,
|
||||||
{
|
{
|
||||||
Elm_Naviframe_Item *it = data;
|
Elm_Naviframe_Item *it = data;
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
evas_object_hide(it->base.view);
|
evas_object_hide(VIEW(it));
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_PUSH_FINISHED,
|
SIG_PUSH_FINISHED,
|
||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
|
@ -743,7 +743,7 @@ _popped_finished(void *data,
|
||||||
{
|
{
|
||||||
Elm_Naviframe_Item *it = data;
|
Elm_Naviframe_Item *it = data;
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_POP_FINISHED,
|
SIG_POP_FINISHED,
|
||||||
data);
|
data);
|
||||||
_item_del(data);
|
_item_del(data);
|
||||||
|
@ -760,10 +760,10 @@ _show_finished(void *data,
|
||||||
|
|
||||||
it = data;
|
it = data;
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
wd = elm_widget_data_get(it->base.widget);
|
wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_TRANSITION_FINISHED,
|
SIG_TRANSITION_FINISHED,
|
||||||
data);
|
data);
|
||||||
if (wd->freeze_events)
|
if (wd->freeze_events)
|
||||||
|
@ -775,16 +775,16 @@ _item_content_set(Elm_Naviframe_Item *navi_it, Evas_Object *content)
|
||||||
{
|
{
|
||||||
if (navi_it->content == content) return;
|
if (navi_it->content == content) return;
|
||||||
if (navi_it->content) evas_object_del(navi_it->content);
|
if (navi_it->content) evas_object_del(navi_it->content);
|
||||||
elm_widget_sub_object_add(navi_it->base.widget, content);
|
elm_widget_sub_object_add(WIDGET(navi_it), content);
|
||||||
edje_object_part_swallow(navi_it->base.view,
|
edje_object_part_swallow(VIEW(navi_it),
|
||||||
"elm.swallow.content",
|
"elm.swallow.content",
|
||||||
content);
|
content);
|
||||||
if (content)
|
if (content)
|
||||||
edje_object_signal_emit(navi_it->base.view,
|
edje_object_signal_emit(VIEW(navi_it),
|
||||||
"elm,state,content,show",
|
"elm,state,content,show",
|
||||||
"elm");
|
"elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(navi_it->base.view,
|
edje_object_signal_emit(VIEW(navi_it),
|
||||||
"elm,state,content,hide",
|
"elm,state,content,hide",
|
||||||
"elm");
|
"elm");
|
||||||
evas_object_event_callback_add(content,
|
evas_object_event_callback_add(content,
|
||||||
|
@ -813,15 +813,15 @@ _item_style_set(Elm_Naviframe_Item *navi_it, const char *item_style)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (strlen(item_style) > sizeof(buf))
|
if (strlen(item_style) > sizeof(buf))
|
||||||
WRN("too much long style name! : naviframe=%p", navi_it->base.widget);
|
WRN("too much long style name! : naviframe=%p", WIDGET(navi_it));
|
||||||
sprintf(buf, "item/%s", item_style);
|
sprintf(buf, "item/%s", item_style);
|
||||||
eina_stringshare_replace(&navi_it->style, item_style);
|
eina_stringshare_replace(&navi_it->style, item_style);
|
||||||
}
|
}
|
||||||
_elm_theme_object_set(navi_it->base.widget,
|
_elm_theme_object_set(WIDGET(navi_it),
|
||||||
navi_it->base.view,
|
VIEW(navi_it),
|
||||||
"naviframe",
|
"naviframe",
|
||||||
buf,
|
buf,
|
||||||
elm_widget_style_get(navi_it->base.widget));
|
elm_widget_style_get(WIDGET(navi_it)));
|
||||||
//recover item
|
//recover item
|
||||||
EINA_INLIST_FOREACH(navi_it->text_list, text_pair)
|
EINA_INLIST_FOREACH(navi_it->text_list, text_pair)
|
||||||
_item_text_set_hook((Elm_Object_Item *) navi_it,
|
_item_text_set_hook((Elm_Object_Item *) navi_it,
|
||||||
|
@ -836,10 +836,10 @@ _item_style_set(Elm_Naviframe_Item *navi_it, const char *item_style)
|
||||||
//content
|
//content
|
||||||
if (navi_it->content)
|
if (navi_it->content)
|
||||||
{
|
{
|
||||||
edje_object_part_swallow(navi_it->base.view,
|
edje_object_part_swallow(VIEW(navi_it),
|
||||||
"elm.swallow.content",
|
"elm.swallow.content",
|
||||||
navi_it->content);
|
navi_it->content);
|
||||||
edje_object_signal_emit(navi_it->base.view,
|
edje_object_signal_emit(VIEW(navi_it),
|
||||||
"elm,state,content,show",
|
"elm,state,content,show",
|
||||||
"elm");
|
"elm");
|
||||||
}
|
}
|
||||||
|
@ -847,10 +847,10 @@ _item_style_set(Elm_Naviframe_Item *navi_it, const char *item_style)
|
||||||
//prev button
|
//prev button
|
||||||
if (navi_it->title_prev_btn)
|
if (navi_it->title_prev_btn)
|
||||||
{
|
{
|
||||||
edje_object_part_swallow(navi_it->base.view,
|
edje_object_part_swallow(VIEW(navi_it),
|
||||||
"elm.swallow.prev_btn",
|
"elm.swallow.prev_btn",
|
||||||
navi_it->title_prev_btn);
|
navi_it->title_prev_btn);
|
||||||
edje_object_signal_emit(navi_it->base.view,
|
edje_object_signal_emit(VIEW(navi_it),
|
||||||
"elm,state,prev_btn,show",
|
"elm,state,prev_btn,show",
|
||||||
"elm");
|
"elm");
|
||||||
}
|
}
|
||||||
|
@ -858,10 +858,10 @@ _item_style_set(Elm_Naviframe_Item *navi_it, const char *item_style)
|
||||||
//next button
|
//next button
|
||||||
if (navi_it->title_next_btn)
|
if (navi_it->title_next_btn)
|
||||||
{
|
{
|
||||||
edje_object_part_swallow(navi_it->base.view,
|
edje_object_part_swallow(VIEW(navi_it),
|
||||||
"elm.swallow.next_btn",
|
"elm.swallow.next_btn",
|
||||||
navi_it->title_next_btn);
|
navi_it->title_next_btn);
|
||||||
edje_object_signal_emit(navi_it->base.view,
|
edje_object_signal_emit(VIEW(navi_it),
|
||||||
"elm,state,next_btn,show",
|
"elm,state,next_btn,show",
|
||||||
"elm");
|
"elm");
|
||||||
}
|
}
|
||||||
|
@ -869,7 +869,7 @@ _item_style_set(Elm_Naviframe_Item *navi_it, const char *item_style)
|
||||||
navi_it->title_visible = EINA_TRUE;
|
navi_it->title_visible = EINA_TRUE;
|
||||||
_item_sizing_eval(navi_it);
|
_item_sizing_eval(navi_it);
|
||||||
|
|
||||||
wd = elm_widget_data_get(navi_it->base.widget);
|
wd = elm_widget_data_get(WIDGET(navi_it));
|
||||||
if (wd && wd->freeze_events)
|
if (wd && wd->freeze_events)
|
||||||
{
|
{
|
||||||
evas_object_hide(wd->rect);
|
evas_object_hide(wd->rect);
|
||||||
|
@ -948,23 +948,23 @@ elm_naviframe_item_push(Evas_Object *obj,
|
||||||
elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
|
elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
|
||||||
|
|
||||||
//item base layout
|
//item base layout
|
||||||
it->base.view = edje_object_add(evas_object_evas_get(obj));
|
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||||
edje_object_mirrored_set(it->base.view, elm_widget_mirrored_get(obj));
|
edje_object_mirrored_set(VIEW(it), elm_widget_mirrored_get(obj));
|
||||||
evas_object_smart_member_add(it->base.view, wd->base);
|
evas_object_smart_member_add(VIEW(it), wd->base);
|
||||||
elm_widget_sub_object_add(obj, it->base.view);
|
elm_widget_sub_object_add(obj, VIEW(it));
|
||||||
edje_object_signal_callback_add(it->base.view,
|
edje_object_signal_callback_add(VIEW(it),
|
||||||
"elm,action,show,finished",
|
"elm,action,show,finished",
|
||||||
"",
|
"",
|
||||||
_show_finished, it);
|
_show_finished, it);
|
||||||
edje_object_signal_callback_add(it->base.view,
|
edje_object_signal_callback_add(VIEW(it),
|
||||||
"elm,action,pushed,finished",
|
"elm,action,pushed,finished",
|
||||||
"",
|
"",
|
||||||
_pushed_finished, it);
|
_pushed_finished, it);
|
||||||
edje_object_signal_callback_add(it->base.view,
|
edje_object_signal_callback_add(VIEW(it),
|
||||||
"elm,action,popped,finished",
|
"elm,action,popped,finished",
|
||||||
"",
|
"",
|
||||||
_popped_finished, it);
|
_popped_finished, it);
|
||||||
edje_object_signal_callback_add(it->base.view,
|
edje_object_signal_callback_add(VIEW(it),
|
||||||
"elm,action,title,clicked",
|
"elm,action,title,clicked",
|
||||||
"",
|
"",
|
||||||
_title_clicked, it);
|
_title_clicked, it);
|
||||||
|
@ -987,17 +987,17 @@ elm_naviframe_item_push(Evas_Object *obj,
|
||||||
_item_content_set(it, content);
|
_item_content_set(it, content);
|
||||||
|
|
||||||
_item_sizing_eval(it);
|
_item_sizing_eval(it);
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
|
|
||||||
prev_it = (Elm_Naviframe_Item *) elm_naviframe_top_item_get(obj);
|
prev_it = (Elm_Naviframe_Item *) elm_naviframe_top_item_get(obj);
|
||||||
if (prev_it)
|
if (prev_it)
|
||||||
{
|
{
|
||||||
if (wd->freeze_events)
|
if (wd->freeze_events)
|
||||||
evas_object_show(wd->rect);
|
evas_object_show(wd->rect);
|
||||||
edje_object_signal_emit(prev_it->base.view,
|
edje_object_signal_emit(VIEW(prev_it),
|
||||||
"elm,state,cur,pushed",
|
"elm,state,cur,pushed",
|
||||||
"elm");
|
"elm");
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,new,pushed",
|
"elm,state,new,pushed",
|
||||||
"elm");
|
"elm");
|
||||||
}
|
}
|
||||||
|
@ -1030,10 +1030,10 @@ elm_naviframe_item_pop(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
if (wd->freeze_events)
|
if (wd->freeze_events)
|
||||||
evas_object_show(wd->rect);
|
evas_object_show(wd->rect);
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,cur,popped", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
|
||||||
evas_object_show(prev_it->base.view);
|
evas_object_show(VIEW(prev_it));
|
||||||
evas_object_raise(prev_it->base.view);
|
evas_object_raise(VIEW(prev_it));
|
||||||
edje_object_signal_emit(prev_it->base.view,
|
edje_object_signal_emit(VIEW(prev_it),
|
||||||
"elm,state,prev,popped",
|
"elm,state,prev,popped",
|
||||||
"elm");
|
"elm");
|
||||||
}
|
}
|
||||||
|
@ -1048,10 +1048,10 @@ elm_naviframe_item_pop_to(Elm_Object_Item *it)
|
||||||
{
|
{
|
||||||
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
||||||
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
|
||||||
Widget_Data *wd = elm_widget_data_get(navi_it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(navi_it));
|
||||||
Eina_Inlist *l, *prev_l;
|
Eina_Inlist *l, *prev_l;
|
||||||
|
|
||||||
if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return;
|
if (it == elm_naviframe_top_item_get(WIDGET(navi_it))) return;
|
||||||
|
|
||||||
l = wd->stack->last->prev;
|
l = wd->stack->last->prev;
|
||||||
|
|
||||||
|
@ -1063,7 +1063,7 @@ elm_naviframe_item_pop_to(Elm_Object_Item *it)
|
||||||
_item_del(EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item));
|
_item_del(EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item));
|
||||||
l = prev_l;
|
l = prev_l;
|
||||||
}
|
}
|
||||||
elm_naviframe_item_pop(navi_it->base.widget);
|
elm_naviframe_item_pop(WIDGET(navi_it));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -1071,15 +1071,15 @@ elm_naviframe_item_del(Elm_Object_Item *it)
|
||||||
{
|
{
|
||||||
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
||||||
Elm_Naviframe_Item *navi_it =(Elm_Naviframe_Item *) it;
|
Elm_Naviframe_Item *navi_it =(Elm_Naviframe_Item *) it;
|
||||||
Widget_Data *wd = elm_widget_data_get(navi_it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(navi_it));
|
||||||
if (it == elm_naviframe_top_item_get(navi_it->base.widget))
|
if (it == elm_naviframe_top_item_get(WIDGET(navi_it)))
|
||||||
{
|
{
|
||||||
_item_del(navi_it);
|
_item_del(navi_it);
|
||||||
navi_it = EINA_INLIST_CONTAINER_GET(wd->stack->last,
|
navi_it = EINA_INLIST_CONTAINER_GET(wd->stack->last,
|
||||||
Elm_Naviframe_Item);
|
Elm_Naviframe_Item);
|
||||||
evas_object_show(navi_it->base.view);
|
evas_object_show(VIEW(navi_it));
|
||||||
evas_object_raise(navi_it->base.view);
|
evas_object_raise(VIEW(navi_it));
|
||||||
edje_object_signal_emit(navi_it->base.view, "elm,state,visible", "elm");
|
edje_object_signal_emit(VIEW(navi_it), "elm,state,visible", "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_item_del(navi_it);
|
_item_del(navi_it);
|
||||||
|
|
|
@ -52,7 +52,7 @@ static const char *widtype = NULL;
|
||||||
|
|
||||||
#define ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, ...) \
|
#define ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, ...) \
|
||||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
|
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
|
||||||
ELM_CHECK_WIDTYPE(it->base.widget, widtype) __VA_ARGS__;
|
ELM_CHECK_WIDTYPE(WIDGET(it), widtype) __VA_ARGS__;
|
||||||
|
|
||||||
static Eina_Bool _move_scroller(void *data);
|
static Eina_Bool _move_scroller(void *data);
|
||||||
static void _del_hook(Evas_Object * obj);
|
static void _del_hook(Evas_Object * obj);
|
||||||
|
@ -118,24 +118,24 @@ _item_new(Evas_Object *obj, Evas_Object *icon, const char *label, Evas_Smart_Cb
|
||||||
it->icon = icon;
|
it->icon = icon;
|
||||||
it->func = func;
|
it->func = func;
|
||||||
it->base.data = data;
|
it->base.data = data;
|
||||||
it->base.view = edje_object_add(evas_object_evas_get(obj));
|
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||||
_elm_theme_object_set(obj, it->base.view, "diskselector", "item", style);
|
_elm_theme_object_set(obj, VIEW(it), "diskselector", "item", style);
|
||||||
evas_object_size_hint_weight_set(it->base.view, EVAS_HINT_EXPAND,
|
evas_object_size_hint_weight_set(VIEW(it), EVAS_HINT_EXPAND,
|
||||||
EVAS_HINT_EXPAND);
|
EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(it->base.view, EVAS_HINT_FILL,
|
evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL,
|
||||||
EVAS_HINT_FILL);
|
EVAS_HINT_FILL);
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
|
|
||||||
if (it->label)
|
if (it->label)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
edje_object_signal_callback_add(it->base.view, "elm,action,click", "", _item_click_cb, it);
|
edje_object_signal_callback_add(VIEW(it), "elm,action,click", "", _item_click_cb, it);
|
||||||
}
|
}
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_set(it->icon, 24, 24);
|
evas_object_size_hint_min_set(it->icon, 24, 24);
|
||||||
evas_object_size_hint_max_set(it->icon, 40, 40);
|
evas_object_size_hint_max_set(it->icon, 40, 40);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
|
||||||
evas_object_show(it->icon);
|
evas_object_show(it->icon);
|
||||||
elm_widget_sub_object_add(obj, it->icon);
|
elm_widget_sub_object_add(obj, it->icon);
|
||||||
}
|
}
|
||||||
|
@ -200,25 +200,25 @@ _del_pre_hook(Evas_Object * obj)
|
||||||
if (wd->last)
|
if (wd->last)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(wd->last->label);
|
eina_stringshare_del(wd->last->label);
|
||||||
evas_object_del(wd->last->base.view);
|
evas_object_del(wd->VIEW(last));
|
||||||
free(wd->last);
|
free(wd->last);
|
||||||
}
|
}
|
||||||
if (wd->s_last)
|
if (wd->s_last)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(wd->s_last->label);
|
eina_stringshare_del(wd->s_last->label);
|
||||||
evas_object_del(wd->s_last->base.view);
|
evas_object_del(wd->VIEW(s_last));
|
||||||
free(wd->s_last);
|
free(wd->s_last);
|
||||||
}
|
}
|
||||||
if (wd->second)
|
if (wd->second)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(wd->second->label);
|
eina_stringshare_del(wd->second->label);
|
||||||
evas_object_del(wd->second->base.view);
|
evas_object_del(wd->VIEW(second));
|
||||||
free(wd->second);
|
free(wd->second);
|
||||||
}
|
}
|
||||||
if (wd->first)
|
if (wd->first)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(wd->first->label);
|
eina_stringshare_del(wd->first->label);
|
||||||
evas_object_del(wd->first->base.view);
|
evas_object_del(wd->VIEW(first));
|
||||||
free(wd->first);
|
free(wd->first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ _del_pre_hook(Evas_Object * obj)
|
||||||
if (it)
|
if (it)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(it->label);
|
eina_stringshare_del(it->label);
|
||||||
evas_object_del(it->base.view);
|
evas_object_del(VIEW(it));
|
||||||
free(it);
|
free(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ _del_pre_hook(Evas_Object * obj)
|
||||||
if (it)
|
if (it)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(it->label);
|
eina_stringshare_del(it->label);
|
||||||
evas_object_del(it->base.view);
|
evas_object_del(VIEW(it));
|
||||||
free(it);
|
free(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,18 +269,18 @@ _theme_hook(Evas_Object * obj)
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(wd->r_items, l, it)
|
EINA_LIST_FOREACH(wd->r_items, l, it)
|
||||||
{
|
{
|
||||||
_elm_theme_object_set(obj, it->base.view, "diskselector", "item",
|
_elm_theme_object_set(obj, VIEW(it), "diskselector", "item",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(wd->items, l, it)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
_elm_theme_object_set(obj, it->base.view, "diskselector", "item",
|
_elm_theme_object_set(obj, VIEW(it), "diskselector", "item",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_elm_theme_object_set(obj, wd->right_blank, "diskselector", "item",
|
_elm_theme_object_set(obj, wd->right_blank, "diskselector", "item",
|
||||||
|
@ -319,11 +319,11 @@ static void
|
||||||
_select_item(Elm_Diskselector_Item *it)
|
_select_item(Elm_Diskselector_Item *it)
|
||||||
{
|
{
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
wd->selected_item = it;
|
wd->selected_item = it;
|
||||||
_selected_item_indicate(wd->selected_item);
|
_selected_item_indicate(wd->selected_item);
|
||||||
if (it->func) it->func((void *)it->base.data, it->base.widget, it);
|
if (it->func) it->func((void *)it->base.data, WIDGET(it), it);
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_SELECTED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -450,7 +450,7 @@ _check_string(void *data)
|
||||||
{
|
{
|
||||||
Evas_Coord x, w;
|
Evas_Coord x, w;
|
||||||
int len;
|
int len;
|
||||||
evas_object_geometry_get(it->base.view, &x, NULL, &w, NULL);
|
evas_object_geometry_get(VIEW(it), &x, NULL, &w, NULL);
|
||||||
/* item not visible */
|
/* item not visible */
|
||||||
if ((x + w <= ox) || (x >= ox + ow))
|
if ((x + w <= ox) || (x >= ox + ow))
|
||||||
continue;
|
continue;
|
||||||
|
@ -460,18 +460,18 @@ _check_string(void *data)
|
||||||
// len = eina_stringshare_strlen(it->label);
|
// len = eina_stringshare_strlen(it->label);
|
||||||
|
|
||||||
if (x <= ox + 5)
|
if (x <= ox + 5)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,left_side",
|
edje_object_signal_emit(VIEW(it), "elm,state,left_side",
|
||||||
"elm");
|
"elm");
|
||||||
else if (x + w >= ox + ow - 5)
|
else if (x + w >= ox + ow - 5)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,right_side",
|
edje_object_signal_emit(VIEW(it), "elm,state,right_side",
|
||||||
"elm");
|
"elm");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((wd->len_threshold) && (len > wd->len_threshold))
|
if ((wd->len_threshold) && (len > wd->len_threshold))
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,center_small",
|
edje_object_signal_emit(VIEW(it), "elm,state,center_small",
|
||||||
"elm");
|
"elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,center",
|
edje_object_signal_emit(VIEW(it), "elm,state,center",
|
||||||
"elm");
|
"elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ _check_string(void *data)
|
||||||
// cut it off at byte mark returned form _check_letter
|
// cut it off at byte mark returned form _check_letter
|
||||||
strncpy(buf, it->label, length);
|
strncpy(buf, it->label, length);
|
||||||
buf[length] = '\0';
|
buf[length] = '\0';
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", buf);
|
edje_object_part_text_set(VIEW(it), "elm.text", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wd->check_idler)
|
if (wd->check_idler)
|
||||||
|
@ -508,15 +508,15 @@ _selected_item_indicate(Elm_Diskselector_Item *it)
|
||||||
Elm_Diskselector_Item *item;
|
Elm_Diskselector_Item *item;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
wd = elm_widget_data_get(it->base.widget);
|
wd = elm_widget_data_get(WIDGET(it));
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(wd->r_items, l, item)
|
EINA_LIST_FOREACH(wd->r_items, l, item)
|
||||||
{
|
{
|
||||||
if (!strcmp(item->label, it->label)) edje_object_signal_emit(item->base.view, "elm,state,selected", "elm");
|
if (!strcmp(item->label, it->label)) edje_object_signal_emit(VIEW(item), "elm,state,selected", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,default", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,default", "elm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -529,7 +529,7 @@ _item_click_cb(void *data, Evas_Object *obj __UNUSED__,
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
|
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
wd = elm_widget_data_get(it->base.widget);
|
wd = elm_widget_data_get(WIDGET(it));
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ _item_click_cb(void *data, Evas_Object *obj __UNUSED__,
|
||||||
_selected_item_indicate(wd->selected_item);
|
_selected_item_indicate(wd->selected_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it->func) it->func((void *)it->base.data, it->base.widget, it);
|
if (it->func) it->func((void *)it->base.data, WIDGET(it), it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -584,7 +584,7 @@ _scroller_stop_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UN
|
||||||
evas_object_geometry_get(wd->scroller, NULL, NULL, &ow, NULL);
|
evas_object_geometry_get(wd->scroller, NULL, NULL, &ow, NULL);
|
||||||
EINA_LIST_FOREACH(list, l, it)
|
EINA_LIST_FOREACH(list, l, it)
|
||||||
{
|
{
|
||||||
evas_object_geometry_get(it->base.view, &x, NULL, &w, NULL);
|
evas_object_geometry_get(VIEW(it), &x, NULL, &w, NULL);
|
||||||
if (abs((int)(ow / 2 - (int)(x + w / 2))) < 10)
|
if (abs((int)(ow / 2 - (int)(x + w / 2))) < 10)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -653,10 +653,10 @@ static void
|
||||||
_round_item_del(Widget_Data *wd, Elm_Diskselector_Item *it)
|
_round_item_del(Widget_Data *wd, Elm_Diskselector_Item *it)
|
||||||
{
|
{
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
elm_box_unpack(wd->main_box, it->base.view);
|
elm_box_unpack(wd->main_box, VIEW(it));
|
||||||
wd->r_items = eina_list_remove(wd->r_items, it);
|
wd->r_items = eina_list_remove(wd->r_items, it);
|
||||||
eina_stringshare_del(it->label);
|
eina_stringshare_del(it->label);
|
||||||
evas_object_del(it->base.view);
|
evas_object_del(VIEW(it));
|
||||||
free(it);
|
free(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -700,7 +700,7 @@ _round_items_add(Widget_Data *wd)
|
||||||
|
|
||||||
if (!wd->first)
|
if (!wd->first)
|
||||||
{
|
{
|
||||||
wd->first = _item_new(it->base.widget, it->icon, it->label, it->func,
|
wd->first = _item_new(WIDGET(it), it->icon, it->label, it->func,
|
||||||
it->base.data);
|
it->base.data);
|
||||||
wd->first->node = it->node;
|
wd->first->node = it->node;
|
||||||
wd->r_items = eina_list_append(wd->r_items, wd->first);
|
wd->r_items = eina_list_append(wd->r_items, wd->first);
|
||||||
|
@ -711,7 +711,7 @@ _round_items_add(Widget_Data *wd)
|
||||||
it = dit;
|
it = dit;
|
||||||
if (!wd->second)
|
if (!wd->second)
|
||||||
{
|
{
|
||||||
wd->second = _item_new(it->base.widget, it->icon, it->label, it->func,
|
wd->second = _item_new(WIDGET(it), it->icon, it->label, it->func,
|
||||||
it->base.data);
|
it->base.data);
|
||||||
wd->second->node = it->node;
|
wd->second->node = it->node;
|
||||||
wd->r_items = eina_list_append(wd->r_items, wd->second);
|
wd->r_items = eina_list_append(wd->r_items, wd->second);
|
||||||
|
@ -722,7 +722,7 @@ _round_items_add(Widget_Data *wd)
|
||||||
{
|
{
|
||||||
it = eina_list_nth(wd->items, i);
|
it = eina_list_nth(wd->items, i);
|
||||||
if (!it) it = dit;
|
if (!it) it = dit;
|
||||||
temp_it = _item_new(it->base.widget, it->icon, it->label, it->func, it->base.data);
|
temp_it = _item_new(WIDGET(it), it->icon, it->label, it->func, it->base.data);
|
||||||
wd->over_items = eina_list_append(wd->over_items, temp_it);
|
wd->over_items = eina_list_append(wd->over_items, temp_it);
|
||||||
wd->r_items = eina_list_append(wd->r_items, temp_it);
|
wd->r_items = eina_list_append(wd->r_items, temp_it);
|
||||||
}
|
}
|
||||||
|
@ -732,7 +732,7 @@ _round_items_add(Widget_Data *wd)
|
||||||
it = dit;
|
it = dit;
|
||||||
if (!wd->last)
|
if (!wd->last)
|
||||||
{
|
{
|
||||||
wd->last = _item_new(it->base.widget, it->icon, it->label, it->func,
|
wd->last = _item_new(WIDGET(it), it->icon, it->label, it->func,
|
||||||
it->base.data);
|
it->base.data);
|
||||||
wd->last->node = it->node;
|
wd->last->node = it->node;
|
||||||
wd->r_items = eina_list_prepend(wd->r_items, wd->last);
|
wd->r_items = eina_list_prepend(wd->r_items, wd->last);
|
||||||
|
@ -743,7 +743,7 @@ _round_items_add(Widget_Data *wd)
|
||||||
it = dit;
|
it = dit;
|
||||||
if (!wd->s_last)
|
if (!wd->s_last)
|
||||||
{
|
{
|
||||||
wd->s_last = _item_new(it->base.widget, it->icon, it->label, it->func,
|
wd->s_last = _item_new(WIDGET(it), it->icon, it->label, it->func,
|
||||||
it->base.data);
|
it->base.data);
|
||||||
wd->s_last->node = it->node;
|
wd->s_last->node = it->node;
|
||||||
wd->r_items = eina_list_prepend(wd->r_items, wd->s_last);
|
wd->r_items = eina_list_prepend(wd->r_items, wd->s_last);
|
||||||
|
@ -754,7 +754,7 @@ _round_items_add(Widget_Data *wd)
|
||||||
{
|
{
|
||||||
it = eina_list_nth(wd->items, wd->item_count - i);
|
it = eina_list_nth(wd->items, wd->item_count - i);
|
||||||
if (!it) it = dit;
|
if (!it) it = dit;
|
||||||
temp_it = _item_new(it->base.widget, it->icon, it->label, it->func, it->base.data);
|
temp_it = _item_new(WIDGET(it), it->icon, it->label, it->func, it->base.data);
|
||||||
wd->under_items = eina_list_append(wd->under_items, temp_it);
|
wd->under_items = eina_list_append(wd->under_items, temp_it);
|
||||||
wd->r_items = eina_list_prepend(wd->r_items, temp_it);
|
wd->r_items = eina_list_prepend(wd->r_items, temp_it);
|
||||||
}
|
}
|
||||||
|
@ -767,13 +767,13 @@ _item_icon_set(Elm_Diskselector_Item *it, Evas_Object *icon)
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
evas_object_del(it->icon);
|
evas_object_del(it->icon);
|
||||||
it->icon = icon;
|
it->icon = icon;
|
||||||
if (it->base.view)
|
if (VIEW(it))
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_set(it->icon, 24, 24);
|
evas_object_size_hint_min_set(it->icon, 24, 24);
|
||||||
evas_object_size_hint_max_set(it->icon, 40, 40);
|
evas_object_size_hint_max_set(it->icon, 40, 40);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
|
||||||
evas_object_show(it->icon);
|
evas_object_show(it->icon);
|
||||||
elm_widget_sub_object_add(it->base.widget, it->icon);
|
elm_widget_sub_object_add(WIDGET(it), it->icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -787,7 +787,7 @@ _check_identical_item(Elm_Diskselector_Item *it, Evas_Object *icon)
|
||||||
int ic = 0;
|
int ic = 0;
|
||||||
int ac = 0;
|
int ac = 0;
|
||||||
|
|
||||||
wd = elm_widget_data_get(it->base.widget);
|
wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if (wd->round)
|
if (wd->round)
|
||||||
|
@ -947,22 +947,22 @@ elm_diskselector_round_set(Evas_Object * obj, Eina_Bool round)
|
||||||
_round_items_add(wd);
|
_round_items_add(wd);
|
||||||
|
|
||||||
if (wd->last)
|
if (wd->last)
|
||||||
elm_box_pack_start(wd->main_box, wd->last->base.view);
|
elm_box_pack_start(wd->main_box, wd->VIEW(last));
|
||||||
if (wd->s_last)
|
if (wd->s_last)
|
||||||
elm_box_pack_start(wd->main_box, wd->s_last->base.view);
|
elm_box_pack_start(wd->main_box, wd->VIEW(s_last));
|
||||||
|
|
||||||
// if more than 3 items should be displayed
|
// if more than 3 items should be displayed
|
||||||
EINA_LIST_FOREACH(wd->under_items, elist, it)
|
EINA_LIST_FOREACH(wd->under_items, elist, it)
|
||||||
elm_box_pack_start(wd->main_box, it->base.view);
|
elm_box_pack_start(wd->main_box, VIEW(it));
|
||||||
|
|
||||||
if (wd->first)
|
if (wd->first)
|
||||||
elm_box_pack_end(wd->main_box, wd->first->base.view);
|
elm_box_pack_end(wd->main_box, wd->VIEW(first));
|
||||||
if (wd->second)
|
if (wd->second)
|
||||||
elm_box_pack_end(wd->main_box, wd->second->base.view);
|
elm_box_pack_end(wd->main_box, wd->VIEW(second));
|
||||||
|
|
||||||
// if more than 3 items should be displayed
|
// if more than 3 items should be displayed
|
||||||
EINA_LIST_FOREACH(wd->over_items, elist, it)
|
EINA_LIST_FOREACH(wd->over_items, elist, it)
|
||||||
elm_box_pack_end(wd->main_box, it->base.view);
|
elm_box_pack_end(wd->main_box, VIEW(it));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1093,19 +1093,19 @@ elm_diskselector_item_append(Evas_Object *obj, const char *label, Evas_Object *i
|
||||||
wd->r_items = eina_list_append(wd->r_items, it);
|
wd->r_items = eina_list_append(wd->r_items, it);
|
||||||
_round_items_add(wd);
|
_round_items_add(wd);
|
||||||
if (wd->last)
|
if (wd->last)
|
||||||
elm_box_pack_start(wd->main_box, wd->last->base.view);
|
elm_box_pack_start(wd->main_box, wd->VIEW(last));
|
||||||
if (wd->s_last)
|
if (wd->s_last)
|
||||||
elm_box_pack_start(wd->main_box, wd->s_last->base.view);
|
elm_box_pack_start(wd->main_box, wd->VIEW(s_last));
|
||||||
elm_box_pack_end(wd->main_box, it->base.view);
|
elm_box_pack_end(wd->main_box, VIEW(it));
|
||||||
if (wd->first)
|
if (wd->first)
|
||||||
elm_box_pack_end(wd->main_box, wd->first->base.view);
|
elm_box_pack_end(wd->main_box, wd->VIEW(first));
|
||||||
if (wd->second)
|
if (wd->second)
|
||||||
elm_box_pack_end(wd->main_box, wd->second->base.view);
|
elm_box_pack_end(wd->main_box, wd->VIEW(second));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elm_box_unpack(wd->main_box, wd->right_blank);
|
elm_box_unpack(wd->main_box, wd->right_blank);
|
||||||
elm_box_pack_end(wd->main_box, it->base.view);
|
elm_box_pack_end(wd->main_box, VIEW(it));
|
||||||
elm_box_pack_end(wd->main_box, wd->right_blank);
|
elm_box_pack_end(wd->main_box, wd->right_blank);
|
||||||
}
|
}
|
||||||
if (!wd->selected_item)
|
if (!wd->selected_item)
|
||||||
|
@ -1124,10 +1124,10 @@ elm_diskselector_item_del(Elm_Diskselector_Item * it)
|
||||||
Elm_Diskselector_Item *item;
|
Elm_Diskselector_Item *item;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
elm_box_unpack(wd->main_box, it->base.view);
|
elm_box_unpack(wd->main_box, VIEW(it));
|
||||||
|
|
||||||
if (wd->round)
|
if (wd->round)
|
||||||
wd->r_items = eina_list_remove(wd->r_items, it);
|
wd->r_items = eina_list_remove(wd->r_items, it);
|
||||||
|
@ -1152,16 +1152,16 @@ elm_diskselector_item_del(Elm_Diskselector_Item * it)
|
||||||
{
|
{
|
||||||
if (!wd->item_count)
|
if (!wd->item_count)
|
||||||
{
|
{
|
||||||
evas_object_hide(wd->first->base.view);
|
evas_object_hide(wd->VIEW(first));
|
||||||
evas_object_hide(wd->second->base.view);
|
evas_object_hide(wd->VIEW(second));
|
||||||
evas_object_hide(wd->last->base.view);
|
evas_object_hide(wd->VIEW(last));
|
||||||
evas_object_hide(wd->s_last->base.view);
|
evas_object_hide(wd->VIEW(s_last));
|
||||||
|
|
||||||
EINA_LIST_FOREACH(wd->under_items, l, item)
|
EINA_LIST_FOREACH(wd->under_items, l, item)
|
||||||
evas_object_hide(item->base.view);
|
evas_object_hide(VIEW(item));
|
||||||
|
|
||||||
EINA_LIST_FOREACH(wd->over_items, l, item)
|
EINA_LIST_FOREACH(wd->over_items, l, item)
|
||||||
evas_object_hide(item->base.view);
|
evas_object_hide(VIEW(item));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1169,14 +1169,14 @@ elm_diskselector_item_del(Elm_Diskselector_Item * it)
|
||||||
if (dit)
|
if (dit)
|
||||||
{
|
{
|
||||||
eina_stringshare_replace(&wd->first->label, dit->label);
|
eina_stringshare_replace(&wd->first->label, dit->label);
|
||||||
edje_object_part_text_set(wd->first->base.view, "elm.text",
|
edje_object_part_text_set(wd->VIEW(first), "elm.text",
|
||||||
wd->first->label);
|
wd->first->label);
|
||||||
}
|
}
|
||||||
dit = eina_list_nth(wd->items, 1);
|
dit = eina_list_nth(wd->items, 1);
|
||||||
if (dit)
|
if (dit)
|
||||||
{
|
{
|
||||||
eina_stringshare_replace(&wd->second->label, dit->label);
|
eina_stringshare_replace(&wd->second->label, dit->label);
|
||||||
edje_object_part_text_set(wd->second->base.view, "elm.text",
|
edje_object_part_text_set(wd->VIEW(second), "elm.text",
|
||||||
wd->second->label);
|
wd->second->label);
|
||||||
}
|
}
|
||||||
// if more than 3 itmes should be displayed
|
// if more than 3 itmes should be displayed
|
||||||
|
@ -1185,21 +1185,21 @@ elm_diskselector_item_del(Elm_Diskselector_Item * it)
|
||||||
dit = eina_list_nth(wd->items, i);
|
dit = eina_list_nth(wd->items, i);
|
||||||
item = eina_list_nth(wd->over_items, i - 2);
|
item = eina_list_nth(wd->over_items, i - 2);
|
||||||
eina_stringshare_replace(&item->label, dit->label);
|
eina_stringshare_replace(&item->label, dit->label);
|
||||||
edje_object_part_text_set(item->base.view, "elm.text", item->label);
|
edje_object_part_text_set(VIEW(item), "elm.text", item->label);
|
||||||
}
|
}
|
||||||
|
|
||||||
dit = eina_list_nth(wd->items, eina_list_count(wd->items) - 1);
|
dit = eina_list_nth(wd->items, eina_list_count(wd->items) - 1);
|
||||||
if (dit)
|
if (dit)
|
||||||
{
|
{
|
||||||
eina_stringshare_replace(&wd->last->label, dit->label);
|
eina_stringshare_replace(&wd->last->label, dit->label);
|
||||||
edje_object_part_text_set(wd->last->base.view, "elm.text",
|
edje_object_part_text_set(wd->VIEW(last), "elm.text",
|
||||||
wd->last->label);
|
wd->last->label);
|
||||||
}
|
}
|
||||||
dit = eina_list_nth(wd->items, eina_list_count(wd->items) - 2);
|
dit = eina_list_nth(wd->items, eina_list_count(wd->items) - 2);
|
||||||
if (dit)
|
if (dit)
|
||||||
{
|
{
|
||||||
eina_stringshare_replace(&wd->s_last->label, dit->label);
|
eina_stringshare_replace(&wd->s_last->label, dit->label);
|
||||||
edje_object_part_text_set(wd->s_last->base.view, "elm.text",
|
edje_object_part_text_set(wd->VIEW(s_last), "elm.text",
|
||||||
wd->s_last->label);
|
wd->s_last->label);
|
||||||
}
|
}
|
||||||
// if more than 3 itmes should be displayed
|
// if more than 3 itmes should be displayed
|
||||||
|
@ -1208,7 +1208,7 @@ elm_diskselector_item_del(Elm_Diskselector_Item * it)
|
||||||
dit = eina_list_nth(wd->items, wd->item_count - i);
|
dit = eina_list_nth(wd->items, wd->item_count - i);
|
||||||
item = eina_list_nth(wd->under_items, i - 3);
|
item = eina_list_nth(wd->under_items, i - 3);
|
||||||
eina_stringshare_replace(&item->label, dit->label);
|
eina_stringshare_replace(&item->label, dit->label);
|
||||||
edje_object_part_text_set(item->base.view, "elm.text", item->label);
|
edje_object_part_text_set(VIEW(item), "elm.text", item->label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1228,7 +1228,7 @@ elm_diskselector_item_label_set(Elm_Diskselector_Item * it, const char *label)
|
||||||
{
|
{
|
||||||
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
|
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
|
||||||
eina_stringshare_replace(&it->label, label);
|
eina_stringshare_replace(&it->label, label);
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Elm_Diskselector_Item *
|
EAPI Elm_Diskselector_Item *
|
||||||
|
@ -1245,7 +1245,7 @@ elm_diskselector_item_selected_set(Elm_Diskselector_Item *it, Eina_Bool selected
|
||||||
{
|
{
|
||||||
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
|
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
wd = elm_widget_data_get(it->base.widget);
|
wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if ((wd->selected_item == it) && (selected))
|
if ((wd->selected_item == it) && (selected))
|
||||||
|
@ -1260,7 +1260,7 @@ elm_diskselector_item_selected_set(Elm_Diskselector_Item *it, Eina_Bool selected
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wd->idler)
|
if (!wd->idler)
|
||||||
wd->idler = ecore_idle_enterer_before_add(_move_scroller, it->base.widget);
|
wd->idler = ecore_idle_enterer_before_add(_move_scroller, WIDGET(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
|
@ -1269,7 +1269,7 @@ elm_diskselector_item_selected_get(const Elm_Diskselector_Item *it)
|
||||||
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
wd = elm_widget_data_get(it->base.widget);
|
wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return EINA_FALSE;
|
if (!wd) return EINA_FALSE;
|
||||||
return (wd->selected_item == it);
|
return (wd->selected_item == it);
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,7 +377,7 @@ _changed(Widget_Data *wd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (item->func)
|
if (item->func)
|
||||||
item->func((void *)item->base.data, item->base.widget, item);
|
item->func((void *)item->base.data, WIDGET(item), item);
|
||||||
if (!item->deleted)
|
if (!item->deleted)
|
||||||
evas_object_smart_callback_call(wd->self, SIG_SELECTED, item);
|
evas_object_smart_callback_call(wd->self, SIG_SELECTED, item);
|
||||||
}
|
}
|
||||||
|
@ -770,7 +770,7 @@ elm_flipselector_item_selected_set(Elm_Flipselector_Item *item, Eina_Bool select
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd)
|
if (!wd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -817,7 +817,7 @@ elm_flipselector_item_selected_get(const Elm_Flipselector_Item *item)
|
||||||
ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item, EINA_FALSE);
|
ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item, EINA_FALSE);
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
|
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return EINA_FALSE;
|
if (!wd) return EINA_FALSE;
|
||||||
return (eina_list_data_get(wd->current) == item);
|
return (eina_list_data_get(wd->current) == item);
|
||||||
}
|
}
|
||||||
|
@ -830,7 +830,7 @@ elm_flipselector_item_del(Elm_Flipselector_Item *item)
|
||||||
Elm_Flipselector_Item *item2;
|
Elm_Flipselector_Item *item2;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd)
|
if (!wd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -877,7 +877,7 @@ elm_flipselector_item_label_get(const Elm_Flipselector_Item *item)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if ((!wd) || (!wd->items))
|
if ((!wd) || (!wd->items))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -899,7 +899,7 @@ elm_flipselector_item_label_set(Elm_Flipselector_Item *item, const char *label)
|
||||||
if ((!item) || (!label))
|
if ((!item) || (!label))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if ((!wd) || (!wd->items))
|
if ((!wd) || (!wd->items))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -916,7 +916,7 @@ elm_flipselector_item_label_set(Elm_Flipselector_Item *item, const char *label)
|
||||||
|
|
||||||
if (wd->current == l)
|
if (wd->current == l)
|
||||||
{
|
{
|
||||||
_update_view(item->base.widget);
|
_update_view(WIDGET(item));
|
||||||
_sizing_eval(wd->self);
|
_sizing_eval(wd->self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,7 +932,7 @@ elm_flipselector_item_prev_get(Elm_Flipselector_Item *item)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if ((!wd) || (!wd->items))
|
if ((!wd) || (!wd->items))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -957,7 +957,7 @@ elm_flipselector_item_next_get(Elm_Flipselector_Item *item)
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if ((!wd) || (!wd->items))
|
if ((!wd) || (!wd->items))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -603,7 +603,7 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
|
||||||
|
|
||||||
while (it)
|
while (it)
|
||||||
{
|
{
|
||||||
edje_object_mirrored_set(it->base.view, rtl);
|
edje_object_mirrored_set(VIEW(it), rtl);
|
||||||
elm_gengrid_item_update(it);
|
elm_gengrid_item_update(it);
|
||||||
it = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
it = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
||||||
}
|
}
|
||||||
|
@ -810,10 +810,10 @@ _long_press(void *data)
|
||||||
if (it->wd->reorder_mode)
|
if (it->wd->reorder_mode)
|
||||||
{
|
{
|
||||||
it->wd->reorder_item = it;
|
it->wd->reorder_item = it;
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
elm_smart_scroller_hold_set(it->wd->scr, EINA_TRUE);
|
elm_smart_scroller_hold_set(it->wd->scr, EINA_TRUE);
|
||||||
elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_FALSE);
|
elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_FALSE);
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,reorder,enabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,reorder,enabled", "elm");
|
||||||
}
|
}
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
@ -893,7 +893,7 @@ _mouse_up(void *data,
|
||||||
|
|
||||||
elm_smart_scroller_hold_set(it->wd->scr, EINA_FALSE);
|
elm_smart_scroller_hold_set(it->wd->scr, EINA_FALSE);
|
||||||
elm_smart_scroller_bounce_allow_set(it->wd->scr, it->wd->h_bounce, it->wd->v_bounce);
|
elm_smart_scroller_bounce_allow_set(it->wd->scr, it->wd->h_bounce, it->wd->v_bounce);
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,reorder,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,reorder,disabled", "elm");
|
||||||
}
|
}
|
||||||
if (it->wd->longpressed)
|
if (it->wd->longpressed)
|
||||||
{
|
{
|
||||||
|
@ -940,7 +940,7 @@ static void
|
||||||
_item_highlight(Elm_Gengrid_Item *it)
|
_item_highlight(Elm_Gengrid_Item *it)
|
||||||
{
|
{
|
||||||
if ((it->wd->no_select) || (it->delete_me) || (it->highlighted)) return;
|
if ((it->wd->no_select) || (it->delete_me) || (it->highlighted)) return;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
||||||
it->highlighted = EINA_TRUE;
|
it->highlighted = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -951,22 +951,22 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
char style[1024];
|
char style[1024];
|
||||||
|
|
||||||
if ((it->realized) || (it->delete_me)) return;
|
if ((it->realized) || (it->delete_me)) return;
|
||||||
it->base.view = edje_object_add(evas_object_evas_get(it->wd->self));
|
VIEW(it) = edje_object_add(evas_object_evas_get(it->wd->self));
|
||||||
edje_object_scale_set(it->base.view, elm_widget_scale_get(it->wd->self) *
|
edje_object_scale_set(VIEW(it), elm_widget_scale_get(it->wd->self) *
|
||||||
_elm_config->scale);
|
_elm_config->scale);
|
||||||
edje_object_mirrored_set(it->base.view, elm_widget_mirrored_get(it->base.widget));
|
edje_object_mirrored_set(VIEW(it), elm_widget_mirrored_get(WIDGET(it)));
|
||||||
evas_object_smart_member_add(it->base.view, it->wd->pan_smart);
|
evas_object_smart_member_add(VIEW(it), it->wd->pan_smart);
|
||||||
elm_widget_sub_object_add(it->wd->self, it->base.view);
|
elm_widget_sub_object_add(it->wd->self, VIEW(it));
|
||||||
snprintf(style, sizeof(style), "it/%s",
|
snprintf(style, sizeof(style), "it/%s",
|
||||||
it->itc->item_style ? it->itc->item_style : "default");
|
it->itc->item_style ? it->itc->item_style : "default");
|
||||||
_elm_theme_object_set(it->wd->self, it->base.view, "gengrid", style,
|
_elm_theme_object_set(it->wd->self, VIEW(it), "gengrid", style,
|
||||||
elm_widget_style_get(it->wd->self));
|
elm_widget_style_get(it->wd->self));
|
||||||
it->spacer =
|
it->spacer =
|
||||||
evas_object_rectangle_add(evas_object_evas_get(it->wd->self));
|
evas_object_rectangle_add(evas_object_evas_get(it->wd->self));
|
||||||
evas_object_color_set(it->spacer, 0, 0, 0, 0);
|
evas_object_color_set(it->spacer, 0, 0, 0, 0);
|
||||||
elm_widget_sub_object_add(it->wd->self, it->spacer);
|
elm_widget_sub_object_add(it->wd->self, it->spacer);
|
||||||
evas_object_size_hint_min_set(it->spacer, 2 * _elm_config->scale, 1);
|
evas_object_size_hint_min_set(it->spacer, 2 * _elm_config->scale, 1);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.pad", it->spacer);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.pad", it->spacer);
|
||||||
|
|
||||||
if (it->itc->func.label_get)
|
if (it->itc->func.label_get)
|
||||||
{
|
{
|
||||||
|
@ -974,7 +974,7 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
const char *key;
|
const char *key;
|
||||||
|
|
||||||
it->labels =
|
it->labels =
|
||||||
elm_widget_stringlist_get(edje_object_data_get(it->base.view,
|
elm_widget_stringlist_get(edje_object_data_get(VIEW(it),
|
||||||
"labels"));
|
"labels"));
|
||||||
EINA_LIST_FOREACH(it->labels, l, key)
|
EINA_LIST_FOREACH(it->labels, l, key)
|
||||||
{
|
{
|
||||||
|
@ -982,7 +982,7 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
((void *)it->base.data, it->wd->self, l->data);
|
((void *)it->base.data, it->wd->self, l->data);
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set(it->base.view, l->data, s);
|
edje_object_part_text_set(VIEW(it), l->data, s);
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -994,7 +994,7 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
const char *key;
|
const char *key;
|
||||||
|
|
||||||
it->icons =
|
it->icons =
|
||||||
elm_widget_stringlist_get(edje_object_data_get(it->base.view,
|
elm_widget_stringlist_get(edje_object_data_get(VIEW(it),
|
||||||
"icons"));
|
"icons"));
|
||||||
EINA_LIST_FOREACH(it->icons, l, key)
|
EINA_LIST_FOREACH(it->icons, l, key)
|
||||||
{
|
{
|
||||||
|
@ -1003,7 +1003,7 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
if (ic)
|
if (ic)
|
||||||
{
|
{
|
||||||
it->icon_objs = eina_list_append(it->icon_objs, ic);
|
it->icon_objs = eina_list_append(it->icon_objs, ic);
|
||||||
edje_object_part_swallow(it->base.view, key, ic);
|
edje_object_part_swallow(VIEW(it), key, ic);
|
||||||
evas_object_show(ic);
|
evas_object_show(ic);
|
||||||
elm_widget_sub_object_add(it->wd->self, ic);
|
elm_widget_sub_object_add(it->wd->self, ic);
|
||||||
}
|
}
|
||||||
|
@ -1016,7 +1016,7 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
const char *key;
|
const char *key;
|
||||||
|
|
||||||
it->states =
|
it->states =
|
||||||
elm_widget_stringlist_get(edje_object_data_get(it->base.view,
|
elm_widget_stringlist_get(edje_object_data_get(VIEW(it),
|
||||||
"states"));
|
"states"));
|
||||||
EINA_LIST_FOREACH(it->states, l, key)
|
EINA_LIST_FOREACH(it->states, l, key)
|
||||||
{
|
{
|
||||||
|
@ -1025,7 +1025,7 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
if (on)
|
if (on)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
|
snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
|
||||||
edje_object_signal_emit(it->base.view, buf, "elm");
|
edje_object_signal_emit(VIEW(it), buf, "elm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1034,7 +1034,7 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
{
|
{
|
||||||
if ((!it->wd->group_item_width) && (!it->wd->group_item_height))
|
if ((!it->wd->group_item_width) && (!it->wd->group_item_height))
|
||||||
{
|
{
|
||||||
edje_object_size_min_restricted_calc(it->base.view,
|
edje_object_size_min_restricted_calc(VIEW(it),
|
||||||
&it->wd->group_item_width,
|
&it->wd->group_item_width,
|
||||||
&it->wd->group_item_height,
|
&it->wd->group_item_height,
|
||||||
it->wd->group_item_width,
|
it->wd->group_item_width,
|
||||||
|
@ -1045,7 +1045,7 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
{
|
{
|
||||||
if ((!it->wd->item_width) && (!it->wd->item_height))
|
if ((!it->wd->item_width) && (!it->wd->item_height))
|
||||||
{
|
{
|
||||||
edje_object_size_min_restricted_calc(it->base.view,
|
edje_object_size_min_restricted_calc(VIEW(it),
|
||||||
&it->wd->item_width,
|
&it->wd->item_width,
|
||||||
&it->wd->item_height,
|
&it->wd->item_height,
|
||||||
it->wd->item_width,
|
it->wd->item_width,
|
||||||
|
@ -1054,19 +1054,19 @@ _item_realize(Elm_Gengrid_Item *it)
|
||||||
1, &it->wd->item_height);
|
1, &it->wd->item_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_mouse_down, it);
|
_mouse_down, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_UP,
|
||||||
_mouse_up, it);
|
_mouse_up, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_MOVE,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_MOVE,
|
||||||
_mouse_move, it);
|
_mouse_move, it);
|
||||||
|
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
||||||
}
|
}
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
|
|
||||||
if (it->tooltip.content_cb)
|
if (it->tooltip.content_cb)
|
||||||
{
|
{
|
||||||
|
@ -1095,8 +1095,8 @@ _item_unrealize(Elm_Gengrid_Item *it)
|
||||||
ecore_timer_del(it->long_timer);
|
ecore_timer_del(it->long_timer);
|
||||||
it->long_timer = NULL;
|
it->long_timer = NULL;
|
||||||
}
|
}
|
||||||
evas_object_del(it->base.view);
|
evas_object_del(VIEW(it));
|
||||||
it->base.view = NULL;
|
VIEW(it) = NULL;
|
||||||
evas_object_del(it->spacer);
|
evas_object_del(it->spacer);
|
||||||
it->spacer = NULL;
|
it->spacer = NULL;
|
||||||
elm_widget_stringlist_free(it->labels);
|
elm_widget_stringlist_free(it->labels);
|
||||||
|
@ -1139,35 +1139,35 @@ _reorder_item_moving_effect_timer_cb(void *data)
|
||||||
if ((((dx > 0) && (it->rx >= it->tx)) || ((dx <= 0) && (it->rx <= it->tx))) &&
|
if ((((dx > 0) && (it->rx >= it->tx)) || ((dx <= 0) && (it->rx <= it->tx))) &&
|
||||||
(((dy > 0) && (it->ry >= it->ty)) || ((dy <= 0) && (it->ry <= it->ty))))
|
(((dy > 0) && (it->ry >= it->ty)) || ((dy <= 0) && (it->ry <= it->ty))))
|
||||||
{
|
{
|
||||||
evas_object_move(it->base.view, it->tx, it->ty);
|
evas_object_move(VIEW(it), it->tx, it->ty);
|
||||||
if (it->is_group)
|
if (it->is_group)
|
||||||
{
|
{
|
||||||
Evas_Coord vw, vh;
|
Evas_Coord vw, vh;
|
||||||
evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &vw, &vh);
|
evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &vw, &vh);
|
||||||
if (it->wd->horizontal)
|
if (it->wd->horizontal)
|
||||||
evas_object_resize(it->base.view, it->wd->group_item_width, vh);
|
evas_object_resize(VIEW(it), it->wd->group_item_width, vh);
|
||||||
else
|
else
|
||||||
evas_object_resize(it->base.view, vw, it->wd->group_item_height);
|
evas_object_resize(VIEW(it), vw, it->wd->group_item_height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
evas_object_resize(it->base.view, it->wd->item_width, it->wd->item_height);
|
evas_object_resize(VIEW(it), it->wd->item_width, it->wd->item_height);
|
||||||
it->moving = EINA_FALSE;
|
it->moving = EINA_FALSE;
|
||||||
it->item_moving_effect_timer = NULL;
|
it->item_moving_effect_timer = NULL;
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_move(it->base.view, it->rx, it->ry);
|
evas_object_move(VIEW(it), it->rx, it->ry);
|
||||||
if (it->is_group)
|
if (it->is_group)
|
||||||
{
|
{
|
||||||
Evas_Coord vw, vh;
|
Evas_Coord vw, vh;
|
||||||
evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &vw, &vh);
|
evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &vw, &vh);
|
||||||
if (it->wd->horizontal)
|
if (it->wd->horizontal)
|
||||||
evas_object_resize(it->base.view, it->wd->group_item_width, vh);
|
evas_object_resize(VIEW(it), it->wd->group_item_width, vh);
|
||||||
else
|
else
|
||||||
evas_object_resize(it->base.view, vw, it->wd->group_item_height);
|
evas_object_resize(VIEW(it), vw, it->wd->group_item_height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
evas_object_resize(it->base.view, it->wd->item_width, it->wd->item_height);
|
evas_object_resize(VIEW(it), it->wd->item_width, it->wd->item_height);
|
||||||
|
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
@ -1198,9 +1198,9 @@ _group_item_place(Pan *sd)
|
||||||
_item_realize(it);
|
_item_realize(it);
|
||||||
if (!was_realized)
|
if (!was_realized)
|
||||||
evas_object_smart_callback_call(it->wd->self, SIG_REALIZED, it);
|
evas_object_smart_callback_call(it->wd->self, SIG_REALIZED, it);
|
||||||
evas_object_move(it->base.view, it->gx, it->gy);
|
evas_object_move(VIEW(it), it->gx, it->gy);
|
||||||
evas_object_resize(it->base.view, iw, ih);
|
evas_object_resize(VIEW(it), iw, ih);
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1361,9 +1361,9 @@ _item_place(Elm_Gengrid_Item *it,
|
||||||
}
|
}
|
||||||
if (it->wd->reorder_item == it)
|
if (it->wd->reorder_item == it)
|
||||||
{
|
{
|
||||||
evas_object_move(it->base.view,
|
evas_object_move(VIEW(it),
|
||||||
it->wd->reorder_item_x, it->wd->reorder_item_y);
|
it->wd->reorder_item_x, it->wd->reorder_item_y);
|
||||||
evas_object_resize(it->base.view, iw, ih);
|
evas_object_resize(VIEW(it), iw, ih);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1461,8 +1461,8 @@ _item_place(Elm_Gengrid_Item *it,
|
||||||
}
|
}
|
||||||
if (!it->is_group)
|
if (!it->is_group)
|
||||||
{
|
{
|
||||||
evas_object_move(it->base.view, x, y);
|
evas_object_move(VIEW(it), x, y);
|
||||||
evas_object_resize(it->base.view, iw, ih);
|
evas_object_resize(VIEW(it), iw, ih);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
it->group_realized = EINA_TRUE;
|
it->group_realized = EINA_TRUE;
|
||||||
|
@ -1484,7 +1484,7 @@ static const char *
|
||||||
_item_label_hook(Elm_Gengrid_Item *it, const char *part)
|
_item_label_hook(Elm_Gengrid_Item *it, const char *part)
|
||||||
{
|
{
|
||||||
if (!it->itc->func.label_get) return NULL;
|
if (!it->itc->func.label_get) return NULL;
|
||||||
return edje_object_part_text_get(it->base.view, part);
|
return edje_object_part_text_get(VIEW(it), part);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Elm_Gengrid_Item *
|
static Elm_Gengrid_Item *
|
||||||
|
@ -1524,7 +1524,7 @@ _item_del(Elm_Gengrid_Item *it)
|
||||||
it->wd->items = eina_inlist_remove(it->wd->items, EINA_INLIST_GET(it));
|
it->wd->items = eina_inlist_remove(it->wd->items, EINA_INLIST_GET(it));
|
||||||
if (it->long_timer) ecore_timer_del(it->long_timer);
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
||||||
if (it->tooltip.del_cb)
|
if (it->tooltip.del_cb)
|
||||||
it->tooltip.del_cb((void *)it->tooltip.data, it->base.widget, it);
|
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
|
||||||
it->wd->walking -= it->walking;
|
it->wd->walking -= it->walking;
|
||||||
it->wd->count--;
|
it->wd->count--;
|
||||||
if (it->is_group)
|
if (it->is_group)
|
||||||
|
@ -1556,7 +1556,7 @@ call:
|
||||||
it->wd->walking--;
|
it->wd->walking--;
|
||||||
it->wd->last_selected_item = it;
|
it->wd->last_selected_item = it;
|
||||||
if ((it->wd->clear_me) && (!it->wd->walking))
|
if ((it->wd->clear_me) && (!it->wd->walking))
|
||||||
elm_gengrid_clear(it->base.widget);
|
elm_gengrid_clear(WIDGET(it));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((!it->walking) && (it->delete_me))
|
if ((!it->walking) && (it->delete_me))
|
||||||
|
@ -1568,7 +1568,7 @@ static void
|
||||||
_item_unselect(Elm_Gengrid_Item *it)
|
_item_unselect(Elm_Gengrid_Item *it)
|
||||||
{
|
{
|
||||||
if ((it->delete_me) || (!it->highlighted)) return;
|
if ((it->delete_me) || (!it->highlighted)) return;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,unselected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
|
||||||
it->highlighted = EINA_FALSE;
|
it->highlighted = EINA_FALSE;
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
{
|
{
|
||||||
|
@ -2393,7 +2393,7 @@ EAPI const Evas_Object *
|
||||||
elm_gengrid_item_object_get(const Elm_Gengrid_Item *it)
|
elm_gengrid_item_object_get(const Elm_Gengrid_Item *it)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
||||||
return it->base.view;
|
return VIEW(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -2532,9 +2532,9 @@ elm_gengrid_item_disabled_set(Elm_Gengrid_Item *it,
|
||||||
if (it->realized)
|
if (it->realized)
|
||||||
{
|
{
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2592,11 +2592,11 @@ elm_gengrid_item_tooltip_content_cb_set(Elm_Gengrid_Item *it,
|
||||||
|
|
||||||
if (it->tooltip.del_cb)
|
if (it->tooltip.del_cb)
|
||||||
it->tooltip.del_cb((void *)it->tooltip.data,
|
it->tooltip.del_cb((void *)it->tooltip.data,
|
||||||
it->base.widget, it);
|
WIDGET(it), it);
|
||||||
it->tooltip.content_cb = func;
|
it->tooltip.content_cb = func;
|
||||||
it->tooltip.data = data;
|
it->tooltip.data = data;
|
||||||
it->tooltip.del_cb = del_cb;
|
it->tooltip.del_cb = del_cb;
|
||||||
if (it->base.view)
|
if (VIEW(it))
|
||||||
{
|
{
|
||||||
elm_widget_item_tooltip_content_cb_set(it,
|
elm_widget_item_tooltip_content_cb_set(it,
|
||||||
it->tooltip.content_cb,
|
it->tooltip.content_cb,
|
||||||
|
@ -2615,11 +2615,11 @@ EAPI void
|
||||||
elm_gengrid_item_tooltip_unset(Elm_Gengrid_Item *it)
|
elm_gengrid_item_tooltip_unset(Elm_Gengrid_Item *it)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
||||||
if ((it->base.view) && (it->tooltip.content_cb))
|
if ((VIEW(it)) && (it->tooltip.content_cb))
|
||||||
elm_widget_item_tooltip_unset(it);
|
elm_widget_item_tooltip_unset(it);
|
||||||
|
|
||||||
if (it->tooltip.del_cb)
|
if (it->tooltip.del_cb)
|
||||||
it->tooltip.del_cb((void *)it->tooltip.data, it->base.widget, it);
|
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
|
||||||
it->tooltip.del_cb = NULL;
|
it->tooltip.del_cb = NULL;
|
||||||
it->tooltip.content_cb = NULL;
|
it->tooltip.content_cb = NULL;
|
||||||
it->tooltip.data = NULL;
|
it->tooltip.data = NULL;
|
||||||
|
@ -2634,7 +2634,7 @@ elm_gengrid_item_tooltip_style_set(Elm_Gengrid_Item *it,
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
||||||
eina_stringshare_replace(&it->tooltip.style, style);
|
eina_stringshare_replace(&it->tooltip.style, style);
|
||||||
if (it->base.view) elm_widget_item_tooltip_style_set(it, style);
|
if (VIEW(it)) elm_widget_item_tooltip_style_set(it, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
@ -2649,7 +2649,7 @@ elm_gengrid_item_tooltip_size_restrict_disable(Elm_Gengrid_Item *it, Eina_Bool d
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
||||||
it->tooltip.free_size = disable;
|
it->tooltip.free_size = disable;
|
||||||
if (it->base.view) return elm_widget_item_tooltip_size_restrict_disable(it, disable);
|
if (VIEW(it)) return elm_widget_item_tooltip_size_restrict_disable(it, disable);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2666,7 +2666,7 @@ elm_gengrid_item_cursor_set(Elm_Gengrid_Item *it,
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
||||||
eina_stringshare_replace(&it->mouse_cursor, cursor);
|
eina_stringshare_replace(&it->mouse_cursor, cursor);
|
||||||
if (it->base.view) elm_widget_item_cursor_set(it, cursor);
|
if (VIEW(it)) elm_widget_item_cursor_set(it, cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
@ -2683,7 +2683,7 @@ elm_gengrid_item_cursor_unset(Elm_Gengrid_Item *it)
|
||||||
if (!it->mouse_cursor)
|
if (!it->mouse_cursor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (it->base.view)
|
if (VIEW(it))
|
||||||
elm_widget_item_cursor_unset(it);
|
elm_widget_item_cursor_unset(it);
|
||||||
|
|
||||||
eina_stringshare_del(it->mouse_cursor);
|
eina_stringshare_del(it->mouse_cursor);
|
||||||
|
@ -2939,7 +2939,7 @@ EAPI Evas_Object *
|
||||||
elm_gengrid_item_gengrid_get(const Elm_Gengrid_Item *it)
|
elm_gengrid_item_gengrid_get(const Elm_Gengrid_Item *it)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
||||||
return it->base.widget;
|
return WIDGET(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
|
|
@ -424,7 +424,7 @@ _event_hook(Evas_Object *obj,
|
||||||
it = elm_genlist_selected_item_get(obj);
|
it = elm_genlist_selected_item_get(obj);
|
||||||
elm_genlist_item_expanded_set(it,
|
elm_genlist_item_expanded_set(it,
|
||||||
!elm_genlist_item_expanded_get(it));
|
!elm_genlist_item_expanded_get(it));
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_ACTIVATED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
|
||||||
}
|
}
|
||||||
else return EINA_FALSE;
|
else return EINA_FALSE;
|
||||||
|
|
||||||
|
@ -717,13 +717,13 @@ _item_highlight(Elm_Genlist_Item *it)
|
||||||
if ((it->wd->no_select) || (it->delete_me) || (it->highlighted) ||
|
if ((it->wd->no_select) || (it->delete_me) || (it->highlighted) ||
|
||||||
(it->disabled) || (it->display_only) || (it->mode_view))
|
(it->disabled) || (it->display_only) || (it->mode_view))
|
||||||
return;
|
return;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
||||||
selectraise = edje_object_data_get(it->base.view, "selectraise");
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
||||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||||
{
|
{
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
if ((it->group_item) && (it->group_item->realized))
|
if ((it->group_item) && (it->group_item->realized))
|
||||||
evas_object_raise(it->group_item->base.view);
|
evas_object_raise(it->VIEW(group_item));
|
||||||
}
|
}
|
||||||
it->highlighted = EINA_TRUE;
|
it->highlighted = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -733,13 +733,13 @@ _item_unhighlight(Elm_Genlist_Item *it)
|
||||||
{
|
{
|
||||||
const char *stacking, *selectraise;
|
const char *stacking, *selectraise;
|
||||||
if ((it->delete_me) || (!it->highlighted)) return;
|
if ((it->delete_me) || (!it->highlighted)) return;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,unselected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
|
||||||
stacking = edje_object_data_get(it->base.view, "stacking");
|
stacking = edje_object_data_get(VIEW(it), "stacking");
|
||||||
selectraise = edje_object_data_get(it->base.view, "selectraise");
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
||||||
if (!it->nostacking)
|
if (!it->nostacking)
|
||||||
{
|
{
|
||||||
if ((it->order_num_in & 0x1) ^ it->stacking_even) evas_object_lower(it->base.view);
|
if ((it->order_num_in & 0x1) ^ it->stacking_even) evas_object_lower(VIEW(it));
|
||||||
else evas_object_raise(it->base.view);
|
else evas_object_raise(VIEW(it));
|
||||||
}
|
}
|
||||||
it->highlighted = EINA_FALSE;
|
it->highlighted = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -823,7 +823,7 @@ _item_del(Elm_Genlist_Item *it)
|
||||||
if (it->realized) _item_unrealize(it, EINA_FALSE);
|
if (it->realized) _item_unrealize(it, EINA_FALSE);
|
||||||
if (it->block) _item_block_del(it);
|
if (it->block) _item_block_del(it);
|
||||||
if ((!it->delete_me) && (it->itc->func.del))
|
if ((!it->delete_me) && (it->itc->func.del))
|
||||||
it->itc->func.del((void *)it->base.data, it->base.widget);
|
it->itc->func.del((void *)it->base.data, WIDGET(it));
|
||||||
it->delete_me = EINA_TRUE;
|
it->delete_me = EINA_TRUE;
|
||||||
if (it->queued)
|
if (it->queued)
|
||||||
it->wd->queue = eina_list_remove(it->wd->queue, it);
|
it->wd->queue = eina_list_remove(it->wd->queue, it);
|
||||||
|
@ -842,7 +842,7 @@ _item_del(Elm_Genlist_Item *it)
|
||||||
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
|
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
|
||||||
|
|
||||||
if (it->tooltip.del_cb)
|
if (it->tooltip.del_cb)
|
||||||
it->tooltip.del_cb((void *)it->tooltip.data, it->base.widget, it);
|
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
|
||||||
|
|
||||||
evas_event_thaw(evas_object_evas_get(tob));
|
evas_event_thaw(evas_object_evas_get(tob));
|
||||||
evas_event_thaw_eval(evas_object_evas_get(tob));
|
evas_event_thaw_eval(evas_object_evas_get(tob));
|
||||||
|
@ -853,7 +853,7 @@ _item_del(Elm_Genlist_Item *it)
|
||||||
static void
|
static void
|
||||||
_item_select(Elm_Genlist_Item *it)
|
_item_select(Elm_Genlist_Item *it)
|
||||||
{
|
{
|
||||||
Evas_Object *parent = it->base.widget;
|
Evas_Object *parent = WIDGET(it);
|
||||||
|
|
||||||
if ((it->wd->no_select) || (it->delete_me) || (it->mode_view)) return;
|
if ((it->wd->no_select) || (it->delete_me) || (it->mode_view)) return;
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
|
@ -897,7 +897,7 @@ _item_unselect(Elm_Genlist_Item *it)
|
||||||
if ((it->delete_me) || (!it->selected)) return;
|
if ((it->delete_me) || (!it->selected)) return;
|
||||||
it->selected = EINA_FALSE;
|
it->selected = EINA_FALSE;
|
||||||
it->wd->selected = eina_list_remove(it->wd->selected, it);
|
it->wd->selected = eina_list_remove(it->wd->selected, it);
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_UNSELECTED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -947,7 +947,7 @@ _mouse_move(void *data,
|
||||||
ecore_timer_del(it->long_timer);
|
ecore_timer_del(it->long_timer);
|
||||||
it->long_timer = NULL;
|
it->long_timer = NULL;
|
||||||
}
|
}
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_DRAG, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG, it);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((!it->down) /* || (it->wd->on_hold)*/ || (it->wd->longpressed))
|
if ((!it->down) /* || (it->wd->on_hold)*/ || (it->wd->longpressed))
|
||||||
|
@ -972,7 +972,7 @@ _mouse_move(void *data,
|
||||||
else
|
else
|
||||||
y_pos = it_scrl_y;
|
y_pos = it_scrl_y;
|
||||||
|
|
||||||
_item_position(it, it->base.view, it->scrl_x, y_pos);
|
_item_position(it, VIEW(it), it->scrl_x, y_pos);
|
||||||
|
|
||||||
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
||||||
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
||||||
|
@ -1008,30 +1008,30 @@ _mouse_move(void *data,
|
||||||
if (dy < 0)
|
if (dy < 0)
|
||||||
{
|
{
|
||||||
if (ady > adx)
|
if (ady > adx)
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_DRAG_START_UP, it);
|
SIG_DRAG_START_UP, it);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dx < 0)
|
if (dx < 0)
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_DRAG_START_LEFT, it);
|
SIG_DRAG_START_LEFT, it);
|
||||||
else
|
else
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_DRAG_START_RIGHT, it);
|
SIG_DRAG_START_RIGHT, it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ady > adx)
|
if (ady > adx)
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_DRAG_START_DOWN, it);
|
SIG_DRAG_START_DOWN, it);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dx < 0)
|
if (dx < 0)
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_DRAG_START_LEFT, it);
|
SIG_DRAG_START_LEFT, it);
|
||||||
else
|
else
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_DRAG_START_RIGHT, it);
|
SIG_DRAG_START_RIGHT, it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1048,13 +1048,13 @@ _long_press(void *data)
|
||||||
if ((it->disabled) || (it->dragging) || (it->display_only))
|
if ((it->disabled) || (it->dragging) || (it->display_only))
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
it->wd->longpressed = EINA_TRUE;
|
it->wd->longpressed = EINA_TRUE;
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_LONGPRESSED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
|
||||||
if ((it->wd->reorder_mode) && (it->flags != ELM_GENLIST_ITEM_GROUP))
|
if ((it->wd->reorder_mode) && (it->flags != ELM_GENLIST_ITEM_GROUP))
|
||||||
{
|
{
|
||||||
it->wd->reorder_it = it;
|
it->wd->reorder_it = it;
|
||||||
it->wd->reorder_start_y = 0;
|
it->wd->reorder_start_y = 0;
|
||||||
|
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
elm_smart_scroller_hold_set(it->wd->scr, EINA_TRUE);
|
elm_smart_scroller_hold_set(it->wd->scr, EINA_TRUE);
|
||||||
elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_FALSE);
|
elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_FALSE);
|
||||||
|
|
||||||
|
@ -1068,7 +1068,7 @@ _long_press(void *data)
|
||||||
elm_genlist_item_expanded_set(it, EINA_FALSE);
|
elm_genlist_item_expanded_set(it, EINA_FALSE);
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,reorder,enabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,reorder,enabled", "elm");
|
||||||
}
|
}
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
@ -1089,7 +1089,7 @@ _swipe(Elm_Genlist_Item *it)
|
||||||
|
|
||||||
sum /= it->wd->movements;
|
sum /= it->wd->movements;
|
||||||
if (abs(sum - it->wd->history[0].x) <= 10) return;
|
if (abs(sum - it->wd->history[0].x) <= 10) return;
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_SWIPE, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_SWIPE, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -1144,31 +1144,31 @@ _multi_touch_gesture_eval(void *data)
|
||||||
if ((off_x + off_mx) > (off_y + off_my))
|
if ((off_x + off_mx) > (off_y + off_my))
|
||||||
{
|
{
|
||||||
if ((it->wd->cur_x > it->wd->prev_x) && (it->wd->cur_mx > it->wd->prev_mx))
|
if ((it->wd->cur_x > it->wd->prev_x) && (it->wd->cur_mx > it->wd->prev_mx))
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_MULTI_SWIPE_RIGHT, it);
|
SIG_MULTI_SWIPE_RIGHT, it);
|
||||||
else if ((it->wd->cur_x < it->wd->prev_x) && (it->wd->cur_mx < it->wd->prev_mx))
|
else if ((it->wd->cur_x < it->wd->prev_x) && (it->wd->cur_mx < it->wd->prev_mx))
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_MULTI_SWIPE_LEFT, it);
|
SIG_MULTI_SWIPE_LEFT, it);
|
||||||
else if (abs(it->wd->cur_x - it->wd->cur_mx) > abs(it->wd->prev_x - it->wd->prev_mx))
|
else if (abs(it->wd->cur_x - it->wd->cur_mx) > abs(it->wd->prev_x - it->wd->prev_mx))
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_MULTI_PINCH_OUT, it);
|
SIG_MULTI_PINCH_OUT, it);
|
||||||
else
|
else
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_MULTI_PINCH_IN, it);
|
SIG_MULTI_PINCH_IN, it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((it->wd->cur_y > it->wd->prev_y) && (it->wd->cur_my > it->wd->prev_my))
|
if ((it->wd->cur_y > it->wd->prev_y) && (it->wd->cur_my > it->wd->prev_my))
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_MULTI_SWIPE_DOWN, it);
|
SIG_MULTI_SWIPE_DOWN, it);
|
||||||
else if ((it->wd->cur_y < it->wd->prev_y) && (it->wd->cur_my < it->wd->prev_my))
|
else if ((it->wd->cur_y < it->wd->prev_y) && (it->wd->cur_my < it->wd->prev_my))
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_MULTI_SWIPE_UP, it);
|
SIG_MULTI_SWIPE_UP, it);
|
||||||
else if (abs(it->wd->cur_y - it->wd->cur_my) > abs(it->wd->prev_y - it->wd->prev_my))
|
else if (abs(it->wd->cur_y - it->wd->cur_my) > abs(it->wd->prev_y - it->wd->prev_my))
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_MULTI_PINCH_OUT, it);
|
SIG_MULTI_PINCH_OUT, it);
|
||||||
else
|
else
|
||||||
evas_object_smart_callback_call(it->base.widget,
|
evas_object_smart_callback_call(WIDGET(it),
|
||||||
SIG_MULTI_PINCH_IN, it);
|
SIG_MULTI_PINCH_IN, it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1205,7 +1205,7 @@ _multi_down(void *data,
|
||||||
if (it->dragging)
|
if (it->dragging)
|
||||||
{
|
{
|
||||||
it->dragging = EINA_FALSE;
|
it->dragging = EINA_FALSE;
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_DRAG_STOP, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, it);
|
||||||
}
|
}
|
||||||
if (it->swipe_timer)
|
if (it->swipe_timer)
|
||||||
{
|
{
|
||||||
|
@ -1289,8 +1289,8 @@ _mouse_down(void *data,
|
||||||
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
||||||
if ((!it->disabled) && (!it->display_only))
|
if ((!it->disabled) && (!it->display_only))
|
||||||
{
|
{
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it);
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_ACTIVATED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
|
||||||
}
|
}
|
||||||
if (it->long_timer) ecore_timer_del(it->long_timer);
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
||||||
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
|
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
|
||||||
|
@ -1334,7 +1334,7 @@ _mouse_up(void *data,
|
||||||
if (it->dragging)
|
if (it->dragging)
|
||||||
{
|
{
|
||||||
it->dragging = EINA_FALSE;
|
it->dragging = EINA_FALSE;
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_DRAG_STOP, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, it);
|
||||||
dragged = 1;
|
dragged = 1;
|
||||||
}
|
}
|
||||||
if (it->swipe_timer)
|
if (it->swipe_timer)
|
||||||
|
@ -1371,7 +1371,7 @@ _mouse_up(void *data,
|
||||||
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
||||||
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
||||||
}
|
}
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,reorder,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,reorder,disabled", "elm");
|
||||||
it->wd->reorder_it = it->wd->reorder_rel = NULL;
|
it->wd->reorder_it = it->wd->reorder_rel = NULL;
|
||||||
elm_smart_scroller_hold_set(it->wd->scr, EINA_FALSE);
|
elm_smart_scroller_hold_set(it->wd->scr, EINA_FALSE);
|
||||||
elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_TRUE);
|
elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_TRUE);
|
||||||
|
@ -1453,9 +1453,9 @@ _signal_expand_toggle(void *data,
|
||||||
Elm_Genlist_Item *it = data;
|
Elm_Genlist_Item *it = data;
|
||||||
|
|
||||||
if (it->expanded)
|
if (it->expanded)
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_CONTRACT_REQUEST, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACT_REQUEST, it);
|
||||||
else
|
else
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_EXPAND_REQUEST, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_EXPAND_REQUEST, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1467,7 +1467,7 @@ _signal_expand(void *data,
|
||||||
Elm_Genlist_Item *it = data;
|
Elm_Genlist_Item *it = data;
|
||||||
|
|
||||||
if (!it->expanded)
|
if (!it->expanded)
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_EXPAND_REQUEST, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_EXPAND_REQUEST, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1479,7 +1479,7 @@ _signal_contract(void *data,
|
||||||
Elm_Genlist_Item *it = data;
|
Elm_Genlist_Item *it = data;
|
||||||
|
|
||||||
if (it->expanded)
|
if (it->expanded)
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_CONTRACT_REQUEST, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACT_REQUEST, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -1509,7 +1509,7 @@ _mode_finished_signal_cb(void *data,
|
||||||
it->nocache = EINA_FALSE;
|
it->nocache = EINA_FALSE;
|
||||||
_mode_item_unrealize(it);
|
_mode_item_unrealize(it);
|
||||||
if (it->group_item)
|
if (it->group_item)
|
||||||
evas_object_raise(it->group_item->base.view);
|
evas_object_raise(it->VIEW(group_item));
|
||||||
snprintf(buf, sizeof(buf), "elm,state,%s,passive,finished", it->wd->mode_type);
|
snprintf(buf, sizeof(buf), "elm,state,%s,passive,finished", it->wd->mode_type);
|
||||||
edje_object_signal_callback_del_full(obj, buf, "elm", _mode_finished_signal_cb, it);
|
edje_object_signal_callback_del_full(obj, buf, "elm", _mode_finished_signal_cb, it);
|
||||||
evas_event_thaw(te);
|
evas_event_thaw(te);
|
||||||
|
@ -1554,8 +1554,8 @@ _item_cache_add(Elm_Genlist_Item *it)
|
||||||
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
||||||
if (it->wd->item_cache_max <= 0)
|
if (it->wd->item_cache_max <= 0)
|
||||||
{
|
{
|
||||||
evas_object_del(it->base.view);
|
evas_object_del(VIEW(it));
|
||||||
it->base.view = NULL;
|
VIEW(it) = NULL;
|
||||||
evas_object_del(it->spacer);
|
evas_object_del(it->spacer);
|
||||||
it->spacer = NULL;
|
it->spacer = NULL;
|
||||||
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
||||||
|
@ -1569,8 +1569,8 @@ _item_cache_add(Elm_Genlist_Item *it)
|
||||||
EINA_INLIST_GET(itc));
|
EINA_INLIST_GET(itc));
|
||||||
itc->spacer = it->spacer;
|
itc->spacer = it->spacer;
|
||||||
it->spacer = NULL;
|
it->spacer = NULL;
|
||||||
itc->base_view = it->base.view;
|
itc->base_view = VIEW(it);
|
||||||
it->base.view = NULL;
|
VIEW(it) = NULL;
|
||||||
evas_object_hide(itc->base_view);
|
evas_object_hide(itc->base_view);
|
||||||
evas_object_move(itc->base_view, -9999, -9999);
|
evas_object_move(itc->base_view, -9999, -9999);
|
||||||
itc->item_style = eina_stringshare_add(it->itc->item_style);
|
itc->item_style = eina_stringshare_add(it->itc->item_style);
|
||||||
|
@ -1645,15 +1645,15 @@ _elm_genlist_item_odd_even_update(Elm_Genlist_Item *it)
|
||||||
if (!it->nostacking)
|
if (!it->nostacking)
|
||||||
{
|
{
|
||||||
if ((it->order_num_in & 0x1) ^ it->stacking_even)
|
if ((it->order_num_in & 0x1) ^ it->stacking_even)
|
||||||
evas_object_lower(it->base.view);
|
evas_object_lower(VIEW(it));
|
||||||
else
|
else
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it->order_num_in & 0x1)
|
if (it->order_num_in & 0x1)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,odd", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,odd", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,even", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,even", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1664,32 +1664,32 @@ _elm_genlist_item_state_update(Elm_Genlist_Item *it, Item_Cache *itc)
|
||||||
if (it->selected != itc->selected)
|
if (it->selected != itc->selected)
|
||||||
{
|
{
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,selected", "elm");
|
"elm,state,selected", "elm");
|
||||||
}
|
}
|
||||||
if (it->disabled != itc->disabled)
|
if (it->disabled != itc->disabled)
|
||||||
{
|
{
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,disabled", "elm");
|
"elm,state,disabled", "elm");
|
||||||
}
|
}
|
||||||
if (it->expanded != itc->expanded)
|
if (it->expanded != itc->expanded)
|
||||||
{
|
{
|
||||||
if (it->expanded)
|
if (it->expanded)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,expanded", "elm");
|
"elm,state,expanded", "elm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,selected", "elm");
|
"elm,state,selected", "elm");
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,disabled", "elm");
|
"elm,state,disabled", "elm");
|
||||||
if (it->expanded)
|
if (it->expanded)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,expanded", "elm");
|
"elm,state,expanded", "elm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1707,7 +1707,7 @@ static const char *
|
||||||
_item_label_hook(Elm_Genlist_Item *it, const char *part)
|
_item_label_hook(Elm_Genlist_Item *it, const char *part)
|
||||||
{
|
{
|
||||||
if (!it->itc->func.label_get) return NULL;
|
if (!it->itc->func.label_get) return NULL;
|
||||||
return edje_object_part_text_get(it->base.view, part);
|
return edje_object_part_text_get(VIEW(it), part);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1733,7 +1733,7 @@ _item_label_realize(Elm_Genlist_Item *it,
|
||||||
EINA_LIST_FOREACH(*source, l, key)
|
EINA_LIST_FOREACH(*source, l, key)
|
||||||
{
|
{
|
||||||
char *s = it->itc->func.label_get
|
char *s = it->itc->func.label_get
|
||||||
((void *)it->base.data, it->base.widget, key);
|
((void *)it->base.data, WIDGET(it), key);
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
@ -1764,14 +1764,14 @@ _item_icon_realize(Elm_Genlist_Item *it,
|
||||||
EINA_LIST_FOREACH(*source, l, key)
|
EINA_LIST_FOREACH(*source, l, key)
|
||||||
{
|
{
|
||||||
Evas_Object *ic = it->itc->func.icon_get
|
Evas_Object *ic = it->itc->func.icon_get
|
||||||
((void *)it->base.data, it->base.widget, key);
|
((void *)it->base.data, WIDGET(it), key);
|
||||||
|
|
||||||
if (ic)
|
if (ic)
|
||||||
{
|
{
|
||||||
res = eina_list_append(res, ic);
|
res = eina_list_append(res, ic);
|
||||||
edje_object_part_swallow(target, key, ic);
|
edje_object_part_swallow(target, key, ic);
|
||||||
evas_object_show(ic);
|
evas_object_show(ic);
|
||||||
elm_widget_sub_object_add(it->base.widget, ic);
|
elm_widget_sub_object_add(WIDGET(it), ic);
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
elm_widget_disabled_set(ic, EINA_TRUE);
|
elm_widget_disabled_set(ic, EINA_TRUE);
|
||||||
}
|
}
|
||||||
|
@ -1796,7 +1796,7 @@ _item_state_realize(Elm_Genlist_Item *it,
|
||||||
EINA_LIST_FOREACH(*source, l, key)
|
EINA_LIST_FOREACH(*source, l, key)
|
||||||
{
|
{
|
||||||
Eina_Bool on = it->itc->func.state_get
|
Eina_Bool on = it->itc->func.state_get
|
||||||
((void *)it->base.data, it->base.widget, key);
|
((void *)it->base.data, WIDGET(it), key);
|
||||||
|
|
||||||
if (on)
|
if (on)
|
||||||
{
|
{
|
||||||
|
@ -1845,7 +1845,7 @@ _item_realize(Elm_Genlist_Item *it,
|
||||||
itc = _item_cache_find(it);
|
itc = _item_cache_find(it);
|
||||||
if (itc)
|
if (itc)
|
||||||
{
|
{
|
||||||
it->base.view = itc->base_view;
|
VIEW(it) = itc->base_view;
|
||||||
itc->base_view = NULL;
|
itc->base_view = NULL;
|
||||||
it->spacer = itc->spacer;
|
it->spacer = itc->spacer;
|
||||||
itc->spacer = NULL;
|
itc->spacer = NULL;
|
||||||
|
@ -1855,12 +1855,12 @@ _item_realize(Elm_Genlist_Item *it,
|
||||||
const char *stacking_even;
|
const char *stacking_even;
|
||||||
const char *stacking;
|
const char *stacking;
|
||||||
|
|
||||||
it->base.view = edje_object_add(evas_object_evas_get(it->base.widget));
|
VIEW(it) = edje_object_add(evas_object_evas_get(WIDGET(it)));
|
||||||
edje_object_scale_set(it->base.view,
|
edje_object_scale_set(VIEW(it),
|
||||||
elm_widget_scale_get(it->base.widget) *
|
elm_widget_scale_get(WIDGET(it)) *
|
||||||
_elm_config->scale);
|
_elm_config->scale);
|
||||||
evas_object_smart_member_add(it->base.view, it->wd->pan_smart);
|
evas_object_smart_member_add(VIEW(it), it->wd->pan_smart);
|
||||||
elm_widget_sub_object_add(it->base.widget, it->base.view);
|
elm_widget_sub_object_add(WIDGET(it), VIEW(it));
|
||||||
|
|
||||||
if (it->flags & ELM_GENLIST_ITEM_SUBITEMS)
|
if (it->flags & ELM_GENLIST_ITEM_SUBITEMS)
|
||||||
strncpy(buf, "tree", sizeof(buf));
|
strncpy(buf, "tree", sizeof(buf));
|
||||||
|
@ -1871,23 +1871,23 @@ _item_realize(Elm_Genlist_Item *it,
|
||||||
strncat(buf, "/", sizeof(buf) - strlen(buf));
|
strncat(buf, "/", sizeof(buf) - strlen(buf));
|
||||||
strncat(buf, it->itc->item_style, sizeof(buf) - strlen(buf));
|
strncat(buf, it->itc->item_style, sizeof(buf) - strlen(buf));
|
||||||
|
|
||||||
_elm_theme_object_set(it->base.widget, it->base.view, "genlist", buf,
|
_elm_theme_object_set(WIDGET(it), VIEW(it), "genlist", buf,
|
||||||
elm_widget_style_get(it->base.widget));
|
elm_widget_style_get(WIDGET(it)));
|
||||||
|
|
||||||
stacking_even = edje_object_data_get(it->base.view, "stacking_even");
|
stacking_even = edje_object_data_get(VIEW(it), "stacking_even");
|
||||||
if (!stacking_even) stacking_even = "above";
|
if (!stacking_even) stacking_even = "above";
|
||||||
it->stacking_even = !!strcmp("above", stacking_even);
|
it->stacking_even = !!strcmp("above", stacking_even);
|
||||||
|
|
||||||
stacking = edje_object_data_get(it->base.view, "stacking");
|
stacking = edje_object_data_get(VIEW(it), "stacking");
|
||||||
if (!stacking) stacking = "yes";
|
if (!stacking) stacking = "yes";
|
||||||
it->nostacking = !!strcmp("yes", stacking);
|
it->nostacking = !!strcmp("yes", stacking);
|
||||||
|
|
||||||
edje_object_mirrored_set(it->base.view,
|
edje_object_mirrored_set(VIEW(it),
|
||||||
elm_widget_mirrored_get(it->base.widget));
|
elm_widget_mirrored_get(WIDGET(it)));
|
||||||
it->spacer =
|
it->spacer =
|
||||||
evas_object_rectangle_add(evas_object_evas_get(it->base.widget));
|
evas_object_rectangle_add(evas_object_evas_get(WIDGET(it)));
|
||||||
evas_object_color_set(it->spacer, 0, 0, 0, 0);
|
evas_object_color_set(it->spacer, 0, 0, 0, 0);
|
||||||
elm_widget_sub_object_add(it->base.widget, it->spacer);
|
elm_widget_sub_object_add(WIDGET(it), it->spacer);
|
||||||
}
|
}
|
||||||
|
|
||||||
_elm_genlist_item_odd_even_update(it);
|
_elm_genlist_item_odd_even_update(it);
|
||||||
|
@ -1897,31 +1897,31 @@ _item_realize(Elm_Genlist_Item *it,
|
||||||
if (it2->parent->flags != ELM_GENLIST_ITEM_GROUP) depth += 1;
|
if (it2->parent->flags != ELM_GENLIST_ITEM_GROUP) depth += 1;
|
||||||
}
|
}
|
||||||
it->expanded_depth = depth;
|
it->expanded_depth = depth;
|
||||||
treesize = edje_object_data_get(it->base.view, "treesize");
|
treesize = edje_object_data_get(VIEW(it), "treesize");
|
||||||
if (treesize) tsize = atoi(treesize);
|
if (treesize) tsize = atoi(treesize);
|
||||||
evas_object_size_hint_min_set(it->spacer,
|
evas_object_size_hint_min_set(it->spacer,
|
||||||
(depth * tsize) * _elm_config->scale, 1);
|
(depth * tsize) * _elm_config->scale, 1);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.pad", it->spacer);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.pad", it->spacer);
|
||||||
if (!calc)
|
if (!calc)
|
||||||
{
|
{
|
||||||
edje_object_signal_callback_add(it->base.view,
|
edje_object_signal_callback_add(VIEW(it),
|
||||||
"elm,action,expand,toggle",
|
"elm,action,expand,toggle",
|
||||||
"elm", _signal_expand_toggle, it);
|
"elm", _signal_expand_toggle, it);
|
||||||
edje_object_signal_callback_add(it->base.view, "elm,action,expand",
|
edje_object_signal_callback_add(VIEW(it), "elm,action,expand",
|
||||||
"elm", _signal_expand, it);
|
"elm", _signal_expand, it);
|
||||||
edje_object_signal_callback_add(it->base.view, "elm,action,contract",
|
edje_object_signal_callback_add(VIEW(it), "elm,action,contract",
|
||||||
"elm", _signal_contract, it);
|
"elm", _signal_contract, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_mouse_down, it);
|
_mouse_down, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_UP,
|
||||||
_mouse_up, it);
|
_mouse_up, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_MOVE,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_MOVE,
|
||||||
_mouse_move, it);
|
_mouse_move, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MULTI_DOWN,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MULTI_DOWN,
|
||||||
_multi_down, it);
|
_multi_down, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MULTI_UP,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MULTI_UP,
|
||||||
_multi_up, it);
|
_multi_up, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MULTI_MOVE,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MULTI_MOVE,
|
||||||
_multi_move, it);
|
_multi_move, it);
|
||||||
|
|
||||||
_elm_genlist_item_state_update(it, itc);
|
_elm_genlist_item_state_update(it, itc);
|
||||||
|
@ -1953,9 +1953,9 @@ _item_realize(Elm_Genlist_Item *it,
|
||||||
will clean our mess */
|
will clean our mess */
|
||||||
assert(eina_list_count(it->icon_objs) == 0);
|
assert(eina_list_count(it->icon_objs) == 0);
|
||||||
|
|
||||||
_item_label_realize(it, it->base.view, &it->labels);
|
_item_label_realize(it, VIEW(it), &it->labels);
|
||||||
it->icon_objs = _item_icon_realize(it, it->base.view, &it->icons);
|
it->icon_objs = _item_icon_realize(it, VIEW(it), &it->icons);
|
||||||
_item_state_realize(it, it->base.view, &it->states);
|
_item_state_realize(it, VIEW(it), &it->states);
|
||||||
|
|
||||||
if (!it->mincalcd)
|
if (!it->mincalcd)
|
||||||
{
|
{
|
||||||
|
@ -1964,7 +1964,7 @@ _item_realize(Elm_Genlist_Item *it,
|
||||||
if (!it->display_only)
|
if (!it->display_only)
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
if (it->wd->height_for_width) mw = it->wd->prev_viewport_w;
|
if (it->wd->height_for_width) mw = it->wd->prev_viewport_w;
|
||||||
edje_object_size_min_restricted_calc(it->base.view, &mw, &mh, mw,
|
edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw,
|
||||||
mh);
|
mh);
|
||||||
if (!it->display_only)
|
if (!it->display_only)
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
|
@ -1983,7 +1983,7 @@ _item_realize(Elm_Genlist_Item *it,
|
||||||
it->wd->item_height = mh;
|
it->wd->item_height = mh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!calc) evas_object_show(it->base.view);
|
if (!calc) evas_object_show(VIEW(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it->tooltip.content_cb)
|
if (it->tooltip.content_cb)
|
||||||
|
@ -2005,8 +2005,8 @@ _item_realize(Elm_Genlist_Item *it,
|
||||||
//evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
//evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
||||||
//evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
//evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
||||||
if (!calc)
|
if (!calc)
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_REALIZED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
|
||||||
edje_object_message_signal_process(it->base.view);
|
edje_object_message_signal_process(VIEW(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2019,7 +2019,7 @@ _item_unrealize(Elm_Genlist_Item *it,
|
||||||
if (it->wd->reorder_it == it) return;
|
if (it->wd->reorder_it == it) return;
|
||||||
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
||||||
if (!calc)
|
if (!calc)
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_UNREALIZED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_UNREALIZED, it);
|
||||||
if (it->long_timer)
|
if (it->long_timer)
|
||||||
{
|
{
|
||||||
ecore_timer_del(it->long_timer);
|
ecore_timer_del(it->long_timer);
|
||||||
|
@ -2027,17 +2027,17 @@ _item_unrealize(Elm_Genlist_Item *it,
|
||||||
}
|
}
|
||||||
if (it->nocache)
|
if (it->nocache)
|
||||||
{
|
{
|
||||||
evas_object_del(it->base.view);
|
evas_object_del(VIEW(it));
|
||||||
it->base.view = NULL;
|
VIEW(it) = NULL;
|
||||||
evas_object_del(it->spacer);
|
evas_object_del(it->spacer);
|
||||||
it->spacer = NULL;
|
it->spacer = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_mirrored_set(it->base.view,
|
edje_object_mirrored_set(VIEW(it),
|
||||||
elm_widget_mirrored_get(it->base.widget));
|
elm_widget_mirrored_get(WIDGET(it)));
|
||||||
edje_object_scale_set(it->base.view,
|
edje_object_scale_set(VIEW(it),
|
||||||
elm_widget_scale_get(it->base.widget)
|
elm_widget_scale_get(WIDGET(it))
|
||||||
* _elm_config->scale);
|
* _elm_config->scale);
|
||||||
_item_cache_add(it);
|
_item_cache_add(it);
|
||||||
}
|
}
|
||||||
|
@ -2159,7 +2159,7 @@ _get_space_for_reorder_item(Elm_Genlist_Item *it)
|
||||||
if (!reorder_it) return 0;
|
if (!reorder_it) return 0;
|
||||||
|
|
||||||
evas_object_geometry_get(it->wd->pan_smart, NULL, &oy, NULL, &oh);
|
evas_object_geometry_get(it->wd->pan_smart, NULL, &oy, NULL, &oh);
|
||||||
evas_object_geometry_get(it->wd->reorder_it->base.view, &rox, &roy, &row, &roh);
|
evas_object_geometry_get(it->wd->VIEW(reorder_it), &rox, &roy, &row, &roh);
|
||||||
|
|
||||||
if ((it->wd->reorder_start_y < it->block->y) &&
|
if ((it->wd->reorder_start_y < it->block->y) &&
|
||||||
(roy - oy + (roh / 2) >= it->block->y - it->wd->pan_y))
|
(roy - oy + (roh / 2) >= it->block->y - it->wd->pan_y))
|
||||||
|
@ -2216,7 +2216,7 @@ _reorder_move_animator_cb(void *data)
|
||||||
it->old_scrl_y -= y;
|
it->old_scrl_y -= y;
|
||||||
down = EINA_FALSE;
|
down = EINA_FALSE;
|
||||||
}
|
}
|
||||||
_item_position(it, it->base.view, it->scrl_x, it->old_scrl_y);
|
_item_position(it, VIEW(it), it->scrl_x, it->old_scrl_y);
|
||||||
_group_items_recalc(it->wd);
|
_group_items_recalc(it->wd);
|
||||||
|
|
||||||
if ((it->wd->reorder_pan_move) ||
|
if ((it->wd->reorder_pan_move) ||
|
||||||
|
@ -2311,7 +2311,7 @@ _item_block_position(Item_Block *itb,
|
||||||
_item_position(it, it->mode_view, it->scrl_x,
|
_item_position(it, it->mode_view, it->scrl_x,
|
||||||
it->scrl_y);
|
it->scrl_y);
|
||||||
else
|
else
|
||||||
_item_position(it, it->base.view, it->scrl_x,
|
_item_position(it, VIEW(it), it->scrl_x,
|
||||||
it->scrl_y);
|
it->scrl_y);
|
||||||
it->old_scrl_y = it->scrl_y;
|
it->old_scrl_y = it->scrl_y;
|
||||||
}
|
}
|
||||||
|
@ -2347,10 +2347,10 @@ _group_items_recalc(void *data)
|
||||||
{
|
{
|
||||||
if (!git->realized)
|
if (!git->realized)
|
||||||
_item_realize(git, 0, EINA_FALSE);
|
_item_realize(git, 0, EINA_FALSE);
|
||||||
evas_object_resize(git->base.view, wd->minw, git->h);
|
evas_object_resize(VIEW(git), wd->minw, git->h);
|
||||||
evas_object_move(git->base.view, git->scrl_x, git->scrl_y);
|
evas_object_move(VIEW(git), git->scrl_x, git->scrl_y);
|
||||||
evas_object_show(git->base.view);
|
evas_object_show(VIEW(git));
|
||||||
evas_object_raise(git->base.view);
|
evas_object_raise(VIEW(git));
|
||||||
}
|
}
|
||||||
else if (!git->want_realize && git->realized)
|
else if (!git->want_realize && git->realized)
|
||||||
{
|
{
|
||||||
|
@ -2780,7 +2780,7 @@ _pan_calculate(Evas_Object *obj)
|
||||||
if (sd->wd->pan_y != sd->wd->reorder_old_pan_y)
|
if (sd->wd->pan_y != sd->wd->reorder_old_pan_y)
|
||||||
sd->wd->reorder_pan_move = EINA_TRUE;
|
sd->wd->reorder_pan_move = EINA_TRUE;
|
||||||
else sd->wd->reorder_pan_move = EINA_FALSE;
|
else sd->wd->reorder_pan_move = EINA_FALSE;
|
||||||
evas_object_raise(sd->wd->reorder_it->base.view);
|
evas_object_raise(sd->wd->VIEW(reorder_it));
|
||||||
sd->wd->reorder_old_pan_y = sd->wd->pan_y;
|
sd->wd->reorder_old_pan_y = sd->wd->pan_y;
|
||||||
sd->wd->start_time = ecore_loop_time_get();
|
sd->wd->start_time = ecore_loop_time_get();
|
||||||
}
|
}
|
||||||
|
@ -2921,12 +2921,12 @@ _mode_item_realize(Elm_Genlist_Item *it)
|
||||||
if ((it->mode_view) || (it->delete_me)) return;
|
if ((it->mode_view) || (it->delete_me)) return;
|
||||||
|
|
||||||
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
||||||
it->mode_view = edje_object_add(evas_object_evas_get(it->base.widget));
|
it->mode_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
|
||||||
edje_object_scale_set(it->mode_view,
|
edje_object_scale_set(it->mode_view,
|
||||||
elm_widget_scale_get(it->base.widget) *
|
elm_widget_scale_get(WIDGET(it)) *
|
||||||
_elm_config->scale);
|
_elm_config->scale);
|
||||||
evas_object_smart_member_add(it->mode_view, it->wd->pan_smart);
|
evas_object_smart_member_add(it->mode_view, it->wd->pan_smart);
|
||||||
elm_widget_sub_object_add(it->base.widget, it->mode_view);
|
elm_widget_sub_object_add(WIDGET(it), it->mode_view);
|
||||||
|
|
||||||
strncpy(buf, "it", sizeof(buf));
|
strncpy(buf, "it", sizeof(buf));
|
||||||
if (it->wd->compress)
|
if (it->wd->compress)
|
||||||
|
@ -2936,10 +2936,10 @@ _mode_item_realize(Elm_Genlist_Item *it)
|
||||||
strncat(buf, "/", sizeof(buf) - strlen(buf));
|
strncat(buf, "/", sizeof(buf) - strlen(buf));
|
||||||
strncat(buf, it->itc->mode_item_style, sizeof(buf) - strlen(buf));
|
strncat(buf, it->itc->mode_item_style, sizeof(buf) - strlen(buf));
|
||||||
|
|
||||||
_elm_theme_object_set(it->base.widget, it->mode_view, "genlist", buf,
|
_elm_theme_object_set(WIDGET(it), it->mode_view, "genlist", buf,
|
||||||
elm_widget_style_get(it->base.widget));
|
elm_widget_style_get(WIDGET(it)));
|
||||||
edje_object_mirrored_set(it->mode_view,
|
edje_object_mirrored_set(it->mode_view,
|
||||||
elm_widget_mirrored_get(it->base.widget));
|
elm_widget_mirrored_get(WIDGET(it)));
|
||||||
|
|
||||||
/* signal callback add */
|
/* signal callback add */
|
||||||
evas_object_event_callback_add(it->mode_view, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(it->mode_view, EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
|
@ -2962,7 +2962,7 @@ _mode_item_realize(Elm_Genlist_Item *it)
|
||||||
|
|
||||||
edje_object_part_swallow(it->mode_view,
|
edje_object_part_swallow(it->mode_view,
|
||||||
edje_object_data_get(it->mode_view, "mode_part"),
|
edje_object_data_get(it->mode_view, "mode_part"),
|
||||||
it->base.view);
|
VIEW(it));
|
||||||
|
|
||||||
it->want_unrealize = EINA_FALSE;
|
it->want_unrealize = EINA_FALSE;
|
||||||
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
||||||
|
@ -2986,8 +2986,8 @@ _mode_item_unrealize(Elm_Genlist_Item *it)
|
||||||
EINA_LIST_FREE(it->mode_icon_objs, icon)
|
EINA_LIST_FREE(it->mode_icon_objs, icon)
|
||||||
evas_object_del(icon);
|
evas_object_del(icon);
|
||||||
|
|
||||||
edje_object_part_unswallow(it->mode_view, it->base.view);
|
edje_object_part_unswallow(it->mode_view, VIEW(it));
|
||||||
evas_object_smart_member_add(it->base.view, wd->pan_smart);
|
evas_object_smart_member_add(VIEW(it), wd->pan_smart);
|
||||||
evas_object_del(it->mode_view);
|
evas_object_del(it->mode_view);
|
||||||
it->mode_view = NULL;
|
it->mode_view = NULL;
|
||||||
|
|
||||||
|
@ -3019,7 +3019,7 @@ _item_mode_set(Elm_Genlist_Item *it)
|
||||||
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
||||||
_mode_item_realize(it);
|
_mode_item_realize(it);
|
||||||
if (it->group_item)
|
if (it->group_item)
|
||||||
evas_object_raise(it->group_item->base.view);
|
evas_object_raise(it->VIEW(group_item));
|
||||||
_item_position(it, it->mode_view, it->scrl_x, it->scrl_y);
|
_item_position(it, it->mode_view, it->scrl_x, it->scrl_y);
|
||||||
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
||||||
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
||||||
|
@ -3476,7 +3476,7 @@ _item_move_after(Elm_Genlist_Item *it, Elm_Genlist_Item *after)
|
||||||
|
|
||||||
// TODO: change this to smart callback
|
// TODO: change this to smart callback
|
||||||
if (it->itc->func.moved)
|
if (it->itc->func.moved)
|
||||||
it->itc->func.moved(it->base.widget, it, after, EINA_TRUE);
|
it->itc->func.moved(WIDGET(it), it, after, EINA_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3496,7 +3496,7 @@ _item_move_before(Elm_Genlist_Item *it, Elm_Genlist_Item *before)
|
||||||
|
|
||||||
// TODO: change this to smart callback
|
// TODO: change this to smart callback
|
||||||
if (it->itc->func.moved)
|
if (it->itc->func.moved)
|
||||||
it->itc->func.moved(it->base.widget, it, before, EINA_FALSE);
|
it->itc->func.moved(WIDGET(it), it, before, EINA_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Elm_Genlist_Item *
|
EAPI Elm_Genlist_Item *
|
||||||
|
@ -3799,7 +3799,7 @@ elm_genlist_clear(Evas_Object *obj)
|
||||||
elm_widget_item_pre_notify_del(it);
|
elm_widget_item_pre_notify_del(it);
|
||||||
if (it->realized) _item_unrealize(it, EINA_FALSE);
|
if (it->realized) _item_unrealize(it, EINA_FALSE);
|
||||||
if (((wd->clear_me) || (!it->delete_me)) && (it->itc->func.del))
|
if (((wd->clear_me) || (!it->delete_me)) && (it->itc->func.del))
|
||||||
it->itc->func.del((void *)it->base.data, it->base.widget);
|
it->itc->func.del((void *)it->base.data, WIDGET(it));
|
||||||
if (it->long_timer) ecore_timer_del(it->long_timer);
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
||||||
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
|
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
|
||||||
elm_widget_item_del(it);
|
elm_widget_item_del(it);
|
||||||
|
@ -4034,7 +4034,7 @@ EAPI Evas_Object *
|
||||||
elm_genlist_item_genlist_get(const Elm_Genlist_Item *it)
|
elm_genlist_item_genlist_get(const Elm_Genlist_Item *it)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
||||||
return it->base.widget;
|
return WIDGET(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Elm_Genlist_Item *
|
EAPI Elm_Genlist_Item *
|
||||||
|
@ -4062,7 +4062,7 @@ elm_genlist_item_selected_set(Elm_Genlist_Item *it,
|
||||||
Eina_Bool selected)
|
Eina_Bool selected)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if ((it->delete_me) || (it->disabled)) return;
|
if ((it->delete_me) || (it->disabled)) return;
|
||||||
selected = !!selected;
|
selected = !!selected;
|
||||||
|
@ -4106,15 +4106,15 @@ elm_genlist_item_expanded_set(Elm_Genlist_Item *it,
|
||||||
if (it->expanded)
|
if (it->expanded)
|
||||||
{
|
{
|
||||||
if (it->realized)
|
if (it->realized)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,expanded", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,expanded", "elm");
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_EXPANDED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_EXPANDED, it);
|
||||||
it->wd->auto_scroll_enabled = EINA_TRUE;
|
it->wd->auto_scroll_enabled = EINA_TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (it->realized)
|
if (it->realized)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,contracted", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,contracted", "elm");
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_CONTRACTED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACTED, it);
|
||||||
it->wd->auto_scroll_enabled = EINA_FALSE;
|
it->wd->auto_scroll_enabled = EINA_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4148,9 +4148,9 @@ elm_genlist_item_disabled_set(Elm_Genlist_Item *it,
|
||||||
if (it->realized)
|
if (it->realized)
|
||||||
{
|
{
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
|
||||||
EINA_LIST_FOREACH(it->icon_objs, l, obj)
|
EINA_LIST_FOREACH(it->icon_objs, l, obj)
|
||||||
elm_widget_disabled_set(obj, disabled);
|
elm_widget_disabled_set(obj, disabled);
|
||||||
}
|
}
|
||||||
|
@ -4368,7 +4368,7 @@ elm_genlist_item_del(Elm_Genlist_Item *it)
|
||||||
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
||||||
}
|
}
|
||||||
if (it->itc->func.del)
|
if (it->itc->func.del)
|
||||||
it->itc->func.del((void *)it->base.data, it->base.widget);
|
it->itc->func.del((void *)it->base.data, WIDGET(it));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_item_del(it);
|
_item_del(it);
|
||||||
|
@ -4396,7 +4396,7 @@ elm_genlist_item_icons_orphan(Elm_Genlist_Item *it)
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
||||||
EINA_LIST_FREE(it->icon_objs, icon)
|
EINA_LIST_FREE(it->icon_objs, icon)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_del(it->base.widget, icon);
|
elm_widget_sub_object_del(WIDGET(it), icon);
|
||||||
evas_object_smart_member_del(icon);
|
evas_object_smart_member_del(icon);
|
||||||
evas_object_hide(icon);
|
evas_object_hide(icon);
|
||||||
}
|
}
|
||||||
|
@ -4406,7 +4406,7 @@ EAPI const Evas_Object *
|
||||||
elm_genlist_item_object_get(const Elm_Genlist_Item *it)
|
elm_genlist_item_object_get(const Elm_Genlist_Item *it)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
||||||
return it->base.view;
|
return VIEW(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -4489,13 +4489,13 @@ elm_genlist_item_tooltip_content_cb_set(Elm_Genlist_Item *it,
|
||||||
|
|
||||||
if (it->tooltip.del_cb)
|
if (it->tooltip.del_cb)
|
||||||
it->tooltip.del_cb((void *)it->tooltip.data,
|
it->tooltip.del_cb((void *)it->tooltip.data,
|
||||||
it->base.widget, it);
|
WIDGET(it), it);
|
||||||
|
|
||||||
it->tooltip.content_cb = func;
|
it->tooltip.content_cb = func;
|
||||||
it->tooltip.data = data;
|
it->tooltip.data = data;
|
||||||
it->tooltip.del_cb = del_cb;
|
it->tooltip.del_cb = del_cb;
|
||||||
|
|
||||||
if (it->base.view)
|
if (VIEW(it))
|
||||||
{
|
{
|
||||||
elm_widget_item_tooltip_content_cb_set(it,
|
elm_widget_item_tooltip_content_cb_set(it,
|
||||||
it->tooltip.content_cb,
|
it->tooltip.content_cb,
|
||||||
|
@ -4514,11 +4514,11 @@ EAPI void
|
||||||
elm_genlist_item_tooltip_unset(Elm_Genlist_Item *it)
|
elm_genlist_item_tooltip_unset(Elm_Genlist_Item *it)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
||||||
if ((it->base.view) && (it->tooltip.content_cb))
|
if ((VIEW(it)) && (it->tooltip.content_cb))
|
||||||
elm_widget_item_tooltip_unset(it);
|
elm_widget_item_tooltip_unset(it);
|
||||||
|
|
||||||
if (it->tooltip.del_cb)
|
if (it->tooltip.del_cb)
|
||||||
it->tooltip.del_cb((void *)it->tooltip.data, it->base.widget, it);
|
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
|
||||||
it->tooltip.del_cb = NULL;
|
it->tooltip.del_cb = NULL;
|
||||||
it->tooltip.content_cb = NULL;
|
it->tooltip.content_cb = NULL;
|
||||||
it->tooltip.data = NULL;
|
it->tooltip.data = NULL;
|
||||||
|
@ -4533,7 +4533,7 @@ elm_genlist_item_tooltip_style_set(Elm_Genlist_Item *it,
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
||||||
eina_stringshare_replace(&it->tooltip.style, style);
|
eina_stringshare_replace(&it->tooltip.style, style);
|
||||||
if (it->base.view) elm_widget_item_tooltip_style_set(it, style);
|
if (VIEW(it)) elm_widget_item_tooltip_style_set(it, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
@ -4548,7 +4548,7 @@ elm_genlist_item_tooltip_size_restrict_disable(Elm_Genlist_Item *it, Eina_Bool d
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
||||||
it->tooltip.free_size = disable;
|
it->tooltip.free_size = disable;
|
||||||
if (it->base.view) return elm_widget_item_tooltip_size_restrict_disable(it, disable);
|
if (VIEW(it)) return elm_widget_item_tooltip_size_restrict_disable(it, disable);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4565,7 +4565,7 @@ elm_genlist_item_cursor_set(Elm_Genlist_Item *it,
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
|
||||||
eina_stringshare_replace(&it->mouse_cursor, cursor);
|
eina_stringshare_replace(&it->mouse_cursor, cursor);
|
||||||
if (it->base.view) elm_widget_item_cursor_set(it, cursor);
|
if (VIEW(it)) elm_widget_item_cursor_set(it, cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
@ -4582,7 +4582,7 @@ elm_genlist_item_cursor_unset(Elm_Genlist_Item *it)
|
||||||
if (!it->mouse_cursor)
|
if (!it->mouse_cursor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (it->base.view)
|
if (VIEW(it))
|
||||||
elm_widget_item_cursor_unset(it);
|
elm_widget_item_cursor_unset(it);
|
||||||
|
|
||||||
eina_stringshare_del(it->mouse_cursor);
|
eina_stringshare_del(it->mouse_cursor);
|
||||||
|
|
|
@ -211,7 +211,7 @@ _item_find(Evas_Object *obj, const void *item)
|
||||||
static void
|
static void
|
||||||
_item_free(Elm_Index_Item *it)
|
_item_free(Elm_Index_Item *it)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
wd->items = eina_list_remove(wd->items, it);
|
wd->items = eina_list_remove(wd->items, it);
|
||||||
elm_widget_item_pre_notify_del(it);
|
elm_widget_item_pre_notify_del(it);
|
||||||
|
@ -240,8 +240,8 @@ _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level)
|
||||||
|
|
||||||
if (it->level != level) continue;
|
if (it->level != level) continue;
|
||||||
o = edje_object_add(evas_object_evas_get(obj));
|
o = edje_object_add(evas_object_evas_get(obj));
|
||||||
it->base.view = o;
|
VIEW(it) = o;
|
||||||
edje_object_mirrored_set(it->base.view, rtl);
|
edje_object_mirrored_set(VIEW(it), rtl);
|
||||||
if (i & 0x1)
|
if (i & 0x1)
|
||||||
_elm_theme_object_set(obj, o, "index", "item_odd/vertical", elm_widget_style_get(obj));
|
_elm_theme_object_set(obj, o, "index", "item_odd/vertical", elm_widget_style_get(obj));
|
||||||
else
|
else
|
||||||
|
@ -286,10 +286,10 @@ _index_box_clear(Evas_Object *obj, Evas_Object *box __UNUSED__, int level)
|
||||||
if (!wd->level_active[level]) return;
|
if (!wd->level_active[level]) return;
|
||||||
EINA_LIST_FOREACH(wd->items, l, it)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
if (!it->base.view) continue;
|
if (!VIEW(it)) continue;
|
||||||
if (it->level != level) continue;
|
if (it->level != level) continue;
|
||||||
evas_object_del(it->base.view);
|
evas_object_del(VIEW(it));
|
||||||
it->base.view = NULL;
|
VIEW(it) = NULL;
|
||||||
}
|
}
|
||||||
wd->level_active[level] = 0;
|
wd->level_active[level] = 0;
|
||||||
}
|
}
|
||||||
|
@ -326,8 +326,8 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy)
|
||||||
evas_object_geometry_get(wd->bx[i], &bx, &by, &bw, &bh);
|
evas_object_geometry_get(wd->bx[i], &bx, &by, &bw, &bh);
|
||||||
EINA_LIST_FOREACH(wd->items, l, it)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
if (!((it->level == i) && (it->base.view))) continue;
|
if (!((it->level == i) && (VIEW(it)))) continue;
|
||||||
if ((it->base.view) && (it->level != wd->level))
|
if ((VIEW(it)) && (it->level != wd->level))
|
||||||
{
|
{
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
{
|
{
|
||||||
|
@ -341,7 +341,7 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy)
|
||||||
it_last = it;
|
it_last = it;
|
||||||
it->selected = 0;
|
it->selected = 0;
|
||||||
}
|
}
|
||||||
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
|
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
|
||||||
xx = x + (w / 2);
|
xx = x + (w / 2);
|
||||||
yy = y + (h / 2);
|
yy = y + (h / 2);
|
||||||
x = evx - xx;
|
x = evx - xx;
|
||||||
|
@ -368,13 +368,13 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy)
|
||||||
const char *stacking, *selectraise;
|
const char *stacking, *selectraise;
|
||||||
|
|
||||||
it = it_last;
|
it = it_last;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,inactive", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,inactive", "elm");
|
||||||
stacking = edje_object_data_get(it->base.view, "stacking");
|
stacking = edje_object_data_get(VIEW(it), "stacking");
|
||||||
selectraise = edje_object_data_get(it->base.view, "selectraise");
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
||||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||||
{
|
{
|
||||||
if ((stacking) && (!strcmp(stacking, "below")))
|
if ((stacking) && (!strcmp(stacking, "below")))
|
||||||
evas_object_lower(it->base.view);
|
evas_object_lower(VIEW(it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (it_closest)
|
if (it_closest)
|
||||||
|
@ -382,10 +382,10 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy)
|
||||||
const char *selectraise;
|
const char *selectraise;
|
||||||
|
|
||||||
it = it_closest;
|
it = it_closest;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,active", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,active", "elm");
|
||||||
selectraise = edje_object_data_get(it->base.view, "selectraise");
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
||||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
evas_object_smart_callback_call((void *)obj, SIG_CHANGED, (void *)it->base.data);
|
evas_object_smart_callback_call((void *)obj, SIG_CHANGED, (void *)it->base.data);
|
||||||
if (wd->delay) ecore_timer_del(wd->delay);
|
if (wd->delay) ecore_timer_del(wd->delay);
|
||||||
wd->delay = ecore_timer_add(0.2, _delay_change, obj);
|
wd->delay = ecore_timer_add(0.2, _delay_change, obj);
|
||||||
|
|
|
@ -121,21 +121,21 @@ static inline void
|
||||||
_elm_list_item_free(Elm_List_Item *it)
|
_elm_list_item_free(Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full
|
||||||
(it->base.view, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, it);
|
(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, it);
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full
|
||||||
(it->base.view, EVAS_CALLBACK_MOUSE_UP, _mouse_up, it);
|
(VIEW(it), EVAS_CALLBACK_MOUSE_UP, _mouse_up, it);
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full
|
||||||
(it->base.view, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, it);
|
(VIEW(it), EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, it);
|
||||||
|
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full
|
||||||
(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, it->base.widget);
|
_changed_size_hints, WIDGET(it));
|
||||||
|
|
||||||
if (it->end)
|
if (it->end)
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full
|
||||||
(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, it->base.widget);
|
_changed_size_hints, WIDGET(it));
|
||||||
|
|
||||||
eina_stringshare_del(it->label);
|
eina_stringshare_del(it->label);
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
|
||||||
&& (!wd->multi) && (wd->selected))
|
&& (!wd->multi) && (wd->selected))
|
||||||
{
|
{
|
||||||
it = elm_list_selected_item_get(obj);
|
it = elm_list_selected_item_get(obj);
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_ACTIVATED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
|
||||||
}
|
}
|
||||||
else if (!strcmp(ev->keyname, "Escape"))
|
else if (!strcmp(ev->keyname, "Escape"))
|
||||||
{
|
{
|
||||||
|
@ -600,7 +600,7 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
|
||||||
elm_smart_scroller_mirrored_set(wd->scr, rtl);
|
elm_smart_scroller_mirrored_set(wd->scr, rtl);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(wd->items, n, it)
|
EINA_LIST_FOREACH(wd->items, n, it)
|
||||||
edje_object_mirrored_set(it->base.view, rtl);
|
edje_object_mirrored_set(VIEW(it), rtl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -632,7 +632,7 @@ _theme_hook(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
EINA_LIST_FOREACH(wd->items, n, it)
|
EINA_LIST_FOREACH(wd->items, n, it)
|
||||||
{
|
{
|
||||||
edje_object_scale_set(it->base.view, elm_widget_scale_get(obj) * _elm_config->scale);
|
edje_object_scale_set(VIEW(it), elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
it->fixed = 0;
|
it->fixed = 0;
|
||||||
}
|
}
|
||||||
_fix_items(obj);
|
_fix_items(obj);
|
||||||
|
@ -704,7 +704,7 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
||||||
static void
|
static void
|
||||||
_item_highlight(Elm_List_Item *it)
|
_item_highlight(Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
Evas_Object *obj = it->base.widget;
|
Evas_Object *obj = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
const char *selectraise;
|
const char *selectraise;
|
||||||
|
|
||||||
|
@ -715,10 +715,10 @@ _item_highlight(Elm_List_Item *it)
|
||||||
evas_object_ref(obj);
|
evas_object_ref(obj);
|
||||||
_elm_list_walk(wd);
|
_elm_list_walk(wd);
|
||||||
|
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
||||||
selectraise = edje_object_data_get(it->base.view, "selectraise");
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
||||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
it->highlighted = EINA_TRUE;
|
it->highlighted = EINA_TRUE;
|
||||||
|
|
||||||
_elm_list_unwalk(wd);
|
_elm_list_unwalk(wd);
|
||||||
|
@ -728,7 +728,7 @@ _item_highlight(Elm_List_Item *it)
|
||||||
static void
|
static void
|
||||||
_item_select(Elm_List_Item *it)
|
_item_select(Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
Evas_Object *obj = it->base.widget;
|
Evas_Object *obj = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
@ -746,7 +746,7 @@ call:
|
||||||
evas_object_ref(obj);
|
evas_object_ref(obj);
|
||||||
_elm_list_walk(wd);
|
_elm_list_walk(wd);
|
||||||
|
|
||||||
if (it->func) it->func((void *)it->base.data, it->base.widget, it);
|
if (it->func) it->func((void *)it->base.data, WIDGET(it), it);
|
||||||
evas_object_smart_callback_call(obj, SIG_SELECTED, it);
|
evas_object_smart_callback_call(obj, SIG_SELECTED, it);
|
||||||
it->wd->last_selected_item = it;
|
it->wd->last_selected_item = it;
|
||||||
|
|
||||||
|
@ -757,7 +757,7 @@ call:
|
||||||
static void
|
static void
|
||||||
_item_unselect(Elm_List_Item *it)
|
_item_unselect(Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
Evas_Object *obj = it->base.widget;
|
Evas_Object *obj = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
const char *stacking, *selectraise;
|
const char *stacking, *selectraise;
|
||||||
|
|
||||||
|
@ -768,20 +768,20 @@ _item_unselect(Elm_List_Item *it)
|
||||||
evas_object_ref(obj);
|
evas_object_ref(obj);
|
||||||
_elm_list_walk(wd);
|
_elm_list_walk(wd);
|
||||||
|
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,unselected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
|
||||||
stacking = edje_object_data_get(it->base.view, "stacking");
|
stacking = edje_object_data_get(VIEW(it), "stacking");
|
||||||
selectraise = edje_object_data_get(it->base.view, "selectraise");
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
||||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||||
{
|
{
|
||||||
if ((stacking) && (!strcmp(stacking, "below")))
|
if ((stacking) && (!strcmp(stacking, "below")))
|
||||||
evas_object_lower(it->base.view);
|
evas_object_lower(VIEW(it));
|
||||||
}
|
}
|
||||||
it->highlighted = EINA_FALSE;
|
it->highlighted = EINA_FALSE;
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
{
|
{
|
||||||
it->selected = EINA_FALSE;
|
it->selected = EINA_FALSE;
|
||||||
wd->selected = eina_list_remove(wd->selected, it);
|
wd->selected = eina_list_remove(wd->selected, it);
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_UNSELECTED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
_elm_list_unwalk(wd);
|
_elm_list_unwalk(wd);
|
||||||
|
@ -792,7 +792,7 @@ static Eina_Bool
|
||||||
_swipe_cancel(void *data)
|
_swipe_cancel(void *data)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it = data;
|
Elm_List_Item *it = data;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
|
|
||||||
if (!wd) return ECORE_CALLBACK_CANCEL;
|
if (!wd) return ECORE_CALLBACK_CANCEL;
|
||||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ECORE_CALLBACK_CANCEL);
|
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ECORE_CALLBACK_CANCEL);
|
||||||
|
@ -805,7 +805,7 @@ static void
|
||||||
_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it = data;
|
Elm_List_Item *it = data;
|
||||||
Evas_Object *obj2 = it->base.widget;
|
Evas_Object *obj2 = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj2);
|
Widget_Data *wd = elm_widget_data_get(obj2);
|
||||||
Evas_Event_Mouse_Move *ev = event_info;
|
Evas_Event_Mouse_Move *ev = event_info;
|
||||||
|
|
||||||
|
@ -880,7 +880,7 @@ static Eina_Bool
|
||||||
_long_press(void *data)
|
_long_press(void *data)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it = data;
|
Elm_List_Item *it = data;
|
||||||
Evas_Object *obj = it->base.widget;
|
Evas_Object *obj = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
|
||||||
if (!wd) goto end;
|
if (!wd) goto end;
|
||||||
|
@ -890,7 +890,7 @@ _long_press(void *data)
|
||||||
if (it->disabled) goto end;
|
if (it->disabled) goto end;
|
||||||
|
|
||||||
wd->longpressed = EINA_TRUE;
|
wd->longpressed = EINA_TRUE;
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_LONGPRESSED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
|
@ -900,7 +900,7 @@ static void
|
||||||
_swipe(Elm_List_Item *it)
|
_swipe(Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
int i, sum = 0;
|
int i, sum = 0;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
|
|
||||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
@ -913,14 +913,14 @@ _swipe(Elm_List_Item *it)
|
||||||
|
|
||||||
sum /= wd->movements;
|
sum /= wd->movements;
|
||||||
if (abs(sum - wd->history[0].x) <= 10) return;
|
if (abs(sum - wd->history[0].x) <= 10) return;
|
||||||
evas_object_smart_callback_call(it->base.widget, "swipe", it);
|
evas_object_smart_callback_call(WIDGET(it), "swipe", it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it = data;
|
Elm_List_Item *it = data;
|
||||||
Evas_Object *obj2 = it->base.widget;
|
Evas_Object *obj2 = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj2);
|
Widget_Data *wd = elm_widget_data_get(obj2);
|
||||||
Evas_Event_Mouse_Down *ev = event_info;
|
Evas_Event_Mouse_Down *ev = event_info;
|
||||||
|
|
||||||
|
@ -944,8 +944,8 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void
|
||||||
/* Always call the callbacks last - the user may delete our context! */
|
/* Always call the callbacks last - the user may delete our context! */
|
||||||
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
||||||
{
|
{
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it);
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_ACTIVATED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
|
||||||
}
|
}
|
||||||
wd->swipe = EINA_FALSE;
|
wd->swipe = EINA_FALSE;
|
||||||
wd->movements = 0;
|
wd->movements = 0;
|
||||||
|
@ -958,7 +958,7 @@ static void
|
||||||
_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it = data;
|
Elm_List_Item *it = data;
|
||||||
Evas_Object *obj2 = it->base.widget;
|
Evas_Object *obj2 = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj2);
|
Widget_Data *wd = elm_widget_data_get(obj2);
|
||||||
Evas_Event_Mouse_Up *ev = event_info;
|
Evas_Event_Mouse_Up *ev = event_info;
|
||||||
|
|
||||||
|
@ -1046,16 +1046,16 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e
|
||||||
it->end = end;
|
it->end = end;
|
||||||
it->func = func;
|
it->func = func;
|
||||||
it->base.data = data;
|
it->base.data = data;
|
||||||
it->base.view = edje_object_add(evas_object_evas_get(obj));
|
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||||
edje_object_mirrored_set(it->base.view, elm_widget_mirrored_get(obj));
|
edje_object_mirrored_set(VIEW(it), elm_widget_mirrored_get(obj));
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_mouse_down, it);
|
_mouse_down, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_UP,
|
||||||
_mouse_up, it);
|
_mouse_up, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_MOVE,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_MOVE,
|
||||||
_mouse_move, it);
|
_mouse_move, it);
|
||||||
evas_object_size_hint_weight_set(it->base.view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(VIEW(it), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(it->base.view, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_add(obj, it->icon);
|
elm_widget_sub_object_add(obj, it->icon);
|
||||||
|
@ -1168,46 +1168,46 @@ _fix_items(Evas_Object *obj)
|
||||||
|
|
||||||
/* FIXME: separators' themes seem to be b0rked */
|
/* FIXME: separators' themes seem to be b0rked */
|
||||||
if (it->is_separator)
|
if (it->is_separator)
|
||||||
_elm_theme_object_set(obj, it->base.view, "separator",
|
_elm_theme_object_set(obj, VIEW(it), "separator",
|
||||||
wd->h_mode ? "horizontal" : "vertical",
|
wd->h_mode ? "horizontal" : "vertical",
|
||||||
style);
|
style);
|
||||||
else if (wd->mode == ELM_LIST_COMPRESS)
|
else if (wd->mode == ELM_LIST_COMPRESS)
|
||||||
{
|
{
|
||||||
if (it->even)
|
if (it->even)
|
||||||
_elm_theme_object_set(obj, it->base.view, "list",
|
_elm_theme_object_set(obj, VIEW(it), "list",
|
||||||
it_compress, style);
|
it_compress, style);
|
||||||
else
|
else
|
||||||
_elm_theme_object_set(obj, it->base.view, "list",
|
_elm_theme_object_set(obj, VIEW(it), "list",
|
||||||
it_compress_odd, style);
|
it_compress_odd, style);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (it->even)
|
if (it->even)
|
||||||
_elm_theme_object_set(obj, it->base.view, "list", it_plain,
|
_elm_theme_object_set(obj, VIEW(it), "list", it_plain,
|
||||||
style);
|
style);
|
||||||
else
|
else
|
||||||
_elm_theme_object_set(obj, it->base.view, "list", it_odd,
|
_elm_theme_object_set(obj, VIEW(it), "list", it_odd,
|
||||||
style);
|
style);
|
||||||
}
|
}
|
||||||
stacking = edje_object_data_get(it->base.view, "stacking");
|
stacking = edje_object_data_get(VIEW(it), "stacking");
|
||||||
if (stacking)
|
if (stacking)
|
||||||
{
|
{
|
||||||
if (!strcmp(stacking, "below"))
|
if (!strcmp(stacking, "below"))
|
||||||
evas_object_lower(it->base.view);
|
evas_object_lower(VIEW(it));
|
||||||
else if (!strcmp(stacking, "above"))
|
else if (!strcmp(stacking, "above"))
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
}
|
}
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
|
|
||||||
if ((!it->icon) && (minh[0] > 0))
|
if ((!it->icon) && (minh[0] > 0))
|
||||||
{
|
{
|
||||||
it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base.view));
|
it->icon = evas_object_rectangle_add(evas_object_evas_get(VIEW(it)));
|
||||||
evas_object_color_set(it->icon, 0, 0, 0, 0);
|
evas_object_color_set(it->icon, 0, 0, 0, 0);
|
||||||
it->dummy_icon = EINA_TRUE;
|
it->dummy_icon = EINA_TRUE;
|
||||||
}
|
}
|
||||||
if ((!it->end) && (minh[1] > 0))
|
if ((!it->end) && (minh[1] > 0))
|
||||||
{
|
{
|
||||||
it->end = evas_object_rectangle_add(evas_object_evas_get(it->base.view));
|
it->end = evas_object_rectangle_add(evas_object_evas_get(VIEW(it)));
|
||||||
evas_object_color_set(it->end, 0, 0, 0, 0);
|
evas_object_color_set(it->end, 0, 0, 0, 0);
|
||||||
it->dummy_end = EINA_TRUE;
|
it->dummy_end = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1215,28 +1215,28 @@ _fix_items(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_set(it->icon, minw[0], minh[0]);
|
evas_object_size_hint_min_set(it->icon, minw[0], minh[0]);
|
||||||
evas_object_size_hint_max_set(it->icon, 99999, 99999);
|
evas_object_size_hint_max_set(it->icon, 99999, 99999);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
|
||||||
}
|
}
|
||||||
if (it->end)
|
if (it->end)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_set(it->end, minw[1], minh[1]);
|
evas_object_size_hint_min_set(it->end, minw[1], minh[1]);
|
||||||
evas_object_size_hint_max_set(it->end, 99999, 99999);
|
evas_object_size_hint_max_set(it->end, 99999, 99999);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.end", it->end);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.end", it->end);
|
||||||
}
|
}
|
||||||
if (!it->fixed)
|
if (!it->fixed)
|
||||||
{
|
{
|
||||||
// this may call up user and it may modify the list item
|
// this may call up user and it may modify the list item
|
||||||
// but we're safe as we're flagged as walking.
|
// but we're safe as we're flagged as walking.
|
||||||
// just don't process further
|
// just don't process further
|
||||||
edje_object_message_signal_process(it->base.view);
|
edje_object_message_signal_process(VIEW(it));
|
||||||
if (it->deleted)
|
if (it->deleted)
|
||||||
continue;
|
continue;
|
||||||
mw = mh = -1;
|
mw = mh = -1;
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
edje_object_size_min_restricted_calc(it->base.view, &mw, &mh, mw, mh);
|
edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw, mh);
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
evas_object_size_hint_min_set(it->base.view, mw, mh);
|
evas_object_size_hint_min_set(VIEW(it), mw, mh);
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
}
|
}
|
||||||
if ((it->selected) || (it->highlighted))
|
if ((it->selected) || (it->highlighted))
|
||||||
{
|
{
|
||||||
|
@ -1245,16 +1245,16 @@ _fix_items(Evas_Object *obj)
|
||||||
// this may call up user and it may modify the list item
|
// this may call up user and it may modify the list item
|
||||||
// but we're safe as we're flagged as walking.
|
// but we're safe as we're flagged as walking.
|
||||||
// just don't process further
|
// just don't process further
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
||||||
if (it->deleted)
|
if (it->deleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
selectraise = edje_object_data_get(it->base.view, "selectraise");
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
||||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||||
evas_object_raise(it->base.view);
|
evas_object_raise(VIEW(it));
|
||||||
}
|
}
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,disabled",
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled",
|
||||||
"elm");
|
"elm");
|
||||||
|
|
||||||
it->fixed = EINA_TRUE;
|
it->fixed = EINA_TRUE;
|
||||||
|
@ -1396,7 +1396,7 @@ elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Eva
|
||||||
|
|
||||||
wd->items = eina_list_append(wd->items, it);
|
wd->items = eina_list_append(wd->items, it);
|
||||||
it->node = eina_list_last(wd->items);
|
it->node = eina_list_last(wd->items);
|
||||||
elm_box_pack_end(wd->box, it->base.view);
|
elm_box_pack_end(wd->box, VIEW(it));
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1409,7 +1409,7 @@ elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Ev
|
||||||
|
|
||||||
wd->items = eina_list_prepend(wd->items, it);
|
wd->items = eina_list_prepend(wd->items, it);
|
||||||
it->node = wd->items;
|
it->node = wd->items;
|
||||||
elm_box_pack_start(wd->box, it->base.view);
|
elm_box_pack_start(wd->box, VIEW(it));
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1429,7 +1429,7 @@ elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char
|
||||||
it = _item_new(obj, label, icon, end, func, data);
|
it = _item_new(obj, label, icon, end, func, data);
|
||||||
wd->items = eina_list_prepend_relative_list(wd->items, it, before->node);
|
wd->items = eina_list_prepend_relative_list(wd->items, it, before->node);
|
||||||
it->node = before->node->prev;
|
it->node = before->node->prev;
|
||||||
elm_box_pack_before(wd->box, it->base.view, before->base.view);
|
elm_box_pack_before(wd->box, VIEW(it), VIEW(before));
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1449,7 +1449,7 @@ elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *l
|
||||||
it = _item_new(obj, label, icon, end, func, data);
|
it = _item_new(obj, label, icon, end, func, data);
|
||||||
wd->items = eina_list_append_relative_list(wd->items, it, after->node);
|
wd->items = eina_list_append_relative_list(wd->items, it, after->node);
|
||||||
it->node = after->node->next;
|
it->node = after->node->next;
|
||||||
elm_box_pack_after(wd->box, it->base.view, after->base.view);
|
elm_box_pack_after(wd->box, VIEW(it), VIEW(after));
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1467,13 +1467,13 @@ elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *ic
|
||||||
if (!l)
|
if (!l)
|
||||||
{
|
{
|
||||||
it->node = eina_list_last(wd->items);
|
it->node = eina_list_last(wd->items);
|
||||||
elm_box_pack_end(wd->box, it->base.view);
|
elm_box_pack_end(wd->box, VIEW(it));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Elm_List_Item *before = eina_list_data_get(l);
|
Elm_List_Item *before = eina_list_data_get(l);
|
||||||
it->node = before->node->prev;
|
it->node = before->node->prev;
|
||||||
elm_box_pack_before(wd->box, it->base.view, before->base.view);
|
elm_box_pack_before(wd->box, VIEW(it), VIEW(before));
|
||||||
}
|
}
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
@ -1686,7 +1686,7 @@ EAPI void
|
||||||
elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected)
|
elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected)
|
||||||
{
|
{
|
||||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
||||||
Evas_Object *obj = it->base.widget;
|
Evas_Object *obj = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
|
@ -1724,12 +1724,12 @@ EAPI void
|
||||||
elm_list_item_show(Elm_List_Item *it)
|
elm_list_item_show(Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
Evas_Coord bx, by, bw, bh;
|
Evas_Coord bx, by, bw, bh;
|
||||||
Evas_Coord x, y, w, h;
|
Evas_Coord x, y, w, h;
|
||||||
|
|
||||||
evas_object_geometry_get(wd->box, &bx, &by, &bw, &bh);
|
evas_object_geometry_get(wd->box, &bx, &by, &bw, &bh);
|
||||||
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
|
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
|
||||||
x -= bx;
|
x -= bx;
|
||||||
y -= by;
|
y -= by;
|
||||||
if (wd->scr)
|
if (wd->scr)
|
||||||
|
@ -1740,12 +1740,12 @@ EAPI void
|
||||||
elm_list_item_bring_in(Elm_List_Item *it)
|
elm_list_item_bring_in(Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
Evas_Coord bx, by, bw, bh;
|
Evas_Coord bx, by, bw, bh;
|
||||||
Evas_Coord x, y, w, h;
|
Evas_Coord x, y, w, h;
|
||||||
|
|
||||||
evas_object_geometry_get(wd->box, &bx, &by, &bw, &bh);
|
evas_object_geometry_get(wd->box, &bx, &by, &bw, &bh);
|
||||||
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
|
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
|
||||||
x -= bx;
|
x -= bx;
|
||||||
y -= by;
|
y -= by;
|
||||||
if (wd->scr)
|
if (wd->scr)
|
||||||
|
@ -1756,7 +1756,7 @@ EAPI void
|
||||||
elm_list_item_del(Elm_List_Item *it)
|
elm_list_item_del(Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
||||||
Evas_Object *obj = it->base.widget;
|
Evas_Object *obj = WIDGET(it);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
|
@ -1817,7 +1817,7 @@ elm_list_item_icon_set(Elm_List_Item *it, Evas_Object *icon)
|
||||||
}
|
}
|
||||||
if (!icon)
|
if (!icon)
|
||||||
{
|
{
|
||||||
icon = evas_object_rectangle_add(evas_object_evas_get(it->base.widget));
|
icon = evas_object_rectangle_add(evas_object_evas_get(WIDGET(it)));
|
||||||
evas_object_color_set(icon, 0, 0, 0, 0);
|
evas_object_color_set(icon, 0, 0, 0, 0);
|
||||||
it->dummy_icon = EINA_TRUE;
|
it->dummy_icon = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1827,8 +1827,8 @@ elm_list_item_icon_set(Elm_List_Item *it, Evas_Object *icon)
|
||||||
it->icon = NULL;
|
it->icon = NULL;
|
||||||
}
|
}
|
||||||
it->icon = icon;
|
it->icon = icon;
|
||||||
if (it->base.view)
|
if (VIEW(it))
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.icon", icon);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.icon", icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
|
@ -1852,7 +1852,7 @@ elm_list_item_end_set(Elm_List_Item *it, Evas_Object *end)
|
||||||
}
|
}
|
||||||
if (!end)
|
if (!end)
|
||||||
{
|
{
|
||||||
end = evas_object_rectangle_add(evas_object_evas_get(it->base.widget));
|
end = evas_object_rectangle_add(evas_object_evas_get(WIDGET(it)));
|
||||||
evas_object_color_set(end, 0, 0, 0, 0);
|
evas_object_color_set(end, 0, 0, 0, 0);
|
||||||
it->dummy_end = EINA_TRUE;
|
it->dummy_end = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1862,8 +1862,8 @@ elm_list_item_end_set(Elm_List_Item *it, Evas_Object *end)
|
||||||
it->end = NULL;
|
it->end = NULL;
|
||||||
}
|
}
|
||||||
it->end = end;
|
it->end = end;
|
||||||
if (it->base.view)
|
if (VIEW(it))
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.end", end);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.end", end);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
|
@ -1876,7 +1876,7 @@ EAPI Evas_Object *
|
||||||
elm_list_item_object_get(const Elm_List_Item *it)
|
elm_list_item_object_get(const Elm_List_Item *it)
|
||||||
{
|
{
|
||||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL);
|
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL);
|
||||||
return it->base.view;
|
return VIEW(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
@ -1891,8 +1891,8 @@ elm_list_item_label_set(Elm_List_Item *it, const char *text)
|
||||||
{
|
{
|
||||||
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
|
||||||
if (!eina_stringshare_replace(&it->label, text)) return;
|
if (!eina_stringshare_replace(&it->label, text)) return;
|
||||||
if (it->base.view)
|
if (VIEW(it))
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Elm_List_Item *
|
EAPI Elm_List_Item *
|
||||||
|
@ -2063,9 +2063,9 @@ elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled)
|
||||||
it->disabled = !!disabled;
|
it->disabled = !!disabled;
|
||||||
|
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
|
|
|
@ -106,34 +106,34 @@ _theme_hook(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(l, _l, item)
|
EINA_LIST_FOREACH(l, _l, item)
|
||||||
{
|
{
|
||||||
edje_object_mirrored_set(item->base.view, elm_widget_mirrored_get(obj));
|
edje_object_mirrored_set(VIEW(item), elm_widget_mirrored_get(obj));
|
||||||
ll = eina_list_append(ll, item->submenu.items);
|
ll = eina_list_append(ll, item->submenu.items);
|
||||||
if (item->separator)
|
if (item->separator)
|
||||||
_elm_theme_object_set(obj, item->base.view, "menu", "separator",
|
_elm_theme_object_set(obj, VIEW(item), "menu", "separator",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
else if (item->submenu.bx)
|
else if (item->submenu.bx)
|
||||||
{
|
{
|
||||||
_elm_theme_object_set
|
_elm_theme_object_set
|
||||||
(obj, item->base.view, "menu", "item_with_submenu",
|
(obj, VIEW(item), "menu", "item_with_submenu",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
elm_menu_item_label_set(item, item->label);
|
elm_menu_item_label_set(item, item->label);
|
||||||
elm_menu_item_object_icon_name_set(item, item->icon_str);
|
elm_menu_item_object_icon_name_set(item, item->icon_str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_elm_theme_object_set(obj, item->base.view, "menu", "item",
|
_elm_theme_object_set(obj, VIEW(item), "menu", "item",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
elm_menu_item_label_set(item, item->label);
|
elm_menu_item_label_set(item, item->label);
|
||||||
elm_menu_item_object_icon_name_set(item, item->icon_str);
|
elm_menu_item_object_icon_name_set(item, item->icon_str);
|
||||||
}
|
}
|
||||||
if (item->disabled)
|
if (item->disabled)
|
||||||
edje_object_signal_emit
|
edje_object_signal_emit
|
||||||
(item->base.view, "elm,state,disabled", "elm");
|
(VIEW(item), "elm,state,disabled", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit
|
edje_object_signal_emit
|
||||||
(item->base.view, "elm,state,enabled", "elm");
|
(VIEW(item), "elm,state,enabled", "elm");
|
||||||
edje_object_message_signal_process(item->base.view);
|
edje_object_message_signal_process(VIEW(item));
|
||||||
edje_object_scale_set(item->base.view, elm_widget_scale_get(obj) *
|
edje_object_scale_set(VIEW(item), elm_widget_scale_get(obj) *
|
||||||
_elm_config->scale);
|
_elm_config->scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,11 +184,11 @@ _submenu_sizing_eval(Elm_Menu_Item *parent)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Elm_Menu_Item *item;
|
Elm_Menu_Item *item;
|
||||||
Evas_Coord x_p, y_p, w_p, h_p, x2, y2, w2, h2, bx, by, bw, bh, px, py, pw, ph;
|
Evas_Coord x_p, y_p, w_p, h_p, x2, y2, w2, h2, bx, by, bw, bh, px, py, pw, ph;
|
||||||
Widget_Data *wd = elm_widget_data_get(parent->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(parent));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
EINA_LIST_FOREACH(parent->submenu.items, l, item) _item_sizing_eval(item);
|
EINA_LIST_FOREACH(parent->submenu.items, l, item) _item_sizing_eval(item);
|
||||||
evas_object_geometry_get(parent->submenu.location, &x_p, &y_p, &w_p, &h_p);
|
evas_object_geometry_get(parent->submenu.location, &x_p, &y_p, &w_p, &h_p);
|
||||||
evas_object_geometry_get(parent->base.view, &x2, &y2, &w2, &h2);
|
evas_object_geometry_get(VIEW(parent), &x2, &y2, &w2, &h2);
|
||||||
evas_object_geometry_get(parent->submenu.bx, &bx, &by, &bw, &bh);
|
evas_object_geometry_get(parent->submenu.bx, &bx, &by, &bw, &bh);
|
||||||
evas_object_geometry_get(wd->parent, &px, &py, &pw, &ph);
|
evas_object_geometry_get(wd->parent, &px, &py, &pw, &ph);
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ _submenu_sizing_eval(Elm_Menu_Item *parent)
|
||||||
y_p = y2;
|
y_p = y2;
|
||||||
|
|
||||||
/* If it overflows on the right, adjust the x */
|
/* If it overflows on the right, adjust the x */
|
||||||
if ((x_p + bw > px + pw) || elm_widget_mirrored_get(parent->base.widget))
|
if ((x_p + bw > px + pw) || elm_widget_mirrored_get(WIDGET(parent)))
|
||||||
x_p = x2-bw;
|
x_p = x2-bw;
|
||||||
|
|
||||||
/* If it overflows on the left, adjust the x - usually only happens
|
/* If it overflows on the left, adjust the x - usually only happens
|
||||||
|
@ -232,11 +232,11 @@ _item_sizing_eval(Elm_Menu_Item *item)
|
||||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||||
if (!item->separator)
|
if (!item->separator)
|
||||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||||
edje_object_size_min_restricted_calc(item->base.view, &minw, &minh, minw, minh);
|
edje_object_size_min_restricted_calc(VIEW(item), &minw, &minh, minw, minh);
|
||||||
if (!item->separator)
|
if (!item->separator)
|
||||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||||
evas_object_size_hint_min_set(item->base.view, minw, minh);
|
evas_object_size_hint_min_set(VIEW(item), minw, minh);
|
||||||
evas_object_size_hint_max_set(item->base.view, maxw, maxh);
|
evas_object_size_hint_max_set(VIEW(item), maxw, maxh);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -312,9 +312,9 @@ _menu_item_select(void *data, Evas_Object *obj __UNUSED__, const char *emission
|
||||||
else _submenu_hide(item);
|
else _submenu_hide(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_menu_hide(item->base.widget, NULL, NULL);
|
_menu_hide(WIDGET(item), NULL, NULL);
|
||||||
|
|
||||||
if (item->func) item->func((void *)(item->base.data), item->base.widget, item);
|
if (item->func) item->func((void *)(item->base.data), WIDGET(item), item);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -333,7 +333,7 @@ _menu_item_activate(void *data, Evas_Object *obj __UNUSED__, const char *emissio
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
EINA_LIST_FOREACH(wd->items, l, item2)
|
EINA_LIST_FOREACH(wd->items, l, item2)
|
||||||
{
|
{
|
||||||
if (item2 != item) elm_menu_item_selected_set(item2, 0);
|
if (item2 != item) elm_menu_item_selected_set(item2, 0);
|
||||||
|
@ -355,7 +355,7 @@ _submenu_open(void *data, Evas_Object *obj __UNUSED__, const char *emission __UN
|
||||||
Elm_Menu_Item *item = data;
|
Elm_Menu_Item *item = data;
|
||||||
item->submenu.open = EINA_TRUE;
|
item->submenu.open = EINA_TRUE;
|
||||||
evas_object_show(item->submenu.hv);
|
evas_object_show(item->submenu.hv);
|
||||||
_sizing_eval(item->base.widget);
|
_sizing_eval(WIDGET(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -369,40 +369,40 @@ _show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
||||||
static void
|
static void
|
||||||
_item_obj_create(Elm_Menu_Item *item)
|
_item_obj_create(Elm_Menu_Item *item)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
item->base.view = edje_object_add(evas_object_evas_get(wd->bx));
|
VIEW(item) = edje_object_add(evas_object_evas_get(wd->bx));
|
||||||
edje_object_mirrored_set(item->base.view, elm_widget_mirrored_get(item->base.widget));
|
edje_object_mirrored_set(VIEW(item), elm_widget_mirrored_get(WIDGET(item)));
|
||||||
evas_object_size_hint_weight_set(item->base.view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(VIEW(item), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_fill_set(item->base.view, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_fill_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
_elm_theme_object_set(item->base.widget, item->base.view, "menu", "item", elm_widget_style_get(item->base.widget));
|
_elm_theme_object_set(WIDGET(item), VIEW(item), "menu", "item", elm_widget_style_get(WIDGET(item)));
|
||||||
edje_object_signal_callback_add(item->base.view, "elm,action,click", "",
|
edje_object_signal_callback_add(VIEW(item), "elm,action,click", "",
|
||||||
_menu_item_select, item);
|
_menu_item_select, item);
|
||||||
edje_object_signal_callback_add(item->base.view, "elm,action,activate", "",
|
edje_object_signal_callback_add(VIEW(item), "elm,action,activate", "",
|
||||||
_menu_item_activate, item);
|
_menu_item_activate, item);
|
||||||
edje_object_signal_callback_add(item->base.view, "elm,action,inactivate", "",
|
edje_object_signal_callback_add(VIEW(item), "elm,action,inactivate", "",
|
||||||
_menu_item_inactivate, item);
|
_menu_item_inactivate, item);
|
||||||
evas_object_show(item->base.view);
|
evas_object_show(VIEW(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_item_separator_obj_create(Elm_Menu_Item *item)
|
_item_separator_obj_create(Elm_Menu_Item *item)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
item->base.view = edje_object_add(evas_object_evas_get(wd->bx));
|
VIEW(item) = edje_object_add(evas_object_evas_get(wd->bx));
|
||||||
evas_object_size_hint_weight_set(item->base.view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(VIEW(item), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_fill_set(item->base.view, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_fill_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
_elm_theme_object_set(item->base.widget, item->base.view, "menu", "separator", elm_widget_style_get(item->base.widget));
|
_elm_theme_object_set(WIDGET(item), VIEW(item), "menu", "separator", elm_widget_style_get(WIDGET(item)));
|
||||||
edje_object_signal_callback_add(item->base.view, "elm,action,activate", "",
|
edje_object_signal_callback_add(VIEW(item), "elm,action,activate", "",
|
||||||
_menu_item_activate, item);
|
_menu_item_activate, item);
|
||||||
evas_object_show(item->base.view);
|
evas_object_show(VIEW(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_item_submenu_obj_create(Elm_Menu_Item *item)
|
_item_submenu_obj_create(Elm_Menu_Item *item)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
item->submenu.location = elm_icon_add(wd->bx);
|
item->submenu.location = elm_icon_add(wd->bx);
|
||||||
item->submenu.hv = elm_hover_add(wd->bx);
|
item->submenu.hv = elm_hover_add(wd->bx);
|
||||||
|
@ -417,17 +417,17 @@ _item_submenu_obj_create(Elm_Menu_Item *item)
|
||||||
evas_object_show(item->submenu.bx);
|
evas_object_show(item->submenu.bx);
|
||||||
elm_hover_content_set(item->submenu.hv, elm_hover_best_content_location_get(item->submenu.hv, ELM_HOVER_AXIS_VERTICAL), item->submenu.bx);
|
elm_hover_content_set(item->submenu.hv, elm_hover_best_content_location_get(item->submenu.hv, ELM_HOVER_AXIS_VERTICAL), item->submenu.bx);
|
||||||
|
|
||||||
edje_object_mirrored_set(item->base.view, elm_widget_mirrored_get(item->base.widget));
|
edje_object_mirrored_set(VIEW(item), elm_widget_mirrored_get(WIDGET(item)));
|
||||||
_elm_theme_object_set(item->base.widget, item->base.view, "menu", "item_with_submenu", elm_widget_style_get(item->base.widget));
|
_elm_theme_object_set(WIDGET(item), VIEW(item), "menu", "item_with_submenu", elm_widget_style_get(WIDGET(item)));
|
||||||
elm_menu_item_label_set(item, item->label);
|
elm_menu_item_label_set(item, item->label);
|
||||||
if (item->icon_str) elm_menu_item_object_icon_name_set(item, item->icon_str);
|
if (item->icon_str) elm_menu_item_object_icon_name_set(item, item->icon_str);
|
||||||
|
|
||||||
edje_object_signal_callback_add(item->base.view, "elm,action,open", "",
|
edje_object_signal_callback_add(VIEW(item), "elm,action,open", "",
|
||||||
_submenu_open, item);
|
_submenu_open, item);
|
||||||
evas_object_event_callback_add(item->base.view, EVAS_CALLBACK_MOVE, _item_move_resize, item);
|
evas_object_event_callback_add(VIEW(item), EVAS_CALLBACK_MOVE, _item_move_resize, item);
|
||||||
evas_object_event_callback_add(item->base.view, EVAS_CALLBACK_RESIZE, _item_move_resize, item);
|
evas_object_event_callback_add(VIEW(item), EVAS_CALLBACK_RESIZE, _item_move_resize, item);
|
||||||
|
|
||||||
evas_object_event_callback_add(item->submenu.bx, EVAS_CALLBACK_RESIZE, _menu_resize, item->base.widget);
|
evas_object_event_callback_add(item->submenu.bx, EVAS_CALLBACK_RESIZE, _menu_resize, WIDGET(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
|
@ -548,7 +548,7 @@ EAPI Evas_Object *
|
||||||
elm_menu_item_object_get(const Elm_Menu_Item *item)
|
elm_menu_item_object_get(const Elm_Menu_Item *item)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
return item->base.view;
|
return VIEW(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -587,13 +587,13 @@ _elm_menu_item_add_helper(Evas_Object *obj, Elm_Menu_Item *parent, Elm_Menu_Item
|
||||||
if (parent)
|
if (parent)
|
||||||
{
|
{
|
||||||
if (!parent->submenu.bx) _item_submenu_obj_create(parent);
|
if (!parent->submenu.bx) _item_submenu_obj_create(parent);
|
||||||
elm_box_pack_end(parent->submenu.bx, subitem->base.view);
|
elm_box_pack_end(parent->submenu.bx, VIEW(subitem));
|
||||||
parent->submenu.items = eina_list_append(parent->submenu.items, subitem);
|
parent->submenu.items = eina_list_append(parent->submenu.items, subitem);
|
||||||
subitem->idx = eina_list_count(parent->submenu.items) - 1;
|
subitem->idx = eina_list_count(parent->submenu.items) - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elm_box_pack_end(wd->bx, subitem->base.view);
|
elm_box_pack_end(wd->bx, VIEW(subitem));
|
||||||
wd->items = eina_list_append(wd->items, subitem);
|
wd->items = eina_list_append(wd->items, subitem);
|
||||||
subitem->idx = eina_list_count(wd->items) - 1;
|
subitem->idx = eina_list_count(wd->items) - 1;
|
||||||
}
|
}
|
||||||
|
@ -626,8 +626,8 @@ elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, const char *icon, con
|
||||||
_item_obj_create(subitem);
|
_item_obj_create(subitem);
|
||||||
elm_menu_item_label_set(subitem, label);
|
elm_menu_item_label_set(subitem, label);
|
||||||
|
|
||||||
elm_widget_sub_object_add(subitem->base.widget, subitem->content);
|
elm_widget_sub_object_add(WIDGET(subitem), subitem->content);
|
||||||
edje_object_part_swallow(subitem->base.view, "elm.swallow.content", subitem->content);
|
edje_object_part_swallow(VIEW(subitem), "elm.swallow.content", subitem->content);
|
||||||
if (icon) elm_menu_item_object_icon_name_set(subitem, icon);
|
if (icon) elm_menu_item_object_icon_name_set(subitem, icon);
|
||||||
|
|
||||||
_elm_menu_item_add_helper(obj, parent, subitem, wd);
|
_elm_menu_item_add_helper(obj, parent, subitem, wd);
|
||||||
|
@ -654,9 +654,9 @@ elm_menu_item_add_object(Evas_Object *obj, Elm_Menu_Item *parent, Evas_Object *s
|
||||||
|
|
||||||
_item_obj_create(subitem);
|
_item_obj_create(subitem);
|
||||||
|
|
||||||
elm_widget_sub_object_add(subitem->base.widget, subitem->content);
|
elm_widget_sub_object_add(WIDGET(subitem), subitem->content);
|
||||||
edje_object_part_swallow(subitem->base.view, "elm.swallow.content", subobj);
|
edje_object_part_swallow(VIEW(subitem), "elm.swallow.content", subobj);
|
||||||
_sizing_eval(subitem->base.widget);
|
_sizing_eval(WIDGET(subitem));
|
||||||
|
|
||||||
_elm_menu_item_add_helper(obj, parent, subitem, wd);
|
_elm_menu_item_add_helper(obj, parent, subitem, wd);
|
||||||
|
|
||||||
|
@ -677,13 +677,13 @@ elm_menu_item_label_set(Elm_Menu_Item *item, const char *label)
|
||||||
eina_stringshare_replace(&item->label, label);
|
eina_stringshare_replace(&item->label, label);
|
||||||
|
|
||||||
if (label)
|
if (label)
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,text,visible", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,text,hidden", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,text,hidden", "elm");
|
||||||
|
|
||||||
edje_object_message_signal_process(item->base.view);
|
edje_object_message_signal_process(VIEW(item));
|
||||||
edje_object_part_text_set(item->base.view, "elm.text", label);
|
edje_object_part_text_set(VIEW(item), "elm.text", label);
|
||||||
_sizing_eval(item->base.widget);
|
_sizing_eval(WIDGET(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
@ -706,12 +706,12 @@ elm_menu_item_object_icon_name_set(Elm_Menu_Item *item, const char *icon)
|
||||||
elm_icon_standard_set(item->content, icon)))
|
elm_icon_standard_set(item->content, icon)))
|
||||||
{
|
{
|
||||||
eina_stringshare_replace(&item->icon_str, icon);
|
eina_stringshare_replace(&item->icon_str, icon);
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,icon,visible", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,icon,visible", "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,icon,hidden", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,icon,hidden", "elm");
|
||||||
edje_object_message_signal_process(item->base.view);
|
edje_object_message_signal_process(VIEW(item));
|
||||||
_sizing_eval(item->base.widget);
|
_sizing_eval(WIDGET(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -722,12 +722,12 @@ elm_menu_item_disabled_set(Elm_Menu_Item *item, Eina_Bool disabled)
|
||||||
item->disabled = !!disabled;
|
item->disabled = !!disabled;
|
||||||
if (disabled)
|
if (disabled)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm");
|
||||||
if (item->submenu.open) _submenu_hide(item);
|
if (item->submenu.open) _submenu_hide(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,enabled", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,enabled", "elm");
|
||||||
edje_object_message_signal_process(item->base.view);
|
edje_object_message_signal_process(VIEW(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
|
@ -753,18 +753,18 @@ elm_menu_item_separator_add(Evas_Object *obj, Elm_Menu_Item *parent)
|
||||||
|
|
||||||
subitem = elm_widget_item_new(obj, Elm_Menu_Item);
|
subitem = elm_widget_item_new(obj, Elm_Menu_Item);
|
||||||
if (!subitem) return NULL;
|
if (!subitem) return NULL;
|
||||||
subitem->base.widget = obj;
|
WIDGET(subitem) = obj;
|
||||||
subitem->separator = 1;
|
subitem->separator = 1;
|
||||||
_item_separator_obj_create(subitem);
|
_item_separator_obj_create(subitem);
|
||||||
if (!parent)
|
if (!parent)
|
||||||
{
|
{
|
||||||
elm_box_pack_end(wd->bx, subitem->base.view);
|
elm_box_pack_end(wd->bx, VIEW(subitem));
|
||||||
wd->items = eina_list_append(wd->items, subitem);
|
wd->items = eina_list_append(wd->items, subitem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!parent->submenu.bx) _item_submenu_obj_create(parent);
|
if (!parent->submenu.bx) _item_submenu_obj_create(parent);
|
||||||
elm_box_pack_end(parent->submenu.bx, subitem->base.view);
|
elm_box_pack_end(parent->submenu.bx, VIEW(subitem));
|
||||||
parent->submenu.items = eina_list_append(parent->submenu.items, subitem);
|
parent->submenu.items = eina_list_append(parent->submenu.items, subitem);
|
||||||
}
|
}
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
@ -777,15 +777,15 @@ elm_menu_item_object_content_set(Elm_Menu_Item *item, Evas_Object *obj)
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
|
||||||
if (item->content)
|
if (item->content)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_del(item->base.widget, item->content);
|
elm_widget_sub_object_del(WIDGET(item), item->content);
|
||||||
evas_object_del(item->content);
|
evas_object_del(item->content);
|
||||||
}
|
}
|
||||||
|
|
||||||
item->content = obj;
|
item->content = obj;
|
||||||
|
|
||||||
elm_widget_sub_object_add(item->base.widget, item->content);
|
elm_widget_sub_object_add(WIDGET(item), item->content);
|
||||||
edje_object_part_swallow(item->base.view, "elm.swallow.content", item->content);
|
edje_object_part_swallow(VIEW(item), "elm.swallow.content", item->content);
|
||||||
_sizing_eval(item->base.widget);
|
_sizing_eval(WIDGET(item));
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -828,7 +828,7 @@ elm_menu_item_del(Elm_Menu_Item *item)
|
||||||
item->parent->submenu.items = eina_list_remove(item->parent->submenu.items, item);
|
item->parent->submenu.items = eina_list_remove(item->parent->submenu.items, item);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
wd->items = eina_list_remove(wd->items, item);
|
wd->items = eina_list_remove(wd->items, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -879,15 +879,15 @@ elm_menu_item_selected_set(Elm_Menu_Item *item, Eina_Bool selected)
|
||||||
item->selected = selected;
|
item->selected = selected;
|
||||||
if (selected)
|
if (selected)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,selected", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,selected", "elm");
|
||||||
_menu_item_activate(item, NULL, NULL, NULL);
|
_menu_item_activate(item, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,unselected", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm");
|
||||||
_menu_item_inactivate(item, NULL, NULL, NULL);
|
_menu_item_inactivate(item, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
edje_object_message_signal_process(item->base.view);
|
edje_object_message_signal_process(VIEW(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
|
@ -910,7 +910,7 @@ elm_menu_item_prev_get(const Elm_Menu_Item *it)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd || !wd->items) return NULL;
|
if (!wd || !wd->items) return NULL;
|
||||||
Eina_List *l = eina_list_data_find_list(wd->items, it);
|
Eina_List *l = eina_list_data_find_list(wd->items, it);
|
||||||
l = eina_list_prev(l);
|
l = eina_list_prev(l);
|
||||||
|
@ -933,7 +933,7 @@ elm_menu_item_next_get(const Elm_Menu_Item *it)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd || !wd->items) return NULL;
|
if (!wd || !wd->items) return NULL;
|
||||||
Eina_List *l = eina_list_data_find_list(wd->items, it);
|
Eina_List *l = eina_list_data_find_list(wd->items, it);
|
||||||
l = eina_list_next(l);
|
l = eina_list_next(l);
|
||||||
|
@ -947,7 +947,7 @@ EAPI Evas_Object *
|
||||||
elm_menu_item_menu_get(const Elm_Menu_Item *item)
|
elm_menu_item_menu_get(const Elm_Menu_Item *item)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
return item->base.widget;
|
return WIDGET(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Elm_Menu_Item *
|
EAPI Elm_Menu_Item *
|
||||||
|
|
|
@ -105,11 +105,11 @@ _theme_hook(Evas_Object *obj)
|
||||||
|
|
||||||
EINA_LIST_FOREACH(wd->seg_items, l, it)
|
EINA_LIST_FOREACH(wd->seg_items, l, it)
|
||||||
{
|
{
|
||||||
_elm_theme_object_set(obj, it->base.view, "segment_control",
|
_elm_theme_object_set(obj, VIEW(it), "segment_control",
|
||||||
"item", elm_widget_style_get(obj));
|
"item", elm_widget_style_get(obj));
|
||||||
edje_object_scale_set(it->base.view, elm_widget_scale_get(it->base.view)
|
edje_object_scale_set(VIEW(it), elm_widget_scale_get(VIEW(it))
|
||||||
*_elm_config->scale);
|
*_elm_config->scale);
|
||||||
edje_object_mirrored_set(it->base.view, rtl);
|
edje_object_mirrored_set(VIEW(it), rtl);
|
||||||
}
|
}
|
||||||
|
|
||||||
_update_list(wd);
|
_update_list(wd);
|
||||||
|
@ -136,8 +136,8 @@ _elm_list_data_get(const Eina_List *list)
|
||||||
|
|
||||||
if (it) return NULL;
|
if (it) return NULL;
|
||||||
|
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,segment,selected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,segment,selected", "elm");
|
||||||
return it->base.view;
|
return VIEW(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -197,7 +197,7 @@ _segment_off(Elm_Segment_Item *it)
|
||||||
wd = elm_widget_item_data_get(it);
|
wd = elm_widget_item_data_get(it);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,segment,normal", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,segment,normal", "elm");
|
||||||
|
|
||||||
if (wd->selected_item == it) wd->selected_item = NULL;
|
if (wd->selected_item == it) wd->selected_item = NULL;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ _segment_on(Elm_Segment_Item *it)
|
||||||
|
|
||||||
if (wd->selected_item) _segment_off(wd->selected_item);
|
if (wd->selected_item) _segment_off(wd->selected_item);
|
||||||
|
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,segment,selected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,segment,selected", "elm");
|
||||||
|
|
||||||
wd->selected_item = it;
|
wd->selected_item = it;
|
||||||
evas_object_smart_callback_call(wd->obj, SIG_CHANGED, (void *)(unsigned long)it->seg_index);
|
evas_object_smart_callback_call(wd->obj, SIG_CHANGED, (void *)(unsigned long)it->seg_index);
|
||||||
|
@ -243,8 +243,8 @@ _position_items(Widget_Data *wd)
|
||||||
|
|
||||||
EINA_LIST_FOREACH(wd->seg_items, l, it)
|
EINA_LIST_FOREACH(wd->seg_items, l, it)
|
||||||
{
|
{
|
||||||
evas_object_move(it->base.view, pos, by);
|
evas_object_move(VIEW(it), pos, by);
|
||||||
evas_object_resize(it->base.view, wd->item_width, bh);
|
evas_object_resize(VIEW(it), wd->item_width, bh);
|
||||||
if (rtl)
|
if (rtl)
|
||||||
pos -= wd->item_width;
|
pos -= wd->item_width;
|
||||||
else
|
else
|
||||||
|
@ -286,13 +286,13 @@ _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
|
||||||
if (it == wd->selected_item) return;
|
if (it == wd->selected_item) return;
|
||||||
|
|
||||||
ev = event_info;
|
ev = event_info;
|
||||||
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
|
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
|
||||||
|
|
||||||
if ((ev->canvas.x >= x) && (ev->output.x <= (x + w)) && (ev->canvas.y >= y)
|
if ((ev->canvas.x >= x) && (ev->output.x <= (x + w)) && (ev->canvas.y >= y)
|
||||||
&& (ev->canvas.y <= (y + h)))
|
&& (ev->canvas.y <= (y + h)))
|
||||||
_segment_on(it);
|
_segment_on(it);
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,segment,normal", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,segment,normal", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -312,7 +312,7 @@ _mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
|
||||||
|
|
||||||
if (it == wd->selected_item) return;
|
if (it == wd->selected_item) return;
|
||||||
|
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,segment,pressed", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,segment,pressed", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -322,20 +322,20 @@ _swallow_item_objects(Elm_Segment_Item *it)
|
||||||
|
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
{
|
{
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,icon,visible", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,icon,visible", "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,icon,hidden", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,icon,hidden", "elm");
|
||||||
|
|
||||||
if (it->label)
|
if (it->label)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,text,visible", "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,text,hidden", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,text,hidden", "elm");
|
||||||
edje_object_message_signal_process(it->base.view);
|
edje_object_message_signal_process(VIEW(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -354,21 +354,21 @@ _update_list(Widget_Data *wd)
|
||||||
it->seg_index = 0;
|
it->seg_index = 0;
|
||||||
|
|
||||||
//Set the segment type
|
//Set the segment type
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,type,segment,single", "elm");
|
"elm,type,segment,single", "elm");
|
||||||
|
|
||||||
//Set the segment state
|
//Set the segment state
|
||||||
if (wd->selected_item == it)
|
if (wd->selected_item == it)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,segment,selected", "elm");
|
"elm,state,segment,selected", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,segment,normal", "elm");
|
"elm,state,segment,normal", "elm");
|
||||||
|
|
||||||
if (elm_widget_disabled_get(wd->obj))
|
if (elm_widget_disabled_get(wd->obj))
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
|
||||||
|
|
||||||
_swallow_item_objects(it);
|
_swallow_item_objects(it);
|
||||||
return;
|
return;
|
||||||
|
@ -383,37 +383,37 @@ _update_list(Widget_Data *wd)
|
||||||
if (idx == 0)
|
if (idx == 0)
|
||||||
{
|
{
|
||||||
if (rtl)
|
if (rtl)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,type,segment,right", "elm");
|
"elm,type,segment,right", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,type,segment,left", "elm");
|
"elm,type,segment,left", "elm");
|
||||||
}
|
}
|
||||||
else if (idx == (wd->item_count - 1))
|
else if (idx == (wd->item_count - 1))
|
||||||
{
|
{
|
||||||
if (rtl)
|
if (rtl)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,type,segment,left", "elm");
|
"elm,type,segment,left", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,type,segment,right", "elm");
|
"elm,type,segment,right", "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,type,segment,middle", "elm");
|
"elm,type,segment,middle", "elm");
|
||||||
|
|
||||||
//Set the segment state
|
//Set the segment state
|
||||||
if (wd->selected_item == it)
|
if (wd->selected_item == it)
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,segment,selected", "elm");
|
"elm,state,segment,selected", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view,
|
edje_object_signal_emit(VIEW(it),
|
||||||
"elm,state,segment,normal", "elm");
|
"elm,state,segment,normal", "elm");
|
||||||
|
|
||||||
if (elm_widget_disabled_get(wd->obj))
|
if (elm_widget_disabled_get(wd->obj))
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
|
||||||
|
|
||||||
_swallow_item_objects(it);
|
_swallow_item_objects(it);
|
||||||
idx++;
|
idx++;
|
||||||
|
@ -446,34 +446,34 @@ _item_new(Evas_Object *obj, Evas_Object *icon, const char *label)
|
||||||
if (!it) return NULL;
|
if (!it) return NULL;
|
||||||
elm_widget_item_data_set(it, wd);
|
elm_widget_item_data_set(it, wd);
|
||||||
|
|
||||||
it->base.view = edje_object_add(evas_object_evas_get(obj));
|
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||||
edje_object_scale_set(it->base.view, elm_widget_scale_get(it->base.view)
|
edje_object_scale_set(VIEW(it), elm_widget_scale_get(VIEW(it))
|
||||||
*_elm_config->scale);
|
*_elm_config->scale);
|
||||||
evas_object_smart_member_add(it->base.view, obj);
|
evas_object_smart_member_add(VIEW(it), obj);
|
||||||
elm_widget_sub_object_add(obj, it->base.view);
|
elm_widget_sub_object_add(obj, VIEW(it));
|
||||||
evas_object_clip_set(it->base.view, evas_object_clip_get(obj));
|
evas_object_clip_set(VIEW(it), evas_object_clip_get(obj));
|
||||||
|
|
||||||
_elm_theme_object_set(obj, it->base.view, "segment_control", "item",
|
_elm_theme_object_set(obj, VIEW(it), "segment_control", "item",
|
||||||
elm_object_style_get(obj));
|
elm_object_style_get(obj));
|
||||||
edje_object_mirrored_set(it->base.view,
|
edje_object_mirrored_set(VIEW(it),
|
||||||
elm_widget_mirrored_get(it->base.widget));
|
elm_widget_mirrored_get(WIDGET(it)));
|
||||||
|
|
||||||
if (label)
|
if (label)
|
||||||
eina_stringshare_replace(&it->label, label);
|
eina_stringshare_replace(&it->label, label);
|
||||||
if (it->label)
|
if (it->label)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,text,visible", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,text,hidden", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,text,hidden", "elm");
|
||||||
edje_object_message_signal_process(it->base.view);
|
edje_object_message_signal_process(VIEW(it));
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", label);
|
edje_object_part_text_set(VIEW(it), "elm.text", label);
|
||||||
|
|
||||||
it->icon = icon;
|
it->icon = icon;
|
||||||
if (it->icon) elm_widget_sub_object_add(it->base.view, it->icon);
|
if (it->icon) elm_widget_sub_object_add(VIEW(it), it->icon);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_mouse_down, it);
|
_mouse_down, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_UP,
|
||||||
_mouse_up, it);
|
_mouse_up, it);
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
|
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
@ -615,12 +615,12 @@ elm_segment_control_item_label_set(Elm_Segment_Item* it, const char* label)
|
||||||
|
|
||||||
eina_stringshare_replace(&it->label, label);
|
eina_stringshare_replace(&it->label, label);
|
||||||
if (it->label)
|
if (it->label)
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,text,visible", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,text,visible", "elm");
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,text,hidden", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,text,hidden", "elm");
|
||||||
edje_object_message_signal_process(it->base.view);
|
edje_object_message_signal_process(VIEW(it));
|
||||||
//label can be NULL also.
|
//label can be NULL also.
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
|
@ -643,7 +643,7 @@ elm_segment_control_item_icon_set(Elm_Segment_Item *it, Evas_Object *icon)
|
||||||
//Remove the existing icon
|
//Remove the existing icon
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
{
|
{
|
||||||
edje_object_part_unswallow(it->base.view, it->icon);
|
edje_object_part_unswallow(VIEW(it), it->icon);
|
||||||
evas_object_del(it->icon);
|
evas_object_del(it->icon);
|
||||||
it->icon = NULL;
|
it->icon = NULL;
|
||||||
}
|
}
|
||||||
|
@ -651,12 +651,12 @@ elm_segment_control_item_icon_set(Elm_Segment_Item *it, Evas_Object *icon)
|
||||||
it->icon = icon;
|
it->icon = icon;
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_add(it->base.view, it->icon);
|
elm_widget_sub_object_add(VIEW(it), it->icon);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,icon,visible", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,icon,visible", "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,icon,hidden", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,icon,hidden", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
|
@ -676,7 +676,7 @@ elm_segment_control_item_object_get(const Elm_Segment_Item *it)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
|
||||||
|
|
||||||
return it->base.view;
|
return VIEW(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Elm_Segment_Item*
|
EAPI Elm_Segment_Item*
|
||||||
|
|
|
@ -163,7 +163,7 @@ _sizing_eval(Evas_Object *obj)
|
||||||
|
|
||||||
static Elm_Slideshow_Item* _item_prev_get(Elm_Slideshow_Item* item)
|
static Elm_Slideshow_Item* _item_prev_get(Elm_Slideshow_Item* item)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
Elm_Slideshow_Item* prev = eina_list_data_get(eina_list_prev(item->l));
|
Elm_Slideshow_Item* prev = eina_list_data_get(eina_list_prev(item->l));
|
||||||
if ((!prev) && (wd->loop))
|
if ((!prev) && (wd->loop))
|
||||||
prev = eina_list_data_get(eina_list_last(item->l));
|
prev = eina_list_data_get(eina_list_last(item->l));
|
||||||
|
@ -172,7 +172,7 @@ static Elm_Slideshow_Item* _item_prev_get(Elm_Slideshow_Item* item)
|
||||||
|
|
||||||
static Elm_Slideshow_Item* _item_next_get(Elm_Slideshow_Item* item)
|
static Elm_Slideshow_Item* _item_next_get(Elm_Slideshow_Item* item)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
Elm_Slideshow_Item* next = eina_list_data_get(eina_list_next(item->l));
|
Elm_Slideshow_Item* next = eina_list_data_get(eina_list_next(item->l));
|
||||||
if ((!next) && (wd->loop))
|
if ((!next) && (wd->loop))
|
||||||
next = eina_list_data_get(wd->items);
|
next = eina_list_data_get(wd->items);
|
||||||
|
@ -195,18 +195,18 @@ static void
|
||||||
_item_realize(Elm_Slideshow_Item *item)
|
_item_realize(Elm_Slideshow_Item *item)
|
||||||
{
|
{
|
||||||
Elm_Slideshow_Item *_item_prev, *_item_next;
|
Elm_Slideshow_Item *_item_prev, *_item_next;
|
||||||
Evas_Object *obj = item->base.widget;
|
Evas_Object *obj = WIDGET(item);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
int ac, bc, lc, ic = 0;
|
int ac, bc, lc, ic = 0;
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if ((!item->base.view) && (item->itc->func.get))
|
if ((!VIEW(item)) && (item->itc->func.get))
|
||||||
{
|
{
|
||||||
item->base.view = item->itc->func.get((void*)item->base.data, obj);
|
VIEW(item) = item->itc->func.get((void*)item->base.data, obj);
|
||||||
evas_object_smart_member_add(item->base.view, obj);
|
evas_object_smart_member_add(VIEW(item), obj);
|
||||||
item->l_built = eina_list_append(NULL, item);
|
item->l_built = eina_list_append(NULL, item);
|
||||||
wd->items_built = eina_list_merge(wd->items_built, item->l_built);
|
wd->items_built = eina_list_merge(wd->items_built, item->l_built);
|
||||||
evas_object_hide(item->base.view);
|
evas_object_hide(VIEW(item));
|
||||||
}
|
}
|
||||||
else if (item->l_built)
|
else if (item->l_built)
|
||||||
wd->items_built = eina_list_demote_list(wd->items_built, item->l_built);
|
wd->items_built = eina_list_demote_list(wd->items_built, item->l_built);
|
||||||
|
@ -227,18 +227,18 @@ _item_realize(Elm_Slideshow_Item *item)
|
||||||
{
|
{
|
||||||
_item_next = _item_next_get(_item_next);
|
_item_next = _item_next_get(_item_next);
|
||||||
if ((_item_next)
|
if ((_item_next)
|
||||||
&& (!_item_next->base.view)
|
&& (!VIEW(_item_next))
|
||||||
&& (_item_next->itc->func.get))
|
&& (_item_next->itc->func.get))
|
||||||
{
|
{
|
||||||
ic++;
|
ic++;
|
||||||
_item_next->base.view =
|
VIEW(_item_next) =
|
||||||
_item_next->itc->func.get(
|
_item_next->itc->func.get(
|
||||||
(void*)_item_next->base.data, obj);
|
(void*)_item_next->base.data, obj);
|
||||||
evas_object_smart_member_add(_item_next->base.view, obj);
|
evas_object_smart_member_add(VIEW(_item_next), obj);
|
||||||
_item_next->l_built = eina_list_append(NULL, _item_next);
|
_item_next->l_built = eina_list_append(NULL, _item_next);
|
||||||
wd->items_built = eina_list_merge(wd->items_built,
|
wd->items_built = eina_list_merge(wd->items_built,
|
||||||
_item_next->l_built);
|
_item_next->l_built);
|
||||||
evas_object_hide(_item_next->base.view);
|
evas_object_hide(VIEW(_item_next));
|
||||||
}
|
}
|
||||||
else if (_item_next && _item_next->l_built)
|
else if (_item_next && _item_next->l_built)
|
||||||
{
|
{
|
||||||
|
@ -258,18 +258,18 @@ _item_realize(Elm_Slideshow_Item *item)
|
||||||
{
|
{
|
||||||
_item_prev = _item_prev_get(_item_prev);
|
_item_prev = _item_prev_get(_item_prev);
|
||||||
if ((_item_prev)
|
if ((_item_prev)
|
||||||
&& (!_item_prev->base.view)
|
&& (!VIEW(_item_prev))
|
||||||
&& (_item_prev->itc->func.get))
|
&& (_item_prev->itc->func.get))
|
||||||
{
|
{
|
||||||
ic++;
|
ic++;
|
||||||
_item_prev->base.view =
|
VIEW(_item_prev) =
|
||||||
_item_prev->itc->func.get(
|
_item_prev->itc->func.get(
|
||||||
(void*)_item_prev->base.data, obj);
|
(void*)_item_prev->base.data, obj);
|
||||||
evas_object_smart_member_add(_item_prev->base.view, obj);
|
evas_object_smart_member_add(VIEW(_item_prev), obj);
|
||||||
_item_prev->l_built = eina_list_append(NULL, _item_prev);
|
_item_prev->l_built = eina_list_append(NULL, _item_prev);
|
||||||
wd->items_built = eina_list_merge(wd->items_built,
|
wd->items_built = eina_list_merge(wd->items_built,
|
||||||
_item_prev->l_built);
|
_item_prev->l_built);
|
||||||
evas_object_hide(_item_prev->base.view);
|
evas_object_hide(VIEW(_item_prev));
|
||||||
}
|
}
|
||||||
else if (_item_prev && _item_prev->l_built)
|
else if (_item_prev && _item_prev->l_built)
|
||||||
{
|
{
|
||||||
|
@ -290,9 +290,9 @@ _item_realize(Elm_Slideshow_Item *item)
|
||||||
wd->items_built = eina_list_remove_list(wd->items_built,
|
wd->items_built = eina_list_remove_list(wd->items_built,
|
||||||
wd->items_built);
|
wd->items_built);
|
||||||
if (item->itc->func.del)
|
if (item->itc->func.del)
|
||||||
item->itc->func.del((void*)item->base.data, item->base.view);
|
item->itc->func.del((void*)item->base.data, VIEW(item));
|
||||||
evas_object_del(item->base.view);
|
evas_object_del(VIEW(item));
|
||||||
item->base.view = NULL;
|
VIEW(item) = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,18 +306,18 @@ _end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, c
|
||||||
item = wd->previous;
|
item = wd->previous;
|
||||||
if (item)
|
if (item)
|
||||||
{
|
{
|
||||||
edje_object_part_unswallow(wd->slideshow, item->base.view);
|
edje_object_part_unswallow(wd->slideshow, VIEW(item));
|
||||||
evas_object_hide(item->base.view);
|
evas_object_hide(VIEW(item));
|
||||||
wd->previous = NULL;
|
wd->previous = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
item = wd->current;
|
item = wd->current;
|
||||||
if ((!item) || (!item->base.view)) return;
|
if ((!item) || (!VIEW(item))) return;
|
||||||
|
|
||||||
_item_realize(item);
|
_item_realize(item);
|
||||||
edje_object_part_unswallow(wd->slideshow, item->base.view);
|
edje_object_part_unswallow(wd->slideshow, VIEW(item));
|
||||||
|
|
||||||
edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->base.view);
|
edje_object_part_swallow(wd->slideshow, "elm.swallow.1", VIEW(item));
|
||||||
edje_object_signal_emit(wd->slideshow, "anim,end", "slideshow");
|
edje_object_signal_emit(wd->slideshow, "anim,end", "slideshow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,25 +429,25 @@ elm_slideshow_show(Elm_Slideshow_Item *item)
|
||||||
Elm_Slideshow_Item *next = NULL;
|
Elm_Slideshow_Item *next = NULL;
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd)
|
if (!wd)
|
||||||
return;
|
return;
|
||||||
if (item == wd->current)
|
if (item == wd->current)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
next = item;
|
next = item;
|
||||||
_end(item->base.widget, item->base.widget, NULL, NULL);
|
_end(WIDGET(item), WIDGET(item), NULL, NULL);
|
||||||
|
|
||||||
if (wd->timer) ecore_timer_del(wd->timer);
|
if (wd->timer) ecore_timer_del(wd->timer);
|
||||||
if (wd->timeout > 0.0)
|
if (wd->timeout > 0.0)
|
||||||
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, item->base.widget);
|
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, WIDGET(item));
|
||||||
_item_realize(next);
|
_item_realize(next);
|
||||||
edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view);
|
edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(next));
|
||||||
snprintf(buf, sizeof(buf), "%s,next", wd->transition);
|
snprintf(buf, sizeof(buf), "%s,next", wd->transition);
|
||||||
edje_object_signal_emit(wd->slideshow, buf, "slideshow");
|
edje_object_signal_emit(wd->slideshow, buf, "slideshow");
|
||||||
wd->previous = wd->current;
|
wd->previous = wd->current;
|
||||||
wd->current = next;
|
wd->current = next;
|
||||||
evas_object_smart_callback_call(item->base.widget, SIG_CHANGED, wd->current);
|
evas_object_smart_callback_call(WIDGET(item), SIG_CHANGED, wd->current);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -473,7 +473,7 @@ elm_slideshow_next(Evas_Object *obj)
|
||||||
|
|
||||||
_item_realize(next);
|
_item_realize(next);
|
||||||
|
|
||||||
edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view);
|
edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(next));
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s,next", wd->transition);
|
snprintf(buf, sizeof(buf), "%s,next", wd->transition);
|
||||||
edje_object_signal_emit(wd->slideshow, buf, "slideshow");
|
edje_object_signal_emit(wd->slideshow, buf, "slideshow");
|
||||||
|
@ -506,7 +506,7 @@ elm_slideshow_previous(Evas_Object *obj)
|
||||||
|
|
||||||
_item_realize(prev);
|
_item_realize(prev);
|
||||||
|
|
||||||
edje_object_part_swallow(wd->slideshow, "elm.swallow.2", prev->base.view);
|
edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(prev));
|
||||||
|
|
||||||
snprintf(buf, 1024, "%s,previous", wd->transition);
|
snprintf(buf, 1024, "%s,previous", wd->transition);
|
||||||
edje_object_signal_emit(wd->slideshow, buf, "slideshow");
|
edje_object_signal_emit(wd->slideshow, buf, "slideshow");
|
||||||
|
@ -626,9 +626,9 @@ elm_slideshow_clear(Evas_Object *obj)
|
||||||
EINA_LIST_FREE(wd->items_built, item)
|
EINA_LIST_FREE(wd->items_built, item)
|
||||||
{
|
{
|
||||||
if (item->itc->func.del)
|
if (item->itc->func.del)
|
||||||
item->itc->func.del((void*)item->base.data, item->base.view);
|
item->itc->func.del((void*)item->base.data, VIEW(item));
|
||||||
evas_object_del(item->base.view);
|
evas_object_del(VIEW(item));
|
||||||
item->base.view = NULL;
|
VIEW(item) = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_LIST_FREE(wd->items, item)
|
EINA_LIST_FREE(wd->items, item)
|
||||||
|
@ -641,7 +641,7 @@ EAPI void
|
||||||
elm_slideshow_item_del(Elm_Slideshow_Item *item)
|
elm_slideshow_item_del(Elm_Slideshow_Item *item)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (wd->previous == item) wd->previous = NULL;
|
if (wd->previous == item) wd->previous = NULL;
|
||||||
if (wd->current == item)
|
if (wd->current == item)
|
||||||
|
@ -663,10 +663,10 @@ elm_slideshow_item_del(Elm_Slideshow_Item *item)
|
||||||
wd->items = eina_list_remove_list(wd->items, item->l);
|
wd->items = eina_list_remove_list(wd->items, item->l);
|
||||||
wd->items_built = eina_list_remove_list(wd->items_built, item->l_built);
|
wd->items_built = eina_list_remove_list(wd->items_built, item->l_built);
|
||||||
|
|
||||||
if ((item->base.view) && (item->itc->func.del))
|
if ((VIEW(item)) && (item->itc->func.del))
|
||||||
item->itc->func.del((void*)item->base.data, item->base.view);
|
item->itc->func.del((void*)item->base.data, VIEW(item));
|
||||||
if (item->base.view)
|
if (VIEW(item))
|
||||||
evas_object_del(item->base.view);
|
evas_object_del(VIEW(item));
|
||||||
free(item);
|
free(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ EAPI Evas_Object *
|
||||||
elm_slideshow_item_object_get(const Elm_Slideshow_Item * item)
|
elm_slideshow_item_object_get(const Elm_Slideshow_Item * item)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
return item->base.view;
|
return VIEW(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
|
|
|
@ -118,12 +118,12 @@ _elm_toolbar_icon_size_get(Widget_Data *wd)
|
||||||
static void
|
static void
|
||||||
_item_show(Elm_Toolbar_Item *it)
|
_item_show(Elm_Toolbar_Item *it)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
Evas_Coord x, y, w, h, bx, by;
|
Evas_Coord x, y, w, h, bx, by;
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
evas_object_geometry_get(wd->bx, &bx, &by, NULL, NULL);
|
evas_object_geometry_get(wd->bx, &bx, &by, NULL, NULL);
|
||||||
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
|
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
|
||||||
elm_smart_scroller_child_region_show(wd->scr, x - bx, y - by, w, h);
|
elm_smart_scroller_child_region_show(wd->scr, x - bx, y - by, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,11 +132,11 @@ _item_unselect(Elm_Toolbar_Item *item)
|
||||||
{
|
{
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
if ((!item) || (!item->selected)) return;
|
if ((!item) || (!item->selected)) return;
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
item->selected = EINA_FALSE;
|
item->selected = EINA_FALSE;
|
||||||
wd->selected_item = NULL;
|
wd->selected_item = NULL;
|
||||||
edje_object_signal_emit(item->base.view, "elm,state,unselected", "elm");
|
edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm");
|
||||||
elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm");
|
elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ static void
|
||||||
_item_select(Elm_Toolbar_Item *it)
|
_item_select(Elm_Toolbar_Item *it)
|
||||||
{
|
{
|
||||||
Elm_Toolbar_Item *it2;
|
Elm_Toolbar_Item *it2;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
Evas_Object *obj2;
|
Evas_Object *obj2;
|
||||||
Eina_Bool sel;
|
Eina_Bool sel;
|
||||||
|
|
||||||
|
@ -161,28 +161,28 @@ _item_select(Elm_Toolbar_Item *it)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
it2 = elm_toolbar_selected_item_get(it->base.widget);
|
it2 = elm_toolbar_selected_item_get(WIDGET(it));
|
||||||
_item_unselect(it2);
|
_item_unselect(it2);
|
||||||
|
|
||||||
it->selected = EINA_TRUE;
|
it->selected = EINA_TRUE;
|
||||||
wd->selected_item = it;
|
wd->selected_item = it;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
||||||
elm_widget_signal_emit(it->icon, "elm,state,selected", "elm");
|
elm_widget_signal_emit(it->icon, "elm,state,selected", "elm");
|
||||||
_item_show(it);
|
_item_show(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
obj2 = it->base.widget;
|
obj2 = WIDGET(it);
|
||||||
if (it->menu && (!sel))
|
if (it->menu && (!sel))
|
||||||
{
|
{
|
||||||
evas_object_show(it->o_menu);
|
evas_object_show(it->o_menu);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_RESIZE,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_RESIZE,
|
||||||
_menu_move_resize, it);
|
_menu_move_resize, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOVE,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOVE,
|
||||||
_menu_move_resize, it);
|
_menu_move_resize, it);
|
||||||
|
|
||||||
_menu_move_resize(it, NULL, NULL, NULL);
|
_menu_move_resize(it, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
if (it->func) it->func((void *)(it->base.data), it->base.widget, it);
|
if (it->func) it->func((void *)(it->base.data), WIDGET(it), it);
|
||||||
evas_object_smart_callback_call(obj2, SIG_CLICKED, it);
|
evas_object_smart_callback_call(obj2, SIG_CLICKED, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ _menu_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev
|
||||||
{
|
{
|
||||||
Elm_Toolbar_Item *selected;
|
Elm_Toolbar_Item *selected;
|
||||||
Elm_Toolbar_Item *it = data;
|
Elm_Toolbar_Item *it = data;
|
||||||
selected = elm_toolbar_selected_item_get(it->base.widget);
|
selected = elm_toolbar_selected_item_get(WIDGET(it));
|
||||||
_item_unselect(selected);
|
_item_unselect(selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,29 +208,29 @@ _menu_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
|
||||||
{
|
{
|
||||||
Elm_Toolbar_Item *it = data;
|
Elm_Toolbar_Item *it = data;
|
||||||
Evas_Coord x,y,w,h;
|
Evas_Coord x,y,w,h;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
|
|
||||||
if ((!wd) || (!wd->menu_parent)) return;
|
if ((!wd) || (!wd->menu_parent)) return;
|
||||||
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
|
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
|
||||||
elm_menu_move(it->o_menu, x, y+h);
|
elm_menu_move(it->o_menu, x, y+h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_item_disable(Elm_Toolbar_Item *it, Eina_Bool disabled)
|
_item_disable(Elm_Toolbar_Item *it, Eina_Bool disabled)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
|
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (it->disabled == disabled) return;
|
if (it->disabled == disabled) return;
|
||||||
it->disabled = !!disabled;
|
it->disabled = !!disabled;
|
||||||
if (it->disabled)
|
if (it->disabled)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
||||||
elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm");
|
elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
|
||||||
elm_widget_signal_emit(it->icon, "elm,state,enabled", "elm");
|
elm_widget_signal_emit(it->icon, "elm,state,enabled", "elm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -294,14 +294,14 @@ _del_hook(Evas_Object *obj)
|
||||||
static void
|
static void
|
||||||
_mirrored_set_item(Evas_Object *obj __UNUSED__, Elm_Toolbar_Item *it, Eina_Bool mirrored)
|
_mirrored_set_item(Evas_Object *obj __UNUSED__, Elm_Toolbar_Item *it, Eina_Bool mirrored)
|
||||||
{
|
{
|
||||||
edje_object_mirrored_set(it->base.view, mirrored);
|
edje_object_mirrored_set(VIEW(it), mirrored);
|
||||||
elm_widget_mirrored_set(it->o_menu, mirrored);
|
elm_widget_mirrored_set(it->o_menu, mirrored);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_theme_hook_item(Evas_Object *obj, Elm_Toolbar_Item *it, double scale, int icon_size)
|
_theme_hook_item(Evas_Object *obj, Elm_Toolbar_Item *it, double scale, int icon_size)
|
||||||
{
|
{
|
||||||
Evas_Object *view = it->base.view;
|
Evas_Object *view = VIEW(it);
|
||||||
Evas_Coord mw, mh;
|
Evas_Coord mw, mh;
|
||||||
const char *style = elm_widget_style_get(obj);
|
const char *style = elm_widget_style_get(obj);
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ _sizing_eval(Evas_Object *obj)
|
||||||
static void
|
static void
|
||||||
_item_menu_create(Widget_Data *wd, Elm_Toolbar_Item *item)
|
_item_menu_create(Widget_Data *wd, Elm_Toolbar_Item *item)
|
||||||
{
|
{
|
||||||
item->o_menu = elm_menu_add(item->base.view);
|
item->o_menu = elm_menu_add(VIEW(item));
|
||||||
item->menu = EINA_TRUE;
|
item->menu = EINA_TRUE;
|
||||||
if (wd->menu_parent)
|
if (wd->menu_parent)
|
||||||
elm_menu_parent_set(item->o_menu, wd->menu_parent);
|
elm_menu_parent_set(item->o_menu, wd->menu_parent);
|
||||||
|
@ -476,12 +476,12 @@ _fix_items_visibility(Widget_Data *wd, Evas_Coord *iw, Evas_Coord vw)
|
||||||
|
|
||||||
if (wd->more_item)
|
if (wd->more_item)
|
||||||
{
|
{
|
||||||
evas_object_geometry_get(wd->more_item->base.view, NULL, NULL, &ciw, NULL);
|
evas_object_geometry_get(wd->VIEW(more_item), NULL, NULL, &ciw, NULL);
|
||||||
*iw += ciw;
|
*iw += ciw;
|
||||||
}
|
}
|
||||||
EINA_LIST_FREE(sorted, it)
|
EINA_LIST_FREE(sorted, it)
|
||||||
{
|
{
|
||||||
evas_object_geometry_get(it->base.view, NULL, NULL, &ciw, NULL);
|
evas_object_geometry_get(VIEW(it), NULL, NULL, &ciw, NULL);
|
||||||
*iw += ciw;
|
*iw += ciw;
|
||||||
it->prio.visible = (*iw <= vw);
|
it->prio.visible = (*iw <= vw);
|
||||||
}
|
}
|
||||||
|
@ -491,7 +491,7 @@ static void
|
||||||
_elm_toolbar_item_menu_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
_elm_toolbar_item_menu_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||||
{
|
{
|
||||||
Elm_Toolbar_Item *it = data;
|
Elm_Toolbar_Item *it = data;
|
||||||
if (it->func) it->func((void *)(it->base.data), it->base.widget, it);
|
if (it->func) it->func((void *)(it->base.data), WIDGET(it), it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -513,7 +513,7 @@ _resize_job(void *data)
|
||||||
|
|
||||||
evas_object_resize(wd->bx, vw, h);
|
evas_object_resize(wd->bx, vw, h);
|
||||||
_fix_items_visibility(wd, &iw, vw);
|
_fix_items_visibility(wd, &iw, vw);
|
||||||
evas_object_geometry_get(wd->more_item->base.view, NULL, NULL, &more_w, NULL);
|
evas_object_geometry_get(wd->VIEW(more_item), NULL, NULL, &more_w, NULL);
|
||||||
if (iw - more_w <= vw)
|
if (iw - more_w <= vw)
|
||||||
iw -= more_w;
|
iw -= more_w;
|
||||||
|
|
||||||
|
@ -542,17 +542,17 @@ _resize_job(void *data)
|
||||||
elm_menu_item_disabled_set(item, it->disabled);
|
elm_menu_item_disabled_set(item, it->disabled);
|
||||||
if (it->o_menu) elm_menu_clone(it->o_menu, menu, item);
|
if (it->o_menu) elm_menu_clone(it->o_menu, menu, item);
|
||||||
}
|
}
|
||||||
evas_object_hide(it->base.view);
|
evas_object_hide(VIEW(it));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
evas_object_box_append(wd->bx, it->base.view);
|
evas_object_box_append(wd->bx, VIEW(it));
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_box_append(wd->bx, wd->more_item->base.view);
|
evas_object_box_append(wd->bx, wd->VIEW(more_item));
|
||||||
evas_object_show(wd->more_item->base.view);
|
evas_object_show(wd->VIEW(more_item));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -560,10 +560,10 @@ _resize_job(void *data)
|
||||||
* button, of course). */
|
* button, of course). */
|
||||||
EINA_INLIST_FOREACH(wd->items, it)
|
EINA_INLIST_FOREACH(wd->items, it)
|
||||||
{
|
{
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
evas_object_box_append(wd->bx, it->base.view);
|
evas_object_box_append(wd->bx, VIEW(it));
|
||||||
}
|
}
|
||||||
evas_object_hide(wd->more_item->base.view);
|
evas_object_hide(wd->VIEW(more_item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_HIDE)
|
else if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_HIDE)
|
||||||
|
@ -578,11 +578,11 @@ _resize_job(void *data)
|
||||||
EINA_INLIST_FOREACH(wd->items, it)
|
EINA_INLIST_FOREACH(wd->items, it)
|
||||||
{
|
{
|
||||||
if (!it->prio.visible)
|
if (!it->prio.visible)
|
||||||
evas_object_hide(it->base.view);
|
evas_object_hide(VIEW(it));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
evas_object_box_append(wd->bx, it->base.view);
|
evas_object_box_append(wd->bx, VIEW(it));
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -591,8 +591,8 @@ _resize_job(void *data)
|
||||||
/* All items are visible, show them all */
|
/* All items are visible, show them all */
|
||||||
EINA_INLIST_FOREACH(wd->items, it)
|
EINA_INLIST_FOREACH(wd->items, it)
|
||||||
{
|
{
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
evas_object_box_append(wd->bx, it->base.view);
|
evas_object_box_append(wd->bx, VIEW(it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -636,7 +636,7 @@ _select_filter(Elm_Toolbar_Item *it, Evas_Object *obj __UNUSED__, const char *em
|
||||||
button = atoi(emission + sizeof("mouse,clicked,") - 1);
|
button = atoi(emission + sizeof("mouse,clicked,") - 1);
|
||||||
if (button == 1) return; /* regular left click event */
|
if (button == 1) return; /* regular left click event */
|
||||||
snprintf(buf, sizeof(buf), "elm,action,click,%d", button);
|
snprintf(buf, sizeof(buf), "elm,action,click,%d", button);
|
||||||
edje_object_signal_emit(it->base.view, buf, "elm");
|
edje_object_signal_emit(VIEW(it), buf, "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -645,7 +645,7 @@ _select(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__
|
||||||
Elm_Toolbar_Item *it = data;
|
Elm_Toolbar_Item *it = data;
|
||||||
|
|
||||||
if ((_elm_config->access_mode == ELM_ACCESS_MODE_OFF) ||
|
if ((_elm_config->access_mode == ELM_ACCESS_MODE_OFF) ||
|
||||||
(_elm_access_2nd_click_timeout(it->base.view)))
|
(_elm_access_2nd_click_timeout(VIEW(it))))
|
||||||
{
|
{
|
||||||
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
|
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
|
||||||
_elm_access_say(E_("Selected"));
|
_elm_access_say(E_("Selected"));
|
||||||
|
@ -656,21 +656,21 @@ _select(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_long_press(Elm_Toolbar_Item *it)
|
_long_press(Elm_Toolbar_Item *it)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
wd->long_timer = NULL;
|
wd->long_timer = NULL;
|
||||||
wd->long_press = EINA_TRUE;
|
wd->long_press = EINA_TRUE;
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_LONGPRESSED, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mouse_down(Elm_Toolbar_Item *it, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Event_Mouse_Down *ev)
|
_mouse_down(Elm_Toolbar_Item *it, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Event_Mouse_Down *ev)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (ev->button != 1) return;
|
if (ev->button != 1) return;
|
||||||
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
||||||
evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
|
evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it);
|
||||||
wd->long_press = EINA_FALSE;
|
wd->long_press = EINA_FALSE;
|
||||||
if (wd->long_timer) ecore_timer_interval_set(wd->long_timer, _elm_config->longpress_timeout);
|
if (wd->long_timer) ecore_timer_interval_set(wd->long_timer, _elm_config->longpress_timeout);
|
||||||
else wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, (Ecore_Task_Cb)_long_press, it);
|
else wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, (Ecore_Task_Cb)_long_press, it);
|
||||||
|
@ -679,7 +679,7 @@ _mouse_down(Elm_Toolbar_Item *it, Evas *evas __UNUSED__, Evas_Object *obj __UNUS
|
||||||
static void
|
static void
|
||||||
_mouse_up(Elm_Toolbar_Item *it, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Event_Mouse_Up *ev)
|
_mouse_up(Elm_Toolbar_Item *it, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Event_Mouse_Up *ev)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(it->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(it));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if (ev->button != 1) return;
|
if (ev->button != 1) return;
|
||||||
if (wd->long_timer)
|
if (wd->long_timer)
|
||||||
|
@ -693,7 +693,7 @@ static void
|
||||||
_mouse_in(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
_mouse_in(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
||||||
{
|
{
|
||||||
Elm_Toolbar_Item *it = data;
|
Elm_Toolbar_Item *it = data;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,highlighted", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,highlighted", "elm");
|
||||||
elm_widget_signal_emit(it->icon, "elm,state,highlighted", "elm");
|
elm_widget_signal_emit(it->icon, "elm,state,highlighted", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,7 +701,7 @@ static void
|
||||||
_mouse_out(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
_mouse_out(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
||||||
{
|
{
|
||||||
Elm_Toolbar_Item *it = data;
|
Elm_Toolbar_Item *it = data;
|
||||||
edje_object_signal_emit(it->base.view, "elm,state,unhighlighted", "elm");
|
edje_object_signal_emit(VIEW(it), "elm,state,unhighlighted", "elm");
|
||||||
elm_widget_signal_emit(it->icon, "elm,state,unhighlighted", "elm");
|
elm_widget_signal_emit(it->icon, "elm,state,unhighlighted", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,8 +762,8 @@ _item_new(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb f
|
||||||
it->func = func;
|
it->func = func;
|
||||||
it->separator = EINA_FALSE;
|
it->separator = EINA_FALSE;
|
||||||
it->base.data = data;
|
it->base.data = data;
|
||||||
it->base.view = edje_object_add(evas_object_evas_get(obj));
|
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||||
_elm_access_item_register((Elm_Widget_Item *)it, it->base.view);
|
_elm_access_item_register((Elm_Widget_Item *)it, VIEW(it));
|
||||||
_elm_access_text_set(_elm_access_item_get((Elm_Widget_Item *)it),
|
_elm_access_text_set(_elm_access_item_get((Elm_Widget_Item *)it),
|
||||||
ELM_ACCESS_TYPE, E_("Tool Item"));
|
ELM_ACCESS_TYPE, E_("Tool Item"));
|
||||||
_elm_access_callback_set(_elm_access_item_get((Elm_Widget_Item *)it),
|
_elm_access_callback_set(_elm_access_item_get((Elm_Widget_Item *)it),
|
||||||
|
@ -783,21 +783,21 @@ _item_new(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb f
|
||||||
evas_object_del(icon_obj);
|
evas_object_del(icon_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
_elm_theme_object_set(obj, it->base.view, "toolbar", "item",
|
_elm_theme_object_set(obj, VIEW(it), "toolbar", "item",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
edje_object_signal_callback_add(it->base.view, "elm,action,click", "elm",
|
edje_object_signal_callback_add(VIEW(it), "elm,action,click", "elm",
|
||||||
_select, it);
|
_select, it);
|
||||||
edje_object_signal_callback_add(it->base.view, "mouse,clicked,*", "*",
|
edje_object_signal_callback_add(VIEW(it), "mouse,clicked,*", "*",
|
||||||
(Edje_Signal_Cb)_select_filter, it);
|
(Edje_Signal_Cb)_select_filter, it);
|
||||||
edje_object_signal_callback_add(it->base.view, "elm,mouse,in", "elm",
|
edje_object_signal_callback_add(VIEW(it), "elm,mouse,in", "elm",
|
||||||
_mouse_in, it);
|
_mouse_in, it);
|
||||||
edje_object_signal_callback_add(it->base.view, "elm,mouse,out", "elm",
|
edje_object_signal_callback_add(VIEW(it), "elm,mouse,out", "elm",
|
||||||
_mouse_out, it);
|
_mouse_out, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
(Evas_Object_Event_Cb)_mouse_down, it);
|
(Evas_Object_Event_Cb)_mouse_down, it);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_UP,
|
||||||
(Evas_Object_Event_Cb)_mouse_up, it);
|
(Evas_Object_Event_Cb)_mouse_up, it);
|
||||||
elm_widget_sub_object_add(obj, it->base.view);
|
elm_widget_sub_object_add(obj, VIEW(it));
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
{
|
{
|
||||||
int ms = 0;
|
int ms = 0;
|
||||||
|
@ -805,27 +805,27 @@ _item_new(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb f
|
||||||
ms = ((double)wd->icon_size * _elm_config->scale);
|
ms = ((double)wd->icon_size * _elm_config->scale);
|
||||||
evas_object_size_hint_min_set(it->icon, ms, ms);
|
evas_object_size_hint_min_set(it->icon, ms, ms);
|
||||||
evas_object_size_hint_max_set(it->icon, ms, ms);
|
evas_object_size_hint_max_set(it->icon, ms, ms);
|
||||||
edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
|
edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
|
||||||
evas_object_show(it->icon);
|
evas_object_show(it->icon);
|
||||||
elm_widget_sub_object_add(obj, it->icon);
|
elm_widget_sub_object_add(obj, it->icon);
|
||||||
}
|
}
|
||||||
edje_object_part_text_set(it->base.view, "elm.text", it->label);
|
edje_object_part_text_set(VIEW(it), "elm.text", it->label);
|
||||||
mw = mh = -1;
|
mw = mh = -1;
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
edje_object_size_min_restricted_calc(it->base.view, &mw, &mh, mw, mh);
|
edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw, mh);
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
if (wd->vertical)
|
if (wd->vertical)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_weight_set(it->base.view, EVAS_HINT_EXPAND, -1.0);
|
evas_object_size_hint_weight_set(VIEW(it), EVAS_HINT_EXPAND, -1.0);
|
||||||
evas_object_size_hint_align_set(it->base.view, EVAS_HINT_FILL, 0.5);
|
evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL, 0.5);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
evas_object_size_hint_weight_set(it->base.view, -1.0, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(VIEW(it), -1.0, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(it->base.view, 0.5, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(VIEW(it), 0.5, EVAS_HINT_FILL);
|
||||||
}
|
}
|
||||||
evas_object_size_hint_min_set(it->base.view, mw, mh);
|
evas_object_size_hint_min_set(VIEW(it), mw, mh);
|
||||||
evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_RESIZE,
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_RESIZE,
|
||||||
_resize_item, obj);
|
_resize_item, obj);
|
||||||
if ((!wd->items) && wd->always_select) _item_select(it);
|
if ((!wd->items) && wd->always_select) _item_select(it);
|
||||||
return it;
|
return it;
|
||||||
|
@ -920,8 +920,8 @@ elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, E
|
||||||
double scale = (elm_widget_scale_get(obj) * _elm_config->scale);
|
double scale = (elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
|
|
||||||
wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it));
|
wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it));
|
||||||
evas_object_box_append(wd->bx, it->base.view);
|
evas_object_box_append(wd->bx, VIEW(it));
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
|
|
||||||
_theme_hook_item(obj, it, scale, wd->icon_size);
|
_theme_hook_item(obj, it, scale, wd->icon_size);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
@ -948,7 +948,7 @@ elm_toolbar_item_state_next(Elm_Toolbar_Item *item)
|
||||||
Eina_List *next_state;
|
Eina_List *next_state;
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
|
|
||||||
obj = item->base.widget;
|
obj = WIDGET(item);
|
||||||
wd = elm_widget_data_get(obj);
|
wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
if (!item->states) return NULL;
|
if (!item->states) return NULL;
|
||||||
|
@ -967,7 +967,7 @@ elm_toolbar_item_state_prev(Elm_Toolbar_Item *item)
|
||||||
Eina_List *prev_state;
|
Eina_List *prev_state;
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
|
|
||||||
obj = item->base.widget;
|
obj = WIDGET(item);
|
||||||
wd = elm_widget_data_get(obj);
|
wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
if (!item->states) return NULL;
|
if (!item->states) return NULL;
|
||||||
|
@ -994,7 +994,7 @@ elm_toolbar_item_state_set(Elm_Toolbar_Item *it, Elm_Toolbar_Item_State *state)
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE);
|
||||||
|
|
||||||
obj = it->base.widget;
|
obj = WIDGET(it);
|
||||||
wd = elm_widget_data_get(obj);
|
wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return EINA_FALSE;
|
if (!wd) return EINA_FALSE;
|
||||||
if (!it->states) return EINA_FALSE;
|
if (!it->states) return EINA_FALSE;
|
||||||
|
@ -1062,8 +1062,8 @@ elm_toolbar_item_state_add(Elm_Toolbar_Item *item, const char *icon, const char
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
obj = item->base.widget;
|
obj = WIDGET(item);
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
|
|
||||||
if (!item->states)
|
if (!item->states)
|
||||||
|
@ -1150,8 +1150,8 @@ elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label,
|
||||||
double scale = (elm_widget_scale_get(obj) * _elm_config->scale);
|
double scale = (elm_widget_scale_get(obj) * _elm_config->scale);
|
||||||
|
|
||||||
wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it));
|
wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it));
|
||||||
evas_object_box_prepend(wd->bx, it->base.view);
|
evas_object_box_prepend(wd->bx, VIEW(it));
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
_theme_hook_item(obj, it, scale, wd->icon_size);
|
_theme_hook_item(obj, it, scale, wd->icon_size);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
|
||||||
|
@ -1172,8 +1172,8 @@ elm_toolbar_item_insert_before(Evas_Object *obj, Elm_Toolbar_Item *before, const
|
||||||
|
|
||||||
wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
|
wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
|
||||||
EINA_INLIST_GET(before));
|
EINA_INLIST_GET(before));
|
||||||
evas_object_box_insert_before(wd->bx, it->base.view, before->base.view);
|
evas_object_box_insert_before(wd->bx, VIEW(it), VIEW(before));
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
_theme_hook_item(obj, it, scale, wd->icon_size);
|
_theme_hook_item(obj, it, scale, wd->icon_size);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
|
||||||
|
@ -1194,8 +1194,8 @@ elm_toolbar_item_insert_after(Evas_Object *obj, Elm_Toolbar_Item *after, const c
|
||||||
|
|
||||||
wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
|
wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
|
||||||
EINA_INLIST_GET(after));
|
EINA_INLIST_GET(after));
|
||||||
evas_object_box_insert_after(wd->bx, it->base.view, after->base.view);
|
evas_object_box_insert_after(wd->bx, VIEW(it), VIEW(after));
|
||||||
evas_object_show(it->base.view);
|
evas_object_show(VIEW(it));
|
||||||
_theme_hook_item(obj, it, scale, wd->icon_size);
|
_theme_hook_item(obj, it, scale, wd->icon_size);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
|
|
||||||
|
@ -1244,7 +1244,7 @@ EAPI Evas_Object *
|
||||||
elm_toolbar_item_toolbar_get(const Elm_Toolbar_Item *item)
|
elm_toolbar_item_toolbar_get(const Elm_Toolbar_Item *item)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
return item->base.widget;
|
return WIDGET(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -1253,7 +1253,7 @@ elm_toolbar_item_priority_set(Elm_Toolbar_Item *item, int priority)
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
if (item->prio.priority == priority) return;
|
if (item->prio.priority == priority) return;
|
||||||
item->prio.priority = priority;
|
item->prio.priority = priority;
|
||||||
_resize(item->base.widget, NULL, NULL, NULL);
|
_resize(WIDGET(item), NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
|
@ -1281,23 +1281,23 @@ static void
|
||||||
_elm_toolbar_item_label_update(Elm_Toolbar_Item *item)
|
_elm_toolbar_item_label_update(Elm_Toolbar_Item *item)
|
||||||
{
|
{
|
||||||
Evas_Coord mw = -1, mh = -1;
|
Evas_Coord mw = -1, mh = -1;
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
edje_object_part_text_set(item->base.view, "elm.text", item->label);
|
edje_object_part_text_set(VIEW(item), "elm.text", item->label);
|
||||||
|
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
edje_object_size_min_restricted_calc(item->base.view, &mw, &mh, mw, mh);
|
edje_object_size_min_restricted_calc(VIEW(item), &mw, &mh, mw, mh);
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
if (wd->vertical)
|
if (wd->vertical)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_weight_set(item->base.view, EVAS_HINT_EXPAND, -1.0);
|
evas_object_size_hint_weight_set(VIEW(item), EVAS_HINT_EXPAND, -1.0);
|
||||||
evas_object_size_hint_align_set(item->base.view, EVAS_HINT_FILL, 0.5);
|
evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, 0.5);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
evas_object_size_hint_weight_set(item->base.view, -1.0, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(VIEW(item), -1.0, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(item->base.view, 0.5, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(VIEW(item), 0.5, EVAS_HINT_FILL);
|
||||||
}
|
}
|
||||||
evas_object_size_hint_min_set(item->base.view, mw, mh);
|
evas_object_size_hint_min_set(VIEW(item), mw, mh);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1307,7 +1307,7 @@ _elm_toolbar_item_label_set_cb (void *data, Evas_Object *obj, const char *emissi
|
||||||
_elm_toolbar_item_label_update(item);
|
_elm_toolbar_item_label_update(item);
|
||||||
edje_object_signal_callback_del(obj, emission, source,
|
edje_object_signal_callback_del(obj, emission, source,
|
||||||
_elm_toolbar_item_label_set_cb);
|
_elm_toolbar_item_label_set_cb);
|
||||||
edje_object_signal_emit (item->base.view, "elm,state,label,reset", "elm");
|
edje_object_signal_emit (VIEW(item), "elm,state,label,reset", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1318,18 +1318,18 @@ _item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal)
|
||||||
if ((label) && (item->label) && (!strcmp(label, item->label))) return;
|
if ((label) && (item->label) && (!strcmp(label, item->label))) return;
|
||||||
|
|
||||||
eina_stringshare_replace(&item->label, label);
|
eina_stringshare_replace(&item->label, label);
|
||||||
s = edje_object_data_get(item->base.view, "transition_animation_on");
|
s = edje_object_data_get(VIEW(item), "transition_animation_on");
|
||||||
if ((s) && (atoi(s)))
|
if ((s) && (atoi(s)))
|
||||||
{
|
{
|
||||||
edje_object_part_text_set(item->base.view, "elm.text_new", item->label);
|
edje_object_part_text_set(VIEW(item), "elm.text_new", item->label);
|
||||||
edje_object_signal_emit (item->base.view, signal, "elm");
|
edje_object_signal_emit (VIEW(item), signal, "elm");
|
||||||
edje_object_signal_callback_add(item->base.view,
|
edje_object_signal_callback_add(VIEW(item),
|
||||||
"elm,state,label_set,done", "elm",
|
"elm,state,label_set,done", "elm",
|
||||||
_elm_toolbar_item_label_set_cb, item);
|
_elm_toolbar_item_label_set_cb, item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_elm_toolbar_item_label_update(item);
|
_elm_toolbar_item_label_update(item);
|
||||||
_resize(item->base.widget, NULL, NULL, NULL);
|
_resize(WIDGET(item), NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -1345,26 +1345,26 @@ _elm_toolbar_item_icon_update(Elm_Toolbar_Item *item)
|
||||||
Elm_Toolbar_Item_State *it_state;
|
Elm_Toolbar_Item_State *it_state;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Evas_Coord mw = -1, mh = -1;
|
Evas_Coord mw = -1, mh = -1;
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
Evas_Object *old_icon = edje_object_part_swallow_get(item->base.view,
|
Evas_Object *old_icon = edje_object_part_swallow_get(VIEW(item),
|
||||||
"elm.swallow.icon");
|
"elm.swallow.icon");
|
||||||
elm_widget_sub_object_del(item->base.view, old_icon);
|
elm_widget_sub_object_del(VIEW(item), old_icon);
|
||||||
evas_object_hide(old_icon);
|
evas_object_hide(old_icon);
|
||||||
edje_object_part_swallow(item->base.view, "elm.swallow.icon", item->icon);
|
edje_object_part_swallow(VIEW(item), "elm.swallow.icon", item->icon);
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
edje_object_size_min_restricted_calc(item->base.view, &mw, &mh, mw, mh);
|
edje_object_size_min_restricted_calc(VIEW(item), &mw, &mh, mw, mh);
|
||||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||||
if (wd->vertical)
|
if (wd->vertical)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_weight_set(item->base.view, EVAS_HINT_EXPAND, -1.0);
|
evas_object_size_hint_weight_set(VIEW(item), EVAS_HINT_EXPAND, -1.0);
|
||||||
evas_object_size_hint_align_set(item->base.view, EVAS_HINT_FILL, 0.5);
|
evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, 0.5);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
evas_object_size_hint_weight_set(item->base.view, -1.0, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(VIEW(item), -1.0, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(item->base.view, 0.5, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(VIEW(item), 0.5, EVAS_HINT_FILL);
|
||||||
}
|
}
|
||||||
evas_object_size_hint_min_set(item->base.view, mw, mh);
|
evas_object_size_hint_min_set(VIEW(item), mw, mh);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(item->states, l, it_state)
|
EINA_LIST_FOREACH(item->states, l, it_state)
|
||||||
if (it_state->icon == old_icon)
|
if (it_state->icon == old_icon)
|
||||||
|
@ -1383,7 +1383,7 @@ EAPI void
|
||||||
elm_toolbar_item_selected_set(Elm_Toolbar_Item *item, Eina_Bool selected)
|
elm_toolbar_item_selected_set(Elm_Toolbar_Item *item, Eina_Bool selected)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if (item->selected == selected) return;
|
if (item->selected == selected) return;
|
||||||
|
@ -1407,11 +1407,11 @@ static void
|
||||||
_elm_toolbar_item_icon_set_cb (void *data, Evas_Object *obj, const char *emission, const char *source)
|
_elm_toolbar_item_icon_set_cb (void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||||
{
|
{
|
||||||
Elm_Toolbar_Item *item = data;
|
Elm_Toolbar_Item *item = data;
|
||||||
edje_object_part_unswallow(item->base.view, item->icon);
|
edje_object_part_unswallow(VIEW(item), item->icon);
|
||||||
_elm_toolbar_item_icon_update(item);
|
_elm_toolbar_item_icon_update(item);
|
||||||
edje_object_signal_callback_del(obj, emission, source,
|
edje_object_signal_callback_del(obj, emission, source,
|
||||||
_elm_toolbar_item_icon_set_cb);
|
_elm_toolbar_item_icon_set_cb);
|
||||||
edje_object_signal_emit (item->base.view, "elm,state,icon,reset", "elm");
|
edje_object_signal_emit (VIEW(item), "elm,state,icon,reset", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1437,20 +1437,20 @@ _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Ob
|
||||||
evas_object_show(item->icon);
|
evas_object_show(item->icon);
|
||||||
elm_widget_sub_object_add(obj, item->icon);
|
elm_widget_sub_object_add(obj, item->icon);
|
||||||
}
|
}
|
||||||
s = edje_object_data_get(item->base.view, "transition_animation_on");
|
s = edje_object_data_get(VIEW(item), "transition_animation_on");
|
||||||
if ((s) && (atoi(s)))
|
if ((s) && (atoi(s)))
|
||||||
{
|
{
|
||||||
old_icon = edje_object_part_swallow_get(item->base.view,
|
old_icon = edje_object_part_swallow_get(VIEW(item),
|
||||||
"elm.swallow.icon_new");
|
"elm.swallow.icon_new");
|
||||||
if (old_icon)
|
if (old_icon)
|
||||||
{
|
{
|
||||||
elm_widget_sub_object_del(item->base.view, old_icon);
|
elm_widget_sub_object_del(VIEW(item), old_icon);
|
||||||
evas_object_hide(old_icon);
|
evas_object_hide(old_icon);
|
||||||
}
|
}
|
||||||
edje_object_part_swallow(item->base.view, "elm.swallow.icon_new",
|
edje_object_part_swallow(VIEW(item), "elm.swallow.icon_new",
|
||||||
item->icon);
|
item->icon);
|
||||||
edje_object_signal_emit (item->base.view, signal, "elm");
|
edje_object_signal_emit (VIEW(item), signal, "elm");
|
||||||
edje_object_signal_callback_add(item->base.view,
|
edje_object_signal_callback_add(VIEW(item),
|
||||||
"elm,state,icon_set,done", "elm",
|
"elm,state,icon_set,done", "elm",
|
||||||
_elm_toolbar_item_icon_set_cb, item);
|
_elm_toolbar_item_icon_set_cb, item);
|
||||||
}
|
}
|
||||||
|
@ -1467,7 +1467,7 @@ elm_toolbar_item_icon_set(Elm_Toolbar_Item *item, const char *icon)
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
|
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
obj = item->base.widget;
|
obj = WIDGET(item);
|
||||||
wd = elm_widget_data_get(obj);
|
wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
if ((icon) && (item->icon_str) && (!strcmp(icon, item->icon_str))) return;
|
if ((icon) && (item->icon_str) && (!strcmp(icon, item->icon_str))) return;
|
||||||
|
@ -1494,7 +1494,7 @@ elm_toolbar_item_icon_memfile_set(Elm_Toolbar_Item *item, const void *img, size_
|
||||||
Eina_Bool ret;
|
Eina_Bool ret;
|
||||||
|
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
|
||||||
obj = item->base.widget;
|
obj = WIDGET(item);
|
||||||
wd = elm_widget_data_get(obj);
|
wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return EINA_FALSE;
|
if (!wd) return EINA_FALSE;
|
||||||
|
|
||||||
|
@ -1523,11 +1523,11 @@ elm_toolbar_item_object_get(const Elm_Toolbar_Item *item)
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
|
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
obj = item->base.widget;
|
obj = WIDGET(item);
|
||||||
wd = elm_widget_data_get(obj);
|
wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
|
|
||||||
return item->base.view;
|
return VIEW(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
|
@ -1537,7 +1537,7 @@ elm_toolbar_item_icon_object_get(Elm_Toolbar_Item *item)
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
|
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
obj = item->base.widget;
|
obj = WIDGET(item);
|
||||||
wd = elm_widget_data_get(obj);
|
wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
|
|
||||||
|
@ -1552,9 +1552,9 @@ elm_toolbar_item_del(Elm_Toolbar_Item *item)
|
||||||
Elm_Toolbar_Item *next;
|
Elm_Toolbar_Item *next;
|
||||||
|
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
wd = elm_widget_data_get(item->base.widget);
|
wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
obj2 = item->base.widget;
|
obj2 = WIDGET(item);
|
||||||
next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next);
|
next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next);
|
||||||
wd->items = eina_inlist_remove(wd->items, EINA_INLIST_GET(item));
|
wd->items = eina_inlist_remove(wd->items, EINA_INLIST_GET(item));
|
||||||
if (!next) next = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items);
|
if (!next) next = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items);
|
||||||
|
@ -1582,14 +1582,14 @@ elm_toolbar_item_disabled_set(Elm_Toolbar_Item *item, Eina_Bool disabled)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
_item_disable(item, disabled);
|
_item_disable(item, disabled);
|
||||||
_resize(item->base.widget, NULL, NULL, NULL);
|
_resize(WIDGET(item), NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_toolbar_item_separator_set(Elm_Toolbar_Item *item, Eina_Bool separator)
|
elm_toolbar_item_separator_set(Elm_Toolbar_Item *item, Eina_Bool separator)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
Evas_Object *obj = item->base.widget;
|
Evas_Object *obj = WIDGET(item);
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
double scale;
|
double scale;
|
||||||
if (item->separator == separator) return;
|
if (item->separator == separator) return;
|
||||||
|
@ -1738,7 +1738,7 @@ EAPI void
|
||||||
elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu)
|
elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if (item->menu == menu) return;
|
if (item->menu == menu) return;
|
||||||
|
@ -1834,7 +1834,7 @@ EAPI Evas_Object *
|
||||||
elm_toolbar_item_menu_get(const Elm_Toolbar_Item *item)
|
elm_toolbar_item_menu_get(const Elm_Toolbar_Item *item)
|
||||||
{
|
{
|
||||||
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
|
||||||
Widget_Data *wd = elm_widget_data_get(item->base.widget);
|
Widget_Data *wd = elm_widget_data_get(WIDGET(item));
|
||||||
if ((!wd) || (!item->menu)) return NULL;
|
if ((!wd) || (!item->menu)) return NULL;
|
||||||
return item->o_menu;
|
return item->o_menu;
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,6 +247,9 @@ struct _Elm_Widget_Item
|
||||||
#define ELM_WIDGET_ITEM_MAGIC 0xef1e1301
|
#define ELM_WIDGET_ITEM_MAGIC 0xef1e1301
|
||||||
EINA_MAGIC;
|
EINA_MAGIC;
|
||||||
|
|
||||||
|
/* simple accessor macros */
|
||||||
|
#define VIEW(X) X->base.view
|
||||||
|
#define WIDGET(X) X->base.widget
|
||||||
Evas_Object *widget; /**< the owner widget that owns this item */
|
Evas_Object *widget; /**< the owner widget that owns this item */
|
||||||
Evas_Object *view; /**< the base view object */
|
Evas_Object *view; /**< the base view object */
|
||||||
const void *data; /**< item specific data */
|
const void *data; /**< item specific data */
|
||||||
|
|
Loading…
Reference in New Issue