# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1339618121 0 # Node ID ff9a5170671509517e72d79b3b38ff486bd595ad # Parent e4fcd1e81f0d4dde0d1bddfed48a15aec514f930 Added optional keypress callback optional utf8 parameter on Windows. diff -r e4fcd1e81f0d -r ff9a51706715 template/dw.c --- a/template/dw.c Wed Jun 13 19:38:00 2012 +0000 +++ b/template/dw.c Wed Jun 13 20:08:41 2012 +0000 @@ -1615,7 +1615,7 @@ } /* - * Configures the main filesystem columnn title for localization. + * Configures the main filesystem column title for localization. * Parameters: * handle: Handle to the container to be configured. * title: The title to be displayed in the main column. diff -r e4fcd1e81f0d -r ff9a51706715 win/dw.c --- a/win/dw.c Wed Jun 13 19:38:00 2012 +0000 +++ b/win/dw.c Wed Jun 13 20:08:41 2012 +0000 @@ -1965,13 +1965,20 @@ break; case WM_CHAR: { - int (*keypressfunc)(HWND, char, int, int, void *) = tmp->signalfunction; + int (*keypressfunc)(HWND, char, int, int, void *, char *) = tmp->signalfunction; if(hWnd == tmp->window || _toplevel_window(hWnd) == tmp->window) { int special = 0; - char ch = 0; - + char *utf8 = NULL, ch[2] = {0}; +#ifdef UNICODE + WCHAR uc[2] = { 0 }; + + uc[0] = (WCHAR)mp1; + utf8 = WideToUTF8(uc); + dw_debug("UTF8 %s\n", utf8); +#endif + if(GetAsyncKeyState(VK_SHIFT) & 0x8000) special |= KC_SHIFT; if(GetAsyncKeyState(VK_CONTROL) & 0x8000) @@ -1980,9 +1987,9 @@ special |= KC_ALT; if(origmsg == WM_CHAR && mp1 < 128) - ch = (char)mp1; - - result = keypressfunc(tmp->window, ch, (int)mp1, special, tmp->data); + ch[0] = (char)mp1; + + result = keypressfunc(tmp->window, ch[0], (int)mp1, special, tmp->data, utf8 ? utf8 : ch); tmp = NULL; } } @@ -9001,16 +9008,16 @@ } /* - * Configures the main filesystem columnn title for localization. + * Configures the main filesystem column title for localization. * Parameters: * 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) { - char *newtitle = strdup(title ? title : ""); - - dw_window_set_data(handle, "_dw_coltitle", newtitle); + char *newtitle = strdup(title ? title : ""); + + dw_window_set_data(handle, "_dw_coltitle", newtitle); } /* @@ -9039,8 +9046,8 @@ dw_container_setup(handle, flags, titles, count, -1); if(coltitle) { - dw_window_set_data(handle, "_dw_coltitle", NULL); - free(coltitle); + dw_window_set_data(handle, "_dw_coltitle", NULL); + free(coltitle); } return DW_ERROR_NONE; }