[Mono-osx] MonoMac NSAttributedString.h
Miguel de Icaza
miguel at novell.com
Wed Apr 21 12:15:02 EDT 2010
I could not find in the bindings for these:
> APPKIT_EXTERN NSString *NSFontAttributeName; // NSFont,
> default Helvetica 12
> APPKIT_EXTERN NSString *NSParagraphStyleAttributeName; //
> NSParagraphStyle, default defaultParagraphStyle
> APPKIT_EXTERN NSString *NSForegroundColorAttributeName; // NSColor,
> default blackColor
> How should these be exposed in the bindings? My guess is it needs to
> follow the same pattern as in CTStringAttributeKey.cs with the call to
> Dlfcn.GetStringConstant. Is that correct?
This is correct. I struggle with this because I feel that we should add
support to the generator for this instead of writing this by hand every
My concern is the following: for a class that has say 200 of those
APPKIT_EXTERN declarations, we have multiple options:
(a) initialize them all in the static constructor, slows down a class
startup for no reason.
(b) initialize them on demand doing an open/find/close per symbol every time
(expensive if you need all keys)
And it just occurred to me that what we could do is open the handle on the
static constructor for the library (to avoid the GetSlowStringConstant
slowness) and load the data on demand.
The remaining issue is: how do we teach the generator about these constants?
Perhaps a [Field] attribute applied to properties?
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-osx