Changeset c74a75e96a5bf4752d1e3d6a697ddbde67435e61

Show
Ignore:
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
  • configure.ac

    rbc959f8 rc74a75e  
    53115311dnl 
    53125312AC_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     )   
    53195327   fi]) 
    53205328 
  • modules/gui/ncurses.c

    rbfa9e5b rc74a75e  
    3333#include <time.h> 
    3434 
     35#ifdef HAVE_NCURSESW_CURSES_H 
    3536#include <ncursesw/curses.h> 
     37#else 
     38#include <curses.h> 
     39#endif 
    3640 
    3741#include <vlc_interface.h> 
     
    11261130    char    *p_buf = NULL; 
    11271131    int      i_len; 
     1132#ifdef HAVE_NCURSESW_CURSES_H 
    11281133    size_t   i_char_len;    /* UCS character length */ 
    11291134    size_t   i_width;       /* Display width */ 
    11301135    wchar_t *psz_wide;      /* wchar_t representation of p_buf */ 
     1136#endif 
    11311137 
    11321138    va_start( vl_args, p_fmt ); 
     
    11381144 
    11391145    i_len = strlen( p_buf ); 
     1146#ifdef HAVE_NCURSESW_CURSES_H 
    11401147    psz_wide = (wchar_t *) malloc( sizeof( wchar_t ) * ( i_len + 1 ) ); 
    11411148 
     
    11501157            i_width = i_len; 
    11511158    } 
    1152  
    11531159    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 */ 
    11551164        char *psz_local; 
    11561165        int i_cut = i_len - w; 
     
    11781187        mvprintw( y, x, "%s", psz_local ); 
    11791188        LocaleFree( p_buf ); 
     1189#ifdef HAVE_NCURSESW_CURSES_H 
    11801190        mvhline( y, x + i_width, ' ', w - i_width ); 
     1191#else 
     1192        mvhline( y, x + i_len, ' ', w - i_len ); 
     1193#endif 
    11811194    } 
    11821195}