From 662dd62488f6f842fe5d940e986f798abe1c7691 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 19 Nov 2005 12:00:00 +0100 Subject: 2005-11-19: Version 1.1-cvs_ext-0.2 (vdr-text2skin-1.1-cvs_ext-0.2.diff) - removed the previously introduced tokens NextTimerName, NextTimerStart, NextTimerChannel, CurrentRecordingsCount and added tokens for the next 3 timers: CurrentEventsTitle[123], CurrentEventsStartDateTime[123], CurrentEventsStopDateTime[123], CurrentEventsChannelNumber[123], CurrentEventsChannelName[123], CurrentEventsIsRecording[123] - added audio- and video-tokens: PresentLanguageCode, PresentLanguageDescription, PresentVideoAR and implemented the missing code for the Language-token - added tokens for replay: ReplayName, ReplayDateTime, ReplayShortText, ReplayDescription, ReplayLanguageCode, ReplayLanguageDescription, ReplayVideoAR (not activated yet) - additional recording-tokens: RecordingVideoAR, RecordingSize - added a reset for scrolling text (configurable) - included Text2skin.diff from the rotor-plugin --- render.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index 3d3b4d7..4c15f26 100644 --- a/render.c +++ b/render.c @@ -11,6 +11,7 @@ #include "screen.h" #include "display.h" #include "scroller.h" +#include "setup.h" #include "xml/display.h" #include #include @@ -353,13 +354,30 @@ void cText2SkinRender::DrawMarquee(const txPoint &Pos, const txSize &Size, const uint Delay, uint Index) { bool scrolling = Font->Width(Text.c_str()) > Size.w; - + tState &state = mStates[Index]; if (state.text != Text) { state = tState(); state.text = Text; } + if (Text2SkinSetup.MarqueeReset && mUpdate.resetMarquee && mUpdate.currentItem.find(Text, 0) != std::string::npos) + { + state.offset = 0; + state.direction = 1; + state.nexttime = 0; + state.scrolling = false; + mUpdate.foundFirstItem = true; + } + else + { + if (mUpdate.foundFirstItem) + { + mUpdate.resetMarquee = false; + mUpdate.foundFirstItem = false; + } + } + if (state.nexttime == 0) state.nexttime = mNow + 1500; else if (mNow >= state.nexttime) { @@ -376,7 +394,7 @@ void cText2SkinRender::DrawMarquee(const txPoint &Pos, const txSize &Size, const ++state.direction; nextin = 1500; } else - --state.offset; + Text2SkinSetup.MarqueeLeftRight ? --state.offset : state.offset = 0; } state.nexttime = mNow + nextin; } -- cgit v1.2.3 From eb6eaf285edd82c212810f066313f93dc4a8a129 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 7 Jan 2006 12:00:00 +0100 Subject: 2006-01-07: Version 1.1-cvs_ext-0.5 (vdr-text2skin-1.1-cvs_ext-0.5.diff) - modifications to compile with vdr-versions >= 1.3.18 - added tokens: OsdWidth, OsdHeight - activating the token ReplayVideoAR --- render.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'render.c') diff --git a/render.c b/render.c index 4c15f26..78c5ac6 100644 --- a/render.c +++ b/render.c @@ -679,7 +679,11 @@ cxType cText2SkinRender::GetTokenData(const txToken &Token) case tCanScrollDown: return mScroller != NULL && mScroller->CanScrollDown(); case tIsRecording: return cRecordControls::Active(); - + + case tOsdWidth: return (cxType)mBaseSize.w; + + case tOsdHeight: return (cxType)mBaseSize.h; + #if VDRVERSNUM >=10318 case tAudioTrack: { cDevice *dev = cDevice::PrimaryDevice(); -- cgit v1.2.3 From c1bf83aec2961a4e84dbc1c36042bd985f044a91 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 4 Feb 2006 11:49:02 +0100 Subject: 2006-02-04: Version 1.1-cvs_ext-0.7 (vdr-text2skin-1.1-cvs_ext-0.7.diff) - changed the routines to determine the next timers - added the possibility to have a scrollbar in every menu - not fully implemented yet (to position in menu-lists is not necessarily correct, if there are more items with the same osd-text) --- render.c | 1 + 1 file changed, 1 insertion(+) (limited to 'render.c') diff --git a/render.c b/render.c index 78c5ac6..f523e63 100644 --- a/render.c +++ b/render.c @@ -263,6 +263,7 @@ void cText2SkinRender::DrawObject(const cxObject *Object) // there is no "next tab", use the rightmost edge obj.mPos2.x += Object->mPos1.x; SetEditableWidth(obj.Size().w); + //printf("EditableWidth von '%s': %d Pixels\n", obj.Text().c_str(), obj.Size().w); } obj.mPos2.y += Object->mPos1.y + yoffset; -- cgit v1.2.3 From 8d32cf88bbe5b69a2710029cdaa896470a0fe20c Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 4 Feb 2006 18:25:22 +0100 Subject: 2006-02-04: Version 1.1-cvs_ext-0.8 (vdr-text2skin-1.1-cvs_ext-0.8.diff) - added a configuration option for showing the scrollbar in the menus and finished implementation --- render.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index f523e63..06096b1 100644 --- a/render.c +++ b/render.c @@ -11,7 +11,6 @@ #include "screen.h" #include "display.h" #include "scroller.h" -#include "setup.h" #include "xml/display.h" #include #include @@ -222,7 +221,8 @@ void cText2SkinRender::DrawObject(const cxObject *Object) uint itemheight = item->Size().h; uint maxitems = areasize.h / itemheight; uint yoffset = 0; - + + mMenuScrollbar.maxItems = maxitems; SetMaxItems(maxitems); //Dprintf("setmaxitems %d\n", maxitems); for (uint i = 0; i < maxitems; ++i, yoffset += itemheight) { for (uint j = 1; j < Object->Objects(); ++j) { @@ -564,6 +564,29 @@ void cText2SkinRender::DrawScrollbar(const txPoint &Pos, const txSize &Size, con DrawRectangle(sp, ss, Fg); } } + else if (mMenuScrollbar.Available()) + { + DrawRectangle(Pos, Size, Bg); + txPoint sbPoint = Pos; + txSize sbSize = Size; + if (sbSize.h > sbSize.w) + { + // -1 to get at least 1 pixel height + double top = double(mMenuScrollbar.Top()) / mMenuScrollbar.total * (sbSize.h - 1); + double bottom = double(mMenuScrollbar.Bottom()) / mMenuScrollbar.total * (sbSize.h - 1); + sbPoint.y += (uint)top; + sbSize.h -= (uint)top + (uint)bottom; + } + else + { + // -1 to get at least 1 pixel height + double left = double(mMenuScrollbar.Top()) / mMenuScrollbar.total * (sbSize.w - 1); + double right = double(mMenuScrollbar.Bottom()) / mMenuScrollbar.total * (sbSize.w - 1); + sbPoint.x += (uint)left; + sbSize.w -= (uint)left + (uint)right; + } + DrawRectangle(sbPoint, sbSize, Fg); + } } txPoint cText2SkinRender::Transform(const txPoint &Pos) @@ -675,9 +698,19 @@ cxType cText2SkinRender::GetTokenData(const txToken &Token) case tDateTime: return TimeType(time(NULL), Token.Attrib.Text); - case tCanScrollUp: return mScroller != NULL && mScroller->CanScrollUp(); + case tCanScrollUp: + { + if (mScroller) return mScroller->CanScrollUp(); + else if (mMenuScrollbar.Available()) return mMenuScrollbar.CanScrollUp(); + else return false; + } - case tCanScrollDown: return mScroller != NULL && mScroller->CanScrollDown(); + case tCanScrollDown: + { + if (mScroller) return mScroller->CanScrollDown(); + else if (mMenuScrollbar.Available()) return mMenuScrollbar.CanScrollDown(); + else return false; + } case tIsRecording: return cRecordControls::Active(); -- cgit v1.2.3 From 74a5cc8e14900d48386e33cb576f154a6dd7e557 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sun, 19 Nov 2006 16:58:14 +0100 Subject: 2006-11-19: Version 1.1-cvs_ext-0.9 (vdr-text2skin-1.1-cvs_ext-0.9.diff) - added a test-feature to search for reruns of a program and add the information to the extended epg-info (trigger DEVELOPMENT_FEATURES). This uses a service-interface of the epgsearch-plugin "Epgsearch-searchresults-v1.0" - the timer-conflicts are now checked with epgsearch (service-interface "Epgsearch-lastconflictinfo-v1.0", as it works more reliable and is supported by the plugin author - the extended epg-info and the recording-info are extended by AUX-Infos (configurable) there is also an option to strip known tags - the tab-widths are scaled for taking into account that different TT-Fonts have a different width than the default font from VDR - added tokens for signal-info: FrontendSTR, FrontendSNR, FrontendHasLock, FrontendHasSignal - changed token TimerConflict to TimerConflicts - added token PresentEventID for EPG-images - added tokens for recordings: RecordingFilename, RecordingPriority, RecordingLifetime - removed Text2skin.diff from the rotor-plugin --- render.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index 06096b1..d536c22 100644 --- a/render.c +++ b/render.c @@ -145,15 +145,22 @@ void cText2SkinRender::Action(void) void cText2SkinRender::Update(void) { + //DStartBench(malen); + //DStartBench(ges); Dbench(update); for (uint i = 0; i < mDisplay->Objects(); ++i) DrawObject(mDisplay->GetObject(i)); + //DShowBench("---\t", malen); + //DStartBench(flushen); Dbench(flush); mScreen->Flush(); Ddiff("flush only", flush); Ddiff("complete flush", update); + //DShowBench("===\t", flushen); + //DShowBench("=== ges\t", ges); + //printf("====\t%d\n", mDisplay->Objects()); } void cText2SkinRender::DrawObject(const cxObject *Object) @@ -262,8 +269,17 @@ void cText2SkinRender::DrawObject(const cxObject *Object) else { // there is no "next tab", use the rightmost edge obj.mPos2.x += Object->mPos1.x; - SetEditableWidth(obj.Size().w); - //printf("EditableWidth von '%s': %d Pixels\n", obj.Text().c_str(), obj.Size().w); + if (obj.Type() == cxObject::text && t == 1) { + // VDR assumes, that the font in the menu is fontOsd, + // so the EditableWidth is not necessarily correct + // for TTF + const cFont *defFont = cFont::GetFont(fontOsd); + const char *dummy = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "; + int editableWidth = obj.Size().w; + if (defFont != obj.Font()) + editableWidth = (int)(editableWidth * defFont->Width(dummy) / (1.1 * obj.Font()->Width(dummy))); + SetEditableWidth(editableWidth); + } } obj.mPos2.y += Object->mPos1.y + yoffset; @@ -610,7 +626,9 @@ bool cText2SkinRender::ItemColor(const std::string &Color, tColor &Result) std::string cText2SkinRender::ImagePath(const std::string &Filename) { if (mRender) - return mRender->mBasePath + "/" + Filename; + return (*Filename.data() == '/') + ? Filename + : mRender->mBasePath + "/" + Filename; return ""; } -- cgit v1.2.3 From ac64ce03ec6b5766691ff2da3af6f51ed800792a Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sun, 3 Dec 2006 17:45:17 +0100 Subject: 2006-12-03: Version 1.1-cvs_ext-0.10 (vdr-text2skin-1.1-cvs_ext-0.10.diff) - set EditableWidth. This is important for plugins like 'rotor' or 'extrecmenu' - now setting the locale setting LC_TIME according to the language-selection in VDR --- render.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index 4fafdbe..87df8a3 100644 --- a/render.c +++ b/render.c @@ -227,6 +227,7 @@ void cText2SkinRender::DrawObject(const cxObject *Object) uint itemheight = item->Size().h; uint maxitems = areasize.h / itemheight; uint yoffset = 0; + bool initialEditableWidthSet = false; mMenuScrollbar.maxItems = maxitems; SetMaxItems(maxitems); //Dprintf("setmaxitems %d\n", maxitems); @@ -262,13 +263,23 @@ void cText2SkinRender::DrawObject(const cxObject *Object) nexttab = GetTab(n); } + // set initial EditableWidth + // this is for plugins like 'extrecmenu' and 'rotor' + if ((obj.Type() == cxObject::text || obj.Type() == cxObject::marquee || obj.Type() == cxObject::blink) && !initialEditableWidthSet) { + initialEditableWidthSet = true; + SetEditableWidth(obj.Size().w); + } + if (t >= 0 && nexttab > 0 && nexttab < obj.mPos1.x + obj.Size().w - 1) // there is a "next tab" with text obj.mPos2.x = Object->mPos1.x + o->mPos1.x + nexttab; else { // there is no "next tab", use the rightmost edge obj.mPos2.x += Object->mPos1.x; - if (obj.Type() == cxObject::text && t == 1) { + /* not used anymore due to change to fontOsd + but could be usefull if someone uses a differnt font + + if ((obj.Type() == cxObject::text || obj.Type() == cxObject::marquee || obj.Type() == cxObject::blink) && t == 1) { // VDR assumes, that the font in the menu is fontOsd, // so the EditableWidth is not necessarily correct // for TTF @@ -278,7 +289,9 @@ void cText2SkinRender::DrawObject(const cxObject *Object) if (defFont != obj.Font()) editableWidth = (int)(editableWidth * defFont->Width(dummy) / (1.1 * obj.Font()->Width(dummy))); SetEditableWidth(editableWidth); - } + } */ + if ((obj.Type() == cxObject::text || obj.Type() == cxObject::marquee || obj.Type() == cxObject::blink) && t == 1) + SetEditableWidth(obj.Size().w); } obj.mPos2.y += Object->mPos1.y + yoffset; -- cgit v1.2.3