Mercurial > dwindows
diff gtk/dw.c @ 2036:48b91f535f82
GTK: More const changes... a few more commits to finish.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 17 Nov 2019 05:16:04 +0000 |
parents | 2dfce1ced00f |
children | f7c462f27829 |
line wrap: on
line diff
--- a/gtk/dw.c Sun Nov 17 04:07:39 2019 +0000 +++ b/gtk/dw.c Sun Nov 17 05:16:04 2019 +0000 @@ -1159,7 +1159,7 @@ } /* Finds the translation function for a given signal name */ -static void *_findsigfunc(char *signame) +static void *_findsigfunc(const char *signame) { int z; @@ -2352,7 +2352,7 @@ * format: printf style format string. * ...: Additional variables for use in the format. */ -void API dw_debug(char *format, ...) +void API dw_debug(const char *format, ...) { va_list args; char outbuf[1025] = {0}; @@ -2372,7 +2372,7 @@ * format: printf style format string. * ...: Additional variables for use in the format. */ -int dw_messagebox(char *title, int flags, char *format, ...) +int dw_messagebox(const char *title, int flags, const char *format, ...) { HWND entrywindow, texttargetbox, imagetextbox, mainbox, okbutton, nobutton, yesbutton, cancelbutton, buttonbox, stext; ULONG flStyle = DW_FCF_TITLEBAR | DW_FCF_SHELLPOSITION | DW_FCF_DLGBORDER; @@ -2838,7 +2838,7 @@ DW_MUTEX_UNLOCK; } -static int _set_font(HWND handle, char *fontname) +static int _set_font(HWND handle, const char *fontname) { int retval = FALSE; #if GTK_MAJOR_VERSION < 2 @@ -2931,7 +2931,7 @@ * Returns: * A malloced buffer with the selected font or NULL on error. */ -char * API dw_font_choose(char *currfont) +char * API dw_font_choose(const char *currfont) { GtkFontSelectionDialog *fd; char *font = currfont ? strdup(currfont) : NULL; @@ -2989,7 +2989,7 @@ * Parameters: * fontname: Font name in Dynamic Windows format. */ -void API dw_font_set_default(char *fontname) +void API dw_font_set_default(const char *fontname) { char *oldfont = _DWDefaultFont; @@ -3023,7 +3023,7 @@ * handle: The window (widget) handle. * fontname: Name and size of the font in the form "size.fontname" */ -int dw_window_set_font(HWND handle, char *fontname) +int dw_window_set_font(HWND handle, const char *fontname) { #if GTK_MAJOR_VERSION > 1 PangoFontDescription *pfont; @@ -3418,7 +3418,7 @@ * title: The Window title. * flStyle: Style flags, see the PM reference. */ -HWND dw_window_new(HWND hwndOwner, char *title, unsigned long flStyle) +HWND dw_window_new(HWND hwndOwner, const char *title, unsigned long flStyle) { GtkWidget *tmp; int _locked_by_me = FALSE; @@ -3618,7 +3618,7 @@ * pad: Number of pixels to pad around the box. * title: Text to be displayined in the group outline. */ -HWND dw_groupbox_new(int type, int pad, char *title) +HWND dw_groupbox_new(int type, int pad, const char *title) { GtkWidget *tmp, *frame; int _locked_by_me = FALSE; @@ -3795,7 +3795,7 @@ } } -char _removetilde(char *dest, char *src) +char _removetilde(char *dest, const char *src) { int z, cur=0; char accel = '\0'; @@ -3829,7 +3829,7 @@ * check: If TRUE menu is "check"able. * submenu: Handle to an existing menu to be a submenu or NULL. */ -HWND dw_menu_append_item(HMENUI menu, char *title, unsigned long id, unsigned long flags, int end, int check, HMENUI submenu) +HWND dw_menu_append_item(HMENUI menu, const char *title, unsigned long id, unsigned long flags, int end, int check, HMENUI submenu) { GtkWidget *tmphandle; char accel, *tempbuf = malloc(strlen(title)+1); @@ -3926,7 +3926,7 @@ return tmphandle; } -GtkWidget *_find_submenu_id(GtkWidget *start, char *name) +GtkWidget *_find_submenu_id(GtkWidget *start, const char *name) { GtkWidget *tmp; int z, submenucount = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(start), "_dw_submenucount")); @@ -4231,7 +4231,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_text_new(char *text, unsigned long id) +HWND dw_text_new(const char *text, unsigned long id) { GtkWidget *tmp; int _locked_by_me = FALSE; @@ -4256,7 +4256,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_status_text_new(char *text, ULONG id) +HWND dw_status_text_new(const char *text, ULONG id) { GtkWidget *tmp, *frame; int _locked_by_me = FALSE; @@ -4328,7 +4328,7 @@ * text: The default text to be in the entryfield widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_entryfield_new(char *text, unsigned long id) +HWND dw_entryfield_new(const char *text, unsigned long id) { GtkWidget *tmp; int _locked_by_me = FALSE; @@ -4353,7 +4353,7 @@ * text: The default text to be in the entryfield widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_entryfield_password_new(char *text, ULONG id) +HWND dw_entryfield_password_new(const char *text, ULONG id) { GtkWidget *tmp; int _locked_by_me = FALSE; @@ -4379,7 +4379,7 @@ * text: The default text to be in the combpbox widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_combobox_new(char *text, unsigned long id) +HWND dw_combobox_new(const char *text, unsigned long id) { GtkWidget *tmp; int sigid, _locked_by_me = FALSE; @@ -4408,7 +4408,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_button_new(char *text, unsigned long id) +HWND dw_button_new(const char *text, unsigned long id) { GtkWidget *tmp; int _locked_by_me = FALSE; @@ -4423,7 +4423,7 @@ return tmp; } -void _create_tooltip(HWND handle, char *text) +void _create_tooltip(HWND handle, const char *text) { GtkTooltips *tooltips = (GtkTooltips *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_tooltip"); @@ -4450,7 +4450,7 @@ * text: Bubble help text to be displayed. * id: An ID of a bitmap in the resource file. */ -HWND dw_bitmapbutton_new(char *text, unsigned long id) +HWND dw_bitmapbutton_new(const char *text, unsigned long id) { GtkWidget *tmp; GtkWidget *bitmap; @@ -4483,7 +4483,7 @@ * DW pick the appropriate file extension. * (BMP on OS/2 or Windows, XPM on Unix) */ -HWND dw_bitmapbutton_new_from_file(char *text, unsigned long id, char *filename) +HWND dw_bitmapbutton_new_from_file(const char *text, unsigned long id, const char *filename) { GtkWidget *tmp; GtkWidget *bitmap; @@ -4518,7 +4518,7 @@ * (BMP on OS/2 or Windows, XPM on Unix) * len: Length of raw data */ -HWND dw_bitmapbutton_new_from_data(char *text, unsigned long id, char *data, int len) +HWND dw_bitmapbutton_new_from_data(const char *text, unsigned long id, const char *data, int len) { GtkWidget *tmp; GtkWidget *bitmap; @@ -4547,7 +4547,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_spinbutton_new(char *text, unsigned long id) +HWND dw_spinbutton_new(const char *text, unsigned long id) { GtkAdjustment *adj; GtkWidget *tmp; @@ -4572,7 +4572,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_radiobutton_new(char *text, ULONG id) +HWND dw_radiobutton_new(const char *text, ULONG id) { /* This will have to be fixed in the future. */ GtkWidget *tmp; @@ -4686,7 +4686,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with dw_window_from_id() or 0L. */ -HWND dw_checkbox_new(char *text, unsigned long id) +HWND dw_checkbox_new(const char *text, unsigned long id) { GtkWidget *tmp; int _locked_by_me = FALSE; @@ -4764,7 +4764,7 @@ * Windows and a pixmap on Unix, pass * NULL if you use the id param) */ -void dw_window_set_bitmap(HWND handle, unsigned long id, char *filename) +void dw_window_set_bitmap(HWND handle, unsigned long id, const char *filename) { #if GTK_MAJOR_VERSION > 1 GdkPixbuf *pixbuf = NULL; @@ -4880,7 +4880,7 @@ * NULL if you use the id param) * len: length of data */ -void dw_window_set_bitmap_from_data(HWND handle, unsigned long id, char *data, int len) +void dw_window_set_bitmap_from_data(HWND handle, unsigned long id, const char *data, int len) { #if GTK_MAJOR_VERSION > 1 GdkPixbuf *pixbuf = NULL; @@ -4979,7 +4979,7 @@ * handle: Handle to the window. * text: The text associated with a given window. */ -void dw_window_set_text(HWND handle, char *text) +void dw_window_set_text(HWND handle, const char *text) { int _locked_by_me = FALSE; GtkWidget *tmp; @@ -5026,7 +5026,7 @@ * handle: Handle to the window (widget). * bubbletext: The text in the floating bubble tooltip. */ -void API dw_window_set_tooltip(HWND handle, char *bubbletext) +void API dw_window_set_tooltip(HWND handle, const char *bubbletext) { int _locked_by_me = FALSE; @@ -5155,7 +5155,7 @@ * buffer: Text buffer to be imported. * startpoint: Point to start entering text. */ -unsigned int dw_mle_import(HWND handle, char *buffer, int startpoint) +unsigned int dw_mle_import(HWND handle, const char *buffer, int startpoint) { unsigned int tmppoint = startpoint; int _locked_by_me = FALSE; @@ -5622,7 +5622,7 @@ * point: Start point of search. * flags: Search specific flags. */ -int dw_mle_search(HWND handle, char *text, int point, unsigned long flags) +int dw_mle_search(HWND handle, const char *text, int point, unsigned long flags) { int _locked_by_me = FALSE, retval = 0; @@ -6032,7 +6032,7 @@ * parent: Parent handle or 0 if root. * itemdata: Item specific data. */ -HTREEITEM dw_tree_insert_after(HWND handle, HTREEITEM item, char *title, HICN icon, HTREEITEM parent, void *itemdata) +HTREEITEM dw_tree_insert_after(HWND handle, HTREEITEM item, const char *title, HICN icon, HTREEITEM parent, void *itemdata) { #if GTK_MAJOR_VERSION > 1 GtkWidget *tree; @@ -6195,7 +6195,7 @@ * parent: Parent handle or 0 if root. * itemdata: Item specific data. */ -HTREEITEM dw_tree_insert(HWND handle, char *title, HICN icon, HTREEITEM parent, void *itemdata) +HTREEITEM dw_tree_insert(HWND handle, const char *title, HICN icon, HTREEITEM parent, void *itemdata) { #if GTK_MAJOR_VERSION > 1 GtkWidget *tree; @@ -6346,7 +6346,7 @@ * title: The text title of the entry. * icon: Handle to coresponding icon. */ -void dw_tree_item_change(HWND handle, HTREEITEM item, char *title, HICN icon) +void dw_tree_item_change(HWND handle, HTREEITEM item, const char *title, HICN icon) { #if GTK_MAJOR_VERSION > 1 GtkWidget *tree; @@ -6879,7 +6879,7 @@ * handle: Handle to the container to be configured. * title: The title to be displayed in the main column. */ -void API dw_filesystem_set_column_title(HWND handle, char *title) +void API dw_filesystem_set_column_title(HWND handle, const char *title) { char *newtitle = strdup(title ? title : ""); @@ -6960,7 +6960,7 @@ * DW pick the appropriate file extension. * (ICO on OS/2 or Windows, XPM on Unix) */ -HICN API dw_icon_load_from_file(char *filename) +HICN API dw_icon_load_from_file(const char *filename) { int found = -1, _locked_by_me = FALSE; #if GTK_MAJOR_VERSION > 1 @@ -7071,7 +7071,7 @@ * data: Source of data for image. * len: length of data */ -HICN API dw_icon_load_from_data(char *data, int len) +HICN API dw_icon_load_from_data(const char *data, int len) { int found = -1, _locked_by_me = FALSE; char *file; @@ -7270,7 +7270,7 @@ * Internal representation of dw_container_set_item() extracted so we can pass * two data pointers; icon and text for dw_filesystem_set_item(). */ -void _dw_container_set_item(HWND handle, void *pointer, int column, int row, void *data, char *text) +void _dw_container_set_item(HWND handle, void *pointer, int column, int row, void *data, const char *text) { char numbuf[11] = {0}, textbuffer[101] = {0}; int flag = 0; @@ -7417,7 +7417,7 @@ * row: Zero based row of data being set. * data: Pointer to the data to be added. */ -void API dw_filesystem_change_file(HWND handle, int row, char *filename, HICN icon) +void API dw_filesystem_change_file(HWND handle, int row, const char *filename, HICN icon) { dw_filesystem_set_file(handle, NULL, row, filename, icon); } @@ -7431,7 +7431,7 @@ * row: Zero based row of data being set. * data: Pointer to the data to be added. */ -void dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, HICN icon) +void dw_filesystem_set_file(HWND handle, void *pointer, int row, const char *filename, HICN icon) { _dw_container_set_item(handle, pointer, 0, row, (void *)&icon, filename); } @@ -7604,9 +7604,9 @@ * row: Zero based row of data being set. * title: String title of the item. */ -void dw_container_set_row_title(void *pointer, int row, char *title) -{ - _dw_container_set_row_data(pointer, pointer, row, _DW_DATA_TYPE_STRING, title); +void dw_container_set_row_title(void *pointer, int row, const char *title) +{ + _dw_container_set_row_data(pointer, pointer, row, _DW_DATA_TYPE_STRING, (void *)title); } /* @@ -7616,9 +7616,9 @@ * row: Zero based row of data being set. * title: String title of the item. */ -void dw_container_change_row_title(HWND handle, int row, char *title) -{ - _dw_container_set_row_data(handle, NULL, row, _DW_DATA_TYPE_STRING, title); +void dw_container_change_row_title(HWND handle, int row, const char *title) +{ + _dw_container_set_row_data(handle, NULL, row, _DW_DATA_TYPE_STRING, (void *)title); } /* @@ -7940,9 +7940,9 @@ * handle: Handle to the window (widget) to be queried. * text: Text usually returned by dw_container_query(). */ -void dw_container_cursor(HWND handle, char *text) -{ - _dw_container_cursor(handle, TRUE, text); +void dw_container_cursor(HWND handle, const char *text) +{ + _dw_container_cursor(handle, TRUE, (void *)text); } /* @@ -8000,9 +8000,9 @@ * handle: Handle to the window (widget). * text: Text usually returned by dw_container_query(). */ -void dw_container_delete_row(HWND handle, char *text) -{ - _dw_container_delete_row(handle, _DW_DATA_TYPE_STRING, text); +void dw_container_delete_row(HWND handle, const char *text) +{ + _dw_container_delete_row(handle, _DW_DATA_TYPE_STRING, (void *)text); } /* @@ -8069,7 +8069,7 @@ * icon: Icon handle to display in the taskbar. * bubbletext: Text to show when the mouse is above the icon. */ -void dw_taskbar_insert(HWND handle, HICN icon, char *bubbletext) +void dw_taskbar_insert(HWND handle, HICN icon, const char *bubbletext) { #if GTK_CHECK_VERSION(2,10,0) GtkStatusIcon *status; @@ -8634,7 +8634,7 @@ * y: Y coordinate. * text: Text to be displayed. */ -void dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text) +void dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, const char *text) { int _locked_by_me = FALSE; GdkGC *gc = NULL; @@ -8802,7 +8802,7 @@ * width: Pointer to a variable to be filled in with the width. * height Pointer to a variable to be filled in with the height. */ -void dw_font_text_extents_get(HWND handle, HPIXMAP pixmap, char *text, int *width, int *height) +void dw_font_text_extents_get(HWND handle, HPIXMAP pixmap, const char *text, int *width, int *height) { int _locked_by_me = FALSE; #if GTK_MAJOR_VERSION > 1 @@ -8928,7 +8928,7 @@ * Returns: * A handle to a pixmap or NULL on failure. */ -HPIXMAP dw_pixmap_new_from_file(HWND handle, char *filename) +HPIXMAP dw_pixmap_new_from_file(HWND handle, const char *filename) { int _locked_by_me = FALSE; HPIXMAP pixmap; @@ -8998,7 +8998,7 @@ * Returns: * A handle to a pixmap or NULL on failure. */ -HPIXMAP dw_pixmap_new_from_data(HWND handle, char *data, int len) +HPIXMAP dw_pixmap_new_from_data(HWND handle, const char *data, int len) { int _locked_by_me = FALSE; char *file; @@ -9123,7 +9123,7 @@ * Returns: * DW_ERROR_NONE on success and DW_ERROR_GENERAL on failure. */ -int API dw_pixmap_set_font(HPIXMAP pixmap, char *fontname) +int API dw_pixmap_set_font(HPIXMAP pixmap, const char *fontname) { if(pixmap && fontname && *fontname) { @@ -9390,7 +9390,7 @@ * handle: Pointer to a module handle, * will be filled in with the handle. */ -int dw_module_load(char *name, HMOD *handle) +int dw_module_load(const char *name, HMOD *handle) { int len; char *newname; @@ -9433,7 +9433,7 @@ * func: A pointer to a function pointer, to obtain * the address. */ -int dw_module_symbol(HMOD handle, char *name, void**func) +int dw_module_symbol(HMOD handle, const char *name, void**func) { if(!func || !name) return -1; @@ -9812,7 +9812,7 @@ * name: Name given to semaphore which can be opened * by other processes. */ -HEV dw_named_event_new(char *name) +HEV dw_named_event_new(const char *name) { struct sockaddr_un un; int ev, *tmpsock = (int *)malloc(sizeof(int)*2); @@ -9862,7 +9862,7 @@ * name: Name given to semaphore which can be opened * by other processes. */ -HEV dw_named_event_get(char *name) +HEV dw_named_event_get(const char *name) { struct sockaddr_un un; int ev = socket(AF_UNIX, SOCK_STREAM, 0); @@ -10045,7 +10045,7 @@ * size: Size in bytes of the shared memory region to allocate. * name: A string pointer to a unique memory name. */ -HSHM dw_named_memory_new(void **dest, int size, char *name) +HSHM dw_named_memory_new(void **dest, int size, const char *name) { char namebuf[1025] = {0}; struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); @@ -10091,7 +10091,7 @@ * size: Size in bytes of the shared memory region to requested. * name: A string pointer to a unique memory name. */ -HSHM dw_named_memory_get(void **dest, int size, char *name) +HSHM dw_named_memory_get(void **dest, int size, const char *name) { char namebuf[1025] = {0}; struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); @@ -11350,7 +11350,7 @@ * pageid: Page ID of the tab to set. * text: Pointer to the text to set. */ -void dw_notebook_page_set_text(HWND handle, unsigned long pageid, char *text) +void dw_notebook_page_set_text(HWND handle, unsigned long pageid, const char *text) { GtkWidget *child; int realpage, _locked_by_me = FALSE; @@ -11383,7 +11383,7 @@ * pageid: Page ID of the tab to set. * text: Pointer to the text to set. */ -void dw_notebook_page_set_status_text(HWND handle, unsigned long pageid, char *text) +void dw_notebook_page_set_status_text(HWND handle, unsigned long pageid, const char *text) { /* TODO (if possible) */ } @@ -11457,7 +11457,7 @@ * handle: Handle to the listbox to be appended to. * text: Text to append into listbox. */ -void dw_listbox_append(HWND handle, char *text) +void dw_listbox_append(HWND handle, const char *text) { GtkWidget *handle2 = handle; int _locked_by_me = FALSE; @@ -11518,7 +11518,7 @@ * text: Text to insert into listbox. * pos: 0-based index into listbox. -1 will append */ -void dw_listbox_insert(HWND handle, char *text, int pos) +void dw_listbox_insert(HWND handle, const char *text, int pos) { GtkWidget *handle2 = handle; int _locked_by_me = FALSE; @@ -11816,7 +11816,7 @@ * index: Index into the list to be queried. * buffer: Buffer where text will be copied. */ -void dw_listbox_set_text(HWND handle, unsigned int index, char *buffer) +void dw_listbox_set_text(HWND handle, unsigned int index, const char *buffer) { GtkWidget *handle2 = handle; int _locked_by_me = FALSE; @@ -12515,7 +12515,7 @@ * the file path on success. * */ -char *dw_file_browse(char *title, char *defpath, char *ext, int flags) +char *dw_file_browse(const char *title, const char *defpath, const char *ext, int flags) { GtkWidget *filew; @@ -12725,7 +12725,7 @@ * Returns: * -1 on error. */ -int dw_exec(char *program, int type, char **params) +int dw_exec(const char *program, int type, char **params) { int ret = -1; @@ -12782,7 +12782,7 @@ * Parameters: * url: Uniform resource locator. */ -int dw_browse(char *url) +int dw_browse(const char *url) { #if GTK_CHECK_VERSION(2,14,0) /* If possible load the URL/URI using gvfs... */ @@ -12801,7 +12801,7 @@ tmp = getenv( "DW_BROWSER" ); if(tmp) browser = tmp; execargs[0] = browser; - execargs[1] = url; + execargs[1] = (char *)url; execargs[2] = NULL; return dw_exec(browser, DW_EXEC_GUI, execargs); @@ -12866,7 +12866,7 @@ * Returns: * 0 on success. */ -int dw_html_raw(HWND handle, char *string) +int dw_html_raw(HWND handle, const char *string) { #ifdef USE_WEBKIT int _locked_by_me = FALSE; @@ -12894,7 +12894,7 @@ * Returns: * 0 on success. */ -int dw_html_url(HWND handle, char *url) +int dw_html_url(HWND handle, const char *url) { #ifdef USE_WEBKIT int _locked_by_me = FALSE; @@ -12923,7 +12923,7 @@ * Returns: * DW_ERROR_NONE (0) on success. */ -int dw_html_javascript_run(HWND handle, char *script, void *scriptdata) +int dw_html_javascript_run(HWND handle, const char *script, void *scriptdata) { #ifdef USE_WEBKIT int _locked_by_me = FALSE; @@ -13041,7 +13041,7 @@ * Parameters: * Text. */ -void dw_clipboard_set_text( char *str, int len ) +void dw_clipboard_set_text(const char *str, int len) { int _locked_by_me = FALSE; GtkClipboard *clipboard_object; @@ -13089,7 +13089,7 @@ * Returns: * A handle to the print object or NULL on failure. */ -HPRINT API dw_print_new(char *jobname, unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata) +HPRINT API dw_print_new(const char *jobname, unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata) { #if GTK_CHECK_VERSION(2,10,0) GtkPrintOperation *op; @@ -13209,7 +13209,7 @@ * dataname: A string pointer identifying which signal to be hooked. * data: User data to be passed to the handler function. */ -void dw_window_set_data(HWND window, char *dataname, void *data) +void dw_window_set_data(HWND window, const char *dataname, void *data) { int _locked_by_me = FALSE; @@ -13240,7 +13240,7 @@ * dataname: A string pointer identifying which signal to be hooked. * data: User data to be passed to the handler function. */ -void *dw_window_get_data(HWND window, char *dataname) +void *dw_window_get_data(HWND window, const char *dataname) { int _locked_by_me = FALSE; void *ret = NULL; @@ -13291,7 +13291,7 @@ /* Get the actual signal window handle not the user window handle * Should mimic the code in dw_signal_connect() below. */ -static HWND _find_signal_window(HWND window, char *signame) +static HWND _find_signal_window(HWND window, const char *signame) { HWND thiswindow = window; @@ -13343,7 +13343,7 @@ * sigfunc: The pointer to the function to be used as the callback. * data: User data to be passed to the handler function. */ -void dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data) +void dw_signal_connect(HWND window, const char *signame, void *sigfunc, void *data) { dw_signal_connect_data(window, signame, sigfunc, NULL, data); } @@ -13359,10 +13359,10 @@ * discfunc: The pointer to the function called when this handler is removed. * data: User data to be passed to the handler function. */ -void dw_signal_connect_data(HWND window, char *signame, void *sigfunc, void *discfunc, void *data) +void dw_signal_connect_data(HWND window, const char *signame, void *sigfunc, void *discfunc, void *data) { void *thisfunc = _findsigfunc(signame); - char *thisname = signame; + char *thisname = (char *)signame; HWND thiswindow = window; int sigid, _locked_by_me = FALSE; void **params = calloc(_DW_INTERNAL_CALLBACK_PARAMS, sizeof(void *)); @@ -13579,7 +13579,7 @@ * Parameters: * window: Window handle of callback to be removed. */ -void dw_signal_disconnect_by_name(HWND window, char *signame) +void dw_signal_disconnect_by_name(HWND window, const char *signame) { int z, count; void *thisfunc; @@ -13662,7 +13662,7 @@ * Wide string that needs to be freed with dw_free() * or NULL on failure. */ -wchar_t * API dw_utf8_to_wchar(char *utf8string) +wchar_t * API dw_utf8_to_wchar(const char *utf8string) { wchar_t *retval = NULL, *freeme; @@ -13686,7 +13686,7 @@ * UTF-8 encoded string that needs to be freed with dw_free() * or NULL on failure. */ -char * API dw_wchar_to_utf8(wchar_t *wstring) +char * API dw_wchar_to_utf8(const wchar_t *wstring) { char *retval = NULL, *freeme;