diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2011-05-29 17:09:06 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-05-29 17:09:06 +0200 |
commit | b56b578398b7d9e9b47d8d880ae9778566a99c34 (patch) | |
tree | bf972d19e8efdb8ff5659472a19bbcc5b6ff304f /glcddrivers/driver.h | |
parent | 4c345e10f3587a9ed1bdcd1fb10e68c27f876961 (diff) | |
download | graphlcd-base-b56b578398b7d9e9b47d8d880ae9778566a99c34.tar.gz graphlcd-base-b56b578398b7d9e9b47d8d880ae9778566a99c34.tar.bz2 |
add fgcol/bgcol class members to base class cDriver, add distinction between default fg/bg colours from driver and fg/bg colours from class; adapt serdisp-driver to these changes
Diffstat (limited to 'glcddrivers/driver.h')
-rw-r--r-- | glcddrivers/driver.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/glcddrivers/driver.h b/glcddrivers/driver.h index c235459..5b75c20 100644 --- a/glcddrivers/driver.h +++ b/glcddrivers/driver.h @@ -42,10 +42,14 @@ public: class cDriver { protected: - int width; - int height; + int width; + int height; + uint32_t bgcol; + uint32_t fgcol; virtual bool GetDriverFeature (const std::string & Feature, int & value) { return false; } + virtual GLCD::cColor GetDefaultBackgroundColor(void) { return GLCD::cColor(GLCD::cColor::Black); } + GLCD::cColor GetDefaultForegroundColor(void) { return GLCD::cColor(GetBackgroundColor()).Invert(); } public: cDriver(); virtual ~cDriver() {} @@ -65,13 +69,11 @@ public: virtual void SetBrightness(unsigned int percent) {} - virtual GLCD::cColor GetBackgroundColor(void) { return GLCD::cColor(GLCD::cColor::White); } virtual bool SetFeature (const std::string & Feature, int value) { return false; } - GLCD::cColor GetForegroundColor(void) { - return GLCD::cColor(GetBackgroundColor()).Invert(); - } + GLCD::cColor GetBackgroundColor(bool driverdefault=false) { return (driverdefault) ? GetDefaultBackgroundColor() : (GLCD::cColor)bgcol; } + GLCD::cColor GetForegroundColor(bool driverdefault=false) { return (driverdefault) ? GetDefaultForegroundColor() : (GLCD::cColor)fgcol; } // not to be overridden, override GetDriverFeature() instead // the following feature names (case insensitive!) are guaranteed to give results: |