Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_entry.c ewl_entry.h ewl_widget.c ewl_widget.h Log Message: - constify ewl_entry and the new name functions - fix warnings in ewl_theme_test =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_entry.c 7 May 2005 23:51:35 -0000 1.14 +++ ewl_entry.c 13 May 2005 03:26:13 -0000 1.15 @@ -21,21 +21,21 @@ static Ewl_Entry_Op *ewl_entry_op_color_new(int r, int g, int b, int a); static void ewl_entry_op_color_apply(Ewl_Entry *e, Ewl_Entry_Op *op); -static Ewl_Entry_Op *ewl_entry_op_font_new(char *font, int size); +static Ewl_Entry_Op *ewl_entry_op_font_new(const char *font, int size); static void ewl_entry_op_font_apply(Ewl_Entry *e, Ewl_Entry_Op *op); static void ewl_entry_op_font_free(void *op); -static Ewl_Entry_Op *ewl_entry_op_style_new(char *style); +static Ewl_Entry_Op *ewl_entry_op_style_new(const char *style); static void ewl_entry_op_style_apply(Ewl_Entry *e, Ewl_Entry_Op *op); static void ewl_entry_op_style_free(void *op); static Ewl_Entry_Op *ewl_entry_op_align_new(unsigned int align); static void ewl_entry_op_align_apply(Ewl_Entry *e, Ewl_Entry_Op *op); -static Ewl_Entry_Op * ewl_entry_op_text_set_new(char *text); -static Ewl_Entry_Op *ewl_entry_op_text_append_new(char *text); -static Ewl_Entry_Op *ewl_entry_op_text_prepend_new(char *text); -static Ewl_Entry_Op *ewl_entry_op_text_insert_new(char *text, int index); +static Ewl_Entry_Op * ewl_entry_op_text_set_new(const char *text); +static Ewl_Entry_Op *ewl_entry_op_text_append_new(const char *text); +static Ewl_Entry_Op *ewl_entry_op_text_prepend_new(const char *text); +static Ewl_Entry_Op *ewl_entry_op_text_insert_new(const char *text, int index); static Ewl_Entry_Op *ewl_entry_op_text_delete_new(unsigned int start, unsigned int len); static void ewl_entry_op_text_apply(Ewl_Entry *e, Ewl_Entry_Op *op); @@ -49,7 +49,7 @@ * @return Returns a new entry widget on success, NULL on failure. * @brief Allocate and initialize a new multiline input entry widget */ -Ewl_Widget *ewl_entry_multiline_new(char *text) +Ewl_Widget *ewl_entry_multiline_new(const char *text) { Ewl_Widget *w; @@ -69,7 +69,7 @@ * @return Returns a new entry widget on success, NULL on failure. * @brief Allocate and initialize a new entry widget */ -Ewl_Widget *ewl_entry_new(char *text) +Ewl_Widget *ewl_entry_new(const char *text) { Ewl_Entry *e; @@ -92,7 +92,7 @@ * * Initializes the entry widget @a e to it's default values and callbacks. */ -int ewl_entry_init(Ewl_Entry * e, char *text) +int ewl_entry_init(Ewl_Entry * e, const char *text) { char *tmp; int r, g, b, a; @@ -234,7 +234,7 @@ * * Change the text of the entry widget @a e to the string @a t. */ -void ewl_entry_text_set(Ewl_Entry * e, char *text) +void ewl_entry_text_set(Ewl_Entry * e, const char *text) { Ewl_Entry_Op *op; @@ -295,7 +295,7 @@ * * Appends text to the entry widget @a e. */ -void ewl_entry_text_append(Ewl_Entry * e, char *text) +void ewl_entry_text_append(Ewl_Entry * e, const char *text) { int len = 0; Ewl_Entry_Op *op; @@ -332,7 +332,7 @@ * * Prepends text to the entry widget @a e. */ -void ewl_entry_text_prepend(Ewl_Entry * e, char *text) +void ewl_entry_text_prepend(Ewl_Entry * e, const char *text) { Ewl_Entry_Op *op; @@ -357,7 +357,7 @@ * * Inserts text to the entry widget @a e. */ -void ewl_entry_text_insert(Ewl_Entry * e, char *text, int index) +void ewl_entry_text_insert(Ewl_Entry * e, const char *text, int index) { Ewl_Entry_Op *op; int len = 0; @@ -390,7 +390,7 @@ * Inserts text to the entry widget @a e at the current cursor position. */ void -ewl_entry_text_at_cursor_insert(Ewl_Entry * e, char *text) +ewl_entry_text_at_cursor_insert(Ewl_Entry * e, const char *text) { int pos = 0; @@ -520,7 +520,7 @@ * @brief Changes the currently applied font of the text to specified values * @return Returns no value. */ -void ewl_entry_font_set(Ewl_Entry *e, char *font, int size) +void ewl_entry_font_set(Ewl_Entry *e, const char *font, int size) { Ewl_Entry_Op *op; @@ -589,7 +589,7 @@ * @brief Changes the currently applied style of the text to specified values * @return Returns no value. */ -void ewl_entry_style_set(Ewl_Entry *e, char *style) +void ewl_entry_style_set(Ewl_Entry *e, const char *style) { Ewl_Entry_Op *op; @@ -1872,7 +1872,7 @@ } static Ewl_Entry_Op * -ewl_entry_op_font_new(char *font, int size) +ewl_entry_op_font_new(const char *font, int size) { Ewl_Entry_Op *op; Ewl_Entry_Op_Font *opf; @@ -1920,7 +1920,7 @@ } static Ewl_Entry_Op * -ewl_entry_op_style_new(char *style) +ewl_entry_op_style_new(const char *style) { Ewl_Entry_Op *op; Ewl_Entry_Op_Style *ops; @@ -2023,7 +2023,7 @@ } static Ewl_Entry_Op * -ewl_entry_op_text_set_new(char *text) +ewl_entry_op_text_set_new(const char *text) { Ewl_Entry_Op *op; Ewl_Entry_Op_Text *ops; @@ -2043,7 +2043,7 @@ } static Ewl_Entry_Op * -ewl_entry_op_text_append_new(char *text) +ewl_entry_op_text_append_new(const char *text) { Ewl_Entry_Op *op; Ewl_Entry_Op_Text *ops; @@ -2063,7 +2063,7 @@ } static Ewl_Entry_Op * -ewl_entry_op_text_prepend_new(char *text) +ewl_entry_op_text_prepend_new(const char *text) { Ewl_Entry_Op *op; Ewl_Entry_Op_Text *ops; @@ -2083,7 +2083,7 @@ } static Ewl_Entry_Op * -ewl_entry_op_text_insert_new(char *text, int index) +ewl_entry_op_text_insert_new(const char *text, int index) { Ewl_Entry_Op *op; Ewl_Entry_Op_Text *ops; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_entry.h 28 Mar 2005 07:04:28 -0000 1.5 +++ ewl_entry.h 13 May 2005 03:26:13 -0000 1.6 @@ -51,27 +51,27 @@ int wrap; /**< Enable wrapping of the text */ }; -Ewl_Widget *ewl_entry_new(char *text); -Ewl_Widget *ewl_entry_multiline_new(char *text); -int ewl_entry_init(Ewl_Entry * e, char *text); -void ewl_entry_text_set(Ewl_Entry * e, char *t); +Ewl_Widget *ewl_entry_new(const char *text); +Ewl_Widget *ewl_entry_multiline_new(const char *text); +int ewl_entry_init(Ewl_Entry * e, const char *text); +void ewl_entry_text_set(Ewl_Entry * e, const char *t); char *ewl_entry_text_get(Ewl_Entry * e); void ewl_entry_editable_set(Ewl_Entry *e, unsigned int edit); void ewl_entry_multiline_set(Ewl_Entry * e, int m); int ewl_entry_multiline_get(Ewl_Entry * e); -void ewl_entry_text_prepend(Ewl_Entry * e, char *text); -void ewl_entry_text_append(Ewl_Entry * e, char *text); -void ewl_entry_text_insert(Ewl_Entry * e, char *text, int index); -void ewl_entry_text_at_cursor_insert(Ewl_Entry * e, char *text); +void ewl_entry_text_prepend(Ewl_Entry * e, const char *text); +void ewl_entry_text_append(Ewl_Entry * e, const char *text); +void ewl_entry_text_insert(Ewl_Entry * e, const char *text, int index); +void ewl_entry_text_at_cursor_insert(Ewl_Entry * e, const char *text); int ewl_entry_length_get(Ewl_Entry *e); -void ewl_entry_font_set(Ewl_Entry *e, char *font, int size); +void ewl_entry_font_set(Ewl_Entry *e, const char *font, int size); char *ewl_entry_font_get(Ewl_Entry *e); int ewl_entry_font_size_get(Ewl_Entry *e); -void ewl_entry_style_set(Ewl_Entry *e, char *style); +void ewl_entry_style_set(Ewl_Entry *e, const char *style); char *ewl_entry_style_get(Ewl_Entry *e); void ewl_entry_color_set(Ewl_Entry *e, int r, int g, int b, int a); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_widget.c 7 May 2005 23:51:35 -0000 1.4 +++ ewl_widget.c 13 May 2005 03:26:13 -0000 1.5 @@ -113,7 +113,7 @@ * @return Returns no value. * @brief Name the specified widget. */ -void ewl_widget_name_set(Ewl_Widget * w, char *name) +void ewl_widget_name_set(Ewl_Widget * w, const char *name) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -134,7 +134,7 @@ * @return Returns an pointer to an allocated name string on success. * @brief Get the name for the specified widget. */ -char *ewl_widget_name_get(Ewl_Widget * w) +const char *ewl_widget_name_get(Ewl_Widget * w) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("w", w, NULL); @@ -147,7 +147,7 @@ * @return Returns an pointer a matched widget on success. * @brief Find a widget identified by a name. */ -Ewl_Widget *ewl_widget_name_find(char * name) +Ewl_Widget *ewl_widget_name_find(const char * name) { Ewl_Widget *match = NULL; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_widget.h 7 May 2005 23:51:35 -0000 1.4 +++ ewl_widget.h 13 May 2005 03:26:13 -0000 1.5 @@ -70,17 +70,17 @@ /* * Assign the given name to a widget */ -void ewl_widget_name_set(Ewl_Widget * w, char *name); +void ewl_widget_name_set(Ewl_Widget * w, const char *name); /* * Retrieve the given name of a widget */ -char * ewl_widget_name_get(Ewl_Widget * w); +const char * ewl_widget_name_get(Ewl_Widget * w); /* * Find the widget identified by a given name. */ -Ewl_Widget * ewl_widget_name_find(char *name); +Ewl_Widget * ewl_widget_name_find(const char *name); /* * Signal the widget that it's parent has changed. ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs