static void st_collections_group_parts_part_box_items_item_name(void);
static void st_collections_group_parts_part_box_items_item_source(void);
static void st_collections_group_parts_part_box_items_item_min(void);
+static void st_collections_group_parts_part_box_items_item_spread(void);
static void st_collections_group_parts_part_box_items_item_prefer(void);
static void st_collections_group_parts_part_box_items_item_max(void);
static void st_collections_group_parts_part_box_items_item_padding(void);
{"collections.group.parts.part.box.items.item.name", st_collections_group_parts_part_box_items_item_name},
{"collections.group.parts.part.box.items.item.source", st_collections_group_parts_part_box_items_item_source},
{"collections.group.parts.part.box.items.item.min", st_collections_group_parts_part_box_items_item_min},
+ {"collections.group.parts.part.box.items.item.spread", st_collections_group_parts_part_box_items_item_spread},
{"collections.group.parts.part.box.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer},
{"collections.group.parts.part.box.items.item.max", st_collections_group_parts_part_box_items_item_max},
{"collections.group.parts.part.box.items.item.padding", st_collections_group_parts_part_box_items_item_padding},
{"collections.group.parts.part.table.items.item.name", st_collections_group_parts_part_box_items_item_name}, /* dup */
{"collections.group.parts.part.table.items.item.source", st_collections_group_parts_part_box_items_item_source}, /* dup */
{"collections.group.parts.part.table.items.item.min", st_collections_group_parts_part_box_items_item_min}, /* dup */
+ {"collections.group.parts.part.table.items.item.spread", st_collections_group_parts_part_box_items_item_spread}, /* dup */
{"collections.group.parts.part.table.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer}, /* dup */
{"collections.group.parts.part.table.items.item.max", st_collections_group_parts_part_box_items_item_max}, /* dup */
{"collections.group.parts.part.table.items.item.padding", st_collections_group_parts_part_box_items_item_padding}, /* dup */
item->row = -1;
item->colspan = 1;
item->rowspan = 1;
+ item->spread.w = 1;
+ item->spread.h = 1;
pitem = (Edje_Pack_Element_Parser *)item;
pitem->can_override = EINA_FALSE;
}
}
/**
+ @page edcref
+ @property
+ spread
+ @parameters
+ [width] [height]
+ @effect
+ Will replicate the item in a rectangle of size width x height
+ box starting from the defined position of this item.
+
+ default value will be 1 1;
+ @endproperty
+*/
+static void st_collections_group_parts_part_box_items_item_spread(void)
+{
+ check_arg_count(2);
+
+ current_item->spread.w = parse_int_range(0, 0, 0x7ffffff);
+ current_item->spread.h = parse_int_range(1, 0, 0x7ffffff);
+}
+
+/**
@page edcref
@property
prefer
{
Eina_List *l;
Evas_Object *child_obj;
+ Edje_Pack_Element pack_it_copy;
const char *group_path_entry = eina_stringshare_add(source);
const char *data;
}
}
- child_obj = edje_object_add(ed->base->evas);
- group_path = eina_list_append(group_path, group_path_entry);
- if (rp->part->type == EDJE_PART_TYPE_GROUP)
- {
- _edje_real_part_swallow(rp, child_obj, EINA_FALSE);
- }
+ if (pack_it)
+ {
+ pack_it_copy = *pack_it;
+ }
+ else
+ {
+ pack_it_copy.spread.w = 0;
+ pack_it_copy.spread.h = 0;
+ }
- if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path, nested))
+ do
{
- ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'",
- rp->part->name, group_path_entry, file, source);
- ed->load_error = edje_object_load_error_get(child_obj);
- evas_object_del(child_obj);
- eina_stringshare_del(group_path_entry);
- goto on_error;
- }
+ child_obj = edje_object_add(ed->base->evas);
+ group_path = eina_list_append(group_path, group_path_entry);
+ if (rp->part->type == EDJE_PART_TYPE_GROUP)
+ {
+ _edje_real_part_swallow(rp, child_obj, EINA_FALSE);
+ }
- group_path = eina_list_remove(group_path, group_path_entry);
- eina_stringshare_del(group_path_entry);
+ if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path, nested))
+ {
+ ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'",
+ rp->part->name, group_path_entry, file, source);
+ ed->load_error = edje_object_load_error_get(child_obj);
+ evas_object_del(child_obj);
+ eina_stringshare_del(group_path_entry);
+ goto on_error;
+ }
- edje_object_propagate_callback_add(child_obj,
- _cb_signal_repeat,
- obj);
- if (rp->part->type == EDJE_PART_TYPE_GROUP)
- {
- ed->groups = eina_list_append(ed->groups, _edje_fetch(child_obj));
- _edje_real_part_swallow(rp, child_obj, EINA_TRUE);
- _edje_subobj_register(ed, child_obj);
- source = NULL;
- }
- else
- {
- if ((rp->type == EDJE_RP_TYPE_CONTAINER) &&
- (rp->typedata.container))
+ group_path = eina_list_remove(group_path, group_path_entry);
+
+ edje_object_propagate_callback_add(child_obj,
+ _cb_signal_repeat,
+ obj);
+ if (rp->part->type == EDJE_PART_TYPE_GROUP)
{
- pack_it->parent = rp;
-
- _edje_object_pack_item_hints_set(child_obj, pack_it);
- if (pack_it->name)
- evas_object_name_set(child_obj, pack_it->name);
-
- if (rp->part->type == EDJE_PART_TYPE_BOX)
- {
- _edje_real_part_box_append(rp, child_obj);
- evas_object_data_set(child_obj, "\377 edje.box_item", pack_it);
- }
- else if (rp->part->type == EDJE_PART_TYPE_TABLE)
- {
- _edje_real_part_table_pack(rp, child_obj, pack_it->col, pack_it->row, pack_it->colspan, pack_it->rowspan);
- evas_object_data_set(child_obj, "\377 edje.table_item", pack_it);
- }
+ ed->groups = eina_list_append(ed->groups, _edje_fetch(child_obj));
+ _edje_real_part_swallow(rp, child_obj, EINA_TRUE);
_edje_subobj_register(ed, child_obj);
- evas_object_show(child_obj);
- rp->typedata.container->items = eina_list_append(rp->typedata.container->items, child_obj);
-
- if (item_count > 0)
- {
- pack_it = *curr_item;
- source = pack_it->source;
- curr_item++;
- item_count--;
- }
- else
+ source = NULL;
+ }
+ else
+ {
+ if ((rp->type == EDJE_RP_TYPE_CONTAINER) &&
+ (rp->typedata.container))
{
- source = NULL;
- curr_item = NULL;
- pack_it = NULL;
+ Eina_Strbuf *buf = NULL;
+ const char *name = pack_it_copy.name;
+
+ pack_it->parent = rp;
+
+ _edje_object_pack_item_hints_set(child_obj, &pack_it_copy);
+
+ if (pack_it_copy.spread.h >= 1 && pack_it_copy.spread.w > 1)
+ {
+ buf = eina_strbuf_new();
+ if (name)
+ eina_strbuf_append_printf(buf, "%s{%i,%i}", name, pack_it_copy.col, pack_it_copy.row);
+ else
+ eina_strbuf_append_printf(buf, "%i,%i", pack_it_copy.col, pack_it_copy.row);
+ name = eina_strbuf_string_get(buf);
+ }
+ if (name) evas_object_name_set(child_obj, name);
+ if (buf) eina_strbuf_free(buf);
+
+ if (rp->part->type == EDJE_PART_TYPE_BOX)
+ {
+ _edje_real_part_box_append(rp, child_obj);
+ evas_object_data_set(child_obj, "\377 edje.box_item", pack_it);
+ }
+ else if (rp->part->type == EDJE_PART_TYPE_TABLE)
+ {
+ _edje_real_part_table_pack(rp, child_obj,
+ pack_it_copy.col, pack_it_copy.row,
+ pack_it_copy.colspan, pack_it_copy.rowspan);
+ evas_object_data_set(child_obj, "\377 edje.table_item", pack_it);
+ }
+ _edje_subobj_register(ed, child_obj);
+ evas_object_show(child_obj);
+ rp->typedata.container->items = eina_list_append(rp->typedata.container->items, child_obj);
}
}
- }
- }
- }
- if (group_path_started)
+ pack_it_copy.spread.w--;
+ pack_it_copy.col++;
+ if (pack_it_copy.spread.w < 1 && pack_it)
+ {
+ pack_it_copy.col = pack_it->col;
+ pack_it_copy.row++;
+ pack_it_copy.spread.h--;
+ pack_it_copy.spread.w = pack_it->spread.w;
+ }
+ }
+ while (pack_it_copy.spread.h > 0);
+
+ eina_stringshare_del(group_path_entry);
+
+ if ((rp->type == EDJE_RP_TYPE_CONTAINER) &&
+ (rp->typedata.container))
+ {
+ if (item_count > 0)
+ {
+ pack_it = *curr_item;
+ source = pack_it->source;
+ curr_item++;
+ item_count--;
+ }
+ else
+ {
+ source = NULL;
+ curr_item = NULL;
+ pack_it = NULL;
+ }
+ }
+ }
+ }
+
+ if (group_path_started)
{
const char *str;
size_t length_source;
int i = 0;
const char *alias = NULL;
+ const char *name = NULL;
Edje_Message_Signal emsg;
parent = data;
pack_it = evas_object_data_get(obj, "\377 edje.box_item");
if (!pack_it) pack_it = evas_object_data_get(obj, "\377 edje.table_item");
+ name = evas_object_name_get(obj);
+
if (pack_it)
{
- if (!pack_it->name)
+ if (!name) name = pack_it->name;
+ if (!name)
{
Eina_List *child = NULL;
Evas_Object *o;
}
else
{
- length_index = strlen(pack_it->name) + 2;
+ length_index = strlen(name) + 2;
}
}
length_parent += eina_convert_itoa(i, new_src + length_parent);
else
{
- memcpy(new_src + length_parent, pack_it->name, length_index);
+ memcpy(new_src + length_parent, name, length_index);
length_parent += length_index - 2;
}
new_src[length_parent++] = EDJE_PART_PATH_SEPARATOR_INDEXR;