aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2013-01-19 11:51:56 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2013-01-19 11:51:56 +0100
commit72b948fb1eaba1fc06de7325cc095f0889ce4d7f (patch)
tree4f53e793ddda10ca4ddcff9355a5c51953a389e6 /src/interface.h
parenta54b49f5a8858ae6603d0db56019adc3ce0dff90 (diff)
downloadsciteco-72b948fb1eaba1fc06de7325cc095f0889ce4d7f.tar.gz
allow <CTRL/C> to be typed; aborts last typed char
* CTRL/C will be a command so it is important to be able to type it directly * aborting character processing is important because it allows aborting infinite loops * since the loop interruption currently relies on SIGINT handling, there is only limited support for XCurses and GTK - CTRL/C has to be typed in the terminal window. later support for input queue polling might be added
Diffstat (limited to 'src/interface.h')
-rw-r--r--src/interface.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interface.h b/src/interface.h
index 28be9fe..38cd725 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -19,6 +19,7 @@
#define __INTERFACE_H
#include <stdarg.h>
+#include <signal.h>
#include <glib.h>
@@ -29,6 +30,7 @@
/* avoid include dependency conflict */
class QRegister;
class Buffer;
+extern sig_atomic_t sigint_occurred;
/*
* Base class for all user interfaces - used mereley as a class interface.
@@ -107,6 +109,12 @@ public:
virtual void popup_show(void) = 0;
virtual void popup_clear(void) = 0;
+ virtual inline bool
+ is_interrupted(void)
+ {
+ return sigint_occurred != FALSE;
+ }
+
/* main entry point */
virtual void event_loop(void) = 0;