Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_embed.c ewl_embed.h Ewl.h Makefile.am 
Added Files:
        ewl_overlay.c ewl_overlay.h 


Log Message:
Separate the layout code from the embed into a new container. This can be used
for absolute coordinate layout of child widgets.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- ewl_embed.c 5 Feb 2004 17:21:36 -0000       1.21
+++ ewl_embed.c 12 Feb 2004 06:34:12 -0000      1.22
@@ -81,10 +81,9 @@
        /*
         * Initialize the fields of the inherited container class
         */
-       if (!ewl_container_init(EWL_CONTAINER(w), "embed",
-                               ewl_embed_child_add_cb,
-                               ewl_embed_child_resize_cb, NULL))
+       if (!ewl_overlay_init(EWL_OVERLAY(w)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);
+       ewl_widget_set_appearance(EWL_WIDGET(w), "embed");
 
        ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
        ewl_object_set_toplevel(EWL_OBJECT(w), EWL_FLAG_PROPERTY_TOPLEVEL);
@@ -94,13 +93,6 @@
        ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_DESTROY,
                             ewl_embed_destroy_cb, NULL);
 
-       /*
-        * Override the default configure callbacks since the embed
-        * has special needs for placement.
-        */
-       ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE,
-                            ewl_embed_configure_cb, NULL);
-
        LAYER(w) = -1000;
 
        ewd_list_append(ewl_embed_list, w);
@@ -366,36 +358,6 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-void ewl_embed_configure_cb(Ewl_Widget *w, void *ev_data, void *user_data)
-{
-       Ewl_Object *o;
-       Ewl_Object *child;
-
-       DENTER_FUNCTION(DLEVEL_STABLE);
-
-       o = EWL_OBJECT(w);
-
-       /*
-        * Configure each of the child widgets.
-        */
-       ewd_list_goto_first(EWL_CONTAINER(w)->children);
-       while ((child = ewd_list_next(EWL_CONTAINER(w)->children))) {
-               /*
-                * Try to give the child the full size of the window from it's
-                * base position. The object will constrict it based on the
-                * fill policy. Don't add the TOP and LEFT insets since
-                * they've already been accounted for.
-                */
-               ewl_object_request_size(child,
-                                       CURRENT_W(w) -
-                                       ewl_object_get_current_x(child),
-                                       CURRENT_H(w) -
-                                       ewl_object_get_current_y(child));
-       }
-
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
 void ewl_embed_unrealize_cb(Ewl_Widget *w, void *ev_data, void *user_data)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
@@ -427,86 +389,6 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-void ewl_embed_child_add_cb(Ewl_Container * emb, Ewl_Widget * child)
-{
-       int size;
-
-       DENTER_FUNCTION(DLEVEL_STABLE);
-
-       /*
-        * Move the child within the bounsd of the embed.
-        */
-       if (ewl_object_get_current_x(EWL_OBJECT(child)) < CURRENT_X(emb))
-               ewl_object_request_x(EWL_OBJECT(child), CURRENT_X(emb));
-       if (ewl_object_get_current_y(EWL_OBJECT(child)) < CURRENT_Y(emb))
-               ewl_object_request_y(EWL_OBJECT(child), CURRENT_Y(emb));
-
-       size = ewl_object_get_current_x(EWL_OBJECT(child)) +
-               ewl_object_get_preferred_w(EWL_OBJECT(child)) - CURRENT_X(emb);
-       if (size > PREFERRED_W(emb))
-               ewl_object_set_preferred_w(EWL_OBJECT(emb), size);
-
-       size = ewl_object_get_current_y(EWL_OBJECT(child)) +
-               ewl_object_get_preferred_h(EWL_OBJECT(child)) - CURRENT_Y(emb);
-       if (size > PREFERRED_H(emb))
-               ewl_object_set_preferred_h(EWL_OBJECT(emb), size);
-
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
-void ewl_embed_child_resize_cb(Ewl_Container *c, Ewl_Widget *w,
-                              int size, Ewl_Orientation o)
-{
-       int            maxw = 0, maxh = 0;
-       Ewl_Embed     *emb;
-       Ewl_Object    *child;
-
-       DENTER_FUNCTION(DLEVEL_STABLE);
-
-       child = EWL_OBJECT(w);
-       emb = EWL_EMBED(c);
-
-       ewd_list_goto_first(EWL_CONTAINER(emb)->children);
-       while ((child = ewd_list_next(EWL_CONTAINER(emb)->children))) {
-               int             cs;
-
-               /*
-                * FIXME: Do we really want to do this?
-                * Move children within the bounds of the viewable area
-                */
-               if (ewl_object_get_current_x(child) < CURRENT_X(emb))
-                       ewl_object_request_x(child, CURRENT_X(emb));
-               if (ewl_object_get_current_y(child) < CURRENT_Y(emb))
-                       ewl_object_request_y(child, CURRENT_Y(emb));
-
-               cs = ewl_object_get_current_x(child) +
-                       ewl_object_get_preferred_w(child);
-
-               /*
-                * Check the width and x position vs. embed width.
-                */
-               if (maxw < cs)
-                       maxw = cs;
-
-               cs = ewl_object_get_current_y(child) +
-                       ewl_object_get_preferred_h(child);
-
-               /*
-                * Check the height and y position vs. embed height.
-                */
-               if (maxh < cs)
-                       maxh = cs;
-
-       }
-
-       ewl_object_set_preferred_size(EWL_OBJECT(emb), maxw, maxh);
-       ewl_object_request_size(EWL_OBJECT(c),
-                               ewl_object_get_current_w(EWL_OBJECT(c)),
-                               ewl_object_get_current_h(EWL_OBJECT(c)));
-
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
 static void ewl_embed_smart_add_cb(Evas_Object *obj)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ewl_embed.h 5 Feb 2004 17:21:36 -0000       1.12
+++ ewl_embed.h 12 Feb 2004 06:34:12 -0000      1.13
@@ -33,7 +33,7 @@
  */
 struct Ewl_Embed
 {
-       Ewl_Container   container; /**< Inherits from the Ewl_Container class */
+       Ewl_Overlay     overlay; /**< Inherits from the Ewl_Overlay class */
 
        Evas           *evas; /**< Evas where drawing takes place. */
        Ecore_X_Window  evas_window; /**< The window holding the evas. */
@@ -59,13 +59,8 @@
  * Internally used callbacks, override at your own risk.
  */
 void ewl_embed_unrealize_cb(Ewl_Widget *w, void *ev_data, void *user_data);
-void ewl_embed_configure_cb(Ewl_Widget *w, void *ev_data, void *user_data);
 void ewl_embed_destroy_cb(Ewl_Widget *w, void *ev_data, void *user_data);
 
-void ewl_embed_child_add_cb(Ewl_Container * emb, Ewl_Widget * child);
-void ewl_embed_child_resize_cb(Ewl_Container *c, Ewl_Widget *w, int size,
-                              Ewl_Orientation o);
-
 /**
  * @}
  */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Ewl.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -3 -r1.43 -r1.44
--- Ewl.h       22 Dec 2003 17:29:15 -0000      1.43
+++ Ewl.h       12 Feb 2004 06:34:12 -0000      1.44
@@ -276,6 +276,7 @@
 #include <ewl_fileselector.h>
 #include <ewl_floater.h>
 #include <ewl_filedialog.h>
+#include <ewl_overlay.h>
 #include <ewl_embed.h>
 #include <ewl_window.h>
 #include <ewl_text.h>
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Makefile.am,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- Makefile.am 27 Jan 2004 06:08:35 -0000      1.41
+++ Makefile.am 12 Feb 2004 06:34:12 -0000      1.42
@@ -34,6 +34,7 @@
        ewl_misc.h \
        ewl_notebook.h \
        ewl_object.h \
+       ewl_overlay.h \
        ewl_password.h \
        ewl_progressbar.h \
        ewl_radiobutton.h \
@@ -80,6 +81,7 @@
        ewl_misc.c \
        ewl_notebook.c \
        ewl_object.c \
+       ewl_overlay.c \
        ewl_password.c \
        ewl_progressbar.c \
        ewl_radiobutton.c \




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to