diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk index 47d8bbc1a..881dde08d 100644 --- a/src/bin/Makefile.mk +++ b/src/bin/Makefile.mk @@ -47,7 +47,6 @@ src/bin/e_auth.h \ src/bin/e_backlight.h \ src/bin/e_bg.h \ src/bin/e_bindings.h \ -src/bin/e_box.h \ src/bin/e_client.h \ src/bin/e_client.x \ src/bin/e_color_class.h \ @@ -220,7 +219,6 @@ src/bin/e_auth.c \ src/bin/e_backlight.c \ src/bin/e_bg.c \ src/bin/e_bindings.c \ -src/bin/e_box.c \ src/bin/e_client.c \ src/bin/e_color.c \ src/bin/e_color_class.c \ diff --git a/src/bin/e_box.c b/src/bin/e_box.c deleted file mode 100644 index 1ed6383a5..000000000 --- a/src/bin/e_box.c +++ /dev/null @@ -1,901 +0,0 @@ -#include "e.h" - -typedef struct _E_Smart_Data E_Smart_Data; -typedef struct _E_Box_Item E_Box_Item; - -struct _E_Smart_Data -{ - Evas_Coord x, y, w, h; - Evas_Object *obj; - Evas_Object *clip; - int frozen; - unsigned char changed : 1; - unsigned char horizontal : 1; - unsigned char homogenous : 1; - E_Box_Item *items; - unsigned int item_count; - struct - { - Evas_Coord w, h; - } min, max; - struct - { - double x, y; - } align; -}; - -struct _E_Box_Item -{ - EINA_INLIST; - E_Smart_Data *sd; - unsigned char fill_w : 1; - unsigned char fill_h : 1; - unsigned char expand_w : 1; - unsigned char expand_h : 1; - struct - { - Evas_Coord w, h; - } min, max; - struct - { - double x, y; - } align; - int x, y, w, h; - Evas_Object *obj; -}; - -/* local subsystem functions */ -static void _e_box_unpack_internal(E_Smart_Data *sd, E_Box_Item *bi); -static E_Box_Item *_e_box_smart_adopt(E_Smart_Data *sd, Evas_Object *obj); -static void _e_box_smart_disown(E_Box_Item *bi); -static void _e_box_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _e_box_smart_reconfigure(E_Smart_Data *sd); -static void _e_box_smart_extents_calculate(E_Smart_Data *sd); - -static void _e_box_smart_init(void); -static void _e_box_smart_add(Evas_Object *obj); -static void _e_box_smart_del(Evas_Object *obj); -static void _e_box_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); -static void _e_box_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); -static void _e_box_smart_show(Evas_Object *obj); -static void _e_box_smart_hide(Evas_Object *obj); -static void _e_box_smart_color_set(Evas_Object *obj, int r, int g, int b, int a); -static void _e_box_smart_clip_set(Evas_Object *obj, Evas_Object *clip); -static void _e_box_smart_clip_unset(Evas_Object *obj); - -/* local subsystem globals */ -static Evas_Smart *_e_smart = NULL; - -static inline Evas_Object * -_e_box_item_object_get(E_Box_Item *bi) -{ - if (!bi) return NULL; - return bi->obj; -} - -static inline Evas_Object * -_e_box_item_nth_get(E_Smart_Data *sd, unsigned int n) -{ - unsigned int x; - E_Box_Item *bi; - - if (!sd->items) return NULL; - if (n > sd->item_count / 2) - { - x = sd->item_count - 1; - EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (n == x) return bi->obj; - x--; - } - return NULL; - } - x = 0; - EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (n == x) return bi->obj; - x++; - } - return NULL; -} - -/* externally accessible functions */ -EAPI Evas_Object * -e_box_add(Evas *evas) -{ - _e_box_smart_init(); - return evas_object_smart_add(evas, _e_smart); -} - -EAPI int -e_box_freeze(Evas_Object *obj) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0); - sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - sd->frozen++; - return sd->frozen; -} - -EAPI int -e_box_thaw(Evas_Object *obj) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0); - sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - sd->frozen--; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); - return sd->frozen; -} - -EAPI void -e_box_orientation_set(Evas_Object *obj, int horizontal) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR(); - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if (sd->horizontal == horizontal) return; - sd->horizontal = horizontal; - sd->changed = 1; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); -} - -EAPI int -e_box_orientation_get(Evas_Object *obj) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0); - sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - return sd->horizontal; -} - -EAPI void -e_box_homogenous_set(Evas_Object *obj, int homogenous) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR(); - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if (sd->homogenous == homogenous) return; - sd->homogenous = homogenous; - sd->changed = 1; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); -} - -EAPI int -e_box_pack_start(Evas_Object *obj, Evas_Object *child) -{ - E_Smart_Data *sd; - E_Box_Item *bi; - Eina_Inlist *l; - - if (!child) return 0; - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0); - sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - bi = _e_box_smart_adopt(sd, child); - l = EINA_INLIST_GET(sd->items); - l = eina_inlist_prepend(l, EINA_INLIST_GET(bi)); - sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item); - sd->item_count++; - sd->changed = 1; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); - return 0; -} - -EAPI int -e_box_pack_end(Evas_Object *obj, Evas_Object *child) -{ - E_Smart_Data *sd; - E_Box_Item *bi; - Eina_Inlist *l; - - if (!child) return 0; - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0); - sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - bi = _e_box_smart_adopt(sd, child); - l = EINA_INLIST_GET(sd->items); - l = eina_inlist_append(l, EINA_INLIST_GET(bi)); - sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item); - sd->item_count++; - sd->changed = 1; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); - return sd->item_count - 1; -} - -EAPI int -e_box_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *before) -{ - E_Smart_Data *sd; - E_Box_Item *bi, *bi2; - int i = 0; - Eina_Inlist *l; - - if (!child) return 0; - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0); - sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - bi2 = evas_object_data_get(before, "e_box_data"); - if (!bi2) return 0; - bi = _e_box_smart_adopt(sd, child); - l = EINA_INLIST_GET(sd->items); - l = eina_inlist_prepend_relative(l, EINA_INLIST_GET(bi), EINA_INLIST_GET(bi2)); - sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item); - sd->item_count++; - - for (l = EINA_INLIST_GET(bi)->prev; l; l = l->prev) - i++; - sd->changed = 1; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); - return i; -} - -EAPI int -e_box_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *after) -{ - E_Smart_Data *sd; - E_Box_Item *bi, *bi2; - int i = 0; - Eina_Inlist *l; - - if (!child) return 0; - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0); - sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - bi2 = evas_object_data_get(after, "e_box_data"); - if (!bi2) return 0; - bi = _e_box_smart_adopt(sd, child); - l = EINA_INLIST_GET(sd->items); - l = eina_inlist_append_relative(l, EINA_INLIST_GET(bi), EINA_INLIST_GET(bi2)); - sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item); - sd->item_count++; - for (l = EINA_INLIST_GET(bi)->prev; l; l = l->prev) - i++; - sd->changed = 1; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); - return i; -} - -EAPI int -e_box_pack_count_get(Evas_Object *obj) -{ - E_Smart_Data *sd; - - sd = evas_object_smart_data_get(obj); - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0); - if (!sd) return 0; - return sd->item_count; -} - -EAPI Evas_Object * -e_box_pack_object_nth(Evas_Object *obj, int n) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(NULL); - sd = evas_object_smart_data_get(obj); - if (!sd) return NULL; - return _e_box_item_nth_get(sd, n); -} - -EAPI Evas_Object * -e_box_pack_object_first(Evas_Object *obj) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(NULL); - sd = evas_object_smart_data_get(obj); - if (!sd) return NULL; - return sd->items ? sd->items->obj : NULL; -} - -EAPI Evas_Object * -e_box_pack_object_last(Evas_Object *obj) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(NULL); - sd = evas_object_smart_data_get(obj); - if ((!sd) || (!sd->items)) return NULL; - return EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(sd->items)->last, E_Box_Item)->obj; -} - -EAPI void -e_box_pack_options_set(Evas_Object *obj, int fill_w, int fill_h, int expand_w, int expand_h, double align_x, double align_y, Evas_Coord min_w, Evas_Coord min_h, Evas_Coord max_w, Evas_Coord max_h) -{ - E_Box_Item *bi; - - bi = evas_object_data_get(obj, "e_box_data"); - if (!bi) return; - bi->fill_w = fill_w; - bi->fill_h = fill_h; - bi->expand_w = expand_w; - bi->expand_h = expand_h; - bi->align.x = align_x; - bi->align.y = align_y; - bi->min.w = min_w; - bi->min.h = min_h; - bi->max.w = max_w; - bi->max.h = max_h; - bi->sd->changed = 1; - if (bi->sd->frozen <= 0) _e_box_smart_reconfigure(bi->sd); -} - -EAPI void -e_box_unpack(Evas_Object *obj) -{ - E_Box_Item *bi; - E_Smart_Data *sd; - - if (!obj) return; - bi = evas_object_data_get(obj, "e_box_data"); - if (!bi) return; - sd = bi->sd; - if (!sd) return; - _e_box_unpack_internal(sd, bi); -} - -EAPI void -e_box_size_min_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR(); - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if (sd->changed) _e_box_smart_extents_calculate(sd); - if (minw) *minw = sd->min.w; - if (minh) *minh = sd->min.h; -} - -EAPI void -e_box_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR(); - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if (sd->changed) _e_box_smart_extents_calculate(sd); - if (maxw) *maxw = sd->max.w; - if (maxh) *maxh = sd->max.h; -} - -EAPI void -e_box_align_get(Evas_Object *obj, double *ax, double *ay) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR(); - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if (ax) *ax = sd->align.x; - if (ay) *ay = sd->align.y; -} - -EAPI void -e_box_align_set(Evas_Object *obj, double ax, double ay) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR(); - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if ((sd->align.x == ax) && (sd->align.y == ay)) return; - sd->align.x = ax; - sd->align.y = ay; - sd->changed = 1; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); -} - -/* - * Returns the number of pixels that are hidden on the left/top side. - */ -EAPI void -e_box_align_pixel_offset_get(Evas_Object *obj, int *x, int *y) -{ - E_Smart_Data *sd; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR(); - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if (x) *x = (sd->min.w - sd->w) * (1.0 - sd->align.x); - if (y) *y = (sd->min.h - sd->h) * (1.0 - sd->align.y); -} - -EAPI Evas_Object * -e_box_item_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y) -{ - E_Smart_Data *sd; - E_Box_Item *bi; - - if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR() NULL; - sd = evas_object_smart_data_get(obj); - if (!sd) return NULL; - if (!E_INSIDE(x, y, sd->x, sd->y, sd->w, sd->h)) return NULL; - if (sd->horizontal) - { - if (x < sd->w / 2) - { - EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj; - } - return NULL; - } - EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj; - } - return NULL; - } - if (y < sd->h / 2) - { - EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj; - } - return NULL; - } - EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj; - } - return NULL; -} - -EAPI Eina_Bool -e_box_item_size_get(Evas_Object *obj, int *w, int *h) -{ - E_Box_Item *bi; - - bi = evas_object_data_get(obj, "e_box_data"); - EINA_SAFETY_ON_NULL_RETURN_VAL(bi, EINA_FALSE); - if (w) *w = bi->w; - if (h) *h = bi->h; - return EINA_TRUE; -} - -/* local subsystem functions */ -static void -_e_box_unpack_internal(E_Smart_Data *sd, E_Box_Item *bi) -{ - Eina_Inlist *l; - - l = EINA_INLIST_GET(sd->items); - l = eina_inlist_remove(l, EINA_INLIST_GET(bi)); - sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item); - sd->item_count--; - _e_box_smart_disown(bi); - sd->changed = 1; - if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); -} - -static E_Box_Item * -_e_box_smart_adopt(E_Smart_Data *sd, Evas_Object *obj) -{ - E_Box_Item *bi; - - bi = calloc(1, sizeof(E_Box_Item)); - if (!bi) return NULL; - bi->sd = sd; - bi->obj = obj; - /* defaults */ - bi->fill_w = 0; - bi->fill_h = 0; - bi->expand_w = 0; - bi->expand_h = 0; - bi->align.x = 0.5; - bi->align.y = 0.5; - bi->min.w = 0; - bi->min.h = 0; - bi->max.w = 0; - bi->max.h = 0; - evas_object_clip_set(obj, sd->clip); - evas_object_smart_member_add(obj, bi->sd->obj); - evas_object_data_set(obj, "e_box_data", bi); - evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE, - _e_box_smart_item_del_hook, NULL); - if ((!evas_object_visible_get(sd->clip)) && - (evas_object_visible_get(sd->obj))) - evas_object_show(sd->clip); - return bi; -} - -static void -_e_box_smart_disown(E_Box_Item *bi) -{ - if (!bi) return; - if (!bi->sd->items) - { - if (evas_object_visible_get(bi->sd->clip)) - evas_object_hide(bi->sd->clip); - } - evas_object_event_callback_del(bi->obj, - EVAS_CALLBACK_FREE, - _e_box_smart_item_del_hook); - evas_object_smart_member_del(bi->obj); - evas_object_clip_unset(bi->obj); - evas_object_data_del(bi->obj, "e_box_data"); - free(bi); -} - -static void -_e_box_smart_item_del_hook(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) -{ - e_box_unpack(obj); -} - -static void -_e_box_smart_reconfigure(E_Smart_Data *sd) -{ - Evas_Coord x, y, w, h, xx, yy; - E_Box_Item *bi; - int minw, minh, wdif, hdif; - int count, expand; - - if (!sd->changed) return; - - x = sd->x; - y = sd->y; - w = sd->w; - h = sd->h; - - _e_box_smart_extents_calculate(sd); - minw = sd->min.w; - minh = sd->min.h; - count = sd->item_count; - expand = 0; - if (w < minw) - { - x = x + ((w - minw) * (1.0 - sd->align.x)); - w = minw; - } - if (h < minh) - { - y = y + ((h - minh) * (1.0 - sd->align.y)); - h = minh; - } - EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (sd->horizontal) - { - if (bi->expand_w) expand++; - } - else - { - if (bi->expand_h) expand++; - } - } - if (expand == 0) - { - if (sd->horizontal) - { - x += (double)(w - minw) * sd->align.x; - w = minw; - } - else - { - y += (double)(h - minh) * sd->align.y; - h = minh; - } - } - wdif = w - minw; - hdif = h - minh; - xx = x; - yy = y; - EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (sd->horizontal) - { - if (sd->homogenous) - { - Evas_Coord ww, hh, ow, oh; - - ww = (w / (Evas_Coord)count); - hh = h; - ow = bi->min.w; - if (bi->fill_w) ow = ww; - if ((bi->max.w >= 0) && (bi->max.w < ow)) - ow = bi->max.w; - oh = bi->min.h; - if (bi->fill_h) oh = hh; - if ((bi->max.h >= 0) && (bi->max.h < oh)) - oh = bi->max.h; - bi->x = xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x); - bi->y = yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y); - evas_object_move(bi->obj, bi->x, bi->y); - evas_object_resize(bi->obj, bi->w = ow, bi->h = oh); - xx += ww; - } - else - { - Evas_Coord ww, hh, ow, oh; - - ww = bi->min.w; - if ((expand > 0) && (bi->expand_w)) - { - if (expand == 1) ow = wdif; - else ow = (w - minw) / expand; - wdif -= ow; - ww += ow; - } - hh = h; - ow = bi->min.w; - if (bi->fill_w) ow = ww; - if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; - oh = bi->min.h; - if (bi->fill_h) oh = hh; - if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; - bi->x = xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x); - bi->y = yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y); - evas_object_move(bi->obj, bi->x, bi->y); - evas_object_resize(bi->obj, bi->w = ow, bi->h = oh); - xx += ww; - } - } - else - { - if (sd->homogenous) - { - Evas_Coord ww, hh, ow, oh; - - ww = w; - hh = (h / (Evas_Coord)count); - ow = bi->min.w; - if (bi->fill_w) ow = ww; - if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; - oh = bi->min.h; - if (bi->fill_h) oh = hh; - if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; - bi->x = xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x); - bi->y = yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y); - evas_object_move(bi->obj, bi->x, bi->y); - evas_object_resize(bi->obj, bi->w = ow, bi->h = oh); - yy += hh; - } - else - { - Evas_Coord ww, hh, ow, oh; - - ww = w; - hh = bi->min.h; - if ((expand > 0) && (bi->expand_h)) - { - if (expand == 1) oh = hdif; - else oh = (h - minh) / expand; - hdif -= oh; - hh += oh; - } - ow = bi->min.w; - if (bi->fill_w) ow = ww; - if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; - oh = bi->min.h; - if (bi->fill_h) oh = hh; - if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; - bi->x = xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x); - bi->y = yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y); - evas_object_move(bi->obj, bi->x, bi->y); - evas_object_resize(bi->obj, bi->w = ow, bi->h = oh); - yy += hh; - } - } - } - sd->changed = 0; -} - -static void -_e_box_smart_extents_calculate(E_Smart_Data *sd) -{ - E_Box_Item *bi; - int minw, minh; - - /* FIXME: need to calc max */ - sd->max.w = -1; /* max < 0 == unlimited */ - sd->max.h = -1; - - minw = 0; - minh = 0; - if (sd->homogenous) - { - EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (minh < bi->min.h) minh = bi->min.h; - if (minw < bi->min.w) minw = bi->min.w; - } - if (sd->horizontal) - minw *= sd->item_count; - else - minh *= sd->item_count; - } - else - { - EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - if (sd->horizontal) - { - if (minh < bi->min.h) minh = bi->min.h; - minw += bi->min.w; - } - else - { - if (minw < bi->min.w) minw = bi->min.w; - minh += bi->min.h; - } - } - } - sd->min.w = minw; - sd->min.h = minh; -} - -static void -_e_box_smart_init(void) -{ - if (_e_smart) return; - { - static const Evas_Smart_Class sc = - { - "e_box", - EVAS_SMART_CLASS_VERSION, - _e_box_smart_add, - _e_box_smart_del, - _e_box_smart_move, - _e_box_smart_resize, - _e_box_smart_show, - _e_box_smart_hide, - _e_box_smart_color_set, - _e_box_smart_clip_set, - _e_box_smart_clip_unset, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL - }; - _e_smart = evas_smart_class_new(&sc); - } -} - -static void -_e_box_smart_add(Evas_Object *obj) -{ - E_Smart_Data *sd; - - sd = calloc(1, sizeof(E_Smart_Data)); - if (!sd) return; - sd->obj = obj; - sd->x = 0; - sd->y = 0; - sd->w = 0; - sd->h = 0; - sd->align.x = 0.5; - sd->align.y = 0.5; - sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj)); - evas_object_smart_member_add(sd->clip, obj); - evas_object_move(sd->clip, -100004, -100004); - evas_object_resize(sd->clip, 200008, 200008); - evas_object_color_set(sd->clip, 255, 255, 255, 255); - evas_object_smart_data_set(obj, sd); -} - -static void -_e_box_smart_del(Evas_Object *obj) -{ - E_Smart_Data *sd; - - sd = evas_object_smart_data_get(obj); - if (!sd) return; - /* FIXME: this gets into an infinite loop when changin basic->advanced on - * ibar config dialog - */ - e_box_freeze(obj); - while (sd->items) - e_box_unpack(sd->items->obj); - e_box_thaw(obj); - evas_object_del(sd->clip); - free(sd); - - evas_object_smart_data_set(obj, NULL); -} - -static void -_e_box_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) -{ - E_Smart_Data *sd; - E_Box_Item *bi; - - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if ((x == sd->x) && (y == sd->y)) return; - { - Evas_Coord dx, dy; - - dx = x - sd->x; - dy = y - sd->y; - EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) - { - bi->x += dx; - bi->y += dy; - evas_object_move(bi->obj, bi->x, bi->y); - } - } - sd->x = x; - sd->y = y; -} - -static void -_e_box_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) -{ - E_Smart_Data *sd; - - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if ((w == sd->w) && (h == sd->h)) return; - sd->w = w; - sd->h = h; - sd->changed = 1; - _e_box_smart_reconfigure(sd); -} - -static void -_e_box_smart_show(Evas_Object *obj) -{ - E_Smart_Data *sd; - - sd = evas_object_smart_data_get(obj); - if (!sd) return; - if (sd->items) evas_object_show(sd->clip); -} - -static void -_e_box_smart_hide(Evas_Object *obj) -{ - E_Smart_Data *sd; - - sd = evas_object_smart_data_get(obj); - if (!sd) return; - evas_object_hide(sd->clip); -} - -static void -_e_box_smart_color_set(Evas_Object *obj, int r, int g, int b, int a) -{ - E_Smart_Data *sd; - - sd = evas_object_smart_data_get(obj); - if (!sd) return; - evas_object_color_set(sd->clip, r, g, b, a); -} - -static void -_e_box_smart_clip_set(Evas_Object *obj, Evas_Object *clip) -{ - E_Smart_Data *sd; - - sd = evas_object_smart_data_get(obj); - if (!sd) return; - evas_object_clip_set(sd->clip, clip); -} - -static void -_e_box_smart_clip_unset(Evas_Object *obj) -{ - E_Smart_Data *sd; - - sd = evas_object_smart_data_get(obj); - if (!sd) return; - evas_object_clip_unset(sd->clip); -} - diff --git a/src/bin/e_box.h b/src/bin/e_box.h deleted file mode 100644 index 75a0e74ad..000000000 --- a/src/bin/e_box.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifdef E_TYPEDEFS -#else -#ifndef E_BOX_H -#define E_BOX_H - -EAPI Evas_Object *e_box_add (Evas *evas); -EAPI int e_box_freeze (Evas_Object *obj); -EAPI int e_box_thaw (Evas_Object *obj); -EAPI void e_box_orientation_set (Evas_Object *obj, int horizontal); -EAPI int e_box_orientation_get (Evas_Object *obj); -EAPI void e_box_homogenous_set (Evas_Object *obj, int homogenous); -EAPI int e_box_pack_start (Evas_Object *obj, Evas_Object *child); -EAPI int e_box_pack_end (Evas_Object *obj, Evas_Object *child); -EAPI int e_box_pack_before (Evas_Object *obj, Evas_Object *child, Evas_Object *before); -EAPI int e_box_pack_after (Evas_Object *obj, Evas_Object *child, Evas_Object *after); -EAPI int e_box_pack_count_get (Evas_Object *obj); -EAPI Evas_Object *e_box_pack_object_nth (Evas_Object *obj, int n); -EAPI Evas_Object *e_box_pack_object_first (Evas_Object *obj); -EAPI Evas_Object *e_box_pack_object_last (Evas_Object *obj); -EAPI void e_box_pack_options_set (Evas_Object *obj, int fill_w, int fill_h, int expand_w, int expand_h, double align_x, double align_y, Evas_Coord min_w, Evas_Coord min_h, Evas_Coord max_w, Evas_Coord max_h); -EAPI void e_box_unpack (Evas_Object *obj); -EAPI void e_box_size_min_get (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh); -EAPI void e_box_size_max_get (Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh); -EAPI void e_box_align_get (Evas_Object *obj, double *ax, double *ay); -EAPI void e_box_align_set (Evas_Object *obj, double ax, double ay); -EAPI void e_box_align_pixel_offset_get (Evas_Object *obj, int *x, int *y); -EAPI Evas_Object *e_box_item_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y); -EAPI Eina_Bool e_box_item_size_get(Evas_Object *obj, int *w, int *h); -#endif -#endif diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c index 8a24a8297..8e10b1ded 100644 --- a/src/bin/e_gadcon.c +++ b/src/bin/e_gadcon.c @@ -688,7 +688,7 @@ e_gadcon_orient(E_Gadcon *gc, E_Gadcon_Orient orient) e_gadcon_layout_orientation_set(gc->o_container, horiz); EINA_LIST_FOREACH(gc->clients, l, gcc) { - e_box_orientation_set(gcc->o_box, horiz); + elm_box_horizontal_set(gcc->o_box, horiz); if (gcc->client_class->func.orient) gcc->client_class->func.orient(gcc, gc->orient); } @@ -995,6 +995,12 @@ _e_gadcon_client_box_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS gcc->o_box = NULL; } +static void +_e_gadcon_client_box_hints_changed(void *data EINA_UNUSED, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +{ + evas_object_size_hint_min_set(obj, 0, 0); +} + static void _e_gadcon_client_frame_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { @@ -1061,8 +1067,9 @@ e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id __UNUSED__, c if (gcc->o_frame) { edje_object_size_min_calc(gcc->o_frame, &(gcc->pad.w), &(gcc->pad.h)); - gcc->o_box = e_box_add(gcc->gadcon->evas); + gcc->o_box = elm_box_add(gcc->gadcon->o_container); evas_object_event_callback_add(gcc->o_box, EVAS_CALLBACK_DEL, _e_gadcon_client_box_del, gcc); + evas_object_event_callback_add(gcc->o_box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _e_gadcon_client_box_hints_changed, gcc); switch (gcc->gadcon->orient) { case E_GADCON_ORIENT_FLOAT: @@ -1073,7 +1080,7 @@ e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id __UNUSED__, c case E_GADCON_ORIENT_CORNER_TR: case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BR: - e_box_orientation_set(gcc->o_box, 1); + elm_box_horizontal_set(gcc->o_box, 1); break; case E_GADCON_ORIENT_VERT: @@ -1083,7 +1090,7 @@ e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id __UNUSED__, c case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_LB: case E_GADCON_ORIENT_CORNER_RB: - e_box_orientation_set(gcc->o_box, 0); + elm_box_horizontal_set(gcc->o_box, 0); break; default: @@ -1097,14 +1104,8 @@ e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id __UNUSED__, c _e_gadcon_cb_client_frame_mouse_move, gcc); if (gcc->o_base) { - e_box_pack_end(gcc->o_box, gcc->o_base); - e_box_pack_options_set(gcc->o_base, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - 0, 0, /* min */ - -1, -1 /* max */ - ); + E_EXPAND(gcc->o_base); + elm_box_pack_end(gcc->o_box, gcc->o_base); } edje_object_part_swallow(gcc->o_frame, gc->edje.swallow_name, gcc->o_box); evas_object_show(gcc->o_box); @@ -1159,7 +1160,7 @@ e_gadcon_client_edit_begin(E_Gadcon_Client *gcc) if ((gcc->autoscroll) /* || (gcc->resizable)*/) { - if (e_box_orientation_get(gcc->o_box)) + if (elm_box_horizontal_get(gcc->o_box)) edje_object_signal_emit(gcc->o_control, "e,state,hsize,on", "e"); else edje_object_signal_emit(gcc->o_control, "e,state,vsize,on", "e"); @@ -1909,7 +1910,7 @@ e_gadcon_client_autoscroll_update(E_Gadcon_Client *gcc, Evas_Coord x, Evas_Coord /* TODO: When using gadman there is no o_box! */ evas_object_geometry_get(gcc->o_box, NULL, NULL, &w, &h); - if (e_box_orientation_get(gcc->o_box)) + if (elm_box_horizontal_get(gcc->o_box)) { if (w > 1) d = (double)x / (double)(w - 1); else d = 0; @@ -2124,7 +2125,7 @@ _e_gadcon_moveresize_handle(E_Gadcon_Client *gcc) /* if (gcc->resizable) { - if (e_box_orientation_get(gcc->o_box)) + if (elm_box_horizontal_get(gcc->o_box)) { if ((gcc->aspect.w > 0) && (gcc->aspect.h > 0)) w = (h * gcc->aspect.w) / gcc->aspect.h; @@ -2138,7 +2139,7 @@ _e_gadcon_moveresize_handle(E_Gadcon_Client *gcc) */ if (gcc->autoscroll) { - if (e_box_orientation_get(gcc->o_box)) + if (elm_box_horizontal_get(gcc->o_box)) { if ((gcc->aspect.w > 0) && (gcc->aspect.h > 0)) { @@ -2163,13 +2164,8 @@ _e_gadcon_moveresize_handle(E_Gadcon_Client *gcc) } } } - e_box_pack_options_set(gcc->o_base, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - mw, mh /* max */ - ); + evas_object_size_hint_min_set(gcc->o_base, w, h); + evas_object_size_hint_max_set(gcc->o_base, mw, mh); } static void @@ -2208,10 +2204,10 @@ _e_gadcon_cb_client_scroll_animator(void *data) E_Gadcon_Client *gcc; gcc = data; - if (e_box_orientation_get(gcc->o_box)) - e_box_align_set(gcc->o_box, 1.0 - gcc->scroll_pos, 0.5); + if (elm_box_horizontal_get(gcc->o_box)) + elm_box_align_set(gcc->o_box, 1.0 - gcc->scroll_pos, 0.5); else - e_box_align_set(gcc->o_box, 0.5, 1.0 - gcc->scroll_pos); + elm_box_align_set(gcc->o_box, 0.5, 1.0 - gcc->scroll_pos); if (!gcc->scroll_timer) { gcc->scroll_animator = NULL; diff --git a/src/bin/e_ilist.c b/src/bin/e_ilist.c index acf7f6f08..898d4358e 100644 --- a/src/bin/e_ilist.c +++ b/src/bin/e_ilist.c @@ -75,10 +75,8 @@ e_ilist_append(Evas_Object *obj, Evas_Object *icon, Evas_Object *end, const char sd->items = eina_list_append(sd->items, si); edje_object_size_min_calc(si->o_base, &mw, &mh); - e_box_freeze(sd->o_box); - e_box_pack_end(sd->o_box, si->o_base); - e_box_pack_options_set(si->o_base, 1, 1, 1, 1, 0.5, 0.5, - mw, mh, 99999, 99999); + evas_object_size_hint_min_set(si->o_base, mw, mh); + elm_box_pack_end(sd->o_box, si->o_base); stacking = edje_object_data_get(si->o_base, "stacking"); if (stacking) { @@ -86,7 +84,6 @@ e_ilist_append(Evas_Object *obj, Evas_Object *icon, Evas_Object *end, const char else if (!strcmp(stacking, "above")) evas_object_raise(si->o_base); } - e_box_thaw(sd->o_box); evas_object_lower(sd->o_box); @@ -110,13 +107,11 @@ e_ilist_append_relative(Evas_Object *obj, Evas_Object *icon, Evas_Object *end, c sd->items = eina_list_append(sd->items, si); edje_object_size_min_calc(si->o_base, &mw, &mh); - e_box_freeze(sd->o_box); + evas_object_size_hint_min_set(si->o_base, mw, mh); if (ri) - e_box_pack_after(sd->o_box, si->o_base, ri->o_base); + elm_box_pack_after(sd->o_box, si->o_base, ri->o_base); else - e_box_pack_end(sd->o_box, si->o_base); - e_box_pack_options_set(si->o_base, 1, 1, 1, 1, 0.5, 0.5, - mw, mh, 99999, 99999); + elm_box_pack_end(sd->o_box, si->o_base); stacking = edje_object_data_get(si->o_base, "stacking"); if (stacking) { @@ -124,7 +119,6 @@ e_ilist_append_relative(Evas_Object *obj, Evas_Object *icon, Evas_Object *end, c else if (!strcmp(stacking, "above")) evas_object_raise(si->o_base); } - e_box_thaw(sd->o_box); evas_object_lower(sd->o_box); evas_object_show(si->o_base); @@ -141,11 +135,8 @@ e_ilist_prepend(Evas_Object *obj, Evas_Object *icon, Evas_Object *end, const cha sd->items = eina_list_prepend(sd->items, si); edje_object_size_min_calc(si->o_base, &mw, &mh); - e_box_freeze(sd->o_box); - e_box_pack_start(sd->o_box, si->o_base); - e_box_pack_options_set(si->o_base, 1, 1, 1, 1, 0.5, 0.5, - mw, mh, 99999, 99999); - e_box_thaw(sd->o_box); + evas_object_size_hint_min_set(si->o_base, mw, mh); + elm_box_pack_start(sd->o_box, si->o_base); evas_object_lower(sd->o_box); evas_object_show(si->o_base); @@ -167,14 +158,11 @@ e_ilist_prepend_relative(Evas_Object *obj, Evas_Object *icon, Evas_Object *end, sd->items = eina_list_prepend(sd->items, si); edje_object_size_min_calc(si->o_base, &mw, &mh); - e_box_freeze(sd->o_box); + evas_object_size_hint_min_set(si->o_base, mw, mh); if (ri) - e_box_pack_before(sd->o_box, si->o_base, ri->o_base); + elm_box_pack_before(sd->o_box, si->o_base, ri->o_base); else - e_box_pack_end(sd->o_box, si->o_base); - e_box_pack_options_set(si->o_base, 1, 1, 1, 1, 0.5, 0.5, - mw, mh, 99999, 99999); - e_box_thaw(sd->o_box); + elm_box_pack_end(sd->o_box, si->o_base); evas_object_lower(sd->o_box); evas_object_show(si->o_base); @@ -206,14 +194,12 @@ EAPI void e_ilist_freeze(Evas_Object *obj) { API_ENTRY return; - e_box_freeze(sd->o_box); } EAPI void e_ilist_thaw(Evas_Object *obj) { API_ENTRY return; - e_box_thaw(sd->o_box); } EAPI int @@ -255,7 +241,8 @@ EAPI void e_ilist_size_min_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { API_ENTRY return; - e_box_size_min_get(sd->o_box, w, h); + elm_box_recalculate(sd->o_box); + evas_object_size_hint_min_get(sd->o_box, w, h); } EAPI void @@ -452,7 +439,10 @@ e_ilist_remove_num(Evas_Object *obj, int n) evas_object_geometry_get(sd->o_box, NULL, NULL, &w, &h); if ((sd->w == w) && (sd->h == h)) - resize = e_box_item_size_get(si->o_base, &w, &h); + { + resize = EINA_TRUE; + evas_object_geometry_get(si->o_base, NULL, NULL, &w, &h); + } if (sd->selected == n) sd->selected = -1; if (si->o_icon) evas_object_del(si->o_icon); @@ -538,6 +528,8 @@ e_ilist_nth_icon_set(Evas_Object *obj, int n, Evas_Object *icon) evas_object_del(si->o_icon); } si->o_icon = icon; + E_WEIGHT(si->o_icon, 1, 0); + E_FILL(si->o_icon); if (si->o_icon) { evas_object_size_hint_min_set(si->o_icon, sd->iw, sd->ih); @@ -638,8 +630,7 @@ e_ilist_icon_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) } edje_object_size_min_calc(si->o_base, &mw, &mh); - e_box_pack_options_set(si->o_icon, 1, 1, 1, 0, 0.5, 0.5, - mw, mh, 99999, 99999); + evas_object_size_hint_min_set(si->o_icon, mw, mh); } } @@ -785,9 +776,9 @@ _e_smart_add(Evas_Object *obj) sd->typebuf.size = 0; sd->typebuf.timer = NULL; - sd->o_box = e_box_add(e); - e_box_align_set(sd->o_box, 0.0, 0.0); - e_box_homogenous_set(sd->o_box, 0); + sd->o_box = elm_box_add(obj); + elm_box_align_set(sd->o_box, 0.0, 0.0); + elm_box_homogeneous_set(sd->o_box, 0); evas_object_smart_member_add(sd->o_box, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _e_smart_event_key_down, sd); @@ -1350,6 +1341,8 @@ _e_ilist_item_new(E_Smart_Data *sd, Evas_Object *icon, Evas_Object *end, const c si = E_NEW(E_Ilist_Item, 1); si->sd = sd; si->o_base = edje_object_add(evas_object_evas_get(sd->o_smart)); + E_EXPAND(si->o_base); + E_FILL(si->o_base); isodd = eina_list_count(sd->items) & 0x1; _e_ilist_item_theme_set(si, !!sd->theme, header, !isodd); diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h index 46ab53913..593b6012a 100644 --- a/src/bin/e_includes.h +++ b/src/bin/e_includes.h @@ -20,7 +20,6 @@ #include "e_config_data.h" #include "e_menu.h" #include "e_icon.h" -#include "e_box.h" #include "e_flowlayout.h" #include "e_entry.h" #include "e_init.h" diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c index 4c9e1fbcf..0d4526cc0 100644 --- a/src/bin/e_menu.c +++ b/src/bin/e_menu.c @@ -757,13 +757,9 @@ e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub) edje_object_size_min_calc(mi->submenu_object, &ww, &hh); mi->submenu_w = ww; mi->submenu_h = hh; - e_box_pack_options_set(mi->submenu_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + E_WEIGHT(mi->submenu_object, 0, 1); + E_FILL(mi->submenu_object); + evas_object_size_hint_min_set(mi->submenu_object, ww, hh); goto out; } evas_object_del(mi->submenu_object); @@ -776,27 +772,19 @@ e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub) "e/widgets/menu/default/submenu"); evas_object_pass_events_set(o, 1); evas_object_show(o); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); edje_object_size_min_calc(mi->submenu_object, &ww, &hh); mi->submenu_w = ww; mi->submenu_h = hh; - e_box_pack_options_set(mi->submenu_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + E_WEIGHT(mi->submenu_object, 0, 1); + E_FILL(mi->submenu_object); + evas_object_size_hint_min_set(mi->submenu_object, ww, hh); edje_object_part_swallow(mi->bg_object, "e.swallow.content", mi->container_object); edje_object_size_min_calc(mi->bg_object, &ww, &hh); - e_box_pack_options_set(mi->bg_object, - 1, 1, /* fill */ - 1, 0, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + E_WEIGHT(mi->bg_object, 1, 0); + E_FILL(mi->bg_object); + evas_object_size_hint_min_set(mi->bg_object, ww, hh); } else { @@ -805,7 +793,7 @@ e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub) mi->submenu_object = o; evas_object_color_set(o, 0, 0, 0, 0); evas_object_pass_events_set(o, 1); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); } _e_menu_lock = EINA_FALSE; if (sub) e_object_unref(E_OBJECT(sub)); @@ -1379,9 +1367,10 @@ _e_menu_item_realize(E_Menu_Item *mi) "e/widgets/menu/default/separator"); evas_object_show(o); edje_object_size_min_calc(mi->separator_object, &ww, &hh); + E_FILL(mi->separator_object); mi->separator_w = ww; mi->separator_h = hh; - e_box_pack_end(mi->menu->container_object, mi->separator_object); + elm_box_pack_end(mi->menu->container_object, mi->separator_object); } else { @@ -1407,14 +1396,13 @@ no_submenu_item: } evas_object_show(o); - o = e_box_add(mi->menu->evas); + o = elm_box_add(o); evas_object_name_set(o, "mi->container_object"); - e_box_homogenous_set(o, 0); + elm_box_homogeneous_set(o, 0); mi->container_object = o; - e_box_orientation_set(o, 1); + elm_box_horizontal_set(o, 1); evas_object_show(o); - e_box_freeze(mi->container_object); if (mi->check) { @@ -1424,17 +1412,13 @@ no_submenu_item: e_theme_edje_object_set(o, "base/theme/menus", "e/widgets/menu/default/check"); evas_object_show(o); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); edje_object_size_min_calc(mi->toggle_object, &ww, &hh); mi->toggle_w = ww; mi->toggle_h = hh; - e_box_pack_options_set(mi->toggle_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + E_WEIGHT(mi->toggle_object, 0, 1); + E_FILL(mi->toggle_object); + evas_object_size_hint_min_set(mi->toggle_object, ww, hh); } else if (mi->radio) { @@ -1444,17 +1428,13 @@ no_submenu_item: e_theme_edje_object_set(o, "base/theme/menus", "e/widgets/menu/default/radio"); evas_object_show(o); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); edje_object_size_min_calc(mi->toggle_object, &ww, &hh); mi->toggle_w = ww; mi->toggle_h = hh; - e_box_pack_options_set(mi->toggle_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + E_WEIGHT(mi->toggle_object, 0, 1); + E_FILL(mi->toggle_object); + evas_object_size_hint_min_set(mi->toggle_object, ww, hh); } else { @@ -1462,7 +1442,7 @@ no_submenu_item: evas_object_name_set(o, "mi->toggle_object"); mi->toggle_object = o; evas_object_color_set(o, 0, 0, 0, 0); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); } if ((!e_config->menu_icons_hide) && ((mi->icon) || (mi->realize_cb.func))) { @@ -1545,14 +1525,10 @@ no_submenu_item: edje_object_size_min_calc(mi->icon_bg_object, &ww, &hh); mi->icon_w = ww; mi->icon_h = hh; - e_box_pack_end(mi->container_object, mi->icon_bg_object); - e_box_pack_options_set(mi->icon_bg_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + elm_box_pack_end(mi->container_object, mi->icon_bg_object); + E_WEIGHT(mi->icon_bg_object, 0, 1); + E_FILL(mi->icon_bg_object); + evas_object_size_hint_min_set(mi->icon_bg_object, ww, hh); } else { @@ -1561,14 +1537,10 @@ no_submenu_item: e_icon_size_get(mi->icon_object, &icon_w, &icon_h); mi->icon_w = icon_w; mi->icon_h = icon_h; - e_box_pack_end(mi->container_object, o); - e_box_pack_options_set(mi->icon_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + elm_box_pack_end(mi->container_object, o); + E_WEIGHT(mi->icon_object, 0, 1); + E_FILL(mi->icon_bg_object); + evas_object_size_hint_min_set(mi->icon_object, ww, hh); } } else @@ -1577,7 +1549,7 @@ no_submenu_item: evas_object_name_set(o, "mi->icon_object"); mi->icon_object = o; evas_object_color_set(o, 0, 0, 0, 0); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); } if (mi->label) @@ -1590,17 +1562,13 @@ no_submenu_item: /* default label */ edje_object_part_text_set(o, "e.text.label", mi->label); evas_object_show(o); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); edje_object_size_min_calc(mi->label_object, &ww, &hh); mi->label_w = ww; mi->label_h = hh; - e_box_pack_options_set(mi->label_object, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + E_EXPAND(mi->label_object); + E_FILL(mi->label_object); + evas_object_size_hint_min_set(mi->label_object, ww, hh); } else { @@ -1608,7 +1576,7 @@ no_submenu_item: evas_object_name_set(o, "mi->label_object"); mi->label_object = o; evas_object_color_set(o, 0, 0, 0, 0); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); } if ((mi->submenu) || (mi->submenu_pre_cb.func)) { @@ -1618,17 +1586,13 @@ no_submenu_item: e_theme_edje_object_set(o, "base/theme/menus", "e/widgets/menu/default/submenu"); evas_object_show(o); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); edje_object_size_min_calc(mi->submenu_object, &ww, &hh); mi->submenu_w = ww; mi->submenu_h = hh; - e_box_pack_options_set(mi->submenu_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - ww, hh, /* min */ - -1, -1 /* max */ - ); + E_WEIGHT(mi->submenu_object, 0, 1); + E_FILL(mi->submenu_object); + evas_object_size_hint_min_set(mi->submenu_object, ww, hh); } else { @@ -1636,14 +1600,13 @@ no_submenu_item: evas_object_name_set(o, "mi->submenu_object"); mi->submenu_object = o; evas_object_color_set(o, 0, 0, 0, 0); - e_box_pack_end(mi->container_object, o); + elm_box_pack_end(mi->container_object, o); } edje_object_part_swallow(mi->bg_object, "e.swallow.content", mi->container_object); - e_box_pack_end(mi->menu->container_object, mi->bg_object); - e_box_thaw(mi->container_object); + elm_box_pack_end(mi->menu->container_object, mi->bg_object); } if (mi->active) e_menu_item_active_set(mi, 1); if (mi->toggle) e_menu_item_toggle_set(mi, 1); @@ -1685,20 +1648,18 @@ _e_menu_realize(E_Menu *m) evas_object_move(m->comp_object, m->cur.x, m->cur.y); evas_object_resize(m->comp_object, m->cur.w, m->cur.h); - o = e_box_add(m->evas); + o = elm_box_add(m->comp_object); evas_object_name_set(o, "menu->container_object"); m->container_object = o; evas_object_intercept_move_callback_add(o, _e_menu_cb_intercept_container_move, m); evas_object_intercept_resize_callback_add(o, _e_menu_cb_intercept_container_resize, m); - e_box_freeze(o); - e_box_homogenous_set(o, 0); + elm_box_homogeneous_set(o, 0); edje_object_part_swallow(m->bg_object, "e.swallow.content", m->container_object); EINA_LIST_FOREACH(m->items, l, mi) _e_menu_item_realize(mi); _e_menu_items_layout_update(m); - e_box_thaw(m->container_object); evas_event_thaw(m->evas); m->realized = 1; @@ -1722,7 +1683,6 @@ _e_menu_items_layout_update(E_Menu *m) int zh = 0, ms = 0, maxh = 0; unsigned int cur_items = 0, max_items = -1; - e_box_freeze(m->container_object); EINA_LIST_FOREACH(m->items, l, mi) { if (mi->icon) icons_on = 1; @@ -1804,113 +1764,52 @@ _e_menu_items_layout_update(E_Menu *m) cur_items++; if (mi->separator) { - e_box_pack_options_set(mi->separator_object, - 1, 1, /* fill */ - 1, 0, /* expand */ - 0.5, 0.5, /* align */ - mi->separator_w, mi->separator_h, /* min */ - -1, mi->separator_h /* max */ - ); + E_WEIGHT(mi->separator_object, 1, 0); + E_FILL(mi->separator_object); + evas_object_size_hint_min_set(mi->separator_object, mi->separator_w, mi->separator_h); + evas_object_size_hint_max_set(mi->separator_object, -1, mi->separator_h); ms += mi->separator_h; continue; } - e_box_freeze(mi->container_object); - if (toggles_on) - e_box_pack_options_set(mi->toggle_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - min_toggle_w, min_toggle_h, /* min */ - -1, -1 /* max */ - ); - else - e_box_pack_options_set(mi->toggle_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - 0, 0, /* min */ - 0, 0 /* max */ - ); + E_WEIGHT(mi->toggle_object, 0, toggles_on); + E_FILL(mi->toggle_object); + evas_object_size_hint_min_set(mi->toggle_object, min_toggle_w * toggles_on, min_toggle_h * toggles_on); if (icons_on) { - if (mi->icon_bg_object) - e_box_pack_options_set(mi->icon_bg_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - min_icon_w, min_icon_h, /* min */ - -1, -1 /* max */ - ); - else - e_box_pack_options_set(mi->icon_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - min_icon_w, min_icon_h, /* min */ - -1, -1 /* max */ - ); + E_WEIGHT(mi->icon_bg_object ?: mi->icon_object, 0, 1); + E_FILL(mi->icon_bg_object ?: mi->icon_object); + evas_object_size_hint_min_set(mi->icon_bg_object ?: mi->icon_object, min_icon_w, min_icon_h); } else - e_box_pack_options_set(mi->icon_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - 0, 0, /* min */ - 0, 0 /* max */ - ); - if (labels_on) - e_box_pack_options_set(mi->label_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - min_label_w, min_label_h, /* min */ - -1, -1 /* max */ - ); - else - e_box_pack_options_set(mi->label_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - 0, 0, /* min */ - 0, 0 /* max */ - ); - if (submenus_on) - e_box_pack_options_set(mi->submenu_object, - 1, 1, /* fill */ - 0, 1, /* expand */ - 0.5, 0.5, /* align */ - min_submenu_w, min_submenu_h, /* min */ - -1, -1 /* max */ - ); - else - e_box_pack_options_set(mi->submenu_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - 0, 0, /* min */ - 0, 0 /* max */ - ); + { + E_WEIGHT(mi->icon_object, 0, 1); + E_FILL(mi->icon_object); + evas_object_size_hint_min_set(mi->icon_object, 0, 0); + } + + E_WEIGHT(mi->label_object, 0, 1 * labels_on); + E_FILL(mi->label_object); + evas_object_size_hint_min_set(mi->label_object, min_label_w * labels_on, min_label_h * labels_on); + + E_WEIGHT(mi->submenu_object, 0, 1 * submenus_on); + E_FILL(mi->submenu_object); + evas_object_size_hint_min_set(mi->submenu_object, min_submenu_w * submenus_on, min_submenu_h * submenus_on); + evas_object_size_hint_min_set(mi->container_object, min_w, min_h); edje_object_part_swallow(mi->bg_object, "e.swallow.content", mi->container_object); edje_object_size_min_calc(mi->bg_object, &mw, &mh); - e_box_pack_options_set(mi->bg_object, - 1, 1, /* fill */ - 1, 0, /* expand */ - 0.5, 0.5, /* align */ - mw, mh, /* min */ - -1, -1 /* max */ - ); + E_WEIGHT(mi->bg_object, 0, 1); + E_FILL(mi->bg_object); + evas_object_size_hint_min_set(mi->bg_object, mw, mh); ms += mh; - e_box_thaw(mi->container_object); } - e_box_size_min_get(m->container_object, &bw, &bh); - evas_object_size_hint_min_set(m->container_object, bw, bh); + elm_box_recalculate(m->container_object); + evas_object_size_hint_min_get(m->container_object, &bw, &bh); evas_object_size_hint_max_set(m->container_object, bw, bh); edje_object_part_swallow(m->bg_object, "e.swallow.content", m->container_object); edje_object_size_min_calc(m->bg_object, &mw, &mh); - e_box_thaw(m->container_object); m->cur.w = mw; m->cur.h = mh; } @@ -1918,7 +1817,6 @@ _e_menu_items_layout_update(E_Menu *m) static void _e_menu_item_unrealize(E_Menu_Item *mi) { - if (mi->container_object) e_box_freeze(mi->container_object); if (mi->separator_object) evas_object_del(mi->separator_object); mi->separator_object = NULL; if (mi->bg_object) evas_object_del(mi->bg_object); @@ -1967,7 +1865,6 @@ _e_menu_unrealize(E_Menu *m) evas_object_hide(m->comp_object); evas_object_del(m->comp_object); if (stopping && m->comp_object) evas_object_unref(m->comp_object); - e_box_freeze(m->container_object); EINA_LIST_FOREACH(m->items, l, mi) _e_menu_item_unrealize(mi); E_FREE_FUNC(m->header.icon, evas_object_del); diff --git a/src/bin/e_test.c b/src/bin/e_test.c index e2b73b488..4f0714886 100644 --- a/src/bin/e_test.c +++ b/src/bin/e_test.c @@ -697,8 +697,8 @@ _e_test_internal(E_Comp *c) of = e_scrollframe_add(dia->win->evas); - ob = e_box_add(dia->win->evas); - e_box_orientation_set(ob, 0); + ob = elm_box_add(dia->win->evas); + elm_box_horizontal_set(ob, 0); for (i = 0; i < 8; i++) { @@ -729,13 +729,13 @@ _e_test_internal(E_Comp *c) "/home/raster/pix/OLD/Download/orange_chair_heaven_falling.jpg", NULL, NULL); - e_box_pack_end(ob, o); - e_box_pack_options_set(o, 1, 1, 1, 0, 0.5, 0.5, 300, 100, 300, 100); + elm_box_pack_end(ob, o); + elm_box_pack_options_set(o, 1, 1, 1, 0, 0.5, 0.5, 300, 100, 300, 100); evas_object_show(o); } /* fixme... more */ - e_box_size_min_get(ob, &mw, &mh); + evas_object_size_hint_min_get(ob, &mw, &mh); evas_object_resize(ob, mw, mh); e_scrollframe_child_set(of, ob); diff --git a/src/bin/e_widget_framelist.c b/src/bin/e_widget_framelist.c index 8bbf21219..29fd11c4c 100644 --- a/src/bin/e_widget_framelist.c +++ b/src/bin/e_widget_framelist.c @@ -35,10 +35,10 @@ e_widget_framelist_add(Evas *evas, const char *label, int horiz) e_widget_sub_object_add(obj, o); e_widget_resize_object_set(obj, o); - o = e_box_add(evas); + o = elm_box_add(obj); wd->o_box = o; - e_box_orientation_set(o, horiz); - e_box_homogenous_set(o, 0); + elm_box_horizontal_set(o, horiz); + elm_box_homogeneous_set(o, 0); edje_object_part_swallow(wd->o_frame, "e.swallow.content", o); e_widget_sub_object_add(obj, o); evas_object_show(o); @@ -57,17 +57,15 @@ e_widget_framelist_object_append_full(Evas_Object *obj, Evas_Object *sobj, int f wd = e_widget_data_get(obj); - e_box_pack_end(wd->o_box, sobj); + elm_box_pack_end(wd->o_box, sobj); e_widget_size_min_get(sobj, &mw, &mh); - e_box_pack_options_set(sobj, - fill_w, fill_h, - expand_w, expand_h, - align_x, align_y, - min_w, min_h, - max_w, max_h - ); - e_box_size_min_get(wd->o_box, &mw, &mh); - evas_object_size_hint_min_set(wd->o_box, mw, mh); + if (fill_w) align_x = -1; + if (fill_h) align_y = -1; + E_WEIGHT(sobj, expand_w, expand_h); + E_ALIGN(sobj, align_x, align_y); + evas_object_size_hint_min_set(sobj, min_w, min_h); + evas_object_size_hint_max_set(sobj, max_w, max_h); + elm_box_recalculate(wd->o_box); edje_object_part_swallow(wd->o_frame, "e.swallow.content", wd->o_box); edje_object_size_min_calc(wd->o_frame, &mw, &mh); e_widget_size_min_set(obj, mw, mh); @@ -83,17 +81,12 @@ e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj) wd = e_widget_data_get(obj); - e_box_pack_end(wd->o_box, sobj); + elm_box_pack_end(wd->o_box, sobj); e_widget_size_min_get(sobj, &mw, &mh); - e_box_pack_options_set(sobj, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); - e_box_size_min_get(wd->o_box, &mw, &mh); - evas_object_size_hint_min_set(wd->o_box, mw, mh); + E_EXPAND(sobj); + E_FILL(sobj); + evas_object_size_hint_min_set(sobj, mw, mh); + elm_box_recalculate(wd->o_box); edje_object_part_swallow(wd->o_frame, "e.swallow.content", wd->o_box); edje_object_size_min_calc(wd->o_frame, &mw, &mh); e_widget_size_min_set(obj, mw, mh); @@ -107,7 +100,7 @@ e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double val E_Widget_Data *wd; wd = e_widget_data_get(obj); - e_box_align_set(wd->o_box, halign, valign); + elm_box_align_set(wd->o_box, halign, valign); } EAPI void diff --git a/src/bin/e_widget_list.c b/src/bin/e_widget_list.c index c84fb6dca..84853f99a 100644 --- a/src/bin/e_widget_list.c +++ b/src/bin/e_widget_list.c @@ -31,10 +31,10 @@ e_widget_list_add(Evas *evas, int homogenous, int horiz) wd = calloc(1, sizeof(E_Widget_Data)); e_widget_data_set(obj, wd); - o = e_box_add(evas); + o = elm_box_add(obj); wd->o_box = o; - e_box_orientation_set(o, horiz); - e_box_homogenous_set(o, homogenous); + elm_box_horizontal_set(o, horiz); + elm_box_homogeneous_set(o, homogenous); evas_object_show(o); e_widget_sub_object_add(obj, o); e_widget_resize_object_set(obj, o); @@ -60,26 +60,23 @@ e_widget_list_object_prepend(Evas_Object *obj, Evas_Object *sobj, int fill, int wd = e_widget_data_get(obj); - e_box_pack_start(wd->o_box, sobj); mw = mh = 0; e_widget_size_min_get(sobj, &mw, &mh); - if (e_box_orientation_get(wd->o_box) == 1) - e_box_pack_options_set(sobj, - 1, fill, /* fill */ - expand, expand, /* expand */ - 0.5, align, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + evas_object_size_hint_min_set(sobj, mw, mh); + if (fill) align = -1; + if (elm_box_horizontal_get(wd->o_box) == 1) + { + E_ALIGN(sobj, -1, align); + E_WEIGHT(sobj, expand, 1); + } else - e_box_pack_options_set(sobj, - fill, 1, /* fill */ - expand, expand, /* expand */ - align, 0.5, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); - e_box_size_min_get(wd->o_box, &mw, &mh); + { + E_ALIGN(sobj, align, -1); + E_WEIGHT(sobj, 1, expand); + } + elm_box_pack_start(wd->o_box, sobj); + elm_box_recalculate(wd->o_box); + evas_object_size_hint_min_get(wd->o_box, &mw, &mh); e_widget_size_min_set(obj, mw, mh); e_widget_sub_object_add(obj, sobj); evas_object_show(sobj); @@ -103,26 +100,23 @@ e_widget_list_object_append(Evas_Object *obj, Evas_Object *sobj, int fill, int e wd = e_widget_data_get(obj); - e_box_pack_end(wd->o_box, sobj); mw = mh = 0; e_widget_size_min_get(sobj, &mw, &mh); - if (e_box_orientation_get(wd->o_box) == 1) - e_box_pack_options_set(sobj, - 1, fill, /* fill */ - expand, expand, /* expand */ - 0.5, align, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + evas_object_size_hint_min_set(sobj, mw, mh); + if (fill) align = -1; + if (elm_box_horizontal_get(wd->o_box) == 1) + { + E_ALIGN(sobj, -1, align); + E_WEIGHT(sobj, expand, 1); + } else - e_box_pack_options_set(sobj, - fill, 1, /* fill */ - expand, expand, /* expand */ - align, 0.5, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); - e_box_size_min_get(wd->o_box, &mw, &mh); + { + E_ALIGN(sobj, align, -1); + E_WEIGHT(sobj, 1, expand); + } + elm_box_pack_end(wd->o_box, sobj); + elm_box_recalculate(wd->o_box); + evas_object_size_hint_min_get(wd->o_box, &mw, &mh); e_widget_size_min_set(obj, mw, mh); e_widget_sub_object_add(obj, sobj); evas_object_show(sobj); @@ -138,23 +132,20 @@ e_widget_list_object_repack(Evas_Object *obj, Evas_Object *sobj, int fill, int e mw = mh = 0; e_widget_size_min_get(sobj, &mw, &mh); - if (e_box_orientation_get(wd->o_box) == 1) - e_box_pack_options_set(sobj, - 1, fill, /* fill */ - expand, expand, /* expand */ - 0.5, align, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); + evas_object_size_hint_min_set(sobj, mw, mh); + if (fill) align = -1; + if (elm_box_horizontal_get(wd->o_box) == 1) + { + E_ALIGN(sobj, -1, align); + E_WEIGHT(sobj, expand, 1); + } else - e_box_pack_options_set(sobj, - fill, 1, /* fill */ - expand, expand, /* expand */ - align, 0.5, /* align */ - mw, mh, /* min */ - 99999, 99999 /* max */ - ); - e_box_size_min_get(wd->o_box, &mw, &mh); + { + E_ALIGN(sobj, align, -1); + E_WEIGHT(sobj, 1, expand); + } + elm_box_recalculate(wd->o_box); + evas_object_size_hint_min_get(wd->o_box, &mw, &mh); e_widget_size_min_set(obj, mw, mh); } @@ -162,7 +153,7 @@ EAPI void e_widget_list_homogeneous_set(Evas_Object *obj, int homogenous) { E_Widget_Data *wd = e_widget_data_get(obj); - e_box_homogenous_set(wd->o_box, homogenous); + elm_box_homogeneous_set(wd->o_box, homogenous); } static void diff --git a/src/bin/e_widget_toolbar.c b/src/bin/e_widget_toolbar.c index 34ce1b5cf..dfe70c5ca 100644 --- a/src/bin/e_widget_toolbar.c +++ b/src/bin/e_widget_toolbar.c @@ -55,7 +55,7 @@ e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h) o = e_scrollframe_add(evas); wd->o_base = o; - o = e_box_add(evas); + o = elm_box_add(o); wd->o_box = o; o = wd->o_base; e_scrollframe_custom_theme_set(o, "base/theme/widgets", "e/widgets/toolbar"); @@ -82,8 +82,8 @@ e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h) e_widget_resize_object_set(obj, o); o = wd->o_box; - e_box_orientation_set(o, 1); - e_box_homogenous_set(o, 1); + elm_box_horizontal_set(o, 1); + elm_box_homogeneous_set(o, 1); e_scrollframe_child_set(wd->o_base, o); e_widget_sub_object_add(obj, o); evas_object_show(o); @@ -158,16 +158,12 @@ e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *la edje_object_part_text_set(o, "e.text.label", label); edje_object_size_min_calc(o, &mw, &mh); e_widget_sub_object_add(obj, o); - e_box_pack_end(wd->o_box, o); - e_box_pack_options_set(o, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - mw, mh, /* min */ - 9999, 9999 /* max */ - ); + evas_object_size_hint_min_set(o, mw, mh); + E_FILL(o); + elm_box_pack_end(wd->o_box, o); evas_object_show(o); - e_box_size_min_get(wd->o_box, &mw, &mh); + elm_box_recalculate(wd->o_box); + evas_object_size_hint_min_get(wd->o_box, &mw, &mh); evas_object_resize(wd->o_box, mw, mh); evas_object_resize(wd->o_base, 500, 500); e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh); @@ -235,13 +231,7 @@ e_widget_toolbar_item_label_set(Evas_Object *obj, int num, const char *label) edje_object_part_text_set(it->o_base, "e.text.label", label); edje_object_size_min_calc(it->o_base, &mw, &mh); - e_box_pack_options_set(it->o_base, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - mw, mh, /* min */ - 9999, 9999 /* max */ - ); + evas_object_size_hint_min_set(it->o_base, mw, mh); } } @@ -254,7 +244,8 @@ e_widget_toolbar_scrollable_set(Evas_Object *obj, Eina_Bool scrollable) if (!obj) return; if (!(wd = e_widget_data_get(obj))) return; wd->scrollable = scrollable; - e_box_size_min_get(wd->o_box, &mw, &mh); + elm_box_recalculate(wd->o_box); + evas_object_size_hint_min_get(wd->o_box, &mw, &mh); evas_object_resize(wd->o_box, mw, mh); evas_object_resize(wd->o_base, 500, 500); e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh); @@ -439,7 +430,8 @@ _e_wid_cb_scrollframe_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __ if ((!wd->o_base) || (!wd->o_box)) return; e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh); - e_box_size_min_get(wd->o_box, &mw, &mh); + elm_box_recalculate(wd->o_box); + evas_object_size_hint_min_get(wd->o_box, &mw, &mh); evas_object_geometry_get(wd->o_box, NULL, NULL, &w, &h); if (vw >= mw) { diff --git a/src/modules/conf_theme/e_int_config_theme.c b/src/modules/conf_theme/e_int_config_theme.c index 52be8e785..28ceb383e 100644 --- a/src/modules/conf_theme/e_int_config_theme.c +++ b/src/modules/conf_theme/e_int_config_theme.c @@ -54,12 +54,13 @@ _e_int_theme_preview_set(Evas_Object *preview, const char *file) Evas *e; Evas_Coord w = 320, h = 240, mw = 0, mh = 0; Eina_List *objs = NULL; - Evas_Object *o, *po, *po2, *po3; + Evas_Object *o, *po, *po2, *po3, *r; _e_int_theme_preview_clear(preview); e = e_widget_preview_evas_get(preview); evas_object_size_hint_min_get(preview, &w, &h); w *= 2; h *= 2; + r = evas_object_rectangle_add(e); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/desktop/background"); @@ -87,8 +88,8 @@ _e_int_theme_preview_set(Evas_Object *preview, const char *file) po = o; po2 = po; - o = e_box_add(e); - e_box_orientation_set(o, 1); + o = elm_box_add(r); + elm_box_horizontal_set(o, 1); evas_object_show(o); edje_object_part_swallow(po, "e.swallow.content", o); objs = eina_list_append(objs, o); @@ -99,20 +100,22 @@ _e_int_theme_preview_set(Evas_Object *preview, const char *file) o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/modules/start/main"); evas_object_show(o); - e_box_pack_end(po, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + E_FILL(o); + elm_box_pack_end(po, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/shelf/default/inset"); evas_object_show(o); - e_box_pack_end(po, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, 4 * mh, 0, 9999, 9999); + E_FILL(o); + elm_box_pack_end(po, o); + evas_object_size_hint_min_set(o, 4 * mh, 0); objs = eina_list_append(objs, o); po2 = o; - o = e_box_add(e); - e_box_orientation_set(o, 1); + o = elm_box_add(r); + elm_box_horizontal_set(o, 1); evas_object_show(o); edje_object_part_swallow(po2, "e.swallow.content", o); objs = eina_list_append(objs, o); @@ -122,57 +125,61 @@ _e_int_theme_preview_set(Evas_Object *preview, const char *file) _e_int_theme_edje_file_set(o, file, "e/modules/pager/desk"); evas_object_show(o); edje_object_signal_emit(o, "e,state,selected", "e"); - e_box_pack_end(po3, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + elm_box_pack_end(po3, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/modules/pager/desk"); evas_object_show(o); - e_box_pack_end(po3, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + elm_box_pack_end(po3, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/modules/pager/desk"); evas_object_show(o); - e_box_pack_end(po3, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + elm_box_pack_end(po3, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/modules/pager/desk"); evas_object_show(o); - e_box_pack_end(po3, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + elm_box_pack_end(po3, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/modules/backlight/main"); evas_object_show(o); - e_box_pack_end(po, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + E_FILL(o); + elm_box_pack_end(po, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/modules/mixer/main"); evas_object_show(o); - e_box_pack_end(po, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + E_FILL(o); + elm_box_pack_end(po, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/modules/battery/main"); evas_object_show(o); - e_box_pack_end(po, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + E_FILL(o); + elm_box_pack_end(po, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); o = edje_object_add(e); _e_int_theme_edje_file_set(o, file, "e/modules/clock/main"); evas_object_show(o); - e_box_pack_end(po, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, mh, 0, 9999, 9999); + E_FILL(o); + elm_box_pack_end(po, o); + evas_object_size_hint_min_set(o, mh, 0); objs = eina_list_append(objs, o); @@ -257,9 +264,9 @@ _e_int_theme_preview_set(Evas_Object *preview, const char *file) edje_object_part_swallow(po, "e.swallow.icon", o); objs = eina_list_append(objs, o); - o = e_box_add(e); - e_box_orientation_set(o, 1); - e_box_homogenous_set(o, 1); + o = elm_box_add(r); + elm_box_horizontal_set(o, 1); + elm_box_homogeneous_set(o, 1); evas_object_show(o); edje_object_part_swallow(po, "e.swallow.buttons", o); objs = eina_list_append(objs, o); @@ -270,8 +277,9 @@ _e_int_theme_preview_set(Evas_Object *preview, const char *file) evas_object_show(o); edje_object_signal_emit(o, "e,state,text", "e"); edje_object_part_text_set(o, "e.text.label", "OK"); - e_box_pack_end(po, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, 50, 20, 9999, 9999); + E_FILL(o); + elm_box_pack_end(po, o); + evas_object_size_hint_min_set(o, 50, 20); objs = eina_list_append(objs, o); o = edje_object_add(e); @@ -279,11 +287,13 @@ _e_int_theme_preview_set(Evas_Object *preview, const char *file) evas_object_show(o); edje_object_signal_emit(o, "e,state,text", "e"); edje_object_part_text_set(o, "e.text.label", "Cancel"); - e_box_pack_end(po, o); - e_box_pack_options_set(o, 1, 1, 0, 0, 0.5, 0.5, 50, 20, 9999, 9999); + E_FILL(o); + elm_box_pack_end(po, o); + evas_object_size_hint_min_set(o, 50, 20); objs = eina_list_append(objs, o); - e_box_size_min_get(po, &mw, &mh); + elm_box_recalculate(po); + evas_object_size_hint_min_get(po, &mw, &mh); evas_object_size_hint_min_set(po, mw, mh); edje_object_part_swallow(po2, "e.swallow.buttons", po); diff --git a/src/modules/everything/e_mod_main.h b/src/modules/everything/e_mod_main.h index 0cd7c94b2..ba923a11d 100644 --- a/src/modules/everything/e_mod_main.h +++ b/src/modules/everything/e_mod_main.h @@ -280,7 +280,7 @@ Evry_Type evry_type_register(const char *type); const char *evry_type_get(Evry_Type type); /*** internal ***/ -Tab_View *evry_tab_view_new(Evry_View *view, const Evry_State *s, Evas *e); +Tab_View *evry_tab_view_new(Evry_View *view, const Evry_State *s, Evas_Object *parent); void evry_tab_view_free(Tab_View *v); Eina_Bool evry_view_init(void); diff --git a/src/modules/everything/evry_types.h b/src/modules/everything/evry_types.h index 93036aaa4..d552c62ad 100644 --- a/src/modules/everything/evry_types.h +++ b/src/modules/everything/evry_types.h @@ -259,7 +259,7 @@ struct _Evry_View Evas_Object *o_list; Evas_Object *o_bar; - Evry_View *(*create) (Evry_View *view, const Evry_State *s, const Evas_Object *swallow); + Evry_View *(*create) (Evry_View *view, const Evry_State *s, Evas_Object *swallow); void (*destroy) (Evry_View *view); int (*cb_key_down) (Evry_View *view, const Ecore_Event_Key *ev); int (*update) (Evry_View *view); diff --git a/src/modules/everything/evry_view.c b/src/modules/everything/evry_view.c index 8d9a0ed74..44edb103f 100644 --- a/src/modules/everything/evry_view.c +++ b/src/modules/everything/evry_view.c @@ -1599,7 +1599,7 @@ _cb_list_show(void *data, Evas_Object *obj __UNUSED__, const char *emission __UN } static Evry_View * -_view_create(Evry_View *ev, const Evry_State *s, const Evas_Object *swallow) +_view_create(Evry_View *ev, const Evry_State *s, Evas_Object *swallow) { GET_VIEW(parent, ev); @@ -1664,7 +1664,7 @@ _view_create(Evry_View *ev, const Evry_State *s, const Evas_Object *swallow) evas_object_show(v->sframe); evas_object_show(v->span); - v->tabs = evry_tab_view_new(EVRY_VIEW(v), v->state, v->evas); + v->tabs = evry_tab_view_new(EVRY_VIEW(v), v->state, v->bg); EVRY_VIEW(v)->o_list = v->bg; EVRY_VIEW(v)->o_bar = v->tabs->o_tabs; diff --git a/src/modules/everything/evry_view_help.c b/src/modules/everything/evry_view_help.c index de7e6c2a2..7150a1205 100644 --- a/src/modules/everything/evry_view_help.c +++ b/src/modules/everything/evry_view_help.c @@ -30,12 +30,12 @@ _cb_key_down(Evry_View *v, const Ecore_Event_Key *ev) o = v->o_list; evas_object_geometry_get(o, NULL, NULL, NULL, &h); if (!h) h = 1; - e_box_align_get(o, NULL, &align); + elm_box_align_get(o, NULL, &align); align = align - 10.0 / (double)h; if (align < 0.0) align = 0.0; - e_box_align_set(v->o_list, 0.5, align); + elm_box_align_set(v->o_list, 0.5, align); return 1; } @@ -44,12 +44,12 @@ _cb_key_down(Evry_View *v, const Ecore_Event_Key *ev) o = v->o_list; evas_object_geometry_get(o, NULL, NULL, NULL, &h); if (!h) h = 1; - e_box_align_get(o, NULL, &align); + elm_box_align_get(o, NULL, &align); align = align + 10.0 / (double)h; if (align > 1.0) align = 1.0; - e_box_align_set(v->o_list, 0.5, align); + elm_box_align_set(v->o_list, 0.5, align); return 1; } @@ -58,7 +58,7 @@ _cb_key_down(Evry_View *v, const Ecore_Event_Key *ev) } static Evry_View * -_view_create(Evry_View *v, const Evry_State *s __UNUSED__, const Evas_Object *swallow) +_view_create(Evry_View *v, const Evry_State *s __UNUSED__, Evas_Object *swallow) { Evas_Object *o; int mw, mh; @@ -86,20 +86,21 @@ _view_create(Evry_View *v, const Evry_State *s __UNUSED__, const Evas_Object *sw if (v->active) return v; - o = e_box_add(evas_object_evas_get(swallow)); - e_box_orientation_set(o, 0); - e_box_align_set(o, 0.5, 1.0); + o = elm_box_add(swallow); + elm_box_horizontal_set(o, 0); + elm_box_align_set(o, 0.5, 1.0); v->o_list = o; - e_box_freeze(v->o_list); o = edje_object_add(evas_object_evas_get(swallow)); e_theme_edje_object_set(o, "base/theme/widgets", "e/modules/everything/textblock"); edje_object_part_text_set(o, "e.textblock.text", text); - e_box_pack_start(v->o_list, o); + elm_box_pack_start(v->o_list, o); edje_object_size_min_calc(o, &mw, &mh); - e_box_pack_options_set(o, 1, 0, 1, 0, 0.5, 0.5, mw, mh + 200, 999, 999); - e_box_thaw(v->o_list); + E_WEIGHT(o, 1, 0); + E_ALIGN(o, -1, 0.5); + evas_object_size_hint_min_set(o, mw, mh + 200); + evas_object_size_hint_max_set(o, 999, 999); evas_object_show(o); o_text = o; diff --git a/src/modules/everything/evry_view_tabs.c b/src/modules/everything/evry_view_tabs.c index ce1f7f848..31de15332 100644 --- a/src/modules/everything/evry_view_tabs.c +++ b/src/modules/everything/evry_view_tabs.c @@ -130,14 +130,13 @@ _tabs_update(Tab_View *v) } /* remove tabs for not active plugins */ - e_box_freeze(v->o_tabs); EINA_LIST_FOREACH (v->tabs, l, tab) { if (!tab->plugin) continue; - e_box_unpack(tab->o_tab); + elm_box_unpack(v->o_tabs, tab->o_tab); evas_object_hide(tab->o_tab); } @@ -152,10 +151,12 @@ _tabs_update(Tab_View *v) o = tab->o_tab; evas_object_show(o); - e_box_pack_end(v->o_tabs, o); mw = tab->cw; if (mw < tab->mw) mw = tab->mw; - e_box_pack_options_set(o, 1, 1, 1, 1, 0.5, 0.5, mw, 1, 99999, 99999); + E_EXPAND(o); + E_FILL(o); + evas_object_size_hint_min_set(o, mw, 1); + elm_box_pack_end(v->o_tabs, o); } } @@ -185,10 +186,12 @@ _tabs_update(Tab_View *v) o = tab->o_tab; evas_object_show(o); - e_box_pack_end(v->o_tabs, o); mw = tab->cw; if (mw < tab->mw) mw = tab->mw; - e_box_pack_options_set(o, 1, 1, 1, 1, 0.5, 0.5, mw, 1, 99999, 99999); + E_EXPAND(o); + E_FILL(o); + evas_object_size_hint_min_set(o, mw, 1); + elm_box_pack_end(v->o_tabs, o); if (s->plugin == p) edje_object_signal_emit(o, "e,state,selected", "e"); @@ -198,8 +201,7 @@ _tabs_update(Tab_View *v) if (++i > 3) break; } - e_box_align_set(v->o_tabs, 0.0, 0.5); - e_box_thaw(v->o_tabs); + elm_box_align_set(v->o_tabs, 0.0, 0.5); } static void @@ -208,16 +210,14 @@ _tabs_clear(Tab_View *v) Eina_List *l; Tab *tab; - e_box_freeze(v->o_tabs); EINA_LIST_FOREACH (v->tabs, l, tab) { if (!tab->plugin) continue; - e_box_unpack(tab->o_tab); + elm_box_unpack(v->o_tabs, tab->o_tab); evas_object_hide(tab->o_tab); } - e_box_thaw(v->o_tabs); } static void @@ -352,7 +352,7 @@ _tabs_key_down(Tab_View *v, const Ecore_Event_Key *ev) } Tab_View * -evry_tab_view_new(Evry_View *view, const Evry_State *s, Evas *e) +evry_tab_view_new(Evry_View *view, const Evry_State *s, Evas_Object *parent) { Tab_View *v; Evas_Object *o; @@ -364,10 +364,10 @@ evry_tab_view_new(Evry_View *view, const Evry_State *s, Evas *e) v->view = view; v->state = s; - v->evas = e; - o = e_box_add(e); - e_box_orientation_set(o, 1); - e_box_homogenous_set(o, 1); + v->evas = evas_object_evas_get(parent); + o = elm_box_add(parent); + elm_box_horizontal_set(o, 1); + elm_box_homogeneous_set(o, 1); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, _tabs_cb_wheel, v); v->o_tabs = o; @@ -382,7 +382,6 @@ evry_tab_view_free(Tab_View *v) EINA_LIST_FREE (v->tabs, tab) { - e_box_unpack(tab->o_tab); evas_object_del(tab->o_tab); E_FREE(tab); } diff --git a/src/modules/fileman/e_fwin_nav.c b/src/modules/fileman/e_fwin_nav.c index 101b09e1a..689210bbd 100644 --- a/src/modules/fileman/e_fwin_nav.c +++ b/src/modules/fileman/e_fwin_nav.c @@ -164,11 +164,20 @@ static void _box_button_cb_dnd_move(void *data, const char *type, void *event) { Instance *inst = data; + Eina_List *l; Evas_Object *obj; E_Event_Dnd_Move *ev = event; if (strcmp(type, "text/uri-list") && strcmp(type, "XdndDirectSave0")) return; - obj = e_box_item_at_xy_get(inst->o_box, ev->x, ev->y); + l = elm_box_children_get(inst->o_box); + EINA_LIST_FREE(l, obj) + { + int x, y, w, h; + + evas_object_geometry_get(obj, &x, &y, &w, &h); + if (E_INSIDE(ev->x, ev->y, x, y, w, h)) break; + } + eina_list_free(l); if (!obj) { _box_button_cb_dnd_leave(inst, type, NULL); @@ -326,10 +335,10 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) e_scrollframe_thumbscroll_force(inst->o_scroll, 1); evas_object_show(inst->o_scroll); - inst->o_box = e_box_add(gc->evas); + inst->o_box = elm_box_add(gc->o_container); evas_object_repeat_events_set(inst->o_box, EINA_TRUE); - e_box_orientation_set(inst->o_box, 1); - e_box_homogenous_set(inst->o_box, 0); + elm_box_horizontal_set(inst->o_box, 1); + elm_box_homogeneous_set(inst->o_box, 0); e_scrollframe_child_set(inst->o_scroll, inst->o_box); evas_object_show(inst->o_box); @@ -649,7 +658,6 @@ _box_button_free(Nav_Item *ni) { if (!ni) return; ni->inst->l_buttons = eina_inlist_remove(ni->inst->l_buttons, EINA_INLIST_GET(ni)); - e_box_unpack(ni->o); evas_object_del(ni->o); E_FREE_LIST(ni->handlers, ecore_event_handler_del); eio_monitor_del(ni->monitor); @@ -678,10 +686,12 @@ _box_button_append(Instance *inst, const char *label, Edje_Signal_Cb func) edje_object_signal_callback_add(o, "e,action,click", "", func, inst); edje_object_part_text_set(o, "e.text.label", label); edje_object_size_min_calc(o, &mw, &mh); - e_box_pack_end(inst->o_box, o); + E_ALIGN(o, -1, 0.5); + elm_box_pack_end(inst->o_box, o); evas_object_show(o); - e_box_pack_options_set(o, 1, 0, 0, 0, 0.5, 0.5, mw, mh, 9999, 9999); - e_box_size_min_get(inst->o_box, &mw, NULL); + evas_object_size_hint_min_set(o, mw, mh); + elm_box_recalculate(inst->o_box); + evas_object_size_hint_min_get(inst->o_box, &mw, NULL); evas_object_geometry_get(inst->o_scroll, NULL, NULL, NULL, &mh); evas_object_resize(inst->o_box, mw, mh); ni->o = o; diff --git a/src/modules/fileman_opinfo/e_mod_main.c b/src/modules/fileman_opinfo/e_mod_main.c index 91628cfe0..a4de2e207 100644 --- a/src/modules/fileman_opinfo/e_mod_main.c +++ b/src/modules/fileman_opinfo/e_mod_main.c @@ -211,7 +211,10 @@ _opinfo_op_registry_listener(void *data, const E_Fm2_Op_Registry_Entry *ere) // resize element to fit the box edje_object_size_min_calc(o, &mw, &mh); - e_box_pack_options_set(o, 1, 0, 1, 0, 0.0, 0.0, mw, mh, 9999, mh); + E_WEIGHT(o, 0, 1); + E_ALIGN(o, -1, 0); + evas_object_size_hint_min_set(o, mw, mh); + evas_object_size_hint_max_set(o, 9999, mh); evas_object_show(o); } @@ -228,7 +231,6 @@ _opinfo_op_registry_free_data_delayed(void *data) if (o) { - e_box_unpack(o); evas_object_del(o); } @@ -292,7 +294,7 @@ _opinfo_op_registry_entry_add_cb(void *data, __UNUSED__ int type, void *event) _opinfo_op_registry_abort_cb, (void*)(long)ere->id); edje_object_signal_callback_add(o, "e,fm,window,jump", "", _opinfo_op_registry_window_jump_cb, (void*)(long)ere->id); - e_box_pack_end(inst->o_box, o); + elm_box_pack_end(inst->o_box, o); e_fm2_op_registry_entry_listener_add(ere, _opinfo_op_registry_listener, o, _opinfo_op_registry_free_data); @@ -365,20 +367,23 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) } // main object - inst->o_box = e_box_add(gc->evas); - e_box_homogenous_set(inst->o_box, 0); - e_box_orientation_set(inst->o_box, 0); - e_box_align_set(inst->o_box, 0, 0); + inst->o_box = elm_box_add(gc->o_container); + elm_box_homogeneous_set(inst->o_box, 0); + elm_box_horizontal_set(inst->o_box, 0); + elm_box_align_set(inst->o_box, 0, 0); // status line inst->o_status = edje_object_add(evas_object_evas_get(inst->o_box)); if (!e_theme_edje_object_set(inst->o_status, "base/theme/modules/fileman_opinfo", "modules/fileman_opinfo/status")) edje_object_file_set(inst->o_status, inst->theme_file, "modules/fileman_opinfo/status"); - e_box_pack_end(inst->o_box, inst->o_status); + elm_box_pack_end(inst->o_box, inst->o_status); evas_object_show(inst->o_status); edje_object_size_min_get(inst->o_status, &mw, &mh); - e_box_pack_options_set(inst->o_status, 1, 0, 1, 0, 0.0, 0.0, mw, mh, 9999, mh); + E_WEIGHT(inst->o_status, 1, 0); + E_ALIGN(inst->o_status, -1, 0); + evas_object_size_hint_min_set(inst->o_status, mw, mh); + evas_object_size_hint_max_set(inst->o_status, 9999, mh); _opinfo_op_registry_update_all(inst); @@ -407,7 +412,6 @@ _gc_shutdown(E_Gadcon_Client *gcc) ecore_event_handler_del(inst->fm_op_entry_add_handler); if (inst->fm_op_entry_del_handler) ecore_event_handler_del(inst->fm_op_entry_del_handler); - e_box_unpack(inst->o_status); evas_object_del(inst->o_status); evas_object_del(inst->o_box); free(inst->theme_file); diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index 9613ad26c..8a8a7c810 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -90,7 +90,7 @@ struct _IBar_Icon Eina_Bool menu_grabbed : 1; }; -static IBar *_ibar_new(Evas *evas, Instance *inst); +static IBar *_ibar_new(Evas_Object *parent, Instance *inst); static void _ibar_free(IBar *b); static void _ibar_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _ibar_empty_handle(IBar *b); @@ -263,9 +263,8 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) ci = _ibar_config_item_get(id); inst->ci = ci; if (!ci->dir) ci->dir = eina_stringshare_add("default"); - b = _ibar_new(gc->evas, inst); + b = _ibar_new(gc->o_container, inst); gcc = e_gadcon_client_new(gc, name, id, style, b->o_outerbox); - e_gadcon_client_min_size_set(gcc, 16, 16); e_gadcon_client_autoscroll_toggle_disabled_set(gcc, !ci->dont_add_nonorder); gcc->data = inst; @@ -394,40 +393,34 @@ _gc_id_del(const E_Gadcon_Client_Class *client_class __UNUSED__, const char *id } static IBar * -_ibar_new(Evas *evas, Instance *inst) +_ibar_new(Evas_Object *parent, Instance *inst) { IBar *b; char buf[PATH_MAX]; - int w, h; b = E_NEW(IBar, 1); inst->ibar = b; b->inst = inst; b->icon_hash = eina_hash_string_superfast_new(NULL); - b->o_outerbox = e_box_add(evas); - e_box_orientation_set(b->o_outerbox, 1); - e_box_align_set(b->o_outerbox, 0.5, 0.5); - b->o_box = e_box_add(evas); - e_box_homogenous_set(b->o_box, 1); - e_box_orientation_set(b->o_box, 1); - e_box_align_set(b->o_box, 0.5, 0.5); + b->o_outerbox = elm_box_add(parent); + elm_box_horizontal_set(b->o_outerbox, 1); + elm_box_align_set(b->o_outerbox, 0.5, 0.5); + b->o_box = elm_box_add(parent); + E_EXPAND(b->o_box); + E_FILL(b->o_box); + elm_box_homogeneous_set(b->o_box, 1); + elm_box_horizontal_set(b->o_box, 1); + elm_box_align_set(b->o_box, 0.5, 0.5); + elm_box_pack_end(b->o_outerbox, b->o_box); if (inst->ci->dir[0] != '/') e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order", inst->ci->dir); else eina_strlcpy(buf, inst->ci->dir, sizeof(buf)); b->io = _ibar_order_new(b, buf); - e_box_pack_end(b->o_outerbox, b->o_box); _ibar_fill(b); - e_box_size_min_get(b->o_box, &w, &h); - e_box_pack_options_set(b->o_box, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - -1, -1 /* max */ - ); evas_object_show(b->o_box); + evas_object_show(b->o_outerbox); ibars = eina_list_append(ibars, b); return b; } @@ -509,24 +502,20 @@ _ibar_empty_handle(IBar *b) Evas_Coord w, h; b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box)); + E_EXPAND(b->o_empty); + E_FILL(b->o_empty); evas_object_event_callback_add(b->o_empty, EVAS_CALLBACK_MOUSE_DOWN, _ibar_cb_empty_mouse_down, b); evas_object_color_set(b->o_empty, 0, 0, 0, 0); evas_object_show(b->o_empty); - e_box_pack_end(b->o_box, b->o_empty); + elm_box_pack_end(b->o_box, b->o_empty); evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h); - if (e_box_orientation_get(b->o_box)) + if (elm_box_horizontal_get(b->o_box)) w = h; else h = w; - e_box_pack_options_set(b->o_empty, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - 9999, 9999 /* max */ - ); + evas_object_size_hint_min_set(b->o_empty, w, h); } } else if (b->o_empty) @@ -600,14 +589,8 @@ _ibar_fill(IBar *b) _ibar_empty_handle(b); _ibar_resize_handle(b); if (!b->inst->gcc) return; - e_box_size_min_get(b->o_box, &w, &h); - e_box_pack_options_set(b->o_box, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - w, h /* max */ - ); + evas_object_size_hint_min_get(b->o_box, &w, &h); + evas_object_size_hint_max_set(b->o_box, w, h); } static void @@ -630,17 +613,9 @@ _ibar_orient_set(IBar *b, int horizontal) else e_theme_edje_object_set(b->o_sep, "base/theme/modules/ibar", "e/modules/ibar/separator/default"); edje_object_size_min_calc(b->o_sep, &w, &h); - e_box_pack_options_set(b->o_sep, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - -1, -1 /* max */ - ); - e_box_orientation_set(b->o_box, horizontal); - e_box_align_set(b->o_box, 0.5, 0.5); - e_box_orientation_set(b->o_outerbox, horizontal); - e_box_align_set(b->o_outerbox, 0.5, 0.5); + evas_object_size_hint_min_set(b->o_sep, w, h); + elm_box_horizontal_set(b->o_box, horizontal); + elm_box_horizontal_set(b->o_outerbox, horizontal); } static void @@ -649,7 +624,9 @@ _ibar_resize_handle(IBar *b) IBar_Icon *ic; Evas_Coord w, h; - evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h); + elm_box_recalculate(b->o_box); + elm_box_recalculate(b->o_outerbox); + evas_object_size_hint_min_get(b->o_outerbox, &w, &h); if (b->inst->gcc) { if (b->inst->gcc->max.w) @@ -657,21 +634,14 @@ _ibar_resize_handle(IBar *b) if (b->inst->gcc->max.h) h = MIN(h, b->inst->gcc->max.h); } - if (e_box_orientation_get(b->o_box)) + if (elm_box_horizontal_get(b->o_box)) w = h; else h = w; - e_box_freeze(b->o_outerbox); - e_box_freeze(b->o_box); EINA_INLIST_FOREACH(b->icons, ic) { - e_box_pack_options_set(ic->o_holder, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - w, h /* max */ - ); + evas_object_size_hint_min_set(ic->o_holder, w, h); + evas_object_size_hint_max_set(ic->o_holder, w, h); } if (b->o_sep) { @@ -679,26 +649,15 @@ _ibar_resize_handle(IBar *b) h = 16 * e_scale; else w = 16 * e_scale; - e_box_pack_options_set(b->o_sep, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - 8, 8, /* min */ - w, h /* max */ - ); + evas_object_size_hint_min_set(b->o_sep, 8, 8); + evas_object_size_hint_max_set(b->o_sep, w, h); } - e_box_thaw(b->o_box); - e_box_thaw(b->o_outerbox); - e_box_size_min_get(b->o_box, &w, &h); - e_box_pack_options_set(b->o_box, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - -1, -1 /* max */ - ); if (!b->inst->gcc) return; - e_box_size_min_get(b->o_outerbox, &w, &h); + elm_box_recalculate(b->o_box); + elm_box_recalculate(b->o_outerbox); + evas_object_size_hint_min_get(b->o_outerbox, &w, &h); + if ((!w) || (!h)) return; + e_gadcon_client_min_size_set(b->inst->gcc, w, h); e_gadcon_client_aspect_set(b->inst->gcc, w, h); } @@ -783,20 +742,15 @@ _ibar_sep_create(IBar *b) if (b->o_sep) return; b->o_sep = edje_object_add(evas_object_evas_get(b->o_box)); + E_FILL(b->o_sep); if (_gc_vertical(b->inst)) e_theme_edje_object_set(b->o_sep, "base/theme/modules/ibar", "e/modules/ibar/separator/horizontal"); else e_theme_edje_object_set(b->o_sep, "base/theme/modules/ibar", "e/modules/ibar/separator/default"); evas_object_show(b->o_sep); - e_box_pack_end(b->o_outerbox, b->o_sep); + elm_box_pack_end(b->o_outerbox, b->o_sep); edje_object_size_min_calc(b->o_sep, &w, &h); - e_box_pack_options_set(b->o_sep, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - -1, -1 /* max */ - ); + evas_object_size_hint_min_set(b->o_sep, w, h); } static IBar_Icon * @@ -832,6 +786,7 @@ _ibar_icon_new(IBar *b, Efreet_Desktop *desktop, Eina_Bool notinorder) ic->app = desktop; efreet_desktop_ref(desktop); ic->o_holder = edje_object_add(evas_object_evas_get(b->o_box)); + E_FILL(ic->o_holder); e_theme_edje_object_set(ic->o_holder, "base/theme/modules/ibar", "e/modules/ibar/icon"); evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_IN, @@ -867,10 +822,10 @@ _ibar_icon_new(IBar *b, Efreet_Desktop *desktop, Eina_Bool notinorder) { ic->not_in_order = 1; b->not_in_order_count++; - e_box_pack_end(b->o_outerbox, ic->o_holder); + elm_box_pack_end(b->o_outerbox, ic->o_holder); } else - e_box_pack_end(b->o_box, ic->o_holder); + elm_box_pack_end(b->o_box, ic->o_holder); return ic; } @@ -1189,7 +1144,7 @@ _ibar_icon_menu_recalc(IBar_Icon *ic) evas_object_resize(ic->menu->comp_object, w, h); e_gadcon_popup_show(ic->menu); evas_object_geometry_get(ic->menu->comp_object, &ox, &oy, NULL, NULL); - if (e_box_orientation_get(ic->ibar->o_box)) + if (elm_box_horizontal_get(ic->ibar->o_box)) { ox = (x + (iw / 2)) - (w / 2); if (E_INTERSECTS(ox, oy, w, h, x, y, iw, ih)) @@ -1265,7 +1220,7 @@ _ibar_cb_icon_menu_img_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, vo edje_object_calc_force(ic->menu->o_bg); edje_object_size_min_calc(ic->menu->o_bg, &w, &h); evas_object_size_hint_min_set(ic->menu->o_bg, w, h); - if (e_box_orientation_get(ic->ibar->o_box)) + if (elm_box_horizontal_get(ic->ibar->o_box)) { int cx, cy, cw, ch, ny; E_Zone *zone; @@ -1968,7 +1923,7 @@ _ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y) inst->ibar->dnd_x = x; inst->ibar->dnd_y = y; - if (inst->ibar->o_drop) e_box_unpack(inst->ibar->o_drop); + if (inst->ibar->o_drop) elm_box_unpack(inst->ibar->o_box, inst->ibar->o_drop); ic = _ibar_icon_at_coord(inst->ibar, x, y); inst->ibar->ic_drop_before = ic; @@ -1978,7 +1933,7 @@ _ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y) int before = 0; evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih); - if (e_box_orientation_get(inst->ibar->o_box)) + if (elm_box_horizontal_get(inst->ibar->o_box)) { if (x < (ix + (iw / 2))) before = 1; } @@ -1987,19 +1942,13 @@ _ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y) if (y < (iy + (ih / 2))) before = 1; } if (before) - e_box_pack_before(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder); + elm_box_pack_before(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder); else - e_box_pack_after(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder); + elm_box_pack_after(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder); inst->ibar->drop_before = before; } - else e_box_pack_end(inst->ibar->o_box, inst->ibar->o_drop); - e_box_pack_options_set(inst->ibar->o_drop, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - 1, 1, /* min */ - -1, -1 /* max */ - ); + else elm_box_pack_end(inst->ibar->o_box, inst->ibar->o_drop); + evas_object_size_hint_min_set(inst->ibar->o_drop, 1, 1); _ibar_resize_handle(inst->ibar); _gc_orient(inst->gcc, -1); } @@ -2015,6 +1964,8 @@ _ibar_inst_cb_enter(void *data, const char *type __UNUSED__, void *event_info) inst = data; o = edje_object_add(evas_object_evas_get(inst->ibar->o_box)); inst->ibar->o_drop = o; + E_EXPAND(o); + E_FILL(o); o2 = edje_object_add(evas_object_evas_get(inst->ibar->o_box)); inst->ibar->o_drop_over = o2; evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c index b53d1acd9..bdd3c2e72 100644 --- a/src/modules/ibox/e_mod_main.c +++ b/src/modules/ibox/e_mod_main.c @@ -70,7 +70,7 @@ struct _IBox_Icon } drag; }; -static IBox *_ibox_new(Evas *evas, E_Zone *zone); +static IBox *_ibox_new(Evas_Object *parent, E_Zone *zone); static void _ibox_free(IBox *b); static void _ibox_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _ibox_empty_handle(IBox *b); @@ -184,7 +184,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) ci = _ibox_config_item_get(id); inst->ci = ci; - b = _ibox_new(gc->evas, gc->zone); + b = _ibox_new(gc->o_container, gc->zone); b->inst = inst; inst->ibox = b; o = b->o_box; @@ -314,15 +314,15 @@ _gc_id_del(const E_Gadcon_Client_Class *client_class __UNUSED__, const char *id } static IBox * -_ibox_new(Evas *evas, E_Zone *zone) +_ibox_new(Evas_Object *parent, E_Zone *zone) { IBox *b; b = E_NEW(IBox, 1); - b->o_box = e_box_add(evas); - e_box_homogenous_set(b->o_box, 1); - e_box_orientation_set(b->o_box, 1); - e_box_align_set(b->o_box, 0.5, 0.5); + b->o_box = elm_box_add(parent); + elm_box_homogeneous_set(b->o_box, 1); + elm_box_horizontal_set(b->o_box, 1); + elm_box_align_set(b->o_box, 0.5, 0.5); b->zone = zone; return b; } @@ -382,19 +382,15 @@ _ibox_empty_handle(IBox *b) evas_object_event_callback_add(b->o_empty, EVAS_CALLBACK_MOUSE_DOWN, _ibox_cb_empty_mouse_down, b); evas_object_color_set(b->o_empty, 0, 0, 0, 0); evas_object_show(b->o_empty); - e_box_pack_end(b->o_box, b->o_empty); + elm_box_pack_end(b->o_box, b->o_empty); evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h); - if (e_box_orientation_get(b->o_box)) + if (elm_box_horizontal_get(b->o_box)) w = h; else h = w; - e_box_pack_options_set(b->o_empty, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - 9999, 9999 /* max */ - ); + E_EXPAND(b->o_empty); + E_FILL(b->o_empty); + evas_object_size_hint_min_set(b->o_empty, w, h); } } else if (b->o_empty) @@ -441,7 +437,7 @@ _ibox_fill(IBox *b) { ic = _ibox_icon_new(b, ec); b->icons = eina_list_append(b->icons, ic); - e_box_pack_end(b->o_box, ic->o_holder); + elm_box_pack_end(b->o_box, ic->o_holder); } } @@ -450,7 +446,8 @@ _ibox_fill(IBox *b) if (!b->inst->gcc) return; if (!b->inst->ci->expand_on_desktop) return; if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) return; - e_box_size_min_get(b->o_box, &mw, &mh); + elm_box_recalculate(b->o_box); + evas_object_size_hint_min_get(b->o_box, &mw, &mh); evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h); evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh)); } @@ -465,8 +462,8 @@ _ibox_empty(IBox *b) static void _ibox_orient_set(IBox *b, int horizontal) { - e_box_orientation_set(b->o_box, horizontal); - e_box_align_set(b->o_box, 0.5, 0.5); + elm_box_horizontal_set(b->o_box, horizontal); + elm_box_align_set(b->o_box, 0.5, 0.5); } static void @@ -477,22 +474,15 @@ _ibox_resize_handle(IBox *b) int w, h; evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h); - if (e_box_orientation_get(b->o_box)) + if (elm_box_horizontal_get(b->o_box)) w = h; else h = w; - e_box_freeze(b->o_box); EINA_LIST_FOREACH(b->icons, l, ic) { - e_box_pack_options_set(ic->o_holder, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - w, h, /* min */ - w, h /* max */ - ); + evas_object_size_hint_min_set(ic->o_holder, w, h); + evas_object_size_hint_max_set(ic->o_holder, w, h); } - e_box_thaw(b->o_box); } static void @@ -543,6 +533,7 @@ _ibox_icon_new(IBox *b, E_Client *ec) ic->ibox = b; ic->client = ec; ic->o_holder = edje_object_add(evas_object_evas_get(b->o_box)); + E_FILL(ic->o_holder); e_theme_edje_object_set(ic->o_holder, "base/theme/modules/ibox", "e/modules/ibox/icon"); evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_IN, _ibox_cb_icon_mouse_in, ic); @@ -884,7 +875,7 @@ _ibox_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y) inst->ibox->dnd_y = y; if (inst->ibox->o_drop) - e_box_unpack(inst->ibox->o_drop); + elm_box_unpack(inst->ibox->o_box, inst->ibox->o_drop); ic = _ibox_icon_at_coord(inst->ibox, x, y); inst->ibox->ic_drop_before = ic; if (ic) @@ -893,7 +884,7 @@ _ibox_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y) int before = 0; evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih); - if (e_box_orientation_get(inst->ibox->o_box)) + if (elm_box_horizontal_get(inst->ibox->o_box)) { if (x < (ix + (iw / 2))) before = 1; } @@ -902,19 +893,13 @@ _ibox_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y) if (y < (iy + (ih / 2))) before = 1; } if (before) - e_box_pack_before(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder); + elm_box_pack_before(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder); else - e_box_pack_after(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder); + elm_box_pack_after(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder); inst->ibox->drop_before = before; } - else e_box_pack_end(inst->ibox->o_box, inst->ibox->o_drop); - e_box_pack_options_set(inst->ibox->o_drop, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - 1, 1, /* min */ - -1, -1 /* max */ - ); + else elm_box_pack_end(inst->ibox->o_box, inst->ibox->o_drop); + evas_object_size_hint_min_set(inst->ibox->o_drop, 1, 1); _ibox_resize_handle(inst->ibox); _gc_orient(inst->gcc, -1); } @@ -930,6 +915,8 @@ _ibox_inst_cb_enter(void *data, const char *type __UNUSED__, void *event_info) inst = data; o = edje_object_add(evas_object_evas_get(inst->ibox->o_box)); inst->ibox->o_drop = o; + E_EXPAND(inst->ibox->o_drop); + E_FILL(inst->ibox->o_drop); o2 = edje_object_add(evas_object_evas_get(inst->ibox->o_box)); inst->ibox->o_drop_over = o2; evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, _ibox_cb_drop_move, inst->ibox); @@ -1016,7 +1003,7 @@ _ibox_inst_cb_drop(void *data, const char *type, void *event_info) ic = _ibox_icon_new(b, ec); if (!ic) return; b->icons = eina_list_prepend_relative(b->icons, ic, ic2); - e_box_pack_before(b->o_box, ic->o_holder, ic2->o_holder); + elm_box_pack_before(b->o_box, ic->o_holder, ic2->o_holder); } else { @@ -1026,7 +1013,7 @@ atend: ic = _ibox_icon_new(b, ec); if (!ic) return; b->icons = eina_list_append(b->icons, ic); - e_box_pack_end(b->o_box, ic->o_holder); + elm_box_pack_end(b->o_box, ic->o_holder); } evas_object_del(inst->ibox->o_drop); @@ -1061,7 +1048,7 @@ _ibox_cb_event_client_add(void *data __UNUSED__, int type __UNUSED__, void *even ic = _ibox_icon_new(b, ev->ec); if (!ic) continue; b->icons = eina_list_append(b->icons, ic); - e_box_pack_end(b->o_box, ic->o_holder); + elm_box_pack_end(b->o_box, ic->o_holder); _ibox_empty_handle(b); _ibox_resize_handle(b); _gc_orient(b->inst->gcc, -1); @@ -1116,13 +1103,14 @@ _ibox_cb_event_client_iconify(void *data __UNUSED__, int type __UNUSED__, void * ic = _ibox_icon_new(b, ev->ec); if (!ic) continue; b->icons = eina_list_append(b->icons, ic); - e_box_pack_end(b->o_box, ic->o_holder); + elm_box_pack_end(b->o_box, ic->o_holder); _ibox_empty_handle(b); _ibox_resize_handle(b); _gc_orient(b->inst->gcc, -1); if (!b->inst->ci->expand_on_desktop) continue; if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) continue; - e_box_size_min_get(b->o_box, &mw, &mh); + elm_box_recalculate(b->o_box); + evas_object_size_hint_min_get(b->o_box, &mw, &mh); evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h); evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh)); } @@ -1153,7 +1141,8 @@ _ibox_cb_event_client_uniconify(void *data __UNUSED__, int type __UNUSED__, void _gc_orient(b->inst->gcc, -1); if (!b->inst->ci->expand_on_desktop) continue; if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) continue; - e_box_size_min_get(b->o_box, &mw, &mh); + elm_box_recalculate(b->o_box); + evas_object_size_hint_min_get(b->o_box, &mw, &mh); evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h); evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh)); } diff --git a/src/modules/illume-keyboard/e_kbd_int.c b/src/modules/illume-keyboard/e_kbd_int.c index 4b862f081..9675f1186 100644 --- a/src/modules/illume-keyboard/e_kbd_int.c +++ b/src/modules/illume-keyboard/e_kbd_int.c @@ -259,9 +259,10 @@ _e_kbd_int_matches_add(E_Kbd_Int *ki, const char *str, int num) edje_object_part_text_set(o, "e.text.label", str); edje_object_size_min_calc(o, &mw, &mh); if (mw < 32) mw = 32; - if (num & 0x1) e_box_pack_start(ki->box_obj, o); - else e_box_pack_end(ki->box_obj, o); - e_box_pack_options_set(o, 1, 1, 1, 1, 0.5, 0.5, mw, mh, 9999, 9999); + if (num & 0x1) elm_box_pack_start(ki->box_obj, o); + else elm_box_pack_end(ki->box_obj, o); + E_EXPAND(o); + evas_object_size_hint_min_set(o, mw, mh); if (num == 0) edje_object_signal_emit(o, "e,state,selected", "e"); edje_object_signal_callback_add(o, "e,action,do,select", "", @@ -292,7 +293,6 @@ _e_kbd_int_matches_update(void *data) if (!(ki = data)) return; evas_event_freeze(ki->win->evas); - e_box_freeze(ki->box_obj); _e_kbd_int_matches_free(ki); matches = e_kbd_buf_string_matches_get(ki->kbuf); if (!matches) @@ -307,7 +307,7 @@ _e_kbd_int_matches_update(void *data) for (i = 0, l = matches; l; l = l->next, i++) { _e_kbd_int_matches_add(ki, l->data, i); - e_box_size_min_get(ki->box_obj, &mw, &mh); + evas_object_size_hint_min_get(ki->box_obj, &mw, &mh); edje_object_part_geometry_get(ki->base_obj, "e.swallow.label", NULL, NULL, &vw, &vh); if (mw > vw) break; @@ -326,8 +326,7 @@ _e_kbd_int_matches_update(void *data) } } } - e_box_thaw(ki->box_obj); - e_box_size_min_get(ki->box_obj, &mw, &mh); + evas_object_size_hint_min_get(ki->box_obj, &mw, &mh); evas_object_size_hint_min_set(ki->box_obj, 0, mh); edje_object_part_swallow(ki->base_obj, "e.swallow.label", ki->box_obj); evas_event_thaw(ki->win->evas); @@ -1769,9 +1768,9 @@ e_kbd_int_new(const char *themedir, const char *syskbds, const char *sysdicts) evas_object_show(o); ki->icon_obj = o; - o = e_box_add(ki->win->evas); - e_box_orientation_set(o, 1); - e_box_homogenous_set(o, 1); + o = elm_box_add(ki->win->evas); + elm_box_horizontal_set(o, 1); + elm_box_homogeneous_set(o, 1); edje_object_part_swallow(ki->base_obj, "e.swallow.label", o); evas_object_show(o); ki->box_obj = o; diff --git a/src/modules/tasks/e_mod_main.c b/src/modules/tasks/e_mod_main.c index 1eb6d706f..d09fd2325 100644 --- a/src/modules/tasks/e_mod_main.c +++ b/src/modules/tasks/e_mod_main.c @@ -50,7 +50,7 @@ struct _Tasks_Item Eina_Bool skip_taskbar : 1; }; -static Tasks *_tasks_new(Evas *evas, E_Zone *zone, const char *id); +static Tasks *_tasks_new(Evas_Object *parent, E_Zone *zone, const char *id); static void _tasks_free(Tasks *tasks); static void _tasks_refill(Tasks *tasks); static void _tasks_refill_all(); @@ -211,7 +211,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) /* Evas_Coord x, y, w, h; */ /* int cx, cy, cw, ch; */ - tasks = _tasks_new(gc->evas, gc->zone, id); + tasks = _tasks_new(gc->o_container, gc->zone, id); o = tasks->o_items; gcc = e_gadcon_client_new(gc, name, id, style, o); @@ -260,7 +260,7 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient) if (!tasks->horizontal) { tasks->horizontal = 1; - e_box_orientation_set(tasks->o_items, tasks->horizontal); + elm_box_horizontal_set(tasks->o_items, tasks->horizontal); _tasks_refill(tasks); } break; @@ -275,7 +275,7 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient) if (tasks->horizontal) { tasks->horizontal = 0; - e_box_orientation_set(tasks->o_items, tasks->horizontal); + elm_box_horizontal_set(tasks->o_items, tasks->horizontal); _tasks_refill(tasks); } break; @@ -283,7 +283,7 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient) default: break; } - e_box_align_set(tasks->o_items, 0.5, 0.5); + elm_box_align_set(tasks->o_items, 0.5, 0.5); } static const char * @@ -355,7 +355,7 @@ _tasks_cb_iconify_provider(void *data, Evas_Object *obj, const char *signal) } static Tasks * -_tasks_new(Evas *evas, E_Zone *zone, const char *id) +_tasks_new(Evas_Object *parent, E_Zone *zone, const char *id) { Tasks *tasks; Eina_List *l; @@ -363,7 +363,7 @@ _tasks_new(Evas *evas, E_Zone *zone, const char *id) tasks = E_NEW(Tasks, 1); tasks->config = _tasks_config_item_get(id); - tasks->o_items = e_box_add(evas); + tasks->o_items = elm_box_add(parent); tasks->horizontal = 1; EINA_LIST_FOREACH(zone->comp->clients, l, ec) { @@ -371,9 +371,9 @@ _tasks_new(Evas *evas, E_Zone *zone, const char *id) tasks->clients = eina_list_append(tasks->clients, ec); } - e_box_homogenous_set(tasks->o_items, 1); - e_box_orientation_set(tasks->o_items, tasks->horizontal); - e_box_align_set(tasks->o_items, 0.5, 0.5); + elm_box_homogeneous_set(tasks->o_items, 1); + elm_box_horizontal_set(tasks->o_items, tasks->horizontal); + elm_box_align_set(tasks->o_items, 0.5, 0.5); tasks->zone = zone; tasks->iconify_provider = e_comp_object_effect_mover_add(90, "e,action,*iconify", _tasks_cb_iconify_provider, tasks); return tasks; @@ -577,14 +577,9 @@ _tasks_item_add(Tasks *tasks, E_Client *ec) Tasks_Item *item; item = _tasks_item_new(tasks, ec); - e_box_pack_end(tasks->o_items, item->o_item); - e_box_pack_options_set(item->o_item, - 1, 1, /* fill */ - 1, 1, /* expand */ - 0.5, 0.5, /* align */ - 1, 1, /* min */ - 9999, 9999 /* max */ - ); + E_EXPAND(item->o_item); + E_FILL(item->o_item); + elm_box_pack_end(tasks->o_items, item->o_item); tasks->items = eina_list_append(tasks->items, item); } @@ -592,7 +587,7 @@ static void _tasks_item_remove(Tasks_Item *item) { item->tasks->items = eina_list_remove(item->tasks->items, item); - e_box_unpack(item->o_item); + elm_box_unpack(item->tasks->o_items, item->o_item); _tasks_item_free(item); } diff --git a/src/modules/winlist/e_winlist.c b/src/modules/winlist/e_winlist.c index 14c8b4d13..80c272a4a 100644 --- a/src/modules/winlist/e_winlist.c +++ b/src/modules/winlist/e_winlist.c @@ -155,10 +155,9 @@ e_winlist_show(E_Zone *zone, E_Winlist_Filter filter) e_theme_edje_object_set(o, "base/theme/winlist", "e/widgets/winlist/main"); - o = e_box_add(zone->comp->evas); + o = elm_box_add(o); _list_object = o; - e_box_freeze(_list_object); - e_box_homogenous_set(o, 1); + elm_box_homogeneous_set(o, 1); e_comp_object_util_del_list_append(_winlist, o); edje_object_part_swallow(_bg_object, "e.swallow.list", o); edje_object_part_text_set(_bg_object, "e.text.title", _("Select a window")); @@ -189,7 +188,6 @@ e_winlist_show(E_Zone *zone, E_Winlist_Filter filter) } if (pick) _e_winlist_client_add(ec, _winlist_zone, desk); } - e_box_thaw(_list_object); eina_list_free(wmclasses); if (!_wins) @@ -752,14 +750,11 @@ _e_winlist_size_adjust(void) E_Zone *zone; int x, y, w, h; - e_box_freeze(_list_object); - e_box_size_min_get(_list_object, &mw, &mh); - evas_object_size_hint_min_set(_list_object, mw, mh); + elm_box_recalculate(_list_object); edje_object_part_swallow(_bg_object, "e.swallow.list", _list_object); edje_object_size_min_calc(_bg_object, &mw, &mh); evas_object_size_hint_min_set(_list_object, -1, -1); edje_object_part_swallow(_bg_object, "e.swallow.list", _list_object); - e_box_thaw(_list_object); zone = _winlist_zone; w = (double)zone->w * e_config->winlist_pos_size_w; @@ -831,6 +826,7 @@ _e_winlist_client_add(E_Client *ec, E_Zone *zone, E_Desk *desk) ww->client = ec; _wins = eina_list_append(_wins, ww); o = edje_object_add(ec->comp->evas); + E_FILL(o); e_comp_object_util_del_list_append(_winlist, o); ww->bg_object = o; e_theme_edje_object_set(o, "base/theme/winlist", @@ -856,14 +852,11 @@ _e_winlist_client_add(E_Client *ec, E_Zone *zone, E_Desk *desk) } edje_object_size_min_calc(ww->bg_object, &mw, &mh); - e_box_pack_end(_list_object, ww->bg_object); - e_box_pack_options_set(ww->bg_object, - 1, 1, /* fill */ - 1, 0, /* expand */ - 0.5, 0.5, /* align */ - mw, mh, /* min */ - 9999, mh /* max */ - ); + E_WEIGHT(ww->bg_object, 1, 0); + E_FILL(ww->bg_object); + evas_object_size_hint_min_set(ww->bg_object, mw, mh); + evas_object_size_hint_max_set(ww->bg_object, 9999, mh); + elm_box_pack_end(_list_object, ww->bg_object); e_object_ref(E_OBJECT(ww->client)); } @@ -1054,7 +1047,7 @@ _e_winlist_show_active(void) else { _scroll_align = _scroll_align_to; - e_box_align_set(_list_object, 0.5, fabs(1.0 - _scroll_align)); + elm_box_align_set(_list_object, 0.5, fabs(1.0 - _scroll_align)); } } @@ -1338,7 +1331,7 @@ _e_winlist_animator(void *data __UNUSED__) _scroll_align = _scroll_align_to; _scroll_to = 0; } - e_box_align_set(_list_object, 0.5, fabs(1.0 - _scroll_align)); + elm_box_align_set(_list_object, 0.5, fabs(1.0 - _scroll_align)); } if (!_scroll_to) _animator = NULL; return _scroll_to;