forked from enlightenment/efl
Move eina list iterations to EINA_LIST_FOREACH variants.
By using these macros we can avoid errors and if we need to change things, we do just in the macro definitions. SVN revision: 39216
This commit is contained in:
parent
47c6288efc
commit
d1d91b99df
|
@ -2,7 +2,6 @@
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
|
|
||||||
typedef struct _Widget_Data Widget_Data;
|
typedef struct _Widget_Data Widget_Data;
|
||||||
typedef struct _Item Item;
|
|
||||||
|
|
||||||
struct _Widget_Data
|
struct _Widget_Data
|
||||||
{
|
{
|
||||||
|
@ -11,7 +10,7 @@ struct _Widget_Data
|
||||||
Eina_List *items;
|
Eina_List *items;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Item
|
struct _Elm_Hoversel_Item
|
||||||
{
|
{
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
const char *label;
|
const char *label;
|
||||||
|
@ -71,7 +70,7 @@ _hover_clicked(void *data, Evas_Object *obj, void *event_info)
|
||||||
static void
|
static void
|
||||||
_item_clicked(void *data, Evas_Object *obj, void *event_info)
|
_item_clicked(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Item *it = data;
|
Elm_Hoversel_Item *it = data;
|
||||||
Evas_Object *obj2 = it->obj;
|
Evas_Object *obj2 = it->obj;
|
||||||
elm_hoversel_hover_end(obj2);
|
elm_hoversel_hover_end(obj2);
|
||||||
if (it->func) it->func(it->data, obj2, it);
|
if (it->func) it->func(it->data, obj2, it);
|
||||||
|
@ -84,7 +83,9 @@ _button_clicked(void *data, Evas_Object *obj, void *event_info)
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
Evas_Object *bt, *bx, *ic;
|
Evas_Object *bt, *bx, *ic;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const Elm_Hoversel_Item *it;
|
||||||
|
|
||||||
wd->hover = elm_hover_add(data);
|
wd->hover = elm_hover_add(data);
|
||||||
elm_hover_style_set(wd->hover, "hoversel_vertical");
|
elm_hover_style_set(wd->hover, "hoversel_vertical");
|
||||||
evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data);
|
evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data);
|
||||||
|
@ -94,9 +95,8 @@ _button_clicked(void *data, Evas_Object *obj, void *event_info)
|
||||||
bx = elm_box_add(wd->hover);
|
bx = elm_box_add(wd->hover);
|
||||||
elm_box_homogenous_set(bx, 1);
|
elm_box_homogenous_set(bx, 1);
|
||||||
|
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
Item *it = l->data;
|
|
||||||
bt = elm_button_add(wd->hover);
|
bt = elm_button_add(wd->hover);
|
||||||
elm_button_style_set(bt, "hoversel_vertical_entry");
|
elm_button_style_set(bt, "hoversel_vertical_entry");
|
||||||
elm_button_label_set(bt, it->label);
|
elm_button_label_set(bt, it->label);
|
||||||
|
@ -203,7 +203,7 @@ elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
if (!wd) return NULL;
|
if (!wd) return NULL;
|
||||||
Item *it = calloc(1, sizeof(Item));
|
Elm_Hoversel_Item *it = calloc(1, sizeof(Elm_Hoversel_Item));
|
||||||
if (!it) return NULL;
|
if (!it) return NULL;
|
||||||
wd->items = eina_list_append(wd->items, it);
|
wd->items = eina_list_append(wd->items, it);
|
||||||
it->obj = obj;
|
it->obj = obj;
|
||||||
|
@ -212,13 +212,12 @@ elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file
|
||||||
it->icon_type = icon_type;
|
it->icon_type = icon_type;
|
||||||
it->func = func;
|
it->func = func;
|
||||||
it->data = (void *)data;
|
it->data = (void *)data;
|
||||||
return (Elm_Hoversel_Item *)it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_hoversel_item_del(Elm_Hoversel_Item *item)
|
elm_hoversel_item_del(Elm_Hoversel_Item *it)
|
||||||
{
|
{
|
||||||
Item *it = (Item *)item;
|
|
||||||
Widget_Data *wd = elm_widget_data_get(it->obj);
|
Widget_Data *wd = elm_widget_data_get(it->obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
elm_hoversel_hover_end(it->obj);
|
elm_hoversel_hover_end(it->obj);
|
||||||
|
|
|
@ -44,11 +44,10 @@ _item_select(Elm_Carousel_Item *it)
|
||||||
Elm_Carousel_Item *it2;
|
Elm_Carousel_Item *it2;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->obj);
|
Widget_Data *wd = elm_widget_data_get(it->obj);
|
||||||
Evas_Object *obj2;
|
Evas_Object *obj2;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
if (it->selected) return;
|
if (it->selected) return;
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it2)
|
||||||
{
|
{
|
||||||
it2 = l->data;
|
|
||||||
if (it2->selected)
|
if (it2->selected)
|
||||||
{
|
{
|
||||||
it2->selected = 0;
|
it2->selected = 0;
|
||||||
|
@ -75,12 +74,11 @@ static void
|
||||||
_theme_hook(Evas_Object *obj)
|
_theme_hook(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
Elm_Carousel_Item *it;
|
const Elm_Carousel_Item *it;
|
||||||
Evas_Coord mw, mh;
|
Evas_Coord mw, mh;
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
it = l->data;
|
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||||
_elm_theme_set(it->base, "carousel", "item", "default");
|
_elm_theme_set(it->base, "carousel", "item", "default");
|
||||||
|
@ -123,7 +121,7 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
Evas_Coord mw, mh, vw, vh, w, h;
|
Evas_Coord mw, mh, vw, vh, w, h;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
Elm_Carousel_Item *it;
|
Elm_Carousel_Item *it;
|
||||||
|
|
||||||
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
||||||
|
@ -133,9 +131,8 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
if (w != vw) evas_object_resize(wd->bx, vw, h);
|
if (w != vw) evas_object_resize(wd->bx, vw, h);
|
||||||
}
|
}
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
it = l->data;
|
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
{
|
{
|
||||||
_item_show(it);
|
_item_show(it);
|
||||||
|
|
|
@ -356,10 +356,11 @@ static void
|
||||||
_signal_selection_start(void *data, Evas_Object *obj, const char *emission, const char *source)
|
_signal_selection_start(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
for (l = entries; l; l = l->next)
|
Evas_Object *entry;
|
||||||
|
EINA_LIST_FOREACH(entries, l, entry)
|
||||||
{
|
{
|
||||||
if (l->data != data) elm_entry_select_none(l->data);
|
if (entry != data) elm_entry_select_none(entry);
|
||||||
}
|
}
|
||||||
wd->have_selection = 1;
|
wd->have_selection = 1;
|
||||||
evas_object_smart_callback_call(data, "selection,start", NULL);
|
evas_object_smart_callback_call(data, "selection,start", NULL);
|
||||||
|
@ -712,10 +713,11 @@ elm_entry_entry_set(Evas_Object *obj, const char *entry)
|
||||||
// debug
|
// debug
|
||||||
#if 0
|
#if 0
|
||||||
{
|
{
|
||||||
Eina_List *l, *an;
|
const Eina_List *l, *an;
|
||||||
|
const char *anchor;
|
||||||
an = edje_object_part_text_anchor_list_get(wd->ent, "elm.text");
|
an = edje_object_part_text_anchor_list_get(wd->ent, "elm.text");
|
||||||
for (l = an; l; l = l->next)
|
EINA_LIST_FOREACH(an, l, anchor)
|
||||||
printf("ANCHOR: %s\n", l->data);
|
printf("ANCHOR: %s\n", anchor);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
wd->changed = 1;
|
wd->changed = 1;
|
||||||
|
|
|
@ -279,13 +279,20 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = it->wd->selected; l;)
|
if (!it->selected)
|
||||||
{
|
{
|
||||||
Elm_Genlist_Item *it2 = l->data;
|
Widget_Data *wd = it->wd;
|
||||||
l = l->next;
|
while (wd->selected)
|
||||||
if ((it2 != it) && (it2->selected)) _item_unselect(it2);
|
_item_unselect(wd->selected->data);
|
||||||
|
_item_select(it);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const Eina_List *l, *l_next;
|
||||||
|
Elm_Genlist_Item *it2;
|
||||||
|
EINA_LIST_FOREACH_SAFE(it->wd->selected, l, l_next, it2)
|
||||||
|
if (it2 != it) _item_unselect(it2);
|
||||||
}
|
}
|
||||||
if (!it->selected) _item_select(it);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,12 +333,12 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc)
|
||||||
|
|
||||||
if (it->itc->func.label_get)
|
if (it->itc->func.label_get)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const char *key;
|
||||||
|
|
||||||
it->labels = _stringlist_get(edje_object_data_get(it->base, "labels"));
|
it->labels = _stringlist_get(edje_object_data_get(it->base, "labels"));
|
||||||
for (l = it->labels; l; l = l->next)
|
EINA_LIST_FOREACH(it->labels, l, key)
|
||||||
{
|
{
|
||||||
const char *key = l->data;
|
|
||||||
char *s = it->itc->func.label_get(it->data, it->wd->obj, l->data);
|
char *s = it->itc->func.label_get(it->data, it->wd->obj, l->data);
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
@ -342,12 +349,12 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc)
|
||||||
}
|
}
|
||||||
if (it->itc->func.icon_get)
|
if (it->itc->func.icon_get)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const char *key;
|
||||||
|
|
||||||
it->icons = _stringlist_get(edje_object_data_get(it->base, "icons"));
|
it->icons = _stringlist_get(edje_object_data_get(it->base, "icons"));
|
||||||
for (l = it->icons; l; l = l->next)
|
EINA_LIST_FOREACH(it->icons, l, key)
|
||||||
{
|
{
|
||||||
const char *key = l->data;
|
|
||||||
Evas_Object *ic = it->itc->func.icon_get(it->data, it->wd->obj, l->data);
|
Evas_Object *ic = it->itc->func.icon_get(it->data, it->wd->obj, l->data);
|
||||||
if (ic)
|
if (ic)
|
||||||
{
|
{
|
||||||
|
@ -360,12 +367,12 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc)
|
||||||
}
|
}
|
||||||
if (it->itc->func.state_get)
|
if (it->itc->func.state_get)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const char *key;
|
||||||
|
|
||||||
it->states = _stringlist_get(edje_object_data_get(it->base, "states"));
|
it->states = _stringlist_get(edje_object_data_get(it->base, "states"));
|
||||||
for (l = it->states; l; l = l->next)
|
EINA_LIST_FOREACH(it->states, l, key)
|
||||||
{
|
{
|
||||||
const char *key = l->data;
|
|
||||||
Evas_Bool on = it->itc->func.state_get(it->data, it->wd->obj, l->data);
|
Evas_Bool on = it->itc->func.state_get(it->data, it->wd->obj, l->data);
|
||||||
if (on)
|
if (on)
|
||||||
{
|
{
|
||||||
|
@ -411,14 +418,14 @@ _item_unrealize(Elm_Genlist_Item *it)
|
||||||
static int
|
static int
|
||||||
_item_block_recalc(Item_Block *itb, int in)
|
_item_block_recalc(Item_Block *itb, int in)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Elm_Genlist_Item *it;
|
||||||
Evas_Coord minw = 0, minh = 0;
|
Evas_Coord minw = 0, minh = 0;
|
||||||
int showme = 0;
|
int showme = 0;
|
||||||
Evas_Coord y = 0;
|
Evas_Coord y = 0;
|
||||||
|
|
||||||
for (l = itb->items; l; l = l->next)
|
EINA_LIST_FOREACH(itb->items, l, it)
|
||||||
{
|
{
|
||||||
Elm_Genlist_Item *it = l->data;
|
|
||||||
if (it->delete_me) continue;
|
if (it->delete_me) continue;
|
||||||
showme |= it->showme;
|
showme |= it->showme;
|
||||||
if (!itb->realized)
|
if (!itb->realized)
|
||||||
|
@ -446,11 +453,11 @@ _item_block_recalc(Item_Block *itb, int in)
|
||||||
static void
|
static void
|
||||||
_item_block_realize(Item_Block *itb, int in)
|
_item_block_realize(Item_Block *itb, int in)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Elm_Genlist_Item *it;
|
||||||
if (itb->realized) return;
|
if (itb->realized) return;
|
||||||
for (l = itb->items; l; l = l->next)
|
EINA_LIST_FOREACH(itb->items, l, it)
|
||||||
{
|
{
|
||||||
Elm_Genlist_Item *it = l->data;
|
|
||||||
if (it->delete_me) continue;
|
if (it->delete_me) continue;
|
||||||
_item_realize(it, in, 0);
|
_item_realize(it, in, 0);
|
||||||
in++;
|
in++;
|
||||||
|
@ -461,12 +468,12 @@ _item_block_realize(Item_Block *itb, int in)
|
||||||
static void
|
static void
|
||||||
_item_block_unrealize(Item_Block *itb)
|
_item_block_unrealize(Item_Block *itb)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Elm_Genlist_Item *it;
|
||||||
|
|
||||||
if (!itb->realized) return;
|
if (!itb->realized) return;
|
||||||
for (l = itb->items; l; l = l->next)
|
EINA_LIST_FOREACH(itb->items, l, it)
|
||||||
{
|
{
|
||||||
Elm_Genlist_Item *it = l->data;
|
|
||||||
_item_unrealize(it);
|
_item_unrealize(it);
|
||||||
}
|
}
|
||||||
itb->realized = 0;
|
itb->realized = 0;
|
||||||
|
@ -475,14 +482,13 @@ _item_block_unrealize(Item_Block *itb)
|
||||||
static void
|
static void
|
||||||
_item_block_position(Item_Block *itb)
|
_item_block_position(Item_Block *itb)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Elm_Genlist_Item *it;
|
||||||
Evas_Coord y = 0, ox, oy;
|
Evas_Coord y = 0, ox, oy;
|
||||||
|
|
||||||
evas_object_geometry_get(itb->wd->pan_smart, &ox, &oy, NULL, NULL);
|
evas_object_geometry_get(itb->wd->pan_smart, &ox, &oy, NULL, NULL);
|
||||||
for (l = itb->items; l; l = l->next)
|
EINA_LIST_FOREACH(itb->items, l, it)
|
||||||
{
|
{
|
||||||
Elm_Genlist_Item *it = l->data;
|
|
||||||
|
|
||||||
if (it->delete_me) continue;
|
if (it->delete_me) continue;
|
||||||
it->x = 0;
|
it->x = 0;
|
||||||
it->y = y;
|
it->y = y;
|
||||||
|
|
|
@ -96,22 +96,20 @@ static void
|
||||||
_reval_content(Evas_Object *obj)
|
_reval_content(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
for (l = wd->subs; l; l = l->next)
|
const Subinfo *si;
|
||||||
{
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
Subinfo *si = l->data;
|
|
||||||
edje_object_part_swallow(wd->cov, si->swallow, si->obj);
|
edje_object_part_swallow(wd->cov, si->swallow, si->obj);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
for (l = wd->subs; l; l = l->next)
|
const Subinfo *si;
|
||||||
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
{
|
{
|
||||||
Subinfo *si = l->data;
|
|
||||||
if (si->obj == obj)
|
if (si->obj == obj)
|
||||||
{
|
{
|
||||||
edje_object_part_swallow(wd->cov, si->swallow, si->obj);
|
edje_object_part_swallow(wd->cov, si->swallow, si->obj);
|
||||||
|
@ -126,10 +124,9 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Evas_Object *sub = event_info;
|
Evas_Object *sub = event_info;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
Subinfo *si;
|
||||||
for (l = wd->subs; l; l = l->next)
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
{
|
{
|
||||||
Subinfo *si = l->data;
|
|
||||||
if (si->obj == sub)
|
if (si->obj == sub)
|
||||||
{
|
{
|
||||||
evas_object_event_callback_del
|
evas_object_event_callback_del
|
||||||
|
@ -146,15 +143,15 @@ static void
|
||||||
_hov_show_do(Evas_Object *obj)
|
_hov_show_do(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const Subinfo *si;
|
||||||
if (wd->cov)
|
if (wd->cov)
|
||||||
{
|
{
|
||||||
evas_object_show(wd->cov);
|
evas_object_show(wd->cov);
|
||||||
edje_object_signal_emit(wd->cov, "elm,action,show", "elm");
|
edje_object_signal_emit(wd->cov, "elm,action,show", "elm");
|
||||||
}
|
}
|
||||||
for (l = wd->subs; l; l = l->next)
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
{
|
{
|
||||||
Subinfo *si = l->data;
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
if (!strncmp(si->swallow, "elm.swallow.slot.", 17))
|
if (!strncmp(si->swallow, "elm.swallow.slot.", 17))
|
||||||
{
|
{
|
||||||
|
@ -187,15 +184,15 @@ static void
|
||||||
_hov_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_hov_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const Subinfo *si;
|
||||||
if (wd->cov)
|
if (wd->cov)
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(wd->cov, "elm,action,hide", "elm");
|
edje_object_signal_emit(wd->cov, "elm,action,hide", "elm");
|
||||||
evas_object_hide(wd->cov);
|
evas_object_hide(wd->cov);
|
||||||
}
|
}
|
||||||
for (l = wd->subs; l; l = l->next)
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
{
|
{
|
||||||
Subinfo *si = l->data;
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
if (!strncmp(si->swallow, "elm.swallow.slot.", 17))
|
if (!strncmp(si->swallow, "elm.swallow.slot.", 17))
|
||||||
{
|
{
|
||||||
|
@ -349,13 +346,12 @@ elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conten
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Subinfo *si;
|
Subinfo *si;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", swallow);
|
snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", swallow);
|
||||||
for (l = wd->subs; l; l = l->next)
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
{
|
{
|
||||||
si = l->data;
|
|
||||||
if (!strcmp(buf, si->swallow))
|
if (!strcmp(buf, si->swallow))
|
||||||
{
|
{
|
||||||
if (content == si->obj) return;
|
if (content == si->obj) return;
|
||||||
|
|
|
@ -59,10 +59,10 @@ static void
|
||||||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
for (l = wd->subs; l; l = l->next)
|
const Subinfo *si;
|
||||||
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
{
|
{
|
||||||
Subinfo *si = l->data;
|
|
||||||
if (si->obj == obj)
|
if (si->obj == obj)
|
||||||
{
|
{
|
||||||
edje_object_part_swallow(wd->lay, si->swallow, obj);
|
edje_object_part_swallow(wd->lay, si->swallow, obj);
|
||||||
|
@ -78,10 +78,9 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Evas_Object *sub = event_info;
|
Evas_Object *sub = event_info;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
Subinfo *si;
|
||||||
for (l = wd->subs; l; l = l->next)
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
{
|
{
|
||||||
Subinfo *si = l->data;
|
|
||||||
if (si->obj == sub)
|
if (si->obj == sub)
|
||||||
{
|
{
|
||||||
evas_object_event_callback_del
|
evas_object_event_callback_del
|
||||||
|
@ -130,11 +129,10 @@ elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conte
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Subinfo *si;
|
Subinfo *si;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
|
||||||
for (l = wd->subs; l; l = l->next)
|
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||||
{
|
{
|
||||||
si = l->data;
|
|
||||||
if (!strcmp(swallow, si->swallow))
|
if (!strcmp(swallow, si->swallow))
|
||||||
{
|
{
|
||||||
if (content == si->obj) return;
|
if (content == si->obj) return;
|
||||||
|
|
|
@ -92,12 +92,11 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Evas_Object *sub = event_info;
|
Evas_Object *sub = event_info;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Elm_List_Item *it;
|
||||||
|
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it = l->data;
|
|
||||||
|
|
||||||
if ((sub == it->icon) || (sub == it->end))
|
if ((sub == it->icon) || (sub == it->end))
|
||||||
{
|
{
|
||||||
if (it->icon == sub) it->icon = NULL;
|
if (it->icon == sub) it->icon = NULL;
|
||||||
|
@ -164,7 +163,6 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
||||||
Elm_List_Item *it = data;
|
Elm_List_Item *it = data;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->obj);
|
Widget_Data *wd = elm_widget_data_get(it->obj);
|
||||||
Evas_Event_Mouse_Up *ev = event_info;
|
Evas_Event_Mouse_Up *ev = event_info;
|
||||||
Eina_List *l;
|
|
||||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = 1;
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = 1;
|
||||||
else wd->on_hold = 0;
|
else wd->on_hold = 0;
|
||||||
if (wd->on_hold)
|
if (wd->on_hold)
|
||||||
|
@ -179,13 +177,19 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = wd->selected; l;)
|
if (!it->selected)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it2 = l->data;
|
while (wd->selected)
|
||||||
l = l->next;
|
_item_unselect(wd->selected->data);
|
||||||
if ((it2 != it) && (it2->selected)) _item_unselect(it2);
|
_item_select(it);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const Eina_List *l, *l_next;
|
||||||
|
Elm_List_Item *it2;
|
||||||
|
EINA_LIST_FOREACH_SAFE(wd->selected, l, l_next, it2)
|
||||||
|
if (it2 != it) _item_unselect(it2);
|
||||||
}
|
}
|
||||||
if (!it->selected) _item_select(it);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,15 +232,15 @@ static void
|
||||||
_fix_items(Evas_Object *obj)
|
_fix_items(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Elm_List_Item *it;
|
||||||
Evas_Coord minw[2] = { 0, 0 }, minh[2] = { 0, 0 };
|
Evas_Coord minw[2] = { 0, 0 }, minh[2] = { 0, 0 };
|
||||||
Evas_Coord mw, mh;
|
Evas_Coord mw, mh;
|
||||||
int i, redo = 0;
|
int i, redo = 0;
|
||||||
|
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
Evas_Coord mw, mh;
|
Evas_Coord mw, mh;
|
||||||
Elm_List_Item *it = l->data;
|
|
||||||
if (it->icon)
|
if (it->icon)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_get(it->icon, &mw, &mh);
|
evas_object_size_hint_min_get(it->icon, &mw, &mh);
|
||||||
|
@ -259,9 +263,9 @@ _fix_items(Evas_Object *obj)
|
||||||
wd->minh[1] = minh[1];
|
wd->minh[1] = minh[1];
|
||||||
redo = 1;
|
redo = 1;
|
||||||
}
|
}
|
||||||
for (i = 0, l = wd->items; l; l = l->next, i++)
|
i = 0;
|
||||||
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it = l->data;
|
|
||||||
it->even = i & 0x1;
|
it->even = i & 0x1;
|
||||||
if ((it->even != it->is_even) || (!it->fixed) || (redo))
|
if ((it->even != it->is_even) || (!it->fixed) || (redo))
|
||||||
{
|
{
|
||||||
|
@ -327,6 +331,7 @@ _fix_items(Evas_Object *obj)
|
||||||
it->fixed = 1;
|
it->fixed = 1;
|
||||||
it->is_even = it->even;
|
it->is_even = it->even;
|
||||||
}
|
}
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
mw = 0; mh = 0;
|
mw = 0; mh = 0;
|
||||||
evas_object_size_hint_min_get(wd->box, &mw, &mh);
|
evas_object_size_hint_min_get(wd->box, &mw, &mh);
|
||||||
|
|
|
@ -534,7 +534,8 @@ elm_quicklaunch_exe_path_get(const char *exe)
|
||||||
{
|
{
|
||||||
static char *path = NULL;
|
static char *path = NULL;
|
||||||
static Eina_List *pathlist = NULL;
|
static Eina_List *pathlist = NULL;
|
||||||
Eina_List *l;
|
const char *pathitr;
|
||||||
|
const Eina_List *l;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
if (exe[0] == '/') return strdup(exe);
|
if (exe[0] == '/') return strdup(exe);
|
||||||
if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
|
if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
|
||||||
|
@ -568,9 +569,9 @@ elm_quicklaunch_exe_path_get(const char *exe)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (l = pathlist; l; l = l->next)
|
EINA_LIST_FOREACH(pathlist, l, pathitr)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", (char *)l->data, exe);
|
snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
|
||||||
if (access(buf, R_OK | X_OK) == 0) return strdup(buf);
|
if (access(buf, R_OK | X_OK) == 0) return strdup(buf);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -116,20 +116,28 @@ _state_set(Evas_Object *obj, Evas_Bool state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_state_set_all(Widget_Data *wd)
|
||||||
|
{
|
||||||
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(wd->group->radios, l, child)
|
||||||
|
{
|
||||||
|
Widget_Data *wd2 = elm_widget_data_get(child);
|
||||||
|
if (wd2->value == wd->group->value) _state_set(child, 1);
|
||||||
|
else _state_set(child, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_signal_radio_on(void *data, Evas_Object *obj, const char *emission, const char *source)
|
_signal_radio_on(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
Eina_List *l;
|
|
||||||
if (wd->group->value == wd->value) return;
|
if (wd->group->value == wd->value) return;
|
||||||
wd->group->value = wd->value;
|
wd->group->value = wd->value;
|
||||||
if (wd->group->valuep) *(wd->group->valuep) = wd->group->value;
|
if (wd->group->valuep) *(wd->group->valuep) = wd->group->value;
|
||||||
for (l = wd->group->radios; l; l = l->next)
|
_state_set_all(wd);
|
||||||
{
|
|
||||||
Widget_Data *wd2 = elm_widget_data_get(l->data);
|
|
||||||
if (wd2->value == wd->group->value) _state_set(l->data, 1);
|
|
||||||
else _state_set(l->data, 0);
|
|
||||||
}
|
|
||||||
evas_object_smart_callback_call(data, "changed", NULL);
|
evas_object_smart_callback_call(data, "changed", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,16 +241,12 @@ EAPI void
|
||||||
elm_radio_value_set(Evas_Object *obj, int value)
|
elm_radio_value_set(Evas_Object *obj, int value)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
if (value == wd->group->value) return;
|
if (value == wd->group->value) return;
|
||||||
wd->group->value = value;
|
wd->group->value = value;
|
||||||
if (wd->group->valuep) *(wd->group->valuep) = wd->group->value;
|
if (wd->group->valuep) *(wd->group->valuep) = wd->group->value;
|
||||||
for (l = wd->group->radios; l; l = l->next)
|
_state_set_all(wd);
|
||||||
{
|
|
||||||
Widget_Data *wd2 = elm_widget_data_get(l->data);
|
|
||||||
if (wd2->value == wd->group->value) _state_set(l->data, 1);
|
|
||||||
else _state_set(l->data, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
|
@ -262,15 +266,11 @@ elm_radio_value_pointer_set(Evas_Object *obj, int *valuep)
|
||||||
wd->group->valuep = valuep;
|
wd->group->valuep = valuep;
|
||||||
if (*(wd->group->valuep) != wd->group->value)
|
if (*(wd->group->valuep) != wd->group->value)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
|
||||||
wd->group->value = *(wd->group->valuep);
|
wd->group->value = *(wd->group->valuep);
|
||||||
for (l = wd->group->radios; l; l = l->next)
|
_state_set_all(wd);
|
||||||
{
|
|
||||||
Widget_Data *wd2 = elm_widget_data_get(l->data);
|
|
||||||
if (wd2->value == wd->group->value) _state_set(l->data, 1);
|
|
||||||
else _state_set(l->data, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -49,7 +49,8 @@ _elm_theme_theme_element_try(const char *home, const char *f, const char *group)
|
||||||
static const char *
|
static const char *
|
||||||
_elm_theme_group_file_find(const char *group)
|
_elm_theme_group_file_find(const char *group)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const char *f;
|
||||||
char *p;
|
char *p;
|
||||||
static const char *home = NULL;
|
static const char *home = NULL;
|
||||||
const char *file = eina_hash_find(cache, group);
|
const char *file = eina_hash_find(cache, group);
|
||||||
|
@ -59,19 +60,19 @@ _elm_theme_group_file_find(const char *group)
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
if (!home) home = "";
|
if (!home) home = "";
|
||||||
}
|
}
|
||||||
for (l = overlay; l; l = l->next)
|
EINA_LIST_FOREACH(overlay, l, f)
|
||||||
{
|
{
|
||||||
file = _elm_theme_theme_element_try(home, l->data, group);
|
file = _elm_theme_theme_element_try(home, f, group);
|
||||||
if (file) return file;
|
if (file) return file;
|
||||||
}
|
}
|
||||||
for (l = themes; l; l = l->next)
|
EINA_LIST_FOREACH(themes, l, f)
|
||||||
{
|
{
|
||||||
file = _elm_theme_theme_element_try(home, l->data, group);
|
file = _elm_theme_theme_element_try(home, f, group);
|
||||||
if (file) return file;
|
if (file) return file;
|
||||||
}
|
}
|
||||||
for (l = extension; l; l = l->next)
|
EINA_LIST_FOREACH(extension, l, f)
|
||||||
{
|
{
|
||||||
file = _elm_theme_theme_element_try(home, l->data, group);
|
file = _elm_theme_theme_element_try(home, f, group);
|
||||||
if (file) return file;
|
if (file) return file;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -43,11 +43,10 @@ _item_select(Elm_Toolbar_Item *it)
|
||||||
Elm_Toolbar_Item *it2;
|
Elm_Toolbar_Item *it2;
|
||||||
Widget_Data *wd = elm_widget_data_get(it->obj);
|
Widget_Data *wd = elm_widget_data_get(it->obj);
|
||||||
Evas_Object *obj2;
|
Evas_Object *obj2;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
if (it->selected) return;
|
if (it->selected) return;
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it2)
|
||||||
{
|
{
|
||||||
it2 = l->data;
|
|
||||||
if (it2->selected)
|
if (it2->selected)
|
||||||
{
|
{
|
||||||
it2->selected = 0;
|
it2->selected = 0;
|
||||||
|
@ -83,12 +82,11 @@ static void
|
||||||
_theme_hook(Evas_Object *obj)
|
_theme_hook(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(obj);
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
Elm_Toolbar_Item *it;
|
Elm_Toolbar_Item *it;
|
||||||
Evas_Coord mw, mh;
|
Evas_Coord mw, mh;
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
it = l->data;
|
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||||
_elm_theme_set(it->base, "toolbar", "item", "default");
|
_elm_theme_set(it->base, "toolbar", "item", "default");
|
||||||
|
@ -141,7 +139,7 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Widget_Data *wd = elm_widget_data_get(data);
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
Evas_Coord mw, mh, vw, vh, w, h;
|
Evas_Coord mw, mh, vw, vh, w, h;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
Elm_Toolbar_Item *it;
|
Elm_Toolbar_Item *it;
|
||||||
|
|
||||||
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
||||||
|
@ -151,9 +149,8 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
if (w != vw) evas_object_resize(wd->bx, vw, h);
|
if (w != vw) evas_object_resize(wd->bx, vw, h);
|
||||||
}
|
}
|
||||||
for (l = wd->items; l; l = l->next)
|
EINA_LIST_FOREACH(wd->items, l, it)
|
||||||
{
|
{
|
||||||
it = l->data;
|
|
||||||
if (it->selected)
|
if (it->selected)
|
||||||
{
|
{
|
||||||
_item_show(it);
|
_item_show(it);
|
||||||
|
|
|
@ -137,10 +137,12 @@ elm_widget_theme_hook_set(Evas_Object *obj, void (*func) (Evas_Object *obj))
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_widget_theme(Evas_Object *obj)
|
elm_widget_theme(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
|
||||||
API_ENTRY return;
|
API_ENTRY return;
|
||||||
for (l = sd->subobjs; l; l = l->next) elm_widget_theme(l->data);
|
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||||
|
elm_widget_theme(child);
|
||||||
if (sd->resize_obj) elm_widget_theme(sd->resize_obj);
|
if (sd->resize_obj) elm_widget_theme(sd->resize_obj);
|
||||||
if (sd->hover_obj) elm_widget_theme(sd->hover_obj);
|
if (sd->hover_obj) elm_widget_theme(sd->hover_obj);
|
||||||
if (sd->theme_func) sd->theme_func(obj);
|
if (sd->theme_func) sd->theme_func(obj);
|
||||||
|
@ -339,7 +341,6 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
||||||
/* its some container */
|
/* its some container */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
int focus_next;
|
int focus_next;
|
||||||
int noloop = 0;
|
int noloop = 0;
|
||||||
|
|
||||||
|
@ -378,24 +379,26 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
||||||
}
|
}
|
||||||
if (!noloop)
|
if (!noloop)
|
||||||
{
|
{
|
||||||
for (l = sd->subobjs; l; l = l->next)
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||||
{
|
{
|
||||||
if (elm_widget_can_focus_get(l->data))
|
if (elm_widget_can_focus_get(child))
|
||||||
{
|
{
|
||||||
if ((focus_next) &&
|
if ((focus_next) &&
|
||||||
(!elm_widget_disabled_get(l->data)))
|
(!elm_widget_disabled_get(child)))
|
||||||
{
|
{
|
||||||
/* the previous focused item was unfocused - so focus
|
/* the previous focused item was unfocused - so focus
|
||||||
* the next one (that can be focused) */
|
* the next one (that can be focused) */
|
||||||
if (elm_widget_focus_jump(l->data, forward)) return 1;
|
if (elm_widget_focus_jump(child, forward)) return 1;
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (elm_widget_focus_get(l->data))
|
if (elm_widget_focus_get(child))
|
||||||
{
|
{
|
||||||
/* jump to the next focused item or focus this item */
|
/* jump to the next focused item or focus this item */
|
||||||
if (elm_widget_focus_jump(l->data, forward)) return 1;
|
if (elm_widget_focus_jump(child, forward)) return 1;
|
||||||
/* it returned 0 - it got to the last item and is past it */
|
/* it returned 0 - it got to the last item and is past it */
|
||||||
focus_next = 1;
|
focus_next = 1;
|
||||||
}
|
}
|
||||||
|
@ -406,24 +409,27 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = eina_list_last(sd->subobjs); l; l = l->prev)
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
|
||||||
|
EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, child)
|
||||||
{
|
{
|
||||||
if (elm_widget_can_focus_get(l->data))
|
if (elm_widget_can_focus_get(child))
|
||||||
{
|
{
|
||||||
if ((focus_next) &&
|
if ((focus_next) &&
|
||||||
(!elm_widget_disabled_get(l->data)))
|
(!elm_widget_disabled_get(child)))
|
||||||
{
|
{
|
||||||
/* the previous focused item was unfocused - so focus
|
/* the previous focused item was unfocused - so focus
|
||||||
* the next one (that can be focused) */
|
* the next one (that can be focused) */
|
||||||
if (elm_widget_focus_jump(l->data, forward)) return 1;
|
if (elm_widget_focus_jump(child, forward)) return 1;
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (elm_widget_focus_get(l->data))
|
if (elm_widget_focus_get(child))
|
||||||
{
|
{
|
||||||
/* jump to the next focused item or focus this item */
|
/* jump to the next focused item or focus this item */
|
||||||
if (elm_widget_focus_jump(l->data, forward)) return 1;
|
if (elm_widget_focus_jump(child, forward)) return 1;
|
||||||
/* it returned 0 - it got to the last item and is past it */
|
/* it returned 0 - it got to the last item and is past it */
|
||||||
focus_next = 1;
|
focus_next = 1;
|
||||||
}
|
}
|
||||||
|
@ -481,8 +487,6 @@ elm_widget_focus_set(Evas_Object *obj, int first)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
|
|
||||||
if (first)
|
if (first)
|
||||||
{
|
{
|
||||||
if ((elm_widget_can_focus_get(sd->resize_obj)) &&
|
if ((elm_widget_can_focus_get(sd->resize_obj)) &&
|
||||||
|
@ -492,12 +496,14 @@ elm_widget_focus_set(Evas_Object *obj, int first)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = sd->subobjs; l; l = l->next)
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||||
{
|
{
|
||||||
if ((elm_widget_can_focus_get(l->data)) &&
|
if ((elm_widget_can_focus_get(child)) &&
|
||||||
(!elm_widget_disabled_get(l->data)))
|
(!elm_widget_disabled_get(child)))
|
||||||
{
|
{
|
||||||
elm_widget_focus_set(l->data, first);
|
elm_widget_focus_set(child, first);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -505,12 +511,14 @@ elm_widget_focus_set(Evas_Object *obj, int first)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = eina_list_last(sd->subobjs); l; l = l->prev)
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, child)
|
||||||
{
|
{
|
||||||
if ((elm_widget_can_focus_get(l->data)) &&
|
if ((elm_widget_can_focus_get(child)) &&
|
||||||
(!elm_widget_disabled_get(l->data)))
|
(!elm_widget_disabled_get(child)))
|
||||||
{
|
{
|
||||||
elm_widget_focus_set(l->data, first);
|
elm_widget_focus_set(child, first);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -536,7 +544,6 @@ elm_widget_parent_get(const Evas_Object *obj)
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_widget_focused_object_clear(Evas_Object *obj)
|
elm_widget_focused_object_clear(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
API_ENTRY return;
|
API_ENTRY return;
|
||||||
if (!sd->focused) return;
|
if (!sd->focused) return;
|
||||||
if (elm_widget_focus_get(sd->resize_obj))
|
if (elm_widget_focus_get(sd->resize_obj))
|
||||||
|
@ -545,11 +552,13 @@ elm_widget_focused_object_clear(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = sd->subobjs; l; l = l->next)
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||||
{
|
{
|
||||||
if (elm_widget_focus_get(l->data))
|
if (elm_widget_focus_get(child))
|
||||||
{
|
{
|
||||||
elm_widget_focused_object_clear(l->data);
|
elm_widget_focused_object_clear(child);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -591,18 +600,19 @@ elm_widget_focus_steal(Evas_Object *obj)
|
||||||
elm_widget_focused_object_clear(parent);
|
elm_widget_focused_object_clear(parent);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
parent = elm_widget_parent_get(parent);
|
parent = elm_widget_parent_get(parent);
|
||||||
sd = evas_object_smart_data_get(parent);
|
sd = evas_object_smart_data_get(parent);
|
||||||
if (elm_widget_focus_get(sd->resize_obj))
|
if (elm_widget_focus_get(sd->resize_obj))
|
||||||
elm_widget_focused_object_clear(sd->resize_obj);
|
elm_widget_focused_object_clear(sd->resize_obj);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = sd->subobjs; l; l = l->next)
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
|
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||||
{
|
{
|
||||||
if (elm_widget_focus_get(l->data))
|
if (elm_widget_focus_get(child))
|
||||||
{
|
{
|
||||||
elm_widget_focused_object_clear(l->data);
|
elm_widget_focused_object_clear(child);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,16 +94,17 @@ static void
|
||||||
_elm_win_resize_job(void *data)
|
_elm_win_resize_job(void *data)
|
||||||
{
|
{
|
||||||
Elm_Win *win = data;
|
Elm_Win *win = data;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *obj;
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
win->deferred_resize_job = NULL;
|
win->deferred_resize_job = NULL;
|
||||||
ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
|
ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
|
||||||
evas_object_resize(win->win_obj, w, h);
|
evas_object_resize(win->win_obj, w, h);
|
||||||
for (l = win->subobjs; l; l = l->next)
|
EINA_LIST_FOREACH(win->subobjs, l, obj)
|
||||||
{
|
{
|
||||||
evas_object_move(l->data, 0, 0);
|
evas_object_move(obj, 0, 0);
|
||||||
evas_object_resize(l->data, w, h);
|
evas_object_resize(obj, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,25 +179,26 @@ _elm_win_xwin_update(Elm_Win *win)
|
||||||
static void
|
static void
|
||||||
_elm_win_eval_subobjs(Evas_Object *obj)
|
_elm_win_eval_subobjs(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const Evas_Object *child;
|
||||||
Elm_Win *win = elm_widget_data_get(obj);
|
Elm_Win *win = elm_widget_data_get(obj);
|
||||||
Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
|
Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||||
int xx = 1, xy = 1;
|
int xx = 1, xy = 1;
|
||||||
double wx, wy;
|
double wx, wy;
|
||||||
|
|
||||||
for (l = win->subobjs; l; l = l->next)
|
EINA_LIST_FOREACH(win->subobjs, l, child)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_weight_get(l->data, &wx, &wy);
|
evas_object_size_hint_weight_get(child, &wx, &wy);
|
||||||
if (wx == 0.0) xx = 0;
|
if (wx == 0.0) xx = 0;
|
||||||
if (wy == 0.0) xy = 0;
|
if (wy == 0.0) xy = 0;
|
||||||
|
|
||||||
evas_object_size_hint_min_get(l->data, &w, &h);
|
evas_object_size_hint_min_get(child, &w, &h);
|
||||||
if (w < 1) w = -1;
|
if (w < 1) w = -1;
|
||||||
if (h < 1) h = -1;
|
if (h < 1) h = -1;
|
||||||
if (w > minw) minw = w;
|
if (w > minw) minw = w;
|
||||||
if (h > minh) minh = h;
|
if (h > minh) minh = h;
|
||||||
|
|
||||||
evas_object_size_hint_max_get(l->data, &w, &h);
|
evas_object_size_hint_max_get(child, &w, &h);
|
||||||
if (w < 1) w = -1;
|
if (w < 1) w = -1;
|
||||||
if (h < 1) h = -1;
|
if (h < 1) h = -1;
|
||||||
if (maxw == -1) maxw = w;
|
if (maxw == -1) maxw = w;
|
||||||
|
@ -241,16 +243,18 @@ _elm_win_shutdown(void)
|
||||||
void
|
void
|
||||||
_elm_win_rescale(void)
|
_elm_win_rescale(void)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *obj;
|
||||||
for (l = _elm_win_list; l; l = l->next) elm_widget_theme(l->data);
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
||||||
|
elm_widget_theme(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
||||||
{
|
{
|
||||||
Elm_Win *win;
|
Elm_Win *win;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
const char *fontpath;
|
||||||
|
|
||||||
win = ELM_NEW(Elm_Win);
|
win = ELM_NEW(Elm_Win);
|
||||||
switch (_elm_config->engine)
|
switch (_elm_config->engine)
|
||||||
|
@ -316,8 +320,8 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
||||||
ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
|
ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
|
||||||
evas_image_cache_set(win->evas, _elm_config->image_cache * 1024);
|
evas_image_cache_set(win->evas, _elm_config->image_cache * 1024);
|
||||||
evas_font_cache_set(win->evas, _elm_config->font_cache * 1024);
|
evas_font_cache_set(win->evas, _elm_config->font_cache * 1024);
|
||||||
for (l = _elm_config->font_dirs; l; l = l->next)
|
EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
|
||||||
evas_font_path_append(win->evas, l->data);
|
evas_font_path_append(win->evas, fontpath);
|
||||||
if (_elm_config->font_hinting == 0)
|
if (_elm_config->font_hinting == 0)
|
||||||
evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
|
evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
|
||||||
else if (_elm_config->font_hinting == 1)
|
else if (_elm_config->font_hinting == 1)
|
||||||
|
|
|
@ -108,44 +108,48 @@ _els_smart_box_pack_end(Evas_Object *obj, Evas_Object *child)
|
||||||
return eina_list_count(sd->items) - 1;
|
return eina_list_count(sd->items) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_els_smart_box_find(const Smart_Data *sd, const Evas_Object *child)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
const Eina_List *l;
|
||||||
|
const Evas_Object *oitr;
|
||||||
|
EINA_LIST_FOREACH(sd->items, l, oitr)
|
||||||
|
{
|
||||||
|
if (oitr == child)
|
||||||
|
return i;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_els_smart_box_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *before)
|
_els_smart_box_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *before)
|
||||||
{
|
{
|
||||||
Smart_Data *sd;
|
Smart_Data *sd;
|
||||||
int i = 0;
|
|
||||||
Eina_List *l;
|
|
||||||
|
|
||||||
if (!child) return 0;
|
if (!child) return 0;
|
||||||
sd = evas_object_smart_data_get(obj);
|
sd = evas_object_smart_data_get(obj);
|
||||||
if (!sd) return 0;
|
if (!sd) return 0;
|
||||||
_smart_adopt(sd, child);
|
_smart_adopt(sd, child);
|
||||||
sd->items = eina_list_prepend_relative(sd->items, child, before);
|
sd->items = eina_list_prepend_relative(sd->items, child, before);
|
||||||
for (i = 0, l = sd->items; l; l = l->next, i++)
|
|
||||||
{
|
|
||||||
if (l->data == child) break;
|
|
||||||
}
|
|
||||||
_smart_reconfigure(sd);
|
_smart_reconfigure(sd);
|
||||||
return i;
|
|
||||||
|
return _els_smart_box_find(sd, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_els_smart_box_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *after)
|
_els_smart_box_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *after)
|
||||||
{
|
{
|
||||||
Smart_Data *sd;
|
Smart_Data *sd;
|
||||||
int i = 0;
|
|
||||||
Eina_List *l;
|
|
||||||
|
|
||||||
if (!child) return 0;
|
if (!child) return 0;
|
||||||
sd = evas_object_smart_data_get(obj);
|
sd = evas_object_smart_data_get(obj);
|
||||||
if (!sd) return 0;
|
if (!sd) return 0;
|
||||||
_smart_adopt(sd, child);
|
_smart_adopt(sd, child);
|
||||||
sd->items = eina_list_append_relative(sd->items, child, after);
|
sd->items = eina_list_append_relative(sd->items, child, after);
|
||||||
for (i = 0, l = sd->items; l; l = l->next, i++)
|
|
||||||
{
|
|
||||||
if (l->data == child) break;
|
|
||||||
}
|
|
||||||
_smart_reconfigure(sd);
|
_smart_reconfigure(sd);
|
||||||
return i;
|
return _els_smart_box_find(sd, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -215,7 +219,8 @@ static void
|
||||||
_smart_reconfigure(Smart_Data *sd)
|
_smart_reconfigure(Smart_Data *sd)
|
||||||
{
|
{
|
||||||
Evas_Coord x, y, w, h, xx, yy;
|
Evas_Coord x, y, w, h, xx, yy;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *obj;
|
||||||
Evas_Coord minw, minh, wdif, hdif, mnw, mnh, mxw, mxh;
|
Evas_Coord minw, minh, wdif, hdif, mnw, mnh, mxw, mxh;
|
||||||
int count, expand, fw, fh, xw, xh;
|
int count, expand, fw, fh, xw, xh;
|
||||||
double ax, ay, wx, wy;
|
double ax, ay, wx, wy;
|
||||||
|
@ -241,9 +246,9 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
y = y + ((h - minh) * (1.0 - ay));
|
y = y + ((h - minh) * (1.0 - ay));
|
||||||
h = minh;
|
h = minh;
|
||||||
}
|
}
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_weight_get(l->data, &wx, &wy);
|
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||||
if (sd->horizontal)
|
if (sd->horizontal)
|
||||||
{
|
{
|
||||||
if (wx > 0.0) expand++;
|
if (wx > 0.0) expand++;
|
||||||
|
@ -271,15 +276,12 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
hdif = h - minh;
|
hdif = h - minh;
|
||||||
xx = x;
|
xx = x;
|
||||||
yy = y;
|
yy = y;
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Evas_Object *obj;
|
evas_object_size_hint_align_get(obj, &ax, &ay);
|
||||||
|
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||||
obj = l->data;
|
evas_object_size_hint_min_get(obj, &mnw, &mnh);
|
||||||
evas_object_size_hint_align_get(l->data, &ax, &ay);
|
evas_object_size_hint_max_get(obj, &mxw, &mxh);
|
||||||
evas_object_size_hint_weight_get(l->data, &wx, &wy);
|
|
||||||
evas_object_size_hint_min_get(l->data, &mnw, &mnh);
|
|
||||||
evas_object_size_hint_max_get(l->data, &mxw, &mxh);
|
|
||||||
fw = fh = 0;
|
fw = fh = 0;
|
||||||
xw = xh = 0;
|
xw = xh = 0;
|
||||||
if (ax == -1.0) {fw = 1; ax = 0.5;}
|
if (ax == -1.0) {fw = 1; ax = 0.5;}
|
||||||
|
@ -386,7 +388,6 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
static void
|
static void
|
||||||
_smart_extents_calculate(Smart_Data *sd)
|
_smart_extents_calculate(Smart_Data *sd)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
Evas_Coord minw, minh, maxw, maxh, mnw, mnh;
|
Evas_Coord minw, minh, maxw, maxh, mnw, mnh;
|
||||||
|
|
||||||
/* FIXME: need to calc max */
|
/* FIXME: need to calc max */
|
||||||
|
@ -396,9 +397,11 @@ _smart_extents_calculate(Smart_Data *sd)
|
||||||
maxh = -1;
|
maxh = -1;
|
||||||
if (sd->homogenous)
|
if (sd->homogenous)
|
||||||
{
|
{
|
||||||
for (l = sd->items; l; l = l->next)
|
const Eina_List *l;
|
||||||
|
const Evas_Object *obj;
|
||||||
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_get(l->data, &mnw, &mnh);
|
evas_object_size_hint_min_get(obj, &mnw, &mnh);
|
||||||
if (minh < mnh) minh = mnh;
|
if (minh < mnh) minh = mnh;
|
||||||
if (minw < mnw) minw = mnw;
|
if (minw < mnw) minw = mnw;
|
||||||
}
|
}
|
||||||
|
@ -409,9 +412,11 @@ _smart_extents_calculate(Smart_Data *sd)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = sd->items; l; l = l->next)
|
const Eina_List *l;
|
||||||
|
const Evas_Object *obj;
|
||||||
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_get(l->data, &mnw, &mnh);
|
evas_object_size_hint_min_get(obj, &mnw, &mnh);
|
||||||
if (sd->horizontal)
|
if (sd->horizontal)
|
||||||
{
|
{
|
||||||
if (minh < mnh) minh = mnh;
|
if (minh < mnh) minh = mnh;
|
||||||
|
@ -494,7 +499,8 @@ static void
|
||||||
_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||||
{
|
{
|
||||||
Smart_Data *sd;
|
Smart_Data *sd;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
Evas_Coord dx, dy;
|
Evas_Coord dx, dy;
|
||||||
|
|
||||||
sd = evas_object_smart_data_get(obj);
|
sd = evas_object_smart_data_get(obj);
|
||||||
|
@ -503,12 +509,12 @@ _smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||||
dy = y - sd->y;
|
dy = y - sd->y;
|
||||||
sd->x = x;
|
sd->x = x;
|
||||||
sd->y = y;
|
sd->y = y;
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, child)
|
||||||
{
|
{
|
||||||
Evas_Coord ox, oy;
|
Evas_Coord ox, oy;
|
||||||
|
|
||||||
evas_object_geometry_get(l->data, &ox, &oy, NULL, NULL);
|
evas_object_geometry_get(child, &ox, &oy, NULL, NULL);
|
||||||
evas_object_move(l->data, ox + dx, oy + dy);
|
evas_object_move(child, ox + dx, oy + dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,8 @@ static void
|
||||||
_smart_reconfigure(Smart_Data *sd)
|
_smart_reconfigure(Smart_Data *sd)
|
||||||
{
|
{
|
||||||
Evas_Coord x, y, w, h, xx, yy;
|
Evas_Coord x, y, w, h, xx, yy;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *obj;
|
||||||
Evas_Coord minw, minh;
|
Evas_Coord minw, minh;
|
||||||
int expandw, expandh;
|
int expandw, expandh;
|
||||||
double ax, ay;
|
double ax, ay;
|
||||||
|
@ -207,16 +208,14 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
y = y + ((h - minh) * (1.0 - ay));
|
y = y + ((h - minh) * (1.0 - ay));
|
||||||
h = minh;
|
h = minh;
|
||||||
}
|
}
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
int xw, xh;
|
int xw, xh;
|
||||||
double wx, wy;
|
double wx, wy;
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
evas_object_size_hint_weight_get(l->data, &wx, &wy);
|
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||||
xw = 0;
|
xw = 0;
|
||||||
xh = 0;
|
xh = 0;
|
||||||
if (wx > 0.0) xw = 1;
|
if (wx > 0.0) xw = 1;
|
||||||
|
@ -238,26 +237,24 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
y = sd->y;
|
y = sd->y;
|
||||||
if (sd->homogenous)
|
if (sd->homogenous)
|
||||||
{
|
{
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
Evas_Coord ww, hh, ow, oh;
|
Evas_Coord ww, hh, ow, oh;
|
||||||
Evas_Coord mxw, mxh;
|
Evas_Coord mxw, mxh;
|
||||||
int xw, xh;
|
int xw, xh;
|
||||||
double wx, wy;
|
double wx, wy;
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
|
|
||||||
xx = x + ((ti->col) * (w / (Evas_Coord)sd->size.cols));
|
xx = x + ((ti->col) * (w / (Evas_Coord)sd->size.cols));
|
||||||
yy = y + ((ti->row) * (h / (Evas_Coord)sd->size.rows));
|
yy = y + ((ti->row) * (h / (Evas_Coord)sd->size.rows));
|
||||||
ww = ((w / (Evas_Coord)sd->size.cols) * (ti->colspan));
|
ww = ((w / (Evas_Coord)sd->size.cols) * (ti->colspan));
|
||||||
hh = ((h / (Evas_Coord)sd->size.rows) * (ti->rowspan));
|
hh = ((h / (Evas_Coord)sd->size.rows) * (ti->rowspan));
|
||||||
evas_object_size_hint_min_get(l->data, &ow, &oh);
|
evas_object_size_hint_min_get(obj, &ow, &oh);
|
||||||
evas_object_size_hint_max_get(l->data, &mxw, &mxh);
|
evas_object_size_hint_max_get(obj, &mxw, &mxh);
|
||||||
evas_object_size_hint_weight_get(l->data, &wx, &wy);
|
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||||
evas_object_size_hint_align_get(l->data, &ax, &ay);
|
evas_object_size_hint_align_get(obj, &ax, &ay);
|
||||||
xw = 0;
|
xw = 0;
|
||||||
xh = 0;
|
xh = 0;
|
||||||
if (wx > 0.0) xw = 1;
|
if (wx > 0.0) xw = 1;
|
||||||
|
@ -275,12 +272,10 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i, ex, tot, need, num, dif, left, nx;
|
int i, ex, tot, need, num, dif, left, nx;
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
if (sd->size.cols < (ti->col + ti->colspan))
|
if (sd->size.cols < (ti->col + ti->colspan))
|
||||||
sd->size.cols = ti->col + ti->colspan;
|
sd->size.cols = ti->col + ti->colspan;
|
||||||
|
@ -296,16 +291,14 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
colsx = calloc(sd->size.cols, sizeof(int));
|
colsx = calloc(sd->size.cols, sizeof(int));
|
||||||
rowsx = calloc(sd->size.rows, sizeof(int));
|
rowsx = calloc(sd->size.rows, sizeof(int));
|
||||||
|
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
int xw, xh;
|
int xw, xh;
|
||||||
double wx, wy;
|
double wx, wy;
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
evas_object_size_hint_weight_get(l->data, &wx, &wy);
|
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||||
xw = 0;
|
xw = 0;
|
||||||
xh = 0;
|
xh = 0;
|
||||||
if (wx > 0.0) xw = 1;
|
if (wx > 0.0) xw = 1;
|
||||||
|
@ -316,21 +309,19 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
rowsx[i] |= xh;
|
rowsx[i] |= xh;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
Evas_Coord mnw, mnh, mxw, mxh;
|
Evas_Coord mnw, mnh, mxw, mxh;
|
||||||
int xw, xh;
|
int xw, xh;
|
||||||
double wx, wy;
|
double wx, wy;
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
|
|
||||||
evas_object_size_hint_min_get(l->data, &mnw, &mnh);
|
evas_object_size_hint_min_get(obj, &mnw, &mnh);
|
||||||
evas_object_size_hint_max_get(l->data, &mxw, &mxh);
|
evas_object_size_hint_max_get(obj, &mxw, &mxh);
|
||||||
evas_object_size_hint_weight_get(l->data, &wx, &wy);
|
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||||
evas_object_size_hint_align_get(l->data, &ax, &ay);
|
evas_object_size_hint_align_get(obj, &ax, &ay);
|
||||||
xw = 0;
|
xw = 0;
|
||||||
xh = 0;
|
xh = 0;
|
||||||
if (wx > 0.0) xw = 1;
|
if (wx > 0.0) xw = 1;
|
||||||
|
@ -509,18 +500,16 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
Evas_Coord ww, hh, ow, oh, i;
|
Evas_Coord ww, hh, ow, oh, i;
|
||||||
Evas_Coord mxw, mxh;
|
Evas_Coord mxw, mxh;
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
evas_object_size_hint_min_get(l->data, &ow, &oh);
|
evas_object_size_hint_min_get(obj, &ow, &oh);
|
||||||
evas_object_size_hint_max_get(l->data, &mxw, &mxh);
|
evas_object_size_hint_max_get(obj, &mxw, &mxh);
|
||||||
evas_object_size_hint_align_get(l->data, &ax, &ay);
|
evas_object_size_hint_align_get(obj, &ax, &ay);
|
||||||
|
|
||||||
xx = x;
|
xx = x;
|
||||||
for (i = 0; i < ti->col; i++) xx += cols[i];
|
for (i = 0; i < ti->col; i++) xx += cols[i];
|
||||||
|
@ -551,7 +540,6 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
static void
|
static void
|
||||||
_smart_extents_calcuate(Smart_Data *sd)
|
_smart_extents_calcuate(Smart_Data *sd)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
Evas_Coord minw, minh, maxw, maxh;
|
Evas_Coord minw, minh, maxw, maxh;
|
||||||
|
|
||||||
minw = 0;
|
minw = 0;
|
||||||
|
@ -562,20 +550,20 @@ _smart_extents_calcuate(Smart_Data *sd)
|
||||||
sd->size.rows = 0;
|
sd->size.rows = 0;
|
||||||
if (sd->homogenous)
|
if (sd->homogenous)
|
||||||
{
|
{
|
||||||
for (l = sd->items; l; l = l->next)
|
const Eina_List *l;
|
||||||
|
const Evas_Object *obj;
|
||||||
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
int mw, mh;
|
int mw, mh;
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
if (sd->size.cols < (ti->col + ti->colspan))
|
if (sd->size.cols < (ti->col + ti->colspan))
|
||||||
sd->size.cols = ti->col + ti->colspan;
|
sd->size.cols = ti->col + ti->colspan;
|
||||||
if (sd->size.rows < (ti->row + ti->rowspan))
|
if (sd->size.rows < (ti->row + ti->rowspan))
|
||||||
sd->size.rows = ti->row + ti->rowspan;
|
sd->size.rows = ti->row + ti->rowspan;
|
||||||
evas_object_size_hint_min_get(l->data, &w, &h);
|
evas_object_size_hint_min_get(obj, &w, &h);
|
||||||
mw = (w + (ti->colspan - 1)) / ti->colspan;
|
mw = (w + (ti->colspan - 1)) / ti->colspan;
|
||||||
mh = (h + (ti->rowspan - 1)) / ti->rowspan;
|
mh = (h + (ti->rowspan - 1)) / ti->rowspan;
|
||||||
if (minw < mw) minw = mw;
|
if (minw < mw) minw = mw;
|
||||||
|
@ -586,13 +574,13 @@ _smart_extents_calcuate(Smart_Data *sd)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
const Eina_List *l;
|
||||||
|
const Evas_Object *obj;
|
||||||
int i, ex, tot, need, num, dif, left, nx;
|
int i, ex, tot, need, num, dif, left, nx;
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
if (sd->size.cols < (ti->col + ti->colspan))
|
if (sd->size.cols < (ti->col + ti->colspan))
|
||||||
sd->size.cols = ti->col + ti->colspan;
|
sd->size.cols = ti->col + ti->colspan;
|
||||||
|
@ -608,16 +596,14 @@ _smart_extents_calcuate(Smart_Data *sd)
|
||||||
colsx = calloc(sd->size.cols, sizeof(int));
|
colsx = calloc(sd->size.cols, sizeof(int));
|
||||||
rowsx = calloc(sd->size.rows, sizeof(int));
|
rowsx = calloc(sd->size.rows, sizeof(int));
|
||||||
|
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
int xw, xh;
|
int xw, xh;
|
||||||
double wx, wy;
|
double wx, wy;
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
evas_object_size_hint_weight_get(l->data, &wx, &wy);
|
evas_object_size_hint_weight_get(obj, &wx, &wy);
|
||||||
xw = 0;
|
xw = 0;
|
||||||
xh = 0;
|
xh = 0;
|
||||||
if (wx > 0.0) xw = 1;
|
if (wx > 0.0) xw = 1;
|
||||||
|
@ -628,15 +614,13 @@ _smart_extents_calcuate(Smart_Data *sd)
|
||||||
rowsx[i] |= xh;
|
rowsx[i] |= xh;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, obj)
|
||||||
{
|
{
|
||||||
Table_Item *ti;
|
Table_Item *ti;
|
||||||
Evas_Object *obj;
|
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
|
|
||||||
obj = l->data;
|
|
||||||
ti = evas_object_data_get(obj, "e_table_data");
|
ti = evas_object_data_get(obj, "e_table_data");
|
||||||
evas_object_size_hint_min_get(l->data, &w, &h);
|
evas_object_size_hint_min_get(obj, &w, &h);
|
||||||
|
|
||||||
/* handle horizontal */
|
/* handle horizontal */
|
||||||
ex = 0;
|
ex = 0;
|
||||||
|
@ -830,19 +814,20 @@ static void
|
||||||
_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||||
{
|
{
|
||||||
Smart_Data *sd;
|
Smart_Data *sd;
|
||||||
Eina_List *l;
|
const Eina_List *l;
|
||||||
|
Evas_Object *child;
|
||||||
Evas_Coord dx, dy;
|
Evas_Coord dx, dy;
|
||||||
|
|
||||||
sd = evas_object_smart_data_get(obj);
|
sd = evas_object_smart_data_get(obj);
|
||||||
if (!sd) return;
|
if (!sd) return;
|
||||||
dx = x - sd->x;
|
dx = x - sd->x;
|
||||||
dy = y - sd->y;
|
dy = y - sd->y;
|
||||||
for (l = sd->items; l; l = l->next)
|
EINA_LIST_FOREACH(sd->items, l, child)
|
||||||
{
|
{
|
||||||
Evas_Coord ox, oy;
|
Evas_Coord ox, oy;
|
||||||
|
|
||||||
evas_object_geometry_get(l->data, &ox, &oy, NULL, NULL);
|
evas_object_geometry_get(child, &ox, &oy, NULL, NULL);
|
||||||
evas_object_move(l->data, ox + dx, oy + dy);
|
evas_object_move(child, ox + dx, oy + dy);
|
||||||
}
|
}
|
||||||
sd->x = x;
|
sd->x = x;
|
||||||
sd->y = y;
|
sd->y = y;
|
||||||
|
|
Loading…
Reference in New Issue