[Y-devel] Proposing an UI module

Mark Thomas mark at www.y-windows.org
Wed Feb 25 23:08:01 GMT 2004


Niko Iivari wrote:
> On Wed, 25 Feb 2004 08:51:14 -0500
> drizzt321 at phpfreaks.com wrote:
> 
> 
>>Hmm...this might go along with something like what I just sent to the
>>list. Basically I was wondering if we might put a layer between the
>>theme, and the painter which would accept the themes specifics, font,
>>fontsize, colors, etc. so the theme itself wouldn't have to worry
>>about how to draw them on the screen

> I think it should be the other way around. I have no problem with the
> theme talking to the painter, as long as the theme does not decide the
> exact position or order of the "little bits" (skimming through the
> thesis, it seems that these "little bits" should be called gadgets) like
> scrollbar trough and the little arrows.
> The ui module would be before the theme instead.
> 
> ui module --> theme module --> painter
> 
> I keep reading your comment and get the feeling we are talking of very
> similiar things.
> 
> theme module --> 'next layer' --> painter ?
> 

You should realise that the theme module can call itself, and a theme 
doesn't necessarily have to implement all calls, and you can have 
multiple themes loaded.

For your scrollbar example, the theme virtual table would look something 
like:

themeDrawScrollbar           -> yotifDrawScrollbar (...)
themeDrawScrollbarTrough     -> metalDrawScrollbarTrough (...)
themeDrawScrollbarUpButton   -> metalDrawScrollbarUpButton (...)
themeDrawScrollbarDownButton -> metalDrawScrollbarDownButton (...)

with:

yotifDrawScrollbar (...)
{
   themeDrawScrollbarTrough (... at the top ...)
   themeDrawScrollbarUpButton (... below that ...)
   themeDrawScrollbarDownButton (... at the bottom ...)
}


Now, you could unload the yotif theme and load the doze theme (or just 
load the doze theme on top), which means calls to themeDrawScrollbar 
instead get served by:

dozeDrawScrollbar (...)
{
   themeDrawScrollbarUpButton (... at the top ...)
   themeDrawScrollbarTrough (... below that ...)
   themeDrawScrollbarDownButton (... at the bottom ...)
}

Which I think solves your problem.

The only thing we need to be careful of is that themes can't conflict 
with each other.

Regards,

   Mark.
-- 
|| Mark Thomas
|| www.y-windows.org
||
||



More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved