Enlightenment CVS committal

Author  : davemds
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        edje_edit.c 


Log Message:
 * withspaces and similar

===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_edit.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- edje_edit.c 13 Jul 2008 14:18:17 -0000      1.20
+++ edje_edit.c 13 Jul 2008 14:29:18 -0000      1.21
@@ -8,7 +8,6 @@
  * Modify edje so that also ebryo source is included in the eet file
  * Write decompile info (print source) back to edje file
  * Remove images/fonts
- * Gradients
  * Draggies
  *
  */
@@ -550,6 +549,7 @@
    evas_stringshare_del(str);
    str = NULL;
 }
+
 Edje_Spectrum_Directory_Entry *
 _edje_edit_spectrum_entry_get(Edje *ed, const char* spectra)
 {
@@ -2821,7 +2821,7 @@
 edje_edit_spectrum_list_get(Evas_Object *obj)
 {
    Edje_Spectrum_Directory_Entry *s;
-   Evas_List *spectrums = NULL;
+   Evas_List *spectrum = NULL;
    Evas_List *l;
 
    GET_ED_OR_RETURN(NULL);
@@ -2834,12 +2834,11 @@
    for (l = ed->file->spectrum_dir->entries; l; l = l->next)
      {
        s = l->data;
-        printf("SPECTRUM: %s [id: %d]\n", s->entry, s->id);
-       spectrums = evas_list_append(spectrums, evas_stringshare_add(s->entry));
+       printf("SPECTRUM: %s [id: %d]\n", s->entry, s->id);
+       spectrum = evas_list_append(spectrum, evas_stringshare_add(s->entry));
      }
 
-   return spectrums;
-   return NULL;
+   return spectrum;
 }
 
 
@@ -2848,26 +2847,26 @@
 {
    int id;
    GET_ED_OR_RETURN(0);
-   
+
    printf("SPECTRA ADD [new name:%s]\n", name);
-   
+
    Edje_Spectrum_Directory_Entry *s;
    Evas_List *l;
-   
+
    if (!ed->file) return 0;
-   
+
    if (_edje_edit_spectrum_entry_get(ed, name)) return 0;
-   
+
    if (!ed->file->spectrum_dir)
      ed->file->spectrum_dir = mem_alloc(SZ(Edje_Spectrum_Directory));
-   
+
    s = mem_alloc(SZ(Edje_Spectrum_Directory_Entry));
    ed->file->spectrum_dir->entries = 
evas_list_append(ed->file->spectrum_dir->entries, s);
-   s->id = evas_list_count(ed->file->spectrum_dir->entries) - 1;
+   s->id = evas_list_count(ed->file->spectrum_dir->entries) - 1; //TODO Search 
for id holes
    s->entry = (char*)evas_stringshare_add(name);
    s->filename = NULL;
    s->color_list = NULL;
-   
+
    return 1;
 }
 
@@ -2875,14 +2874,14 @@
 edje_edit_spectra_del(Evas_Object *obj, const char* spectra)
 {
    Edje_Spectrum_Directory_Entry *s;
-   
+
    GET_ED_OR_RETURN(0);
-   
+
    s = _edje_edit_spectrum_entry_get(ed, spectra);
    if (!s) return 0;
-   
+
    printf("SPECTRA DEL %s\n", spectra);
-   
+
    ed->file->spectrum_dir->entries = 
evas_list_remove(ed->file->spectrum_dir->entries, s);
    _edje_if_string_free(ed, s->entry);
    _edje_if_string_free(ed, s->filename);
@@ -2894,7 +2893,7 @@
         s->color_list = evas_list_remove_list(s->color_list, s->color_list);
      }
    free(s);
-   
+
    return 1;
 }
 
@@ -2902,17 +2901,17 @@
 edje_edit_spectra_name_set(Evas_Object *obj, const char* spectra, const char* 
name)
 {
    Edje_Spectrum_Directory_Entry *s;
-   
+
    GET_ED_OR_RETURN(0);
 
    printf("SET SPECTRA NAME for spectra: %s [new name:%s]\n", spectra, name);
-   
+
    s = _edje_edit_spectrum_entry_get(ed, spectra);
    if (!s) return 0;
-   
+
    _edje_if_string_free(ed, s->entry);
    s->entry = (char*)evas_stringshare_add(name);
-   
+
    return 1;
 }
 
@@ -2920,14 +2919,14 @@
 edje_edit_spectra_stop_num_get(Evas_Object *obj, const char* spectra)
 {
    Edje_Spectrum_Directory_Entry *s;
-   
+
    GET_ED_OR_RETURN(-1);
-   
+
    printf("GET SPECTRA STOP NUM for spectra: %s\n", spectra);
-   
+
    s = _edje_edit_spectrum_entry_get(ed, spectra);
    if (!s) return -1;
-   
+
    return evas_list_count(s->color_list);
 }
 
@@ -2937,14 +2936,14 @@
    Edje_Spectrum_Directory_Entry *s;
    Edje_Spectrum_Color *color;
    GET_ED_OR_RETURN(0);
-   
+
    printf("SET SPECTRA STOP NUM for spectra: %s\n", spectra);
-   
+
    s = _edje_edit_spectrum_entry_get(ed, spectra);
    if (!s) return 0;
-   
+
    if (num == evas_list_count(s->color_list)) return 1;
-      
+
    //destroy all colors
    while (s->color_list)
      {
@@ -2952,8 +2951,8 @@
         free(color);
         s->color_list = evas_list_remove_list(s->color_list, s->color_list);
      }
-   
-   //... and recreate
+
+   //... and recreate (TODO we should optimize this function)
    while (num)
      {
         color = mem_alloc(SZ(Edje_Spectrum_Color));
@@ -2965,7 +2964,7 @@
         color->d = 10;
         num--;
      }
-   
+
    return 1;
 }
 
@@ -2975,11 +2974,11 @@
    Edje_Spectrum_Directory_Entry *s;
    Edje_Spectrum_Color *color;
    GET_ED_OR_RETURN(0);
-   
+
    s = _edje_edit_spectrum_entry_get(ed, spectra);
    if (!s) return 0;
    printf("GET SPECTRA STOP COLOR for spectra: %s stopn: %d\n", spectra, 
stop_number);
-   
+
    color = evas_list_nth(s->color_list, stop_number);
    if (!color) return 0;
    if (r) *r = color->r;
@@ -2987,7 +2986,7 @@
    if (b) *b = color->b;
    if (a) *a = color->a;
    if (d) *d = color->d;
-   
+
    return 1;
 }
 
@@ -2997,11 +2996,11 @@
    Edje_Spectrum_Directory_Entry *s;
    Edje_Spectrum_Color *color;
    GET_ED_OR_RETURN(0);
-   
+
    s = _edje_edit_spectrum_entry_get(ed, spectra);
    if (!s) return 0;
    printf("SET SPECTRA STOP COLOR for spectra: %s stopn: %d\n", spectra, 
stop_number);
-   
+
    color = evas_list_nth(s->color_list, stop_number);
    if (!color) return 0;
    color->r = r;
@@ -3009,14 +3008,13 @@
    color->b = b;
    color->a = a;
    color->d = d;
-   
+
    edje_object_calc_force(obj);
-   
+
    return 1;
 }
 
 
-
 /******************/
 /*  GRADIENT API  */
 /******************/
@@ -3038,16 +3036,13 @@
 edje_edit_state_gradient_type_set(Evas_Object *obj, const char *part, const 
char *state, const char *type)
 {
    GET_PD_OR_RETURN(0);
-
    if (!type) return 0;
 
 //   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 *)evas_stringshare_add(type);
-
    edje_object_calc_force(obj);
-   
    return 1;
 }
 
@@ -3059,7 +3054,7 @@
 
    if (!pd->gradient.type)
       return -1;
-   
+
    if (!strcmp(pd->gradient.type, "linear"))
       return 0;
    return 1;
@@ -3069,13 +3064,13 @@
 edje_edit_state_gradient_spectra_get(Evas_Object *obj, const char *part, const 
char *state)
 {
    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 evas_stringshare_add(s->entry);
 }
 
@@ -3083,17 +3078,17 @@
 edje_edit_state_gradient_spectra_set(Evas_Object *obj, const char *part, const 
char *state, const char* spectra)
 {
    Edje_Spectrum_Directory_Entry *s;
-   
+
    GET_PD_OR_RETURN(0);
 
    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 0;
 
    pd->gradient.id = s->id;
    edje_object_calc_force(obj);
-   
+
    return 1;
 }
 
@@ -3182,7 +3177,6 @@
 {
    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;
 }
 
@@ -3191,7 +3185,6 @@
 {
    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;
 }
 
@@ -3200,7 +3193,6 @@
 {
    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;
 }
 
@@ -3209,7 +3201,6 @@
 {
    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;
 }
 



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to