diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-22 13:51:30 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-22 13:51:30 +0100 |
commit | 7ac3c26c927d636c0f2331f00d5a5c11aec8a2ff (patch) | |
tree | 046d6de75fddb732e1a7d59105382a6d29dd3848 /interface-ncurses.cpp | |
parent | 117bb7fa94aad9ac9507f3c8ace4d5e393c9abad (diff) | |
download | sciteco-7ac3c26c927d636c0f2331f00d5a5c11aec8a2ff.tar.gz |
PDCurses compatibility changes
standard curses implementation on Windows (MinGW32)
* may also be used on Unix, to build X11 versions using XCurses
* cannot do the avoid-screen-refresh thing on PDCurses
Diffstat (limited to 'interface-ncurses.cpp')
-rw-r--r-- | interface-ncurses.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/interface-ncurses.cpp b/interface-ncurses.cpp index 55f6b00..a621474 100644 --- a/interface-ncurses.cpp +++ b/interface-ncurses.cpp @@ -7,7 +7,7 @@ #include <glib/gprintf.h> #include <glib/gstdio.h> -#include <ncurses.h> +#include <curses.h> #include <Scintilla.h> #include <ScintillaTerm.h> @@ -38,6 +38,10 @@ static void scintilla_notify(Scintilla *sci, int idFrom, InterfaceNCurses::InterfaceNCurses() { +#ifdef __PDCURSES__ + initscr(); + screen = NULL; +#else /* * Prevent the initial redraw and any escape sequences that may * interfere with stdout, so we may use the terminal in @@ -48,6 +52,7 @@ InterfaceNCurses::InterfaceNCurses() screen_tty = g_fopen("/dev/tty", "r+b"); screen = newterm(NULL, screen_tty, screen_tty); set_term(screen); +#endif raw(); cbreak(); @@ -269,6 +274,7 @@ InterfaceNCurses::popup_clear(void) redrawwin(info_window); wrefresh(info_window); + redrawwin(sci_window); scintilla_refresh(sci); redrawwin(msg_window); wrefresh(msg_window); @@ -336,16 +342,18 @@ InterfaceNCurses::~InterfaceNCurses() { delwin(info_window); g_free(info_current); + /* also deletes curses window */ scintilla_delete(sci); - delwin(sci_window); delwin(cmdline_window); g_free(cmdline_current); delwin(msg_window); if (!isendwin()) endwin(); +#ifndef __PDCURSES__ delscreen(screen); fclose(screen_tty); +#endif } /* |