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
00028 @implementation CPGraphicsContext : CPObject
00029 {
00030 CPContext _graphicsPort;
00031 }
00032
00036 + (CPGraphicsContext)currentContext
00037 {
00038 return CPGraphicsContextCurrent;
00039 }
00040
00044 + (void)setCurrentContext:(CPGraphicsContext)aGraphicsContext
00045 {
00046 CPGraphicsContextCurrent = aGraphicsContext;
00047 }
00048
00055 + (CPGraphicsContext)graphicsContextWithGraphicsPort:(CGContext)aContext flipped:(BOOL)aFlag
00056 {
00057 return [[self alloc] initWithGraphicsPort:aContext];
00058 }
00059
00065 - (id)initWithGraphicsPort:(CPContext)aGraphicsPort
00066 {
00067 self = [super init];
00068
00069 if (self)
00070 _graphicsPort = aGraphicsPort;
00071
00072 return self;
00073 }
00074
00078 - (CGContext)graphicsPort
00079 {
00080 return _graphicsPort;
00081 }
00082
00083 @end