* Correctly propagate recursive event with existing and non existing
part.
+2011-03-11 Cedric BAIL
+
+ * Add PROXY part.
static void ob_collections_group_parts_part_description(void);
static void st_collections_group_parts_part_description_inherit(void);
+static void st_collections_group_parts_part_description_source(void);
static void st_collections_group_parts_part_description_state(void);
static void st_collections_group_parts_part_description_visible(void);
static void st_collections_group_parts_part_description_align(void);
{"collections.group.parts.part.table.items.item.position", st_collections_group_parts_part_table_items_item_position},
{"collections.group.parts.part.table.items.item.span", st_collections_group_parts_part_table_items_item_span},
{"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
+ {"collections.group.parts.part.description.source", st_collections_group_parts_part_description_source},
{"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
{"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible},
{"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align},
return sizeof(statement_handlers) / sizeof (New_Object_Handler);
}
+static void
+_edje_part_description_fill(Edje_Part_Description_Spec_Fill *fill)
+{
+ fill->smooth = 1;
+ fill->pos_rel_x = FROM_DOUBLE(0.0);
+ fill->pos_abs_x = 0;
+ fill->rel_x = FROM_DOUBLE(1.0);
+ fill->abs_x = 0;
+ fill->pos_rel_y = FROM_DOUBLE(0.0);
+ fill->pos_abs_y = 0;
+ fill->rel_y = FROM_DOUBLE(1.0);
+ fill->abs_y = 0;
+ fill->angle = 0;
+ fill->spread = 0;
+ fill->type = EDJE_FILL_TYPE_SCALE;
+}
+
static Edje_Part_Description_Common *
_edje_part_description_alloc(unsigned char type, const char *collection, const char *part)
{
ed = mem_alloc(SZ(Edje_Part_Description_Image));
ed->image.id = -1;
- ed->image.fill.smooth = 1;
- ed->image.fill.pos_rel_x = FROM_DOUBLE(0.0);
- ed->image.fill.pos_abs_x = 0;
- ed->image.fill.rel_x = FROM_DOUBLE(1.0);
- ed->image.fill.abs_x = 0;
- ed->image.fill.pos_rel_y = FROM_DOUBLE(0.0);
- ed->image.fill.pos_abs_y = 0;
- ed->image.fill.rel_y = FROM_DOUBLE(1.0);
- ed->image.fill.abs_y = 0;
- ed->image.fill.angle = 0;
- ed->image.fill.spread = 0;
- ed->image.fill.type = EDJE_FILL_TYPE_SCALE;
+
+ _edje_part_description_fill(&ed->image.fill);
result = &ed->common;
break;
}
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *ed;
+
+ ed = mem_alloc(SZ(Edje_Part_Description_Proxy));
+
+ ed->proxy.id = -1;
+
+ _edje_part_description_fill(&ed->proxy.fill);
+
+ result = &ed->common;
+ break;
+ }
case EDJE_PART_TYPE_BOX:
{
Edje_Part_Description_Box *ed;
"BOX", EDJE_PART_TYPE_BOX,
"TABLE", EDJE_PART_TYPE_TABLE,
"EXTERNAL", EDJE_PART_TYPE_EXTERNAL,
+ "PROXY", EDJE_PART_TYPE_PROXY,
NULL);
if (ep->default_desc || ep->other.desc_count > 0)
break;
}
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed;
+ Edje_Part_Description_Proxy *pparent = (Edje_Part_Description_Proxy*) parent;
+
+ ped->proxy.id = pparent->proxy.id;
+
+ break;
+ }
case EDJE_PART_TYPE_BOX:
{
Edje_Part_Description_Box *bed = (Edje_Part_Description_Box *) ed;
/**
@page edcref
+
+ @property
+ source
+ @parameters
+ [another part's name]
+ @effect
+ Causes the part to use another part content as the content of this part.
+ Only work with PROXY part.
+ @endproperty
+*/
+static void
+st_collections_group_parts_part_description_source(void)
+{
+ Edje_Part_Collection *pc;
+ Edje_Part *ep;
+ Edje_Part_Description_Proxy *ed;
+ char *name;
+
+ check_arg_count(1);
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+ ep = pc->parts[pc->parts_count - 1];
+
+ if (ep->type != EDJE_PART_TYPE_PROXY)
+ {
+ ERR("%s: Error. parse error %s:%i. "
+ "source attributes in non-PROXY part.",
+ progname, file_in, line - 1);
+ exit(-1);
+ }
+
+ ed = (Edje_Part_Description_Proxy*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1];
+
+ name = parse_str(0);
+
+ data_queue_part_lookup(pc, name, &(ed->proxy.id));
+ free(name);
+}
+
+/**
+ @page edcref
@property
state
@parameters
{
Edje_Part_Collection *pc;
Edje_Part *ep;
- Edje_Part_Description_Image *ed;
+ Edje_Part_Description_Spec_Fill *fill;
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = pc->parts[pc->parts_count - 1];
- if (ep->type != EDJE_PART_TYPE_IMAGE)
+ switch (ep->type)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
- }
+ case EDJE_PART_TYPE_IMAGE:
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) ep->default_desc;
- if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+ ed = (Edje_Part_Description_Image*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->image.fill;
+ }
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *ed;
+
+ ed = (Edje_Part_Description_Proxy*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1];
- ed->image.fill.smooth = parse_bool(0);
+ fill = &ed->proxy.fill;
+ }
+ default:
+ {
+ ERR("%s: Error. parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ progname, file_in, line - 1);
+ exit(-1);
+ }
+ }
+
+ fill->smooth = parse_bool(0);
}
/**
{
Edje_Part_Collection *pc;
Edje_Part *ep;
- Edje_Part_Description_Image *ed;
+ Edje_Part_Description_Spec_Fill *fill;
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = pc->parts[pc->parts_count - 1];
- if (ep->type != EDJE_PART_TYPE_IMAGE)
+ switch (ep->type)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
- }
+ case EDJE_PART_TYPE_IMAGE:
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) ep->default_desc;
- if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+ ed = (Edje_Part_Description_Image*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->image.fill;
+ }
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *ed;
+
+ ed = (Edje_Part_Description_Proxy*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->proxy.fill;
+ }
+ default:
+ {
+ ERR("%s: Error. parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ progname, file_in, line - 1);
+ exit(-1);
+ }
+ }
- ed->image.fill.type = parse_enum(0,
- "SCALE", EDJE_FILL_TYPE_SCALE,
- "TILE", EDJE_FILL_TYPE_TILE,
- NULL);
+ fill->type = parse_enum(0,
+ "SCALE", EDJE_FILL_TYPE_SCALE,
+ "TILE", EDJE_FILL_TYPE_TILE,
+ NULL);
}
/**
{
Edje_Part_Collection *pc;
Edje_Part *ep;
- Edje_Part_Description_Image *ed;
+ Edje_Part_Description_Spec_Fill *fill;
check_arg_count(2);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = pc->parts[pc->parts_count - 1];
- if (ep->type != EDJE_PART_TYPE_IMAGE)
+ switch (ep->type)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
- }
+ case EDJE_PART_TYPE_IMAGE:
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) ep->default_desc;
- if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+ ed = (Edje_Part_Description_Image*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->image.fill;
+ }
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *ed;
+
+ ed = (Edje_Part_Description_Proxy*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->proxy.fill;
+ }
+ default:
+ {
+ ERR("%s: Error. parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ progname, file_in, line - 1);
+ exit(-1);
+ }
+ }
- ed->image.fill.pos_rel_x = FROM_DOUBLE(parse_float_range(0, -999999999.0, 999999999.0));
- ed->image.fill.pos_rel_y = FROM_DOUBLE(parse_float_range(1, -999999999.0, 999999999.0));
+ fill->pos_rel_x = FROM_DOUBLE(parse_float_range(0, -999999999.0, 999999999.0));
+ fill->pos_rel_y = FROM_DOUBLE(parse_float_range(1, -999999999.0, 999999999.0));
}
/**
{
Edje_Part_Collection *pc;
Edje_Part *ep;
- Edje_Part_Description_Image *ed;
+ Edje_Part_Description_Spec_Fill *fill;
check_arg_count(2);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = pc->parts[pc->parts_count - 1];
- if (ep->type != EDJE_PART_TYPE_IMAGE)
+
+ switch (ep->type)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
- }
+ case EDJE_PART_TYPE_IMAGE:
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) ep->default_desc;
- if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+ ed = (Edje_Part_Description_Image*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->image.fill;
+ }
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *ed;
- ed->image.fill.pos_abs_x = parse_int(0);
- ed->image.fill.pos_abs_y = parse_int(1);
+ ed = (Edje_Part_Description_Proxy*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->proxy.fill;
+ }
+ default:
+ {
+ ERR("%s: Error. parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ progname, file_in, line - 1);
+ exit(-1);
+ }
+ }
+
+ fill->pos_abs_x = parse_int(0);
+ fill->pos_abs_y = parse_int(1);
}
/**
{
Edje_Part_Collection *pc;
Edje_Part *ep;
- Edje_Part_Description_Image *ed;
+ Edje_Part_Description_Spec_Fill *fill;
check_arg_count(2);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = pc->parts[pc->parts_count - 1];
- if (ep->type != EDJE_PART_TYPE_IMAGE)
+ switch (ep->type)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
- }
+ case EDJE_PART_TYPE_IMAGE:
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) ep->default_desc;
- if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+ ed = (Edje_Part_Description_Image*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->image.fill;
+ }
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *ed;
+
+ ed = (Edje_Part_Description_Proxy*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->proxy.fill;
+ }
+ default:
+ {
+ ERR("%s: Error. parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ progname, file_in, line - 1);
+ exit(-1);
+ }
+ }
- ed->image.fill.rel_x = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
- ed->image.fill.rel_y = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0));
+ fill->rel_x = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
+ fill->rel_y = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0));
}
/**
{
Edje_Part_Collection *pc;
Edje_Part *ep;
- Edje_Part_Description_Image *ed;
+ Edje_Part_Description_Spec_Fill *fill;
check_arg_count(2);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = pc->parts[pc->parts_count - 1];
- if (ep->type != EDJE_PART_TYPE_IMAGE)
+ switch (ep->type)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
- }
+ case EDJE_PART_TYPE_IMAGE:
+ {
+ Edje_Part_Description_Image *ed;
- ed = (Edje_Part_Description_Image*) ep->default_desc;
- if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+ ed = (Edje_Part_Description_Image*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->image.fill;
+ }
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *ed;
+
+ ed = (Edje_Part_Description_Proxy*) ep->default_desc;
+ if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1];
+
+ fill = &ed->proxy.fill;
+ }
+ default:
+ {
+ ERR("%s: Error. parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY part.",
+ progname, file_in, line - 1);
+ exit(-1);
+ }
+ }
- ed->image.fill.abs_x = parse_int(0);
- ed->image.fill.abs_y = parse_int(1);
+ fill->abs_x = parse_int(0);
+ fill->abs_y = parse_int(1);
}
EDJE_PART_TYPE_BOX = 8,
EDJE_PART_TYPE_TABLE = 9,
EDJE_PART_TYPE_EXTERNAL = 10,
- EDJE_PART_TYPE_LAST = 11
+ EDJE_PART_TYPE_PROXY = 11,
+ EDJE_PART_TYPE_LAST = 12
} Edje_Part_Type;
typedef enum _Edje_Text_Effect
INIT_EMP_BOTH(RECTANGLE, Edje_Part_Description_Common, ce);
INIT_EMP_BOTH(TEXT, Edje_Part_Description_Text, ce);
INIT_EMP_BOTH(IMAGE, Edje_Part_Description_Image, ce);
+ INIT_EMP_BOTH(PROXY, Edje_Part_Description_Proxy, ce);
INIT_EMP_BOTH(SWALLOW, Edje_Part_Description_Common, ce);
INIT_EMP_BOTH(TEXTBLOCK, Edje_Part_Description_Text, ce);
INIT_EMP_BOTH(GROUP, Edje_Part_Description_Common, ce);
EDIT_ALLOC_POOL_RTL(TEXT, Text, text);
EDIT_ALLOC_POOL_RTL(TEXTBLOCK, Text, text);
EDIT_ALLOC_POOL_RTL(IMAGE, Image, image);
+ EDIT_ALLOC_POOL_RTL(PROXY, Proxy, proxy);
EDIT_ALLOC_POOL_RTL(BOX, Box, box);
EDIT_ALLOC_POOL_RTL(TABLE, Table, table);
EDIT_ALLOC_POOL_RTL(EXTERNAL, External, external_params);
static void
_edje_part_recalc_single_fill(Edje_Real_Part *ep,
- Edje_Part_Description_Spec_Image *desc,
+ Edje_Part_Description_Spec_Fill *fill,
Edje_Calc_Params *params)
{
int fw;
int fh;
- params->smooth = desc->fill.smooth;
+ params->smooth = fill->smooth;
- if (desc->fill.type == EDJE_FILL_TYPE_TILE)
+ if (fill->type == EDJE_FILL_TYPE_TILE)
evas_object_image_size_get(ep->object, &fw, NULL);
else
fw = params->w;
- params->type.common.fill.x = desc->fill.pos_abs_x
- + TO_INT(SCALE(desc->fill.pos_rel_x, fw));
- params->type.common.fill.w = desc->fill.abs_x
- + TO_INT(SCALE(desc->fill.rel_x, fw));
+ params->type.common.fill.x = fill->pos_abs_x
+ + TO_INT(SCALE(fill->pos_rel_x, fw));
+ params->type.common.fill.w = fill->abs_x
+ + TO_INT(SCALE(fill->rel_x, fw));
- if (desc->fill.type == EDJE_FILL_TYPE_TILE)
+ if (fill->type == EDJE_FILL_TYPE_TILE)
evas_object_image_size_get(ep->object, NULL, &fh);
else
fh = params->h;
- params->type.common.fill.y = desc->fill.pos_abs_y
- + TO_INT(SCALE(desc->fill.pos_rel_y, fh));
- params->type.common.fill.h = desc->fill.abs_y
- + TO_INT(SCALE(desc->fill.rel_y, fh));
+ params->type.common.fill.y = fill->pos_abs_y
+ + TO_INT(SCALE(fill->pos_rel_y, fh));
+ params->type.common.fill.h = fill->abs_y
+ + TO_INT(SCALE(fill->rel_y, fh));
- params->type.common.fill.angle = desc->fill.angle;
- params->type.common.fill.spread = desc->fill.spread;
+ params->type.common.fill.angle = fill->angle;
+ params->type.common.fill.spread = fill->spread;
}
static void
/* fill */
if (ep->part->type == EDJE_PART_TYPE_IMAGE)
- _edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Image *)desc)->image, params);
+ _edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Image *)desc)->image.fill, params);
+ else if (ep->part->type == EDJE_PART_TYPE_PROXY)
+ _edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Proxy *)desc)->proxy.fill, params);
/* colors */
if ((desc->color_class) && (*desc->color_class))
case EDJE_PART_TYPE_TABLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
+ case EDJE_PART_TYPE_PROXY:
break;
case EDJE_PART_TYPE_GRADIENT:
/* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */
}
static void
+_edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Proxy *chosen_desc, FLOAT_T pos)
+{
+ Edje_Real_Part *pp;
+ int part_id;
+
+ if (p3->type.common.fill.w == 0 || p3->type.common.fill.h == 0)
+ {
+ evas_object_image_source_set(ep->object, NULL);
+ return ;
+ }
+
+ if (pos >= 0.5) {
+ part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id;
+ } else {
+ part_id = chosen_desc->proxy.id;
+ }
+
+ pp = ed->table_parts[part_id % ed->table_parts_size];
+
+ switch (pp->part->type)
+ {
+ case EDJE_PART_TYPE_IMAGE:
+ case EDJE_PART_TYPE_TEXT:
+ case EDJE_PART_TYPE_TEXTBLOCK:
+ case EDJE_PART_TYPE_RECTANGLE:
+ case EDJE_PART_TYPE_BOX:
+ case EDJE_PART_TYPE_TABLE:
+ case EDJE_PART_TYPE_PROXY:
+ evas_object_image_source_set(ep->object, pp->object);
+ break;
+ case EDJE_PART_TYPE_GRADIENT:
+ /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */
+ break;
+ case EDJE_PART_TYPE_GROUP:
+ case EDJE_PART_TYPE_SWALLOW:
+ case EDJE_PART_TYPE_EXTERNAL:
+ evas_object_image_source_set(ep->object, pp->swallowed_object);
+ break;
+ }
+
+ evas_object_image_fill_set(ep->object, p3->type.common.fill.x, p3->type.common.fill.y,
+ p3->type.common.fill.w, p3->type.common.fill.h);
+ evas_object_image_smooth_scale_set(ep->object, p3->smooth);
+}
+
+static void
_edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Image *chosen_desc, FLOAT_T pos)
{
int image_id;
switch (part_type)
{
case EDJE_PART_TYPE_IMAGE:
- p3->type.common.fill.x = INTP(p1->type.common.fill.x, p2->type.common.fill.x, pos);
- p3->type.common.fill.y = INTP(p1->type.common.fill.y, p2->type.common.fill.y, pos);
- p3->type.common.fill.w = INTP(p1->type.common.fill.w, p2->type.common.fill.w, pos);
- p3->type.common.fill.h = INTP(p1->type.common.fill.h, p2->type.common.fill.h, pos);
p3->type.common.spec.image.l = INTP(p1->type.common.spec.image.l, p2->type.common.spec.image.l, pos);
p3->type.common.spec.image.r = INTP(p1->type.common.spec.image.r, p2->type.common.spec.image.r, pos);
p3->type.common.spec.image.t = INTP(p1->type.common.spec.image.t, p2->type.common.spec.image.t, pos);
p3->type.common.spec.image.b = INTP(p1->type.common.spec.image.b, p2->type.common.spec.image.b, pos);
+ case EDJE_PART_TYPE_PROXY:
+ p3->type.common.fill.x = INTP(p1->type.common.fill.x, p2->type.common.fill.x, pos);
+ p3->type.common.fill.y = INTP(p1->type.common.fill.y, p2->type.common.fill.y, pos);
+ p3->type.common.fill.w = INTP(p1->type.common.fill.w, p2->type.common.fill.w, pos);
+ p3->type.common.fill.h = INTP(p1->type.common.fill.h, p2->type.common.fill.h, pos);
break;
case EDJE_PART_TYPE_TEXT:
p3->type.text.size = INTP(p1->type.text.size, p2->type.text.size, pos);
evas_object_image_scale_hint_set(ep->object,
img_desc->image.scale_hint);
}
+ case EDJE_PART_TYPE_PROXY:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_TEXTBLOCK:
case EDJE_PART_TYPE_BOX:
case EDJE_PART_TYPE_TEXT:
_edje_text_recalc_apply(ed, ep, pf, (Edje_Part_Description_Text*) chosen_desc);
break;
+ case EDJE_PART_TYPE_PROXY:
+ _edje_proxy_recalc_apply(ed, ep, pf, (Edje_Part_Description_Proxy*) chosen_desc, pos);
+ break;
case EDJE_PART_TYPE_IMAGE:
_edje_image_recalc_apply(ed, ep, pf, (Edje_Part_Description_Image*) chosen_desc, pos);
break;
Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_group = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_image = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_part_description_proxy = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_text = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_textblock = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_box = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_group_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_image_pointer = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_part_description_proxy_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_text_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_textblock_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_box_pointer = NULL;
EMP(RECTANGLE, rectangle);
EMP(TEXT, text);
EMP(IMAGE, image);
+EMP(PROXY, proxy);
EMP(SWALLOW, swallow);
EMP(TEXTBLOCK, textblock);
EMP(GROUP, group);
{ EDJE_PART_TYPE_BOX, "box" },
{ EDJE_PART_TYPE_TABLE, "table" },
{ EDJE_PART_TYPE_EXTERNAL, "external" },
+ { EDJE_PART_TYPE_PROXY, "proxy" }
};
static const char *
FREED(_edje_edd_edje_part_description_swallow);
FREED(_edje_edd_edje_part_description_group);
FREED(_edje_edd_edje_part_description_image);
+ FREED(_edje_edd_edje_part_description_proxy);
FREED(_edje_edd_edje_part_description_text);
FREED(_edje_edd_edje_part_description_textblock);
FREED(_edje_edd_edje_part_description_box);
FREED(_edje_edd_edje_part_description_swallow_pointer);
FREED(_edje_edd_edje_part_description_group_pointer);
FREED(_edje_edd_edje_part_description_image_pointer);
+ FREED(_edje_edd_edje_part_description_proxy_pointer);
FREED(_edje_edd_edje_part_description_text_pointer);
FREED(_edje_edd_edje_part_description_textblock_pointer);
FREED(_edje_edd_edje_part_description_box_pointer);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.RECTANGLE", count.RECTANGLE, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TEXT", count.TEXT, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.IMAGE", count.IMAGE, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.PROXY", count.PROXY, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SWALLOW", count.SWALLOW, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TEXTBLOCK", count.TEXTBLOCK, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.GROUP", count.GROUP, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.spread", image.fill.spread, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.type", image.fill.type, EET_T_CHAR);
+ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Proxy);
+ eddc.func.mem_free = mem_free_proxy;
+ eddc.func.mem_alloc = mem_alloc_proxy;
+ _edje_edd_edje_part_description_proxy =
+ eet_data_descriptor_file_new(&eddc);
+ EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON_SUB(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, common);
+
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.id", proxy.id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.smooth", proxy.fill.smooth, EET_T_CHAR);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.pos_rel_x", proxy.fill.pos_rel_x, EDJE_T_FLOAT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.pos_abs_x", proxy.fill.pos_abs_x, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.rel_x", proxy.fill.rel_x, EDJE_T_FLOAT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.abs_x", proxy.fill.abs_x, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.pos_rel_y", proxy.fill.pos_rel_y, EDJE_T_FLOAT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.pos_abs_y", proxy.fill.pos_abs_y, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.rel_y", proxy.fill.rel_y, EDJE_T_FLOAT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.abs_y", proxy.fill.abs_y, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.angle", proxy.fill.angle, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.spread", proxy.fill.spread, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.type", proxy.fill.type, EET_T_CHAR);
+
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Text);
eddc.func.mem_free = mem_free_text;
eddc.func.mem_alloc = mem_alloc_text;
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_swallow);
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_group);
EDJE_DEFINE_POINTER_TYPE(Part_Description_Image, part_description_image);
+ EDJE_DEFINE_POINTER_TYPE(Part_Description_Proxy, part_description_proxy);
EDJE_DEFINE_POINTER_TYPE(Part_Description_Text, part_description_text);
EDJE_DEFINE_POINTER_TYPE(Part_Description_Text, part_description_textblock);
EDJE_DEFINE_POINTER_TYPE(Part_Description_Box, part_description_box);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "swallow", _edje_edd_edje_part_description_swallow);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "group", _edje_edd_edje_part_description_group);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "image", _edje_edd_edje_part_description_image);
+ EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "proxy", _edje_edd_edje_part_description_proxy);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "text", _edje_edd_edje_part_description_text);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "textblock", _edje_edd_edje_part_description_textblock);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "box", _edje_edd_edje_part_description_box);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "swallow", swallow);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "group", group);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "image", image);
+ EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "proxy", proxy);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "text", text);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "textblock", textblock);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "box", box);
case EDJE_PART_TYPE_RECTANGLE:
rp->object = evas_object_rectangle_add(ed->evas);
break;
+ case EDJE_PART_TYPE_PROXY:
case EDJE_PART_TYPE_IMAGE:
rp->object = evas_object_image_add(ed->evas);
break;
eina_mempool_del(ce->mp.RECTANGLE);
eina_mempool_del(ce->mp.TEXT);
eina_mempool_del(ce->mp.IMAGE);
+ eina_mempool_del(ce->mp.PROXY);
eina_mempool_del(ce->mp.SWALLOW);
eina_mempool_del(ce->mp.TEXTBLOCK);
eina_mempool_del(ce->mp.GROUP);
eina_mempool_del(ce->mp_rtl.RECTANGLE);
eina_mempool_del(ce->mp_rtl.TEXT);
eina_mempool_del(ce->mp_rtl.IMAGE);
+ eina_mempool_del(ce->mp_rtl.PROXY);
eina_mempool_del(ce->mp_rtl.SWALLOW);
eina_mempool_del(ce->mp_rtl.TEXTBLOCK);
eina_mempool_del(ce->mp_rtl.GROUP);
FREE_POOL(RECTANGLE, ce, desc);
FREE_POOL(TEXT, ce, desc);
FREE_POOL(IMAGE, ce, desc);
+ FREE_POOL(PROXY, ce, desc);
FREE_POOL(SWALLOW, ce, desc);
FREE_POOL(TEXTBLOCK, ce, desc);
FREE_POOL(GROUP, ce, desc);
typedef struct _Edje_Part_Dragable Edje_Part_Dragable;
typedef struct _Edje_Part_Image_Id Edje_Part_Image_Id;
typedef struct _Edje_Part_Description_Image Edje_Part_Description_Image;
+typedef struct _Edje_Part_Description_Proxy Edje_Part_Description_Proxy;
typedef struct _Edje_Part_Description_Text Edje_Part_Description_Text;
typedef struct _Edje_Part_Description_Box Edje_Part_Description_Box;
typedef struct _Edje_Part_Description_Table Edje_Part_Description_Table;
typedef struct _Edje_Part_Description_Spec_Fill Edje_Part_Description_Spec_Fill;
typedef struct _Edje_Part_Description_Spec_Border Edje_Part_Description_Spec_Border;
typedef struct _Edje_Part_Description_Spec_Image Edje_Part_Description_Spec_Image;
+typedef struct _Edje_Part_Description_Spec_Proxy Edje_Part_Description_Spec_Proxy;
typedef struct _Edje_Part_Description_Spec_Text Edje_Part_Description_Spec_Text;
typedef struct _Edje_Part_Description_Spec_Box Edje_Part_Description_Spec_Box;
typedef struct _Edje_Part_Description_Spec_Table Edje_Part_Description_Spec_Table;
TYPE RECTANGLE; \
TYPE TEXT; \
TYPE IMAGE; \
+ TYPE PROXY; \
TYPE SWALLOW; \
TYPE TEXTBLOCK; \
TYPE GROUP; \
struct _Edje_Part_Description_Spec_Image
{
+ Edje_Part_Description_Spec_Fill fill;
+
Edje_Part_Image_Id **tweens; /* list of Edje_Part_Image_Id */
unsigned int tweens_count; /* number of tweens */
Eina_Bool set; /* if image condition it's content */
Edje_Part_Description_Spec_Border border;
+};
+
+struct _Edje_Part_Description_Spec_Proxy
+{
Edje_Part_Description_Spec_Fill fill;
+
+ int id; /* the part id to use as a source for this state */
};
struct _Edje_Part_Description_Spec_Text
Edje_Part_Description_Spec_Image image;
};
+struct _Edje_Part_Description_Proxy
+{
+ Edje_Part_Description_Common common;
+ Edje_Part_Description_Spec_Proxy proxy;
+};
+
struct _Edje_Part_Description_Text
{
Edje_Part_Description_Common common;
extern Eina_Mempool *_emp_RECTANGLE;
extern Eina_Mempool *_emp_TEXT;
extern Eina_Mempool *_emp_IMAGE;
+extern Eina_Mempool *_emp_PROXY;
extern Eina_Mempool *_emp_SWALLOW;
extern Eina_Mempool *_emp_TEXTBLOCK;
extern Eina_Mempool *_emp_GROUP;