Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        Ewl.h Makefile.am ewl_checkbutton.c ewl_container.h 
        ewl_object.c ewl_row.c ewl_tree.c 
Removed Files:
        ewl_selection.c ewl_selection.h 


Log Message:
Removal of selection widget (functionality moved to cursor), progress on the
tree widget, and added a tentative TODO/timeline.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Ewl.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- Ewl.h       4 Feb 2003 03:43:39 -0000       1.26
+++ Ewl.h       21 Mar 2003 20:12:47 -0000      1.27
@@ -72,7 +72,6 @@
 #include <ewl_checkbutton.h>
 #include <ewl_radiobutton.h>
 #include <ewl_cursor.h>
-#include <ewl_selection.h>
 #include <ewl_separator.h>
 #include <ewl_notebook.h>
 #include <ewl_scrollpane.h>
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Makefile.am,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- Makefile.am 2 Feb 2003 21:03:21 -0000       1.30
+++ Makefile.am 21 Mar 2003 20:12:47 -0000      1.31
@@ -40,7 +40,6 @@
        ewl_scrollbar.h \
        ewl_scrollpane.h \
        ewl_seeker.h \
-       ewl_selection.h \
        ewl_selectionbar.h \
        ewl_selectionbook.h \
        ewl_separator.h \
@@ -83,7 +82,6 @@
        ewl_scrollbar.c \
        ewl_scrollpane.c \
        ewl_seeker.c \
-       ewl_selection.c \
        ewl_selectionbar.c \
        ewl_selectionbook.c \
        ewl_separator.c \
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_checkbutton.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- ewl_checkbutton.c   14 Aug 2002 02:05:36 -0000      1.29
+++ ewl_checkbutton.c   21 Mar 2003 20:12:48 -0000      1.30
@@ -46,7 +46,7 @@
        w = EWL_WIDGET(cb);
 
        ewl_button_init(b, label);
-       ewl_widget_set_appearance(w, "/button/check");
+       ewl_widget_set_appearance(w, "checkbutton");
        RECURSIVE(b) = FALSE;
 
        ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_NONE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ewl_container.h     20 Feb 2003 05:17:40 -0000      1.17
+++ ewl_container.h     21 Mar 2003 20:12:48 -0000      1.18
@@ -79,5 +79,7 @@
                                           int y);
 Ewl_Widget     *ewl_container_get_child_at_recursive(Ewl_Container * widget,
                                                     int x, int y);
+void            ewl_container_prefer_largest(Ewl_Container *c,
+                                            Ewl_Orientation o);
 
 #endif                         /* __EWL_CONTAINER_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_object.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- ewl_object.c        6 Mar 2003 01:14:41 -0000       1.31
+++ ewl_object.c        21 Mar 2003 20:12:49 -0000      1.32
@@ -545,7 +545,7 @@
                MAXIMUM_W(o) = w;
 
        if (PREFERRED_W(o) < MINIMUM_W(o))
-               ewl_object_set_preferred_w(EWL_WIDGET(o), PREFERRED_W(o));
+               ewl_object_set_preferred_w(o, PREFERRED_W(o));
 
        if (CURRENT_W(o) < w)
                ewl_object_request_w(o, w);
@@ -574,7 +574,7 @@
                MAXIMUM_H(o) = h;
 
        if (PREFERRED_H(o) < MINIMUM_H(o))
-               ewl_object_set_preferred_h(EWL_WIDGET(o), PREFERRED_H(o));
+               ewl_object_set_preferred_h(o, PREFERRED_H(o));
 
        if (CURRENT_H(o) < h)
                ewl_object_request_h(o, h);
@@ -680,7 +680,7 @@
                MINIMUM_W(o) = w;
 
        if (PREFERRED_W(o) > MAXIMUM_W(o))
-               ewl_object_set_preferred_w(EWL_WIDGET(o), PREFERRED_W(o));
+               ewl_object_set_preferred_w(o, PREFERRED_W(o));
 
        if (CURRENT_W(o) > w)
                ewl_object_request_h(o, w);
@@ -709,7 +709,7 @@
                o->minimum.h = h;
 
        if (PREFERRED_H(o) > MAXIMUM_H(o))
-               ewl_object_set_preferred_h(EWL_WIDGET(o), PREFERRED_H(o));
+               ewl_object_set_preferred_h(o, PREFERRED_H(o));
 
        if (CURRENT_H(o) > h)
                ewl_object_request_h(o, h);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_row.c   27 Feb 2003 22:12:08 -0000      1.6
+++ ewl_row.c   21 Mar 2003 20:12:49 -0000      1.7
@@ -135,7 +135,7 @@
         * Adjust the preferred height to the largest widget added.
         */
        size = ewl_object_get_preferred_h(EWL_OBJECT(w));
-       if (ewl_object_get_preferred_h(row->max) > size) {
+       if (!row->max || ewl_object_get_preferred_h(row->max) > size) {
                row->max = EWL_OBJECT(w);
                ewl_object_set_preferred_h(EWL_OBJECT(c), size);
        }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_tree.c  19 Feb 2003 02:18:06 -0000      1.3
+++ ewl_tree.c  21 Mar 2003 20:12:50 -0000      1.4
@@ -5,12 +5,15 @@
  */
 #define DEFAULT_INDENT 30
 
+static void __ewl_tree_add(Ewl_Container *c, Ewl_Widget *w);
+static void __ewl_tree_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
+               Ewl_Orientation o);
 static void __ewl_tree_configure(Ewl_Widget *w, void *ev_data, void *user_data);
 static void __ewl_tree_node_configure(Ewl_Widget * w, void *ev_data,
                void *user_data);
 
-void __ewl_tree_node_add(Ewl_Container *c, Ewl_Widget *w);
-void __ewl_tree_node_resize(Ewl_Container *c, Ewl_Widget *w, int size,
+static void __ewl_tree_node_add(Ewl_Container *c, Ewl_Widget *w);
+static void __ewl_tree_node_resize(Ewl_Container *c, Ewl_Widget *w, int size,
                Ewl_Orientation o);
 
 /**
@@ -58,7 +61,8 @@
        DCHECK_PARAM_PTR_RET("tree", tree, FALSE);
        DCHECK_PARAM_PTR_RET("columns", columns, FALSE);
 
-       ewl_container_init(EWL_CONTAINER(tree), "tree", NULL, NULL, NULL);
+       ewl_container_init(EWL_CONTAINER(tree), "tree", __ewl_tree_add,
+                       __ewl_tree_child_resize, NULL);
 
        ewl_callback_append(EWL_WIDGET(tree), EWL_CALLBACK_CONFIGURE,
                        __ewl_tree_configure, NULL);
@@ -86,6 +90,7 @@
 Ewl_Widget *ewl_tree_add(Ewl_Tree *tree, Ewl_Row *prow, Ewl_Widget **children)
 {
        int i;
+       Ewl_Widget *w;
        Ewl_Widget *row;
        Ewl_Widget *node;
 
@@ -94,8 +99,10 @@
        DCHECK_PARAM_PTR_RET("tree", tree, NULL);
        DCHECK_PARAM_PTR_RET("children", children, NULL);
 
-       if (prow && EWL_WIDGET(prow)->parent &&
-                       (EWL_TREE_NODE(EWL_WIDGET(prow)->parent)->tree != tree))
+       w = EWL_WIDGET(prow);
+
+       if (prow && w->parent &&
+                       (EWL_TREE_NODE(w->parent)->tree != tree))
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
        /*
@@ -136,9 +143,8 @@
         * Place the new row in the tree.
         */
        if (row) {
-               if (prow && EWL_WIDGET(prow)->parent)
-                       ewl_container_append_child(EWL_CONTAINER(
-                                               EWL_WIDGET(prow)->parent),
+               if (prow && w->parent)
+                       ewl_container_append_child(EWL_CONTAINER(w->parent),
                                        node);
                else
                        ewl_container_append_child(EWL_CONTAINER(tree), node);
@@ -236,9 +242,39 @@
 }
 
 static void
+__ewl_tree_add(Ewl_Container *c, Ewl_Widget *w)
+{
+       int cw;
+
+       cw = ewl_object_get_preferred_w(EWL_OBJECT(w));
+       if (cw > PREFERRED_W(c))
+               ewl_object_set_preferred_w(EWL_OBJECT(c), cw);
+
+       ewl_object_set_preferred_h(EWL_OBJECT(c), PREFERRED_H(c) +
+                       ewl_object_get_preferred_h(EWL_OBJECT(w)));
+}
+
+static void
+__ewl_tree_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
+               Ewl_Orientation o)
+{
+       if (o == EWL_ORIENTATION_HORIZONTAL) {
+               if (ewl_object_get_preferred_w(EWL_OBJECT(w)) > PREFERRED_W(c))
+                       ewl_object_set_preferred_w(EWL_OBJECT(c),
+                                       PREFERRED_W(c) + size);
+               else
+                       ewl_container_prefer_largest(c, o);
+       }
+       else {
+               ewl_object_set_preferred_h(EWL_OBJECT(c),
+                               PREFERRED_H(c) + size);
+       }
+}
+
+static void
 __ewl_tree_configure(Ewl_Widget *w, void *ev_data, void *user_data)
 {
-       int i, y, h;
+       int y, h;
        Ewl_Object *child;
        Ewl_Container *c;
        Ewl_Tree *tree;
@@ -252,15 +288,13 @@
         * Align each top level node at the current x coordinate, and simply
         * lay them out in a vertical fashion.
         */
-       i = 0;
        y = CURRENT_Y(w);
        ewd_list_goto_first(c->children);
-       while (i < tree->nrows && (child = ewd_list_next(c->children))) {
+       while ((child = ewd_list_next(c->children))) {
                h = ewl_object_get_preferred_h(child);
                ewl_object_request_geometry(child, CURRENT_X(w), y,
                                CURRENT_W(w), h);
                y += h;
-               i++;
        }
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -305,7 +339,7 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-void
+static void
 __ewl_tree_node_add(Ewl_Container *c, Ewl_Widget *w)
 {
        int width;
@@ -328,11 +362,24 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-void
+static void
 __ewl_tree_node_resize(Ewl_Container *c, Ewl_Widget *w, int size,
                Ewl_Orientation o)
 {
+       Ewl_Tree_Node *node;
+
        DENTER_FUNCTION(DLEVEL_STABLE);
+
+       node = EWL_TREE_NODE(c);
+
+       if (node->expanded || (w == ewd_list_goto_first(c->children))) {
+               if (o == EWL_ORIENTATION_HORIZONTAL)
+                       ewl_object_set_preferred_w(EWL_OBJECT(c),
+                                       PREFERRED_W(c) + size);
+               else
+                       ewl_object_set_preferred_h(EWL_OBJECT(c),
+                                       PREFERRED_H(c) + size);
+       }
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }




-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to