From: <enl...@li...> - 2001-11-14 00:30:47
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_button.c ewl_config.c ewl_config.h ewl_fx.c ewl_fx.h ewl_scrollbar.c ewl_scrollpane.c ewl_spinner.c ewl_spinner.h ewl_widget.c ewl_window.c ewl_window.h Log Message: * Changed the fx API slightly to simplify the job of calculating intervals between frames, and reduce the number of steps for the calculation. * Setup a config option for the user to put a bound on the frames per second for fx. This should be useful for slower machines when running apps with lots of widgets displayed. * Added more documenting comments, but haven't added sections to the manual.raw yet. * Added window geometry functions since the standard object geometries don't work well with windows. * Fixed the spinner test to use the new window geometry functions. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- ewl_button.c 2001/11/09 23:41:48 1.30 +++ ewl_button.c 2001/11/14 00:30:15 1.31 @@ -95,7 +95,6 @@ /** * ewl_button_set_label - change the label of the specified button - * * @b: the buttons whose label will be changed * @l: the new label for the button * =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_config.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- ewl_config.c 2001/11/09 23:41:48 1.17 +++ ewl_config.c 2001/11/14 00:30:15 1.18 @@ -330,6 +330,7 @@ ewl_config_set_str("system", "/fx/paths/0", PACKAGE_DATA_DIR "/plugins/fx"); ewl_config_set_int("system", "/fx/paths/count", 1); + ewl_config_set_int("system", "/fx/fps", 50); ewl_config_set_str("system", "/theme/name", "default"); ewl_config_set_int("system", "/theme/cache", 0); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_config.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_config.h 2001/11/09 23:41:48 1.13 +++ ewl_config.h 2001/11/14 00:30:15 1.14 @@ -22,6 +22,7 @@ struct { Ewd_List *paths; + int fps; } fx; struct =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ewl_fx.c 2001/11/10 20:32:26 1.18 +++ ewl_fx.c 2001/11/14 00:30:15 1.19 @@ -16,6 +16,12 @@ static int fx_group_id = -1; +/** + * ewl_fx_init - initialize any fx variables that must be set up ahead of time + * + * Returns no value. The programmer should not call this, it is used by + * ewl_init, and nothing else. + */ int ewl_fx_init(void) { @@ -49,6 +55,12 @@ DRETURN_INT(TRUE, DLEVEL_STABLE); } +/** + * ewl_fx_init - initialize any fx variables that must be set up ahead of time + * + * Returns no value. The programmer should not call this, it is used by + * ewl_deinit, and nothing else. + */ int ewl_fx_deinit(void) { @@ -59,6 +71,12 @@ DRETURN_INT(TRUE, DLEVEL_STABLE); } +/** + * ewl_fx_init_widget - initialize fx for a specified widget + * @w: the widget to setup fx variables + * + * Returns no value. Internal variables for fx to be used are setup on @w. + */ void ewl_fx_init_widget(Ewl_Widget * w) { @@ -131,6 +149,12 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_fx_deinit_widget - deinitialize fx for a specified widget + * @w: the widget to remove fx variables + * + * Returns no value. Frees fx variables attached to the widget @w. + */ void ewl_fx_deinit_widget(Ewl_Widget * w) { @@ -139,6 +163,18 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_fx_add_proto - add a prototype for executing fx + * @name: the identifier for the fx + * @fx_start: the function called when the fx begin + * @fx_cont: the function called at specified intervals + * @fx_stop: the function called when the fx stop + * @modifies: a bit mask that specifies which properties the fx alter + * + * Returns -1 on error, 0 if a cached version of the proto is found, 1 if a + * newly allocated prototype is used. This should be used if a programmer + * wishes to include their own plugins. + */ int ewl_fx_add_proto(char *name, Ewl_FX_Function fx_start, @@ -169,15 +205,27 @@ DRETURN_INT(1, DLEVEL_STABLE); } +/** + * ewl_fx_del_proto - delete the prototype for the fx with the specified @name + * @name: the name identifier for the fx prototype to remove. + * + * Returns TRUE on success, FALSE on failure. + */ int ewl_fx_del_proto(char *name) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("name", name, -1); + DCHECK_PARAM_PTR_RET("name", name, FALSE); - DRETURN_INT(1, DLEVEL_STABLE); + DRETURN_INT(TRUE, DLEVEL_STABLE); } +/** + * ewl_fx_proto_get - retrieve a prototype for the plugin of the specified @name + * @name: the name identifier for the desired fx prototype + * + * Returns a pointer to the found fx prototype on success, NULL on failure. + */ Ewl_FX_Proto * ewl_fx_proto_get(char *name) { @@ -191,6 +239,16 @@ DRETURN_PTR(fxp, DLEVEL_STABLE); } +/** + * ewl_fx_add - add fx to a specified widget + * @w: the widget to add the fx + * @name: the name of the fx to add + * @cb_start: the callback to indicate the fx have started + * @cb_stop: the callback to indicate the fx have stopped + * + * Returns -1 on error, 0 if the fx have already been started, 1 if the fx are + * newly started. + */ int ewl_fx_add(Ewl_Widget * w, char *name, Ewl_Callback_Type cb_start, Ewl_Callback_Type cb_stop) @@ -250,6 +308,16 @@ DRETURN_INT(1, DLEVEL_STABLE); } +/** + * ewl_fx_del - delete the specified fx from the widget @w + * @w: the widget to delete fx + * @name: the name of the fx to remove from @w + * @cb_start: the callback to indicate the start of the fx + * @cb_stop: the callback to indicate the stop of the fx + * + * Returns -1 on error, 0 if the fx are not running, 1 if the fx are running + * and have been stopped. + */ int ewl_fx_del(Ewl_Widget * w, char *name, Ewl_Callback_Type cb_start, Ewl_Callback_Type cb_stop) @@ -307,6 +375,12 @@ DRETURN_INT(1, DLEVEL_STABLE); } +/** + * ewd_fx_del_all - remove all fx from the specified widget + * @w: the widget to remove fx + * + * Returns no value. Any fx currently running are stopped. + */ void ewl_fx_del_all(Ewl_Widget * w) { @@ -342,14 +416,26 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_fx_timer_add - add a timer for the specified fx on the a widget + * @w: the widget to add the fx timer + * @name: the name of the fx to add the timer + * @interval: the interval between timer notifications + * @step: FIXME what does this do? the only references to it just calculate it + * @count: the number of times to execute the timer + * @data: user specified data to pass to the timer function + * + * Returns no value. Sets up a timer to be executed at regular intervals to + * allow animation of fx. + */ void -ewl_fx_timer_add(Ewl_Widget * w, char *name, double interval, - double step, int count, void *data) +ewl_fx_timer_add(Ewl_Widget * w, char *name, double timeout, int fps, + int value_span, void *data) { Ewl_FX_Timer *timer; Ewl_FX_Pending *pend = NULL; Ewl_FX_Proto *fxp; - int l; + int l, ufps; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -383,12 +469,20 @@ timer = NEW(Ewl_FX_Timer, 1); ZERO(timer, Ewl_FX_Timer, 1); + /* + * Allow the user to override the programmers chosen fps if that value + * is specified and smaller than the programmers fps. + */ + ufps = ewl_config_get_int("system", "/fx/fps"); + if (ufps && ufps < fps) + fps = ufps; + timer->widget = w; timer->func = fxp->fx_cont; - timer->step = step; - timer->interval = interval; + timer->interval = 1 / (float)fps; timer->count = 0; - timer->hits = count; + timer->hits = timeout * fps; + timer->step = (float)value_span / (timer->hits + 0.5); timer->data = data; timer->pend = pend; @@ -407,6 +501,13 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_fx_timer_del - remove a timer of a specified name from a widget + * @w: the widget to remove the timer + * @name: the name of the timer attached to @w that is to be removed + * + * Returns no value. Removes the timer specified by @name from the widget @w. + */ void ewl_fx_timer_del(Ewl_Widget * w, char *name) { @@ -444,29 +545,45 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_fx_calculate_interval - determine the interval between frames + * @fps: the desired frames per second + * + * Returns the interval between frames on success, 0 on failure. + */ double -ewl_fx_calculate_interval(double fps, double timeout) +ewl_fx_calculate_interval(double fps) { double ival = 0; DENTER_FUNCTION(DLEVEL_STABLE); + + /* + * Need to check fps to ensure we don't get a divide by zero error. + */ + DCHECK_PARAM_PTR_RET("fps", fps, 0.0); - ival = timeout / (fps * timeout); + ival = 1 / fps; D(DLEVEL_STABLE, "interval = %f", ival); DRETURN_FLOAT(ival, DLEVEL_STABLE); } +/** + * ewl_fx_calculate_step - determine the step between frames + * @start_val: the beginning value of the step + * @end_val: the ending value of the step + * @fps: the frames per second of the animation + */ double -ewl_fx_calculate_step(double start_val, double end_val, - double fps, double timeout) +ewl_fx_calculate_step(double start_val, double end_val, double fps) { double step = 0; DENTER_FUNCTION(DLEVEL_STABLE); - step = timeout / (fps * timeout); + step = 1 / fps; if (end_val > start_val) step *= (end_val - start_val); @@ -478,6 +595,17 @@ DRETURN_FLOAT(step, DLEVEL_STABLE); } +/** + * ewl_fx_clip_box_get_color - retrieve the current color of the fx clip box + * @w: the widget to check the clip box color + * @r: a pointer to the integer to store the red value + * @g: a pointer to the integer to store the green value + * @b: a pointer to the integer to store the blue value + * @a: a pointer to the integer to store the alpha value + * + * Returns no value. The RGBA values of @w's fx clip box are stored into any + * non-NULL pointers @r, @g, @b, and @a respectively. + */ void ewl_fx_clip_box_get_color(Ewl_Widget * w, int *r, int *g, int *b, int *a) { @@ -501,6 +629,17 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_fx_clip_box_set_color - set the color for a widgets fx clip box + * @w: the widget to set the color + * @r: the red value to be set + * @g: the green value to be set + * @b: the blue value to be set + * @a: the alpha value to be set + * + * Returns no value. Sets the RGBA colors of @w's fx clib box to @r, @g, @b, + * and @a respectively. + */ void ewl_fx_clip_box_set_color(Ewl_Widget * w, int r, int g, int b, int a) { @@ -513,6 +652,12 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_fx_plugin_load - load a plugin of a specified name + * @name: the name of the plugin to load + * + * Returns a pointer to the fx prototype on success, NULL on failure. + */ Ewl_FX_Proto * ewl_fx_plugin_load(char *name) { @@ -549,6 +694,12 @@ DRETURN_PTR(fxp, DLEVEL_STABLE); } +/** + * ewl_fx_get_available - get a list of available plugins + * + * + * Returns a list of available plugins on success, NULL on failure. + */ Ewd_List * ewl_fx_get_available(void) { @@ -561,6 +712,13 @@ DRETURN_PTR(avail, DLEVEL_STABLE); } +/** + * ewl_fx_start - start pending fx on a widget + * @w: the widget to start pending fx + * @pend: the pending effect to start + * + * Returns no value. Starts the pending fx @pend on widget @w. + */ void ewl_fx_start(Ewl_Widget * w, Ewl_FX_Pending * pend) { @@ -626,10 +784,10 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } -/* +/** * ewl_fx_stop - stop a pending effect. * @w: the widget to stop the pending effect on. - * @pend what pending effect to stop. + * @pend: the pending effect to stop. * * Returns no value. Here we stop the pending effect and search through * qued effects and start matching effects and remove them from the que list. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_fx.h 2001/11/09 23:41:48 1.11 +++ ewl_fx.h 2001/11/14 00:30:15 1.12 @@ -70,13 +70,12 @@ Ewl_Callback_Type cb_stop); void ewl_fx_del_all(Ewl_Widget * w); -void ewl_fx_timer_add(Ewl_Widget * w, char *name, double interval, - double step, int count, void *data); +void ewl_fx_timer_add(Ewl_Widget * w, char *name, double timeout, int fps, + int value_span, void *data); void ewl_fx_timer_del(Ewl_Widget * w, char *name); -double ewl_fx_calculate_interval(double fps, double timeout); -double ewl_fx_calculate_step(double start_val, double end_val, - double fps, double timeout); +double ewl_fx_calculate_interval(double fps); +double ewl_fx_calculate_step(double start_val, double end_val, double fps); void ewl_fx_clip_box_get_color(Ewl_Widget * w, int *r, int *g, int *b, int *a); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollbar.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_scrollbar.c 2001/11/12 19:41:00 1.8 +++ ewl_scrollbar.c 2001/11/14 00:30:15 1.9 @@ -16,7 +16,6 @@ /** * ewl_scrollbar_new - allocate and initialize a new scrollbar widget - * * @orientation: the desired orientation of the scrollbar * * Returns NULL on failure, or a pointer to the newly allocated scrollbar @@ -105,6 +104,14 @@ DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE); } +/** + * ewl_scrollbar_set_fill_percentage - set the percentage filled by drag button + * @s: the scrollbar to change fill percentage + * @fp: the percentage of the scrollbar filled by the drag button + * + * Returns no value. Changes the area of the scrollbar that is filled by the + * drag button. + */ void ewl_scrollbar_set_fill_percentage(Ewl_Scrollbar * s, double fp) { @@ -128,6 +135,13 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_scrollbar_get_fill_percentage - get the percentage filled by drag button + * @s: the scrollbar to retrieve fill percentage + * + * Returns the percentage of the scrollbar that the drag button fills on + * success, -1 on failure. + */ double ewl_scrollbar_get_fill_percentage(Ewl_Scrollbar * s) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollpane.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_scrollpane.c 2001/11/12 19:41:00 1.2 +++ ewl_scrollpane.c 2001/11/14 00:30:15 1.3 @@ -17,6 +17,12 @@ void *user_data); +/** + * ewl_scrollpane_new - create a new scrollpane + * + * Returns a pointer to a newly allocated scrollpane on success, NULL on + * failure. + */ Ewl_Widget * ewl_scrollpane_new(void) { @@ -33,6 +39,14 @@ DRETURN_PTR(EWL_WIDGET(s), DLEVEL_UNSTABLE); } +/** + * ewl_scrollpane_set_hscrollbar_flag - set flags for horizontal scrollbar + * @s: the scrollpane that contains the scrollbar to change + * @f: the flags to set on the horizontal scrollbar in @s + * + * Returns no value. The scrollbar flags for the horizontal scrollbar are set + * to @f. + */ void ewl_scrollpane_set_hscrollbar_flag(Ewl_ScrollPane * s, Ewl_ScrollBar_Flags f) { @@ -44,6 +58,14 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_scrollpane_set_vscrollbar_flag - set flags for vertical scrollbar + * @s: the scrollpane that contains the scrollbar to change + * @f: the flags to set on the vertical scrollbar in @s + * + * Returns no value. The scrollbar flags for the vertical scrollbar are set + * to @f. + */ void ewl_scrollpane_set_vscrollbar_flag(Ewl_ScrollPane * s, Ewl_ScrollBar_Flags f) { @@ -55,6 +77,12 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_scrollpane_get_hscrollbar_flag - get flags for horizontal scrollbar + * @s: the scrollpane that contains the scrollbar to retrieve + * + * Returns the flags of the horizontal scrollbar on success, NULL on failure. + */ Ewl_ScrollBar_Flags ewl_scrollpane_get_hscrollbar_flag(Ewl_ScrollPane * s) { @@ -68,6 +96,12 @@ DRETURN_INT(f, DLEVEL_STABLE); } +/** + * ewl_scrollpane_get_vscrollbar_flag - get flags for vertical scrollbar + * @s: the scrollpane that contains the scrollbar to retrieve + * + * Returns the flags of the vertical scrollbar on success, NULL on failure. + */ Ewl_ScrollBar_Flags ewl_scrollpane_get_vscrollbar_flag(Ewl_ScrollPane * s) { @@ -81,7 +115,13 @@ DRETURN_INT(f, DLEVEL_STABLE); } - +/** + * ewl_scrollpane_init - initialize the fields of a scrollpane + * @s: the scrollpane to initialize + * + * Returns no value. Sets up default callbacks and field values for the + * scrollpane @s. + */ void ewl_scrollpane_init(Ewl_ScrollPane * s) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- ewl_spinner.c 2001/11/09 23:41:48 1.26 +++ ewl_spinner.c 2001/11/14 00:30:15 1.27 @@ -1,7 +1,6 @@ #include <Ewl.h> -static void __ewl_spinner_init(Ewl_Spinner * spinner); static void __ewl_spinner_realize(Ewl_Widget * widget, void *ev_data, void *user_data); static void __ewl_spinner_configure(Ewl_Widget * widget, void *ev_data, @@ -46,7 +45,7 @@ s->button_increase = ewl_button_new(NULL); s->button_decrease = ewl_button_new(NULL); - __ewl_spinner_init(s); + ewl_spinner_init(s); ewl_container_append_child(EWL_CONTAINER(s), s->entry); ewl_container_append_child(EWL_CONTAINER(s), s->button_increase); @@ -114,8 +113,8 @@ } -static void -__ewl_spinner_init(Ewl_Spinner * s) +void +ewl_spinner_init(Ewl_Spinner * s) { Ewl_Widget *w; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_spinner.h 2001/10/03 07:03:51 1.11 +++ ewl_spinner.h 2001/11/14 00:30:16 1.12 @@ -20,6 +20,7 @@ #define EWL_SPINNER(spinner) ((Ewl_Spinner *) spinner) Ewl_Widget *ewl_spinner_new(); +void ewl_spinner_init(Ewl_Spinner * spinner); void ewl_spinner_set_value(Ewl_Widget * widget, double value); double ewl_spinner_get_value(Ewl_Widget * widget); void ewl_spinner_set_digits(Ewl_Widget * widget, int digits); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- ewl_widget.c 2001/11/12 19:41:00 1.34 +++ ewl_widget.c 2001/11/14 00:30:16 1.35 @@ -215,7 +215,8 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); - ewl_callback_call(w, EWL_CALLBACK_CONFIGURE); + if (REALIZED(w) && VISIBLE(w)) + ewl_callback_call(w, EWL_CALLBACK_CONFIGURE); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- ewl_window.c 2001/11/10 20:32:26 1.32 +++ ewl_window.c 2001/11/14 00:30:16 1.33 @@ -332,6 +332,44 @@ } /** + * ewl_window_get_geometry - retrieve the size and position of a window + * @win: the window to retrieve the size + * @x: the pointer to the integer to store the x position + * @y: the pointer to the integer to store the y position + * @w: the pointer to the integer to store the width + * @h: the pointer to the integer to store the height + * + * Returns no value. Stores the current position and size of the window into + * @x, @y, @w, and @h. + */ +void +ewl_window_get_geometry(Ewl_Window * win, int *x, int *y, int *w, int *h) +{ + DCHECK_PARAM_PTR("win", win); + + ecore_window_get_geometry(win->window, x, y, w, h); +} + +/** + * ewl_window_set_geometry - set the current size and position of a window + * @widget: the window to change geometry + * @x: the new x position of the window + * @y: the new y position of the window + * @w: the new width of the window + * @h: the new height of the window + * + * Returns no value. Changes the current size and position of the window. + */ +void +ewl_window_set_geometry(Ewl_Widget *widget, int x, int y, int w, int h) +{ + DCHECK_PARAM_PTR("widget", widget); + + ewl_window_resize(widget, w, h); + ewl_window_move(widget, x, y); +} + +/** * ewl_window_set_title - set the title of the specified window * @w: the window to change the title * @title: the title to set for the window =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_window.h 2001/10/22 22:17:22 1.11 +++ ewl_window.h 2001/11/14 00:30:16 1.12 @@ -28,6 +28,9 @@ void ewl_window_set_max_size(Ewl_Widget * widget, int w, int h); void ewl_window_set_title(Ewl_Widget * widget, char *title); char *ewl_window_get_title(Ewl_Widget * widget); +void ewl_window_get_geometry(Ewl_Window * win, int *x, int *y, int *w, + int *h); +void ewl_window_set_geometry(Ewl_Widget * widget, int x, int y, int w, int h); void ewl_window_set_borderless(Ewl_Widget * w); void ewl_window_move(Ewl_Widget * w, int x, int y); |
From: <enl...@li...> - 2001-11-14 00:30:47
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/tools/ewl_config Modified Files: ewl_config.c Log Message: * Changed the fx API slightly to simplify the job of calculating intervals between frames, and reduce the number of steps for the calculation. * Setup a config option for the user to put a bound on the frames per second for fx. This should be useful for slower machines when running apps with lots of widgets displayed. * Added more documenting comments, but haven't added sections to the manual.raw yet. * Added window geometry functions since the standard object geometries don't work well with windows. * Fixed the spinner test to use the new window geometry functions. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/tools/ewl_config/ewl_config.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- ewl_config.c 2001/11/12 00:59:52 1.15 +++ ewl_config.c 2001/11/14 00:30:16 1.16 @@ -284,10 +284,10 @@ ewl_widget_show(e_conf.global_fps_label); e_conf.global_fps = ewl_spinner_new(); - ewl_spinner_set_min_val(e_conf.global_fps, 10.0); + ewl_spinner_set_min_val(e_conf.global_fps, 1.0); ewl_spinner_set_max_val(e_conf.global_fps, 80.0); ewl_spinner_set_digits(e_conf.global_fps, 1); - ewl_spinner_set_step(e_conf.global_fps, 0.1); + ewl_spinner_set_step(e_conf.global_fps, 1.0); ewl_container_append_child(EWL_CONTAINER(e_conf.page_fx), e_conf.global_fps); ewl_widget_show(e_conf.global_fps); @@ -481,6 +481,8 @@ conf->theme.cache = ewl_config_get_int("system", "/theme/cache"); + conf->fx.fps = ewl_config_get_int("system", "/fx/fps"); + return 1; } @@ -507,8 +509,7 @@ ewl_checkbutton_set_checked(e_conf.enable_debug, c->debug.enable); ewl_spinner_set_value(e_conf.debug_level, (double) (c->debug.level)); -/* ewl_spinner_set_value(e_conf.max_fps, (double) (c->fx.max_fps)); - ewl_spinner_set_value(e_conf.timeout, (double) (c->fx.timeout));*/ + ewl_spinner_set_value(e_conf.global_fps, (double) (c->fx.fps)); ewl_entry_set_text(e_conf.theme_name, c->theme.name); @@ -553,6 +554,7 @@ c->theme.name = strdup("default"); c->theme.cache = ewl_checkbutton_is_checked(e_conf.theme_cache); + c->fx.fps = ewl_spinner_get_value(e_conf.global_fps); return c; } @@ -573,6 +575,7 @@ ewl_config_set_str("system", "/theme/name", c->theme.name); ewl_config_set_int("system", "/theme/cache", c->theme.cache); + ewl_config_set_int("system", "/fx/fps", c->fx.fps); } void @@ -647,7 +650,8 @@ nc->evas.image_cache != oc.evas.image_cache || strcasecmp(nc->evas.render_method, oc.evas.render_method) || strcmp(nc->theme.name, oc.theme.name) || - nc->theme.cache != oc.theme.cache) && !confirm.win) + nc->theme.cache != oc.theme.cache || nc->fx.fps != oc.fx.fps) && + !confirm.win) ewl_config_create_confirm_dialog(); else { |
From: <enl...@li...> - 2001-11-14 00:31:13
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_fx.c Log Message: Removed a couple functions that are no longer necessary. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ewl_fx.c 2001/11/14 00:30:15 1.19 +++ ewl_fx.c 2001/11/14 00:31:12 1.20 @@ -546,56 +546,6 @@ } /** - * ewl_fx_calculate_interval - determine the interval between frames - * @fps: the desired frames per second - * - * Returns the interval between frames on success, 0 on failure. - */ -double -ewl_fx_calculate_interval(double fps) -{ - double ival = 0; - - DENTER_FUNCTION(DLEVEL_STABLE); - - /* - * Need to check fps to ensure we don't get a divide by zero error. - */ - DCHECK_PARAM_PTR_RET("fps", fps, 0.0); - - ival = 1 / fps; - - D(DLEVEL_STABLE, "interval = %f", ival); - - DRETURN_FLOAT(ival, DLEVEL_STABLE); -} - -/** - * ewl_fx_calculate_step - determine the step between frames - * @start_val: the beginning value of the step - * @end_val: the ending value of the step - * @fps: the frames per second of the animation - */ -double -ewl_fx_calculate_step(double start_val, double end_val, double fps) -{ - double step = 0; - - DENTER_FUNCTION(DLEVEL_STABLE); - - step = 1 / fps; - - if (end_val > start_val) - step *= (end_val - start_val); - else if (start_val > end_val) - step *= (start_val - end_val); - - D(DLEVEL_STABLE, "step = %f", step); - - DRETURN_FLOAT(step, DLEVEL_STABLE); -} - -/** * ewl_fx_clip_box_get_color - retrieve the current color of the fx clip box * @w: the widget to check the clip box color * @r: a pointer to the integer to store the red value |
From: <enl...@li...> - 2001-11-14 00:32:22
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_fx.h Log Message: And remove those functions from the header as well. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_fx.h 2001/11/14 00:30:15 1.12 +++ ewl_fx.h 2001/11/14 00:32:21 1.13 @@ -74,9 +74,6 @@ int value_span, void *data); void ewl_fx_timer_del(Ewl_Widget * w, char *name); -double ewl_fx_calculate_interval(double fps); -double ewl_fx_calculate_step(double start_val, double end_val, double fps); - void ewl_fx_clip_box_get_color(Ewl_Widget * w, int *r, int *g, int *b, int *a); void ewl_fx_clip_box_set_color(Ewl_Widget * w, int r, int g, int b, int a); |
From: <enl...@li...> - 2001-11-14 05:54:22
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_button.c ewl_button.h ewl_fx.c ewl_misc.c ewl_notebook.c ewl_notebook.h ewl_text.c Log Message: Some more documentation comments and some additions to the raw manual. There are a few errors to fix up, which I'll do tomorrow. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- ewl_button.c 2001/11/14 00:30:15 1.31 +++ ewl_button.c 2001/11/14 05:54:20 1.32 @@ -1,7 +1,6 @@ #include <Ewl.h> -void ewl_button_init(Ewl_Button * b, char *label); void __ewl_button_realize(Ewl_Widget * w, void *ev_data, void *user_data); void __ewl_button_remove_label(Ewl_Button * b); void __ewl_button_update_label(Ewl_Button * b); @@ -39,6 +38,7 @@ /** * ewl_button_init - initialize a button to starting values * @b: the button to initialize + * @label: set the label of the button @b to @label * * Returns no value. Initializes a button to default values and callbacks. */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_button.h 2001/10/03 07:03:51 1.12 +++ ewl_button.h 2001/11/14 05:54:20 1.13 @@ -20,6 +20,7 @@ }; Ewl_Widget *ewl_button_new(char *l); +void ewl_button_init(Ewl_Button * b, char *label); void ewl_button_set_label(Ewl_Button * b, char *l); #endif /* __EWL_BUTTON_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- ewl_fx.c 2001/11/14 00:31:12 1.20 +++ ewl_fx.c 2001/11/14 05:54:20 1.21 @@ -420,9 +420,9 @@ * ewl_fx_timer_add - add a timer for the specified fx on the a widget * @w: the widget to add the fx timer * @name: the name of the fx to add the timer - * @interval: the interval between timer notifications - * @step: FIXME what does this do? the only references to it just calculate it - * @count: the number of times to execute the timer + * @timeout: the time until the effect has stepped to it's maximum value + * @fps: the number of frames per second that will be displayed + * @value_span: the range of values that will be stepped through * @data: user specified data to pass to the timer function * * Returns no value. Sets up a timer to be executed at regular intervals to =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- ewl_misc.c 2001/11/04 22:06:33 1.21 +++ ewl_misc.c 2001/11/14 05:54:20 1.22 @@ -13,7 +13,14 @@ void ewl_reread_config(int val, void *data); - +/** + * ewl_init - initialize the internal variables of ewl to begin the program + * @argc: the argc passed into the main function + * @argv: the argv passed into the main function + * + * Returns no value. Sets up necessary internal variables for executing ewl + * functions. This should be called before any other ewl functions are used. + */ void ewl_init(int argc, char **argv) { @@ -63,6 +70,12 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_main - the main execution loop of ewl + * + * Returns no value. This is the main execution loop of ewl. It dispatches + * incoming events and renders updates to the evas's used by ewl. + */ void ewl_main(void) { @@ -76,6 +89,12 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_idle_render - renders updates during idle times of the main loop + * @data: this is only necessary for registering this function with ecore + * + * Returns no value. Renders updates to the evas's during idle event times. + */ void ewl_idle_render(void *data) { @@ -115,6 +134,12 @@ data = NULL; } +/** + * ewl_main_quit - notifies ewl to quit at the end of this pass of the main loop + * + * Returns no value. Sets ewl to exit the main execution loop after this time + * through the loop has been completed. + */ void ewl_main_quit(void) { @@ -125,6 +150,14 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_init_parse_options - parse the options passed to ewl_init + * @argc: the argc passed to the main function + * @argv: the argv passed to the main function + * + * Returns no value. Parses the arguments of the program into sections that + * ewl knows how to deal with. + */ static void ewl_init_parse_options(int argc, char **argv) { @@ -135,6 +168,14 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_parse_option_array - parses the argument arrays into options + * @argc: the argc passed to the main function + * @argv: the argv passed to the main function + * + * Returns no value. Parses the options passed to the main program and + * processes any ewl related options. + */ static void ewl_parse_option_array(int argc, char **argv) { @@ -167,6 +208,13 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_reread_config - a timer function used to reread the config options + * @val: dummy variable used for compatibility with ecore's timers + * @data: dummy variable used for compatibility with ecore's timers + * + * Returns no value. Sets up a timer loop for rereading the config data. + */ void ewl_reread_config(int val, void *data) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_notebook.c 2001/11/12 00:23:52 1.11 +++ ewl_notebook.c 2001/11/14 05:54:21 1.12 @@ -25,7 +25,11 @@ Ewl_NotebookPage *__ewl_notebook_page_create(Ewl_Notebook * n, Ewl_Widget * c, Ewl_Widget * l); - +/** + * ewl_notebook_new - create a new notebook + * + * Returns a newly allocated notebook on success, NULL on failure. + */ Ewl_Widget * ewl_notebook_new(void) { @@ -35,28 +39,33 @@ n = NEW(Ewl_Notebook, 1); ZERO(n, Ewl_Notebook, 1); - - n->tab_box = ewl_hbox_new(); - ewl_widget_set_appearance(n->tab_box, "/appearance/notebook/tab_box"); + ewl_notebook_init(n); - __ewl_notebook_init(n); - DRETURN_PTR(EWL_WIDGET(n), DLEVEL_TESTING); } +/** + * ewl_notebook_append_page - append a page to the notebook + * @n: the notebook to append the page + * @c: the tab of the new page added + * @l: the contents of the page added + * + * Returns no value. Appends a page to the list of available pages that will + * be available for display. + */ void -ewl_notebook_append_page(Ewl_Widget * w, Ewl_Widget * c, Ewl_Widget * l) +ewl_notebook_append_page(Ewl_Notebook *n, Ewl_Widget * c, Ewl_Widget * l) { - Ewl_Notebook *n; + Ewl_Widget *w; Ewl_NotebookPage *np; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("n", n); DCHECK_PARAM_PTR("c", c); DCHECK_PARAM_PTR("l", l); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); np = __ewl_notebook_page_create(n, c, l); ewl_container_append_child(EWL_CONTAINER(w), np->page); @@ -72,18 +81,27 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_notebook_prepend_page - prepend a page to the notebook + * @n: the notebook to prepend the page + * @c: the tab of the new page added + * @l: the contents of the page added + * + * Returns no value. Prepends a page to the list of available pages that will + * be available for display. + */ void -ewl_notebook_prepend_page(Ewl_Widget * w, Ewl_Widget * c, Ewl_Widget * l) +ewl_notebook_prepend_page(Ewl_Notebook * n, Ewl_Widget * c, Ewl_Widget * l) { - Ewl_Notebook *n; + Ewl_Widget *w; Ewl_NotebookPage *np; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("n", n); DCHECK_PARAM_PTR("c", c); DCHECK_PARAM_PTR("l", l); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); np = __ewl_notebook_page_create(n, c, l); ewl_container_prepend_child(EWL_CONTAINER(w), np->page); @@ -99,19 +117,29 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_notebook_insert_page - insert a page to the notebook + * @n: the notebook to insert the page + * @c: the tab of the new page added + * @l: the contents of the page added + * @p: the position in the list of tabs to add the page + * + * Returns no value. Insert a page to the list of available pages that will + * be available for display. + */ void -ewl_notebook_insert_page(Ewl_Widget * w, Ewl_Widget * c, Ewl_Widget * l, +ewl_notebook_insert_page(Ewl_Notebook * n, Ewl_Widget * c, Ewl_Widget * l, int p) { - Ewl_Notebook *n; + Ewl_Widget *w; Ewl_NotebookPage *np; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("n", n); DCHECK_PARAM_PTR("c", c); DCHECK_PARAM_PTR("l", l); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); np = __ewl_notebook_page_create(n, c, l); ewl_container_insert_child(EWL_CONTAINER(w), np->page, p); @@ -128,19 +156,25 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_notebook_remove_first_page - remove the first page from the notebook + * @n: the notebook to remove the first page + * + * Returns a pointer to the removed page on success, NULL on failure. + */ Ewl_NotebookPage * -ewl_notebook_remove_first_page(Ewl_Widget * w) +ewl_notebook_remove_first_page(Ewl_Notebook * n) { - Ewl_Notebook *n; + Ewl_Widget *w; Ewl_NotebookPage *np; Ewl_NotebookPage *nnp; Ewl_Widget *tab; Ewl_Widget *page; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, NULL); + DCHECK_PARAM_PTR_RET("n", n, NULL); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); np = NULL; if (!n->pages || ewd_list_is_empty(n->pages)) @@ -178,19 +212,25 @@ DRETURN_PTR(nnp, DLEVEL_STABLE); } +/** + * ewl_notebook_remove_first_page - remove the last page from the notebook + * @n: the notebook to remove the last page + * + * Returns a pointer to the removed page on success, NULL on failure. + */ Ewl_NotebookPage * -ewl_notebook_remove_last_page(Ewl_Widget * w) +ewl_notebook_remove_last_page(Ewl_Notebook * n) { - Ewl_Notebook *n; + Ewl_Widget *w; Ewl_NotebookPage *np; Ewl_NotebookPage *nnp; Ewl_Widget *tab; Ewl_Widget *page; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, NULL); + DCHECK_PARAM_PTR_RET("n", n, NULL); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); np = NULL; if (!n->pages || ewd_list_is_empty(n->pages)) @@ -228,19 +268,26 @@ DRETURN_PTR(nnp, DLEVEL_STABLE); } +/** + * ewl_notebook_remove_page - remove the specified page from the notebook + * @n: the notebook to remove the specified page + * @i: the position in the list of pages to remove from @n + * + * Returns a pointer to the removed page on success, NULL on failure. + */ Ewl_NotebookPage * -ewl_notebook_remove_page(Ewl_Widget * w, int i) +ewl_notebook_remove_page(Ewl_Notebook * n, int i) { - Ewl_Notebook *n; + Ewl_Widget *w; Ewl_NotebookPage *np; Ewl_NotebookPage *nnp; Ewl_Widget *tab; Ewl_Widget *page; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, NULL); + DCHECK_PARAM_PTR_RET("n", n, NULL); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); np = NULL; if (!n->pages || ewd_list_is_empty(n->pages)) @@ -278,19 +325,25 @@ DRETURN_PTR(nnp, DLEVEL_STABLE); } +/** + * ewl_notebook_remove_visible - remove the visible page from the notebook + * @n: the notebook to remove the visible page + * + * Returns a pointer to the removed page on success, NULL on failure. + */ Ewl_NotebookPage * -ewl_notebook_remove_visible(Ewl_Widget * w) +ewl_notebook_remove_visible(Ewl_Notebook * n) { - Ewl_Notebook *n; + Ewl_Widget *w; Ewl_NotebookPage *np; Ewl_NotebookPage *nnp; Ewl_Widget *tab; Ewl_Widget *page; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, NULL); + DCHECK_PARAM_PTR_RET("n", n, NULL); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); np = NULL; if (!n->pages || ewd_list_is_empty(n->pages)) @@ -334,15 +387,23 @@ DRETURN_PTR(nnp, DLEVEL_STABLE); } +/** + * ewl_notebook_set_tabs_alignment - set the alignment of a notebooks tabs + * @n: the notebook to change tab alignment + * @a: the new alignment for the tabs of @n + * + * Returns no value. Changes the alignment of the tabs on @n to @a, and + * updates the display. + */ void -ewl_notebook_set_tabs_alignment(Ewl_Widget * w, Ewl_Alignment a) +ewl_notebook_set_tabs_alignment(Ewl_Notebook * n, Ewl_Alignment a) { - Ewl_Notebook *n; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("n", n); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); ewl_object_set_alignment(EWL_OBJECT(n->tab_box), a); @@ -351,31 +412,45 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_notebook_get_tabs_alignment - get the alignment of a notebooks tabs + * @n: the notebook to get tab alignment + * + * Returns the tab alignment of the notebook @n on success, 0 on failure. + */ Ewl_Alignment -ewl_notebook_get_tabs_alignment(Ewl_Widget * w) +ewl_notebook_get_tabs_alignment(Ewl_Notebook * n) { - Ewl_Notebook *n; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, 0); + DCHECK_PARAM_PTR_RET("n", n, 0); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); DRETURN_INT(ewl_object_get_alignment(EWL_OBJECT(n->tab_box)), DLEVEL_TESTING); } +/** + * ewl_notebook_set_tabs_position - set a notebooks tab position + * @n: the notebook to change tab position + * @p: the new position for the tabs of @n + * + * Returns no value. Changes the tab position of @n to @p and updates the + * display. + */ void -ewl_notebook_set_tabs_position(Ewl_Widget * w, Ewl_Position p) +ewl_notebook_set_tabs_position(Ewl_Notebook * n, Ewl_Position p) { - Ewl_Notebook *n; + Ewl_Widget *w; Ewl_NotebookPage *np; char file[PATH_LEN]; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("n", n); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); n->tabs_position = p; @@ -431,28 +506,41 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_notebook_get_tabs_position - get the position of a notebooks tabs + * @n: the notebook to retrieve the tab position + * + * Returns the position of the tabs in @n on success, 0 on failure. + */ Ewl_Position -ewl_notebook_get_tabs_position(Ewl_Widget * w) +ewl_notebook_get_tabs_position(Ewl_Notebook * n) { - Ewl_Notebook *n; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, 0); + DCHECK_PARAM_PTR_RET("n", n, 0); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); DRETURN_INT(n->tabs_position, DLEVEL_TESTING); } +/** + * ewl_notebook_set_flags - set the flags for a notebook + * @n: the notebook to change flags + * @flags: the new flags for the notebook @n + * + * Returns no value. Sets the flags for the notebook @n to @flags. + */ void -ewl_notebook_set_flags(Ewl_Widget * w, Ewl_Notebook_Flags flags) +ewl_notebook_set_flags(Ewl_Notebook * n, Ewl_Notebook_Flags flags) { - Ewl_Notebook *n; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("n", n); - n = EWL_NOTEBOOK(w); + w = EWL_WIDGET(n); n->flags = flags; @@ -462,8 +550,14 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_notebook_init - initialize a notebook to default values and callbacks + * @n: the notebook to initialize + * + * Returns no value. Sets the fields and callbacks of @n to their defaults. + */ void -__ewl_notebook_init(Ewl_Notebook * n) +ewl_notebook_init(Ewl_Notebook * n) { Ewl_Widget *w; @@ -472,24 +566,45 @@ w = EWL_WIDGET(n); + /* + * Initialize the container portion of the notebook and set the fill + * policy to fill the area available. + */ ewl_container_init(EWL_CONTAINER(w), "/appearance/notebook/default"); ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_FILL); + /* + * Create the box to hold tabs and make the box fill the area of the + * notebook. + */ + n->tab_box = ewl_hbox_new(); + ewl_widget_set_appearance(n->tab_box, "/appearance/notebook/tab_box"); + ewl_object_set_fill_policy(EWL_OBJECT(n->tab_box), + EWL_FILL_POLICY_FILL); + + /* + * Attach the necessary callbacks for the notebook + */ ewl_callback_append(w, EWL_CALLBACK_REALIZE, __ewl_notebook_realize, NULL); ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, __ewl_notebook_configure, NULL); ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, __ewl_notebook_destroy, NULL); + ewl_callback_del(w, EWL_CALLBACK_CONFIGURE, + __ewl_container_configure_clip_box); + /* + * Attach a necessary callback for the tab box + */ ewl_callback_append(n->tab_box, EWL_CALLBACK_CONFIGURE, __ewl_notebook_tab_box_configure, NULL); - ewl_callback_del(w, EWL_CALLBACK_CONFIGURE, - __ewl_container_configure_clip_box); - + /* + * Create a list to keep track of the pages in the notebook and set + * the default position of the tabs. + */ n->pages = ewd_list_new(); - n->tabs_position = EWL_POSITION_TOP; DLEAVE_FUNCTION(DLEVEL_STABLE); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_notebook.h 2001/10/22 22:17:22 1.6 +++ ewl_notebook.h 2001/11/14 05:54:21 1.7 @@ -30,6 +30,7 @@ }; Ewl_Widget *ewl_notebook_new(void); +void ewl_notebook_init(Ewl_Notebook * n); void ewl_notebook_append_page(Ewl_Widget * w, Ewl_Widget * c, Ewl_Widget * l); void ewl_notebook_prepend_page(Ewl_Widget * w, Ewl_Widget * c, Ewl_Widget * l); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- ewl_text.c 2001/11/12 19:47:59 1.36 +++ ewl_text.c 2001/11/14 05:54:21 1.37 @@ -18,6 +18,12 @@ #define START_W 2048 #define START_H 2048 +/** + * ewl_text_new - allocate a new text widget + * + * Returns a pointer to a newly allocated text widget on success, NULL on + * failure. + */ Ewl_Widget * ewl_text_new() { @@ -33,6 +39,13 @@ DRETURN_PTR(EWL_WIDGET(t), DLEVEL_STABLE); } +/** + * ewl_text_init - initialize a text widget to default values and callbacks + * @t: the text widget to initialize to default values and callbacks + * + * Returns no value. Sets the fields and callbacks of the text widget @t to + * their defaults. + */ void ewl_text_init(Ewl_Text * t) { @@ -67,204 +80,23 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } -static void -__ewl_text_realize(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Etox_Align_Type h_align, v_align; - Ewl_Text *t; - char *name; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - t = EWL_TEXT(w); - - t->style = etox_style_new("Default"); - - /* - * Determine the proper vertical alignment - */ - -/* if (EWL_OBJECT(t)->align & EWL_ALIGNMENT_BOTTOM) - v_align = ETOX_ALIGN_TYPE_BOTTOM; - else if (EWL_OBJECT(t)->align & EWL_ALIGNMENT_TOP)*/ - v_align = ETOX_ALIGN_TYPE_TOP; - -/* else - v_align = ETOX_ALIGN_TYPE_CENTER;*/ - - /* - * Determine the proper horizontal alignment - */ - -/* if (EWL_OBJECT(t)->align & EWL_ALIGNMENT_RIGHT) - h_align = ETOX_ALIGN_TYPE_RIGHT; - else if (EWL_OBJECT(t)->align & EWL_ALIGNMENT_LEFT)*/ - h_align = ETOX_ALIGN_TYPE_LEFT; - -/* else - h_align = ETOX_ALIGN_TYPE_CENTER;*/ - - /* - * Create the evas objects needed to draw the text - */ - - name = NEW(char, 11); - - snprintf(name, 11, "%p", w); - - t->tox = etox_new(w->evas, name); - FREE(name); - - /* - * Set up necessary etox properties - */ - etox_set_align(t->tox, h_align, v_align); - etox_set_style(t->tox, t->style); - etox_set_layer(t->tox, LAYER(w)); - etox_resize(t->tox, START_W, START_H); - etox_move(t->tox, CURRENT_X(w), CURRENT_Y(w)); - etox_set_padding(t->tox, t->padding); - etox_set_font(t->tox, t->font, t->font_size); - etox_set_text(t->tox, ET_TEXT(t->text), ET_END); - { - double xx, yy, ww, hh; - - etox_get_actual_geometry(t->tox, &xx, &yy, &ww, &hh); - - etox_resize(t->tox, ww, hh); - } - etox_set_alpha(t->tox, 255); - etox_set_clip(t->tox, w->fx_clip_box); - etox_show(t->tox); - - __ewl_text_theme_update(w, NULL, NULL); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_text_destroy(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Ewl_Text *t; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - t = EWL_TEXT(w); - - if (t->tox) - { - etox_hide(t->tox); - etox_unset_clip(t->tox); - etox_free(t->tox); - } - - IF_FREE(t->text); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_text_configure(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Ewl_Text *t; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - t = EWL_TEXT(w); - - if (t->tox) - { - double ww, hh; - - etox_move(t->tox, CURRENT_X(t), CURRENT_Y(t)); - etox_resize(t->tox, START_W, START_H); - etox_get_actual_geometry(t->tox, NULL, NULL, &ww, &hh); -// etox_resize(t->tox, ww, hh); - ewl_object_set_custom_size(EWL_OBJECT(w), ww, hh); - } - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_text_theme_update(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Ewl_Text *t; - char key[PATH_LEN]; - char *font = NULL /*, *style = NULL */ ; - int font_size = 0; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - t = EWL_TEXT(w); - - if (!t->tox) - DRETURN(DLEVEL_STABLE); - - snprintf(key, PATH_LEN, "%s/font", w->appearance); - font = ewl_theme_data_get_str(w, key); - - snprintf(key, PATH_LEN, "%s/font_size", w->appearance); - font_size = ewl_theme_data_get_int(w, key); - -/* snprintf(key, PATH_LEN, "%s/style", w->appearance); - style = ewl_theme_data_get_str(w, key);*/ - - if (font) - { - IF_FREE(t->font); - - t->font = font; - t->font_size = font_size; - - etox_set_font(t->tox, font, font_size); - } - -/* if (style) - { - t->style = etox_style_new(style); - FREE(style); - - etox_set_style(t->tox, t->style); - } -*/ - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_text_reparent(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Ewl_Text *t; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - t = EWL_TEXT(w); - - if (!t->tox) - DRETURN(DLEVEL_STABLE); - - etox_unset_clip(t->tox); - etox_set_clip(t->tox, w->fx_clip_box); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - +/** + * ewl_text_set_text - set the text of a text widget + * @t: the text widget to set the text + * @text: the new text for the text widget @t + * + * Returns no value. Sets the text of the text widget @t to @text. + */ void -ewl_text_set_text(Ewl_Widget * w, char *text) +ewl_text_set_text(Ewl_Text * t, char *text) { - Ewl_Text *t; + Ewl_Widget *w; char *ot; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); ot = t->text; @@ -292,21 +124,35 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_get_text - retrieve the text of a text widget + * @t: the text widget to retrieve the text + * + * Returns a pointer to a copy of the text in @t on success, NULL on failure. + */ char * -ewl_text_get_text(Ewl_Widget * w) +ewl_text_get_text(Ewl_Text * t) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("w", w, NULL); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); DRETURN_PTR(t->text ? strdup(t->text) : NULL, DLEVEL_STABLE); } +/** + * ewl_text_set_font - set the font of a text widget + * @t: the text widget to set the font + * @f: the name of the font to use for the text widget + * + * Returns no value. Sets the name of the font for text widget @t to @f and + * updates the display to use that font. + */ void -ewl_text_set_font(Ewl_Widget * w, char *f) +ewl_text_set_font(Ewl_Text * t, char *f) { Ewl_Text *t; @@ -326,28 +172,42 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_get_font - retrieve the font used by a text widget + * @t: the text widget to get the font + * + * Returns a pointer to a copy of the font name used by @t on success, NULL on + * failure. + */ char * -ewl_text_get_font(Ewl_Widget * w) +ewl_text_get_font(Ewl_Text * t) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, NULL); + DCHECK_PARAM_PTR_RET("t", t, NULL); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); DRETURN_PTR(t->font ? strdup(t->font) : NULL, DLEVEL_STABLE); } +/** + * ewl_text_set_font_size - set the font size of a text widget + * @t: the text widget to set the font size + * @s: the font size to use for the text widget + * + * Returns no value. Sets the font size for the text widget @t to @s. + */ void -ewl_text_set_font_size(Ewl_Widget * w, int s) +ewl_text_set_font_size(Ewl_Text * t, int s) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); t->font_size = s; @@ -357,6 +217,12 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_get_font_size - retrieve the font size of a text widget + * @t: the text widget to retrieve the font size + * + * Returns the font size of the text widget on success, 0 on failure. + */ int ewl_text_get_font_size(Ewl_Widget * w) { @@ -370,6 +236,17 @@ DRETURN_INT(t->font_size, DLEVEL_STABLE); } +/** + * ewl_text_set_color - set the color of the text for a text widget + * @t: the text widget to set the color + * @r: the red value for the color + * @g: the green value for the color + * @b: the blue value for the color + * @a: the alpha value for the color + * + * Returns no value. Sets the color of the text in the text widget @t to the + * new color values specified. + */ void ewl_text_set_color(Ewl_Widget * w, int r, int g, int b, int a) { @@ -386,6 +263,16 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_get_color - get the color of the text in a text widget + * @t: the text widget to get the color + * @r: a pointer to the integer to store the red value + * @g: a pointer to the integer to store the green value + * @b: a pointer to the integer to store the blue value + * @a: a pointer to the integer to store the alpha value + * + * Returns no value. Stores the color values into any non-NULL color pointers. + */ void ewl_text_get_color(Ewl_Widget * w, int *r, int *g, int *b, int *a) { @@ -553,6 +440,182 @@ (double) x, (double) y, NULL, NULL, NULL, NULL); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_text_realize(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Etox_Align_Type h_align, v_align; + Ewl_Text *t; + char *name; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + t = EWL_TEXT(w); + + t->style = etox_style_new("Default"); + + /* + * Determine the proper vertical alignment + */ + +/* if (EWL_OBJECT(t)->align & EWL_ALIGNMENT_BOTTOM) + v_align = ETOX_ALIGN_TYPE_BOTTOM; + else if (EWL_OBJECT(t)->align & EWL_ALIGNMENT_TOP)*/ + v_align = ETOX_ALIGN_TYPE_TOP; + +/* else + v_align = ETOX_ALIGN_TYPE_CENTER;*/ + + /* + * Determine the proper horizontal alignment + */ + +/* if (EWL_OBJECT(t)->align & EWL_ALIGNMENT_RIGHT) + h_align = ETOX_ALIGN_TYPE_RIGHT; + else if (EWL_OBJECT(t)->align & EWL_ALIGNMENT_LEFT)*/ + h_align = ETOX_ALIGN_TYPE_LEFT; + +/* else + h_align = ETOX_ALIGN_TYPE_CENTER;*/ + + /* + * Create the evas objects needed to draw the text + */ + + name = NEW(char, 11); + + snprintf(name, 11, "%p", w); + + t->tox = etox_new(w->evas, name); + FREE(name); + + /* + * Set up necessary etox properties + */ + etox_set_align(t->tox, h_align, v_align); + etox_set_style(t->tox, t->style); + etox_set_layer(t->tox, LAYER(w)); + etox_resize(t->tox, START_W, START_H); + etox_move(t->tox, CURRENT_X(w), CURRENT_Y(w)); + etox_set_padding(t->tox, t->padding); + etox_set_font(t->tox, t->font, t->font_size); + etox_set_text(t->tox, ET_TEXT(t->text), ET_END); + { + double xx, yy, ww, hh; + + etox_get_actual_geometry(t->tox, &xx, &yy, &ww, &hh); + + etox_resize(t->tox, ww, hh); + } + etox_set_alpha(t->tox, 255); + etox_set_clip(t->tox, w->fx_clip_box); + etox_show(t->tox); + + __ewl_text_theme_update(w, NULL, NULL); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_text_destroy(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Text *t; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + t = EWL_TEXT(w); + + if (t->tox) + { + etox_hide(t->tox); + etox_unset_clip(t->tox); + etox_free(t->tox); + } + + IF_FREE(t->text); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_text_configure(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Text *t; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + t = EWL_TEXT(w); + + if (t->tox) + { + double ww, hh; + + etox_move(t->tox, CURRENT_X(t), CURRENT_Y(t)); + etox_resize(t->tox, START_W, START_H); + etox_get_actual_geometry(t->tox, NULL, NULL, &ww, &hh); +// etox_resize(t->tox, ww, hh); + ewl_object_set_custom_size(EWL_OBJECT(w), ww, hh); + } + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_text_theme_update(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Text *t; + char key[PATH_LEN]; + char *font = NULL /*, *style = NULL */ ; + int font_size = 0; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + t = EWL_TEXT(w); + + if (!t->tox) + DRETURN(DLEVEL_STABLE); + + snprintf(key, PATH_LEN, "%s/font", w->appearance); + font = ewl_theme_data_get_str(w, key); + + snprintf(key, PATH_LEN, "%s/font_size", w->appearance); + font_size = ewl_theme_data_get_int(w, key); + + if (font) + { + IF_FREE(t->font); + + t->font = font; + t->font_size = font_size; + + etox_set_font(t->tox, font, font_size); + } + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_text_reparent(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Text *t; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + t = EWL_TEXT(w); + + if (!t->tox) + DRETURN(DLEVEL_STABLE); + + etox_unset_clip(t->tox); + etox_set_clip(t->tox, w->fx_clip_box); DLEAVE_FUNCTION(DLEVEL_STABLE); } |
From: <enl...@li...> - 2001-11-14 05:54:51
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/doc Modified Files: manual.raw Log Message: Some more documentation comments and some additions to the raw manual. There are a few errors to fix up, which I'll do tomorrow. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/doc/manual.raw,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- manual.raw 2001/11/04 22:06:32 1.4 +++ manual.raw 2001/11/14 05:54:20 1.5 @@ -54,18 +54,19 @@ furnished to do so, subject to the following conditions: </para> <para> - The above copyright notice and this permission notice shall be included in - all copies of the Software and its documentation and acknowledgment shall be - given in the documentation and software packages that this Software was - used. + The above copyright notice and this permission notice shall be included + in all copies of the Software and its documentation and acknowledgment + shall be given in the documentation and software packages that this + Software was used. </para> <para> - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. </para> </legalnotice> @@ -76,44 +77,49 @@ <chapter id="introduction"> <title>Introduction</title> <para> - EWL is a widget library based on the <ulink url="http://docbook.org"> - Enlightenment</ulink> subsystem libraries. + EWL is a widget library based on the <ulink + url="http://www.enlightenment.org"> Enlightenment</ulink> subsystem + libraries. </para> </chapter> <chapter id="basic"> <title id="basic.title">Basic Classes and Utility Functions</title> - <section><title>Object Class</title> -!Isrc/ewl_object.c + <section><title>Callback Functions</title> +!Isrc/ewl_callback.c </section> - <section><title>Widget Class</title> -!Isrc/ewl_widget.c + <section><title>Configuration Functions</title> +!Isrc/ewl_config.c </section> <section><title>Container Class</title> !Isrc/ewl_container.c </section> - <section><title>Callback Functions</title> -!Isrc/ewl_callback.c - </section> - <section><title>Event Functions</title> !Isrc/ewl_events.c </section> - <section><title>Configuration Functions</title> -!Isrc/ewl_config.c + <section><title>Special FX</title> +!Isrc/ewl_fx.c </section> + <section><title>Misc Functions</title> +!Isrc/ewl_misc.c + </section> + + <section><title>Object Class</title> +!Isrc/ewl_object.c + </section> + <section><title>Theme Functions</title> !Isrc/ewl_theme.c </section> - <section><title>Special FX</title> -!Isrc/ewl_fx.c + <section><title>Widget Class</title> +!Isrc/ewl_widget.c </section> </chapter> @@ -130,6 +136,10 @@ !Isrc/ewl_box.c </section> + <section><title>Ewl_Notebook</title> +!Isrc/ewl_notebook.c + </section> + <section><title>Ewl_Table</title> !Isrc/ewl_table.c </section> @@ -142,6 +152,10 @@ <chapter id="buttons"> <title id="buttons.title">Button Widgets</title> + <para> + Ewl provides a few different types of button widgets for developing + interactive user interfaces. + </para> <section><title>Ewl_Button</title> !Isrc/ewl_button.c @@ -153,6 +167,67 @@ <section><title>Ewl_RadioButton</title> !Isrc/ewl_radiobutton.c + </section> + + </chapter> + + <chapter id="text"> + <title id="text.title">Text Widgets</title> + <para> + Ewl provides a two different types of text widgets for displaying and + inputing text data to ewl. Ewl_Text is a simple one line display of + text, while Ewl_TextArea provides facilities for multi-line text + including scrollbars if applicable. + </para> + + <section><title>Ewl_Text</title> +!Isrc/ewl_text.c + </section> + + <section><title>Ewl_TextArea</title> +!Isrc/ewl_textarea.c + </section> + + </chapter> + + <chapter id="data"> + <title id="data.title">Data Manipulation Widgets</title> + <para> + Included in ewl are a few different widgets for interactively + manipulating data items. + </para> + + <section><title>Ewl_Scrollbar</title> +!Isrc/ewl_scrollbar.c + </section> + + <section><title>Ewl_Seeker</title> +!Isrc/ewl_seeker.c + </section> + + <section><title>Ewl_Spinner</title> +!Isrc/ewl_spinner.c + </section> + + </chapter> + + <chapter id="display"> + <title id="display.title">Display Widgets</title> + <para> + Some of the widgets in Ewl are used for simply manipulating and + beatifying the display. + </para> + + <section><title>Ewl_Image</title> +!Isrc/ewl_image.c + </section> + + <section><title>Ewl_Scrollpane</title> +!Isrc/ewl_scrollpane.c + </section> + + <section><title>Ewl_Separator</title> +!Isrc/ewl_separator.c </section> </chapter> |
From: <enl...@li...> - 2001-11-14 22:56:39
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_button.c ewl_entry.c ewl_fx.c ewl_image.c ewl_image.h ewl_list.c ewl_notebook.c ewl_notebook.h ewl_separator.c ewl_separator.h ewl_spinner.c ewl_spinner.h ewl_text.c ewl_text.h ewl_textarea.c ewl_widget.c Log Message: Lots more documentation related fixes. Also did some consistency checks on some of the API calls. Generating the html docs took a long time on my machine, so if it sits there for a while, be patient it will generate the files eventually (might be time to try and break the docs up a bit). =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- ewl_button.c 2001/11/14 05:54:20 1.32 +++ ewl_button.c 2001/11/14 22:56:38 1.33 @@ -83,7 +83,7 @@ b->label_object = ewl_text_new(); ewl_widget_set_appearance(b->label_object, "/appearance/button/label"); - ewl_text_set_text(b->label_object, label); + ewl_text_set_text(EWL_TEXT(b->label_object), label); ewl_object_set_alignment(EWL_OBJECT(b->label_object), EWL_ALIGNMENT_CENTER); ewl_container_append_child(EWL_CONTAINER(b), @@ -241,15 +241,15 @@ tmp = ewl_theme_data_get_str(w, key); if (tmp) - ewl_text_set_font(b->label_object, tmp); + ewl_text_set_font(EWL_TEXT(b->label_object), tmp); snprintf(key, PATH_LEN, "%s/text/font_size", w->appearance); itmp = ewl_theme_data_get_int(w, key); if (itmp) - ewl_text_set_font_size(b->label_object, itmp); + ewl_text_set_font_size(EWL_TEXT(b->label_object), itmp); - ewl_text_set_text(b->label_object, b->label); + ewl_text_set_text(EWL_TEXT(b->label_object), b->label); ewl_widget_show(b->label_object); DLEAVE_FUNCTION(DLEVEL_STABLE); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- ewl_entry.c 2001/11/12 19:40:59 1.35 +++ ewl_entry.c 2001/11/14 22:56:38 1.36 @@ -62,7 +62,7 @@ e = EWL_ENTRY(w); - ewl_text_set_text(e->text, t); + ewl_text_set_text(EWL_TEXT(e->text), t); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -77,7 +77,7 @@ e = EWL_ENTRY(w); - DRETURN_PTR(ewl_text_get_text(e->text), DLEVEL_STABLE); + DRETURN_PTR(ewl_text_get_text(EWL_TEXT(e->text)), DLEVEL_STABLE); } void @@ -192,8 +192,8 @@ c_pos = ewl_cursor_get_position(e->cursor); - ewl_text_get_letter_geometry(e->text, --c_pos, &xx2, &yy2, &ww2, - &hh2); + ewl_text_get_letter_geometry(EWL_TEXT(e->text), --c_pos, &xx2, &yy2, + &ww2, &hh2); str = EWL_TEXT(e->text)->text; @@ -224,10 +224,10 @@ yy = CURRENT_Y(e->text); ww = 0; - ewl_text_get_letter_geometry(e->text, ss, &sx, &sy, &sw, - &sh); - ewl_text_get_letter_geometry(e->text, ss + ee, &ex, &ey, - &ew, &eh); + ewl_text_get_letter_geometry(EWL_TEXT(e->text), ss, &sx, &sy, + &sw, &sh); + ewl_text_get_letter_geometry(EWL_TEXT(e->text), ss + ee, + &ex, &ey, &ew, &eh); xx += sx; ww += sw; @@ -334,9 +334,9 @@ len = index = strlen(str); } else - ewl_text_get_index_at(e->text, ev->x, + index = ewl_text_get_index_at(EWL_TEXT(e->text), ev->x, CURRENT_Y(e->text) + - (CURRENT_H(e->text) / 2), &index); + (CURRENT_H(e->text) / 2)); ewl_cursor_set_position(e->cursor, index + 1); @@ -382,7 +382,7 @@ if (w->state & EWL_STATE_PRESSED) { int ss, ee; - int index; + int index = 0; ewl_widget_show(e->selection); @@ -390,11 +390,10 @@ if (ev->x > CURRENT_X(e->text) && ev->x < CURRENT_X(e->text) + CURRENT_W(e->text)) { - ewl_text_get_index_at(e->text, (ev->x), - (CURRENT_Y(e->text) - + - (CURRENT_H - (e->text) / 2)), &index); + index = ewl_text_get_index_at(EWL_TEXT(e->text), + (ev->x), (CURRENT_Y(e->text) + + (CURRENT_H + (e->text) / 2))); ee = index - ss; @@ -476,11 +475,11 @@ "/appearance/entry/default/text/style"); if (font) - ewl_text_set_font(e->text, font); + ewl_text_set_font(EWL_TEXT(e->text), font); if (size) - ewl_text_set_font_size(e->text, size); + ewl_text_set_font_size(EWL_TEXT(e->text), size); if (style) - ewl_text_set_style(e->text, style); + ewl_text_set_style(EWL_TEXT(e->text), style); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- ewl_fx.c 2001/11/14 05:54:20 1.21 +++ ewl_fx.c 2001/11/14 22:56:38 1.22 @@ -56,7 +56,7 @@ } /** - * ewl_fx_init - initialize any fx variables that must be set up ahead of time + * ewl_fx_deinit - deinit any fx variables that must be set up ahead of time * * Returns no value. The programmer should not call this, it is used by * ewl_deinit, and nothing else. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_image.c 2001/11/09 23:41:48 1.12 +++ ewl_image.c 2001/11/14 22:56:38 1.13 @@ -1,11 +1,6 @@ #include <Ewl.h> -/* -#define _EBITS_INTERNAL 1 -#include <Ebits_Private.h> -*/ -static void __ewl_image_init(Ewl_Image * i); static void __ewl_image_realize(Ewl_Widget * w, void *ev_data, void *user_data); static void __ewl_image_configure(Ewl_Widget * w, void *ev_data, @@ -16,6 +11,13 @@ static Ewl_Image_Type __ewl_image_get_type(const char *i); +/** + * ewl_image_load - allocates a new image widget with specified image contents + * @i: the path to the image to be displayed by the image widget + * + * Returns a pointer to the newly allocated image widget on success, NULL on + * failure. + */ Ewl_Widget * ewl_image_load(const char *i) { @@ -30,7 +32,7 @@ image = NEW(Ewl_Image, 1); ZERO(image, Ewl_Image, 1); - __ewl_image_init(image); + ewl_image_init(image); image->type = __ewl_image_get_type(i); image->path = strdup(i); @@ -38,17 +40,25 @@ DRETURN_PTR(EWL_WIDGET(image), DLEVEL_STABLE); } +/** + * ewl_image_set_file - change the image file displayed by an image widget + * @i: the image widget to change the displayed image + * @im: the path to the new image to be displayed by @i + * + * Returns no value. Set the image displayed by @i to the one found at the + * path @im. + */ void -ewl_image_set_file(Ewl_Widget * w, const char *im) +ewl_image_set_file(Ewl_Image * i, const char *im) { - Ewl_Image *i; + Ewl_Widget *w; int ww = 0, hh = 0; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("i", i); DCHECK_PARAM_PTR("im", im); - i = EWL_IMAGE(w); + w = EWL_WIDGET(i); IF_FREE(i->path); @@ -105,8 +115,15 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } -static void -__ewl_image_init(Ewl_Image * i) +/** + * ewl_image_init - initialize an image widget to default values and callbacks + * @i: the image widget to initialize + * + * Returns no value. Sets the fields and callbacks of @i to their default + * values. + */ +void +ewl_image_init(Ewl_Image * i) { Ewl_Widget *w; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_image.h 2001/10/03 07:03:51 1.8 +++ ewl_image.h 2001/11/14 22:56:38 1.9 @@ -23,6 +23,7 @@ }; Ewl_Widget *ewl_image_load(const char *i); -void ewl_image_set_file(Ewl_Widget * w, const char *im); +void ewl_image_init(Ewl_Image * i); +void ewl_image_set_file(Ewl_Image * i, const char *im); #endif /* __EWL_IMAGE_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_list.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ewl_list.c 2001/11/09 23:41:48 1.18 +++ ewl_list.c 2001/11/14 22:56:38 1.19 @@ -88,8 +88,8 @@ for (i = 0; i < EWL_TABLE(table)->columns; i++) { text_widgets[i] = ewl_text_new(); - ewl_text_set_text(text_widgets[i], text[i]); - ewl_text_set_font_size(text_widgets[i], 8); + ewl_text_set_text(EWL_TEXT(text_widgets[i]), text[i]); + ewl_text_set_font_size(EWL_TEXT(text_widgets[i]), 8); /* ewl_table_attach(table, text_widgets[i], EWL_ALIGNMENT_LEFT, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_notebook.c 2001/11/14 05:54:21 1.12 +++ ewl_notebook.c 2001/11/14 22:56:38 1.13 @@ -183,7 +183,7 @@ np = ewd_list_goto_first(n->pages); if (np == n->visible_np) - DRETURN_PTR(ewl_notebook_remove_visible(w), DLEVEL_STABLE); + DRETURN_PTR(ewl_notebook_remove_visible(n), DLEVEL_STABLE); if (!np) DRETURN_PTR(NULL, DLEVEL_STABLE); @@ -239,7 +239,7 @@ np = ewd_list_goto_last(n->pages); if (np == n->visible_np) - DRETURN_PTR(ewl_notebook_remove_visible(w), DLEVEL_STABLE); + DRETURN_PTR(ewl_notebook_remove_visible(n), DLEVEL_STABLE); if (!np) DRETURN_PTR(NULL, DLEVEL_STABLE); @@ -296,7 +296,7 @@ np = ewd_list_goto_index(n->pages, i); if (np == n->visible_np) - DRETURN_PTR(ewl_notebook_remove_visible(w), DLEVEL_STABLE); + DRETURN_PTR(ewl_notebook_remove_visible(n), DLEVEL_STABLE); if (!np) DRETURN_PTR(NULL, DLEVEL_STABLE); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_notebook.h 2001/11/14 05:54:21 1.7 +++ ewl_notebook.h 2001/11/14 22:56:38 1.8 @@ -31,23 +31,23 @@ Ewl_Widget *ewl_notebook_new(void); void ewl_notebook_init(Ewl_Notebook * n); -void ewl_notebook_append_page(Ewl_Widget * w, Ewl_Widget * c, Ewl_Widget * l); -void ewl_notebook_prepend_page(Ewl_Widget * w, Ewl_Widget * c, +void ewl_notebook_append_page(Ewl_Notebook * n, Ewl_Widget * c, Ewl_Widget * l); +void ewl_notebook_prepend_page(Ewl_Notebook * n, Ewl_Widget * c, Ewl_Widget * l); -void ewl_notebook_insert_page(Ewl_Widget * w, Ewl_Widget * c, +void ewl_notebook_insert_page(Ewl_Notebook * n, Ewl_Widget * c, Ewl_Widget * l, int p); -Ewl_NotebookPage *ewl_notebook_remove_first_page(Ewl_Widget * w); -Ewl_NotebookPage *ewl_notebook_remove_last_page(Ewl_Widget * w); -Ewl_NotebookPage *ewl_notebook_remove_page(Ewl_Widget * w, int i); -Ewl_NotebookPage *ewl_notebook_remove_visible(Ewl_Widget * w); +Ewl_NotebookPage *ewl_notebook_remove_first_page(Ewl_Notebook * n); +Ewl_NotebookPage *ewl_notebook_remove_last_page(Ewl_Notebook * n); +Ewl_NotebookPage *ewl_notebook_remove_page(Ewl_Notebook * n, int i); +Ewl_NotebookPage *ewl_notebook_remove_visible(Ewl_Notebook * n); -void ewl_notebook_set_tabs_alignment(Ewl_Widget * w, Ewl_Alignment a); -Ewl_Alignment ewl_notebook_get_tabs_alignment(Ewl_Widget * w); +void ewl_notebook_set_tabs_alignment(Ewl_Notebook * n, Ewl_Alignment a); +Ewl_Alignment ewl_notebook_get_tabs_alignment(Ewl_Notebook * n); -void ewl_notebook_set_tabs_position(Ewl_Widget * w, Ewl_Position p); -Ewl_Position ewl_notebook_get_tabs_position(Ewl_Widget * w); +void ewl_notebook_set_tabs_position(Ewl_Notebook * n, Ewl_Position p); +Ewl_Position ewl_notebook_get_tabs_position(Ewl_Notebook * n); -void ewl_notebook_set_flags(Ewl_Widget * w, Ewl_Notebook_Flags flags); +void ewl_notebook_set_flags(Ewl_Notebook * n, Ewl_Notebook_Flags flags); #endif /* __EWL_NOTEBOOK_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_separator.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_separator.c 2001/11/09 23:41:48 1.11 +++ ewl_separator.c 2001/11/14 22:56:38 1.12 @@ -1,9 +1,15 @@ #include <Ewl.h> -static void __ewl_separator_init(Ewl_Separator * s, Ewl_Orientation o); static void __ewl_separator_realize(Ewl_Widget * w, void *ev_data, void *user_data); +/** + * ewl_separator_new - allocate a new separator widget + * @o: the orientation of the newly allocated separator widget + * + * Returns a pointer to the newly alloacted separator widget on success, NULL + * on failure. + */ Ewl_Widget * ewl_separator_new(Ewl_Orientation o) { @@ -19,8 +25,8 @@ DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE); } -static void -__ewl_separator_init(Ewl_Separator * s, Ewl_Orientation o) +void +ewl_separator_init(Ewl_Separator * s, Ewl_Orientation o) { Ewl_Widget *w; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_separator.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_separator.h 2001/10/03 07:03:51 1.9 +++ ewl_separator.h 2001/11/14 22:56:38 1.10 @@ -16,6 +16,7 @@ #define ewl_vseparator_new() ewl_separator_new(EWL_ORIENTATION_VERTICAL) Ewl_Widget *ewl_separator_new(Ewl_Orientation o); +void ewl_separator_init(Ewl_Separator * s, Ewl_Orientation o); #endif /* __EWL_SEPARATOR_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- ewl_spinner.c 2001/11/14 00:30:15 1.27 +++ ewl_spinner.c 2001/11/14 22:56:38 1.28 @@ -29,6 +29,12 @@ void __ewl_entry_delete_to_right(Ewl_Widget * w); +/** + * ewl_spinner_new - allocate a new spinner widget + * + * Returns a pointer to a newly allocated spinner widget on success, NULL on + * failure. + */ Ewl_Widget * ewl_spinner_new() { @@ -54,65 +60,113 @@ DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE); } +/** + * ewl_spinner_set_value - set the current value of a spinner widget + * @s: the spinner widget to set the current value + * @value: the value to set for the spinner @s + * + * Returns no value. Sets the current value of the spinner @s to @value. + */ void -ewl_spinner_set_value(Ewl_Widget * w, double value) +ewl_spinner_set_value(Ewl_Spinner * s, double value) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("s", s); - __ewl_spinner_set_value(w, value); + __ewl_spinner_set_value(EWL_WIDGET(s), value); DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_spinner_get_value - get the current value of a spinner widget + * @s: the spinner widget to retrieve the value + * + * Returns the current value of the spinner @s on success, -1.0 on failure. + */ double -ewl_spinner_get_value(Ewl_Widget * widget) +ewl_spinner_get_value(Ewl_Spinner * s) { - DCHECK_PARAM_PTR_RET("widget", widget, -1.00); + DCHECK_PARAM_PTR_RET("s", s, -1.00); - return __ewl_spinner_get_value(widget); + return __ewl_spinner_get_value(EWL_WIDGET(s)); } +/** + * ewl_spinner_set_digits - set the number of digits displayed by a spinner + * @s: the widget to change the number of digits displayed + * @digits: the number of digits to display for the spinner @s + * + * Returns no value. Changes the digits displayed by @s to @digits. + */ void -ewl_spinner_set_digits(Ewl_Widget * widget, int digits) +ewl_spinner_set_digits(Ewl_Spinner * s, int digits) { - DCHECK_PARAM_PTR("widget", widget); + DCHECK_PARAM_PTR("s", s); - __ewl_spinner_set_digits(widget, digits); + __ewl_spinner_set_digits(EWL_WIDGET(s), digits); } +/** + * ewl_spinner_set_min_val - set the minimum value possible for a spinner + * @s: the spinner to change the minimum possible value + * @val: the new minimum possible value for @s + * + * Returns no value. Sets the smallest value that @s can obtain to @val. + */ void -ewl_spinner_set_min_val(Ewl_Widget * widget, double val) +ewl_spinner_set_min_val(Ewl_Spinner * s, double val) { - DCHECK_PARAM_PTR("widget", widget); + DCHECK_PARAM_PTR("s", s); - __ewl_spinner_set_min_val(widget, val); + __ewl_spinner_set_min_val(EWL_WIDGET(s), val); } +/** + * ewl_spinner_set_max_val - set the maximum value possible for a spinner + * @s: the spinner to change the maximum possible value + * @val: the new maximum possible value for @s + * + * Returns no value. Sets the largest value that @s can obtain to @val. + */ void -ewl_spinner_set_max_val(Ewl_Widget * widget, double val) +ewl_spinner_set_max_val(Ewl_Spinner * s, double val) { - DCHECK_PARAM_PTR("widget", widget); + DCHECK_PARAM_PTR("s", s); - __ewl_spinner_set_max_val(widget, val); + __ewl_spinner_set_max_val(EWL_WIDGET(s), val); } +/** + * ewl_spinner_set_step - set the increment between each click of the spinner + * @s: the spinner to change increment step + * @step: the new increment between clicks of the spinner @s + * + * Returns no value. Changes the increment that @s changes by with each click + * of it's spinner buttons to @step. + */ void -ewl_spinner_set_step(Ewl_Widget * w, double step) +ewl_spinner_set_step(Ewl_Spinner * s, double step) { - Ewl_Spinner *s; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("s", s); - s = EWL_SPINNER(w); + w = EWL_WIDGET(s); s->step = step; DLEAVE_FUNCTION(DLEVEL_STABLE); } - +/** + * ewl_spinner_init - initialize a spinner to default values and callbacks + * @s: the spinner to initialize + * + * Returns no value. Sets the fields and callbacks of the spinner @s their + * default values. + */ void ewl_spinner_init(Ewl_Spinner * s) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_spinner.h 2001/11/14 00:30:16 1.12 +++ ewl_spinner.h 2001/11/14 22:56:38 1.13 @@ -20,12 +20,12 @@ #define EWL_SPINNER(spinner) ((Ewl_Spinner *) spinner) Ewl_Widget *ewl_spinner_new(); -void ewl_spinner_init(Ewl_Spinner * spinner); -void ewl_spinner_set_value(Ewl_Widget * widget, double value); -double ewl_spinner_get_value(Ewl_Widget * widget); -void ewl_spinner_set_digits(Ewl_Widget * widget, int digits); -void ewl_spinner_set_min_val(Ewl_Widget * widget, double val); -void ewl_spinner_set_max_val(Ewl_Widget * widget, double val); -void ewl_spinner_set_step(Ewl_Widget * w, double step); +void ewl_spinner_init(Ewl_Spinner * s); +void ewl_spinner_set_value(Ewl_Spinner * s, double value); +double ewl_spinner_get_value(Ewl_Spinner * s); +void ewl_spinner_set_digits(Ewl_Spinner * s, int digits); +void ewl_spinner_set_min_val(Ewl_Spinner * s, double val); +void ewl_spinner_set_max_val(Ewl_Spinner * s, double val); +void ewl_spinner_set_step(Ewl_Spinner * s, double step); #endif /* __EWL_SPINNER_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- ewl_text.c 2001/11/14 05:54:21 1.37 +++ ewl_text.c 2001/11/14 22:56:38 1.38 @@ -94,7 +94,7 @@ char *ot; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); w = EWL_WIDGET(t); @@ -136,7 +136,7 @@ Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, NULL); + DCHECK_PARAM_PTR_RET("t", t, NULL); w = EWL_WIDGET(t); @@ -154,13 +154,13 @@ void ewl_text_set_font(Ewl_Text * t, char *f) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); DCHECK_PARAM_PTR("f", f); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); IF_FREE(t->font); @@ -224,14 +224,14 @@ * Returns the font size of the text widget on success, 0 on failure. */ int -ewl_text_get_font_size(Ewl_Widget * w) +ewl_text_get_font_size(Ewl_Text * t) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, 0); + DCHECK_PARAM_PTR_RET("t", t, 0); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); DRETURN_INT(t->font_size, DLEVEL_STABLE); } @@ -248,14 +248,14 @@ * new color values specified. */ void -ewl_text_set_color(Ewl_Widget * w, int r, int g, int b, int a) +ewl_text_set_color(Ewl_Text * t, int r, int g, int b, int a) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); etox_color_set_member(t->color, "EWL", r, g, b, a); ewl_widget_configure(w); @@ -274,29 +274,37 @@ * Returns no value. Stores the color values into any non-NULL color pointers. */ void -ewl_text_get_color(Ewl_Widget * w, int *r, int *g, int *b, int *a) +ewl_text_get_color(Ewl_Text * t, int *r, int *g, int *b, int *a) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); etox_color_get_member(t->color, "EWL", r, g, b, a); DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_set_style - set the text style for a text widget + * @t: the text widget to set the text style + * @s: the name of the style to be set for the text + * + * Returns no value. Changes the text style of the text widget @t to the style + * identified by the name @s. + */ void -ewl_text_set_style(Ewl_Widget * w, char *s) +ewl_text_set_style(Ewl_Text * t, char *s) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); if (!s || (s && !strlen(s))) t->style = etox_style_new("Default"); @@ -308,16 +316,28 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_get_text_geometry - retrieve the geometry of a text widget + * @t: the text widget to retrieve geometry + * @xx: a pointer to an integer to store the x coordinate + * @yy: a pointer to an integer to store the y coordinate + * @ww: a pointer to an integer to store the width + * @hh: a pointer to an integer to store the height + * + * Returns no value. Stores the position and size of the text in the text + * widget @t into the integers pointed to by @xx, @yy, @ww, and @hh + * respectively. + */ void -ewl_text_get_text_geometry(Ewl_Widget * w, int *xx, int *yy, int *ww, int *hh) +ewl_text_get_text_geometry(Ewl_Text * t, int *xx, int *yy, int *ww, int *hh) { - Ewl_Text *t; + Ewl_Widget *w; double nxx, nyy, nww, nhh; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); etox_get_geometry(t->tox, &nxx, &nyy, &nww, &nhh); @@ -333,17 +353,29 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_get_letter_geometry - retrieve the geomtry of a specific letter + * @t: the widget that holds the text to retrieve a letters geometry + * @i: the index of the letter in the text to retrieve geometry + * @xx: a pointer to an integer to store the x coordinate of the letter + * @yy: a pointer to an integer to store the y coordinate of the letter + * @ww: a pointer to an integer to store the width of the letter + * @hh: a pointer to an integer to store the height of the letter + * + * Returns no value. Stores the geometry of the letter at index @i of the text + * widget @t into @xx, @yy, @ww, and @hh respectively. + */ void -ewl_text_get_letter_geometry(Ewl_Widget * w, int i, - int *xx, int *yy, int *ww, int *hh) +ewl_text_get_letter_geometry(Ewl_Text * t, int i, int *xx, int *yy, int *ww, + int *hh) { - Ewl_Text *t; + Ewl_Widget *w; double nxx, nyy, nww, nhh; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); etox_get_char_geometry_at(t->tox, i, &nxx, &nyy, &nww, &nhh); @@ -359,17 +391,30 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_get_letter_geometry_at - get the letter geometry at coordinates + * @t: the text widget to get the letter geometry by coordinates + * @x: the x coordinate to check for letter geometry + * @y: the y coordinate to check for letter geometry + * @tx: the x coordinate of the letter that intersects @x, @y + * @ty: the y coordinate of the letter that intersects @x, @y + * @tw: the width of the letter that intersects @x, @y + * @th: the height of the letter that intersects @x, @y + * + * Returns no value. Stores the geometry of a letter at specified coordinates + * @x, @y of text widget @t into @tx, @ty, @tw, and @th. + */ void -ewl_text_get_letter_geometry_at(Ewl_Widget * w, int x, int y, +ewl_text_get_letter_geometry_at(Ewl_Text * t, int x, int y, int *tx, int *ty, int *tw, int *th) { - Ewl_Text *t; + Ewl_Widget *w; double xx, yy, ww, hh; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); etox_get_char_geometry_at_position(t->tox, (double) x, (double) y, &xx, &yy, &ww, &hh); @@ -386,16 +431,23 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_text_set_alignment - set the alignment of the text in a text widget + * @t: the text widget to change text alignment + * @a: the new alignment for the text in @t + * + * Returns no value. Changes the alignment of the text in @t to @a. + */ void -ewl_text_set_alignment(Ewl_Widget * w, Ewl_Alignment a) +ewl_text_set_alignment(Ewl_Text * t, Ewl_Alignment a) { - Ewl_Text *t; + Ewl_Widget *w; Etox_Align_Type h_align, v_align; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("t", t); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); EWL_OBJECT(w)->alignment = a; if (!t->tox) @@ -425,23 +477,29 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } -void -ewl_text_get_index_at(Ewl_Widget * w, int x, int y, int *index) +/** + * ewl_text_get_index_at - get the index of the letter at coordinates + * @t: the text widget to find the letter index by coordinates + * @x: the x coordinate to check for the letter index + * @y: the y coordinate to check for the letter index + * + * Returns the index of the letter at the coordinates @x, @y in the text + * widget @t. + */ +int +ewl_text_get_index_at(Ewl_Text * t, int x, int y) { - Ewl_Text *t; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR_RET("t", t, 0); - t = EWL_TEXT(w); + w = EWL_WIDGET(t); - if (index) - *index = etox_get_char_geometry_at_position(t->tox, + DRETURN_INT(DLEVEL_STABLE, etox_get_char_geometry_at_position(t->tox, (double) x, (double) y, NULL, - NULL, NULL, NULL); - - DLEAVE_FUNCTION(DLEVEL_STABLE); + NULL, NULL, NULL)); } static void =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ewl_text.h 2001/11/12 19:47:59 1.16 +++ ewl_text.h 2001/11/14 22:56:38 1.17 @@ -21,22 +21,22 @@ Ewl_Widget *ewl_text_new(); -void ewl_text_set_text(Ewl_Widget * w, char *text); -char *ewl_text_get_text(Ewl_Widget * w); -void ewl_text_set_font(Ewl_Widget * w, char *font); -char *ewl_text_get_font(Ewl_Widget * w); -void ewl_text_set_font_size(Ewl_Widget * w, int size); -int ewl_text_get_font_size(Ewl_Widget * w); -void ewl_text_set_color(Ewl_Widget * w, int r, int g, int b, int a); -void ewl_text_get_color(Ewl_Widget * w, int *r, int *g, int *b, int *a); -void ewl_text_get_text_geometry(Ewl_Widget * w, int *xx, int *yy, +void ewl_text_set_text(Ewl_Text * t, char *text); +char *ewl_text_get_text(Ewl_Text * t); +void ewl_text_set_font(Ewl_Text * t, char *font); +char *ewl_text_get_font(Ewl_Text * t); +void ewl_text_set_font_size(Ewl_Text * t, int size); +int ewl_text_get_font_size(Ewl_Text * t); +void ewl_text_set_color(Ewl_Text * t, int r, int g, int b, int a); +void ewl_text_get_color(Ewl_Text * t, int *r, int *g, int *b, int *a); +void ewl_text_get_text_geometry(Ewl_Text * t, int *xx, int *yy, int *ww, int *hh); -void ewl_text_set_style(Ewl_Widget * w, char *s); -void ewl_text_get_letter_geometry(Ewl_Widget * w, int index, int *xx, +void ewl_text_set_style(Ewl_Text * t, char *s); +void ewl_text_get_letter_geometry(Ewl_Text * t, int index, int *xx, int *yy, int *ww, int *hh); -void ewl_text_get_letter_geometry_at(Ewl_Widget * w, int x, int y, +void ewl_text_get_letter_geometry_at(Ewl_Text * t, int x, int y, int *tx, int *ty, int *tw, int *th); -void ewl_text_set_alignment(Ewl_Widget * w, Ewl_Alignment a); -void ewl_text_get_index_at(Ewl_Widget * w, int x, int y, int *index); +void ewl_text_set_alignment(Ewl_Text * t, Ewl_Alignment a); +int ewl_text_get_index_at(Ewl_Text * t, int x, int y); #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_textarea.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_textarea.c 2001/11/12 19:41:00 1.1 +++ ewl_textarea.c 2001/11/14 22:56:38 1.2 @@ -23,6 +23,12 @@ void __ewl_textarea_delete_to_right(Ewl_TextArea * ta); +/** + * ewl_textarea_new - allocate a new text area widget + * + * Returns a pointer to a newly allocated text area widget on success, NULL on + * failure. + */ Ewl_Widget * ewl_textarea_new(void) { @@ -43,6 +49,14 @@ DRETURN_PTR(EWL_WIDGET(ta), DLEVEL_STABLE); } +/** + * ewl_textarea_set_text - set the text of a text area widget + * @ta: the text area widget to set the text + * @text: the text to set in the text area widget @ta + * + * Returns no value. Sets the text of the text area widget @ta to a copy of + * the contents of @text. + */ void ewl_textarea_set_text(Ewl_TextArea * ta, char *text) { @@ -50,11 +64,17 @@ DCHECK_PARAM_PTR("ta", ta); DCHECK_PARAM_PTR("text", text); - ewl_text_set_text(ta->text, text); + ewl_text_set_text(EWL_TEXT(ta->text), text); DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * ewl_textarea_get_text - retrieve the text of a text widget + * @ta: the text widget to retrieve text contents + * + * Returns a pointer to a copy of the text in @ta on success, NULL on failure. + */ char * ewl_textarea_get_text(Ewl_TextArea * ta) { @@ -63,12 +83,18 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("ta", ta, NULL); - text = ewl_text_get_text(ta->text); + text = ewl_text_get_text(EWL_TEXT(ta->text)); DRETURN_PTR(text, DLEVEL_STABLE); } - +/** + * ewl_textarea_init - initialize the fields and callbacks of a text area + * @ta: the text area to be initialized + * + * Returns no value. Sets the internal fields and callbacks of a text area to + * their defaults. + */ void ewl_textarea_init(Ewl_TextArea * ta) { @@ -228,7 +254,7 @@ l = i = strlen(str); } else - ewl_text_get_index_at(ta->text, ev->x, ev->y, &i); + i = ewl_text_get_index_at(EWL_TEXT(ta->text), ev->x, ev->y); ewl_cursor_set_position(ta->cursor, i + 1); @@ -263,15 +289,15 @@ c_pos = ewl_cursor_get_position(ta->cursor); - ewl_text_get_letter_geometry(ta->text, --c_pos, &req_x, &req_y, - &req_w, &req_h); + ewl_text_get_letter_geometry(EWL_TEXT(ta->text), --c_pos, &req_x, + &req_y, &req_w, &req_h); str = EWL_TEXT(ta->text)->text; if (str && (l = strlen(str)) && c_pos >= l) { - ewl_text_get_letter_geometry(ta->text, l - 1, &req_x, - &req_y, &req_w, &req_h); + ewl_text_get_letter_geometry(EWL_TEXT(ta->text), l - 1, + &req_x, &req_y, &req_w, &req_h); req_x += req_w + CURRENT_X(ta->text); req_y += CURRENT_Y(ta->text); req_w = 5; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- ewl_widget.c 2001/11/14 00:30:16 1.35 +++ ewl_widget.c 2001/11/14 22:56:38 1.36 @@ -179,6 +179,8 @@ ewl_callback_call(w, EWL_CALLBACK_DESTROY); + IF_FREE(w); + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -514,8 +516,6 @@ * type so we don't get a segfault. */ ewl_callback_clear(w); - - IF_FREE(w); DLEAVE_FUNCTION(DLEVEL_STABLE); } |
From: <enl...@li...> - 2001-11-15 00:27:51
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_separator.c Log Message: Compilation error and warning fixups. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_separator.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_separator.c 2001/11/14 22:56:38 1.12 +++ ewl_separator.c 2001/11/15 00:27:20 1.13 @@ -20,7 +20,7 @@ s = NEW(Ewl_Separator, 1); ZERO(s, Ewl_Separator, 1); - __ewl_separator_init(s, o); + ewl_separator_init(s, o); DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE); } |
From: <enl...@li...> - 2001-11-15 00:27:51
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/tools/ewl_config Modified Files: ewl_config.c Log Message: Compilation error and warning fixups. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/tools/ewl_config/ewl_config.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ewl_config.c 2001/11/14 00:30:16 1.16 +++ ewl_config.c 2001/11/15 00:27:20 1.17 @@ -155,8 +155,8 @@ /* Evas Page */ e_conf.page_evas_label = ewl_text_new(); - ewl_text_set_text(e_conf.page_evas_label, "Evas Settings"); - ewl_text_set_font_size(e_conf.page_evas_label, 8); + ewl_text_set_text(EWL_TEXT(e_conf.page_evas_label), "Evas Settings"); + ewl_text_set_font_size(EWL_TEXT(e_conf.page_evas_label), 8); ewl_widget_show(e_conf.page_evas_label); e_conf.page_evas = ewl_vbox_new(); @@ -165,7 +165,8 @@ ewl_widget_show(e_conf.page_evas); e_conf.render_method_label = ewl_text_new(); - ewl_text_set_text(e_conf.render_method_label, "Render Method"); + ewl_text_set_text(EWL_TEXT(e_conf.render_method_label), + "Render Method"); ewl_container_append_child(EWL_CONTAINER(e_conf.page_evas), e_conf.render_method_label); ewl_widget_show(e_conf.render_method_label); @@ -192,43 +193,46 @@ ewl_widget_show(e_conf.render_method_x11); e_conf.font_cache_label = ewl_text_new(); - ewl_text_set_text(e_conf.font_cache_label, "Font Cache (kB)"); + ewl_text_set_text(EWL_TEXT(e_conf.font_cache_label), "Font Cache (kB)"); ewl_container_append_child(EWL_CONTAINER(e_conf.page_evas), e_conf.font_cache_label); ewl_widget_show(e_conf.font_cache_label); e_conf.font_cache = ewl_spinner_new(); - ewl_spinner_set_min_val(e_conf.font_cache, (1024.0 * 0.5)); - ewl_spinner_set_max_val(e_conf.font_cache, (1024.0 * 256)); - ewl_spinner_set_digits(e_conf.font_cache, 0); - ewl_spinner_set_step(e_conf.font_cache, 1.0); + ewl_spinner_set_min_val(EWL_SPINNER(e_conf.font_cache), (1024.0 * 0.5)); + ewl_spinner_set_max_val(EWL_SPINNER(e_conf.font_cache), (1024.0 * 256)); + ewl_spinner_set_digits(EWL_SPINNER(e_conf.font_cache), 0); + ewl_spinner_set_step(EWL_SPINNER(e_conf.font_cache), 1.0); ewl_container_append_child(EWL_CONTAINER(e_conf.page_evas), e_conf.font_cache); ewl_widget_show(e_conf.font_cache); e_conf.image_cache_label = ewl_text_new(); - ewl_text_set_text(e_conf.image_cache_label, "Image Cache (kB)"); + ewl_text_set_text(EWL_TEXT(e_conf.image_cache_label), + "Image Cache (kB)"); ewl_container_append_child(EWL_CONTAINER(e_conf.page_evas), e_conf.image_cache_label); ewl_widget_show(e_conf.image_cache_label); e_conf.image_cache = ewl_spinner_new(); - ewl_spinner_set_min_val(e_conf.image_cache, (1024.0 * 0.5)); - ewl_spinner_set_max_val(e_conf.image_cache, (1024.0 * 256)); - ewl_spinner_set_digits(e_conf.image_cache, 0); - ewl_spinner_set_step(e_conf.image_cache, 1.0); + ewl_spinner_set_min_val(EWL_SPINNER(e_conf.image_cache), + (1024.0 * 0.5)); + ewl_spinner_set_max_val(EWL_SPINNER(e_conf.image_cache), + (1024.0 * 256)); + ewl_spinner_set_digits(EWL_SPINNER(e_conf.image_cache), 0); + ewl_spinner_set_step(EWL_SPINNER(e_conf.image_cache), 1.0); ewl_container_append_child(EWL_CONTAINER(e_conf.page_evas), e_conf.image_cache); ewl_widget_show(e_conf.image_cache); - ewl_notebook_append_page(e_conf.notebook, e_conf.page_evas, - e_conf.page_evas_label); + ewl_notebook_append_page(EWL_NOTEBOOK(e_conf.notebook), + e_conf.page_evas, e_conf.page_evas_label); /* Debug Page */ e_conf.page_debug_label = ewl_text_new(); - ewl_text_set_text(e_conf.page_debug_label, "Debug Settings"); - ewl_text_set_font_size(e_conf.page_debug_label, 8); + ewl_text_set_text(EWL_TEXT(e_conf.page_debug_label), "Debug Settings"); + ewl_text_set_font_size(EWL_TEXT(e_conf.page_debug_label), 8); ewl_widget_show(e_conf.page_debug_label); e_conf.page_debug = ewl_vbox_new(); @@ -242,27 +246,27 @@ ewl_widget_show(e_conf.enable_debug); e_conf.debug_level_label = ewl_text_new(); - ewl_text_set_text(e_conf.debug_level_label, "Debug Level"); + ewl_text_set_text(EWL_TEXT(e_conf.debug_level_label), "Debug Level"); ewl_container_append_child(EWL_CONTAINER(e_conf.page_debug), e_conf.debug_level_label); ewl_widget_show(e_conf.debug_level_label); e_conf.debug_level = ewl_spinner_new(); - ewl_spinner_set_min_val(e_conf.debug_level, 0.0); - ewl_spinner_set_max_val(e_conf.debug_level, 20.0); - ewl_spinner_set_digits(e_conf.debug_level, 0); - ewl_spinner_set_step(e_conf.debug_level, 1); + ewl_spinner_set_min_val(EWL_SPINNER(e_conf.debug_level), 0.0); + ewl_spinner_set_max_val(EWL_SPINNER(e_conf.debug_level), 20.0); + ewl_spinner_set_digits(EWL_SPINNER(e_conf.debug_level), 0); + ewl_spinner_set_step(EWL_SPINNER(e_conf.debug_level), 1); ewl_container_append_child(EWL_CONTAINER(e_conf.page_debug), e_conf.debug_level); ewl_widget_show(e_conf.debug_level); - ewl_notebook_append_page(e_conf.notebook, e_conf.page_debug, - e_conf.page_debug_label); + ewl_notebook_append_page(EWL_NOTEBOOK(e_conf.notebook), + e_conf.page_debug, e_conf.page_debug_label); /* FX Page */ e_conf.page_fx_label = ewl_text_new(); - ewl_text_set_text(e_conf.page_fx_label, "FX Settings"); - ewl_text_set_font_size(e_conf.page_fx_label, 8); + ewl_text_set_text(EWL_TEXT(e_conf.page_fx_label), "FX Settings"); + ewl_text_set_font_size(EWL_TEXT(e_conf.page_fx_label), 8); ewl_widget_show(e_conf.page_fx_label); e_conf.page_fx = ewl_vbox_new(); @@ -272,22 +276,23 @@ e_conf.global_label = ewl_text_new(); - ewl_text_set_text(e_conf.global_label, "Global Settings"); + ewl_text_set_text(EWL_TEXT(e_conf.global_label), "Global Settings"); ewl_container_append_child(EWL_CONTAINER(e_conf.page_fx), e_conf.global_label); ewl_widget_show(e_conf.global_label); e_conf.global_fps_label = ewl_text_new(); - ewl_text_set_text(e_conf.global_fps_label, "Frames Per Second"); + ewl_text_set_text(EWL_TEXT(e_conf.global_fps_label), + "Frames Per Second"); ewl_container_append_child(EWL_CONTAINER(e_conf.page_fx), e_conf.global_fps_label); ewl_widget_show(e_conf.global_fps_label); e_conf.global_fps = ewl_spinner_new(); - ewl_spinner_set_min_val(e_conf.global_fps, 1.0); - ewl_spinner_set_max_val(e_conf.global_fps, 80.0); - ewl_spinner_set_digits(e_conf.global_fps, 1); - ewl_spinner_set_step(e_conf.global_fps, 1.0); + ewl_spinner_set_min_val(EWL_SPINNER(e_conf.global_fps), 1.0); + ewl_spinner_set_max_val(EWL_SPINNER(e_conf.global_fps), 80.0); + ewl_spinner_set_digits(EWL_SPINNER(e_conf.global_fps), 1); + ewl_spinner_set_step(EWL_SPINNER(e_conf.global_fps), 1.0); ewl_container_append_child(EWL_CONTAINER(e_conf.page_fx), e_conf.global_fps); ewl_widget_show(e_conf.global_fps); @@ -307,7 +312,7 @@ ewl_widget_show(e_conf.fx_separator1); e_conf.plugins_label = ewl_text_new(); - ewl_text_set_text(e_conf.plugins_label, "Plugins"); + ewl_text_set_text(EWL_TEXT(e_conf.plugins_label), "Plugins"); ewl_container_append_child(EWL_CONTAINER(e_conf.page_fx), e_conf.plugins_label); ewl_widget_show(e_conf.plugins_label); @@ -339,7 +344,7 @@ } label = ewl_text_new(); - ewl_text_set_text(label, name); + ewl_text_set_text(EWL_TEXT(label), name); ewl_table_attach(EWL_TABLE(e_conf.effects_table), label, 1, 1, i, i); ewl_widget_show(label); @@ -388,13 +393,13 @@ } } - ewl_notebook_append_page(e_conf.notebook, e_conf.page_fx, + ewl_notebook_append_page(EWL_NOTEBOOK(e_conf.notebook), e_conf.page_fx, e_conf.page_fx_label); /* Theme Page */ e_conf.page_theme_label = ewl_text_new(); - ewl_text_set_text(e_conf.page_theme_label, "Theme Settings"); - ewl_text_set_font_size(e_conf.page_theme_label, 8); + ewl_text_set_text(EWL_TEXT(e_conf.page_theme_label), "Theme Settings"); + ewl_text_set_font_size(EWL_TEXT(e_conf.page_theme_label), 8); ewl_widget_show(e_conf.page_theme_label); e_conf.page_theme = ewl_vbox_new(); @@ -404,7 +409,7 @@ e_conf.theme_name_label = ewl_text_new(); - ewl_text_set_text(e_conf.theme_name_label, "Theme Name"); + ewl_text_set_text(EWL_TEXT(e_conf.theme_name_label), "Theme Name"); ewl_container_append_child(EWL_CONTAINER(e_conf.page_theme), e_conf.theme_name_label); ewl_widget_show(e_conf.theme_name_label); @@ -419,8 +424,8 @@ e_conf.theme_cache); ewl_widget_show(e_conf.theme_cache); - ewl_notebook_append_page(e_conf.notebook, e_conf.page_theme, - e_conf.page_theme_label); + ewl_notebook_append_page(EWL_NOTEBOOK(e_conf.notebook), + e_conf.page_theme, e_conf.page_theme_label); ewl_set_settings(&init_settings); @@ -501,15 +506,17 @@ else ewl_radiobutton_set_checked(e_conf.render_method_software, 1); - ewl_spinner_set_value(e_conf.font_cache, + ewl_spinner_set_value(EWL_SPINNER(e_conf.font_cache), (double) (c->evas.font_cache) / 1024.0); - ewl_spinner_set_value(e_conf.image_cache, + ewl_spinner_set_value(EWL_SPINNER(e_conf.image_cache), (double) (c->evas.image_cache) / 1024.0); ewl_checkbutton_set_checked(e_conf.enable_debug, c->debug.enable); - ewl_spinner_set_value(e_conf.debug_level, (double) (c->debug.level)); + ewl_spinner_set_value(EWL_SPINNER(e_conf.debug_level), + (double) (c->debug.level)); - ewl_spinner_set_value(e_conf.global_fps, (double) (c->fx.fps)); + ewl_spinner_set_value(EWL_SPINNER(e_conf.global_fps), + (double) (c->fx.fps)); ewl_entry_set_text(e_conf.theme_name, c->theme.name); @@ -532,9 +539,11 @@ c->evas.render_method = strdup("x11"); c->evas.font_cache = - (float) (ewl_spinner_get_value(e_conf.font_cache)) * 1024.0; + (float)(ewl_spinner_get_value(EWL_SPINNER(e_conf.font_cache))) + * 1024.0; c->evas.image_cache = - (float) (ewl_spinner_get_value(e_conf.image_cache)) * 1024.0; + (float)(ewl_spinner_get_value(EWL_SPINNER(e_conf.image_cache))) + * 1024.0; if (ewl_checkbutton_is_checked(e_conf.enable_debug)) c->debug.enable = 1; @@ -546,7 +555,7 @@ if (c->debug.enable) c->debug.level = - (int) (ewl_spinner_get_value(e_conf.debug_level)); + (int)(ewl_spinner_get_value(EWL_SPINNER(e_conf.debug_level))); c->theme.name = ewl_entry_get_text(e_conf.theme_name); @@ -554,7 +563,7 @@ c->theme.name = strdup("default"); c->theme.cache = ewl_checkbutton_is_checked(e_conf.theme_cache); - c->fx.fps = ewl_spinner_get_value(e_conf.global_fps); + c->fx.fps = ewl_spinner_get_value(EWL_SPINNER(e_conf.global_fps)); return c; } @@ -682,7 +691,7 @@ ewl_object_set_padding(EWL_OBJECT(confirm.text), 0, 0, 20, 20); ewl_object_set_alignment(EWL_OBJECT(confirm.text), EWL_ALIGNMENT_CENTER); - ewl_text_set_text(confirm.text, + ewl_text_set_text(EWL_TEXT(confirm.text), "You have made modifications, what would you " "like to do ?"); ewl_container_append_child(EWL_CONTAINER(confirm.main_vbox), |
From: <enl...@li...> - 2001-11-15 00:27:51
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/test Modified Files: ewl_image_test.c ewl_notebook_test.c ewl_spinner_test.c ewl_text_test.c Log Message: Compilation error and warning fixups. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_image_test.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_image_test.c 2001/11/04 22:06:34 1.6 +++ ewl_image_test.c 2001/11/15 00:27:20 1.7 @@ -78,7 +78,7 @@ img = ewd_dlist_goto_last(images); ewl_entry_set_text(entry_path, img); - ewl_image_set_file(image, img); + ewl_image_set_file(EWL_IMAGE(image), img); ewl_widget_configure(image_win); @@ -101,7 +101,7 @@ { ewd_dlist_append(images, img); ewd_dlist_goto_last(images); - ewl_image_set_file(image, img); + ewl_image_set_file(EWL_IMAGE(image), img); } else printf("ERROR: %s does not exist\n", img); @@ -129,7 +129,7 @@ img = ewd_dlist_goto_first(images); ewl_entry_set_text(entry_path, img); - ewl_image_set_file(image, img); + ewl_image_set_file(EWL_IMAGE(image), img); ewl_widget_configure(image_win); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_notebook_test.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_notebook_test.c 2001/11/04 22:06:34 1.7 +++ ewl_notebook_test.c 2001/11/15 00:27:20 1.8 @@ -85,8 +85,8 @@ n = NEW(Ewl_Widget, 2); tab = ewl_text_new(); - ewl_text_set_text(tab, "Main"); - ewl_text_set_font_size(tab, 8); + ewl_text_set_text(EWL_TEXT(tab), "Main"); + ewl_text_set_font_size(EWL_TEXT(tab), 8); ewl_widget_show(tab); main_vbox = ewl_vbox_new(); @@ -94,7 +94,7 @@ ewl_widget_show(main_vbox); text = ewl_text_new(); - ewl_text_set_text(text, "Main"); + ewl_text_set_text(EWL_TEXT(text), "Main"); ewl_object_set_alignment(EWL_OBJECT(text), EWL_ALIGNMENT_CENTER); ewl_container_append_child(EWL_CONTAINER(main_vbox), text); ewl_widget_show(text); @@ -106,7 +106,7 @@ ewl_widget_show(avbox); alabel = ewl_text_new(); - ewl_text_set_text(alabel, "Tabs Alignment"); + ewl_text_set_text(EWL_TEXT(alabel), "Tabs Alignment"); ewl_container_append_child(EWL_CONTAINER(avbox), alabel); ewl_widget_show(alabel); @@ -152,7 +152,7 @@ ewl_widget_show(pvbox); plabel = ewl_text_new(); - ewl_text_set_text(plabel, "Tabs Position"); + ewl_text_set_text(EWL_TEXT(plabel), "Tabs Position"); ewl_container_append_child(EWL_CONTAINER(pvbox), plabel); ewl_widget_show(plabel); @@ -206,8 +206,8 @@ n = NEW(Ewl_Widget, 2); tab = ewl_text_new(); - ewl_text_set_text(tab, label); - ewl_text_set_font_size(tab, 8); + ewl_text_set_text(EWL_TEXT(tab), label); + ewl_text_set_font_size(EWL_TEXT(tab), 8); ewl_widget_show(tab); main_vbox = ewl_vbox_new(); @@ -215,7 +215,7 @@ ewl_widget_show(main_vbox); text = ewl_text_new(); - ewl_text_set_text(text, label); + ewl_text_set_text(EWL_TEXT(text), label); ewl_object_set_alignment(EWL_OBJECT(text), EWL_ALIGNMENT_CENTER); ewl_container_append_child(EWL_CONTAINER(main_vbox), text); ewl_widget_show(text); @@ -338,7 +338,7 @@ n = __notebook_create_main_page(notebook); - ewl_notebook_prepend_page(notebook, n[0], n[1]); + ewl_notebook_prepend_page(EWL_NOTEBOOK(notebook), n[0], n[1]); } return; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_spinner_test.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_spinner_test.c 2001/11/14 00:30:16 1.6 +++ ewl_spinner_test.c 2001/11/15 00:27:20 1.7 @@ -31,10 +31,10 @@ { int xx, yy, ww, hh; - xx = (int) (ewl_spinner_get_value(spinner[0])); - yy = (int) (ewl_spinner_get_value(spinner[1])); - ww = (int) (ewl_spinner_get_value(spinner[2])); - hh = (int) (ewl_spinner_get_value(spinner[3])); + xx = (int) (ewl_spinner_get_value(EWL_SPINNER(spinner[0]))); + yy = (int) (ewl_spinner_get_value(EWL_SPINNER(spinner[1]))); + ww = (int) (ewl_spinner_get_value(EWL_SPINNER(spinner[2]))); + hh = (int) (ewl_spinner_get_value(EWL_SPINNER(spinner[3]))); ewl_callback_del(tmp_win, EWL_CALLBACK_CONFIGURE, __spinner_main_window_configure); @@ -57,7 +57,7 @@ { int xx, yy, ww, hh; - ewl_window_get_geometry(EWL_OBJECT(tmp_win), &xx, &yy, &ww, + ewl_window_get_geometry(EWL_WINDOW(tmp_win), &xx, &yy, &ww, &hh); ewl_callback_del(spinner[0], EWL_CALLBACK_VALUE_CHANGED, @@ -69,10 +69,10 @@ ewl_callback_del(spinner[3], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed); - ewl_spinner_set_value(spinner[0], (double) (xx)); - ewl_spinner_set_value(spinner[1], (double) (yy)); - ewl_spinner_set_value(spinner[2], (double) (ww)); - ewl_spinner_set_value(spinner[3], (double) (hh)); + ewl_spinner_set_value(EWL_SPINNER(spinner[0]), (double) (xx)); + ewl_spinner_set_value(EWL_SPINNER(spinner[1]), (double) (yy)); + ewl_spinner_set_value(EWL_SPINNER(spinner[2]), (double) (ww)); + ewl_spinner_set_value(EWL_SPINNER(spinner[3]), (double) (hh)); ewl_callback_append(spinner[0], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); @@ -120,16 +120,16 @@ ewl_object_get_minimum_size(EWL_OBJECT(tmp_win), &mw, &mh); text[0] = ewl_text_new(); - ewl_text_set_text(text[0], "X"); + ewl_text_set_text(EWL_TEXT(text[0]), "X"); ewl_container_append_child(EWL_CONTAINER(spinner_win), text[0]); ewl_widget_show(text[0]); spinner[0] = ewl_spinner_new(); - ewl_spinner_set_digits(spinner[0], 0); - ewl_spinner_set_min_val(spinner[0], 0); - ewl_spinner_set_max_val(spinner[0], 1280); - ewl_spinner_set_value(spinner[0], (double) (xx)); - ewl_spinner_set_step(spinner[0], 1.0); + ewl_spinner_set_digits(EWL_SPINNER(spinner[0]), 0); + ewl_spinner_set_min_val(EWL_SPINNER(spinner[0]), 0); + ewl_spinner_set_max_val(EWL_SPINNER(spinner[0]), 1280); + ewl_spinner_set_value(EWL_SPINNER(spinner[0]), (double) (xx)); + ewl_spinner_set_step(EWL_SPINNER(spinner[0]), 1.0); ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner[0]); ewl_callback_append(spinner[0], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); @@ -140,16 +140,16 @@ ewl_widget_show(separator[0]); text[1] = ewl_text_new(); - ewl_text_set_text(text[1], "Y"); + ewl_text_set_text(EWL_TEXT(text[1]), "Y"); ewl_container_append_child(EWL_CONTAINER(spinner_win), text[1]); ewl_widget_show(text[1]); spinner[1] = ewl_spinner_new(); - ewl_spinner_set_digits(spinner[1], 0); - ewl_spinner_set_min_val(spinner[1], 0); - ewl_spinner_set_max_val(spinner[1], 1024); - ewl_spinner_set_value(spinner[1], (double) (yy)); - ewl_spinner_set_step(spinner[1], 1.0); + ewl_spinner_set_digits(EWL_SPINNER(spinner[1]), 0); + ewl_spinner_set_min_val(EWL_SPINNER(spinner[1]), 0); + ewl_spinner_set_max_val(EWL_SPINNER(spinner[1]), 1024); + ewl_spinner_set_value(EWL_SPINNER(spinner[1]), (double) (yy)); + ewl_spinner_set_step(EWL_SPINNER(spinner[1]), 1.0); ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner[1]); ewl_callback_append(spinner[1], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); @@ -160,16 +160,16 @@ ewl_widget_show(separator[1]); text[2] = ewl_text_new(); - ewl_text_set_text(text[2], "W"); + ewl_text_set_text(EWL_TEXT(text[2]), "W"); ewl_container_append_child(EWL_CONTAINER(spinner_win), text[2]); ewl_widget_show(text[2]); spinner[2] = ewl_spinner_new(); - ewl_spinner_set_digits(spinner[2], 0); - ewl_spinner_set_min_val(spinner[2], (double) (mw)); - ewl_spinner_set_max_val(spinner[2], 1280); - ewl_spinner_set_value(spinner[2], (double) (ww)); - ewl_spinner_set_step(spinner[2], 1.0); + ewl_spinner_set_digits(EWL_SPINNER(spinner[2]), 0); + ewl_spinner_set_min_val(EWL_SPINNER(spinner[2]), (double) (mw)); + ewl_spinner_set_max_val(EWL_SPINNER(spinner[2]), 1280); + ewl_spinner_set_value(EWL_SPINNER(spinner[2]), (double) (ww)); + ewl_spinner_set_step(EWL_SPINNER(spinner[2]), 1.0); ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner[2]); ewl_callback_append(spinner[2], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); @@ -180,16 +180,16 @@ ewl_widget_show(separator[2]); text[3] = ewl_text_new(); - ewl_text_set_text(text[3], "H"); + ewl_text_set_text(EWL_TEXT(text[3]), "H"); ewl_container_append_child(EWL_CONTAINER(spinner_win), text[3]); ewl_widget_show(text[3]); spinner[3] = ewl_spinner_new(); - ewl_spinner_set_digits(spinner[3], 0); - ewl_spinner_set_min_val(spinner[3], (double) (mh)); - ewl_spinner_set_max_val(spinner[3], 1024); - ewl_spinner_set_value(spinner[3], (double) (hh)); - ewl_spinner_set_step(spinner[3], 1.0); + ewl_spinner_set_digits(EWL_SPINNER(spinner[3]), 0); + ewl_spinner_set_min_val(EWL_SPINNER(spinner[3]), (double) (mh)); + ewl_spinner_set_max_val(EWL_SPINNER(spinner[3]), 1024); + ewl_spinner_set_value(EWL_SPINNER(spinner[3]), (double) (hh)); + ewl_spinner_set_step(EWL_SPINNER(spinner[3]), 1.0); ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner[3]); ewl_callback_append(spinner[3], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_text_test.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_text_test.c 2001/11/04 22:06:36 1.9 +++ ewl_text_test.c 2001/11/15 00:27:20 1.10 @@ -36,7 +36,7 @@ ewl_widget_show(text_win); text = ewl_text_new(); - ewl_text_set_text(text, + ewl_text_set_text(EWL_TEXT(text), "Enlightenment Widget Library\n" "\n" "Bla bla bla bla bla bla bla bla bla\n" |
From: <enl...@li...> - 2001-11-15 22:06:19
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/test Modified Files: Makefile.am ewl_test.c ewl_textarea_test.c Added Files: ewl_floater_test.c Log Message: Widgets that float above the rest of the widgets in arbitrary positions are now available. The positioning can be set relative to other widgets or absolute within the window. Click the Ewl Floater button in ewl_test for an example of relative positioning. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/Makefile.am,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- Makefile.am 2001/11/12 19:41:00 1.17 +++ Makefile.am 2001/11/15 22:06:18 1.18 @@ -12,6 +12,7 @@ ewl_button_test.c \ ewl_entry_test.c \ ewl_image_test.c \ + ewl_floater_test.c \ ewl_notebook_test.c \ ewl_scrollbar_test.c \ ewl_scrollpane_test.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_test.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- ewl_test.c 2001/11/12 19:41:00 1.32 +++ ewl_test.c 2001/11/15 22:06:18 1.33 @@ -1,6 +1,6 @@ #include <Ewl.h> -#define BUTTONS 13 +#define BUTTONS 14 Ewl_Widget *main_win; Ewl_Widget *button[BUTTONS]; @@ -12,6 +12,9 @@ void __create_button_test_window(Ewl_Widget * w, void *ev_data, void *user_data); +void __create_floater_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); + void __create_entry_test_window(Ewl_Widget * w, void *ev_data, void *user_data); @@ -74,83 +77,104 @@ ewl_window_resize(main_win, 237, 390); ewl_window_set_min_size(main_win, 237, 390); ewl_widget_show(main_win); + + i = 0; - button[0] = ewl_button_new("Ewl_Box"); - ewl_object_set_custom_size(EWL_OBJECT(button[0]), 100, 17); - ewl_object_set_padding(EWL_OBJECT(button[0]), 0, 0, 13, 0); - ewl_container_append_child(EWL_CONTAINER(main_win), button[0]); - ewl_callback_append(button[0], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Box"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_object_set_padding(EWL_OBJECT(button[i]), 0, 0, 13, 0); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_box_test_window, NULL); + i++; - button[1] = ewl_button_new("Ewl_Button"); - ewl_object_set_custom_size(EWL_OBJECT(button[1]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[1]); - ewl_callback_append(button[1], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Button"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_button_test_window, NULL); + i++; - button[2] = ewl_button_new("Ewl_Entry"); - ewl_object_set_custom_size(EWL_OBJECT(button[2]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[2]); - ewl_callback_append(button[2], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Entry"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_entry_test_window, NULL); + i++; - button[3] = ewl_button_new("Ewl_Image"); - ewl_object_set_custom_size(EWL_OBJECT(button[3]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[3]); - ewl_callback_append(button[3], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Image"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_image_test_window, NULL); + i++; - button[4] = ewl_button_new("Ewl_List"); - ewl_object_set_custom_size(EWL_OBJECT(button[4]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[4]); - ewl_widget_disable(button[4]); - - button[5] = ewl_button_new("Ewl_Notebook"); - ewl_object_set_custom_size(EWL_OBJECT(button[5]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[5]); - ewl_callback_append(button[5], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Floater"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, + __create_floater_test_window, NULL); + i++; + + button[i] = ewl_button_new("Ewl_List"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_widget_disable(button[i]); + i++; + + button[i] = ewl_button_new("Ewl_Notebook"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_notebook_test_window, NULL); + i++; - button[6] = ewl_button_new("Ewl_Scrollbar"); - ewl_object_set_custom_size(EWL_OBJECT(button[6]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[6]); - ewl_callback_append(button[6], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Scrollbar"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_scrollbar_test_window, NULL); + i++; - button[7] = ewl_button_new("Ewl_ScrollPane"); - ewl_object_set_custom_size(EWL_OBJECT(button[7]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[7]); - ewl_callback_append(button[7], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_ScrollPane"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_scrollpane_test_window, NULL); + i++; - button[8] = ewl_button_new("Ewl_Seeker"); - ewl_object_set_custom_size(EWL_OBJECT(button[8]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[8]); - ewl_callback_append(button[8], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Seeker"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_seeker_test_window, NULL); + i++; - button[9] = ewl_button_new("Ewl_Spinner"); - ewl_object_set_custom_size(EWL_OBJECT(button[9]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[9]); - ewl_callback_append(button[9], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Spinner"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_spinner_test_window, NULL); + i++; - button[10] = ewl_button_new("Ewl_Table"); - ewl_object_set_custom_size(EWL_OBJECT(button[10]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[10]); - ewl_callback_append(button[10], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Table"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_table_test_window, NULL); + i++; - button[11] = ewl_button_new("Ewl_Text"); - ewl_object_set_custom_size(EWL_OBJECT(button[11]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[11]); - ewl_callback_append(button[11], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_Text"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_text_test_window, NULL); + i++; - button[12] = ewl_button_new("Ewl_TextArea"); - ewl_object_set_custom_size(EWL_OBJECT(button[12]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[12]); - ewl_callback_append(button[12], EWL_CALLBACK_CLICKED, + button[i] = ewl_button_new("Ewl_TextArea"); + ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); + ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_textarea_test_window, NULL); for (i = 0; i < BUTTONS; i++) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_textarea_test.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_textarea_test.c 2001/11/14 00:30:16 1.2 +++ ewl_textarea_test.c 2001/11/15 22:06:18 1.3 @@ -8,7 +8,14 @@ "as or extremely long\n" "lines. Beware, it may\n" "trigger bugs in etox or\n" - "ewl\nso\ntrace\ncarefully."; + "ewl\nso\ntrace\ncarefully. Now it's time for some " + "gibberish to make this thing longer and to test the " + "scrollbars. There's probably not enough text here\n" + "to really push etox, but hopefully it will give a " + "better idea of the speed\n" + "Right now selection of text and click to position\n" + "need quite a bit of work, as well as keyboard\n" + "navigation and focus control\n"; static Ewl_Widget *textarea_button; |
From: <enl...@li...> - 2001-11-15 22:06:50
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: Ewl.h Makefile.am ewl_events.c ewl_window.c ewl_window.h Added Files: ewl_floater.c ewl_floater.h Log Message: Widgets that float above the rest of the widgets in arbitrary positions are now available. The positioning can be set relative to other widgets or absolute within the window. Click the Ewl Floater button in ewl_test for an example of relative positioning. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Ewl.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- Ewl.h 2001/11/12 19:40:59 1.18 +++ Ewl.h 2001/11/15 22:06:18 1.19 @@ -40,6 +40,7 @@ #include <ewl_theme.h> #include <ewl_button.h> +#include <ewl_floater.h> #include <ewl_window.h> #include <ewl_text.h> #include <ewl_entry.h> =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Makefile.am,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- Makefile.am 2001/11/12 19:40:59 1.22 +++ Makefile.am 2001/11/15 22:06:18 1.23 @@ -19,6 +19,7 @@ ewl_entry.h \ ewl_enums.h \ ewl_events.h \ + ewl_floater.h \ ewl_fx.h \ ewl_image.h \ ewl_list.h \ @@ -50,6 +51,7 @@ ewl_cursor.c \ ewl_entry.c \ ewl_events.c \ + ewl_floater.c \ ewl_fx.c \ ewl_image.c \ ewl_list.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ewl_events.c 2001/11/10 23:43:48 1.22 +++ ewl_events.c 2001/11/15 22:06:18 1.23 @@ -236,7 +236,7 @@ static void ewl_ev_mouse_down(Ecore_Event * _ev) { - Ewl_Widget *widget; + Ewl_Widget *widget = NULL; Ewl_Window *window; Ecore_Event_Mouse_Down *ev; @@ -248,8 +248,7 @@ if (!window) DRETURN(DLEVEL_STABLE); - widget = ewl_container_get_child_at_recursive(EWL_CONTAINER(window), - ev->x, ev->y); + widget = ewl_window_get_child_at(window, ev->x, ev->y); /* * Determine whether this widget has already been selected, if not, @@ -348,8 +347,7 @@ if (!window) DRETURN(DLEVEL_STABLE); - widget = ewl_container_get_child_at_recursive(EWL_CONTAINER(window), - ev->x, ev->y); + widget = ewl_window_get_child_at(window, ev->x, ev->y); if (widget && !(widget->state & EWL_STATE_DISABLED)) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- ewl_window.c 2001/11/14 00:30:16 1.33 +++ ewl_window.c 2001/11/15 22:06:18 1.34 @@ -3,7 +3,6 @@ Ewd_List *ewl_window_list = NULL; -static void __ewl_window_init(Ewl_Window * w); static void __ewl_window_realize(Ewl_Widget * w, void *ev_data, void *user_data); static void __ewl_window_show(Ewl_Widget * w, void *ev_data, void *user_data); @@ -30,178 +29,11 @@ DRETURN_PTR(NULL, DLEVEL_STABLE); ZERO(w, Ewl_Window, 1); - __ewl_window_init(w); + ewl_window_init(w); DRETURN_PTR(EWL_WIDGET(w), DLEVEL_STABLE); } -static void -__ewl_window_init(Ewl_Window * w) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - /* - * Initialize the fields of the inherited container class - */ - ewl_box_init(EWL_BOX(w), EWL_ORIENTATION_VERTICAL); - ewl_widget_set_appearance(EWL_WIDGET(w), - "/appearance/window/default"); - ewl_object_set_current_size(EWL_OBJECT(w), 256, 256); - ewl_object_request_size(EWL_OBJECT(w), 256, 256); - - w->title = strdup("EWL!"); - - ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_REALIZE, - __ewl_window_realize, NULL); - ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_SHOW, - __ewl_window_show, NULL); - ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_HIDE, - __ewl_window_hide, NULL); - ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_DESTROY, - __ewl_window_destroy, NULL); - /* - * Override the default configure callbacks since the window - * has special needs for placement. - */ - ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE, - __ewl_window_configure, NULL); - - LAYER(w) = -1000; - - ewd_list_append(ewl_window_list, w); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_window_realize(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Ewl_Window *window; - char *font_path; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - window = EWL_WINDOW(w); - - window->window = ecore_window_new(0, CURRENT_X(w), CURRENT_Y(w), - CURRENT_W(w), CURRENT_H(w)); - ecore_window_set_events(window->window, XEV_CONFIGURE); - ecore_window_set_name_class(window->window, "EWL", "EWL!"); - ecore_window_set_min_size(window->window, MINIMUM_W(w), MINIMUM_H(w)); - ecore_window_set_max_size(window->window, MAXIMUM_W(w), MAXIMUM_H(w)); - ecore_window_set_title(window->window, window->title); - - ecore_window_set_delete_inform(window->window); - - font_path = ewl_theme_font_path(); - - w->evas = evas_new_all(ecore_display_get(), - window->window, 0, 0, - CURRENT_W(w), - CURRENT_H(w), - ewl_config_get_render_method(), - 216, 1024 * 1024 * 2, - 1024 * 1024 * 5, font_path); - - w->evas_window = evas_get_window(w->evas); - ecore_window_set_events(w->evas_window, XEV_KEY | XEV_BUTTON | - XEV_IN_OUT | XEV_EXPOSE | XEV_VISIBILITY | - XEV_MOUSE_MOVE | XEV_FOCUS); - - window->bg_rect = evas_add_rectangle(w->evas); - evas_set_color(w->evas, window->bg_rect, 0, 0, 0, 255); - evas_set_layer(w->evas, window->bg_rect, LAYER(w) - 1000); - evas_show(w->evas, window->bg_rect); - - if (window->borderless) - ecore_window_hint_set_borderless(window->window); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_window_show(Ewl_Widget * w, void *ev_data, void *user_data) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - if (!EWL_WINDOW(w)->window) - DRETURN(DLEVEL_STABLE); - - if (EWL_WINDOW(w)->borderless) - ecore_window_hint_set_borderless(EWL_WINDOW(w)->window); - - ecore_window_show(EWL_WINDOW(w)->window); - ecore_window_show(w->evas_window); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_window_hide(Ewl_Widget * widget, void *ev_data, void *user_data) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("widget", widget); - - ecore_window_hide(widget->evas_window); - ecore_window_hide(EWL_WINDOW(widget)->window); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_window_destroy(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Ewl_Window *win; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - win = EWL_WINDOW(w); - - IF_FREE(win->title); - - ecore_window_hide(w->evas_window); - ecore_window_hide(win->window); - - ecore_window_destroy(w->evas_window); - ecore_window_destroy(win->window); - - IF_FREE(win->title); - - if (ewd_list_goto(ewl_window_list, w)) - ewd_list_remove(ewl_window_list); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_window_configure(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Ewl_Window *win; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - win = EWL_WINDOW(w); - ewl_object_apply_requested(EWL_OBJECT(w)); - - if (win->bg_rect) - { - evas_move(w->evas, win->bg_rect, 0, 0); - evas_resize(w->evas, win->bg_rect, CURRENT_W(w), - CURRENT_H(w)); - } - - ecore_window_resize(w->evas_window, CURRENT_W(w), CURRENT_H(w)); - evas_set_output_size(w->evas, CURRENT_W(w), CURRENT_H(w)); - evas_set_output_viewport(w->evas, 0, 0, CURRENT_W(w), CURRENT_H(w)); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - /** * ewl_window_find_window - find an ewl window by it's X window * @window: the X window to search for on the list of ewl window's @@ -461,6 +293,292 @@ if (REALIZED(w)) ecore_window_move(win->window, x, y); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * ewl_window_floater_add - add a floating widget to a window + * @w: the window to add a floating widget + * @f: the floating widget to be added to the window + * + * Returns no value. Adds a floating widget @f to the list of available floating + * widgets for the window @w. + */ +void +ewl_window_floater_add(Ewl_Window *w, Ewl_Floater *f) +{ + DENTER_FUNCTION(DLEVEL_UNSTABLE); + + DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("f", f); + + if (!w->floaters) + w->floaters = ewd_list_new(); + + LAYER(f) = w->float_layer; + w->float_layer++; + + ewd_list_append(w->floaters, f); + + ewl_widget_configure(EWL_WIDGET(w)); + + DLEAVE_FUNCTION(DLEVEL_UNSTABLE); +} + +/** + * ewl_window_floater_remove - remove a floater from a window + * @w: the window that contains the floater + * @f: the floater to be removed + * + * Returns no value. Removes the floating widget from the window. + */ +void +ewl_window_floater_remove(Ewl_Window *w, Ewl_Floater *f) +{ + DENTER_FUNCTION(DLEVEL_UNSTABLE); + + DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("f", f); + + if (!w->floaters) + DRETURN(DLEVEL_UNSTABLE); + + ewd_list_goto(w->floaters, f); + ewd_list_remove(w->floaters); + + ewl_widget_configure(EWL_WIDGET(w)); + + DLEAVE_FUNCTION(DLEVEL_UNSTABLE); +} + +Ewl_Widget * +ewl_window_get_child_at(Ewl_Window *win, int x, int y) +{ + Ewl_Widget *widget = NULL; + + DENTER_FUNCTION(DLEVEL_STABLE); + + DCHECK_PARAM_PTR_RET("win", win, NULL); + + /* + * First check the window for any floaters that intersect + */ + if (win->floaters) { + Ewl_Container *f; + + ewd_list_goto_first(win->floaters); + while (!widget && (f = ewd_list_next(win->floaters))) { + widget = ewl_container_get_child_at_recursive( + EWL_CONTAINER(f), x, y); + if (widget == EWL_WIDGET(f)) + widget = NULL; + } + } + + /* + * If no floating widgets matched, then find it in the normal layout + */ + if (!widget) + widget = ewl_container_get_child_at_recursive( + EWL_CONTAINER(win), x, y); + + DRETURN_PTR(widget, DLEVEL_STABLE); +} + +/** + * ewl_window_init - initialize a window to default values and callbacks + * @w: the window to be initialized to default values and callbacks + * + * Returns no value. Sets the values and callbacks of a window @w to their + * defaults. + */ +void +ewl_window_init(Ewl_Window * w) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + /* + * Initialize the fields of the inherited container class + */ + ewl_box_init(EWL_BOX(w), EWL_ORIENTATION_VERTICAL); + ewl_widget_set_appearance(EWL_WIDGET(w), + "/appearance/window/default"); + ewl_object_set_current_size(EWL_OBJECT(w), 256, 256); + ewl_object_request_size(EWL_OBJECT(w), 256, 256); + + w->title = strdup("EWL!"); + + ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_REALIZE, + __ewl_window_realize, NULL); + ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_SHOW, + __ewl_window_show, NULL); + ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_HIDE, + __ewl_window_hide, NULL); + ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_DESTROY, + __ewl_window_destroy, NULL); + /* + * Override the default configure callbacks since the window + * has special needs for placement. + */ + ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE, + __ewl_window_configure, NULL); + + LAYER(w) = -1000; + w->float_layer = 1000; + + ewd_list_append(ewl_window_list, w); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_window_realize(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Window *window; + char *font_path; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + window = EWL_WINDOW(w); + + window->window = ecore_window_new(0, CURRENT_X(w), CURRENT_Y(w), + CURRENT_W(w), CURRENT_H(w)); + ecore_window_set_events(window->window, XEV_CONFIGURE); + ecore_window_set_name_class(window->window, "EWL", "EWL!"); + ecore_window_set_min_size(window->window, MINIMUM_W(w), MINIMUM_H(w)); + ecore_window_set_max_size(window->window, MAXIMUM_W(w), MAXIMUM_H(w)); + ecore_window_set_title(window->window, window->title); + + ecore_window_set_delete_inform(window->window); + + font_path = ewl_theme_font_path(); + + w->evas = evas_new_all(ecore_display_get(), + window->window, 0, 0, + CURRENT_W(w), + CURRENT_H(w), + ewl_config_get_render_method(), + 216, 1024 * 1024 * 2, + 1024 * 1024 * 5, font_path); + + w->evas_window = evas_get_window(w->evas); + ecore_window_set_events(w->evas_window, XEV_KEY | XEV_BUTTON | + XEV_IN_OUT | XEV_EXPOSE | XEV_VISIBILITY | + XEV_MOUSE_MOVE | XEV_FOCUS); + + window->bg_rect = evas_add_rectangle(w->evas); + evas_set_color(w->evas, window->bg_rect, 0, 0, 0, 255); + evas_set_layer(w->evas, window->bg_rect, LAYER(w) - 1000); + evas_show(w->evas, window->bg_rect); + + if (window->borderless) + ecore_window_hint_set_borderless(window->window); + + /* + * Reparent and realize floating widgets + */ + if (window->floaters) { + Ewl_Widget *f; + + ewd_list_goto_first(window->floaters); + while ((f = EWL_WIDGET(ewd_list_next(window->floaters)))) { + ewl_widget_set_parent(f, w); + if (VISIBLE(f)) + ewl_widget_realize(f); + } + } + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_window_show(Ewl_Widget * w, void *ev_data, void *user_data) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + if (!EWL_WINDOW(w)->window) + DRETURN(DLEVEL_STABLE); + + if (EWL_WINDOW(w)->borderless) + ecore_window_hint_set_borderless(EWL_WINDOW(w)->window); + + ecore_window_show(EWL_WINDOW(w)->window); + ecore_window_show(w->evas_window); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_window_hide(Ewl_Widget * widget, void *ev_data, void *user_data) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("widget", widget); + + ecore_window_hide(widget->evas_window); + ecore_window_hide(EWL_WINDOW(widget)->window); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_window_destroy(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Window *win; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + win = EWL_WINDOW(w); + + IF_FREE(win->title); + + ecore_window_hide(w->evas_window); + ecore_window_hide(win->window); + + ecore_window_destroy(w->evas_window); + ecore_window_destroy(win->window); + + IF_FREE(win->title); + + if (win->floaters) + ewd_list_for_each(win->floaters, + EWD_FOR_EACH(ewl_widget_destroy)); + + if (ewd_list_goto(ewl_window_list, w)) + ewd_list_remove(ewl_window_list); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void +__ewl_window_configure(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Window *win; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + win = EWL_WINDOW(w); + ewl_object_apply_requested(EWL_OBJECT(w)); + + if (win->bg_rect) + { + evas_move(w->evas, win->bg_rect, 0, 0); + evas_resize(w->evas, win->bg_rect, CURRENT_W(w), + CURRENT_H(w)); + } + + ecore_window_resize(w->evas_window, CURRENT_W(w), CURRENT_H(w)); + evas_set_output_size(w->evas, CURRENT_W(w), CURRENT_H(w)); + evas_set_output_viewport(w->evas, 0, 0, CURRENT_W(w), CURRENT_H(w)); + + if (win->floaters) + ewd_list_for_each(win->floaters, + EWD_FOR_EACH(ewl_widget_configure)); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_window.h 2001/11/14 00:30:16 1.12 +++ ewl_window.h 2001/11/15 22:06:18 1.13 @@ -16,11 +16,15 @@ Ebits_Object *ebits_object; char *title; int borderless; + + int float_layer; + Ewd_List *floaters; }; #define EWL_WINDOW(widget) ((Ewl_Window *) widget) Ewl_Widget *ewl_window_new(); +void ewl_window_init(Ewl_Window * w); Ewl_Window *ewl_window_find_window(Window window); Ewl_Window *ewl_window_find_window_by_evas_window(Window window); void ewl_window_resize(Ewl_Widget * widget, int w, int h); @@ -33,5 +37,8 @@ void ewl_window_set_geometry(Ewl_Widget * widget, int x, int y, int w, int h); void ewl_window_set_borderless(Ewl_Widget * w); void ewl_window_move(Ewl_Widget * w, int x, int y); +Ewl_Widget * ewl_window_get_child_at(Ewl_Window *win, int x, int y); +void ewl_window_floater_add(Ewl_Window *w, Ewl_Floater *f); +void ewl_window_floater_remove(Ewl_Window *w, Ewl_Floater *f); #endif /* __EWL_WINDOW_H__ */ |
From: <enl...@li...> - 2001-11-15 22:41:12
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_window.c Log Message: Now floating widgets receive events as they should, highest floating widget that intersects the event receives it. Had it backwards before. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- ewl_window.c 2001/11/15 22:06:18 1.34 +++ ewl_window.c 2001/11/15 22:41:11 1.35 @@ -319,7 +319,7 @@ LAYER(f) = w->float_layer; w->float_layer++; - ewd_list_append(w->floaters, f); + ewd_list_prepend(w->floaters, f); ewl_widget_configure(EWL_WIDGET(w)); |
From: <enl...@li...> - 2002-01-04 18:41:26
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_callback.c ewl_callback.h ewl_fx.c ewl_misc.c ewl_widget.c Log Message: A few bug fixes and an update to use the new ewd path groups. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_callback.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- ewl_callback.c 2001/11/12 00:23:52 1.25 +++ ewl_callback.c 2002/01/04 18:41:25 1.26 @@ -1,8 +1,88 @@ #include <Ewl.h> +static unsigned int __ewl_callback_hash(void *key); +static int __ewl_callback_compare(void *key1, void *key2); +static Ewl_Callback * __ewl_callback_register(Ewl_Callback *cb); +static void __ewl_callback_unregister(Ewl_Callback *cb); + static int callback_id = 0; +static Ewd_Hash *cb_registration = NULL; /** + * ewl_callbacks_init - setup internal registration variables for callbacks + * + * Returns no value. Sets up some important variables for tracking callbacks + * that allow shared callbacks. + * + * W/o shared callbacks ewl_test with all windows open has a top line of: + * 21279 ningerso 19 0 22972 22M 9412 R 6.0 8.0 0:40 ewl_test + * With shared callbacks ewl_test with all windows open has a top line of: + * 15901 ningerso 10 0 20120 19M 9148 S 0.0 7.0 0:34 ewl_test + * + * So using shared callbacks saves us over 2 MB of memory in this case. + */ +void ewl_callbacks_init() +{ + cb_registration = ewd_hash_new(__ewl_callback_hash, + __ewl_callback_compare); +} + +/* + * __ewl_callback_register - register a callback to check for duplicates + * @cb: the callback to register + * + * Returns a pointer to the callback that should be used instead of the passed + * @cb on success, NULL on failure. The returned callback may in fact be @cb, + * but this can not be counted on. The callback @cb will be freed if this is + * not the case. + */ +static Ewl_Callback * +__ewl_callback_register(Ewl_Callback *cb) +{ + Ewl_Callback *found; + + DENTER_FUNCTION(DLEVEL_STABLE); + + DCHECK_PARAM_PTR_RET("cb", cb, NULL); + + found = ewd_hash_get(cb_registration, cb); + if (!found) { + cb->id = ++callback_id; + ewd_hash_set(cb_registration, cb, cb); + found = cb; + } + else + FREE(cb); + + found->references++; + + DRETURN_PTR(found, DLEVEL_STABLE); +} + +/* + * __ewl_callback_unregister - unreference a callback and free if appropriate + * @cb: the callback to unregister + * + * Returns no value. Checks to see if @cb has nay remaining references, if not + * it is removed from the registration system and freed. + */ +static void +__ewl_callback_unregister(Ewl_Callback *cb) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + + DCHECK_PARAM_PTR("cb", cb); + + cb->references--; + if (cb->references < 1) { + ewd_hash_remove(cb_registration, cb); + FREE(cb); + } + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** * ewl_callback_append - append a callback of the specified type * @w: the widget to attach the callback * @t: the type of the callback that is being attached @@ -31,15 +111,14 @@ ZERO(cb, Ewl_Callback, 1); cb->func = f; cb->user_data = user_data; - cb->type = t; + + cb = __ewl_callback_register(cb); if (!w->callbacks[t]) w->callbacks[t] = ewd_list_new(); ewd_list_append(w->callbacks[t], cb); - cb->id = ++callback_id; - DRETURN_INT(cb->id, DLEVEL_STABLE); } @@ -71,15 +150,14 @@ ZERO(cb, Ewl_Callback, 1); cb->func = f; cb->user_data = user_data; - cb->type = t; + cb = __ewl_callback_register(cb); + if (!w->callbacks[t]) w->callbacks[t] = ewd_list_new(); ewd_list_prepend(w->callbacks[t], cb); - cb->id = ++callback_id; - DRETURN_INT(cb->id, DLEVEL_STABLE); } @@ -146,41 +224,6 @@ } /** - * ewl_callback_set_user_data - set the user data for the specified callback - * @w: the widget to search for the callback - * @type: the type of the callback to be changed - * @func: the function whose callback data will be changed - * @user_data: the new data to pass into the callback - * - * Returns no value. Change the user data for the specified callback to - * @user_data. - */ -void -ewl_callback_set_user_data(Ewl_Widget * w, Ewl_Callback_Type type, - Ewl_Callback_Function func, void *user_data) -{ - Ewl_Callback *cb; - - DENTER_FUNCTION(DLEVEL_STABLE); - - if (!w->callbacks[type] || ewd_list_is_empty(w->callbacks[type])) - DRETURN(DLEVEL_STABLE); - - ewd_list_goto_first(w->callbacks[type]); - - while (w && (cb = ewd_list_next(w->callbacks[type])) != NULL) - { - if (cb->func == func) - { - cb->user_data = user_data; - break; - } - } - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -/** * ewl_callback_del_type - delete all callbacks of the specified type * @w: the widget to delete the callbacks * @t: the type of the callbacks to be deleted @@ -190,13 +233,17 @@ void ewl_callback_del_type(Ewl_Widget * w, Ewl_Callback_Type t) { + Ewl_Callback *rm; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); if (!w->callbacks[t]) DRETURN(DLEVEL_STABLE); + + while ((rm = ewd_list_remove_first(w->callbacks[t]))) + __ewl_callback_unregister(rm); - ewd_list_clear(w->callbacks[t]); ewd_list_destroy(w->callbacks[t]); w->callbacks[t] = NULL; @@ -284,15 +331,52 @@ while ((cb = ewd_list_current(w->callbacks[t])) != NULL) { - if (cb->func == f) - { - ewd_list_remove(w->callbacks[t]); - break; - } - ewd_list_next(w->callbacks[t]); - } + if (cb->func == f) + { + ewd_list_remove(w->callbacks[t]); + break; + } - IF_FREE(cb); + __ewl_callback_unregister(cb); + ewd_list_next(w->callbacks[t]); + } DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/* + * Hashes the value of a callback based on it's type, function, and user data. + */ +static unsigned int +__ewl_callback_hash(void *key) +{ + Ewl_Callback *cb = EWL_CALLBACK(key); + + DENTER_FUNCTION(DLEVEL_STABLE); + + DCHECK_PARAM_PTR_RET("key", key, 0); + + DRETURN_INT((unsigned int)(cb->func) ^ + (unsigned int)(cb->user_data), DLEVEL_STABLE); +} + +/* + * Simple comparison of callbacks, always returns -1 unless there is an exact + * match, in which case it returns 0. + */ +static int +__ewl_callback_compare(void *key1, void *key2) +{ + Ewl_Callback *cb1 = EWL_CALLBACK(key1); + Ewl_Callback *cb2 = EWL_CALLBACK(key2); + + DENTER_FUNCTION(DLEVEL_STABLE); + + DCHECK_PARAM_PTR_RET("key1", key1, -1) + DCHECK_PARAM_PTR_RET("key2", key2, -1) + + if (cb1->func == cb2->func && cb1->user_data == cb2->user_data) + DRETURN_INT(0, DLEVEL_STABLE); + + DRETURN_INT(-1, DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_callback.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ewl_callback.h 2001/11/12 00:23:52 1.18 +++ ewl_callback.h 2002/01/04 18:41:25 1.19 @@ -11,12 +11,13 @@ void *user_data); struct _ewl_callback { - Ewl_Callback_Type type; Ewl_Callback_Function func; void *user_data; + int references; int id; }; +void ewl_callbacks_init(); int ewl_callback_append(Ewl_Widget * widget, Ewl_Callback_Type type, Ewl_Callback_Function func, void *user_data); int ewl_callback_prepend(Ewl_Widget * widget, Ewl_Callback_Type type, @@ -26,8 +27,6 @@ void ewl_callback_call_with_event_data(Ewl_Widget * widget, Ewl_Callback_Type type, void *event_data); -void ewl_callback_set_user_data(Ewl_Widget * w, Ewl_Callback_Type type, - Ewl_Callback_Function func, void *user_data); void ewl_callback_del_type(Ewl_Widget * w, Ewl_Callback_Type t); void ewl_callback_del(Ewl_Widget * w, Ewl_Callback_Type t, Ewl_Callback_Function f); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ewl_fx.c 2001/11/14 22:56:38 1.22 +++ ewl_fx.c 2002/01/04 18:41:25 1.23 @@ -32,7 +32,7 @@ fx_protos = ewd_hash_new(ewd_str_hash, ewd_str_compare); fx_timers = ewd_hash_new(ewd_str_hash, ewd_str_compare); - fx_group_id = ewd_plugin_group_new("fx"); + fx_group_id = ewd_path_group_new("fx"); count = ewl_config_get_int("system", "/fx/paths/count"); @@ -48,7 +48,7 @@ path = ewl_config_get_str("system", key); - ewd_plugin_path_add(fx_group_id, path); + ewd_path_group_add(fx_group_id, path); } } @@ -66,7 +66,7 @@ { DENTER_FUNCTION(DLEVEL_STABLE); - ewd_plugin_group_del(fx_group_id); + ewd_path_group_del(fx_group_id); DRETURN_INT(TRUE, DLEVEL_STABLE); } @@ -657,7 +657,7 @@ DENTER_FUNCTION(DLEVEL_STABLE); - avail = ewd_plugin_get_available(fx_group_id); + avail = ewd_path_group_available(fx_group_id); DRETURN_PTR(avail, DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ewl_misc.c 2001/11/14 05:54:20 1.22 +++ ewl_misc.c 2002/01/04 18:41:25 1.23 @@ -52,6 +52,8 @@ exit(-1); } + ewl_callbacks_init(); + if (!ewl_fx_init()) { DERROR("Could not init fx data. Exiting...."); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- ewl_widget.c 2001/11/14 22:56:38 1.36 +++ ewl_widget.c 2002/01/04 18:41:25 1.37 @@ -179,6 +179,8 @@ ewl_callback_call(w, EWL_CALLBACK_DESTROY); + ewl_callback_del_type(w, EWL_CALLBACK_DESTROY); + IF_FREE(w); DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -476,6 +478,8 @@ void __ewl_widget_destroy(Ewl_Widget * w, void *ev_data, void *data) { + Ewd_List *destroy_cbs; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -515,7 +519,10 @@ * the remaining callbacks. This preserves the list of the destroy * type so we don't get a segfault. */ + destroy_cbs = w->callbacks[EWL_CALLBACK_DESTROY]; + w->callbacks[EWL_CALLBACK_DESTROY] = NULL; ewl_callback_clear(w); + w->callbacks[EWL_CALLBACK_DESTROY] = destroy_cbs; DLEAVE_FUNCTION(DLEVEL_STABLE); } |
From: <enl...@li...> - 2002-01-29 04:39:37
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_floater.c Log Message: A few bug fixes for the ewl_floaters. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_floater.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_floater.c 2001/11/15 22:06:18 1.1 +++ ewl_floater.c 2002/01/29 04:39:36 1.2 @@ -53,9 +53,17 @@ w = EWL_WIDGET(f); + /* + * Initialize the inherited box fields, set the fill policy to + * normal, and the widget to follow. + */ ewl_box_init(EWL_BOX(w), EWL_ORIENTATION_VERTICAL); ewl_object_set_fill_policy (EWL_OBJECT(w), EWL_FILL_POLICY_NORMAL); + f->follows = parent; + /* + * Setup the basic callbacks for special events. + */ ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, __ewl_floater_configure, NULL); ewl_callback_prepend(w, EWL_CALLBACK_REALIZE, __ewl_floater_realize, @@ -63,12 +71,6 @@ ewl_callback_append(w, EWL_CALLBACK_DESTROY, __ewl_floater_destroy, NULL); - if (parent) { - f->follows = parent; - f->x = CURRENT_X(w) = REQUEST_X(parent); - f->y = CURRENT_Y(w) = REQUEST_Y(parent); - } - DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -87,14 +89,12 @@ DCHECK_PARAM_PTR("f", f); - if (f->follows) { - f->x = x + REQUEST_X(f->follows); - f->y = y + REQUEST_Y(f->follows); - } - else { - f->x = x; - f->y = y; - } + /* + * Set the coordinates of the floater, this will be used for either + * absolute or relative positioning. + */ + f->x = x; + f->y = y; ewl_widget_configure(EWL_WIDGET(f)); @@ -116,31 +116,90 @@ DCHECK_PARAM_PTR("f", f); + /* + * Remove the callback attached to the configure event for the + * followed widget. + */ + if (f->follows) + ewl_callback_del(f->follows, EWL_CALLBACK_CONFIGURE, + __ewl_floater_configure); + + /* + * Set the widget that the floater follows. + */ f->follows = w; + /* + * Now attach a callback to the configure event for the followed + * widget. + */ + if (f->follows) + ewl_callback_append(f->follows, EWL_CALLBACK_CONFIGURE, + __ewl_floater_configure, NULL); + ewl_widget_configure(EWL_WIDGET(f)); DLEAVE_FUNCTION(DLEVEL_UNSTABLE); } +/* + * Configure the floater so that the positioning is relative to a followed + * widget if appropriate. + */ void __ewl_floater_configure(Ewl_Widget * w, void * ev_data, void * user_data) { + int align, x, y; Ewl_Floater * f; DENTER_FUNCTION(DLEVEL_STABLE); f = EWL_FLOATER(w); + /* + * Determine actual coordinates based on absolute or relative + * positioning. + */ if (f->follows) { - REQUEST_X(f) = REQUEST_X(f->follows) + f->x; - REQUEST_Y(f) = REQUEST_Y(f->follows) + f->y; + x = REQUEST_X(f->follows) + f->x; + y = REQUEST_Y(f->follows) + f->y; } else { - REQUEST_X(f) = f->x; - REQUEST_Y(f) = f->y; + x = f->x; + y = f->y; + } + + /* + * Store the alignment in a temporary variable for fast access to + * determine positioning. + */ + align = ewl_object_get_alignment(EWL_OBJECT(w)); + + /* + * Determine the horizontal placement of the widget based on alignment + */ + if (align & EWL_ALIGNMENT_RIGHT) { + x -= REQUEST_W(w); + } + else if (!(align & EWL_ALIGNMENT_LEFT)) { + x -= REQUEST_W(w) / 2; } + /* + * Determine the vertical placement of the widget based on alignment + */ + if (align & EWL_ALIGNMENT_BOTTOM) { + y -= REQUEST_H(w); + } + else if (!(align & EWL_ALIGNMENT_TOP)) { + y -= REQUEST_H(w) / 2; + } + + /* + * Now request the calculated coordinates for the floater. + */ + ewl_object_request_position(EWL_OBJECT(w), x, y); + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -152,7 +211,7 @@ { w->evas = w->parent->evas; w->evas_window = w->parent->evas_window; - evas_set_color(w->evas, w->fx_clip_box, 255, 0, 0, 255); + /* evas_set_color(w->evas, w->fx_clip_box, 255, 0, 0, 255); */ } /* |
From: <enl...@li...> - 2002-04-16 19:32:27
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/test Added Files: ewl_fileselector_test.c ewl_imenu_test.c ewl_selectionbook_test.c Log Message: Added a couple missing test files... |
From: <enl...@li...> - 2002-04-16 19:37:18
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/data/themes/default Modified Files: theme.db Log Message: Updated default theme database. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/data/themes/default/theme.db,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 Binary files /tmp/cvsb0viuE and /tmp/cvssoLgq8 differ |
From: <enl...@li...> - 2002-04-16 19:37:18
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl Modified Files: ChangeLog AUTHORS Log Message: Updated changelog to reflect this commit, credited ymer for his contributions. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/ChangeLog,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- ChangeLog 24 Mar 2002 13:29:57 -0000 1.46 +++ ChangeLog 16 Apr 2002 18:30:24 -0000 1.47 @@ -1,3 +1,17 @@ +Thu Apr 11 09:38:57 2001 Nathan Ingersoll <ningerso@d.umn.edu> + + Added a preferred size field to objects, and removed the requested + size field. Originally the requested size would be the preferred + size, but that detail got lost along the way. + * Documented large sections of code. + + Added add, and resize notifiers to the containers, the resize + notifier is called when a child's preferred size changes. + + Expanded the possible fill policies and implemented them within the + object sizing functions. + + ymer started a widget called selectionbook that is essentially a + prettier notebook. + + Worked with ymer to develop an internal menu, this may eventually be + the basis for global menus. + Mon Nov 12 20:28:57 2001 Christopher Rosendahl <cro...@tr...> * Added a Ewl_ScrollBar_Flags enum. * Wrote a Ewl_TextArea widget. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/AUTHORS,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- AUTHORS 24 Mar 2002 13:29:57 -0000 1.3 +++ AUTHORS 16 Apr 2002 18:30:24 -0000 1.4 @@ -1,3 +1,6 @@ Main Authors: Christopher 'smugg' Rosendahl <cro...@tr...> Nathan 'RbdPngn' Ingersoll <ningerso@d.umn.edu> + +Significant Contributors: + Espen 'ymer' Nilsen <nil...@pl...> |
From: <enl...@li...> - 2002-04-16 19:37:35
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: Ewl.h Makefile.am ewl_box.c ewl_box.h ewl_button.c ewl_button.h ewl_callback.c ewl_callback.h ewl_checkbutton.c ewl_checkbutton.h ewl_config.c ewl_config.h ewl_container.c ewl_container.h ewl_cursor.c ewl_cursor.h ewl_debug.h ewl_entry.c ewl_entry.h ewl_enums.h ewl_events.c ewl_events.h ewl_floater.c ewl_floater.h ewl_fx.c ewl_fx.h ewl_image.c ewl_image.h ewl_list.c ewl_list.h ewl_misc.c ewl_misc.h ewl_notebook.c ewl_notebook.h ewl_object.c ewl_object.h ewl_radiobutton.c ewl_radiobutton.h ewl_scrollbar.c ewl_scrollbar.h ewl_scrollpane.c ewl_scrollpane.h ewl_seeker.c ewl_seeker.h ewl_selection.c ewl_selection.h ewl_separator.c ewl_separator.h ewl_spinner.c ewl_spinner.h ewl_table.c ewl_table.h ewl_text.c ewl_text.h ewl_textarea.c ewl_textarea.h ewl_theme.c ewl_theme.h ewl_widget.c ewl_widget.h ewl_window.c ewl_window.h getopt.c getopt.h getopt1.c Added Files: ewl_fileselector.c ewl_fileselector.h ewl_grid.c ewl_grid.h ewl_imenu.c ewl_imenu.h ewl_selectionbar.c ewl_selectionbar.h ewl_selectionbook.c ewl_selectionbook.h Log Message: Massive reworking of the code. Most of this works, but a few things are not yet debugged, including but not limited too: ewl_imenu, ewl_selectionbar, ewl_selectionbook, ewl_grid, and ewl_table. They all work to some degree, but have issues that need to be worked out. I don't recommend updating from this today, as I need to make sure I added all of the correct files, and still have to commit updated test files. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Ewl.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- Ewl.h 15 Nov 2001 22:06:18 -0000 1.19 +++ Ewl.h 16 Apr 2002 18:22:56 -0000 1.20 @@ -1,6 +1,10 @@ #ifndef _EWL_H #define _EWL_H +#ifdef __cplusplus +extern "C" { +#endif + #include <Ebits.h> #include <Ecore.h> #include <Edb.h> @@ -34,12 +38,14 @@ #include <ewl_misc.h> #include <ewl_box.h> +#include <ewl_grid.h> #include <ewl_table.h> #include <ewl_config.h> #include <ewl_theme.h> #include <ewl_button.h> +#include <ewl_fileselector.h> #include <ewl_floater.h> #include <ewl_window.h> #include <ewl_text.h> @@ -52,6 +58,7 @@ #include <ewl_spinner.h> #include <ewl_list.h> #include <ewl_image.h> +#include <ewl_imenu.h> #include <ewl_checkbutton.h> #include <ewl_radiobutton.h> #include <ewl_cursor.h> @@ -60,5 +67,10 @@ #include <ewl_notebook.h> #include <ewl_scrollpane.h> #include <ewl_textarea.h> +#include <ewl_selectionbar.h> +#include <ewl_selectionbook.h> +#ifdef __cplusplus +} +#endif #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Makefile.am,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- Makefile.am 15 Nov 2001 22:06:18 -0000 1.23 +++ Makefile.am 16 Apr 2002 18:22:56 -0000 1.24 @@ -19,10 +19,12 @@ ewl_entry.h \ ewl_enums.h \ ewl_events.h \ + ewl_fileselector.h \ ewl_floater.h \ ewl_fx.h \ + ewl_grid.h \ ewl_image.h \ - ewl_list.h \ + ewl_imenu.h \ ewl_macros.h \ ewl_misc.h \ ewl_notebook.h \ @@ -32,6 +34,8 @@ ewl_scrollpane.h \ ewl_seeker.h \ ewl_selection.h \ + ewl_selectionbar.h \ + ewl_selectionbook.h \ ewl_separator.h \ ewl_spinner.h \ ewl_text.h \ @@ -51,10 +55,12 @@ ewl_cursor.c \ ewl_entry.c \ ewl_events.c \ + ewl_fileselector.c \ ewl_floater.c \ ewl_fx.c \ + ewl_grid.c \ ewl_image.c \ - ewl_list.c \ + ewl_imenu.c \ ewl_misc.c \ ewl_notebook.c \ ewl_object.c \ @@ -63,6 +69,8 @@ ewl_scrollpane.c \ ewl_seeker.c \ ewl_selection.c \ + ewl_selectionbar.c \ + ewl_selectionbook.c \ ewl_separator.c \ ewl_spinner.c \ ewl_table.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_box.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- ewl_box.c 9 Nov 2001 23:41:48 -0000 1.35 +++ ewl_box.c 16 Apr 2002 18:22:56 -0000 1.36 @@ -1,19 +1,72 @@ #include <Ewl.h> +#define DO_FILL(o, f) (ewl_object_get_fill_policy(o) & f) -void __ewl_box_configure(Ewl_Widget * w, void *ev_data, void *user_data); -static void __ewl_hbox_configure_children(Ewl_Widget * w); -static Ewd_List *__ewl_hbox_configure_normal(Ewl_Widget * w, int *rh); -static void __ewl_hbox_configure_fillers(Ewl_Widget * w, Ewd_List * f, - int rh); -static void __ewl_hbox_layout_children(Ewl_Widget * w); - -static void __ewl_vbox_configure_children(Ewl_Widget * w); -static Ewd_List *__ewl_vbox_configure_normal(Ewl_Widget * w, int *rw); -static void __ewl_vbox_configure_fillers(Ewl_Widget * w, Ewd_List * f, - int rw); -static void __ewl_vbox_layout_children(Ewl_Widget * w); +typedef struct { + + /* + * These keep track of the alignments that determine which list a + * child falls on. + */ + int f1_align, f3_align; + int a1_align, a3_align; + + /* + * This is an indicator for filling in the proper directions. + */ + int f_policy; + + /* + * Function pointers for getting the dimension of the widget that we + * care about. + */ + int (*pref_fill_ask) (Ewl_Object * ob); + void (*pref_fill_set) (Ewl_Object * ob, int size); + int (*fill_ask) (Ewl_Object * ob); + int (*fill_pad1) (Ewl_Object * ob); + int (*fill_pad2) (Ewl_Object * ob); + void (*fill_set) (Ewl_Object * ob, int size); + + int (*pref_align_ask) (Ewl_Object * ob); + void (*pref_align_set) (Ewl_Object * ob, int size); + int (*align_ask) (Ewl_Object * ob); + int (*align_pad1) (Ewl_Object * ob); + int (*align_pad2) (Ewl_Object * ob); + void (*align_set) (Ewl_Object * ob, int size); + +} Box_Orientation; + +/* + * The information for the two different orientations + */ +Box_Orientation *vertical = NULL, *horizontal = NULL; + +/* + * And a pointer to the currently used orientation + */ +Box_Orientation *info = NULL; + +/* + * These lists are used to sort children when configured. + */ +static Ewd_List *spread = NULL; + +void __ewl_box_setup(); +void __ewl_box_add(Ewl_Container * c, Ewl_Widget * w); +void __ewl_box_child_resize(Ewl_Container * c, Ewl_Widget * w, + int size, Ewl_Orientation o); +void __ewl_box_configure(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_box_configure_calc(Ewl_Box * b, int *fill_size, + int *align_size); +void __ewl_box_configure_fill(Ewl_Box * b, int *fill_size, + int *align_size); +void __ewl_box_configure_layout(Ewl_Box * b, int *x, int *y, + int *fill, int *align, + int *align_size); +void __ewl_box_configure_child(Ewl_Box * b, Ewl_Object * c, int *x, + int *y, int *align, int *align_size); /** * ewl_box_new - allocate and initialize a new box with given orientation @@ -21,10 +74,10 @@ * * Returns NULL on failure, or a newly allocated box on success. */ -Ewl_Widget * +Ewl_Widget * ewl_box_new(Ewl_Orientation o) { - Ewl_Box *b; + Ewl_Box *b; DENTER_FUNCTION(DLEVEL_STABLE); @@ -49,7 +102,7 @@ void ewl_box_init(Ewl_Box * b, Ewl_Orientation o) { - Ewl_Widget *w; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("b", b); @@ -57,24 +110,38 @@ w = EWL_WIDGET(b); /* + * Create the temporary layout lists now that they are needed. + */ + if (!spread) + spread = ewd_list_new(); + + /* * Initialize the container portion of the box */ if (o == EWL_ORIENTATION_VERTICAL) ewl_container_init(EWL_CONTAINER(b), - "/appearance/box/vertical"); + "/appearance/box/vertical", + __ewl_box_add, __ewl_box_child_resize); else ewl_container_init(EWL_CONTAINER(b), - "/appearance/box/horizontal"); - - ewl_object_set_fill_policy(EWL_OBJECT(b), EWL_FILL_POLICY_FILL); + "/appearance/box/horizontal", + __ewl_box_add, __ewl_box_child_resize); ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, __ewl_box_configure, NULL); /* + * Check if the info structs have been created yet, if not create + * them. + */ + if (!vertical) + __ewl_box_setup(); + + /* * Set the box's appropriate orientation */ - b->orientation = o; + b->orientation = 0xdeadbeef; + ewl_box_set_orientation(b, o); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -90,7 +157,7 @@ void ewl_box_set_orientation(Ewl_Box * b, Ewl_Orientation o) { - Ewl_Widget *w; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("b", b); @@ -105,6 +172,10 @@ DRETURN(DLEVEL_STABLE); b->orientation = o; + + /* + * Change the appearance based on orientation + */ if (b->orientation == EWL_ORIENTATION_VERTICAL) ewl_widget_set_appearance(w, "/appearance/box/vertical"); else @@ -126,7 +197,7 @@ void ewl_box_set_spacing(Ewl_Box * b, int s) { - Ewl_Widget *w; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("b", b); @@ -143,439 +214,576 @@ void __ewl_box_configure(Ewl_Widget * w, void *ev_data, void *user_data) { - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - if (EWL_BOX(w)->orientation == EWL_ORIENTATION_VERTICAL) - __ewl_vbox_configure_children(w); - else - __ewl_hbox_configure_children(w); + Ewl_Box *b; - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -__ewl_vbox_configure_children(Ewl_Widget * w) -{ - Ewd_List *f; - int rh; + int total_fill = 0; + int x, y, width, height; + int *fill, *align, *fill_size, *align_size; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); - f = __ewl_vbox_configure_normal(w, &rh); - - if (f) - __ewl_vbox_configure_fillers(w, f, rh); - - __ewl_vbox_layout_children(w); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static Ewd_List * -__ewl_vbox_configure_normal(Ewl_Widget * w, int *rh) -{ - Ewd_List *f = NULL; - Ewl_Box *box; - Ewl_Widget *c; - int ll = 0, rr = 0, tt = 0, bb = 0; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, NULL); - - box = EWL_BOX(w); - - if (w->ebits_object) - ebits_get_insets(w->ebits_object, &ll, &rr, &tt, &bb); - - *rh = REQUEST_H(w) - tt - bb; + b = EWL_BOX(w); - ewd_list_goto_first(EWL_CONTAINER(w)->children); + /* + * Catch the easy case, and return. + */ + if (ewd_list_is_empty(EWL_CONTAINER(w)->children)) + DRETURN(DLEVEL_STABLE); - while ((c = ewd_list_next(EWL_CONTAINER(w)->children)) != NULL) - { - if (EWL_OBJECT(c)->fill_policy & EWL_FILL_POLICY_FILL) - { - if (!f) - f = ewd_list_new(); + /* + * Get the starting values for the dimensions of the box. + */ + x = CURRENT_X(w) + INSET_LEFT(w); + y = CURRENT_Y(w) + INSET_TOP(w); + width = CURRENT_W(w) - (INSET_LEFT(w) + INSET_RIGHT(w)); + height = CURRENT_H(w) - (INSET_TOP(w) + INSET_BOTTOM(w)); - ewd_list_append(f, c); + /* + * These variables avoid large nested if's to handle different + * orientations. + */ + if (b->orientation == EWL_ORIENTATION_HORIZONTAL) { + fill = &x; + fill_size = &width; + align = &y; + align_size = &height; + info = horizontal; + } else { + fill = &y; + fill_size = &height; + align = &x; + align_size = &width; + info = vertical; + } - continue; - } + /* + * Save the starting fill size. + */ + total_fill = *fill_size; - if (MAXIMUM_W(c) && MAXIMUM_W(c) < CURRENT_W(c)) - REQUEST_W(c) = MAXIMUM_W(c); - else if (MINIMUM_W(c) && MINIMUM_W(c) > CURRENT_W(c)) - REQUEST_W(c) = MINIMUM_W(c); - else - REQUEST_W(c) = CURRENT_W(c); + /* + * Split the children up for configuration based on alignment. + */ + __ewl_box_configure_calc(b, fill_size, align_size); - if (MAXIMUM_H(c) && MAXIMUM_H(c) < CURRENT_H(c)) - REQUEST_H(c) = MAXIMUM_H(c); - else if (MINIMUM_H(c) && MINIMUM_H(c) > CURRENT_H(c)) - REQUEST_H(c) = MINIMUM_H(c); - else - REQUEST_H(c) = CURRENT_H(c); + /* + * Spread the fill space if necessary. + */ + __ewl_box_configure_fill(b, fill_size, align_size); - *rh -= REQUEST_H(c) + box->spacing; - *rh -= c->object.padd.t + c->object.padd.b; - } + /* + * Center items to be laid out as best as possible. + */ + /* *fill += *fill_size / 2; */ - return f; + /* + * Layout the children in their appropriate positions. + */ + __ewl_box_configure_layout(b, &x, &y, fill, align, align_size); DLEAVE_FUNCTION(DLEVEL_STABLE); } -static void -__ewl_vbox_configure_fillers(Ewl_Widget * w, Ewd_List * f, int rh) +/* + * Split the children into three lists for layout. + */ +void +__ewl_box_configure_calc(Ewl_Box * b, int *fill_size, int *align_size) { - Ewl_Box *b; - Ewl_Widget *c; - int nh, ll = 0, rr = 0, tt = 0, bb = 0; - int children = 0, rchildren = 0; - int nfh = 0; + Ewl_Object *child; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - b = EWL_BOX(w); - - if (w->ebits_object) - ebits_get_insets(w->ebits_object, &ll, &rr, &tt, &bb); - children = ewd_list_nodes(f); - rchildren = children; - - nh = (rh - (rchildren - 1) * b->spacing) / children; - - if (children > 1) - { - ewd_list_goto_first(f); - - while ((c = ewd_list_next(f)) != NULL) - { - if (MAXIMUM_H(c) && MAXIMUM_H(c) < nh) - nfh += MAXIMUM_H(c); - else if (MINIMUM_H(c) && MINIMUM_H(c) > nh) - nfh -= MINIMUM_H(c); - else - continue; - - --children; - } - - } - - if (children) - nh = ((rh - nfh) - (rchildren - 1) * b->spacing) / children; - - ewd_list_goto_first(f); - - while ((c = ewd_list_next(f)) != NULL) - { - if (MAXIMUM_W(c) && MAXIMUM_W(c) < REQUEST_W(w) - ll - rr) - REQUEST_W(c) = MAXIMUM_W(c); - else if (MINIMUM_W(c) - && MINIMUM_W(c) > REQUEST_W(w) - ll - rr) - REQUEST_W(c) = MINIMUM_W(c); - else - REQUEST_W(c) = - REQUEST_W(w) - ll - rr - c->object.padd.l - - c->object.padd.r; - - if (MAXIMUM_H(c) && MAXIMUM_H(c) < nh) - REQUEST_H(c) = MAXIMUM_H(c); - else if (MINIMUM_H(c) && MINIMUM_H(c) > nh) - REQUEST_H(c) = MINIMUM_H(c); - else - REQUEST_H(c) = - nh - c->object.padd.t - c->object.padd.b; - } - - ewd_list_clear(f); - ewd_list_destroy(f); + /* + * Sort the children into lists dependant on their alignment within the + * box. + */ + ewd_list_goto_first(EWL_CONTAINER(b)->children); + while ((child = ewd_list_next(EWL_CONTAINER(b)->children))) { + int change; + + /* + * Place the child on a list depending on it's matching + * alignment. First check for top/left alignment. + */ + if (VISIBLE(child) & EWL_VISIBILITY_SHOWN) { + + /* + * Set the initial fill size to the preferred size. + */ + info->fill_set(child, info->pref_fill_ask(child)); + + /* + * Figure out how much extra space is available for + * filling widgets. + */ + change = *fill_size; + *fill_size -= info->fill_ask(child) + b->spacing + + info->fill_pad1(child) + info->fill_pad2(child); + + /* + * Attempt to give the widget the full size, this will + * fail if the fill policy or bounds don't allow it. + */ + info->align_set(child, *align_size); + + /* + * If it has a fill policy for a direction we're + * concerned with, add it to the fill list. + */ + if (ewl_object_get_fill_policy(child) & info->f_policy) + ewd_list_append(spread, child); + } + } DLEAVE_FUNCTION(DLEVEL_STABLE); } -static void -__ewl_vbox_layout_children(Ewl_Widget * w) +/* + * Spread space to any widgets that have fill policy set to fill. This should + * not be called if @num_fill or *@fill_size are equal to zero. + */ +void +__ewl_box_configure_fill(Ewl_Box * b, int *fill_size, int *align_size) { - Ewl_Box *box; - Ewl_Widget *c; - int y, l = 0, r = 0, t = 0, b = 0; + int space; + int temp, remainder; + Ewl_Object *c; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - box = EWL_BOX(w); - if (w->ebits_object) - ebits_get_insets(w->ebits_object, &l, &r, &t, &b); + /* + * Calculate the space to give per child. Safeguard against divide by + * zero. + */ + space = (ewd_list_is_empty(spread) ? 0 : + *fill_size / ewd_list_nodes(spread)); - y = REQUEST_Y(w) + t; + /* + * As long as children keep accepting more space, we should loop + * through and give them what's available. + */ + while (space && !ewd_list_is_empty(spread)) { - if (!EWL_CONTAINER(w)->children || - ewd_list_is_empty(EWL_CONTAINER(w)->children)) - DRETURN(DLEVEL_STABLE); + /* + * Determine the amount of space to hand out. + */ + ewd_list_goto_first(spread); + while ((c = ewd_list_current(spread))) { + + /* + * Save the current size of the child, then + * attempt to give it a portion of the space + * available. + */ + temp = info->fill_ask(c); + info->fill_set(c, temp + space); + + /* + * Determine if the child accepted any of the space + */ + temp = info->fill_ask(c) - temp; + + /* + * 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) + ewd_list_remove(spread); + else + *fill_size -= temp; + + ewd_list_next(spread); + } + + /* + * Calculate the space to give per child. + */ + space = (ewd_list_is_empty(spread) ? 0 : + *fill_size / ewd_list_nodes(spread)); + } - ewd_list_goto_first(EWL_CONTAINER(w)->children); + /* + * Distribute any remaining fill space. + */ + while (*fill_size && !ewd_list_is_empty(spread)) { - while ((c = ewd_list_next(EWL_CONTAINER(w)->children)) != NULL) - { - /* - * If the child is bigger then the box, align it left - */ - if (REQUEST_W(c) > REQUEST_W(w) - l - r) - REQUEST_X(c) = REQUEST_X(w) + l + c->object.padd.l; - /* - * Left alignment - */ - else if (EWL_OBJECT(c)->alignment & EWL_ALIGNMENT_LEFT) - REQUEST_X(c) = REQUEST_X(w) + l + c->object.padd.l; - /* - * Right - */ - else if (EWL_OBJECT(c)->alignment & EWL_ALIGNMENT_RIGHT) - { - REQUEST_X(c) = - REQUEST_X(w) + REQUEST_W(w) - l + - c->object.padd.l; - REQUEST_X(c) -= REQUEST_W(c); - } - /* - * Center - */ - else - { - REQUEST_X(c) = REQUEST_X(w) + c->object.padd.l; - REQUEST_X(c) += (REQUEST_W(w) / 2) - - (REQUEST_W(c) / 2); - } - - REQUEST_Y(c) = y + c->object.padd.t; - /* - * Update y so the next child comes beneath it - */ - y = REQUEST_Y(c) + REQUEST_H(c) + box->spacing + - c->object.padd.b; + /* + * Determine the sign of the amount to be incremented. + */ + remainder = *fill_size / abs(*fill_size); + + /* + * Add the remainder sign to each child. + */ + ewd_list_goto_first(spread); + while (*fill_size && (c = ewd_list_current(spread))) { + + /* + * Store the current size of the child. + */ + temp = info->fill_ask(c); + + /* + * Attempt to give it a portion of the remaining space + */ + info->fill_set(c, temp + remainder); + + /* + * Determine if the child accepted the space + */ + temp = info->fill_ask(c) - temp; + + /* + * Remove the child if it didn't accept any space, + * otherwise subtract the accepted space from the + * total. + */ + if (!temp) + ewd_list_remove(spread); + else + *fill_size -= remainder; + + ewd_list_next(spread); + } + } - ewl_widget_configure(c); - } + /* + * This contents of the list are no longer needed. + */ + ewd_list_clear(spread); DLEAVE_FUNCTION(DLEVEL_STABLE); } - - -static void -__ewl_hbox_configure_children(Ewl_Widget * w) +void +__ewl_box_configure_layout(Ewl_Box * b, int *x, int *y, int *fill, + int *align, int *align_size) { - Ewd_List *f; - int rw; + Ewl_Object *child; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - f = __ewl_hbox_configure_normal(w, &rw); + /* + * Configure the widgets on the first list. + */ + ewd_list_goto_first(EWL_CONTAINER(b)->children); + while ((child = ewd_list_next(EWL_CONTAINER(b)->children))) { - if (f) - __ewl_hbox_configure_fillers(w, f, rw); + if (VISIBLE(child) & EWL_VISIBILITY_SHOWN) { - __ewl_hbox_layout_children(w); + /* + * Adjust for the first padding amount. + */ + *fill += info->fill_pad1(child); + + /* + * Position this child based on the determined values. + */ + __ewl_box_configure_child(b, child, x, y, align, + align_size); + + /* + * Move to the next position for the child. + */ + *fill += info->fill_ask(child) + b->spacing + + info->fill_pad2(child); + + ewl_widget_configure(EWL_WIDGET(child)); + } + } DLEAVE_FUNCTION(DLEVEL_STABLE); } -static Ewd_List * -__ewl_hbox_configure_normal(Ewl_Widget * w, int *rw) +void +__ewl_box_configure_child(Ewl_Box * b, Ewl_Object * c, int *x, int *y, + int *align, int *align_size) { - Ewd_List *f = NULL; - Ewl_Box *box; - Ewl_Widget *c; - int ll = 0, rr = 0, tt = 0, bb = 0; - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("w", w, NULL); - - box = EWL_BOX(w); - - if (w->ebits_object) - ebits_get_insets(w->ebits_object, &ll, &rr, &tt, &bb); - - *rw = REQUEST_W(w) - ll - rr; - - ewd_list_goto_first(EWL_CONTAINER(w)->children); - - while ((c = ewd_list_next(EWL_CONTAINER(w)->children)) != NULL) - { - if (EWL_OBJECT(c)->fill_policy & EWL_FILL_POLICY_FILL) - { - if (!f) - f = ewd_list_new(); - - ewd_list_append(f, c); - - continue; - } - if (MAXIMUM_H(c) < REQUEST_H(w) - tt - bb) - REQUEST_H(c) = MAXIMUM_H(c); - else if (MINIMUM_H(c) > REQUEST_H(w)) - REQUEST_H(c) = MINIMUM_H(c); - else - REQUEST_H(c) = CURRENT_H(c); - - if (MAXIMUM_W(c) < CURRENT_W(c)) - REQUEST_W(c) = MAXIMUM_W(c); - else if (MINIMUM_W(c) > CURRENT_W(c)) - REQUEST_W(c) = MINIMUM_W(c); - else - REQUEST_W(c) = CURRENT_W(c); + /* + * Adjust the alignment in the direction opposite of the + * orientation. The first one is the simplest as it it a + * direct use of the current coordinates. + */ + if (ewl_object_get_alignment(c) & info->a1_align) + ewl_object_request_position(c, *x, *y); - *rw -= REQUEST_W(c) + box->spacing; - *rw -= c->object.padd.l + c->object.padd.r; - } + /* + * The second one is aligned against the furthest edge, so + * there is some calculation to be made. + */ + else if (ewl_object_get_alignment(c) & info->a3_align) { + *align += *align_size - info->align_ask(c); + ewl_object_request_position(c, *x, *y); + *align -= *align_size - info->align_ask(c); + } - return f; + /* + * The final one is for centering the child. + */ + else { + *align += (*align_size - info->align_ask(c)) / 2; + ewl_object_request_position(c, *x, *y); + *align -= (*align_size - info->align_ask(c)) / 2; + } DLEAVE_FUNCTION(DLEVEL_STABLE); } -static void -__ewl_hbox_configure_fillers(Ewl_Widget * w, Ewd_List * f, int rw) +/* + * When a child gets added to the box update it's size. + */ +void +__ewl_box_add(Ewl_Container * c, Ewl_Widget * w) { - Ewl_Box *b; - Ewl_Widget *c; - int nw, ll = 0, rr = 0, tt = 0, bb = 0; - int children = 0, rchildren = 0; - int nfw = 0; + int max_size = 0; + Box_Orientation *info; - DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("c", c); DCHECK_PARAM_PTR("w", w); - b = EWL_BOX(w); - - if (w->ebits_object) - ebits_get_insets(w->ebits_object, &ll, &rr, &tt, &bb); - - children = ewd_list_nodes(f); - rchildren = children; - - nw = (rw - (rchildren - 1) * b->spacing) / children; + /* + * Base the info used on the orientation of the box. + */ + if (EWL_BOX(c)->orientation == EWL_ORIENTATION_HORIZONTAL) + info = horizontal; + else + info = vertical; - if (children > 1) - { - ewd_list_goto_first(f); - - while ((c = ewd_list_next(f)) != NULL) - { - if (MAXIMUM_W(c) && MAXIMUM_W(c) < nw) - nfw += MAXIMUM_W(c); - else if (MINIMUM_W(c) && MINIMUM_W(c) > nw) - nfw -= MINIMUM_W(c); - else - continue; - - --children; - } - - } - - if (children) - nw = ((rw - nfw) - (rchildren - 1) * b->spacing) / children; - - ewd_list_goto_first(f); - - while ((c = ewd_list_next(f)) != NULL) - { - if (MAXIMUM_H(c) && MAXIMUM_H(c) < REQUEST_H(w) - tt - bb) - REQUEST_H(c) = MAXIMUM_H(c); - else if (MINIMUM_H(c) - && MINIMUM_H(c) > REQUEST_W(w) - ll - rr) - REQUEST_H(c) = MINIMUM_H(w); - else - REQUEST_H(c) = - REQUEST_H(w) - ll - rr - c->object.padd.t - - c->object.padd.b; - - if (MAXIMUM_W(c) && MAXIMUM_W(c) < nw) - REQUEST_W(c) = MAXIMUM_W(c); - else if (MINIMUM_W(c) && MINIMUM_W(c) > nw) - REQUEST_W(c) = MINIMUM_W(c); - else - REQUEST_W(c) = - nw - c->object.padd.l - c->object.padd.r; - } + /* + * 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)); - ewd_list_clear(f); - ewd_list_destroy(f); + /* + * 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 <= info->pref_align_ask(EWL_OBJECT(w))) { + EWL_BOX(c)->max_align = w; + info->pref_align_set(EWL_OBJECT(c), + info->pref_align_ask(EWL_OBJECT(w))); + } - DLEAVE_FUNCTION(DLEVEL_STABLE); + /* + * 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), + info->pref_fill_ask(EWL_OBJECT(c)) + + info->pref_fill_ask(EWL_OBJECT(w)) + + (ewd_list_nodes(c->children) > 1 ? + EWL_BOX(c)->spacing : 0)); } -static void -__ewl_hbox_layout_children(Ewl_Widget * w) +/* + * Determine the preferred size of the box when a child changes it's preferred + * size. + */ +void +__ewl_box_child_resize(Ewl_Container * c, Ewl_Widget * w, int size, + Ewl_Orientation o) { - Ewl_Box *box; - Ewl_Widget *c; - int x, l = 0, r = 0, t = 0, b = 0; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - box = EWL_BOX(w); - - if (w->ebits_object) - ebits_get_insets(w->ebits_object, &l, &r, &t, &b); - - x = REQUEST_X(w) + l; + int align_insets = 0, fill_insets = 0; + Box_Orientation *info; - if (!EWL_CONTAINER(w)->children || - ewd_list_is_empty(EWL_CONTAINER(w)->children)) - DRETURN(DLEVEL_STABLE); - - ewd_list_goto_first(EWL_CONTAINER(w)->children); + /* + * Get the appropriate dimension setting functions based on the + * orientation. + */ + if (EWL_BOX(c)->orientation == EWL_ORIENTATION_HORIZONTAL) { + info = horizontal; - while ((c = ewd_list_next(EWL_CONTAINER(w)->children)) != NULL) - { - /* - * If the child is bigger then the box, align it to the TOP - */ - if (REQUEST_H(c) > REQUEST_H(w) - t - b) - REQUEST_Y(c) = REQUEST_Y(w) + t + c->object.padd.t; - else if (EWL_OBJECT(c)->alignment & EWL_ALIGNMENT_TOP) - REQUEST_Y(c) = REQUEST_Y(w) + t + c->object.padd.t; - /* - * Bottom - */ - else if (EWL_OBJECT(c)->alignment & EWL_ALIGNMENT_BOTTOM) - { - REQUEST_Y(c) = - REQUEST_Y(w) + REQUEST_H(w) - l - r; - REQUEST_Y(c) -= REQUEST_H(c); - REQUEST_Y(c) += c->object.padd.b; - } - /* - * Center or unknown - */ - else - { - REQUEST_Y(c) = REQUEST_Y(w); - REQUEST_Y(c) += (REQUEST_H(w) / 2) - - (REQUEST_H(c) / 2); - REQUEST_Y(c) += c->object.padd.t; - } + /* + * The current preferred size includes the insets, so we need + * to know how large they are to subtract them. + */ + if (ewl_object_get_preferred_w(EWL_OBJECT(c))) + fill_insets = INSET_LEFT(c) + INSET_RIGHT(c); + if (ewl_object_get_preferred_h(EWL_OBJECT(c))) + align_insets = INSET_TOP(c) + INSET_BOTTOM(c); + } else { + info = vertical; + + /* + * The current preferred size includes the insets, so we need + * to know how large they are to subtract them. + */ + if (ewl_object_get_preferred_w(EWL_OBJECT(c))) + align_insets = INSET_LEFT(c) + INSET_RIGHT(c); + if (ewl_object_get_preferred_h(EWL_OBJECT(c))) + fill_insets = INSET_TOP(c) + INSET_BOTTOM(c); + } - REQUEST_X(c) = x + c->object.padd.l; + /* + * If the change is in the orientation direction, just add it to the + * current orientation size. + */ + if (EWL_BOX(c)->orientation == o) { + info->pref_fill_set(EWL_OBJECT(c), + info->pref_fill_ask(EWL_OBJECT(c)) + + (size - fill_insets)); + } - x = REQUEST_X(c) + REQUEST_W(c) + box->spacing; - x += c->object.padd.r; + /* + * 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)) { - ewl_widget_configure(c); - } + /* + * Add the change in size to the current size. + */ + info->pref_align_set(EWL_OBJECT(c), + info->pref_align_ask(EWL_OBJECT(c)) + + (size - align_insets)); + } - DLEAVE_FUNCTION(DLEVEL_STABLE); + /* + * Find the new largest widget in the alignment direction + */ + else { + int max_size = 0; + Ewl_Object *child; + + ewd_list_goto_first(c->children); + while ((child = ewd_list_next(c->children))) { + + /* + * Found a larger widget than the previous largest, so + * store it size as the new max size. + */ + if (info->pref_align_ask(child) > max_size) { + EWL_BOX(c)->max_align = EWL_WIDGET(child); + max_size = info->pref_align_ask(child); + } + } + + /* + * 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); + } +} + +/* + * Setup some internal variables for effectively laying out the children based + * on orientation. + */ +void +__ewl_box_setup() +{ + if (!vertical) { + vertical = NEW(Box_Orientation, 1); + ZERO(vertical, Box_Orientation, 1); + + /* + * This sets the aligments for filling direction. + */ + vertical->f1_align = EWL_ALIGNMENT_TOP; + vertical->f3_align = EWL_ALIGNMENT_BOTTOM; + + /* + * These are the valid fill policies for this widget. + */ + vertical->f_policy = EWL_FILL_POLICY_VSHRINK | + EWL_FILL_POLICY_VFILL; + + /* + * This sets the aligments for the non-filling direction. + */ + vertical->a1_align = EWL_ALIGNMENT_LEFT; + vertical->a3_align = EWL_ALIGNMENT_RIGHT; + + /* + * These functions allow for asking the dimensions of the + * 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 + * children. + */ + vertical->fill_set = ewl_object_request_h; + 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; + + /* + * These functions check the padding in the correct dimensions + */ + vertical->fill_pad1 = ewl_object_top_padding; + vertical->fill_pad2 = ewl_object_bottom_padding; + + vertical->align_pad1 = ewl_object_left_padding; + vertical->align_pad2 = ewl_object_right_padding; + + } + + if (!horizontal) { + horizontal = NEW(Box_Orientation, 1); + ZERO(horizontal, Box_Orientation, 1); + + /* + * This sets the aligments for the filling direction. + */ + horizontal->f1_align = EWL_ALIGNMENT_LEFT; + horizontal->f3_align = EWL_ALIGNMENT_RIGHT; + + /* + * These are the valid fill policies for this widget. + */ + horizontal->f_policy = EWL_FILL_POLICY_HSHRINK | + EWL_FILL_POLICY_HFILL; + + /* + * This sets the aligments for the non-filling direction. + */ + horizontal->a1_align = EWL_ALIGNMENT_TOP; + horizontal->a3_align = EWL_ALIGNMENT_BOTTOM; + + /* + * These functions allow for asking the dimensions of the + * 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 + * children. + */ + horizontal->fill_set = ewl_object_request_w; + 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; + + /* + * These functions check the padding in the correct dimensions + */ + horizontal->align_pad1 = ewl_object_top_padding; + horizontal->align_pad2 = ewl_object_bottom_padding; + + horizontal->fill_pad1 = ewl_object_left_padding; + horizontal->fill_pad2 = ewl_object_right_padding; + } } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_box.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ewl_box.h 3 Oct 2001 07:03:51 -0000 1.16 +++ ewl_box.h 16 Apr 2002 18:22:56 -0000 1.17 @@ -13,20 +13,22 @@ #define EWL_BOX(box) ((Ewl_Box *) box) -struct _ewl_box -{ - Ewl_Container container; +struct _ewl_box { + Ewl_Container container; + Ewl_Orientation orientation; - unsigned int spacing; + unsigned int spacing; + + Ewl_Widget *max_align; }; #define ewl_hbox_new() ewl_box_new(EWL_ORIENTATION_HORIZONTAL) #define ewl_vbox_new() ewl_box_new(EWL_ORIENTATION_VERTICAL) -Ewl_Widget *ewl_box_new(Ewl_Orientation orientation); -void ewl_box_init(Ewl_Box * box, Ewl_Orientation orientation); -void ewl_box_set_orientation(Ewl_Box * b, Ewl_Orientation o); -void ewl_box_set_spacing(Ewl_Box * b, int spacing); +Ewl_Widget *ewl_box_new(Ewl_Orientation orientation); +void ewl_box_init(Ewl_Box * box, Ewl_Orientation orientation); +void ewl_box_set_orientation(Ewl_Box * b, Ewl_Orientation o); +void ewl_box_set_spacing(Ewl_Box * b, int spacing); #endif /* __EWL_BOX_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- ewl_button.c 14 Nov 2001 22:56:38 -0000 1.33 +++ ewl_button.c 16 Apr 2002 18:22:56 -0000 1.34 @@ -1,16 +1,18 @@ #include <Ewl.h> -void __ewl_button_realize(Ewl_Widget * w, void *ev_data, void *user_data); -void __ewl_button_remove_label(Ewl_Button * b); -void __ewl_button_update_label(Ewl_Button * b); - -void __ewl_button_focus_in(Ewl_Widget * w, void *ev_data, void *user_data); -void __ewl_button_focus_out(Ewl_Widget * w, void *ev_data, void *user_data); -void __ewl_button_mouse_down(Ewl_Widget * w, void *ev_data, void *user_data); -void __ewl_button_mouse_up(Ewl_Widget * w, void *ev_data, void *user_data); -void __ewl_button_theme_update(Ewl_Widget * w, void *ev_data, - void *user_data); +void __ewl_button_focus_in(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_button_focus_out(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_button_mouse_down(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_button_mouse_up(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_button_show(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_button_theme_update(Ewl_Widget * w, void *ev_data, + void *user_data); /** * ewl_button_new - allocate and initialize a new button @@ -18,10 +20,10 @@ * * Returns NULL on failure, a pointer to a new button on success */ -Ewl_Widget * +Ewl_Widget * ewl_button_new(char *label) { - Ewl_Button *b; + Ewl_Button *b; DENTER_FUNCTION(DLEVEL_STABLE); @@ -45,7 +47,7 @@ void ewl_button_init(Ewl_Button * b, char *label) { - Ewl_Widget *w; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); @@ -64,8 +66,6 @@ /* * Attach necessary callback mechanisms */ - ewl_callback_append(w, EWL_CALLBACK_REALIZE, - __ewl_button_realize, NULL); ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN, __ewl_button_mouse_down, NULL); ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, @@ -74,21 +74,22 @@ __ewl_button_focus_in, NULL); ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT, __ewl_button_focus_out, NULL); + ewl_callback_append(w, EWL_CALLBACK_SHOW, __ewl_button_show, NULL); ewl_callback_append(w, EWL_CALLBACK_THEME_UPDATE, __ewl_button_theme_update, NULL); - if (label) - { - b->label = strdup(label); - b->label_object = ewl_text_new(); - ewl_widget_set_appearance(b->label_object, - "/appearance/button/label"); - ewl_text_set_text(EWL_TEXT(b->label_object), label); - ewl_object_set_alignment(EWL_OBJECT(b->label_object), - EWL_ALIGNMENT_CENTER); - ewl_container_append_child(EWL_CONTAINER(b), - b->label_object); - } + /* + * Create and setup the label for the button if it's desired. + */ + if (label) { + b->label_object = ewl_text_new(); + ewl_widget_set_appearance(b->label_object, + "/appearance/button/label"); + ewl_object_set_alignment(EWL_OBJECT(b->label_object), + EWL_ALIGNMENT_CENTER); + ewl_text_set_text(EWL_TEXT(b->label_object), label); + ewl_container_append_child(EWL_CONTAINER(b), b->label_object); + } DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -103,39 +104,20 @@ void ewl_button_set_label(Ewl_Button * b, char *l) { - Ewl_Widget *w; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("b", b); w = EWL_WIDGET(b); - if (!l) - { - __ewl_button_remove_label(b); - DRETURN(DLEVEL_STABLE); - } - - IF_FREE(b->label); - b->label = strdup(l); - __ewl_button_update_label(b); + if (!l) { + ewl_widget_destroy(b->label_object); + b->label_object = NULL; + } else + ewl_text_set_text(EWL_TEXT(b->label_object), l); ewl_widget_configure(w); - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -void -__ewl_button_realize(Ewl_Widget * w, void *ev_data, void *user_data) -{ - Ewl_Button *b; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - b = EWL_BUTTON(w); - - if (b->label_object) - ewl_widget_realize(b->label_object); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -184,91 +166,43 @@ DCHECK_PARAM_PTR("w", w); - if (w->state & EWL_STATE_HILITED) - { - ewl_widget_update_appearance(w, "hilited"); - ewl_callback_call(w, EWL_CALLBACK_CLICKED); - } - else + if (w->state & EWL_STATE_HILITED) { + ewl_widget_update_appearance(w, "hilited"); + ewl_callback_call(w, EWL_CALLBACK_CLICKED); + } else ewl_widget_update_appearance(w, "normal"); DLEAVE_FUNCTION(DLEVEL_STABLE); } void -__ewl_button_theme_update(Ewl_Widget * w, void *ev_data, void *user_data) +__ewl_button_show(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Button *b; - char appearance[PATH_LEN]; - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - - b = EWL_BUTTON(w); - if (!REALIZED(w) || !b->label_object) - DRETURN(DLEVEL_STABLE); - - snprintf(appearance, PATH_LEN, "%s/label", w->appearance); - - ewl_widget_set_appearance(b->label_object, appearance); + if (EWL_BUTTON(w)->label_object) + ewl_widget_show(EWL_BUTTON(w)->label_object); DLEAVE_FUNCTION(DLEVEL_STABLE); } void -__ewl_button_update_label(Ewl_Button * b) +__ewl_button_theme_update(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *w; - char key[PATH_LEN]; - void *tmp; - int itmp; + Ewl_Button *b; + char appearance[PATH_LEN]; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("b", b); - - w = EWL_WIDGET(b); - - if (!b->label) - DRETURN(DLEVEL_STABLE); - - if (VISIBLE(b)) - ewl_widget_show(b->label_object); - else if (REALIZED(b)) - ewl_widget_realize(b->label_object); - - snprintf(key, PATH_LEN, "%s/text/font", w->appearance); - tmp = ewl_theme_data_get_str(w, key); - - if (tmp) - ewl_text_set_font(EWL_TEXT(b->label_object), tmp); - - snprintf(key, PATH_LEN, "%s/text/font_size", w->appearance); - itmp = ewl_theme_data_get_int(w, key); - - if (itmp) - ewl_text_set_font_size(EWL_TEXT(b->label_object), itmp); - - ewl_text_set_text(EWL_TEXT(b->label_object), b->label); - ewl_widget_show(b->label_object); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} + DCHECK_PARAM_PTR("w", w); -void -__ewl_button_remove_label(Ewl_Button * b) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("b", b); + b = EWL_BUTTON(w); - if (!b->label) + if (!REALIZED(w) || !b->label_object) DRETURN(DLEVEL_STABLE); - if (!b->label_object) - DRETURN(DLEVEL_STABLE); + snprintf(appearance, PATH_LEN, "%s/label", w->appearance); - ewl_widget_destroy(b->label_object); - FREE(b->label); + ewl_widget_set_appearance(b->label_object, appearance); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_button.h 14 Nov 2001 05:54:20 -0000 1.13 +++ ewl_button.h 16 Apr 2002 18:22:56 -0000 1.14 @@ -11,16 +11,15 @@ #define EWL_BUTTON(button) ((Ewl_Button *) button) -struct _ewl_button -{ - Ewl_Box box; +struct _ewl_button { + Ewl_Box box; - char *label; - Ewl_Widget *label_object; + char *label; + Ewl_Widget *label_object; }; -Ewl_Widget *ewl_button_new(char *l); -void ewl_button_init(Ewl_Button * b, char *label); -void ewl_button_set_label(Ewl_Button * b, char *l); +Ewl_Widget *ewl_button_new(char *l); +void ewl_button_init(Ewl_Button * b, char *label); +void ewl_button_set_label(Ewl_Button * b, char *l); #endif /* __EWL_BUTTON_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_callback.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- ewl_callback.c 4 Jan 2002 18:41:25 -0000 1.26 +++ ewl_callback.c 16 Apr 2002 18:22:56 -0000 1.27 @@ -1,11 +1,11 @@ #include <Ewl.h> static unsigned int __ewl_callback_hash(void *key); -static int __ewl_callback_compare(void *key1, void *key2); -static Ewl_Callback * __ewl_callback_register(Ewl_Callback *cb); -static void __ewl_callback_unregister(Ewl_Callback *cb); +static int __ewl_callback_compare(void *key1, void *key2); +static Ewl_Callback *__ewl_callback_register(Ewl_Callback * cb); +static void __ewl_callback_unregister(Ewl_Callback * cb); -static int callback_id = 0; +static int callback_id = 0; static Ewd_Hash *cb_registration = NULL; /** @@ -21,10 +21,23 @@ * * So using shared callbacks saves us over 2 MB of memory in this case. */ -void ewl_callbacks_init() +void +ewl_callbacks_init() { cb_registration = ewd_hash_new(__ewl_callback_hash, - __ewl_callback_compare); + __ewl_callback_compare); +} + +/** + * ewl_callbacks_deinit - destroy internal registration variables for callbacks + * + * Returns no value. Destroys some important variables for tracking callbacks + * that allow shared callbacks. + */ +void +ewl_callbacks_deinit() +{ + ewd_hash_destroy(cb_registration); } /* @@ -37,9 +50,9 @@ * not the case. */ static Ewl_Callback * -__ewl_callback_register(Ewl_Callback *cb) +__ewl_callback_register(Ewl_Callback * cb) { - Ewl_Callback *found; + Ewl_Callback *found; DENTER_FUNCTION(DLEVEL_STABLE); @@ -50,8 +63,7 @@ cb->id = ++callback_id; ewd_hash_set(cb_registration, cb, cb); found = cb; - } - else + } else FREE(cb); found->references++; @@ -67,7 +79,7 @@ * it is removed from the registration system and freed. */ static void -__ewl_callback_unregister(Ewl_Callback *cb) +__ewl_callback_unregister(Ewl_Callback * cb) { DENTER_FUNCTION(DLEVEL_STABLE); @@ -98,7 +110,7 @@ ewl_callback_append(Ewl_Widget * w, Ewl_Callback_Type t, Ewl_Callback_Function f, void *user_data) { - Ewl_Callback *cb; + Ewl_Callback *cb; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("w", w, -1); @@ -137,7 +149,7 @@ ewl_callback_prepend(Ewl_Widget * w, Ewl_Callback_Type t, Ewl_Callback_Function f, void *user_data) { - Ewl_Callback *cb; + Ewl_Callback *cb; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("w", w, -1); @@ -162,6 +174,55 @@ } /** + * ewl_callback_insert_after - add a callback after a previous callback in list + * @w: the widget to insert the callback + * @t: the type of the callback that is being attached + * @f: the function to attach as a callback + * @user_data: the data to be passed to the callback function + * + * Returns 0 on failure, the id of the new callback on success. Same + * functionality as ewl_callback_append, but the callback is placed after the + * specified callback on the callback chain. + */ +int +ewl_callback_insert_after(Ewl_Widget * w, Ewl_Callback_Type t, + Ewl_Callback_Function f, void *user_data, + Ewl_Callback_Function after, void *after_data) +{ + Ewl_Callback *cb; + Ewl_Callback *search; + + DENTER_FUNCTION(DLEVEL_STABLE); + + DCHECK_PARAM_PTR_RET("w", w, 0); + DCHECK_PARAM_PTR_RET("f", f, 0); + + cb = NEW(Ewl_Callback, 1); + if (!cb) + DRETURN_INT(0, DLEVEL_STABLE); + + ZERO(cb, Ewl_Callback, 1); + cb->func = f; + cb->user_data = user_data; + + cb = __ewl_callback_register(cb); + + if (!w->callbacks[t]) + w->callbacks[t] = ewd_list_new(); + + /* + * Step 1 position past the callback we want to insert after. + */ + ewd_list_goto_first(w->callbacks[t]); + while ((search = ewd_list_next(w->callbacks[t])) && + (search->func != f || search->user_data != after_data)); + + ewd_list_insert(w->callbacks[t], cb); + + DRETURN_INT(cb->id, DLEVEL_STABLE); +} + +/** * ewl_callback_call - execute callbacks of specified types for the widget * @w: the widget to execute the callbacks * @t: the type of the callbacks to be executed @@ -172,7 +233,7 @@ void ewl_callback_call(Ewl_Widget * w, Ewl_Callback_Type t) { - Ewl_Callback *cb = NULL; + Ewl_Callback *cb = NULL; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -180,19 +241,21 @@ if (!w->callbacks[t] || ewd_list_is_empty(w->callbacks[t])) DRETURN(DLEVEL_STABLE); + /* + * Loop through all the callbacks for this widget's event and execute + * them. + */ ewd_list_goto_first(w->callbacks[t]); - - while (w && w->callbacks[t] && (cb = ewd_list_next(w->callbacks[t]))) - { - if (cb->func) - cb->func(w, NULL, cb->user_data); - } + while (w->callbacks[t] && (cb = ewd_list_next(w->callbacks[t]))) { + if (cb->func) + cb->func(w, NULL, cb->user_data); + } DLEAVE_FUNCTION(DLEVEL_STABLE); } /** - * ewl_callback_call - execute callbacks of specified types with event data + * ewl_callback_call_with_event_data - execute callbacks with event data * @w: the widget to execute the callbacks * @t: the type of the callbacks to be executed * @ev_data: the event data to pass to the callbacks @@ -204,7 +267,7 @@ ewl_callback_call_with_event_data(Ewl_Widget * w, Ewl_Callback_Type t, void *ev_data) { - Ewl_Callback *cb; + Ewl_Callback *cb; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -212,13 +275,15 @@ if (!w->callbacks[t] || ewd_list_is_empty(w->callbacks[t])) DRETURN(DLEVEL_STABLE); + /* + * Loop through and execute each of the callbacks of a certain type for + * the specified widget. + */ ewd_list_goto_first(w->callbacks[t]); - - while (w && w->callbacks[t] && (cb = ewd_list_next(w->callbacks[t]))) - { - if (cb->func) - cb->func(w, ev_data, cb->user_data); - } + while (w->callbacks[t] && (cb = ewd_list_next(w->callbacks[t]))) { + if (cb->func) + cb->func(w, ev_data, cb->user_data); + } DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -233,7 +298,7 @@ void ewl_callback_del_type(Ewl_Widget * w, Ewl_Callback_Type t) { - Ewl_Callback *rm; + Ewl_Callback *rm; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -242,7 +307,7 @@ DRETURN(DLEVEL_STABLE); while ((rm = ewd_list_remove_first(w->callbacks[t]))) - __ewl_callback_unregister(rm); + __ewl_callback_unregister(rm); ewd_list_destroy(w->callbacks[t]); w->callbacks[t] = NULL; @@ -261,7 +326,7 @@ void ewl_callback_del_cb_id(Ewl_Widget * w, Ewl_Callback_Type t, int cb_id) { - Ewl_Callback *cb; + Ewl_Callback *cb; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -271,12 +336,11 @@ DRETURN(DLEVEL_STABLE); while ((cb = ewd_list_next(w->callbacks[t])) != NULL) - if (cb->id == cb_id) - { - ewd_list_remove(w->callbacks[t]); - FREE(cb); - break; - } + if (cb->id == cb_id) { + ewd_list_remove(w->callbacks[t]); + __ewl_callback_unregister(cb); + break; + } DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -292,16 +356,15 @@ void ewl_callback_clear(Ewl_Widget * w) { - int i; + int i; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); - for (i = 0; i < EWL_CALLBACK_MAX; i++) - { - if (w->callbacks[i]) - ewl_callback_del_type(w, i); - } + for (i = 0; i < EWL_CALLBACK_MAX; i++) { + if (w->callbacks[i]) + ewl_callback_del_type(w, i); + } DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -319,7 +382,7 @@ void ewl_callback_del(Ewl_Widget * w, Ewl_Callback_Type t, Ewl_Callback_Function f) { - Ewl_Callback *cb; + Ewl_Callback *cb; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -329,17 +392,15 @@ ewd_list_goto_first(w->callbacks[t]); - while ((cb = ewd_list_current(w->callbacks[t])) != NULL) - { - if (cb->func == f) - { + while ((cb = ewd_list_current(w->callbacks[t])) != NULL) { + if (cb->func == f) { ewd_list_remove(w->callbacks[t]); + __ewl_callback_unregister(cb); break; } - __ewl_callback_unregister(cb); ewd_list_next(w->callbacks[t]); - } + } DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -350,14 +411,14 @@ static unsigned int __ewl_callback_hash(void *key) { - Ewl_Callback *cb = EWL_CALLBACK(key); + Ewl_Callback *cb = EWL_CALLBACK(key); DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("key", key, 0); - DRETURN_INT((unsigned int)(cb->func) ^ - (unsigned int)(cb->user_data), DLEVEL_STABLE); + DRETURN_INT((unsigned int) (cb->func) ^ + (unsigned int) (cb->user_data), DLEVEL_STABLE); } /* @@ -367,15 +428,15 @@ static int __ewl_callback_compare(void *key1, void *key2) { - Ewl_Callback *cb1 = EWL_CALLBACK(key1); - Ewl_Callback *cb2 = EWL_CALLBACK(key2); + Ewl_Callback *cb1 = EWL_CALLBACK(key1); + Ewl_Callback *cb2 = EWL_CALLBACK(key2); DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("key1", key1, -1) - DCHECK_PARAM_PTR_RET("key2", key2, -1) + DCHECK_PARAM_PTR_RET("key2", key2, -1) - if (cb1->func == cb2->func && cb1->user_data == cb2->user_data) + if (cb1->func == cb2->func && cb1->user_data == cb2->user_data) DRETURN_INT(0, DLEVEL_STABLE); DRETURN_INT(-1, DLEVEL_STABLE); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_callback.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ewl_callback.h 4 Jan 2002 18:41:25 -0000 1.19 +++ ewl_callback.h 16 Apr 2002 18:22:56 -0000 1.20 @@ -7,28 +7,57 @@ #define EWL_CALLBACK(callback) ((Ewl_Callback *) callback) #define EWL_CALLBACK_FUNCTION(cb_func) ((Ewl_Callback_Function) cb_func) -typedef void (*Ewl_Callback_Function) (Ewl_Widget * widget, void *ev_data, - void *user_data); -struct _ewl_callback -{ +typedef void (*Ewl_Callback_Function) (Ewl_Widget * widget, void *ev_data, + void *user_data); +struct _ewl_callback { + /* + * The function to be executed when the specified event occurs. + */ Ewl_Callback_Function func; - void *user_data; - int references; - int id; + + /* + * The user specified data to pass to func when executed. + */ + void *user_data; + + /* + * A flag to indicate if we want to be notified if this event is + * passed to a child of this widget. + */ + int catch_child; + + /* + * Reference counting to determine when this should be freed. + */ + int references; + + /* + * The id of this callback which can be used for identifying it later. + */ + int id; }; -void ewl_callbacks_init(); -int ewl_callback_append(Ewl_Widget * widget, Ewl_Callback_Type type, - Ewl_Callback_Function func, void *user_data); -int ewl_callback_prepend(Ewl_Widget * widget, Ewl_Callback_Type type, - Ewl_Callback_Function func, void *user_data); -void ewl_callback_clear(Ewl_Widget * widget); -void ewl_callback_call(Ewl_Widget * widget, Ewl_Callback_Type type); -void ewl_callback_call_with_event_data(Ewl_Widget * widget, - Ewl_Callback_Type type, - void *event_data); -void ewl_callback_del_type(Ewl_Widget * w, Ewl_Callback_Type t); -void ewl_callback_del(Ewl_Widget * w, Ewl_Callback_Type t, - Ewl_Callback_Function f); +void ewl_callbacks_init(); +void ewl_callbacks_deinit(); +int ewl_callback_append(Ewl_Widget * widget, Ewl_Callback_Type type, + Ewl_Callback_Function func, + void *user_data); +int ewl_callback_prepend(Ewl_Widget * widget, + Ewl_Callback_Type type, + Ewl_Callback_Function func, + void *user_data); +int ewl_callback_insert_after(Ewl_Widget * w, Ewl_Callback_Type t, + Ewl_Callback_Function f, + void *user_data, + Ewl_Callback_Function after, + void *after_data); +void ewl_callback_clear(Ewl_Widget * widget); +void ewl_callback_call(Ewl_Widget * widget, Ewl_Callback_Type type); +void ewl_callback_call_with_event_data(Ewl_Widget * widget, + Ewl_Callback_Type type, + void *event_data); +void ewl_callback_del_type(Ewl_Widget * w, Ewl_Callback_Type t); +void ewl_callback_del(Ewl_Widget * w, Ewl_Callback_Type t, + Ewl_Callback_Function f); #endif /* __EWL_CALLBACK_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_checkbutton.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- ewl_checkbutton.c 9 Nov 2001 23:41:48 -0000 1.25 +++ ewl_checkbutton.c 16 Apr 2002 18:22:56 -0000 1.26 @@ -2,18 +2,19 @@ #include <Ewl.h> -void ewl_checkbutton_init(Ewl_CheckButton * cb, char *label); +void ewl_checkbutton_init(Ewl_CheckButton * cb, char *label); -void __ewl_checkbutton_configure(Ewl_Widget * w, void *ev_data, - void *user_data); -void __ewl_checkbutton_clicked(Ewl_Widget * w, void *ev_data, - void *user_data); -void __ewl_checkbutton_update_check(Ewl_Widget * w); +void __ewl_checkbutton_configure(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_checkbutton_clicked(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_checkbutton_update_check(Ewl_Widget * w); -void __ewl_box_configure(Ewl_Widget * w, void *ev_data, void *user_data); -void __ewl_checkbutton_theme_update(Ewl_Widget * w, void *ev_data, +void __ewl_box_configure(Ewl_Widget * w, void *ev_data, void *user_data); -void ewl_button_init(Ewl_Button * b, char *l); +void __ewl_checkbutton_theme_update(Ewl_Widget * w, void *ev_data, + void *user_data); +void ewl_button_init(Ewl_Button * b, char *l); /** * ewl_checkbutton_new - allocate and initialize a new check button @@ -21,7 +22,7 @@ * * Returns the newly allocated checkbutton on success, NULL on failure. */ -Ewl_Widget * +Ewl_Widget * ewl_checkbutton_new(char *label) { Ewl_CheckButton *b; @@ -121,8 +122,8 @@ void ewl_checkbutton_init(Ewl_CheckButton * cb, char *label) { - Ewl_Button *b; - Ewl_Widget *w; + Ewl_Button *b; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); @@ -131,6 +132,8 @@ ewl_button_init(b, label); ewl_widget_set_appearance(w, "/appearance/button/check"); + ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_NONE); + ewl_object_set_preferred_size(EWL_OBJECT(w), 20, 20); ewl_callback_del(w, EWL_CALLBACK_CONFIGURE, __ewl_box_configure); ewl_callback_append(w, EWL_CALLBACK_THEME_UPDATE, @@ -148,7 +151,7 @@ void __ewl_checkbutton_configure(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Button *b; + Ewl_Button *b; Ewl_CheckButton *cb; DENTER_FUNCTION(DLEVEL_STABLE); @@ -157,52 +160,48 @@ b = EWL_BUTTON(w); cb = EWL_CHECKBUTTON(w); - if (b->label_object) - { - if (MINIMUM_H(b->label_object) > CURRENT_H(w)) - { - REQUEST_Y(b->label_object) = CURRENT_Y(w) + 17; - MINIMUM_H(w) = MINIMUM_H(b->label_object); - MAXIMUM_H(w) = MINIMUM_H(b->label_object); - } - else - { - REQUEST_Y(b->label_object) = CURRENT_Y(w); - REQUEST_Y(b->label_object) += - (CURRENT_H(w) / 2) - - (CURRENT_H(b->label_object) / 2); - MINIMUM_H(w) = 17; - MAXIMUM_H(w) = 17; - } - - MINIMUM_W(w) = 17 + CURRENT_W(b->label_object); - MAXIMUM_W(w) = 17 + CURRENT_W(b->label_object); - - if (cb->label_position == EWL_POSITION_LEFT) - REQUEST_X(b->label_object) = REQUEST_X(w); - else - REQUEST_X(b->label_object) = CURRENT_X(w) + 17; - - ewl_widget_configure(b->label_object); - - if (w->ebits_object) - { - if (cb->label_position == EWL_POSITION_LEFT) - ebits_move(w->ebits_object, - REQUEST_X(w) + - CURRENT_W(b->label_object), - REQUEST_Y(w)); - else - ebits_move(w->ebits_object, REQUEST_X(w), - REQUEST_Y(w)); - - } - } - else - { - MAXIMUM_W(w) = 17; - MAXIMUM_H(w) = 17; - } + if (b->label_object) { + if (MINIMUM_H(b->label_object) > CURRENT_H(w)) { + CURRENT_Y(b->label_object) = CURRENT_Y(w) + 17; + ewl_object_set_minimum_height(EWL_OBJECT(w), + MINIMUM_H(b-> + label_object)); + ewl_object_set_maximum_height(EWL_OBJECT(w), + MINIMUM_H(b-> + label_object)); + } else { + CURRENT_Y(b->label_object) = CURRENT_Y(w); + CURRENT_Y(b->label_object) += (CURRENT_H(w) / 2) - + (CURRENT_H(b->label_object) / 2); + MINIMUM_H(w) = 17; + MAXIMUM_H(w) = 17; + } + + MINIMUM_W(w) = 17 + CURRENT_W(b->label_object); + MAXIMUM_W(w) = 17 + CURRENT_W(b->label_object); + + if (cb->label_position == EWL_POSITION_LEFT) + CURRENT_X(b->label_object) = CURRENT_X(w); + else + CURRENT_X(b->label_object) = CURRENT_X(w) + 17; + + ewl_widget_configure(b->label_object); + + if (w->ebits_object) { + if (cb->label_position == EWL_POSITION_LEFT) + ebits_move(w->ebits_object, + CURRENT_X(w) + + CURRENT_W(b->label_object), + CURRENT_Y(w)); + else + ebits_move(w->ebits_object, CURRENT_X(w), + CURRENT_Y(w)); + + } + } else { + MAXIMUM_W(w) = 17; + MAXIMUM_H(w) = 17; + } DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -211,7 +210,7 @@ __ewl_checkbutton_clicked(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_CheckButton *cb; - int oc; + int oc; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -238,15 +237,14 @@ cb = EWL_CHECKBUTTON(w); - if (w->ebits_object) - { - if (cb->checked) - ebits_set_named_bit_state(w->ebits_object, "Check", - "clicked"); - else - ebits_set_named_bit_state(w->ebits_object, "Check", - "normal"); - } + if (w->ebits_object) { + if (cb->checked) + ebits_set_named_bit_state(w->ebits_object, "Check", + "clicked"); + else + ebits_set_named_bit_state(w->ebits_object, "Check", + "normal"); + } DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_checkbutton.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_checkbutton.h 3 Oct 2001 07:03:51 -0000 1.11 +++ ewl_checkbutton.h 16 Apr 2002 18:22:56 -0000 1.12 @@ -11,17 +11,17 @@ #define EWL_CHECKBUTTON(button) ((Ewl_CheckButton *) button) -struct _ewl_checkbutton -{ - Ewl_Bu... [truncated message content] |
From: <enl...@li...> - 2002-04-16 19:37:38
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/data/scripts Modified Files: theme.sh Log Message: Updated theme generation script. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/data/scripts/theme.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- theme.sh 12 Nov 2001 19:40:59 -0000 1.5 +++ theme.sh 16 Apr 2002 18:26:57 -0000 1.6 @@ -18,18 +18,18 @@ edb_ed $DB add "/appearance/button/default/base/visible" str "yes" edb_ed $DB add "/appearance/button/default/label/font" str "borzoib" edb_ed $DB add "/appearance/button/default/label/font_size" int 8 -edb_ed $DB add "/appearance/button/default/label/style" str "Default" +edb_ed $DB add "/appearance/button/default/label/style" str "shadow" edb_ed $DB add "/appearance/button/check/base" str "/appearance/button/check/base.bits.db" edb_ed $DB add "/appearance/button/check/base/visible" str "yes" edb_ed $DB add "/appearance/button/check/label/font" str "borzoib" edb_ed $DB add "/appearance/button/check/label/font_size" int 8 -edb_ed $DB add "/appearance/button/check/label/style" str "Default" +edb_ed $DB add "/appearance/button/check/label/style" str "shadow" edb_ed $DB add "/appearance/button/radio/base" str "/appearance/button/radio/base.bits.db" edb_ed $DB add "/appearance/button/radio/base/visible" str "yes" edb_ed $DB add "/appearance/button/radio/label/font" str "borzoib" edb_ed $DB add "/appearance/button/radio/label/font_size" int 8 -edb_ed $DB add "/appearance/button/radio/label/style" str "Default" +edb_ed $DB add "/appearance/button/radio/label/style" str "shadow" # Add keys for text entry widgets echo -n "." @@ -41,8 +41,8 @@ edb_ed $DB add "/appearance/entry/default/base" str "/appearance/entry/default/base.bits.db" edb_ed $DB add "/appearance/entry/default/base/visible" str "yes" edb_ed $DB add "/appearance/entry/default/text/font" str "borzoib" -edb_ed $DB add "/appearance/entry/default/text/font_size" int 10 -edb_ed $DB add "/appearance/entry/default/text/style" str "Default" +edb_ed $DB add "/appearance/entry/default/text/font_size" int 8 +edb_ed $DB add "/appearance/entry/default/text/style" str "shadow" # Add keys for image widget echo -n "." @@ -68,7 +68,7 @@ edb_ed $DB add "/appearance/notebook/tab_button/base/visible" str "yes" edb_ed $DB add "/appearance/notebook/tab_button/label/font" str "borzoib" edb_ed $DB add "/appearance/notebook/tab_button/label/font_size" int 8 -edb_ed $DB add "/appearance/notebook/tab_button/label/style" str "Default" +edb_ed $DB add "/appearance/notebook/tab_button/label/style" str "shadow" # Add keys for seeker widget @@ -119,13 +119,18 @@ # Add keys for text widget echo -n "." edb_ed $DB add "/appearance/text/default/font" str "borzoib" -edb_ed $DB add "/appearance/text/default/font_size" int 10 -edb_ed $DB add "/appearance/text/default/style" str "Default" +edb_ed $DB add "/appearance/text/default/font_size" int 8 +edb_ed $DB add "/appearance/text/default/style" str "shadow" # Add keys for the textarea widget echo -n "." edb_ed $DB add "/appearance/textarea/default/base" str "/appearance/textarea/default/base.bits.db" edb_ed $DB add "/appearance/textarea/default/base/visible" str "yes" +edb_ed $DB add "/appearance/textarea/default/base/style" str "shadow" +edb_ed $DB add "/appearance/textarea/default/base/r" int 255 +edb_ed $DB add "/appearance/textarea/default/base/g" int 255 +edb_ed $DB add "/appearance/textarea/default/base/b" int 255 +edb_ed $DB add "/appearance/textarea/default/base/a" int 255 # Add keys for window widget @@ -138,6 +143,11 @@ edb_ed $DB add "/theme/author" str "Christopher 'smugg' Rosendahl and Nathan 'RbdPngn' Ingersoll" edb_ed $DB add "/theme/licence" str "General Public Licence" edb_ed $DB add "/theme/name" str "Default" + +# Add keys for floater widget +echo -n "." +edb_ed $DB add "/appearance/floater/base" str "/appearance/box/horizontal/base.bits.db" +edb_ed $DB add "/appearance/floater/base/visible" str "yes" echo echo "Theme regeneration complete." |
From: <enl...@li...> - 2002-04-16 19:37:34
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/tools/ewl_config Modified Files: ewl_config.c Log Message: Commit some of the changes to the ewl_config program... I doubt this works atm, because the table is in transition. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/tools/ewl_config/ewl_config.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- ewl_config.c 15 Nov 2001 00:27:20 -0000 1.17 +++ ewl_config.c 16 Apr 2002 18:56:06 -0000 1.18 @@ -317,10 +317,7 @@ e_conf.plugins_label); ewl_widget_show(e_conf.plugins_label); - e_conf.effects_table = ewl_table_new_all(FALSE, - 3, - ewd_list_nodes - (avail), 3, 5); + e_conf.effects_table = ewl_grid_new(3, ewd_list_nodes(avail)); ewl_container_append_child(EWL_CONTAINER(e_conf.page_fx), e_conf.effects_table); ewl_widget_show(e_conf.effects_table); @@ -345,7 +342,7 @@ label = ewl_text_new(); ewl_text_set_text(EWL_TEXT(label), name); - ewl_table_attach(EWL_TABLE(e_conf.effects_table), + ewl_grid_add(EWL_GRID(e_conf.effects_table), label, 1, 1, i, i); ewl_widget_show(label); @@ -366,7 +363,7 @@ else ewl_widget_disable(settings_button); - ewl_table_attach(EWL_TABLE(e_conf.effects_table), + ewl_grid_add(EWL_GRID(e_conf.effects_table), settings_button, 2, 2, i, i); ewl_widget_show(settings_button); @@ -387,7 +384,7 @@ else ewl_widget_disable(about_button); - ewl_table_attach(EWL_TABLE(e_conf.effects_table), + ewl_grid_add(EWL_GRID(e_conf.effects_table), about_button, 3, 3, i, i); ewl_widget_show(about_button); } @@ -664,7 +661,7 @@ ewl_config_create_confirm_dialog(); else { - ewl_widget_destroy_recursive(e_conf.main_win); + ewl_widget_destroy(e_conf.main_win); ewl_main_quit(); } @@ -741,7 +738,7 @@ void *user_data) { if (confirm.win) - ewl_widget_destroy_recursive(confirm.win); + ewl_widget_destroy(confirm.win); confirm.win = NULL; |
From: <enl...@li...> - 2002-04-16 19:37:40
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/test Modified Files: Makefile.am ewl_box_test.c ewl_button_test.c ewl_entry_test.c ewl_floater_test.c ewl_image_test.c ewl_notebook_test.c ewl_spinner_test.c ewl_table_test.c ewl_test.c ewl_text_test.c ewl_textarea_test.c Log Message: Updated test files to match the commit to the src directory. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/Makefile.am,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- Makefile.am 15 Nov 2001 22:06:18 -0000 1.18 +++ Makefile.am 16 Apr 2002 18:24:59 -0000 1.19 @@ -12,11 +12,11 @@ ewl_button_test.c \ ewl_entry_test.c \ ewl_image_test.c \ + ewl_fileselector_test.c \ ewl_floater_test.c \ + ewl_imenu_test.c \ ewl_notebook_test.c \ - ewl_scrollbar_test.c \ - ewl_scrollpane_test.c \ - ewl_seeker_test.c \ + ewl_selectionbook_test.c \ ewl_spinner_test.c \ ewl_table_test.c \ ewl_text_test.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_box_test.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- ewl_box_test.c 4 Nov 2001 22:06:33 -0000 1.15 +++ ewl_box_test.c 16 Apr 2002 18:24:59 -0000 1.16 @@ -2,7 +2,8 @@ static Ewl_Widget *box_button = NULL; -void __create_box_test_window(Ewl_Widget * w, void *ev_data, void *user_data); +void __create_box_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); void __destroy_box_test_window(Ewl_Widget * w, void *ev_data, void *user_data) @@ -18,30 +19,46 @@ } void -__toggle_child_fill_policy(Ewl_Widget * w, void *ev_data, void *user_data) +__toggle_child_fill(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Fill_Policy f; f = ewl_object_get_fill_policy(EWL_OBJECT(w)); - if (f == EWL_FILL_POLICY_NORMAL) - { - ewl_object_set_fill_policy(EWL_OBJECT(w), - EWL_FILL_POLICY_FILL); - ewl_object_set_minimum_size(EWL_OBJECT(w), 100, 17); - ewl_object_set_maximum_size(EWL_OBJECT(w), 1 << 30, - 1 << 30); - ewl_button_set_label(EWL_BUTTON(w), "Fill"); - ewl_widget_configure(w->parent); - } - else - { - ewl_object_set_fill_policy(EWL_OBJECT(w), - EWL_FILL_POLICY_NORMAL); - ewl_object_set_custom_size(EWL_OBJECT(w), 100, 17); - ewl_button_set_label(EWL_BUTTON(w), "Normal"); - ewl_widget_configure(w->parent); - } + if (f == EWL_FILL_POLICY_NONE) { + ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_FILL); + ewl_button_set_label(EWL_BUTTON(w), "Fill"); + ewl_widget_configure(w->parent); + } else { + ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_NONE); + ewl_button_set_label(EWL_BUTTON(w), "None"); + ewl_widget_configure(w->parent); + } + + return; + ev_data = NULL; + user_data = NULL; +} + +void +__toggle_child_shrink(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Fill_Policy f; + + f = ewl_object_get_fill_policy(EWL_OBJECT(w)); + + if (f == EWL_FILL_POLICY_NONE) { + ewl_object_set_fill_policy(EWL_OBJECT(w), + EWL_FILL_POLICY_SHRINK); + ewl_button_set_label(EWL_BUTTON(w), + "Shrink This Box To Fit It's Parent"); + ewl_widget_configure(w->parent); + } else { + ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_NONE); + ewl_button_set_label(EWL_BUTTON(w), + "Don't shrink this box at all"); + ewl_widget_configure(w->parent); + } return; ev_data = NULL; @@ -49,29 +66,23 @@ } void -__toggle_child_horizontal_align(Ewl_Widget * w, void *ev_data, - void *user_data) +__toggle_child_horizontal_align(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Alignment a; - char l[10]; + Ewl_Alignment a; + char l[10]; a = ewl_object_get_alignment(EWL_OBJECT(w)); - if (a == EWL_ALIGNMENT_LEFT) - { - a = EWL_ALIGNMENT_CENTER; - snprintf(l, 10, "Center"); - } - else if (a == EWL_ALIGNMENT_CENTER) - { - a = EWL_ALIGNMENT_RIGHT; - snprintf(l, 10, "Right"); - } - else if (a == EWL_ALIGNMENT_RIGHT) - { - a = EWL_ALIGNMENT_LEFT; - snprintf(l, 10, "Left"); - } + if (a == EWL_ALIGNMENT_LEFT) { + a = EWL_ALIGNMENT_CENTER; + snprintf(l, 10, "Center"); + } else if (a == EWL_ALIGNMENT_CENTER) { + a = EWL_ALIGNMENT_RIGHT; + snprintf(l, 10, "Right"); + } else if (a == EWL_ALIGNMENT_RIGHT) { + a = EWL_ALIGNMENT_LEFT; + snprintf(l, 10, "Left"); + } ewl_button_set_label(EWL_BUTTON(w), l); @@ -88,26 +99,21 @@ void __toggle_child_vertical_align(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Alignment a; - char l[10]; + Ewl_Alignment a; + char l[10]; a = ewl_object_get_alignment(EWL_OBJECT(w)); - if (a == EWL_ALIGNMENT_TOP) - { - a = EWL_ALIGNMENT_CENTER; - snprintf(l, 10, "Center"); - } - else if (a == EWL_ALIGNMENT_CENTER) - { - a = EWL_ALIGNMENT_BOTTOM; - snprintf(l, 10, "Bottom"); - } - else if (a == EWL_ALIGNMENT_BOTTOM) - { - a = EWL_ALIGNMENT_TOP; - snprintf(l, 10, "Top"); - } + if (a == EWL_ALIGNMENT_TOP) { + a = EWL_ALIGNMENT_CENTER; + snprintf(l, 10, "Center"); + } else if (a == EWL_ALIGNMENT_CENTER) { + a = EWL_ALIGNMENT_BOTTOM; + snprintf(l, 10, "Bottom"); + } else if (a == EWL_ALIGNMENT_BOTTOM) { + a = EWL_ALIGNMENT_TOP; + snprintf(l, 10, "Top"); + } ewl_button_set_label(EWL_BUTTON(w), l); @@ -124,11 +130,12 @@ void __create_box_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *box_win; - Ewl_Widget *vbox[2]; - Ewl_Widget *vbox_button[2][3]; - Ewl_Widget *hbox[3]; - Ewl_Widget *hbox_button[2][3]; + Ewl_Widget *box_win; + Ewl_Widget *box_box; + Ewl_Widget *vbox[2]; + Ewl_Widget *vbox_button[2][3]; + Ewl_Widget *hbox[3]; + Ewl_Widget *hbox_button[2][3]; ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_box_test_window); @@ -139,37 +146,62 @@ __destroy_box_test_window, NULL); ewl_widget_show(box_win); + /* + * Create the main box for holding the widgets + */ + box_box = ewl_vbox_new(); + ewl_container_append_child(EWL_CONTAINER(box_win), box_box); + ewl_widget_show(box_box); + + /* + * Create the first horizontal box, this is positioned in the upper + * left corner. + */ hbox[0] = ewl_hbox_new(); - ewl_container_append_child(EWL_CONTAINER(box_win), hbox[0]); + ewl_container_append_child(EWL_CONTAINER(box_box), hbox[0]); ewl_widget_show(hbox[0]); - /****************************************************************/ + /******************************************************************/ + /* Create a box for holding the horizontal alignment test buttons */ + /******************************************************************/ vbox[0] = ewl_vbox_new(); ewl_container_append_child(EWL_CONTAINER(hbox[0]), vbox[0]); ewl_widget_show(vbox[0]); + /* + * Create and setup the button that starts in the left position. + */ vbox_button[0][0] = ewl_button_new("Left"); ewl_container_append_child(EWL_CONTAINER(vbox[0]), vbox_button[0][0]); - ewl_object_set_custom_size(EWL_OBJECT(vbox_button[0][0]), 100, 17); + ewl_object_set_fill_policy(EWL_OBJECT(vbox_button[0][0]), + EWL_FILL_POLICY_NONE); ewl_object_set_alignment(EWL_OBJECT(vbox_button[0][0]), EWL_ALIGNMENT_LEFT); ewl_callback_append(vbox_button[0][0], EWL_CALLBACK_CLICKED, __toggle_child_horizontal_align, NULL); ewl_widget_show(vbox_button[0][0]); + /* + * Create and setup the button that starts in the center position. + */ vbox_button[0][1] = ewl_button_new("Center"); ewl_container_append_child(EWL_CONTAINER(vbox[0]), vbox_button[0][1]); - ewl_object_set_custom_size(EWL_OBJECT(vbox_button[0][1]), 100, 17); + ewl_object_set_fill_policy(EWL_OBJECT(vbox_button[0][1]), + EWL_FILL_POLICY_NONE); ewl_object_set_alignment(EWL_OBJECT(vbox_button[0][1]), EWL_ALIGNMENT_CENTER); ewl_callback_append(vbox_button[0][1], EWL_CALLBACK_CLICKED, __toggle_child_horizontal_align, NULL); ewl_widget_show(vbox_button[0][1]); + /* + * Create and setup the button that starts in the right position. + */ vbox_button[0][2] = ewl_button_new("Right"); ewl_container_append_child(EWL_CONTAINER(vbox[0]), vbox_button[0][2]); - ewl_object_set_custom_size(EWL_OBJECT(vbox_button[0][2]), 100, 17); + ewl_object_set_fill_policy(EWL_OBJECT(vbox_button[0][2]), + EWL_FILL_POLICY_NONE); ewl_object_set_alignment(EWL_OBJECT(vbox_button[0][2]), EWL_ALIGNMENT_RIGHT); ewl_callback_append(vbox_button[0][2], EWL_CALLBACK_CLICKED, @@ -177,64 +209,87 @@ ewl_widget_show(vbox_button[0][2]); /****************************************************************/ + /* Create a box for holding the Fill test buttons */ + /****************************************************************/ vbox[1] = ewl_vbox_new(); ewl_container_append_child(EWL_CONTAINER(hbox[0]), vbox[1]); ewl_widget_show(vbox[1]); - vbox_button[1][0] = ewl_button_new("Normal"); + /* + * Create and setup a button with no filling by default. + */ + vbox_button[1][0] = ewl_button_new("None"); ewl_container_append_child(EWL_CONTAINER(vbox[1]), vbox_button[1][0]); - ewl_object_set_custom_size(EWL_OBJECT(vbox_button[1][0]), 100, 17); ewl_object_set_fill_policy(EWL_OBJECT(vbox_button[1][0]), - EWL_FILL_POLICY_NORMAL); + EWL_FILL_POLICY_NONE); ewl_callback_append(vbox_button[1][0], EWL_CALLBACK_CLICKED, - __toggle_child_fill_policy, NULL); + __toggle_child_fill, NULL); ewl_widget_show(vbox_button[1][0]); + /* + * Create and setup a button with filling by default. + */ vbox_button[1][1] = ewl_button_new("Fill"); ewl_container_append_child(EWL_CONTAINER(vbox[1]), vbox_button[1][1]); ewl_object_set_fill_policy(EWL_OBJECT(vbox_button[1][1]), EWL_FILL_POLICY_FILL); ewl_callback_append(vbox_button[1][1], EWL_CALLBACK_CLICKED, - __toggle_child_fill_policy, NULL); + __toggle_child_fill, NULL); ewl_widget_show(vbox_button[1][1]); - vbox_button[1][2] = ewl_button_new("Normal"); + /* + * Create and setup a button with no filling by default. + */ + vbox_button[1][2] = ewl_button_new("None"); ewl_container_append_child(EWL_CONTAINER(vbox[1]), vbox_button[1][2]); - ewl_object_set_custom_size(EWL_OBJECT(vbox_button[1][2]), 100, 17); ewl_object_set_fill_policy(EWL_OBJECT(vbox_button[1][2]), - EWL_FILL_POLICY_NORMAL); + EWL_FILL_POLICY_NONE); ewl_callback_append(vbox_button[1][2], EWL_CALLBACK_CLICKED, - __toggle_child_fill_policy, NULL); + __toggle_child_fill, NULL); ewl_widget_show(vbox_button[1][2]); /****************************************************************/ + /* Create a box for holding the vertical alignment test buttons */ + /****************************************************************/ hbox[1] = ewl_hbox_new(); - ewl_container_append_child(EWL_CONTAINER(box_win), hbox[1]); + ewl_container_append_child(EWL_CONTAINER(box_box), hbox[1]); ewl_widget_show(hbox[1]); + /* + * Create and setup a button with top alignment by default. + */ hbox_button[0][0] = ewl_button_new("Top"); ewl_container_append_child(EWL_CONTAINER(hbox[1]), hbox_button[0][0]); - ewl_object_set_custom_size(EWL_OBJECT(hbox_button[0][0]), 100, 17); + ewl_object_set_fill_policy(EWL_OBJECT(hbox_button[0][0]), + EWL_FILL_POLICY_NONE); ewl_object_set_alignment(EWL_OBJECT(hbox_button[0][0]), EWL_ALIGNMENT_TOP); ewl_callback_append(hbox_button[0][0], EWL_CALLBACK_CLICKED, __toggle_child_vertical_align, NULL); ewl_widget_show(hbox_button[0][0]); + /* + * Create and setup a button with center alignment by default. + */ hbox_button[0][1] = ewl_button_new("Center"); ewl_container_append_child(EWL_CONTAINER(hbox[1]), hbox_button[0][1]); - ewl_object_set_custom_size(EWL_OBJECT(hbox_button[0][1]), 100, 17); + ewl_object_set_fill_policy(EWL_OBJECT(hbox_button[0][1]), + EWL_FILL_POLICY_NONE); ewl_object_set_alignment(EWL_OBJECT(hbox_button[0][1]), EWL_ALIGNMENT_CENTER); ewl_callback_append(hbox_button[0][1], EWL_CALLBACK_CLICKED, __toggle_child_vertical_align, NULL); ewl_widget_show(hbox_button[0][1]); + /* + * Create and setup a button with bottom alignment by default. + */ hbox_button[0][2] = ewl_button_new("Bottom"); ewl_container_append_child(EWL_CONTAINER(hbox[1]), hbox_button[0][2]); - ewl_object_set_custom_size(EWL_OBJECT(hbox_button[0][2]), 100, 17); + ewl_object_set_fill_policy(EWL_OBJECT(hbox_button[0][2]), + EWL_FILL_POLICY_NONE); ewl_object_set_alignment(EWL_OBJECT(hbox_button[0][2]), EWL_ALIGNMENT_BOTTOM); ewl_callback_append(hbox_button[0][2], EWL_CALLBACK_CLICKED, @@ -242,35 +297,47 @@ ewl_widget_show(hbox_button[0][2]); /****************************************************************/ + /* Create a box for holding the Shrink test buttons */ + + /****************************************************************/ hbox[2] = ewl_hbox_new(); - ewl_container_append_child(EWL_CONTAINER(box_win), hbox[2]); + ewl_container_append_child(EWL_CONTAINER(box_box), hbox[2]); ewl_widget_show(hbox[2]); - hbox_button[1][0] = ewl_button_new("Normal"); + /* + * Create and setup a button with no filling by default. + */ + hbox_button[1][0] = + ewl_button_new("Shrink This Box To Fit It's Parent"); ewl_container_append_child(EWL_CONTAINER(hbox[2]), hbox_button[1][0]); - ewl_object_set_custom_size(EWL_OBJECT(hbox_button[1][0]), 100, 17); ewl_object_set_fill_policy(EWL_OBJECT(hbox_button[1][0]), - EWL_FILL_POLICY_NORMAL); + EWL_FILL_POLICY_SHRINK); ewl_callback_append(hbox_button[1][0], EWL_CALLBACK_CLICKED, - __toggle_child_fill_policy, NULL); + __toggle_child_shrink, NULL); ewl_widget_show(hbox_button[1][0]); - hbox_button[1][1] = ewl_button_new("Fill"); + /* + * Create and setup a button with shrinking by default. + */ + hbox_button[1][1] = + ewl_button_new("Shrink This Box To Fit It's Parent"); ewl_container_append_child(EWL_CONTAINER(hbox[2]), hbox_button[1][1]); ewl_object_set_fill_policy(EWL_OBJECT(hbox_button[1][1]), - EWL_FILL_POLICY_FILL); + EWL_FILL_POLICY_SHRINK); ewl_callback_append(hbox_button[1][1], EWL_CALLBACK_CLICKED, - __toggle_child_fill_policy, NULL); + __toggle_child_shrink, NULL); ewl_widget_show(hbox_button[1][1]); - hbox_button[1][2] = ewl_button_new("Normal"); + /* + * Create and setup a button with no filling by default. + */ + hbox_button[1][2] = ewl_button_new("Don't shrink this box at all"); ewl_container_append_child(EWL_CONTAINER(hbox[2]), hbox_button[1][2]); - ewl_object_set_custom_size(EWL_OBJECT(hbox_button[1][2]), 100, 17); ewl_object_set_fill_policy(EWL_OBJECT(hbox_button[1][2]), - EWL_FILL_POLICY_NORMAL); + EWL_FILL_POLICY_NONE); ewl_callback_append(hbox_button[1][2], EWL_CALLBACK_CLICKED, - __toggle_child_fill_policy, NULL); + __toggle_child_shrink, NULL); ewl_widget_show(hbox_button[1][2]); return; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_button_test.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_button_test.c 22 Oct 2001 22:17:22 -0000 1.13 +++ ewl_button_test.c 16 Apr 2002 18:25:00 -0000 1.14 @@ -2,13 +2,13 @@ static Ewl_Widget *button_button = NULL; -void __create_button_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_button_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); void __destroy_button_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - ewl_widget_destroy_recursive(w); + ewl_widget_destroy(w); ewl_callback_append(button_button, EWL_CALLBACK_CLICKED, __create_button_test_window, NULL); @@ -21,14 +21,14 @@ void __create_button_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *button_win; - Ewl_Widget *separator[2]; - Ewl_Widget *button[2]; - Ewl_Widget *check_button[2]; - Ewl_Widget *radio_button[2]; + Ewl_Widget *button_win; + Ewl_Widget *button_box; + Ewl_Widget *separator[2]; + Ewl_Widget *button[2]; + Ewl_Widget *check_button[2]; + Ewl_Widget *radio_button[2]; - ewl_callback_del(w, EWL_CALLBACK_CLICKED, - __create_button_test_window); + ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_button_test_window); button_button = w; @@ -40,58 +40,74 @@ __destroy_button_test_window, NULL); ewl_widget_show(button_win); - ewl_box_set_spacing(EWL_BOX(button_win), 10); - ewl_widget_show(button_win); - + /* + * Create the main box for holding the button widgets + */ + button_box = ewl_vbox_new(); + ewl_container_append_child(EWL_CONTAINER(button_win), button_box); + ewl_box_set_spacing(EWL_BOX(button_box), 10); + ewl_widget_show(button_box); + + /* + * Create a button to be displayed witha label. + */ button[0] = ewl_button_new("With Label"); - ewl_container_append_child(EWL_CONTAINER(button_win), button[0]); + ewl_container_append_child(EWL_CONTAINER(button_box), button[0]); ewl_object_set_alignment(EWL_OBJECT(button[0]), EWL_ALIGNMENT_LEFT); - ewl_object_set_custom_size(EWL_OBJECT(button[0]), 100, 17); ewl_widget_show(button[0]); + /* + * Create a button that does not contain a label + */ button[1] = ewl_button_new(NULL); - ewl_container_append_child(EWL_CONTAINER(button_win), button[1]); + ewl_container_append_child(EWL_CONTAINER(button_box), button[1]); ewl_object_set_alignment(EWL_OBJECT(button[1]), EWL_ALIGNMENT_LEFT); - ewl_object_set_custom_size(EWL_OBJECT(button[1]), 100, 17); ewl_widget_show(button[1]); + /* + * Add a separator between the classic buttons and the check buttons. + */ separator[0] = ewl_vseparator_new(); - ewl_container_append_child(EWL_CONTAINER(button_win), separator[0]); - ewl_widget_realize(separator[0]); - - ewl_object_set_padding(EWL_OBJECT(separator[0]), 2, 2, 5, 5); + ewl_container_append_child(EWL_CONTAINER(button_box), separator[0]); + ewl_widget_show(separator[0]); + /* + * Create a check button with a label. + */ check_button[0] = ewl_checkbutton_new("With Label"); - ewl_container_append_child(EWL_CONTAINER(button_win), - check_button[0]); + ewl_container_append_child(EWL_CONTAINER(button_box), check_button[0]); ewl_object_set_alignment(EWL_OBJECT(check_button[0]), EWL_ALIGNMENT_LEFT); ewl_widget_show(check_button[0]); + /* + * Create a check button w/o a label. + */ check_button[1] = ewl_checkbutton_new(NULL); - ewl_container_append_child(EWL_CONTAINER(button_win), - check_button[1]); + ewl_container_append_child(EWL_CONTAINER(button_box), check_button[1]); ewl_object_set_alignment(EWL_OBJECT(check_button[1]), EWL_ALIGNMENT_LEFT); ewl_widget_show(check_button[1]); + /* + * Add a separator between the check buttons and the radio buttons + */ separator[1] = ewl_vseparator_new(); - ewl_container_append_child(EWL_CONTAINER(button_win), separator[1]); - ewl_widget_realize(separator[1]); - - ewl_object_set_padding(EWL_OBJECT(separator[1]), 2, 2, 5, 5); + ewl_container_append_child(EWL_CONTAINER(button_box), separator[1]); + ewl_widget_show(separator[1]); + /* + * Add a radio button with + */ radio_button[0] = ewl_radiobutton_new("With Label"); - ewl_container_append_child(EWL_CONTAINER(button_win), - radio_button[0]); + ewl_container_append_child(EWL_CONTAINER(button_box), radio_button[0]); ewl_object_set_alignment(EWL_OBJECT(radio_button[0]), EWL_ALIGNMENT_LEFT); ewl_widget_show(radio_button[0]); radio_button[1] = ewl_radiobutton_new(NULL); ewl_radiobutton_set_chain(radio_button[1], radio_button[0]); - ewl_container_append_child(EWL_CONTAINER(button_win), - radio_button[1]); + ewl_container_append_child(EWL_CONTAINER(button_box), radio_button[1]); ewl_object_set_alignment(EWL_OBJECT(radio_button[1]), EWL_ALIGNMENT_LEFT); ewl_widget_show(radio_button[1]); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_entry_test.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ewl_entry_test.c 10 Nov 2001 20:32:26 -0000 1.10 +++ ewl_entry_test.c 16 Apr 2002 18:25:00 -0000 1.11 @@ -3,13 +3,13 @@ static Ewl_Widget *entry_button; static Ewl_Widget *entry[2]; -void __create_entry_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_entry_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); void __destroy_entry_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - ewl_widget_destroy_recursive(w); + ewl_widget_destroy(w); ewl_callback_append(entry_button, EWL_CALLBACK_CLICKED, __create_entry_test_window, NULL); @@ -22,7 +22,7 @@ void __fetch_entry_text(Ewl_Widget * w, void *ev_data, void *user_data) { - char *s; + char *s; s = ewl_entry_get_text(entry[0]); printf("First entry covers: %s\n", s); @@ -54,39 +54,46 @@ void __create_entry_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *entry_win; - Ewl_Widget *button_hbox; - Ewl_Widget *button[2]; + Ewl_Widget *entry_win; + Ewl_Widget *entry_box; + Ewl_Widget *button_hbox; + Ewl_Widget *button[2]; ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_entry_test_window); entry_button = w; entry_win = ewl_window_new(); - ewl_box_set_spacing(EWL_BOX(entry_win), 10); ewl_window_resize(entry_win, 371, 96); ewl_window_set_min_size(entry_win, 371, 96); ewl_callback_append(entry_win, EWL_CALLBACK_DELETE_WINDOW, __destroy_entry_test_window, NULL); ewl_widget_show(entry_win); + /* + * Create the main box for holding the widgets + */ + entry_box = ewl_vbox_new(); + ewl_container_append_child(EWL_CONTAINER(entry_win), entry_box); + ewl_box_set_spacing(EWL_BOX(entry_box), 10); + ewl_widget_show(entry_box); + entry[0] = ewl_entry_new(); ewl_entry_set_text(entry[0], "Play with me ?"); ewl_object_set_padding(EWL_OBJECT(entry[0]), 5, 5, 5, 0); - ewl_container_append_child(EWL_CONTAINER(entry_win), entry[0]); + ewl_container_append_child(EWL_CONTAINER(entry_box), entry[0]); ewl_widget_show(entry[0]); entry[1] = ewl_entry_new(); ewl_entry_set_text(entry[1], "E W L ! ! !"); ewl_object_set_padding(EWL_OBJECT(entry[1]), 5, 5, 0, 0); - ewl_container_append_child(EWL_CONTAINER(entry_win), entry[1]); + ewl_container_append_child(EWL_CONTAINER(entry_box), entry[1]); ewl_widget_show(entry[1]); button_hbox = ewl_hbox_new(); ewl_object_set_custom_size(EWL_OBJECT(button_hbox), 211, 23); - ewl_object_set_alignment(EWL_OBJECT(button_hbox), - EWL_ALIGNMENT_CENTER); - ewl_container_append_child(EWL_CONTAINER(entry_win), button_hbox); + ewl_object_set_alignment(EWL_OBJECT(button_hbox), EWL_ALIGNMENT_CENTER); + ewl_container_append_child(EWL_CONTAINER(entry_box), button_hbox); ewl_box_set_spacing(EWL_BOX(button_hbox), 5); ewl_widget_show(button_hbox); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_floater_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_floater_test.c 15 Nov 2001 22:06:18 -0000 1.1 +++ ewl_floater_test.c 16 Apr 2002 18:25:00 -0000 1.2 @@ -2,13 +2,13 @@ static Ewl_Widget *floater_button = NULL; -void __create_floater_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_floater_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); void __destroy_floater_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - ewl_widget_destroy_recursive(w); + ewl_widget_destroy(w); ewl_callback_append(floater_button, EWL_CALLBACK_CLICKED, __create_floater_test_window, NULL); @@ -21,19 +21,18 @@ void __create_floater_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *floater; - Ewl_Widget *floater_win; - Ewl_Widget *separator; - Ewl_Widget *button[2]; - Ewl_Widget *check_button[2]; - Ewl_Widget *radio_button[2]; + Ewl_Widget *floater; + Ewl_Widget *floater_win; + Ewl_Widget *separator; + Ewl_Widget *button[2]; + Ewl_Widget *check_button[2]; + Ewl_Widget *radio_button[2]; - ewl_callback_del(w, EWL_CALLBACK_CLICKED, - __create_floater_test_window); + ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_floater_test_window); floater_button = w; - floater_win= ewl_window_new(); + floater_win = ewl_window_new(); ewl_window_resize(floater_win, 145, 230); ewl_window_set_min_size(floater_win, 145, 230); ewl_box_set_spacing(EWL_BOX(floater_win), 10); @@ -42,23 +41,20 @@ ewl_widget_show(floater_win); radio_button[0] = ewl_radiobutton_new("With Label"); - ewl_container_append_child(EWL_CONTAINER(floater_win), - radio_button[0]); + ewl_container_append_child(EWL_CONTAINER(floater_win), radio_button[0]); ewl_object_set_alignment(EWL_OBJECT(radio_button[0]), EWL_ALIGNMENT_LEFT); ewl_widget_show(radio_button[0]); radio_button[1] = ewl_radiobutton_new(NULL); ewl_radiobutton_set_chain(radio_button[1], radio_button[0]); - ewl_container_append_child(EWL_CONTAINER(floater_win), - radio_button[1]); + ewl_container_append_child(EWL_CONTAINER(floater_win), radio_button[1]); ewl_object_set_alignment(EWL_OBJECT(radio_button[1]), EWL_ALIGNMENT_LEFT); ewl_widget_show(radio_button[1]); floater = ewl_floater_new(radio_button[1]); ewl_floater_set_position(EWL_FLOATER(floater), 20, 20); - ewl_window_floater_add(EWL_WINDOW(floater_win), EWL_FLOATER(floater)); ewl_widget_show(floater); button[0] = ewl_button_new("With Label"); @@ -75,20 +71,18 @@ separator = ewl_vseparator_new(); ewl_container_append_child(EWL_CONTAINER(floater), separator); - ewl_widget_realize(separator); + ewl_widget_show(separator); ewl_object_set_padding(EWL_OBJECT(separator), 2, 2, 5, 5); check_button[0] = ewl_checkbutton_new("With Label"); - ewl_container_append_child(EWL_CONTAINER(floater), - check_button[0]); + ewl_container_append_child(EWL_CONTAINER(floater), check_button[0]); ewl_object_set_alignment(EWL_OBJECT(check_button[0]), EWL_ALIGNMENT_LEFT); ewl_widget_show(check_button[0]); check_button[1] = ewl_checkbutton_new(NULL); - ewl_container_append_child(EWL_CONTAINER(floater), - check_button[1]); + ewl_container_append_child(EWL_CONTAINER(floater), check_button[1]); ewl_object_set_alignment(EWL_OBJECT(check_button[1]), EWL_ALIGNMENT_LEFT); ewl_widget_show(check_button[1]); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_image_test.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_image_test.c 15 Nov 2001 00:27:20 -0000 1.7 +++ ewl_image_test.c 16 Apr 2002 18:25:00 -0000 1.8 @@ -2,20 +2,21 @@ #include <ewl-config.h> static Ewl_Widget *image_button; -Ewl_Widget *image_win; -Ewl_Widget *image; -Ewd_DList *images; -Ewl_Widget *entry_path; +Ewl_Widget *image_win; +Ewl_Widget *image_box; +Ewl_Widget *image; +Ewd_DList *images; +Ewl_Widget *entry_path; -void __create_image_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_image_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); void __destroy_image_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - char *str; + char *str; ewd_dlist_goto_first(images); @@ -24,7 +25,7 @@ ewd_dlist_destroy(images); - ewl_widget_destroy_recursive(w); + ewl_widget_destroy(w); ewl_callback_append(image_button, EWL_CALLBACK_CLICKED, __create_image_test_window, NULL); @@ -37,7 +38,7 @@ int __image_exists(char *i) { - struct stat st; + struct stat st; if (!i || !strlen(i)) return -1; @@ -51,7 +52,7 @@ void __image_update_window_size(void) { - int ww, hh; + int ww, hh; ewl_object_get_current_size(EWL_OBJECT(image), &ww, &hh); @@ -69,7 +70,7 @@ void __image_goto_prev_cb(Ewl_Widget * w, void *ev_data, void *user_data) { - char *img = NULL; + char *img = NULL; ewd_dlist_previous(images); img = ewd_dlist_current(images); @@ -93,17 +94,15 @@ void __image_load_cb(Ewl_Widget * w, void *ev_data, void *user_data) { - char *img = NULL; + char *img = NULL; img = ewl_entry_get_text(entry_path); - if (img && __image_exists(img)) - { - ewd_dlist_append(images, img); - ewd_dlist_goto_last(images); - ewl_image_set_file(EWL_IMAGE(image), img); - } - else + if (img && __image_exists(img)) { + ewd_dlist_append(images, img); + ewd_dlist_goto_last(images); + ewl_image_set_file(EWL_IMAGE(image), img); + } else printf("ERROR: %s does not exist\n", img); @@ -120,7 +119,7 @@ void __image_goto_next_cb(Ewl_Widget * w, void *ev_data, void *user_data) { - char *img = NULL; + char *img = NULL; ewd_dlist_next(images); img = ewd_dlist_current(images); @@ -144,9 +143,10 @@ void __create_image_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *button_hbox; - Ewl_Widget *button_prev, *button_load, *button_next; - char *image_file = NULL; + Ewl_Widget *scrollpane; + Ewl_Widget *button_hbox; + Ewl_Widget *button_prev, *button_load, *button_next; + char *image_file = NULL; ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_image_test_window); @@ -155,13 +155,24 @@ images = ewd_dlist_new(); image_win = ewl_window_new(); - ewl_box_set_spacing(EWL_BOX(image_win), 10); ewl_window_resize(image_win, 390, 297); ewl_window_set_min_size(image_win, 390, 297); ewl_callback_append(image_win, EWL_CALLBACK_DELETE_WINDOW, __destroy_image_test_window, NULL); ewl_widget_show(image_win); + /* + * Create the main box for holding the widgets + */ + image_box = ewl_vbox_new(); + ewl_container_append_child(EWL_CONTAINER(image_win), image_box); + ewl_box_set_spacing(EWL_BOX(image_box), 10); + ewl_widget_show(image_box); + + scrollpane = ewl_scrollpane_new(); + ewl_container_append_child(EWL_CONTAINER(image_box), scrollpane); + ewl_widget_show(scrollpane); + if ((__image_exists(PACKAGE_DATA_DIR "/images/e-logo.png")) != -1) image_file = strdup(PACKAGE_DATA_DIR "/images/e-logo.png"); else if ((__image_exists("./data/images/e-logo.png")) != -1) @@ -172,7 +183,7 @@ image = ewl_image_load(image_file); ewl_object_set_padding(EWL_OBJECT(image), 0, 0, 5, 0); ewl_object_set_alignment(EWL_OBJECT(image), EWL_ALIGNMENT_CENTER); - ewl_container_append_child(EWL_CONTAINER(image_win), image); + ewl_container_append_child(EWL_CONTAINER(scrollpane), image); ewl_widget_show(image); if (image_file) @@ -181,15 +192,14 @@ entry_path = ewl_entry_new(); if (image_file) ewl_entry_set_text(entry_path, image_file); - ewl_container_append_child(EWL_CONTAINER(image_win), entry_path); + ewl_container_append_child(EWL_CONTAINER(image_box), entry_path); ewl_widget_show(entry_path); button_hbox = ewl_hbox_new(); ewl_box_set_spacing(EWL_BOX(button_hbox), 5); - ewl_object_set_alignment(EWL_OBJECT(button_hbox), - EWL_ALIGNMENT_CENTER); + ewl_object_set_alignment(EWL_OBJECT(button_hbox), EWL_ALIGNMENT_CENTER); ewl_object_set_custom_size(EWL_OBJECT(button_hbox), 112, 38); - ewl_container_append_child(EWL_CONTAINER(image_win), button_hbox); + ewl_container_append_child(EWL_CONTAINER(image_box), button_hbox); ewl_widget_show(button_hbox); button_prev = ewl_button_new(NULL); @@ -209,8 +219,7 @@ if ((__image_exists (PACKAGE_DATA_DIR "/images/button_prev.bits.db")) != -1) image_file = - strdup(PACKAGE_DATA_DIR - "/images/button_prev.bits.db"); + strdup(PACKAGE_DATA_DIR "/images/button_prev.bits.db"); else if ((__image_exists("./data/images/button_prev.bits.db")) != -1) image_file = strdup("./data/images/button_prev.bits.db"); else if ((__image_exists("../data/images/button_prev.bits.db")) != -1) @@ -224,8 +233,7 @@ if ((__image_exists (PACKAGE_DATA_DIR "/images/button_load.bits.db")) != -1) image_file = - strdup(PACKAGE_DATA_DIR - "/images/button_load.bits.db"); + strdup(PACKAGE_DATA_DIR "/images/button_load.bits.db"); else if ((__image_exists("./data/images/button_load.bits.db")) != -1) image_file = strdup("./data/images/button_load.bits.db"); else if ((__image_exists("../data/images/button_load.bits.db")) != -1) @@ -239,8 +247,7 @@ if ((__image_exists (PACKAGE_DATA_DIR "/images/button_next.bits.db")) != -1) image_file = - strdup(PACKAGE_DATA_DIR - "/images/button_next.bits.db"); + strdup(PACKAGE_DATA_DIR "/images/button_next.bits.db"); else if ((__image_exists("./data/images/button_next.bits.db")) != -1) image_file = strdup("./data/images/button_next.bits.db"); else if ((__image_exists("../data/images/button_next.bits.db")) != -1) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_notebook_test.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_notebook_test.c 15 Nov 2001 00:27:20 -0000 1.8 +++ ewl_notebook_test.c 16 Apr 2002 18:25:00 -0000 1.9 @@ -2,22 +2,24 @@ static Ewl_Widget *notebook_button; -void __create_notebook_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); -void __notebook_append_page(Ewl_Widget * w, void *ev_data, void *user_data); -void __notebook_prepend_page(Ewl_Widget * w, void *ev_data, void *user_data); +void __create_notebook_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); +void __notebook_append_page(Ewl_Widget * w, void *ev_data, + void *user_data); +void __notebook_prepend_page(Ewl_Widget * w, void *ev_data, + void *user_data); void -__notebook_remove_visible_page(Ewl_Widget * w, void *ev_data, - void *user_data); + __notebook_remove_visible_page(Ewl_Widget * w, void *ev_data, + void *user_data); -Ewl_Widget *button_aleft, *button_acenter, *button_aright, *button_atop, +Ewl_Widget *button_aleft, *button_acenter, *button_aright, *button_atop, *button_abottom; -Ewl_Widget *button_pleft, *button_pright, *button_ptop, *button_pbottom; +Ewl_Widget *button_pleft, *button_pright, *button_ptop, *button_pbottom; void __destroy_notebook_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - ewl_widget_destroy_recursive(w); + ewl_widget_destroy(w); ewl_callback_append(notebook_button, EWL_CALLBACK_CLICKED, __create_notebook_test_window, NULL); @@ -34,14 +36,12 @@ return; if (w == button_aleft) - ewl_notebook_set_tabs_alignment(user_data, - EWL_ALIGNMENT_LEFT); + ewl_notebook_set_tabs_alignment(user_data, EWL_ALIGNMENT_LEFT); else if (w == button_acenter) ewl_notebook_set_tabs_alignment(user_data, EWL_ALIGNMENT_CENTER); else if (w == button_aright) - ewl_notebook_set_tabs_alignment(user_data, - EWL_ALIGNMENT_RIGHT); + ewl_notebook_set_tabs_alignment(user_data, EWL_ALIGNMENT_RIGHT); else if (w == button_atop) ewl_notebook_set_tabs_alignment(user_data, EWL_ALIGNMENT_TOP); else if (w == button_abottom) @@ -65,22 +65,21 @@ else if (w == button_ptop) ewl_notebook_set_tabs_position(user_data, EWL_POSITION_TOP); else if (w == button_pbottom) - ewl_notebook_set_tabs_position(user_data, - EWL_POSITION_BOTTOM); + ewl_notebook_set_tabs_position(user_data, EWL_POSITION_BOTTOM); return; ev_data = NULL; } -Ewl_Widget ** +Ewl_Widget ** __notebook_create_main_page(Ewl_Widget * notebook) { - Ewl_Widget **n; - Ewl_Widget *main_vbox; - Ewl_Widget *tab; - Ewl_Widget *text; - Ewl_Widget *avbox, *alabel; - Ewl_Widget *pvbox, *plabel; + Ewl_Widget **n; + Ewl_Widget *main_vbox; + Ewl_Widget *tab; + Ewl_Widget *text; + Ewl_Widget *avbox, *alabel; + Ewl_Widget *pvbox, *plabel; n = NEW(Ewl_Widget, 2); @@ -190,16 +189,16 @@ return n; } -Ewl_Widget ** +Ewl_Widget ** __notebook_generate_page(Ewl_Widget * notebook) { - Ewl_Widget **n; - Ewl_Widget *main_vbox, *hbox; - Ewl_Widget *tab; - Ewl_Widget *text; - Ewl_Widget *button[3]; - static int num = 1; - char label[20]; + Ewl_Widget **n; + Ewl_Widget *main_vbox, *hbox; + Ewl_Widget *tab; + Ewl_Widget *text; + Ewl_Widget *button[3]; + static int num = 1; + char label[20]; snprintf(label, 20, "Page %i", num++); @@ -259,7 +258,7 @@ void __notebook_append_page(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget **n; + Ewl_Widget **n; n = __notebook_generate_page(user_data); @@ -276,7 +275,7 @@ void __notebook_prepend_page(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget **n; + Ewl_Widget **n; n = __notebook_generate_page(user_data); @@ -295,12 +294,11 @@ { Ewl_NotebookPage *np; - if ((np = ewl_notebook_remove_visible(user_data)) != NULL) - { - ewl_widget_destroy_recursive(np->tab); - ewl_widget_destroy_recursive(np->page); - FREE(np); - } + if ((np = ewl_notebook_remove_visible(user_data)) != NULL) { + ewl_widget_destroy(np->tab); + ewl_widget_destroy(np->page); + FREE(np); + } return; w = NULL; @@ -310,8 +308,9 @@ void __create_notebook_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *notebook_win; - Ewl_Widget *notebook; + Ewl_Widget *notebook_win; + Ewl_Widget *notebook_box; + Ewl_Widget *notebook; ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_notebook_test_window); @@ -325,8 +324,16 @@ __destroy_notebook_test_window, NULL); ewl_widget_show(notebook_win); + /* + * Create the main box for holding the widgets + */ + notebook_box = ewl_vbox_new(); + ewl_container_append_child(EWL_CONTAINER(notebook_win), notebook_box); + ewl_box_set_spacing(EWL_BOX(notebook_box), 10); + ewl_widget_show(notebook_box); + notebook = ewl_notebook_new(); - ewl_container_append_child(EWL_CONTAINER(notebook_win), notebook); + ewl_container_append_child(EWL_CONTAINER(notebook_box), notebook); ewl_widget_show(notebook); __notebook_append_page(NULL, NULL, notebook); @@ -334,7 +341,7 @@ __notebook_append_page(NULL, NULL, notebook); { - Ewl_Widget **n; + Ewl_Widget **n; n = __notebook_create_main_page(notebook); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_spinner_test.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_spinner_test.c 15 Nov 2001 00:27:20 -0000 1.7 +++ ewl_spinner_test.c 16 Apr 2002 18:25:00 -0000 1.8 @@ -1,20 +1,20 @@ #include <Ewl.h> -Ewl_Widget *tmp_win; +Ewl_Widget *tmp_win; static Ewl_Widget *spinner_button; static Ewl_Widget *spinner[4]; -void __create_spinner_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_spinner_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); void -__spinner_main_window_configure(Ewl_Widget * w, void *ev_data, - void *user_data); + __spinner_main_window_configure(Ewl_Widget * w, void *ev_data, + void *user_data); void __destroy_spinner_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - ewl_widget_destroy_recursive(w); + ewl_widget_destroy(w); ewl_callback_append(spinner_button, EWL_CALLBACK_CLICKED, __create_spinner_test_window, NULL); @@ -29,7 +29,7 @@ void __spinner_value_changed(Ewl_Widget * w, void *ev_data, void *user_data) { - int xx, yy, ww, hh; + int xx, yy, ww, hh; xx = (int) (ewl_spinner_get_value(EWL_SPINNER(spinner[0]))); yy = (int) (ewl_spinner_get_value(EWL_SPINNER(spinner[1]))); @@ -52,13 +52,11 @@ } void -__spinner_main_window_configure(Ewl_Widget * w, void *ev_data, - void *user_data) +__spinner_main_window_configure(Ewl_Widget * w, void *ev_data, void *user_data) { - int xx, yy, ww, hh; + int xx, yy, ww, hh; - ewl_window_get_geometry(EWL_WINDOW(tmp_win), &xx, &yy, &ww, - &hh); + ewl_window_get_geometry(EWL_WINDOW(tmp_win), &xx, &yy, &ww, &hh); ewl_callback_del(spinner[0], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed); @@ -92,13 +90,13 @@ void __create_spinner_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *spinner_win; - Ewl_Widget *text[4]; - Ewl_Widget *separator[3]; - int xx, yy, ww, hh, mw, mh; + Ewl_Widget *spinner_win; + Ewl_Widget *spinner_box; + Ewl_Widget *text[4]; + Ewl_Widget *separator[3]; + int xx, yy, ww, hh, mw, mh; - ewl_callback_del(w, EWL_CALLBACK_CLICKED, - __create_spinner_test_window); + ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_spinner_test_window); spinner_button = w; @@ -109,6 +107,14 @@ __destroy_spinner_test_window, NULL); ewl_widget_show(spinner_win); + /* + * Create the main box for holding the widgets + */ + spinner_box = ewl_vbox_new(); + ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner_box); + ewl_box_set_spacing(EWL_BOX(spinner_box), 10); + ewl_widget_show(spinner_box); + tmp_win = ewl_window_new(); ewl_callback_append(tmp_win, EWL_CALLBACK_CONFIGURE, __spinner_main_window_configure, NULL); @@ -121,7 +127,7 @@ text[0] = ewl_text_new(); ewl_text_set_text(EWL_TEXT(text[0]), "X"); - ewl_container_append_child(EWL_CONTAINER(spinner_win), text[0]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), text[0]); ewl_widget_show(text[0]); spinner[0] = ewl_spinner_new(); @@ -130,18 +136,18 @@ ewl_spinner_set_max_val(EWL_SPINNER(spinner[0]), 1280); ewl_spinner_set_value(EWL_SPINNER(spinner[0]), (double) (xx)); ewl_spinner_set_step(EWL_SPINNER(spinner[0]), 1.0); - ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner[0]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner[0]); ewl_callback_append(spinner[0], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); ewl_widget_show(spinner[0]); separator[0] = ewl_vseparator_new(); - ewl_container_append_child(EWL_CONTAINER(spinner_win), separator[0]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), separator[0]); ewl_widget_show(separator[0]); text[1] = ewl_text_new(); ewl_text_set_text(EWL_TEXT(text[1]), "Y"); - ewl_container_append_child(EWL_CONTAINER(spinner_win), text[1]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), text[1]); ewl_widget_show(text[1]); spinner[1] = ewl_spinner_new(); @@ -150,18 +156,18 @@ ewl_spinner_set_max_val(EWL_SPINNER(spinner[1]), 1024); ewl_spinner_set_value(EWL_SPINNER(spinner[1]), (double) (yy)); ewl_spinner_set_step(EWL_SPINNER(spinner[1]), 1.0); - ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner[1]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner[1]); ewl_callback_append(spinner[1], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); ewl_widget_show(spinner[1]); separator[1] = ewl_vseparator_new(); - ewl_container_append_child(EWL_CONTAINER(spinner_win), separator[1]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), separator[1]); ewl_widget_show(separator[1]); text[2] = ewl_text_new(); ewl_text_set_text(EWL_TEXT(text[2]), "W"); - ewl_container_append_child(EWL_CONTAINER(spinner_win), text[2]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), text[2]); ewl_widget_show(text[2]); spinner[2] = ewl_spinner_new(); @@ -170,18 +176,18 @@ ewl_spinner_set_max_val(EWL_SPINNER(spinner[2]), 1280); ewl_spinner_set_value(EWL_SPINNER(spinner[2]), (double) (ww)); ewl_spinner_set_step(EWL_SPINNER(spinner[2]), 1.0); - ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner[2]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner[2]); ewl_callback_append(spinner[2], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); ewl_widget_show(spinner[2]); separator[2] = ewl_vseparator_new(); - ewl_container_append_child(EWL_CONTAINER(spinner_win), separator[2]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), separator[2]); ewl_widget_show(separator[2]); text[3] = ewl_text_new(); ewl_text_set_text(EWL_TEXT(text[3]), "H"); - ewl_container_append_child(EWL_CONTAINER(spinner_win), text[3]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), text[3]); ewl_widget_show(text[3]); spinner[3] = ewl_spinner_new(); @@ -190,7 +196,7 @@ ewl_spinner_set_max_val(EWL_SPINNER(spinner[3]), 1024); ewl_spinner_set_value(EWL_SPINNER(spinner[3]), (double) (hh)); ewl_spinner_set_step(EWL_SPINNER(spinner[3]), 1.0); - ewl_container_append_child(EWL_CONTAINER(spinner_win), spinner[3]); + ewl_container_append_child(EWL_CONTAINER(spinner_box), spinner[3]); ewl_callback_append(spinner[3], EWL_CALLBACK_VALUE_CHANGED, __spinner_value_changed, NULL); ewl_widget_show(spinner[3]); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_table_test.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_table_test.c 4 Nov 2001 22:06:35 -0000 1.11 +++ ewl_table_test.c 16 Apr 2002 18:25:00 -0000 1.12 @@ -2,13 +2,13 @@ static Ewl_Widget *table_button = NULL; -void __create_table_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_table_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); void __destroy_table_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - ewl_widget_destroy_recursive(w); + ewl_widget_destroy(w); ewl_callback_append(table_button, EWL_CALLBACK_CLICKED, __create_table_test_window, NULL); @@ -21,32 +21,52 @@ void __create_table_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *table_win; - Ewl_Widget *table; - Ewl_Widget *button[77]; + Ewl_Widget *table_win; + Ewl_Widget *table_box; + Ewl_Widget *table; + Ewl_Widget *button[77]; + char *headers[4]; + char *one = "one"; + char *two = "two"; + char *three = "three"; + char *four = "four"; ewl_callback_del(w, EWL_CALLBACK_CLICKED, __create_table_test_window); table_button = w; table_win = ewl_window_new(); - ewl_window_resize(table_win, 555, 100); - ewl_window_set_min_size(table_win, 555, 100); + ewl_window_resize(table_win, 300, 300); ewl_callback_append(table_win, EWL_CALLBACK_DELETE_WINDOW, __destroy_table_test_window, NULL); - ewl_widget_realize(table_win); + ewl_widget_show(table_win); - table = ewl_table_new_all(FALSE, 4, 5, 10, 0); - ewl_container_append_child(EWL_CONTAINER(table_win), table); - ewl_widget_realize(table); - - button[0] = ewl_button_new(NULL); - ewl_table_attach(EWL_TABLE(table), button[0], 1, 1, 1, 1); - ewl_object_set_custom_size(EWL_OBJECT(button[0]), 100, 20); - ewl_object_set_fill_policy(EWL_OBJECT(button[0]), - EWL_FILL_POLICY_NORMAL); - ewl_widget_realize(button[0]); + /* + * Create the main box for holding the widgets + */ + table_box = ewl_vbox_new(); + ewl_object_set_fill_policy(EWL_OBJECT(table_box), EWL_FILL_POLICY_FILL); + ewl_container_append_child(EWL_CONTAINER(table_win), table_box); + ewl_theme_data_set_str(table_box, + "/appearance/box/vertical/base/visible", "no"); + ewl_widget_show(table_box); + + + headers[0] = one; + headers[1] = two; + headers[2] = three; + headers[3] = four; + + table = ewl_table_new(4, 5, headers); + ewl_container_append_child(EWL_CONTAINER(table_box), table); + ewl_widget_show(table); + + + button[0] = ewl_button_new("FIRST"); + ewl_table_add(EWL_TABLE(table), button[0], 3, 4, 2, 3); + ewl_widget_show(button[0]); +/* button[1] = ewl_button_new(NULL); ewl_table_attach(EWL_TABLE(table), button[1], 1, 1, 2, 2); ewl_object_set_custom_size(EWL_OBJECT(button[1]), 100, 20); @@ -59,18 +79,18 @@ ewl_object_set_custom_size(EWL_OBJECT(button[2]), 100, 20); ewl_object_set_fill_policy(EWL_OBJECT(button[2]), EWL_FILL_POLICY_NORMAL); - ewl_widget_realize(button[2]); + ewl_widget_show(button[2]); button[3] = ewl_button_new(NULL); ewl_object_set_custom_height(EWL_OBJECT(button[3]), 20); ewl_table_attach(EWL_TABLE(table), button[3], 2, 2, 1, 1); - ewl_widget_realize(button[3]); + ewl_widget_show(button[3]); button[4] = ewl_button_new(NULL); ewl_object_set_custom_height(EWL_OBJECT(button[4]), 20); ewl_table_attach(EWL_TABLE(table), button[4], 2, 2, 2, 2); - ewl_widget_realize(button[4]); + ewl_widget_show(button[4]); button[5] = ewl_button_new(NULL); ewl_object_set_custom_height(EWL_OBJECT(button[5]), 20); @@ -115,7 +135,9 @@ ewl_table_attach(EWL_TABLE(table), button[11], 4, 4, 5, 5); ewl_widget_realize(button[11]); +*/ + ewl_widget_configure(table); return; w = NULL; ev_data = NULL; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_test.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- ewl_test.c 15 Nov 2001 22:06:18 -0000 1.33 +++ ewl_test.c 16 Apr 2002 18:25:00 -0000 1.34 @@ -2,54 +2,55 @@ #define BUTTONS 14 -Ewl_Widget *main_win; -Ewl_Widget *button[BUTTONS]; +void __close_main_widow(Ewl_Widget * w, void *ev_data, + void *user_data); -void __close_main_widow(Ewl_Widget * w, void *ev_data, void *user_data); +void __create_box_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); -void __create_box_test_window(Ewl_Widget * w, void *ev_data, void *user_data); +void __create_button_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); -void __create_button_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_fileselector_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); -void __create_floater_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_floater_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); -void __create_entry_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_entry_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); -void __create_image_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_image_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); -void __create_list_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_imenu_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); -void __create_notebook_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_notebook_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); + +void __create_scrollpane_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); + +void __create_spinner_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); + +void __create_table_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); + +void __create_text_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); +void __create_textarea_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); +void __create_selectionbook_test_window(Ewl_Widget * w, + void *ev_data, + void *user_data); -void __create_scrollbar_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); -void __create_scrollpane_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); - -void __create_seeker_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); - -void __create_spinner_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); - -void __create_table_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); - -void __create_text_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); -void __create_textarea_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); void __close_main_window(Ewl_Widget * w, void *ev_data, void *user_data) { - ewl_widget_destroy_recursive(main_win); + ewl_widget_destroy(w); ewl_main_quit(); @@ -64,125 +65,156 @@ int main(int argc, char **argv) { - int i; + int i; + Ewl_Widget *main_win; + Ewl_Widget *main_box; + Ewl_Widget *button[BUTTONS]; ewl_init(argc, argv); main_win = ewl_window_new(); - ewl_box_set_spacing(EWL_BOX(main_win), 6); ewl_window_set_title(main_win, "The Enlightenment Widget Library Developer Test Program"); ewl_callback_append(main_win, EWL_CALLBACK_DELETE_WINDOW, __close_main_window, NULL); - ewl_window_resize(main_win, 237, 390); + ewl_window_resize(main_win, 237, 450); ewl_window_set_min_size(main_win, 237, 390); ewl_widget_show(main_win); i = 0; + /* + * Create the main box for holding the button widgets + */ + main_box = ewl_vbox_new(); + ewl_container_append_child(EWL_CONTAINER(main_win), main_box); + ewl_box_set_spacing(EWL_BOX(main_box), 6); + ewl_widget_show(main_box); + + /* + * Create the button for the box test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Box"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_object_set_padding(EWL_OBJECT(button[i]), 0, 0, 13, 0); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + ewl_object_set_padding(EWL_OBJECT(button[i]), 0, 0, 10, 0); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_box_test_window, NULL); i++; + /* + * Create the button for the button test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Button"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_button_test_window, NULL); i++; + /* + * Create the button for the text entry test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Entry"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_entry_test_window, NULL); i++; + /* + * Create the button for the image test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Image"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_image_test_window, NULL); i++; + /* + * Create the button for the fileselector test and add it to the box. + */ + button[i] = ewl_button_new("Ewl_FileSelector"); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, + __create_fileselector_test_window, NULL); + i++; + + /* + * Create the button for the floater test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Floater"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_floater_test_window, NULL); i++; + /* + * Create the button for the imenu test and add it to the box. + */ + button[i] = ewl_button_new("Ewl_IMenu"); + ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, + __create_imenu_test_window, NULL); + i++; + + /* + * Create the button for the list test and add it to the box. + */ button[i] = ewl_button_new("Ewl_List"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + /* + * ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, + * __create_list_test_window, NULL); + */ ewl_widget_disable(button[i]); i++; + /* + * Create the button for the notepad test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Notebook"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_notebook_test_window, NULL); i++; - button[i] = ewl_button_new("Ewl_Scrollbar"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); - ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, - __create_scrollbar_test_window, NULL); - i++; - - button[i] = ewl_button_new("Ewl_ScrollPane"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); + /* + * Create the button for the selectionbook test and add it to the box. + */ + button[i] = ewl_button_new("Ewl_Selectionbook"); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, - __create_scrollpane_test_window, NULL); - i++; - - button[i] = ewl_button_new("Ewl_Seeker"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); - ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, - __create_seeker_test_window, NULL); + __create_selectionbook_test_window, NULL); i++; + /* + * Create the button for the spinner test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Spinner"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_spinner_test_window, NULL); i++; + /* + * Create the button for the table test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Table"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_table_test_window, NULL); i++; + /* + * Create the button for the text test and add it to the box. + */ button[i] = ewl_button_new("Ewl_Text"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_text_test_window, NULL); i++; + /* + * Create the button for the text area test and add it to the box. + */ button[i] = ewl_button_new("Ewl_TextArea"); - ewl_object_set_custom_size(EWL_OBJECT(button[i]), 100, 17); - ewl_container_append_child(EWL_CONTAINER(main_win), button[i]); ewl_callback_append(button[i], EWL_CALLBACK_CLICKED, __create_textarea_test_window, NULL); + i++; - for (i = 0; i < BUTTONS; i++) - { - ewl_object_set_alignment(EWL_OBJECT(button[i]), - EWL_ALIGNMENT_CENTER); - ewl_widget_show(button[i]); - } + for (i = 0; i < BUTTONS; i++) { + ewl_container_append_child(EWL_CONTAINER(main_box), button[i]); + ewl_object_set_fill_policy(EWL_OBJECT(button[i]), + EWL_FILL_POLICY_NONE); + ewl_object_set_alignment(EWL_OBJECT(button[i]), + EWL_ALIGNMENT_CENTER); + ewl_widget_show(button[i]); + } ewl_main(); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_text_test.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ewl_text_test.c 15 Nov 2001 00:27:20 -0000 1.10 +++ ewl_text_test.c 16 Apr 2002 18:25:00 -0000 1.11 @@ -2,14 +2,14 @@ static Ewl_Widget *text_button; -void __create_text_test_window(Ewl_Widget * w, void *ev_data, - void *user_data); +void __create_text_test_window(Ewl_Widget * w, void *ev_data, + void *user_data); void __destroy_text_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - ewl_widget_destroy_recursive(w); + ewl_widget_destroy(w); ewl_callback_append(text_button, EWL_CALLBACK_CLICKED, __create_text_test_window, NULL); @@ -22,8 +22,9 @@ void __create_text_test_window(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *text_win; - Ewl_Widget *text; + Ewl_Widget *te... [truncated message content] |
From: <enl...@li...> - 2002-04-17 19:17:37
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/test Modified Files: ewl_imenu_test.c Log Message: Update imenu test to display submenu usage, and the current unresolved issues. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_imenu_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_imenu_test.c 16 Apr 2002 18:54:32 -0000 1.1 +++ ewl_imenu_test.c 17 Apr 2002 19:17:34 -0000 1.2 @@ -40,7 +40,7 @@ { Ewl_Widget *imenu_win; Ewl_Widget *imenu_box; - Ewl_Widget *imenu; + Ewl_Widget *imenu1, *imenu2; Ewl_Widget *item; @@ -67,38 +67,44 @@ /* * Create the menu */ - imenu = ewl_imenu_new(NULL, "test menu"); - ewl_container_append_child(EWL_CONTAINER(imenu_box), imenu); - ewl_widget_show(imenu); + imenu1 = ewl_imenu_new(NULL, "test menu"); + ewl_container_append_child(EWL_CONTAINER(imenu_box), imenu1); + ewl_widget_show(imenu1); /* * Append some test items */ item = ewl_imenu_item_new("/usr/share/pixmaps/dia.xpm", "dia"); - ewl_container_append_child(EWL_CONTAINER(imenu), item); + ewl_container_append_child(EWL_CONTAINER(imenu1), item); ewl_callback_append(item, EWL_CALLBACK_SELECT, __menu_select, NULL); ewl_widget_show(item); item = ewl_imenu_item_new("/usr/share/pixmaps/wilber.xpm", "gimp"); - ewl_container_append_child(EWL_CONTAINER(imenu), item); + ewl_container_append_child(EWL_CONTAINER(imenu1), item); ewl_callback_append(item, EWL_CALLBACK_SELECT, __menu_select, NULL); ewl_widget_show(item); item = ewl_imenu_item_new(NULL, "button"); - ewl_container_append_child(EWL_CONTAINER(imenu), item); + ewl_container_append_child(EWL_CONTAINER(imenu1), item); ewl_callback_append(item, EWL_CALLBACK_SELECT, __menu_select, NULL); ewl_widget_show(item); + /* + * Create a sub-menu + */ + imenu2 = ewl_imenu_new(NULL, "Sub menu"); + ewl_container_append_child(EWL_CONTAINER(imenu1), imenu2); + ewl_widget_show(imenu2); + item = ewl_imenu_item_new(NULL, "button"); - ewl_container_append_child(EWL_CONTAINER(imenu), item); + ewl_container_append_child(EWL_CONTAINER(imenu2), item); ewl_callback_append(item, EWL_CALLBACK_SELECT, __menu_select, NULL); ewl_widget_show(item); item = ewl_imenu_item_new(NULL, "button"); - ewl_container_append_child(EWL_CONTAINER(imenu), item); + ewl_container_append_child(EWL_CONTAINER(imenu2), item); ewl_callback_append(item, EWL_CALLBACK_SELECT, __menu_select, NULL); ewl_widget_show(item); - /* * ewl_imenu_set_title_expandable(EWL_IMENU(imenu)); |
From: <enl...@li...> - 2002-04-19 22:09:59
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_box.c ewl_button.c ewl_callback.c ewl_container.c ewl_entry.c ewl_enums.h ewl_events.c ewl_filedialog.c ewl_filedialog.h ewl_fileselector.c ewl_floater.c ewl_fx.c ewl_fx.h ewl_grid.c ewl_grid.h ewl_image.c ewl_list.c ewl_notebook.c ewl_object.c ewl_seeker.c ewl_selectionbar.c ewl_selectionbar.h ewl_selectionbook.c ewl_spinner.c ewl_table.c ewl_text.c ewl_textarea.c ewl_textarea.h ewl_widget.c getopt.c getopt1.c Log Message: Ran indent, added a means for setting up the appearance of a textarea before it realizes it's etox. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_box.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- ewl_box.c 16 Apr 2002 18:22:56 -0000 1.36 +++ ewl_box.c 19 Apr 2002 22:09:57 -0000 1.37 @@ -6,8 +6,7 @@ typedef struct { /* - * These keep track of the alignments that determine which list a - * child falls on. + * Alignment is only done in the align direction. */ int f1_align, f3_align; int a1_align, a3_align; @@ -127,8 +126,8 @@ "/appearance/box/horizontal", __ewl_box_add, __ewl_box_child_resize); - ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, - __ewl_box_configure, NULL); + ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, __ewl_box_configure, + NULL); /* * Check if the info structs have been created yet, if not create @@ -138,7 +137,8 @@ __ewl_box_setup(); /* - * Set the box's appropriate orientation + * Set the box's appropriate orientation, set to a garbage value so + * that the orientation does it's job. */ b->orientation = 0xdeadbeef; ewl_box_set_orientation(b, o); @@ -695,8 +695,8 @@ /* * These are the valid fill policies for this widget. */ - vertical->f_policy = EWL_FILL_POLICY_VSHRINK | - EWL_FILL_POLICY_VFILL; + vertical->f_policy = + EWL_FILL_POLICY_VSHRINK | EWL_FILL_POLICY_VFILL; /* * This sets the aligments for the non-filling direction. @@ -748,8 +748,8 @@ /* * These are the valid fill policies for this widget. */ - horizontal->f_policy = EWL_FILL_POLICY_HSHRINK | - EWL_FILL_POLICY_HFILL; + horizontal->f_policy = + EWL_FILL_POLICY_HSHRINK | EWL_FILL_POLICY_HFILL; /* * This sets the aligments for the non-filling direction. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- ewl_button.c 16 Apr 2002 18:22:56 -0000 1.34 +++ ewl_button.c 19 Apr 2002 22:09:57 -0000 1.35 @@ -68,12 +68,12 @@ */ ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN, __ewl_button_mouse_down, NULL); - ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, - __ewl_button_mouse_up, NULL); - ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN, - __ewl_button_focus_in, NULL); - ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT, - __ewl_button_focus_out, NULL); + ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, __ewl_button_mouse_up, + NULL); + ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN, __ewl_button_focus_in, + NULL); + ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT, __ewl_button_focus_out, + NULL); ewl_callback_append(w, EWL_CALLBACK_SHOW, __ewl_button_show, NULL); ewl_callback_append(w, EWL_CALLBACK_THEME_UPDATE, __ewl_button_theme_update, NULL); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_callback.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- ewl_callback.c 16 Apr 2002 18:22:56 -0000 1.27 +++ ewl_callback.c 19 Apr 2002 22:09:57 -0000 1.28 @@ -435,7 +435,6 @@ DCHECK_PARAM_PTR_RET("key1", key1, -1) DCHECK_PARAM_PTR_RET("key2", key2, -1) - if (cb1->func == cb2->func && cb1->user_data == cb2->user_data) DRETURN_INT(0, DLEVEL_STABLE); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ewl_container.c 16 Apr 2002 18:22:56 -0000 1.22 +++ ewl_container.c 19 Apr 2002 22:09:57 -0000 1.23 @@ -421,11 +421,11 @@ * Now move down through the tree of widgets until the bottom layer is * found. */ - while ((child2 = ewl_container_get_child_at(EWL_CONTAINER(child), - x, y))) { + while ((child2 = + ewl_container_get_child_at(EWL_CONTAINER(child), x, y))) { if (child2->recursive) { - child = ewl_container_get_child_at(EWL_CONTAINER - (child), x, y); + child = ewl_container_get_child_at(EWL_CONTAINER(child), + x, y); if (!child) DRETURN_PTR(child2, DLEVEL_STABLE); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- ewl_entry.c 16 Apr 2002 18:22:56 -0000 1.37 +++ ewl_entry.c 19 Apr 2002 22:09:57 -0000 1.38 @@ -27,10 +27,6 @@ void __ewl_entry_delete_to_right(Ewl_Widget * w); void - - - - __ewl_entry_update_selected_region(Ewl_Widget * w, void *user_data, void *ev_data); @@ -132,12 +128,12 @@ ewl_callback_append(w, EWL_CALLBACK_REALIZE, __ewl_entry_realize, NULL); ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, __ewl_entry_configure, NULL); - ewl_callback_append(w, EWL_CALLBACK_KEY_DOWN, - __ewl_entry_key_down, NULL); - ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN, - __ewl_entry_mouse_down, NULL); - ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, - __ewl_entry_mouse_move, NULL); + ewl_callback_append(w, EWL_CALLBACK_KEY_DOWN, __ewl_entry_key_down, + NULL); + ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN, __ewl_entry_mouse_down, + NULL); + ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, __ewl_entry_mouse_move, + NULL); ewl_callback_append(w, EWL_CALLBACK_SELECT, __ewl_entry_select, NULL); ewl_callback_append(w, EWL_CALLBACK_DESELECT, __ewl_entry_deselect, NULL); @@ -261,8 +257,8 @@ } - ewl_object_request_geometry(EWL_OBJECT(e->selection), xx, - yy, ww, hh); + ewl_object_request_geometry(EWL_OBJECT(e->selection), xx, yy, + ww, hh); ewl_widget_configure(e->selection); } @@ -367,8 +363,8 @@ index = ewl_text_get_index_at(EWL_TEXT(e->text), (ev->x), (CURRENT_Y(e->text) + - (CURRENT_H(e->text) - / 2))); + (CURRENT_H(e->text) / + 2))); ee = index - ss; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_enums.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ewl_enums.h 17 Apr 2002 22:18:50 -0000 1.22 +++ ewl_enums.h 19 Apr 2002 22:09:57 -0000 1.23 @@ -93,8 +93,8 @@ EWL_FILL_POLICY_NONE = 0, EWL_FILL_POLICY_HSHRINK = 1, EWL_FILL_POLICY_VSHRINK = 2, - EWL_FILL_POLICY_SHRINK = EWL_FILL_POLICY_HSHRINK | - EWL_FILL_POLICY_VSHRINK, + EWL_FILL_POLICY_SHRINK = + EWL_FILL_POLICY_HSHRINK | EWL_FILL_POLICY_VSHRINK, EWL_FILL_POLICY_HFILL = 0x10, EWL_FILL_POLICY_VFILL = 0x20, EWL_FILL_POLICY_FILL = EWL_FILL_POLICY_HFILL | EWL_FILL_POLICY_VFILL, @@ -141,8 +141,8 @@ EWL_FX_MODIFIES_BLUE_CHANNEL, EWL_FX_MODIFIES_POSITION = (0x1 << 6), EWL_FX_MODIFIES_SIZE = (0x1 << 7), - EWL_FX_MODIFIES_GEOMETRY = EWL_FX_MODIFIES_POSITION | - EWL_FX_MODIFIES_SIZE + EWL_FX_MODIFIES_GEOMETRY = + EWL_FX_MODIFIES_POSITION | EWL_FX_MODIFIES_SIZE }; typedef enum _ewl_scrollbar_flags Ewl_ScrollBar_Flags; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- ewl_events.c 16 Apr 2002 18:22:56 -0000 1.24 +++ ewl_events.c 19 Apr 2002 22:09:57 -0000 1.25 @@ -117,8 +117,8 @@ * Configure events really only need to occur on resize. */ 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_object_request_geometry(EWL_OBJECT(window), 0, 0, ev->w, + ev->h); ewl_widget_configure(EWL_WIDGET(window)); } @@ -228,8 +228,8 @@ * matching key up event */ if (last_key) - ewl_callback_call_with_event_data(last_key, - EWL_CALLBACK_KEY_UP, ev); + ewl_callback_call_with_event_data(last_key, EWL_CALLBACK_KEY_UP, + ev); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_filedialog.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_filedialog.c 17 Apr 2002 22:29:59 -0000 1.1 +++ ewl_filedialog.c 19 Apr 2002 22:09:57 -0000 1.2 @@ -2,29 +2,30 @@ #include <Ewl.h> -void __save_dialog_init (Ewl_Filedialog *fd, Ewl_Callback_Function cb); -void __open_dialog_init (Ewl_Filedialog *fd, Ewl_Callback_Function cb); +void __save_dialog_init(Ewl_Filedialog * fd, + Ewl_Callback_Function cb); +void __open_dialog_init(Ewl_Filedialog * fd, + Ewl_Callback_Function cb); -void __destroy_dialog (Ewl_Widget *w, void *ev_data, void *user_data); +void __destroy_dialog(Ewl_Widget * w, void *ev_data, + void *user_data); typedef struct _open_dialog Open_Dialog; -struct _open_dialog -{ - Ewl_Widget * box; /* box to hold the buttons */ +struct _open_dialog { + Ewl_Widget *box; /* box to hold the buttons */ - Ewl_Widget * open; /* open button */ - Ewl_Widget * cancel; /* cancel button */ + Ewl_Widget *open; /* open button */ + Ewl_Widget *cancel; /* cancel button */ }; typedef struct _save_dialog Save_Dialog; -struct _save_dialog -{ - Ewl_Widget * inputbox; /* box to hold text input widgets */ - Ewl_Widget * buttonbox; /* box to hold buttons */ +struct _save_dialog { + Ewl_Widget *inputbox; /* box to hold text input widgets */ + Ewl_Widget *buttonbox; /* box to hold buttons */ - Ewl_Widget * save; /* save button */ - Ewl_Widget * cancel; /* cancel button */ + Ewl_Widget *save; /* save button */ + Ewl_Widget *cancel; /* cancel button */ }; @@ -36,9 +37,9 @@ * Returns a pointer to a newly allocated filedialog in success, NULL on * failure. */ -Ewl_Widget * -ewl_filedialog_new (Ewl_Widget *follows, Ewl_Filedialog_Type type, - Ewl_Callback_Function cb) +Ewl_Widget * +ewl_filedialog_new(Ewl_Widget * follows, Ewl_Filedialog_Type type, + Ewl_Callback_Function cb) { Ewl_Filedialog *fd; @@ -66,71 +67,73 @@ * Returns nothing. Iinitialize the filedialog to default values. */ void -ewl_filedialog_init (Ewl_Filedialog *fd, Ewl_Widget *follows, - Ewl_Filedialog_Type type, Ewl_Callback_Function cb) +ewl_filedialog_init(Ewl_Filedialog * fd, Ewl_Widget * follows, + Ewl_Filedialog_Type type, Ewl_Callback_Function cb) { - + DENTER_FUNCTION(DLEVEL_STABLE); ewl_floater_init(EWL_FLOATER(fd), follows); - fd->type = type; - + fd->type = type; + if (type == EWL_FILEDIALOG_TYPE_OPEN) __open_dialog_init(fd, cb); - else + else __save_dialog_init(fd, cb); - + DLEAVE_FUNCTION(DLEVEL_STABLE); } -void __open_dialog_init (Ewl_Filedialog *fd, Ewl_Callback_Function cb) +void +__open_dialog_init(Ewl_Filedialog * fd, Ewl_Callback_Function cb) { - Open_Dialog *od; - Ewl_Widget *separator; - + Open_Dialog *od; + Ewl_Widget *separator; + DENTER_FUNCTION(DLEVEL_STABLE); od = NEW(Open_Dialog, 1); - if (!od) return; + if (!od) + return; memset(od, 0, sizeof(Open_Dialog)); - + fd->selector = ewl_fileselector_new(cb); ewl_object_set_fill_policy(EWL_OBJECT(fd->selector), - EWL_FILL_POLICY_FILL); + EWL_FILL_POLICY_FILL); ewl_container_append_child(EWL_CONTAINER(fd), fd->selector); separator = ewl_vseparator_new(); ewl_container_append_child(EWL_CONTAINER(fd), separator); ewl_widget_show(separator); - + od->box = ewl_box_new(EWL_ORIENTATION_HORIZONTAL); ewl_box_set_spacing(EWL_BOX(od->box), 4); ewl_object_set_padding(EWL_OBJECT(od->box), 10, 10, 10, 10); ewl_object_set_fill_policy(EWL_OBJECT(od->box), - EWL_FILL_POLICY_VSHRINK); + EWL_FILL_POLICY_VSHRINK); ewl_object_set_alignment(EWL_OBJECT(od->box), EWL_ALIGNMENT_RIGHT); - + od->open = ewl_button_new("Open"); - ewl_object_set_fill_policy(EWL_OBJECT(od->open), - EWL_FILL_POLICY_SHRINK); + ewl_object_set_fill_policy(EWL_OBJECT(od->open), + EWL_FILL_POLICY_SHRINK); ewl_callback_append(od->open, EWL_CALLBACK_CLICKED, cb, fd->selector); - ewl_callback_append(od->open, EWL_CALLBACK_CLICKED, - __destroy_dialog, NULL); + ewl_callback_append(od->open, EWL_CALLBACK_CLICKED, + __destroy_dialog, NULL); ewl_container_append_child(EWL_CONTAINER(od->box), od->open); ewl_widget_show(od->open); - + od->cancel = ewl_button_new("Cancel"); - ewl_object_set_fill_policy(EWL_OBJECT(od->cancel), - EWL_FILL_POLICY_SHRINK); - ewl_callback_append(od->cancel, EWL_CALLBACK_CLICKED, - __destroy_dialog, NULL); + ewl_object_set_fill_policy(EWL_OBJECT(od->cancel), + EWL_FILL_POLICY_SHRINK); + ewl_callback_append(od->cancel, EWL_CALLBACK_CLICKED, + __destroy_dialog, NULL); ewl_container_append_child(EWL_CONTAINER(od->box), od->cancel); ewl_widget_show(od->cancel); @@ -145,20 +148,22 @@ } -void __save_dialog_init (Ewl_Filedialog *fd, Ewl_Callback_Function cb) +void +__save_dialog_init(Ewl_Filedialog * fd, Ewl_Callback_Function cb) { - Save_Dialog *sd; + Save_Dialog *sd; DENTER_FUNCTION(DLEVEL_STABLE); sd = NEW(Save_Dialog, 1); - if (!sd) return; + if (!sd) + return; memset(sd, 0, sizeof(Save_Dialog)); - + fd->selector = ewl_fileselector_new(cb); ewl_object_set_fill_policy(EWL_OBJECT(fd->selector), - EWL_FILL_POLICY_FILL); + EWL_FILL_POLICY_FILL); ewl_container_append_child(EWL_CONTAINER(fd), fd->selector); @@ -168,9 +173,10 @@ -void __destroy_dialog (Ewl_Widget *w, void *ev_data, void *user_data) +void +__destroy_dialog(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *fd; + Ewl_Widget *fd; fd = w->parent->parent; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_filedialog.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_filedialog.h 17 Apr 2002 22:29:59 -0000 1.1 +++ ewl_filedialog.h 19 Apr 2002 22:09:57 -0000 1.2 @@ -3,19 +3,21 @@ #define __EWL_FILEDIALOG_H__ typedef struct _ewl_filedialog Ewl_Filedialog; + #define EWL_FILEDIALOG(fd) ((Ewl_Filedialog *) fd) -struct _ewl_filedialog -{ - Ewl_Floater box; +struct _ewl_filedialog { + Ewl_Floater box; Ewl_Filedialog_Type type; - Ewl_Widget *selector; /* Ewl_Fileselector */ - void * dialog; /* open or save dialog */ + Ewl_Widget *selector; /* Ewl_Fileselector */ + void *dialog; /* open or save dialog */ }; -Ewl_Widget * ewl_filedialog_new (Ewl_Widget *follows, Ewl_Filedialog_Type type, - Ewl_Callback_Function cb); -void ewl_filedialog_init (Ewl_Filedialog *fd, Ewl_Widget *follows, - Ewl_Filedialog_Type type, Ewl_Callback_Function cb); +Ewl_Widget *ewl_filedialog_new(Ewl_Widget * follows, + Ewl_Filedialog_Type type, + Ewl_Callback_Function cb); +void ewl_filedialog_init(Ewl_Filedialog * fd, Ewl_Widget * follows, + Ewl_Filedialog_Type type, + Ewl_Callback_Function cb); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fileselector.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_fileselector.c 17 Apr 2002 22:07:29 -0000 1.2 +++ ewl_fileselector.c 19 Apr 2002 22:09:57 -0000 1.3 @@ -2,10 +2,13 @@ #include <Ewl.h> -void __ewl_fileselector_realize (Ewl_Widget *w, void *ev_data, void *user_data); -void __ewl_fileselector_configure(Ewl_Widget *w, void *ev_data, void *user_data); -void __directory_clicked (Ewl_Widget *w, void *ev_data, void *user_data); -void __process_directory (Ewl_Fileselector *fs, char *dir); +void __ewl_fileselector_realize(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_fileselector_configure(Ewl_Widget * w, void *ev_data, + void *user_data); +void __directory_clicked(Ewl_Widget * w, void *ev_data, + void *user_data); +void __process_directory(Ewl_Fileselector * fs, char *dir); /** * ewl_fileselector_new - create a new fileselector @@ -14,8 +17,8 @@ * Returns a pointer to a newly allocated fileselector on success, NULL * on failure. */ -Ewl_Widget * -ewl_fileselector_new (Ewl_Callback_Function file_clicked) +Ewl_Widget * +ewl_fileselector_new(Ewl_Callback_Function file_clicked) { Ewl_Fileselector *fs; @@ -39,10 +42,10 @@ * Returns nothing. Initialize the fileselector to default values */ void -ewl_fileselector_init (Ewl_Fileselector *fs, Ewl_Callback_Function fc) +ewl_fileselector_init(Ewl_Fileselector * fs, Ewl_Callback_Function fc) { - Ewl_Widget *w; - + Ewl_Widget *w; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("fs", fs); @@ -63,11 +66,11 @@ ewl_widget_show(fs->fbox); fs->file_clicked = fc; - + ewl_callback_append(w, EWL_CALLBACK_REALIZE, - __ewl_fileselector_realize, NULL); + __ewl_fileselector_realize, NULL); ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, - __ewl_fileselector_configure, NULL); + __ewl_fileselector_configure, NULL); DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -75,10 +78,10 @@ void -__ewl_fileselector_realize (Ewl_Widget *w, void *ev_data, void *user_data) +__ewl_fileselector_realize(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Fileselector *fs; - char *home; + char *home; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -94,10 +97,10 @@ void -__ewl_fileselector_configure(Ewl_Widget *w, void *ev_data, void *user_data) +__ewl_fileselector_configure(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Fileselector *fs; - + DENTER_FUNCTION(DLEVEL_STABLE); @@ -111,12 +114,12 @@ void -__directory_clicked(Ewl_Widget *w, void *ev_data, void *user_data) +__directory_clicked(Ewl_Widget * w, void *ev_data, void *user_data) { - char dir[PATH_MAX]; - int index; + char dir[PATH_MAX]; + int index; Ewl_Fileselector *fs; - + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -125,8 +128,7 @@ fs = EWL_FILESELECTOR(user_data); index = (int) ewl_widget_get_data(w, (void *) w->parent); - sprintf(dir, "%s/%s", fs->d_info[index].path, - fs->d_info[index].name); + sprintf(dir, "%s/%s", fs->d_info[index].path, fs->d_info[index].name); __process_directory(EWL_FILESELECTOR(user_data), dir); @@ -135,14 +137,14 @@ void -__process_directory(Ewl_Fileselector *fs, char *directory) +__process_directory(Ewl_Fileselector * fs, char *directory) { - char **dir_head, **file_head; - char file[PATH_MAX]; + char **dir_head, **file_head; + char file[PATH_MAX]; struct dirent **dentries; - struct stat statBuffer; - int num, i, f_count, d_count, result; - char dir[PATH_MAX]; + struct stat statBuffer; + int num, i, f_count, d_count, result; + char dir[PATH_MAX]; Ewl_Table_Child *tc; @@ -156,12 +158,12 @@ strncpy(dir, directory, PATH_MAX); if ((num = scandir(dir, &dentries, 0, alphasort)) < 0) { - perror ("__process_directory - scandir"); + perror("__process_directory - scandir"); return; } - + --num; - + /** * count the number of regular files and number of directories */ @@ -170,10 +172,10 @@ sprintf(file, "%s/%s", dir, dentries[i]->d_name); result = stat(file, &statBuffer); if (result == -1) { - perror ("__process_directory - stat 1"); + perror("__process_directory - stat 1"); continue; } - + if (S_ISDIR(statBuffer.st_mode)) d_count++; else if (S_ISREG(statBuffer.st_mode)) @@ -182,24 +184,28 @@ continue; } } - d_count += 3; /* add 3 to d_count for the dir header, '.' and '..' */ - f_count++; /* add 1 to f_count for the file header */ - - + d_count += 3; /* add 3 to d_count for the dir header, '.' and '..' */ + f_count++; /* add 1 to f_count for the file header */ + + /** * time to create the tables to hold the files and directories, * and also initialize the arrays to hold the dir/file info */ IF_FREE(fs->f_info); IF_FREE(fs->d_info); - + fs->f_info = NEW(Ewl_Fileinfo, f_count); fs->d_info = NEW(Ewl_Dirinfo, d_count); - dir_head = NEW(char *, 1); dir_head[0] = "Directory"; - file_head = NEW(char *, 1); file_head[0] = "File Name"; - - if(fs->dirs) + dir_head = NEW(char *, 1); + + dir_head[0] = "Directory"; + file_head = NEW(char *, 1); + + file_head[0] = "File Name"; + + if (fs->dirs) ewl_table_reset(EWL_TABLE(fs->dirs), 1, d_count, dir_head); else { fs->dirs = ewl_table_new(1, d_count, dir_head); @@ -220,12 +226,13 @@ * ready to start filling in the tables with directory and file * information */ - result = 0; + result = 0; for (i = num; i >= 0; i--) { /* make sure there exists non-hidden files/directories */ - if (d_count == 0 && f_count == 0) break; + if (d_count == 0 && f_count == 0) + break; /* if the current file is not hidden (start with .), add * it to the table @@ -235,10 +242,10 @@ sprintf(file, "%s/%s", dir, dentries[i]->d_name); result = stat(file, &statBuffer); if (result == -1) { - perror ("__process_directory - stat 2: "); + perror("__process_directory - stat 2: "); continue; } - + /* if the file is a directory add it to the dir * table */ @@ -246,27 +253,29 @@ printf("dir: %s\n", file); d_count--; strncpy(fs->d_info[d_count].name, - (const char *)dentries[i]->d_name, + (const char *) dentries[i]->d_name, PATH_MAX); strncpy(fs->d_info[d_count].path, - (const char *) dir, PATH_MAX); + (const char *) dir, PATH_MAX); fs->d_info[d_count].dirEntry = dentries[i]; tc = (Ewl_Table_Child *) - ewl_table_add_return(EWL_TABLE(fs->dirs), - dentries[i]->d_name, - 1, 1, d_count+1, d_count+1); + ewl_table_add_return(EWL_TABLE + (fs->dirs), + dentries[i]-> + d_name, 1, 1, + d_count + 1, + d_count + 1); ewl_widget_show(EWL_WIDGET(tc)); - + ewl_callback_append(EWL_WIDGET(tc->widget), - EWL_CALLBACK_MOUSE_UP, - __directory_clicked, - fs); - - ewl_widget_set_data(tc->widget, - (void *) tc, (int *)d_count); - + EWL_CALLBACK_MOUSE_UP, + __directory_clicked, fs); + + ewl_widget_set_data(tc->widget, (void *) tc, + (int *) d_count); + } /* else if it is a regulare file add it to the * file table @@ -275,34 +284,37 @@ printf("file: %s\n", file); f_count--; strncpy(fs->f_info[f_count].name, - (const char *)dentries[i]->d_name, + (const char *) dentries[i]->d_name, PATH_MAX); - strncpy(fs->f_info[f_count].path, - (const char *) dir, PATH_MAX); + strncpy(fs->f_info[f_count].path, + (const char *) dir, PATH_MAX); fs->f_info[f_count].status = statBuffer; tc = (Ewl_Table_Child *) - ewl_table_add_return(EWL_TABLE(fs->files), - dentries[i]->d_name, - 1, 1, f_count+1, f_count+1); + ewl_table_add_return(EWL_TABLE + (fs->files), + dentries[i]-> + d_name, 1, 1, + f_count + 1, + f_count + 1); ewl_widget_show(EWL_WIDGET(tc)); if (fs->file_clicked != NULL) { - ewl_callback_append( - EWL_WIDGET(tc->widget), - EWL_CALLBACK_MOUSE_UP, - fs->file_clicked, - fs); + ewl_callback_append(EWL_WIDGET + (tc->widget), + EWL_CALLBACK_MOUSE_UP, + fs->file_clicked, + fs); } - - ewl_widget_set_data(tc->widget, - (void *) tc, (int *)f_count); + + ewl_widget_set_data(tc->widget, (void *) tc, + (int *) f_count); } else continue; - + } } @@ -314,30 +326,30 @@ strcpy(fs->d_info[d_count].path, dir); tc = (Ewl_Table_Child *) ewl_table_add_return(EWL_TABLE(fs->dirs), - "..", 1, 1, d_count+1, d_count+1); + "..", 1, 1, d_count + 1, + d_count + 1); ewl_widget_show(EWL_WIDGET(tc)); ewl_callback_append(EWL_WIDGET(tc), EWL_CALLBACK_MOUSE_UP, - __directory_clicked, fs); - ewl_widget_set_data(tc->widget, (void *) tc, (int *)d_count); - - + __directory_clicked, fs); + ewl_widget_set_data(tc->widget, (void *) tc, (int *) d_count); + + d_count--; strcpy(fs->d_info[d_count].name, "."); strcpy(fs->d_info[d_count].path, dir); - + tc = (Ewl_Table_Child *) ewl_table_add_return(EWL_TABLE(fs->dirs), - ".", 1, 1, d_count+1, d_count+1); + ".", 1, 1, d_count + 1, + d_count + 1); ewl_widget_show(EWL_WIDGET(tc)); ewl_callback_append(EWL_WIDGET(tc), EWL_CALLBACK_MOUSE_UP, - __directory_clicked, fs); - ewl_widget_set_data(tc->widget, (void *) tc, (int *)d_count); - + __directory_clicked, fs); + ewl_widget_set_data(tc->widget, (void *) tc, (int *) d_count); + + - ewl_widget_configure(EWL_WIDGET(fs)); - + DLEAVE_FUNCTION(DLEVEL_STABLE); } - - =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_floater.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_floater.c 16 Apr 2002 18:22:56 -0000 1.3 +++ ewl_floater.c 19 Apr 2002 22:09:57 -0000 1.4 @@ -94,8 +94,8 @@ */ ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, __ewl_floater_configure, NULL); - ewl_callback_prepend(w, EWL_CALLBACK_REALIZE, - __ewl_floater_realize, NULL); + ewl_callback_prepend(w, EWL_CALLBACK_REALIZE, __ewl_floater_realize, + NULL); ewl_callback_append(w, EWL_CALLBACK_DESTROY, __ewl_floater_destroy, NULL); ewl_callback_insert_after(w, EWL_CALLBACK_REPARENT, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fx.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- ewl_fx.c 16 Apr 2002 18:22:56 -0000 1.24 +++ ewl_fx.c 19 Apr 2002 22:09:57 -0000 1.25 @@ -162,8 +162,8 @@ * Now determine the number of callbacks for that specific * effect. */ - snprintf(key, PATH_LEN, "/user/%s/%i/callbacks/count", - wname, i); + snprintf(key, PATH_LEN, "/user/%s/%i/callbacks/count", wname, + i); cb_count = ewl_config_get_int("fx", key); /* @@ -175,16 +175,16 @@ * Determine the starting event. */ snprintf(key, PATH_LEN, - "/user/%s/%i/callbacks/%i/cb_start", - wname, i, j); + "/user/%s/%i/callbacks/%i/cb_start", wname, i, + j); start = ewl_config_get_int("fx", key); /* * Determine the ending event. */ snprintf(key, PATH_LEN, - "/user/%s/%i/callbacks/%i/cb_stop", - wname, i, j); + "/user/%s/%i/callbacks/%i/cb_stop", wname, i, + j); end = ewl_config_get_int("fx", key); /* @@ -1139,8 +1139,8 @@ /* * Determine the number of callbacks for this effect. */ - snprintf(key, PATH_LEN, "/user/%s/%i/callbacks/count", - wname, i); + snprintf(key, PATH_LEN, "/user/%s/%i/callbacks/count", wname, + i); cb_count = ewl_config_get_int("fx", key); /* @@ -1152,16 +1152,16 @@ * Determine the event that starts this effect. */ snprintf(key, PATH_LEN, - "/user/%s/%i/callbacks/%i/cb_start", - wname, i, j); + "/user/%s/%i/callbacks/%i/cb_start", wname, i, + j); start = ewl_config_get_int("fx", key); /* * Determine the event that stops this effect. */ snprintf(key, PATH_LEN, - "/user/%s/%i/callbacks/%i/cb_stop", - wname, i, j); + "/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_fx.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_fx.h 16 Apr 2002 18:22:56 -0000 1.14 +++ ewl_fx.h 19 Apr 2002 22:09:57 -0000 1.15 @@ -51,11 +51,6 @@ void ewl_fx_deinit_widget(Ewl_Widget * w); int - - - - - ewl_fx_add_proto(char *name, Ewl_FX_Function fx_start, Ewl_FX_Timer_Function fx_cont, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_grid.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_grid.c 16 Apr 2002 18:22:56 -0000 1.1 +++ ewl_grid.c 19 Apr 2002 22:09:57 -0000 1.2 @@ -411,8 +411,8 @@ c_y += g->row_size[i].size; - ewl_object_request_geometry(EWL_OBJECT(child), - c_x, c_y, c_w, c_h); + ewl_object_request_geometry(EWL_OBJECT(child), c_x, c_y, c_w, + c_h); ewl_widget_configure(child); /* reset geometry values for the next child */ @@ -622,14 +622,14 @@ */ if (o == EWL_ORIENTATION_HORIZONTAL) { info = g->col_size; - start_off = (unsigned int) &cdata->start_col - - (unsigned int) cdata; + start_off = + (unsigned int) &cdata->start_col - (unsigned int) cdata; end_off = (unsigned int) &cdata->end_col - (unsigned int) cdata; widget_size = ewl_object_get_preferred_w; } else { info = g->row_size; - start_off = (unsigned int) &cdata->start_row - - (unsigned int) cdata; + start_off = + (unsigned int) &cdata->start_row - (unsigned int) cdata; end_off = (unsigned int) &cdata->end_row - (unsigned int) cdata; widget_size = ewl_object_get_preferred_h; } @@ -654,8 +654,7 @@ */ give = size / num_spread; for (i = *(int *) (cdata + start_off) - 1; - i < *(int *) (cdata + end_off) - && num_spread; i++) { + i < *(int *) (cdata + end_off) && num_spread; i++) { if (!info[i].override) { /* =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_grid.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_grid.h 16 Apr 2002 18:22:56 -0000 1.1 +++ ewl_grid.h 19 Apr 2002 22:09:57 -0000 1.2 @@ -51,8 +51,8 @@ void ewl_grid_init(Ewl_Grid * g, int cols, int rows); void ewl_grid_add(Ewl_Grid * g, Ewl_Widget * w, - int start_col, int end_col, - int start_row, int end_row); + int start_col, int end_col, int start_row, + int end_row); void ewl_grid_set_col_w(Ewl_Grid * g, int col, int width); void ewl_grid_set_row_h(Ewl_Grid * g, int row, int height); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_image.c 16 Apr 2002 18:22:56 -0000 1.14 +++ ewl_image.c 19 Apr 2002 22:09:57 -0000 1.15 @@ -137,10 +137,10 @@ __ewl_image_configure, NULL); ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN, __ewl_image_mouse_down, NULL); - ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, - __ewl_image_mouse_up, NULL); - ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, - __ewl_image_mouse_move, NULL); + ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, __ewl_image_mouse_up, + NULL); + ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, __ewl_image_mouse_move, + NULL); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -213,7 +213,7 @@ /* * Determine the type of the file based on the filename. */ -static Ewl_Image_Type +static Ewl_Image_Type __ewl_image_get_type(const char *i) { int l; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_list.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- ewl_list.c 16 Apr 2002 18:22:57 -0000 1.20 +++ ewl_list.c 19 Apr 2002 22:09:57 -0000 1.21 @@ -182,8 +182,8 @@ ewl_callback_append(w, EWL_CALLBACK_REALIZE, __ewl_list_realize, NULL); ewl_callback_append(w, EWL_CALLBACK_SHOW, __ewl_list_show, NULL); ewl_callback_append(w, EWL_CALLBACK_HIDE, __ewl_list_hide, NULL); - ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, - __ewl_list_configure, NULL); + ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, __ewl_list_configure, + NULL); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_notebook.c 16 Apr 2002 18:22:57 -0000 1.14 +++ ewl_notebook.c 19 Apr 2002 22:09:57 -0000 1.15 @@ -585,12 +585,12 @@ /* * Attach the necessary callbacks for the notebook */ - ewl_callback_append(w, EWL_CALLBACK_REALIZE, - __ewl_notebook_realize, NULL); - ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, - __ewl_notebook_configure, NULL); - ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, - __ewl_notebook_destroy, NULL); + ewl_callback_append(w, EWL_CALLBACK_REALIZE, __ewl_notebook_realize, + NULL); + ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, __ewl_notebook_configure, + NULL); + ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, __ewl_notebook_destroy, + NULL); ewl_callback_del(w, EWL_CALLBACK_CONFIGURE, __ewl_container_configure_clip_box); @@ -774,8 +774,8 @@ } - ewl_object_request_geometry(EWL_OBJECT(n->tab_box), rx, ry, - rw, rh); + ewl_object_request_geometry(EWL_OBJECT(n->tab_box), rx, ry, rw, + rh); ewl_widget_configure(n->tab_box); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_object.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- ewl_object.c 16 Apr 2002 18:22:57 -0000 1.21 +++ ewl_object.c 19 Apr 2002 22:09:57 -0000 1.22 @@ -369,8 +369,8 @@ * Bound the width by the preferred size first. */ if ((w < o->preferred.w && !(o->fill_policy & EWL_FILL_POLICY_HSHRINK)) - || (w > o->preferred.w - && !(o->fill_policy & EWL_FILL_POLICY_HFILL))) + || (w > o->preferred.w && + !(o->fill_policy & EWL_FILL_POLICY_HFILL))) w = o->preferred.w; /* @@ -402,8 +402,8 @@ * Bound the width by the preferred size first. */ if ((h < o->preferred.h && !(o->fill_policy & EWL_FILL_POLICY_VSHRINK)) - || (h > o->preferred.h - && !(o->fill_policy & EWL_FILL_POLICY_VFILL))) + || (h > o->preferred.h && + !(o->fill_policy & EWL_FILL_POLICY_VFILL))) h = o->preferred.h; /* @@ -900,7 +900,7 @@ * * Returns the value stored in the objects alignment attribute. */ -inline Ewl_Alignment +inline Ewl_Alignment ewl_object_get_alignment(Ewl_Object * o) { DCHECK_PARAM_PTR_RET("o", o, EWL_ALIGNMENT_LEFT); @@ -916,7 +916,7 @@ * * Returns the value stored in the objects fill policy attribute. */ -inline Ewl_Fill_Policy +inline Ewl_Fill_Policy ewl_object_get_fill_policy(Ewl_Object * o) { DCHECK_PARAM_PTR_RET("o", o, EWL_FILL_POLICY_NORMAL); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_seeker.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- ewl_seeker.c 16 Apr 2002 18:22:57 -0000 1.26 +++ ewl_seeker.c 19 Apr 2002 22:09:57 -0000 1.27 @@ -120,8 +120,8 @@ NULL); ewl_callback_append(w, EWL_CALLBACK_THEME_UPDATE, __ewl_seeker_theme_update, NULL); - ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN, - __ewl_seeker_mouse_down, NULL); + ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN, __ewl_seeker_mouse_down, + NULL); ewl_callback_append(w, EWL_CALLBACK_APPEARANCE_CHANGED, __ewl_seeker_appearance_changed, NULL); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_selectionbar.c 17 Apr 2002 22:07:29 -0000 1.2 +++ ewl_selectionbar.c 19 Apr 2002 22:09:57 -0000 1.3 @@ -1,25 +1,32 @@ #include <Ewl.h> -void __ewl_selectionbar_realize(Ewl_Widget * w, void *ev_data, void *user_data); -void __ewl_selectionbar_show(Ewl_Widget *w, void *ev_data, void *user_data); -void __ewl_selectionbar_configure(Ewl_Widget * w, void *ev_data, void *user_data); -void __ewl_selectionbar_parent_configure(Ewl_Widget *w, void *ev_data, void *user_data); -void __focus_in(Ewl_Widget * w, void *ev_data, void *user_data); -void __focus_out(Ewl_Widget * w, void *ev_data, void *user_data); +void __ewl_selectionbar_realize(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_selectionbar_show(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_selectionbar_configure(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_selectionbar_parent_configure(Ewl_Widget * w, + void *ev_data, + void *user_data); +void __focus_in(Ewl_Widget * w, void *ev_data, void *user_data); +void __focus_out(Ewl_Widget * w, void *ev_data, void *user_data); + +void __children_animator(Ewl_Widget * w, void *ev_data, + void *user_data); + +void __mouse_move_over_children(Ewl_Widget * w, void *user_data, + void *ev_data); -void __children_animator(Ewl_Widget * w, void *ev_data, void *user_data); +void __child_add(Ewl_Container * parent, Ewl_Widget * child); -void __mouse_move_over_children(Ewl_Widget *w, void *user_data, void *ev_data); +void __open_bar_cb(int val, void *ev_data); +void __close_bar_cb(int val, void *ev_data); -void __child_add(Ewl_Container *parent, Ewl_Widget *child); -void __open_bar_cb(int val, void *ev_data); -void __close_bar_cb(int val, void *ev_data); - - -char open_string [100]; -char close_string[100]; +char open_string[100]; +char close_string[100]; /** * ewl_selectionbar_new - create a new selectionbar @@ -27,12 +34,13 @@ * Returns a pointer to a newly allocated scrollpane on success, NULL on * failure. */ -Ewl_Widget *ewl_selectionbar_new(Ewl_Widget *parent) +Ewl_Widget * +ewl_selectionbar_new(Ewl_Widget * parent) { Ewl_Selectionbar *s; DENTER_FUNCTION(DLEVEL_STABLE); - + s = NEW(Ewl_Selectionbar, 1); if (!s) DRETURN_PTR(NULL, DLEVEL_STABLE); @@ -41,7 +49,7 @@ ewl_selectionbar_init(s, parent); - + DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE); } @@ -53,16 +61,17 @@ * Returns no value. Sets up the default callbacks and values for the * the selectionbar */ -void ewl_selectionbar_init(Ewl_Selectionbar * s, Ewl_Widget *parent) +void +ewl_selectionbar_init(Ewl_Selectionbar * s, Ewl_Widget * parent) { - Ewl_Widget *w; - Ewl_Window *window; + Ewl_Widget *w; + Ewl_Window *window; + - DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("s", s); - + w = EWL_WIDGET(s); ewl_floater_init(EWL_FLOATER(s), parent); @@ -70,60 +79,64 @@ __ewl_selectionbar_configure, NULL); ewl_callback_append(w, EWL_CALLBACK_REALIZE, __ewl_selectionbar_realize, NULL); - ewl_callback_append(w, EWL_CALLBACK_SHOW, - __ewl_selectionbar_show, NULL); + ewl_callback_append(w, EWL_CALLBACK_SHOW, __ewl_selectionbar_show, + NULL); ewl_theme_data_set_str(EWL_WIDGET(s), - "/appearance/box/vertical/base/visible", "no"); + "/appearance/box/vertical/base/visible", "no"); s->bar = NEW(Ewl_Container, 1); memset(s->bar, 0, sizeof(Ewl_Container)); - - ewl_container_init(EWL_CONTAINER(s->bar), "/appearance/box/vertical", - NULL, NULL); + + ewl_container_init(EWL_CONTAINER(s->bar), "/appearance/box/vertical", + NULL, NULL); ewl_object_set_fill_policy(EWL_OBJECT(s->bar), EWL_FILL_POLICY_NORMAL); ewl_container_append_child(EWL_CONTAINER(w), EWL_WIDGET(s->bar)); ewl_callback_append(EWL_WIDGET(s->bar), EWL_CALLBACK_FOCUS_OUT, - __focus_out, w); + __focus_out, w); ewl_callback_append(EWL_WIDGET(s->bar), EWL_CALLBACK_FOCUS_IN, - __focus_in, w); + __focus_in, w); ewl_theme_data_set_str(EWL_WIDGET(s->bar), - "/appearance/box/vertical/base/visible", "yes"); + "/appearance/box/vertical/base/visible", "yes"); + - window = ewl_window_find_window_by_widget(parent); ewl_callback_append(EWL_WIDGET(window), EWL_CALLBACK_CONFIGURE, - __ewl_selectionbar_parent_configure, w); - - + __ewl_selectionbar_parent_configure, w); + + s->scroller.top = ewl_vbox_new(); ewl_object_request_size(EWL_OBJECT(s->scroller.top), 30, 10); ewl_container_append_child(s->bar, s->scroller.top); + /* ewl_callback_append(s->scroller.top, EWL_CALLBACK_MOUSE_MOVE, __mouse_move_over_children, s); -*/ ewl_theme_data_set_str(s->scroller.top, - "/appearance/box/vertical/base/visible", "yes"); - - +*/ ewl_theme_data_set_str(s->scroller.top, + "/appearance/box/vertical/base/visible", + "yes"); + + s->scroller.bottom = ewl_vbox_new(); ewl_object_request_size(EWL_OBJECT(s->scroller.bottom), 30, 10); ewl_container_append_child(s->bar, s->scroller.bottom); + /* ewl_callback_append(s->scroller.bottom, EWL_CALLBACK_MOUSE_MOVE, __mouse_move_over_children, s); -*/ ewl_theme_data_set_str(s->scroller.bottom, - "/appearance/box/vertical/base/visible", "yes"); +*/ ewl_theme_data_set_str(s->scroller.bottom, + "/appearance/box/vertical/base/visible", + "yes"); + - ewl_container_add_notify(EWL_CONTAINER(w), __child_add); - + sprintf(open_string, "open_%p", w); sprintf(close_string, "close_%p", w); printf("open string = %s\n", open_string); printf("close string = %s\n", close_string); - + s->OPEN = 1; s->mouse_x = 0; @@ -131,14 +144,15 @@ } -void __child_add (Ewl_Container *parent, Ewl_Widget *child) +void +__child_add(Ewl_Container * parent, Ewl_Widget * child) { ewl_container_append_child(EWL_SELECTIONBAR(parent)->bar, child); ewl_container_remove_child(parent, child); ewl_callback_append(child, EWL_CALLBACK_MOUSE_MOVE, - __mouse_move_over_children, parent); - + __mouse_move_over_children, parent); + } @@ -147,7 +161,8 @@ * * Returns no value */ -void ewl_selectionbar_set_size(Ewl_Selectionbar * s, int w, int h1, int h2) +void +ewl_selectionbar_set_size(Ewl_Selectionbar * s, int w, int h1, int h2) { DENTER_FUNCTION(DLEVEL_STABLE); @@ -175,12 +190,12 @@ s->w = CURRENT_W(EWL_OBJECT(w->parent)); if (!s->h) s->h = 80; - - ewl_object_request_size (EWL_OBJECT(w), s->w, s->h); - ewl_object_request_size (EWL_OBJECT(s->bar), s->w, s->h); + + ewl_object_request_size(EWL_OBJECT(w), s->w, s->h); + ewl_object_request_size(EWL_OBJECT(s->bar), s->w, s->h); ewl_object_set_maximum_height(EWL_OBJECT(s->bar), s->h); - + ewl_widget_show(EWL_WIDGET(EWL_SELECTIONBAR(w)->scroller.top)); ewl_widget_show(EWL_WIDGET(EWL_SELECTIONBAR(w)->scroller.bottom)); ewl_widget_show(EWL_WIDGET(EWL_SELECTIONBAR(w)->bar)); @@ -191,37 +206,37 @@ void -__ewl_selectionbar_show(Ewl_Widget *w, void *ev_data, void *user_data) +__ewl_selectionbar_show(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Selectionbar *s; + s = EWL_SELECTIONBAR(w); - + ecore_add_event_timer(close_string, 0.01, __close_bar_cb, 1, s->bar); } void -__ewl_selectionbar_configure(Ewl_Widget * w, void *ev_data, - void *user_data) +__ewl_selectionbar_configure(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Selectionbar *s; - Ewl_Widget *child; - Ewd_List *children; - + Ewl_Widget *child; + Ewd_List *children; + DENTER_FUNCTION(DLEVEL_STABLE); s = EWL_SELECTIONBAR(w); - if(s->w < CURRENT_W(EWL_OBJECT(EWL_FLOATER(s)->follows))) + if (s->w < CURRENT_W(EWL_OBJECT(EWL_FLOATER(s)->follows))) s->w = CURRENT_W(EWL_OBJECT(EWL_FLOATER(s)->follows)); - - if(s->w > CURRENT_W(EWL_OBJECT(EWL_FLOATER(s)->follows))) + + if (s->w > CURRENT_W(EWL_OBJECT(EWL_FLOATER(s)->follows))) s->w = CURRENT_W(EWL_OBJECT(EWL_FLOATER(s)->follows)); - if(CURRENT_H(EWL_OBJECT(s)) < 5) + if (CURRENT_H(EWL_OBJECT(s)) < 5) ewl_object_request_h(EWL_OBJECT(s), 5); - - + + ewl_widget_configure(EWL_WIDGET(s->bar)); /* @@ -230,11 +245,11 @@ */ children = EWL_CONTAINER(EWL_FLOATER(w)->follows)->children; - - if(children) { + + if (children) { ewd_list_goto_first(children); - while((child = ewd_list_next(children)) != NULL) - // printf("child layer = %d\n", LAYER(child)); + while ((child = ewd_list_next(children)) != NULL) + // printf("child layer = %d\n", LAYER(child)); s = s; } @@ -244,10 +259,11 @@ void -__ewl_selectionbar_parent_configure(Ewl_Widget *w, void *ev_data, void *user_data) +__ewl_selectionbar_parent_configure(Ewl_Widget * w, void *ev_data, + void *user_data) { Ewl_Selectionbar *s; - Ewl_Object *o; + Ewl_Object *o; DENTER_FUNCTION(DLEVEL_STABLE); @@ -260,7 +276,7 @@ ewl_object_request_size(o, s->w, CURRENT_H(EWL_OBJECT(s->bar))); - + if (CURRENT_H(EWL_OBJECT(s->bar)) < 5) ewl_object_request_size(o, s->w, 5); __focus_out(EWL_WIDGET(s->bar), NULL, s); @@ -270,45 +286,45 @@ } void -__focus_in (Ewl_Widget *w, void *ev_data, void *user_data) +__focus_in(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Selectionbar *s; - Ewl_Object *o; - Ewd_List *children; - Ewl_Widget *child; - int cum_width; + Ewl_Object *o; + Ewd_List *children; + Ewl_Widget *child; + int cum_width; DENTER_FUNCTION(DLEVEL_STABLE); - - + + s = EWL_SELECTIONBAR(user_data); o = EWL_OBJECT(w); children = EWL_CONTAINER(w)->children; cum_width = 0; - - if(s->OPEN) return; + + if (s->OPEN) + return; ecore_add_event_timer(open_string, 0.01, __open_bar_cb, 1, w); - + ewl_widget_show(s->scroller.top); ewl_widget_show(s->scroller.bottom); - + ewd_list_goto_first(children); while ((child = ewd_list_next(children)) != NULL) { if (child != EWL_WIDGET(s->scroller.top) && - child != EWL_WIDGET(s->scroller.bottom)) - { + child != EWL_WIDGET(s->scroller.bottom)) { + + ewl_object_request_size(EWL_OBJECT(child), 60, 40); - ewl_object_request_size(EWL_OBJECT(child), - 60, 40); - ewl_object_request_position(EWL_OBJECT(child), - CURRENT_X(o) + cum_width, - CURRENT_Y(o) + ((CURRENT_H(o) - - CURRENT_H(child)) / 2)); + CURRENT_X(o) + cum_width, + CURRENT_Y(o) + + ((CURRENT_H(o) - + CURRENT_H(child)) / 2)); ewl_widget_show(child); @@ -317,7 +333,7 @@ } s->OPEN = 1; - + /* ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, __children_animator, s); @@ -327,24 +343,24 @@ void -__focus_out (Ewl_Widget *w, void *ev_data, void *user_data) +__focus_out(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Selectionbar *s; - Ewd_List *children; - Ewl_Widget *child; - Ewl_Window *window; - Ewl_Object *o; - - int mx, my; - int wx, wy; - int ww, wh; - + Ewd_List *children; + Ewl_Widget *child; + Ewl_Window *window; + Ewl_Object *o; + + int mx, my; + int wx, wy; + int ww, wh; + DENTER_FUNCTION(DLEVEL_STABLE); s = EWL_SELECTIONBAR(user_data); o = EWL_OBJECT(w); children = EWL_CONTAINER(w)->children; - + /* * First check that the mouse left the selectionbar and that @@ -357,73 +373,76 @@ wy = CURRENT_Y(o); ww = CURRENT_W(o); wh = CURRENT_H(o); - - if((((mx > wx) && (mx < (wx + ww))) && ((my > wy) && (my < (wy + wh))))) + + if ((((mx > wx) && (mx < (wx + ww))) && + ((my > wy) && (my < (wy + wh))))) return; - + ewl_callback_del(w, EWL_CALLBACK_MOUSE_MOVE, __children_animator); - + ewl_widget_hide(s->scroller.top); ewl_widget_hide(s->scroller.bottom); - + ewd_list_goto_first(children); while ((child = ewd_list_next(children)) != NULL) if (child != EWL_WIDGET(s->scroller.top) && - child != EWL_WIDGET(s->scroller.bottom)) - ewl_widget_hide(child); + child != EWL_WIDGET(s->scroller.bottom)) + ewl_widget_hide(child); s->OPEN = 0; ecore_add_event_timer(close_string, 0.01, __close_bar_cb, 1, w); - + DLEAVE_FUNCTION(DLEVEL_STABLE); } - -void __open_bar_cb(int val, void *ev_data) + +void +__open_bar_cb(int val, void *ev_data) { - Ewl_Widget *w; - Ewl_Object *o; - Ewl_Object *so; + Ewl_Widget *w; + Ewl_Object *o; + Ewl_Object *so; Ewl_Selectionbar *s; ecore_del_event_timer(close_string); - + w = EWL_WIDGET(ev_data); o = EWL_OBJECT(w); s = EWL_SELECTIONBAR(w->parent); so = EWL_OBJECT(s); - if(CURRENT_H(o) < s->h) { + if (CURRENT_H(o) < s->h) { ewl_object_request_size(o, s->w, CURRENT_H(o) + s->h / 10); ewl_object_request_size(so, CURRENT_W(o), CURRENT_H(o)); - ecore_add_event_timer(open_string, 0.01, __open_bar_cb, ++val, w); + ecore_add_event_timer(open_string, 0.01, __open_bar_cb, ++val, + w); ewl_widget_configure(EWL_WIDGET(s)); - } - else { + } else { ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, - __children_animator, s); + __children_animator, s); ewl_callback_append(s->scroller.top, EWL_CALLBACK_MOUSE_MOVE, - __mouse_move_over_children, s); + __mouse_move_over_children, s); ewl_callback_append(s->scroller.bottom, EWL_CALLBACK_MOUSE_MOVE, - __mouse_move_over_children, s); + __mouse_move_over_children, s); } } -void __close_bar_cb(int val, void *ev_data) +void +__close_bar_cb(int val, void *ev_data) { - Ewl_Widget *w; - Ewl_Object *o; - Ewl_Object *so; + Ewl_Widget *w; + Ewl_Object *o; + Ewl_Object *so; Ewl_Selectionbar *s; ecore_del_event_timer(open_string); @@ -433,29 +452,32 @@ s = EWL_SELECTIONBAR(w->parent); so = EWL_OBJECT(s); - if(CURRENT_H(o) > 10) { - ewl_object_request_size(o, s->w, CURRENT_H(o)-(s->h/10)+5); - ewl_object_request_size(so, s->w, CURRENT_H(o)-(s->h/10)+5); - - ecore_add_event_timer(close_string, 0.01, __close_bar_cb, ++val, w); + if (CURRENT_H(o) > 10) { + ewl_object_request_size(o, s->w, + CURRENT_H(o) - (s->h / 10) + 5); + ewl_object_request_size(so, s->w, + CURRENT_H(o) - (s->h / 10) + 5); + + ecore_add_event_timer(close_string, 0.01, __close_bar_cb, ++val, + w); ewl_widget_configure(EWL_WIDGET(s)); - } - else { + } else { ewl_object_request_size(o, s->w, 5); ewl_object_request_size(so, s->w, 5); ewl_widget_configure(EWL_WIDGET(s)); } } - + void -__mouse_move_over_children (Ewl_Widget *w, void *ev_data, void *user_data) +__mouse_move_over_children(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Selectionbar *s; + s = EWL_SELECTIONBAR(user_data); - + __children_animator(EWL_WIDGET(s->bar), ev_data, s); } @@ -463,21 +485,21 @@ __children_animator(Ewl_Widget * w, void *ev_data, void *user_data) { - Ewl_Widget *child; - Ewl_Object *o; - Ewd_List *children; - Ecore_Event_Mouse_Move *ev; + Ewl_Widget *child; + Ewl_Object *o; + Ewd_List *children; + Ecore_Event_Mouse_Move *ev; Ewl_Selectionbar *s; - int x, old_x; - + int x, old_x; + s = EWL_SELECTIONBAR(user_data); - + o = EWL_OBJECT(w); children = EWL_CONTAINER(w)->children; - + ev = ev_data; x = ev->x - CURRENT_X(o); @@ -488,16 +510,15 @@ s->mouse_x = x; - - ewl_object_request_position(EWL_OBJECT(s->scroller.top), x - 15, - CURRENT_Y(o) + 5); + + ewl_object_request_position(EWL_OBJECT(s->scroller.top), x - 15, + CURRENT_Y(o) + 5); ewl_object_request_position(EWL_OBJECT(s->scroller.bottom), - x - 15, - CURRENT_Y(o) + CURRENT_H(o) - 15); - - + x - 15, CURRENT_Y(o) + CURRENT_H(o) - 15); + + ewl_widget_configure(s->scroller.top); ewl_widget_configure(s->scroller.bottom); @@ -505,26 +526,25 @@ ewd_list_goto_first(children); while ((child = ewd_list_next(children)) != NULL) { if (child != EWL_WIDGET(s->scroller.bottom) && - child != EWL_WIDGET(s->scroller.top)) { + child != EWL_WIDGET(s->scroller.top)) { - if(CURRENT_W(EWL_OBJECT(child)) < 2 || - CURRENT_H(EWL_OBJECT(child)) < 2) - { + 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(child)), - ewl_object_get_preferred_h( - EWL_OBJECT(child))); + ewl_object_get_preferred_w + (EWL_OBJECT(child)), + ewl_object_get_preferred_h + (EWL_OBJECT(child))); } - + /* ewl_object_request_size(EWL_OBJECT(child), 60, 40); -*/ +*/ ewl_object_request_position(EWL_OBJECT(child), - CURRENT_X(child) + - (old_x - x), - CURRENT_Y(o) + - ((CURRENT_H(o) - - CURRENT_H(child)) / 2)); + CURRENT_X(child) + + (old_x - x), + CURRENT_Y(o) + + ((CURRENT_H(o) - + CURRENT_H(child)) / 2)); ewl_widget_configure(child); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbar.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_selectionbar.h 17 Apr 2002 22:07:29 -0000 1.2 +++ ewl_selectionbar.h 19 Apr 2002 22:09:57 -0000 1.3 @@ -7,25 +7,27 @@ #define EWL_SELECTIONBAR(selectionbar) ((Ewl_Selectionbar *) selectionbar) struct _ewl_selectionbar { - - Ewl_Floater floater; - - Ewl_Container *bar; + + Ewl_Floater floater; + + Ewl_Container *bar; struct { - Ewl_Widget *top; - Ewl_Widget *bottom; + Ewl_Widget *top; + Ewl_Widget *bottom; } scroller; - int h, w; - int mouse_x; /* store old mouse x position for animation */ - int OPEN; /* Boolean, open or closed */ + int h, w; + int mouse_x; /* store old mouse x position for animation */ + int OPEN; /* Boolean, open or closed */ }; -Ewl_Widget *ewl_selectionbar_new(Ewl_Widget *parent); -void ewl_selectionbar_init(Ewl_Selectionbar * s, Ewl_Widget *parent); -void ewl_selectionbar_set_size(Ewl_Selectionbar * s, int w, int h1, int h2); +Ewl_Widget *ewl_selectionbar_new(Ewl_Widget * parent); +void ewl_selectionbar_init(Ewl_Selectionbar * s, + Ewl_Widget * parent); +void ewl_selectionbar_set_size(Ewl_Selectionbar * s, int w, int h1, + int h2); -#endif /* __EWL_SELECTIONBAR_H__ */ +#endif /* __EWL_SELECTIONBAR_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbook.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_selectionbook.c 17 Apr 2002 22:07:29 -0000 1.2 +++ ewl_selectionbook.c 19 Apr 2002 22:09:57 -0000 1.3 @@ -3,16 +3,16 @@ #include "ewl_selectionbook.h" -void __ewl_selectionbook_configure(Ewl_Widget * w, void *ev_data, - void *user_data); -void __ewl_selectionbook_realize(Ewl_Widget * w, void *ev_data, - void *user_data); -void __ewl_selectionbook_destroy(Ewl_Widget * w, void *ev_data, - void *user_data); +void __ewl_selectionbook_configure(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_selectionbook_realize(Ewl_Widget * w, void *ev_data, + void *user_data); +void __ewl_selectionbook_destroy(Ewl_Widget * w, void *ev_data, + void *user_data); -void __ewl_selectionbook_page_switch(Ewl_Widget * w, void *ev_data, - void *user_data); +void __ewl_selectionbook_page_switch(Ewl_Widget * w, void *ev_data, + void *user_data); /** * ewl_selectionbook_new - create a new selectionbook @@ -20,7 +20,8 @@ * * Returns a newly allocated selectionbook on success, NULL on failure. */ -Ewl_Widget *ewl_selectionbook_new() +Ewl_Widget * +ewl_selectionbook_new() { Ewl_Selectionbook *s; @@ -46,9 +47,10 @@ * Returns no value. Sets the fields and callbacks of the selectionbook * @s to their default values. */ -void ewl_selectionbook_init(Ewl_Selectionbook * s) +void +ewl_selectionbook_init(Ewl_Selectionbook * s) { - Ewl_Widget *w; + Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); @@ -67,18 +69,18 @@ __ewl_selectionbook_realize, NULL); ewl_callback_append(w, EWL_CALLBACK_DESTROY, __ewl_selectionbook_destroy, NULL); - ewl_theme_data_set_str(w, - "/appearance/box/vertical/base/visible", "no"); + ewl_theme_data_set_str(w, "/appearance/box/vertical/base/visible", + "no"); + - s->tab_bar = ewl_selectionbar_new(w); - + s->pages = ewd_list_new(); s->current_page = NULL; s->num_pages = 0; - + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -88,7 +90,7 @@ ewl_selectionbook_add_page(Ewl_Selectionbook * s, Ewl_Widget * tab, Ewl_Widget * page) { - Ewl_SbookPage *p; + Ewl_SbookPage *p; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("s", s); @@ -108,7 +110,7 @@ __ewl_selectionbook_page_switch, s); ewl_widget_set_data(tab, (void *) s, (void *) p); - + if (!s->current_page) { s->current_page = p; ewl_callback_del(p->tab, EWL_CALLBACK_CLICKED, @@ -134,13 +136,14 @@ void ewl_selectionbook_rem_page(Ewl_Selectionbook * s, int num, int destroy) { - Ewl_SbookPage *p;; + Ewl_SbookPage *p;; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("s", s); if (s->num_pages < num) return; + /* ewd_list_goto_index(s->pages, num); @@ -184,12 +187,14 @@ } -void ewl_selectionbook_rem_current_page(Ewl_Selectionbook * s, int destroy) +void +ewl_selectionbook_rem_current_page(Ewl_Selectionbook * s, int destroy) { - Ewl_SbookPage *p; + Ewl_SbookPage *p; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("s", s); + /* p = s->current_page; ewd_list_goto_first(s->pages); @@ -231,33 +236,32 @@ s = EWL_SELECTIONBOOK(w); -// ewl_container_remove_child(EWL_CONTAINER(s), s->tab_bar); +// ewl_container_remove_child(EWL_CONTAINER(s), s->tab_bar); ewl_widget_show(s->tab_bar); - + DLEAVE_FUNCTION(DLEVEL_STABLE); } void -__ewl_selectionbook_configure(Ewl_Widget * w, void *ev_data, - void *user_data) +__ewl_selectionbook_configure(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Selectionbook *s; - Ewl_Widget *child; - int layer; - + Ewl_Widget *child; + int layer; + DENTER_FUNCTION(DLEVEL_STABLE); s = EWL_SELECTIONBOOK(w); printf("in selectionbook configure %p\n", w); - if(s->current_page) { - ewl_object_request_geometry(EWL_OBJECT(s->current_page->page), - CURRENT_X(EWL_OBJECT(s)), - CURRENT_Y(EWL_OBJECT(s)), - CURRENT_W(EWL_OBJECT(s)), - CURRENT_H(EWL_OBJECT(s))); + if (s->current_page) { + ewl_object_request_geometry(EWL_OBJECT(s->current_page->page), + CURRENT_X(EWL_OBJECT(s)), + CURRENT_Y(EWL_OBJECT(s)), + CURRENT_W(EWL_OBJECT(s)), + CURRENT_H(EWL_OBJECT(s))); ewl_widget_configure(s->current_page->page); } @@ -273,7 +277,7 @@ __ewl_selectionbook_destroy(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Selectionbook *s; - Ewl_SbookPage *p; + Ewl_SbookPage *p; DENTER_FUNCTION(DLEVEL_STABLE); @@ -281,8 +285,7 @@ if (s->pages) { ewd_list_goto_first(s->pages); - while ((p = - (Ewl_SbookPage *) ewd_list_next(s->pages)) != NULL) + while ((p = (Ewl_SbookPage *) ewd_list_next(s->pages)) != NULL) ewl_widget_destroy(p->page); } @@ -297,11 +300,10 @@ void -__ewl_selectionbook_page_switch(Ewl_Widget * w, void *ev_data, - void *user_data) +__ewl_selectionbook_page_switch(Ewl_Widget * w, void *ev_data, void *user_data) { Ewl_Selectionbook *s; - Ewl_SbookPage *p; + Ewl_SbookPage *p; DENTER_FUNCTION(DLEVEL_STABLE); @@ -311,11 +313,9 @@ if (s->current_page) { ewl_callback_append(p->tab, EWL_CALLBACK_CLICKED, - __ewl_selectionbook_page_switch, - s); + __ewl... [truncated message content] |
From: <enl...@li...> - 2002-04-23 16:37:41
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: Makefile.am Log Message: Yet another indent run, a few minor bug fixes, and re-added ewl_list.h to the Makefile.am. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Makefile.am,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- Makefile.am 17 Apr 2002 22:18:50 -0000 1.25 +++ Makefile.am 23 Apr 2002 16:37:39 -0000 1.26 @@ -26,6 +26,7 @@ ewl_grid.h \ ewl_image.h \ ewl_imenu.h \ + ewl_list.h \ ewl_macros.h \ ewl_misc.h \ ewl_notebook.h \ |