summaryrefslogtreecommitdiff
path: root/glcdskin/font.h
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2010-04-17 19:16:26 +0200
committermrwastl <mrwastl@users.sourceforge.net>2010-04-17 19:16:26 +0200
commit68ac6628a31cb1472275b5282c5cf9a971d9bddd (patch)
tree0ef788b563efab6688b0381cedd43baaefbc66cc /glcdskin/font.h
parent1011961a8af0615ee25b79d2bbd7e6820b851556 (diff)
downloadgraphlcd-base-68ac6628a31cb1472275b5282c5cf9a971d9bddd.tar.gz
graphlcd-base-68ac6628a31cb1472275b5282c5cf9a971d9bddd.tar.bz2
backport of skin-support from 0.2.x to 0.1.x, changes for gcc 4.3 conformity
Diffstat (limited to 'glcdskin/font.h')
-rw-r--r--glcdskin/font.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/glcdskin/font.h b/glcdskin/font.h
new file mode 100644
index 0000000..d11fa50
--- /dev/null
+++ b/glcdskin/font.h
@@ -0,0 +1,73 @@
+/*
+ * GraphLCD skin library
+ *
+ * font.h - font class
+ *
+ * This file is released under the GNU General Public License. Refer
+ * to the COPYING file distributed with this package.
+ *
+ * based on text2skin
+ *
+ */
+
+#ifndef _GLCDSKIN_FONT_H_
+#define _GLCDSKIN_FONT_H_
+
+#include <string>
+#include <vector>
+
+#include <glcdgraphics/font.h>
+
+#include "display.h"
+#include "object.h"
+
+namespace GLCD
+{
+
+class cSkin;
+
+class cSkinFont
+{
+ friend bool StartElem(const std::string &name, std::map<std::string,std::string> &attrs);
+ friend bool EndElem(const std::string &name);
+
+public:
+ enum eType
+ {
+ ftFNT,
+ ftFT2
+ };
+
+private:
+ cSkin * mSkin;
+ std::string mId;
+ eType mType;
+ std::string mFile;
+ int mSize;
+ cFont mFont;
+ cSkinFunction * mCondition;
+ cSkinDisplay mDummyDisplay;
+ cSkinObject mDummyObject;
+
+public:
+ cSkinFont(cSkin * Parent);
+
+ bool ParseUrl(const std::string & Text);
+ bool ParseCondition(const std::string & Text);
+
+ cSkin * Skin(void) const { return mSkin; }
+ const std::string & Id(void) const { return mId; }
+ const cFont * Font(void) const { return &mFont; }
+ cSkinFunction * Condition(void) const { return mCondition; }
+};
+
+class cSkinFonts: public std::vector<cSkinFont *>
+{
+public:
+ cSkinFonts(void);
+ ~cSkinFonts(void);
+};
+
+} // end of namespace
+
+#endif