Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mj7t5-0001nY-Mf for mharc-grub-devel@gnu.org; Thu, 03 Sep 2009 04:41:47 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mj7t3-0001lb-Jp for grub-devel@gnu.org; Thu, 03 Sep 2009 04:41:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mj7sy-0001h1-9t for grub-devel@gnu.org; Thu, 03 Sep 2009 04:41:44 -0400 Received: from [199.232.76.173] (port=48322 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mj7sy-0001gl-5C for grub-devel@gnu.org; Thu, 03 Sep 2009 04:41:40 -0400 Received: from mail-fx0-f226.google.com ([209.85.220.226]:61660) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mj7sx-0001Fh-Ji for grub-devel@gnu.org; Thu, 03 Sep 2009 04:41:39 -0400 Received: by fxm26 with SMTP id 26so1621735fxm.42 for ; Thu, 03 Sep 2009 01:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=gMekGl4ITsVKkLYmakOT1jbVE1yaQLZ9x8G4Ded5FXY=; b=fvB5yuuOLfP0Bw1D1nFCDYg24V11nNGCE4SuAUvxaFhhYNvUXc1HjiAe3nUkFDVkZk 5tbsmG/K3qGAYJ4Gm07iACCdF28iSxvfo6lrG8eTeVE8SIhJH/n5HSPpHU/u/fpMkKTJ t7XhFtR+LydWG+tsAnTnx+oRtT3NQTWMMsSNI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=YjZU7KWt616WN8xU9o3TFeWeRy4sBxiDIjW3VNncNGNvXeY4KJSXektzM2grdPQ2gg eSwpftf+uJFjiZKwfZr+EaytOFKTxUafHFvQme6p+pZOcfeJ53wZoySoESWmcphoJkrM h0qnq+Onq/TqzFWQZNLKOcP4j+fQLI4g0GUDw= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.86.187.7 with SMTP id k7mr3575399fgf.30.1251967298253; Thu, 03 Sep 2009 01:41:38 -0700 (PDT) In-Reply-To: References: Date: Thu, 3 Sep 2009 10:41:37 +0200 X-Google-Sender-Auth: 65ccfaa6a4140abd Message-ID: From: Michal Suchanek To: The development of GRUB 2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [GITGRUB] New menu interface X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2009 08:41:46 -0000 2009/9/3 Bean : > On Thu, Sep 3, 2009 at 3:43 AM, Michal Suchanek wrot= e: >> 2009/9/2 Bean : >>> On Thu, Sep 3, 2009 at 1:25 AM, Michal Suchanek wr= ote: >>>> 2009/9/2 Bean : >>>>> On Wed, Sep 2, 2009 at 11:27 PM, Michal Suchanek= wrote: >>>>>> How will it fit screen? What if the image is 4:3 and =C2=A0the scree= n is >>>>>> 5:4 or widescreen? >>>>> >>>>> It'd scale to fit the new proportion, although the image perhaps won'= t >>>>> look nice in this case. We could choose one of the following renderin= g >>>>> method based on option: >>>>> >>>>> Center >>>>> Scaling (full) >>>>> Scaling (keep ratio) >>>>> Tiling >>>> >>>> Other common uses are >>>> >>>> Scaling (cover) - keep aspect but cover the whole area (with parts of >>>> the picture sticking out of the viewport) - useful with a >>>> non-intrusive background like a photo of fallen leaves or the like >>>> >>>> Left, Right, TopLeft, BottomRight, ... - for side and corner decoratio= ns. >>> >>> Hi, >>> >>> Sounds good, and it shouldn't be difficult to implement. >>> >>>> >>>>> >>>>>> Percentages are a good start. However, if you make your menu >>>>>> percentage based adding new items or new menu areas is still >>>>>> problematic. >>>>> >>>>> Actually I've though of another representation, using the font metric= s >>>>> as base unit, =C2=A0something like this: >>>>> >>>>> + menu { >>>>> =C2=A0x =3D 10% >>>>> =C2=A0y =3D 10% >>>>> =C2=A0width =3D 30c >>>>> =C2=A0height =3D 30c >>>>> } >>>> >>>> Does that c represent the width of the character "c"? What about >>>> proportional fonts? >>> >>> The suffix c means character. For proportional fonts, it's the average >>> width of font used by the current component. >> >> Still why would you want an object about 30 characters wide? You >> either want an object that can accommodate its content or an object >> that fills available space. An object "about 30 characters wide" is >> useless in my view. > > Hi, > > For example, we might want to limit the width of edit box to display > at most 30 characters, in this case 30c is quite useful. > > And the c unit is usable in both text and graphic mode. If we write > y=3D2c, y is 2 character height, this looks acceptable in both text and > graphics mode, but y=3D2 is extremely narrow in graphic mode. In fact, c > is the unit used in the current gfxterm. > >> If it's height you can be sure you can put 30 menu items in there then >> (but then it would be in some units on fount height not width) > > For y and height property, c is calculated using font height instead of w= idth. > >> >>> >>>> >>>> I think it is OK if the layout manager was in Lua if that makes >>>> hacking on it easier but you still need the support functions for a >>>> fully functional layout manager in C for that to work. >>> >>> Yeah, I think it'd be better to implement to whole framework in C at >>> first. LUA could be used to write custom component that extends the >>> function of existing components. >>> >> >> Actually the code in video subsystem that is required for writing a >> layout manager is already there or easy to add. >> >> - get_viewport - get available area >> - set_viewport - limit drawing to selected component >> - get_text_width >> - get_font_height - find out the size of a rectangle needed to draw a >> specific string >> >> What is needed is parser for some configuration format that can store >> arbitrary attributes which can then be interpreted by the layout >> manager. > > We can select the layout manager using layout property. Although for > simple interface, I don't think layout manager is necessary, as there > won't be too many components on screen. And how would you place the menu items then? At random? Thanks Michal