source: trunk/FACT++/src/ReadlineWindow.h@ 16936

Last change on this file since 16936 was 16869, checked in by tbretz, 11 years ago
When we output something ourselves before the event hook is called in readline, we have to signal readline that we have started a new row, so that readline can properly update the prompt. I hope this finally solves the flickering issue on my laptop and/or the problematic display in the fadctrl.
File size: 1.2 KB
Line 
1#ifndef FACT_ReadlineWindow
2#define FACT_ReadlineWindow
3
4#include "Readline.h"
5
6typedef struct _win_st WINDOW;
7
8class ReadlineWindow : public Readline
9{
10 WINDOW *fWindow; /// Pointer to the panel for the input stream
11
12 int fPromptX; /// When the readline call is issued the x position at which the output will start is stored here
13 int fPromptY; /// When the readline call is issued the y position at which the output will start is stored here
14
15 int fColor; /// Color index in which the prompt should be displayed
16
17protected:
18 // The implementations of the callback funtions
19 //int Getc(FILE *);
20 void Startup();
21 void Redisplay();
22 void EventHook(bool = false);
23 void CompletionDisplay(char **matches, int num, int max);
24
25 // Refresh the display before setting the cursor position
26 virtual void Refresh() { }
27
28 // Callback after readline has returned
29 void Shutdown(const char *buf);
30
31public:
32 ReadlineWindow(const char *prgname);
33
34 // Initialization
35 void SetWindow(WINDOW *w);
36 void SetColorPrompt(int col) { fColor = col; }
37
38 // Move cursor to start of last prompt
39 void RewindCursor() const;
40};
41
42#endif
Note: See TracBrowser for help on using the repository browser.