From 786c120805c95b8c1ba73b456e3fb8b7f88920e2 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 23 Dec 2010 03:42:04 +0000 Subject: [PATCH] git-svn-id: svn://qnap.local/TwoTerm/trunk@1892 5590a31f-7b70-45f8-8c82-aa3a8e5f4507 --- Screen.cpp | 9 +++++++++ Screen.h | 29 ++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Screen.cpp b/Screen.cpp index 0ddc359..9bc86de 100644 --- a/Screen.cpp +++ b/Screen.cpp @@ -74,6 +74,15 @@ void Screen::setFlag(uint8_t flag) _flag = flag; } +void Screen::setFlagBit(uint8_t bit) +{ + _flag |= bit; +} +void Screen::clearFlagBit(uint8_t bit) +{ + _flag &= ~bit; +} + void Screen::putc(uint8_t c, bool incrementX) { diff --git a/Screen.h b/Screen.h index 1ada997..708786f 100644 --- a/Screen.h +++ b/Screen.h @@ -27,6 +27,30 @@ typedef struct CharInfo { } CharInfo; + +typedef struct ViewPort { + + + iRect frame; + + union flags + { + unsigned wrap:1; + unsigned advance:1; + unsigned lineFeed:1; + unsigned scroll:1; + + flags() + { + wrap = 0; + advance = 0; + lineFeed = 0; + scroll = 0; + } + + } flags; +}; + class Screen { public: @@ -37,7 +61,7 @@ public: static const unsigned FlagBold = 0x04; static const unsigned FlagUnderscore = 0x08; static const unsigned FlagBlink = 0x10; - static const unsigned FlagSelected = 0x20; + static const unsigned FlagSelected = 0x8000; @@ -81,6 +105,9 @@ public: void setFlag(uint8_t flag); + void setFlagBit(uint8_t bit); + void clearFlagBit(uint8_t bit); + void putc(uint8_t c, bool incrementX = true); CharInfo getc(int x, int y) const;