summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS5
-rw-r--r--display.c52
-rw-r--r--display.h15
-rw-r--r--font.c3
-rw-r--r--graphtft/font.c5
-rw-r--r--render.c14
-rw-r--r--render.h3
-rw-r--r--text2skin.c2
-rw-r--r--xml/object.c4
9 files changed, 86 insertions, 17 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index a96df14..9a2f596 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1,6 +1,10 @@
Special thanks go to the following individuals (if your name is missing here,
please send an email to sascha (at) akv-soft (dot) de):
+Lars Tegeler
+ for implementing true-type-font support
+ for implementing image-scaling and quantizing
+
Monroe
for creating and extending the german and english vdr-wiki with text2skin sections
for creating plaintext conversions of the wiki pages for inclusion in this package
@@ -10,3 +14,4 @@ steffx
Brougs78
for doing much testing and skinning
+
diff --git a/display.c b/display.c
index 9ec84fd..b9e60be 100644
--- a/display.c
+++ b/display.c
@@ -1,5 +1,5 @@
/*
- * $Id: display.c,v 1.4 2005/01/02 19:55:36 lordjaxom Exp $
+ * $Id: display.c,v 1.5 2005/01/05 19:27:45 lordjaxom Exp $
*/
#include "render.h"
@@ -644,7 +644,7 @@ cText2SkinDisplayMenu::cText2SkinDisplayMenu(cText2SkinLoader *Loader):
const cxObject *area = NULL;
for (uint i = 0; i < disp->Objects(); ++i) {
const cxObject *o = disp->GetObject(i);
- if (disp->GetObject(i)->Type() == cxObject::list) {
+ if (o->Type() == cxObject::list) {
area = o;
break;
}
@@ -950,6 +950,8 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
}
#if VDRVERSNUM >= 10318
+// --- cText2SkinDisplayTracks ------------------------------------------------
+
cText2SkinDisplayTracks::cText2SkinDisplayTracks(cText2SkinLoader *Loader, const char *Title,
int NumTracks, const char * const *Tracks):
cText2SkinRender(Loader, cxDisplay::audioTracks),
@@ -957,6 +959,10 @@ cText2SkinDisplayTracks::cText2SkinDisplayTracks(cText2SkinLoader *Loader, const
mItems(),
mCurrentItem((uint)-1)
{
+ for (int i = 0; i < NumTracks; ++i) {
+ tListItem item(Tracks[i]);
+ mItems.push_back(item);
+ }
}
cText2SkinDisplayTracks::~cText2SkinDisplayTracks()
@@ -965,11 +971,51 @@ cText2SkinDisplayTracks::~cText2SkinDisplayTracks()
void cText2SkinDisplayTracks::SetTrack(int Index, const char * const *Tracks)
{
+ UpdateLock();
+ if (mCurrentItem != (uint)Index) {
+ mCurrentItem = Index;
+ SetDirty();
+ }
+ UpdateUnlock();
}
cxType cText2SkinDisplayTracks::GetTokenData(const txToken &Token)
{
- return cText2SkinRender::GetTokenData(Token);
+ switch (Token.Type) {
+ case tMenuItem:
+ if (Token.Index < 0) return false;
+ case tMenuCurrent:
+ if (Token.Index >= 0 && Token.Tab == -1) return false;
+ break;
+
+ default:
+ if (Token.Tab >= 0) return false;
+ break;
+ }
+
+ switch (Token.Type) {
+ case tMenuTitle:
+ return mTitle;
+
+ case tMenuItem:
+ return mItems.size() > (uint)Token.Index && mCurrentItem != (uint)Token.Index
+ ? (cxType)mItems[Token.Index].text
+ : (cxType)false;
+
+ case tIsMenuItem:
+ return mItems.size() > (uint)Token.Index && mCurrentItem != (uint)Token.Index;
+
+ case tMenuCurrent:
+ return mItems.size() > (uint)Token.Index && mCurrentItem == (uint)Token.Index
+ ? (cxType)mItems[Token.Index].text
+ : (cxType)false;
+
+ case tIsMenuCurrent:
+ return mItems.size() > (uint)Token.Index && mCurrentItem == (uint)Token.Index;
+
+ default:
+ return cText2SkinRender::GetTokenData(Token);
+ }
}
#endif
diff --git a/display.h b/display.h
index 645e280..ea06401 100644
--- a/display.h
+++ b/display.h
@@ -1,5 +1,5 @@
/*
- * $Id: display.h,v 1.4 2005/01/02 19:55:36 lordjaxom Exp $
+ * $Id: display.h,v 1.5 2005/01/05 19:28:52 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_SKIN_H
@@ -157,12 +157,13 @@ protected:
virtual int GetTab(int n) { return cSkinDisplayMenu::Tab(n); }
virtual bool HasTabText(int Index, int n);
virtual void SetEditableWidth(int Width) { cSkinDisplayMenu::SetEditableWidth(Width); }
+ virtual int MaxItems(void) { return mMaxItems;}
+ virtual void SetMaxItems(int MaxItems) { mMaxItems = MaxItems; }
public:
cText2SkinDisplayMenu(cText2SkinLoader *Loader);
virtual ~cText2SkinDisplayMenu();
- virtual int MaxItems(void) { return mMaxItems; }
virtual void Clear(void);
virtual void SetTitle(const char *Title);
virtual void SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue);
@@ -182,7 +183,7 @@ inline bool cText2SkinDisplayMenu::HasTabText(int Index, int n)
if (Index < 0 || mItems.size () > (uint)Index)
return n == -1
? mItems[Index].text.length() > 0
- : mItems[Index].tabs[n].length() > 0;
+ : mItems[Index].tabs[n].length() > 0;
return false;
}
@@ -205,6 +206,7 @@ private:
protected:
virtual cxType GetTokenData(const txToken &Token);
+ virtual bool HasTabText(int Index, int n);
public:
cText2SkinDisplayTracks(cText2SkinLoader *Loader, const char *Title, int NumTracks,
@@ -215,6 +217,13 @@ public:
virtual void Flush(void) { cText2SkinRender::Flush(); }
};
+
+inline bool cText2SkinDisplayTracks::HasTabText(int Index, int n)
+{
+ if (Index < 0 || mItems.size () > (uint)Index && n <= 0)
+ return mItems[Index].text.length() > 0;
+ return false;
+}
#endif
#endif // VDR_TEXT2SKIN_SKIN_H
diff --git a/font.c b/font.c
index 134e097..7042da9 100644
--- a/font.c
+++ b/font.c
@@ -1,5 +1,5 @@
/*
- * $Id: font.c,v 1.2 2004/12/28 14:35:54 lordjaxom Exp $
+ * $Id: font.c,v 1.3 2005/01/05 19:29:10 lordjaxom Exp $
*/
#include "font.h"
@@ -32,7 +32,6 @@ const cFont *cText2SkinFont::Load(const std::string &Path, const std::string &Fi
#ifdef HAVE_FREETYPE
char *cachename;
asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, Setup.OSDLanguage);
- Dprintf("trying now: %s %s\n", (Path + "/" + Filename).c_str(), cachename);
if (mFontCache.Load(Path + "/" + Filename, cachename, Size, Setup.OSDLanguage, Width))
res = mFontCache.GetFont(cachename);
else
diff --git a/graphtft/font.c b/graphtft/font.c
index c8c74fa..0a384f7 100644
--- a/graphtft/font.c
+++ b/graphtft/font.c
@@ -1,5 +1,5 @@
/*
- * $Id: font.c,v 1.2 2005/01/02 14:34:05 lordjaxom Exp $
+ * $Id: font.c,v 1.3 2005/01/02 23:18:42 lordjaxom Exp $
*
* Taken from GraphTFT
*/
@@ -58,6 +58,9 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua
// set slot
_slot = _face->glyph;
+ if (Width > 0)
+ Width = Size * Width / 100;
+
// set Size
FT_Set_Char_Size
(
diff --git a/render.c b/render.c
index 4de2418..b2e8775 100644
--- a/render.c
+++ b/render.c
@@ -1,5 +1,5 @@
/*
- * $Id: render.c,v 1.15 2005/01/02 20:34:20 lordjaxom Exp $
+ * $Id: render.c,v 1.16 2005/01/05 19:30:14 lordjaxom Exp $
*/
#include "render.h"
@@ -152,7 +152,7 @@ void cText2SkinRender::Update(void)
void cText2SkinRender::DrawObject(const cxObject *Object)
{
- if (Object->Condition() != NULL && !Object->Condition()->EvaluateToBool())
+ if (Object->Condition() != NULL && !Object->Condition()->Evaluate())
return;
switch (Object->Type()) {
@@ -216,10 +216,16 @@ void cText2SkinRender::DrawObject(const cxObject *Object)
uint maxitems = areasize.h / itemheight;
uint yoffset = 0;
+ SetMaxItems(maxitems); Dprintf("setmaxitems %d\n", maxitems);
for (uint i = 0; i < maxitems; ++i, yoffset += itemheight) {
for (uint j = 1; j < Object->Objects(); ++j) {
const cxObject *o = Object->GetObject(j);
- for (int t = -1; t < cSkinDisplayMenu::MaxTabs; ++t) {
+ int maxtabs = 1;
+
+ if (o->Display()->Type() == cxDisplay::menu)
+ maxtabs = cSkinDisplayMenu::MaxTabs;
+
+ for (int t = -1; t < maxtabs; ++t) {
if (!HasTabText(i, t))
continue;
@@ -228,7 +234,7 @@ void cText2SkinRender::DrawObject(const cxObject *Object)
cxObject obj(*o);
obj.SetListIndex(i, t);
- if (obj.Condition() != NULL && !obj.Condition()->EvaluateToBool())
+ if (obj.Condition() != NULL && !obj.Condition()->Evaluate())
continue;
obj.mPos1.x += Object->mPos1.x + (t >= 0 ? thistab : 0);
diff --git a/render.h b/render.h
index de50cc3..982ef18 100644
--- a/render.h
+++ b/render.h
@@ -1,5 +1,5 @@
/*
- * $Id: render.h,v 1.7 2005/01/01 23:44:36 lordjaxom Exp $
+ * $Id: render.h,v 1.8 2005/01/05 19:31:18 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_RENDER_H
@@ -113,6 +113,7 @@ protected:
virtual int GetTab(int n) { return 0; }
virtual bool HasTabText(int Index, int n) { return false; }
virtual void SetEditableWidth(int Width) {}
+ virtual void SetMaxItems(int MaxItems) {}
// functions for display renderer to control behaviour
void Flush(bool Force = false);
diff --git a/text2skin.c b/text2skin.c
index 9911d3c..91133fb 100644
--- a/text2skin.c
+++ b/text2skin.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: text2skin.c,v 1.2 2004/12/28 23:42:36 lordjaxom Exp $
+ * $Id: text2skin.c,v 1.3 2005/01/05 19:31:39 lordjaxom Exp $
*/
#include "text2skin.h"
diff --git a/xml/object.c b/xml/object.c
index f55af07..ce07ab5 100644
--- a/xml/object.c
+++ b/xml/object.c
@@ -1,5 +1,5 @@
/*
- * $Id: object.c,v 1.8 2005/01/01 23:44:36 lordjaxom Exp $
+ * $Id: object.c,v 1.9 2005/01/03 09:01:07 lordjaxom Exp $
*/
#include "xml/object.h"
@@ -56,7 +56,7 @@ cxObject::cxObject(const cxObject &Src):
mTotal(Src.mTotal),
mFontFace(Src.mFontFace),
mFontSize(Src.mFontSize),
- mFontWidth(Src.mFontSize),
+ mFontWidth(Src.mFontWidth),
mDelay(Src.mDelay),
mObjects(NULL)
{