renamed KG* files to O2* files and appropriate source changes

This commit is contained in:
Christopher Lloyd 2009-11-18 04:48:58 +00:00
parent 2dffa9d8d0
commit e812c6fc0f
170 changed files with 2856 additions and 2856 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
#import "KTFont_gdi.h"
#import <CoreGraphics/KGFont.h>
#import "KGContext_gdi.h"
#import <CoreGraphics/O2Font.h>
#import "O2Context_gdi.h"
#import "Win32Display.h"
#import "Win32Font.h"
#import "KGFont_gdi.h"
#import "O2Font_gdi.h"
#import <CoreGraphics/O2MutablePath.h>
#import <AppKit/NSRaise.h>
@ -94,7 +94,7 @@ static inline CGGlyphMetrics *glyphInfoForGlyph(KTFont_gdi *self,CGGlyph glyph){
return;
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
Win32Font *gdiFont=[(O2Font_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
NSRange range=NSMakeRange(0,MAXUNICHAR);
unichar characters[range.length];
unsigned short glyphs[range.length];
@ -159,7 +159,7 @@ static inline CGGlyphMetrics *glyphInfoForGlyph(KTFont_gdi *self,CGGlyph glyph){
-(void)fetchGlyphKerning {
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
Win32Font *gdiFont=[(O2Font_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
int i,numberOfPairs=GetKerningPairs(dc,0,NULL);
KERNINGPAIR pairs[numberOfPairs];
@ -222,7 +222,7 @@ static inline CGGlyphMetrics *fetchGlyphInfoIfNeeded(KTFont_gdi *self,CGGlyph gl
-(void)fetchAdvancementsForGlyph:(CGGlyph)glyph {
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
Win32Font *gdiFont=[(O2Font_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
ABCFLOAT *abc;
int i,max;
@ -281,7 +281,7 @@ static inline CGGlyphMetrics *fetchGlyphAdvancementIfNeeded(KTFont_gdi *self,CGG
-(void)fetchMetrics {
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
Win32Font *gdiFont=[(O2Font_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
TEXTMETRIC gdiMetrics;
GetTextMetrics(dc,&gdiMetrics);
@ -591,7 +591,7 @@ NSLog(@"name=%@,size=%f",[NSString stringWithCString:fontData. elfLogFont.lfFace
-(O2Path *)createPathForGlyph:(CGGlyph)glyph transform:(CGAffineTransform *)xform {
O2MutablePath *result=[[O2MutablePath alloc] init];
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
Win32Font *gdiFont=[(O2Font_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
int size=GetOutlineTextMetricsA(dc,0,NULL);
if(size<=0){

View File

@ -1,6 +1,6 @@
#import "NSGraphicsStyle_uxtheme.h"
#import <AppKit/NSGraphicsContext.h>
#import <CoreGraphics/KGContext.h>
#import <CoreGraphics/O2Context.h>
#import <AppKit/NSImage.h>
#import <AppKit/NSColor.h>
#import "Win32DeviceContextWindow.h"
@ -109,7 +109,7 @@ static BOOL drawThemeBackground(HANDLE theme,HDC dc,int partId,int stateId,const
@implementation NSGraphicsStyle_uxtheme
-(HANDLE)themeForClassList:(LPCWSTR)classList deviceContext:(KGDeviceContext_gdi *)deviceContext {
-(HANDLE)themeForClassList:(LPCWSTR)classList deviceContext:(O2DeviceContext_gdi *)deviceContext {
HWND windowHandle=[[deviceContext windowDeviceContext] windowHandle];
if(windowHandle==NULL)
@ -143,13 +143,13 @@ static inline RECT transformToRECT(O2AffineTransform matrix,NSRect rect) {
return context;
}
-(KGDeviceContext_gdi *)deviceContext {
-(O2DeviceContext_gdi *)deviceContext {
O2Context *context=[[NSGraphicsContext currentContext] graphicsPort];
if([context respondsToSelector:@selector(deviceContext)]){
KGDeviceContext_gdi *result=[context performSelector:@selector(deviceContext)];
O2DeviceContext_gdi *result=[context performSelector:@selector(deviceContext)];
if([result isKindOfClass:[KGDeviceContext_gdi class]])
if([result isKindOfClass:[O2DeviceContext_gdi class]])
return result;
}
@ -157,7 +157,7 @@ static inline RECT transformToRECT(O2AffineTransform matrix,NSRect rect) {
}
-(BOOL)sizeOfPartId:(int)partId stateId:(int)stateId uxthClassId:(int)uxthClassId size:(NSSize *)result {
KGDeviceContext_gdi *deviceContext=[self deviceContext];
O2DeviceContext_gdi *deviceContext=[self deviceContext];
HANDLE theme;
if(deviceContext==nil)
@ -177,7 +177,7 @@ static inline RECT transformToRECT(O2AffineTransform matrix,NSRect rect) {
}
-(BOOL)drawPartId:(int)partId stateId:(int)stateId uxthClassId:(int)uxthClassId inRect:(NSRect)rect {
KGDeviceContext_gdi *deviceContext=[self deviceContext];
O2DeviceContext_gdi *deviceContext=[self deviceContext];
HANDLE theme;
if(deviceContext==nil)

View File

@ -5,16 +5,16 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/KGContext_builtin.h>
#import <CoreGraphics/O2Context_builtin.h>
#import <windows.h>
@class Win32Font,KGDeviceContext_gdi;
@class Win32Font,O2DeviceContext_gdi;
@interface KGContext_builtin_gdi : O2Context_builtin {
@interface O2Context_builtin_gdi : O2Context_builtin {
HDC _dc;
Win32Font *_gdiFont;
}
-(KGDeviceContext_gdi *)deviceContext;
-(O2DeviceContext_gdi *)deviceContext;
@end

View File

@ -5,16 +5,16 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGContext_builtin_gdi.h"
#import <CoreGraphics/KGGraphicsState.h>
#import "KGSurface_DIBSection.h"
#import "KGDeviceContext_gdi.h"
#import "KGFont_gdi.h"
#import "O2Context_builtin_gdi.h"
#import <CoreGraphics/O2GraphicsState.h>
#import "O2Surface_DIBSection.h"
#import "O2DeviceContext_gdi.h"
#import "O2Font_gdi.h"
#import <CoreGraphics/O2ColorSpace.h>
#import <CoreGraphics/O2Color.h>
#import <AppKit/Win32Font.h>
@implementation KGContext_builtin_gdi
@implementation O2Context_builtin_gdi
static inline O2GState *currentState(O2Context *self){
return [self->_stateStack lastObject];
@ -26,8 +26,8 @@ static inline BOOL transformIsFlipped(O2AffineTransform matrix){
-initWithSurface:(O2Surface *)surface flipped:(BOOL)flipped {
[super initWithSurface:surface flipped:flipped];
if([[self surface] isKindOfClass:[KGSurface_DIBSection class]])
_dc=[[(KGSurface_DIBSection *)[self surface] deviceContext] dc];
if([[self surface] isKindOfClass:[O2Surface_DIBSection class]])
_dc=[[(O2Surface_DIBSection *)[self surface] deviceContext] dc];
_gdiFont=nil;
return self;
}
@ -41,8 +41,8 @@ static inline BOOL transformIsFlipped(O2AffineTransform matrix){
return _dc;
}
-(KGDeviceContext_gdi *)deviceContext {
return [(KGSurface_DIBSection *)[self surface] deviceContext];
-(O2DeviceContext_gdi *)deviceContext {
return [(O2Surface_DIBSection *)[self surface] deviceContext];
}
-(void)deviceClipReset {
@ -70,7 +70,7 @@ static inline BOOL transformIsFlipped(O2AffineTransform matrix){
if(gState->_fontIsDirty){
[gState clearFontIsDirty];
[_gdiFont release];
_gdiFont=[(KGFont_gdi *)[gState font] createGDIFontSelectedInDC:_dc pointSize:[gState pointSize]];
_gdiFont=[(O2Font_gdi *)[gState font] createGDIFontSelectedInDC:_dc pointSize:[gState pointSize]];
}
}

View File

@ -6,19 +6,19 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/KGContext.h>
#import <CoreGraphics/O2Context.h>
#import <windows.h>
@class KGDeviceContext_gdi,Win32Font;
@class O2DeviceContext_gdi,Win32Font;
@interface KGContext_gdi : O2Context {
KGDeviceContext_gdi *_deviceContext;
@interface O2Context_gdi : O2Context {
O2DeviceContext_gdi *_deviceContext;
HDC _dc;
BOOL _isAdvanced;
Win32Font *_gdiFont;
}
-initWithGraphicsState:(O2GState *)state deviceContext:(KGDeviceContext_gdi *)deviceContext;
-initWithGraphicsState:(O2GState *)state deviceContext:(O2DeviceContext_gdi *)deviceContext;
-initWithHWND:(HWND)handle;
-initWithPrinterDC:(HDC)printer auxiliaryInfo:(NSDictionary *)auxiliaryInfo;
@ -28,7 +28,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(HWND)windowHandle;
-(HFONT)fontHandle;
-(KGDeviceContext_gdi *)deviceContext;
-(O2DeviceContext_gdi *)deviceContext;
@end

View File

@ -5,26 +5,26 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGContext_gdi.h"
#import "O2Context_gdi.h"
#import "Win32Window.h"
#import "Win32DeviceContextPrinter.h"
#import "KGDeviceContext_gdi_ddb.h"
#import "KGDeviceContext_gdiDIBSection.h"
#import "KGSurface_DIBSection.h"
#import "O2DeviceContext_gdi_ddb.h"
#import "O2DeviceContext_gdiDIBSection.h"
#import "O2Surface_DIBSection.h"
#import "Win32DeviceContextWindow.h"
#import <CoreGraphics/KGGraphicsState.h>
#import <AppKit/KGDeviceContext_gdi.h>
#import <CoreGraphics/O2GraphicsState.h>
#import <AppKit/O2DeviceContext_gdi.h>
#import <CoreGraphics/O2MutablePath.h>
#import <CoreGraphics/O2Color.h>
#import <CoreGraphics/O2ColorSpace.h>
#import <CoreGraphics/KGDataProvider.h>
#import <CoreGraphics/KGShading.h>
#import <CoreGraphics/KGFunction.h>
#import <CoreGraphics/KGContext_builtin.h>
#import <CoreGraphics/KGPDFContext.h>
#import "KGFont_gdi.h"
#import <CoreGraphics/KGImage.h>
#import <CoreGraphics/KGClipPhase.h>
#import <CoreGraphics/O2DataProvider.h>
#import <CoreGraphics/O2Shading.h>
#import <CoreGraphics/O2Function.h>
#import <CoreGraphics/O2Context_builtin.h>
#import <CoreGraphics/O2PDFContext.h>
#import "O2Font_gdi.h"
#import <CoreGraphics/O2Image.h>
#import <CoreGraphics/O2ClipPhase.h>
#import <AppKit/Win32Font.h>
#import <AppKit/NSRaise.h>
@ -88,7 +88,7 @@ static RECT NSRectToRECT(NSRect rect) {
return result;
}
@implementation KGContext_gdi
@implementation O2Context_gdi
static inline O2GState *currentState(O2Context *self){
return [self->_stateStack lastObject];
@ -107,7 +107,7 @@ static inline O2GState *currentState(O2Context *self){
return NO;
}
-initWithGraphicsState:(O2GState *)state deviceContext:(KGDeviceContext_gdi *)deviceContext {
-initWithGraphicsState:(O2GState *)state deviceContext:(O2DeviceContext_gdi *)deviceContext {
[self initWithGraphicsState:state];
_deviceContext=[deviceContext retain];
_dc=[_deviceContext dc];
@ -117,7 +117,7 @@ static inline O2GState *currentState(O2Context *self){
}
-initWithHWND:(HWND)handle {
KGDeviceContext_gdi *deviceContext=[[[Win32DeviceContextWindow alloc] initWithWindowHandle:handle] autorelease];
O2DeviceContext_gdi *deviceContext=[[[Win32DeviceContextWindow alloc] initWithWindowHandle:handle] autorelease];
NSSize size=[deviceContext pixelSize];
O2AffineTransform flip={1,0,0,-1,0,size.height};
O2GState *initialState=[[[O2GState alloc] initWithDeviceTransform:flip] autorelease];
@ -126,7 +126,7 @@ static inline O2GState *currentState(O2Context *self){
}
-initWithPrinterDC:(HDC)printer auxiliaryInfo:(NSDictionary *)auxiliaryInfo {
KGDeviceContext_gdi *deviceContext=[[[Win32DeviceContextPrinter alloc] initWithDC:printer] autorelease];
O2DeviceContext_gdi *deviceContext=[[[Win32DeviceContextPrinter alloc] initWithDC:printer] autorelease];
NSSize pointSize=[deviceContext pointSize];
NSSize pixelsPerInch=[deviceContext pixelsPerInch];
O2AffineTransform flip={1,0,0,-1,0, pointSize.height};
@ -148,7 +148,7 @@ static inline O2GState *currentState(O2Context *self){
-initWithSize:(NSSize)size window:(CGWindow *)window {
HWND handle=[(Win32Window *)window windowHandle];
KGDeviceContext_gdi *deviceContext=[[[Win32DeviceContextWindow alloc] initWithWindowHandle:handle] autorelease];
O2DeviceContext_gdi *deviceContext=[[[Win32DeviceContextWindow alloc] initWithWindowHandle:handle] autorelease];
O2AffineTransform flip={1,0,0,-1,0,size.height};
O2GState *initialState=[[[O2GState alloc] initWithDeviceTransform:flip] autorelease];
@ -156,9 +156,9 @@ static inline O2GState *currentState(O2Context *self){
}
-initWithSize:(NSSize)size context:(O2Context *)otherX {
KGContext_gdi *other=(KGContext_gdi *)otherX;
// KGDeviceContext_gdi *deviceContext=[[[KGDeviceContext_gdi_ddb alloc] initWithSize:size deviceContext:[other deviceContext]] autorelease];
KGDeviceContext_gdi *deviceContext=[[[KGDeviceContext_gdiDIBSection alloc] initWithWidth:size.width height:size.height deviceContext:[other deviceContext]] autorelease];
O2Context_gdi *other=(O2Context_gdi *)otherX;
// O2DeviceContext_gdi *deviceContext=[[[O2DeviceContext_gdi_ddb alloc] initWithSize:size deviceContext:[other deviceContext]] autorelease];
O2DeviceContext_gdi *deviceContext=[[[O2DeviceContext_gdiDIBSection alloc] initWithWidth:size.width height:size.height deviceContext:[other deviceContext]] autorelease];
O2AffineTransform flip={1,0,0,-1,0,size.height};
O2GState *initialState=[[[O2GState alloc] initWithDeviceTransform:flip] autorelease];
@ -172,7 +172,7 @@ static inline O2GState *currentState(O2Context *self){
}
-(O2Surface *)createSurfaceWithWidth:(size_t)width height:(size_t)height {
return [[KGSurface_DIBSection alloc] initWithWidth:width height:height compatibleWithDeviceContext:[self deviceContext]];
return [[O2Surface_DIBSection alloc] initWithWidth:width height:height compatibleWithDeviceContext:[self deviceContext]];
}
-(NSSize)pointSize {
@ -191,7 +191,7 @@ static inline O2GState *currentState(O2Context *self){
return [_gdiFont fontHandle];
}
-(KGDeviceContext_gdi *)deviceContext {
-(O2DeviceContext_gdi *)deviceContext {
return _deviceContext;
}
@ -316,7 +316,7 @@ static inline O2GState *currentState(O2Context *self){
if(gState->_fontIsDirty){
[gState clearFontIsDirty];
[_gdiFont release];
_gdiFont=[(KGFont_gdi *)[gState font] createGDIFontSelectedInDC:_dc pointSize:[gState pointSize]];
_gdiFont=[(O2Font_gdi *)[gState font] createGDIFontSelectedInDC:_dc pointSize:[gState pointSize]];
}
}
@ -1085,7 +1085,7 @@ static void zeroBytes(void *bytes,int size){
[self drawBitmapImage:image inRect:rect ctm:transformToDevice fraction:fraction];
}
-(void)drawDeviceContext:(KGDeviceContext_gdi *)deviceContext inRect:(NSRect)rect ctm:(O2AffineTransform)ctm {
-(void)drawDeviceContext:(O2DeviceContext_gdi *)deviceContext inRect:(NSRect)rect ctm:(O2AffineTransform)ctm {
rect.origin=O2PointApplyAffineTransform(rect.origin,ctm);
if(transformIsFlipped(ctm))
@ -1097,11 +1097,11 @@ static void zeroBytes(void *bytes,int size){
-(void)drawLayer:(O2Layer *)layer inRect:(NSRect)rect {
O2ContextRef context=O2LayerGetContext(layer);
if(![context isKindOfClass:[KGContext_gdi class]]){
if(![context isKindOfClass:[O2Context_gdi class]]){
NSLog(@"layer class is not right %@!=%@",[context class],[self class]);
return;
}
KGDeviceContext_gdi *deviceContext=[(KGContext_gdi *)context deviceContext];
O2DeviceContext_gdi *deviceContext=[(O2Context_gdi *)context deviceContext];
[self drawDeviceContext:deviceContext inRect:rect ctm:currentState(self)->_deviceSpaceTransform];
}
@ -1131,7 +1131,7 @@ static void zeroBytes(void *bytes,int size){
}
-(BOOL)getImageableRect:(NSRect *)rect {
KGDeviceContext_gdi *deviceContext=[self deviceContext];
O2DeviceContext_gdi *deviceContext=[self deviceContext];
if(deviceContext==nil)
return NO;
@ -1140,15 +1140,15 @@ static void zeroBytes(void *bytes,int size){
}
-(void)drawBackingContext:(O2Context *)other size:(NSSize)size {
KGDeviceContext_gdi *deviceContext=nil;
O2DeviceContext_gdi *deviceContext=nil;
if([other isKindOfClass:[KGContext_gdi class]])
deviceContext=[(KGContext_gdi *)other deviceContext];
if([other isKindOfClass:[O2Context_gdi class]])
deviceContext=[(O2Context_gdi *)other deviceContext];
else {
O2Surface *surface=[other surface];
if([surface isKindOfClass:[KGSurface_DIBSection class]])
deviceContext=[(KGSurface_DIBSection *)surface deviceContext];
if([surface isKindOfClass:[O2Surface_DIBSection class]])
deviceContext=[(O2Surface_DIBSection *)surface deviceContext];
}
if(deviceContext!=nil)

View File

@ -14,7 +14,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
@class Win32DeviceContextWindow,O2Path;
@interface KGDeviceContext_gdi : NSObject {
@interface O2DeviceContext_gdi : NSObject {
HDC _dc;
}

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <AppKit/KGDeviceContext_gdi.h>
#import <AppKit/O2DeviceContext_gdi.h>
#import <CoreGraphics/O2Path.h>
#import <CoreGraphics/O2Color.h>
#import <CoreGraphics/O2ColorSpace.h>
@ -70,7 +70,7 @@ COLORREF COLORREFFromColor(O2Color *color){
}
}
@implementation KGDeviceContext_gdi
@implementation O2DeviceContext_gdi
-initWithDC:(HDC)dc {
_dc=dc;

View File

@ -6,11 +6,11 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <AppKit/KGDeviceContext_gdi.h>
#import <AppKit/O2DeviceContext_gdi.h>
#import <Foundation/NSGeometry.h>
@interface KGDeviceContext_gdiDIBSection : KGDeviceContext_gdi {
KGDeviceContext_gdi *_compatible;
@interface O2DeviceContext_gdiDIBSection : O2DeviceContext_gdi {
O2DeviceContext_gdi *_compatible;
HBITMAP _bitmap;
int _bitsPerPixel;
size_t _bitsPerComponent;
@ -18,8 +18,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
void *_bits;
}
-initWithWidth:(size_t)width height:(size_t)height deviceContext:(KGDeviceContext_gdi *)compatible bitsPerPixel:(int)bpp;
-initWithWidth:(size_t)width height:(size_t)height deviceContext:(KGDeviceContext_gdi *)compatible;
-initWithWidth:(size_t)width height:(size_t)height deviceContext:(O2DeviceContext_gdi *)compatible bitsPerPixel:(int)bpp;
-initWithWidth:(size_t)width height:(size_t)height deviceContext:(O2DeviceContext_gdi *)compatible;
-(void *)bitmapBytes;

View File

@ -6,13 +6,13 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <AppKit/KGDeviceContext_gdiDIBSection.h>
#import <AppKit/O2DeviceContext_gdiDIBSection.h>
#import <AppKit/Win32Display.h>
#import <AppKit/KGContext_gdi.h>
#import <AppKit/O2Context_gdi.h>
@implementation KGDeviceContext_gdiDIBSection
@implementation O2DeviceContext_gdiDIBSection
-initWithWidth:(size_t)width height:(size_t)height deviceContext:(KGDeviceContext_gdi *)compatible bitsPerPixel:(int)bpp {
-initWithWidth:(size_t)width height:(size_t)height deviceContext:(O2DeviceContext_gdi *)compatible bitsPerPixel:(int)bpp {
[self initWithDC:CreateCompatibleDC([compatible dc])];
_compatible=[compatible retain];
@ -50,7 +50,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return self;
}
-initWithWidth:(size_t)width height:(size_t)height deviceContext:(KGDeviceContext_gdi *)compatible {
-initWithWidth:(size_t)width height:(size_t)height deviceContext:(O2DeviceContext_gdi *)compatible {
return [self initWithWidth:width height:height deviceContext:compatible bitsPerPixel:0];
}

View File

@ -6,14 +6,14 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <AppKit/KGDeviceContext_gdi.h>
#import <AppKit/O2DeviceContext_gdi.h>
#import <Foundation/NSGeometry.h>
@interface KGDeviceContext_gdi_ddb : KGDeviceContext_gdi {
KGDeviceContext_gdi *_compatible;
@interface O2DeviceContext_gdi_ddb : O2DeviceContext_gdi {
O2DeviceContext_gdi *_compatible;
HBITMAP _bitmap;
}
-initWithSize:(NSSize)size deviceContext:(KGDeviceContext_gdi *)compatible;
-initWithSize:(NSSize)size deviceContext:(O2DeviceContext_gdi *)compatible;
@end

View File

@ -6,13 +6,13 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <AppKit/KGDeviceContext_gdi_ddb.h>
#import <AppKit/O2DeviceContext_gdi_ddb.h>
#import <AppKit/Win32Display.h>
#import <AppKit/KGContext_gdi.h>
#import <AppKit/O2Context_gdi.h>
@implementation KGDeviceContext_gdi_ddb
@implementation O2DeviceContext_gdi_ddb
-initWithSize:(NSSize)size deviceContext:(KGDeviceContext_gdi *)compatible {
-initWithSize:(NSSize)size deviceContext:(O2DeviceContext_gdi *)compatible {
[self initWithDC:CreateCompatibleDC([compatible dc])];
_compatible=[compatible retain];
_bitmap=CreateCompatibleBitmap([compatible dc],size.width,size.height);

View File

@ -1,9 +1,9 @@
#import <CoreGraphics/KGFont.h>
#import <CoreGraphics/O2Font.h>
#import <windows.h>
@class Win32Font;
@interface KGFont_gdi : O2Font {
@interface O2Font_gdi : O2Font {
BOOL _useMacMetrics;
unichar *_glyphsToCharacters;
}

View File

@ -1,4 +1,4 @@
#import "KGFont_gdi.h"
#import "O2Font_gdi.h"
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#import <windows.h>
@ -8,16 +8,16 @@
@implementation O2Font(GDI)
+allocWithZone:(NSZone *)zone {
return NSAllocateObject([KGFont_gdi class],0,NULL);
return NSAllocateObject([O2Font_gdi class],0,NULL);
}
@end
@interface KGFont_gdi(forward)
@interface O2Font_gdi(forward)
-(void)fetchGlyphsToCharacters;
@end
@implementation KGFont_gdi
@implementation O2Font_gdi
static HFONT Win32FontHandleWithName(NSString *name,int unitsPerEm){
const unichar *wideName=(const unichar *)[name cStringUsingEncoding:NSUnicodeStringEncoding];

View File

@ -5,16 +5,16 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/KGSurface.h>
#import <CoreGraphics/O2Surface.h>
@class KGDeviceContext_gdi,KGDeviceContext_gdiDIBSection;
@class O2DeviceContext_gdi,O2DeviceContext_gdiDIBSection;
@interface KGSurface_DIBSection : O2Surface {
KGDeviceContext_gdiDIBSection *_deviceContext;
@interface O2Surface_DIBSection : O2Surface {
O2DeviceContext_gdiDIBSection *_deviceContext;
}
-initWithWidth:(size_t)width height:(size_t)height compatibleWithDeviceContext:(KGDeviceContext_gdi *)compatible;
-initWithWidth:(size_t)width height:(size_t)height compatibleWithDeviceContext:(O2DeviceContext_gdi *)compatible;
-(KGDeviceContext_gdi *)deviceContext;
-(O2DeviceContext_gdi *)deviceContext;
@end

View File

@ -5,14 +5,14 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGSurface_DIBSection.h"
#import "KGDeviceContext_gdiDIBSection.h"
#import "O2Surface_DIBSection.h"
#import "O2DeviceContext_gdiDIBSection.h"
#import <CoreGraphics/O2ColorSpace.h>
@implementation KGSurface_DIBSection
@implementation O2Surface_DIBSection
-initWithWidth:(size_t)width height:(size_t)height compatibleWithDeviceContext:(KGDeviceContext_gdi *)compatible {
_deviceContext=[[KGDeviceContext_gdiDIBSection alloc] initWithWidth:width height:height deviceContext:compatible];
-initWithWidth:(size_t)width height:(size_t)height compatibleWithDeviceContext:(O2DeviceContext_gdi *)compatible {
_deviceContext=[[O2DeviceContext_gdiDIBSection alloc] initWithWidth:width height:height deviceContext:compatible];
if(_deviceContext==nil){
[super dealloc];
@ -35,7 +35,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
[super dealloc];
}
-(KGDeviceContext_gdi *)deviceContext {
-(O2DeviceContext_gdi *)deviceContext {
return _deviceContext;
}

View File

@ -6,10 +6,10 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <AppKit/KGDeviceContext_gdi.h>
#import <AppKit/O2DeviceContext_gdi.h>
#import <Foundation/NSGeometry.h>
@interface Win32DeviceContextPrinter : KGDeviceContext_gdi
@interface Win32DeviceContextPrinter : O2DeviceContext_gdi
-(NSSize)pageSize;

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <AppKit/KGDeviceContext_gdi.h>
#import <AppKit/O2DeviceContext_gdi.h>
enum {
uxthBUTTON,
@ -23,7 +23,7 @@ enum {
uxthNumClasses
};
@interface Win32DeviceContextWindow : KGDeviceContext_gdi {
@interface Win32DeviceContextWindow : O2DeviceContext_gdi {
HWND _handle;
HANDLE _theme[uxthNumClasses];
}

View File

@ -15,7 +15,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <windows.h>
@class NSEvent, NSColor, Win32EventInputSource,KGContext_gdi;
@class NSEvent, NSColor, Win32EventInputSource,O2Context_gdi;
@interface Win32Display : NSDisplay {
Win32EventInputSource *_eventInputSource;

View File

@ -9,9 +9,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <AppKit/Win32Event.h>
#import <AppKit/Win32Window.h>
#import <AppKit/Win32Cursor.h>
#import <AppKit/KGContext_gdi.h>
#import <AppKit/O2Context_gdi.h>
#import <AppKit/Win32DeviceContextWindow.h>
#import <CoreGraphics/KGGraphicsState.h>
#import <CoreGraphics/O2GraphicsState.h>
#import <AppKit/Win32EventInputSource.h>
#import <AppKit/NSScreen.h>
@ -913,7 +913,7 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old,
return NSCancelButton;
else {
NSDictionary *auxiliaryInfo=[NSDictionary dictionaryWithObject:[attributes objectForKey:@"_title"] forKey:(id)kCGPDFContextTitle];
KGContext_gdi *context=[[[KGContext_gdi alloc] initWithPrinterDC:printProperties.hDC auxiliaryInfo:auxiliaryInfo] autorelease];
O2Context_gdi *context=[[[O2Context_gdi alloc] initWithPrinterDC:printProperties.hDC auxiliaryInfo:auxiliaryInfo] autorelease];
NSRect imageable;
if([context getImageableRect:&imageable])

View File

@ -12,8 +12,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <AppKit/Win32Event.h>
#import <AppKit/Win32Display.h>
#import <Foundation/NSString_win32.h>
#import <CoreGraphics/KGContext.h>
#import <AppKit/KGContext_gdi.h>
#import <CoreGraphics/O2Context.h>
#import <AppKit/O2Context_gdi.h>
#import <AppKit/NSWindow.h>
#import <AppKit/NSPanel.h>
@ -351,7 +351,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
SIZE sizeWnd = {_size.width, _size.height};
POINT ptSrc = {0, 0};
UpdateLayeredWindow([self windowHandle], NULL, NULL, &sizeWnd, [(KGContext_gdi *)_backingContext dc], &ptSrc, 0, &blend, ULW_ALPHA);
UpdateLayeredWindow([self windowHandle], NULL, NULL, &sizeWnd, [(O2Context_gdi *)_backingContext dc], &ptSrc, 0, &blend, ULW_ALPHA);
}
else {
switch(_backingType){

View File

@ -7,7 +7,7 @@
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/KGContext.h>
#import <CoreGraphics/O2Context.h>
#import <cairo.h>
#import <X11/Xlib.h>
#import <cairo-xlib.h>

View File

@ -11,10 +11,10 @@
#import <CoreGraphics/O2MutablePath.h>
#import <CoreGraphics/O2Color.h>
#import <Foundation/NSException.h>
#import <CoreGraphics/KGGraphicsState.h>
#import <CoreGraphics/O2GraphicsState.h>
#import <AppKit/TTFFont.h>
#import <CoreGraphics/O2ColorSpace.h>
#import <CoreGraphics/KGSurface.h>
#import <CoreGraphics/O2Surface.h>
#import <AppKit/CairoCacheImage.h>
#import <Foundation/NSException.h>

View File

@ -8,7 +8,7 @@
#import "TTFFont.h"
#import <AppKit/KTFont.h>
#import <CoreGraphics/KGFont.h>
#import <CoreGraphics/O2Font.h>
#import <AppKit/NSFontTypeface.h>
#import <fontconfig.h>

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGBitmapContext.h>
#import "KGBitmapContext.h"
#import "O2BitmapContext.h"
CGContextRef CGBitmapContextCreate(void *bytes,size_t width,size_t height,size_t bitsPerComponent,size_t bytesPerRow,CGColorSpaceRef colorSpace,CGBitmapInfo bitmapInfo) {
return O2BitmapContextCreate(bytes,width,height,bitsPerComponent,bytesPerRow,colorSpace,bitmapInfo);

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE,ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGContext.h>
#import "KGContext.h"
#import "O2Context.h"
#import "O2MutablePath.h"
#import "CGConversions.h"

View File

@ -3,8 +3,8 @@
#import <CoreGraphics/CGPath.h>
#import <CoreGraphics/CGPattern.h>
#import "O2AffineTransform.h"
#import "KGFunction.h"
#import "KGPattern.h"
#import "O2Function.h"
#import "O2Pattern.h"
#import "O2Path.h"
static inline CGAffineTransform CGAffineTransformFromO2(O2AffineTransform xform){

View File

@ -9,7 +9,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <CoreGraphics/CoreGraphicsExport.h>
#import <CoreFoundation/CFData.h>
typedef struct KGDataConsumer *CGDataConsumerRef;
typedef struct O2DataConsumer *CGDataConsumerRef;
COREGRAPHICS_EXPORT CGDataConsumerRef CGDataConsumerCreateWithCFData(CFMutableDataRef data);
COREGRAPHICS_EXPORT void CGDataConsumerRelease(CGDataConsumerRef self);

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGDataConsumer.h>
#import "KGDataConsumer.h"
#import "O2DataConsumer.h"
CGDataConsumerRef CGDataConsumerCreateWithCFData(CFMutableDataRef data) {
return O2DataConsumerCreateWithCFData(data);

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGDataProvider.h>
#import "KGDataProvider.h"
#import "O2DataProvider.h"
CGDataProviderRef CGDataProviderRetain(CGDataProviderRef provider) {
return O2DataProviderRetain(provider);

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGFont.h>
#import "KGFont.h"
#import "O2Font.h"
CGFontRef CGFontCreateWithFontName(CFStringRef name) {
return O2FontCreateWithFontName((NSString *)name);

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGFunction.h>
#import "KGFunction.h"
#import "O2Function.h"
#import "CGConversions.h"
CGFunctionRef CGFunctionRetain(CGFunctionRef self) {

View File

@ -8,7 +8,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <CoreGraphics/CGImage.h>
#import <Foundation/NSString.h>
#import "KGImage.h"
#import "O2Image.h"
CGImageRef CGImageRetain(CGImageRef image) {
return O2ImageRetain(image);

View File

@ -9,7 +9,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import "CoreGraphicsExport.h"
#import <CoreFoundation/CFDictionary.h>
typedef struct KGImageSource *CGImageSourceRef;
typedef struct O2ImageSource *CGImageSourceRef;
#import "CGImage.h"

View File

@ -1,8 +1,8 @@
#import <CoreGraphics/CGImageSource.h>
#import "KGImageSource.h"
#import "O2ImageSource.h"
CGImageSourceRef CGImageSourceCreateWithData(CFDataRef data,CFDictionaryRef options) {
return [KGImageSource newImageSourceWithData:(NSData *)data options:(NSDictionary *)options];
return [O2ImageSource newImageSourceWithData:(NSData *)data options:(NSDictionary *)options];
}
CGImageRef CGImageSourceCreateImageAtIndex(CGImageSourceRef self,size_t index,CFDictionaryRef options) {

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGLayer.h>
#import "KGLayer.h"
#import "O2Layer.h"
CGLayerRef CGLayerRetain(CGLayerRef self) {
return O2LayerRetain(self);

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGPDFContext.h>
#import "KGPDFContext.h"
#import "O2PDFContext.h"
const CFStringRef kCGPDFContextTitle=(CFStringRef)@"kCGPDFContextTitle";

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CoreGraphics.h>
#import "KGPDFDocument.h"
#import "O2PDFDocument.h"
CGPDFDocumentRef CGPDFDocumentRetain(CGPDFDocumentRef self) {
return [self retain];

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGPDFPage.h>
#import "KGPDFPage.h"
#import "O2PDFPage.h"
#import "CGConversions.h"
CGPDFPageRef CGPDFPageRetain(CGPDFPageRef self) {

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGPattern.h>
#import "KGPattern.h"
#import "O2Pattern.h"
#import "CGConversions.h"
CGPatternRef CGPatternRetain(CGPatternRef self) {

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGShading.h>
#import "KGShading.h"
#import "O2Shading.h"
CGShadingRef CGShadingRetain(CGShadingRef self) {
return O2ShadingRetain(self);

View File

@ -6,103 +6,103 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CGWindow.h>
#import "KGExceptions.h"
#import "O2Exceptions.h"
@implementation CGWindow
-(void)setDelegate:delegate {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-delegate {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return nil;
}
-(void)invalidate {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(O2Context *)cgContext {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return nil;
}
-(void)setTitle:(NSString *)title {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)setFrame:(NSRect)frame {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)showWindowForAppActivation:(NSRect)frame {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)hideWindowForAppDeactivation:(NSRect)frame {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)showWindowWithoutActivation {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)hideWindow {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)placeAboveWindow:(CGWindow *)other {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)placeBelowWindow:(CGWindow *)other {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)makeKey {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)captureEvents {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)miniaturize {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)deminiaturize {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(BOOL)isMiniaturized {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return NO;
}
-(void)flushBuffer {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(NSPoint)mouseLocationOutsideOfEventStream {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return NSZeroPoint;
}
-(void)sendEvent:(CGEvent *)event {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)addEntriesToDeviceDictionary:(NSDictionary *)entries {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
@end

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import "NSTIFFImageFileDirectory.h"
#import "NSTIFFReader.h"
#import "KGImageSource.h"
#import "O2ImageSource.h"
#import "O2LZW.h"
@implementation NSTIFFImageFileDirectory

View File

@ -12,8 +12,8 @@ typedef O2BitmapContext *O2BitmapContextRef;
typedef void (*O2BitmapContextReleaseDataCallback)(void *userInfo,void *data);
#import "KGContext.h"
#import "KGImage.h"
#import "O2Context.h"
#import "O2Image.h"
@interface O2BitmapContext : O2Context {
O2Surface *_surface;

View File

@ -6,13 +6,13 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGBitmapContext.h"
#import "KGGraphicsState.h"
#import "KGImage.h"
#import "KGDataProvider.h"
#import "O2BitmapContext.h"
#import "O2GraphicsState.h"
#import "O2Image.h"
#import "O2DataProvider.h"
#import "O2ColorSpace.h"
#import "KGExceptions.h"
#import "KGSurface.h"
#import "O2Exceptions.h"
#import "O2Surface.h"
@implementation O2BitmapContext

View File

@ -1,4 +1,4 @@
#import "KGClipPhase.h"
#import "O2ClipPhase.h"
@implementation O2ClipPhase

View File

@ -15,7 +15,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
typedef O2Color *O2ColorRef;
#import "O2ColorSpace.h"
#import "KGPattern.h"
#import "O2Pattern.h"
@interface O2Color : NSObject {
O2ColorSpaceRef _colorSpace;

View File

@ -1,11 +1,11 @@
#import "O2ColorSpace+PDF.h"
#import "KGPDFObject_Name.h"
#import "KGPDFObject_Integer.h"
#import "KGPDFContext.h"
#import "KGPDFArray.h"
#import "KGPDFStream.h"
#import "KGPDFString.h"
#import "KGPDFDictionary.h"
#import "O2PDFObject_Name.h"
#import "O2PDFObject_Integer.h"
#import "O2PDFContext.h"
#import "O2PDFArray.h"
#import "O2PDFStream.h"
#import "O2PDFString.h"
#import "O2PDFDictionary.h"
@implementation O2ColorSpace(PDF)

View File

@ -81,15 +81,15 @@ typedef enum {
typedef int O2TextDrawingMode;
#import "KGFont.h"
#import "KGLayer.h"
#import "O2Font.h"
#import "O2Layer.h"
#import "O2Color.h"
#import "O2ColorSpace.h"
#import "KGImage.h"
#import "O2Image.h"
#import "O2Path.h"
#import "KGPattern.h"
#import "KGShading.h"
#import "KGPDFPage.h"
#import "O2Pattern.h"
#import "O2Shading.h"
#import "O2PDFPage.h"
@interface O2Context : NSObject {
O2AffineTransform _userToDeviceTransform;

View File

@ -6,16 +6,16 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGContext.h"
#import "KGBitmapContext.h"
#import "KGGraphicsState.h"
#import "O2Context.h"
#import "O2BitmapContext.h"
#import "O2GraphicsState.h"
#import "O2Color.h"
#import "O2ColorSpace.h"
#import "O2MutablePath.h"
#import "KGLayer.h"
#import "KGPDFPage.h"
#import "KGClipPhase.h"
#import "KGExceptions.h"
#import "O2Layer.h"
#import "O2PDFPage.h"
#import "O2ClipPhase.h"
#import "O2Exceptions.h"
#import <Foundation/NSBundle.h>
#import <Foundation/NSArray.h>
@ -27,9 +27,9 @@ static NSMutableArray *possibleContextClasses=nil;
if(possibleContextClasses==nil){
possibleContextClasses=[NSMutableArray new];
[possibleContextClasses addObject:@"KGContext_gdi"];
[possibleContextClasses addObject:@"O2Context_gdi"];
[possibleContextClasses addObject:@"O2Context_builtin"];
[possibleContextClasses addObject:@"KGContext_builtin_gdi"];
[possibleContextClasses addObject:@"O2Context_builtin_gdi"];
NSArray *allPaths=[[NSBundle bundleForClass:self] pathsForResourcesOfType:@"cgContext" inDirectory:nil];
int i,count=[allPaths count];
@ -130,12 +130,12 @@ static NSMutableArray *possibleContextClasses=nil;
}
-initWithSize:(O2Size)size window:(CGWindow *)window {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return nil;
}
-initWithSize:(O2Size)size context:(O2Context *)context {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return nil;
}
@ -230,28 +230,28 @@ static inline O2GState *currentState(O2Context *self){
}
-(void)drawPath:(O2PathDrawingMode)pathMode {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
// reset path in subclass
}
-(void)showGlyphs:(const O2Glyph *)glyphs count:(unsigned)count {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)showText:(const char *)text length:(unsigned)length {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)drawShading:(O2Shading *)shading {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)drawImage:(O2Image *)image inRect:(O2Rect)rect {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)drawLayer:(O2LayerRef)layer inRect:(O2Rect)rect {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)flush {
@ -289,7 +289,7 @@ static inline O2GState *currentState(O2Context *self){
// temporary
-(void)drawBackingContext:(O2Context *)other size:(O2Size)size {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(void)setAntialiasingQuality:(int)value {
@ -305,11 +305,11 @@ static inline O2GState *currentState(O2Context *self){
}
-(void)copyBitsInRect:(O2Rect)rect toPoint:(O2Point)point gState:(int)gState {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
-(NSData *)captureBitmapInRect:(O2Rect)rect {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return nil;
}
@ -456,7 +456,7 @@ void O2ContextAddPath(O2ContextRef self,O2PathRef path) {
}
void O2ContextReplacePathWithStrokedPath(O2ContextRef self) {
KGUnimplementedFunction();
O2UnimplementedFunction();
}
// gstate

View File

@ -26,9 +26,9 @@
*
*-------------------------------------------------------------------*/
#import "KGBitmapContext.h"
#import "O2BitmapContext.h"
#import "VGmath.h"
#import "KGSurface.h"
#import "O2Surface.h"
@class O2Paint;
@ -59,7 +59,7 @@ typedef struct Edge {
typedef void (*O2BlendSpan_RGBA8888)(O2argb8u *src,O2argb8u *dst,int length);
typedef void (*O2BlendSpan_RGBAffff)(O2argb32f *src,O2argb32f *dst,int length);
typedef void (*KGWriteCoverage_RGBA8888)(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBA8888 blendFunction);
typedef void (*O2WriteCoverage_RGBA8888)(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBA8888 blendFunction);
@class O2Surface,O2Context_builtin;
@ -70,7 +70,7 @@ typedef void (*KGWriteCoverage_RGBA8888)(O2Surface *surface,O2Surface *mask,O2Pa
O2BlendSpan_RGBA8888 _blend_lRGBA8888_PRE;
O2BlendSpan_RGBAffff _blend_lRGBAffff_PRE;
KGWriteCoverage_RGBA8888 _writeCoverage_lRGBA8888_PRE;
O2WriteCoverage_RGBA8888 _writeCoverage_lRGBA8888_PRE;
void (*_blendFunction)();
void (*_writeCoverageFunction)();
@ -95,15 +95,15 @@ typedef void (*KGWriteCoverage_RGBA8888)(O2Surface *surface,O2Surface *mask,O2Pa
-(void)setWidth:(size_t)width height:(size_t)height reallocateOnlyIfRequired:(BOOL)roir;
void KGRasterizerDealloc(O2Context_builtin *self);
void KGRasterizerSetViewport(O2Context_builtin *self,int x,int y,int vpwidth,int vpheight);
void KGRasterizerClear(O2Context_builtin *self);
void O2RasterizerDealloc(O2Context_builtin *self);
void O2RasterizerSetViewport(O2Context_builtin *self,int x,int y,int vpwidth,int vpheight);
void O2RasterizerClear(O2Context_builtin *self);
void O2DContextAddEdge(O2Context_builtin *self,const O2Point v0, const O2Point v1);
void KGRasterizerSetShouldAntialias(O2Context_builtin *self,BOOL antialias,int quality);
void KGRasterizerFill(O2Context_builtin *self,int fillRule);
void O2RasterizerSetShouldAntialias(O2Context_builtin *self,BOOL antialias,int quality);
void O2RasterizerFill(O2Context_builtin *self,int fillRule);
void KGRasterizeSetBlendMode(O2Context_builtin *self,O2BlendMode blendMode);
void KGRasterizeSetMask(O2Context_builtin *self,O2Surface* mask);
void O2RasterizeSetBlendMode(O2Context_builtin *self,O2BlendMode blendMode);
void O2RasterizeSetMask(O2Context_builtin *self,O2Surface* mask);
void O2DContextSetPaint(O2Context_builtin *self,O2Paint* paint);
void O2BlendSpanNormal_8888_coverage(O2argb8u *src,O2argb8u *dst,int coverage,int length);

View File

@ -20,20 +20,20 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#import "KGContext_builtin.h"
#import "O2Context_builtin.h"
#import "O2MutablePath.h"
#import "KGImage.h"
#import "O2Image.h"
#import "O2Color.h"
#import "KGSurface.h"
#import "KGExceptions.h"
#import "KGGraphicsState.h"
#import "O2Surface.h"
#import "O2Exceptions.h"
#import "O2GraphicsState.h"
#import "VGPath.h"
#import "KGPaint_image.h"
#import "KGPaint_color.h"
#import "KGPaint_axialGradient.h"
#import "KGPaint_radialGradient.h"
#import "KGBlending.h"
#import "KGShading.h"
#import "O2Paint_image.h"
#import "O2Paint_color.h"
#import "O2Paint_axialGradient.h"
#import "O2Paint_radialGradient.h"
#import "O2Blending.h"
#import "O2Shading.h"
#define MAX_SAMPLES COVERAGE_MULTIPLIER
@ -87,7 +87,7 @@ static BOOL _isAvailable=NO;
_clipContext=nil;
_paint=[[O2Paint_color alloc] initWithGray:0 alpha:1];
KGRasterizeSetBlendMode(self,kO2BlendModeNormal);
O2RasterizeSetBlendMode(self,kO2BlendModeNormal);
_vpwidth=self->_vpheight=0;
@ -98,7 +98,7 @@ static BOOL _isAvailable=NO;
samplesX=NSZoneMalloc(NULL,MAX_SAMPLES*sizeof(O2Float));
KGRasterizerSetViewport(self,0,0,O2ImageGetWidth(_surface),O2ImageGetHeight(_surface));
O2RasterizerSetViewport(self,0,0,O2ImageGetWidth(_surface),O2ImageGetHeight(_surface));
[self reallocateForSurface];
return self;
}
@ -144,7 +144,7 @@ static BOOL _isAvailable=NO;
-(void)setWidth:(size_t)width height:(size_t)height reallocateOnlyIfRequired:(BOOL)roir {
[_surface setWidth:width height:height reallocateOnlyIfRequired:roir];
[self reallocateForSurface];
KGRasterizerSetViewport(self,0,0,O2ImageGetWidth(_surface),O2ImageGetHeight(_surface));
O2RasterizerSetViewport(self,0,0,O2ImageGetWidth(_surface),O2ImageGetHeight(_surface));
O2AffineTransform flip={1,0,0,-1,0,O2ImageGetHeight(_surface)};
[currentState(self) setDeviceSpaceCTM:flip];
}
@ -182,7 +182,7 @@ static BOOL _isAvailable=NO;
}
-(void)deviceClipReset {
KGRasterizerSetViewport(self,0,0,O2ImageGetWidth(_surface),O2ImageGetHeight(_surface));
O2RasterizerSetViewport(self,0,0,O2ImageGetWidth(_surface),O2ImageGetHeight(_surface));
}
-(void)deviceClipToNonZeroPath:(O2Path *)path {
@ -215,9 +215,9 @@ static O2Paint *paintFromColor(O2Color *color){
-(void)drawPath:(O2PathDrawingMode)drawingMode {
O2GState *gState=currentState(self);
KGRasterizeSetBlendMode(self,gState->_blendMode);
O2RasterizeSetBlendMode(self,gState->_blendMode);
KGRasterizerSetShouldAntialias(self,gState->_shouldAntialias,gState->_antialiasingQuality);
O2RasterizerSetShouldAntialias(self,gState->_shouldAntialias,gState->_antialiasingQuality);
/* Path construction is affected by the CTM, and the stroke pen is affected by the CTM , this means path points and the stroke can be affected by different transforms as the CTM can change during path construction and before stroking. For example, creation of transformed shapes which are drawn using an untransformed pen. The current tesselator expects everything to be in user coordinates and it tesselates from there into device space, but the path points are already in base coordinates. So, path points are brought from base coordinates into the active coordinate space using an inverted transform and then everything is tesselated using the CTM into device space. */
@ -254,7 +254,7 @@ static O2Paint *paintFromColor(O2Color *color){
surfaceToPaintMatrix=O2AffineTransformInvert(surfaceToPaintMatrix);
O2PaintSetSurfaceToPaintMatrix(paint,surfaceToPaintMatrix);
KGRasterizerClear(self);
O2RasterizerClear(self);
VGPathStroke(vgPath,userToSurfaceMatrix, self, gState->_dashLengths,gState->_dashLengthsCount, gState->_dashPhase, YES /* context->m_strokeDashPhaseReset ? YES : NO*/,
gState->_lineWidth, gState->_lineCap, gState->_lineJoin, RI_MAX(gState->_miterLimit, 1.0f));
@ -264,7 +264,7 @@ static O2Paint *paintFromColor(O2Color *color){
O2DContextSetPaint(self,nil);
[vgPath release];
KGRasterizerClear(self);
O2RasterizerClear(self);
O2PathReset(_path);
}
@ -284,8 +284,8 @@ static O2Paint *paintFromColor(O2Color *color){
O2GState *gState=currentState(self);
O2Paint *paint;
KGRasterizeSetBlendMode(self,gState->_blendMode);
KGRasterizerSetShouldAntialias(self,gState->_shouldAntialias,gState->_antialiasingQuality);
O2RasterizeSetBlendMode(self,gState->_blendMode);
O2RasterizerSetShouldAntialias(self,gState->_shouldAntialias,gState->_antialiasingQuality);
if([shading isAxial]){
paint=[[O2Paint_axialGradient alloc] initWithShading:shading deviceTransform:gState->_deviceSpaceTransform];
@ -302,7 +302,7 @@ static O2Paint *paintFromColor(O2Color *color){
O2DContextAddEdge(self,O2PointMake(O2ImageGetWidth(_surface),0), O2PointMake(O2ImageGetWidth(_surface),O2ImageGetHeight(_surface)));
O2DContextClipAndFillEdges(self,VG_NON_ZERO);
KGRasterizerClear(self);
O2RasterizerClear(self);
}
-(void)drawImage:(O2Image *)image inRect:(O2Rect)rect {
@ -334,7 +334,7 @@ static O2Paint *paintFromColor(O2Color *color){
p3 = O2PointApplyAffineTransform(p3,imageUserToSurface);
KGRasterizerSetShouldAntialias(self,gState->_shouldAntialias,gState->_antialiasingQuality);
O2RasterizerSetShouldAntialias(self,gState->_shouldAntialias,gState->_antialiasingQuality);
O2Paint *paint=paintFromColor(gState->_fillColor);
O2InterpolationQuality iq;
@ -347,7 +347,7 @@ static O2Paint *paintFromColor(O2Color *color){
O2DContextSetPaint(self,imagePaint);
KGRasterizeSetBlendMode(self,gState->_blendMode);
O2RasterizeSetBlendMode(self,gState->_blendMode);
O2AffineTransform surfaceToImageMatrix = imageUserToSurface;
O2AffineTransform surfaceToPaintMatrix = O2AffineTransformConcat(imageUserToSurface,fillPaintToUser);
@ -367,7 +367,7 @@ static O2Paint *paintFromColor(O2Color *color){
O2PaintRelease(paint);
O2PaintRelease(imagePaint);
KGRasterizerClear(self);
O2RasterizerClear(self);
}
-(void)drawLayer:(O2LayerRef)layer inRect:(O2Rect)rect {
@ -377,14 +377,14 @@ static O2Paint *paintFromColor(O2Color *color){
}
-(void)deviceClipToEvenOddPath:(O2Path *)path {
// KGInvalidAbstractInvocation();
// O2InvalidAbstractInvocation();
}
-(void)deviceClipToMask:(O2Image *)mask inRect:(O2Rect)rect {
// KGInvalidAbstractInvocation();
// O2InvalidAbstractInvocation();
}
void KGRasterizerSetViewport(O2Context_builtin *self,int x,int y,int width,int height) {
void O2RasterizerSetViewport(O2Context_builtin *self,int x,int y,int width,int height) {
RI_ASSERT(vpwidth >= 0 && vpheight >= 0);
self->_vpx=x;
self->_vpy=y;
@ -392,7 +392,7 @@ void KGRasterizerSetViewport(O2Context_builtin *self,int x,int y,int width,int h
self->_vpheight=height;
}
void KGRasterizerClear(O2Context_builtin *self) {
void O2RasterizerClear(O2Context_builtin *self) {
int i;
for(i=0;i<self->_edgeCount;i++)
NSZoneFree(NULL,self->_edges[i]);
@ -454,7 +454,7 @@ static double radicalInverseBase2(unsigned int i)
return p;
}
void KGRasterizerSetShouldAntialias(O2Context_builtin *self,BOOL antialias,int quality) {
void O2RasterizerSetShouldAntialias(O2Context_builtin *self,BOOL antialias,int quality) {
//make a sampling pattern
@ -492,7 +492,7 @@ void KGRasterizerSetShouldAntialias(O2Context_builtin *self,BOOL antialias,int q
}
}
static void KGApplyCoverageAndMaskToSpan_lRGBAffff_PRE(O2argb32f *dst,int icoverage,O2Float *mask,O2argb32f *src,int length){
static void O2ApplyCoverageAndMaskToSpan_lRGBAffff_PRE(O2argb32f *dst,int icoverage,O2Float *mask,O2argb32f *src,int length){
int i;
for(i=0;i<length;i++){
@ -505,7 +505,7 @@ static void KGApplyCoverageAndMaskToSpan_lRGBAffff_PRE(O2argb32f *dst,int icover
}
}
static void KGApplyCoverageToSpan_lRGBAffff_PRE(O2argb32f *dst,int icoverage,O2argb32f *src,int length){
static void O2ApplyCoverageToSpan_lRGBAffff_PRE(O2argb32f *dst,int icoverage,O2argb32f *src,int length){
int i;
O2Float coverage=zeroToOneFromCoverage(icoverage);
@ -517,7 +517,7 @@ static void KGApplyCoverageToSpan_lRGBAffff_PRE(O2argb32f *dst,int icoverage,O2a
}
}
static void KGApplyCoverageAndMaskToSpan_lRGBA8888_PRE(O2argb8u *dst,int icoverage,uint8_t *mask,O2argb8u *src,int length){
static void O2ApplyCoverageAndMaskToSpan_lRGBA8888_PRE(O2argb8u *dst,int icoverage,uint8_t *mask,O2argb8u *src,int length){
int i;
for(i=0;i<length;i++){
@ -530,7 +530,7 @@ static void KGApplyCoverageAndMaskToSpan_lRGBA8888_PRE(O2argb8u *dst,int icovera
}
}
void KGApplyCoverageToSpan_lRGBA8888_PRE(O2argb8u *dst,int coverage,O2argb8u *src,int length){
void O2ApplyCoverageToSpan_lRGBA8888_PRE(O2argb8u *dst,int coverage,O2argb8u *src,int length){
int i;
if(coverage==256){
@ -645,7 +645,7 @@ static void O2BlendSpanCopy_8888_coverage(O2argb8u *src,O2argb8u *dst,int covera
/* Paint functions can selectively paint or not paint at all, e.g. gradients with extend turned off, they do this by returning a negative chunk for a pixels which aren't generated and positive chunk for pixels that are. We need to make sure we cover the entire span so we loop until the span is complete.
*/
static inline void KGRasterizeWriteCoverageSpan8888_Normal(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBA8888 blendFunction) {
static inline void O2RasterizeWriteCoverageSpan8888_Normal(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBA8888 blendFunction) {
O2argb8u *dst=__builtin_alloca(length*sizeof(O2argb8u));
O2argb8u *direct=surface->_read_lRGBA8888_PRE(surface,x,y,dst,length);
@ -679,7 +679,7 @@ static inline void KGRasterizeWriteCoverageSpan8888_Normal(O2Surface *surface,O2
}
static inline void KGRasterizeWriteCoverageSpan8888_Copy(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBA8888 blendFunction) {
static inline void O2RasterizeWriteCoverageSpan8888_Copy(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBA8888 blendFunction) {
O2argb8u *dst=__builtin_alloca(length*sizeof(O2argb8u));
O2argb8u *direct=surface->_read_lRGBA8888_PRE(surface,x,y,dst,length);
@ -713,7 +713,7 @@ static inline void KGRasterizeWriteCoverageSpan8888_Copy(O2Surface *surface,O2Su
}
}
static inline void KGRasterizeWriteCoverageSpan8888(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBA8888 blendFunction) {
static inline void O2RasterizeWriteCoverageSpan8888(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBA8888 blendFunction) {
O2argb8u *dst=__builtin_alloca(length*sizeof(O2argb8u));
O2argb8u *direct=surface->_read_lRGBA8888_PRE(surface,x,y,dst,length);
@ -732,12 +732,12 @@ static inline void KGRasterizeWriteCoverageSpan8888(O2Surface *surface,O2Surface
//apply masking
if(mask==NULL)
KGApplyCoverageToSpan_lRGBA8888_PRE(dst,coverage,src,chunk);
O2ApplyCoverageToSpan_lRGBA8888_PRE(dst,coverage,src,chunk);
else {
uint8_t maskSpan[chunk];
O2ImageReadSpan_A8_MASK(mask,x,y,maskSpan,chunk);
KGApplyCoverageAndMaskToSpan_lRGBA8888_PRE(dst,coverage,maskSpan,src,chunk);
O2ApplyCoverageAndMaskToSpan_lRGBA8888_PRE(dst,coverage,maskSpan,src,chunk);
}
if(direct==NULL){
@ -756,7 +756,7 @@ static inline void KGRasterizeWriteCoverageSpan8888(O2Surface *surface,O2Surface
}
}
static inline void KGRasterizeWriteCoverageSpanffff(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBAffff blendFunction) {
static inline void O2RasterizeWriteCoverageSpanffff(O2Surface *surface,O2Surface *mask,O2Paint *paint,int x, int y,int coverage,int length,O2BlendSpan_RGBAffff blendFunction) {
O2argb32f *dst=__builtin_alloca(length*sizeof(O2argb32f));
O2argb32f *direct=O2ImageReadSpan_lRGBAffff_PRE(surface,x,y,dst,length);
@ -775,12 +775,12 @@ static inline void KGRasterizeWriteCoverageSpanffff(O2Surface *surface,O2Surface
//apply masking
if(mask==NULL)
KGApplyCoverageToSpan_lRGBAffff_PRE(dst,coverage,src,chunk);
O2ApplyCoverageToSpan_lRGBAffff_PRE(dst,coverage,src,chunk);
else {
O2Float maskSpan[length];
O2ImageReadSpan_Af_MASK(mask,x,y,maskSpan,chunk);
KGApplyCoverageAndMaskToSpan_lRGBAffff_PRE(dst,coverage,maskSpan,src,chunk);
O2ApplyCoverageAndMaskToSpan_lRGBAffff_PRE(dst,coverage,maskSpan,src,chunk);
}
if(direct==NULL){
@ -1223,7 +1223,7 @@ void O2DContextClipAndFillEdges(O2Context_builtin *self,int fillRuleMask){
O2DContextFillEdgesOnSurface(self,surface,mask,self->_paint,fillRuleMask);
}
void KGRasterizeSetBlendMode(O2Context_builtin *self,O2BlendMode blendMode) {
void O2RasterizeSetBlendMode(O2Context_builtin *self,O2BlendMode blendMode) {
RI_ASSERT(blendMode >= kO2BlendModeNormal && blendMode <= kO2BlendModePlusLighter);
self->_blend_lRGBA8888_PRE=NULL;
@ -1234,7 +1234,7 @@ void KGRasterizeSetBlendMode(O2Context_builtin *self,O2BlendMode blendMode) {
case kO2BlendModeNormal:
self->_blend_lRGBA8888_PRE=O2BlendSpanNormal_8888;
self->_blend_lRGBAffff_PRE=O2BlendSpanNormal_ffff;
self->_writeCoverage_lRGBA8888_PRE=KGRasterizeWriteCoverageSpan8888_Normal;
self->_writeCoverage_lRGBA8888_PRE=O2RasterizeWriteCoverageSpan8888_Normal;
break;
case kO2BlendModeMultiply:
@ -1305,7 +1305,7 @@ void KGRasterizeSetBlendMode(O2Context_builtin *self,O2BlendMode blendMode) {
case kO2BlendModeCopy:
self->_blend_lRGBA8888_PRE=O2BlendSpanCopy_8888;
self->_blend_lRGBAffff_PRE=O2BlendSpanCopy_ffff;
self->_writeCoverage_lRGBA8888_PRE=KGRasterizeWriteCoverageSpan8888_Copy;
self->_writeCoverage_lRGBA8888_PRE=O2RasterizeWriteCoverageSpan8888_Copy;
break;
case kO2BlendModeSourceIn:
@ -1359,11 +1359,11 @@ void KGRasterizeSetBlendMode(O2Context_builtin *self,O2BlendMode blendMode) {
else {
if(self->_blend_lRGBA8888_PRE!=NULL){
self->_blendFunction=self->_blend_lRGBA8888_PRE;
self->_writeCoverageFunction=KGRasterizeWriteCoverageSpan8888;
self->_writeCoverageFunction=O2RasterizeWriteCoverageSpan8888;
}
else {
self->_blendFunction=self->_blend_lRGBAffff_PRE;
self->_writeCoverageFunction=KGRasterizeWriteCoverageSpanffff;
self->_writeCoverageFunction=O2RasterizeWriteCoverageSpanffff;
}
}
}

View File

@ -8,10 +8,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Foundation/NSObject.h>
#import <Foundation/NSData.h>
@class KGDataConsumer;
typedef KGDataConsumer *O2DataConsumerRef;
@class O2DataConsumer;
typedef O2DataConsumer *O2DataConsumerRef;
@interface KGDataConsumer : NSObject {
@interface O2DataConsumer : NSObject {
NSMutableData *_data;
}

View File

@ -1,6 +1,6 @@
#import "KGDataConsumer.h"
#import "O2DataConsumer.h"
@implementation KGDataConsumer
@implementation O2DataConsumer
-initWithMutableData:(NSMutableData *)data {
_data=[data retain];
@ -17,7 +17,7 @@
}
O2DataConsumerRef O2DataConsumerCreateWithCFData(NSMutableData *data) {
return [[KGDataConsumer alloc] initWithMutableData:data];
return [[O2DataConsumer alloc] initWithMutableData:data];
}
void O2DataConsumerRelease(O2DataConsumerRef self) {

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGDataProvider.h"
#import "O2DataProvider.h"
#import <Foundation/NSData.h>
#import <Foundation/NSFileManager.h>
#import <Foundation/NSStream.h>

View File

@ -15,11 +15,11 @@ static inline void _KGUnimplementedFunction(const char *fname,const char *file,i
NSLog(@"%s() unimplemented in %s at %d",fname,file,line);
}
#define KGInvalidAbstractInvocation() \
#define O2InvalidAbstractInvocation() \
_KGInvalidAbstractInvocation(_cmd,self,__FILE__,__LINE__)
#define KGUnimplementedMethod() \
#define O2UnimplementedMethod() \
_KGUnimplementedMethod(_cmd,self,__FILE__,__LINE__)
#define KGUnimplementedFunction() \
#define O2UnimplementedFunction() \
_KGUnimplementedFunction(__PRETTY_FUNCTION__,__FILE__,__LINE__)

View File

@ -1,4 +1,4 @@
#import "KGFont.h"
#import "O2Font.h"
@class O2PDFObject,O2PDFContext;

View File

@ -1,7 +1,7 @@
#import "KGFont+PDF.h"
#import "KGPDFArray.h"
#import "KGPDFDictionary.h"
#import "KGPDFContext.h"
#import "O2Font+PDF.h"
#import "O2PDFArray.h"
#import "O2PDFDictionary.h"
#import "O2PDFContext.h"
#import <Foundation/NSArray.h>
@implementation O2Font(PDF)

View File

@ -14,9 +14,9 @@ typedef O2Font *O2FontRef;
typedef uint16_t O2Glyph;
#import "KGContext.h"
#import "KGDataProvider.h"
#import "KGImage.h"
#import "O2Context.h"
#import "O2DataProvider.h"
#import "O2Image.h"
@class NSData;

View File

@ -5,8 +5,8 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGFont.h"
#import "KGExceptions.h"
#import "O2Font.h"
#import "O2Exceptions.h"
@implementation O2Font
@ -33,22 +33,22 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(NSData *)copyTableForTag:(uint32_t)tag {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return nil;
}
-(O2Glyph)glyphWithGlyphName:(NSString *)name {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return 0;
}
-(NSString *)copyGlyphNameForGlyph:(O2Glyph)glyph {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return nil;
}
-(void)fetchAdvances {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
}
NSString *O2MacRomanGlyphNames[256]={

View File

@ -1,4 +1,4 @@
#import "KGFont.h"
#import "O2Font.h"
@class NSMapTable;

View File

@ -1,4 +1,4 @@
#import "KGFunction.h"
#import "O2Function.h"
@class O2PDFArray,O2PDFDictionary,O2PDFObject,O2PDFContext;

View File

@ -1,10 +1,10 @@
#import "KGFunction+PDF.h"
#import "KGPDFFunction_Type2.h"
#import "KGPDFFunction_Type3.h"
#import "KGPDFArray.h"
#import "KGPDFDictionary.h"
#import "KGPDFStream.h"
#import "KGPDFContext.h"
#import "O2Function+PDF.h"
#import "O2PDFFunction_Type2.h"
#import "O2PDFFunction_Type3.h"
#import "O2PDFArray.h"
#import "O2PDFDictionary.h"
#import "O2PDFStream.h"
#import "O2PDFContext.h"
#import <Foundation/NSArray.h>
@implementation O2Function(PDF)

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGFunction.h"
#import "O2Function.h"
#import <Foundation/NSString.h>
#import <Foundation/NSArray.h>
#import <stddef.h>

View File

@ -8,7 +8,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Foundation/NSObject.h>
#import "O2Geometry.h"
#import "KGFont.h"
#import "O2Font.h"
@class O2Image,O2ColorSpace,O2Color,O2Pattern,O2MutablePath,O2Path,NSArray,NSMutableArray,O2Font;

View File

@ -6,17 +6,17 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGGraphicsState.h"
#import "O2GraphicsState.h"
#import "O2Geometry.h"
#import "O2Color.h"
#import "O2ColorSpace.h"
#import "O2MutablePath.h"
#import "KGFont.h"
#import "KGClipPhase.h"
#import "O2Font.h"
#import "O2ClipPhase.h"
#import <Foundation/NSArray.h>
#import "KGExceptions.h"
#import "KGSurface.h"
#import "O2Exceptions.h"
#import "O2Surface.h"
@implementation O2GState
@ -55,7 +55,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if(_dashLengths!=NULL)
NSZoneFree(NULL,_dashLengths);
[_shadowColor release];
KGGaussianKernelRelease(_shadowKernel);
O2GaussianKernelRelease(_shadowKernel);
[super dealloc];
}
@ -77,7 +77,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
copy->_shadowColor=O2ColorCreateCopy(_shadowColor);
copy->_shadowKernel=KGGaussianKernelRetain(_shadowKernel);
copy->_shadowKernel=O2GaussianKernelRetain(_shadowKernel);
return copy;
}
@ -91,7 +91,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(O2Rect)clipBoundingBox {
KGUnimplementedMethod();
O2UnimplementedMethod();
return O2RectZero;
}
@ -125,12 +125,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(O2Rect)convertRectToDeviceSpace:(O2Rect)rect {
KGUnimplementedMethod();
O2UnimplementedMethod();
return O2RectZero;
}
-(O2Rect)convertRectToUserSpace:(O2Rect)rect {
KGUnimplementedMethod();
O2UnimplementedMethod();
return O2RectZero;
}
@ -343,8 +343,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
[color retain];
[_shadowColor release];
_shadowColor=color;
KGGaussianKernelRelease(_shadowKernel);
_shadowKernel=(_shadowColor==nil)?NULL:KGCreateGaussianKernelWithDeviation(blur);
O2GaussianKernelRelease(_shadowKernel);
_shadowKernel=(_shadowColor==nil)?NULL:O2CreateGaussianKernelWithDeviation(blur);
}
-(void)setShadowOffset:(O2Size)offset blur:(float)blur {

View File

@ -1,4 +1,4 @@
#import "KGImage.h"
#import "O2Image.h"
@class O2ColorSpace,O2DataProvider,O2PDFObject,O2PDFContext;

View File

@ -1,10 +1,10 @@
#import "KGImage+PDF.h"
#import "O2Image+PDF.h"
#import "O2ColorSpace+PDF.h"
#import "KGDataProvider.h"
#import "KGPDFArray.h"
#import "KGPDFDictionary.h"
#import "KGPDFStream.h"
#import "KGPDFContext.h"
#import "O2DataProvider.h"
#import "O2PDFArray.h"
#import "O2PDFDictionary.h"
#import "O2PDFStream.h"
#import "O2PDFContext.h"
@implementation O2Image(PDF)

View File

@ -76,8 +76,8 @@ enum {
typedef unsigned O2BitmapInfo;
#import "O2ColorSpace.h"
#import "KGPattern.h"
#import "KGDataProvider.h"
#import "O2Pattern.h"
#import "O2DataProvider.h"
#import "VGmath.h"
typedef enum {
@ -221,27 +221,27 @@ typedef struct {
uint8_t r;
uint8_t g;
uint8_t b;
} KGARGB32Big;
} O2ARGB32Big;
typedef struct {
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t a;
} KGRGBA32Big;
} O2RGBA32Big;
typedef struct {
uint8_t b;
uint8_t g;
uint8_t r;
uint8_t a;
} KGARGB32Little;
} O2ARGB32Little;
#ifdef __LITTLE_ENDIAN__
typedef KGARGB32Little O2argb8u;
typedef O2ARGB32Little O2argb8u;
#endif
#ifdef __BIG_ENDIAN__
typedef KGARGB32Big O2argb8u;
typedef O2ARGB32Big O2argb8u;
#endif
static inline O2argb8u O2argb8uInit(uint8_t r,uint8_t g,uint8_t b,uint8_t a){

View File

@ -27,11 +27,11 @@
*
*-------------------------------------------------------------------*/
#import "KGImage.h"
#import "KGSurface.h"
#import "O2Image.h"
#import "O2Surface.h"
#import "O2ColorSpace.h"
#import "KGDataProvider.h"
#import "KGExceptions.h"
#import "O2DataProvider.h"
#import "O2Exceptions.h"
#import <Foundation/NSData.h>
@implementation O2Image
@ -362,7 +362,7 @@ static BOOL initFunctionsForParameters(O2Image *self,size_t bitsPerComponent,siz
_clampExternalPixels=NO; // only do this if premultiplied format
if(!initFunctionsForParameters(self,bitsPerComponent,bitsPerPixel,colorSpace,bitmapInfo)){
NSLog(@"KGImage failed to init with bpc=%d, bpp=%d,colorSpace=%@,bitmapInfo=0x%0X",bitsPerComponent,bitsPerPixel,colorSpace,bitmapInfo);
NSLog(@"O2Image failed to init with bpc=%d, bpp=%d,colorSpace=%@,bitmapInfo=0x%0X",bitsPerComponent,bitsPerPixel,colorSpace,bitmapInfo);
[self dealloc];
return nil;
}
@ -393,12 +393,12 @@ static BOOL initFunctionsForParameters(O2Image *self,size_t bitsPerComponent,siz
}
-initWithJPEGDataProvider:(O2DataProvider *)jpegProvider decode:(const O2Float *)decode interpolate:(BOOL)interpolate renderingIntent:(O2ColorRenderingIntent)renderingIntent {
KGUnimplementedMethod();
O2UnimplementedMethod();
return nil;
}
-initWithPNGDataProvider:(O2DataProvider *)jpegProvider decode:(const O2Float *)decode interpolate:(BOOL)interpolate renderingIntent:(O2ColorRenderingIntent)renderingIntent {
KGUnimplementedMethod();
O2UnimplementedMethod();
return nil;
}
@ -436,12 +436,12 @@ static BOOL initFunctionsForParameters(O2Image *self,size_t bitsPerComponent,siz
}
-(O2Image *)copyWithColorSpace:(O2ColorSpaceRef)colorSpace {
KGUnimplementedMethod();
O2UnimplementedMethod();
return nil;
}
-(O2Image *)childImageInRect:(O2Rect)rect {
KGUnimplementedMethod();
O2UnimplementedMethod();
return nil;
}
@ -452,12 +452,12 @@ static BOOL initFunctionsForParameters(O2Image *self,size_t bitsPerComponent,siz
}
-copyWithMask:(O2Image *)image {
KGUnimplementedMethod();
O2UnimplementedMethod();
return nil;
}
-copyWithMaskingColors:(const O2Float *)components {
KGUnimplementedMethod();
O2UnimplementedMethod();
return nil;
}
@ -1634,7 +1634,7 @@ static void clampSpan_lRGBAffff_PRE(O2argb32f *span,int length){
}
}
static inline void KGRGBPremultiplySpan(O2argb32f *span,int length){
static inline void O2RGBPremultiplySpan(O2argb32f *span,int length){
int i;
for(i=0;i<length;i++){
@ -1656,7 +1656,7 @@ O2argb32f *O2ImageReadSpan_lRGBAffff_PRE(O2Image *self,int x,int y,O2argb32f *sp
O2argb32fConvertSpan(span,length,format,VGColor_lRGBA_PRE);
}
if(!(format&VGColorPREMULTIPLIED)){
KGRGBPremultiplySpan(span,length);
O2RGBPremultiplySpan(span,length);
format|=VGColorPREMULTIPLIED;
}
else {

View File

@ -13,14 +13,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
extern NSString *kO2ImagePropertyDPIWidth;
extern NSString *kO2ImagePropertyDPIHeight;
@interface KGImageSource : NSObject {
@interface O2ImageSource : NSObject {
O2DataProvider *_provider;
NSDictionary *_options;
}
+(KGImageSource *)newImageSourceWithDataProvider:(O2DataProvider *)provider options:(NSDictionary *)options;
+(KGImageSource *)newImageSourceWithData:(NSData *)data options:(NSDictionary *)options;
+(KGImageSource *)newImageSourceWitURL:(NSURL *)url options:(NSDictionary *)options;
+(O2ImageSource *)newImageSourceWithDataProvider:(O2DataProvider *)provider options:(NSDictionary *)options;
+(O2ImageSource *)newImageSourceWithData:(NSData *)data options:(NSDictionary *)options;
+(O2ImageSource *)newImageSourceWitURL:(NSURL *)url options:(NSDictionary *)options;
+(BOOL)isPresentInDataProvider:(O2DataProvider *)provider;

View File

@ -6,23 +6,23 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGImageSource.h"
#import "O2ImageSource.h"
#import <Foundation/NSData.h>
#import "KGDataProvider.h"
#import "KGExceptions.h"
#import "O2DataProvider.h"
#import "O2Exceptions.h"
NSString *kO2ImagePropertyDPIWidth=@"kCGImagePropertyDPIWidth";
NSString *kO2ImagePropertyDPIHeight=@"kCGImagePropertyDPIHeight";
@implementation KGImageSource
@implementation O2ImageSource
+(KGImageSource *)newImageSourceWithDataProvider:(O2DataProvider *)provider options:(NSDictionary *)options {
+(O2ImageSource *)newImageSourceWithDataProvider:(O2DataProvider *)provider options:(NSDictionary *)options {
NSString *classes[]={
@"KGImageSource_PNG",
@"KGImageSource_TIFF",
@"KGImageSource_JPEG",
@"KGImageSource_BMP",
@"KGImageSource_GIF",
@"O2ImageSource_PNG",
@"O2ImageSource_TIFF",
@"O2ImageSource_JPEG",
@"O2ImageSource_BMP",
@"O2ImageSource_GIF",
nil
};
int i;
@ -39,16 +39,16 @@ NSString *kO2ImagePropertyDPIHeight=@"kCGImagePropertyDPIHeight";
return nil;
}
+(KGImageSource *)newImageSourceWithData:(NSData *)data options:(NSDictionary *)options {
+(O2ImageSource *)newImageSourceWithData:(NSData *)data options:(NSDictionary *)options {
O2DataProvider *provider=[[O2DataProvider alloc] initWithData:data];
KGImageSource *result=[self newImageSourceWithDataProvider:provider options:options];
O2ImageSource *result=[self newImageSourceWithDataProvider:provider options:options];
[provider release];
return result;
}
+(KGImageSource *)newImageSourceWitURL:(NSURL *)url options:(NSDictionary *)options {
+(O2ImageSource *)newImageSourceWitURL:(NSURL *)url options:(NSDictionary *)options {
O2DataProvider *provider=[[O2DataProvider alloc] initWithURL:url];
KGImageSource *result=[self newImageSourceWithDataProvider:provider options:options];
O2ImageSource *result=[self newImageSourceWithDataProvider:provider options:options];
[provider release];
return result;
}
@ -64,7 +64,7 @@ NSString *kO2ImagePropertyDPIHeight=@"kCGImagePropertyDPIHeight";
}
-(unsigned)count {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return 0;
}
@ -73,7 +73,7 @@ NSString *kO2ImagePropertyDPIHeight=@"kCGImagePropertyDPIHeight";
}
-(O2Image *)createImageAtIndex:(unsigned)index options:(NSDictionary *)options {
KGInvalidAbstractInvocation();
O2InvalidAbstractInvocation();
return nil;
}

View File

@ -6,9 +6,9 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGImageSource.h"
#import "O2ImageSource.h"
@interface KGImageSource_BMP : KGImageSource {
@interface O2ImageSource_BMP : O2ImageSource {
NSData *_bmp;
}

View File

@ -8,12 +8,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/* BMP decode is based on the public domain implementation by Sean Barrett http://www.nothings.org/stb_image.c V 1.00 */
#import "KGImageSource_BMP.h"
#import "O2ImageSource_BMP.h"
#import <Foundation/NSString.h>
#import <Foundation/NSData.h>
#import "KGDataProvider.h"
#import "O2DataProvider.h"
#import "O2ColorSpace.h"
#import "KGImage.h"
#import "O2Image.h"
#import <assert.h>
typedef unsigned char uint8;
@ -393,7 +393,7 @@ stbi_uc *stbi_bmp_load_from_memory (const stbi_uc *buffer, int len, int *x, int
return bmp_load(x,y,comp,req_comp);
}
@implementation KGImageSource_BMP
@implementation O2ImageSource_BMP
+(BOOL)isPresentInDataProvider:(O2DataProvider *)provider {
enum { signatureLength=2 };

View File

@ -6,12 +6,12 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGImageSource.h"
#import "O2ImageSource.h"
#import "gif_lib.h"
@class O2DataProvider;
@interface KGImageSource_GIF : KGImageSource {
@interface O2ImageSource_GIF : O2ImageSource {
GifFileType *_gif;
}

View File

@ -6,12 +6,12 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGImageSource_GIF.h"
#import "KGDataProvider.h"
#import "O2ImageSource_GIF.h"
#import "O2DataProvider.h"
#import "O2ColorSpace.h"
#import "KGImage.h"
#import "O2Image.h"
@implementation KGImageSource_GIF
@implementation O2ImageSource_GIF
+(BOOL)isPresentInDataProvider:(O2DataProvider *)provider {
enum { signatureLength=4 };
@ -73,11 +73,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
O2ColorSpaceRef colorSpace=O2ColorSpaceCreateDeviceRGB();
size_t width=gifImage->ImageDesc.Width;
size_t height=gifImage->ImageDesc.Height;
size_t bytesPerRow=width*sizeof(KGRGBA32Big);
size_t bytesPerRow=width*sizeof(O2RGBA32Big);
size_t bitsPerComponent=8;
size_t bitsPerPixel=32;
KGRGBA32Big *pixels=NSZoneMalloc(NULL,bytesPerRow*height);
KGRGBA32Big *scanline=pixels;
O2RGBA32Big *pixels=NSZoneMalloc(NULL,bytesPerRow*height);
O2RGBA32Big *scanline=pixels;
BOOL interlace=gifImage->ImageDesc.Interlace;
int interlacePass=1;
int interlaceDelta=8;

View File

@ -9,7 +9,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/* JPEG decode is based on the public domain implementation by Sean Barrett http://www.nothings.org/stb_image.c V 1.14 */
#import <Foundation/NSObject.h>
#import "KGImageSource.h"
#import "O2ImageSource.h"
@class NSData,NSDictionary;
@ -88,7 +88,7 @@ typedef struct
// definition of jpeg image component
@interface KGImageSource_JPEG : KGImageSource {
@interface O2ImageSource_JPEG : O2ImageSource {
NSData *_jpg;
uint8_t *_bitmap;
jpeg jpeg_decoder;

View File

@ -8,18 +8,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/* JPEG decode is based on the public domain implementation by Sean Barrett http://www.nothings.org/stb_image.c V 1.14 */
#import "KGImageSource_JPEG.h"
#import "KGImageSource_TIFF.h"
#import "O2ImageSource_JPEG.h"
#import "O2ImageSource_TIFF.h"
#import <Foundation/NSString.h>
#import <Foundation/NSData.h>
#import "KGDataProvider.h"
#import "O2DataProvider.h"
#import "O2ColorSpace.h"
#import "KGImage.h"
#import "O2Image.h"
#import <assert.h>
#import <string.h>
@implementation KGImageSource_JPEG
@implementation O2ImageSource_JPEG
#define malloc(x) NSZoneMalloc(NULL,x)
#define free(x) NSZoneFree(NULL,x)
@ -663,7 +663,7 @@ static int process_marker(jpeg *z, int m)
int i;
NSData *data=[NSData dataWithBytes:z->s.img_buffer+6 length:size-6];
KGImageSource *tiffSource=[[KGImageSource_TIFF alloc] initWithData:data options:nil];
O2ImageSource *tiffSource=[[O2ImageSource_TIFF alloc] initWithData:data options:nil];
O2Image *image=[tiffSource imageAtIndex:0 options:nil];
#endif
// skip(&z->s, size-2);

View File

@ -6,9 +6,9 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGImageSource.h"
#import "O2ImageSource.h"
@interface KGImageSource_PNG : KGImageSource {
@interface O2ImageSource_PNG : O2ImageSource {
NSData *_png;
}

View File

@ -8,13 +8,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/* PNG decode is based on the public domain implementation by Sean Barrett http://www.nothings.org/stb_image.c V 1.00 */
#import "KGImageSource_PNG.h"
#import "O2ImageSource_PNG.h"
#import <Foundation/NSString.h>
#import <Foundation/NSData.h>
#import "KGzlib.h"
#import "KGDataProvider.h"
#import "O2zlib.h"
#import "O2DataProvider.h"
#import "O2ColorSpace.h"
#import "KGImage.h"
#import "O2Image.h"
#import <assert.h>
@ -501,7 +501,7 @@ unsigned char *stbi_png_load_from_memory(const unsigned char *buffer, int len, i
return do_png(x,y,comp,req_comp);
}
@implementation KGImageSource_PNG
@implementation O2ImageSource_PNG
+(BOOL)isPresentInDataProvider:(O2DataProvider *)provider {
enum { signatureLength=8 };

View File

@ -6,11 +6,11 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGImageSource.h"
#import "O2ImageSource.h"
@class NSTIFFReader;
@interface KGImageSource_TIFF : KGImageSource {
@interface O2ImageSource_TIFF : O2ImageSource {
NSTIFFReader *_reader;
}

View File

@ -6,14 +6,14 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGImageSource_TIFF.h"
#import "O2ImageSource_TIFF.h"
#import "NSTIFFReader.h"
#import "NSTIFFImageFileDirectory.h"
#import "KGDataProvider.h"
#import "O2DataProvider.h"
#import "O2ColorSpace.h"
#import "KGImage.h"
#import "O2Image.h"
@implementation KGImageSource_TIFF
@implementation O2ImageSource_TIFF
+(BOOL)isPresentInDataProvider:(O2DataProvider *)provider {
enum { signatureLength=4 };

View File

@ -12,8 +12,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
typedef O2Layer *O2LayerRef;
#import "KGContext.h"
#import "KGImage.h"
#import "O2Context.h"
#import "O2Image.h"
@interface O2Layer : NSObject {
O2ContextRef _context;

View File

@ -6,9 +6,9 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGLayer.h"
#import "KGExceptions.h"
#import "KGBitmapContext.h"
#import "O2Layer.h"
#import "O2Exceptions.h"
#import "O2BitmapContext.h"
#import <Foundation/NSDictionary.h>
@implementation O2Layer

View File

@ -8,7 +8,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import "O2MutablePath.h"
#import "O2Path.h"
#import "KGExceptions.h"
#import "O2Exceptions.h"
#import <math.h>
// ellipse to 4 spline bezier, http://www.tinaja.com/glib/ellipse4.pdf
@ -281,7 +281,7 @@ void O2PathAddArc(O2MutablePathRef self,const O2AffineTransform *matrix,O2Float
}
void O2PathAddArcToPoint(O2MutablePathRef self,const O2AffineTransform *matrix,O2Float tx1,O2Float ty1,O2Float tx2,O2Float ty2,O2Float radius) {
KGUnimplementedFunction();
O2UnimplementedFunction();
}
void O2PathAddEllipseInRect(O2MutablePathRef self,const O2AffineTransform *matrix,O2Rect rect) {

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGPDFObject.h"
#import "O2PDFObject.h"
#import "O2Geometry.h"
@class O2PDFString,O2PDFArray,O2PDFDictionary,O2PDFStream;

View File

@ -6,11 +6,11 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGPDFArray.h"
#import "KGPDFObject_Real.h"
#import "KGPDFObject_Boolean.h"
#import "KGPDFObject_Integer.h"
#import "KGPDFContext.h"
#import "O2PDFArray.h"
#import "O2PDFObject_Real.h"
#import "O2PDFObject_Boolean.h"
#import "O2PDFObject_Integer.h"
#import "O2PDFContext.h"
#import <Foundation/NSString.h>
#import <stddef.h>

View File

@ -6,10 +6,10 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGPDFContentStream.h"
#import "KGPDFPage.h"
#import "KGPDFArray.h"
#import "KGPDFDictionary.h"
#import "O2PDFContentStream.h"
#import "O2PDFPage.h"
#import "O2PDFArray.h"
#import "O2PDFDictionary.h"
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>

View File

@ -6,15 +6,15 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGContext.h"
#import "O2Context.h"
#import <Foundation/NSMapTable.h>
@class O2PDFContext, O2PDFxref,O2PDFObject, O2PDFDictionary,O2PDFArray,NSMutableData,NSMutableDictionary,KGDataConsumer;
@class O2PDFContext, O2PDFxref,O2PDFObject, O2PDFDictionary,O2PDFArray,NSMutableData,NSMutableDictionary,O2DataConsumer;
const NSString *kO2PDFContextTitle;
@interface O2PDFContext : O2Context {
KGDataConsumer *_dataConsumer;
O2DataConsumer *_dataConsumer;
NSMutableData *_mutableData;
NSMutableDictionary *_fontCache;
NSMapTable *_objectToRef;
@ -32,7 +32,7 @@ const NSString *kO2PDFContextTitle;
NSMutableArray *_contentStreamStack;
}
-initWithConsumer:(KGDataConsumer *)consumer mediaBox:(const O2Rect *)mediaBox auxiliaryInfo:(NSDictionary *)auxiliaryInfo;
-initWithConsumer:(O2DataConsumer *)consumer mediaBox:(const O2Rect *)mediaBox auxiliaryInfo:(NSDictionary *)auxiliaryInfo;
-(unsigned)length;
-(NSData *)data;

View File

@ -6,31 +6,31 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGPDFContext.h"
#import "KGPDFArray.h"
#import "KGPDFDictionary.h"
#import "KGPDFPage.h"
#import "KGPDFContext.h"
#import "KGPDFxref.h"
#import "KGPDFxrefEntry.h"
#import "KGPDFObject_R.h"
#import "KGPDFObject_Name.h"
#import "KGPDFStream.h"
#import "KGPDFString.h"
#import "KGShading+PDF.h"
#import "KGImage+PDF.h"
#import "KGFont+PDF.h"
#import "O2PDFContext.h"
#import "O2PDFArray.h"
#import "O2PDFDictionary.h"
#import "O2PDFPage.h"
#import "O2PDFContext.h"
#import "O2PDFxref.h"
#import "O2PDFxrefEntry.h"
#import "O2PDFObject_R.h"
#import "O2PDFObject_Name.h"
#import "O2PDFStream.h"
#import "O2PDFString.h"
#import "O2Shading+PDF.h"
#import "O2Image+PDF.h"
#import "O2Font+PDF.h"
#import "O2MutablePath.h"
#import "O2Color.h"
#import "O2ColorSpace+PDF.h"
#import "KGGraphicsState.h"
#import "O2GraphicsState.h"
#import <Foundation/NSProcessInfo.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSData.h>
#import <Foundation/NSPathUtilities.h>
#import "KGExceptions.h"
#import "KGClipPhase.h"
#import "O2Exceptions.h"
#import "O2ClipPhase.h"
const NSString *kO2PDFContextTitle=@"kO2PDFContextTitle";
@ -40,7 +40,7 @@ static inline O2GState *currentState(O2Context *self){
return [self->_stateStack lastObject];
}
-initWithConsumer:(KGDataConsumer *)consumer mediaBox:(const O2Rect *)mediaBox auxiliaryInfo:(NSDictionary *)auxiliaryInfo {
-initWithConsumer:(O2DataConsumer *)consumer mediaBox:(const O2Rect *)mediaBox auxiliaryInfo:(NSDictionary *)auxiliaryInfo {
[super init];
_dataConsumer=[consumer retain];

View File

@ -7,7 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGPDFObject.h"
#import "O2PDFObject.h"
#import <Foundation/NSMapTable.h>
@class O2PDFObject,O2PDFArray,O2PDFStream,O2PDFString;

View File

@ -6,15 +6,15 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KGPDFDictionary.h"
#import "O2PDFDictionary.h"
#import "KGPDFArray.h"
#import "KGPDFStream.h"
#import "KGPDFObject_Integer.h"
#import "KGPDFObject_Name.h"
#import "KGPDFObject_Real.h"
#import "KGPDFObject_Boolean.h"
#import "KGPDFContext.h"
#import "O2PDFArray.h"
#import "O2PDFStream.h"
#import "O2PDFObject_Integer.h"
#import "O2PDFObject_Name.h"
#import "O2PDFObject_Real.h"
#import "O2PDFObject_Boolean.h"
#import "O2PDFContext.h"
#import <Foundation/NSString.h>
#import <stddef.h>
#import <string.h>

Some files were not shown because too many files have changed in this diff Show More