discuss-gnustep
[Top][All Lists]
Advanced

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

GNUstep themeing and MacOS HITheme APIs...


From: M. Uli Kusterer
Subject: GNUstep themeing and MacOS HITheme APIs...
Date: Fri, 05 Nov 2004 03:33:36 +0100
User-agent: MT-NewsWatcher/3.4 (PPC Mac OS X)

Folks,

 have any of you seen the new (as of 10.3) HITheme APIs in MacOS X? 
They're CoreFoundation APIs (i.e. procedural C), but I think they're 
nicely complete.

 It wouldn't be too hard to implement these APIs for GNUstep, I think. 
They use HIRects, which are the same as an NSRect. And CGContextRef is 
an opaque data structure that can be gotten out of an NSGraphicsContext 
using its graphicsPort method. If the latter was implemented as

   -(void*) graphicsPort
   {
      return self;
   }

You could essentially rewrite all those functions like:

HIThemeDrawButton(
  const NSRect *                 inBounds,
  const HIThemeButtonDrawInfo *  inDrawInfo,
  NSGraphicsContext*             inContext,
  HIThemeOrientation             inOrientation,
  NSRect *                       outLabelRect);

Where all the remaining HIxxx types are specific to keeping drawing 
state for themeing anyway. Now, if we moved these functions into a 
loadable bundle, we could probably implement theme-switching nicely (you 
couldn't switch themes at runtime anyway, it could screw up the metrics).

 Agree? Disagree?

If you don't like the C API, HITheme.h would be a good 'checklist' to 
make sure there's no functionality forgotten in GNUstep's themeing 
calls, though.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


reply via email to

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