From: Enlightenment S. <no-...@en...> - 2010-07-13 15:47:27
|
Log: * edje: when gradient meet dodo. Yes, they are gone ! Author: cedric Date: 2010-07-13 08:47:19 -0700 (Tue, 13 Jul 2010) New Revision: 50223 Modified: trunk/edje/src/bin/edje_cc_handlers.c trunk/edje/src/bin/edje_cc_out.c trunk/edje/src/lib/edje_calc.c trunk/edje/src/lib/edje_convert.c trunk/edje/src/lib/edje_convert.h trunk/edje/src/lib/edje_data.c trunk/edje/src/lib/edje_edit.c trunk/edje/src/lib/edje_load.c trunk/edje/src/lib/edje_private.h Modified: trunk/edje/src/bin/edje_cc_handlers.c =================================================================== --- trunk/edje/src/bin/edje_cc_handlers.c 2010-07-13 13:58:37 UTC (rev 50222) +++ trunk/edje/src/bin/edje_cc_handlers.c 2010-07-13 15:47:19 UTC (rev 50223) @@ -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_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_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_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 @@ {"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 @@ {"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 @@ {"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 @@ {"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 @@ {"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}, @@ -1458,90 +1431,6 @@ /** @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 styles @context styles { @@ -2134,7 +2023,6 @@ @li IMAGE @li SWALLOW @li TEXTBLOCK - @li GRADIENT @li GROUP @li BOX @li TABLE @@ -2158,7 +2046,6 @@ "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 @@ 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 @@ 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 @@ .. } @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 @@ -4635,44 +4513,6 @@ @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 - - @property type @parameters TODO @@ -4751,7 +4591,7 @@ 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 @@ 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 @@ 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 @@ 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.", @@ -5450,271 +5290,6 @@ /** - @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} */ Modified: trunk/edje/src/bin/edje_cc_out.c =================================================================== --- trunk/edje/src/bin/edje_cc_out.c 2010-07-13 13:58:37 UTC (rev 50222) +++ trunk/edje/src/bin/edje_cc_out.c 2010-07-13 15:47:19 UTC (rev 50223) @@ -41,7 +41,6 @@ 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 @@ 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 = 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 @@ 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 @@ 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 @@ } } -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) { @@ -665,20 +646,6 @@ } 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) { Eina_List *l; @@ -1079,7 +1046,6 @@ &input_raw_bytes); check_groups_names(ef); - check_spectra(ef); check_groups(ef); total_bytes += data_write_groups(ef, &collection_num); @@ -1181,17 +1147,6 @@ } 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) { Slave_Lookup *sl; @@ -1214,17 +1169,6 @@ } 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) { Eina_List *l; @@ -1371,40 +1315,6 @@ 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 @@ 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 Modified: trunk/edje/src/lib/edje_calc.c =================================================================== --- trunk/edje/src/lib/edje_calc.c 2010-07-13 13:58:37 UTC (rev 50222) +++ trunk/edje/src/lib/edje_calc.c 2010-07-13 15:47:19 UTC (rev 50223) @@ -1103,92 +1103,37 @@ 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_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 @@ 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,45 +1363,14 @@ case EDJE_PART_TYPE_SWALLOW: case EDJE_PART_TYPE_GROUP: break; + case EDJE_PART_TYPE_GRADIENT: + /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */ + abort(); + 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; - } - } -} - -static void _edje_box_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description *chosen_desc) { Evas_Object_Box_Layout layout; @@ -1714,6 +1623,10 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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) Modified: trunk/edje/src/lib/edje_convert.c =================================================================== --- trunk/edje/src/lib/edje_convert.c 2010-07-13 13:58:37 UTC (rev 50222) +++ trunk/edje/src/lib/edje_convert.c 2010-07-13 15:47:19 UTC (rev 50223) @@ -211,7 +211,6 @@ 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; Modified: trunk/edje/src/lib/edje_convert.h =================================================================== --- trunk/edje/src/lib/edje_convert.h 2010-07-13 13:58:37 UTC (rev 50222) +++ trunk/edje/src/lib/edje_convert.h 2010-07-13 15:47:19 UTC (rev 50223) @@ -30,7 +30,6 @@ 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; Modified: trunk/edje/src/lib/edje_data.c =================================================================== --- trunk/edje/src/lib/edje_data.c 2010-07-13 13:58:37 UTC (rev 50222) +++ trunk/edje/src/lib/edje_data.c 2010-07-13 15:47:19 UTC (rev 50223) @@ -17,9 +17,6 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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); Modified: trunk/edje/src/lib/edje_edit.c =================================================================== --- trunk/edje/src/lib/edje_edit.c 2010-07-13 13:58:37 UTC (rev 50222) +++ trunk/edje/src/lib/edje_edit.c 2010-07-13 15:47:19 UTC (rev 50223) @@ -678,38 +678,6 @@ 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 @@ } 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,9 +1976,7 @@ evas_object_clip_set(rp->object, ed->clipper); evas_object_show(ed->clipper); } - rp->gradient_id = -1; - /* Update table_parts */ ed->table_parts_size++; ed->table_parts = realloc(ed->table_parts, @@ -2841,15 +2805,6 @@ 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 @@ 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); @@ -4824,457 +4767,6 @@ } /******************/ -/* 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 */ /******************/ Edje_Program * @@ -6091,33 +5583,10 @@ #define BUF_APPENDF(FMT, ...) \ ret &= eina_strbuf_append_printf(buf, FMT, ##__VA_ARGS__) -static char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK... [truncated message content] |