Changeset c74a75e96a5bf4752d1e3d6a697ddbde67435e61
- Timestamp:
- 09/13/07 23:58:05
(1 year ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1189720685 +0000
- git-parent:
[1fd6a94503a42e517cc2bbcb194391d6e7052939]
- git-author:
- Rafaël Carré <funman@videolan.org> 1189720685 +0000
- Message:
ncurses: fallback on libncurses if libncursesw isn't available (macosx)
it is now enabled by default if headers & library are present
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rbc959f8 |
rc74a75e |
|
| 5311 | 5311 | dnl |
|---|
| 5312 | 5312 | AC_ARG_ENABLE(ncurses, |
|---|
| 5313 | | [ --enable-ncurses ncurses interface support (default disabled)], |
|---|
| 5314 | | [if test "${enable_ncurses}" = "yes"; then |
|---|
| 5315 | | AC_CHECK_HEADERS(ncursesw/curses.h,[ |
|---|
| 5316 | | VLC_ADD_PLUGINS([ncurses]) |
|---|
| 5317 | | VLC_ADD_LDFLAGS([ncurses],[-lncursesw]) |
|---|
| 5318 | | ]) |
|---|
| | 5313 | [ --disable-ncurses ncurses interface support (default enabled)], |
|---|
| | 5314 | [if test "${enable_ncurses}" != "no"; then |
|---|
| | 5315 | AC_CHECK_HEADERS(ncursesw/curses.h, |
|---|
| | 5316 | [AC_CHECK_LIB( ncursesw, mvprintw, |
|---|
| | 5317 | [VLC_ADD_PLUGINS([ncurses]) |
|---|
| | 5318 | VLC_ADD_LDFLAGS([ncurses],[-lncursesw])]) |
|---|
| | 5319 | ], |
|---|
| | 5320 | [AC_CHECK_HEADER(curses.h, |
|---|
| | 5321 | [AC_CHECK_LIB(ncurses, mvprintw, |
|---|
| | 5322 | [VLC_ADD_PLUGINS([ncurses]) |
|---|
| | 5323 | VLC_ADD_LDFLAGS([ncurses],[-lncurses])] |
|---|
| | 5324 | )] |
|---|
| | 5325 | )] |
|---|
| | 5326 | ) |
|---|
| 5319 | 5327 | fi]) |
|---|
| 5320 | 5328 | |
|---|
| rbfa9e5b |
rc74a75e |
|
| 33 | 33 | #include <time.h> |
|---|
| 34 | 34 | |
|---|
| | 35 | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| 35 | 36 | #include <ncursesw/curses.h> |
|---|
| | 37 | #else |
|---|
| | 38 | #include <curses.h> |
|---|
| | 39 | #endif |
|---|
| 36 | 40 | |
|---|
| 37 | 41 | #include <vlc_interface.h> |
|---|
| … | … | |
| 1126 | 1130 | char *p_buf = NULL; |
|---|
| 1127 | 1131 | int i_len; |
|---|
| | 1132 | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| 1128 | 1133 | size_t i_char_len; /* UCS character length */ |
|---|
| 1129 | 1134 | size_t i_width; /* Display width */ |
|---|
| 1130 | 1135 | wchar_t *psz_wide; /* wchar_t representation of p_buf */ |
|---|
| | 1136 | #endif |
|---|
| 1131 | 1137 | |
|---|
| 1132 | 1138 | va_start( vl_args, p_fmt ); |
|---|
| … | … | |
| 1138 | 1144 | |
|---|
| 1139 | 1145 | i_len = strlen( p_buf ); |
|---|
| | 1146 | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| 1140 | 1147 | psz_wide = (wchar_t *) malloc( sizeof( wchar_t ) * ( i_len + 1 ) ); |
|---|
| 1141 | 1148 | |
|---|
| … | … | |
| 1150 | 1157 | i_width = i_len; |
|---|
| 1151 | 1158 | } |
|---|
| 1152 | | |
|---|
| 1153 | 1159 | if( i_width > w ) |
|---|
| 1154 | | { /* FIXME: ellipsize psz_wide while keeping the width in mind */ |
|---|
| | 1160 | #else |
|---|
| | 1161 | if( i_len > w ) |
|---|
| | 1162 | #endif |
|---|
| | 1163 | { /* FIXME: ncursesw: ellipsize psz_wide while keeping the width in mind */ |
|---|
| 1155 | 1164 | char *psz_local; |
|---|
| 1156 | 1165 | int i_cut = i_len - w; |
|---|
| … | … | |
| 1178 | 1187 | mvprintw( y, x, "%s", psz_local ); |
|---|
| 1179 | 1188 | LocaleFree( p_buf ); |
|---|
| | 1189 | #ifdef HAVE_NCURSESW_CURSES_H |
|---|
| 1180 | 1190 | mvhline( y, x + i_width, ' ', w - i_width ); |
|---|
| | 1191 | #else |
|---|
| | 1192 | mvhline( y, x + i_len, ' ', w - i_len ); |
|---|
| | 1193 | #endif |
|---|
| 1181 | 1194 | } |
|---|
| 1182 | 1195 | } |
|---|