remove support for PDCurses
This commit is contained in:
1
NEWS
1
NEWS
@@ -10,6 +10,7 @@ ncmpcpp-0.7 (????-??-??)
|
|||||||
* Find backward/forward function is now incremental.
|
* Find backward/forward function is now incremental.
|
||||||
* Support for 256 colors and customization of background colors has been added.
|
* Support for 256 colors and customization of background colors has been added.
|
||||||
* Multiple configuration files via command line arguments are now accepted. In addition, by default ncmpcpp attempts to read both $HOME/.ncmpcpp/config and $XDG_CONFIG_HOME/ncmpcpp/config (in this order).
|
* Multiple configuration files via command line arguments are now accepted. In addition, by default ncmpcpp attempts to read both $HOME/.ncmpcpp/config and $XDG_CONFIG_HOME/ncmpcpp/config (in this order).
|
||||||
|
* Support for PDCurses has been removed due to the library being unmaintained and buggy.
|
||||||
|
|
||||||
ncmpcpp-0.6.2 (????-??-??)
|
ncmpcpp-0.6.2 (????-??-??)
|
||||||
|
|
||||||
|
|||||||
36
configure.ac
36
configure.ac
@@ -15,7 +15,6 @@ AC_ARG_ENABLE(clock, AS_HELP_STRING([--enable-clock], [Enable clock screen @<:@d
|
|||||||
AC_ARG_ENABLE(unicode, AS_HELP_STRING([--enable-unicode], [Enable utf8 support @<:@default=yes@:>@]), [unicode=$enableval], [unicode=yes])
|
AC_ARG_ENABLE(unicode, AS_HELP_STRING([--enable-unicode], [Enable utf8 support @<:@default=yes@:>@]), [unicode=$enableval], [unicode=yes])
|
||||||
AC_ARG_WITH(curl, AS_HELP_STRING([--with-curl], [Enable fetching lyrics from the Internet @<:@default=auto@:>@]), [curl=$withval], [curl=auto])
|
AC_ARG_WITH(curl, AS_HELP_STRING([--with-curl], [Enable fetching lyrics from the Internet @<:@default=auto@:>@]), [curl=$withval], [curl=auto])
|
||||||
AC_ARG_WITH(fftw, AS_HELP_STRING([--with-fftw], [Enable fftw support (required for frequency spectrum vizualization) @<:@default=auto@:>@]), [fftw=$withval], [fftw=auto])
|
AC_ARG_WITH(fftw, AS_HELP_STRING([--with-fftw], [Enable fftw support (required for frequency spectrum vizualization) @<:@default=auto@:>@]), [fftw=$withval], [fftw=auto])
|
||||||
AC_ARG_WITH(pdcurses, AS_HELP_STRING([--with-pdcurses[=LIBNAME]], [Link against pdcurses instead of ncurses @<:@default=XCurses@:>@]), [pdcurses=$withval], [pdcurses=no])
|
|
||||||
AC_ARG_WITH(taglib, AS_HELP_STRING([--with-taglib], [Enable tag editor @<:@default=auto@:>@]), [taglib=$withval], [taglib=auto])
|
AC_ARG_WITH(taglib, AS_HELP_STRING([--with-taglib], [Enable tag editor @<:@default=auto@:>@]), [taglib=$withval], [taglib=auto])
|
||||||
|
|
||||||
if test "$outputs" = "yes"; then
|
if test "$outputs" = "yes"; then
|
||||||
@@ -226,35 +225,23 @@ AC_CHECK_HEADERS([pthread.h],
|
|||||||
dnl ========================
|
dnl ========================
|
||||||
dnl = checking for ncurses =
|
dnl = checking for ncurses =
|
||||||
dnl ========================
|
dnl ========================
|
||||||
if test "$pdcurses" = "no" ; then
|
if test "$unicode" = "yes" ; then
|
||||||
if test "$unicode" = "yes" ; then
|
curses_config_bin="ncursesw6-config ncursesw5-config"
|
||||||
curses_config_bin="ncursesw6-config ncursesw5-config"
|
AC_DEFINE([NCMPCPP_UNICODE], [1], [enables unicode support])
|
||||||
AC_DEFINE([NCMPCPP_UNICODE], [1], [enables unicode support])
|
|
||||||
else
|
|
||||||
curses_config_bin="ncurses6-config ncurses5-config"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if test "$pdcurses" = "yes" ; then
|
curses_config_bin="ncurses6-config ncurses5-config"
|
||||||
pdcurses_lib=XCurses
|
|
||||||
curses_config_bin=xcurses-config
|
|
||||||
else
|
|
||||||
pdcurses_lib=$pdcurses
|
|
||||||
fi
|
|
||||||
AC_DEFINE([USE_PDCURSES], [1], [enables pdcurses support])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_PATH_PROGS(CURSES_CONFIG, $curses_config_bin)
|
AC_PATH_PROGS(CURSES_CONFIG, $curses_config_bin)
|
||||||
if test "$CURSES_CONFIG" != "" ; then
|
if test "$CURSES_CONFIG" != "" ; then
|
||||||
CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags`"
|
CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags`"
|
||||||
LDFLAGS="$LDFLAGS `$CURSES_CONFIG --libs`"
|
LDFLAGS="$LDFLAGS `$CURSES_CONFIG --libs`"
|
||||||
fi
|
fi
|
||||||
if test "$pdcurses" = "no" ; then
|
AC_CHECK_LIB(ncursesw, initscr,
|
||||||
AC_CHECK_LIB(ncursesw, initscr,
|
curses_lib=ncursesw,
|
||||||
curses_lib=ncursesw,
|
curses_lib=ncurses
|
||||||
curses_lib=ncurses
|
)
|
||||||
)
|
|
||||||
else
|
|
||||||
curses_lib=$pdcurses_lib
|
|
||||||
fi
|
|
||||||
AC_CHECK_LIB($curses_lib, initscr,
|
AC_CHECK_LIB($curses_lib, initscr,
|
||||||
if test "$CURSES_CONFIG" = "" ; then
|
if test "$CURSES_CONFIG" = "" ; then
|
||||||
LDFLAGS="$LDFLAGS -l$curses_lib"
|
LDFLAGS="$LDFLAGS -l$curses_lib"
|
||||||
@@ -262,9 +249,6 @@ AC_CHECK_LIB($curses_lib, initscr,
|
|||||||
,
|
,
|
||||||
AC_MSG_ERROR([$curses_lib library is required])
|
AC_MSG_ERROR([$curses_lib library is required])
|
||||||
)
|
)
|
||||||
if test "$pdcurses" != "no" ; then
|
|
||||||
AC_CHECK_LIB($curses_lib, Xinitscr, AC_DEFINE([XCURSES], [1], [x11 pdcurses available]), )
|
|
||||||
fi
|
|
||||||
AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing curses.h header]))
|
AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing curses.h header]))
|
||||||
|
|
||||||
dnl ======================
|
dnl ======================
|
||||||
|
|||||||
@@ -184,9 +184,6 @@ void resizeScreen(bool reload_main_window)
|
|||||||
using Global::wHeader;
|
using Global::wHeader;
|
||||||
using Global::wFooter;
|
using Global::wFooter;
|
||||||
|
|
||||||
# if defined(USE_PDCURSES)
|
|
||||||
resize_term(0, 0);
|
|
||||||
# else
|
|
||||||
// update internal screen dimensions
|
// update internal screen dimensions
|
||||||
if (reload_main_window)
|
if (reload_main_window)
|
||||||
{
|
{
|
||||||
@@ -194,7 +191,6 @@ void resizeScreen(bool reload_main_window)
|
|||||||
endwin();
|
endwin();
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
|
|
||||||
MainHeight = LINES-(Config.design == Design::Alternative ? 7 : 4);
|
MainHeight = LINES-(Config.design == Design::Alternative ? 7 : 4);
|
||||||
|
|
||||||
|
|||||||
@@ -128,11 +128,7 @@ bool configure(int argc, char **argv)
|
|||||||
# ifdef HAVE_FFTW3_H
|
# ifdef HAVE_FFTW3_H
|
||||||
<< " fftw"
|
<< " fftw"
|
||||||
# endif
|
# endif
|
||||||
# ifdef USE_PDCURSES
|
|
||||||
<< " pdcurses"
|
|
||||||
# else
|
|
||||||
<< " ncurses"
|
<< " ncurses"
|
||||||
# endif
|
|
||||||
# ifdef HAVE_TAGLIB_H
|
# ifdef HAVE_TAGLIB_H
|
||||||
<< " taglib"
|
<< " taglib"
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -75,9 +75,7 @@ namespace
|
|||||||
std::cerr.rdbuf(cerr_buffer);
|
std::cerr.rdbuf(cerr_buffer);
|
||||||
errorlog.close();
|
errorlog.close();
|
||||||
Mpd.Disconnect();
|
Mpd.Disconnect();
|
||||||
# ifndef USE_PDCURSES // destroying screen somehow crashes pdcurses
|
|
||||||
NC::destroyScreen();
|
NC::destroyScreen();
|
||||||
# endif // USE_PDCURSES
|
|
||||||
windowTitle("");
|
windowTitle("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,15 +26,11 @@
|
|||||||
#include "title.h"
|
#include "title.h"
|
||||||
#include "utility/wide_string.h"
|
#include "utility/wide_string.h"
|
||||||
|
|
||||||
#ifdef USE_PDCURSES
|
|
||||||
void windowTitle(const std::string &) { }
|
|
||||||
#else
|
|
||||||
void windowTitle(const std::string &status)
|
void windowTitle(const std::string &status)
|
||||||
{
|
{
|
||||||
if (strcmp(getenv("TERM"), "linux") && Config.set_window_title)
|
if (strcmp(getenv("TERM"), "linux") && Config.set_window_title)
|
||||||
std::cout << "\033]0;" << status << "\7" << std::flush;
|
std::cout << "\033]0;" << status << "\7" << std::flush;
|
||||||
}
|
}
|
||||||
#endif // USE_PDCURSES
|
|
||||||
|
|
||||||
void drawHeader()
|
void drawHeader()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -672,30 +672,19 @@ bool Window::FDCallbacksListEmpty() const
|
|||||||
int Window::readKey()
|
int Window::readKey()
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
// if there are characters in input queue, get them and
|
// if there are characters in input queue,
|
||||||
// return immediately.
|
// get them and return immediately.
|
||||||
if (!m_input_queue.empty())
|
if (!m_input_queue.empty())
|
||||||
{
|
{
|
||||||
result = m_input_queue.front();
|
result = m_input_queue.front();
|
||||||
m_input_queue.pop();
|
m_input_queue.pop();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// in pdcurses polling stdin doesn't work, so we can't poll
|
|
||||||
// both stdin and other file descriptors in one select. the
|
|
||||||
// workaround is to set the timeout of select to 0, poll
|
|
||||||
// other file descriptors and then wait for stdin input with
|
|
||||||
// the given timeout. unfortunately, this results in delays
|
|
||||||
// since ncmpcpp doesn't see that data arrived while waiting
|
|
||||||
// for input from stdin, but it seems there is no better option.
|
|
||||||
|
|
||||||
fd_set fdset;
|
fd_set fdset;
|
||||||
FD_ZERO(&fdset);
|
FD_ZERO(&fdset);
|
||||||
# if !defined(USE_PDCURSES)
|
|
||||||
FD_SET(STDIN_FILENO, &fdset);
|
FD_SET(STDIN_FILENO, &fdset);
|
||||||
timeval timeout = { m_window_timeout/1000, (m_window_timeout%1000)*1000 };
|
timeval timeout = { m_window_timeout/1000, (m_window_timeout%1000)*1000 };
|
||||||
# else
|
|
||||||
timeval timeout = { 0, 0 };
|
|
||||||
# endif
|
|
||||||
|
|
||||||
int fd_max = STDIN_FILENO;
|
int fd_max = STDIN_FILENO;
|
||||||
for (FDCallbacks::const_iterator it = m_fds.begin(); it != m_fds.end(); ++it)
|
for (FDCallbacks::const_iterator it = m_fds.begin(); it != m_fds.end(); ++it)
|
||||||
@@ -707,19 +696,13 @@ int Window::readKey()
|
|||||||
|
|
||||||
if (select(fd_max+1, &fdset, 0, 0, m_window_timeout < 0 ? 0 : &timeout) > 0)
|
if (select(fd_max+1, &fdset, 0, 0, m_window_timeout < 0 ? 0 : &timeout) > 0)
|
||||||
{
|
{
|
||||||
# if !defined(USE_PDCURSES)
|
|
||||||
result = FD_ISSET(STDIN_FILENO, &fdset) ? wgetch(m_window) : ERR;
|
result = FD_ISSET(STDIN_FILENO, &fdset) ? wgetch(m_window) : ERR;
|
||||||
# endif // !USE_PDCURSES
|
|
||||||
for (FDCallbacks::const_iterator it = m_fds.begin(); it != m_fds.end(); ++it)
|
for (FDCallbacks::const_iterator it = m_fds.begin(); it != m_fds.end(); ++it)
|
||||||
if (FD_ISSET(it->first, &fdset))
|
if (FD_ISSET(it->first, &fdset))
|
||||||
it->second();
|
it->second();
|
||||||
}
|
}
|
||||||
# if !defined(USE_PDCURSES)
|
|
||||||
else
|
else
|
||||||
result = ERR;
|
result = ERR;
|
||||||
# else
|
|
||||||
result = wgetch(m_window);
|
|
||||||
# endif
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -778,20 +761,7 @@ int Window::getY()
|
|||||||
|
|
||||||
bool Window::hasCoords(int &x, int &y)
|
bool Window::hasCoords(int &x, int &y)
|
||||||
{
|
{
|
||||||
# ifndef USE_PDCURSES
|
|
||||||
return wmouse_trafo(m_window, &y, &x, 0);
|
return wmouse_trafo(m_window, &y, &x, 0);
|
||||||
# else
|
|
||||||
// wmouse_trafo is broken in pdcurses, use our own implementation
|
|
||||||
size_t u_x = x, u_y = y;
|
|
||||||
if (u_x >= m_start_x && u_x < m_start_x+m_width
|
|
||||||
&& u_y >= m_start_y && u_y < m_start_y+m_height)
|
|
||||||
{
|
|
||||||
x -= m_start_x;
|
|
||||||
y -= m_start_y;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Window::runPromptHook(const char *arg, bool *done) const
|
bool Window::runPromptHook(const char *arg, bool *done) const
|
||||||
|
|||||||
@@ -23,10 +23,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef USE_PDCURSES
|
|
||||||
# define NCURSES_MOUSE_VERSION 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "curses.h"
|
#include "curses.h"
|
||||||
#include "gcc.h"
|
#include "gcc.h"
|
||||||
|
|
||||||
@@ -94,12 +90,12 @@
|
|||||||
#undef KEY_ENTER
|
#undef KEY_ENTER
|
||||||
#define KEY_ENTER 13
|
#define KEY_ENTER 13
|
||||||
|
|
||||||
#if !defined(USE_PDCURSES) && NCURSES_MOUSE_VERSION == 1
|
#if NCURSES_MOUSE_VERSION == 1
|
||||||
// NOTICE: define BUTTON5_PRESSED to be BUTTON2_PRESSED with additional mask
|
// NOTICE: define BUTTON5_PRESSED to be BUTTON2_PRESSED with additional mask
|
||||||
// (I noticed that it sometimes returns 134217728 (2^27) instead of expected
|
// (I noticed that it sometimes returns 134217728 (2^27) instead of expected
|
||||||
// mask, so the modified define does it right.
|
// mask, so the modified define does it right.
|
||||||
# define BUTTON5_PRESSED (BUTTON2_PRESSED | (1U << 27))
|
# define BUTTON5_PRESSED (BUTTON2_PRESSED | (1U << 27))
|
||||||
#endif // !defined(USE_PDCURSES) && NCURSES_MOUSE_VERSION == 1
|
#endif // NCURSES_MOUSE_VERSION == 1
|
||||||
|
|
||||||
// undefine macros with colliding names
|
// undefine macros with colliding names
|
||||||
#undef border
|
#undef border
|
||||||
|
|||||||
Reference in New Issue
Block a user