gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnustep on windows


From: Fred Kiefer
Subject: Re: gnustep on windows
Date: Mon, 03 Mar 2008 21:06:52 +0100
User-agent: Thunderbird 2.0.0.9 (X11/20070801)

Christopher Armstrong wrote:
> Hi Paul
> 
> Thought I'd chime in on the conversation :-).
>  
>>> When programming with GNUstep you will be working against the GNUstep
>>> drawing API, not cairo or GDI. It is true that the implementation of
>>> this API for cairo is more complete, but even that may be changed.
>> Oh, I know, but it doesn't make a lot of sense to maintain multiple
>> backends when one will serve. Also GDI vector drawing looks ugly and
>> Cairo looks nice... so I'd prefer to use Cairo. That way, my results
>> should be pretty much the same on Windows and Linux. 
> 
> I agree with using cairo. From what I can ascertain, they call GDI where
> possible and do custom drawing where GDI fails to support it -
> effectively a GDI backend of their own. If we can just pass a HDC to
> cairo and let it do the drawing, this means we can take advantage of
> their improvements to *their* GDI backend. 
> 
> They're API has already been integrated with GNUstep at one point so it
> shouldn't be difficult to do it again.
> 
>>> You might be talking about [Camaelon][1] (spelling is important).
>> I have read a bit about Camaelon, but my understanding is that it's a
>> theming engine rather than an API. I also have the impression that it's a
>> bit slow because it's pixmap-based. I was looking at the Narcissus theme
>> engine, but the developer made the comment that his patch to NSScroller
>> to enable theming of the scroller was rejected because it didn't conform
>> to the theming API that had been planned. I haven't really been able to
>> find out much about this API, however. 
> 
> I'm not sure what theming API had been planned, but I'm sure if you were
> to write one it would be accepted. I think there is alot of ideas
> floating around but none have been really fleshed out as code yet. The
> current API and theming code in GNUstep itself suggests using a grid of
> pixmaps for each UI element that are stretched and tiled onto the GUI.
> 
> I have been toying with theming on and off for the past couple of years.
> I haven't really got that far, but I'm some way to developing an API. I
> have been trying to integrate Windows theming into GNUstep, which isn't
> all that hard really, its just trying to understand the MS documentation
> and work out the best way to match it to GNUstep. The hard part is doing
> the Windows 2000 theming because Microsoft doesn't store this as a
> theme, but rather requires you to paint it yourself.
> 
> Please find attached what I have at the moment (be warned: it is a bit
> messy and incomplete). Your free to play with it or pitch any questions
> you have about it to me.
> 

Just one comment on this impressive patch. You seem to override some
system colour methods on NSColor to use the Windows colour settings in
GNUstep. This is the wrong approach to do so. You should be generating a
new system colour list and send that via the themeDidActivate
notification of your theme. That way even system colours loaded from a
NIB file would be displayed correctly.

All you have to do is create the list:

list = [[NSColorList alloc] initWithName: @"System"];

and to add your colours to it:

[list setColor: Win32ToGSColor(COLOR_WINDOWTEXT)
        forKey: @"controlTextColor"];


Cheers,
Fred





reply via email to

[Prev in Thread] Current Thread [Next in Thread]