aboutsummaryrefslogtreecommitdiffhomepage
path: root/sciteco.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-15 01:25:38 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-15 01:25:38 +0100
commit1f7475248b369e18114086b507ceceacdc1a0c24 (patch)
tree3c4e157ff099dc6faa8978c4e5e1558e6424e4a0 /sciteco.h
parent33d3311dc9fe09e8cc670dc11378980f2f1d3eab (diff)
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)
Diffstat (limited to 'sciteco.h')
-rw-r--r--sciteco.h21
1 files changed, 3 insertions, 18 deletions
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 <stdarg.h>
-
#include <glib.h>
-#include <gtk/gtk.h>
-#include "gtk-info-popup.h"
-#include <Scintilla.h>
+#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 */