- CoreDataExports.h added

- CGLayer, CGPattern C interface added
This commit is contained in:
Christopher Lloyd 2008-04-24 01:45:29 +00:00
parent 9ff4c636da
commit 6569f1d255
19 changed files with 162 additions and 25 deletions

View File

@ -8,3 +8,24 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <ApplicationServices/CGLayer.h>
#import "KGLayer.h"
CGLayerRef CGLayerRetain(CGLayerRef self) {
return [self retain];
}
void CGLayerRelease(CGLayerRef self) {
[self release];
}
CGLayerRef CGLayerCreateWithContext(CGContextRef context,CGSize size,id unused) {
return [[KGLayer alloc] initRelativeToContext:context size:size unused:unused];
}
CGSize CGLayerGetSize(CGLayerRef self) {
return [self size];
}
CGContextRef CGLayerGetContext(CGLayerRef self) {
return [self context];
}

View File

@ -8,3 +8,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <ApplicationServices/CGPattern.h>
#import "KGPattern.h"
CGPatternRef CGPatternRetain(CGPatternRef self) {
return [self retain];
}
void CGPatternRelease(CGPatternRef self) {
[self release];
}
CGPatternRef CGPatternCreate(void *info,CGRect bounds,CGAffineTransform matrix,CGFloat xstep,CGFloat ystep,CGPatternTiling tiling,BOOL isColored,const CGPatternCallbacks *callbacks) {
return [[KGPattern alloc] initWithInfo:info bounds:bounds matrix:matrix xstep:xstep ystep:ystep tiling:tiling isColored:isColored callbacks:callbacks];
}

View File

@ -16,9 +16,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
NSDictionary *_unused;
}
-initWithSize:(CGSize)size unused:(NSDictionary *)unused;
-initRelativeToContext:(KGContext *)context size:(CGSize)size unused:(NSDictionary *)unused;
-(KGContext *)cgContext;
-(CGSize)size;
-(KGContext *)context;
@end

View File

@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
@implementation KGLayer
-initWithSize:(CGSize)size unused:(NSDictionary *)unused {
-initRelativeToContext:(KGContext *)context size:(CGSize)size unused:(NSDictionary *)unused {
_size=size;
_unused=[unused copy];
return self;
@ -23,13 +23,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
[super dealloc];
}
-(KGContext *)cgContext {
KGInvalidAbstractInvocation();
return nil;
}
-(CGSize)size {
return _size;
}
-(KGContext *)context {
KGInvalidAbstractInvocation();
return nil;
}
@end

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2007 Christopher J. W. Lloyd
/* Copyright (c) 2008 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@ -7,9 +7,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 <Foundation/NSObject.h>
#import <ApplicationServices/ApplicationServices.h>
@interface KGPattern : NSObject {
void *_info;
CGRect _bounds;
CGAffineTransform _matrix;
CGFloat _xstep;
CGFloat _ystep;
CGPatternTiling _tiling;
BOOL _isColored;
CGPatternCallbacks _callbacks;
}
-initWithInfo:(void *)info bounds:(CGRect)bounds matrix:(CGAffineTransform)matrix xstep:(CGFloat)xstep ystep:(CGFloat)ystep tiling:(CGPatternTiling)tiling isColored:(BOOL)isColored callbacks:(const CGPatternCallbacks *)callbacks;
@end

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2006-2007 Christopher J. W. Lloyd
/* Copyright (c) 2008 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@ -10,4 +10,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
@implementation KGPattern
-initWithInfo:(void *)info bounds:(CGRect)bounds matrix:(CGAffineTransform)matrix xstep:(CGFloat)xstep ystep:(CGFloat)ystep tiling:(CGPatternTiling)tiling isColored:(BOOL)isColored callbacks:(const CGPatternCallbacks *)callbacks {
_info=info;
_bounds=bounds;
_matrix=matrix;
_xstep=xstep;
_ystep=ystep;
_tiling=tiling;
_isColored=isColored;
_callbacks=*callbacks;
return self;
}
@end

View File

@ -1020,7 +1020,7 @@ static void zeroBytes(void *bytes,int size){
}
-(void)drawLayer:(KGLayer *)layer inRect:(NSRect)rect {
KGContext *context=[layer cgContext];
KGContext *context=[layer context];
if(![context isKindOfClass:[KGContext_gdi class]]){
NSLog(@"layer class is not right %@!=%@",[context class],[self class]);

View File

@ -4,7 +4,7 @@
@implementation KGLayer_gdi
-initRelativeToContext:(KGContext *)context size:(NSSize)size unused:(NSDictionary *)unused {
[super initWithSize:size unused:unused];
[super initRelativeToContext:context size:size unused:unused];
_context=[[KGContext_gdi alloc] initWithSize:size context:context];
return self;
}

View File

@ -8,14 +8,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Foundation/NSObject.h>
#import <ApplicationServices/CoreGraphicsExport.h>
#import "CGGeometry.h"
#import "CGColorSpace.h"
#import "CGPattern.h"
@class KGColor;
typedef KGColor *CGColorRef;
#import "CGGeometry.h"
#import "CGColorSpace.h"
#import "CGPattern.h"
COREGRAPHICS_EXPORT CGColorRef CGColorRetain(CGColorRef self);
COREGRAPHICS_EXPORT void CGColorRelease(CGColorRef self);

View File

@ -8,6 +8,11 @@ THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED
#import <Foundation/NSObject.h>
#import <ApplicationServices/CoreGraphicsExport.h>
@class KGContext;
typedef KGContext *CGContextRef;
#import <ApplicationServices/CGGeometry.h>
#import <ApplicationServices/CGAffineTransform.h>
#import <ApplicationServices/CGFont.h>
@ -88,9 +93,6 @@ typedef enum {
typedef int CGTextDrawingMode;
@class KGContext;
typedef KGContext *CGContextRef;
COREGRAPHICS_EXPORT CGContextRef CGContextRetain(CGContextRef context);
COREGRAPHICS_EXPORT void CGContextRelease(CGContextRef context);

View File

@ -7,7 +7,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 <Foundation/NSObject.h>
#import "CoreGraphicsExport.h"
@class KGLayer;
typedef KGLayer *CGLayerRef;
#import "CGContext.h"
COREGRAPHICS_EXPORT CGLayerRef CGLayerRetain(CGLayerRef self);
COREGRAPHICS_EXPORT void CGLayerRelease(CGLayerRef self);
COREGRAPHICS_EXPORT CGLayerRef CGLayerCreateWithContext(CGContextRef context,CGSize size,id unused);
COREGRAPHICS_EXPORT CGSize CGLayerGetSize(CGLayerRef self);
COREGRAPHICS_EXPORT CGContextRef CGLayerGetContext(CGLayerRef self);

View File

@ -7,6 +7,21 @@ 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 <Foundation/NSObject.h>
#import "CoreGraphicsExport.h"
@class KGPattern;
typedef KGPattern *CGPatternRef;
#import "CGGeometry.h"
#import "CGContext.h"
typedef struct {
unsigned int version;
void (*drawPattern)(void *,CGContextRef);
void (*releaseInfo)(void *);
} CGPatternCallbacks;
typedef enum {
kCGPatternTilingNoDistortion,
@ -14,6 +29,7 @@ typedef enum {
kCGPatternTilingConstantSpacing,
} CGPatternTiling;
@class KGPattern;
COREGRAPHICS_EXPORT CGPatternRef CGPatternRetain(CGPatternRef self);
COREGRAPHICS_EXPORT void CGPatternRelease(CGPatternRef self);
typedef KGPattern *CGPatternRef;
COREGRAPHICS_EXPORT CGPatternRef CGPatternCreate(void *info,CGRect bounds,CGAffineTransform matrix,CGFloat xstep,CGFloat ystep,CGPatternTiling tiling,BOOL isColored,const CGPatternCallbacks *callbacks);

View File

@ -10,6 +10,8 @@
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
FE21313A0DBFC72700CEDC65 /* dllmain.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2131390DBFC72700CEDC65 /* dllmain.m */; };
FE2131420DBFC74200CEDC65 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
FE2132900DBFD21900CEDC65 /* CoreDataExports.h in Headers */ = {isa = PBXBuildFile; fileRef = FE21328F0DBFD21900CEDC65 /* CoreDataExports.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE2132920DBFD22000CEDC65 /* CoreData.h in Headers */ = {isa = PBXBuildFile; fileRef = FE2132910DBFD22000CEDC65 /* CoreData.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE82F3D40BF1042F00B18B54 /* NSAttributeDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = FE82F3BE0BF1042F00B18B54 /* NSAttributeDescription.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE82F3D50BF1042F00B18B54 /* NSAttributeDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = FE82F3BF0BF1042F00B18B54 /* NSAttributeDescription.m */; };
FE82F3D60BF1042F00B18B54 /* NSEntityDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = FE82F3C00BF1042F00B18B54 /* NSEntityDescription.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -89,6 +91,8 @@
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8DC2EF5B0486A6940098B216 /* CoreData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreData.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FE2131390DBFC72700CEDC65 /* dllmain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = dllmain.m; sourceTree = "<group>"; };
FE21328F0DBFD21900CEDC65 /* CoreDataExports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreDataExports.h; sourceTree = "<group>"; };
FE2132910DBFD22000CEDC65 /* CoreData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreData.h; sourceTree = "<group>"; };
FE59F2FF0D54301C00D54A25 /* Foundation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Foundation.xcodeproj; path = ../Foundation/Foundation.xcodeproj; sourceTree = SOURCE_ROOT; };
FE82F3BE0BF1042F00B18B54 /* NSAttributeDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSAttributeDescription.h; sourceTree = "<group>"; };
FE82F3BF0BF1042F00B18B54 /* NSAttributeDescription.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSAttributeDescription.m; sourceTree = "<group>"; };
@ -137,6 +141,8 @@
0867D691FE84028FC02AAC07 /* CoreData */ = {
isa = PBXGroup;
children = (
FE2132910DBFD22000CEDC65 /* CoreData.h */,
FE21328F0DBFD21900CEDC65 /* CoreDataExports.h */,
FE59F2FF0D54301C00D54A25 /* Foundation.xcodeproj */,
FE82F3BE0BF1042F00B18B54 /* NSAttributeDescription.h */,
FE82F3BF0BF1042F00B18B54 /* NSAttributeDescription.m */,
@ -247,6 +253,8 @@
FE82F3E40BF1042F00B18B54 /* NSPersistentStoreCoordinator.h in Headers */,
FE82F3E60BF1042F00B18B54 /* NSPropertyDescription.h in Headers */,
FE82F3E80BF1042F00B18B54 /* NSRelationshipDescription.h in Headers */,
FE2132900DBFD21900CEDC65 /* CoreDataExports.h in Headers */,
FE2132920DBFD22000CEDC65 /* CoreData.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -290,6 +298,7 @@
ProjectRef = FE59F2FF0D54301C00D54A25 /* Foundation.xcodeproj */;
},
);
projectRoot = "";
targets = (
8DC2EF4F0486A6940098B216 /* CoreData-Windows-i386 */,
);
@ -423,9 +432,9 @@
FRAMEWORK_SEARCH_PATHS = /Developer/Cocotron/1.0/Windows/i386/Frameworks;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_OPTIMIZATION_LEVEL = s;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_UNROLL_LOOPS = YES;
INFOPLIST_FILE = Info.plist;

View File

@ -0,0 +1,27 @@
#ifdef __cplusplus
#if defined(__WIN32__)
#if defined(COREDATA_INSIDE_BUILD)
#define COREDATA_EXPORT extern "C" __declspec(dllexport)
#else
#define COREDATA_EXPORT extern "C" __declspec(dllimport)
#endif
#else
#define COREDATA_EXPORT extern "C"
#endif
#else
#if defined(__WIN32__)
#if defined(COREDATA_INSIDE_BUILD)
#define COREDATA_EXPORT __declspec(dllexport) extern
#else
#define COREDATA_EXPORT __declspec(dllimport) extern
#endif
#else
#define COREDATA_EXPORT extern
#endif
#endif

View File

@ -0,0 +1,5 @@
#import <Foundation/NSString.h>
#import "CoreDataExports.h"
COREDATA_EXPORT NSString *NSManagedObjectContextDidSaveNotification;

View File

@ -0,0 +1,3 @@
#import "NSManagedObjectContext.h"
NSString *NSManagedObjectContextDidSaveNotification=@"NSManagedObjectContextDidSaveNotification";

View File

@ -1,5 +1,7 @@
#import <Foundation/NSObject.h>
@class NSEntityDescription,NSArray,NSDictionary;
@interface NSPropertyDescription : NSObject <NSCoding,NSCopying> {
}

View File

@ -0,0 +1,5 @@
#import <CoreData/NSPropertyDescription.h>
@implementation NSPropertyDescription
@end

View File

@ -8,8 +8,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import "KGRenderController.h"
#import "KGImageView.h"
#import "KGRender_cg.h"
#import "KGRender_baseline.h"
@implementation KGRenderController