00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 var CPGraphicsContextCurrent = nil;
00024
00029 @implementation CPGraphicsContext : CPObject
00030 {
00031 CPContext _graphicsPort;
00032 }
00033
00037 + (CPGraphicsContext)currentContext
00038 {
00039 return CPGraphicsContextCurrent;
00040 }
00041
00045 + (void)setCurrentContext:(CPGraphicsContext)aGraphicsContext
00046 {
00047 CPGraphicsContextCurrent = aGraphicsContext;
00048 }
00049
00056 + (CPGraphicsContext)graphicsContextWithGraphicsPort:(CGContext)aContext flipped:(BOOL)aFlag
00057 {
00058 return [[self alloc] initWithGraphicsPort:aContext];
00059 }
00060
00066 - (id)initWithGraphicsPort:(CPContext)aGraphicsPort
00067 {
00068 self = [super init];
00069
00070 if (self)
00071 _graphicsPort = aGraphicsPort;
00072
00073 return self;
00074 }
00075
00079 - (CGContext)graphicsPort
00080 {
00081 return _graphicsPort;
00082 }
00083
00084 @end