darling-cocotron/AppKit/NSAffineTransform.m
Christopher Lloyd a73db3310f - split CoreGraphics out into it's own framework project. AppKit still embeds CoreGraphics but it is also built standalone on Foundation. (don't link against both)
- new experimental AppKit-MacOS-i386 target which sits on Apple's Foundation, ApplicationServices (not operational). Header&api usage fixes to clean this up.
- Redid NSBezierPath so it doesn't rely on private Cocotron CoreGraphics API.
- Change the NSRaise macros/functions to be inline so AppKit can just include it instead of depending on them in Foundation since they aren't present in OSX.
- split NSRaiseException() into it's own Foundation private header and removed use from AppKit.
- changed use of NSRangeEntries so AppKit can embed it on MacOS
- switched NSOutlineView use of NSInt*CallBacks to NSInteger*CallBacks
- added CGPDFContext and CGDataConsumer
2009-06-05 03:16:46 +00:00

45 lines
1.1 KiB
Objective-C

#import <AppKit/NSAffineTransform.h>
#import <AppKit/NSBezierPath.h>
#import <ApplicationServices/ApplicationServices.h>
#import <AppKit/NSGraphicsContext.h>
@implementation NSAffineTransform(AppKit)
-(void)concat {
NSAffineTransformStruct atStruct=[self transformStruct];
CGAffineTransform cgMatrix;
cgMatrix.a=atStruct.m11;
cgMatrix.b=atStruct.m12;
cgMatrix.c=atStruct.m21;
cgMatrix.d=atStruct.m22;
cgMatrix.tx=atStruct.tX;
cgMatrix.ty=atStruct.tY;
CGContextConcatCTM([[NSGraphicsContext currentContext] graphicsPort],cgMatrix);
}
-(void)set {
NSAffineTransformStruct atStruct=[self transformStruct];
CGAffineTransform cgMatrix;
cgMatrix.a=atStruct.m11;
cgMatrix.b=atStruct.m12;
cgMatrix.c=atStruct.m21;
cgMatrix.d=atStruct.m22;
cgMatrix.tx=atStruct.tX;
cgMatrix.ty=atStruct.tY;
CGContextSetCTM([[NSGraphicsContext currentContext] graphicsPort],cgMatrix);
}
-(NSBezierPath *)transformBezierPath:(NSBezierPath *)bezierPath {
NSBezierPath *result=[[bezierPath copy] autorelease];
[result transformUsingAffineTransform:self];
return result;
}
@end