On Thursday 08 July 2004 11:23 pm, Oliver Gabel wrote:
> Hi Ian,
> what do you mean, with >>"Style engine" on one side and "Widget Toolkit"
> on the other"<< ?
> As far as I know, every toolkit brings along its own style engine; so
> does GTK, Qt and WinXP. 

Yes, thats true.  The difference is mainly in whether you need to carry the 
baggage of pointer interaction, key interaction etc.  A style engine has

Style::drawButton(isDown, text, hasFocus, location)

or some such, a toolkit has

Button b;
setLocation(b)
setDown(b);
setText(b);
setFocus(b);
draw(b);

Ok, so thats not valid in any language, but the difference is a style engine 
is strictly the painting part.  Most toolkits have their own because they run 
on multiple platforms, and drawing on each platform is different.  A style 
engine is usable at a level where there may not be any widgets (e.g. fake a 
screen shot, never have an event loop or even any structs describing states).

Qt's style engine is more of a style wrapper in this discussion.  It emulates 
or wraps over other styles (e.g. Motif is emulated, XP and Mac are wrapped).  
Also you can't really use the Qt style engine on its own, it ties very 
closely into the rest of Qt.  Or at least it does in all current stable 
versions I am aware of.

> In fact, the widget engine of WinXP is also just a "toolkit ". 

XP has a toolkit, but apart from that it has a theming engine.  You can use 
this without touching the 'toolkit'. You can get XP to draw a button without 
every actually having a button, or indeed any interactivity or event loop or 
anything.  And it will draw it in the new XP style if thats the users 
preference in control panel, or in the old 98 style if thats the users 
preference in control panel.  The app doesn't have to know how the rest of 
the apps look, nor does it need to touch the XP toolkit.

I think the reason this was done is because XP looses rating points when an 
app looks bad on it, so they were trying to reduce the likelyhood of this 
happening in future.

> Do you want a low level DirectFB toolkit, with low level DirectFB style
> engine, and have the ports of other toolkits to DirectFB use this low level
> DirectFB toolkit and style engine instead of raw DirectFB drawing commands? 

No, just the style engine.  Think "Just QStyle" in Qt, but without any 
parameters that inherit QWidget.  I only mention toolkits because any 
DirectFB toolkit is going to need code like this to draw its widgets anyway.  
Only don't think QStyle because its too tied into a toolkit to apply.

> Then you would have
> to switch off those toolkit's own style engines. I don't know, if this
> would be a clean approach.

Actually its already used in Qt to port to Mac and XP.  Both of those have 
functions for drawing.  the Qt Style engine wraps them, not replaced by them.
Its not used in X11 because X11 has no style engine of its own.  Its not just 
clean, its right.  Because that way (under XP) if the style is changed from 
new to old, then all Qt apps look right.  if it wasn't done that way they 
wouldn't.  It also means when XP or Mac bring out a new version with a new 
look, we don't have to jump and release a new Qt, the apps will just draw 
with the new appearance.

> There allready is a native (fairly low-level) toolkit for DirectFB: LiTE
> (Light Toolkit Engine).
> It's only in CVS at the moment, and it lacks style/themeing support. I
> have been thinking about
> style support for LiTE for a while;  it shouldn't be hard to implement,
> as LiTE is not very
> complex at the moment. A few things would have to be adapted though.
> Anyway, I'm looking forward to having a cool native toolkit with style
> support an OSX-like
> features in DirectFB sometime :-)

Yeah, I know about it, but the last time I looked at it I couldn't get it to 
run properly (on-board video chip, didn't do the right bit depths for the 
slider demo).  Although that could of been a different toolkit.  Sounds as if 
what I am looking for doesn't exist yet in DirectFB.  Thats OK, I have done a 
lot of work with style, theming, and even skinning engines.  I don't mind 
doing it myself.

Sorry for taking so long to reply.  I was going to do something on this on the 
weekend, but my monitor started de-gausing every 5 seconds...  Might be a 
while before I can do any development at home.

--
Ian.


Reply via email to