* edje: when gradient meet dodo. Yes, they are gone !

SVN revision: 50223
This commit is contained in:
Cedric BAIL 2010-07-13 15:47:19 +00:00
parent ab8cdf1979
commit b49c2411bd
9 changed files with 55 additions and 1354 deletions

View File

@ -57,7 +57,6 @@
* <ul>
* <li>@ref sec_description_image "Image"</li>
* <li>@ref sec_description_text "Text"</li>
* <li>@ref sec_description_gradient "Gradient"</li>
* <li>@ref sec_description_box "Box"</li>
* <li>@ref sec_description_table "Table"</li>
* <li>@ref sec_description_map "Map (3d/transformations)"</li>
@ -95,11 +94,6 @@ static void st_color_class_color(void);
static void st_color_class_color2(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_group(void);
@ -192,7 +186,6 @@ 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_size_relative(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_fill_type(void);
static void st_collections_group_parts_part_description_color_class(void);
@ -212,12 +205,6 @@ 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_text_source(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 st_collections_group_parts_part_description_gradient_rel1_relative(void);
static void st_collections_group_parts_part_description_gradient_rel1_offset(void);
static void st_collections_group_parts_part_description_gradient_rel2_relative(void);
static void st_collections_group_parts_part_description_gradient_rel2_offset(void);
static void st_collections_group_parts_part_description_box_layout(void);
static void st_collections_group_parts_part_description_box_align(void);
static void st_collections_group_parts_part_description_box_padding(void);
@ -281,9 +268,6 @@ New_Statement_Handler statement_handlers[] =
{"color_classes.color_class.color", st_color_class_color},
{"color_classes.color_class.color2", st_color_class_color2},
{"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.externals.external", st_externals_external}, /* dup */
{"collections.image", st_images_image}, /* dup */
{"collections.set.name", st_images_set_name}, /* dup */
@ -452,7 +436,6 @@ 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.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.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.fill.type", st_collections_group_parts_part_description_fill_type},
{"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class},
@ -474,12 +457,6 @@ New_Statement_Handler statement_handlers[] =
{"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.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.rel1.relative", st_collections_group_parts_part_description_gradient_rel1_relative},
{"collections.group.parts.part.description.gradient.rel1.offset", st_collections_group_parts_part_description_gradient_rel1_offset},
{"collections.group.parts.part.description.gradient.rel2.relative", st_collections_group_parts_part_description_gradient_rel2_relative},
{"collections.group.parts.part.description.gradient.rel2.offset", st_collections_group_parts_part_description_gradient_rel2_offset},
{"collections.group.parts.part.description.gradient.spectrum", st_collections_group_parts_part_description_gradient_spectrum},
{"collections.group.parts.part.description.box.layout", st_collections_group_parts_part_description_box_layout},
{"collections.group.parts.part.description.box.align", st_collections_group_parts_part_description_box_align},
{"collections.group.parts.part.description.box.padding", st_collections_group_parts_part_description_box_padding},
@ -648,7 +625,6 @@ New_Object_Handler object_handlers[] =
{"color_classes", NULL},
{"color_classes.color_class", ob_color_class},
{"spectra", NULL},
{"spectra.spectrum", ob_spectrum},
{"collections", ob_collections},
{"collections.externals", NULL}, /* dup */
{"collections.set", ob_images_set}, /* dup */
@ -725,9 +701,6 @@ New_Object_Handler object_handlers[] =
{"collections.group.parts.part.description.fonts", 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.gradient", NULL},
{"collections.group.parts.part.description.gradient.rel1", NULL},
{"collections.group.parts.part.description.gradient.rel2", NULL},
{"collections.group.parts.part.description.box", NULL},
{"collections.group.parts.part.description.table", NULL},
{"collections.group.parts.part.description.map", NULL},
@ -1455,90 +1428,6 @@ st_color_class_color3(void)
cc->a3 = parse_int_range(3, 0, 255);
}
/**
@page edcref
@block
spectra
@context
spectra {
spectrum {
name: "colorspectrumname";
color: [0-255] [0-255] [0-255] [0-255] [0-?]
color: [0-255] [0-255] [0-255] [0-255] [0-?]
..
}
..
}
@description
The "spectra" block contains a list of one or more "spectrum" blocks.
Each "spectrum" block defines a color range used to fill GRADIENT
parts. The colors are defined with the red, green, blue, alpha, delta
format.
@endblock
*/
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 = eina_list_append(edje_file->spectrum_dir->entries, se);
se->id = eina_list_count(edje_file->spectrum_dir->entries) - 1;
se->entry = NULL;
se->filename = NULL;
se->color_list = NULL;
}
/**
@page edcref
@property
name
@parameters
[spectrum name]
@effect
The name of the spectrum used as reference later in the theme.
@endproperty
*/
static void
st_spectrum_name(void)
{
Edje_Spectrum_Directory_Entry *se;
se = eina_list_data_get(eina_list_last(edje_file->spectrum_dir->entries));
se->entry = parse_str(0);
}
/**
@page edcref
@property
color
@parameters
[red] [green] [blue] [alpha] [delta]
@effect
Each color declaration represents a stop point in the color range. The
last parameter (delta) is used to set the proportion of a given stop
point higher or lower in contrast with the other color's delta value.
@endproperty
*/
static void
st_spectrum_color(void)
{
Edje_Spectrum_Directory_Entry *se;
Edje_Spectrum_Color *sc;
se = eina_list_data_get(eina_list_last(edje_file->spectrum_dir->entries));
sc = mem_alloc(SZ(Edje_Spectrum_Color));
se->color_list = eina_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);
}
/**
@page edcref
@block
@ -2134,7 +2023,6 @@ st_collections_group_parts_part_name(void)
@li IMAGE
@li SWALLOW
@li TEXTBLOCK
@li GRADIENT
@li GROUP
@li BOX
@li TABLE
@ -2158,7 +2046,6 @@ st_collections_group_parts_part_type(void)
"IMAGE", EDJE_PART_TYPE_IMAGE,
"SWALLOW", EDJE_PART_TYPE_SWALLOW,
"TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK,
"GRADIENT", EDJE_PART_TYPE_GRADIENT,
"GROUP", EDJE_PART_TYPE_GROUP,
"BOX", EDJE_PART_TYPE_BOX,
"TABLE", EDJE_PART_TYPE_TABLE,
@ -3408,14 +3295,6 @@ ob_collections_group_parts_part_description(void)
ed->text.align.y = FROM_DOUBLE(0.5);
ed->text.id_source = -1;
ed->text.id_text_source = -1;
ed->gradient.rel1.relative_x = FROM_INT(0);
ed->gradient.rel1.relative_y = FROM_INT(0);
ed->gradient.rel1.offset_x = 0;
ed->gradient.rel1.offset_y = 0;
ed->gradient.rel2.relative_x = FROM_INT(1);
ed->gradient.rel2.relative_y = FROM_INT(1);
ed->gradient.rel2.offset_x = -1;
ed->gradient.rel2.offset_y = -1;
ed->box.layout = NULL;
ed->box.alt_layout = NULL;
ed->box.align.x = FROM_DOUBLE(0.5);
@ -3549,7 +3428,6 @@ 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_y, &ed->rel2.id_y);
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
* referenced
@ -4556,8 +4434,8 @@ st_collections_group_parts_part_description_image_scale_hint(void)
..
}
@description
The fill method is an optional block that defines the way an IMAGE or
GRADIENT part is going to be displayed inside its container.
The fill method is an optional block that defines the way an IMAGE part
is going to be displayed inside its container.
@endblock
@property
@ -4631,44 +4509,6 @@ st_collections_group_parts_part_description_fill_spread(void)
ed->fill.spread = parse_int_range(0, 0, 1);
}
/**
@page edcref
@property
angle
@parameters
[angle]
@effect
The angle of rotation of a GRADIENT part. It is invalid in any other
part type. The angle is expressed as an int, in the range 0 - 360.
@endproperty
*/
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 = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_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)
{
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
ed->fill.angle = parse_int_range(0, 0, 360);
}
/**
@page edcref
@ -4751,7 +4591,7 @@ st_collections_group_parts_part_description_fill_origin_relative(void)
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
@ -4787,7 +4627,7 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
@ -4848,7 +4688,7 @@ st_collections_group_parts_part_description_fill_size_relative(void)
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
@ -4884,7 +4724,7 @@ st_collections_group_parts_part_description_fill_size_offset(void)
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
@ -5449,271 +5289,6 @@ st_collections_group_parts_part_description_text_elipsis(void)
}
/**
@edcsection{description_gradient,Gradient state description sub blocks}
*/
/**
@page edcref
@block
gradient
@context
part {
description {
..
gradient {
type: "linear";
spectrum "spectrumName";
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2
relative: 1.0 1.0;
offset: -1 -1;
}
}
..
}
}
@description
A gradient block is used to display a given "spectrum" inside a
container. The container's shape is a rect but this not mean the
gradient is restricted to a rectangular shape. Gradients can use
"rel1" and "rel2" blocks to layout the initial and final point
relatively inside the container.
@endblock
@property
type
@parameters
[the name of the type]
@effect
Alters the gradient's rendering algorithm between:
@li linear (default)
@li radial
@li rectangular
@li angular
@li sinusoidal
@endproperty
*/
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 = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
ed->gradient.type = parse_str(0);
}
/**
@page edcref
@property
spectrum
@parameters
[an existing spectrum name]
@effect
Causes the gradient to display the colors as defined by a given
"spectrum" in the "spectra" block.
@endproperty
*/
static void
st_collections_group_parts_part_description_gradient_spectrum(void)
{
Edje_Part_Collection *pc;
Edje_Part *ep;
Edje_Part_Description *ed;
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
{
char *name;
name = parse_str(0);
data_queue_spectrum_lookup(name, &(ed->gradient.id));
free(name);
}
}
/**
@page edcref
@property
relative
@parameters
[a relative X coordinate] [a relative Y coordinate]
@effect
Inside rel1 places the initial point, or first color, of the gradient
relatively to the gradient's container. Inside rel2 places the final
point, or last color.
@endproperty
*/
static void
st_collections_group_parts_part_description_gradient_rel1_relative(void)
{
Edje_Part_Collection *pc;
Edje_Part *ep;
Edje_Part_Description *ed;
check_arg_count(2);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
{
ed->gradient.use_rel = 1;
ed->gradient.rel1.relative_x = parse_float(0);
ed->gradient.rel1.relative_y = parse_float(1);
}
}
/**
@page edcref
@property
offset
@parameters
[X axis] [Y axis]
@effect
Inside rel1 moves the initial point, or first color, of the gradient
a fixed number of pixels along either axis. Inside rel2 moves the final
point, or last color.
@endproperty
*/
static void
st_collections_group_parts_part_description_gradient_rel1_offset(void)
{
Edje_Part_Collection *pc;
Edje_Part *ep;
Edje_Part_Description *ed;
check_arg_count(2);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
{
ed->gradient.use_rel = 1;
ed->gradient.rel1.offset_x = parse_int(0);
ed->gradient.rel1.offset_y = parse_int(1);
}
}
static void
st_collections_group_parts_part_description_gradient_rel2_relative(void)
{
Edje_Part_Collection *pc;
Edje_Part *ep;
Edje_Part_Description *ed;
check_arg_count(2);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
{
ed->gradient.use_rel = 1;
ed->gradient.rel2.relative_x = parse_float(0);
ed->gradient.rel2.relative_y = parse_float(1);
}
}
static void
st_collections_group_parts_part_description_gradient_rel2_offset(void)
{
Edje_Part_Collection *pc;
Edje_Part *ep;
Edje_Part_Description *ed;
check_arg_count(2);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
{
ed->gradient.use_rel = 1;
ed->gradient.rel2.offset_x = parse_int(0);
ed->gradient.rel2.offset_y = parse_int(1);
}
}
/**
@edcsection{description_box,Box state description sub blocks}
*/

View File

@ -41,7 +41,6 @@ typedef struct _Part_Lookup Part_Lookup;
typedef struct _Program_Lookup Program_Lookup;
typedef struct _Group_Lookup Group_Lookup;
typedef struct _Image_Lookup Image_Lookup;
typedef struct _String_Lookup Spectrum_Lookup;
typedef struct _Slave_Lookup Slave_Lookup;
typedef struct _Code_Lookup Code_Lookup;
@ -110,8 +109,6 @@ Eina_List *aliases = 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_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_target = NULL;
static Eet_Data_Descriptor *edd_edje_part_collection_directory = NULL;
@ -120,16 +117,13 @@ static Eet_Data_Descriptor *edd_edje_part_collection = 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_image_id = NULL;
static Eet_Data_Descriptor *edd_edje_spectrum_color = NULL;
static Eina_List *part_lookups = NULL;
static Eina_List *program_lookups = NULL;
static Eina_List *group_lookups = NULL;
static Eina_List *image_lookups = NULL;
static Eina_List *spectrum_lookups = NULL;
static Eina_List *part_slave_lookups = NULL;
static Eina_List *image_slave_lookups= NULL;
static Eina_List *spectrum_slave_lookups= NULL;
#define ABORT_WRITE(eet_file, file) \
eet_close(eet_file); \
@ -155,8 +149,6 @@ data_setup(void)
edd_edje_file = _edje_edd_edje_file;
edd_edje_image_directory = _edje_edd_edje_image_directory;
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_target = _edje_edd_edje_program_target;
edd_edje_part_collection_directory = _edje_edd_edje_part_collection_directory;
@ -165,7 +157,6 @@ data_setup(void)
edd_edje_part = _edje_edd_edje_part;
edd_edje_part_description = _edje_edd_edje_part_description;
edd_edje_part_image_id = _edje_edd_edje_part_image_id;
edd_edje_spectrum_color = _edje_edd_edje_spectrum_color;
}
static void
@ -252,16 +243,6 @@ check_program (Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
}
}
static void
check_spectrum (Edje_Spectrum_Directory_Entry *se, Eet_File *ef)
{
if (!se->entry)
error_and_abort(ef, "Spectrum missing a name.\n");
else if (!se->color_list)
error_and_abort(ef, "Spectrum %s is empty. At least one color must be "
"given.", se->entry);
}
static int
data_write_header(Eet_File *ef)
{
@ -664,20 +645,6 @@ check_groups_names(Eet_File *ef)
error_and_abort(ef, "Collection %i: name missing.\n", de->id);
}
static void
check_spectra(Eet_File *ef)
{
Eina_List *l;
Edje_Spectrum_Directory_Entry *se;
if (!edje_file->spectrum_dir)
return;
/* check that all spectra are valid */
EINA_LIST_FOREACH(edje_file->spectrum_dir->entries, l, se)
check_spectrum(se, ef);
}
static void
check_groups(Eet_File *ef)
{
@ -1079,7 +1046,6 @@ data_write(void)
&input_raw_bytes);
check_groups_names(ef);
check_spectra(ef);
check_groups(ef);
total_bytes += data_write_groups(ef, &collection_num);
@ -1180,17 +1146,6 @@ data_queue_image_lookup(char *name, int *dest, Eina_Bool *set)
il->set = set;
}
void
data_queue_spectrum_lookup(char *name, int *dest)
{
Spectrum_Lookup *sl;
sl = mem_alloc(SZ(Spectrum_Lookup));
spectrum_lookups = eina_list_append(spectrum_lookups, sl);
sl->name = mem_strdup(name);
sl->dest = dest;
}
void
data_queue_part_slave_lookup(int *master, int *slave)
{
@ -1213,17 +1168,6 @@ data_queue_image_slave_lookup(int *master, int *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 = eina_list_append(spectrum_slave_lookups, sl);
sl->master = master;
sl->slave = slave;
}
void
handle_slave_lookup(Eina_List *list, int *master, int value)
{
@ -1371,40 +1315,6 @@ data_process_lookups(void)
free(il);
}
while (spectrum_lookups)
{
Spectrum_Lookup *il;
Edje_Spectrum_Directory_Entry *de;
il = eina_list_data_get(spectrum_lookups);
if (!edje_file->spectrum_dir)
l = NULL;
else
{
EINA_LIST_FOREACH(edje_file->spectrum_dir->entries, l, de)
{
*(il->dest) = 1;
if ((de->entry) && (!strcmp(de->entry, il->name)))
{
handle_slave_lookup(spectrum_slave_lookups, il->dest, de->id);
*(il->dest) = de->id;
break;
}
}
}
if (!l)
{
ERR("%s: Error. unable to find spectrum name %s",
progname, il->name);
exit(-1);
}
spectrum_lookups = eina_list_remove(spectrum_lookups, il);
free(il->name);
free(il);
}
while (part_slave_lookups)
{
free(eina_list_data_get(part_slave_lookups));
@ -1416,12 +1326,6 @@ data_process_lookups(void)
free(eina_list_data_get(image_slave_lookups));
image_slave_lookups = eina_list_remove_list(image_slave_lookups, image_slave_lookups);
}
while (spectrum_slave_lookups)
{
free(eina_list_data_get(spectrum_slave_lookups));
spectrum_slave_lookups = eina_list_remove_list(spectrum_slave_lookups, spectrum_slave_lookups);
}
}
static void

View File

@ -1103,92 +1103,37 @@ _edje_part_recalc_single_fill(Edje_Real_Part *ep,
Edje_Calc_Params *params,
int flags)
{
if (ep->part->type == EDJE_PART_TYPE_GRADIENT && desc->gradient.use_rel && (!desc->gradient.type || !strcmp(desc->gradient.type, "linear")))
params->smooth = desc->fill.smooth;
if (flags & FLAG_X)
{
int x2, y2;
int dx, dy;
int angle;
int fw;
params->type.common.fill.x = desc->gradient.rel1.offset_x
+ TO_INT(SCALE(desc->gradient.rel1.relative_x, params->w));
params->type.common.fill.y = desc->gradient.rel1.offset_y
+ TO_INT((SCALE(desc->gradient.rel1.relative_y, params->h)));
x2 = desc->gradient.rel2.offset_x
+ TO_INT(SCALE(desc->gradient.rel2.relative_x, params->w));
y2 = desc->gradient.rel2.offset_y
+ TO_INT(SCALE(desc->gradient.rel2.relative_y, params->h));
params->type.common.fill.w = 1; /* doesn't matter for linear grads */
dy = y2 - params->type.common.fill.y;
dx = x2 - params->type.common.fill.x;
params->type.common.fill.h = TO_INT(SQRT(FROM_INT(dx * dx + dy * dy)));
params->type.common.fill.spread = desc->fill.spread;
if (dx == 0 && dy == 0)
{
angle = 0;
}
else if (dx == 0)
{
if (dy > 0) angle = 0;
else angle = 180;
}
else if (dy == 0)
{
if (dx > 0) angle = 270;
else angle = 90;
}
if (desc->fill.type == EDJE_FILL_TYPE_TILE)
evas_object_image_size_get(ep->object, &fw, NULL);
else
{
double m; /* FIXME: atan isn't available atm in eina fp implementation */
m = (double)dx / (double)dy;
angle = atan(m) * 180 / M_PI;
if (dy < 0)
angle = 180 - angle;
else
angle = 360 - angle;
}
params->type.common.fill.angle = angle;
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));
}
else
if (flags & FLAG_Y)
{
params->smooth = desc->fill.smooth;
if (flags & FLAG_X)
{
int fw;
int fh;
if (desc->fill.type == EDJE_FILL_TYPE_TILE)
evas_object_image_size_get(ep->object, &fw, NULL);
else
fw = params->w;
if (desc->fill.type == EDJE_FILL_TYPE_TILE)
evas_object_image_size_get(ep->object, NULL, &fh);
else
fh = params->h;
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));
}
if (flags & FLAG_Y)
{
int fh;
if (desc->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.angle = desc->fill.angle;
params->type.common.fill.spread = desc->fill.spread;
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.angle = desc->fill.angle;
params->type.common.fill.spread = desc->fill.spread;
}
static void
@ -1335,8 +1280,7 @@ _edje_part_recalc_single(Edje *ed,
_edje_part_recalc_single_drag(ep, confine_to, params, minw, minh, maxw, maxh, flags);
/* fill */
if (ep->part->type == EDJE_PART_TYPE_IMAGE ||
ep->part->type == EDJE_PART_TYPE_GRADIENT)
if (ep->part->type == EDJE_PART_TYPE_IMAGE)
_edje_part_recalc_single_fill(ep, desc, params, flags);
/* colors */
@ -1376,10 +1320,6 @@ _edje_part_recalc_single(Edje *ed,
params->type.common.spec.image.b = desc->border.b;
}
break;
case EDJE_PART_TYPE_GRADIENT:
params->type.common.spec.gradient.id = desc->gradient.id;
params->type.common.spec.gradient.type = desc->gradient.type;
break;
case EDJE_PART_TYPE_TEXT:
case EDJE_PART_TYPE_TEXTBLOCK:
/* text.align */
@ -1423,41 +1363,10 @@ _edje_part_recalc_single(Edje *ed,
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
break;
}
}
static void
_edje_gradient_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description *chosen_desc __UNUSED__)
{
evas_object_gradient_fill_angle_set(ep->object, p3->type.common.fill.angle);
evas_object_gradient_fill_spread_set(ep->object, p3->type.common.fill.spread);
evas_object_gradient_fill_set(ep->object, p3->type.common.fill.x, p3->type.common.fill.y,
p3->type.common.fill.w, p3->type.common.fill.h);
if (p3->type.common.spec.gradient.type && p3->type.common.spec.gradient.type[0])
evas_object_gradient_type_set(ep->object, p3->type.common.spec.gradient.type, NULL);
if (ed->file->spectrum_dir && ed->file->spectrum_dir->entries &&
p3->type.common.spec.gradient.id != ep->gradient_id)
{
Edje_Spectrum_Directory_Entry *se;
Edje_Spectrum_Color *sc;
Eina_List *l;
se = eina_list_nth(ed->file->spectrum_dir->entries, p3->type.common.spec.gradient.id);
if (se)
{
evas_object_gradient_clear(ep->object);
EINA_LIST_FOREACH(se->color_list, l, sc)
{
evas_object_gradient_color_stop_add(ep->object, sc->r,
sc->g, sc->b, 255,
sc->d);
evas_object_gradient_alpha_stop_add(ep->object,
sc->a, sc->d);
}
ep->gradient_id = p3->type.common.spec.gradient.id;
}
case EDJE_PART_TYPE_GRADIENT:
/* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */
abort();
break;
}
}
@ -1714,6 +1623,10 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
FLOAT_T pos = ZERO;
Edje_Calc_Params lp3;
/* GRADIENT ARE GONE, WE MUST IGNORE IT FROM OLD FILE. */
if (ep->part->type == EDJE_PART_TYPE_GRADIENT)
return;
if ((ep->calculated & FLAG_XY) == FLAG_XY)
{
return;
@ -1961,24 +1874,14 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
switch (part_type)
{
case EDJE_PART_TYPE_IMAGE:
case EDJE_PART_TYPE_GRADIENT:
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);
if (part_type == EDJE_PART_TYPE_GRADIENT)
{
p3->type.common.fill.angle = INTP(p1->type.common.fill.angle, p2->type.common.fill.angle, pos);
p3->type.common.fill.spread = (beginning_pos) ? p1->type.common.fill.spread : p2->type.common.fill.spread;
p3->type.common.spec.gradient = (beginning_pos) ? p1->type.common.spec.gradient : p2->type.common.spec.gradient;
}
else
{
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);
}
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);
break;
case EDJE_PART_TYPE_TEXT:
p3->type.text.size = INTP(p1->type.text.size, p2->type.text.size, pos);
@ -2033,7 +1936,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
chosen_desc->image.scale_hint);
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_TEXTBLOCK:
case EDJE_PART_TYPE_GRADIENT:
case EDJE_PART_TYPE_BOX:
case EDJE_PART_TYPE_TABLE:
evas_object_color_set(ep->object,
@ -2060,6 +1962,10 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
case EDJE_PART_TYPE_TEXT:
/* This is correctly handle in _edje_text_recalc_apply at the moment. */
break;
case EDJE_PART_TYPE_GRADIENT:
/* FIXME: definitivly remove this code when we switch to new format. */
abort();
break;
}
/* Some object need special recalc. */
@ -2071,9 +1977,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
case EDJE_PART_TYPE_IMAGE:
_edje_image_recalc_apply(ed, ep, pf, chosen_desc, pos);
break;
case EDJE_PART_TYPE_GRADIENT:
_edje_gradient_recalc_apply(ed, ep, pf, chosen_desc);
break;
case EDJE_PART_TYPE_BOX:
_edje_box_recalc_apply(ed, ep, pf, chosen_desc);
break;
@ -2087,6 +1990,10 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
case EDJE_PART_TYPE_TEXTBLOCK:
/* Nothing special to do for this type of object. */
break;
case EDJE_PART_TYPE_GRADIENT:
/* FIXME: definitivly remove this code when we switch to new format. */
abort();
break;
}
if (ep->swallowed_object)

View File

@ -211,7 +211,6 @@ _edje_file_convert(Eet_File *file, Old_Edje_File *oedf)
goto on_error;
edf->oef = oedf;
edf->spectrum_dir = oedf->spectrum_dir;
edf->styles = oedf->styles;
edf->color_classes = oedf->color_classes;
edf->version = oedf->version;

View File

@ -30,7 +30,6 @@ struct _Old_Edje_File
Old_Edje_External_Directory *external_dir;
Old_Edje_Font_Directory *font_dir;
Old_Edje_Image_Directory *image_dir;
Edje_Spectrum_Directory *spectrum_dir;
Edje_Part_Collection_Directory *collection_dir;
Eina_List *data;
Eina_List *styles;

View File

@ -17,9 +17,6 @@ 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_set = NULL;
EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_set_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_target = NULL;
EAPI Eet_Data_Descriptor *_edje_edd_edje_program_after = NULL;
@ -53,9 +50,6 @@ _edje_edd_shutdown(void)
FREED(_edje_edd_edje_font_directory_entry);
FREED(_edje_edd_edje_image_directory);
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_target);
FREED(_edje_edd_edje_program_after);
@ -134,29 +128,6 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Old_Edje_Image_Directory, "entries", entries, _edje_edd_edje_image_directory_entry);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Old_Edje_Image_Directory, "sets", sets, _edje_edd_edje_image_directory_set);
/* spectrum directory */
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Spectrum_Color);
_edje_edd_edje_spectrum_color =
eet_data_descriptor_file_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);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Spectrum_Directory_Entry);
_edje_edd_edje_spectrum_directory_entry =
eet_data_descriptor_file_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);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Spectrum_Directory);
_edje_edd_edje_spectrum_directory =
eet_data_descriptor_file_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 */
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Collection_Directory_Entry);
_edje_edd_edje_part_collection_directory_entry =
@ -215,7 +186,6 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "external_dir", external_dir, _edje_edd_edje_external_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "font_dir", font_dir, _edje_edd_edje_font_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "spectrum_dir", spectrum_dir, _edje_edd_edje_spectrum_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "collection_dir", collection_dir, _edje_edd_edje_part_collection_directory);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Old_Edje_File, "data", data, _edje_edd_edje_data);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Old_Edje_File, "styles", styles, _edje_edd_edje_style);
@ -357,17 +327,6 @@ _edje_edd_init(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_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, "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);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.use_rel", gradient.use_rel, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.relative_x", gradient.rel1.relative_x, EDJE_T_FLOAT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.relative_y", gradient.rel1.relative_y, EDJE_T_FLOAT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.offset_x", gradient.rel1.offset_x, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.offset_y", gradient.rel1.offset_y, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.relative_x", gradient.rel2.relative_x, EDJE_T_FLOAT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.relative_y", gradient.rel2.relative_y, EDJE_T_FLOAT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.offset_x", gradient.rel2.offset_x, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.offset_y", gradient.rel2.offset_y, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.layout", box.layout, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.alt_layout", box.alt_layout, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.align.x", box.align.x, EDJE_T_FLOAT);

View File

@ -678,38 +678,6 @@ _edje_if_string_free(Edje *ed, const char *str)
str = NULL;
}
static Edje_Spectrum_Directory_Entry *
_edje_edit_spectrum_entry_get(Edje *ed, const char* spectra)
{
Edje_Spectrum_Directory_Entry *s;
Eina_List *l;
if (!ed->file || !spectra || !ed->file->spectrum_dir)
return NULL;
EINA_LIST_FOREACH(ed->file->spectrum_dir->entries, l, s)
if (!strcmp(s->entry, spectra))
return s;
return NULL;
}
static Edje_Spectrum_Directory_Entry *
_edje_edit_spectrum_entry_get_by_id(Edje *ed, int spectra_id)
{
Edje_Spectrum_Directory_Entry *s;
Eina_List *l;
if (!ed->file || !ed->file->spectrum_dir)
return NULL;
EINA_LIST_FOREACH(ed->file->spectrum_dir->entries, l, s)
if (s->id == spectra_id)
return s;
return NULL;
}
static Edje_Style *
_edje_edit_style_get(Edje *ed, const char *name)
{
@ -1971,8 +1939,6 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type
}
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
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
ERR("wrong part type %i!", ep->type);
if (rp->object)
@ -2010,8 +1976,6 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type
evas_object_clip_set(rp->object, ed->clipper);
evas_object_show(ed->clipper);
}
rp->gradient_id = -1;
/* Update table_parts */
ed->table_parts_size++;
@ -2841,15 +2805,6 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double
pd->text.align.y = 0.5;
pd->text.id_source = -1;
pd->text.id_text_source = -1;
pd->gradient.rel1.relative_x = 0;
pd->gradient.rel1.relative_y = 0;
pd->gradient.rel1.offset_x = 0;
pd->gradient.rel1.offset_y = 0;
pd->gradient.rel2.relative_x = 1;
pd->gradient.rel2.relative_y = 1;
pd->gradient.rel2.offset_x = -1;
pd->gradient.rel2.offset_y = -1;
pd->gradient.use_rel = 1;
if ((rp->part->type == EDJE_PART_TYPE_EXTERNAL) && (rp->part->source))
{
@ -2962,18 +2917,6 @@ edje_edit_state_copy(Evas_Object *obj, const char *part, const char *from, doubl
new_i->id = i->id;
pdto->image.tween_list = eina_list_append(pdto->image.tween_list, new_i);
}
PD_STRING_COPY(gradient.type);
PD_STRING_COPY(gradient.params);
PD_COPY(gradient.id);
PD_COPY(gradient.use_rel);
PD_COPY(gradient.rel1.relative_x);
PD_COPY(gradient.rel1.relative_y);
PD_COPY(gradient.rel1.offset_x);
PD_COPY(gradient.rel1.offset_y);
PD_COPY(gradient.rel2.relative_x);
PD_COPY(gradient.rel2.relative_y);
PD_COPY(gradient.rel2.offset_x);
PD_COPY(gradient.rel2.offset_y);
PD_COPY(border.l);
PD_COPY(border.r);
PD_COPY(border.t);
@ -4823,457 +4766,6 @@ edje_edit_state_image_border_fill_set(Evas_Object *obj, const char *part, const
edje_object_calc_force(obj);
}
/******************/
/* SPECTRUM API */
/******************/
EAPI Eina_List *
edje_edit_spectrum_list_get(Evas_Object *obj)
{
Edje_Spectrum_Directory_Entry *s;
Eina_List *spectrum = NULL;
Eina_List *l;
GET_ED_OR_RETURN(NULL);
if (!ed->file) return NULL;
if (!ed->file->spectrum_dir) return NULL;
//printf("GET SPECTRUM LIST for %s\n", ed->file->path);
EINA_LIST_FOREACH(ed->file->spectrum_dir->entries, l, s)
{
//printf("SPECTRUM: %s [id: %d]\n", s->entry, s->id);
spectrum = eina_list_append(spectrum, eina_stringshare_add(s->entry));
}
return spectrum;
}
EAPI Eina_Bool
edje_edit_spectra_add(Evas_Object *obj, const char* name)
{
GET_ED_OR_RETURN(EINA_FALSE);
//printf("SPECTRA ADD [new name:%s]\n", name);
Edje_Spectrum_Directory_Entry *s;
if (!ed->file) return EINA_FALSE;
if (_edje_edit_spectrum_entry_get(ed, name)) return EINA_FALSE;
if (!ed->file->spectrum_dir)
{
ed->file->spectrum_dir = _alloc(sizeof(Edje_Spectrum_Directory));
if (!ed->file->spectrum_dir) return EINA_FALSE;
}
s = _alloc(sizeof(Edje_Spectrum_Directory_Entry));
if (!s) return EINA_FALSE;
ed->file->spectrum_dir->entries = eina_list_append(ed->file->spectrum_dir->entries, s);
s->id = eina_list_count(ed->file->spectrum_dir->entries) - 1; //TODO Search for id holes
s->entry = (char*)eina_stringshare_add(name);
s->filename = NULL;
s->color_list = NULL;
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_spectra_del(Evas_Object *obj, const char* spectra)
{
Edje_Spectrum_Directory_Entry *s;
GET_ED_OR_RETURN(EINA_FALSE);
s = _edje_edit_spectrum_entry_get(ed, spectra);
if (!s) return EINA_FALSE;
//printf("SPECTRA DEL %s\n", spectra);
ed->file->spectrum_dir->entries = eina_list_remove(ed->file->spectrum_dir->entries, s);
_edje_if_string_free(ed, s->entry);
_edje_if_string_free(ed, s->filename);
while (s->color_list)
{
Edje_Spectrum_Color *color;
color = eina_list_data_get(s->color_list);
free(color);
s->color_list = eina_list_remove_list(s->color_list, s->color_list);
}
free(s);
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_spectra_name_set(Evas_Object *obj, const char* spectra, const char* name)
{
Edje_Spectrum_Directory_Entry *s;
GET_ED_OR_RETURN(EINA_FALSE);
//printf("SET SPECTRA NAME for spectra: %s [new name:%s]\n", spectra, name);
s = _edje_edit_spectrum_entry_get(ed, spectra);
if (!s) return EINA_FALSE;
_edje_if_string_free(ed, s->entry);
s->entry = (char*)eina_stringshare_add(name);
return EINA_TRUE;
}
EAPI int
edje_edit_spectra_stop_num_get(Evas_Object *obj, const char* spectra)
{
Edje_Spectrum_Directory_Entry *s;
GET_ED_OR_RETURN(EINA_FALSE);
//printf("GET SPECTRA STOP NUM for spectra: %s\n", spectra);
s = _edje_edit_spectrum_entry_get(ed, spectra);
if (!s) return EINA_FALSE;
return eina_list_count(s->color_list);
}
EAPI Eina_Bool
edje_edit_spectra_stop_num_set(Evas_Object *obj, const char* spectra, int num)
{
Edje_Spectrum_Directory_Entry *s;
Edje_Spectrum_Color *color;
GET_ED_OR_RETURN(EINA_FALSE);
//printf("SET SPECTRA STOP NUM for spectra: %s\n", spectra);
s = _edje_edit_spectrum_entry_get(ed, spectra);
if (!s) return EINA_FALSE;
if (num == (int) eina_list_count(s->color_list)) return EINA_TRUE;
//destroy all colors
while (s->color_list)
{
color = eina_list_data_get(s->color_list);
free(color);
s->color_list = eina_list_remove_list(s->color_list, s->color_list);
}
//... and recreate (TODO we should optimize this function)
while (num)
{
color = _alloc(sizeof(Edje_Spectrum_Color));
if (!color) return EINA_FALSE;
s->color_list = eina_list_append(s->color_list, color);
color->r = 255;
color->g = 255;
color->b = 255;
color->a = 255;
color->d = 10;
num--;
}
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_spectra_stop_color_get(Evas_Object *obj, const char* spectra, int stop_number, int *r, int *g, int *b, int *a, int *d)
{
Edje_Spectrum_Directory_Entry *s;
Edje_Spectrum_Color *color;
GET_ED_OR_RETURN(EINA_FALSE);
s = _edje_edit_spectrum_entry_get(ed, spectra);
if (!s) return EINA_FALSE;
//printf("GET SPECTRA STOP COLOR for spectra: %s stopn: %d\n", spectra, stop_number);
color = eina_list_nth(s->color_list, stop_number);
if (!color) return EINA_FALSE;
if (r) *r = color->r;
if (g) *g = color->g;
if (b) *b = color->b;
if (a) *a = color->a;
if (d) *d = color->d;
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_spectra_stop_color_set(Evas_Object *obj, const char* spectra, int stop_number, int r, int g, int b, int a, int d)
{
Edje_Spectrum_Directory_Entry *s;
Edje_Spectrum_Color *color;
GET_ED_OR_RETURN(EINA_FALSE);
s = _edje_edit_spectrum_entry_get(ed, spectra);
if (!s) return EINA_FALSE;
//printf("SET SPECTRA STOP COLOR for spectra: %s stopn: %d\n", spectra, stop_number);
color = eina_list_nth(s->color_list, stop_number);
if (!color) return EINA_FALSE;
color->r = r;
color->g = g;
color->b = b;
color->a = a;
color->d = d;
edje_object_calc_force(obj);
return EINA_TRUE;
}
/******************/
/* GRADIENT API */
/******************/
EAPI const char *
edje_edit_state_gradient_type_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(NULL);
if (!pd->gradient.type)
return NULL;
// printf("GET GRADIENT TYPE for part: %s state: %s [%s]\n", part, state, pd->gradient.type);
return eina_stringshare_add(pd->gradient.type);
}
EAPI Eina_Bool
edje_edit_state_gradient_type_set(Evas_Object *obj, const char *part, const char *state, double value, const char *type)
{
GET_PD_OR_RETURN(EINA_FALSE);
if (!type) return EINA_FALSE;
// printf("SET GRADIENT TYPE for part: %s state: %s TO: %s\n", part, state, type);
_edje_if_string_free(ed, pd->gradient.type);
pd->gradient.type = (char *)eina_stringshare_add(type);
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_use_fill_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(EINA_FALSE);
if (!pd->gradient.type)
return EINA_FALSE;
//~ if (!strcmp(pd->gradient.type, "linear"))
//~ return 0;
return EINA_TRUE;
}
EAPI const char *
edje_edit_state_gradient_spectra_get(Evas_Object *obj, const char *part, const char *state, double value)
{
Edje_Spectrum_Directory_Entry *s;
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT SPECTRA for part: %s state: %s\n", part, state);
s = _edje_edit_spectrum_entry_get_by_id(ed, pd->gradient.id);
if (!s) return 0;
return eina_stringshare_add(s->entry);
}
EAPI Eina_Bool
edje_edit_state_gradient_spectra_set(Evas_Object *obj, const char *part, const char *state, double value, const char* spectra)
{
Edje_Spectrum_Directory_Entry *s;
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT SPECTRA for part: %s state: %s [%s]\n", part, state, spectra);
s = _edje_edit_spectrum_entry_get(ed, spectra);
if (!s) return EINA_FALSE;
pd->gradient.id = s->id;
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI int
edje_edit_state_gradient_angle_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
return pd->fill.angle;
}
EAPI void
edje_edit_state_gradient_angle_set(Evas_Object *obj, const char *part, const char *state, double value, int angle)
{
GET_PD_OR_RETURN();
pd->fill.angle = angle;
edje_object_calc_force(obj);
}
EAPI double
edje_edit_state_gradient_rel1_relative_x_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT REL1 RELX for part: %s state: %s [%f]\n", part, state, pd->gradient.rel1.relative_x);
return TO_DOUBLE(pd->gradient.rel1.relative_x);
}
EAPI double
edje_edit_state_gradient_rel1_relative_y_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT REL1 RELY for part: %s state: %s [%f]\n", part, state, pd->gradient.rel1.relative_y);
return TO_DOUBLE(pd->gradient.rel1.relative_y);
}
EAPI double
edje_edit_state_gradient_rel2_relative_x_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT REL2 RELX for part: %s state: %s [%f]\n", part, state, pd->gradient.rel2.relative_x);
return TO_DOUBLE(pd->gradient.rel2.relative_x);
}
EAPI double
edje_edit_state_gradient_rel2_relative_y_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT REL2 RELY for part: %s state: %s [%f]\n", part, state, pd->gradient.rel2.relative_y);
return TO_DOUBLE(pd->gradient.rel2.relative_y);
}
EAPI Eina_Bool
edje_edit_state_gradient_rel1_relative_x_set(Evas_Object *obj, const char *part, const char *state, double value, double val)
{
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL1 RELX for part: %s state: %s [TO %f]\n", part, state, val);
pd->gradient.rel1.relative_x = FROM_DOUBLE(val);
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel1_relative_y_set(Evas_Object *obj, const char *part, const char *state, double value, double val)
{
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL1 RELY for part: %s state: %s [TO %f]\n", part, state, val);
pd->gradient.rel1.relative_y = FROM_DOUBLE(val);
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel2_relative_x_set(Evas_Object *obj, const char *part, const char *state, double value, double val)
{
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL2 RELX for part: %s state: %s [TO %f]\n", part, state, val);
pd->gradient.rel2.relative_x = FROM_DOUBLE(val);
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel2_relative_y_set(Evas_Object *obj, const char *part, const char *state, double value, double val)
{
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL2 RELY for part: %s state: %s [TO %f]\n", part, state, val);
pd->gradient.rel2.relative_y = FROM_DOUBLE(val);
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI int
edje_edit_state_gradient_rel1_offset_x_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT REL1 OFFSETX for part: %s state: %s [%f]\n", part, state, pd->gradient.rel1.offset_x);
return pd->gradient.rel1.offset_x;
}
EAPI int
edje_edit_state_gradient_rel1_offset_y_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT REL1 OFFSETY for part: %s state: %s [%f]\n", part, state, pd->gradient.rel1.offset_y);
return pd->gradient.rel1.offset_y;
}
EAPI int
edje_edit_state_gradient_rel2_offset_x_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT REL2 OFFSETX for part: %s state: %s [%f]\n", part, state, pd->gradient.rel2.offset_x);
return pd->gradient.rel2.offset_x;
}
EAPI int
edje_edit_state_gradient_rel2_offset_y_get(Evas_Object *obj, const char *part, const char *state, double value)
{
GET_PD_OR_RETURN(0);
//printf("GET GRADIENT REL2 OFFSETY for part: %s state: %s [%f]\n", part, state, pd->gradient.rel2.offset_y);
return pd->gradient.rel2.offset_y;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel1_offset_x_set(Evas_Object *obj, const char *part, const char *state, double value, int val)
{
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL1 OFFSETX for part: %s state: %s [TO %d]\n", part, state, val);
pd->gradient.rel1.offset_x = val;
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel1_offset_y_set(Evas_Object *obj, const char *part, const char *state, double value, int val)
{
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL1 OFFSETY for part: %s state: %s [TO %d]\n", part, state, val);
pd->gradient.rel1.offset_y = val;
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel2_offset_x_set(Evas_Object *obj, const char *part, const char *state, double value, int val)
{
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL2 OFFSETX for part: %s state: %s [TO %d]\n", part, state, val);
pd->gradient.rel2.offset_x = val;
edje_object_calc_force(obj);
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel2_offset_y_set(Evas_Object *obj, const char *part, const char *state, double value, int val)
{
GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL2 OFFSETY for part: %s state: %s [TO %d]\n", part, state, val);
pd->gradient.rel2.offset_y = val;
edje_object_calc_force(obj);
return EINA_TRUE;
}
/******************/
/* PROGRAMS API */
/******************/
@ -6091,32 +5583,9 @@ edje_edit_script_get(Evas_Object *obj)
#define BUF_APPENDF(FMT, ...) \
ret &= eina_strbuf_append_printf(buf, FMT, ##__VA_ARGS__)
static char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK", "GRADIENT", "GROUP", "BOX", "TABLE", "EXTERNAL"};
static char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK", "GROUP", "BOX", "TABLE", "EXTERNAL"};
static char *effects[] = {"NONE", "PLAIN", "OUTLINE", "SOFT_OUTLINE", "SHADOW", "SOFT_SHADOW", "OUTLINE_SHADOW", "OUTLINE_SOFT_SHADOW ", "FAR_SHADOW ", "FAR_SOFT_SHADOW", "GLOW"};
static char *prefers[] = {"NONE", "VERTICAL", "HORIZONTAL", "BOTH"};
static Eina_Bool
_edje_generate_source_of_spectra(Edje * ed, const char *name, Eina_Strbuf *buf)
{
Edje_Spectrum_Directory_Entry *d;
Edje_Spectrum_Color *color = NULL;
Eina_List *l;
Eina_Bool ret = EINA_TRUE;
if (!ed || !name || !buf) return EINA_FALSE;
if ((d = _edje_edit_spectrum_entry_get(ed, name)))
{
BUF_APPENDF(I1 "spectrum { name: \"%s\";\n", d->entry);
EINA_LIST_FOREACH(d->color_list, l, color)
if (color)
BUF_APPENDF(I2 "color: %d %d %d %d %d;\n", color->r, color->g,
color->b, color->a, color->d);
BUF_APPEND(I1 "}\n");
}
return ret;
}
static Eina_Bool
_edje_generate_source_of_colorclass(Edje * ed, const char *name, Eina_Strbuf *buf)
@ -6422,16 +5891,12 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
}
//Fill
if (rp->part->type == EDJE_PART_TYPE_IMAGE ||
rp->part->type == EDJE_PART_TYPE_GRADIENT)
if (rp->part->type == EDJE_PART_TYPE_IMAGE)
{
BUF_APPEND(I5"fill {\n");
if (rp->part->type == EDJE_PART_TYPE_IMAGE && !pd->fill.smooth)
BUF_APPEND(I6"smooth: 0;\n");
//TODO Support spread
if (rp->part->type == EDJE_PART_TYPE_GRADIENT && pd->fill.angle)
BUF_APPENDF(I6"angle: %d;\n", pd->fill.angle);
//TODO Support type
if (pd->fill.pos_rel_x || pd->fill.pos_rel_y ||
pd->fill.pos_abs_x || pd->fill.pos_abs_y)
@ -6480,21 +5945,6 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
BUF_APPEND(I5"}\n");
}
//Gradient
if (rp->part->type == EDJE_PART_TYPE_GRADIENT)
{
BUF_APPEND(I5"gradient {\n");
BUF_APPENDF(I6"type: \"%s\";\n", pd->gradient.type);
str = edje_edit_state_gradient_spectra_get(obj, part, state, value);
if (str)
{
BUF_APPENDF(I6"spectrum: \"%s\";\n", str);
edje_edit_string_free(str);
}
//TODO rel1 and 2 seems unused
BUF_APPEND(I5"}\n");
}
//External
if (rp->part->type == EDJE_PART_TYPE_EXTERNAL)
{
@ -6836,25 +6286,6 @@ _edje_generate_source(Evas_Object *obj)
}
}
/* Spectrum */
if ((ll = edje_edit_spectrum_list_get(obj)))
{
BUF_APPEND(I0 "spectra {\n");
EINA_LIST_FOREACH(ll, l, entry)
_edje_generate_source_of_spectra(ed, entry, buf);
BUF_APPEND(I0 "}\n\n");
edje_edit_string_list_free(ll);
if (!ret)
{
ERR("Generating EDC for Spectrum");
eina_strbuf_free(buf);
return NULL;
}
}
/* Styles */
if ((ll = edje_edit_styles_list_get(obj)))
{

View File

@ -433,17 +433,15 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
case EDJE_PART_TYPE_TEXTBLOCK:
rp->object = evas_object_textblock_add(ed->evas);
break;
case EDJE_PART_TYPE_GRADIENT:
rp->object = evas_object_gradient_add(ed->evas);
ERR("SPANK ! SPANK ! SPANK !\nYOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !!\n THEY WILL BE REMOVED SHORTLY !",
ep->name, group, file);
break;
case EDJE_PART_TYPE_BOX:
rp->object = evas_object_box_add(ed->evas);
break;
case EDJE_PART_TYPE_TABLE:
rp->object = evas_object_table_add(ed->evas);
break;
case EDJE_PART_TYPE_GRADIENT:
ERR("SPANK ! SPANK ! SPANK !\nYOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !!\n THEY ARE NOW REMOVED !",
ep->name, group, file);
default:
ERR("wrong part type %i!", ep->type);
break;
@ -475,7 +473,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
if (rp->part->clip_to_id < 0)
evas_object_clip_set(rp->object, ed->clipper);
}
rp->gradient_id = -1;
}
if (n > 0)
{
@ -1057,26 +1054,6 @@ _edje_file_free(Edje_File *edf)
free(edf->image_dir->sets);
free(edf->image_dir);
}
if (edf->spectrum_dir)
{
Edje_Spectrum_Directory_Entry *se;
EINA_LIST_FREE(edf->spectrum_dir->entries, se)
{
Edje_Spectrum_Color *sc;
EINA_LIST_FREE(se->color_list, sc)
free(sc);
if (edf->free_strings)
{
if (se->entry) eina_stringshare_del(se->entry);
if (se->filename) eina_stringshare_del(se->filename);
}
free(se);
}
free(edf->spectrum_dir);
}
EINA_LIST_FREE(edf->color_classes, ecc)
{
@ -1184,8 +1161,6 @@ _edje_collection_free_part_description_free(Edje_Part_Description *desc, Eina_Bo
if (desc->text.text_class) eina_stringshare_del(desc->text.text_class);
if (desc->text.style) eina_stringshare_del(desc->text.style);
if (desc->text.font) eina_stringshare_del(desc->text.font);
if (desc->gradient.type) eina_stringshare_del(desc->gradient.type);
if (desc->gradient.params) eina_stringshare_del(desc->gradient.params);
}
free(desc);
}

View File

@ -221,8 +221,6 @@ typedef struct _Edje_Image_Directory Edje_Image_Directory;
typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
typedef struct _Edje_Image_Directory_Set Edje_Image_Directory_Set;
typedef struct _Edje_Image_Directory_Set_Entry Edje_Image_Directory_Set_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_Target Edje_Program_Target;
typedef struct _Edje_Program_After Edje_Program_After;
@ -233,7 +231,6 @@ typedef struct _Edje_Part_Collection Edje_Part_Collection;
typedef struct _Edje_Part Edje_Part;
typedef struct _Edje_Part_Image_Id Edje_Part_Image_Id;
typedef struct _Edje_Part_Description Edje_Part_Description;
typedef struct _Edje_Spectrum_Color Edje_Spectrum_Color;
typedef struct _Edje_Patterns Edje_Patterns;
typedef struct _Old_Edje_File Old_Edje_File;
@ -322,7 +319,6 @@ struct _Edje_File
Edje_External_Directory *external_dir;
Edje_Image_Directory *image_dir;
Edje_Spectrum_Directory *spectrum_dir;
Eina_List *styles;
Eina_List *color_classes;
@ -439,29 +435,6 @@ struct _Edje_Image_Directory_Set_Entry
} size;
};
/*----------*/
struct _Edje_Spectrum_Directory
{
Eina_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. */
Eina_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 */
@ -673,19 +646,6 @@ struct _Edje_Part_Description
Eina_Bool set; /* if image condition it's content */
} image;
struct {
char *type; /* type of spectrum - 'linear', 'radial', etc */
char *params; /* params for spectrum type */
int id; /* the spectrum id to use */
int use_rel; /* 1 - use rel1,rel2; 0 - use fill */
struct {
FLOAT_T relative_x;
FLOAT_T relative_y;
int offset_x;
int offset_y;
} rel1, rel2; /* linear gradient fill options */
} gradient;
struct {
int l, r, t, b; /* border scaling on image fill */
unsigned char no_fill; /* do we fill the center of the image if bordered? 1 == NO!!!! */
@ -935,10 +895,6 @@ struct _Edje_Calc_Params
struct {
int l, r, t, b; // 16
} image; // 16
struct {
int id; // 4
char *type; // 4
} gradient; // 8
} spec; // 16
} common; // 40
struct {
@ -1050,7 +1006,6 @@ struct _Edje_Real_Part
Edje_Running_Program *program; // 4
int clicked_button; // 4
int gradient_id; // 4 // FIXME: only for gradient
unsigned char calculated; // 1
unsigned char calculating; // 1
@ -1285,8 +1240,6 @@ 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_image_directory;
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_target;
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection_directory;
@ -1295,7 +1248,6 @@ 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_description;
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 Ecore_Animator *_edje_timer;