added: implementation of cursor
This commit is contained in:
29
src/cursor.h
29
src/cursor.h
@ -4,6 +4,31 @@
|
||||
#include <ncurses.h>
|
||||
#include "position.h"
|
||||
|
||||
/* Attributes
|
||||
A_NORMAL Normal display (no highlight)
|
||||
A_STANDOUT Best highlighting mode of the terminal.
|
||||
A_UNDERLINE Underlining
|
||||
A_REVERSE Reverse video
|
||||
A_BLINK Blinking
|
||||
A_DIM Half bright
|
||||
A_BOLD Extra bright or bold
|
||||
A_PROTECT Protected mode
|
||||
A_INVIS Invisible or blank mode
|
||||
A_ALTCHARSET Alternate character set
|
||||
A_CHARTEXT Bit-mask to extract a character
|
||||
COLOR_PAIR(n) Color-pair number n
|
||||
|
||||
Color pair numbers
|
||||
COLOR_BLACK 0
|
||||
COLOR_RED 1
|
||||
COLOR_GREEN 2
|
||||
COLOR_YELLOW 3
|
||||
COLOR_BLUE 4
|
||||
COLOR_MAGENTA 5
|
||||
COLOR_CYAN 6
|
||||
COLOR_WHITE 7
|
||||
*/
|
||||
|
||||
// IMPORTANT: use unique_ptr for cursor because:
|
||||
// 1. Every instance of cursor will initialize a new ncurses screen
|
||||
// Hence you should only have one instance of cursor at a time
|
||||
@ -20,9 +45,9 @@ public:
|
||||
|
||||
void show() const;
|
||||
|
||||
void print_char(const position &pos, const char ch) const;
|
||||
void print_char(const position &pos, const char ch, const int attrs) const;
|
||||
|
||||
void print_str(const position &head, const std::string str) const;
|
||||
void print_str(const position &head, const std::string str, const int attrs) const;
|
||||
};
|
||||
|
||||
// IMPORTANT: this will fail when terminal size changes
|
||||
|
Reference in New Issue
Block a user