From patchwork Sun Aug 7 13:46:38 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Olivetti X-Patchwork-Id: 11968 Received: from 232.red-213-97-27.pooles.rima-tde.net ([213.97.27.232]) by www.linuxtv.org with esmtp (Exim 4.34) id 1E1lUc-0001wI-4Y for vdr@linuxtv.org; Sun, 07 Aug 2005 15:47:10 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by 232.Red-213-97-27.pooles.rima-tde.net (Postfix) with ESMTP id A171318BBF38 for ; Sun, 7 Aug 2005 15:46:39 +0200 (CEST) Message-ID: <42F610BE.7020202@ventoso.org> Date: Sun, 07 Aug 2005 15:46:38 +0200 From: Luca Olivetti User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Klaus Schmidinger's VDR Subject: Re: [vdr] [ANNOUNCE] vdr-iaxphone-0.0.3 - a softphone for vdr References: <42F60EF6.9030802@ventoso.org> In-Reply-To: <42F60EF6.9030802@ventoso.org> X-Enigmail-Version: 0.89.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2005 13:47:10 -0000 Status: O X-Status: X-Keywords: X-UID: 3987 Luca Olivetti wrote: > > - Reworked the osd (using own cStatusMenu class instead of cOsdMenu, the > former reserves some lines on top to show status information) Btw, if you could do something like the following patch I wouldn't need to reimplement the whole cOsdMenu in my plugin ;-) Bye diff --unified --recursive orig/osdbase.c new/osdbase.c --- orig/osdbase.c 2005-08-04 16:07:10.745702589 +0200 +++ new/osdbase.c 2005-08-05 10:05:49.449609914 +0200 @@ -67,7 +67,7 @@ int cOsdMenu::displayMenuCount = 0; int cOsdMenu::displayMenuItems = 0;//XXX dynamic??? -cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4) +cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4, int res) { isMenu = true; digit = 0; @@ -77,6 +77,7 @@ SetCols(c0, c1, c2, c3, c4); first = 0; current = marked = -1; + reserved = res; subMenu = NULL; helpRed = helpGreen = helpYellow = helpBlue = NULL; status = NULL; @@ -84,6 +85,7 @@ displayMenu = Skins.Current()->DisplayMenu(); displayMenuItems = displayMenu->MaxItems(); } + displayMenuItems -= reserved; } cOsdMenu::~cOsdMenu() @@ -93,6 +95,7 @@ free(status); displayMenu->Clear(); cStatus::MsgOsdClear(); + displayMenuItems += reserved; if (!--displayMenuCount) DELETENULL(displayMenu); } @@ -121,6 +124,13 @@ cols[4] = c4; } +void cOsdMenu::SetReserved(int res) +{ + displayMenuItems += reserved; + reserved = res; + displayMenuItems -= reserved; +} + void cOsdMenu::SetHasHotkeys(void) { hasHotkeys = true; @@ -207,10 +217,12 @@ if (first < 0) first = 0; } + //text2skin doesn't cope well with out of order menu items + if(reserved) for (int kk=0; kkSetItem("",kk,false,false); int i = first; int n = 0; for (cOsdItem *item = Get(first); item; item = Next(item)) { - displayMenu->SetItem(item->Text(), i - first, i == current, item->Selectable()); + displayMenu->SetItem(item->Text(), i - first + reserved, i == current, item->Selectable()); if (i == current) cStatus::MsgOsdCurrentItem(item->Text()); if (++n == displayMenuItems) @@ -238,7 +250,7 @@ { cOsdItem *item = Get(current); if (item) { - displayMenu->SetItem(item->Text(), current - first, Current, item->Selectable()); + displayMenu->SetItem(item->Text(), current - first + reserved, Current, item->Selectable()); if (Current) cStatus::MsgOsdCurrentItem(item->Text()); if (!Current) diff --unified --recursive orig/osdbase.h new/osdbase.h --- orig/osdbase.h 2005-08-04 16:07:10.745702589 +0200 +++ new/osdbase.h 2005-08-04 16:04:28.254938058 +0200 @@ -89,7 +89,7 @@ static int displayMenuItems; char *title; int cols[cSkinDisplayMenu::MaxTabs]; - int first, current, marked; + int first, current, marked, reserved; cOsdMenu *subMenu; const char *helpRed, *helpGreen, *helpYellow, *helpBlue; char *status; @@ -99,6 +99,7 @@ cSkinDisplayMenu *DisplayMenu(void) { return displayMenu; } const char *hk(const char *s); void SetCols(int c0, int c1 = 0, int c2 = 0, int c3 = 0, int c4 = 0); + void SetReserved(int res); void SetHasHotkeys(void); virtual void Clear(void); bool SelectableItem(int idx); @@ -119,7 +120,7 @@ void SetHelp(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); virtual void Del(int Index); public: - cOsdMenu(const char *Title, int c0 = 0, int c1 = 0, int c2 = 0, int c3 = 0, int c4 = 0); + cOsdMenu(const char *Title, int c0 = 0, int c1 = 0, int c2 = 0, int c3 = 0, int c4 = 0, int res=0); virtual ~cOsdMenu(); int Current(void) { return current; } void Add(cOsdItem *Item, bool Current = false, cOsdItem *After = NULL);