Merge branch 'master' into sdl2.0
There are problems with im that should be investigated...
This commit is contained in:
commit
9cf77f684c
184 changed files with 9413 additions and 8107 deletions
|
|
@ -52,35 +52,8 @@ static void print_composemap(osk_composenode * composemap, char *sp);
|
|||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <iconv.h>
|
||||
#define wcstok(line, delim, pointer) wcstok(line, delim)
|
||||
#define strtok_r(line, delim, pointer) strtok(line, delim)
|
||||
|
||||
static void mtw(wchar_t * wtok, char *tok);
|
||||
|
||||
static void mtw(wchar_t * wtok, char *tok)
|
||||
{
|
||||
/* workaround using iconv to get a functionallity somewhat approximate as mbstowcs() */
|
||||
Uint16 *ui16;
|
||||
char *wrptr;
|
||||
size_t n, in, out;
|
||||
iconv_t trans;
|
||||
|
||||
n = 255;
|
||||
in = 250;
|
||||
out = 250;
|
||||
ui16 = malloc(sizeof(Uint16) * 255);
|
||||
wrptr = (char *)ui16;
|
||||
|
||||
trans = iconv_open("WCHAR_T", "UTF-8");
|
||||
iconv(trans, (const char **)&tok, &in, &wrptr, &out);
|
||||
*((wchar_t *) wrptr) = L'\0';
|
||||
swprintf(wtok, L"%ls", ui16);
|
||||
free(ui16);
|
||||
iconv_close(trans);
|
||||
}
|
||||
|
||||
#define mbstowcs(wtok, tok, size) mtw(wtok, tok)
|
||||
#include <windows.h>
|
||||
#define mbstowcs(wtok, tok, size) MultiByteToWideChar(CP_UTF8,MB_COMPOSITE,tok,-1,wtok,size)
|
||||
#endif
|
||||
|
||||
struct osk_keyboard *osk_create(char * layout_name, SDL_Surface * canvas,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue