summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2004-12-09 14:27:06 +0000
committerlordjaxom <lordjaxom>2004-12-09 14:27:06 +0000
commite4c359b5c303cecfc49fb82799805da9fee8dadb (patch)
treeca09dced5d5794edac92e64c54b04a07a4a4c4ea
parent5382d18d05d358bb1c313c642395e835aa44a6a0 (diff)
downloadvdr-plugin-text2skin-e4c359b5c303cecfc49fb82799805da9fee8dadb.tar.gz
vdr-plugin-text2skin-e4c359b5c303cecfc49fb82799805da9fee8dadb.tar.bz2
1.0-pre2v1.0-pre2
-rw-r--r--Makefile11
-rw-r--r--display.c9
-rw-r--r--display.h2
-rw-r--r--graphtft/font.c3
-rw-r--r--render.c12
-rw-r--r--render.h2
-rw-r--r--text2skin.c2
-rw-r--r--xml/function.c7
-rw-r--r--xml/parser.c3
9 files changed, 28 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 2439122..aba3e9c 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ HAVE_FREETYPE=1
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING
# -------------------------------------------------------------
#
-# $Id: Makefile,v 1.7 2004/12/08 18:47:37 lordjaxom Exp $
+# $Id: Makefile,v 1.8 2004/12/09 12:43:14 lordjaxom Exp $
#
# The official name of this plugin.
@@ -74,8 +74,13 @@ ifdef HAVE_IMAGEMAGICK
endif
ifdef HAVE_FREETYPE
- INCLUDES += $(shell freetype-config --cflags)
- LIBS += $(shell freetype-config --libs)
+ ifneq ($(shell which freetype-config),)
+ INCLUDES += $(shell freetype-config --cflags)
+ LIBS += $(shell freetype-config --libs)
+ else
+ INCLUDES += -I/usr/include/freetype -I/usr/local/include/freetype
+ LIBS += -lfreetype
+ endif
DEFINES += -DHAVE_FREETYPE
OBJS += graphtft/font.o
endif
diff --git a/display.c b/display.c
index c8e2642..05d1768 100644
--- a/display.c
+++ b/display.c
@@ -302,7 +302,6 @@ void cText2SkinDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
}
void cText2SkinDisplayReplay::SetProgress(int Current, int Total) {
- Dprintf("SetProgress: %d %d\n", Current, Total);
if (mCurrent != Current || mTotal != Total) {
mCurrent = Current;
mTotal = Total;
@@ -535,11 +534,11 @@ cText2SkinDisplayMenu::~cText2SkinDisplayMenu() {
}
void cText2SkinDisplayMenu::Clear(void) {
- Dprintf("Clear\n");
mItems.clear();
mEvent = NULL;
mRecording = NULL;
mText = "";
+ cText2SkinRender::Clear();
SetDirty();
}
@@ -606,7 +605,9 @@ void cText2SkinDisplayMenu::SetItem(const char *Text, int Index, bool Current, b
}
void cText2SkinDisplayMenu::SetEvent(const cEvent *Event) {
+ Dprintf("setEvent %p\n", Event);
if (mEvent != Event) {
+ Dprintf("dirty\n");
mEvent = Event;
if (mEvent != NULL)
SetDirty();
@@ -647,12 +648,8 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) {
switch (Token.Type) {
case tMenuItem:
case tMenuGroup:
- case tIsMenuItem:
- case tIsMenuGroup:
- case tIsMenuCurrent:
if (Token.Index < 0) return false;
case tMenuCurrent:
- Dprintf("MenuCurrent: index %d\n", Token.Index);
if (Token.Index >= 0 && Token.Tab == -1) return false;
break;
diff --git a/display.h b/display.h
index 5e3df0b..f205c8a 100644
--- a/display.h
+++ b/display.h
@@ -138,7 +138,7 @@ protected:
virtual cxType GetTokenData(const txToken &Token);
virtual int GetTab(int n) { return cSkinDisplayMenu::Tab(n); }
virtual bool HasTabText(int Index, int n);
- virtual void SetEditableWidth(int Width) { printf("seteditablewidth: %d\n", Width); cSkinDisplayMenu::SetEditableWidth(Width); }
+ virtual void SetEditableWidth(int Width) { cSkinDisplayMenu::SetEditableWidth(Width); }
public:
cText2SkinDisplayMenu(cText2SkinLoader *Loader);
diff --git a/graphtft/font.c b/graphtft/font.c
index f4657c3..e38b283 100644
--- a/graphtft/font.c
+++ b/graphtft/font.c
@@ -1,10 +1,11 @@
/*
- * $Id: font.c,v 1.2 2004/12/06 21:19:07 lordjaxom Exp $
+ * $Id: font.c,v 1.3 2004/12/09 12:43:14 lordjaxom Exp $
*
* Taken from GraphTFT
*/
#include "font.h"
+#include <stdio.h>
cGraphtftFont::cGraphtftFont()
{
diff --git a/render.c b/render.c
index 2e0fda5..dfbc0ba 100644
--- a/render.c
+++ b/render.c
@@ -161,7 +161,7 @@ void cText2SkinRender::DrawObject(const cxObject *Object)
break;
case cxObject::progress:
- DrawProgressbar(Object->Pos(), Object->Size(), Object->Current(), Object->Total(), Object->Bg(), Object->Fg(), Object->Active(), Object->Mark(), Object->Keep(), GetMarks());
+ DrawProgressbar(Object->Pos(), Object->Size(), Object->Current(), Object->Total(), Object->Bg(), Object->Fg(), Object->Keep(), Object->Mark(), Object->Active(), GetMarks());
break;
case cxObject::scrolltext:
@@ -243,9 +243,9 @@ void cText2SkinRender::DrawImage(const txPoint &Pos, const tColor *Bg, const tCo
const std::string &Path)
{
cText2SkinBitmap *bmp;
- Dprintf("trying to draw image %s to %dx%d\n", ImagePath(Path).c_str(), Pos.x, Pos.y);
+ //Dprintf("trying to draw image %s to %dx%d\n", ImagePath(Path).c_str(), Pos.x, Pos.y);
if ((bmp = cText2SkinBitmap::Load(ImagePath(Path), Alpha)) != NULL) {
- Dprintf("success loading image\n");
+ //Dprintf("success loading image\n");
if (Bg) bmp->SetColor(0, *Bg);
if (Fg) bmp->SetColor(1, *Fg);
mScreen->DrawBitmap(Pos.x, Pos.y, bmp->Get(mUpdateIn));
@@ -255,7 +255,7 @@ void cText2SkinRender::DrawImage(const txPoint &Pos, const tColor *Bg, const tCo
void cText2SkinRender::DrawText(const txPoint &Pos, const txSize &Size, const tColor *Fg,
const std::string &Text, const cFont *Font, int Align)
{
- Dprintf("trying to draw text %s to %d,%d size %d,%d, color %x\n", Text.c_str(), Pos.x, Pos.y, Size.w, Size.h, Fg ? *Fg : 0);
+ //Dprintf("trying to draw text %s to %d,%d size %d,%d, color %x\n", Text.c_str(), Pos.x, Pos.y, Size.w, Size.h, Fg ? *Fg : 0);
mScreen->DrawText(Pos.x, Pos.y, Text.c_str(), Fg ? *Fg : 0, 0, Font, Size.w, Size.h, Align);
}
@@ -279,7 +279,7 @@ void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, i
const tColor *Selected, const tColor *Mark,
const tColor *Cur, const cMarks *Marks)
{
- Dprintf("trying to draw Progressbar, Current = %d, Total = %d\n", Current, Total);
+ //Dprintf("trying to draw Progressbar, Current = %d, Total = %d, bg = %x, marks = %p\n", Current, Total, Bg ? *Bg : 0, Marks);
if (Bg)
DrawRectangle(Pos, Size, Bg);
if (Total == 0)
@@ -349,7 +349,7 @@ void cText2SkinRender::DrawMark(const txPoint &Pos, const txSize &Size, bool Sta
void cText2SkinRender::DrawScrolltext(const txPoint &Pos, const txSize &Size, const tColor *Fg,
const std::string &Text, const cFont *Font, int /*Align*/)
{
- Dprintf("trying to draw scrolltext %s\n", Text.c_str());
+ //Dprintf("trying to draw scrolltext %s\n", Text.c_str());
if (mScroller == NULL)
mScroller = new cText2SkinScroller(mScreen, Pos.x, Pos.y, Size.w, Size.h, Text.c_str(), Font, Fg ? *Fg : 0, clrTransparent);
else
diff --git a/render.h b/render.h
index 2cb7562..d5bc15f 100644
--- a/render.h
+++ b/render.h
@@ -84,7 +84,6 @@ protected:
const tColor *Fg, const std::string &Text, const cFont *Font, int Align);
void DrawScrollbar(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg);
- //int GetEditableWidth(MenuItem Item, bool Current);
void Update(void);
// all renderers shall return appropriate data for the tokens
@@ -100,6 +99,7 @@ protected:
void Flush(bool Force = false);
void SetDirty(void) { mDirty = true; }
void Scroll(bool Up, bool Page) { if (mScroller) mScroller->Scroll(Up, Page); }
+ void Clear(void) { DELETENULL(mScroller); }
public:
cText2SkinRender(cText2SkinLoader *Loader, cxDisplay::eType Section, const std::string &BasePath = "",
diff --git a/text2skin.c b/text2skin.c
index f90c698..e9baa04 100644
--- a/text2skin.c
+++ b/text2skin.c
@@ -12,7 +12,7 @@
#include "i18n.h"
#include "loader.h"
-const char *cText2SkinPlugin::VERSION = "1.0-pre1";
+const char *cText2SkinPlugin::VERSION = "1.0-pre2";
const char *cText2SkinPlugin::SKINVERSION = "1.0";
const char *cText2SkinPlugin::DESCRIPTION = "Loader for text-based skins";
diff --git a/xml/function.c b/xml/function.c
index e6e321c..f283c2c 100644
--- a/xml/function.c
+++ b/xml/function.c
@@ -4,6 +4,7 @@
#include "xml/function.h"
#include "render.h"
+#include "bitmap.h"
#include "common.h"
#include <vdr/tools.h>
@@ -156,10 +157,8 @@ bool cxFunction::Parse(const std::string &Text)
const std::string &cxFunction::FunFile(const std::string &Param) const
{
std::string path = cText2SkinRender::ImagePath(Param);
- Dprintf("checking file(%s)\n", path.c_str());
- if (access(path.c_str(), F_OK) == 0)
- return Param;
- return False;
+ Dprintf("checking file(%s) in cache\n", path.c_str());
+ return cText2SkinBitmap::Load(path) ? Param : False;
}
std::string cxFunction::Evaluate(void) const
diff --git a/xml/parser.c b/xml/parser.c
index 1349769..4b957be 100644
--- a/xml/parser.c
+++ b/xml/parser.c
@@ -205,6 +205,9 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr
|| name == "scrollbar") {
ATTRIB_OPT_STRING("color", object->mFg);
ATTRIB_OPT_STRING("bgColor", object->mBg);
+ ATTRIB_OPT_STRING("mark", object->mMark);
+ ATTRIB_OPT_STRING("active", object->mActive);
+ ATTRIB_OPT_STRING("keep", object->mKeep);
ATTRIB_OPT_FUNC ("current", object->mCurrent.Parse);
ATTRIB_OPT_FUNC ("total", object->mTotal.Parse);
}