From 1f7475248b369e18114086b507ceceacdc1a0c24 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 15 Nov 2012 01:25:38 +0100 Subject: added Interface class to ease porting SciTECO to other platforms (toolkits) * will support Scintilla with Scinterm/NCurses * changes are in such a way that the generated machine code should have almost no overhead compared to the previous implementation (at least when compiled with optimizations) --- sciteco.h | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'sciteco.h') diff --git a/sciteco.h b/sciteco.h index 37f1af4..9cf3205 100644 --- a/sciteco.h +++ b/sciteco.h @@ -1,26 +1,14 @@ #ifndef __SCITECO_H #define __SCITECO_H -#include - #include -#include -#include "gtk-info-popup.h" -#include +#include "interface.h" extern gchar *cmdline; extern bool quit_requested; -extern GtkInfoPopup *filename_popup; - -void message_display(GtkMessageType type, - const gchar *fmt, ...) G_GNUC_PRINTF(2, 3); - void cmdline_keypress(gchar key); -void cmdline_display(const gchar *cmdline); - -sptr_t editor_msg(unsigned int iMessage, uptr_t wParam = 0, sptr_t lParam = 0); #define IS_CTL(C) ((C) < ' ') #define CTL_ECHO(C) ((C) | 0x40) @@ -35,9 +23,6 @@ typedef gint64 tecoBool; #define IS_SUCCESS(X) ((X) < 0) #define IS_FAILURE(X) (!IS_SUCCESS(X)) -/* TECO uses only lower 7 bits for commands */ -#define MAX_TRANSITIONS 127 - namespace String { static inline void @@ -62,13 +47,13 @@ namespace Validate { static inline bool pos(gint n) { - return n >= 0 && n <= editor_msg(SCI_GETLENGTH); + return n >= 0 && n <= interface.ssm(SCI_GETLENGTH); } static inline bool line(gint n) { - return n >= 0 && n < editor_msg(SCI_GETLINECOUNT); + return n >= 0 && n < interface.ssm(SCI_GETLINECOUNT); } } /* namespace Validate */ -- cgit v1.2.3