1 /* 2 * GNU Typist - interactive typing tutor program for UNIX systems 3 * 4 * Copyright (C) 2011 GNU Typist Development Team <bug-gtypist@gnu.org> 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef UTF8_H 21 #define UTF8_H 22 23 #ifndef _XOPEN_SOURCE_EXTENDED 24 #define _XOPEN_SOURCE_EXTENDED 25 #endif 26 27 #include <wchar.h> 28 29 /* 30 ncurses' KEY_BACKSPACE (0x107) collides with polish "c with acute (0x107) 31 => we need to encode KEY_BACKSPACE! 32 */ 33 #define GTYPIST_KEY_BACKSPACE 0x0008 34 35 36 extern wchar_t* widen(const char* text); 37 extern char* convertUTF8ToCurrentEncoding(const char* UTF8Input); 38 extern wchar_t* convertFromUTF8(const char* UTF8Text); 39 extern void mvwideaddstr(int y, int x, const char* UTF8Text); 40 extern void wideaddstr(const char* UTF8Text); 41 extern void wideaddstr_rev(const char* UTF8Text); 42 extern void wideaddch(wchar_t c); 43 extern void wideaddch_rev(wchar_t c); 44 extern int utf8len(const char* UTF8Text); 45 extern int iswideupper(wchar_t c); 46 extern wchar_t towideupper(wchar_t c); 47 extern int get_widech(int* c); 48 49 #endif /* !UTF8_H */ 50