aboutsummaryrefslogtreecommitdiffhomepage
path: root/interface-ncurses.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-15 08:28:49 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-15 08:28:49 +0100
commit7d68fdafcd42e42c8bceeb384af7be1b5dfd3a65 (patch)
tree5db0bfa0b96b8e1842e6dd8ad9bdc61df758db99 /interface-ncurses.h
parent7d0a161e5297d0d29905facb2b290d1084ab29ac (diff)
downloadsciteco-7d68fdafcd42e42c8bceeb384af7be1b5dfd3a65.tar.gz
added NCurses user interface (based on Scinterm)
* terminal resizing not yet supported * file popups are sort of a hack
Diffstat (limited to 'interface-ncurses.h')
-rw-r--r--interface-ncurses.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/interface-ncurses.h b/interface-ncurses.h
new file mode 100644
index 0000000..a9bcad5
--- /dev/null
+++ b/interface-ncurses.h
@@ -0,0 +1,48 @@
+#ifndef __INTERFACE_NCURSES_H
+#define __INTERFACE_NCURSES_H
+
+#include <glib.h>
+
+#include <ncurses.h>
+
+#include <Scintilla.h>
+#include <ScintillaTerm.h>
+
+#include "interface.h"
+
+extern class InterfaceNCurses : public Interface {
+ Scintilla *sci;
+
+ WINDOW *sci_window;
+ WINDOW *msg_window;
+ WINDOW *cmdline_window;
+
+ WINDOW *popup_window;
+ GSList *popup_list;
+ gint popup_list_longest;
+ gint popup_list_length;
+
+public:
+ InterfaceNCurses();
+ ~InterfaceNCurses();
+
+ void msg(MessageType type, const gchar *fmt, ...) G_GNUC_PRINTF(3, 4);
+
+ inline sptr_t
+ ssm(unsigned int iMessage, uptr_t wParam = 0, sptr_t lParam = 0)
+ {
+ return scintilla_send_message(sci, iMessage, wParam, lParam);
+ }
+
+ void cmdline_update(const gchar *cmdline = "");
+
+ void popup_add_filename(PopupFileType type,
+ const gchar *filename, bool highlight = false);
+ void popup_show(void);
+ void popup_clear(void);
+
+ /* main entry point */
+ void event_loop(void);
+} interface;
+
+#endif