aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmdline.cpp
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 /cmdline.cpp
parent33d3311dc9fe09e8cc670dc11378980f2f1d3eab (diff)
downloadsciteco-1f7475248b369e18114086b507ceceacdc1a0c24.tar.gz
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 'cmdline.cpp')
-rw-r--r--cmdline.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/cmdline.cpp b/cmdline.cpp
index db1d1ef..557e056 100644
--- a/cmdline.cpp
+++ b/cmdline.cpp
@@ -6,6 +6,7 @@
#include <glib/gstdio.h>
#include "sciteco.h"
+#include "interface.h"
#include "parser.h"
#include "qbuffers.h"
#include "goto.h"
@@ -33,10 +34,7 @@ cmdline_keypress(gchar key)
/*
* Cleanup messages, popups, etc...
*/
- if (gtk_widget_get_visible(GTK_WIDGET(filename_popup))) {
- gtk_widget_hide(GTK_WIDGET(filename_popup));
- gtk_info_popup_clear(filename_popup);
- }
+ interface.popup_clear();
/*
* Process immediate editing commands
@@ -68,7 +66,7 @@ cmdline_keypress(gchar key)
* Echo command line
*/
echo = macro_echo(cmdline, "*");
- cmdline_display(echo);
+ interface.cmdline_update(echo);
g_free(echo);
}
@@ -231,23 +229,22 @@ filename_complete(const gchar *filename, gchar completed)
for (GList *file = g_list_first(matching);
file != NULL;
file = g_list_next(file)) {
- GtkInfoPopupFileType type;
- gboolean in_buffer = FALSE;
+ Interface::PopupFileType type;
+ bool in_buffer = false;
if (filename_is_dir((gchar *)file->data)) {
- type = GTK_INFO_POPUP_DIRECTORY;
+ type = Interface::POPUP_DIRECTORY;
} else {
- type = GTK_INFO_POPUP_FILE;
+ type = Interface::POPUP_FILE;
/* FIXME: inefficient */
- in_buffer = ring.find((gchar *)file->data)
- != NULL;
+ in_buffer = ring.find((gchar *)file->data);
}
- gtk_info_popup_add_filename(filename_popup,
- type, (gchar *)file->data,
- in_buffer);
+
+ interface.popup_add_filename(type, (gchar *)file->data,
+ in_buffer);
}
- gtk_widget_show(GTK_WIDGET(filename_popup));
+ interface.popup_show();
} else if (g_list_length(matching) == 1 &&
!filename_is_dir((gchar *)g_list_first(matching)->data)) {
gchar *new_insert;