#define SIG_CHILD_ADDED "child,added"
#define SIG_CHILD_REMOVED "child,removed"
-static const Evas_Smart_Cb_Description _signals[] =
+static const Evas_Smart_Cb_Description _signals[] =
{
{SIG_CHILD_ADDED, ""},
{SIG_CHILD_REMOVED, ""},
static void _sizing_eval(Evas_Object *obj);
-#define EVAS_OBJECT_BOX_DATA_GET(o, ptr) \
- Evas_Object_Box_Data *ptr = evas_object_smart_data_get(o)
-
-#define EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, ptr) \
- EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRIT("no widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- fflush(stderr); \
- abort(); \
- return; \
-}
-
-#define EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRIT("no widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- fflush(stderr); \
- abort(); \
- return val; \
- }
+#define EVAS_OBJECT_BOX_DATA_GET(o, ptr) \
+ Evas_Object_Box_Data *ptr = evas_object_smart_data_get(o)
+
+#define EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, ptr) \
+ EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
+if (!ptr) \
+{ \
+ CRIT("no widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ fflush(stderr); \
+ abort(); \
+ return; \
+}
+
+#define EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
+ EVAS_OBJECT_BOX_DATA_GET(o, ptr); \
+if (!ptr) \
+{ \
+ CRIT("no widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ fflush(stderr); \
+ abort(); \
+ return val; \
+}
EVAS_SMART_SUBCLASS_NEW(_evas_object_box_type, _evas_object_box,
- Evas_Object_Box_Api, Evas_Smart_Class,
- evas_object_smart_clipped_class_get, NULL)
+ Evas_Object_Box_Api, Evas_Smart_Class,
+ evas_object_smart_clipped_class_get, NULL)
static Eina_Bool
_evas_object_box_iterator_next(Evas_Object_Box_Iterator *it, void **data)
if ((!api) || (!api->remove))
{
- ERR("no api->remove");
- return;
+ ERR("no api->remove");
+ return;
}
if (!api->remove(box, priv, o))
api = priv->api;
if ((!api) || (!api->option_new))
{
- ERR("no api->option_new");
- return NULL;
+ ERR("no api->option_new");
+ return NULL;
}
opt = api->option_new(o, priv, child);
if (!opt)
{
- ERR("option_new failed");
- return NULL;
+ ERR("option_new failed");
+ return NULL;
}
return opt;
EINA_LIST_FOREACH(priv->children, l, opt)
{
if (opt->obj == reference)
- {
- Evas_Object_Box_Option *new_opt;
+ {
+ Evas_Object_Box_Option *new_opt;
- new_opt = _evas_object_box_option_new(o, priv, child);
- if (!new_opt)
- return NULL;
+ new_opt = _evas_object_box_option_new(o, priv, child);
+ if (!new_opt)
+ return NULL;
- priv->children = eina_list_prepend_relative
- (priv->children, new_opt, opt);
+ priv->children = eina_list_prepend_relative
+ (priv->children, new_opt, opt);
priv->children_changed = EINA_TRUE;
evas_object_smart_callback_call(o, SIG_CHILD_ADDED, new_opt);
- return new_opt;
- }
+ return new_opt;
+ }
}
return NULL;
EINA_LIST_FOREACH(priv->children, l, opt)
{
- if (opt->obj == reference)
- {
- Evas_Object_Box_Option *new_opt;
+ if (opt->obj == reference)
+ {
+ Evas_Object_Box_Option *new_opt;
- new_opt = _evas_object_box_option_new(o, priv, child);
- if (!new_opt)
- return NULL;
+ new_opt = _evas_object_box_option_new(o, priv, child);
+ if (!new_opt)
+ return NULL;
- priv->children = eina_list_append_relative
- (priv->children, new_opt, opt);
+ priv->children = eina_list_append_relative
+ (priv->children, new_opt, opt);
priv->children_changed = EINA_TRUE;
evas_object_smart_callback_call(o, SIG_CHILD_ADDED, new_opt);
- return new_opt;
- }
+ return new_opt;
+ }
}
return NULL;
new_opt = _evas_object_box_option_new(o, priv, child);
if (!new_opt)
- return NULL;
+ return NULL;
priv->children = eina_list_prepend(priv->children, new_opt);
priv->children_changed = EINA_TRUE;
for (l = priv->children, i = 0; l; l = l->next, i++)
{
- Evas_Object_Box_Option *opt = l->data;
+ Evas_Object_Box_Option *opt = l->data;
if (i == pos)
- {
- Evas_Object_Box_Option *new_opt;
+ {
+ Evas_Object_Box_Option *new_opt;
- new_opt = _evas_object_box_option_new(o, priv, child);
- if (!new_opt)
- return NULL;
+ new_opt = _evas_object_box_option_new(o, priv, child);
+ if (!new_opt)
+ return NULL;
- priv->children = eina_list_prepend_relative
- (priv->children, new_opt, opt);
+ priv->children = eina_list_prepend_relative
+ (priv->children, new_opt, opt);
priv->children_changed = EINA_TRUE;
evas_object_smart_callback_call(o, SIG_CHILD_ADDED, new_opt);
- return new_opt;
- }
+ return new_opt;
+ }
}
return NULL;
if ((!api) || (!api->option_free))
{
- ERR("api->option_free not set (may cause memory leaks, segfaults)");
- return NULL;
+ ERR("api->option_free not set (may cause memory leaks, segfaults)");
+ return NULL;
}
EINA_LIST_FOREACH(priv->children, l, opt)
Evas_Object *obj = opt->obj;
if (obj == child)
- {
- priv->children = eina_list_remove(priv->children, opt);
- api->option_free(o, priv, opt);
+ {
+ priv->children = eina_list_remove(priv->children, opt);
+ api->option_free(o, priv, opt);
priv->children_changed = EINA_TRUE;
evas_object_smart_callback_call(o, SIG_CHILD_REMOVED, obj);
- return obj;
- }
+ return obj;
+ }
}
return NULL;
if ((!api) || (!api->option_free))
{
- WRN("api->option_free not set (may cause memory leaks, segfaults)");
+ WRN("api->option_free not set (may cause memory leaks, segfaults)");
return NULL;
}
node = eina_list_nth_list(priv->children, pos);
if (!node)
{
- ERR("No item to be removed at position %d", pos);
- return NULL;
+ ERR("No item to be removed at position %d", pos);
+ return NULL;
}
opt = node->data;
const Evas_Smart *smart;
const Evas_Smart_Class *sc;
- priv = (Evas_Object_Box_Data *)calloc(1, sizeof(*priv));
- if (!priv)
- {
- ERR("Could not allocate object private data.");
- return;
- }
+ priv = (Evas_Object_Box_Data *)calloc(1, sizeof(*priv));
+ if (!priv)
+ {
+ ERR("Could not allocate object private data.");
+ return;
+ }
smart = evas_object_smart_smart_get(o);
sc = evas_smart_class_get(smart);
priv->api = (const Evas_Object_Box_Api *)sc;
- evas_object_smart_data_set(o, priv);
+ evas_object_smart_data_set(o, priv);
}
_evas_object_box_parent_sc->add(o);
api = priv->api;
if ((!api) || (!api->option_free))
{
- WRN("api->option_free not set (may cause memory leaks, segfaults)");
+ WRN("api->option_free not set (may cause memory leaks, segfaults)");
return;
}
l = priv->children;
while (l)
{
- Evas_Object_Box_Option *opt = l->data;
+ Evas_Object_Box_Option *opt = l->data;
- _evas_object_box_child_callbacks_unregister(opt->obj);
- api->option_free(o, priv, opt);
- l = eina_list_remove_list(l, l);
+ _evas_object_box_child_callbacks_unregister(opt->obj);
+ api->option_free(o, priv, opt);
+ l = eina_list_remove_list(l, l);
}
if (priv->layout.data && priv->layout.free_data)
EAPI const Evas_Object_Box_Api *
evas_object_box_smart_class_get(void)
{
- static Evas_Object_Box_Api _sc =
+ static Evas_Object_Box_Api _sc =
EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(_evas_object_box_type);
static const Evas_Object_Box_Api *class = NULL;
{
EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, priv);
- if ((priv->layout.cb == cb) && (priv->layout.data == data) &&
+ if ((priv->layout.cb == cb) && (priv->layout.data == data) &&
(priv->layout.free_data == free_data))
return;
{
if (dim > cell_sz)
{
- if ((min_d != 0) && (cell_sz < min_d))
- *new_dim = min_d;
- else
- *new_dim = cell_sz;
+ if ((min_d != 0) && (cell_sz < min_d))
+ *new_dim = min_d;
+ else
+ *new_dim = cell_sz;
}
else
{
- if ((max_d != -1) && (cell_sz > max_d))
- *new_dim = max_d;
- else
- *new_dim = cell_sz;
+ if ((max_d != -1) && (cell_sz > max_d))
+ *new_dim = max_d;
+ else
+ *new_dim = cell_sz;
}
}
{
if (align >= 0.0)
{
- *new_dim = dim;
- *offset = (space_sz - (dim + pad_before + pad_after)) * align
- + pad_before;
+ *new_dim = dim;
+ *offset = (space_sz - (dim + pad_before + pad_after)) * align
+ + pad_before;
}
else
{
- if ((max_dim != -1) && (space_sz > max_dim))
- {
- *new_dim = max_dim;
- *offset = (space_sz - (max_dim + pad_before + pad_after)) * 0.5
- + pad_before;
- }
- else
- {
- *new_dim = space_sz;
- *offset = 0;
- }
+ if ((max_dim != -1) && (space_sz > max_dim))
+ {
+ *new_dim = max_dim;
+ *offset = (space_sz - (max_dim + pad_before + pad_after)) * 0.5
+ + pad_before;
+ }
+ else
+ {
+ *new_dim = space_sz;
+ *offset = 0;
+ }
}
}
{
if (align >= 0.0)
{
- *new_dim = dim;
- *offset =
- (cell_sz - (dim + pad_before + pad_after)) * align + pad_before;
+ *new_dim = dim;
+ *offset =
+ (cell_sz - (dim + pad_before + pad_after)) * align + pad_before;
}
else
{
*offset = pad_before;
_layout_dimension_change_min_max_cell_bound
- (dim, new_dim, min_dim, max_dim, cell_sz - pad_before - pad_after);
+ (dim, new_dim, min_dim, max_dim, cell_sz - pad_before - pad_after);
}
}
evas_object_geometry_get(o, NULL, NULL, NULL, &h);
if (remaining <= 0)
- {
- int min_w;
-
- evas_object_size_hint_min_get(o, &min_w, NULL);
- evas_object_resize(o, min_w, h);
- }
- else
- {
- double normal_weight, weight_x;
- int target_size;
- int max_w;
-
- evas_object_size_hint_weight_get(o, &weight_x, NULL);
- normal_weight = weight_x / weight_total;
- target_size = (int)((double)remaining * normal_weight);
-
- evas_object_size_hint_max_get(o, &max_w, NULL);
- if ((max_w != -1) && (target_size > max_w))
- {
- evas_object_resize(o, max_w, h);
- rem_diff += max_w;
- objects[i] = objects[n_objects - 1];
- weight_total -= weight_x;
- n_objects--;
- return _evas_object_box_layout_horizontal_weight_apply
- (priv, objects, n_objects, remaining - rem_diff,
- weight_total);
- }
- else
- {
- evas_object_resize(o, target_size, h);
- rem_diff += target_size;
- }
- }
+ {
+ int min_w;
+
+ evas_object_size_hint_min_get(o, &min_w, NULL);
+ evas_object_resize(o, min_w, h);
+ }
+ else
+ {
+ double normal_weight, weight_x;
+ int target_size;
+ int max_w;
+
+ evas_object_size_hint_weight_get(o, &weight_x, NULL);
+ normal_weight = weight_x / weight_total;
+ target_size = (int)((double)remaining * normal_weight);
+
+ evas_object_size_hint_max_get(o, &max_w, NULL);
+ if ((max_w != -1) && (target_size > max_w))
+ {
+ evas_object_resize(o, max_w, h);
+ rem_diff += max_w;
+ objects[i] = objects[n_objects - 1];
+ weight_total -= weight_x;
+ n_objects--;
+ return _evas_object_box_layout_horizontal_weight_apply
+ (priv, objects, n_objects, remaining - rem_diff,
+ weight_total);
+ }
+ else
+ {
+ evas_object_resize(o, target_size, h);
+ rem_diff += target_size;
+ }
+ }
}
return remaining - rem_diff;
int padding_l, padding_r;
double weight_x;
- _sizing_eval(opt->obj);
+ _sizing_eval(opt->obj);
evas_object_size_hint_weight_get(opt->obj, &weight_x, NULL);
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, NULL, NULL);
+ (opt->obj, &padding_l, &padding_r, NULL, NULL);
req_w += padding_l + padding_r;
if (!weight_x)
- {
- int child_w;
-
- evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, NULL);
- req_w += child_w;
- }
- else
- {
- objects[weight_use] = opt;
- weight_use++;
- weight_total += weight_x;
- }
+ {
+ int child_w;
+
+ evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, NULL);
+ req_w += child_w;
+ }
+ else
+ {
+ objects[weight_use] = opt;
+ weight_use++;
+ weight_total += weight_x;
+ }
}
remaining = w - req_w;
evas_object_size_hint_align_get(opt->obj, NULL, &align_y);
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
+ (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
evas_object_size_hint_max_get(opt->obj, NULL, &max_h);
evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
if (new_h > top_h) top_h = new_h;
_layout_set_offset_and_expand_dimension_space_max_bounded
- (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
+ (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
- if (new_h != child_h)
- evas_object_resize(opt->obj, child_w, new_h);
+ if (new_h != child_h)
+ evas_object_resize(opt->obj, child_w, new_h);
evas_object_move(opt->obj, x + off_x, y + off_y);
x += child_w + padding_l + padding_r + global_pad;
sub_pixel += pad_inc;
if (sub_pixel >= 1 << 16)
- {
- x++;
- sub_pixel -= 1 << 16;
- }
+ {
+ x++;
+ sub_pixel -= 1 << 16;
+ }
}
evas_object_size_hint_min_set(o, req_w, top_h);
evas_object_geometry_get(o, NULL, NULL, &w, NULL);
if (remaining <= 0)
- {
- int min_h;
-
- evas_object_size_hint_min_get(o, NULL, &min_h);
- evas_object_resize(o, w, min_h);
- }
- else
- {
- double normal_weight, weight_y;
- int target_size;
- int max_h;
-
- evas_object_size_hint_weight_get(o, NULL, &weight_y);
- normal_weight = weight_y / weight_total;
- target_size = (int)((double)remaining * normal_weight);
-
- evas_object_size_hint_max_get(o, NULL, &max_h);
- if ((max_h != -1) && (target_size > max_h))
- {
- evas_object_resize(o, w, max_h);
- rem_diff += max_h;
- objects[i] = objects[n_objects - 1];
- weight_total -= weight_y;
- n_objects--;
- return _evas_object_box_layout_vertical_weight_apply
- (priv, objects, n_objects, remaining - rem_diff,
- weight_total);
- }
- else
- {
- evas_object_resize(o, w, target_size);
- rem_diff += target_size;
- }
- }
+ {
+ int min_h;
+
+ evas_object_size_hint_min_get(o, NULL, &min_h);
+ evas_object_resize(o, w, min_h);
+ }
+ else
+ {
+ double normal_weight, weight_y;
+ int target_size;
+ int max_h;
+
+ evas_object_size_hint_weight_get(o, NULL, &weight_y);
+ normal_weight = weight_y / weight_total;
+ target_size = (int)((double)remaining * normal_weight);
+
+ evas_object_size_hint_max_get(o, NULL, &max_h);
+ if ((max_h != -1) && (target_size > max_h))
+ {
+ evas_object_resize(o, w, max_h);
+ rem_diff += max_h;
+ objects[i] = objects[n_objects - 1];
+ weight_total -= weight_y;
+ n_objects--;
+ return _evas_object_box_layout_vertical_weight_apply
+ (priv, objects, n_objects, remaining - rem_diff,
+ weight_total);
+ }
+ else
+ {
+ evas_object_resize(o, w, target_size);
+ rem_diff += target_size;
+ }
+ }
}
return remaining - rem_diff;
int padding_t, padding_b;
double weight_y;
- _sizing_eval(opt->obj);
+ _sizing_eval(opt->obj);
evas_object_size_hint_weight_get(opt->obj, NULL, &weight_y);
evas_object_size_hint_padding_get
- (opt->obj, NULL, NULL, &padding_t, &padding_b);
+ (opt->obj, NULL, NULL, &padding_t, &padding_b);
req_h += padding_t + padding_b;
if (!weight_y)
- {
- int child_h;
-
- evas_object_geometry_get(opt->obj, NULL, NULL, NULL, &child_h);
- req_h += child_h;
- }
- else
- {
- objects[weight_use] = opt;
- weight_use++;
- weight_total += weight_y;
- }
+ {
+ int child_h;
+
+ evas_object_geometry_get(opt->obj, NULL, NULL, NULL, &child_h);
+ req_h += child_h;
+ }
+ else
+ {
+ objects[weight_use] = opt;
+ weight_use++;
+ weight_total += weight_y;
+ }
}
remaining = h - req_h;
y += remaining / 2;
else
{ /* justified */
- _fixed_point_divide_and_decompose_integer
- (remaining, n_children - 1, &global_pad, &pad_inc);
- global_pad += priv->pad.v;
+ _fixed_point_divide_and_decompose_integer
+ (remaining, n_children - 1, &global_pad, &pad_inc);
+ global_pad += priv->pad.v;
}
EINA_LIST_FOREACH(priv->children, l, opt)
evas_object_size_hint_align_get(opt->obj, &align_x, NULL);
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
+ (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
evas_object_size_hint_max_get(opt->obj, &max_w, NULL);
evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
new_w = child_w;
_layout_set_offset_and_expand_dimension_space_max_bounded
- (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
+ (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
if (new_w > top_w) top_w = new_w;
- if (new_w != child_w)
- evas_object_resize(opt->obj, new_w, child_h);
+ if (new_w != child_w)
+ evas_object_resize(opt->obj, new_w, child_h);
evas_object_move(opt->obj, x + off_x, y + off_y);
y += child_h + padding_t + padding_b + global_pad;
sub_pixel += pad_inc;
if (sub_pixel >= 1 << 16)
- {
- y++;
- sub_pixel -= 1 << 16;
- }
+ {
+ y++;
+ sub_pixel -= 1 << 16;
+ }
}
evas_object_size_hint_min_set(o, top_w, req_h);
evas_object_size_hint_align_get(opt->obj, &align_x, &align_y);
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
+ (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
evas_object_size_hint_max_get(opt->obj, &max_w, &max_h);
evas_object_size_hint_min_get(opt->obj, &min_w, NULL);
- _sizing_eval(opt->obj);
+ _sizing_eval(opt->obj);
evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
new_w = child_w;
new_h = child_h;
_layout_set_offset_and_expand_dimension_space_max_bounded
- (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
+ (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
_layout_set_offset_and_change_dimension_min_max_cell_bounded
- (child_w, &new_w, min_w, max_w, cell_sz, &off_x, align_x,
- padding_l, padding_r);
+ (child_w, &new_w, min_w, max_w, cell_sz, &off_x, align_x,
+ padding_l, padding_r);
- if ((new_w != child_w) || (new_h != child_h))
- evas_object_resize(opt->obj, new_w, new_h);
+ if ((new_w != child_w) || (new_h != child_h))
+ evas_object_resize(opt->obj, new_w, new_h);
evas_object_move(opt->obj, x + off_x, y + off_y);
x += cell_sz + priv->pad.h;
sub_pixel += inc;
if (sub_pixel >= 1 << 16)
- {
- x++;
- sub_pixel -= 1 << 16;
- }
+ {
+ x++;
+ sub_pixel -= 1 << 16;
+ }
}
evas_object_size_hint_min_set(o, w, h);
evas_object_size_hint_align_get(opt->obj, &align_x, &align_y);
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
+ (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
evas_object_size_hint_max_get(opt->obj, &max_w, &max_h);
evas_object_size_hint_min_get(opt->obj, NULL, &min_h);
- _sizing_eval(opt->obj);
+ _sizing_eval(opt->obj);
evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
new_w = child_w;
new_h = child_h;
_layout_set_offset_and_expand_dimension_space_max_bounded
- (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
+ (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
_layout_set_offset_and_change_dimension_min_max_cell_bounded
- (child_h, &new_h, min_h, max_h, cell_sz, &off_y, align_y,
- padding_t, padding_b);
+ (child_h, &new_h, min_h, max_h, cell_sz, &off_y, align_y,
+ padding_t, padding_b);
- if ((new_w != child_w) || (new_h != child_h))
- evas_object_resize(opt->obj, new_w, new_h);
+ if ((new_w != child_w) || (new_h != child_h))
+ evas_object_resize(opt->obj, new_w, new_h);
evas_object_move(opt->obj, x + off_x, y + off_y);
y += cell_sz + priv->pad.v;
sub_pixel += inc;
if (sub_pixel >= 1 << 16)
- {
- y++;
- sub_pixel -= 1 << 16;
- }
+ {
+ y++;
+ sub_pixel -= 1 << 16;
+ }
}
evas_object_size_hint_min_set(o, w, h);
{
int child_w, padding_l, padding_r;
- _sizing_eval(opt->obj);
+ _sizing_eval(opt->obj);
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, NULL, NULL);
+ (opt->obj, &padding_l, &padding_r, NULL, NULL);
evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, NULL);
if (child_w + padding_l + padding_r > cell_sz)
- cell_sz = child_w + padding_l + padding_r;
+ cell_sz = child_w + padding_l + padding_r;
}
global_pad = priv->pad.h;
else
{ /* justified */
_fixed_point_divide_and_decompose_integer
- (remaining, n_children - 1, &global_pad, &pad_inc);
+ (remaining, n_children - 1, &global_pad, &pad_inc);
global_pad += priv->pad.h;
}
evas_object_size_hint_align_get(opt->obj, &align_x, &align_y);
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
+ (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
evas_object_size_hint_max_get(opt->obj, &max_w, &max_h);
evas_object_size_hint_min_get(opt->obj, &min_w, NULL);
if (new_h > top_h) top_h = new_h;
_layout_set_offset_and_expand_dimension_space_max_bounded
- (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
+ (child_h, &new_h, h, max_h, &off_y, align_y, padding_t, padding_b);
_layout_set_offset_and_change_dimension_min_max_cell_bounded
- (child_w, &new_w, min_w, max_w, cell_sz, &off_x, align_x,
- padding_l, padding_r);
+ (child_w, &new_w, min_w, max_w, cell_sz, &off_x, align_x,
+ padding_l, padding_r);
- if ((new_w != child_w) || (new_h != child_h))
- evas_object_resize(opt->obj, new_w, new_h);
+ if ((new_w != child_w) || (new_h != child_h))
+ evas_object_resize(opt->obj, new_w, new_h);
evas_object_move(opt->obj, x + off_x, y + off_y);
x += cell_sz + global_pad;
sub_pixel += pad_inc;
if (sub_pixel >= 1 << 16)
- {
- x++;
- sub_pixel -= 1 << 16;
- }
+ {
+ x++;
+ sub_pixel -= 1 << 16;
+ }
}
evas_object_size_hint_min_set(o, x, top_h);
{
int child_h, padding_t, padding_b;
- _sizing_eval(opt->obj);
+ _sizing_eval(opt->obj);
evas_object_size_hint_padding_get
- (opt->obj, NULL, NULL, &padding_t, &padding_b);
+ (opt->obj, NULL, NULL, &padding_t, &padding_b);
evas_object_geometry_get(opt->obj, NULL, NULL, NULL, &child_h);
if (child_h + padding_t + padding_b > cell_sz)
- cell_sz = child_h + padding_t + padding_b;
+ cell_sz = child_h + padding_t + padding_b;
}
global_pad = priv->pad.v;
y += remaining / 2;
else
{ /* justified */
- _fixed_point_divide_and_decompose_integer
- (remaining, n_children - 1, &global_pad, &pad_inc);
- global_pad += priv->pad.v;
+ _fixed_point_divide_and_decompose_integer
+ (remaining, n_children - 1, &global_pad, &pad_inc);
+ global_pad += priv->pad.v;
}
EINA_LIST_FOREACH(priv->children, l, opt)
evas_object_size_hint_align_get(opt->obj, &align_x, &align_y);
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
+ (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
evas_object_size_hint_max_get(opt->obj, &max_w, &max_h);
evas_object_size_hint_min_get(opt->obj, NULL, &min_h);
if (new_w > top_w) top_w = new_w;
_layout_set_offset_and_expand_dimension_space_max_bounded
- (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
+ (child_w, &new_w, w, max_w, &off_x, align_x, padding_l, padding_r);
_layout_set_offset_and_change_dimension_min_max_cell_bounded
- (child_h, &new_h, min_h, max_h, cell_sz, &off_y, align_y,
- padding_t, padding_b);
+ (child_h, &new_h, min_h, max_h, cell_sz, &off_y, align_y,
+ padding_t, padding_b);
- if ((new_w != child_w) || (new_h != child_h))
- evas_object_resize(opt->obj, new_w, new_h);
+ if ((new_w != child_w) || (new_h != child_h))
+ evas_object_resize(opt->obj, new_w, new_h);
evas_object_move(opt->obj, x + off_x, y + off_y);
y += cell_sz + global_pad;
sub_pixel += pad_inc;
if (sub_pixel >= 1 << 16)
- {
- y++;
- sub_pixel -= 1 << 16;
- }
+ {
+ y++;
+ sub_pixel -= 1 << 16;
+ }
}
evas_object_size_hint_min_set(o, top_w, y);
int child_w, child_h, off_x = 0;
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
+ (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
- _sizing_eval(opt->obj);
- evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
+ _sizing_eval(opt->obj);
+ evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
child_w += padding_l + padding_r + priv->pad.h;
child_h += padding_t + padding_b;
remain_w -= child_w;
if (remain_w + priv->pad.h >= 0)
- { /* continue "line" */
- if (child_h > max_h)
- max_h = child_h;
-
- off_x += child_w;
- row_width[n_rows] += child_w;
- }
- else
- { /* break line */
- if (i == start_i)
- { /* obj goes to actual line */
- max_h = child_h;
- row_width[n_rows] = child_w;
- }
- else
- { /* obj goes to next line */
- row_max_h[n_rows] = max_h;
- row_break[n_rows] = i - 1;
- n_rows++;
-
- off_x = child_w;
- off_y += max_h;
- max_h = child_h;
-
- row_width[n_rows] = child_w;
- start_i = i;
-
- remain_w = box_w - off_x;
- }
- }
+ { /* continue "line" */
+ if (child_h > max_h)
+ max_h = child_h;
+
+ off_x += child_w;
+ row_width[n_rows] += child_w;
+ }
+ else
+ { /* break line */
+ if (i == start_i)
+ { /* obj goes to actual line */
+ max_h = child_h;
+ row_width[n_rows] = child_w;
+ }
+ else
+ { /* obj goes to next line */
+ row_max_h[n_rows] = max_h;
+ row_break[n_rows] = i - 1;
+ n_rows++;
+
+ off_x = child_w;
+ off_y += max_h;
+ max_h = child_h;
+
+ row_width[n_rows] = child_w;
+ start_i = i;
+
+ remain_w = box_w - off_x;
+ }
+ }
}
row_break[n_rows] = i - 1;
if (remain_y > 0)
{
- if (priv->align.v >= 0.0)
- inc_y = priv->align.v * remain_y;
- else if (row_count == 0)
- y += remain_y / 2;
- else /* y-justified */
- inc_y = remain_y / row_count;
+ if (priv->align.v >= 0.0)
+ inc_y = priv->align.v * remain_y;
+ else if (row_count == 0)
+ y += remain_y / 2;
+ else /* y-justified */
+ inc_y = remain_y / row_count;
}
inc_y += priv->pad.v;
remain_x = (w - row_width[r]);
if (priv->align.h < 0.0)
- {
- if (row_size == 0)
- x += remain_x / 2;
- else
- _fixed_point_divide_and_decompose_integer
- (remain_x, row_size, &row_justify, &just_inc);
- }
+ {
+ if (row_size == 0)
+ x += remain_x / 2;
+ else
+ _fixed_point_divide_and_decompose_integer
+ (remain_x, row_size, &row_justify, &just_inc);
+ }
row_justify += priv->pad.h;
for (; i <= row_break[r]; i++, l = l->next)
- {
- Evas_Object_Box_Option *opt = l->data;
- int off_x, off_y, y_remain;
- int padding_l, padding_r;
- int child_w, child_h;
- double align_y;
+ {
+ Evas_Object_Box_Option *opt = l->data;
+ int off_x, off_y, y_remain;
+ int padding_l, padding_r;
+ int child_w, child_h;
+ double align_y;
- evas_object_size_hint_align_get(opt->obj, NULL, &align_y);
- evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, NULL, NULL);
+ evas_object_size_hint_align_get(opt->obj, NULL, &align_y);
+ evas_object_size_hint_padding_get
+ (opt->obj, &padding_l, &padding_r, NULL, NULL);
- evas_object_geometry_get
- (opt->obj, NULL, NULL, &child_w, &child_h);
+ evas_object_geometry_get
+ (opt->obj, NULL, NULL, &child_w, &child_h);
- y_remain = row_max_h[r] - child_h;
+ y_remain = row_max_h[r] - child_h;
- off_x = padding_l;
- if (priv->align.h >= 0.0)
- off_x += remain_x * priv->align.h;
- off_y = y_remain * align_y;
+ off_x = padding_l;
+ if (priv->align.h >= 0.0)
+ off_x += remain_x * priv->align.h;
+ off_y = y_remain * align_y;
- evas_object_move(opt->obj, x + off_x, y + off_y);
+ evas_object_move(opt->obj, x + off_x, y + off_y);
- x += child_w + padding_l + padding_r + row_justify;
+ x += child_w + padding_l + padding_r + row_justify;
- sub_pixel += just_inc;
- if (sub_pixel >= 1 << 16)
- {
- x++;
- sub_pixel -= 1 << 16;
- }
- }
+ sub_pixel += just_inc;
+ if (sub_pixel >= 1 << 16)
+ {
+ x++;
+ sub_pixel -= 1 << 16;
+ }
+ }
evas_object_geometry_get(o, &x, NULL, NULL, NULL);
if (min_w < row_width[r])
int child_w, child_h, off_y = 0;
evas_object_size_hint_padding_get
- (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
+ (opt->obj, &padding_l, &padding_r, &padding_t, &padding_b);
- _sizing_eval(opt->obj);
+ _sizing_eval(opt->obj);
evas_object_geometry_get(opt->obj, NULL, NULL, &child_w, &child_h);
child_w += padding_l + padding_r;
remain_h -= child_h;
if (remain_h + priv->pad.v >= 0)
- { /* continue "col" */
- if (child_w > max_w)
- max_w = child_w;
-
- off_y += child_h;
- col_height[n_cols] += child_h;
- }
- else
- {
- /* break col */
- if (i == start_i)
- { /* obj goes to actual col */
- max_w = child_w;
- col_height[n_cols] = child_h;
- }
- else
- { /* obj goes to next col */
- col_max_w[n_cols] = max_w;
- col_break[n_cols] = i - 1;
- n_cols++;
-
- off_x += max_w;
- off_y = child_h;
- max_w = child_w;
-
- col_height[n_cols] = child_h;
- start_i = i;
-
- remain_h = box_h - off_y;
- }
- }
+ { /* continue "col" */
+ if (child_w > max_w)
+ max_w = child_w;
+
+ off_y += child_h;
+ col_height[n_cols] += child_h;
+ }
+ else
+ {
+ /* break col */
+ if (i == start_i)
+ { /* obj goes to actual col */
+ max_w = child_w;
+ col_height[n_cols] = child_h;
+ }
+ else
+ { /* obj goes to next col */
+ col_max_w[n_cols] = max_w;
+ col_break[n_cols] = i - 1;
+ n_cols++;
+
+ off_x += max_w;
+ off_y = child_h;
+ max_w = child_w;
+
+ col_height[n_cols] = child_h;
+ start_i = i;
+
+ remain_h = box_h - off_y;
+ }
+ }
}
col_break[n_cols] = i - 1;
if (remain_x > 0)
{
- if (priv->align.h >= 0)
- inc_x = priv->align.h * remain_x;
- else if (col_count == 0)
- x += remain_x / 2;
- else /* x-justified */
- inc_x = remain_x / col_count;
+ if (priv->align.h >= 0)
+ inc_x = priv->align.h * remain_x;
+ else if (col_count == 0)
+ x += remain_x / 2;
+ else /* x-justified */
+ inc_x = remain_x / col_count;
}
inc_x += priv->pad.h;
remain_y = (h - col_height[c]);
if (priv->align.v < 0.0)
- {
- if (col_size == 0)
- y += remain_y / 2;
- else
- _fixed_point_divide_and_decompose_integer
- (remain_y, col_size, &col_justify, &just_inc);
- }
+ {
+ if (col_size == 0)
+ y += remain_y / 2;
+ else
+ _fixed_point_divide_and_decompose_integer
+ (remain_y, col_size, &col_justify, &just_inc);
+ }
col_justify += priv->pad.v;
for (; i <= col_break[c]; i++, l = l->next)
- {
- Evas_Object_Box_Option *opt = l->data;
- int off_x, off_y, x_remain;
- int padding_t, padding_b;
- int child_w, child_h;
- double align_x;
+ {
+ Evas_Object_Box_Option *opt = l->data;
+ int off_x, off_y, x_remain;
+ int padding_t, padding_b;
+ int child_w, child_h;
+ double align_x;
- evas_object_size_hint_align_get(opt->obj, &align_x, NULL);
- evas_object_size_hint_padding_get
- (opt->obj, NULL, NULL, &padding_t, &padding_b);
+ evas_object_size_hint_align_get(opt->obj, &align_x, NULL);
+ evas_object_size_hint_padding_get
+ (opt->obj, NULL, NULL, &padding_t, &padding_b);
- evas_object_geometry_get
- (opt->obj, NULL, NULL, &child_w, &child_h);
+ evas_object_geometry_get
+ (opt->obj, NULL, NULL, &child_w, &child_h);
- x_remain = col_max_w[c] - child_w;
+ x_remain = col_max_w[c] - child_w;
- off_x = x_remain * align_x;
- off_y = padding_t;
- if (priv->align.v >= 0.0)
- off_y += remain_y * priv->align.v;
+ off_x = x_remain * align_x;
+ off_y = padding_t;
+ if (priv->align.v >= 0.0)
+ off_y += remain_y * priv->align.v;
- evas_object_move(opt->obj, x + off_x, y + off_y);
+ evas_object_move(opt->obj, x + off_x, y + off_y);
- y += child_h + padding_t + padding_b + col_justify;
+ y += child_h + padding_t + padding_b + col_justify;
- sub_pixel += just_inc;
- if (sub_pixel >= 1 << 16)
- {
- y++;
- sub_pixel -= 1 << 16;
- }
- }
+ sub_pixel += just_inc;
+ if (sub_pixel >= 1 << 16)
+ {
+ y++;
+ sub_pixel -= 1 << 16;
+ }
+ }
evas_object_geometry_get(o, NULL, &y, NULL, NULL);
min_w += col_max_w[c];
{
Evas_Object *child = opt->obj;
Evas_Coord max_w, max_h, min_w, min_h, pad_l, pad_r, pad_t, pad_b,
- child_w, child_h, new_w, new_h, off_x, off_y;
+ child_w, child_h, new_w, new_h, off_x, off_y;
double align_x, align_y;
evas_object_size_hint_align_get(child, &align_x, &align_y);
evas_object_size_hint_padding_get
- (child, &pad_l, &pad_r, &pad_t, &pad_b);
+ (child, &pad_l, &pad_r, &pad_t, &pad_b);
evas_object_size_hint_max_get(child, &max_w, &max_h);
evas_object_size_hint_min_get(child, &min_w, &min_h);
- _sizing_eval(opt->obj);
- evas_object_geometry_get(child, NULL, NULL, &child_w, &child_h);
+ _sizing_eval(opt->obj);
+ evas_object_geometry_get(child, NULL, NULL, &child_w, &child_h);
new_w = child_w;
new_h = child_h;
if (new_w > top_w) top_w = new_w;
if (new_h > top_h) top_h = new_h;
_layout_set_offset_and_change_dimension_min_max_cell_bounded
- (child_w, &new_w, min_w, max_w, ow, &off_x, align_x, pad_l, pad_r);
+ (child_w, &new_w, min_w, max_w, ow, &off_x, align_x, pad_l, pad_r);
_layout_set_offset_and_change_dimension_min_max_cell_bounded
- (child_h, &new_h, min_h, max_h, oh, &off_y, align_y, pad_t, pad_b);
+ (child_h, &new_h, min_h, max_h, oh, &off_y, align_y, pad_t, pad_b);
- if ((new_w != child_w) || (new_h != child_h))
- evas_object_resize(child, new_w, new_h);
+ if ((new_w != child_w) || (new_h != child_h))
+ evas_object_resize(child, new_w, new_h);
evas_object_move(child, ox + off_x, oy + off_y);
if (old_child)
- evas_object_stack_above(child, old_child);
+ evas_object_stack_above(child, old_child);
old_child = child;
}
EVAS_OBJECT_BOX_DATA_GET(o, priv);
if (priv)
{
- if (horizontal) *horizontal = priv->align.h;
- if (vertical) *vertical = priv->align.v;
+ if (horizontal) *horizontal = priv->align.h;
+ if (vertical) *vertical = priv->align.v;
}
else
{
- if (horizontal) *horizontal = 0.5;
- if (vertical) *vertical = 0.5;
+ if (horizontal) *horizontal = 0.5;
+ if (vertical) *vertical = 0.5;
}
}
EVAS_OBJECT_BOX_DATA_GET(o, priv);
if (priv)
{
- if (horizontal) *horizontal = priv->pad.h;
- if (vertical) *vertical = priv->pad.v;
+ if (horizontal) *horizontal = priv->pad.h;
+ if (vertical) *vertical = priv->pad.v;
}
else
{
- if (horizontal) *horizontal = 0;
- if (vertical) *vertical = 0;
+ if (horizontal) *horizontal = 0;
+ if (vertical) *vertical = 0;
}
}
if (opt)
{
- evas_object_smart_member_add(child, o);
- evas_object_smart_changed(o);
- return _evas_object_box_option_callbacks_register(o, priv, opt);
+ evas_object_smart_member_add(child, o);
+ evas_object_smart_changed(o);
+ return _evas_object_box_option_callbacks_register(o, priv, opt);
}
return NULL;