summaryrefslogtreecommitdiff
path: root/testing/toxic/windows.h
diff options
context:
space:
mode:
authorManuel Argüelles <manuel.arguelles@gmail.com>2013-08-21 16:19:35 -0500
committerManuel Argüelles <manuel.arguelles@gmail.com>2013-08-21 16:19:35 -0500
commit93789396b16e0eaef7b0d540b2ff2a39b5a315ec (patch)
tree9749d56cf218408017c8341b1c7f28a1c3bb55a4 /testing/toxic/windows.h
parentd840e8a7430616bf96c164446f672d23b06cdfef (diff)
Add wide char support in toxic (issue #440)
Set current locale, use of get_wch instead of getch for reading, use wctomb and friends to convert back from wchar_t, link with cursesw. Unicode support is only added to chat windows.
Diffstat (limited to 'testing/toxic/windows.h')
-rw-r--r--testing/toxic/windows.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/testing/toxic/windows.h b/testing/toxic/windows.h
index 86917dbe..227040b9 100644
--- a/testing/toxic/windows.h
+++ b/testing/toxic/windows.h
@@ -4,9 +4,12 @@
4#ifndef _windows_h 4#ifndef _windows_h
5#define _windows_h 5#define _windows_h
6 6
7#define _XOPEN_SOURCE_EXTENDED
7#include <curses.h> 8#include <curses.h>
8#include <stdint.h> 9#include <stdint.h>
9#include <stdbool.h> 10#include <stdbool.h>
11#include <wctype.h>
12#include <wchar.h>
10#include "../../core/Messenger.h" 13#include "../../core/Messenger.h"
11#define MAX_WINDOWS_NUM 32 14#define MAX_WINDOWS_NUM 32
12#define MAX_FRIENDS_NUM 100 15#define MAX_FRIENDS_NUM 100
@@ -23,7 +26,7 @@
23typedef struct ToxWindow_ ToxWindow; 26typedef struct ToxWindow_ ToxWindow;
24 27
25struct ToxWindow_ { 28struct ToxWindow_ {
26 void(*onKey)(ToxWindow *, Messenger *, int); 29 void(*onKey)(ToxWindow *, Messenger *, wint_t);
27 void(*onDraw)(ToxWindow *, Messenger *); 30 void(*onDraw)(ToxWindow *, Messenger *);
28 void(*onInit)(ToxWindow *, Messenger *); 31 void(*onInit)(ToxWindow *, Messenger *);
29 void(*onFriendRequest)(ToxWindow *, uint8_t *, uint8_t *, uint16_t); 32 void(*onFriendRequest)(ToxWindow *, uint8_t *, uint8_t *, uint16_t);