aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-12-09 02:46:34 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-12-09 02:46:34 +0100
commit613e8c91f082ca3cb64aa10063d3254100deac84 (patch)
treeda8d470f9e77d33a3b80de620b35d568d5239f36 /src/interface-curses.h
parent52ecff415770da4aeb4041d1308d13933dfc8801 (diff)
downloadsciteco-613e8c91f082ca3cb64aa10063d3254100deac84.tar.gz
Curses: support cycling through long lists of possible auto-completions and optimized screen refreshing/redrawing
* pressing e.g. TAB when the popup is showing a list of auto-completions will show the next page, eventually beginning at the first one again. * do not redraw curses windows in the UI methods directly. this resulted in flickering during command-line editing macros and ordinary macro calls because the physical screen was updated immediately. Instead, window refreshing and updated is done centrally in event_loop_iter() only after a key has been processed. Also we use wnoutrefresh() and doupdate() to send as little to the terminal (emulator) as possible.
Diffstat (limited to 'src/interface-curses.h')
-rw-r--r--src/interface-curses.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/interface-curses.h b/src/interface-curses.h
index 35f7edb..70e5300 100644
--- a/src/interface-curses.h
+++ b/src/interface-curses.h
@@ -80,11 +80,16 @@ typedef class InterfaceCurses : public Interface<InterfaceCurses, ViewCurses> {
struct Popup {
WINDOW *window;
- GSList *list;
- gint longest;
- gint length;
+ GSList *list; /**! list of popup entries */
+ gint longest; /**! size of longest entry */
+ gint length; /**! total number of popup entries */
- Popup() : window(NULL), list(NULL), longest(0), length(0) {}
+ GSList *cur_list; /**! next entry to display */
+ gint cur_entry; /**! next entry to display (position) */
+
+ Popup() : window(NULL), list(NULL),
+ longest(3), length(0),
+ cur_list(NULL), cur_entry(0) {}
~Popup();
} popup;
@@ -122,6 +127,12 @@ public:
const gchar *name, bool highlight = false);
/* implementation of Interface::popup_show() */
void popup_show_impl(void);
+ /* implementation of Interface::popup_is_shown() */
+ inline bool
+ popup_is_shown_impl(void)
+ {
+ return popup.window != NULL;
+ }
/* implementation of Interface::popup_clear() */
void popup_clear_impl(void);