Last active
April 21, 2018 08:27
-
-
Save Daniel-Wang/30d4e1a865f81ee35c7bceefe60da481 to your computer and use it in GitHub Desktop.
View header file for Vm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Includes | |
namespace vm { | |
class View { | |
public: | |
View(int height, int width, int startX, int startY); | |
~View(); | |
void printBufferContent(); | |
void setHighlighter(std::unique_ptr<Highlighter> highlighter); | |
void resetCursor(); | |
virtual void printString(const std::string& text) const; | |
int height() const; | |
void setBackgroundColor(int pair); | |
void enableHighlightingAt(int xStart, int xFinish, int y); | |
void disableHighlighting(); | |
private: | |
void setCursorAt(int x, int y); | |
void clearView() const; | |
int _height; | |
std::string _content; | |
std::pair<std::pair<int, int>, int> _highlight; | |
WINDOW* _window; | |
std::shared_ptr<Buffer> _buffer; | |
std::unique_ptr<Highlighter> _highlighter; | |
std::unique_ptr<ViewCursor> _cursor; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment