From: <enl...@li...> - 2003-09-04 01:49:07
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_config.h ewl_cursor.c ewl_cursor.h ewl_embed.h ewl_entry.h ewl_enums.h ewl_image.c ewl_image.h ewl_misc.h ewl_notebook.h ewl_radiobutton.c ewl_radiobutton.h Log Message: Whee more widget documentation. This time it's for the radiobutton and image widgets. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_config.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ewl_config.h 26 Mar 2003 05:22:02 -0000 1.18 +++ ewl_config.h 4 Sep 2003 01:48:34 -0000 1.19 @@ -4,7 +4,8 @@ typedef struct _ewl_config Ewl_Config; -struct _ewl_config { +struct _ewl_config +{ struct { int enable; int level; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_cursor.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_cursor.c 23 May 2003 22:10:15 -0000 1.13 +++ ewl_cursor.c 4 Sep 2003 01:48:35 -0000 1.14 @@ -3,9 +3,8 @@ /** - * ewl_cursor_new - create a cursor for positioning within an entry widget - * - * Returns a newly allocated cursor widget on success, NULL on failure. + * @return Returns a new cursor widget on success, NULL on failure. + * @brief Create a cursor for positioning within an entry widget */ Ewl_Widget *ewl_cursor_new(void) { @@ -22,10 +21,11 @@ } /** - * ewl_cursor_init - initialize the cursor to default values and appearance - * @c: the cursor to initialize + * @param c: the cursor to initialize + * @return Returns no value. + * @brief Initialize the cursor to default values and appearance * - * Returns no value. Sets the default values and appearance for the cursor @c. + * Sets the default values and appearance for the cursor @a c. */ void ewl_cursor_init(Ewl_Cursor * c) { @@ -44,6 +44,15 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * @param c: the cursor to change base position + * @param pos: the new base position value + * @return Returns no value. + * @brief Set the initial position of the cursor + * + * Sets the initial position that will be used when determining layout when + * start or end positions change. + */ void ewl_cursor_set_base(Ewl_Cursor *c, unsigned int pos) { DENTER_FUNCTION(DLEVEL_STABLE); @@ -55,12 +64,14 @@ } /** - * ewl_cursor_set_position - set the current position of the cursor - * @w: the cursor widget to change position - * @p: the index of the cursor position within the entry widget's text + * @param c: the cursor widget to change position + * @param start: the start index the cursor position + * @param end: the end index the cursor position + * @return Returns no value. + * @brief Set the current position of the cursor * - * Returns no value. Changes the position of the cursor so that the entry - * widget can update it appropriately. + * Changes the position of the cursor so that the entry widget can update it + * appropriately. */ void ewl_cursor_set_position(Ewl_Cursor * c, unsigned int start, unsigned int end) @@ -83,6 +94,15 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * @param c: the cursor to perform the selection + * @param pos: the ending position of the selection + * @return Returns no value. + * @brief Selects the text between the cursor base and specified position + * + * Selects the characters between the previously specified base position and + * the specified @a pos. + */ void ewl_cursor_select_to(Ewl_Cursor *c, unsigned int pos) { @@ -103,6 +123,11 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * @param c: the cursor to retrieve base position + * @return Returns the current base position. + * @brief Retrieve the current base position. + */ unsigned int ewl_cursor_get_base_position(Ewl_Cursor *c) { DENTER_FUNCTION(DLEVEL_STABLE); @@ -112,10 +137,9 @@ } /** - * ewl_cursor_get_start_position - retrieve the start position of the cursor - * @w: the entry cursor to retrieve the current start position - * - * Returns the current start position of the cursor widget @w. + * @param c: the entry cursor to retrieve the current start position + * @return Returns the current start position of the cursor @a c. + * @brief Retrieve the start position of the cursor */ unsigned int ewl_cursor_get_start_position(Ewl_Cursor * c) { @@ -126,10 +150,9 @@ } /** - * ewl_cursor_get_end_position - retrieve the end position of the cursor - * @w: the entry cursor to retrieve the current end position - * - * Returns the current end position of the cursor widget @w. + * @param c: the entry cursor to retrieve the current end position + * @return Returns the current end position of the cursor widget @a c. + * @brief Retrieve the end position of the cursor */ unsigned int ewl_cursor_get_end_position(Ewl_Cursor * c) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_cursor.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_cursor.h 23 May 2003 22:10:15 -0000 1.9 +++ ewl_cursor.h 4 Sep 2003 01:48:35 -0000 1.10 @@ -1,18 +1,38 @@ - #ifndef __EWL_CURSOR_H__ #define __EWL_CURSOR_H__ -typedef struct _ewl_cursor Ewl_Cursor; - +/** + * @defgroup Ewl_Cursor A Text Cursor + * Indicates cursor position in editable text and provides a visual selection + * highlighting. + * + * @{ + */ + +/** + * The cursor indicates where in an Ewl_Entry typed text will be placed. + */ +typedef struct Ewl_Cursor Ewl_Cursor; + +/** + * @def EWL_CURSOR(cursor) + * Typecasts a pointer to an Ewl_Cursor pointer. + */ #define EWL_CURSOR(cursor) ((Ewl_Cursor *) cursor) -struct _ewl_cursor { - Ewl_Widget widget; +/** + * @struct Ewl_Cursor + * Inherits from Ewl_Widget and extends it to position itself based on indices + * into an Ewl_Entry. + */ +struct Ewl_Cursor +{ + Ewl_Widget widget; /**< Inherit from Ewl_Widget */ struct { - unsigned int start; - unsigned int end; - unsigned int base; + unsigned int start; /**< Starting index in entry */ + unsigned int end; /**< Ending index in entry */ + unsigned int base; /**< Last index where start == end */ } position; }; @@ -26,5 +46,8 @@ unsigned int ewl_cursor_get_start_position(Ewl_Cursor * w); unsigned int ewl_cursor_get_end_position(Ewl_Cursor * w); +/** + * @} + */ #endif /* __EWL_CURSOR_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_embed.h 1 Sep 2003 04:57:07 -0000 1.3 +++ ewl_embed.h 4 Sep 2003 01:48:35 -0000 1.4 @@ -1,4 +1,3 @@ - #ifndef __EWL_EMBED_H__ #define __EWL_EMBED_H__ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- ewl_entry.h 1 Sep 2003 04:57:07 -0000 1.23 +++ ewl_entry.h 4 Sep 2003 01:48:35 -0000 1.24 @@ -1,4 +1,3 @@ - #ifndef __EWL_ENTRY_H__ #define __EWL_ENTRY_H__ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_enums.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- ewl_enums.h 3 Sep 2003 19:52:06 -0000 1.35 +++ ewl_enums.h 4 Sep 2003 01:48:35 -0000 1.36 @@ -1,81 +1,82 @@ - - #ifndef __EWL_ENUMS_H__ #define __EWL_ENUMS_H__ -/* +/** + * @defgroup Ewl_Enums Various Flags and Enumerations used in EWL + * Provides bitmasks, flags, and other enumerations for use by widgets in EWL. + */ + +/** * This defines the various types of callbacks that can be hooked up for each * widget. */ -typedef enum _ewl_callback_type Ewl_Callback_Type; +typedef enum Ewl_Callback_Type Ewl_Callback_Type; -enum _ewl_callback_type +enum Ewl_Callback_Type { - EWL_CALLBACK_NONE, - EWL_CALLBACK_EXPOSE, - EWL_CALLBACK_REALIZE, - EWL_CALLBACK_UNREALIZE, - EWL_CALLBACK_SHOW, - EWL_CALLBACK_HIDE, - EWL_CALLBACK_DESTROY, - EWL_CALLBACK_DELETE_WINDOW, - EWL_CALLBACK_CONFIGURE, - EWL_CALLBACK_REPARENT, - EWL_CALLBACK_KEY_DOWN, - EWL_CALLBACK_KEY_UP, - EWL_CALLBACK_MOUSE_DOWN, - EWL_CALLBACK_MOUSE_UP, - EWL_CALLBACK_MOUSE_MOVE, - EWL_CALLBACK_FOCUS_IN, - EWL_CALLBACK_FOCUS_OUT, - EWL_CALLBACK_SELECT, - EWL_CALLBACK_DESELECT, - EWL_CALLBACK_CLICKED, - EWL_CALLBACK_DOUBLE_CLICKED, - EWL_CALLBACK_HILITED, - EWL_CALLBACK_VALUE_CHANGED, - EWL_CALLBACK_THEME_UPDATE, - EWL_CALLBACK_STATE_CHANGED, - EWL_CALLBACK_APPEARANCE_CHANGED, - EWL_CALLBACK_FX_STARTED, - EWL_CALLBACK_FX_STOPPED, - EWL_CALLBACK_WIDGET_ENABLE, - EWL_CALLBACK_WIDGET_DISABLE, - EWL_CALLBACK_MAX + EWL_CALLBACK_NONE, /**< A placeholder FIXME: Is this necessary still? */ + EWL_CALLBACK_EXPOSE, /**< Triggered when the window needs redrawing */ + EWL_CALLBACK_REALIZE, /**< Event when a widget is first drawn */ + EWL_CALLBACK_UNREALIZE, /**< When a widget is no longer drawn */ + EWL_CALLBACK_SHOW, /**< A widget has been marked visible */ + EWL_CALLBACK_HIDE, /**< A widget is marked hidden */ + EWL_CALLBACK_DESTROY, /**< The widget is freed */ + EWL_CALLBACK_DELETE_WINDOW, /**< The window is being closed */ + EWL_CALLBACK_CONFIGURE, /**< The object is being resized */ + EWL_CALLBACK_REPARENT, /**< A widget has been placed in a container */ + EWL_CALLBACK_KEY_DOWN, /**< A key was pressed down */ + EWL_CALLBACK_KEY_UP, /**< A key was released */ + EWL_CALLBACK_MOUSE_DOWN, /**< Mouse was pressed down */ + EWL_CALLBACK_MOUSE_UP, /**< Mouse was released */ + EWL_CALLBACK_MOUSE_MOVE, /**< Mouse was moved */ + EWL_CALLBACK_FOCUS_IN, /**< Mouse was placed over the widget */ + EWL_CALLBACK_FOCUS_OUT, /**< Mouse was moved away from the widget */ + EWL_CALLBACK_SELECT, /**< Widget was selected by mouse or key */ + EWL_CALLBACK_DESELECT, /**< Widget was deselected by mouse or key */ + EWL_CALLBACK_CLICKED, /**< Mouse was pressed and released on a widget */ + EWL_CALLBACK_DOUBLE_CLICKED, /**< Mouse was clicked twice quickly */ + EWL_CALLBACK_HILITED, /**< Mouse is over the widget */ + EWL_CALLBACK_VALUE_CHANGED, /**< Value in widget changed */ + EWL_CALLBACK_THEME_UPDATE, /**< Need to re-read theme data */ + EWL_CALLBACK_STATE_CHANGED, /**< Alter the state of the appearance */ + EWL_CALLBACK_APPEARANCE_CHANGED, /**< Theme key of widget changed */ + EWL_CALLBACK_WIDGET_ENABLE, /**< Widget has been re-enabled */ + EWL_CALLBACK_WIDGET_DISABLE, /**< Widget no longer takes input */ + EWL_CALLBACK_MAX /**< Flag to indicate last value */ }; -/* +/** * Flags for the callbacks to indicate interception or notification of the * parent. */ -typedef enum _ewl_event_notify Ewl_Event_Notify; +typedef enum Ewl_Event_Notify Ewl_Event_Notify; -enum _ewl_event_notify +enum Ewl_Event_Notify { EWL_CALLBACK_NOTIFY_NONE = 0, EWL_CALLBACK_NOTIFY_NOTIFY = 1, EWL_CALLBACK_NOTIFY_INTERCEPT = 2 }; -/* +/** * The orientation enum is used in a few widgets to specify whether the widget * should be laid out in a horizontal or vertical fashion. */ -typedef enum _ewl_orientation Ewl_Orientation; +typedef enum Ewl_Orientation Ewl_Orientation; -enum _ewl_orientation +enum Ewl_Orientation { EWL_ORIENTATION_HORIZONTAL, EWL_ORIENTATION_VERTICAL }; -/* +/** * The state enum specifies the current state of a widget, ie. has it been * clicked, does it have the keyboard focus, etc. */ -typedef enum _ewl_state Ewl_State; +typedef enum Ewl_State Ewl_State; -enum _ewl_state +enum Ewl_State { EWL_STATE_NORMAL = (0x1 << 0), EWL_STATE_HILITED = (0x1 << 1), @@ -86,14 +87,14 @@ }; -/* +/** * The alignment enumeration allows for specifying how an element is aligned * within it's container. */ -typedef enum _ewl_alignment Ewl_Alignment; +typedef enum Ewl_Alignment Ewl_Alignment; #define EWL_ALIGNMENT_MASK 0xFF -enum _ewl_alignment +enum Ewl_Alignment { EWL_ALIGNMENT_CENTER = ETOX_ALIGN_CENTER, EWL_ALIGNMENT_LEFT = ETOX_ALIGN_LEFT, @@ -102,14 +103,14 @@ EWL_ALIGNMENT_BOTTOM = ETOX_ALIGN_BOTTOM }; -/* +/** * Fill policy identifies to containers whether child widgets should be * stretched to fill available space or keep their current size. */ -typedef enum _ewl_fill_policy Ewl_Fill_Policy; +typedef enum Ewl_Fill_Policy Ewl_Fill_Policy; #define EWL_FILL_POLICY_MASK 0xFF00 -enum _ewl_fill_policy +enum Ewl_Fill_Policy { EWL_FILL_POLICY_NONE = 0, EWL_FILL_POLICY_HSHRINK = 0x1000, @@ -124,7 +125,7 @@ #define EWL_FILL_POLICY_NORMAL (EWL_FILL_POLICY_FILL) -/* +/** * Flags identifying whether a widget is shown, has been realized, or is * recursive (ie. a container). */ @@ -142,9 +143,9 @@ }; -typedef enum _ewl_position Ewl_Position; +typedef enum Ewl_Position Ewl_Position; -enum _ewl_position +enum Ewl_Position { EWL_POSITION_LEFT = 0x1, EWL_POSITION_RIGHT = 0x2, @@ -154,51 +155,33 @@ #define EWL_POSITION_MASK (0xf) -typedef enum _ewl_window_flags Ewl_Window_Flags; +typedef enum Ewl_Window_Flags Ewl_Window_Flags; -enum _ewl_window_flags +enum Ewl_Window_Flags { EWL_WINDOW_AUTO_SIZE = 1, EWL_WINDOW_BORDERLESS = 2 }; -typedef enum _ewl_tree_node_flags Ewl_Tree_Node_Flags; +typedef enum Ewl_Tree_Node_Flags Ewl_Tree_Node_Flags; -enum _ewl_tree_node_flags +enum Ewl_Tree_Node_Flags { EWL_TREE_NODE_NOEXPAND = 0, EWL_TREE_NODE_COLLAPSED = 1, EWL_TREE_NODE_EXPANDED = 2 }; -typedef enum _ewl_notebook_flags Ewl_Notebook_Flags; +typedef enum Ewl_Notebook_Flags Ewl_Notebook_Flags; -enum _ewl_notebook_flags +enum Ewl_Notebook_Flags { EWL_NOTEBOOK_FLAG_TABS_HIDDEN = 0x10 }; -typedef enum _ewl_fx_modifies Ewl_FX_Modifies; - -enum _ewl_fx_modifies -{ - EWL_FX_MODIFIES_NONE = (0x1 << 0), - EWL_FX_MODIFIES_ALPHA_CHANNEL = (0x1 << 1), - EWL_FX_MODIFIES_RED_CHANNEL = (0x1 << 2), - EWL_FX_MODIFIES_GREEN_CHANNEL = (0x1 << 3), - EWL_FX_MODIFIES_BLUE_CHANNEL = (0x1 << 4), - EWL_FX_MODIFIES_ALL_CHANNELS = EWL_FX_MODIFIES_ALPHA_CHANNEL | - EWL_FX_MODIFIES_RED_CHANNEL | EWL_FX_MODIFIES_GREEN_CHANNEL | - 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 -}; - -typedef enum _ewl_scrollbar_flags Ewl_ScrollBar_Flags; +typedef enum Ewl_Scrollbar_Flags Ewl_ScrollBar_Flags; -enum _ewl_scrollbar_flags +enum Ewl_Scrollbar_Flags { EWL_SCROLLBAR_FLAG_NONE, EWL_SCROLLBAR_FLAG_AUTO_VISIBLE, @@ -206,9 +189,9 @@ }; -typedef enum _ewl_filedialog_type Ewl_Filedialog_Type; +typedef enum Ewl_Filedialog_Type Ewl_Filedialog_Type; -enum _ewl_filedialog_type +enum Ewl_Filedialog_Type { EWL_FILEDIALOG_TYPE_OPEN, EWL_FILEDIALOG_TYPE_CLOSE =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- ewl_image.c 25 Aug 2003 19:40:42 -0000 1.27 +++ ewl_image.c 4 Sep 2003 01:48:35 -0000 1.28 @@ -15,11 +15,9 @@ Ewl_Image_Type __ewl_image_get_type(const char *i); /** - * ewl_image_set_file - load an 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. + * @param i: the path to the image to be displayed by the image widget + * @return Returns a pointer to a new image widget on success, NULL on failure. + * @brief Load an image widget with specified image contents */ Ewl_Widget *ewl_image_new(char *i) { @@ -36,11 +34,12 @@ } /** - * ewl_image_init - initialize an image widget to default values and callbacks - * @i: the image widget to initialize + * @param i: the image widget to initialize + * @param path: the path to the image displayed + * @return Returns no value. + * @brief Initialize an image widget to default values and callbacks * - * Returns no value. Sets the fields and callbacks of @i to their default - * values. + * Sets the fields and callbacks of @a i to their default values. */ void ewl_image_init(Ewl_Image * i, char *path) { @@ -75,12 +74,12 @@ } /** - * 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 + * @param i: the image widget to change the displayed image + * @param im: the path to the new image to be displayed by @a i + * @return Returns no value. + * @brief Change the image file displayed by an image widget * - * Returns no value. Set the image displayed by @i to the one found at the - * path @im. + * Set the image displayed by @a i to the one found at the path @a im. */ void ewl_image_set_file(Ewl_Image * i, char *im) { @@ -137,12 +136,12 @@ } /** - * ewl_image_set_proportional - set boolean to determine how to scale - * @i: the image to change proportional setting - * @p: the boolean indicator of proportionality + * @param i: the image to change proportional setting + * @param p: the boolean indicator of proportionality + * @return Returns no value. + * @brief Set boolean to determine how to scale * - * Returns no value. Changes the flag indicating if the image is scaled - * proportionally. + * Changes the flag indicating if the image is scaled proportionally. */ void ewl_image_set_proportional(Ewl_Image *i, char p) @@ -158,14 +157,15 @@ } /** - * ewl_image_scale - scale image dimensions by a percentage - * @i: the image to scale - * @wp: the percentage to scale width - * @hp: the percentage to scale height - * - * Returns no value. Scales the given image to @wp percent of preferred width - * by @hp percent of preferred height. If @i->proportional is set to TRUE, the - * lesser of @wp and @hp is applied for both directions. + * @param i: the image to scale + * @param wp: the percentage to scale width + * @param hp: the percentage to scale height + * @brief Scale image dimensions by a percentage + * + * @return Returns no value. + * Scales the given image to @a wp percent of preferred width + * by @a hp percent of preferred height. If @a i->proportional is set to TRUE, + * the lesser of @a wp and @a hp is applied for both directions. */ void ewl_image_scale(Ewl_Image *i, double wp, double hp) @@ -190,12 +190,13 @@ } /** - * ewl_image_scale_to - scale image dimensions to a specific size - * @i: the image to scale - * @w: the size to scale width - * @h: the size to scale height + * @param i: the image to scale + * @param w: the size to scale width + * @param h: the size to scale height + * @return Returns no value. + * @brief Scale image dimensions to a specific size * - * Returns no value. Scales the given image to @w by @hp. If @i->proportional + * Scales the given image to @a w by @a hp. If @a i->proportional * is set to TRUE, the image is scaled proportional to the lesser scale * percentage of preferred size. */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_image.h 13 Jul 2003 05:52:49 -0000 1.14 +++ ewl_image.h 4 Sep 2003 01:48:35 -0000 1.15 @@ -1,19 +1,31 @@ - #ifndef __EWL_IMAGE_H__ #define __EWL_IMAGE_H__ -typedef enum _ewl_image_type Ewl_Image_Type; - -enum _ewl_image_type { - EWL_IMAGE_TYPE_NORMAL, - EWL_IMAGE_TYPE_EDJE +/** + * @defgroup Ewl_Image An Image Display Widget + * Provides a widget for displaying evas loadable images, and edjes. + * + * @{ + */ + +typedef enum Ewl_Image_Type Ewl_Image_Type; + +enum Ewl_Image_Type +{ + EWL_IMAGE_TYPE_NORMAL, /**< Standard image type */ + EWL_IMAGE_TYPE_EDJE /**< Edje image type */ }; -typedef struct _ewl_image Ewl_Image; +typedef struct Ewl_Image Ewl_Image; #define EWL_IMAGE(image) ((Ewl_Image *) image) -struct _ewl_image { +/** + * @struct Ewl_Image + * + */ +struct Ewl_Image +{ Ewl_Widget widget; Ewl_Image_Type type; void *image; @@ -29,5 +41,9 @@ void ewl_image_set_proportional(Ewl_Image * i, char p); void ewl_image_scale(Ewl_Image *i, double wp, double hp); void ewl_image_scale_to(Ewl_Image *i, int w, int h); + +/** + * @} + */ #endif /* __EWL_IMAGE_H__ */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_misc.h 25 Aug 2003 19:40:42 -0000 1.14 +++ ewl_misc.h 4 Sep 2003 01:48:35 -0000 1.15 @@ -1,12 +1,13 @@ #ifndef __EWL_MISC_H__ #define __EWL_MISC_H__ -struct _ewl_options { +typedef struct Ewl_Options Ewl_Options; + +struct Ewl_Options +{ int debug_level; char *xdisplay; }; - -typedef struct _ewl_options Ewl_Options; void ewl_init(int argc, char **argv); void ewl_main(void); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_notebook.h 22 May 2003 03:57:53 -0000 1.11 +++ ewl_notebook.h 4 Sep 2003 01:48:35 -0000 1.12 @@ -1,11 +1,11 @@ #ifndef __EWL_NOTEBOOK_H__ #define __EWL_NOTEBOOK_H__ -typedef struct _ewl_notebook Ewl_Notebook; +typedef struct Ewl_Notebook Ewl_Notebook; #define EWL_NOTEBOOK(notebook) ((Ewl_Notebook *) notebook) -struct _ewl_notebook +struct Ewl_Notebook { Ewl_Container container; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_radiobutton.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- ewl_radiobutton.c 4 Apr 2003 04:55:52 -0000 1.24 +++ ewl_radiobutton.c 4 Sep 2003 01:48:35 -0000 1.25 @@ -2,10 +2,12 @@ #include <Ewl.h> -void ewl_radiobutton_init(Ewl_RadioButton * cb, char *label); void __ewl_radiobutton_clicked(Ewl_Widget * w, void *ev_data, void *user_data); +void __ewl_radiobutton_destroy(Ewl_Widget * w, void *ev_data, + void *user_data); + /* void __ewl_checkbutton_clicked(Ewl_Widget * w, void *ev_data, void *user_data); @@ -15,10 +17,9 @@ /** - * ewl_radiobutton_new - allocate and initialize a new radio button - * @label: the label to associate with the radio button - * - * Returns a pointer to the new radio button on success, NULL on failure. + * @param label: the label to associate with the radio button + * @return Returns a pointer to new radio button on success, NULL on failure. + * @brief Allocate and initialize a new radio button */ Ewl_Widget *ewl_radiobutton_new(char *label) { @@ -37,11 +38,12 @@ } /** - * ewl_radiobutton_set_chain - attach the button to a chain of radio buttons - * @w: the radio button to be added to a chain of radio buttons - * @c: a radio button already in the chain of radio buttons + * @param w: the radio button to be added to a chain of radio buttons + * @param c: a radio button already in the chain of radio buttons + * @return Returns no value. + * @brief Attach the button to a chain of radio buttons * - * Returns no value. Associates @w with the same chain as @c, in order to + * Associates @a w with the same chain as @a c, in order to * ensure that only one radio button of that group is checked at any time. */ void ewl_radiobutton_set_chain(Ewl_Widget * w, Ewl_Widget * c) @@ -61,27 +63,27 @@ if (!crb->chain) { crb->chain = ewd_list_new(); - rb->chain = crb->chain; - ewd_list_append(crb->chain, w); ewd_list_append(crb->chain, c); } else { - rb->chain = crb->chain; if (!ewd_list_goto(crb->chain, w)) ewd_list_append(crb->chain, w); } + rb->chain = crb->chain; + DLEAVE_FUNCTION(DLEVEL_STABLE); } /** - * ewl_radiobutton_init - initialize the radio button fields and callbacks - * @rb: the radio button to initialize - * @label: the label for the initialized radio button + * @param rb: the radio button to initialize + * @param label: the label for the initialized radio button + * @return Returns no value. + * @brief Initialize the radio button fields and callbacks * - * Returns no value. Sets internal fields of the radio button to default - * values and sets the label to the specified @label. + * Sets internal fields of the radio button to default + * values and sets the label to the specified @a label. */ void ewl_radiobutton_init(Ewl_RadioButton * rb, char *label) { @@ -101,6 +103,8 @@ */ ewl_callback_append(w, EWL_CALLBACK_CLICKED, __ewl_radiobutton_clicked, NULL); + ewl_callback_append(w, EWL_CALLBACK_DESTROY, + __ewl_radiobutton_destroy, NULL); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -132,6 +136,26 @@ if (oc != ewl_checkbutton_is_checked(cb)) ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +void __ewl_radiobutton_destroy(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_RadioButton *rb; + + DENTER_FUNCTION(DLEVEL_STABLE); + + rb = EWL_RADIOBUTTON(w); + + if (!rb->chain) + DRETURN(DLEVEL_STABLE); + + ewd_list_goto(rb->chain, w); + ewd_list_remove(rb->chain); + + if (ewd_list_is_empty(rb->chain)) + ewd_list_free(rb->chain); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_radiobutton.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_radiobutton.h 25 May 2002 05:46:42 -0000 1.11 +++ ewl_radiobutton.h 4 Sep 2003 01:48:35 -0000 1.12 @@ -1,22 +1,58 @@ - #ifndef __EWL_RADIOBUTTON_H__ #define __EWL_RADIOBUTTON_H__ -typedef struct _ewl_radiobutton Ewl_RadioButton; - +/** + * @defgroup Ewl_RadioButton A Radio Button Widget and Grouping System + * Provides for a simple radiobutton with label, and to group radio buttons + * for selecting a single option. + * + * @{ + */ + +/** + * The radio button provides a means for selecting a single item from a group + * of options. + */ +typedef struct Ewl_RadioButton Ewl_RadioButton; + +/** + * @def EWL_RADIOBUTTON(button) + * Typecasts a pointer to an Ewl_RadioButton pointer. + */ #define EWL_RADIOBUTTON(button) ((Ewl_RadioButton *) button) -struct _ewl_radiobutton { - Ewl_CheckButton button; - Ewd_List *chain; +/** + * Inherits from Ewl_CheckButton and extends it to provide grouping buttons + * to limit to a single selection in a group at a given time. + */ +struct Ewl_RadioButton +{ + Ewl_CheckButton button; /**< Inherit from Ewl_CheckButton */ + Ewd_List *chain; /**< List of members of the group */ }; Ewl_Widget *ewl_radiobutton_new(char *l); +void ewl_radiobutton_init(Ewl_RadioButton * cb, char *label); +/** + * @def ewl_radiobutton_set_checked(r, c) + * Shortcut for setting the checked status on the inherited Ewl_CheckButton + * fields. + */ #define ewl_radiobutton_set_checked(r, c) \ ewl_checkbutton_set_checked(EWL_CHECKBUTTON(r), c) + +/** + * @def ewl_radiobutton_set_checked(r, c) + * Shortcut for checking the checked status on the inherited Ewl_CheckButton + * fields. + */ #define ewl_radiobutton_is_checked(r) \ ewl_checkbutton_is_checked(EWL_CHECKBUTTON(r)) void ewl_radiobutton_set_chain(Ewl_Widget * w, Ewl_Widget * c); + +/** + * @} + */ #endif /* __EWL_RADIOBUTTON_H__ */ |