mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Add support for wide curses.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4331 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
a59dfa003e
commit
40d97468ca
@ -319,6 +319,15 @@ void term_addch(TERM_WINDOW *window, int chr)
|
||||
|
||||
void term_add_unichar(TERM_WINDOW *window, unichar chr)
|
||||
{
|
||||
#ifdef WIDEC_CURSES
|
||||
cchar_t wch;
|
||||
wchar_t temp[2];
|
||||
temp[0] = chr;
|
||||
temp[1] = 0;
|
||||
if (setcchar(&wch, temp, A_NORMAL, 0, NULL) == OK)
|
||||
wadd_wch(window->win, &wch);
|
||||
else
|
||||
#endif
|
||||
waddch(window->win, chr);
|
||||
}
|
||||
|
||||
@ -393,18 +402,25 @@ void term_set_input_type(int type)
|
||||
|
||||
int term_gets(unichar *buffer, int size)
|
||||
{
|
||||
int key, count;
|
||||
int count;
|
||||
#ifdef WIDEC_CURSES
|
||||
wint_t key;
|
||||
#else
|
||||
int key;
|
||||
#endif
|
||||
|
||||
for (count = 0; count < size; ) {
|
||||
key = getch();
|
||||
#ifdef WIDEC_CURSES
|
||||
if (get_wch(&key) == ERR)
|
||||
#else
|
||||
if ((key = getch()) == ERR)
|
||||
#endif
|
||||
break;
|
||||
#ifdef KEY_RESIZE
|
||||
if (key == KEY_RESIZE)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (key == ERR)
|
||||
break;
|
||||
|
||||
buffer[count] = key;
|
||||
count++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user