Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_box.c ewl_button.c ewl_callback.c ewl_cell.c ewl_check.c 
        ewl_checkbutton.c ewl_cursor.c ewl_embed.c ewl_entry.c 
        ewl_filedialog.c ewl_fileselector.c ewl_floater.c ewl_grid.c 
        ewl_image.c ewl_imenu.c ewl_macros.h ewl_menu.c 
        ewl_menu_base.c ewl_misc.c ewl_notebook.c ewl_progressbar.c 
        ewl_progressbar.h ewl_radiobutton.c ewl_row.c ewl_scrollbar.c 
        ewl_scrollpane.c ewl_seeker.c ewl_selectionbar.c 
        ewl_selectionbook.c ewl_separator.c ewl_spacer.c 
        ewl_spectrum.c ewl_spinner.c ewl_table.c ewl_text.c 
        ewl_textarea.c ewl_theme.c ewl_tree.c ewl_widget.c 
        ewl_window.c 


Log Message:
Theme bits and improvements on the progressbar. Verified that allocations are
checking for success. The NEW macro now calls calloc since we needed to zero
out allocations anyways.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_box.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- ewl_box.c   18 Oct 2003 17:00:35 -0000      1.56
+++ ewl_box.c   12 Nov 2003 20:07:17 -0000      1.57
@@ -77,7 +77,6 @@
        if (!b)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(b, Ewl_Box, 1);
        if (!ewl_box_init(b, o)) {
                ewl_widget_destroy(EWL_WIDGET(b));
                b = NULL;
@@ -764,7 +763,8 @@
 {
        if (!vertical) {
                vertical = NEW(Box_Orientation, 1);
-               ZERO(vertical, Box_Orientation, 1);
+               if (!vertical)
+                       DRETURN(DLEVEL_STABLE);
 
                /*
                 * This sets the aligments for filling direction.
@@ -804,7 +804,8 @@
 
        if (!horizontal) {
                horizontal = NEW(Box_Orientation, 1);
-               ZERO(horizontal, Box_Orientation, 1);
+               if (!horizontal)
+                       DRETURN(DLEVEL_STABLE);
 
                /*
                 * This sets the aligments for the filling direction.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- ewl_button.c        10 Nov 2003 22:55:27 -0000      1.50
+++ ewl_button.c        12 Nov 2003 20:07:17 -0000      1.51
@@ -15,7 +15,6 @@
        if (!b)
                return NULL;
 
-       ZERO(b, Ewl_Button, 1);
        ewl_button_init(b, label);
 
        DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_callback.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- ewl_callback.c      1 Sep 2003 04:57:07 -0000       1.32
+++ ewl_callback.c      12 Nov 2003 20:07:17 -0000      1.33
@@ -119,7 +119,6 @@
        if (!cb)
                DRETURN_INT(0, DLEVEL_STABLE);
 
-       ZERO(cb, Ewl_Callback, 1);
        cb->func = f;
        cb->user_data = user_data;
 
@@ -163,7 +162,6 @@
        if (!cb)
                DRETURN_INT(0, DLEVEL_STABLE);
 
-       ZERO(cb, Ewl_Callback, 1);
        cb->func = f;
        cb->user_data = user_data;
 
@@ -212,7 +210,6 @@
        if (!cb)
                DRETURN_INT(0, DLEVEL_STABLE);
 
-       ZERO(cb, Ewl_Callback, 1);
        cb->func = f;
        cb->user_data = user_data;
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_cell.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_cell.c  1 Sep 2003 04:57:07 -0000       1.8
+++ ewl_cell.c  12 Nov 2003 20:07:17 -0000      1.9
@@ -21,7 +21,6 @@
        if (!cell)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(cell, Ewl_Cell, 1);
        if (!ewl_cell_init(EWL_CELL(cell))) {
                FREE(cell);
                DRETURN_PTR(NULL, DLEVEL_STABLE);
@@ -67,7 +66,7 @@
        child = ewd_list_goto_first(c->children);
 
        if (child)
-               ewl_object_request_geometry(child, CURRENT_X(w), CURRENT_Y(w),
+               ewl_object_place(child, CURRENT_X(w), CURRENT_Y(w),
                                CURRENT_W(w), CURRENT_H(w));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_check.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_check.c 6 Oct 2003 17:39:54 -0000       1.9
+++ ewl_check.c 12 Nov 2003 20:07:17 -0000      1.10
@@ -24,7 +24,6 @@
        if (!b)
                return NULL;
 
-       ZERO(b, Ewl_Check, 1);
        ewl_check_init(b);
 
        DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_checkbutton.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- ewl_checkbutton.c   6 Oct 2003 17:57:29 -0000       1.36
+++ ewl_checkbutton.c   12 Nov 2003 20:07:17 -0000      1.37
@@ -21,7 +21,6 @@
        if (!b)
                return NULL;
 
-       ZERO(b, Ewl_CheckButton, 1);
        ewl_checkbutton_init(b, label);
 
        DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_cursor.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- ewl_cursor.c        4 Sep 2003 01:48:35 -0000       1.14
+++ ewl_cursor.c        12 Nov 2003 20:07:17 -0000      1.15
@@ -13,8 +13,9 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        c = NEW(Ewl_Cursor, 1);
+       if (!c)
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(c, Ewl_Cursor, 1);
        ewl_cursor_init(c);
 
        DRETURN_PTR(EWL_WIDGET(c), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- ewl_embed.c 8 Nov 2003 08:07:11 -0000       1.13
+++ ewl_embed.c 12 Nov 2003 20:07:17 -0000      1.14
@@ -63,7 +63,6 @@
        if (!w)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(w, Ewl_Embed, 1);
        if (!ewl_embed_init(w)) {
                ewl_widget_destroy(EWL_WIDGET(w));
                w = NULL;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- ewl_entry.c 24 Oct 2003 07:42:38 -0000      1.71
+++ ewl_entry.c 12 Nov 2003 20:07:17 -0000      1.72
@@ -46,8 +46,6 @@
        if (!e)
                return NULL;
 
-       ZERO(e, Ewl_Entry, 1);
-
        ewl_entry_init(e, text);
 
        DRETURN_PTR(EWL_WIDGET(e), DLEVEL_STABLE);
@@ -538,6 +536,10 @@
        sp = ewl_cursor_get_start_position(EWL_CURSOR(e->cursor));
 
        s3 = NEW(char, l + 1 + l2);
+       if (!s3) {
+               FREE(s2);
+               DRETURN(DLEVEL_STABLE);
+       }
 
        s3[0] = 0;
        strncat(s3, s2, sp - 1);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_filedialog.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_filedialog.c    29 Sep 2003 21:46:50 -0000      1.4
+++ ewl_filedialog.c    12 Nov 2003 20:07:17 -0000      1.5
@@ -97,8 +97,6 @@
        od = NEW(Open_Dialog, 1);
        if (!od)
                return;
-       memset(od, 0, sizeof(Open_Dialog));
-
 
        fd->selector = ewl_fileselector_new(cb);
        ewl_object_set_fill_policy(EWL_OBJECT(fd->selector),
@@ -156,8 +154,6 @@
        sd = NEW(Save_Dialog, 1);
        if (!sd)
                return;
-       memset(sd, 0, sizeof(Save_Dialog));
-
 
        fd->selector = ewl_fileselector_new(cb);
        ewl_object_set_fill_policy(EWL_OBJECT(fd->selector),
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fileselector.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_fileselector.c  29 Sep 2003 21:46:50 -0000      1.9
+++ ewl_fileselector.c  12 Nov 2003 20:07:17 -0000      1.10
@@ -85,8 +85,6 @@
        if (!fs)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       memset(fs, 0, sizeof(Ewl_Fileselector));
-
        ewl_fileselector_init(fs, clicked);
 
        DRETURN_PTR(EWL_WIDGET(fs), DLEVEL_STABLE);
@@ -250,12 +248,30 @@
        IF_FREE(fs->d_info);
 
        fs->f_info = NEW(Ewl_Fileinfo, f_count);
+       if (!fs->f_info)
+               DRETURN(DLEVEL_STABLE);
+
        fs->d_info = NEW(Ewl_Dirinfo, d_count);
+       if (!fs->d_info) {
+               FREE(fs->f_info);
+               DRETURN(DLEVEL_STABLE);
+       }
 
        dir_head = NEW(char *, 1);
+       if (!dir_head) {
+               FREE(fs->f_info);
+               FREE(fs->d_info);
+               DRETURN(DLEVEL_STABLE);
+       }
 
        dir_head[0] = "Directory";
        file_head = NEW(char *, 1);
+       if (!file_head) {
+               FREE(fs->f_info);
+               FREE(fs->d_info);
+               FREE(dir_head);
+               DRETURN(DLEVEL_STABLE);
+       }
 
        file_head[0] = "File Name";
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_floater.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- ewl_floater.c       29 Sep 2003 21:46:50 -0000      1.13
+++ ewl_floater.c       12 Nov 2003 20:07:17 -0000      1.14
@@ -31,8 +31,6 @@
        if (!f)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       memset(f, 0, sizeof(Ewl_Floater));
-
        ewl_floater_init(EWL_FLOATER(f), parent);
 
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_grid.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ewl_grid.c  18 Oct 2003 17:00:36 -0000      1.11
+++ ewl_grid.c  12 Nov 2003 20:07:17 -0000      1.12
@@ -28,8 +28,6 @@
        if (!g)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       memset(g, 0, sizeof(Ewl_Grid));
-
        ewl_grid_init(g, cols, rows);
 
        DRETURN_PTR(EWL_WIDGET(g), DLEVEL_STABLE);
@@ -61,10 +59,14 @@
         * horisontal and vertical size of cols/rows
         */
        g->col_size = NEW(Ewl_Grid_Info, cols);
-       ZERO(g->col_size, Ewl_Grid_Info, cols);
+       if (!g->col_size)
+               DRETURN(DLEVEL_STABLE);
 
        g->row_size = NEW(Ewl_Grid_Info, rows);
-       ZERO(g->row_size, Ewl_Grid_Info, rows);
+       if (!g->row_size) {
+               FREE(g->col_size);
+               DRETURN(DLEVEL_STABLE);
+       }
 
        /*
         * Store the cols/rows in the grid
@@ -111,10 +113,14 @@
        IF_FREE(g->row_size);
 
        g->col_size = NEW(Ewl_Grid_Info, cols);
-       ZERO(g->col_size, Ewl_Grid_Info, cols);
+       if (!g->col_size)
+               DRETURN(DLEVEL_STABLE);
 
        g->row_size = NEW(Ewl_Grid_Info, rows);
-       ZERO(g->row_size, Ewl_Grid_Info, rows);
+       if (!g->row_size) {
+               FREE(g->col_size);
+               DRETURN(DLEVEL_STABLE);
+       }
 
        g->cols = cols;
        g->rows = rows;
@@ -187,8 +193,6 @@
        if (!child)
                DLEAVE_FUNCTION(DLEVEL_STABLE);
 
-       memset(child, 0, sizeof(Ewl_Grid_Child));
-
        child->start_col = start_col;
        child->end_col = end_col;
        child->start_row = start_row;
@@ -512,6 +516,8 @@
         */
        if (!cdata) {
                cdata = NEW(Ewl_Grid_Child, 1);
+               if (!cdata)
+                       DRETURN(DLEVEL_STABLE);
                cdata->start_col = cdata->end_col = 1;
                cdata->start_row = cdata->end_row = 1;
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- ewl_image.c 29 Oct 2003 21:08:30 -0000      1.34
+++ ewl_image.c 12 Nov 2003 20:07:17 -0000      1.35
@@ -28,8 +28,9 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        image = NEW(Ewl_Image, 1);
+       if (!image)
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(image, Ewl_Image, 1);
        ewl_image_init(image, i);
 
        DRETURN_PTR(EWL_WIDGET(image), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_imenu.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ewl_imenu.c 29 Sep 2003 21:46:50 -0000      1.12
+++ ewl_imenu.c 12 Nov 2003 20:07:17 -0000      1.13
@@ -22,8 +22,6 @@
        if (!menu)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(menu, Ewl_IMenu, 1);
-
        ewl_imenu_init(menu, image, title);
 
        DRETURN_PTR(EWL_WIDGET(menu), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_macros.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ewl_macros.h        16 Oct 2003 20:54:25 -0000      1.18
+++ ewl_macros.h        12 Nov 2003 20:07:17 -0000      1.19
@@ -12,7 +12,7 @@
  * @def NEW(type, num)
  * Allocates memory of @a num elements of sizeof(@a type).
  */
-#define NEW(type, num) malloc(sizeof(type) * (num));
+#define NEW(type, num) calloc(num, sizeof(type));
 
 #undef REALLOC
 /**
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_menu.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ewl_menu.c  29 Sep 2003 21:46:50 -0000      1.11
+++ ewl_menu.c  12 Nov 2003 20:07:17 -0000      1.12
@@ -33,8 +33,6 @@
        if (!menu)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(menu, Ewl_Menu, 1);
-
        ewl_menu_init(menu, image, title);
 
        DRETURN_PTR(EWL_WIDGET(menu), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_menu_base.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ewl_menu_base.c     29 Sep 2003 21:46:50 -0000      1.17
+++ ewl_menu_base.c     12 Nov 2003 20:07:17 -0000      1.18
@@ -73,8 +73,6 @@
        if (!item)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(item, Ewl_Menu_Item, 1);
-
        ewl_menu_item_init(item, image, text);
 
        DRETURN_PTR(EWL_WIDGET(item), DLEVEL_STABLE);
@@ -168,7 +166,6 @@
        if (!sep)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(sep, Ewl_Menu_Separator, 1);
        ewl_menu_separator_init(sep);
 
        DRETURN_PTR(sep, DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- ewl_misc.c  8 Nov 2003 08:07:11 -0000       1.50
+++ ewl_misc.c  12 Nov 2003 20:07:17 -0000      1.51
@@ -143,6 +143,15 @@
        if (ewd_list_is_empty(ewl_embed_list))
                DRETURN_INT(TRUE, DLEVEL_STABLE);
 
+       /*
+        * Freeze events on the evases to reduce overhead
+        */
+       ewd_list_goto_first(ewl_embed_list);
+       while ((emb = ewd_list_next(ewl_embed_list)) != NULL) {
+               if (emb->evas)
+                       evas_event_freeze(emb->evas);
+       }
+
        edje_freeze();
 
        /*
@@ -162,12 +171,14 @@
        edje_thaw();
 
        /*
-        * Allow each embed to render itself.
+        * Allow each embed to render itself, this requires thawing the evas.
         */
        ewd_list_goto_first(ewl_embed_list);
        while ((emb = ewd_list_next(ewl_embed_list)) != NULL) {
-               if (emb->evas)
+               if (emb->evas) {
+                       evas_event_thaw(emb->evas);
                        evas_render(emb->evas);
+               }
        }
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ewl_notebook.c      20 Oct 2003 19:54:04 -0000      1.33
+++ ewl_notebook.c      12 Nov 2003 20:07:17 -0000      1.34
@@ -29,7 +29,8 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        n = NEW(Ewl_Notebook, 1);
-       ZERO(n, Ewl_Notebook, 1);
+       if (!n)
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
        ewl_notebook_init(n);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_progressbar.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_progressbar.c   10 Nov 2003 22:55:27 -0000      1.1
+++ ewl_progressbar.c   12 Nov 2003 20:07:17 -0000      1.2
@@ -1,11 +1,12 @@
 #include <Ewl.h>
 
-Ewl_Widget *ewl_progressbar_new();
-void ewl_progressbar_init (Ewl_Progressbar * p);
 void __ewl_progressbar_configure(Ewl_Widget * w, void *ev_data, void *user_data);
 
 
-
+/**
+ * @return Returns NULL on failure, or a pointer to the new progressbar on success.
+ * @brief Allocate and initialize a new progressbar
+ */
 Ewl_Widget *ewl_progressbar_new() 
 {
        Ewl_Progressbar *p;
@@ -16,20 +17,22 @@
        if (!p)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(p, Ewl_Progressbar, 1);
-
        ewl_progressbar_init(p);
        
        DRETURN_PTR(EWL_WIDGET(p), DLEVEL_STABLE);
 }
 
-
-void ewl_progressbar_init (Ewl_Progressbar * p)
+/**
+ * @param p: the progressbar to be initialized
+ * @return Returns no value.
+ * @brief Initialize the progressbar to some sane starting values
+ */
+void ewl_progressbar_init(Ewl_Progressbar * p)
 {
        Ewl_Widget     *w;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
-       DCHECK_PARAM_PTR("s", p);
+       DCHECK_PARAM_PTR("p", p);
 
        w = EWL_WIDGET(p);
 
@@ -37,10 +40,19 @@
                        NULL, NULL, NULL);
 
        p->bar = NEW(Ewl_Widget, 1);
+       if (!p->bar)
+               DRETURN(DLEVEL_STABLE);
+
        ewl_widget_init(p->bar, "bar");
        ewl_container_append_child(EWL_CONTAINER(p), p->bar);
        ewl_widget_show(p->bar);
 
+       p->text = ewl_text_new("test");
+       ewl_object_set_alignment(EWL_OBJECT(p->text),
+                       EWL_FLAG_ALIGN_CENTER);
+       ewl_container_append_child(EWL_CONTAINER(p), p->text);
+       ewl_widget_show(p->text);
+
        p->value = 0.0;
        
        ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, 
@@ -50,6 +62,69 @@
 }
 
 
+/**
+ * @param p: the progressbar whose value will be changed
+ * @param v: the new value the statusbar
+ * @return Returns no value.
+ * @brief Set the value of the progressbars location
+ */
+void ewl_progressbar_set_value(Ewl_Progressbar * p, double v)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("p", p);
+
+       if (v == p->value)
+               DRETURN(DLEVEL_STABLE);
+
+       if (v < 0)
+               v = 0;
+
+       p->value = v;
+
+       ewl_widget_configure(EWL_WIDGET(p));
+       ewl_callback_call(EWL_WIDGET(p), EWL_CALLBACK_VALUE_CHANGED);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+
+/**
+ * @param p: the progressbars to retrieve the value
+ * @return Returns 0 on failure, the value of the progressbars location on success.
+ * @brief Retrieve the current value of the progressbars
+ */ 
+double ewl_progressbar_get_value(Ewl_Progressbar * p)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("p", p, -1);
+
+       DRETURN_FLOAT(p->value, DLEVEL_STABLE);
+}
+
+
+/**
+ * @param p: the progressbars whose text will be changed
+ * @param text: the new text
+ * @return Returns no value
+ * @brief Sets the given text on the progressbar
+ */
+void ewl_progressbar_set_text (Ewl_Progressbar * p, char *text)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("p", p);
+
+       if (text)
+               ewl_text_set_text(EWL_TEXT(p->text), text);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE)
+}
+
+
+/*
+ * On a configure event we need to adjust the progressbar to fit into it's new
+ * coords and position as well as move the bar to the correct size and
+ * position.
+ */
 void __ewl_progressbar_configure(Ewl_Widget * w, void *ev_data, void *user_data)
 {
        Ewl_Progressbar *p;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_progressbar.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_progressbar.h   10 Nov 2003 22:55:27 -0000      1.1
+++ ewl_progressbar.h   12 Nov 2003 20:07:17 -0000      1.2
@@ -35,6 +35,7 @@
 {
        Ewl_Container   container; /**< Inherit from Ewl_Container */
        Ewl_Widget      *bar;      /**< The moving bar on top */
+       Ewl_Widget      *text;     /**< text label on the bar */
        double          value;     /**< current value of the progressbar */
 };
 
@@ -44,5 +45,7 @@
 
 void ewl_progressbar_set_value (Ewl_Progressbar * p, double v);
 double ewl_progressbar_get_value(Ewl_Progressbar * p);
+
+void ewl_progressbar_set_text (Ewl_Progressbar * p, char *text);
 
 #endif                         /* __EWL_PROGRESSBAR_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_radiobutton.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- ewl_radiobutton.c   24 Sep 2003 07:12:25 -0000      1.27
+++ ewl_radiobutton.c   12 Nov 2003 20:07:17 -0000      1.28
@@ -28,9 +28,8 @@
 
        b = NEW(Ewl_RadioButton, 1);
        if (!b)
-               return NULL;
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(b, Ewl_RadioButton, 1);
        ewl_radiobutton_init(b, label);
 
        DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ewl_row.c   11 Nov 2003 18:00:08 -0000      1.17
+++ ewl_row.c   12 Nov 2003 20:07:17 -0000      1.18
@@ -25,7 +25,6 @@
        if (!row)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(row, Ewl_Row, 1);
        if (!ewl_row_init(EWL_ROW(row))) {
                FREE(row);
                DRETURN_PTR(NULL, DLEVEL_STABLE);
@@ -177,7 +176,8 @@
                         * Attempt to divvy up remaining space equally among
                         * remaining children.
                         */
-                       portion =  remains / nodes;
+                       portion = MIN(ewl_object_get_preferred_w(child),
+                                       remains / nodes);
                        ewl_object_request_position(child, x, CURRENT_Y(w));
                        ewl_object_request_w(child, portion);
 
@@ -189,7 +189,7 @@
                        nodes--;
                }
 
-               if ((child = ewd_list_goto_last(c->children)))
+               if (remains > 0 &&(child = ewd_list_goto_last(c->children)))
                        ewl_object_request_w(child,
                                        ewl_object_get_current_w(child) +
                                        remains);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollbar.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- ewl_scrollbar.c     10 Oct 2003 21:42:28 -0000      1.25
+++ ewl_scrollbar.c     12 Nov 2003 20:07:17 -0000      1.26
@@ -25,8 +25,6 @@
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(s, Ewl_Scrollbar, 1);
-
        /*
         * Initialize the objects fields.
         */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollpane.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ewl_scrollpane.c    11 Nov 2003 18:00:08 -0000      1.26
+++ ewl_scrollpane.c    12 Nov 2003 20:07:17 -0000      1.27
@@ -28,8 +28,8 @@
        DENTER_FUNCTION(DLEVEL_UNSTABLE);
 
        s = NEW(Ewl_ScrollPane, 1);
-
-       ZERO(s, Ewl_ScrollPane, 1);
+       if (!s)
+               DRETURN_PTR(NULL, DLEVEL_UNSTABLE);
 
        ewl_scrollpane_init(s);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_seeker.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- ewl_seeker.c        11 Nov 2003 18:00:09 -0000      1.47
+++ ewl_seeker.c        12 Nov 2003 20:07:17 -0000      1.48
@@ -27,8 +27,6 @@
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(s, Ewl_Seeker, 1);
-
        ewl_seeker_init(s, o);
 
        DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbar.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- ewl_selectionbar.c  29 Sep 2003 21:46:51 -0000      1.13
+++ ewl_selectionbar.c  12 Nov 2003 20:07:17 -0000      1.14
@@ -43,8 +43,6 @@
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       memset(s, 0, sizeof(Ewl_Selectionbar));
-
        ewl_selectionbar_init(s, parent);
 
 
@@ -80,8 +78,8 @@
                            NULL);
 
        s->bar = NEW(Ewl_Container, 1);
-       memset(s->bar, 0, sizeof(Ewl_Container));
-
+       if (!s->bar)
+               DRETURN(DLEVEL_STABLE);
 
        ewl_container_init(EWL_CONTAINER(s->bar), "/selectionbar", NULL, NULL,
                        NULL);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbook.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ewl_selectionbook.c 29 Sep 2003 21:46:51 -0000      1.10
+++ ewl_selectionbook.c 12 Nov 2003 20:07:17 -0000      1.11
@@ -30,8 +30,6 @@
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       memset(s, 0, sizeof(Ewl_Selectionbook));
-
        ewl_selectionbook_init(s);
 
        DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
@@ -95,8 +93,6 @@
        p = NEW(Ewl_SbookPage, 1);
        if (!p)
                return;
-
-       memset(p, 0, sizeof(Ewl_SbookPage));
 
        p->tab = tab;
        p->page = page;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_separator.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- ewl_separator.c     29 Sep 2003 21:46:51 -0000      1.22
+++ ewl_separator.c     12 Nov 2003 20:07:17 -0000      1.23
@@ -12,7 +12,8 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        s = NEW(Ewl_Separator, 1);
-       ZERO(s, Ewl_Separator, 1);
+       if (!s)
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
        ewl_separator_init(s, o);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spacer.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_spacer.c        29 Aug 2003 17:56:13 -0000      1.3
+++ ewl_spacer.c        12 Nov 2003 20:07:17 -0000      1.4
@@ -13,9 +13,8 @@
 
        s = NEW(Ewl_Spacer, 1);
        if (!s)
-               return NULL;
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(s, Ewl_Spacer, 1);
        ewl_spacer_init(s);
 
        DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spectrum.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_spectrum.c      16 Oct 2003 07:05:10 -0000      1.2
+++ ewl_spectrum.c      12 Nov 2003 20:07:17 -0000      1.3
@@ -23,11 +23,8 @@
        Ewl_Spectrum *sp = NULL;
 
        sp = NEW(Ewl_Spectrum, 1);
-
        if (!sp)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
-
-       ZERO(sp, Ewl_Spectrum, 1);
 
        ewl_spectrum_init(sp);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- ewl_spinner.c       29 Sep 2003 21:46:51 -0000      1.41
+++ ewl_spinner.c       12 Nov 2003 20:07:17 -0000      1.42
@@ -43,11 +43,8 @@
        Ewl_Spinner    *s = NULL;
 
        s = NEW(Ewl_Spinner, 1);
-
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
-
-       ZERO(s, Ewl_Spinner, 1);
 
        ewl_spinner_init(s);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_table.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- ewl_table.c 29 Sep 2003 21:46:51 -0000      1.36
+++ ewl_table.c 12 Nov 2003 20:07:17 -0000      1.37
@@ -32,9 +32,6 @@
        if (!t)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       memset(t, 0, sizeof(Ewl_Table));
-       ewl_table_init(t, cols, rows, col_headers);
-
        DRETURN_PTR(EWL_WIDGET(t), DLEVEL_STABLE);
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- ewl_text.c  18 Oct 2003 17:00:37 -0000      1.54
+++ ewl_text.c  12 Nov 2003 20:07:17 -0000      1.55
@@ -25,7 +25,8 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        t = NEW(Ewl_Text, 1);
-       ZERO(t, Ewl_Text, 1);
+       if (!t)
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
        ewl_text_init(t, text);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_textarea.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewl_textarea.c      22 Oct 2003 07:43:18 -0000      1.19
+++ ewl_textarea.c      12 Nov 2003 20:07:17 -0000      1.20
@@ -24,7 +24,8 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        ta = NEW(Ewl_TextArea, 1);
-       ZERO(ta, Ewl_TextArea, 1);
+       if (!ta)
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
        ewl_textarea_init(ta, text);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_theme.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- ewl_theme.c 7 Oct 2003 04:29:58 -0000       1.47
+++ ewl_theme.c 12 Nov 2003 20:07:17 -0000      1.48
@@ -228,6 +228,10 @@
 
        if (*data != '/') {
                path = NEW(char, PATH_MAX);
+               if (!path) {
+                       FREE(data);
+                       DRETURN_PTR(NULL, DLEVEL_STABLE);
+               }
 
                snprintf(path, PATH_MAX, "%s/%s", theme_path, data);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- ewl_tree.c  10 Nov 2003 22:55:27 -0000      1.24
+++ ewl_tree.c  12 Nov 2003 20:07:17 -0000      1.25
@@ -38,7 +38,6 @@
        if (!w)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(w, Ewl_Tree, 1);
        if (!ewl_tree_init(EWL_TREE(w), columns)) {
                FREE(w);
                DRETURN_PTR(NULL, DLEVEL_STABLE);
@@ -237,7 +236,8 @@
        DCHECK_PARAM_PTR_RET("text", text, NULL);
 
        entries = NEW(Ewl_Widget *, tree->ncols);
-       ZERO(entries, Ewl_Widget *, tree->ncols);
+       if (!entries)
+               DRETURN_PTR(NULL, DLEVEL_STABLE);
 
        for (i = 0; i < tree->ncols; i++) {
                if (text[i]) {
@@ -377,7 +377,6 @@
        if (!node)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(node, Ewl_Tree_Node, 1);
        if (!ewl_tree_node_init(EWL_TREE_NODE(node))) {
                FREE(node);
                DRETURN_PTR(NULL, DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -3 -r1.84 -r1.85
--- ewl_widget.c        9 Nov 2003 07:10:55 -0000       1.84
+++ ewl_widget.c        12 Nov 2003 20:07:17 -0000      1.85
@@ -859,6 +859,8 @@
         */
        len = strlen(w->appearance) + 7;
        key = NEW(char, len);
+       if (!key)
+               DRETURN(DLEVEL_STABLE);
 
        /*
         * Retrieve the path to the theme file that will be loaded
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -3 -r1.63 -r1.64
--- ewl_window.c        8 Nov 2003 08:07:11 -0000       1.63
+++ ewl_window.c        12 Nov 2003 20:07:17 -0000      1.64
@@ -41,7 +41,6 @@
        if (!w)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ZERO(w, Ewl_Window, 1);
        if (!ewl_window_init(w)) {
                ewl_widget_destroy(EWL_WIDGET(w));
                w = NULL;




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to