diff --git a/Makefile b/Makefile index 10e896e..f13f5e5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ # Makefile to build x48ng without autotools VERSION_MAJOR = 0 -VERSION_MINOR = 27 -PATCHLEVEL = 1 +VERSION_MINOR = 28 +PATCHLEVEL = 0 MAKEFLAGS +=-j$(NUM_CORES) -l$(NUM_CORES) @@ -23,8 +23,8 @@ CFLAGS += $(shell pkg-config --cflags SDL_gfx sdl12_compat) LIBS += $(shell pkg-config --libs SDL_gfx sdl12_compat) ### Text UI -CFLAGS += $(shell pkg-config --cflags ncurses) -LIBS += $(shell pkg-config --libs ncurses) +CFLAGS += $(shell pkg-config --cflags ncursesw -DNCURSES_WIDECHAR=1) +LIBS += $(shell pkg-config --libs ncursesw) ### debugger CFLAGS += $(shell pkg-config --cflags readline) diff --git a/src/ui_text.c b/src/ui_text.c index f2dfb76..0f96e64 100644 --- a/src/ui_text.c +++ b/src/ui_text.c @@ -8,6 +8,7 @@ #include #include #include +#include #include @@ -37,7 +38,7 @@ typedef struct tui_ann_struct_t { int bit; int x; int y; - char icon; + wchar_t* icon; } tui_ann_struct_t; typedef struct tui_button_t { @@ -51,12 +52,12 @@ typedef struct tui_button_t { /* variables */ /*************/ static tui_ann_struct_t ann_tbl[] = { - {ANN_LEFT, 16, 4, '<'}, /* '↰' */ - { ANN_RIGHT, 61, 4, '>'}, /* '↱ */ - { ANN_ALPHA, 106, 4, 'a'}, /* 'α' */ - { ANN_BATTERY, 151, 4, 'B'}, /* '🪫' */ - { ANN_BUSY, 196, 4, '*'}, /* '⌛' */ - { ANN_IO, 241, 4, '^'}, /* '☃' */ + {ANN_LEFT, 16, 4, L"\u21b0" }, /* ↰ */ + { ANN_RIGHT, 61, 4, L"\u21b1" }, /* ↱ */ + { ANN_ALPHA, 106, 4, L"\u03b1" }, /* α */ + { ANN_BATTERY, 151, 4, L"\u1faab"}, /* 🪫 */ + { ANN_BUSY, 196, 4, L"\u231b" }, /* ⌛ */ + { ANN_IO, 241, 4, L"\u21c4" }, /* ⇄ */ /* { 0 } */ }; @@ -635,13 +636,13 @@ void text_draw_annunc( void ) return; last_annunc_state = val; - for ( int i = 0; i < 6; i++ ) - mvaddch( 0, 3 + ( i * 4 ), ( ( ann_tbl[ i ].bit & val ) == ann_tbl[ i ].bit ) ? ann_tbl[ i ].icon : ' ' ); + mvaddwstr( 0, 4 + ( i * 4 ), ( ( ann_tbl[ i ].bit & val ) == ann_tbl[ i ].bit ) ? ann_tbl[ i ].icon : L" " ); } void init_text_ui( int argc, char** argv ) { + setlocale( LC_ALL, "" ); buttons = ( tui_button_t* )malloc( sizeof( buttons_gx ) ); if ( opt_gx )