diff options
Diffstat (limited to 'interface.h')
-rw-r--r-- | interface.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/interface.h b/interface.h index d40506a..f89307e 100644 --- a/interface.h +++ b/interface.h @@ -7,6 +7,12 @@ #include <Scintilla.h> +#include "undo.h" + +/* avoid include dependency conflict */ +class QRegister; +class Buffer; + /* * Base class for all user interfaces - used mereley as a class interface. * The actual instance of the interface has the platform-specific type @@ -16,6 +22,22 @@ * There's only one Interface* instance in the system. */ class Interface { + template <class Type> + class UndoTokenInfoUpdate : public UndoToken { + Interface *iface; + Type *obj; + + public: + UndoTokenInfoUpdate(Interface *_iface, Type *_obj) + : iface(_iface), obj(_obj) {} + + void + run(void) + { + iface->info_update(obj); + } + }; + public: virtual GOptionGroup * get_options(void) @@ -44,6 +66,16 @@ public: virtual sptr_t ssm(unsigned int iMessage, uptr_t wParam = 0, sptr_t lParam = 0) = 0; + virtual void info_update(QRegister *reg) = 0; + virtual void info_update(Buffer *buffer) = 0; + + template <class Type> + inline void + undo_info_update(Type *obj) + { + undo.push(new UndoTokenInfoUpdate<Type>(this, obj)); + } + /* NULL means to redraw the current cmdline if necessary */ virtual void cmdline_update(const gchar *cmdline = NULL) = 0; @@ -60,9 +92,14 @@ public: /* main entry point */ virtual void event_loop(void) = 0; + /* + * Interfacing to the external SciTECO world + * See main.cpp + */ protected: - /* see main.cpp */ void stdio_vmsg(MessageType type, const gchar *fmt, va_list ap); +public: + void process_notify(SCNotification *notify); }; #ifdef INTERFACE_GTK |