Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_container.c ewl_embed.c ewl_misc.c ewl_object.c
ewl_widget.c
Log Message:
Minor theme adjustments, adjusted some of the code for resizing parents with
respect to their children changing size. Also changed the box test to work
correctly when changing fill policies on buttons.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- ewl_container.c 7 Oct 2003 21:26:23 -0000 1.46
+++ ewl_container.c 8 Oct 2003 21:42:16 -0000 1.47
@@ -248,7 +248,7 @@
DCHECK_PARAM_PTR("w", w);
- if (!size)
+ if (!size || ewl_in_realize_phase() || !REALIZED(w))
DRETURN(DLEVEL_STABLE);
/*
@@ -507,8 +507,12 @@
*/
void ewl_container_call_child_add(Ewl_Container *c, Ewl_Widget *w)
{
- if (c->child_add && VISIBLE(w))
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ if (c->child_add && VISIBLE(w) && REALIZED(w))
c->child_add(c, w);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
/**
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_embed.c 7 Oct 2003 21:26:23 -0000 1.7
+++ ewl_embed.c 8 Oct 2003 21:42:17 -0000 1.8
@@ -331,13 +331,21 @@
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_current_w(EWL_OBJECT(child)) - CURRENT_X(emb);
+ 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_current_h(EWL_OBJECT(child)) - CURRENT_Y(emb);
+ 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);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- ewl_misc.c 7 Oct 2003 21:26:23 -0000 1.41
+++ ewl_misc.c 8 Oct 2003 21:42:17 -0000 1.42
@@ -14,6 +14,8 @@
Ewd_List *free_evas_list = NULL;
Ewd_List *free_evas_object_list = NULL;
+Ewd_List *child_add_list= NULL;
+
void __ewl_init_parse_options(int argc, char **argv);
void __ewl_parse_option_array(int argc, char **argv);
int __ewl_ecore_exit(void *data, int type, void *event);
@@ -53,6 +55,8 @@
destroy_list = ewd_list_new();
free_evas_list = ewd_list_new();
free_evas_object_list = ewd_list_new();
+ child_add_list = ewd_list_new();
+
__ewl_init_parse_options(argc, argv);
ecore_init();
@@ -176,8 +180,13 @@
ecore_main_loop_quit();
ewl_callbacks_deinit();
+
ewd_list_destroy(configure_list);
ewd_list_destroy(realize_list);
+ ewd_list_destroy(destroy_list);
+ ewd_list_destroy(free_evas_list);
+ ewd_list_destroy(free_evas_object_list);
+ ewd_list_destroy(child_add_list);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -396,7 +405,6 @@
*/
if (ewd_list_nodes(configure_list) > longest) {
longest = ewd_list_nodes(configure_list);
- printf("SCHEDULING CONFIGURATION OF %d WIDGETS\n", longest);
}
DLEAVE_FUNCTION(DLEVEL_TESTING);
@@ -480,9 +488,13 @@
{
Ewl_Widget *w;
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ ewl_enter_realize_phase();
+
/*
* First realize any widgets that require it, this looping should
- * avoid deep recursion.
+ * avoid deep recursion, and works from top to bottom.
*/
ewd_list_goto_first(realize_list);
while ((w = ewd_list_remove_first(realize_list))) {
@@ -490,8 +502,23 @@
ewl_object_remove_queued(EWL_OBJECT(w),
EWL_FLAG_QUEUED_RSCHEDULED);
ewl_widget_realize(EWL_WIDGET(w));
+ ewd_list_prepend(child_add_list, w);
}
}
+
+ /*
+ * Work our way back up the chain of widgets to resize from bottom to
+ * top.
+ */
+ while ((w = ewd_list_remove_first(child_add_list))) {
+ if (w->parent)
+ ewl_container_call_child_add(EWL_CONTAINER(w->parent),
+ w);
+ }
+
+ ewl_exit_realize_phase();
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
/**
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_object.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -3 -r1.43 -r1.44
--- ewl_object.c 29 Sep 2003 21:46:50 -0000 1.43
+++ ewl_object.c 8 Oct 2003 21:42:18 -0000 1.44
@@ -120,7 +120,7 @@
DCHECK_PARAM_PTR_RET("o", o, 0);
- w = CURRENT_W(o) + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
+ w = CURRENT_W(o);
if (w < MINIMUM_W(o))
w = MINIMUM_W(o);
@@ -131,6 +131,8 @@
if (w > MAXIMUM_W(o))
w = MAXIMUM_W(o);
+ w += PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
+
DRETURN_INT(w, DLEVEL_STABLE);
}
@@ -145,7 +147,7 @@
DCHECK_PARAM_PTR_RET("o", o, 0);
- h = CURRENT_H(o) + PADDING_VERTICAL(o) + INSET_VERTICAL(o);
+ h = CURRENT_H(o);
if (h < MINIMUM_H(o))
h = MINIMUM_H(o);
@@ -156,6 +158,8 @@
if (h > MAXIMUM_H(o))
h = MAXIMUM_H(o);
+ h += PADDING_VERTICAL(o) + INSET_VERTICAL(o);
+
DRETURN_INT(h, DLEVEL_STABLE);
}
@@ -195,7 +199,7 @@
*/
void ewl_object_set_preferred_w(Ewl_Object * o, unsigned int w)
{
- int old_size, new_size;
+ int old_size, new_size, resize;
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -214,10 +218,19 @@
else
new_size = w;
+ resize = ewl_object_get_fill_policy(EWL_OBJECT(o)) &
+ EWL_FLAG_FILL_HSHRINK;
+
/*
* Now update the widgets parent of the change in size.
*/
- if (REALIZED(o) && !(o->flags & EWL_FLAG_FILL_HSHRINK))
+ if (CURRENT_W(o) < PREFERRED_W(o) && resize) {
+ resize = 0;
+ }
+ else
+ resize = 1;
+
+ if (resize)
ewl_container_resize_child(EWL_WIDGET(o), new_size - old_size,
EWL_ORIENTATION_HORIZONTAL);
@@ -235,7 +248,7 @@
*/
void ewl_object_set_preferred_h(Ewl_Object * o, unsigned int h)
{
- int old_size, new_size;
+ int old_size, new_size, resize;
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -254,10 +267,19 @@
else
new_size = h;
+ resize = ewl_object_get_fill_policy(EWL_OBJECT(o)) &
+ EWL_FLAG_FILL_VSHRINK;
+
/*
- * Notify the parent widgets of the change in size.
+ * Now update the widgets parent of the change in size.
*/
- if (REALIZED(o) && !(o->flags & EWL_FLAG_FILL_VSHRINK))
+ if (CURRENT_H(o) < PREFERRED_H(o) && resize) {
+ resize = 0;
+ }
+ else
+ resize = 1;
+
+ if (resize)
ewl_container_resize_child(EWL_WIDGET(o), new_size - old_size,
EWL_ORIENTATION_VERTICAL);
@@ -457,11 +479,10 @@
DCHECK_PARAM_PTR("o", o);
- w -= PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
- if ((signed int)w < 0) {
- printf("FIXME: Negative width requested check child add/resize"
- "/remove functions\n");
- }
+ if (w > PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o))
+ w -= PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
+ else
+ w = 0;
/*
* Bound the width by the preferred size first.
@@ -500,12 +521,10 @@
DCHECK_PARAM_PTR("o", o);
- h -= PADDING_VERTICAL(o) + INSET_VERTICAL(o);
- if ((signed int)h < 0) {
- printf("FIXME: Negative height requested check child add/resize"
- "/remove functions\n");
+ if (h > PADDING_VERTICAL(o) + INSET_VERTICAL(o))
+ h -= PADDING_VERTICAL(o) + INSET_VERTICAL(o);
+ else
h = 0;
- }
/*
* Bound the width by the preferred size first.
@@ -577,9 +596,9 @@
MAXIMUM_W(o) = w;
if (PREFERRED_W(o) < MINIMUM_W(o))
- ewl_container_resize_child(EWL_WIDGET(o), MINIMUM_W(o) -
- PREFERRED_W(o),
- EWL_ORIENTATION_HORIZONTAL);
+ ewl_container_resize_child(EWL_WIDGET(o),
+ MINIMUM_W(o) - PREFERRED_W(o),
+ EWL_ORIENTATION_HORIZONTAL);
if (CURRENT_W(o) < w)
ewl_object_request_w(o, w);
@@ -613,9 +632,9 @@
MAXIMUM_H(o) = h;
if (PREFERRED_H(o) < MINIMUM_H(o))
- ewl_container_resize_child(EWL_WIDGET(o), MINIMUM_W(o) -
- PREFERRED_W(o),
- EWL_ORIENTATION_VERTICAL);
+ ewl_container_resize_child(EWL_WIDGET(o),
+ MINIMUM_H(o) - PREFERRED_H(o),
+ EWL_ORIENTATION_VERTICAL);
if (CURRENT_H(o) < h)
ewl_object_request_h(o, h);
@@ -875,9 +894,9 @@
* Now update the widgets parent of the change in size.
*/
ewl_container_resize_child(EWL_WIDGET(o), dh,
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
ewl_container_resize_child(EWL_WIDGET(o), dv,
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -3 -r1.75 -r1.76
--- ewl_widget.c 7 Oct 2003 21:26:23 -0000 1.75
+++ ewl_widget.c 8 Oct 2003 21:42:18 -0000 1.76
@@ -130,8 +130,6 @@
if (REALIZED(w))
DRETURN(DLEVEL_STABLE);
- ewl_enter_realize_phase();
-
/*
* The parent's realize function will get us here again.
*/
@@ -142,8 +140,6 @@
ewl_widget_show(w);
}
- ewl_exit_realize_phase();
-
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -187,12 +183,11 @@
pc = EWL_CONTAINER(w->parent);
if (HIDDEN(w)) {
ewl_object_add_visible(EWL_OBJECT(w), EWL_FLAG_VISIBLE_SHOWN);
- if (pc)
- ewl_container_call_child_add(pc, w);
}
- if (REALIZED(w))
+ if (REALIZED(w)) {
ewl_callback_call(w, EWL_CALLBACK_SHOW);
+ }
else
ewl_realize_request(w);
@@ -722,7 +717,7 @@
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
- if (w->fx_clip_box && (w->theme_object || RECURSIVE(w)))
+ if (w->fx_clip_box)
evas_object_show(w->fx_clip_box);
DLEAVE_FUNCTION(DLEVEL_STABLE);
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs