Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_box.c ewl_cell.c ewl_container.c ewl_container.h
ewl_entry.c ewl_enums.h ewl_events.c ewl_floater.c ewl_grid.c
ewl_notebook.c ewl_object.c ewl_object.h ewl_row.c ewl_row.h
ewl_scrollpane.c ewl_seeker.c ewl_selectionbar.c
ewl_selectionbook.c ewl_spinner.c ewl_table.c ewl_text.c
ewl_tree.c ewl_window.c
Log Message:
Add remove notifiers to containers.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_box.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -3 -r1.43 -r1.44
--- ewl_box.c 13 Feb 2003 06:54:17 -0000 1.43
+++ ewl_box.c 19 Feb 2003 02:18:05 -0000 1.44
@@ -115,10 +115,10 @@
*/
if (o == EWL_ORIENTATION_HORIZONTAL)
ewl_container_init(EWL_CONTAINER(b), "hbox", __ewl_box_add,
- __ewl_box_child_resize);
+ __ewl_box_child_resize, NULL);
else
ewl_container_init(EWL_CONTAINER(b), "vbox", __ewl_box_add,
- __ewl_box_child_resize);
+ __ewl_box_child_resize, NULL);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, __ewl_box_configure,
NULL);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_cell.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_cell.c 4 Feb 2003 03:43:40 -0000 1.4
+++ ewl_cell.c 19 Feb 2003 02:18:05 -0000 1.5
@@ -45,7 +45,7 @@
DCHECK_PARAM_PTR_RET("cell", cell, FALSE);
ewl_container_init(EWL_CONTAINER(cell), "cell", __ewl_cell_add,
- __ewl_cell_child_resize);
+ __ewl_cell_child_resize, NULL);
ewl_callback_append(EWL_WIDGET(cell), EWL_CALLBACK_CONFIGURE,
__ewl_cell_configure, NULL);
@@ -70,7 +70,6 @@
if (child)
ewl_object_request_geometry(child, CURRENT_X(w), CURRENT_Y(w),
CURRENT_W(w), CURRENT_H(w));
- ewl_widget_configure(EWL_WIDGET(child));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- ewl_container.c 2 Feb 2003 21:03:23 -0000 1.27
+++ ewl_container.c 19 Feb 2003 02:18:05 -0000 1.28
@@ -26,7 +26,7 @@
*/
void
ewl_container_init(Ewl_Container * c, char *appearance, Ewl_Child_Add add,
- Ewl_Child_Resize rs)
+ Ewl_Child_Remove remove, Ewl_Child_Resize rs)
{
Ewl_Widget *w;
@@ -46,6 +46,7 @@
*/
c->children = ewd_list_new();
c->child_add = add;
+ c->child_remove = remove;
c->child_resize = rs;
/*
@@ -71,13 +72,34 @@
*
* Returns no value. Changes the add nofitier function of @container to @add.
*/
-void ewl_container_add_notify(Ewl_Container * container, Ewl_Child_Add add)
+void
+ewl_container_add_notify(Ewl_Container * container, Ewl_Child_Add add)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("container", container);
container->child_add = add;
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * ewl_container_remove_notify - set the function to be called when removing children
+ * @container: the container to change the add notifier
+ * @remove: the new remove notifier for the container
+ *
+ * Returns no value. Changes the remove notifier function of @container to
+ * @remove.
+ */
+void
+ewl_container_remove_notify(Ewl_Container * container, Ewl_Child_Remove remove)
+{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ DCHECK_PARAM_PTR("container", container);
+
+ container->child_remove = remove;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_container.h 14 Jan 2003 21:45:00 -0000 1.15
+++ ewl_container.h 19 Feb 2003 02:18:05 -0000 1.16
@@ -14,6 +14,7 @@
#define EWL_CONTAINER(widget) ((Ewl_Container *) widget)
typedef void (*Ewl_Child_Add) (Ewl_Container * c, Ewl_Widget * w);
+typedef void (*Ewl_Child_Remove) (Ewl_Container * c, Ewl_Widget * w);
typedef void (*Ewl_Child_Resize) (Ewl_Container * c, Ewl_Widget * w,
int size, Ewl_Orientation o);
@@ -42,6 +43,12 @@
Ewl_Child_Add child_add;
/*
+ * Removal function updates the preferred size of the container when
+ * a child is removed.
+ */
+ Ewl_Child_Add child_remove;
+
+ /*
* Changes the preferred size of the container when the preferred size
* of the child changes.
*/
@@ -49,8 +56,11 @@
};
void ewl_container_init(Ewl_Container * widget, char *appearance,
- Ewl_Child_Add add, Ewl_Child_Resize rs);
+ Ewl_Child_Add add, Ewl_Child_Remove remove,
+ Ewl_Child_Resize rs);
void ewl_container_add_notify(Ewl_Container * container,
+ Ewl_Child_Add add);
+void ewl_container_remove_notify(Ewl_Container * container,
Ewl_Child_Add add);
void ewl_container_resize_notify(Ewl_Container * container,
Ewl_Child_Resize resize);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- ewl_entry.c 14 Jan 2003 21:45:00 -0000 1.41
+++ ewl_entry.c 19 Feb 2003 02:18:05 -0000 1.42
@@ -114,11 +114,10 @@
w = EWL_WIDGET(e);
- ewl_container_init(EWL_CONTAINER(w), "/entry",
- NULL, __ewl_entry_child_resize);
- ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_FILL);
- ewl_object_set_minimum_size(EWL_OBJECT(w), 20, 20);
- ewl_object_set_maximum_size(EWL_OBJECT(w), 1 << 30, 20);
+ ewl_container_init(EWL_CONTAINER(w), "entry", NULL,
+ __ewl_entry_child_resize, NULL);
+ ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_HSHRINK |
+ EWL_FILL_POLICY_HFILL);
w->recursive = FALSE;
@@ -186,7 +185,6 @@
yy = CURRENT_Y(w);
ewl_object_request_position(EWL_OBJECT(e->text), xx, yy);
- ewl_widget_configure(e->text);
/******************************************************************/
@@ -209,7 +207,6 @@
}
ewl_object_request_geometry(EWL_OBJECT(e->cursor), xx, yy, ww, hh);
- ewl_widget_configure(e->cursor);
/******************************************************************/
@@ -241,7 +238,6 @@
ewl_object_request_geometry(EWL_OBJECT(e->selection), xx, yy,
ww, hh);
- ewl_widget_configure(e->selection);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_enums.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ewl_enums.h 14 Jan 2003 21:45:00 -0000 1.26
+++ ewl_enums.h 19 Feb 2003 02:18:05 -0000 1.27
@@ -79,7 +79,8 @@
*/
typedef enum _ewl_alignment Ewl_Alignment;
-enum _ewl_alignment {
+enum _ewl_alignment
+{
EWL_ALIGNMENT_CENTER = ETOX_ALIGN_CENTER,
EWL_ALIGNMENT_LEFT = ETOX_ALIGN_LEFT,
EWL_ALIGNMENT_RIGHT = ETOX_ALIGN_RIGHT,
@@ -93,7 +94,8 @@
*/
typedef enum _ewl_fill_policy Ewl_Fill_Policy;
-enum _ewl_fill_policy {
+enum _ewl_fill_policy
+{
EWL_FILL_POLICY_NONE = 0,
EWL_FILL_POLICY_HSHRINK = 1,
EWL_FILL_POLICY_VSHRINK = 2,
@@ -110,7 +112,8 @@
*/
typedef enum _ewl_visibility Ewl_Visibility;
-enum _ewl_visibility {
+enum _ewl_visibility
+{
EWL_VISIBILITY_HIDDEN = 0x0,
EWL_VISIBILITY_SHOWN = 0x1,
EWL_VISIBILITY_REALIZED = 0x2
@@ -119,7 +122,8 @@
typedef enum _ewl_position Ewl_Position;
-enum _ewl_position {
+enum _ewl_position
+{
EWL_POSITION_LEFT,
EWL_POSITION_RIGHT,
EWL_POSITION_TOP,
@@ -128,20 +132,23 @@
typedef enum _ewl_window_flags Ewl_Window_Flags;
-enum _ewl_window_flags {
+enum _ewl_window_flags
+{
EWL_WINDOW_AUTO_SIZE = 1,
EWL_WINDOW_BORDERLESS = 2
};
typedef enum _ewl_notebook_flags Ewl_Notebook_Flags;
-enum _ewl_notebook_flags {
+enum _ewl_notebook_flags
+{
EWL_NOTEBOOK_FLAG_TABS_HIDDEN = 0x1
};
typedef enum _ewl_fx_modifies Ewl_FX_Modifies;
-enum _ewl_fx_modifies {
+enum _ewl_fx_modifies
+{
EWL_FX_MODIFIES_NONE = (0x1 << 0),
EWL_FX_MODIFIES_ALPHA_CHANNEL = (0x1 << 1),
EWL_FX_MODIFIES_RED_CHANNEL = (0x1 << 2),
@@ -158,7 +165,8 @@
typedef enum _ewl_scrollbar_flags Ewl_ScrollBar_Flags;
-enum _ewl_scrollbar_flags {
+enum _ewl_scrollbar_flags
+{
EWL_SCROLLBAR_FLAG_NONE,
EWL_SCROLLBAR_FLAG_AUTO_VISIBLE,
EWL_SCROLLBAR_FLAG_ALWAYS_HIDDEN
@@ -167,7 +175,8 @@
typedef enum _ewl_filedialog_type Ewl_Filedialog_Type;
-enum _ewl_filedialog_type {
+enum _ewl_filedialog_type
+{
EWL_FILEDIALOG_TYPE_OPEN,
EWL_FILEDIALOG_TYPE_CLOSE
};
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- ewl_events.c 14 Jan 2003 21:45:01 -0000 1.27
+++ ewl_events.c 19 Feb 2003 02:18:05 -0000 1.28
@@ -116,7 +116,6 @@
if (CURRENT_W(window) != ev->w || CURRENT_H(window) != ev->h) {
ewl_object_request_geometry(EWL_OBJECT(window), 0, 0, ev->w,
ev->h);
- ewl_widget_configure(EWL_WIDGET(window));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_floater.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_floater.c 14 Aug 2002 02:05:36 -0000 1.7
+++ ewl_floater.c 19 Feb 2003 02:18:05 -0000 1.8
@@ -195,15 +195,20 @@
void
__ewl_floater_parent_configure(Ewl_Widget * w, void *ev_data, void *user_data)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
DCHECK_PARAM_PTR("w", w);
DCHECK_PARAM_PTR("user_data", user_data);
ewl_widget_configure(EWL_WIDGET(user_data));
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void __ewl_floater_reparent(Ewl_Widget * w, void *ev_data, void *user_data)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
DCHECK_PARAM_PTR("w", w);
DCHECK_PARAM_PTR("user_data", user_data);
@@ -213,6 +218,7 @@
if (REALIZED(w))
ewl_widget_theme_update(w);
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
/*
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_grid.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_grid.c 14 Jan 2003 21:45:02 -0000 1.6
+++ ewl_grid.c 19 Feb 2003 02:18:05 -0000 1.7
@@ -53,9 +53,8 @@
/*
* Initialize the grids inherited fields
*/
- ewl_container_init(EWL_CONTAINER(g),
- "/box/vertical", __ewl_grid_add,
- __ewl_grid_auto_resize);
+ ewl_container_init(EWL_CONTAINER(g), "vbox", __ewl_grid_add,
+ __ewl_grid_auto_resize, NULL);
/*
* Initialize the lists that keep track of the
@@ -597,7 +596,7 @@
Ewl_Grid_Info *info;
int i, num_spread = 0;
Ewl_Grid_Child *cdata;
- int (*widget_size) (Ewl_Object * o);
+ unsigned int (*widget_size) (Ewl_Object * o);
DENTER_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ewl_notebook.c 14 Jan 2003 21:45:03 -0000 1.18
+++ ewl_notebook.c 19 Feb 2003 02:18:05 -0000 1.19
@@ -530,7 +530,7 @@
* Initialize the container portion of the notebook and set the fill
* policy to fill the area available.
*/
- ewl_container_init(EWL_CONTAINER(w), "/notebook", NULL, NULL);
+ ewl_container_init(EWL_CONTAINER(w), "/notebook", NULL, NULL, NULL);
ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_FILL);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_object.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ewl_object.c 2 Feb 2003 21:03:23 -0000 1.26
+++ ewl_object.c 19 Feb 2003 02:18:06 -0000 1.27
@@ -6,7 +6,9 @@
* @o: the object to initialize
*
* Returns no value. Sets all of the fields of the object @o to their default
- * values.
+ * values. NEVER, EVER inherit directly from this class, inherit from the
+ * widget instead. The separation is really just a convenience factor, a
+ * Widget really is the lowest common class.
*/
void ewl_object_init(Ewl_Object * o)
{
@@ -43,7 +45,8 @@
* integers pointed to by the parameters @x, @y, @w, and @h.
*/
void
-ewl_object_get_current_geometry(Ewl_Object * o, int *x, int *y, int *w, int *h)
+ewl_object_get_current_geometry(Ewl_Object * o, int *x, int *y,
+ unsigned int *w, unsigned int *h)
{
DCHECK_PARAM_PTR("o", o);
@@ -66,7 +69,8 @@
* Returns no value. Stores the width and height of object @o into @w and @h
* respectively.
*/
-void ewl_object_get_current_size(Ewl_Object * o, int *w, int *h)
+void
+ewl_object_get_current_size(Ewl_Object * o, unsigned int *w, unsigned int *h)
{
DCHECK_PARAM_PTR("o", o);
@@ -110,7 +114,7 @@
*
* Returns the current width of the object @o.
*/
-int ewl_object_get_current_w(Ewl_Object * o)
+unsigned int ewl_object_get_current_w(Ewl_Object * o)
{
DCHECK_PARAM_PTR_RET("o", o, 0);
@@ -124,7 +128,7 @@
*
* Returns the current height of the object @o.
*/
-int ewl_object_get_current_h(Ewl_Object * o)
+unsigned int ewl_object_get_current_h(Ewl_Object * o)
{
DCHECK_PARAM_PTR_RET("o", o, 0);
@@ -143,7 +147,8 @@
* maximum value or smaller than the objects minimum value. If they are
* outside these bounds, the size is not altered.
*/
-void ewl_object_set_preferred_size(Ewl_Object * o, int w, int h)
+void ewl_object_set_preferred_size(Ewl_Object * o, unsigned int w,
+ unsigned int h)
{
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -163,7 +168,7 @@
* Returns no value. Sets the preferred of @o width to @w or as close as
* possible according to the bounds.
*/
-void ewl_object_set_preferred_w(Ewl_Object * o, int w)
+void ewl_object_set_preferred_w(Ewl_Object * o, unsigned int w)
{
int old_size;
@@ -205,7 +210,7 @@
* Returns no value. Sets the preferred of @o height to @w or as close as
* possible according to the bounds.
*/
-void ewl_object_set_preferred_h(Ewl_Object * o, int h)
+void ewl_object_set_preferred_h(Ewl_Object * o, unsigned int h)
{
int old_size;
@@ -248,7 +253,8 @@
* Returns no value. Stores the width and height of object @o into @w and @h
* respectively.
*/
-void ewl_object_get_preferred_size(Ewl_Object * o, int *w, int *h)
+void ewl_object_get_preferred_size(Ewl_Object * o,
+ unsigned int *w, unsigned int *h)
{
DCHECK_PARAM_PTR("o", o);
@@ -264,12 +270,21 @@
*
* Returns the preferred width of the object @o.
*/
-int ewl_object_get_preferred_w(Ewl_Object * o)
+unsigned int ewl_object_get_preferred_w(Ewl_Object * o)
{
+ unsigned int add, temp;
DCHECK_PARAM_PTR_RET("o", o, 0);
- DRETURN_INT(PREFERRED_W(o) + INSET_HORIZONTAL(o) +
- PADDING_HORIZONTAL(o), DLEVEL_STABLE);
+ add = INSET_HORIZONTAL(o) + PADDING_HORIZONTAL(o);
+
+ if (PREFERRED_W(o) < MINIMUM_W(o))
+ temp = MINIMUM_W(o);
+ else
+ temp = PREFERRED_W(o);
+
+ temp += add;
+
+ DRETURN_INT(temp, DLEVEL_STABLE);
}
/**
@@ -278,12 +293,22 @@
*
* Returns the preferred height of the object @o.
*/
-int ewl_object_get_preferred_h(Ewl_Object * o)
+unsigned int ewl_object_get_preferred_h(Ewl_Object * o)
{
+ unsigned int add, temp;
+
DCHECK_PARAM_PTR_RET("o", o, 0);
- DRETURN_INT(PREFERRED_H(o) + INSET_VERTICAL(o) + PADDING_VERTICAL(o),
- DLEVEL_STABLE);
+ add = INSET_VERTICAL(o) + PADDING_VERTICAL(o);
+
+ if (PREFERRED_H(o) < MINIMUM_H(o))
+ add += MINIMUM_H(o);
+ else
+ add += PREFERRED_H(o);
+
+ temp += add;
+
+ DRETURN_INT(add, DLEVEL_STABLE);
}
/**
@@ -298,7 +323,8 @@
* object @o. This is the usual method for requesting a new geometry for an
* object.
*/
-void ewl_object_request_geometry(Ewl_Object * o, int x, int y, int w, int h)
+void ewl_object_request_geometry(Ewl_Object * o, int x, int y,
+ unsigned int w, unsigned int h)
{
/*
* Pass the parameters on to the appropriate object request functions.
@@ -318,7 +344,7 @@
* object @o at a later time. This is the usual method for requesting a new
* size for an object.
*/
-void ewl_object_request_size(Ewl_Object * o, int w, int h)
+void ewl_object_request_size(Ewl_Object * o, unsigned int w, unsigned int h)
{
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -364,6 +390,7 @@
DCHECK_PARAM_PTR("o", o);
CURRENT_X(o) = x + PADDING_LEFT(o) + INSET_LEFT(o);
+ ewl_widget_configure(EWL_WIDGET(o));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -384,6 +411,7 @@
DCHECK_PARAM_PTR("o", o);
CURRENT_Y(o) = y + PADDING_TOP(o) + INSET_TOP(o);
+ ewl_widget_configure(EWL_WIDGET(o));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -397,7 +425,7 @@
* Returns no value. The given width is stored to be applied to the
* object @o at a later time.
*/
-void ewl_object_request_w(Ewl_Object * o, int w)
+void ewl_object_request_w(Ewl_Object * o, unsigned int w)
{
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -422,6 +450,7 @@
CURRENT_W(o) = MAXIMUM_W(o);
else
CURRENT_W(o) = w;
+ ewl_widget_configure(EWL_WIDGET(o));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -435,7 +464,7 @@
* Returns no value. The given height is stored to be applied to the
* object @o at a later time.
*/
-void ewl_object_request_h(Ewl_Object * o, int h)
+void ewl_object_request_h(Ewl_Object * o, unsigned int h)
{
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -460,6 +489,7 @@
CURRENT_H(o) = MAXIMUM_H(o);
else
CURRENT_H(o) = h;
+ ewl_widget_configure(EWL_WIDGET(o));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -474,7 +504,7 @@
* current size or maximum size are less than the new minimum, they are set to
* the new minimum size.
*/
-void ewl_object_set_minimum_size(Ewl_Object * o, int w, int h)
+void ewl_object_set_minimum_size(Ewl_Object * o, unsigned int w, unsigned int h)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("o", o);
@@ -495,18 +525,18 @@
* current width or maximum width are less than the new minimum, they are set to
* the new minimum width.
*/
-inline void ewl_object_set_minimum_w(Ewl_Object * o, int w)
+inline void ewl_object_set_minimum_w(Ewl_Object * o, unsigned int w)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("o", o);
- MINIMUM_W(o) = w + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
+ MINIMUM_W(o) = w;
if (MAXIMUM_W(o) < w)
MAXIMUM_W(o) = w;
if (CURRENT_W(o) < w)
- CURRENT_W(o) = w;
+ ewl_object_request_w(o, w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -521,7 +551,7 @@
* current height or maximum height are less than the new minimum, they are set
* to the new minimum height.
*/
-inline void ewl_object_set_minimum_h(Ewl_Object * o, int h)
+inline void ewl_object_set_minimum_h(Ewl_Object * o, unsigned int h)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("o", o);
@@ -532,7 +562,7 @@
MAXIMUM_H(o) = h;
if (CURRENT_H(o) < h)
- CURRENT_H(o) = h;
+ ewl_object_request_h(o, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -543,7 +573,7 @@
*
* Returns the minimum width of the object @o.
*/
-inline int ewl_object_get_minimum_w(Ewl_Object * o)
+inline unsigned int ewl_object_get_minimum_w(Ewl_Object * o)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
@@ -558,7 +588,7 @@
*
* Returns the minimum height of the object @o.
*/
-inline int ewl_object_get_minimum_h(Ewl_Object * o)
+inline unsigned int ewl_object_get_minimum_h(Ewl_Object * o)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
@@ -576,7 +606,8 @@
* Returns no value. Stores the minimum height and width of object @o into the
* integers pointed to by @w and @h respectively.
*/
-void ewl_object_get_minimum_size(Ewl_Object * o, int *w, int *h)
+void
+ewl_object_get_minimum_size(Ewl_Object * o, unsigned int *w, unsigned int *h)
{
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -601,7 +632,8 @@
* current size or minimum size are less than the new maximum, they are set to
* the new maximum size.
*/
-void ewl_object_set_maximum_size(Ewl_Object * o, int w, int h)
+void
+ewl_object_set_maximum_size(Ewl_Object * o, unsigned int w, unsigned int h)
{
DCHECK_PARAM_PTR("o", o);
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -622,22 +654,19 @@
* current width or minimum width are less than the new maximum, they are set to
* the new maximum width.
*/
-inline void ewl_object_set_maximum_w(Ewl_Object * o, int w)
+inline void ewl_object_set_maximum_w(Ewl_Object * o, unsigned int w)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("o", o);
MAXIMUM_W(o) = w;
- if (MAXIMUM_W(o) < 0)
- MAXIMUM_W(o) = EWL_OBJECT_MAX_SIZE;
-
- if (CURRENT_W(o) > w)
- CURRENT_W(o) = w;
-
if (MINIMUM_W(o) > w)
MINIMUM_W(o) = w;
+ if (CURRENT_W(o) > w)
+ ewl_object_request_h(o, w);
+
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -651,21 +680,18 @@
* current height or minimum width are less than the new maximum, they are set
* to the new maximum height.
*/
-inline void ewl_object_set_maximum_h(Ewl_Object * o, int h)
+inline void ewl_object_set_maximum_h(Ewl_Object * o, unsigned int h)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("o", o);
o->maximum.h = h;
- if (MAXIMUM_H(o) < 0)
- MAXIMUM_H(o) = EWL_OBJECT_MAX_SIZE;
-
if (MINIMUM_H(o) > h)
o->minimum.h = h;
if (CURRENT_H(o) > h)
- CURRENT_H(o) = h;
+ ewl_object_request_h(o, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -677,7 +703,7 @@
*
* Returns the maximum width of the object @o.
*/
-inline int ewl_object_get_maximum_w(Ewl_Object * o)
+inline unsigned int ewl_object_get_maximum_w(Ewl_Object * o)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
@@ -694,7 +720,7 @@
*
* Returns the maximum height of the object @o.
*/
-inline int ewl_object_get_maximum_h(Ewl_Object * o)
+inline unsigned int ewl_object_get_maximum_h(Ewl_Object * o)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
@@ -713,7 +739,8 @@
* Returns no value. Stores the maximum height and width of object @o into the
* integers pointed to by @w and @h respectively.
*/
-void ewl_object_get_maximum_size(Ewl_Object * o, int *w, int *h)
+void
+ewl_object_get_maximum_size(Ewl_Object * o, unsigned int *w, unsigned int *h)
{
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -865,11 +892,9 @@
/*
* Now update the widgets parent of the change in size.
*/
- if (dh)
- ewl_container_resize_child(EWL_WIDGET(o), dh,
+ ewl_container_resize_child(EWL_WIDGET(o), dh,
EWL_ORIENTATION_HORIZONTAL);
- if (dv)
- ewl_container_resize_child(EWL_WIDGET(o), dv,
+ ewl_container_resize_child(EWL_WIDGET(o), dv,
EWL_ORIENTATION_VERTICAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -973,6 +998,9 @@
DCHECK_PARAM_PTR("o", o);
o->alignment = align;
+
+ if (EWL_WIDGET(o)->parent)
+ ewl_widget_configure(EWL_WIDGET(o)->parent);
}
/**
@@ -990,6 +1018,9 @@
DCHECK_PARAM_PTR("o", o);
o->fill_policy = fill;
+
+ if (EWL_WIDGET(o)->parent)
+ ewl_widget_configure(EWL_WIDGET(o)->parent);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_object.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- ewl_object.h 29 Jan 2003 16:56:54 -0000 1.27
+++ ewl_object.h 19 Feb 2003 02:18:06 -0000 1.28
@@ -33,45 +33,54 @@
void ewl_object_init(Ewl_Object * o);
void ewl_object_get_current_geometry(Ewl_Object * o, int *x, int *y,
- int *w, int *h);
+ unsigned int *w,
+ unsigned int *h);
-void ewl_object_get_current_size(Ewl_Object * o, int *w, int *h);
+void ewl_object_get_current_size(Ewl_Object * o, unsigned int *w,
+ unsigned int *h);
int ewl_object_get_current_x(Ewl_Object * o);
int ewl_object_get_current_y(Ewl_Object * o);
-int ewl_object_get_current_w(Ewl_Object * o);
-int ewl_object_get_current_h(Ewl_Object * o);
+unsigned int ewl_object_get_current_w(Ewl_Object * o);
+unsigned int ewl_object_get_current_h(Ewl_Object * o);
-void ewl_object_set_preferred_size(Ewl_Object * o, int w, int h);
-void ewl_object_get_preferred_size(Ewl_Object * o, int *w, int *h);
-void ewl_object_set_preferred_w(Ewl_Object * o, int w);
-int ewl_object_get_preferred_w(Ewl_Object * o);
-void ewl_object_set_preferred_h(Ewl_Object * o, int h);
-int ewl_object_get_preferred_h(Ewl_Object * o);
-
-void ewl_object_request_geometry(Ewl_Object * o, int x, int y, int w,
- int h);
-void ewl_object_request_size(Ewl_Object * o, int w, int h);
+void ewl_object_set_preferred_size(Ewl_Object * o, unsigned int w,
+ unsigned int h);
+void ewl_object_get_preferred_size(Ewl_Object * o, unsigned int *w,
+ unsigned int *h);
+void ewl_object_set_preferred_w(Ewl_Object * o, unsigned int w);
+unsigned int ewl_object_get_preferred_w(Ewl_Object * o);
+void ewl_object_set_preferred_h(Ewl_Object * o, unsigned int h);
+unsigned int ewl_object_get_preferred_h(Ewl_Object * o);
+
+void ewl_object_request_geometry(Ewl_Object * o, int x, int y,
+ unsigned int w, unsigned int h);
+void ewl_object_request_size(Ewl_Object * o, unsigned int w,
+ unsigned int h);
void ewl_object_request_position(Ewl_Object * o, int x, int y);
inline void ewl_object_request_x(Ewl_Object * o, int x);
inline void ewl_object_request_y(Ewl_Object * o, int y);
-void ewl_object_request_w(Ewl_Object * o, int w);
-void ewl_object_request_h(Ewl_Object * o, int h);
+void ewl_object_request_w(Ewl_Object * o, unsigned int w);
+void ewl_object_request_h(Ewl_Object * o, unsigned int h);
-void ewl_object_set_minimum_size(Ewl_Object * o, int w, int h);
-inline void ewl_object_set_minimum_w(Ewl_Object * o, int w);
-inline void ewl_object_set_minimum_h(Ewl_Object * o, int h);
-
-void ewl_object_get_minimum_size(Ewl_Object * o, int *w, int *h);
-inline int ewl_object_get_minimum_w(Ewl_Object * o);
-inline int ewl_object_get_minimum_h(Ewl_Object * o);
-
-void ewl_object_set_maximum_size(Ewl_Object * o, int w, int h);
-inline void ewl_object_set_maximum_w(Ewl_Object * o, int w);
-inline void ewl_object_set_maximum_h(Ewl_Object * o, int h);
-
-void ewl_object_get_maximum_size(Ewl_Object * o, int *w, int *h);
-inline int ewl_object_get_maximum_w(Ewl_Object * o);
-inline int ewl_object_get_maximum_h(Ewl_Object * o);
+void ewl_object_set_minimum_size(Ewl_Object * o, unsigned int w,
+ unsigned int h);
+inline void ewl_object_set_minimum_w(Ewl_Object * o, unsigned int w);
+inline void ewl_object_set_minimum_h(Ewl_Object * o, unsigned int h);
+
+void ewl_object_get_minimum_size(Ewl_Object * o, unsigned int *w,
+ unsigned int *h);
+inline unsigned int ewl_object_get_minimum_w(Ewl_Object * o);
+inline unsigned int ewl_object_get_minimum_h(Ewl_Object * o);
+
+void ewl_object_set_maximum_size(Ewl_Object * o, unsigned int w,
+ unsigned int h);
+inline void ewl_object_set_maximum_w(Ewl_Object * o, unsigned int w);
+inline void ewl_object_set_maximum_h(Ewl_Object * o, unsigned int h);
+
+void ewl_object_get_maximum_size(Ewl_Object * o, unsigned int *w,
+ unsigned int *h);
+inline unsigned int ewl_object_get_maximum_w(Ewl_Object * o);
+inline unsigned int ewl_object_get_maximum_h(Ewl_Object * o);
inline void ewl_object_set_alignment(Ewl_Object * o, Ewl_Alignment align);
inline Ewl_Alignment ewl_object_get_alignment(Ewl_Object * o);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_row.c 3 Feb 2003 06:37:00 -0000 1.3
+++ ewl_row.c 19 Feb 2003 02:18:06 -0000 1.4
@@ -44,7 +44,7 @@
DCHECK_PARAM_PTR_RET("row", row, FALSE);
ewl_container_init(EWL_CONTAINER(row), "row", __ewl_row_add,
- __ewl_row_resize);
+ __ewl_row_resize, NULL);
ewl_callback_append(EWL_WIDGET(row), EWL_CALLBACK_CONFIGURE,
__ewl_row_configure, NULL);
@@ -60,7 +60,7 @@
* Returns no value. The table of widths for @row is changed to @colw, if
* @colw is NULL, then each cell is given it's preferred size.
*/
-void ewl_row_set_column_table(Ewl_Row *row, unsigned int *colw)
+void ewl_row_set_column_table(Ewl_Row *row, int n, unsigned int **colw)
{
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -91,24 +91,17 @@
/*
* Look up the widths and heights from it's column width table.
*/
- if (row->colw) {
- int i = 0;
-
- while ((child = ewd_list_next(c->children))) {
+ int i = 0;
+ while ((child = ewd_list_next(c->children))) {
+ if (row->colw && row->colw[i]) {
ewl_object_request_geometry(child, x, CURRENT_Y(w),
- row->colw[i], PREFERRED_H(child));
- i++;
+ *row->colw[i], PREFERRED_H(child));
}
- }
- else {
- /*
- * In the absence of a column table, just give the cells their
- * preferred widths.
- */
- while ((child = ewd_list_next(c->children))) {
+ else {
ewl_object_request_geometry(child, x, CURRENT_Y(w),
PREFERRED_W(child), PREFERRED_H(child));
}
+ i++;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_row.h 3 Feb 2003 06:37:00 -0000 1.3
+++ ewl_row.h 19 Feb 2003 02:18:06 -0000 1.4
@@ -12,11 +12,11 @@
Ewl_Container container;
Ewl_Object *max;
- unsigned int *colw;
+ unsigned int **colw;
};
Ewl_Widget *ewl_row_new();
int ewl_row_init(Ewl_Row *row);
-void ewl_row_set_column_table(Ewl_Row *row, unsigned int *colw);
+void ewl_row_set_column_table(Ewl_Row *row, int n, unsigned int **colw);
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollpane.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_scrollpane.c 14 Jan 2003 21:45:04 -0000 1.8
+++ ewl_scrollpane.c 19 Feb 2003 02:18:06 -0000 1.9
@@ -60,8 +60,9 @@
w = EWL_WIDGET(s);
- ewl_container_init(EWL_CONTAINER(s), "/scrollpane",
- __ewl_scrollpane_add, __ewl_scrollpane_child_resize);
+ ewl_container_init(EWL_CONTAINER(s), "scrollpane",
+ __ewl_scrollpane_add, __ewl_scrollpane_child_resize,
+ NULL);
/*
* Create the container to hold the contents and it's configure
@@ -70,9 +71,9 @@
s->box = NEW(Ewl_Container, 1);
ZERO(s->box, Ewl_Container, 1);
ewl_container_init(EWL_CONTAINER(s->box),
- "/scrollpane/box",
+ "scrollbox",
__ewl_scrollpane_box_add,
- __ewl_scrollpane_box_resize);
+ __ewl_scrollpane_box_resize, NULL);
ewl_callback_append(s->box, EWL_CALLBACK_CONFIGURE,
__ewl_scrollpane_body_configure, s);
@@ -262,7 +263,6 @@
/*
* Configure the parts of the scrollpane.
*/
- ewl_widget_configure(s->box);
ewl_widget_configure(s->hscrollbar);
ewl_widget_configure(s->vscrollbar);
@@ -335,8 +335,6 @@
ewl_object_request_position(EWL_OBJECT(child),
CURRENT_X(w) + INSET_LEFT(w) - woffset,
CURRENT_Y(w) + INSET_TOP(w) - hoffset);
-
- ewl_widget_configure(EWL_WIDGET(child));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_seeker.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- ewl_seeker.c 13 Feb 2003 06:54:17 -0000 1.32
+++ ewl_seeker.c 19 Feb 2003 02:18:06 -0000 1.33
@@ -75,7 +75,7 @@
*/
if (orientation == EWL_ORIENTATION_HORIZONTAL) {
ewl_container_init(EWL_CONTAINER(w), "hseeker",
- NULL, NULL);
+ NULL, NULL, NULL);
ewl_object_set_preferred_h(EWL_OBJECT(w), 16);
ewl_object_set_fill_policy(EWL_OBJECT(w),
@@ -83,8 +83,8 @@
EWL_FILL_POLICY_HSHRINK);
}
else {
- ewl_container_init(EWL_CONTAINER(w),
- "vseeker", NULL, NULL);
+ ewl_container_init(EWL_CONTAINER(w), "vseeker", NULL, NULL,
+ NULL);
ewl_object_set_preferred_w(EWL_OBJECT(w), 16);
ewl_object_set_fill_policy(EWL_OBJECT(w),
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbar.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_selectionbar.c 14 Jan 2003 21:45:04 -0000 1.6
+++ ewl_selectionbar.c 19 Feb 2003 02:18:06 -0000 1.7
@@ -84,7 +84,8 @@
memset(s->bar, 0, sizeof(Ewl_Container));
- ewl_container_init(EWL_CONTAINER(s->bar), "/selectionbar", NULL, NULL);
+ ewl_container_init(EWL_CONTAINER(s->bar), "/selectionbar", NULL, NULL,
+ NULL);
ewl_object_set_fill_policy(EWL_OBJECT(s->bar), EWL_FILL_POLICY_HFILL |
EWL_FILL_POLICY_HSHRINK);
ewl_container_append_child(EWL_CONTAINER(w), EWL_WIDGET(s->bar));
@@ -423,12 +424,9 @@
ecore_add_event_timer(close_string, 0.01, __close_bar_cb, ++val,
w);
-
- ewl_widget_configure(EWL_WIDGET(s));
} else {
ewl_object_request_size(o, s->w, 5);
ewl_object_request_size(so, s->w, 5);
- ewl_widget_configure(EWL_WIDGET(s));
}
}
@@ -480,10 +478,6 @@
x - 15, CURRENT_Y(o) + CURRENT_H(o) - 15);
- ewl_widget_configure(s->scroller.top);
- ewl_widget_configure(s->scroller.bottom);
-
-
ewd_list_goto_first(children);
while ((child = ewd_list_next(children)) != NULL) {
if (child != EWL_WIDGET(s->scroller.bottom) &&
@@ -506,8 +500,6 @@
CURRENT_Y(o) +
((CURRENT_H(o) -
CURRENT_H(child)) / 2));
-
- ewl_widget_configure(child);
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbook.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_selectionbook.c 14 Jan 2003 21:45:04 -0000 1.7
+++ ewl_selectionbook.c 19 Feb 2003 02:18:06 -0000 1.8
@@ -250,8 +250,6 @@
CURRENT_Y(EWL_OBJECT(s)),
CURRENT_W(EWL_OBJECT(s)),
CURRENT_H(EWL_OBJECT(s)));
-
- ewl_widget_configure(s->current_page->page);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- ewl_spinner.c 14 Aug 2002 02:05:36 -0000 1.32
+++ ewl_spinner.c 19 Feb 2003 02:18:06 -0000 1.33
@@ -171,7 +171,7 @@
w = EWL_WIDGET(s);
- ewl_container_init(EWL_CONTAINER(w), "/spinner", NULL, NULL);
+ ewl_container_init(EWL_CONTAINER(w), "/spinner", NULL, NULL, NULL);
ewl_object_set_minimum_size(EWL_OBJECT(w), 30, 20);
ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_FILL);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_table.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ewl_table.c 3 Feb 2003 00:21:09 -0000 1.33
+++ ewl_table.c 19 Feb 2003 02:18:06 -0000 1.34
@@ -61,7 +61,7 @@
/*
* Iniitialize the tables inherited fields
*/
- ewl_container_init(EWL_CONTAINER(t), "table", NULL, NULL);
+ ewl_container_init(EWL_CONTAINER(t), "table", NULL, NULL, NULL);
ewl_object_set_fill_policy(EWL_OBJECT(t), EWL_FILL_POLICY_FILL);
/*
@@ -502,10 +502,6 @@
INSET_RIGHT(o),
CURRENT_H(o) - INSET_TOP(o) +
INSET_BOTTOM(o));
-
-
-
- ewl_widget_configure(EWL_WIDGET(table->grid));
ewd_list_goto_first(EWL_CONTAINER(table->grid)->children);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -3 -r1.43 -r1.44
--- ewl_text.c 14 Jan 2003 21:45:05 -0000 1.43
+++ ewl_text.c 19 Feb 2003 02:18:06 -0000 1.44
@@ -666,9 +666,7 @@
estyle_geometry(t->estyle, &x, &y, &width, &height);
/*
- * Set the preferred size to the size of the estyle and request that
- * size for the widget.
+ * Set the preferred size to the size of the estyle
*/
ewl_object_set_preferred_size(EWL_OBJECT(t), width, height);
- ewl_object_set_custom_size(EWL_OBJECT(t), width, height);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_tree.c 2 Feb 2003 23:07:23 -0000 1.2
+++ ewl_tree.c 19 Feb 2003 02:18:06 -0000 1.3
@@ -9,6 +9,10 @@
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,
+ Ewl_Orientation o);
+
/**
* ewl_tree_new - allocate and initialize a new tree widget
* @columns: the number of columns to display
@@ -54,7 +58,7 @@
DCHECK_PARAM_PTR_RET("tree", tree, FALSE);
DCHECK_PARAM_PTR_RET("columns", columns, FALSE);
- ewl_container_init(EWL_CONTAINER(tree), "tree", NULL, NULL);
+ ewl_container_init(EWL_CONTAINER(tree), "tree", NULL, NULL, NULL);
ewl_callback_append(EWL_WIDGET(tree), EWL_CALLBACK_CONFIGURE,
__ewl_tree_configure, NULL);
@@ -222,7 +226,8 @@
DCHECK_PARAM_PTR_RET("node", node, FALSE);
- ewl_container_init(EWL_CONTAINER(node), "node", NULL, NULL);
+ ewl_container_init(EWL_CONTAINER(node), "node", __ewl_tree_node_add,
+ __ewl_tree_node_resize, NULL);
ewl_callback_append(EWL_WIDGET(node), EWL_CALLBACK_CONFIGURE,
__ewl_tree_node_configure, NULL);
@@ -249,9 +254,9 @@
*/
i = 0;
y = CURRENT_Y(w);
- h = CURRENT_H(w) / ewd_list_nodes(c->children);
ewd_list_goto_first(c->children);
while (i < tree->nrows && (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;
@@ -296,6 +301,38 @@
ewl_object_request_geometry(child, x, CURRENT_Y(w),
CURRENT_W(w), CURRENT_H(w));
}
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+void
+__ewl_tree_node_add(Ewl_Container *c, Ewl_Widget *w)
+{
+ int width;
+ Ewl_Tree_Node *node;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ node = EWL_TREE_NODE(c);
+
+ if (!ewd_list_nodes(c->children) || node->expanded) {
+ ewl_object_set_preferred_h(EWL_OBJECT(c),
+ ewl_object_get_preferred_h(EWL_OBJECT(c)) +
+ ewl_object_get_preferred_h(EWL_OBJECT(w)));
+ }
+
+ width = ewl_object_get_preferred_w(EWL_OBJECT(w));
+ if (ewl_object_get_preferred_w(EWL_OBJECT(c)) < width)
+ ewl_object_set_preferred_w(EWL_OBJECT(c), width);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+void
+__ewl_tree_node_resize(Ewl_Container *c, Ewl_Widget *w, int size,
+ Ewl_Orientation o)
+{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- ewl_window.c 24 Jan 2003 17:06:19 -0000 1.41
+++ ewl_window.c 19 Feb 2003 02:18:06 -0000 1.42
@@ -14,6 +14,8 @@
void __ewl_window_configure(Ewl_Widget * w, void *ev_data,
void *user_data);
void __ewl_window_child_add(Ewl_Container * win, Ewl_Widget * child);
+void __ewl_window_child_resize(Ewl_Container *c, Ewl_Widget *w,
+ int size, Ewl_Orientation o);
/**
* ewl_window_new - allocate and initialize a new window
@@ -383,7 +385,8 @@
* Initialize the fields of the inherited container class
*/
ewl_container_init(EWL_CONTAINER(w), "/window",
- __ewl_window_child_add, NULL);
+ __ewl_window_child_add, __ewl_window_child_resize,
+ NULL);
ewl_object_request_size(EWL_OBJECT(w), 256, 256);
w->title = strdup("EWL!");
@@ -556,17 +559,58 @@
DRETURN(DLEVEL_STABLE);
/*
- * Resize to fit the preferred size of the contents.
+ * Configure each of the child widgets.
*/
- ewl_object_set_preferred_size(EWL_OBJECT(w), 0, 0);
+ 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) - (CURRENT_X(child)),
+ CURRENT_H(w) - (CURRENT_Y(child)));
+ }
+
+ ecore_window_resize(win->window,
+ ewl_object_get_current_w(EWL_OBJECT(w)),
+ ewl_object_get_current_h(EWL_OBJECT(w)));
+ ecore_window_resize(win->evas_window,
+ ewl_object_get_current_w(EWL_OBJECT(w)),
+ ewl_object_get_current_h(EWL_OBJECT(w)));
+ evas_output_size_set(win->evas,
+ ewl_object_get_current_w(EWL_OBJECT(w)),
+ ewl_object_get_current_h(EWL_OBJECT(w)));
+ evas_output_viewport_set(win->evas,
+ ewl_object_get_current_x(EWL_OBJECT(w)),
+ ewl_object_get_current_y(EWL_OBJECT(w)),
+ ewl_object_get_current_w(EWL_OBJECT(w)),
+ ewl_object_get_current_h(EWL_OBJECT(w)));
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+void __ewl_window_child_add(Ewl_Container * win, Ewl_Widget * child)
+{
+ LAYER(child) += 100;
+}
+
+void __ewl_window_child_resize(Ewl_Container *c, Ewl_Widget *w,
+ int size, Ewl_Orientation o)
+{
+ int maxw = 0, maxh = 0;
+ Ewl_Window *win;
+ Ewl_Object *child;
+
+ child = EWL_OBJECT(w);
+ win = EWL_WINDOW(c);
ewd_list_goto_first(EWL_CONTAINER(win)->children);
while ((child = ewd_list_next(EWL_CONTAINER(win)->children))) {
- int ws;
int cs;
- ws = ewl_object_get_preferred_w(EWL_OBJECT(win));
-
/*
* Adjust children for insets
*/
@@ -581,67 +625,25 @@
/*
* Check the width and x position vs. window width.
*/
- if (ws < cs)
- ewl_object_set_preferred_w(EWL_OBJECT(win), cs);
+ if (maxw < cs)
+ maxw = cs;
- ws = ewl_object_get_preferred_h(EWL_OBJECT(win));
cs = ewl_object_get_current_y(child) +
ewl_object_get_preferred_h(child);
/*
* Check the height and y position vs. window height.
*/
- if (ws < cs)
- ewl_object_set_preferred_h(EWL_OBJECT(win), cs);
+ if (maxh < cs)
+ maxh = cs;
}
- if (win->flags & EWL_WINDOW_AUTO_SIZE) {
- ewl_object_request_size(EWL_OBJECT(w),
- ewl_object_get_preferred_w(EWL_OBJECT(w)),
- ewl_object_get_preferred_h(EWL_OBJECT(w)));
- ecore_window_resize(win->window,
- ewl_object_get_current_w(EWL_OBJECT(w)),
- ewl_object_get_current_h(EWL_OBJECT(w)));
- }
-
- ecore_window_resize(win->evas_window,
- ewl_object_get_current_w(EWL_OBJECT(w)),
- ewl_object_get_current_h(EWL_OBJECT(w)));
- evas_output_size_set(win->evas,
- ewl_object_get_current_w(EWL_OBJECT(w)),
- ewl_object_get_current_h(EWL_OBJECT(w)));
- evas_output_viewport_set(win->evas,
- ewl_object_get_current_x(EWL_OBJECT(w)),
- ewl_object_get_current_y(EWL_OBJECT(w)),
- ewl_object_get_current_w(EWL_OBJECT(w)),
- ewl_object_get_current_h(EWL_OBJECT(w)));
+ ewl_object_set_preferred_size(EWL_OBJECT(win), maxw, maxh);
- /*
- * 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) - (CURRENT_X(child)),
- CURRENT_H(w) - (CURRENT_Y(child)));
-
- /*
- * Now configure the widget.
- */
- ewl_widget_configure(EWL_WIDGET(child));
+ if (win->flags & EWL_WINDOW_AUTO_SIZE) {
+ ewl_object_request_size(EWL_OBJECT(c),
+ ewl_object_get_preferred_w(EWL_OBJECT(c)),
+ ewl_object_get_preferred_h(EWL_OBJECT(c)));
}
-
- DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
-void __ewl_window_child_add(Ewl_Container * win, Ewl_Widget * child)
-{
- LAYER(child) += 100;
}
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs