Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
Ewl.h ewl_box.c ewl_box.h ewl_cell.c ewl_config.c
ewl_container.c ewl_entry.c ewl_enums.h ewl_fx.c ewl_grid.c
ewl_image.c ewl_imenu.c ewl_menu_base.c ewl_menu_base.h
ewl_notebook.c ewl_object.c ewl_row.c ewl_scrollpane.c
ewl_seeker.c ewl_selectionbar.c ewl_spinner.c ewl_theme.c
ewl_tree.c ewl_tree.h ewl_window.c
Log Message:
Some minor tweaks to the layout model. Basing container sizes on the minimum
sizes of their contents and allowing for fill policies to do their jobs seems
to give cleaner results.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Ewl.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- Ewl.h 23 May 2003 22:10:15 -0000 1.29
+++ Ewl.h 3 Jun 2003 04:00:37 -0000 1.30
@@ -20,8 +20,8 @@
#include <sys/stat.h>
#include <unistd.h>
-#ifndef PATH_LEN
-#define PATH_LEN 4096
+#ifndef PATH_MAX
+#define PATH_MAX 4096
#endif
#include <ewl_debug.h>
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_box.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- ewl_box.c 23 May 2003 22:10:15 -0000 1.50
+++ ewl_box.c 3 Jun 2003 04:00:38 -0000 1.51
@@ -19,13 +19,10 @@
* Function pointers for getting the dimension of the widget that we
* care about.
*/
- unsigned int (*pref_fill_ask) (Ewl_Object * ob);
void (*pref_fill_set) (Ewl_Object * ob, unsigned int size);
unsigned int (*fill_ask) (Ewl_Object * ob);
void (*fill_set) (Ewl_Object * ob, unsigned int size);
- unsigned int (*pref_align_ask) (Ewl_Object * ob);
- void (*pref_align_set) (Ewl_Object * ob, unsigned int size);
unsigned int (*align_ask) (Ewl_Object * ob);
void (*align_set) (Ewl_Object * ob, unsigned int size);
@@ -338,6 +335,9 @@
DENTER_FUNCTION(DLEVEL_STABLE);
+ if (ewd_list_is_empty(EWL_CONTAINER(w)->children))
+ DRETURN(DLEVEL_STABLE);
+
num = 0;
ewd_list_goto_first(EWL_CONTAINER(w)->children);
while ((child = ewd_list_next(EWL_CONTAINER(w)->children))) {
@@ -396,9 +396,12 @@
__ewl_box_configure_calc(Ewl_Box * b, int *fill_size, int *align_size)
{
Ewl_Object *child;
+ unsigned int initial;
DENTER_FUNCTION(DLEVEL_STABLE);
+ initial = *fill_size / ewd_list_nodes(EWL_CONTAINER(b)->children);
+
/*
* Sort the children into lists dependant on their alignment within the
* box.
@@ -416,7 +419,7 @@
/*
* Set the initial fill size to the preferred size.
*/
- info->fill_set(child, info->pref_fill_ask(child));
+ info->fill_set(child, initial);
/*
* Figure out how much extra space is available for
@@ -489,7 +492,7 @@
* If the child did not accept any of the size, then
* it's at it's max/min and is no longer useful.
*/
- if (temp <= 0)
+ if (!temp || (*fill_size - temp < 0))
ewd_list_remove(spread);
else {
*fill_size -= temp;
@@ -540,7 +543,7 @@
* otherwise subtract the accepted space from the
* total.
*/
- if (temp <= 0)
+ if (!temp || (*fill_size - temp < 0))
ewd_list_remove(spread);
else {
*fill_size -= remainder;
@@ -632,55 +635,31 @@
static void
__ewl_box_add(Ewl_Container * c, Ewl_Widget * w)
{
- int max_size = 0;
- int osize, temp;
- Box_Orientation *info;
+ unsigned int space = 0;
- DCHECK_PARAM_PTR("c", c);
- DCHECK_PARAM_PTR("w", w);
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ if (ewd_list_nodes(c->children) > 1)
+ space = EWL_BOX(c)->spacing;
/*
* Base the info used on the orientation of the box.
*/
if (EWL_BOX(c)->orientation == EWL_ORIENTATION_HORIZONTAL) {
- osize = PREFERRED_W(c);
- info = horizontal;
+ ewl_object_set_preferred_w(EWL_OBJECT(c), PREFERRED_W(c) +
+ ewl_object_get_minimum_w(EWL_OBJECT(w)) +
+ space);
+ ewl_container_prefer_largest(c, EWL_ORIENTATION_VERTICAL);
}
else {
- osize = PREFERRED_H(c);
- info = vertical;
- }
-
- /*
- * If there already is a max widget, compare size to that one.
- */
- if (EWL_BOX(c)->max_align)
- max_size =
- info->pref_align_ask(EWL_OBJECT(EWL_BOX(c)->max_align));
- else
- max_size = info->pref_align_ask(EWL_OBJECT(w));
-
- temp = info->pref_align_ask(EWL_OBJECT(w));
-
- /*
- * Use a <= here so we don't need as many cases in the previous if
- * statement. If this widget is the largest so far, mark it as the
- * largest in the box.
- */
- if (max_size <= temp) {
- EWL_BOX(c)->max_align = w;
- info->pref_align_set(EWL_OBJECT(c), temp);
+ ewl_object_set_preferred_h(EWL_OBJECT(c), PREFERRED_H(c) +
+ ewl_object_get_minimum_h(EWL_OBJECT(w)) +
+ space);
+ ewl_container_prefer_largest(c, EWL_ORIENTATION_HORIZONTAL);
}
- temp = info->pref_fill_ask(EWL_OBJECT(w));
- /*
- * Add the size of the new child, and add in the spacing if there's
- * any other widgets in the box.
- */
- info->pref_fill_set(EWL_OBJECT(c), osize + temp +
- (ewd_list_nodes(c->children) > 1 ?
- EWL_BOX(c)->spacing : 0));
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
@@ -689,32 +668,28 @@
int space = 0;
Ewl_Box *b = EWL_BOX(c);
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
if (ewd_list_nodes(c->children) > 1)
space = b->spacing;
if (b->orientation == EWL_ORIENTATION_HORIZONTAL) {
ewl_object_set_preferred_w(EWL_OBJECT(c),
PREFERRED_W(c) -
- ewl_object_get_preferred_w(EWL_OBJECT(w)) -
+ ewl_object_get_minimum_w(EWL_OBJECT(w)) -
space);
- if (w == b->max_align) {
- ewl_container_prefer_largest(c,
- EWL_ORIENTATION_HORIZONTAL);
- b->max_align = NULL;
- }
+ ewl_container_prefer_largest(c, EWL_ORIENTATION_VERTICAL);
}
else {
ewl_object_set_preferred_h(EWL_OBJECT(c),
PREFERRED_H(c) -
- ewl_object_get_preferred_h(EWL_OBJECT(w)) -
+ ewl_object_get_minimum_w(EWL_OBJECT(w)) -
space);
- if (w == b->max_align) {
- ewl_container_prefer_largest(c,
- EWL_ORIENTATION_HORIZONTAL);
- b->max_align = NULL;
- }
+ ewl_container_prefer_largest(c, EWL_ORIENTATION_HORIZONTAL);
}
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
/*
@@ -725,11 +700,11 @@
__ewl_box_child_resize(Ewl_Container * c, Ewl_Widget * w, int size,
Ewl_Orientation o)
{
- int max_size = 0;
- Ewl_Object *child;
int align_size, fill_size;
Box_Orientation *info;
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
/*
* Get the appropriate dimension setting functions based on the
* orientation.
@@ -753,50 +728,12 @@
info->pref_fill_set(EWL_OBJECT(c), fill_size + size);
/*
- * Check if the change is in the alignment direction, and the
- * previous largest widget grew larger
- */
- else if ((w == EWL_BOX(c)->max_align) && (size > 0)) {
-
- /*
- * Add the change in size to the current size.
- */
- info->pref_align_set(EWL_OBJECT(c), align_size + size);
- }
-
- /*
* Find the new largest widget in the alignment direction
*/
- else {
-
- ewd_list_goto_first(c->children);
- while ((child = ewd_list_next(c->children))) {
- int temp;
-
- temp = info->pref_align_ask(child);
-
- /*
- * Found a larger widget than the previous largest, so
- * store it size as the new max size.
- */
- if (temp > max_size) {
- EWL_BOX(c)->max_align = EWL_WIDGET(child);
- max_size = temp;
- }
- }
-
- /*
- * Now store the new align max preferred size as the new
- * preferred size for this box.
- */
- info->pref_align_set(EWL_OBJECT(c), max_size);
- }
+ else
+ ewl_container_prefer_largest(c, o);
- max_size = 0;
- ewd_list_goto_first(c->children);
- while ((child = ewd_list_next(c->children)))
- max_size += ewl_object_get_preferred_h(child) + EWL_BOX(c)->spacing;
- max_size -= EWL_BOX(c)->spacing;
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
/*
@@ -833,10 +770,8 @@
* children.
*/
vertical->fill_ask = ewl_object_get_current_h;
- vertical->pref_fill_ask = ewl_object_get_preferred_h;
vertical->align_ask = ewl_object_get_current_w;
- vertical->pref_align_ask = ewl_object_get_preferred_w;
/*
* These functions allow for setting the dimensions of the
@@ -846,7 +781,6 @@
vertical->pref_fill_set = ewl_object_set_preferred_h;
vertical->align_set = ewl_object_request_w;
- vertical->pref_align_set = ewl_object_set_preferred_w;
}
if (!horizontal) {
@@ -876,10 +810,8 @@
* children.
*/
horizontal->fill_ask = ewl_object_get_current_w;
- horizontal->pref_fill_ask = ewl_object_get_preferred_w;
horizontal->align_ask = ewl_object_get_current_h;
- horizontal->pref_align_ask = ewl_object_get_preferred_h;
/*
* These functions allow for setting the dimensions of the
@@ -889,6 +821,5 @@
horizontal->pref_fill_set = ewl_object_set_preferred_w;
horizontal->align_set = ewl_object_request_h;
- horizontal->pref_align_set = ewl_object_set_preferred_h;
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_box.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ewl_box.h 30 Apr 2003 15:43:54 -0000 1.20
+++ ewl_box.h 3 Jun 2003 04:00:39 -0000 1.21
@@ -20,7 +20,6 @@
Ewl_Orientation orientation;
unsigned int spacing;
- Ewl_Widget *max_align;
unsigned int homogeneous;
};
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_cell.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewl_cell.c 19 Feb 2003 02:18:05 -0000 1.5
+++ ewl_cell.c 3 Jun 2003 04:00:39 -0000 1.6
@@ -92,8 +92,8 @@
}
ewl_object_set_preferred_size(EWL_OBJECT(c),
- ewl_object_get_preferred_w(EWL_OBJECT(w)),
- ewl_object_get_preferred_h(EWL_OBJECT(w)));
+ ewl_object_get_minimum_w(EWL_OBJECT(w)),
+ ewl_object_get_minimum_h(EWL_OBJECT(w)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -105,8 +105,8 @@
DENTER_FUNCTION(DLEVEL_STABLE);
ewl_object_set_preferred_size(EWL_OBJECT(c),
- ewl_object_get_preferred_w(EWL_OBJECT(w)),
- ewl_object_get_preferred_h(EWL_OBJECT(w)));
+ ewl_object_get_minimum_w(EWL_OBJECT(w)),
+ ewl_object_get_minimum_h(EWL_OBJECT(w)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_config.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- ewl_config.c 26 Mar 2003 05:22:02 -0000 1.23
+++ ewl_config.c 3 Jun 2003 04:00:39 -0000 1.24
@@ -276,7 +276,7 @@
void __create_user_config(void)
{
char *home;
- char pe[256];
+ char pe[PATH_MAX];
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -287,11 +287,11 @@
DRETURN(DLEVEL_STABLE);
}
- snprintf(pe, PATH_LEN, "%s/.e", home);
+ snprintf(pe, PATH_MAX, "%s/.e", home);
mkdir(pe, 0755);
- snprintf(pe, PATH_LEN, "%s/.e/ewl", home);
+ snprintf(pe, PATH_MAX, "%s/.e/ewl", home);
mkdir(pe, 0755);
- snprintf(pe, PATH_LEN, "%s/.e/ewl/config", home);
+ snprintf(pe, PATH_MAX, "%s/.e/ewl/config", home);
mkdir(pe, 0755);
ewl_config_set_int("system", "/debug/enable", 0);
@@ -331,7 +331,7 @@
static int __open_config_db(const char *name)
{
char *home;
- char path[PATH_LEN];
+ char path[PATH_MAX];
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -342,7 +342,7 @@
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
- snprintf(path, PATH_LEN, "%s/.e/ewl/config/%s.db", home, name);
+ snprintf(path, PATH_MAX, "%s/.e/ewl/config/%s.db", home, name);
config_db = e_db_open(path);
@@ -369,7 +369,7 @@
static int __config_exists(char *name)
{
char *home;
- char path[PATH_LEN];
+ char path[PATH_MAX];
struct stat st;
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -381,7 +381,7 @@
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
- snprintf(path, PATH_LEN, "%s/.e/ewl/config/%s.db", home, name);
+ snprintf(path, PATH_MAX, "%s/.e/ewl/config/%s.db", home, name);
stat(path, &st);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_container.c 14 Apr 2003 17:12:49 -0000 1.35
+++ ewl_container.c 3 Jun 2003 04:00:40 -0000 1.36
@@ -493,11 +493,11 @@
DCHECK_PARAM_PTR("c", c);
if (o == EWL_ORIENTATION_HORIZONTAL) {
- get_size = ewl_object_get_preferred_w;
+ get_size = ewl_object_get_minimum_w;
set_size = ewl_object_set_preferred_w;
}
else {
- get_size = ewl_object_get_preferred_h;
+ get_size = ewl_object_get_minimum_h;
set_size = ewl_object_set_preferred_h;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- ewl_entry.c 23 May 2003 22:10:15 -0000 1.55
+++ ewl_entry.c 3 Jun 2003 04:00:40 -0000 1.56
@@ -500,7 +500,7 @@
strcat(s3, s);
ep = ewl_cursor_get_end_position(EWL_CURSOR(e->cursor));
- if (sp != ep)
+ if (!ep || (sp != ep))
ep++;
strcat(s3, &(s2[ep - 1]));
@@ -592,8 +592,8 @@
if (e->text == w) {
ewl_object_set_preferred_size(EWL_OBJECT(c),
- ewl_object_get_preferred_w(EWL_OBJECT(w)),
- ewl_object_get_preferred_h(EWL_OBJECT(w)));
+ ewl_object_get_minimum_w(EWL_OBJECT(w)),
+ ewl_object_get_minimum_h(EWL_OBJECT(w)));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -614,10 +614,10 @@
if (o == EWL_ORIENTATION_HORIZONTAL)
ewl_object_set_preferred_w(EWL_OBJECT(entry),
- ewl_object_get_preferred_w(text));
+ ewl_object_get_minimum_w(text));
else
ewl_object_set_preferred_h(EWL_OBJECT(entry),
- ewl_object_get_preferred_h(text));
+ ewl_object_get_minimum_h(text));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_enums.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- ewl_enums.h 22 May 2003 03:57:53 -0000 1.32
+++ ewl_enums.h 3 Jun 2003 04:00:41 -0000 1.33
@@ -119,8 +119,10 @@
EWL_FILL_POLICY_HFILL = 0x4000,
EWL_FILL_POLICY_VFILL = 0x8000,
EWL_FILL_POLICY_FILL = EWL_FILL_POLICY_HFILL | EWL_FILL_POLICY_VFILL,
- EWL_FILL_POLICY_NORMAL = EWL_FILL_POLICY_FILL | EWL_FILL_POLICY_SHRINK
+ EWL_FILL_POLICY_ALL = EWL_FILL_POLICY_FILL | EWL_FILL_POLICY_SHRINK
};
+
+#define EWL_FILL_POLICY_NORMAL (EWL_FILL_POLICY_FILL)
/*
* Flags identifying whether a widget is shown, has been realized, or is
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- ewl_fx.c 26 Mar 2003 05:22:02 -0000 1.29
+++ ewl_fx.c 3 Jun 2003 04:00:41 -0000 1.30
@@ -46,7 +46,7 @@
count = ewl_config_get_int("system", "/fx/paths/count");
if (count) {
- char key[PATH_LEN];
+ char key[PATH_MAX];
char *path;
int i;
@@ -54,7 +54,7 @@
* Loop through and add each path to the modules.
*/
for (i = 0; i < count; i++) {
- snprintf(key, PATH_LEN, "/fx/paths/%i", i);
+ snprintf(key, PATH_MAX, "/fx/paths/%i", i);
path = ewl_config_get_str("system", key);
@@ -90,8 +90,8 @@
*/
void ewl_fx_init_widget(Ewl_Widget * w)
{
- char wname[PATH_LEN];
- char key[PATH_LEN];
+ char wname[PATH_MAX];
+ char key[PATH_MAX];
int count, i;
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -134,7 +134,7 @@
/*
* Now determine how many fx to apply to this widget.
*/
- snprintf(key, PATH_LEN, "/user/%s/count", wname);
+ snprintf(key, PATH_MAX, "/user/%s/count", wname);
count = ewl_config_get_int("fx", key);
/*
@@ -156,14 +156,14 @@
/*
* Determine the name of the fx module to load.
*/
- snprintf(key, PATH_LEN, "/user/%s/%i/name", wname, i);
+ snprintf(key, PATH_MAX, "/user/%s/%i/name", wname, i);
name = ewl_config_get_str("fx", key);
/*
* Now determine the number of callbacks for that specific
* effect.
*/
- snprintf(key, PATH_LEN, "/user/%s/%i/callbacks/count", wname,
+ snprintf(key, PATH_MAX, "/user/%s/%i/callbacks/count", wname,
i);
cb_count = ewl_config_get_int("fx", key);
@@ -175,7 +175,7 @@
/*
* Determine the starting event.
*/
- snprintf(key, PATH_LEN,
+ snprintf(key, PATH_MAX,
"/user/%s/%i/callbacks/%i/cb_start", wname, i,
j);
start = ewl_config_get_int("fx", key);
@@ -183,7 +183,7 @@
/*
* Determine the ending event.
*/
- snprintf(key, PATH_LEN,
+ snprintf(key, PATH_MAX,
"/user/%s/%i/callbacks/%i/cb_stop", wname, i,
j);
end = ewl_config_get_int("fx", key);
@@ -644,13 +644,13 @@
void ewl_fx_timer_del(Ewl_Widget * w, char *name)
{
Ewl_FX_Timer *timer;
- char name2[PATH_LEN];
+ char name2[PATH_MAX];
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
DCHECK_PARAM_PTR("name", name);
- snprintf(name2, PATH_LEN, "%s%p", name, w);
+ snprintf(name2, PATH_MAX, "%s%p", name, w);
D(DLEVEL_STABLE, "attempting to remove fx");
@@ -1089,8 +1089,8 @@
__ewl_fx_widget_appearance_changed(Ewl_Widget * w, void *ev_data,
void *user_data)
{
- char wname[PATH_LEN];
- char key[PATH_LEN];
+ char wname[PATH_MAX];
+ char key[PATH_MAX];
int count, i;
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -1111,7 +1111,7 @@
* Determine the number of fx that need to be setup for the widgets.
*/
sscanf(w->appearance, "/%[^/]/", wname);
- snprintf(key, PATH_LEN, "/user/%s/count", wname);
+ snprintf(key, PATH_MAX, "/user/%s/count", wname);
count = ewl_config_get_int("fx", key);
/*
@@ -1133,13 +1133,13 @@
/*
* Determine the name of the current effect being loaded.
*/
- snprintf(key, PATH_LEN, "/user/%s/%i/name", wname, i);
+ snprintf(key, PATH_MAX, "/user/%s/%i/name", wname, i);
name = ewl_config_get_str("fx", key);
/*
* Determine the number of callbacks for this effect.
*/
- snprintf(key, PATH_LEN, "/user/%s/%i/callbacks/count", wname,
+ snprintf(key, PATH_MAX, "/user/%s/%i/callbacks/count", wname,
i);
cb_count = ewl_config_get_int("fx", key);
@@ -1151,7 +1151,7 @@
/*
* Determine the event that starts this effect.
*/
- snprintf(key, PATH_LEN,
+ snprintf(key, PATH_MAX,
"/user/%s/%i/callbacks/%i/cb_start", wname, i,
j);
start = ewl_config_get_int("fx", key);
@@ -1159,7 +1159,7 @@
/*
* Determine the event that stops this effect.
*/
- snprintf(key, PATH_LEN,
+ snprintf(key, PATH_MAX,
"/user/%s/%i/callbacks/%i/cb_stop", wname, i,
j);
end = ewl_config_get_int("fx", key);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_grid.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_grid.c 22 Feb 2003 17:23:28 -0000 1.8
+++ ewl_grid.c 3 Jun 2003 04:00:42 -0000 1.9
@@ -531,7 +531,7 @@
* Calculate the amount of space the widget would need in this
* column.
*/
- temp = ewl_object_get_preferred_w(EWL_OBJECT(c)) /
+ temp = ewl_object_get_minimum_w(EWL_OBJECT(c)) /
(cdata->end_col - cdata->start_col + 1);
/*
@@ -563,7 +563,7 @@
* Calculate the amount of space the widget would need in this
* row.
*/
- temp = ewl_object_get_preferred_h(EWL_OBJECT(c)) /
+ temp = ewl_object_get_minimum_h(EWL_OBJECT(c)) /
(cdata->end_row - cdata->start_row + 1);
/*
@@ -610,12 +610,12 @@
info = g->col_size;
start_off = cdata->start_col;
end_off = cdata->end_col;
- widget_size = ewl_object_get_preferred_w;
+ widget_size = ewl_object_get_minimum_w;
} else {
info = g->row_size;
start_off = cdata->start_row;
end_off = cdata->end_row;
- widget_size = ewl_object_get_preferred_h;
+ widget_size = ewl_object_get_minimum_h;
}
/*
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- ewl_image.c 30 Apr 2003 15:43:54 -0000 1.23
+++ ewl_image.c 3 Jun 2003 04:00:43 -0000 1.24
@@ -286,9 +286,9 @@
else
ewl_object_set_preferred_h(EWL_OBJECT(i), i->oh);
- if (ewl_object_get_preferred_w(EWL_OBJECT(i)))
- ewl_image_scale_to(i, ewl_object_get_preferred_w(EWL_OBJECT(i)),
- ewl_object_get_preferred_h(EWL_OBJECT(i)));
+ if (ewl_object_get_minimum_w(EWL_OBJECT(i)))
+ ewl_image_scale_to(i, ewl_object_get_minimum_w(EWL_OBJECT(i)),
+ ewl_object_get_minimum_h(EWL_OBJECT(i)));
else
ewl_image_scale(i, i->sw, i->sh);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_imenu.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_imenu.c 14 Apr 2003 22:08:05 -0000 1.6
+++ ewl_imenu.c 3 Jun 2003 04:00:45 -0000 1.7
@@ -1,20 +1,7 @@
#include <Ewl.h>
-void __expand_imenu(Ewl_Widget * w, void *ev_data, void *user_data);
-
-void __item_clicked(Ewl_Widget * w, void *ev_data, void *user_data);
-
-void __ewl_imenu_realize(Ewl_Widget * w, void *ev_data,
- void *user_data);
-
-
-void __expand_imenu_animator(int val, void *ev_data);
-void __collapse_imenu_animator(int val, void *ev_data);
-void __expand_imenu_and_title_animator(int val, void *ev_data);
-void __collapse_imenu_and_title_animator(int val, void *ev_data);
-
-void __ewl_imenu_start(Ewl_Widget * w);
+void __ewl_imenu_expand(Ewl_Widget * w, void *ev_data, void *user_data);
/**
* ewl_imenu_new - create a new internal menu
@@ -60,13 +47,9 @@
* Initialize the defaults of the inherited fields.
*/
ewl_menu_base_init(EWL_MENU_BASE(menu), image, title);
- ewl_widget_set_appearance(EWL_WIDGET(menu), "imenu");
- /*
- * The realize needs to create the pop-up.
- */
ewl_callback_prepend(EWL_WIDGET(menu), EWL_CALLBACK_SELECT,
- __expand_imenu, NULL);
+ __ewl_imenu_expand, NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -92,7 +75,7 @@
/*
* ewl_callback_append(menu->corner_button, EWL_CALLBACK_MOUSE_UP,
- * __expand_imenu, menu);
+ * __ewl_imenu_expand, menu);
* ewl_container_append_child(EWL_CONTAINER(menu->corner),
* menu->corner_button);
*
@@ -102,7 +85,7 @@
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-void __expand_imenu(Ewl_Widget * w, void *ev_data, void *user_data)
+void __ewl_imenu_expand(Ewl_Widget * w, void *ev_data, void *user_data)
{
Ewl_IMenu *menu;
Ewl_Window *win;
@@ -117,6 +100,7 @@
* called.
*/
menu->popup = ewl_floater_new(EWL_WIDGET(menu));
+ ewl_widget_set_appearance(EWL_WIDGET(menu->popup), "imenu");
ewl_box_set_orientation(EWL_BOX(menu->popup), EWL_ORIENTATION_VERTICAL);
ewl_object_set_fill_policy(EWL_OBJECT(menu->popup),
EWL_FILL_POLICY_NONE);
@@ -139,17 +123,7 @@
CURRENT_W(menu));
}
- DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
-
-void __ewl_imenu_realize(Ewl_Widget * w, void *ev_data, void *user_data)
-{
- Ewl_IMenu *menu;
-
- menu = EWL_IMENU(w);
+ ewl_callback_del(w, EWL_CALLBACK_SELECT, __ewl_imenu_expand);
- ewl_container_append_child(EWL_CONTAINER
- (ewl_window_find_window_by_widget(w)),
- menu->popup);
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_menu_base.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_menu_base.c 29 Apr 2003 18:33:17 -0000 1.7
+++ ewl_menu_base.c 3 Jun 2003 04:00:46 -0000 1.8
@@ -1,12 +1,10 @@
#include <Ewl.h>
-void __expand_menu_base(Ewl_Widget *w, void *ev_data,
- void *user_data);
-void __collapse_menu_base(Ewl_Widget * w, void *ev_data,
+void __ewl_menu_base_expand(Ewl_Widget *w, void *ev_data,
void *user_data);
+void __ewl_menu_base_collapse(Ewl_Widget * w, void *ev_data,
+ void *user_data);
void __ewl_menu_add(Ewl_Container * parent, Ewl_Widget * child);
-void __ewl_menu_item_show(Ewl_Widget * w, void *ev_data,
- void *user_data);
void __item_clicked(Ewl_Widget * w, void *ev_data, void *user_data);
/**
@@ -30,10 +28,10 @@
ewl_object_set_fill_policy(EWL_OBJECT(menu), EWL_FILL_POLICY_NONE);
ewl_callback_append(EWL_WIDGET(menu), EWL_CALLBACK_SELECT,
- __expand_menu_base, NULL);
+ __ewl_menu_base_expand, NULL);
ewl_callback_append(EWL_WIDGET(menu), EWL_CALLBACK_DESELECT,
- __collapse_menu_base, NULL);
+ __ewl_menu_base_collapse, NULL);
/*
* The popbox actually holds the children, and is simply added to the
@@ -42,6 +40,7 @@
menu->popbox = ewl_vbox_new();
ewl_object_set_alignment(EWL_OBJECT(menu->popbox),
EWL_ALIGNMENT_LEFT | EWL_ALIGNMENT_TOP);
+ ewl_widget_show(menu->popbox);
/*
* The add notifier makes sure newly added children go in the popup
@@ -124,6 +123,8 @@
if (image) {
item->icon = ewl_image_new(image);
ewl_object_set_maximum_size(EWL_OBJECT(item->icon), 20, 20);
+ ewl_object_set_alignment(EWL_OBJECT(item->icon),
+ EWL_ALIGNMENT_CENTER);
ewl_container_append_child(EWL_CONTAINER(item), item->icon);
ewl_widget_show(item->icon);
}
@@ -134,16 +135,11 @@
if (text) {
item->text = ewl_text_new(text);
ewl_container_append_child(EWL_CONTAINER(item), item->text);
+ ewl_object_set_alignment(EWL_OBJECT(item->text),
+ EWL_ALIGNMENT_LEFT);
ewl_widget_show(item->text);
}
- /*
- * Attach the callback for collapsing the menu when the item is
- * clicked.
- */
- ewl_callback_append(EWL_WIDGET(item), EWL_CALLBACK_SHOW,
- __ewl_menu_item_show, NULL);
-
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -163,22 +159,7 @@
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-void __ewl_menu_item_show(Ewl_Widget * w, void *ev_data, void *user_data)
-{
- Ewl_Menu_Item *item;
-
- DENTER_FUNCTION(DLEVEL_STABLE);
-
- item = EWL_MENU_ITEM(w);
-
- if (item->icon)
- ewl_widget_show(item->icon);
- ewl_widget_show(item->text);
-
- DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
-void __expand_menu_base(Ewl_Widget *w, void *ev_data, void *user_data)
+void __ewl_menu_base_expand(Ewl_Widget *w, void *ev_data, void *user_data)
{
Ewl_Menu_Base *menu = EWL_MENU_BASE(w);
@@ -187,24 +168,21 @@
if (!menu->popup)
DRETURN(DLEVEL_STABLE);
- ewl_widget_show(menu->popup);
- ewl_widget_realize(menu->popup);
-
ewl_container_append_child(EWL_CONTAINER(menu->popup), menu->popbox);
- ewl_widget_show(menu->popbox);
- ewl_widget_configure(menu->popup);
+ ewl_widget_show(menu->popup);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-void __collapse_menu_base(Ewl_Widget * w, void *ev_data, void *user_data)
+void __ewl_menu_base_collapse(Ewl_Widget * w, void *ev_data, void *user_data)
{
- Ewl_IMenu *menu;
+ Ewl_Menu_Base *menu;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ menu = EWL_MENU_BASE(w);
- menu = EWL_IMENU(w);
+ ewl_widget_hide(menu->popup);
- ewl_widget_hide(menu->popbox);
- ewl_container_remove_child(EWL_CONTAINER(menu->popup), menu->popbox);
- ewl_widget_destroy(menu->popup);
- menu->popup = NULL;
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_menu_base.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_menu_base.h 25 May 2002 05:46:41 -0000 1.1
+++ ewl_menu_base.h 3 Jun 2003 04:00:46 -0000 1.2
@@ -5,7 +5,8 @@
#define EWL_MENU_ITEM(mi) ((Ewl_Menu_Item *)mi)
-struct _ewl_menu_item {
+struct _ewl_menu_item
+{
/*
* The grid allows for easy layout of the icon and text.
*/
@@ -32,7 +33,8 @@
#define EWL_MENU_BASE(menu) ((Ewl_Menu_Base *) menu)
-struct _ewl_menu_base {
+struct _ewl_menu_base
+{
/*
* Inherit the item so that we can place menus inside other menus
*/
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ewl_notebook.c 26 May 2003 16:39:38 -0000 1.26
+++ ewl_notebook.c 3 Jun 2003 04:00:46 -0000 1.27
@@ -406,7 +406,7 @@
void ewl_notebook_set_tabs_position(Ewl_Notebook * n, Ewl_Position p)
{
Ewl_Widget *w;
- char file[PATH_LEN];
+ char file[PATH_MAX];
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("n", n);
@@ -420,21 +420,21 @@
switch (n->flags) {
case EWL_POSITION_LEFT:
- snprintf(file, PATH_LEN, "lnotebook");
+ snprintf(file, PATH_MAX, "lnotebook");
ewl_box_set_orientation(EWL_BOX(n->tab_box),
EWL_ORIENTATION_VERTICAL);
ewl_object_set_fill_policy(EWL_OBJECT(n->tab_box),
EWL_FILL_POLICY_VFILL);
break;
case EWL_POSITION_RIGHT:
- snprintf(file, PATH_LEN, "rnotebook");
+ snprintf(file, PATH_MAX, "rnotebook");
ewl_box_set_orientation(EWL_BOX(n->tab_box),
EWL_ORIENTATION_VERTICAL);
ewl_object_set_fill_policy(EWL_OBJECT(n->tab_box),
EWL_FILL_POLICY_VFILL);
break;
case EWL_POSITION_BOTTOM:
- snprintf(file, PATH_LEN, "bnotebook");
+ snprintf(file, PATH_MAX, "bnotebook");
ewl_box_set_orientation(EWL_BOX(n->tab_box),
EWL_ORIENTATION_HORIZONTAL);
ewl_object_set_fill_policy(EWL_OBJECT(n->tab_box),
@@ -442,7 +442,7 @@
break;
case EWL_POSITION_TOP:
default:
- snprintf(file, PATH_LEN, "tnotebook");
+ snprintf(file, PATH_MAX, "tnotebook");
ewl_box_set_orientation(EWL_BOX(n->tab_box),
EWL_ORIENTATION_HORIZONTAL);
ewl_object_set_fill_policy(EWL_OBJECT(n->tab_box),
@@ -608,7 +608,7 @@
if (VISIBLE(n->tab_box))
ewl_object_set_preferred_w(EWL_OBJECT(c),
PREFERRED_W(c) +
- ewl_object_get_preferred_w(
+ ewl_object_get_minimum_w(
EWL_OBJECT(n->tab_box)));
}
else {
@@ -622,7 +622,7 @@
if (VISIBLE(n->tab_box))
ewl_object_set_preferred_h(EWL_OBJECT(c),
PREFERRED_H(c) +
- ewl_object_get_preferred_h(
+ ewl_object_get_minimum_h(
EWL_OBJECT(n->tab_box)));
}
@@ -653,7 +653,7 @@
if (VISIBLE(n->tab_box))
ewl_object_set_preferred_w(EWL_OBJECT(c),
PREFERRED_W(c) +
- ewl_object_get_preferred_w(
+ ewl_object_get_minimum_w(
EWL_OBJECT(n->tab_box)));
}
else {
@@ -667,7 +667,7 @@
if (VISIBLE(n->tab_box))
ewl_object_set_preferred_h(EWL_OBJECT(c),
PREFERRED_H(c) +
- ewl_object_get_preferred_h(
+ ewl_object_get_minimum_h(
EWL_OBJECT(n->tab_box)));
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_object.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_object.c 30 Apr 2003 15:43:55 -0000 1.35
+++ ewl_object.c 3 Jun 2003 04:00:47 -0000 1.36
@@ -590,10 +590,17 @@
*/
inline unsigned int ewl_object_get_minimum_w(Ewl_Object * o)
{
+ int val;
+
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
- DRETURN_INT(MINIMUM_W(o) + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o),
+ if (o->flags & EWL_FILL_POLICY_HSHRINK)
+ val = MINIMUM_W(o);
+ else
+ val = PREFERRED_W(o);
+
+ DRETURN_INT(val + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o),
DLEVEL_STABLE);
}
@@ -605,10 +612,17 @@
*/
inline unsigned int ewl_object_get_minimum_h(Ewl_Object * o)
{
+ int val;
+
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
- DRETURN_INT(MINIMUM_H(o) + PADDING_VERTICAL(o) + INSET_VERTICAL(o),
+ if (o->flags & EWL_FILL_POLICY_VSHRINK)
+ val = MINIMUM_H(o);
+ else
+ val = PREFERRED_H(o);
+
+ DRETURN_INT(val + PADDING_VERTICAL(o) + INSET_VERTICAL(o),
DLEVEL_STABLE);
}
@@ -726,12 +740,18 @@
*/
inline unsigned int ewl_object_get_maximum_w(Ewl_Object * o)
{
+ int val;
+
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
- DRETURN_INT(MAXIMUM_W(o) + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o),
+ if (o->flags & EWL_FILL_POLICY_HFILL)
+ val = MAXIMUM_W(o);
+ else
+ val = PREFERRED_W(o);
+
+ DRETURN_INT(val + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o),
DLEVEL_STABLE);
-
}
@@ -743,10 +763,17 @@
*/
inline unsigned int ewl_object_get_maximum_h(Ewl_Object * o)
{
+ int val;
+
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
- DRETURN_INT(MAXIMUM_H(o) + PADDING_VERTICAL(o) + INSET_VERTICAL(o),
+ if (o->flags & EWL_FILL_POLICY_VFILL)
+ val = MAXIMUM_H(o);
+ else
+ val = PREFERRED_H(o);
+
+ DRETURN_INT(val + PADDING_VERTICAL(o) + INSET_VERTICAL(o),
DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_row.c 2 Apr 2003 20:36:19 -0000 1.9
+++ ewl_row.c 3 Jun 2003 04:00:47 -0000 1.10
@@ -170,14 +170,14 @@
/*
* Adjust the preferred height to the largest widget added.
*/
- size = ewl_object_get_preferred_h(EWL_OBJECT(w));
- if (!row->max || ewl_object_get_preferred_h(row->max) > size) {
+ size = ewl_object_get_minimum_w(EWL_OBJECT(w));
+ if (!row->max || ewl_object_get_minimum_h(row->max) > size) {
row->max = EWL_OBJECT(w);
ewl_object_set_preferred_h(EWL_OBJECT(c), size);
}
ewl_object_set_preferred_w(EWL_OBJECT(c), PREFERRED_W(c) +
- ewl_object_get_preferred_w(EWL_OBJECT(w)));
+ ewl_object_get_minimum_w(EWL_OBJECT(w)));
}
static void
@@ -200,7 +200,7 @@
*/
ewd_list_goto_first(c->children);
while ((child = ewd_list_next(c->children))) {
- h = ewl_object_get_preferred_h(child);
+ h = ewl_object_get_minimum_h(child);
if (h > max_h) {
max_h = h;
row->max = child;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollpane.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ewl_scrollpane.c 22 May 2003 03:57:53 -0000 1.11
+++ ewl_scrollpane.c 3 Jun 2003 04:00:48 -0000 1.12
@@ -202,8 +202,8 @@
/*
* Get the space needed by the scrolbars.
*/
- vs_width = ewl_object_get_preferred_w(EWL_OBJECT(s->vscrollbar));
- hs_height = ewl_object_get_preferred_h(EWL_OBJECT(s->hscrollbar));
+ vs_width = ewl_object_get_minimum_w(EWL_OBJECT(s->vscrollbar));
+ hs_height = ewl_object_get_minimum_h(EWL_OBJECT(s->hscrollbar));
/*
* Determine the space used by the contents.
@@ -229,8 +229,8 @@
* Update the fill percentage on the scrollbars based on available space
* for the content.
*/
- b_width = ewl_object_get_preferred_w(EWL_OBJECT(s->box));
- b_height = ewl_object_get_preferred_h(EWL_OBJECT(s->box));
+ b_width = ewl_object_get_minimum_w(EWL_OBJECT(s->box));
+ b_height = ewl_object_get_minimum_h(EWL_OBJECT(s->box));
ewl_scrollbar_set_fill_percentage(EWL_SCROLLBAR(s->hscrollbar),
(double) content_w /
(double) b_width);
@@ -292,8 +292,8 @@
* Give the child it's preferred size.
*/
ewl_object_request_size(EWL_OBJECT(child),
- ewl_object_get_preferred_w(child),
- ewl_object_get_preferred_h(child));
+ ewl_object_get_minimum_w(child),
+ ewl_object_get_minimum_h(child));
/*
* Get the usable space of the container.
@@ -404,12 +404,12 @@
*/
if (o == EWL_ORIENTATION_HORIZONTAL)
ewl_object_set_preferred_w(EWL_OBJECT(parent),
- ewl_object_get_preferred_w(EWL_OBJECT(s->box))
- +
ewl_object_get_preferred_w(EWL_OBJECT(s->vscrollbar)));
+ ewl_object_get_minimum_w(EWL_OBJECT(s->box)) +
+ ewl_object_get_minimum_w(EWL_OBJECT(s->vscrollbar)));
else
ewl_object_set_preferred_h(EWL_OBJECT(parent),
- ewl_object_get_preferred_h(EWL_OBJECT(s->box))
- +
ewl_object_get_preferred_h(EWL_OBJECT(s->hscrollbar)));
+ ewl_object_get_minimum_h(EWL_OBJECT(s->box)) +
+ ewl_object_get_minimum_h(EWL_OBJECT(s->hscrollbar)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -432,8 +432,8 @@
ewd_list_remove_last(p->children);
ewl_object_set_preferred_size(EWL_OBJECT(p),
- ewl_object_get_preferred_w(EWL_OBJECT(child)),
- ewl_object_get_preferred_h(EWL_OBJECT(child)));
+ ewl_object_get_minimum_w(EWL_OBJECT(child)),
+ ewl_object_get_minimum_h(EWL_OBJECT(child)));
}
void
@@ -444,7 +444,7 @@
* Set the new preferred dimensions of the box.
*/
ewl_object_set_preferred_w(EWL_OBJECT(p),
- ewl_object_get_preferred_w(EWL_OBJECT(w)));
+ ewl_object_get_minimum_w(EWL_OBJECT(w)));
ewl_object_set_preferred_h(EWL_OBJECT(p),
- ewl_object_get_preferred_h(EWL_OBJECT(w)));
+ ewl_object_get_minimum_h(EWL_OBJECT(w)));
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_seeker.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_seeker.c 29 Apr 2003 18:33:17 -0000 1.35
+++ ewl_seeker.c 3 Jun 2003 04:00:48 -0000 1.36
@@ -628,14 +628,14 @@
__ewl_seeker_appearance_changed(Ewl_Widget * w, void *ev_data, void *user_data)
{
Ewl_Seeker *s;
- char appearance[PATH_LEN];
+ char appearance[PATH_MAX];
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
s = EWL_SEEKER(w);
- snprintf(appearance, PATH_LEN, "%s/dragbar", w->appearance);
+ snprintf(appearance, PATH_MAX, "%s/dragbar", w->appearance);
ewl_widget_set_appearance(s->dragbar, appearance);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbar.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_selectionbar.c 19 Feb 2003 02:18:06 -0000 1.7
+++ ewl_selectionbar.c 3 Jun 2003 04:00:49 -0000 1.8
@@ -486,9 +486,9 @@
if (CURRENT_W(EWL_OBJECT(child)) < 2 ||
CURRENT_H(EWL_OBJECT(child)) < 2) {
ewl_object_request_size(EWL_OBJECT(child),
- ewl_object_get_preferred_w
+ ewl_object_get_minimum_w
(EWL_OBJECT(child)),
- ewl_object_get_preferred_h
+ ewl_object_get_minimum_h
(EWL_OBJECT(child)));
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- ewl_spinner.c 29 Apr 2003 18:33:20 -0000 1.36
+++ ewl_spinner.c 3 Jun 2003 04:00:50 -0000 1.37
@@ -75,8 +75,7 @@
ewl_container_init(EWL_CONTAINER(w), "spinner",
__ewl_spinner_child_add, __ewl_spinner_child_resize,
NULL);
- ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_HFILL |
- EWL_FILL_POLICY_HSHRINK);
+ ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_HFILL);
ewl_callback_append(w, EWL_CALLBACK_REALIZE, __ewl_spinner_realize,
NULL);
@@ -225,25 +224,24 @@
if (w == s->entry) {
ewl_object_set_preferred_w(EWL_OBJECT(c), PREFERRED_W(c) +
- ewl_object_get_preferred_w(EWL_OBJECT(w)));
+ ewl_object_get_minimum_w(EWL_OBJECT(w)));
}
else if (s->button_increase && s->button_decrease) {
ewl_object_set_preferred_w(EWL_OBJECT(c), PREFERRED_W(c) +
- MAX(ewl_object_get_preferred_w(EWL_OBJECT(
+ MAX(ewl_object_get_minimum_w(EWL_OBJECT(
s->button_increase)),
- ewl_object_get_preferred_w(EWL_OBJECT(
+ ewl_object_get_minimum_w(EWL_OBJECT(
s->button_decrease))));
}
if (s->entry && s->button_increase && s->button_decrease) {
int size;
- size = ewl_object_get_preferred_h(EWL_OBJECT(
- s->button_increase)) +
- ewl_object_get_preferred_h(EWL_OBJECT(
+ size = ewl_object_get_minimum_h(EWL_OBJECT(s->button_increase))
+ + ewl_object_get_minimum_h(EWL_OBJECT(
s->button_decrease));
- ewl_object_set_preferred_h(EWL_OBJECT(c),
- MAX(ewl_object_get_preferred_h(EWL_OBJECT(s->entry)),
+ ewl_object_set_minimum_h(EWL_OBJECT(c),
+ MAX(ewl_object_get_minimum_h(EWL_OBJECT(s->entry)),
size));
}
@@ -264,19 +262,19 @@
PREFERRED_W(c) + size);
else if (s->button_increase && s->button_decrease) {
ewl_object_set_preferred_w(EWL_OBJECT(c),
- MAX(ewl_object_get_preferred_w(EWL_OBJECT(
+ MAX(ewl_object_get_minimum_w(EWL_OBJECT(
s->button_increase)),
- ewl_object_get_preferred_w(EWL_OBJECT(
+ ewl_object_get_minimum_w(EWL_OBJECT(
s->button_decrease))));
}
}
else if (s->entry && s->button_increase && s->button_decrease) {
- size = ewl_object_get_preferred_h(EWL_OBJECT(
+ size = ewl_object_get_minimum_h(EWL_OBJECT(
s->button_increase)) +
- ewl_object_get_preferred_h(EWL_OBJECT(
+ ewl_object_get_minimum_h(EWL_OBJECT(
s->button_decrease));
ewl_object_set_preferred_h(EWL_OBJECT(c),
- MAX(ewl_object_get_preferred_h(EWL_OBJECT(s->entry)),
+ MAX(ewl_object_get_minimum_h(EWL_OBJECT(s->entry)),
size));
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_theme.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- ewl_theme.c 29 Apr 2003 20:07:53 -0000 1.42
+++ ewl_theme.c 3 Jun 2003 04:00:50 -0000 1.43
@@ -4,7 +4,7 @@
#include "ewl-config.h"
#endif
-static char theme_path[PATH_LEN];
+static char theme_path[PATH_MAX];
static E_DB_File *theme_db = NULL;
@@ -21,7 +21,7 @@
{
struct stat st;
char *theme_name;
- char theme_db_path[PATH_LEN];
+ char theme_db_path[PATH_MAX];
char *home;
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -47,10 +47,10 @@
exit(-1);
}
- snprintf(theme_path, PATH_LEN, "%s/.e/ewl/themes/%s", home, theme_name);
+ snprintf(theme_path, PATH_MAX, "%s/.e/ewl/themes/%s", home, theme_name);
if (((stat(theme_path, &st)) == 0) || S_ISDIR(st.st_mode)) {
- snprintf(theme_db_path, PATH_LEN, "%s/theme.db", theme_path);
+ snprintf(theme_db_path, PATH_MAX, "%s/theme.db", theme_path);
theme_db = e_db_open_read(theme_db_path);
}
@@ -60,12 +60,12 @@
/*
* Theme dir is ok, now get the specified theme's path
*/
- snprintf(theme_path, PATH_LEN, PACKAGE_DATA_DIR
+ snprintf(theme_path, PATH_MAX, PACKAGE_DATA_DIR
"/themes/%s", theme_name);
stat(theme_path, &st);
if (S_ISDIR(st.st_mode)) {
- snprintf(theme_db_path, PATH_LEN, "%s/theme.db",
+ snprintf(theme_db_path, PATH_MAX, "%s/theme.db",
theme_path);
theme_db = e_db_open_read(theme_db_path);
@@ -92,21 +92,21 @@
void ewl_theme_init_font_path()
{
char *font_path;
- char key[PATH_LEN];
+ char key[PATH_MAX];
/*
* Setup the default font paths
*/
font_paths = ewd_list_new();
if (font_paths) {
- snprintf(key, PATH_LEN, "/theme/font_path");
+ snprintf(key, PATH_MAX, "/theme/font_path");
font_path = ewl_theme_data_get_str(NULL, key);
if (font_path) {
if (*font_path == '/')
ewd_list_append(font_paths, font_path);
else {
- snprintf(key, PATH_LEN, "%s/%s", theme_path,
+ snprintf(key, PATH_MAX, "%s/%s", theme_path,
font_path);
ewd_list_append(font_paths, key);
}
@@ -222,9 +222,9 @@
DRETURN_PTR(NULL, DLEVEL_STABLE);
if (*data != '/') {
- path = NEW(char, PATH_LEN);
+ path = NEW(char, PATH_MAX);
- snprintf(path, PATH_LEN, "%s/%s", theme_path, data);
+ snprintf(path, PATH_MAX, "%s/%s", theme_path, data);
FREE(data);
} else /* Absolute path given, so return it */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ewl_tree.c 26 May 2003 16:39:38 -0000 1.12
+++ ewl_tree.c 3 Jun 2003 04:00:51 -0000 1.13
@@ -19,6 +19,10 @@
static void __ewl_tree_node_resize(Ewl_Container *c, Ewl_Widget *w, int size,
Ewl_Orientation o);
+
+static void __ewl_tree_row_select(Ewl_Widget *w, void *ev_data,
+ void *user_data);
+
/**
* ewl_tree_new - allocate and initialize a new tree widget
* @columns: the number of columns to display
@@ -90,6 +94,8 @@
tree->colbounds[i] = &CURRENT_W(button);
}
+ ewl_callback_append(row, EWL_CALLBACK_SELECT, __ewl_tree_row_select,
+ NULL);
ewl_container_append_child(EWL_CONTAINER(tree), row);
ewl_widget_show(row);
@@ -472,12 +478,12 @@
{
int cw;
- cw = ewl_object_get_preferred_w(EWL_OBJECT(w));
+ cw = ewl_object_get_minimum_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)));
+ ewl_object_get_minimum_h(EWL_OBJECT(w)));
}
static void
@@ -485,7 +491,7 @@
Ewl_Orientation o)
{
if (o == EWL_ORIENTATION_HORIZONTAL) {
- if (ewl_object_get_preferred_w(EWL_OBJECT(w)) > PREFERRED_W(c))
+ if (ewl_object_get_minimum_w(EWL_OBJECT(w)) > PREFERRED_W(c))
ewl_object_set_preferred_w(EWL_OBJECT(c),
PREFERRED_W(c) + size);
else
@@ -517,7 +523,7 @@
y = CURRENT_Y(w);
ewd_list_goto_first(c->children);
while ((child = ewd_list_next(c->children))) {
- h = ewl_object_get_preferred_h(child);
+ h = ewl_object_get_minimum_h(child);
ewl_object_request_geometry(child, CURRENT_X(w), y,
CURRENT_W(w), h);
y += h;
@@ -550,7 +556,7 @@
* are lower nodes and rows.
*/
ewl_object_request_geometry(child, CURRENT_X(w), CURRENT_Y(w),
- CURRENT_W(w), ewl_object_get_preferred_h(child));
+ CURRENT_W(w), ewl_object_get_minimum_h(child));
y = CURRENT_Y(w) + ewl_object_get_current_h(child);
width = CURRENT_W(w) - CURRENT_X(w) + CURRENT_X(w);
@@ -560,7 +566,7 @@
*/
while ((child = ewd_list_next(c->children))) {
ewl_object_request_geometry(child, CURRENT_X(w), y, width,
- ewl_object_get_preferred_h(child));
+ ewl_object_get_minimum_h(child));
y += ewl_object_get_current_h(child);
}
@@ -619,12 +625,12 @@
if (node->expanded || w == node->row) {
ewl_object_set_preferred_h(EWL_OBJECT(c),
PREFERRED_H(c) +
- ewl_object_get_preferred_h(EWL_OBJECT(w)));
+ ewl_object_get_minimum_h(EWL_OBJECT(w)));
}
- width = ewl_object_get_preferred_w(EWL_OBJECT(w));
+ width = ewl_object_get_minimum_w(EWL_OBJECT(w));
if (PREFERRED_W(c) < width)
- ewl_object_set_preferred_w(EWL_OBJECT(c), width);
+ ewl_object_set_minimum_w(EWL_OBJECT(c), width);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -642,10 +648,10 @@
if (node->expanded || w == node->row) {
ewl_object_set_preferred_h(EWL_OBJECT(c),
PREFERRED_H(c) -
- ewl_object_get_preferred_h(EWL_OBJECT(w)));
+ ewl_object_get_minimum_h(EWL_OBJECT(w)));
}
- width = ewl_object_get_preferred_w(EWL_OBJECT(w));
+ width = ewl_object_get_minimum_w(EWL_OBJECT(w));
if (PREFERRED_W(c) >= width)
ewl_container_prefer_largest(c, EWL_ORIENTATION_HORIZONTAL);
@@ -670,6 +676,22 @@
ewl_object_set_preferred_h(EWL_OBJECT(c),
PREFERRED_H(c) + size);
}
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+static void
+__ewl_tree_row_select(Ewl_Widget *w, void *ev_data, void *user_data)
+{
+ Ewl_Tree *tree;
+ Ewl_Tree_Node *node;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ node = EWL_TREE_NODE(w->parent);
+ tree = node->tree;
+
+ tree->selected = w;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_tree.h 26 May 2003 16:39:39 -0000 1.9
+++ ewl_tree.h 3 Jun 2003 04:00:51 -0000 1.10
@@ -19,6 +19,8 @@
unsigned int **colbases;
unsigned int **colbounds;
Ewl_Widget *header;
+
+ Ewl_Widget *selected;
};
typedef struct _ewl_tree_node Ewl_Tree_Node;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- ewl_window.c 23 May 2003 22:10:15 -0000 1.46
+++ ewl_window.c 3 Jun 2003 04:00:51 -0000 1.47
@@ -388,7 +388,6 @@
ewl_container_init(EWL_CONTAINER(w), "window",
__ewl_window_child_add, __ewl_window_child_resize,
NULL);
- ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_NONE);
w->title = strdup("EWL!");
@@ -574,6 +573,9 @@
if (!win->window)
DRETURN(DLEVEL_STABLE);
+ /*
+ * Adjust the maximum window bounds to match the widget
+ */
ecore_window_set_min_size(win->window,
ewl_object_get_minimum_w(EWL_OBJECT(w)),
ewl_object_get_minimum_h(EWL_OBJECT(w)));
@@ -581,9 +583,27 @@
ewl_object_get_maximum_w(EWL_OBJECT(w)),
ewl_object_get_maximum_h(EWL_OBJECT(w)));
+ /*
+ * Check the windows current geometry against the widgets values.
+ */
+ ecore_window_get_geometry(win->window, NULL, NULL, &width, &height);
+
+ if (width != ewl_object_get_current_w(EWL_OBJECT(win)))
+ ewl_object_request_w(EWL_OBJECT(win), width);
+
+ if (height != ewl_object_get_current_h(EWL_OBJECT(win)))
+ ewl_object_request_h(EWL_OBJECT(win), height);
+
+ /*
+ * Find out how much space the widget accepted.
+ */
width = ewl_object_get_current_w(EWL_OBJECT(w));
height = ewl_object_get_current_h(EWL_OBJECT(w));
+ /*
+ * Now give the windows the appropriate size and adjust the evas as
+ * well.
+ */
ecore_window_resize(win->window, width, height);
ecore_window_resize(win->evas_window, width, height);
evas_output_size_set(win->evas, width, height);
@@ -653,7 +673,7 @@
ewl_object_request_y(child, CURRENT_Y(win));
cs = ewl_object_get_current_x(child) +
- ewl_object_get_preferred_w(child);
+ ewl_object_get_minimum_w(child);
/*
* Check the width and x position vs. window width.
@@ -662,7 +682,7 @@
maxw = cs;
cs = ewl_object_get_current_y(child) +
- ewl_object_get_preferred_h(child);
+ ewl_object_get_minimum_h(child);
/*
* Check the height and y position vs. window height.
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs