jens@0: // jens@0: // GraphicsUtils.h jens@0: // MYUtilities jens@0: // jens@0: // Copyright 2008 Jens Alfke. All rights reserved. jens@0: // jens@0: jens@0: #import jens@0: jens@0: jens@0: @interface NSImage (MYUtilities) jens@0: - (NSImage*) my_shrunkToFitIn: (NSSize) maxSize; jens@0: - (NSSize) my_sizeOfLargestRep; jens@0: - (NSData*) my_JPEGData; jens@2: - (NSData*) my_dataInFormat: (NSBitmapImageFileType)format quality: (float)quality; jens@0: @end jens@0: jens@0: jens@0: @interface NSBezierPath (MYUtilities) jens@0: + (NSBezierPath*) my_bezierPathWithRoundRect: (NSRect)rect radius: (float)radius; jens@0: @end jens@2: jens@2: jens@2: NSArray* OpenWindowsWithDelegateClass( Class klass ); jens@2: jens@2: jens@2: /** Moves/resizes r to fit inside container */ jens@2: NSRect PinRect( NSRect r, NSRect container ); jens@3: jens@3: OSStatus LoadFontsFromBundle( NSBundle *bundle ); jens@3: OSStatus LoadFontsFromPath( NSString* path );