summaryrefslogtreecommitdiff
path: root/xml
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2004-12-28 01:24:35 +0000
committerlordjaxom <lordjaxom>2004-12-28 01:24:35 +0000
commitd5de012d18ffe859b70e703fec6170b1021e4249 (patch)
tree0fd60f69e1e432ca891828a5ce42df6a47634c22 /xml
parentb0a767292621b6c79a8bd021bbe2915a64e5b30c (diff)
downloadvdr-plugin-text2skin-d5de012d18ffe859b70e703fec6170b1021e4249.tar.gz
vdr-plugin-text2skin-d5de012d18ffe859b70e703fec6170b1021e4249.tar.bz2
- moved marquee into renderer
- introduced object state cache - introduced blink element - introduced delay attribute to objects
Diffstat (limited to 'xml')
-rw-r--r--xml/display.h3
-rw-r--r--xml/function.h10
-rw-r--r--xml/object.c8
-rw-r--r--xml/object.h15
-rw-r--r--xml/parser.c24
-rw-r--r--xml/string.h6
6 files changed, 43 insertions, 23 deletions
diff --git a/xml/display.h b/xml/display.h
index b57f734..73a7269 100644
--- a/xml/display.h
+++ b/xml/display.h
@@ -1,5 +1,5 @@
/*
- * $Id: display.h,v 1.1 2004/12/19 22:03:25 lordjaxom Exp $
+ * $Id: display.h,v 1.2 2004/12/28 01:24:35 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_DISPLAY_H
@@ -31,6 +31,7 @@ private:
eType mType;
txWindow mWindows[MAXOSDAREAS];
int mNumWindows;
+ int mNumMarquees;
cxObjects mObjects;
cxSkin *mSkin;
diff --git a/xml/function.h b/xml/function.h
index a67163b..3b9155b 100644
--- a/xml/function.h
+++ b/xml/function.h
@@ -1,5 +1,5 @@
/*
- * $Id: function.h,v 1.1 2004/12/19 22:03:26 lordjaxom Exp $
+ * $Id: function.h,v 1.2 2004/12/28 01:24:35 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_XML_FUNCTION_H
@@ -55,14 +55,14 @@ public:
std::string Evaluate(void) const;
bool EvaluateToBool(void);
- void SetIndex(uint Index, int Tab);
+ void SetListIndex(uint Index, int Tab);
};
-inline void cxFunction::SetIndex(uint Index, int Tab)
+inline void cxFunction::SetListIndex(uint Index, int Tab)
{
- mString.SetIndex(Index, Tab);
+ mString.SetListIndex(Index, Tab);
for (uint i = 0; i < mNumParams; ++i)
- mParams[i]->SetIndex(Index, Tab);
+ mParams[i]->SetListIndex(Index, Tab);
}
#endif // VDR_TEXT2SKIN_XML_FUNCTION_H
diff --git a/xml/object.c b/xml/object.c
index 159a9c7..1b8ac04 100644
--- a/xml/object.c
+++ b/xml/object.c
@@ -1,5 +1,5 @@
/*
- * $Id: object.c,v 1.2 2004/12/21 20:36:41 lordjaxom Exp $
+ * $Id: object.c,v 1.3 2004/12/28 01:24:35 lordjaxom Exp $
*/
#include "xml/object.h"
@@ -7,8 +7,8 @@
#include "font.h"
static const std::string ObjectNames[] =
- { "image", "text", "marquee", "rectangle", "ellipse", "slope", "progress", "scrolltext",
- "scrollbar", "block", "list", "item" };
+ { "image", "text", "marquee", "blink", "rectangle", "ellipse", "slope", "progress",
+ "scrolltext", "scrollbar", "block", "list", "item" };
cxObject::cxObject(cxDisplay *parent):
mType((eType)__COUNT_OBJECT__),
@@ -21,6 +21,7 @@ cxObject::cxObject(cxDisplay *parent):
mCondition(NULL),
mFontFace("Osd"),
mFontSize(0),
+ mDelay(150),
mIndex(0),
mObjects(NULL),
mDisplay(parent),
@@ -48,6 +49,7 @@ cxObject::cxObject(const cxObject &Src):
mTotal(Src.mTotal),
mFontFace(Src.mFontFace),
mFontSize(Src.mFontSize),
+ mDelay(0),
mObjects(NULL),
mDisplay(Src.mDisplay),
mSkin(Src.mSkin)
diff --git a/xml/object.h b/xml/object.h
index 4778b83..b7bd46c 100644
--- a/xml/object.h
+++ b/xml/object.h
@@ -1,5 +1,5 @@
/*
- * $Id: object.h,v 1.1 2004/12/19 22:03:27 lordjaxom Exp $
+ * $Id: object.h,v 1.2 2004/12/28 01:24:35 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_XML_OBJECT_H
@@ -49,6 +49,7 @@ public:
image,
text,
marquee,
+ blink,
rectangle,
ellipse,
slope,
@@ -81,6 +82,7 @@ private:
cxString mTotal;
std::string mFontFace;
int mFontSize;
+ uint mDelay;
uint mIndex;
cxObjects *mObjects; // used for block objects such as <list>
cxDisplay *mDisplay;
@@ -96,7 +98,7 @@ public:
bool ParseAlignment(const std::string &Text);
bool ParseFontFace (const std::string &Text);
- void SetIndex(uint Index, int Tab);
+ void SetListIndex(uint Index, int Tab);
eType Type(void) const { return mType; }
cxFunction *Condition(void) const { return mCondition; }
@@ -108,6 +110,7 @@ public:
std::string Text(void) const { return mText.Evaluate(); }
int Current(void) const { return mCurrent.Evaluate(); }
int Total(void) const { return mTotal.Evaluate(); }
+ uint Delay(void) const { return mDelay; }
uint Index(void) const { return mIndex; }
cxDisplay *Display(void) const { return mDisplay; }
cxSkin *Skin(void) const { return mSkin; }
@@ -126,12 +129,12 @@ public:
const cxObject *GetObject(uint Index) const;
};
-inline void cxObject::SetIndex(uint Index, int Tab)
+inline void cxObject::SetListIndex(uint Index, int Tab)
{
- mText.SetIndex(Index, Tab);
- mPath.SetIndex(Index, Tab);
+ mText.SetListIndex(Index, Tab);
+ mPath.SetListIndex(Index, Tab);
if (mCondition != NULL)
- mCondition->SetIndex(Index, Tab);
+ mCondition->SetListIndex(Index, Tab);
}
class cxObjects: public std::vector<cxObject*> {
diff --git a/xml/parser.c b/xml/parser.c
index c6ba202..2f66300 100644
--- a/xml/parser.c
+++ b/xml/parser.c
@@ -1,5 +1,5 @@
/*
- * $Id: parser.c,v 1.2 2004/12/21 20:36:12 lordjaxom Exp $
+ * $Id: parser.c,v 1.3 2004/12/28 01:24:35 lordjaxom Exp $
*/
#include "xml/parser.h"
@@ -84,7 +84,7 @@ static cxSkin *skin = NULL;
static cxDisplay *display = NULL;
static cxObject *parent = NULL;
static cxObject *object = NULL;
-static uint mindex = 0;
+static uint oindex = 0;
bool xStartElem(const std::string &name, std::map<std::string,std::string> &attrs) {
//Dprintf("start element: %s\n", name.c_str());
@@ -148,13 +148,25 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr
}
else if (name == "text"
|| name == "marquee"
+ || name == "blink"
|| name == "scrolltext") {
ATTRIB_OPT_STRING("color", object->mFg);
ATTRIB_OPT_FUNC ("align", object->ParseAlignment);
ATTRIB_OPT_FUNC ("font", object->ParseFontFace);
- if (name == "marquee")
- object->mIndex = mindex++;
+ if (name == "blink") {
+ ATTRIB_OPT_STRING("blinkColor", object->mBg);
+ ATTRIB_OPT_NUMBER("delay", object->mDelay);
+
+ if (object->mDelay == 0)
+ object->mDelay = 1000;
+ }
+ else if (name == "marquee") {
+ ATTRIB_OPT_NUMBER("delay", object->mDelay);
+
+ if (object->mDelay == 0)
+ object->mDelay = 500;
+ }
}
else if (name == "rectangle") {
ATTRIB_OPT_STRING("color", object->mFg);
@@ -216,9 +228,10 @@ bool xEndElem(const std::string &name) {
//Dprintf("end element: %s\n", name.c_str());
if (context[context.size() - 1] == name) {
if (name == "display") {
+ //display->mNumMarquees = mindex;
skin->mDisplays[display->Type()] = display;
display = NULL;
- mindex = 0;
+ oindex = 0;
}
else if (object != NULL || parent != NULL) {
if (object == NULL) {
@@ -238,6 +251,7 @@ bool xEndElem(const std::string &name) {
}
}
+ object->mIndex = oindex++;
if (parent != NULL) {
//Dprintf("pushing to parent\n");
if (parent->mObjects == NULL)
diff --git a/xml/string.h b/xml/string.h
index b3b0c8d..f441c9f 100644
--- a/xml/string.h
+++ b/xml/string.h
@@ -1,5 +1,5 @@
/*
- * $Id: string.h,v 1.3 2004/12/21 20:26:25 lordjaxom Exp $
+ * $Id: string.h,v 1.4 2004/12/28 01:24:35 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_XML_STRING_H
@@ -175,10 +175,10 @@ public:
bool Parse(const std::string &Text);
cxType Evaluate(void) const;
- void SetIndex(uint Index, int Tab);
+ void SetListIndex(uint Index, int Tab);
};
-inline void cxString::SetIndex(uint Index, int Tab)
+inline void cxString::SetListIndex(uint Index, int Tab)
{
for (uint i = 0; i < mTokens.size(); ++i) {
mTokens[i].Index = Index;