This lets you limit the size of the font that will be used.
Especially useful when using fit.
+2011-03-10 WooHyun Jung
+
+ * Fix: Emit clicked signal on entry if still in - missing.
+
+2011-03-10 Cedric BAIL
+
+ * Correctly propagate recursive event with existing and non existing
+ part.
+
+2011-03-11 Cedric BAIL
+
+ * Add PROXY part.
+
+2011-03-19 Carsten Haitzler (The Rasterman)
+
+ * Change edje_decc to only use edje_cc as the compiler for security
+ and correctness reasons.
+
+2011-03-23 Brett Nash (nash)
+
+ * Move some of edje over to use smart clipper in evas. This _should_
+ be transparent to users.
+
+2011-03-30 Carsten Haitzler (The Rasterman)
+
+ * text.align (only the vertical part) now works for textblock.
+
dnl m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
-m4_define([lt_rev], m4_eval(v_maj + v_min))
-m4_define([lt_cur], v_mic)
+m4_define([lt_cur], m4_eval(v_maj + v_min))
+m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
-version_info="lt_rev:lt_cur:lt_age"
+version_info="lt_cur:lt_rev:lt_age"
release_info="v_rel"
AC_SUBST(version_info)
AC_SUBST(release_info)
[
eina >= 1.0.0
eet >= 1.4.0
- evas >= 1.0.0
+ evas >= 1.0.999
ecore >= 1.0.0
ecore-file >= 1.0.0
embryo >= 1.0.0
### Checks for header files
-AC_CHECK_HEADERS([locale.h])
+AC_CHECK_HEADERS([locale.h sys/resource.h])
EFL_CHECK_PATH_MAX
%{_libdir}/*.a
%{_libdir}/pkgconfig/*
%{_includedir}/edje-1/*.h
+%{_libdir}/edje/utils/epp
%files bin
%defattr(-, root, root)
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;
+ break;
+ }
+ 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;
+ break;
+ }
+ default:
+ {
+ ERR("%s: Error. parse error %s:%i. "
+ "image and proxy attributes in non-IMAGE, non-PROXY `%s` part (%i).",
+ progname, file_in, line - 1, ep->name, ep->type);
+ exit(-1);
+ }
+ }
- ed->image.fill.smooth = parse_bool(0);
+ 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;
+ break;
+ }
+ 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;
+ break;
+ }
+ 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];
- 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 = &ed->image.fill;
+ break;
+ }
+ 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;
+ break;
+ }
+ 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_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;
+ break;
+ }
+ 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;
+ break;
+ }
+ 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_abs_x = parse_int(0);
- ed->image.fill.pos_abs_y = parse_int(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;
+ break;
+ }
+ 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;
+ break;
+ }
+ 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;
+ break;
+ }
+ 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;
+ break;
+ }
+ 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);
}
#include <math.h>
#include "edje_cc.h"
+#include "edje_prefix.h"
#include <Ecore.h>
#include <Ecore_File.h>
+#ifdef _WIN32
+# define EPP_EXT ".exe"
+#else
+# define EPP_EXT
+#endif
+
static void new_object(void);
static void new_statement(void);
static char *perform_math (char *input);
void
compile(void)
{
- char buf[4096];
+ char buf[4096], buf2[4096];
char inc[4096];
static char tmpn[4096];
int fd;
* Run the input through the C pre-processor.
*/
ret = -1;
- if (ecore_file_exists(EPP_DIR"/epp"))
+ snprintf(buf2, sizeof(buf2), "%s/edje/utils/epp"EPP_EXT, e_prefix_lib_get());
+ if (ecore_file_exists(buf2))
{
- snprintf(buf, sizeof(buf), EPP_DIR"/epp %s -I%s %s -o %s",
- file_in, inc, def, tmpn);
+ snprintf(buf, sizeof(buf), "%s %s -I%s %s -o %s",
+ buf2, file_in, inc, def, tmpn);
ret = system(buf);
}
/*
if (ret == EXIT_SUCCESS)
file_in = tmpn;
free(def);
-/* OLD CODE
- snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s -E -o %s",
- file_in, inc, def, tmpn);
- ret = system(buf);
- if (ret < 0)
- {
- snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s",
- inc, def, tmpn, file_in);
- ret = system(buf);
- }
- if (ret >= 0) file_in = tmpn;
- free(def);
- */
}
fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
eet_close(ef);
return 0;
}
+ /* force compiler to be edje_cc */
+ edje_file->compiler = strdup("edje_cc");
if (!edje_file->compiler)
{
edje_file->compiler = strdup("edje_cc");
return "TEXT";
case EDJE_PART_TYPE_IMAGE:
return "IMAGE";
+ case EDJE_PART_TYPE_PROXY:
+ return "PROXY";
case EDJE_PART_TYPE_SWALLOW:
return "SWALLOW";
case EDJE_PART_TYPE_TEXTBLOCK:
if (machine) puts("IMAGE-END");
else if (detail > 1) puts(INDENT4 "}");
}
+ else if (t == EDJE_PART_TYPE_PROXY)
+ {
+ int x2, y2;
+ double dx2, dy2;
+ Eina_Bool has_orgin, has_size;
+
+ if (machine) puts("PROXY-BEGIN");
+ else puts(INDENT4 "proxy {");
+ // TODO Support source
+ // TODO support proxy.fill.smooth
+
+ dx = edje_edit_state_fill_origin_relative_x_get
+ (ed, part, state, value);
+ dy = edje_edit_state_fill_origin_relative_y_get
+ (ed, part, state, value);
+ x = edje_edit_state_fill_origin_offset_x_get
+ (ed, part, state, value);
+ y = edje_edit_state_fill_origin_offset_y_get
+ (ed, part, state, value);
+
+ dx2 = edje_edit_state_fill_size_relative_x_get
+ (ed, part, state, value);
+ dy2 = edje_edit_state_fill_size_relative_y_get
+ (ed, part, state, value);
+ x2 = edje_edit_state_fill_size_offset_x_get
+ (ed, part, state, value);
+ y2 = edje_edit_state_fill_size_offset_y_get
+ (ed, part, state, value);
+
+ has_orgin = (FDIFF(dx, 0.0) || FDIFF(dy, 0.0) || (x) || (y));
+ has_size = (FDIFF(dx2, 1.0) || FDIFF(dy2, 1.0) || (x2) || (y2));
+
+ if ((has_orgin) || (has_size))
+ {
+ if (machine) puts("PROXY-FILL-BEGIN");
+ else puts(INDENT5 "fill {");
+
+ if (has_orgin)
+ {
+ if (machine)
+ printf("ORIGIN-RELATIVE-X: %g\n"
+ "ORIGIN-RELATIVE-Y: %g\n"
+ "ORIGIN-OFFSET-X: %d\n"
+ "ORIGIN-OFFSET-Y: %d\n",
+ dx, dy, x, y);
+ else
+ printf(INDENT6 "origin {\n"
+ INDENT7 "relative: %g %g;\n"
+ INDENT7 "offset: %d %d;\n"
+ INDENT6 "}\n",
+ dx, dy, x, y);
+ }
+
+ if (has_size)
+ {
+ if (machine)
+ printf("SIZE-RELATIVE-X: %g\n"
+ "SIZE-RELATIVE-Y: %g\n"
+ "SIZE-OFFSET-X: %d\n"
+ "SIZE-OFFSET-Y: %d\n",
+ dx2, dy2, x2, y2);
+ else
+ printf(INDENT6 "size {\n"
+ INDENT7 "relative: %g %g;\n"
+ INDENT7 "offset: %d %d;\n"
+ INDENT6 "}\n",
+ dx2, dy2, x2, y2);
+ }
+
+ if (machine) puts("PROXY-FILL-END");
+ else puts(INDENT5 "}");
+ }
+
+ if (machine) puts("PROXY-END");
+ else puts(INDENT4 "}");
+ }
else if ((t == EDJE_PART_TYPE_TEXTBLOCK) || (t == EDJE_PART_TYPE_TEXT))
{
if (machine) puts("TEXT-BEGIN");
Eina_Bool alpha;
Eina_Bool print;
Eina_Bool slave_mode;
+ double scale;
char *title;
};
evas_object_size_hint_min_set(stack, minw, minh);
}
+static void
+_key_down(void *data, Evas *e __UNUSED__, Evas_Object *stack __UNUSED__, void *event_info)
+{
+ Evas_Event_Key_Down *ev = event_info;
+ struct opts *opts = data;
+
+ if ((!strcmp(ev->keyname, "equal")) ||
+ (!strcmp(ev->keyname, "plus")))
+ opts->scale += 0.1;
+ else if ((!strcmp(ev->keyname, "minus")) ||
+ (!strcmp(ev->keyname, "underscore")))
+ opts->scale -= 0.1;
+ else if ((!strcmp(ev->keyname, "0")))
+ opts->scale = 1.0;
+ if (opts->scale < 0.1) opts->scale = 0.1;
+ else if (opts->scale > 10.0) opts->scale = 1.0;
+ edje_scale_set(opts->scale);
+}
+
static Evas_Object *
_create_stack(Evas *evas, const struct opts *opts)
{
('p', "print", "Print signals and messages to stdout"),
ECORE_GETOPT_STORE_TRUE
('S', "slave-mode", "Listen for commands on stdin"),
+ ECORE_GETOPT_STORE_DOUBLE
+ ('z', "scale", "Set scale factor"),
ECORE_GETOPT_LICENSE('L', "license"),
ECORE_GETOPT_COPYRIGHT('C', "copyright"),
ECORE_GETOPT_VERSION('V', "version"),
ECORE_GETOPT_VALUE_STR(opts.title),
ECORE_GETOPT_VALUE_BOOL(opts.print),
ECORE_GETOPT_VALUE_BOOL(opts.slave_mode),
+ ECORE_GETOPT_VALUE_DOUBLE(opts.scale),
ECORE_GETOPT_VALUE_BOOL(quit_option),
ECORE_GETOPT_VALUE_BOOL(quit_option),
ECORE_GETOPT_VALUE_BOOL(quit_option),
};
memset(&opts, 0, sizeof(opts));
+ opts.scale = 1.0;
if (!ecore_evas_init())
return EXIT_FAILURE;
}
ecore_app_args_set(argc, (const char **)argv);
+ edje_scale_set(opts.scale);
opts.file = argv[args];
if (opts.list_groups)
goto free_ecore_evas;
}
+ evas_object_focus_set(stack, EINA_TRUE);
+ evas_object_event_callback_add(stack, EVAS_CALLBACK_KEY_DOWN,
+ _key_down, &opts);
evas_object_event_callback_add(stack, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_reset_size_hints, edje);
$(CWARNFLAGS)
DEFS= \
+-DHAVE_CONFIG_H \
-DHAVE_STRERROR \
-DFATAL_EXIT_CODE=1 \
--DSUCCESS_EXIT_CODE=1 \
+-DSUCCESS_EXIT_CODE=0 \
-DGCC_INCLUDE_DIR=\"/usr/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"/usr/include\" \
-DTOOL_INCLUDE_DIR=\"/usr/bin\" \
* You are forbidden to forbid anyone else to use, share and improve
* what you give them. Help stamp out software-hoarding! */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdlib.h>
-#include "config.h"
+
#include "cpplib.h"
static void
* You are forbidden to forbid anyone else to use, share and improve
* what you give them. Help stamp out software-hoarding! */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
-#include "config.h"
+
#include "cpplib.h"
/* Print the file names and line numbers of the #include
/* Parse a C expression from text in a string */
-#include "config.h"
-#include "cpplib.h"
-#include "cpphash.h"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#ifdef __EMX__
-#include <strings.h>
+# include <strings.h>
#endif
#ifdef MULTIBYTE_CHARS
-#include <locale.h>
+# include <locale.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include "cpplib.h"
+#include "cpphash.h"
+
/* This is used for communicating lists of keywords with cccp.c. */
struct arglist {
struct arglist *next;
* You are forbidden to forbid anyone else to use, share and improve
* what you give them. Help stamp out software-hoarding! */
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+#include <stdlib.h>
+
#include "cpplib.h"
#include "cpphash.h"
static HASHNODE *hashtab[HASHSIZE];
-#include <string.h>
-#include <stdlib.h>
-
#define IS_IDCHAR(ch) is_idchar[(unsigned char)(ch)]
/*
* You are forbidden to forbid anyone else to use, share and improve
* what you give them. Help stamp out software-hoarding! */
-const char *version_string = "0.0.0";
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
-#include "config.h"
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+void *alloca (size_t);
+#endif
#ifdef __EMX__
#include <strings.h>
#include "cpplib.h"
#include "cpphash.h"
+const char *version_string = "0.0.0";
+
#ifndef STDC_VALUE
#define STDC_VALUE 1
#endif
#include <stdio.h>
#include <string.h>
#include <signal.h>
-#ifdef __STDC__
#include <stdlib.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef USG
#include <time.h>
#include <sys/time.h> /* for __DATE__ and __TIME__ */
-#include <sys/resource.h>
+#ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
#else
#include <sys/param.h> /* CYGNUS LOCAL: shebs -noquiet */
#include <sys/times.h>
}
else if (c == '@' && CPP_BUFFER(pfile)->has_escapes
&& is_hor_space[PEEKN(1)])
- FORWARD(2);
+ FORWARD(1);
else
return;
}
continue;
if (i < nargs || (nargs == 0 && i == 0))
{
+ unsigned char *bp;
+
/* if we are working on last arg which absorbs rest of args... */
if (i == nargs - 1 && defn->rest_args)
rest_args = 1;
token = macarg(pfile, rest_args);
args[i].raw_length = CPP_WRITTEN(pfile) - args[i].raw;
args[i].newlines = 0; /* FIXME */
+ bp = ARG_BASE + args[i].raw;
+ while (is_space[(unsigned char)(*bp)]) { bp++; }
+ args[i].raw_length -= bp - (ARG_BASE + args[i].raw);
+ args[i].raw = bp - ARG_BASE;
+ if (args[i].raw_length > 0)
+ {
+ bp = ARG_BASE + args[i].raw + args[i].raw_length - 1;
+ while (is_space[(unsigned char)(*bp)])
+ {
+ bp--;
+ args[i].raw_length--;
+ if (args[i].raw_length < 1) break;
+ }
+ }
}
else
token = macarg(pfile, 0);
if (totlen > xbuf_len)
abort();
}
-
/* if there is anything left of the definition
* after handling the arg list, copy that in too. */
xbuf[totlen] = 0;
xbuf_len = totlen;
-
}
pfile->output_escapes--;
}
else if (CPP_TRADITIONAL(pfile))
{
- return CPP_COMMENT;
+ if (newlines > 0)
+ {
+ output_line_command(pfile, 0, same_file);
+ return CPP_VSPACE;
+ }
+ else
+ {
+ return CPP_COMMENT;
+ }
+ }
+ else if (newlines > 0)
+ {
+ output_line_command(pfile, 0, same_file);
+ CPP_RESERVE(pfile, 1);
+ CPP_PUTC_Q(pfile, ' ');
+ return CPP_VSPACE;
}
else
{
c = GETC();
if (c == '-')
{
+#if 1 // fix macro expansions starting with - losing the -
+ CPP_PUTS(pfile, "-", 1);
+ return CPP_OTHER;
+#else
if (pfile->output_escapes)
CPP_PUTS(pfile, "@-", 2);
parse_name(pfile, GETC());
return CPP_NAME;
+#endif
}
else if (is_space[c])
{
- CPP_RESERVE(pfile, 2);
+ CPP_RESERVE(pfile, 1);
if (pfile->output_escapes)
CPP_PUTC_Q(pfile, '@');
- CPP_PUTC_Q(pfile, c);
return CPP_HSPACE;
}
}
* You are forbidden to forbid anyone else to use, share and improve
* what you give them. Help stamp out software-hoarding! */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include "config.h"
#include "cpplib.h"
#define EPP_DEBUG 0
continue;
case CPP_VSPACE:
- if (!got_text)
- goto next;
break;
default:
#endif
if (!opts->no_output)
{
- size_t n;
+ size_t n;
n = CPP_WRITTEN(&parse_in);
if (fwrite(parse_in.token_buffer, 1, n, stdout) != n)
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);
int bytes;
/* Try to load the file */
- im = evas_object_image_add(ed->evas);
+ im = evas_object_image_add(ed->base.evas);
if (!im) return EINA_FALSE;
evas_object_image_file_set(im, path, NULL);
// pc = ed->collection;
- part_obj = edje_edit_object_add(ed->evas);
+ part_obj = edje_edit_object_add(ed->base.evas);
old = eina_stringshare_add(old_group_name);
rp->part = ep;
if (ep->type == EDJE_PART_TYPE_RECTANGLE)
- rp->object = evas_object_rectangle_add(ed->evas);
- else if (ep->type == EDJE_PART_TYPE_IMAGE)
- rp->object = evas_object_image_add(ed->evas);
+ rp->object = evas_object_rectangle_add(ed->base.evas);
+ else if (ep->type == EDJE_PART_TYPE_IMAGE || ep->type == EDJE_PART_TYPE_PROXY)
+ rp->object = evas_object_image_add(ed->base.evas);
else if (ep->type == EDJE_PART_TYPE_TEXT)
{
_edje_text_part_on_add(ed, rp);
- rp->object = evas_object_text_add(ed->evas);
+ rp->object = evas_object_text_add(ed->base.evas);
evas_object_text_font_source_set(rp->object, ed->path);
}
else if (ep->type == EDJE_PART_TYPE_SWALLOW ||
ep->type == EDJE_PART_TYPE_GROUP ||
ep->type == EDJE_PART_TYPE_EXTERNAL)
{
- rp->object = evas_object_rectangle_add(ed->evas);
+ rp->object = evas_object_rectangle_add(ed->base.evas);
evas_object_color_set(rp->object, 0, 0, 0, 0);
evas_object_pass_events_set(rp->object, 1);
evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
}
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
- rp->object = evas_object_textblock_add(ed->evas);
+ rp->object = evas_object_textblock_add(ed->base.evas);
else
ERR("wrong part type %i!", ep->type);
if (rp->object)
if (child)
_edje_real_part_swallow(rp, child);
}
- evas_object_clip_set(rp->object, ed->clipper);
- evas_object_show(ed->clipper);
+ evas_object_clip_set(rp->object, ed->base.clipper);
+ evas_object_show(ed->base.clipper);
}
/* Update table_parts */
if (real->clip_to == rp)
{
- evas_object_clip_set(real->object, ed->clipper);
+ evas_object_clip_set(real->object, ed->base.clipper);
real->clip_to = NULL;
}
if (real->drag && real->drag->confine_to == rp)
/* if all parts are gone, hide the clipper */
if (ed->table_parts_size == 0)
- evas_object_hide(ed->clipper);
+ evas_object_hide(ed->base.clipper);
edje_object_calc_force(obj);
evas_object_clip_unset(rp->object);
}
- evas_object_clip_set(rp->object, ed->clipper);
+ evas_object_clip_set(rp->object, ed->base.clipper);
if (rp->swallowed_object)
- evas_object_clip_set(rp->swallowed_object, ed->clipper);
+ evas_object_clip_set(rp->swallowed_object, ed->base.clipper);
rp->part->clip_to_id = -1;
rp->clip_to = NULL;
if (source)
{
rp->part->source = eina_stringshare_add(source);
- child_obj = edje_object_add(ed->evas);
+ child_obj = edje_object_add(ed->base.evas);
edje_object_file_set(child_obj, ed->file->path, source);
_edje_real_part_swallow(rp, child_obj);
}
img->image.fill.spread = 0;
img->image.fill.type = EDJE_FILL_TYPE_SCALE;
}
+ else if (rp->part->type == EDJE_PART_TYPE_PROXY)
+ {
+ Edje_Part_Description_Proxy *pro;
+
+ pro = (Edje_Part_Description_Proxy*) pd;
+
+ memset(&pro->proxy, 0, sizeof (pro->proxy));
+
+ pro->proxy.id = -1;
+ pro->proxy.fill.smooth = 1;
+ pro->proxy.fill.pos_rel_x = 0.0;
+ pro->proxy.fill.pos_abs_x = 0;
+ pro->proxy.fill.rel_x = 1.0;
+ pro->proxy.fill.abs_x = 0;
+ pro->proxy.fill.pos_rel_y = 0.0;
+ pro->proxy.fill.pos_abs_y = 0;
+ pro->proxy.fill.rel_y = 1.0;
+ pro->proxy.fill.abs_y = 0;
+ pro->proxy.fill.angle = 0;
+ pro->proxy.fill.spread = 0;
+ pro->proxy.fill.type = EDJE_FILL_TYPE_SCALE;
+ }
else if (rp->part->type == EDJE_PART_TYPE_EXTERNAL)
{
Edje_Part_Description_External *external;
switch (rp->part->type)
{
+ case EDJE_PART_TYPE_PROXY:
+ {
+ Edje_Part_Description_Proxy *pro_to = (Edje_Part_Description_Proxy*) pdto;
+ Edje_Part_Description_Proxy *pro_from = (Edje_Part_Description_Proxy*) pdfrom;
+
+ pro_to->proxy = pro_from->proxy;
+
+ break;
+ }
case EDJE_PART_TYPE_IMAGE:
{
Edje_Part_Description_Image *img_to = (Edje_Part_Description_Image*) pdto;
EAPI double \
edje_edit_state_fill_##Type##_relative_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
{ \
- Edje_Part_Description_Image *img; \
- \
eina_error_set(0); \
\
GET_PD_OR_RETURN(0); \
\
- if (rp->part->type != EDJE_PART_TYPE_IMAGE) \
- return 0; \
+ switch (rp->part->type) \
+ { \
+ case EDJE_PART_TYPE_IMAGE: \
+ { \
+ Edje_Part_Description_Image *img; \
+ \
+ img = (Edje_Part_Description_Image*) pd; \
\
- img = (Edje_Part_Description_Image*) pd; \
+ return TO_DOUBLE(img->image.fill.Class##rel_##Value); \
+ } \
+ case EDJE_PART_TYPE_PROXY: \
+ { \
+ Edje_Part_Description_Proxy *pro; \
\
- return TO_DOUBLE(img->image.fill.Class##rel_##Value); \
+ pro = (Edje_Part_Description_Proxy*) pd; \
+ \
+ return TO_DOUBLE(pro->proxy.fill.Class##rel_##Value); \
+ } \
+ } \
+ \
+ return 0; \
} \
EAPI void \
edje_edit_state_fill_##Type##_relative_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
{ \
- Edje_Part_Description_Image *img; \
- \
eina_error_set(0); \
\
GET_PD_OR_RETURN(); \
\
- if (rp->part->type != EDJE_PART_TYPE_IMAGE) \
- return; \
+ switch (rp->part->type) \
+ { \
+ case EDJE_PART_TYPE_IMAGE: \
+ { \
+ Edje_Part_Description_Image *img; \
+ \
+ img = (Edje_Part_Description_Image*) pd; \
+ \
+ img->image.fill.Class##rel_##Value = FROM_DOUBLE(v); \
+ \
+ break; \
+ } \
+ case EDJE_PART_TYPE_PROXY: \
+ { \
+ Edje_Part_Description_Proxy *pro; \
+ \
+ pro = (Edje_Part_Description_Proxy*) pd; \
\
- img = (Edje_Part_Description_Image*) pd; \
+ pro->proxy.fill.Class##rel_##Value = FROM_DOUBLE(v); \
+ \
+ break; \
+ } \
+ default: \
+ return; \
+ } \
\
- img->image.fill.Class##rel_##Value = FROM_DOUBLE(v); \
edje_object_calc_force(obj); \
}
EAPI int \
edje_edit_state_fill_##Type##_offset_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
{ \
- Edje_Part_Description_Image *img; \
- \
eina_error_set(0); \
\
GET_PD_OR_RETURN(0); \
\
- if (rp->part->type != EDJE_PART_TYPE_IMAGE) \
- return 0; \
+ switch (rp->part->type) \
+ { \
+ case EDJE_PART_TYPE_IMAGE: \
+ { \
+ Edje_Part_Description_Image *img; \
+ \
+ img = (Edje_Part_Description_Image*) pd; \
+ \
+ return img->image.fill.Class##abs_##Value; \
+ } \
+ case EDJE_PART_TYPE_PROXY: \
+ { \
+ Edje_Part_Description_Proxy *pro; \
\
- img = (Edje_Part_Description_Image*) pd; \
+ pro = (Edje_Part_Description_Proxy*) pd; \
\
- return img->image.fill.Class##abs_##Value; \
+ return pro->proxy.fill.Class##abs_##Value; \
+ } \
+ } \
+ return 0; \
} \
EAPI void \
edje_edit_state_fill_##Type##_offset_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
{ \
- Edje_Part_Description_Image *img; \
- \
eina_error_set(0); \
\
GET_PD_OR_RETURN(); \
\
- if (rp->part->type != EDJE_PART_TYPE_IMAGE) \
- return; \
+ switch (rp->part->type) \
+ { \
+ case EDJE_PART_TYPE_IMAGE: \
+ { \
+ Edje_Part_Description_Image *img; \
\
- img = (Edje_Part_Description_Image*) pd; \
+ img = (Edje_Part_Description_Image*) pd; \
+ \
+ img->image.fill.Class##abs_##Value = FROM_DOUBLE(v); \
+ return; \
+ } \
+ case EDJE_PART_TYPE_PROXY: \
+ { \
+ Edje_Part_Description_Proxy *pro; \
+ \
+ pro = (Edje_Part_Description_Proxy*) pd; \
+ \
+ pro->proxy.fill.Class##abs_##Value = FROM_DOUBLE(v); \
+ return; \
+ } \
+ default: \
+ return; \
+ } \
\
- img->image.fill.Class##abs_##Value = FROM_DOUBLE(v); \
edje_object_calc_force(obj); \
}
//Fill
BUF_APPEND(I5"fill {\n");
- if (rp->part->type == EDJE_PART_TYPE_IMAGE && !img->image.fill.smooth)
+ if (!img->image.fill.smooth)
BUF_APPEND(I6"smooth: 0;\n");
//TODO Support spread
BUF_APPEND(I5"}\n");
}
+ if (rp->part->type == EDJE_PART_TYPE_PROXY)
+ {
+ Edje_Part_Description_Proxy *pro;
+
+ pro = (Edje_Part_Description_Proxy *) pd;
+
+ //Fill
+
+ BUF_APPEND(I5"fill {\n");
+ if (!pro->proxy.fill.smooth)
+ BUF_APPEND(I6"smooth: 0;\n");
+ //TODO Support spread
+ //TODO Support source
+
+ if (pro->proxy.fill.pos_rel_x || pro->proxy.fill.pos_rel_y ||
+ pro->proxy.fill.pos_abs_x || pro->proxy.fill.pos_abs_y)
+ {
+ BUF_APPEND(I6"origin {\n");
+ if (pro->proxy.fill.pos_rel_x || pro->proxy.fill.pos_rel_y)
+ BUF_APPENDF(I7"relative: %g %g;\n", TO_DOUBLE(pro->proxy.fill.pos_rel_x), TO_DOUBLE(pro->proxy.fill.pos_rel_y));
+ if (pro->proxy.fill.pos_abs_x || pro->proxy.fill.pos_abs_y)
+ BUF_APPENDF(I7"offset: %d %d;\n", pro->proxy.fill.pos_abs_x, pro->proxy.fill.pos_abs_y);
+ BUF_APPEND(I6"}\n");
+ }
+
+ if (TO_DOUBLE(pro->proxy.fill.rel_x) != 1.0 || TO_DOUBLE(pro->proxy.fill.rel_y) != 1.0 ||
+ pro->proxy.fill.abs_x || pro->proxy.fill.abs_y)
+ {
+ BUF_APPEND(I6"size {\n");
+ if (pro->proxy.fill.rel_x != 1.0 || pro->proxy.fill.rel_y != 1.0)
+ BUF_APPENDF(I7"relative: %g %g;\n", TO_DOUBLE(pro->proxy.fill.rel_x), TO_DOUBLE(pro->proxy.fill.rel_y));
+ if (pro->proxy.fill.abs_x || pro->proxy.fill.abs_y)
+ BUF_APPENDF(I7"offset: %d %d;\n", pro->proxy.fill.abs_x, pro->proxy.fill.abs_y);
+ BUF_APPEND(I6"}\n");
+ }
+
+ BUF_APPEND(I5"}\n");
+ }
+
//Text
if (rp->part->type == EDJE_PART_TYPE_TEXT)
{
Edje_Part_Collection *pc;
Eina_Bool ret = EINA_TRUE;
- obj = edje_edit_object_add(ed->evas);
+ obj = edje_edit_object_add(ed->base.evas);
if (!edje_object_file_set(obj, ed->file->path, group)) return EINA_FALSE;
ef = eet_open(ed->file->path, EET_FILE_MODE_READ);
CHKPARAM(2);
ed = embryo_program_data_get(ep);
- evas_pointer_canvas_xy_get(ed->evas, &x, &y);
+ evas_pointer_canvas_xy_get(ed->base.evas, &x, &y);
x -= ed->x;
y -= ed->y;
SETINT((int)x, params[1]);
CHKPARAM(0);
ed = embryo_program_data_get(ep);
- return evas_pointer_button_down_mask_get(ed->evas);
+ return evas_pointer_button_down_mask_get(ed->base.evas);
}
/* emit(sig[], src[]) */
rp = ed->table_parts[part_id % ed->table_parts_size];
if (!rp) return 0;
- new_obj = edje_object_add(ed->evas);
+ new_obj = edje_object_add(ed->base.evas);
if (!new_obj) return 0;
if (!edje_object_file_set(new_obj, ed->file->path, group_name))
sel = calloc(1, sizeof(Sel));
en->sel = eina_list_append(en->sel, sel);
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source);
evas_object_smart_member_add(ob, smart);
evas_object_stack_below(ob, o);
sel->obj_bg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg);
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
if (en->rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE)
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source6);
else
sel = calloc(1, sizeof(Sel));
an->sel = eina_list_append(an->sel, sel);
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source5);
evas_object_smart_member_add(ob, smart);
evas_object_stack_below(ob, o);
evas_object_show(ob);
sel->obj_bg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg);
-
- ob = edje_object_add(en->rp->edje->evas);
+
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source6);
evas_object_smart_member_add(ob, smart);
evas_object_stack_above(ob, o);
evas_object_show(ob);
sel->obj_fg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_fg);
-
- ob = evas_object_rectangle_add(en->rp->edje->evas);
+
+ ob = evas_object_rectangle_add(en->rp->edje->base.evas);
evas_object_color_set(ob, 0, 0, 0, 0);
evas_object_smart_member_add(ob, smart);
evas_object_stack_above(ob, o);
evas_object_event_callback_add(ed->obj, EVAS_CALLBACK_FOCUS_OUT, _edje_focus_out_cb, ed);
evas_object_event_callback_add(ed->obj, EVAS_CALLBACK_KEY_DOWN, _edje_key_down_cb, ed);
evas_object_event_callback_add(ed->obj, EVAS_CALLBACK_KEY_UP, _edje_key_up_cb, ed);
- evas_event_callback_add(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed);
- evas_event_callback_add(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed);
+ evas_event_callback_add(ed->base.evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed);
+ evas_event_callback_add(ed->base.evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed);
}
void
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_FOCUS_OUT, _edje_focus_out_cb);
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_KEY_DOWN, _edje_key_down_cb);
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_KEY_UP, _edje_key_up_cb);
- if (evas_event_callback_del_full(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed) != ed)
+ if (evas_event_callback_del_full(ed->base.evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed) != ed)
ERR("could not unregister EVAS_CALLBACK_FOCUS_IN");
- if (evas_event_callback_del_full(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed) != ed)
+ if (evas_event_callback_del_full(ed->base.evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed) != ed)
ERR("could not unregister EVAS_CALLBACK_FOCUS_OUT");
}
evas_object_textblock_replace_char_set(rp->object, "*");
}
- en->cursor_bg = edje_object_add(rp->edje->evas);
+ en->cursor_bg = edje_object_add(rp->edje->base.evas);
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE)
edje_object_file_set(en->cursor_bg, rp->edje->path, rp->part->source6);
else
evas_object_pass_events_set(en->cursor_bg, EINA_TRUE);
rp->edje->subobjs = eina_list_append(rp->edje->subobjs, en->cursor_bg);
- en->cursor_fg = edje_object_add(rp->edje->evas);
+ en->cursor_fg = edje_object_add(rp->edje->base.evas);
edje_object_file_set(en->cursor_fg, rp->edje->path, rp->part->source4);
evas_object_smart_member_add(en->cursor_fg, rp->edje->obj);
evas_object_stack_above(en->cursor_fg, rp->object);
smart = evas_object_smart_parent_get(rp->object);
evas_object_hide(en->cursor_fg);
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source2);
bh_position = edje_object_data_get(ob, "position");
if ((!bh_position) || (bh_position[0] == 0)) bh_position = "BOTH";
if ((!strcmp(bh_position, "TOP")) || (!strcmp(bh_position, "BOTH")))
{
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source3);
evas_object_layer_set(ob, EVAS_LAYER_MAX - 2);
en->block_handler_top = ob;
if ((!strcmp(bh_position, "BOTTOM")) || (!strcmp(bh_position, "BOTH")))
{
- ob = edje_object_add(en->rp->edje->evas);
+ ob = edje_object_add(en->rp->edje->base.evas);
edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source2);
evas_object_layer_set(ob, EVAS_LAYER_MAX - 2);
en->block_handler_btm = ob;
if (!en->imf_context) goto done;
ecore_imf_context_client_window_set(en->imf_context, rp->object);
- ecore_imf_context_client_canvas_set(en->imf_context, rp->edje->evas);
+ ecore_imf_context_client_canvas_set(en->imf_context, rp->edje->base.evas);
ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context,
_edje_entry_imf_retrieve_surrounding_cb, rp->edje);
switch (ep->type)
{
case EDJE_PART_TYPE_RECTANGLE:
- rp->object = evas_object_rectangle_add(ed->evas);
+ rp->object = evas_object_rectangle_add(ed->base.evas);
break;
+ case EDJE_PART_TYPE_PROXY:
case EDJE_PART_TYPE_IMAGE:
- rp->object = evas_object_image_add(ed->evas);
+ rp->object = evas_object_image_add(ed->base.evas);
break;
case EDJE_PART_TYPE_TEXT:
_edje_text_part_on_add(ed, rp);
- rp->object = evas_object_text_add(ed->evas);
+ rp->object = evas_object_text_add(ed->base.evas);
evas_object_text_font_source_set(rp->object, ed->path);
break;
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
case EDJE_PART_TYPE_EXTERNAL:
- rp->object = evas_object_rectangle_add(ed->evas);
+ rp->object = evas_object_rectangle_add(ed->base.evas);
evas_object_color_set(rp->object, 0, 0, 0, 0);
evas_object_pass_events_set(rp->object, 1);
evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
_edje_callbacks_focus_add(rp->object, ed, rp);
break;
case EDJE_PART_TYPE_TEXTBLOCK:
- rp->object = evas_object_textblock_add(ed->evas);
+ rp->object = evas_object_textblock_add(ed->base.evas);
break;
case EDJE_PART_TYPE_BOX:
- rp->object = evas_object_box_add(ed->evas);
+ rp->object = evas_object_box_add(ed->base.evas);
rp->anim = _edje_box_layout_anim_new(rp->object);
break;
case EDJE_PART_TYPE_TABLE:
- rp->object = evas_object_table_add(ed->evas);
+ rp->object = evas_object_table_add(ed->base.evas);
break;
case EDJE_PART_TYPE_GRADIENT:
ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
evas_object_precise_is_inside_set(rp->object, 1);
}
if (rp->part->clip_to_id < 0)
- evas_object_clip_set(rp->object, ed->clipper);
+ evas_object_clip_set(rp->object, ed->base.clipper);
}
}
if (n > 0)
#ifdef EDJE_CALC_CACHE
ed->all_part_change = 1;
#endif
- if ((evas_object_clipees_get(ed->clipper)) &&
+ if ((evas_object_clipees_get(ed->base.clipper)) &&
(evas_object_visible_get(obj)))
- evas_object_show(ed->clipper);
+ evas_object_show(ed->base.clipper);
/* instantiate 'internal swallows' */
for (i = 0; i < ed->table_parts_size; i++)
}
}
- child_obj = edje_object_add(ed->evas);
+ child_obj = edje_object_add(ed->base.evas);
group_path = eina_list_append(group_path, group_path_entry);
if (!_edje_object_file_set_internal(child_obj, file, source, group_path))
{
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);
elo->obj.is_evas_obj = 1;
elo->evas_obj = evas_object_rectangle_add(evas_object_evas_get(ed->obj));
evas_object_smart_member_add(elo->evas_obj, ed->obj);
- evas_object_clip_set(elo->evas_obj, ed->clipper);
+ evas_object_clip_set(elo->evas_obj, ed->base.clipper);
evas_object_move(elo->evas_obj, ed->x, ed->y);
evas_object_resize(elo->evas_obj, 0, 0);
evas_object_data_set(elo->evas_obj, ELO, elo);
void
_edje_clean_objects(Edje *ed)
{
- evas_object_del(ed->clipper);
- ed->evas = NULL;
+ evas_object_del(ed->base.clipper);
+ ed->base.evas = NULL;
ed->obj = NULL;
- ed->clipper = NULL;
+ ed->base.clipper = NULL;
}
void
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;
typedef Eina_Bool(*Edje_elm_function) (void *data, void *input_data);
struct _Edje
{
+ Evas_Object_Smart_Clipped_Data base;
+ /* This contains (or should):
+ Evas_Object *clipper; // a big rect to clip this Edje to
+ Evas *evas; // the Evas this Edje belongs to
+ */
const Edje_Smart_Api *api;
const char *path;
const char *group;
Evas_Coord x, y, w, h;
Edje_Size min;
double paused_at;
- Evas *evas; /* the Evas this Edje belongs to */
Evas_Object *obj; /* the smart object */
- Evas_Object *clipper; /* a big rect to clip this Edje to */
Edje_File *file; /* the file the data comes form */
Edje_Part_Collection *collection; /* the description being used */
Eina_List *actions; /* currently running actions */
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;
Edje_Real_Part *_edje_real_part_get(const Edje *ed, const char *part);
Edje_Real_Part *_edje_real_part_recursive_get(const Edje *ed, const char *part);
-Edje *_edje_recursive_get(Edje *ed, const char *part, Edje_Real_Part **orp);
Edje_Color_Class *_edje_color_class_find(Edje *ed, const char *color_class);
void _edje_color_class_member_add(Edje *ed, const char *color_class);
void _edje_color_class_member_del(Edje *ed, const char *color_class);
void _edje_text_class_members_free(void);
void _edje_text_class_hash_free(void);
-Edje *_edje_fetch(const Evas_Object *obj);
+Edje *_edje_fetch(const Evas_Object *obj) EINA_PURE;
int _edje_freeze(Edje *ed);
int _edje_thaw(Edje *ed);
int _edje_block(Edje *ed);
if (ed->delete_me) return;
- sep = strrchr(sig, EDJE_PART_PATH_SEPARATOR);
+ sep = strchr(sig, EDJE_PART_PATH_SEPARATOR);
/* If we are not sending the signal to a part of the child, the
* signal if for ourself
if (sep)
{
Edje_Real_Part *rp = NULL;
+ const char *newsig;
Edje *ed2;
- char *newsig;
- size_t length;
char *part;
+ char *idx;
+ size_t length;
- /* the signal contains a colon, split the signal into "parts:signal",
- * use _edje_real_part_recursive_get_helper to find the real part.
- */
- length = strlen(sig) + 1;
+ /* the signal contains a colon, split the signal into "parts:signal" */
+ length = sep - sig + 1;
part = alloca(length);
- memcpy(part, sig, length);
-
- newsig = part + (sep - sig);
+ memcpy(part, sig, length - 1);
+ part[length - 1] = '\0';
- *newsig = '\0';
- newsig++;
+ newsig = sep + 1;
- ed2 = _edje_recursive_get(ed, part, &rp);
- if (ed2 && ed2 != ed)
+ /* lookup for alias */
+ if (ed->collection && ed->collection->alias)
{
- _edje_emit(ed2, newsig, src);
+ char *alias;
+
+ alias = eina_hash_find(ed->collection->alias, part);
+ if (alias) {
+ char *aliased;
+ int alien;
+ int nslen;
+
+ alien = strlen(alias);
+ nslen = strlen(newsig);
+ length = alien + nslen + 2;
+
+ aliased = alloca(length);
+ memcpy(aliased, alias, alien);
+ aliased[alien] = EDJE_PART_PATH_SEPARATOR;
+ memcpy(aliased + alien + 1, newsig, nslen + 1);
+
+ _edje_emit(ed, aliased, src);
+ return;
+ }
}
- else if (rp)
+
+ /* search for the index if present and remove it from the part */
+ idx = strchr(part, EDJE_PART_PATH_SEPARATOR_INDEXL);
+ if (idx)
{
- switch (rp->part->type)
+ char *end;
+
+ end = strchr(idx + 1, EDJE_PART_PATH_SEPARATOR_INDEXR);
+ if (end && end != idx + 1)
{
- case EDJE_PART_TYPE_EXTERNAL:
- if (!rp->swallowed_object) break ;
+ char *tmp;
- _edje_external_signal_emit(rp->swallowed_object, newsig, src);
- break ;
- case EDJE_PART_TYPE_BOX:
- case EDJE_PART_TYPE_TABLE:
- _edje_emit(rp->edje, newsig, src);
- break ;
- case EDJE_PART_TYPE_GROUP:
- if (!rp->swallowed_object) break;
+ tmp = alloca(end - idx - 1);
+ memcpy(tmp, idx + 1, end - idx - 1);
+ tmp[end - idx - 1] = '\0';
+ *idx = '\0';
+ idx = tmp;
+ }
+ else
+ {
+ idx = NULL;
+ }
+ }
- ed2 = _edje_fetch(rp->swallowed_object);
- if (!ed2) break;
+ /* search for the right part now */
+ rp = _edje_real_part_get(ed, part);
+ if (!rp) goto end;
+ switch (rp->part->type)
+ {
+ case EDJE_PART_TYPE_GROUP:
+ if (!rp->swallowed_object) goto end;
+ ed2 = _edje_fetch(rp->swallowed_object);
+ if (!ed2) goto end;
+
+ _edje_emit(ed2, newsig, src);
+ break;
+
+ case EDJE_PART_TYPE_EXTERNAL:
+ if (!rp->swallowed_object) break ;
+
+ if (!idx)
+ {
+ _edje_external_signal_emit(rp->swallowed_object, newsig, src);
+ }
+ else
+ {
+ Evas_Object *child;
+
+ child = _edje_children_get(rp, idx);
+ ed2 = _edje_fetch(child);
+ if (!ed2) goto end;
_edje_emit(ed2, newsig, src);
- break ;
- default:
- fprintf(stderr, "SPANK SPANK SPANK !!!\nYou should never be here !\n");
- break;
- }
+ }
+ break ;
+
+ case EDJE_PART_TYPE_BOX:
+ case EDJE_PART_TYPE_TABLE:
+ if (idx)
+ {
+ Evas_Object *child;
+
+ child = _edje_children_get(rp, idx);
+ ed2 = _edje_fetch(child);
+ if (!ed2) goto end;
+ _edje_emit(ed2, newsig, src);
+ }
+ break ;
+
+ default:
+ fprintf(stderr, "SPANK SPANK SPANK !!!\nYou should never be here !\n");
+ break;
}
}
+ end:
emsg.sig = sig;
emsg.src = src;
_edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg);
oi->ed = ed;
oi->obj = o;
evas_object_smart_member_add(oi->obj, oi->ed->obj);
- evas_object_clip_set(oi->obj, oi->ed->clipper);
+ evas_object_clip_set(oi->obj, oi->ed->base.clipper);
evas_object_geometry_get(oi->obj, &(oi->x), &(oi->y), &(oi->w), &(oi->h));
snprintf(buf, sizeof(buf), "%i", oi->oid);
if (!si->oid.hash)
static void _edje_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h);
static void _edje_smart_show(Evas_Object * obj);
static void _edje_smart_hide(Evas_Object * obj);
-static void _edje_smart_color_set(Evas_Object * obj, int r, int g, int b, int a);
-static void _edje_smart_clip_set(Evas_Object * obj, Evas_Object * clip);
-static void _edje_smart_clip_unset(Evas_Object * obj);
static void _edje_smart_calculate(Evas_Object * obj);
static Eina_Bool _edje_smart_file_set(Evas_Object *obj, const char *file, const char *group);
static Edje_Smart_Api _edje_smart_class = EDJE_SMART_API_INIT_NAME_VERSION("edje");
+static Evas_Smart_Class _edje_smart_parent;
static Evas_Smart *_edje_smart = NULL;
Eina_List *_edje_edjes = NULL;
EAPI Evas_Object *
edje_object_add(Evas *evas)
{
- Edje *ed;
Evas_Object *e;
+
if (!_edje_smart)
{
+ memset(&_edje_smart_parent, 0, sizeof(_edje_smart_parent));
_edje_object_smart_set(&_edje_smart_class);
- _edje_smart = evas_smart_class_new((Evas_Smart_Class *)&_edje_smart_class);
+ _edje_smart =
+ evas_smart_class_new((Evas_Smart_Class *)&_edje_smart_class);
}
e = evas_object_smart_add(evas, _edje_smart);
- ed = _edje_fetch(e);
return e;
}
if (!sc)
return;
+ evas_object_smart_clipped_smart_set(&sc->base);
+
+ _edje_smart_parent.add = sc->base.add; /* Save parent class */
sc->base.add = _edje_smart_add;
+ _edje_smart_parent.del = sc->base.del; /* Save parent class */
sc->base.del = _edje_smart_del;
+ /* we'll handle move thank you */
sc->base.move = _edje_smart_move;
sc->base.resize = _edje_smart_resize;
+ _edje_smart_parent.show = sc->base.show; /* Save parent class */
sc->base.show = _edje_smart_show;
+ _edje_smart_parent.hide = sc->base.hide; /* Save parent class */
sc->base.hide = _edje_smart_hide;
- sc->base.color_set = _edje_smart_color_set;
- sc->base.clip_set = _edje_smart_clip_set;
- sc->base.clip_unset = _edje_smart_clip_unset;
sc->base.calculate = _edje_smart_calculate;
- sc->base.member_add = NULL;
- sc->base.member_del = NULL;
+ //sc->base.member_add = NULL;
+ //sc->base.member_del = NULL;
sc->file_set = _edje_smart_file_set;
}
evas_object_smart_data_set(obj, ed);
}
- ed->evas = evas_object_evas_get(obj);
- ed->clipper = evas_object_rectangle_add(ed->evas);
- evas_object_static_clip_set(ed->clipper, 1);
- evas_object_smart_member_add(ed->clipper, obj);
- evas_object_color_set(ed->clipper, 255, 255, 255, 255);
- evas_object_move(ed->clipper, -10000, -10000);
- evas_object_resize(ed->clipper, 20000, 20000);
- evas_object_pass_events_set(ed->clipper, 1);
+ ed->base.evas = evas_object_evas_get(obj);
+ ed->base.clipper = evas_object_rectangle_add(ed->base.evas);
+ evas_object_static_clip_set(ed->base.clipper, 1);
+ evas_object_smart_member_add(ed->base.clipper, obj);
+ evas_object_color_set(ed->base.clipper, 255, 255, 255, 255);
+ evas_object_move(ed->base.clipper, -10000, -10000);
+ evas_object_resize(ed->base.clipper, 20000, 20000);
+ evas_object_pass_events_set(ed->base.clipper, 1);
ed->is_rtl = EINA_FALSE;
ed->have_objects = 1;
ed->references = 1;
{
Edje *ed;
+ _edje_smart_parent.show(obj);
ed = evas_object_smart_data_get(obj);
if (!ed) return;
if (evas_object_visible_get(obj)) return;
- if (evas_object_visible_get(ed->clipper)) return;
- if ((ed->collection) && (evas_object_clipees_get(ed->clipper)))
- evas_object_show(ed->clipper);
if (_edje_script_only(ed))
{
_edje_script_only_show(ed);
{
Edje *ed;
+ _edje_smart_parent.hide(obj);
ed = evas_object_smart_data_get(obj);
if (!ed) return;
if (!evas_object_visible_get(obj)) return;
- if (!evas_object_visible_get(ed->clipper)) return;
- if ((ed->collection) && (evas_object_clipees_get(ed->clipper)))
- evas_object_hide(ed->clipper);
if (_edje_script_only(ed))
{
_edje_script_only_hide(ed);
}
static void
-_edje_smart_color_set(Evas_Object * obj, int r, int g, int b, int a)
-{
- Edje *ed;
-
- ed = evas_object_smart_data_get(obj);
- if (!ed) return;
- evas_object_color_set(ed->clipper, r, g, b, a);
-// _edje_emit(ed, "color_set", NULL);
-}
-
-static void
-_edje_smart_clip_set(Evas_Object * obj, Evas_Object * clip)
-{
- Edje *ed;
-
- ed = evas_object_smart_data_get(obj);
- if (!ed) return;
- if (evas_object_clip_get(obj) == clip) return;
- evas_object_clip_set(ed->clipper, clip);
-// _edje_emit(ed, "clip_set", NULL);
-}
-
-static void
-_edje_smart_clip_unset(Evas_Object * obj)
-{
- Edje *ed;
-
- ed = evas_object_smart_data_get(obj);
- if (!ed) return;
- if (!evas_object_clip_get(obj)) return;
- evas_object_clip_unset(ed->clipper);
-// _edje_emit(ed, "clip_unset", NULL);
-}
-
-static void
_edje_smart_calculate(Evas_Object *obj)
{
Edje *ed;
static void _edje_object_signal_preload_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
Edje_Real_Part *_edje_real_part_recursive_get_helper(const Edje *ed, char **path);
-static Edje *_edje_recursive_get_helper(Edje *ed, char **path, Edje_Real_Part **orp);
/************************** API Routines **************************/
}
/**
- * @brief XX
+ * @brief Advances the cursor to the next cursor position.
+ * @see evas_textblock_cursor_char_next
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur The edje cursor to advance
*/
EAPI Eina_Bool
edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Moves the cursor to the previous char
+ * @see evas_textblock_cursor_char_prev
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur the edje cursor to work on
*/
EAPI Eina_Bool
edje_object_part_text_cursor_prev(Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Move the cursor to the char above the current cursor position.
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur the edje cursor to work on
*/
EAPI Eina_Bool
edje_object_part_text_cursor_up(Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Moves the cursor to the char below the current cursor position.
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur the edje cursor to work on
*/
EAPI Eina_Bool
edje_object_part_text_cursor_down(Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Moves the cursor to the beginning of the text part
+ * @see evas_textblock_cursor_paragraph_first
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur the edje cursor to work on
*/
EAPI void
edje_object_part_text_cursor_begin_set(Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Moves the cursor to the end of the text part.
+ * @see evas_textblock_cursor_paragraph_last
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur the edje cursor to work on
*/
EAPI void
edje_object_part_text_cursor_end_set(Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Copy the cursor to another cursor.
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param sry the cursor to copy from
+ * @param dst the cursor to copy to
*/
EAPI void
edje_object_part_text_cursor_copy(Evas_Object *obj, const char *part, Edje_Cursor src, Edje_Cursor dst)
}
/**
- * @brief XX
+ * @brief Move the cursor to the beginning of the line.
+ * @see evas_textblock_cursor_line_char_first
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur the edje cursor to work on
*/
EAPI void
edje_object_part_text_cursor_line_begin_set(Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Move the cursor to the end of the line.
+ * @see evas_textblock_cursor_line_char_last
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur the edje cursor to work on
*/
EAPI void
edje_object_part_text_cursor_line_end_set(Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Returns whether the cursor points to a format.
+ * @see evas_textblock_cursor_is_format
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur The cursor to adjust.
+ * @return EINA_TRUE if it's true, EINA_FALSE otherwise.
*/
EAPI Eina_Bool
edje_object_part_text_cursor_is_format_get(const Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Return true if the cursor points to a visible format
+ * For example \t, \n, item and etc.
+ * @see evas_textblock_cursor_format_is_visible_get
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur The cursor to adjust.
*/
EAPI Eina_Bool
edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const char *part, Edje_Cursor cur)
}
/**
- * @brief XX
+ * @brief Returns the content (char) at the cursor position.
+ * @see evas_textblock_cursor_content_get
*
* @param obj A valid Evas_Object handle
* @param part The part name
+ * @param cur The cursor to use
*/
EAPI const char *
edje_object_part_text_cursor_content_get(const Evas_Object *obj, const char *part, Edje_Cursor cur)
return rp;
}
-Edje *
-_edje_recursive_get(Edje *ed, const char *part, Edje_Real_Part **orp)
-{
- Edje *oed;
- char **path;
-
- path = eina_str_split(part, EDJE_PART_PATH_SEPARATOR_STRING, 0);
- if (!path) return NULL;
-
- oed = _edje_recursive_get_helper(ed, path, orp);
-
- free(*path);
- free(path);
- return oed;
-}
-
Evas_Object *
_edje_children_get(Edje_Real_Part *rp, const char *partid)
{
}
/* Private Routines */
-static Edje *
-_edje_recursive_get_helper(Edje *ed, char **path, Edje_Real_Part **orp)
-{
- Evas_Object *child;
- Edje_Real_Part *rp;
- char *idx = NULL;
-
- if (!path[0])
- return NULL;
-
- if (ed->collection && ed->collection->alias)
- {
- char *alias;
-
- alias = _edje_merge_path(eina_hash_find(ed->collection->alias, path[0]), path + 1);
- if (alias) {
- Edje *tmp;
-
- tmp = _edje_recursive_get(ed, alias, orp);
- free(alias);
- return tmp;
- }
- }
-
- //printf(" lookup: %s on %s\n", path[0], ed->parent ? ed->parent : "-");
- idx = strchr(path[0], EDJE_PART_PATH_SEPARATOR_INDEXL);
- if (idx)
- {
- char *end;
-
- end = strchr(idx + 1, EDJE_PART_PATH_SEPARATOR_INDEXR);
- if (end)
- {
- *end = '\0';
- *idx = '\0';
- idx++;
- }
- }
-
- rp = _edje_real_part_get(ed, path[0]);
- if (!rp) return NULL;
-
- if (!path[1] && !idx)
- {
- *orp = rp;
- return rp->edje;
- }
-
- switch (rp->part->type)
- {
- case EDJE_PART_TYPE_GROUP:
- if (!rp->swallowed_object) return NULL;
- ed = _edje_fetch(rp->swallowed_object);
- if (!ed) return NULL;
- path++;
-
- if (!path[0]) return ed;
- return _edje_recursive_get_helper(ed, path, orp);
- case EDJE_PART_TYPE_BOX:
- case EDJE_PART_TYPE_TABLE:
- case EDJE_PART_TYPE_EXTERNAL:
- if (!idx)
- {
- *orp = rp;
- return NULL;
- }
- path++;
-
- child = _edje_children_get(rp, idx);
-
- ed = _edje_fetch(child);
- if (!ed) return NULL;
- if (!path[0]) return ed;
- return _edje_recursive_get_helper(ed, path, orp);
- default:
- return NULL;
- }
-}
-
Edje_Real_Part *
_edje_real_part_get(const Edje *ed, const char *part)
{
evas_object_smart_member_add(rp->swallowed_object, rp->edje->obj);
if (rp->clip_to)
evas_object_clip_set(rp->swallowed_object, rp->clip_to->object);
- else evas_object_clip_set(rp->swallowed_object, rp->edje->clipper);
+ else evas_object_clip_set(rp->swallowed_object, rp->edje->base.clipper);
evas_object_stack_above(rp->swallowed_object, rp->object);
evas_object_event_callback_add(rp->swallowed_object,
EVAS_CALLBACK_FREE,