Changeset 9907acfc7422d52b0fd174f7a20cc41d7896f9a2
- Timestamp:
- 30/10/07 04:42:18
(1 year ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1193715738 +0000
- git-parent:
[a7cc6c93be03fe91fcc8f06498bf44b032fbddaa]
- git-author:
- Rafaël Carré <funman@videolan.org> 1193715738 +0000
- Message:
ncurses: base detection of wide characters support on the presence of libncursesw, and use the same header wether it's present or not
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r632c854 |
r9907acf |
|
| 5354 | 5354 | dnl |
|---|
| 5355 | 5355 | AC_ARG_ENABLE(ncurses, |
|---|
| 5356 | | [ --disable-ncurses ncurses interface support (default enabled)], |
|---|
| | 5356 | [ --disable-ncurses ncurses interface support (default auto)], |
|---|
| 5357 | 5357 | [if test "${enable_ncurses}" != "no"; then |
|---|
| 5358 | | AC_CHECK_HEADERS(ncursesw/curses.h, |
|---|
| 5359 | | [AC_CHECK_LIB( ncursesw, mvprintw, |
|---|
| 5360 | | [VLC_ADD_PLUGINS([ncurses]) |
|---|
| 5361 | | VLC_ADD_LIBS([ncurses],[-lncursesw])]) |
|---|
| 5362 | | ], |
|---|
| 5363 | | [AC_CHECK_HEADER(curses.h, |
|---|
| 5364 | | [AC_CHECK_LIB(ncurses, mvprintw, |
|---|
| 5365 | | [VLC_ADD_PLUGINS([ncurses]) |
|---|
| 5366 | | VLC_ADD_LIBS([ncurses],[-lncurses])] |
|---|
| 5367 | | )] |
|---|
| 5368 | | )] |
|---|
| 5369 | | ) |
|---|
| 5370 | | fi]) |
|---|
| | 5358 | AC_CHECK_HEADER(ncurses.h, |
|---|
| | 5359 | [AC_CHECK_LIB(ncursesw, mvprintw, |
|---|
| | 5360 | [VLC_ADD_PLUGINS([ncurses]) |
|---|
| | 5361 | VLC_ADD_LIBS([ncurses],[-lncursesw]) |
|---|
| | 5362 | AC_DEFINE([HAVE_NCURSESW], 1, [Define to 1 if you have libncursesw.]) |
|---|
| | 5363 | ], |
|---|
| | 5364 | [AC_CHECK_LIB( ncurses, mvprintw, |
|---|
| | 5365 | [VLC_ADD_PLUGINS([ncurses]) |
|---|
| | 5366 | VLC_ADD_LIBS([ncurses],[-lncurses])], |
|---|
| | 5367 | [AS_IF([test "x${enable_ncurses}" != "x"], [ |
|---|
| | 5368 | AC_MSG_ERROR([libncurses not found])])] |
|---|
| | 5369 | )] |
|---|
| | 5370 | )] |
|---|
| | 5371 | ) |
|---|
| | 5372 | fi] |
|---|
| | 5373 | ) |
|---|
| 5371 | 5374 | |
|---|
| 5372 | 5375 | dnl |
|---|
| rc101253 |
r9907acf |
|
| 33 | 33 | #include <time.h> |
|---|
| 34 | 34 | |
|---|
| 35 | | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| 36 | | #include <ncursesw/curses.h> |
|---|
| 37 | | #else |
|---|
| 38 | | #include <curses.h> |
|---|
| | 35 | #ifdef HAVE_NCURSESW |
|---|
| | 36 | # define _XOPEN_SOURCE_EXTENDED 1 |
|---|
| 39 | 37 | #endif |
|---|
| | 38 | |
|---|
| | 39 | #include <ncurses.h> |
|---|
| 40 | 40 | |
|---|
| 41 | 41 | #include <vlc_interface.h> |
|---|
| … | … | |
| 438 | 438 | psz_part[len] = (char)i_key; |
|---|
| 439 | 439 | |
|---|
| 440 | | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| | 440 | #ifdef HAVE_NCURSESW |
|---|
| 441 | 441 | psz_utf8 = strdup( psz_part ); |
|---|
| 442 | 442 | #else |
|---|
| … | … | |
| 1152 | 1152 | char *p_buf = NULL; |
|---|
| 1153 | 1153 | int i_len; |
|---|
| 1154 | | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| | 1154 | #ifdef HAVE_NCURSESW |
|---|
| 1155 | 1155 | size_t i_char_len; /* UCS character length */ |
|---|
| 1156 | 1156 | size_t i_width; /* Display width */ |
|---|
| … | … | |
| 1167 | 1167 | |
|---|
| 1168 | 1168 | i_len = strlen( p_buf ); |
|---|
| 1169 | | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| | 1169 | #ifdef HAVE_NCURSESW |
|---|
| 1170 | 1170 | psz_wide = (wchar_t *) malloc( sizeof( wchar_t ) * ( i_len + 1 ) ); |
|---|
| 1171 | 1171 | |
|---|
| … | … | |
| 1200 | 1200 | p_buf[w/2+1] = '.'; |
|---|
| 1201 | 1201 | } |
|---|
| 1202 | | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| | 1202 | #ifdef HAVE_NCURSESW |
|---|
| 1203 | 1203 | mvprintw( y, x, "%s", p_buf ); |
|---|
| 1204 | 1204 | #else |
|---|
| … | … | |
| 1210 | 1210 | else |
|---|
| 1211 | 1211 | { |
|---|
| 1212 | | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| | 1212 | #ifdef HAVE_NCURSESW |
|---|
| 1213 | 1213 | mvprintw( y, x, "%s", p_buf ); |
|---|
| 1214 | 1214 | mvhline( y, x + i_width, ' ', w - i_width ); |
|---|