summaryrefslogtreecommitdiff
path: root/font.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-05-16 10:35:36 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2004-05-16 10:35:36 +0200
commit5d99df7b7760c4a2b497c737a15b609008f6d56d (patch)
treea342f2f7465a73fe2bd63848d87566af8d646dd3 /font.h
parent7aab06d8b1c6de59d06756d44c631984acd299b3 (diff)
downloadvdr-5d99df7b7760c4a2b497c737a15b609008f6d56d.tar.gz
vdr-5d99df7b7760c4a2b497c737a15b609008f6d56d.tar.bz2
Implemented 'skins' and 'themes'
Diffstat (limited to 'font.h')
-rw-r--r--font.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/font.h b/font.h
index 9c363160..aaad4f94 100644
--- a/font.h
+++ b/font.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: font.h 1.5 2004/01/16 13:18:28 kls Exp $
+ * $Id: font.h 1.6 2004/04/12 10:21:03 kls Exp $
*/
#ifndef __FONT_H
@@ -38,13 +38,20 @@ private:
static eDvbCode code;
static cFont *fonts[];
const tCharData *data[NUMCHARS];
+ int height;
public:
cFont(void *Data);
void SetData(void *Data);
int Width(unsigned char c) const { return data[c]->width; }
+ ///< Returns the width of the given character.
int Width(const char *s) const;
+ ///< Returns the width of the given string.
int Height(unsigned char c) const { return data[c]->height; }
+ ///< Returns the height of the given character.
int Height(const char *s) const;
+ ///< Returns the height of the given string.
+ int Height(void) const { return height; }
+ ///< Returns the height of this font (all characters have the same height).
const tCharData *CharData(unsigned char c) const { return data[c]; }
static bool SetCode(const char *Code);
static void SetCode(eDvbCode Code);
@@ -52,4 +59,27 @@ public:
static const cFont *GetFont(eDvbFont Font);
};
+class cTextWrapper {
+private:
+ char *text;
+ char *eol;
+ int lines;
+ int lastLine;
+public:
+ cTextWrapper(void);
+ cTextWrapper(const char *Text, const cFont *Font, int Width);
+ ~cTextWrapper();
+ void Set(const char *Text, const cFont *Font, int Width);
+ ///< Wraps the Text to make it fit into the area defined by the given Width
+ ///< when displayed with the given Font.
+ ///< Wrapping is done by inserting the necessary number of newline
+ ///< characters into the string.
+ const char *Text(void);
+ ///< Returns the full wrapped text.
+ int Lines(void) { return lines; }
+ ///< Returns the actual number of lines needed to display the full wrapped text.
+ const char *GetLine(int Line);
+ ///< Returns the given Line. The first line is numbered 0.
+ };
+
#endif //__FONT_H