Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_button.c ewl_calendar.c ewl_label.c ewl_label.h 


Log Message:
Switch label to new API style.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_button.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewl_button.c        3 Oct 2005 06:43:06 -0000       1.5
+++ ewl_button.c        6 Oct 2005 05:01:44 -0000       1.6
@@ -68,7 +68,8 @@
                b->label_object = NULL;
        }
        else if (!b->label_object) {
-               b->label_object = ewl_label_new(l);
+               b->label_object = ewl_label_new();
+               ewl_label_text_set(EWL_LABEL(b->label_object), l);
                ewl_widget_show(b->label_object);
                ewl_container_child_append(EWL_CONTAINER(b), b->label_object);
        }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_calendar.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_calendar.c      3 Oct 2005 06:43:06 -0000       1.8
+++ ewl_calendar.c      6 Oct 2005 05:01:44 -0000       1.9
@@ -78,31 +78,38 @@
        Ewl_Widget* day_label;
        
        /* Add the days*/
-       day_label = ewl_label_new("M");
+       day_label = ewl_label_new();
+       ewl_label_text_set(EWL_LABEL(day_label), "M");
        ewl_grid_add(EWL_GRID(ib->grid), day_label, 1, 1, 1, 1);
        ewl_widget_show(day_label);
 
-       day_label = ewl_label_new("T");
+       day_label = ewl_label_new();
+       ewl_label_text_set(EWL_LABEL(day_label), "T");
        ewl_grid_add(EWL_GRID(ib->grid), day_label, 2, 2, 1, 1);
        ewl_widget_show(day_label);
 
-       day_label = ewl_label_new("W");
+       day_label = ewl_label_new();
+       ewl_label_text_set(EWL_LABEL(day_label), "W");
        ewl_grid_add(EWL_GRID(ib->grid), day_label, 3, 3, 1, 1);
        ewl_widget_show(day_label);
 
-       day_label = ewl_label_new("T");
+       day_label = ewl_label_new();
+       ewl_label_text_set(EWL_LABEL(day_label), "T");
        ewl_grid_add(EWL_GRID(ib->grid), day_label, 4, 4, 1, 1);
        ewl_widget_show(day_label);
 
-       day_label = ewl_label_new("F");
+       day_label = ewl_label_new();
+       ewl_label_text_set(EWL_LABEL(day_label), "F");
        ewl_grid_add(EWL_GRID(ib->grid), day_label, 5, 5, 1, 1);
        ewl_widget_show(day_label);
 
-       day_label = ewl_label_new("S");
+       day_label = ewl_label_new();
+       ewl_label_text_set(EWL_LABEL(day_label), "S");
        ewl_grid_add(EWL_GRID(ib->grid), day_label, 6, 6, 1, 1);
        ewl_widget_show(day_label);
 
-       day_label = ewl_label_new("S");
+       day_label = ewl_label_new();
+       ewl_label_text_set(EWL_LABEL(day_label), "S");
        ewl_grid_add(EWL_GRID(ib->grid), day_label, 7, 7, 1, 1);
        ewl_widget_show(day_label);
 }
@@ -209,7 +216,8 @@
                }
 
                sprintf(day, "%d", cur_day+1); 
-               day_label = ewl_label_new(day);
+               day_label = ewl_label_new();
+               ewl_label_text_set(EWL_LABEL(day_label), day);
                ewl_callback_append(EWL_WIDGET(day_label), 
EWL_CALLBACK_MOUSE_DOWN,ewl_calendar_day_select, cal);
                ewl_callback_append(EWL_WIDGET(day_label), 
EWL_CALLBACK_CLICKED,ewl_calendar_day_pick, cal);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_label.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_label.c 4 Oct 2005 05:23:26 -0000       1.9
+++ ewl_label.c 6 Oct 2005 05:01:44 -0000       1.10
@@ -6,12 +6,11 @@
 static void ewl_label_apply(Ewl_Label *la);
 
 /**
- * @param text: The text to set into the label
  * @return Returns a new Ewl_Widget if successful, NULL on failure
  * @brief Creates a new Ewl_Label widget with the @a text text in it
  */
 Ewl_Widget *
-ewl_label_new(char *text)
+ewl_label_new()
 {
        Ewl_Label *label;
 
@@ -22,7 +21,7 @@
                DRETURN_PTR(NULL, DLEVEL_STABLE);
        }
 
-       if (!ewl_label_init(label, text)) {
+       if (!ewl_label_init(label)) {
                ewl_widget_destroy(EWL_WIDGET(label));
                DRETURN_PTR(NULL, DLEVEL_STABLE);
        }
@@ -31,12 +30,11 @@
 
 /**
  * @param la: The Ewl_Label to initialize
- * @param text: The text to initialize into the widget
  * @return Returns TRUE on success, FALSE on falure
  * @brief Initializes the @a la widget
  */
 int
-ewl_label_init(Ewl_Label *la, char *text)
+ewl_label_init(Ewl_Label *la)
 {
        Ewl_Widget *w;
 
@@ -54,9 +52,7 @@
        ewl_callback_append(w, EWL_CALLBACK_REALIZE, ewl_label_realize_cb, 
NULL);
        ewl_callback_append(w, EWL_CALLBACK_DESTROY, ewl_label_destroy_cb, 
NULL);
 
-       ewl_label_text_set(la, text);
-
-       DRETURN_INT(1, DLEVEL_STABLE);
+       DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
 
 /**
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_label.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_label.h 21 Jul 2005 06:46:00 -0000      1.3
+++ ewl_label.h 6 Oct 2005 05:01:44 -0000       1.4
@@ -31,8 +31,8 @@
        char * text;            /**< The text set into the widget */
 };
 
-Ewl_Widget *ewl_label_new(char *text);
-int         ewl_label_init(Ewl_Label *la, char *text);
+Ewl_Widget *ewl_label_new();
+int         ewl_label_init(Ewl_Label *la);
 
 void        ewl_label_text_set(Ewl_Label *la, char *text);
 char      *ewl_label_text_get(Ewl_Label *la);




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to