FACT++  1.0
ReadlineWindow.h
Go to the documentation of this file.
1 #ifndef FACT_ReadlineWindow
2 #define FACT_ReadlineWindow
3 
4 #include "Readline.h"
5 
6 typedef struct _win_st WINDOW;
7 
8 class ReadlineWindow : public Readline
9 {
11 
12  int fPromptX;
13  int fPromptY;
14 
15  int fColor;
16 
17 protected:
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 
31 public:
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
WINDOW * fWindow
void Startup()
Color index in which the prompt should be displayed.
void SetWindow(WINDOW *w)
void CompletionDisplay(char **matches, int num, int max)
ReadlineWindow(const char *prgname)
void SetColorPrompt(int col)
int fPromptY
When the readline call is issued the x position at which the output will start is stored here...
void Shutdown(const char *buf)
struct _win_st WINDOW
Definition: ReadlineWindow.h:6
virtual void Refresh()
void RewindCursor() const
int fPromptX
Pointer to the panel for the input stream.
int fColor
When the readline call is issued the y position at which the output will start is stored here...
void EventHook(bool=false)
C++ wrapper for GNU's readline library.
Definition: Readline.h:10
Helper to redirect readline's in- and output to an ncurses window.
Definition: ReadlineWindow.h:8