aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2015-03-17 02:06:47 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2015-03-17 02:06:47 +0100
commit537b7b5e9f71cb57a690d903d1787d119eaa29d0 (patch)
tree63f76ff2da0e035dc1cd674f4721ec7181e83b1e /src
parent5fb74180f8ca001d3d0bb256619744d35bec1fa1 (diff)
downloadsciteco-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.
Diffstat (limited to 'src')
-rw-r--r--src/interface-curses.cpp18
1 files changed, 15 insertions, 3 deletions
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;