diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-17 02:06:47 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-17 02:06:47 +0100 |
commit | 537b7b5e9f71cb57a690d903d1787d119eaa29d0 (patch) | |
tree | 63f76ff2da0e035dc1cd674f4721ec7181e83b1e | |
parent | 5fb74180f8ca001d3d0bb256619744d35bec1fa1 (diff) | |
download | sciteco-537b7b5e9f71cb57a690d903d1787d119eaa29d0.tar.gz |
support for ncurses/win32
Unfortunately, I cannot really test this curses port
since it is not supported by Windows 2000 (missing AttachConsole() API)
and it does not run very well in Wine.
Under Wine, it does not require the LINES and COLS variable to be set.
However, endwin() and the refresh later on result in a very unusable
state of operation. I cannot currently check whether this is true on
Windows XP or later.
-rwxr-xr-x | distribute | 4 | ||||
-rw-r--r-- | src/interface-curses.cpp | 18 |
2 files changed, 18 insertions, 4 deletions
@@ -73,6 +73,8 @@ ppa : debian-source # which is required by the glib spawn functions. # If we ever build a non-console version on Windows, # we should include gspawn-win32-helper.exe instead. +MINGW_UI=pdcurses + mingw-binary : sciteco-$(SCITECO_VERSION)-win32.zip sciteco-$(SCITECO_VERSION)-win32.zip : $(SCITECO_SRC) tar xzf $(SCITECO_SRC) @@ -83,7 +85,7 @@ sciteco-$(SCITECO_VERSION)-win32.zip : $(SCITECO_SRC) --prefix=/usr \ --enable-static-executables \ --disable-dependency-tracking \ - --with-interface=pdcurses \ + --with-interface=$(MINGW_UI) \ --disable-bootstrap \ --enable-html-manual \ CFLAGS="-g -O3" CXXFLAGS="-g -O3"; \ diff --git a/src/interface-curses.cpp b/src/interface-curses.cpp index 0c08ec9..d12aed4 100644 --- a/src/interface-curses.cpp +++ b/src/interface-curses.cpp @@ -63,6 +63,13 @@ #define PDCURSES_WIN32 #endif +/** + * Whether we're on ncurses/win32 console + */ +#if defined(NCURSES_VERSION) && defined(G_OS_WIN32) +#define NCURSES_WIN32 +#endif + namespace SciTECO { extern "C" { @@ -141,6 +148,11 @@ InterfaceCurses::init_batch(void) PDC_set_resize_limits(25, 0xFFFF, 80, 0xFFFF); #endif +#ifdef NCURSES_WIN32 + /* $TERM must be unset for the win32 driver to load */ + g_unsetenv("TERM"); +#endif + /* * PDCurses cannot support terminal redirection * into files, nor can it support multiple terminals. @@ -290,7 +302,7 @@ InterfaceCurses::set_window_title(const gchar *title) PDC_set_title(title); } -#elif defined(HAVE_TIGETSTR) +#elif defined(HAVE_TIGETSTR) && defined(G_OS_UNIX) void InterfaceCurses::set_window_title(const gchar *title) @@ -299,8 +311,8 @@ InterfaceCurses::set_window_title(const gchar *title) * NOTE: terminfo variables in term.h interfere with * the rest of our code */ - const char *tsl = tigetstr("tsl"); - const char *fsl = tigetstr("fsl"); + const char *tsl = tigetstr((char *)"tsl"); + const char *fsl = tigetstr((char *)"fsl"); if (!tsl || !fsl) return; |