Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mivjc-0003ke-U5 for mharc-grub-devel@gnu.org; Wed, 02 Sep 2009 15:43:12 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mivjb-0003kZ-Lh for grub-devel@gnu.org; Wed, 02 Sep 2009 15:43:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MivjZ-0003kN-70 for grub-devel@gnu.org; Wed, 02 Sep 2009 15:43:10 -0400 Received: from [199.232.76.173] (port=57679 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MivjZ-0003kK-1l for grub-devel@gnu.org; Wed, 02 Sep 2009 15:43:09 -0400 Received: from fg-out-1718.google.com ([72.14.220.154]:34555) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MivjY-0006Im-Cd for grub-devel@gnu.org; Wed, 02 Sep 2009 15:43:08 -0400 Received: by fg-out-1718.google.com with SMTP id e21so753949fga.12 for ; Wed, 02 Sep 2009 12:43:07 -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=/x6JF/9kp7+ZsRJ571i+1/VV2hX5WD3U900dCvR6OAk=; b=E18MQKo4x/aYvLhaF1zbi0sL99I6+S9mVg+BXN8L636Kg6ik8e01Eu/89RyAPWSY41 s2e5QgYi6Ed6LLOB37dZLTMjISZiwyxUpGp3GcGz6BcUs+79MQWgFGmOLw2n/5a8aNxS GWRQ3Y2grJuOaLLi/FZqdQAhZI8Y6P3KKymuM= 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=AD/fIL7e6Uf8LF8QslQFkeBnRgSBEsfXYyIuueH4L8rhh6scYWcuWXYO2vLRL0UBx1 bM1GQtMurRyASh6M7BqenEaL1GKPE1/GyXxENvUujnJJepXAp+8foc27Zkv47NZGoN95 JA1+sDCVs7zKjgIyywaaXX7+5jogtz3hShyH0= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.86.227.27 with SMTP id z27mr2900189fgg.66.1251920587261; Wed, 02 Sep 2009 12:43:07 -0700 (PDT) In-Reply-To: References: Date: Wed, 2 Sep 2009 21:43:07 +0200 X-Google-Sender-Auth: 2e8a5b075601360a 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: Wed, 02 Sep 2009 19:43:11 -0000 2009/9/2 Bean : > On Thu, Sep 3, 2009 at 1:25 AM, Michal Suchanek wrot= e: >> 2009/9/2 Bean : >>> On Wed, Sep 2, 2009 at 11:27 PM, Michal Suchanek w= rote: >>>> How will it fit screen? What if the image is 4:3 and =C2=A0the screen = 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 rendering >>> 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 decorations= . > > 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 metrics >>> 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. 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) > >> >> 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. Thanks Michal