forked from enlightenment/efl
Add initial support for edje gradients. See data/src/gradient.edc for an example.
SVN revision: 24361
This commit is contained in:
parent
9f6824c2ab
commit
8cda88c2e6
|
@ -1,7 +1,7 @@
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: C
|
" Language: EDC
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: no one?
|
||||||
" Last Change: 2002 Mar 18
|
" Last Change: 2005
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" For version 5.x: Clear all syntax items
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
spectra {
|
||||||
|
spectrum {
|
||||||
|
name: "white_to_trans";
|
||||||
|
color: 255 255 255 255 1;
|
||||||
|
color: 255 255 255 0 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
collections {
|
||||||
|
group {
|
||||||
|
name: "grad_test";
|
||||||
|
parts {
|
||||||
|
part {
|
||||||
|
name: "grad";
|
||||||
|
type: GRADIENT;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
color: 255 255 255 255;
|
||||||
|
gradient {
|
||||||
|
type: "linear";
|
||||||
|
spectrum: "white_to_trans";
|
||||||
|
}
|
||||||
|
fill {
|
||||||
|
angle: 0;
|
||||||
|
spread: 0;
|
||||||
|
origin {
|
||||||
|
relative: 0.5 0.5;
|
||||||
|
}
|
||||||
|
size {
|
||||||
|
relative: 1 1 ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "half" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
color: 0 255 0 255;
|
||||||
|
fill {
|
||||||
|
angle: 180;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "full" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
color: 255 255 255 255;
|
||||||
|
fill {
|
||||||
|
angle: 360;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
programs {
|
||||||
|
program {
|
||||||
|
name: "anim";
|
||||||
|
signal: "mouse,clicked*";
|
||||||
|
source: "grad";
|
||||||
|
action: STATE_SET "half" 0.0;
|
||||||
|
target: "grad";
|
||||||
|
transition: LINEAR 2.0;
|
||||||
|
after: "anim2";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "anim2";
|
||||||
|
action: STATE_SET "full" 0.0;
|
||||||
|
target: "grad";
|
||||||
|
transition: LINEAR 2.0;
|
||||||
|
after: "anim3";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "anim3";
|
||||||
|
action: STATE_SET "default" 0.0;
|
||||||
|
target: "grad";
|
||||||
|
after: "anim";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,6 +21,11 @@ static void st_color_class_color(void);
|
||||||
static void st_color_class_color2(void);
|
static void st_color_class_color2(void);
|
||||||
static void st_color_class_color3(void);
|
static void st_color_class_color3(void);
|
||||||
|
|
||||||
|
static void ob_spectrum(void);
|
||||||
|
/*static void st_spectrum(void);*/
|
||||||
|
static void st_spectrum_name(void);
|
||||||
|
static void st_spectrum_color(void);
|
||||||
|
|
||||||
static void ob_collections(void);
|
static void ob_collections(void);
|
||||||
|
|
||||||
static void ob_collections_group(void);
|
static void ob_collections_group(void);
|
||||||
|
@ -73,6 +78,8 @@ static void st_collections_group_parts_part_description_fill_origin_relative(voi
|
||||||
static void st_collections_group_parts_part_description_fill_origin_offset(void);
|
static void st_collections_group_parts_part_description_fill_origin_offset(void);
|
||||||
static void st_collections_group_parts_part_description_fill_size_relative(void);
|
static void st_collections_group_parts_part_description_fill_size_relative(void);
|
||||||
static void st_collections_group_parts_part_description_fill_size_offset(void);
|
static void st_collections_group_parts_part_description_fill_size_offset(void);
|
||||||
|
static void st_collections_group_parts_part_description_fill_angle(void);
|
||||||
|
static void st_collections_group_parts_part_description_fill_spread(void);
|
||||||
static void st_collections_group_parts_part_description_color_class(void);
|
static void st_collections_group_parts_part_description_color_class(void);
|
||||||
static void st_collections_group_parts_part_description_color(void);
|
static void st_collections_group_parts_part_description_color(void);
|
||||||
static void st_collections_group_parts_part_description_color2(void);
|
static void st_collections_group_parts_part_description_color2(void);
|
||||||
|
@ -88,6 +95,8 @@ static void st_collections_group_parts_part_description_text_align(void);
|
||||||
static void st_collections_group_parts_part_description_text_source(void);
|
static void st_collections_group_parts_part_description_text_source(void);
|
||||||
static void st_collections_group_parts_part_description_text_text_source(void);
|
static void st_collections_group_parts_part_description_text_text_source(void);
|
||||||
static void st_collections_group_parts_part_description_text_elipsis(void);
|
static void st_collections_group_parts_part_description_text_elipsis(void);
|
||||||
|
static void st_collections_group_parts_part_description_gradient_type(void);
|
||||||
|
static void st_collections_group_parts_part_description_gradient_spectrum(void);
|
||||||
|
|
||||||
static void ob_collections_group_programs_program(void);
|
static void ob_collections_group_programs_program(void);
|
||||||
static void st_collections_group_programs_program_name(void);
|
static void st_collections_group_programs_program_name(void);
|
||||||
|
@ -115,6 +124,9 @@ New_Statement_Handler statement_handlers[] =
|
||||||
{"color_classes.color_class.color", st_color_class_color},
|
{"color_classes.color_class.color", st_color_class_color},
|
||||||
{"color_classes.color_class.color2", st_color_class_color2},
|
{"color_classes.color_class.color2", st_color_class_color2},
|
||||||
{"color_classes.color_class.color3", st_color_class_color3},
|
{"color_classes.color_class.color3", st_color_class_color3},
|
||||||
|
/*{"spectra.spectrum", st_spectrum},*/
|
||||||
|
{"spectra.spectrum.name", st_spectrum_name},
|
||||||
|
{"spectra.spectrum.color", st_spectrum_color},
|
||||||
{"collections.image", st_images_image}, /* dup */
|
{"collections.image", st_images_image}, /* dup */
|
||||||
{"collections.images.image", st_images_image}, /* dup */
|
{"collections.images.image", st_images_image}, /* dup */
|
||||||
{"collections.font", st_fonts_font}, /* dup */
|
{"collections.font", st_fonts_font}, /* dup */
|
||||||
|
@ -204,6 +216,8 @@ New_Statement_Handler statement_handlers[] =
|
||||||
{"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset},
|
{"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset},
|
||||||
{"collections.group.parts.part.description.fill.size.relative", st_collections_group_parts_part_description_fill_size_relative},
|
{"collections.group.parts.part.description.fill.size.relative", st_collections_group_parts_part_description_fill_size_relative},
|
||||||
{"collections.group.parts.part.description.fill.size.offset", st_collections_group_parts_part_description_fill_size_offset},
|
{"collections.group.parts.part.description.fill.size.offset", st_collections_group_parts_part_description_fill_size_offset},
|
||||||
|
{"collections.group.parts.part.description.fill.angle", st_collections_group_parts_part_description_fill_angle},
|
||||||
|
{"collections.group.parts.part.description.fill.spread", st_collections_group_parts_part_description_fill_spread},
|
||||||
{"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class},
|
{"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class},
|
||||||
{"collections.group.parts.part.description.color", st_collections_group_parts_part_description_color},
|
{"collections.group.parts.part.description.color", st_collections_group_parts_part_description_color},
|
||||||
{"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2},
|
{"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2},
|
||||||
|
@ -221,6 +235,8 @@ New_Statement_Handler statement_handlers[] =
|
||||||
{"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */
|
{"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */
|
||||||
{"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */
|
{"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */
|
||||||
{"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_elipsis},
|
{"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_elipsis},
|
||||||
|
{"collections.group.parts.part.description.gradient.type", st_collections_group_parts_part_description_gradient_type},
|
||||||
|
{"collections.group.parts.part.description.gradient.spectrum", st_collections_group_parts_part_description_gradient_spectrum},
|
||||||
{"collections.group.parts.part.description.images.image", st_images_image}, /* dup */
|
{"collections.group.parts.part.description.images.image", st_images_image}, /* dup */
|
||||||
{"collections.group.parts.part.description.font", st_fonts_font}, /* dup */
|
{"collections.group.parts.part.description.font", st_fonts_font}, /* dup */
|
||||||
{"collections.group.parts.part.description.fonts.font", st_fonts_font}, /* dup */
|
{"collections.group.parts.part.description.fonts.font", st_fonts_font}, /* dup */
|
||||||
|
@ -322,6 +338,8 @@ New_Object_Handler object_handlers[] =
|
||||||
{"styles.style", ob_styles_style},
|
{"styles.style", ob_styles_style},
|
||||||
{"color_classes", NULL},
|
{"color_classes", NULL},
|
||||||
{"color_classes.color_class", ob_color_class},
|
{"color_classes.color_class", ob_color_class},
|
||||||
|
{"spectra", NULL},
|
||||||
|
{"spectra.spectrum", ob_spectrum},
|
||||||
{"collections", ob_collections},
|
{"collections", ob_collections},
|
||||||
{"collections.images", NULL}, /* dup */
|
{"collections.images", NULL}, /* dup */
|
||||||
{"collections.fonts", NULL}, /* dup */
|
{"collections.fonts", NULL}, /* dup */
|
||||||
|
@ -367,6 +385,7 @@ New_Object_Handler object_handlers[] =
|
||||||
{"collections.group.parts.part.description.fonts", NULL}, /* dup */
|
{"collections.group.parts.part.description.fonts", NULL}, /* dup */
|
||||||
{"collections.group.parts.part.description.styles", NULL}, /* dup */
|
{"collections.group.parts.part.description.styles", NULL}, /* dup */
|
||||||
{"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
|
{"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
|
||||||
|
{"collections.group.parts.part.description.gradient", NULL},
|
||||||
{"collections.group.parts.part.description.color_classes", NULL}, /* dup */
|
{"collections.group.parts.part.description.color_classes", NULL}, /* dup */
|
||||||
{"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */
|
{"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */
|
||||||
{"collections.group.parts.part.description.program", ob_collections_group_programs_program}, /* dup */
|
{"collections.group.parts.part.description.program", ob_collections_group_programs_program}, /* dup */
|
||||||
|
@ -622,6 +641,48 @@ st_color_class_color3(void)
|
||||||
cc->a3 = parse_int_range(3, 0, 255);
|
cc->a3 = parse_int_range(3, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ob_spectrum(void)
|
||||||
|
{
|
||||||
|
Edje_Spectrum_Directory_Entry *se;
|
||||||
|
|
||||||
|
if (!edje_file->spectrum_dir)
|
||||||
|
edje_file->spectrum_dir = mem_alloc(SZ(Edje_Spectrum_Directory));
|
||||||
|
se = mem_alloc(SZ(Edje_Spectrum_Directory_Entry));
|
||||||
|
edje_file->spectrum_dir->entries = evas_list_append(edje_file->spectrum_dir->entries, se);
|
||||||
|
se->id = evas_list_count(edje_file->spectrum_dir->entries) - 1;
|
||||||
|
se->entry = NULL;
|
||||||
|
se->filename = NULL;
|
||||||
|
se->color_list = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
st_spectrum_name(void)
|
||||||
|
{
|
||||||
|
Edje_Spectrum_Directory_Entry *se;
|
||||||
|
Edje_Spectrum_Color *sc;
|
||||||
|
|
||||||
|
se = evas_list_data(evas_list_last(edje_file->spectrum_dir->entries));
|
||||||
|
se->entry = parse_str(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
st_spectrum_color(void)
|
||||||
|
{
|
||||||
|
Edje_Spectrum_Directory_Entry *se;
|
||||||
|
Edje_Spectrum_Color *sc;
|
||||||
|
|
||||||
|
se = evas_list_data(evas_list_last(edje_file->spectrum_dir->entries));
|
||||||
|
|
||||||
|
sc = mem_alloc(SZ(Edje_Spectrum_Color));
|
||||||
|
se->color_list = evas_list_append(se->color_list, sc);
|
||||||
|
sc->r = parse_int_range(0, 0, 255);
|
||||||
|
sc->g = parse_int_range(1, 0, 255);
|
||||||
|
sc->b = parse_int_range(2, 0, 255);
|
||||||
|
sc->a = parse_int_range(3, 0, 255);
|
||||||
|
sc->d = parse_int(4);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ob_styles_style(void)
|
ob_styles_style(void)
|
||||||
{
|
{
|
||||||
|
@ -856,6 +917,7 @@ st_collections_group_parts_part_type(void)
|
||||||
"IMAGE", EDJE_PART_TYPE_IMAGE,
|
"IMAGE", EDJE_PART_TYPE_IMAGE,
|
||||||
"SWALLOW", EDJE_PART_TYPE_SWALLOW,
|
"SWALLOW", EDJE_PART_TYPE_SWALLOW,
|
||||||
"TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK,
|
"TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK,
|
||||||
|
"GRADIENT", EDJE_PART_TYPE_GRADIENT,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1017,6 +1079,8 @@ ob_collections_group_parts_part_description(void)
|
||||||
ed->fill.pos_abs_y = 0;
|
ed->fill.pos_abs_y = 0;
|
||||||
ed->fill.rel_y = 1.0;
|
ed->fill.rel_y = 1.0;
|
||||||
ed->fill.abs_y = 0;
|
ed->fill.abs_y = 0;
|
||||||
|
ed->fill.angle = 0;
|
||||||
|
ed->fill.spread = 0;
|
||||||
ed->color_class = NULL;
|
ed->color_class = NULL;
|
||||||
ed->color.r = 255;
|
ed->color.r = 255;
|
||||||
ed->color.g = 255;
|
ed->color.g = 255;
|
||||||
|
@ -1128,6 +1192,7 @@ st_collections_group_parts_part_description_inherit(void)
|
||||||
data_queue_part_slave_lookup(&parent->rel2.id_x, &ed->rel2.id_x);
|
data_queue_part_slave_lookup(&parent->rel2.id_x, &ed->rel2.id_x);
|
||||||
data_queue_part_slave_lookup(&parent->rel2.id_y, &ed->rel2.id_y);
|
data_queue_part_slave_lookup(&parent->rel2.id_y, &ed->rel2.id_y);
|
||||||
data_queue_image_slave_lookup(&parent->image.id, &ed->image.id);
|
data_queue_image_slave_lookup(&parent->image.id, &ed->image.id);
|
||||||
|
data_queue_spectrum_slave_lookup(&parent->gradient.id, &ed->gradient.id);
|
||||||
|
|
||||||
/* make sure all the allocated memory is getting copied, not just
|
/* make sure all the allocated memory is getting copied, not just
|
||||||
* referenced
|
* referenced
|
||||||
|
@ -1680,7 +1745,7 @@ st_collections_group_parts_part_description_fill_origin_relative(void)
|
||||||
pc = evas_list_data(evas_list_last(edje_collections));
|
pc = evas_list_data(evas_list_last(edje_collections));
|
||||||
ep = evas_list_data(evas_list_last(pc->parts));
|
ep = evas_list_data(evas_list_last(pc->parts));
|
||||||
|
|
||||||
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||||
"fill attributes in non-IMAGE part.\n",
|
"fill attributes in non-IMAGE part.\n",
|
||||||
|
@ -1706,7 +1771,7 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
|
||||||
pc = evas_list_data(evas_list_last(edje_collections));
|
pc = evas_list_data(evas_list_last(edje_collections));
|
||||||
ep = evas_list_data(evas_list_last(pc->parts));
|
ep = evas_list_data(evas_list_last(pc->parts));
|
||||||
|
|
||||||
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||||
"fill attributes in non-IMAGE part.\n",
|
"fill attributes in non-IMAGE part.\n",
|
||||||
|
@ -1734,7 +1799,7 @@ st_collections_group_parts_part_description_fill_size_relative(void)
|
||||||
ed = ep->default_desc;
|
ed = ep->default_desc;
|
||||||
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||||
|
|
||||||
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||||
"fill attributes in non-IMAGE part.\n",
|
"fill attributes in non-IMAGE part.\n",
|
||||||
|
@ -1760,7 +1825,7 @@ st_collections_group_parts_part_description_fill_size_offset(void)
|
||||||
ed = ep->default_desc;
|
ed = ep->default_desc;
|
||||||
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||||
|
|
||||||
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||||
"fill attributes in non-IMAGE part.\n",
|
"fill attributes in non-IMAGE part.\n",
|
||||||
|
@ -2151,6 +2216,58 @@ st_collections_group_parts_part_description_text_text_source(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
st_collections_group_parts_part_description_fill_angle(void)
|
||||||
|
{
|
||||||
|
Edje_Part_Collection *pc;
|
||||||
|
Edje_Part *ep;
|
||||||
|
Edje_Part_Description *ed;
|
||||||
|
|
||||||
|
check_arg_count(1);
|
||||||
|
|
||||||
|
pc = evas_list_data(evas_list_last(edje_collections));
|
||||||
|
ep = evas_list_data(evas_list_last(pc->parts));
|
||||||
|
|
||||||
|
/* XXX this will need to include IMAGES when angle support is added to evas images */
|
||||||
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||||
|
"gradient attributes in non-GRADIENT part.\n",
|
||||||
|
progname, file_in, line - 1);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ed = ep->default_desc;
|
||||||
|
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||||
|
ed->fill.angle = parse_int_range(0, 0, 360);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
st_collections_group_parts_part_description_fill_spread(void)
|
||||||
|
{
|
||||||
|
Edje_Part_Collection *pc;
|
||||||
|
Edje_Part *ep;
|
||||||
|
Edje_Part_Description *ed;
|
||||||
|
|
||||||
|
check_arg_count(1);
|
||||||
|
|
||||||
|
pc = evas_list_data(evas_list_last(edje_collections));
|
||||||
|
ep = evas_list_data(evas_list_last(pc->parts));
|
||||||
|
|
||||||
|
/* XXX this will need to include IMAGES when spread support is added to evas images */
|
||||||
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||||
|
"gradient attributes in non-GRADIENT part.\n",
|
||||||
|
progname, file_in, line - 1);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ed = ep->default_desc;
|
||||||
|
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||||
|
ed->fill.spread = parse_int_range(0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
st_collections_group_parts_part_description_text_elipsis(void)
|
st_collections_group_parts_part_description_text_elipsis(void)
|
||||||
{
|
{
|
||||||
|
@ -2176,6 +2293,65 @@ st_collections_group_parts_part_description_text_elipsis(void)
|
||||||
ed->text.elipsis = parse_float_range(0, 0.0, 1.0);
|
ed->text.elipsis = parse_float_range(0, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
st_collections_group_parts_part_description_gradient_type(void)
|
||||||
|
{
|
||||||
|
Edje_Part_Collection *pc;
|
||||||
|
Edje_Part *ep;
|
||||||
|
Edje_Part_Description *ed;
|
||||||
|
|
||||||
|
check_arg_count(1);
|
||||||
|
|
||||||
|
pc = evas_list_data(evas_list_last(edje_collections));
|
||||||
|
ep = evas_list_data(evas_list_last(pc->parts));
|
||||||
|
|
||||||
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||||
|
"gradient attributes in non-GRADIENT part.\n",
|
||||||
|
progname, file_in, line - 1);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ed = ep->default_desc;
|
||||||
|
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||||
|
ed->gradient.type = parse_str(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
st_collections_group_parts_part_description_gradient_spectrum(void)
|
||||||
|
{
|
||||||
|
Edje_Part_Collection *pc;
|
||||||
|
Edje_Part *ep;
|
||||||
|
Edje_Part_Description *ed;
|
||||||
|
char *spectrum;
|
||||||
|
|
||||||
|
check_arg_count(1);
|
||||||
|
|
||||||
|
pc = evas_list_data(evas_list_last(edje_collections));
|
||||||
|
ep = evas_list_data(evas_list_last(pc->parts));
|
||||||
|
|
||||||
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
||||||
|
"gradient attributes in non-GRADIENT part.\n",
|
||||||
|
progname, file_in, line - 1);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ed = ep->default_desc;
|
||||||
|
if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
|
||||||
|
|
||||||
|
{
|
||||||
|
char *name;
|
||||||
|
|
||||||
|
name = parse_str(0);
|
||||||
|
data_queue_spectrum_lookup(name, &(ed->gradient.id));
|
||||||
|
free(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ob_collections_group_programs_program(void)
|
ob_collections_group_programs_program(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
|
|
||||||
typedef struct _Part_Lookup Part_Lookup;
|
typedef struct _Part_Lookup Part_Lookup;
|
||||||
typedef struct _Program_Lookup Program_Lookup;
|
typedef struct _Program_Lookup Program_Lookup;
|
||||||
typedef struct _Image_Lookup Image_Lookup;
|
typedef struct _String_Lookup Image_Lookup;
|
||||||
|
typedef struct _String_Lookup Spectrum_Lookup;
|
||||||
typedef struct _Slave_Lookup Slave_Lookup;
|
typedef struct _Slave_Lookup Slave_Lookup;
|
||||||
typedef struct _Code_Lookup Code_Lookup;
|
typedef struct _Code_Lookup Code_Lookup;
|
||||||
|
|
||||||
|
@ -24,7 +25,7 @@ struct _Program_Lookup
|
||||||
int *dest;
|
int *dest;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Image_Lookup
|
struct _String_Lookup
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
int *dest;
|
int *dest;
|
||||||
|
@ -55,6 +56,8 @@ Evas_List *code_lookups = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_file = NULL;
|
static Eet_Data_Descriptor *edd_edje_file = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_image_directory = NULL;
|
static Eet_Data_Descriptor *edd_edje_image_directory = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_image_directory_entry = NULL;
|
static Eet_Data_Descriptor *edd_edje_image_directory_entry = NULL;
|
||||||
|
static Eet_Data_Descriptor *edd_edje_spectrum_directory = NULL;
|
||||||
|
static Eet_Data_Descriptor *edd_edje_spectrum_directory_entry = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_program = NULL;
|
static Eet_Data_Descriptor *edd_edje_program = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_program_target = NULL;
|
static Eet_Data_Descriptor *edd_edje_program_target = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_part_collection_directory = NULL;
|
static Eet_Data_Descriptor *edd_edje_part_collection_directory = NULL;
|
||||||
|
@ -63,12 +66,15 @@ static Eet_Data_Descriptor *edd_edje_part_collection = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_part = NULL;
|
static Eet_Data_Descriptor *edd_edje_part = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_part_description = NULL;
|
static Eet_Data_Descriptor *edd_edje_part_description = NULL;
|
||||||
static Eet_Data_Descriptor *edd_edje_part_image_id = NULL;
|
static Eet_Data_Descriptor *edd_edje_part_image_id = NULL;
|
||||||
|
static Eet_Data_Descriptor *edd_edje_spectrum_color = NULL;
|
||||||
|
|
||||||
static Evas_List *part_lookups = NULL;
|
static Evas_List *part_lookups = NULL;
|
||||||
static Evas_List *program_lookups = NULL;
|
static Evas_List *program_lookups = NULL;
|
||||||
static Evas_List *image_lookups = NULL;
|
static Evas_List *image_lookups = NULL;
|
||||||
|
static Evas_List *spectrum_lookups = NULL;
|
||||||
static Evas_List *part_slave_lookups = NULL;
|
static Evas_List *part_slave_lookups = NULL;
|
||||||
static Evas_List *image_slave_lookups= NULL;
|
static Evas_List *image_slave_lookups= NULL;
|
||||||
|
static Evas_List *spectrum_slave_lookups= NULL;
|
||||||
|
|
||||||
#define ABORT_WRITE(eet_file, file) \
|
#define ABORT_WRITE(eet_file, file) \
|
||||||
eet_close(eet_file); \
|
eet_close(eet_file); \
|
||||||
|
@ -81,6 +87,8 @@ data_setup(void)
|
||||||
edd_edje_file = _edje_edd_edje_file;
|
edd_edje_file = _edje_edd_edje_file;
|
||||||
edd_edje_image_directory = _edje_edd_edje_image_directory;
|
edd_edje_image_directory = _edje_edd_edje_image_directory;
|
||||||
edd_edje_image_directory_entry = _edje_edd_edje_image_directory_entry;
|
edd_edje_image_directory_entry = _edje_edd_edje_image_directory_entry;
|
||||||
|
edd_edje_spectrum_directory = _edje_edd_edje_spectrum_directory;
|
||||||
|
edd_edje_spectrum_directory_entry = _edje_edd_edje_spectrum_directory_entry;
|
||||||
edd_edje_program = _edje_edd_edje_program;
|
edd_edje_program = _edje_edd_edje_program;
|
||||||
edd_edje_program_target = _edje_edd_edje_program_target;
|
edd_edje_program_target = _edje_edd_edje_program_target;
|
||||||
edd_edje_part_collection_directory = _edje_edd_edje_part_collection_directory;
|
edd_edje_part_collection_directory = _edje_edd_edje_part_collection_directory;
|
||||||
|
@ -89,6 +97,7 @@ data_setup(void)
|
||||||
edd_edje_part = _edje_edd_edje_part;
|
edd_edje_part = _edje_edd_edje_part;
|
||||||
edd_edje_part_description = _edje_edd_edje_part_description;
|
edd_edje_part_description = _edje_edd_edje_part_description;
|
||||||
edd_edje_part_image_id = _edje_edd_edje_part_image_id;
|
edd_edje_part_image_id = _edje_edd_edje_part_image_id;
|
||||||
|
edd_edje_spectrum_color = _edje_edd_edje_spectrum_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -745,6 +754,17 @@ data_queue_image_lookup(char *name, int *dest)
|
||||||
il->dest = dest;
|
il->dest = dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
data_queue_spectrum_lookup(char *name, int *dest)
|
||||||
|
{
|
||||||
|
Spectrum_Lookup *sl;
|
||||||
|
|
||||||
|
sl = mem_alloc(SZ(Spectrum_Lookup));
|
||||||
|
spectrum_lookups = evas_list_append(spectrum_lookups, sl);
|
||||||
|
sl->name = mem_strdup(name);
|
||||||
|
sl->dest = dest;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
data_queue_part_slave_lookup(int *master, int *slave)
|
data_queue_part_slave_lookup(int *master, int *slave)
|
||||||
{
|
{
|
||||||
|
@ -767,6 +787,17 @@ data_queue_image_slave_lookup(int *master, int *slave)
|
||||||
sl->slave = slave;
|
sl->slave = slave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
data_queue_spectrum_slave_lookup(int *master, int *slave)
|
||||||
|
{
|
||||||
|
Slave_Lookup *sl;
|
||||||
|
|
||||||
|
sl = mem_alloc(SZ(Slave_Lookup));
|
||||||
|
spectrum_slave_lookups = evas_list_append(spectrum_slave_lookups, sl);
|
||||||
|
sl->master = master;
|
||||||
|
sl->slave = slave;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
handle_slave_lookup(Evas_List *list, int *master, int value)
|
handle_slave_lookup(Evas_List *list, int *master, int value)
|
||||||
{
|
{
|
||||||
|
@ -878,6 +909,44 @@ data_process_lookups(void)
|
||||||
free(il);
|
free(il);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (spectrum_lookups)
|
||||||
|
{
|
||||||
|
Spectrum_Lookup *il;
|
||||||
|
|
||||||
|
il = spectrum_lookups->data;
|
||||||
|
|
||||||
|
printf("spectrum lookup\n");
|
||||||
|
if (!edje_file->spectrum_dir)
|
||||||
|
l = NULL;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (l = edje_file->spectrum_dir->entries; l; l = l->next)
|
||||||
|
{
|
||||||
|
Edje_Spectrum_Directory_Entry *de;
|
||||||
|
|
||||||
|
de = l->data;
|
||||||
|
*(il->dest) = 1;
|
||||||
|
if ((de->entry) && (!strcmp(de->entry, il->name)))
|
||||||
|
{
|
||||||
|
printf("found spectrum: %s (%d)\n", de->entry, de->id);
|
||||||
|
handle_slave_lookup(spectrum_slave_lookups, il->dest, de->id);
|
||||||
|
*(il->dest) = de->id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!l)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: Error. unable to find spectrum name %s\n",
|
||||||
|
progname, il->name);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
spectrum_lookups = evas_list_remove(spectrum_lookups, il);
|
||||||
|
free(il->name);
|
||||||
|
free(il);
|
||||||
|
}
|
||||||
|
|
||||||
while (part_slave_lookups)
|
while (part_slave_lookups)
|
||||||
{
|
{
|
||||||
free(part_slave_lookups->data);
|
free(part_slave_lookups->data);
|
||||||
|
@ -889,6 +958,12 @@ data_process_lookups(void)
|
||||||
free(image_slave_lookups->data);
|
free(image_slave_lookups->data);
|
||||||
image_slave_lookups = evas_list_remove_list(image_slave_lookups, image_slave_lookups);
|
image_slave_lookups = evas_list_remove_list(image_slave_lookups, image_slave_lookups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (spectrum_slave_lookups)
|
||||||
|
{
|
||||||
|
free(spectrum_slave_lookups->data);
|
||||||
|
spectrum_slave_lookups = evas_list_remove_list(spectrum_slave_lookups, spectrum_slave_lookups);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1014,6 +1089,12 @@ data_queue_image_pc_lookup(Edje_Part_Collection *pc, char *name, int *dest)
|
||||||
data_queue_image_lookup(name, dest);
|
data_queue_image_lookup(name, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
data_queue_spectrum_pc_lookup(Edje_Part_Collection *pc, char *name, int *dest)
|
||||||
|
{
|
||||||
|
data_queue_spectrum_lookup(name, dest);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
data_process_scripts(void)
|
data_process_scripts(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -899,6 +899,8 @@ _edje_part_recalc_single(Edje *ed,
|
||||||
params->fill.y = desc->fill.pos_abs_y + (params->h * desc->fill.pos_rel_y);
|
params->fill.y = desc->fill.pos_abs_y + (params->h * desc->fill.pos_rel_y);
|
||||||
params->fill.h = desc->fill.abs_y + (params->h * desc->fill.rel_y);
|
params->fill.h = desc->fill.abs_y + (params->h * desc->fill.rel_y);
|
||||||
}
|
}
|
||||||
|
params->fill.angle = desc->fill.angle;
|
||||||
|
params->fill.spread = desc->fill.angle;
|
||||||
/* colors */
|
/* colors */
|
||||||
|
|
||||||
params->color.r = desc->color.r;
|
params->color.r = desc->color.r;
|
||||||
|
@ -960,6 +962,8 @@ _edje_part_recalc_single(Edje *ed,
|
||||||
params->text.align.y = desc->text.align.y;
|
params->text.align.y = desc->text.align.y;
|
||||||
}
|
}
|
||||||
params->text.elipsis = desc->text.elipsis;
|
params->text.elipsis = desc->text.elipsis;
|
||||||
|
params->gradient.id = desc->gradient.id;
|
||||||
|
params->gradient.type = desc->gradient.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1066,6 +1070,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
p3.fill.y = (p1.fill.y * (1.0 - pos)) + (p2.fill.y * (pos));
|
p3.fill.y = (p1.fill.y * (1.0 - pos)) + (p2.fill.y * (pos));
|
||||||
p3.fill.w = (p1.fill.w * (1.0 - pos)) + (p2.fill.w * (pos));
|
p3.fill.w = (p1.fill.w * (1.0 - pos)) + (p2.fill.w * (pos));
|
||||||
p3.fill.h = (p1.fill.h * (1.0 - pos)) + (p2.fill.h * (pos));
|
p3.fill.h = (p1.fill.h * (1.0 - pos)) + (p2.fill.h * (pos));
|
||||||
|
p3.fill.angle = (p1.fill.angle * (1.0 - pos)) + (p2.fill.angle * (pos));
|
||||||
|
p3.fill.spread = pos > 0.5 ? p2.fill.spread : p1.fill.spread;
|
||||||
|
|
||||||
p3.color.r = (p1.color.r * (1.0 - pos)) + (p2.color.r * (pos));
|
p3.color.r = (p1.color.r * (1.0 - pos)) + (p2.color.r * (pos));
|
||||||
p3.color.g = (p1.color.g * (1.0 - pos)) + (p2.color.g * (pos));
|
p3.color.g = (p1.color.g * (1.0 - pos)) + (p2.color.g * (pos));
|
||||||
|
@ -1090,6 +1096,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
p3.text.align.x = (p1.text.align.x * (1.0 - pos)) + (p2.text.align.x * (pos));
|
p3.text.align.x = (p1.text.align.x * (1.0 - pos)) + (p2.text.align.x * (pos));
|
||||||
p3.text.align.y = (p1.text.align.y * (1.0 - pos)) + (p2.text.align.y * (pos));
|
p3.text.align.y = (p1.text.align.y * (1.0 - pos)) + (p2.text.align.y * (pos));
|
||||||
p3.text.elipsis = (p1.text.elipsis * (1.0 - pos)) + (p2.text.elipsis * (pos));
|
p3.text.elipsis = (p1.text.elipsis * (1.0 - pos)) + (p2.text.elipsis * (pos));
|
||||||
|
|
||||||
|
p3.gradient.id = pos > 0.5 ? p2.gradient.id : p1.gradient.id;
|
||||||
|
p3.gradient.type = pos > 0.5 ? p2.gradient.type : p1.gradient.type;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1203,6 +1212,40 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
evas_object_move(ep->object, ed->x + p3.x, ed->y + p3.y);
|
evas_object_move(ep->object, ed->x + p3.x, ed->y + p3.y);
|
||||||
evas_object_resize(ep->object, p3.w, p3.h);
|
evas_object_resize(ep->object, p3.w, p3.h);
|
||||||
}
|
}
|
||||||
|
else if (ep->part->type == EDJE_PART_TYPE_GRADIENT)
|
||||||
|
{
|
||||||
|
evas_object_move(ep->object, ed->x + p3.x, ed->y + p3.y);
|
||||||
|
evas_object_resize(ep->object, p3.w, p3.h);
|
||||||
|
evas_object_color_set(ep->object, p3.color.r, p3.color.g, p3.color.b, p3.color.a);
|
||||||
|
if (p3.visible) evas_object_show(ep->object);
|
||||||
|
else evas_object_hide(ep->object);
|
||||||
|
|
||||||
|
evas_object_gradient_angle_set(ep->object, p3.fill.angle);
|
||||||
|
evas_object_gradient_spread_set(ep->object, p3.fill.spread);
|
||||||
|
evas_object_gradient_fill_set(ep->object, p3.fill.x, p3.fill.y, p3.fill.w, p3.fill.h);
|
||||||
|
|
||||||
|
if (p3.gradient.type && p3.gradient.type[0])
|
||||||
|
evas_object_gradient_type_set(ep->object, p3.gradient.type, NULL);
|
||||||
|
|
||||||
|
if (ed->file->spectrum_dir && ed->file->spectrum_dir->entries)
|
||||||
|
{
|
||||||
|
Edje_Spectrum_Directory_Entry *se;
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
se = evas_list_nth(ed->file->spectrum_dir->entries, p3.gradient.id);
|
||||||
|
if (se)
|
||||||
|
{
|
||||||
|
// XXX only do this if we NEED to (e.g. gradient changed)
|
||||||
|
evas_object_gradient_colors_clear(ep->object);
|
||||||
|
for (l = se->color_list; l; l = l->next)
|
||||||
|
{
|
||||||
|
Edje_Spectrum_Color *sc = l->data;
|
||||||
|
evas_object_gradient_color_add(ep->object, sc->r, sc->g, sc->b, sc->a, sc->d);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ep->swallowed_object)
|
if (ep->swallowed_object)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,9 @@ EAPI Eet_Data_Descriptor *_edje_edd_edje_font_directory = NULL;
|
||||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_font_directory_entry = NULL;
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_font_directory_entry = NULL;
|
||||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory = NULL;
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory = NULL;
|
||||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry = NULL;
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry = NULL;
|
||||||
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_spectrum_directory = NULL;
|
||||||
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_spectrum_directory_entry = NULL;
|
||||||
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_spectrum_color = NULL;
|
||||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_program = NULL;
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_program = NULL;
|
||||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_program_target = NULL;
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_program_target = NULL;
|
||||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_program_after = NULL;
|
EAPI Eet_Data_Descriptor *_edje_edd_edje_program_after = NULL;
|
||||||
|
@ -42,6 +45,9 @@ _edje_edd_free(void)
|
||||||
FREED(_edje_edd_edje_font_directory_entry);
|
FREED(_edje_edd_edje_font_directory_entry);
|
||||||
FREED(_edje_edd_edje_image_directory);
|
FREED(_edje_edd_edje_image_directory);
|
||||||
FREED(_edje_edd_edje_image_directory_entry);
|
FREED(_edje_edd_edje_image_directory_entry);
|
||||||
|
FREED(_edje_edd_edje_spectrum_directory);
|
||||||
|
FREED(_edje_edd_edje_spectrum_directory_entry);
|
||||||
|
FREED(_edje_edd_edje_spectrum_color);
|
||||||
FREED(_edje_edd_edje_program);
|
FREED(_edje_edd_edje_program);
|
||||||
FREED(_edje_edd_edje_program_target);
|
FREED(_edje_edd_edje_program_target);
|
||||||
FREED(_edje_edd_edje_program_after);
|
FREED(_edje_edd_edje_program_after);
|
||||||
|
@ -100,6 +106,32 @@ _edje_edd_setup(void)
|
||||||
eet_data_descriptor2_new(&eddc);
|
eet_data_descriptor2_new(&eddc);
|
||||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Edje_Image_Directory, "entries", entries, _edje_edd_edje_image_directory_entry);
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Edje_Image_Directory, "entries", entries, _edje_edd_edje_image_directory_entry);
|
||||||
|
|
||||||
|
/* spectrum directory */
|
||||||
|
NEWD("Edje_Spectrum_Color",
|
||||||
|
Edje_Spectrum_Color);
|
||||||
|
_edje_edd_edje_spectrum_color =
|
||||||
|
eet_data_descriptor2_new(&eddc);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_spectrum_color, Edje_Spectrum_Color, "r", r, EET_T_INT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_spectrum_color, Edje_Spectrum_Color, "g", g, EET_T_INT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_spectrum_color, Edje_Spectrum_Color, "b", b, EET_T_INT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_spectrum_color, Edje_Spectrum_Color, "a", a, EET_T_INT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_spectrum_color, Edje_Spectrum_Color, "d", d, EET_T_INT);
|
||||||
|
|
||||||
|
NEWD("Edje_Spectrum_Directory_Entry",
|
||||||
|
Edje_Spectrum_Directory_Entry);
|
||||||
|
_edje_edd_edje_spectrum_directory_entry =
|
||||||
|
eet_data_descriptor2_new(&eddc);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_spectrum_directory_entry, Edje_Spectrum_Directory_Entry, "entry", entry, EET_T_STRING);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_spectrum_directory_entry, Edje_Spectrum_Directory_Entry, "filename", filename, EET_T_STRING);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_spectrum_directory_entry, Edje_Spectrum_Directory_Entry, "color_list", color_list, _edje_edd_edje_spectrum_color);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_spectrum_directory_entry, Edje_Spectrum_Directory_Entry, "id", id, EET_T_INT);
|
||||||
|
|
||||||
|
NEWD("Edje_Spectrum_Directory",
|
||||||
|
Edje_Spectrum_Directory);
|
||||||
|
_edje_edd_edje_spectrum_directory =
|
||||||
|
eet_data_descriptor2_new(&eddc);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_spectrum_directory, Edje_Spectrum_Directory, "entries", entries, _edje_edd_edje_spectrum_directory_entry);
|
||||||
|
|
||||||
/* collection directory */
|
/* collection directory */
|
||||||
NEWD("Edje_Part_Collection_Directory_Entry",
|
NEWD("Edje_Part_Collection_Directory_Entry",
|
||||||
Edje_Part_Collection_Directory_Entry);
|
Edje_Part_Collection_Directory_Entry);
|
||||||
|
@ -164,6 +196,7 @@ _edje_edd_setup(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "feature_ver", feature_ver, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "feature_ver", feature_ver, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "font_dir", font_dir, _edje_edd_edje_font_directory);
|
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "font_dir", font_dir, _edje_edd_edje_font_directory);
|
||||||
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory);
|
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "spectrum_dir", spectrum_dir, _edje_edd_edje_spectrum_directory);
|
||||||
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "collection_dir", collection_dir, _edje_edd_edje_part_collection_directory);
|
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "collection_dir", collection_dir, _edje_edd_edje_part_collection_directory);
|
||||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Edje_File, "data", data, _edje_edd_edje_data);
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Edje_File, "data", data, _edje_edd_edje_data);
|
||||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Edje_File, "styles", styles, _edje_edd_edje_style);
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Edje_File, "styles", styles, _edje_edd_edje_style);
|
||||||
|
@ -208,7 +241,7 @@ _edje_edd_setup(void)
|
||||||
_edje_edd_edje_part_image_id =
|
_edje_edd_edje_part_image_id =
|
||||||
eet_data_descriptor2_new(&eddc);
|
eet_data_descriptor2_new(&eddc);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_image_id, Edje_Part_Image_Id, "id", id, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_image_id, Edje_Part_Image_Id, "id", id, EET_T_INT);
|
||||||
|
|
||||||
NEWD("Edje_Part_Description",
|
NEWD("Edje_Part_Description",
|
||||||
Edje_Part_Description);
|
Edje_Part_Description);
|
||||||
_edje_edd_edje_part_description =
|
_edje_edd_edje_part_description =
|
||||||
|
@ -243,6 +276,7 @@ _edje_edd_setup(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.id_y", rel2.id_y, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.id_y", rel2.id_y, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "image.id", image.id, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "image.id", image.id, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description, Edje_Part_Description, "image.tween_list", image.tween_list, _edje_edd_edje_part_image_id);
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description, Edje_Part_Description, "image.tween_list", image.tween_list, _edje_edd_edje_part_image_id);
|
||||||
|
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.l", border.l, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.l", border.l, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.r", border.r, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.r", border.r, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.t", border.t, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.t", border.t, EET_T_INT);
|
||||||
|
@ -257,6 +291,8 @@ _edje_edd_setup(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.pos_abs_y", fill.pos_abs_y, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.pos_abs_y", fill.pos_abs_y, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.rel_y", fill.rel_y, EET_T_DOUBLE);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.rel_y", fill.rel_y, EET_T_DOUBLE);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.abs_y", fill.abs_y, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.abs_y", fill.abs_y, EET_T_INT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.angle", fill.angle, EET_T_INT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.spread", fill.spread, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "color_class", color_class, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "color_class", color_class, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "color.r", color.r, EET_T_UCHAR);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "color.r", color.r, EET_T_UCHAR);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "color.g", color.g, EET_T_UCHAR);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "color.g", color.g, EET_T_UCHAR);
|
||||||
|
@ -284,6 +320,8 @@ _edje_edd_setup(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.id_source", text.id_source, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.id_source", text.id_source, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.id_text_source", text.id_text_source, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.id_text_source", text.id_text_source, EET_T_INT);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.elipsis", text.elipsis, EET_T_DOUBLE);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.elipsis", text.elipsis, EET_T_DOUBLE);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.id", gradient.id, EET_T_INT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.type", gradient.type, EET_T_STRING);
|
||||||
|
|
||||||
NEWD("Edje_Part",
|
NEWD("Edje_Part",
|
||||||
Edje_Part);
|
Edje_Part);
|
||||||
|
|
|
@ -169,6 +169,8 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
||||||
}
|
}
|
||||||
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
|
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||||
rp->object = evas_object_textblock_add(ed->evas);
|
rp->object = evas_object_textblock_add(ed->evas);
|
||||||
|
else if (ep->type == EDJE_PART_TYPE_GRADIENT)
|
||||||
|
rp->object = evas_object_gradient_add(ed->evas);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("EDJE ERROR: wrong part type %i!\n", ep->type);
|
printf("EDJE ERROR: wrong part type %i!\n", ep->type);
|
||||||
|
|
|
@ -104,6 +104,8 @@ typedef struct _Edje_Font_Directory Edje_Font_Directory;
|
||||||
typedef struct _Edje_Font_Directory_Entry Edje_Font_Directory_Entry;
|
typedef struct _Edje_Font_Directory_Entry Edje_Font_Directory_Entry;
|
||||||
typedef struct _Edje_Image_Directory Edje_Image_Directory;
|
typedef struct _Edje_Image_Directory Edje_Image_Directory;
|
||||||
typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
|
typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
|
||||||
|
typedef struct _Edje_Spectrum_Directory Edje_Spectrum_Directory;
|
||||||
|
typedef struct _Edje_Spectrum_Directory_Entry Edje_Spectrum_Directory_Entry;
|
||||||
typedef struct _Edje_Program Edje_Program;
|
typedef struct _Edje_Program Edje_Program;
|
||||||
typedef struct _Edje_Program_Target Edje_Program_Target;
|
typedef struct _Edje_Program_Target Edje_Program_Target;
|
||||||
typedef struct _Edje_Program_After Edje_Program_After;
|
typedef struct _Edje_Program_After Edje_Program_After;
|
||||||
|
@ -113,6 +115,7 @@ typedef struct _Edje_Part_Collection Edje_Part_Collection;
|
||||||
typedef struct _Edje_Part Edje_Part;
|
typedef struct _Edje_Part Edje_Part;
|
||||||
typedef struct _Edje_Part_Image_Id Edje_Part_Image_Id;
|
typedef struct _Edje_Part_Image_Id Edje_Part_Image_Id;
|
||||||
typedef struct _Edje_Part_Description Edje_Part_Description;
|
typedef struct _Edje_Part_Description Edje_Part_Description;
|
||||||
|
typedef struct _Edje_Spectrum_Color Edje_Spectrum_Color;
|
||||||
|
|
||||||
#define PI 3.14159265358979323846
|
#define PI 3.14159265358979323846
|
||||||
|
|
||||||
|
@ -128,7 +131,8 @@ typedef struct _Edje_Part_Description Edje_Part_Description;
|
||||||
#define EDJE_PART_TYPE_IMAGE 3
|
#define EDJE_PART_TYPE_IMAGE 3
|
||||||
#define EDJE_PART_TYPE_SWALLOW 4
|
#define EDJE_PART_TYPE_SWALLOW 4
|
||||||
#define EDJE_PART_TYPE_TEXTBLOCK 5
|
#define EDJE_PART_TYPE_TEXTBLOCK 5
|
||||||
#define EDJE_PART_TYPE_LAST 6
|
#define EDJE_PART_TYPE_GRADIENT 6
|
||||||
|
#define EDJE_PART_TYPE_LAST 7
|
||||||
|
|
||||||
#define EDJE_TEXT_EFFECT_NONE 0
|
#define EDJE_TEXT_EFFECT_NONE 0
|
||||||
#define EDJE_TEXT_EFFECT_PLAIN 1
|
#define EDJE_TEXT_EFFECT_PLAIN 1
|
||||||
|
@ -211,6 +215,7 @@ struct _Edje_File
|
||||||
|
|
||||||
Edje_Font_Directory *font_dir;
|
Edje_Font_Directory *font_dir;
|
||||||
Edje_Image_Directory *image_dir;
|
Edje_Image_Directory *image_dir;
|
||||||
|
Edje_Spectrum_Directory *spectrum_dir;
|
||||||
Edje_Part_Collection_Directory *collection_dir;
|
Edje_Part_Collection_Directory *collection_dir;
|
||||||
Evas_List *data;
|
Evas_List *data;
|
||||||
Evas_List *styles;
|
Evas_List *styles;
|
||||||
|
@ -277,6 +282,29 @@ struct _Edje_Image_Directory_Entry
|
||||||
int id; /* the id no. of the image */
|
int id; /* the id no. of the image */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*----------*/
|
||||||
|
|
||||||
|
struct _Edje_Spectrum_Directory
|
||||||
|
{
|
||||||
|
Evas_List *entries; /* a list of Edje_Spectrum_Directory_Entry */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Edje_Spectrum_Directory_Entry
|
||||||
|
{
|
||||||
|
char *entry;
|
||||||
|
/* only one of the following two should be included. filename takes precedence */
|
||||||
|
char *filename; /* filename of external spectrum. */
|
||||||
|
Evas_List *color_list; /* list of Edje_Spectrum_Color */
|
||||||
|
int id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Edje_Spectrum_Color
|
||||||
|
{
|
||||||
|
int r, g, b, a;
|
||||||
|
int d;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------*/
|
/*----------*/
|
||||||
|
|
||||||
struct _Edje_Program /* a conditional program to be run */
|
struct _Edje_Program /* a conditional program to be run */
|
||||||
|
@ -438,6 +466,12 @@ struct _Edje_Part_Description
|
||||||
int id; /* the image id to use */
|
int id; /* the image id to use */
|
||||||
Evas_List *tween_list; /* list of Edje_Part_Image_Id */
|
Evas_List *tween_list; /* list of Edje_Part_Image_Id */
|
||||||
} image;
|
} image;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int id; /* the spectrum id to use */
|
||||||
|
char *type; /* type of spectrum - 'linear', 'radial', etc */
|
||||||
|
char *params; /* params for spectrum type */
|
||||||
|
} gradient;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int l, r, t, b; /* border scaling on image fill */
|
int l, r, t, b; /* border scaling on image fill */
|
||||||
|
@ -454,6 +488,8 @@ struct _Edje_Part_Description
|
||||||
int pos_abs_y; /* fill offset y added to fill offset */
|
int pos_abs_y; /* fill offset y added to fill offset */
|
||||||
double rel_y; /* relative size compared to area */
|
double rel_y; /* relative size compared to area */
|
||||||
int abs_y; /* size of fill added to relative fill */
|
int abs_y; /* size of fill added to relative fill */
|
||||||
|
int angle; /* angle of fill -- currently only used by grads */
|
||||||
|
int spread; /* spread of fill -- currently only used by grads */
|
||||||
} fill;
|
} fill;
|
||||||
|
|
||||||
char *color_class; /* how to modify the color */
|
char *color_class; /* how to modify the color */
|
||||||
|
@ -485,6 +521,7 @@ struct _Edje_Part_Description
|
||||||
} text;
|
} text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------*/
|
/*----------*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -671,6 +708,8 @@ struct _Edje_Calc_Params
|
||||||
unsigned char smooth : 1;
|
unsigned char smooth : 1;
|
||||||
struct {
|
struct {
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
|
int angle;
|
||||||
|
int spread;
|
||||||
} fill;
|
} fill;
|
||||||
struct {
|
struct {
|
||||||
unsigned char r, g, b, a;
|
unsigned char r, g, b, a;
|
||||||
|
@ -684,6 +723,10 @@ struct _Edje_Calc_Params
|
||||||
} align;
|
} align;
|
||||||
double elipsis;
|
double elipsis;
|
||||||
} text;
|
} text;
|
||||||
|
struct {
|
||||||
|
int id;
|
||||||
|
char *type;
|
||||||
|
} gradient;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Edje_Pending_Program
|
struct _Edje_Pending_Program
|
||||||
|
@ -823,6 +866,8 @@ EAPI extern Eet_Data_Descriptor *_edje_edd_edje_font_directory;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_font_directory_entry;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_font_directory_entry;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_image_directory;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_image_directory;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry;
|
||||||
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_spectrum_directory;
|
||||||
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_spectrum_directory_entry;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_program;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_program;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_program_target;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_program_target;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection_directory;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection_directory;
|
||||||
|
@ -831,6 +876,7 @@ EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_description;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_description;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_image_id;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_image_id;
|
||||||
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_spectrum_color;
|
||||||
|
|
||||||
extern int _edje_anim_count;
|
extern int _edje_anim_count;
|
||||||
extern Ecore_Animator *_edje_timer;
|
extern Ecore_Animator *_edje_timer;
|
||||||
|
|
Loading…
Reference in New Issue