Project

General

Profile

Bug #48 ยป text2skin-1.1-cvs-vdr-1.6.0.diff

gnapheus, 01/01/2009 03:33 PM

View differences:

./text2skin/cache.h 2009-01-01 14:51:59.000000000 +0100
item_map mItems;
usage_list mUsage;
uint mMaxItems;
unsigned int mMaxItems;
protected:
virtual void DeleteObject(const key_type &Key, data_type &Data) = 0;
virtual void ResetObject(data_type &Data) = 0;
public:
cxCache(uint MaxItems);
cxCache(unsigned int MaxItems);
virtual ~cxCache();
void Reset(void);
void Flush(void);
bool Contains(const key_type &Key);
data_type &operator[](const key_type &Key);
uint Count(void) { return mUsage.size(); }
unsigned int Count(void) { return mUsage.size(); }
};
template<class key_type, class data_type>
......
}
template<class key_type, class data_type>
cxCache<key_type, data_type>::cxCache(uint MaxItems)
cxCache<key_type, data_type>::cxCache(unsigned int MaxItems)
{
mMaxItems = MaxItems;
}
./text2skin/font.c 2009-01-01 14:50:55.000000000 +0100
const cFont *res = NULL;
#ifdef HAVE_FREETYPE
char *cachename;
#if VDRVERSNUM >= 10507
asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, I18nCurrentLanguage());
if (mFontCache.Load(Path + "/" + Filename, cachename, Size, I18nCurrentLanguage(), Width))
#else
asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, Setup.OSDLanguage);
if (mFontCache.Load(Path + "/" + Filename, cachename, Size, Setup.OSDLanguage, Width))
#endif
res = mFontCache.GetFont(cachename);
else
esyslog("ERROR: Text2Skin: Couldn't load font %s:%d", Filename.c_str(), Size);
./text2skin/i18n.c 2009-01-01 14:50:55.000000000 +0100
cText2SkinI18n::~cText2SkinI18n() {
for (int i = 0; mPhrases[i][0]; ++i) {
#if VDRVERSNUM >= 10507
for (int j = 0; j < I18nLanguages()->Size(); ++j)
#else
for (int j = 0; j < I18nNumLanguages; ++j)
#endif
free((void*)mPhrases[i][j]);
}
free(mPhrases);
......
memset(&p, 0, sizeof(tI18nPhrase));
Text += 17;
#if VDRVERSNUM >= 10507
for (i = 0; i < I18nLanguages()->Size(); ++i) {
#else
for (i = 0; i < I18nNumLanguages; ++i) {
#endif
char *langs = strdup(I18nLanguageCode(i));
char *ptr = langs, *ep;
std::string text;
......
}
int idx = mNumPhrases++;
#if VDRVERSNUM >= 10507
for (i = 0; i < I18nLanguages()->Size(); ++i)
#else
for (i = 0; i < I18nNumLanguages; ++i)
#endif
if (!p[i]) p[i] = "";
mPhrases = (tI18nPhrase*)realloc(mPhrases, (mNumPhrases + 1) * sizeof(tI18nPhrase));
memcpy(mPhrases[idx], p, sizeof(tI18nPhrase));
......
bool cText2SkinI18n::Load(const std::string &Filename) {
if (cText2SkinFile::Load(Filename)) {
#if VDRVERSNUM <= 10506
I18nRegister(mPhrases, mIdentity.c_str());
#endif
return true;
}
return false;
./text2skin/Makefile 2009-01-01 14:59:45.000000000 +0100
# comment this out if you don't want to use FreeType font rendering
HAVE_FREETYPE=1
# Truetype support is broken with vdr 1.6.?, so disabled in order to compile.
# HAVE_FREETYPE=1
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING
......
LIBDIR = ../../lib
TMPDIR = /tmp
### The version number of VDR (taken from VDR's "config.h"):
### The version number of VDR's plugin API (taken from VDR's "config.h"):
VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
### The name of the distribution archive:
......
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
@cp $@ $(LIBDIR)/$@.$(VDRVERSION)
@cp $@ $(LIBDIR)/$@.$(APIVERSION)
ifndef DEBUG
strip $(LIBDIR)/$@.$(VDRVERSION)
strip $(LIBDIR)/$@.$(APIVERSION)
endif
dist: clean
./text2skin/status.c 2009-01-01 14:50:55.000000000 +0100
void cText2SkinStatus::OsdClear(void)
{
#if VDRVERSNUM >= 10507
if (I18nCurrentLanguage() != mLastLanguage) {
mLastLanguage = I18nCurrentLanguage();
#else
if (Setup.OSDLanguage != mLastLanguage) {
mLastLanguage = Setup.OSDLanguage;
#endif
cxString::Reparse();
}
}
./text2skin/text2skin.c 2009-01-01 14:50:55.000000000 +0100
bool cText2SkinPlugin::Start(void) {
RegisterI18n(Phrases);
#if VDRVERSNUM >= 10507
Text2SkinStatus.SetLanguage(I18nCurrentLanguage());
#else
Text2SkinStatus.SetLanguage(Setup.OSDLanguage);
#endif
cText2SkinLoader::Start();
return true;
}
    (1-1/1)