diff options
-rw-r--r-- | bitmap.c | 14 | ||||
-rw-r--r-- | bitmap.h | 10 | ||||
-rw-r--r-- | cache.h | 14 | ||||
-rw-r--r-- | common.c | 22 | ||||
-rw-r--r-- | common.h | 2 | ||||
-rw-r--r-- | display.c | 96 | ||||
-rw-r--r-- | display.h | 10 | ||||
-rw-r--r-- | file.h | 2 | ||||
-rw-r--r-- | font.h | 2 | ||||
-rw-r--r-- | loader.c | 22 | ||||
-rw-r--r-- | loader.h | 6 | ||||
-rw-r--r-- | render.c | 72 | ||||
-rw-r--r-- | render.h | 16 | ||||
-rw-r--r-- | screen.c | 22 | ||||
-rw-r--r-- | screen.h | 4 | ||||
-rw-r--r-- | scroller.c | 8 | ||||
-rw-r--r-- | scroller.h | 4 | ||||
-rw-r--r-- | status.c | 10 | ||||
-rw-r--r-- | status.h | 4 | ||||
-rw-r--r-- | xml/display.c | 6 | ||||
-rw-r--r-- | xml/display.h | 6 | ||||
-rw-r--r-- | xml/function.c | 22 | ||||
-rw-r--r-- | xml/function.h | 2 | ||||
-rw-r--r-- | xml/object.c | 34 | ||||
-rw-r--r-- | xml/object.h | 4 | ||||
-rw-r--r-- | xml/parser.c | 14 | ||||
-rw-r--r-- | xml/parser.h | 2 | ||||
-rw-r--r-- | xml/skin.c | 8 | ||||
-rw-r--r-- | xml/skin.h | 8 | ||||
-rw-r--r-- | xml/string.c | 40 | ||||
-rw-r--r-- | xml/string.h | 4 | ||||
-rw-r--r-- | xml/xml.c | 8 |
32 files changed, 249 insertions, 249 deletions
@@ -26,7 +26,7 @@ void cBitmapCache::ResetObject(cText2SkinBitmap *&Data) } -cText2SkinBitmap *cText2SkinBitmap::Load(const std::string &Filename, int Alpha, int height, +cText2SkinBitmap *cText2SkinBitmap::Load(const std::string &Filename, int Alpha, int height, int width, int colors, bool Quiet) { tBitmapSpec spec(Filename, Alpha, height, width, colors); Dprintf("checking image with spec %s_%d_%d_%d_%d..", Filename.c_str(),Alpha,height,width,colors); @@ -44,10 +44,10 @@ cText2SkinBitmap *cText2SkinBitmap::Load(const std::string &Filename, int Alpha, fname = gbuf.gl_pathv[0]; } else { if (!Quiet) - esyslog("ERROR: text2skin: No match for wildcard filename %s", + esyslog("ERROR: text2skin: No match for wildcard filename %s", Filename.c_str()); fname = ""; - } + } globfree(&gbuf); } @@ -62,7 +62,7 @@ cText2SkinBitmap *cText2SkinBitmap::Load(const std::string &Filename, int Alpha, } } else if (!Quiet) esyslog("ERROR: text2skin: filename %s too short to identify format", fname.c_str()); - + Dprintf("..load %sok\n", result ? "" : "not "); if (result) res->SetAlpha(Alpha); @@ -73,7 +73,7 @@ cText2SkinBitmap *cText2SkinBitmap::Load(const std::string &Filename, int Alpha, return res; } -bool cText2SkinBitmap::Available(const std::string &Filename, int Alpha, int height, int width, +bool cText2SkinBitmap::Available(const std::string &Filename, int Alpha, int height, int width, int colors) { if ((int)Filename.find('*') != -1) { @@ -240,14 +240,14 @@ bool cText2SkinBitmap::LoadNonXpm(const char *Filename, int height, int width, i for (int x = 0; x < bmp->Width(); ++x) { if ( colors != 0 ){ bmp->DrawPixel(x, y , outputPalette[outputImage[y * bmp->Width() + x]] | 0xFF000000 ); - }else{ + }else{ tColor col = (data[pos + 3] << 24) | (data[pos + 2] << 16) | (data[pos + 1] << 8) | data[pos + 0]; bmp->DrawPixel(x, y, col); pos += 4; } } } - + imlib_free_image(); imlib_context_free(ctx); mBitmaps.push_back(bmp); @@ -21,7 +21,7 @@ struct tBitmapSpec { bool operator==(const tBitmapSpec &Src) const; }; -inline bool tBitmapSpec::operator<(const tBitmapSpec &Src) const +inline bool tBitmapSpec::operator<(const tBitmapSpec &Src) const { if (Filename == Src.Filename) { if (Alpha == Src.Alpha) { @@ -36,7 +36,7 @@ inline bool tBitmapSpec::operator<(const tBitmapSpec &Src) const } return Filename < Src.Filename; } - + inline bool tBitmapSpec::operator==(const tBitmapSpec &Src) const { return Filename == Src.Filename @@ -74,14 +74,14 @@ private: bool LoadNonXpm(const char *Filename, int height, int width, int colors, bool Quiet); public: - static cText2SkinBitmap *Load(const std::string &Filename, int Alpha = 0, int height = 0, + static cText2SkinBitmap *Load(const std::string &Filename, int Alpha = 0, int height = 0, int width = 0, int colors = 0, bool Quiet = false); - static bool Available(const std::string &Filename, int Alpha = 0, int height = 0, + static bool Available(const std::string &Filename, int Alpha = 0, int height = 0, int width = 0, int colors = 0); static void ResetCache(void) { mCache.Reset(); } static void FlushCache(void) { mCache.Flush(); } static void Init(void); - + virtual ~cText2SkinBitmap(); void Reset(void) { mCurrent = 0; mLastGet = 0; } @@ -37,24 +37,24 @@ public: }; template<class key_type, class data_type> -inline bool cxCache<key_type, data_type>::Contains(const key_type &Key) +inline bool cxCache<key_type, data_type>::Contains(const key_type &Key) { return mItems.find(Key) != mItems.end(); } template<class key_type, class data_type> -cxCache<key_type, data_type>::cxCache(uint MaxItems) +cxCache<key_type, data_type>::cxCache(uint MaxItems) { mMaxItems = MaxItems; } template<class key_type, class data_type> -cxCache<key_type, data_type>::~cxCache() +cxCache<key_type, data_type>::~cxCache() { } template<class key_type, class data_type> -void cxCache<key_type, data_type>::Flush(void) +void cxCache<key_type, data_type>::Flush(void) { item_iterator it = mItems.begin(); for (; it != mItems.end(); ++it) @@ -65,7 +65,7 @@ void cxCache<key_type, data_type>::Flush(void) } template<class key_type, class data_type> -void cxCache<key_type, data_type>::Reset(void) +void cxCache<key_type, data_type>::Reset(void) { item_iterator it = mItems.begin(); for (; it != mItems.end(); ++it) @@ -73,7 +73,7 @@ void cxCache<key_type, data_type>::Reset(void) } template<class key_type, class data_type> -data_type &cxCache<key_type, data_type>::operator[](const key_type &Key) +data_type &cxCache<key_type, data_type>::operator[](const key_type &Key) { item_iterator it = mItems.find(Key); if (it != mItems.end()) { @@ -86,7 +86,7 @@ data_type &cxCache<key_type, data_type>::operator[](const key_type &Key) } mUsage.push_back(Key); return it->second; - } + } while (mUsage.size() >= mMaxItems) { item_iterator it = mItems.find(*mUsage.begin()); @@ -9,14 +9,14 @@ #define FRONTEND_DEVICE "/dev/dvb/adapter%d/frontend%d" -const std::string &SkinPath(void) +const std::string &SkinPath(void) { // should never change static std::string path = cPlugin::ConfigDirectory(PLUGIN_NAME_I18N); return path; } -const char *ChannelNumber(const cChannel *Channel, int Number) +const char *ChannelNumber(const cChannel *Channel, int Number) { static char buffer[256]; buffer[0] = '\0'; @@ -29,7 +29,7 @@ const char *ChannelNumber(const cChannel *Channel, int Number) return buffer; } -const char *ChannelName(const cChannel *Channel, int Number) +const char *ChannelName(const cChannel *Channel, int Number) { static char buffer[256]; buffer[0] = '\0'; @@ -40,11 +40,11 @@ const char *ChannelName(const cChannel *Channel, int Number) return buffer; } -const char *ChannelShortName(const cChannel *Channel, int Number) +const char *ChannelShortName(const cChannel *Channel, int Number) { static char buffer[256]; buffer[0] = '\0'; - if (Channel) + if (Channel) snprintf(buffer, sizeof(buffer), "%s", Channel->ShortName(true)); else if (!Number) snprintf(buffer, sizeof(buffer), "%s", trVDR("*** Invalid Channel ***")); @@ -59,7 +59,7 @@ const char *EventType(uint Number) return buffer; } -bool StoppedTimer(const char *Name) +bool StoppedTimer(const char *Name) { cTimer *timer = Timers.First(); while (timer) { @@ -273,7 +273,7 @@ int GetRecordingCuttedLength(const char *FileName, double FramesPerSecond, bool return (int)length > totalLength ? totalLength : (int)length; } -cxType TimeType(time_t Time, const std::string &Format) +cxType TimeType(time_t Time, const std::string &Format) { static char result[1000]; struct tm tm_r, *tm; @@ -282,7 +282,7 @@ cxType TimeType(time_t Time, const std::string &Format) if (Time > 0) { if (Format.length() > 0) { strftime(result, sizeof(result), Format.c_str(), tm); - + cxType r = result; /*if (Format.find("%s") != -1 || Format.find("%S") != -1 || Format.find("%Es") != -1 || Format.find("%ES") != -1 @@ -315,7 +315,7 @@ cxType DurationType(int Seconds, const std::string &Format, int Frame) if (Seconds >= 0) { if (Format.length() > 0) { uint update = 0; - const char *ptr = Format.c_str(); + const char *ptr = Format.c_str(); char *res = result; enum { normal, format } state = normal; int n = 0; @@ -356,7 +356,7 @@ cxType DurationType(int Seconds, const std::string &Format, int Frame) n = snprintf(res, sizeof(result) - (res - result), "%02d", s); update = 1000; break; - + case 'f': if (Frame) n = snprintf(res, sizeof(result) - (res - result), "%02d", Frame); @@ -384,7 +384,7 @@ cxType DurationType(int Seconds, const std::string &Format, int Frame) return false; } -bool ParseVar(const char *Text, const char *Name, std::string &Value) +bool ParseVar(const char *Text, const char *Name, std::string &Value) { const char *ptr1, *ptr2; char *str; @@ -60,7 +60,7 @@ cxType DurationType(int Seconds, const std::string &Format, int Frame = 0); bool ParseVar(const char *Text, const char *Name, std::string &Value); bool ParseVar(const char *Text, const char *Name, tColor *Value); - + void SkipQuotes(std::string &Value); std::string FitToWidth(std::string &Line, uint Width); std::string FitToWidth(std::stringstream &Line, uint Width); @@ -86,7 +86,7 @@ void cText2SkinDisplayChannel::SetMessage(eMessageType Type, const char *Text) } UpdateUnlock(); } - + void cText2SkinDisplayChannel::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { if (mFallbackDisplay != NULL) { @@ -100,7 +100,7 @@ void cText2SkinDisplayChannel::SetButtons(const char *Red, const char *Green, co if (Green == NULL) Green = ""; if (Yellow == NULL) Yellow = ""; if (Blue == NULL) Blue = ""; - if (mButtonRed != Red || mButtonGreen != Green || mButtonYellow != Yellow + if (mButtonRed != Red || mButtonGreen != Green || mButtonYellow != Yellow || mButtonBlue != Blue) { mButtonRed = Red; mButtonGreen = Green; @@ -116,7 +116,7 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token) switch (Token.Type) { case tChannelNumber: return ChannelNumber(mChannel, mNumber); - + case tChannelName: return mChannel != NULL ? (cxType)ChannelName(mChannel, mNumber) @@ -126,7 +126,7 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token) return mChannel != NULL ? (cxType)ChannelShortName(mChannel, mNumber) : (cxType)false; - + case tChannelBouquet: return mChannel != NULL ? (cxType)mChannel->Provider() @@ -173,7 +173,7 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token) : (cxType)false; case tPresentRemaining: - if (mPresent != NULL && time(NULL) - mPresent->StartTime() + if (mPresent != NULL && time(NULL) - mPresent->StartTime() <= mPresent->Duration()) { return (cxType)DurationType(mPresent->Duration() - (time(NULL) - mPresent->StartTime()), Token.Attrib.Text); @@ -204,7 +204,7 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token) return mFollowing != NULL ? (cxType)TimeType(mFollowing->Vps(), Token.Attrib.Text) : (cxType)false; - + case tFollowingEndDateTime: return mFollowing != NULL ? (cxType)TimeType(mFollowing->EndTime(), Token.Attrib.Text) @@ -214,7 +214,7 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token) return mFollowing != NULL ? (cxType)DurationType(mFollowing->Duration(), Token.Attrib.Text) : (cxType)false; - + case tFollowingTitle: return mFollowing != NULL ? (cxType)mFollowing->Title() @@ -298,19 +298,19 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token) case tHasTimer: case tPresentHasTimer: return mPresent != NULL && mPresent->HasTimer(); - + case tIsRunning: case tPresentIsRunning: return mPresent != NULL && mPresent->IsRunning(); case tFollowingHasTimer: return mFollowing != NULL && mFollowing->HasTimer(); - + case tFollowingIsRunning: return mFollowing != NULL && mFollowing->IsRunning(); case tFollowingHasVPS: - return mFollowing != NULL && mFollowing->Vps() != 0 + return mFollowing != NULL && mFollowing->Vps() != 0 && mFollowing->Vps() != mFollowing->StartTime(); case tMessage: @@ -325,12 +325,12 @@ cxType cText2SkinDisplayChannel::GetTokenData(const txToken &Token) return mType == mtWarning ? (cxType)mText : (cxType)false; - + case tMessageStatus: return mType == mtStatus ? (cxType)mText : (cxType)false; - + case tMessageError: return mType == mtError ? (cxType)mText @@ -391,7 +391,7 @@ cxType cText2SkinDisplayVolume::GetTokenData(const txToken &Token) { default: return cText2SkinRender::GetTokenData(Token); } } - + // --- cText2SkinDisplayReplay ------------------------------------------------ cText2SkinDisplayReplay::cText2SkinDisplayReplay(cText2SkinLoader *Loader, bool ModeOnly): @@ -506,7 +506,7 @@ void cText2SkinDisplayReplay::SetMessage(eMessageType Type, const char *Text) } UpdateUnlock(); } - + void cText2SkinDisplayReplay::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { @@ -559,7 +559,7 @@ cxType cText2SkinDisplayReplay::GetTokenData(const txToken &Token) case tIsPlaying: case tReplayIsPlaying: return mStateInfo && mSpeed == -1 && mPlay; - + case tIsPausing: case tReplayIsPausing: return mStateInfo && mSpeed == -1 && !mPlay; @@ -572,7 +572,7 @@ cxType cText2SkinDisplayReplay::GetTokenData(const txToken &Token) : (cxType)true; } return false; - + case tIsFastRewind: case tReplayIsFastRewind: if (mStateInfo && mSpeed != -1 && mPlay && !mForward) { @@ -626,12 +626,12 @@ cxType cText2SkinDisplayReplay::GetTokenData(const txToken &Token) return mType == mtWarning ? (cxType)mText : (cxType)false; - + case tMessageStatus: return mType == mtStatus ? (cxType)mText : (cxType)false; - + case tMessageError: return mType == mtError ? (cxType)mText @@ -658,15 +658,15 @@ cxType cText2SkinDisplayReplay::GetTokenData(const txToken &Token) cText2SkinDisplayMessage::cText2SkinDisplayMessage(cText2SkinLoader *Loader): cText2SkinRender(Loader, cxDisplay::message), - mText("") + mText("") { } -cText2SkinDisplayMessage::~cText2SkinDisplayMessage() +cText2SkinDisplayMessage::~cText2SkinDisplayMessage() { } -void cText2SkinDisplayMessage::SetMessage(eMessageType Type, const char *Text) +void cText2SkinDisplayMessage::SetMessage(eMessageType Type, const char *Text) { UpdateLock(); if (Text == NULL) Text = ""; @@ -678,7 +678,7 @@ void cText2SkinDisplayMessage::SetMessage(eMessageType Type, const char *Text) UpdateUnlock(); } -cxType cText2SkinDisplayMessage::GetTokenData(const txToken &Token) +cxType cText2SkinDisplayMessage::GetTokenData(const txToken &Token) { switch (Token.Type) { case tMessage: @@ -693,12 +693,12 @@ cxType cText2SkinDisplayMessage::GetTokenData(const txToken &Token) return mType == mtWarning ? (cxType)mText : (cxType)false; - + case tMessageStatus: return mType == mtStatus ? (cxType)mText : (cxType)false; - + case tMessageError: return mType == mtError ? (cxType)mText @@ -751,13 +751,13 @@ cText2SkinDisplayMenu::cText2SkinDisplayMenu(cText2SkinLoader *Loader): } } -cText2SkinDisplayMenu::~cText2SkinDisplayMenu() +cText2SkinDisplayMenu::~cText2SkinDisplayMenu() { if (mFallbackDisplay != NULL) delete mFallbackDisplay; } -void cText2SkinDisplayMenu::Clear(void) +void cText2SkinDisplayMenu::Clear(void) { if (mFallbackDisplay != NULL) { printf("fallback clear\n"); @@ -778,7 +778,7 @@ void cText2SkinDisplayMenu::Clear(void) UpdateUnlock(); } -void cText2SkinDisplayMenu::SetTitle(const char *Title) +void cText2SkinDisplayMenu::SetTitle(const char *Title) { if (mFallbackDisplay != NULL) { printf("fallback title\n"); @@ -798,8 +798,8 @@ void cText2SkinDisplayMenu::SetTitle(const char *Title) UpdateUnlock(); } -void cText2SkinDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, - const char *Blue) +void cText2SkinDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, + const char *Blue) { if (mFallbackDisplay != NULL) { mFallbackDisplay->SetButtons(Red, Green, Yellow, Blue); @@ -811,7 +811,7 @@ void cText2SkinDisplayMenu::SetButtons(const char *Red, const char *Green, const if (Green == NULL) Green = ""; if (Yellow == NULL) Yellow = ""; if (Blue == NULL) Blue = ""; - if (mButtonRed != Red || mButtonGreen != Green || mButtonYellow != Yellow + if (mButtonRed != Red || mButtonGreen != Green || mButtonYellow != Yellow || mButtonBlue != Blue) { mButtonRed = Red; mButtonGreen = Green; @@ -822,7 +822,7 @@ void cText2SkinDisplayMenu::SetButtons(const char *Red, const char *Green, const UpdateUnlock(); } -void cText2SkinDisplayMenu::SetMessage(eMessageType Type, const char *Text) +void cText2SkinDisplayMenu::SetMessage(eMessageType Type, const char *Text) { if (mFallbackDisplay != NULL) { printf("fallback message\n"); @@ -840,7 +840,7 @@ void cText2SkinDisplayMenu::SetMessage(eMessageType Type, const char *Text) UpdateUnlock(); } -void cText2SkinDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) +void cText2SkinDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { if (mFallbackDisplay != NULL) { mFallbackDisplay->SetItem(Text, Index, Current, Selectable); @@ -884,7 +884,7 @@ void cText2SkinDisplayMenu::SetItem(const char *Text, int Index, bool Current, b UpdateUnlock(); } -void cText2SkinDisplayMenu::SetEvent(const cEvent *Event) +void cText2SkinDisplayMenu::SetEvent(const cEvent *Event) { if (mFallbackDisplay != NULL) { mFallbackDisplay->SetEvent(Event); @@ -901,7 +901,7 @@ void cText2SkinDisplayMenu::SetEvent(const cEvent *Event) UpdateUnlock(); } -void cText2SkinDisplayMenu::SetRecording(const cRecording *Recording) +void cText2SkinDisplayMenu::SetRecording(const cRecording *Recording) { if (mFallbackDisplay != NULL) { mFallbackDisplay->SetRecording(Recording); @@ -919,7 +919,7 @@ void cText2SkinDisplayMenu::SetRecording(const cRecording *Recording) UpdateUnlock(); } -void cText2SkinDisplayMenu::SetText(const char *Text, bool FixedFont) +void cText2SkinDisplayMenu::SetText(const char *Text, bool FixedFont) { if (mFallbackDisplay != NULL) { mFallbackDisplay->SetText(Text, FixedFont); @@ -935,7 +935,7 @@ void cText2SkinDisplayMenu::SetText(const char *Text, bool FixedFont) UpdateUnlock(); } -void cText2SkinDisplayMenu::SetTabs(int Tab1, int Tab2, int Tab3, int Tab4, int Tab5) +void cText2SkinDisplayMenu::SetTabs(int Tab1, int Tab2, int Tab3, int Tab4, int Tab5) { if (mFallbackDisplay != NULL) { mFallbackDisplay->SetTabs(Tab1, Tab2, Tab3, Tab4, Tab5); @@ -947,7 +947,7 @@ void cText2SkinDisplayMenu::SetTabs(int Tab1, int Tab2, int Tab3, int Tab4, int UpdateUnlock(); } -void cText2SkinDisplayMenu::Scroll(bool Up, bool Page) +void cText2SkinDisplayMenu::Scroll(bool Up, bool Page) { if (mFallbackDisplay != NULL) { mFallbackDisplay->Scroll(Up, Page); @@ -960,7 +960,7 @@ void cText2SkinDisplayMenu::Scroll(bool Up, bool Page) UpdateUnlock(); } -cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) +cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) { switch (Token.Type) { case tMenuItem: @@ -994,7 +994,7 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) case tIsMenuItem: return mItems.size() > (uint)Token.Index && mItems[Token.Index].sel && mCurrentItem != (uint)Token.Index; - + case tMenuCurrent: if (mItems.size() <= mCurrentItem) return false; @@ -1060,17 +1060,17 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) return mMessageType == mtWarning ? (cxType)mMessageText : (cxType)false; - + case tMessageStatus: return mMessageType == mtStatus ? (cxType)mMessageText : (cxType)false; - + case tMessageError: return mMessageType == mtError ? (cxType)mMessageText : (cxType)false; - + case tPresentStartDateTime: return mEvent != NULL ? (cxType)TimeType(mEvent->StartTime(), Token.Attrib.Text) @@ -1194,7 +1194,7 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) return mEvent != NULL ? (cxType)EventType(mEvent->EventID()) : (cxType)false; - + case tHasVPS: case tChannelHasVPS: return mEvent != NULL && mEvent->Vps() != 0; @@ -1237,7 +1237,7 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) case tHasTimer: case tPresentHasTimer: return mEvent != NULL && mEvent->HasTimer(); - + case tIsRunning: case tPresentIsRunning: return mEvent != NULL && mEvent->IsRunning(); @@ -1288,7 +1288,7 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) } else return (cxType)false; - case tRecordingLanguageCode: + case tRecordingLanguageCode: if (mRecording) { const cComponents *components = mRecording->Info()->Components(); if (components) { @@ -1313,8 +1313,8 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) } } return false; - - case tRecordingLanguageDescription: + + case tRecordingLanguageDescription: if (mRecording) { const cComponents *components = mRecording->Info()->Components(); if (components) { @@ -1478,7 +1478,7 @@ cxType cText2SkinDisplayTracks::GetTokenData(const txToken &Token) case tAudioChannel: return ChannelName(mAudioChannel); - + default: return cText2SkinRender::GetTokenData(Token); } @@ -102,7 +102,7 @@ public: virtual void SetTotal(const char *Total); virtual void SetJump(const char *Jump); virtual void SetMessage(eMessageType Type, const char *Text); - virtual void SetButtons(const char *Red, const char *Green, const char *Yellow, + virtual void SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue); virtual void Flush(void) { cText2SkinRender::Flush(); } @@ -192,13 +192,13 @@ public: inline bool cText2SkinDisplayMenu::HasTabText(int Index, int n) { if (Index < 0 || mItems.size () > (uint)Index) - return n == -1 + return n == -1 ? mItems[Index].text.length() > 0 : mItems[Index].tabs[n].length() > 0; return false; } -inline void cText2SkinDisplayMenu::Flush(void) +inline void cText2SkinDisplayMenu::Flush(void) { if (mFallbackDisplay != NULL) mFallbackDisplay->Flush(); @@ -218,7 +218,7 @@ private: tListItems mItems; uint mCurrentItem; int mAudioChannel; - + protected: virtual cxType GetTokenData(const txToken &Token); virtual bool HasTabText(int Index, int n); @@ -227,7 +227,7 @@ protected: public: static const std::string &ChannelName(int AudioChannel); - cText2SkinDisplayTracks(cText2SkinLoader *Loader, const char *Title, int NumTracks, + cText2SkinDisplayTracks(cText2SkinLoader *Loader, const char *Title, int NumTracks, const char * const *Tracks); virtual ~cText2SkinDisplayTracks(); @@ -18,7 +18,7 @@ public: virtual ~cText2SkinFile(); virtual bool Load(const std::string &Filename); - + const std::string &Skin(void) const { return mSkin; } }; @@ -16,7 +16,7 @@ class cText2SkinFontCache { private: typedef map<string,cFont*> cache_map; - + public: cText2SkinFontCache(); ~cText2SkinFontCache(); @@ -20,7 +20,7 @@ void cText2SkinLoader::Start(void) { struct stat buf; if (strcmp(result->d_name, ".") == 0 || strcmp(result->d_name, "..") == 0) continue; - if (stat((SkinPath() + "/" + result->d_name).c_str(), &buf) == 0 + if (stat((SkinPath() + "/" + result->d_name).c_str(), &buf) == 0 && S_ISDIR(buf.st_mode)) Load(result->d_name); } @@ -33,7 +33,7 @@ void cText2SkinLoader::Load(const char *Skin) { cText2SkinTheme *theme = new cText2SkinTheme(Skin); std::string themefile = SkinPath() + "/" + Skin + "/" + Skin + ".colors"; theme->Load(themefile); - + std::string skinfile = SkinPath() + "/" + Skin + "/" + Skin + ".skin"; if (access(skinfile.c_str(), F_OK) == 0) { isyslog("parsing %s", skinfile.c_str()); @@ -53,8 +53,8 @@ void cText2SkinLoader::Load(const char *Skin) { } } -cText2SkinLoader::cText2SkinLoader(cxSkin *Data, cText2SkinI18n *I18n, cText2SkinTheme *Theme, - const std::string &Skin, const std::string &Description): +cText2SkinLoader::cText2SkinLoader(cxSkin *Data, cText2SkinI18n *I18n, cText2SkinTheme *Theme, + const std::string &Skin, const std::string &Description): cSkin(Skin.c_str(), Theme->Theme()), mData(Data), mI18n(I18n), @@ -63,39 +63,39 @@ cText2SkinLoader::cText2SkinLoader(cxSkin *Data, cText2SkinI18n *I18n, cText2Ski { } -cText2SkinLoader::~cText2SkinLoader() +cText2SkinLoader::~cText2SkinLoader() { delete mData; delete mI18n; delete mTheme; } -cSkinDisplayChannel *cText2SkinLoader::DisplayChannel(bool WithInfo) +cSkinDisplayChannel *cText2SkinLoader::DisplayChannel(bool WithInfo) { return new cText2SkinDisplayChannel(this, WithInfo); } -cSkinDisplayMenu *cText2SkinLoader::DisplayMenu(void) +cSkinDisplayMenu *cText2SkinLoader::DisplayMenu(void) { return new cText2SkinDisplayMenu(this); } -cSkinDisplayVolume *cText2SkinLoader::DisplayVolume(void) +cSkinDisplayVolume *cText2SkinLoader::DisplayVolume(void) { return new cText2SkinDisplayVolume(this); } -cSkinDisplayReplay *cText2SkinLoader::DisplayReplay(bool ModeOnly) +cSkinDisplayReplay *cText2SkinLoader::DisplayReplay(bool ModeOnly) { return new cText2SkinDisplayReplay(this, ModeOnly); } -cSkinDisplayMessage *cText2SkinLoader::DisplayMessage(void) +cSkinDisplayMessage *cText2SkinLoader::DisplayMessage(void) { return new cText2SkinDisplayMessage(this); } -cSkinDisplayTracks *cText2SkinLoader::DisplayTracks(const char *Title, int NumTracks, +cSkinDisplayTracks *cText2SkinLoader::DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks) { return new cText2SkinDisplayTracks(this, Title, NumTracks, Tracks); @@ -21,16 +21,16 @@ public: static void Start(void); static void Load(const char *Skin); - cText2SkinLoader(cxSkin *Data, cText2SkinI18n *I18n, cText2SkinTheme *Theme, + cText2SkinLoader(cxSkin *Data, cText2SkinI18n *I18n, cText2SkinTheme *Theme, const std::string &Skin, const std::string &Description); ~cText2SkinLoader(); - + virtual const char *Description(void) { return mDescription.c_str(); } virtual cSkinDisplayChannel *DisplayChannel(bool WithInfo); virtual cSkinDisplayMenu *DisplayMenu(void); virtual cSkinDisplayReplay *DisplayReplay(bool ModeOnly); virtual cSkinDisplayVolume *DisplayVolume(void); - virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, + virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks); virtual cSkinDisplayMessage *DisplayMessage(void); @@ -18,7 +18,7 @@ cText2SkinRender *cText2SkinRender::mRender = NULL; -cText2SkinRender::cText2SkinRender(cText2SkinLoader *Loader, cxDisplay::eType Display, +cText2SkinRender::cText2SkinRender(cText2SkinLoader *Loader, cxDisplay::eType Display, const std::string &BasePath, bool OffScreen): mSkin(Loader->Data()), mDisplay(mSkin->Get(Display)), @@ -73,7 +73,7 @@ cText2SkinRender::cText2SkinRender(cText2SkinLoader *Loader, cxDisplay::eType Di areas[i].x2 = mSkin->BaseOffset().x + pos2.x; areas[i].y2 = mSkin->BaseOffset().y + pos2.y; areas[i].bpp = mDisplay->Windows()[i].bpp; - Dprintf("setting area: %d, %d, %d, %d, %d\n", areas[i].x1, areas[i].y1, areas[i].x2, + Dprintf("setting area: %d, %d, %d, %d, %d\n", areas[i].x1, areas[i].y1, areas[i].x2, areas[i].y2, areas[i].bpp); } res = mScreen->SetAreas(areas, mDisplay->NumWindows()); @@ -112,7 +112,7 @@ cText2SkinRender::cText2SkinRender(cText2SkinLoader *Loader, cxDisplay::eType Di } } -cText2SkinRender::~cText2SkinRender() +cText2SkinRender::~cText2SkinRender() { if (mActive) { mActive = false; @@ -126,7 +126,7 @@ cText2SkinRender::~cText2SkinRender() mRender = NULL; } -void cText2SkinRender::Action(void) +void cText2SkinRender::Action(void) { bool to = true; uint start_time = cTimeMs::Now(); @@ -156,7 +156,7 @@ void cText2SkinRender::Action(void) UpdateUnlock(); } -void cText2SkinRender::Update(void) +void cText2SkinRender::Update(void) { Dbench(update); #ifdef BENCH @@ -245,7 +245,7 @@ void cText2SkinRender::DrawObject(cxObject *Object, case cxObject::ellipse: DrawEllipse(pos, size, Object->Fg(), Object->Arc()); break; - + case cxObject::slope: DrawSlope(pos, size, Object->Fg(), Object->Arc()); break; @@ -446,14 +446,14 @@ void cText2SkinRender::DrawItemText(cxObject *Object, int i, const txPoint &List } } -void cText2SkinRender::DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, - const tColor *Fg, const tColor *Mask, int Alpha, int Colors, +void cText2SkinRender::DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, + const tColor *Fg, const tColor *Mask, int Alpha, int Colors, const std::string &Path) { cText2SkinBitmap *bmp; //Dprintf("trying to draw image %s to %dx%d - alpha %d\n", ImagePath(Path).c_str(), Pos.x, Pos.y, Alpha); - if ((bmp = cText2SkinBitmap::Load(ImagePath(Path), Alpha, Size.h > 1 ? Size.h : 0, + if ((bmp = cText2SkinBitmap::Load(ImagePath(Path), Alpha, Size.h > 1 ? Size.h : 0, Size.w > 1 ? Size.w : 0, Colors)) != NULL) { //Dprintf("success loading image\n"); if (Bg) bmp->SetColor(0, *Bg); @@ -465,7 +465,7 @@ void cText2SkinRender::DrawImage(const txPoint &Pos, const txSize &Size, const t void cText2SkinRender::DrawText(const txPoint &Pos, const txSize &Size, const tColor *Fg, const tColor *Bg, 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, + //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); if (Bg) mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, *Bg); @@ -524,7 +524,7 @@ void cText2SkinRender::DrawMarquee(const txPoint &Pos, const txSize &Size, const if (mUpdateIn == 0 || updatein < mUpdateIn) mUpdateIn = updatein; } - //Dprintf("drawMarquee text = %s, state.text = %s, offset = %d, index = %d, scrolling = %d, mUpdatteIn = %d, nexttime = %d, delay = %d\n", + //Dprintf("drawMarquee text = %s, state.text = %s, offset = %d, index = %d, scrolling = %d, mUpdatteIn = %d, nexttime = %d, delay = %d\n", // Text.c_str(), state.text.c_str(), state.offset, Index, scrolling, mUpdateIn, state.nexttime, Delay); if (Bg) @@ -559,17 +559,17 @@ void cText2SkinRender::DrawBlink(const txPoint &Pos, const txSize &Size, const t mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, *Bg); if (col) - mScreen->DrawText(Pos.x, Pos.y, Text.c_str(), *col, clrTransparent, Font, Size.w, Size.h, + mScreen->DrawText(Pos.x, Pos.y, Text.c_str(), *col, clrTransparent, Font, Size.w, Size.h, Align); } -void cText2SkinRender::DrawRectangle(const txPoint &Pos, const txSize &Size, const tColor *Fg) +void cText2SkinRender::DrawRectangle(const txPoint &Pos, const txSize &Size, const tColor *Fg) { mScreen->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, Fg ? *Fg : 0); } -void cText2SkinRender::DrawEllipse(const txPoint &Pos, const txSize &Size, const tColor *Fg, - int Arc) +void cText2SkinRender::DrawEllipse(const txPoint &Pos, const txSize &Size, const tColor *Fg, + int Arc) { mScreen->DrawEllipse(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, Fg ? *Fg : 0, Arc); } @@ -578,12 +578,12 @@ void cText2SkinRender::DrawSlope(const txPoint &Pos, const txSize &Size, const t mScreen->DrawSlope(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, Fg ? *Fg : 0, Arc); } -void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, int Current, - int Total, const tColor *Bg, const tColor *Fg, - const tColor *Selected, const tColor *Mark, - const tColor *Cur, const cMarks *Marks) +void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, int Current, + int Total, const tColor *Bg, const tColor *Fg, + const tColor *Selected, const tColor *Mark, + const tColor *Cur, const cMarks *Marks) { - //Dprintf("trying to draw Progressbar, Current = %d, Total = %d, bg = %x, marks = %p\n", + //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); @@ -600,8 +600,8 @@ void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, i txPoint pt(Pos.x + m->position * Size.w / Total, Pos.y); if (Selected && start) { const cMark *m2 = Marks->Next(m); - DrawRectangle(txPoint(pt.x, Pos.y + Size.h / 3), - txSize(((m2 ? m2->position : Total) - m->position) + DrawRectangle(txPoint(pt.x, Pos.y + Size.h / 3), + txSize(((m2 ? m2->position : Total) - m->position) * Size.w / Total + 1, Size.h - Size.h * 2 / 3 + 1), Selected); } DrawMark(pt, Size, start, m->position == Current, false, Mark, Cur); @@ -610,14 +610,14 @@ void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, i } } else { DrawRectangle(Pos, txSize(Size.w, Size.h * Current / Total), Fg); - + if (Marks) { bool start = true; for (const cMark *m = Marks->First(); m; m = Marks->Next(m)) { txPoint pt(Pos.x, Pos.y + m->position * Size.h / Total); if (Selected && start) { const cMark *m2 = Marks->Next(m); - DrawRectangle(txPoint(Pos.x + Size.w / 3, pt.y), + DrawRectangle(txPoint(Pos.x + Size.w / 3, pt.y), txSize(Size.w - Size.w * 2 / 3 + 1, ((m2 ? m2->position : Total) - m->position) * Size.h / Total + 1), Selected); @@ -629,7 +629,7 @@ void cText2SkinRender::DrawProgressbar(const txPoint &Pos, const txSize &Size, i } } -void cText2SkinRender::DrawMark(const txPoint &Pos, const txSize &Size, bool Start, bool Current, +void cText2SkinRender::DrawMark(const txPoint &Pos, const txSize &Size, bool Start, bool Current, bool Horizontal, const tColor *Mark, const tColor *Cur) { txPoint p1 = Pos; @@ -656,19 +656,19 @@ void cText2SkinRender::DrawMark(const txPoint &Pos, const txSize &Size, bool Sta } } -void cText2SkinRender::DrawScrolltext(const txPoint &Pos, const txSize &Size, const tColor *Fg, +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()); if (mScroller == NULL) - mScroller = new cText2SkinScroller(mScreen, Pos.x, Pos.y, Size.w, Size.h, Text.c_str(), + mScroller = new cText2SkinScroller(mScreen, Pos.x, Pos.y, Size.w, Size.h, Text.c_str(), Font, Fg ? *Fg : 0, clrTransparent); else mScroller->DrawText(); } - -void cText2SkinRender::DrawScrollbar(const txPoint &Pos, const txSize &Size, const tColor *Bg, - const tColor *Fg) + +void cText2SkinRender::DrawScrollbar(const txPoint &Pos, const txSize &Size, const tColor *Bg, + const tColor *Fg) { if (mScroller != NULL) { int total = mScroller->Total(); @@ -711,13 +711,13 @@ void cText2SkinRender::DrawScrollbar(const txPoint &Pos, const txSize &Size, con } } -txPoint cText2SkinRender::Transform(const txPoint &Pos) +txPoint cText2SkinRender::Transform(const txPoint &Pos) { txSize base = mRender->mBaseSize; return txPoint(Pos.x < 0 ? base.w + Pos.x : Pos.x, Pos.y < 0 ? base.h + Pos.y : Pos.y); } -bool cText2SkinRender::ItemColor(const std::string &Color, tColor &Result) +bool cText2SkinRender::ItemColor(const std::string &Color, tColor &Result) { if (Color != "" && Color != "None") { if (Color[0] == '#') @@ -729,7 +729,7 @@ bool cText2SkinRender::ItemColor(const std::string &Color, tColor &Result) return true; } -std::string cText2SkinRender::ImagePath(const std::string &Filename) +std::string cText2SkinRender::ImagePath(const std::string &Filename) { if (mRender) return (*Filename.data() == '/') @@ -738,7 +738,7 @@ std::string cText2SkinRender::ImagePath(const std::string &Filename) return ""; } -cxType cText2SkinRender::GetToken(const txToken &Token) +cxType cText2SkinRender::GetToken(const txToken &Token) { if (mRender != NULL) { tTokenCache::iterator it = mRender->mTokenCache.find(Token); @@ -750,7 +750,7 @@ cxType cText2SkinRender::GetToken(const txToken &Token) std::string str = res.String(); if (Token.Type == tMenuCurrent) { - const char *ptr = str.c_str(); + const char *ptr = str.c_str(); char *end; int n = strtoul(ptr, &end, 10); if (n != 0) @@ -807,7 +807,7 @@ cxType cText2SkinRender::GetToken(const txToken &Token) return false; } -cxType cText2SkinRender::GetTokenData(const txToken &Token) +cxType cText2SkinRender::GetTokenData(const txToken &Token) { #define MB_PER_MINUTE 25.75 // this is just an estimate! switch (Token.Type) { @@ -50,10 +50,10 @@ private: std::vector<int> mDirtyItems; uint mMaxItems; cSkin *mFallback; - + // update thread bool mActive; - + cCondVar mDoUpdate; cMutex mDoUpdateMutex; cCondVar mStarted; @@ -80,9 +80,9 @@ protected: int ListItem = -1, bool ForceUpdate = false); void DrawItemText(cxObject *o, int i, const txPoint &ListOffset, const txSize &ListSize); - void DrawBackground(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, + void DrawBackground(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, int Alpha, const std::string &Path); - void DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, + void DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, const tColor *Mask, int Alpha, int Colors, const std::string &Path); void DrawText(const txPoint &Pos, const txSize &Size, const tColor *Fg, const tColor *Bg, const std::string &Text, const cFont *Font, int Align); @@ -94,8 +94,8 @@ protected: void DrawRectangle(const txPoint &Pos, const txSize &Size, const tColor *Fg); void DrawEllipse(const txPoint &Pos, const txSize &Size, const tColor *Fg, int Arc); void DrawSlope(const txPoint &Pos, const txSize &Size, const tColor *Fg, int Arc); - void DrawProgressbar(const txPoint &Pos, const txSize &Size, int Current, int Total, - const tColor *Bg, const tColor *Fg, const tColor *Selected, + void DrawProgressbar(const txPoint &Pos, const txSize &Size, int Current, int Total, + const tColor *Bg, const tColor *Fg, const tColor *Selected, const tColor *Mark, const tColor *Cur, const cMarks *Marks = NULL); void DrawMark(const txPoint &Pos, const txSize &Size, bool Start, bool Current, bool Horizontal, const tColor *Mark, const tColor *Cur); @@ -124,7 +124,7 @@ protected: cSkin *Fallback(void) const { return mFallback; } public: - cText2SkinRender(cText2SkinLoader *Loader, cxDisplay::eType Section, + cText2SkinRender(cText2SkinLoader *Loader, cxDisplay::eType Section, const std::string &BasePath = "", bool OffScreen = false); virtual ~cText2SkinRender(); @@ -163,7 +163,7 @@ public: } mUpdate; }; -inline void cText2SkinRender::Flush(bool Force) +inline void cText2SkinRender::Flush(bool Force) { if (Force) // do a full redraw @@ -9,13 +9,13 @@ cText2SkinScreen::cText2SkinScreen(bool OffScreen): { } -cText2SkinScreen::~cText2SkinScreen() +cText2SkinScreen::~cText2SkinScreen() { delete mScreen; delete mOsd; -} +} -eOsdError cText2SkinScreen::SetAreas(const tArea *Areas, int NumAreas) +eOsdError cText2SkinScreen::SetAreas(const tArea *Areas, int NumAreas) { if (!mOffScreen) { eOsdError result = mOsd->CanHandleAreas(Areas, NumAreas); @@ -35,7 +35,7 @@ eOsdError cText2SkinScreen::SetAreas(const tArea *Areas, int NumAreas) return oeOk; } -void cText2SkinScreen::Clear(void) +void cText2SkinScreen::Clear(void) { for (int i = 0; i < mNumRegions; ++i) { #ifndef DIRECTBLIT @@ -67,7 +67,7 @@ void cText2SkinScreen::DrawBitmap(int x, int y, const cBitmap &Bitmap, const tCo #endif } -void cText2SkinScreen::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color) +void cText2SkinScreen::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color) { #ifndef DIRECTBLIT for (int i = 0; i < mNumRegions; ++i) @@ -77,8 +77,8 @@ void cText2SkinScreen::DrawRectangle(int x1, int y1, int x2, int y2, tColor Colo #endif } -void cText2SkinScreen::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, - const cFont *Font, int Width, int Height, int Alignment) +void cText2SkinScreen::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, + const cFont *Font, int Width, int Height, int Alignment) { #ifndef DIRECTBLIT for (int i = 0; i < mNumRegions; ++i) @@ -88,7 +88,7 @@ void cText2SkinScreen::DrawText(int x, int y, const char *s, tColor ColorFg, tCo #endif } -void cText2SkinScreen::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants) +void cText2SkinScreen::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants) { #ifndef DIRECTBLIT for (int i = 0; i < mNumRegions; ++i) @@ -98,7 +98,7 @@ void cText2SkinScreen::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, #endif } -void cText2SkinScreen::DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type) +void cText2SkinScreen::DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type) { #ifndef DIRECTBLIT for (int i = 0; i < mNumRegions; ++i) @@ -108,7 +108,7 @@ void cText2SkinScreen::DrawSlope(int x1, int y1, int x2, int y2, tColor Color, i #endif } -void cText2SkinScreen::Flush(void) +void cText2SkinScreen::Flush(void) { for (int i = 0; i < mNumRegions; ++i) { if (mOffScreen) @@ -130,7 +130,7 @@ void cText2SkinScreen::Flush(void) mOsd->Flush(); } -void cText2SkinScreen::DrawBitmapOverlay(cBitmap &Dest, int x, int y, cBitmap &Bitmap, +void cText2SkinScreen::DrawBitmapOverlay(cBitmap &Dest, int x, int y, cBitmap &Bitmap, const tColor *ColorMask) { const tIndex *bitmap = Dest.Data(0, 0); @@ -21,7 +21,7 @@ private: int mNumRegions; protected: - static void DrawBitmapOverlay(cBitmap &Dest, int x, int y, cBitmap &Bitmap, + static void DrawBitmapOverlay(cBitmap &Dest, int x, int y, cBitmap &Bitmap, const tColor *ColorMask = NULL); public: @@ -33,7 +33,7 @@ public: void Clear(void); void DrawBitmap(int x, int y, const cBitmap &Bitmap, const tColor *ColorMask = NULL); void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color); - void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, + void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width = 0, int Height = 0, int Alignment = taDefault); void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0); void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type); @@ -4,9 +4,9 @@ #include "screen.h" #include <vdr/tools.h> -cText2SkinScroller::cText2SkinScroller(cText2SkinScreen *Screen, int Left, int Top, int Width, - int Height, const char *Text, const cFont *Font, - tColor ColorFg, tColor ColorBg) +cText2SkinScroller::cText2SkinScroller(cText2SkinScreen *Screen, int Left, int Top, int Width, + int Height, const char *Text, const cFont *Font, + tColor ColorFg, tColor ColorBg) { Set(Screen, Left, Top, Width, Height, Text, Font, ColorFg, ColorBg); } @@ -25,7 +25,7 @@ void cText2SkinScroller::Set(cText2SkinScreen *Screen, int Left, int Top, int Wi // sets mHeight to the actually used mHeight, which may be less than Height mWrapper.Set(Text, Font, Width); mShown = min(Total(), mHeight / mFont->Height()); - mHeight = mShown * mFont->Height(); + mHeight = mShown * mFont->Height(); DrawText(); } @@ -23,10 +23,10 @@ private: cTextWrapper mWrapper; public: - cText2SkinScroller(cText2SkinScreen *Screen, int Left, int Top, int Width, int Height, + cText2SkinScroller(cText2SkinScreen *Screen, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg); - void Set(cText2SkinScreen *Screen, int Left, int Top, int Width, int Height, const char *Text, + void Set(cText2SkinScreen *Screen, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg); void DrawText(void); void Reset(void); @@ -12,7 +12,7 @@ const std::string ReplayNames[__REPLAY_COUNT__] = cText2SkinStatus Text2SkinStatus; -cText2SkinStatus::cText2SkinStatus(void): +cText2SkinStatus::cText2SkinStatus(void): mRender(NULL), mReplayMode(replayNone), mReplayIsLoop(false), @@ -33,7 +33,7 @@ void cText2SkinStatus::SetRender(cText2SkinRender *Render) } void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name, - const char *FileName, bool On) + const char *FileName, bool On) { Dprintf("cText2SkinStatus::Replaying(%s)\n", Name); eReplayMode oldMode = mReplayMode; @@ -101,7 +101,7 @@ void cText2SkinStatus::Replaying(const cControl* /*Control*/, const char *Name, } void cText2SkinStatus::Recording(const cDevice *Device, const char *Name, - const char *FileName, bool On) + const char *FileName, bool On) { if (mRender != NULL) mRender->UpdateLock(); @@ -122,7 +122,7 @@ void cText2SkinStatus::Recording(const cDevice *Device, const char *Name, } } -void cText2SkinStatus::OsdClear(void) +void cText2SkinStatus::OsdClear(void) { if (I18nCurrentLanguage() != mLastLanguage) { mLastLanguage = I18nCurrentLanguage(); @@ -407,7 +407,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) mCurrentRecording = (mCurrentRecording + 1) % mRecordings.size(); mNextRecording = now + 2000; } - + uint next = 0; if (mRecordings.size() > 1) { next = mNextRecording - now; @@ -73,9 +73,9 @@ private: double mReplayFramesPerSecond; protected: - virtual void Replaying(const cControl *Control, const char *Name, + virtual void Replaying(const cControl *Control, const char *Name, const char *FileName, bool On); - virtual void Recording(const cDevice *Device, const char *Name, + virtual void Recording(const cDevice *Device, const char *Name, const char *FileName, bool On); virtual void OsdClear(void); diff --git a/xml/display.c b/xml/display.c index ae4ffa4..9023a9f 100644 --- a/xml/display.c +++ b/xml/display.c @@ -2,8 +2,8 @@ #include "xml/display.h" -static const std::string DisplayNames[] = - { "channelInfo", "channelSmall", "volume", "audioTracks", "message", "replayInfo", +static const std::string DisplayNames[] = + { "channelInfo", "channelSmall", "volume", "audioTracks", "message", "replayInfo", "replaySmall", "menu" }; cxDisplay::cxDisplay(cxSkin *parent): @@ -14,7 +14,7 @@ cxDisplay::cxDisplay(cxSkin *parent): { } -bool cxDisplay::ParseType(const std::string &Text) +bool cxDisplay::ParseType(const std::string &Text) { for (int i = 0; i < (int)__COUNT_DISPLAY__; ++i) { if (DisplayNames[i].length() > 0 && DisplayNames[i] == Text) { diff --git a/xml/display.h b/xml/display.h index 6316adc..796518f 100644 --- a/xml/display.h +++ b/xml/display.h @@ -1,7 +1,7 @@ // -*- c++ -*- -#ifndef VDR_TEXT2SKIN_DISPLAY_H -#define VDR_TEXT2SKIN_DISPLAY_H +#ifndef VDR_TEXT2SKIN_DISPLAY_H +#define VDR_TEXT2SKIN_DISPLAY_H #include "xml/object.h" #include <string> @@ -56,4 +56,4 @@ public: ~cxDisplays(); }; -#endif // VDR_TEXT2SKIN_DISPLAY_H +#endif // VDR_TEXT2SKIN_DISPLAY_H diff --git a/xml/function.c b/xml/function.c index 62c097f..9ee07fc 100644 --- a/xml/function.c +++ b/xml/function.c @@ -17,7 +17,7 @@ cxFunction::cxFunction(cxObject *Parent): mType(string), mString(mObject, false), mNumber(0), - mNumParams(0) + mNumParams(0) { } @@ -49,7 +49,7 @@ cxFunction::~cxFunction() delete mParams[i]; } -bool cxFunction::Parse(const std::string &Text) +bool cxFunction::Parse(const std::string &Text) { const char *text = Text.c_str(); const char *ptr = text, *last = text; @@ -58,7 +58,7 @@ bool cxFunction::Parse(const std::string &Text) if (*ptr == '\'' || *ptr == '{') { // must be string - if (strlen(ptr) < 2 + if (strlen(ptr) < 2 || (*ptr == '\'' && *(ptr + strlen(ptr) - 1) != '\'') || (*ptr == '{' && *(ptr + strlen(ptr) - 1) != '}')) { esyslog("ERROR: Unmatched string end\n"); @@ -100,7 +100,7 @@ bool cxFunction::Parse(const std::string &Text) if (inExpr++ == 0) { int i; for (i = 0; Internals[i] != NULL; ++i) { - if ((size_t)(ptr - last) == strlen(Internals[i]) + if ((size_t)(ptr - last) == strlen(Internals[i]) && memcmp(last, Internals[i], ptr - last) == 0){ type = (eType)(INTERNAL + 1 + i); break; @@ -143,11 +143,11 @@ bool cxFunction::Parse(const std::string &Text) int params = 0; switch (mType) { - case fun_and: + case fun_and: case fun_or: params = -1; break; - case fun_eq: - case fun_ne: + case fun_eq: + case fun_ne: case fun_gt: case fun_lt: case fun_ge: @@ -160,7 +160,7 @@ bool cxFunction::Parse(const std::string &Text) } if (params != -1 && mNumParams != (uint)params) { - esyslog("ERROR: Text2Skin: Wrong number of parameters to %s, " + esyslog("ERROR: Text2Skin: Wrong number of parameters to %s, " "expecting %d", Internals[mType - 1 - INTERNAL], params); return false; } @@ -176,7 +176,7 @@ bool cxFunction::Parse(const std::string &Text) return false; } } - + return true; } @@ -184,7 +184,7 @@ cxType cxFunction::FunFile(const cxType &Param) const { std::string path = cText2SkinRender::ImagePath(Param); //Dprintf("checking file(%s) in cache\n", path.c_str()); - return cText2SkinBitmap::Available(path, mObject->Alpha(), + return cText2SkinBitmap::Available(path, mObject->Alpha(), mObject->Size().h > 1 ? mObject->Size().h : 0, mObject->Size().w > 1 ? mObject->Size().w : 0, mObject->Colors()) @@ -254,7 +254,7 @@ cxType cxFunction::Evaluate(void) const case fun_trans: return mSkin->Translate(mParams[0]->Evaluate()); - + case fun_plugin: return FunPlugin(mParams[0]->Evaluate()); diff --git a/xml/function.h b/xml/function.h index 889b1e0..d50ddad 100644 --- a/xml/function.h +++ b/xml/function.h @@ -45,7 +45,7 @@ private: int mNumber; cxFunction *mParams[MAXPARAMETERS]; uint mNumParams; - + protected: cxType FunFile (const cxType &Param) const; cxType FunPlugin(const cxType &Param) const; diff --git a/xml/object.c b/xml/object.c index 02fc3fc..8b3d5d2 100644 --- a/xml/object.c +++ b/xml/object.c @@ -5,7 +5,7 @@ #include "font.h" static const std::string ObjectNames[] = - { "image", "text", "marquee", "blink", "rectangle", "ellipse", "slope", "progress", + { "image", "text", "marquee", "blink", "rectangle", "ellipse", "slope", "progress", "scrolltext", "scrollbar", "block", "list", "item" }; cxObject::cxObject(cxDisplay *Parent): @@ -72,13 +72,13 @@ cxObject::cxObject(const cxObject &Src): mObjects = new cxObjects(*Src.mObjects); } -cxObject::~cxObject() +cxObject::~cxObject() { delete mCondition; delete mObjects; } -bool cxObject::ParseType(const std::string &Text) +bool cxObject::ParseType(const std::string &Text) { for (int i = 0; i < (int)__COUNT_OBJECT__; ++i) { if (ObjectNames[i] == Text) { @@ -89,7 +89,7 @@ bool cxObject::ParseType(const std::string &Text) return false; } -bool cxObject::ParseCondition(const std::string &Text) +bool cxObject::ParseCondition(const std::string &Text) { cxFunction *result = new cxFunction(this); if (result->Parse(Text)) { @@ -100,28 +100,28 @@ bool cxObject::ParseCondition(const std::string &Text) return false; } -bool cxObject::ParseAlignment(const std::string &Text) +bool cxObject::ParseAlignment(const std::string &Text) { if (Text == "center") mAlign = (eTextAlignment)(taTop | taCenter); else if (Text == "right") mAlign = (eTextAlignment)(taTop | taRight); else if (Text == "left") mAlign = (eTextAlignment)(taTop | taLeft); - else + else return false; return true; } -bool cxObject::ParseFontFace(const std::string &Text) +bool cxObject::ParseFontFace(const std::string &Text) { int size = 0, width = 0, pos; std::string face = Text; if ((pos = face.find('@')) != -1) { std::string s = face.substr(pos + 1); - const char *p = s.c_str(); + const char *p = s.c_str(); char *end; size = strtol(p, &end, 10); if (*end == ',') width = strtol(end + 1, NULL, 10); - + face.erase(pos); } @@ -141,7 +141,7 @@ void cxObject::SetListIndex(uint Index, int Tab) mCondition->SetListIndex(Index, Tab); } -const std::string &cxObject::TypeName(void) const +const std::string &cxObject::TypeName(void) const { return ObjectNames[mType]; } @@ -192,13 +192,13 @@ txSize cxObject::Size(const txPoint &BaseOffset, const txSize &BaseSize, const t return txSize(p2.x - p1.x + 1, p2.y - p1.y + 1); } -const tColor *cxObject::Fg(void) const +const tColor *cxObject::Fg(void) const { static tColor Fg; return cText2SkinRender::ItemColor(mFg, Fg) ? &Fg : NULL; } -const tColor *cxObject::Bg(void) const +const tColor *cxObject::Bg(void) const { static tColor Bg; return cText2SkinRender::ItemColor(mBg, Bg) ? &Bg : NULL; @@ -210,25 +210,25 @@ const tColor *cxObject::Bl(void) const return cText2SkinRender::ItemColor(mBl, Bl) ? &Bl : NULL; } -const tColor *cxObject::Mask(void) const +const tColor *cxObject::Mask(void) const { static tColor Mask; return cText2SkinRender::ItemColor(mMask, Mask) ? &Mask : NULL; } -const tColor *cxObject::Mark(void) const +const tColor *cxObject::Mark(void) const { static tColor Mark; return cText2SkinRender::ItemColor(mMark, Mark) ? &Mark : NULL; } -const tColor *cxObject::Active(void) const +const tColor *cxObject::Active(void) const { static tColor Active; return cText2SkinRender::ItemColor(mActive, Active) ? &Active : NULL; } -const tColor *cxObject::Keep(void) const +const tColor *cxObject::Keep(void) const { static tColor Keep; return cText2SkinRender::ItemColor(mKeep, Keep) ? &Keep : NULL; @@ -238,7 +238,7 @@ cxObjects::cxObjects(void) { } -cxObjects::~cxObjects() +cxObjects::~cxObjects() { for (uint i = 0; i < size(); ++i) delete operator[](i); diff --git a/xml/object.h b/xml/object.h index 2343f82..297039e 100644 --- a/xml/object.h +++ b/xml/object.h @@ -27,7 +27,7 @@ struct txWindow { txPoint pos1; txPoint pos2; int bpp; - txWindow(int _x1 = 0, int _y1 = 0, int _x2 = -1, int _y2 = -1, int _bpp=4): + txWindow(int _x1 = 0, int _y1 = 0, int _x2 = -1, int _y2 = -1, int _bpp=4): pos1(_x1, _y2), pos2(_x2, _y2), bpp(_bpp) {} }; @@ -103,7 +103,7 @@ public: item, #define __COUNT_OBJECT__ (item + 1) }; - + private: cxDisplay *mDisplay; cxSkin *mSkin; diff --git a/xml/parser.c b/xml/parser.c index 8329fb6..ed2e72b 100644 --- a/xml/parser.c +++ b/xml/parser.c @@ -51,7 +51,7 @@ } else \ _target = _l; \ } - + #define ATTRIB_MAN_NUMBER(_attr,_target) \ ATTRIB_OPT_NUMBER(_attr,_target) \ else { \ @@ -92,7 +92,7 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr ATTRIB_MAN_FUNC ("version", skin->mVersion.Parse); ATTRIB_MAN_STRING("name", skin->mTitle); ATTRIB_MAN_FUNC ("screenBase", skin->ParseBase); - } + } else TAG_ERR_REMAIN("document"); } @@ -164,7 +164,7 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr if (name == "blink") { ATTRIB_OPT_STRING("blinkColor", object->mBl); ATTRIB_OPT_NUMBER("delay", object->mDelay); - + if (object->mDelay == 0) object->mDelay = 1000; } @@ -182,7 +182,7 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr ATTRIB_OPT_STRING("color", object->mFg); ATTRIB_OPT_NUMBER("arc", object->mArc); } - else if (name == "progress" + else if (name == "progress" || name == "scrollbar") { ATTRIB_OPT_STRING("color", object->mFg); ATTRIB_OPT_STRING("bgColor", object->mBg); @@ -204,7 +204,7 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr } else TAG_ERR_REMAIN(context[context.size() - 1].c_str()); } - } else + } else TAG_ERR_CHILD(context[context.size() - 1].c_str()); context.push_back(name); return true; @@ -220,7 +220,7 @@ bool xCharData(const std::string &text) { while (text[end] == '\012' || text[end] == '\015' || text[end] == ' ' || text[end] == '\t') --end; - + //Dprintf("char data after: %s\n", text.substr(start, end - start + 1).c_str()); if (end - start + 1 > 0) { @@ -320,4 +320,4 @@ cxSkin *xmlParse(const std::string &name, const std::string &fileName, cText2Ski skin = NULL; return result; } - + diff --git a/xml/parser.h b/xml/parser.h index c8b8eb7..85e2576 100644 --- a/xml/parser.h +++ b/xml/parser.h @@ -11,5 +11,5 @@ class cText2SkinTheme; cxSkin *xmlParse(const std::string &name, const std::string &fileName, cText2SkinI18n *I18n, cText2SkinTheme *Theme); - + #endif // VDR_TEXT2SKIN_PARSER_H @@ -41,11 +41,11 @@ bool cxVersion::Parse(const std::string &Text) cxSkin::cxSkin(const std::string &Name, cText2SkinI18n *I18n, cText2SkinTheme *Theme): mName(Name), mI18n(I18n), - mTheme(Theme) + mTheme(Theme) { } -void cxSkin::SetBase(eScreenBase Base) +void cxSkin::SetBase(eScreenBase Base) { if (Base != (eScreenBase)-1) mBase = Base; @@ -76,7 +76,7 @@ void cxSkin::SetBase(eScreenBase Base) } } -bool cxSkin::ParseBase(const std::string &Text) +bool cxSkin::ParseBase(const std::string &Text) { int i; for (i = 0; i < (int)__COUNT_BASE__; ++i) { @@ -89,7 +89,7 @@ bool cxSkin::ParseBase(const std::string &Text) } return false; } - + std::string cxSkin::Translate(const std::string &Text) { if (mI18n != NULL) @@ -1,7 +1,7 @@ // -*- c++ -*- -#ifndef VDR_TEXT2SKIN_XML_SKIN_H -#define VDR_TEXT2SKIN_XML_SKIN_H +#ifndef VDR_TEXT2SKIN_XML_SKIN_H +#define VDR_TEXT2SKIN_XML_SKIN_H #include "xml/display.h" #include <vdr/osd.h> @@ -77,7 +77,7 @@ private: cxVersion mVersion; cxDisplays mDisplays; - + cText2SkinI18n *mI18n; // TODO: should move here completely cText2SkinTheme *mTheme; @@ -106,4 +106,4 @@ inline cxDisplay *cxSkin::Get(cxDisplay::eType Type) { return NULL; } -#endif // VDR_TEXT2SKIN_XML_SKIN_H +#endif // VDR_TEXT2SKIN_XML_SKIN_H diff --git a/xml/string.c b/xml/string.c index dda65bb..6504f64 100644 --- a/xml/string.c +++ b/xml/string.c @@ -7,57 +7,57 @@ static const char *Tokens[__COUNT_TOKEN__] = { "DateTime", "FreeDiskSpace", "UsedDiskSpace", "TotalDiskSpace", "VideoSizeWidth", "VideoSizeHeight", "AudioTrack", "AudioChannel", // Channel Display - "ChannelNumber", "ChannelName", "ChannelShortName", "ChannelBouquet", "ChannelPortal", - "ChannelSource", "ChannelID", "PresentStartDateTime", "PresentVPSDateTime", + "ChannelNumber", "ChannelName", "ChannelShortName", "ChannelBouquet", "ChannelPortal", + "ChannelSource", "ChannelID", "PresentStartDateTime", "PresentVPSDateTime", "CurrentEventsTitle1", "CurrentEventsStartDateTime1", "CurrentEventsStopDateTime1", "CurrentEventsChannelNumber1", "CurrentEventsChannelName1", "CurrentEventsIsRecording1", "CurrentEventsTitle2", "CurrentEventsStartDateTime2", "CurrentEventsStopDateTime2", "CurrentEventsChannelNumber2", "CurrentEventsChannelName2", "CurrentEventsIsRecording2", "CurrentEventsTitle3", "CurrentEventsStartDateTime3", "CurrentEventsStopDateTime3", "CurrentEventsChannelNumber3", "CurrentEventsChannelName3", "CurrentEventsIsRecording3", "TimerConflicts", "PresentEndDateTime", "PresentDuration", "PresentProgress", "PresentRemaining", "PresentLanguageCode", "PresentLanguageDescription", "PresentVideoAR", "PresentEventID", - "PresentTitle", "PresentShortText", "PresentDescription", "FollowingStartDateTime", + "PresentTitle", "PresentShortText", "PresentDescription", "FollowingStartDateTime", "FollowingVPSDateTime", "FollowingEndDateTime", "FollowingDuration", "FollowingTitle", "FollowingShortText", "FollowingDescription", "Language", - "HasTeletext", "ChannelHasTeletext", "HasMultilang", "ChannelHasMultilang", "HasDolby", + "HasTeletext", "ChannelHasTeletext", "HasMultilang", "ChannelHasMultilang", "HasDolby", "ChannelHasDolby", "IsEncrypted", "ChannelIsEncrypted", "IsRadio", "ChannelIsRadio", "IsRecording", "CurrentRecording", "HasVPS", "HasTimer", "IsRunning", "ChannelHasVPS", - "PresentHasTimer", "PresentIsRunning", "PresentHasVPS", "FollowingHasTimer", + "PresentHasTimer", "PresentIsRunning", "PresentHasVPS", "FollowingHasTimer", "FollowingIsRunning", "FollowingHasVPS", - + // Volume Display "VolumeCurrent", "VolumeTotal", "IsMute", "VolumeIsMute", - + // Message Display "Message", "MessageStatus", "MessageInfo", "MessageWarning", "MessageError", - + // Replay Display - "ReplayTitle", "ReplayPositionIndex", "ReplayDurationIndex", "ReplayPrompt", + "ReplayTitle", "ReplayPositionIndex", "ReplayDurationIndex", "ReplayPrompt", "ReplayName", "ReplayDateTime", "ReplayShortText", "ReplayDescription", "ReplayLanguageCode", "ReplayLanguageDescription", "ReplayVideoAR", - "IsPlaying", "ReplayIsPlaying", "IsFastForward", "ReplayIsFastForward", "IsFastRewind", - "ReplayIsFastRewind", "IsSlowForward", "ReplayIsSlowForward", "IsSlowRewind", + "IsPlaying", "ReplayIsPlaying", "IsFastForward", "ReplayIsFastForward", "IsFastRewind", + "ReplayIsFastRewind", "IsSlowForward", "ReplayIsSlowForward", "IsSlowRewind", "ReplayIsSlowRewind", "IsPausing", "ReplayIsPausing", "ReplayPosition", "ReplayDuration", "ReplayRemaining", "ReplayMode", "ReplayIsShuffle", "ReplayIsLoop", // Menu Page - "MenuTitle", "MenuGroup", "IsMenuGroup", "MenuItem", "IsMenuItem", "MenuCurrent", + "MenuTitle", "MenuGroup", "IsMenuGroup", "MenuItem", "IsMenuItem", "MenuCurrent", "IsMenuCurrent", "MenuText", "RecordingName", "RecordingFilename", "RecordingDateTime", "RecordingTitle", "RecordingShortText", "RecordingDescription", "RecordingLanguageCode", "FrontendSTR", "FrontendSNR", "FrontendHasLock", "FrontendHasSignal", "RecordingPriority", "RecordingLifetime", "RecordingVideoAR", "RecordingSize", "RecordingLength", "RecordingCuttedLength", "OsdWidth", "OsdHeight", - "RecordingLanguageDescription", "ButtonRed", "ButtonGreen", + "RecordingLanguageDescription", "ButtonRed", "ButtonGreen", "ButtonYellow", "ButtonBlue", "CanScrollUp", "CanScrollDown" }; -std::string txToken::Token(const txToken &Token) +std::string txToken::Token(const txToken &Token) { std::string result = (std::string)"{" + Tokens[Token.Type]; //if (Token.Attrib.length() > 0) // result += ":" + Token.Attrib; result += "}"; - + return result; } @@ -91,7 +91,7 @@ void cxString::Reparse(void) } } -bool cxString::Parse(const std::string &Text, bool Translate) +bool cxString::Parse(const std::string &Text, bool Translate) { std::string trans = Translate ? mSkin->Translate(Text) : Text; const char *text = trans.c_str(); @@ -114,7 +114,7 @@ bool cxString::Parse(const std::string &Text, bool Translate) ++ptr; continue; - } + } else if (*ptr == '{') { if (inToken) { esyslog("ERROR: Unexpected '{' in token"); @@ -165,14 +165,14 @@ bool cxString::Parse(const std::string &Text, bool Translate) lastToken.Attrib = n; } else lastToken.Attrib = attr; - } + } inAttrib = false; inToken = false; } else { int i; for (i = 0; i < (int)__COUNT_TOKEN__; ++i) { - if ((size_t)(ptr - last) == strlen(Tokens[i]) + if ((size_t)(ptr - last) == strlen(Tokens[i]) && memcmp(last, Tokens[i], ptr - last) == 0) { txToken token((exToken)i, offset, ""); mTokens.push_back(token); @@ -209,7 +209,7 @@ bool cxString::Parse(const std::string &Text, bool Translate) return true; } -cxType cxString::Evaluate(void) const +cxType cxString::Evaluate(void) const { std::string result; int offset = 0; diff --git a/xml/string.h b/xml/string.h index 2bc1388..9b0d66d 100644 --- a/xml/string.h +++ b/xml/string.h @@ -225,7 +225,7 @@ struct txToken { int Tab; txToken(void): Index(-1), Tab(-1) {} - txToken(exToken t, uint o, const std::string &a): + txToken(exToken t, uint o, const std::string &a): Type(t), Offset(o), Attrib(a), Index(-1), Tab(-1) {} friend bool operator< (const txToken &A, const txToken &B); @@ -233,7 +233,7 @@ struct txToken { static std::string Token(const txToken &Token); }; -inline bool operator< (const txToken &A, const txToken &B) +inline bool operator< (const txToken &A, const txToken &B) { return A.Type == B.Type ? A.Attrib == B.Attrib @@ -176,7 +176,7 @@ XML::readChar(int c) { if (isTokenChar(0, c)) { tag += c; } else if (c == '>') { - if (nodestartcb) + if (nodestartcb) if (!nodestartcb(tag, attr)) return (-1); state = LOOK4START; @@ -215,7 +215,7 @@ XML::readChar(int c) { // looking for attr name, > or / case LOOK4ATTRN: if (c == '>') { - if (nodestartcb) + if (nodestartcb) if (!nodestartcb(tag, attr)) return (-1); state = LOOK4START; @@ -236,7 +236,7 @@ XML::readChar(int c) { // saw / in element opening case SAWSLASH: if (c == '>') { - if (nodestartcb) + if (nodestartcb) if (!nodestartcb(tag, attr)) return (-1); if (nodeendcb) @@ -307,7 +307,7 @@ XML::readChar(int c) { if (isTokenChar(0, c)) { tag += c; } else if (c == '>') { - if (nodeendcb) + if (nodeendcb) if (!nodeendcb(tag)) return false; state = LOOK4START; |