Commit e884f9ca authored by Joseph Pranevich's avatar Joseph Pranevich Committed by Alexandre Julliard

Rewrite of configuration system to support "regular" curses as well as

eliminating the --with-ncurses option. Now, ncurses support will be built in if a compatible library is detected.
parent e365a233
...@@ -43,10 +43,6 @@ AC_ARG_ENABLE(trace, ...@@ -43,10 +43,6 @@ AC_ARG_ENABLE(trace,
[ --disable-trace compile out TRACE messages], [ --disable-trace compile out TRACE messages],
[if test "$enableval" = "no"; then TRACE_MSGS="no"; fi]) [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
AC_ARG_WITH(ncurses,
[ --with-ncurses compile in the ncurses terminal (EXPERIMENTAL)],
[if test "$withval" = "yes"; then LIBS="$LIBS -lncurses"; AC_DEFINE(WINE_NCURSES) fi])
AC_ARG_WITH(reentrant-x, AC_ARG_WITH(reentrant-x,
[ --without-reentrant-x compile for use with non-reentrant X libraries]) [ --without-reentrant-x compile for use with non-reentrant X libraries])
...@@ -116,6 +112,14 @@ else ...@@ -116,6 +112,14 @@ else
X_LIBS="" X_LIBS=""
fi fi
dnl **** Check which curses lib to use ***
AC_CHECK_LIB(ncurses,waddch)
if test "$ac_cv_lib_ncurses_waddch" = "yes"
then :
else
AC_CHECK_LIB(curses,waddch)
fi
dnl **** Check for IPX (currently Linux only) **** dnl **** Check for IPX (currently Linux only) ****
AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu, AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
AC_TRY_COMPILE( AC_TRY_COMPILE(
......
/* ncurses.c */ /* ncurses.c */
#include "config.h" #include "config.h"
#include "console.h"
#ifdef WINE_NCURSES #ifdef WINE_NCURSES
...@@ -18,7 +19,6 @@ ...@@ -18,7 +19,6 @@
driver, it should make sure to perserve the old values. driver, it should make sure to perserve the old values.
*/ */
#include "console.h"
#include "debug.h" #include "debug.h"
#undef ERR /* Use ncurses's err() */ #undef ERR /* Use ncurses's err() */
#include <curses.h> #include <curses.h>
...@@ -39,6 +39,7 @@ void NCURSES_Start() ...@@ -39,6 +39,7 @@ void NCURSES_Start()
driver.getCursorPosition = NCURSES_GetCursorPosition; driver.getCursorPosition = NCURSES_GetCursorPosition;
driver.getCharacterAtCursor = NCURSES_GetCharacterAtCursor; driver.getCharacterAtCursor = NCURSES_GetCharacterAtCursor;
driver.clearScreen = NCURSES_ClearScreen; driver.clearScreen = NCURSES_ClearScreen;
driver.notifyResizeScreen = NCURSES_NotifyResizeScreen;
driver.checkForKeystroke = NCURSES_CheckForKeystroke; driver.checkForKeystroke = NCURSES_CheckForKeystroke;
driver.getKeystroke = NCURSES_GetKeystroke; driver.getKeystroke = NCURSES_GetKeystroke;
...@@ -62,7 +63,8 @@ void NCURSES_Init() ...@@ -62,7 +63,8 @@ void NCURSES_Init()
void NCURSES_Write(char output, int fg, int bg, int attribute) void NCURSES_Write(char output, int fg, int bg, int attribute)
{ {
/* We can discard all extended information. */ /* We can discard all extended information. */
waddch(stdscr, output); if (waddch(stdscr, output) == ERR)
FIXME(console, "NCURSES: waddch() failed.\n");
} }
void NCURSES_Close() void NCURSES_Close()
...@@ -101,7 +103,8 @@ int NCURSES_CheckForKeystroke(char *scan, char *ascii) ...@@ -101,7 +103,8 @@ int NCURSES_CheckForKeystroke(char *scan, char *ascii)
void NCURSES_MoveCursor(char row, char col) void NCURSES_MoveCursor(char row, char col)
{ {
wmove(stdscr, row, col); if (wmove(stdscr, row, col) == ERR)
FIXME(console, "NCURSES: wmove() failed to %d, %d.\n", row, col);
} }
void NCURSES_GetCursorPosition(char *row, char *col) void NCURSES_GetCursorPosition(char *row, char *col)
...@@ -134,4 +137,13 @@ void NCURSES_ClearScreen() ...@@ -134,4 +137,13 @@ void NCURSES_ClearScreen()
werase(stdscr); werase(stdscr);
} }
void NCURSES_NotifyResizeScreen(int x, int y)
{
/* Note: This function gets called *after* another driver in the chain
calls ResizeScreen(). It is meant to resize the ncurses internal
data structures to know about the new window dimensions. */
resizeterm(y, x);
}
#endif /* WINE_NCURSES */ #endif /* WINE_NCURSES */
...@@ -57,8 +57,14 @@ ...@@ -57,8 +57,14 @@
/* Define if the struct statfs is defined by <sys/mount.h> */ /* Define if the struct statfs is defined by <sys/mount.h> */
#undef STATFS_DEFINED_BY_SYS_MOUNT #undef STATFS_DEFINED_BY_SYS_MOUNT
/* Define if we want to use ncurses instead of the TTY terminal */ /* Define if we can use ncurses for full-screen access */
#undef WINE_NCURSES #undef HAVE_LIBNCURSES
/* Define if we can use curses (if no ncurses) for full-screen access */
#undef HAVE_LIBCURSES
/* Define if we can a compatible xterm program */
#undef XTERM_PROGRAM
/* Define if IPX should use netipx/ipx.h from libc */ /* Define if IPX should use netipx/ipx.h from libc */
#undef HAVE_IPX_GNU #undef HAVE_IPX_GNU
......
...@@ -69,9 +69,6 @@ ...@@ -69,9 +69,6 @@
/* Define if the struct statfs is defined by <sys/mount.h> */ /* Define if the struct statfs is defined by <sys/mount.h> */
#undef STATFS_DEFINED_BY_SYS_MOUNT #undef STATFS_DEFINED_BY_SYS_MOUNT
/* Define if we want to use ncurses instead of the TTY terminal */
#undef WINE_NCURSES
/* Define if IPX should use netipx/ipx.h from libc */ /* Define if IPX should use netipx/ipx.h from libc */
#undef HAVE_IPX_GNU #undef HAVE_IPX_GNU
...@@ -192,12 +189,18 @@ ...@@ -192,12 +189,18 @@
/* Define if you have the <wctype.h> header file. */ /* Define if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H #undef HAVE_WCTYPE_H
/* Define if you have the curses library (-lcurses). */
#undef HAVE_LIBCURSES
/* Define if you have the dl library (-ldl). */ /* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL #undef HAVE_LIBDL
/* Define if you have the i386 library (-li386). */ /* Define if you have the i386 library (-li386). */
#undef HAVE_LIBI386 #undef HAVE_LIBI386
/* Define if you have the ncurses library (-lncurses). */
#undef HAVE_LIBNCURSES
/* Define if you have the nsl library (-lnsl). */ /* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL #undef HAVE_LIBNSL
......
/* Console.H */ /* console.h */
/* Copyright 1998 - Joseph Pranevich */
/* Include file for definitions pertaining to Wine's text-console /* Include file for definitions pertaining to Wine's text-console
interface. interface.
...@@ -11,7 +12,18 @@ ...@@ -11,7 +12,18 @@
#include "config.h" #include "config.h"
/* Which libs can be used for wine's curses implementation... */
#ifdef HAVE_LIBNCURSES
#define WINE_NCURSES
#else
#ifdef HAVE_LIBCURSES
#define WINE_NCURSES
#endif
#endif
#define CONSOLE_DEFAULT_DRIVER "tty" #define CONSOLE_DEFAULT_DRIVER "tty"
/* If you have problems, try setting the next line to xterm */
#define CONSOLE_XTERM_PROG "nxterm" /* We should check for this first... */
typedef struct CONSOLE_DRIVER typedef struct CONSOLE_DRIVER
{ {
...@@ -70,6 +82,7 @@ void CONSOLE_ClearScreen(); ...@@ -70,6 +82,7 @@ void CONSOLE_ClearScreen();
char CONSOLE_GetCharacter(); char CONSOLE_GetCharacter();
void CONSOLE_ResizeScreen(); void CONSOLE_ResizeScreen();
void CONSOLE_NotifyResizeScreen(); void CONSOLE_NotifyResizeScreen();
void CONSOLE_WriteRawString(char *);
/* Generic Defines */ /* Generic Defines */
void GENERIC_Start(); void GENERIC_Start();
...@@ -97,6 +110,7 @@ void NCURSES_GetCursorPosition(char *, char *); ...@@ -97,6 +110,7 @@ void NCURSES_GetCursorPosition(char *, char *);
void NCURSES_GetCharacterAtCursor(char *, int *, int *, int *); void NCURSES_GetCharacterAtCursor(char *, int *, int *, int *);
void NCURSES_Refresh(); void NCURSES_Refresh();
void NCURSES_ClearScreen(); void NCURSES_ClearScreen();
void NCURSES_NotifyResizeScreen(int x, int y);
#endif /* WINE_NCURSES */ #endif /* WINE_NCURSES */
...@@ -104,5 +118,6 @@ void NCURSES_ClearScreen(); ...@@ -104,5 +118,6 @@ void NCURSES_ClearScreen();
void XTERM_Start(); void XTERM_Start();
void XTERM_Close(); void XTERM_Close();
void XTERM_Init(); void XTERM_Init();
void XTERM_ResizeScreen(int x, int y);
#endif /* CONSOLE_H */ #endif /* CONSOLE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment