diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-15 19:52:31 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-15 19:52:31 +0100 |
commit | 51e123544bff3ca0bdd8f6ba6a1c507b57071ca4 (patch) | |
tree | 0b3c68e7520dc310a49cee0b6dc1abd042143224 /interface.h | |
parent | 5fe8298dec3736a2169719af9f0edf8592f3f7b6 (diff) | |
download | sciteco-51e123544bff3ca0bdd8f6ba6a1c507b57071ca4.tar.gz |
support stdio for curses interface
* ./sciteco commandline help works now
* messages issued during batch-mode macro processing are written to stdout/stderr
* output can be redirected
Diffstat (limited to 'interface.h')
-rw-r--r-- | interface.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/interface.h b/interface.h index 6e43392..f84649a 100644 --- a/interface.h +++ b/interface.h @@ -1,6 +1,8 @@ #ifndef __INTERFACE_H #define __INTERFACE_H +#include <stdarg.h> + #include <glib.h> #include <Scintilla.h> @@ -28,8 +30,16 @@ public: MSG_WARNING, MSG_ERROR }; - virtual void msg(MessageType type, const gchar *fmt, ...) - G_GNUC_PRINTF(3, 4) = 0; + virtual void vmsg(MessageType type, const gchar *fmt, va_list ap) = 0; + inline void + msg(MessageType type, const gchar *fmt, ...) G_GNUC_PRINTF(3, 4) + { + va_list ap; + + va_start(ap, fmt); + vmsg(type, fmt, ap); + va_end(ap); + } virtual sptr_t ssm(unsigned int iMessage, uptr_t wParam = 0, sptr_t lParam = 0) = 0; @@ -48,6 +58,10 @@ public: /* main entry point */ virtual void event_loop(void) = 0; + +protected: + /* see main.cpp */ + void stdio_vmsg(MessageType type, const gchar *fmt, va_list ap); }; #ifdef INTERFACE_GTK |