diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2011-09-16 17:59:04 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-09-16 17:59:04 +0200 |
commit | 7178bcc48bc3377c4027e362ba217e9f3815cea5 (patch) | |
tree | 8f7cab76d7e5207128da9058b1d1e2d54f5e3a3a /glcddrivers/driver.h | |
parent | 73ba3e0dd78c96a92e8297e62270bd4e5cd35a44 (diff) | |
download | graphlcd-base-7178bcc48bc3377c4027e362ba217e9f3815cea5.tar.gz graphlcd-base-7178bcc48bc3377c4027e362ba217e9f3815cea5.tar.bz2 |
move config/oldConfig + it's initialisation to base class cDriver; libglcddrivers.so no longer link-dependent on libglcdgraphics.so
Diffstat (limited to 'glcddrivers/driver.h')
-rw-r--r-- | glcddrivers/driver.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/glcddrivers/driver.h b/glcddrivers/driver.h index a7175b7..7f95afc 100644 --- a/glcddrivers/driver.h +++ b/glcddrivers/driver.h @@ -38,6 +38,7 @@ public: cSimpleTouchEvent(); }; +class cDriverConfig; class cDriver { @@ -46,13 +47,15 @@ protected: int height; uint32_t bgcol; uint32_t fgcol; + cDriverConfig * config; + cDriverConfig * oldConfig; 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(GetDefaultBackgroundColor()).Invert(); } + virtual uint32_t GetDefaultBackgroundColor(void) { return GRAPHLCD_Black; } + uint32_t GetDefaultForegroundColor(void) { return GetDefaultBackgroundColor() ^ 0x00FFFFFF; } public: - cDriver(); - virtual ~cDriver() {} + cDriver(cDriverConfig * config); + virtual ~cDriver(); int Width() const { return width; } int Height() const { return height; } @@ -72,18 +75,18 @@ public: virtual bool SetFeature (const std::string & Feature, int value) { return false; } - GLCD::cColor GetBackgroundColor(bool driverdefault=false) { + uint32_t GetBackgroundColor(bool driverdefault=false) { return ( - (driverdefault || bgcol == GLCD::cColor::ERRCOL || bgcol == GLCD::cColor::Transparent) + (driverdefault || bgcol == GRAPHLCD_ERRCOL || bgcol == GRAPHLCD_Transparent) ? GetDefaultBackgroundColor() - : GLCD::cColor(bgcol) + : bgcol ); } - GLCD::cColor GetForegroundColor(bool driverdefault=false) { + uint32_t GetForegroundColor(bool driverdefault=false) { return ( - (driverdefault || fgcol == GLCD::cColor::ERRCOL || fgcol == GLCD::cColor::Transparent) + (driverdefault || fgcol == GRAPHLCD_ERRCOL || fgcol == GRAPHLCD_Transparent) ? GetDefaultForegroundColor() - : GLCD::cColor(fgcol) + : fgcol ); } |