diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2011-05-16 00:26:23 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-05-16 00:26:23 +0200 |
commit | 4cd5223718a7f24ad31b2054263048e6af5dd1aa (patch) | |
tree | b55ec97258ce269c5de7cb602217788a3c426aa6 /glcdskin/object.h | |
parent | 9a4532d4904088f9c5cde08542d85dc858b92e9b (diff) | |
download | graphlcd-base-4cd5223718a7f24ad31b2054263048e6af5dd1aa.tar.gz graphlcd-base-4cd5223718a7f24ad31b2054263048e6af5dd1aa.tar.bz2 |
object colours (fore/background) are now evaluated at run time; minor clean up in class cColor, class member cColor::color is no longer public
Diffstat (limited to 'glcdskin/object.h')
-rw-r--r-- | glcdskin/object.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/glcdskin/object.h b/glcdskin/object.h index 81fb139..cb5f35a 100644 --- a/glcdskin/object.h +++ b/glcdskin/object.h @@ -60,6 +60,29 @@ enum eTextVerticalAlignment tvaBottom }; + +class cSkinColor +{ +private: + cSkinObject * mObject; + uint32_t mColor; + std::string mVarId; +public: + cSkinColor(cSkinObject *Parent, uint32_t color):mVarId("") { mObject = Parent; mColor = color; } + cSkinColor(cSkinObject *Parent, cColor color):mVarId("") { mObject = Parent; mColor = (uint32_t)color; } + cSkinColor(cSkinObject *Parent, const std::string varId) { mObject = Parent; mVarId = varId; } + ~cSkinColor() {}; + + void SetColor(uint32_t color) { mVarId = ""; mColor = color; } + void SetColor(cColor color) { mVarId = ""; mColor = (uint32_t)color; } + void SetVarId(const std::string varId) { mVarId = varId; } + + uint32_t GetColor(void); + + operator uint32_t(void) { return GetColor(); } +}; + + class cSkinObject { friend bool StartElem(const std::string & name, std::map<std::string,std::string> & attrs); @@ -92,8 +115,8 @@ private: eType mType; // type of object, one of enum eType tPoint mPos1; tPoint mPos2; - cColor mColor; - cColor mBackgroundColor; + cSkinColor mColor; + cSkinColor mBackgroundColor; bool mFilled; int mRadius; int mArc; @@ -135,7 +158,7 @@ public: ~cSkinObject(); bool ParseType(const std::string &Text); - bool ParseColor(const std::string &Text, cColor & ParamColor); + bool ParseColor(const std::string &Text, cSkinColor & ParamColor); bool ParseCondition(const std::string &Text); bool ParseAlignment(const std::string &Text); bool ParseVerticalAlignment(const std::string &Text); |