1

add attribute support, fg/bg in progress

This commit is contained in:
churl
2022-04-28 00:40:01 +02:00
parent 3322218708
commit 2861c07c1a
5 changed files with 74 additions and 24 deletions

View File

@ -18,16 +18,44 @@
#include "devices/CGA.h"
#include "lib/OutStream.h"
class CGA_Stream : public OutStream, public CGA {
// NOTE: I added this
class fgc {
public:
fgc() : fg(CGA::LIGHT_GREY) {};
fgc(CGA::color fg) : fg(fg) {};
CGA::color fg;
};
class bgc {
public:
bgc() : bg(CGA::BLACK) {};
bgc(CGA::color bg) : bg(bg) {};
CGA::color bg;
};
class CGA_Stream : public OutStream, public CGA {
private:
CGA_Stream(CGA_Stream& copy); // Verhindere Kopieren
public:
CGA_Stream() : OutStream(), CGA() { flush(); }
CGA::color color_fg;
CGA::color color_bg;
bool blink;
CGA_Stream() : OutStream(), CGA() {
color_fg = CGA::LIGHT_GREY;
color_bg = CGA::BLACK;
blink = false;
flush();
}
// Methode zur Ausgabe des Pufferinhalts der Basisklasse StringBuffer.
void flush() override;
// NOTE: I added this
// TODO: Problem: Implementing this here breaks the << chaining
// CGA_Stream& operator<<(const fgc&);
// CGA_Stream& operator<<(const bgc&);
};
#endif