diff options
author | lordjaxom <lordjaxom> | 2004-06-25 17:54:38 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2004-06-25 17:54:38 +0000 |
commit | f2a4ea2dc8c0d915e0f2af6f4ec1a228e1e94453 (patch) | |
tree | e071f932913f57fa464a7e3cdd5cf774c3a629e5 /data.c | |
parent | de602ae6486b181ec081749a510cfcf15c71c817 (diff) | |
download | vdr-plugin-text2skin-f2a4ea2dc8c0d915e0f2af6f4ec1a228e1e94453.tar.gz vdr-plugin-text2skin-f2a4ea2dc8c0d915e0f2af6f4ec1a228e1e94453.tar.bz2 |
- on devices capable of full-color OSD, bpp's have no meaning anymorev0.0.7
(but will still work like usual). On such devices, a full-screen 8-bit
OSD will be used
- new display-item "PresentTextDescription" displays combined
ShortText/Description
- displaying replay symbols only if information is actually available
- exchanged x, y, width, height with x1, y1, x2, y2 coordinates
(skin version is now 0.0.3)
- coordinates may be negative to respect dynamic OSD settings
(negative coordinates give pixels from the right or bottom edge)
- added base parameter to Skin item to be able to use full screen in absolute
mode
- added a script to convert 0.0.2 skins to 0.0.3
- added parsing quoted texts (path="Bla.jpg" etc. will work correctly now)
- fixed translator to escape the dollar sign
- fixed display of scrollbar (REALLY!)
- fixed linkage of libMagick++
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 39 |
1 files changed, 25 insertions, 14 deletions
@@ -1,22 +1,20 @@ /* - * $Id: data.c,v 1.19 2004/06/16 18:46:50 lordjaxom Exp $ + * $Id: data.c,v 1.20 2004/06/22 16:48:03 lordjaxom Exp $ */ #include "data.h" #include "common.h" +#include "render.h" cText2SkinItem::cText2SkinItem(void) { mItem = itemUnknown; mDisplay = displayAlways; - mPos.x = 0; - mPos.y = 0; - mSize.w = 0; - mSize.h = 0; mBpp = 4; mArc = 0; mAlpha = 0; mFont = cFont::GetFont(fontOsd); mAlign = taDefault; + mBase = baseRelative; } cText2SkinItem::~cText2SkinItem() { @@ -28,24 +26,27 @@ bool cText2SkinItem::Parse(const char *Text) { bool res = false; // check if this is an item - if (ParseVar(ptr, "Item", &mItem)) { - if (mItem == itemSkin && (!ParseVar(ptr, "name", mName) || !ParseVar(ptr, "version", mVersion))) + if (ParseVar(ptr, "Item", &mItem) && mItem != itemUnknown) { + ParseItem(ptr); + + if (mItem == itemSkin && (mName == "" || mVersion == "")) esyslog("ERROR: text2skin: Item=Skin is missing the name and/or version parameter(s)"); - else if (mItem != itemUnknown) { - ParseItem(ptr); + else res = true; - } } else esyslog("ERROR: text2skin: unknown item in skin"); return res; } bool cText2SkinItem::ParseItem(const char *Text) { + ParseVar(Text, "name", mName); + ParseVar(Text, "version", mVersion); + ParseVar(Text, "base", &mBase); ParseVar(Text, "display", &mDisplay); - ParseVar(Text, "x", &mPos.x); - ParseVar(Text, "y", &mPos.y); - ParseVar(Text, "width", &mSize.w); - ParseVar(Text, "height", &mSize.h); + ParseVar(Text, "x1", &mPos1.x); + ParseVar(Text, "y1", &mPos1.y); + ParseVar(Text, "x2", &mPos2.x); + ParseVar(Text, "y2", &mPos2.y); ParseVar(Text, "bpp", &mBpp); ParseVar(Text, "arc", &mArc); ParseVar(Text, "alpha", &mAlpha); @@ -61,6 +62,16 @@ bool cText2SkinItem::ParseItem(const char *Text) { return true; } +const POINT cText2SkinItem::Pos(void) const { + return cText2SkinRender::Transform(mPos1); +} + +const SIZE cText2SkinItem::Size(void) const { + POINT p1 = cText2SkinRender::Transform(mPos1); + POINT p2 = cText2SkinRender::Transform(mPos2); + return SIZE(p2.x - p1.x + 1, p2.y - p1.y + 1); +} + // --- cText2SkinData --------------------------------------------------------- cText2SkinData::cText2SkinData(const char *Skin): cText2SkinFile(Skin) { |