Permalink
Browse files

KGColor renamed O2Color, API switched to C, KGColorSpace renamed O2Co…

…lorSpace. i356 fix, setFocusRingType:/focusRingType implemented in NSView

git-svn-id: http://cocotron.googlecode.com/svn/trunk@630 43251c19-cd1f-0410-9ec0-95c558c233a8
  • Loading branch information...
1 parent 3a66fa3 commit 0065d5a100cfc109da8fda8be7ac11e31d7ce0b6 cocotron committed Sep 4, 2009
Showing with 460 additions and 438 deletions.
  1. +32 −32 AppKit/AppKit.xcodeproj/project.pbxproj
  2. +3 −0 AppKit/NSView.h
  3. +9 −0 AppKit/NSView.m
  4. +1 −1 AppKit/Win32.subproj/KGContext_builtin_gdi.m
  5. +13 −13 AppKit/Win32.subproj/KGContext_gdi.m
  6. +8 −8 AppKit/Win32.subproj/KGDeviceContext_gdi.m
  7. +3 −3 AppKit/Win32.subproj/KGSurface_DIBSection.m
  8. +2 −2 AppKit/Win32.subproj/Win32Display.m
  9. +1 −1 AppKit/X11.subproj/CairoContext.m
  10. +17 −17 CoreGraphics/CGColor.m
  11. +2 −2 CoreGraphics/CGColorSpace.h
  12. +4 −4 CoreGraphics/CGColorSpace.m
  13. +32 −32 CoreGraphics/CoreGraphics.xcodeproj/project.pbxproj
  14. +2 −2 CoreGraphics/KGBitmapContext.h
  15. +3 −3 CoreGraphics/KGBitmapContext.m
  16. +0 −8 CoreGraphics/KGColorSpace+PDF.h
  17. +6 −5 CoreGraphics/KGContext.h
  18. +45 −31 CoreGraphics/KGContext.m
  19. +2 −2 CoreGraphics/KGContext_builtin.m
  20. +1 −1 CoreGraphics/KGGraphicsState.h
  21. +6 −6 CoreGraphics/KGGraphicsState.m
  22. +1 −1 CoreGraphics/KGImage+PDF.h
  23. +3 −3 CoreGraphics/KGImage+PDF.m
  24. +6 −5 CoreGraphics/KGImage.h
  25. +13 −13 CoreGraphics/KGImage.m
  26. +2 −2 CoreGraphics/KGImageSource_BMP.m
  27. +2 −2 CoreGraphics/KGImageSource_GIF.m
  28. +2 −2 CoreGraphics/KGImageSource_JPEG.m
  29. +2 −2 CoreGraphics/KGImageSource_PNG.m
  30. +2 −2 CoreGraphics/KGImageSource_TIFF.m
  31. +13 −13 CoreGraphics/KGPDFContext.m
  32. +17 −17 CoreGraphics/KGPDFOperators.m
  33. +7 −7 CoreGraphics/KGPaint_ramp.m
  34. +5 −5 CoreGraphics/KGShading+PDF.m
  35. +6 −5 CoreGraphics/KGShading.h
  36. +4 −4 CoreGraphics/KGShading.m
  37. +1 −1 CoreGraphics/KGSurface.h
  38. +5 −5 CoreGraphics/KGSurface.m
  39. +23 −18 CoreGraphics/O2Color.h
  40. +55 −42 CoreGraphics/O2Color.m
  41. +8 −0 CoreGraphics/O2ColorSpace+PDF.h
  42. +18 −18 CoreGraphics/{KGColorSpace+PDF.m → O2ColorSpace+PDF.m}
  43. +19 −15 CoreGraphics/{KGColorSpace.h → O2ColorSpace.h}
  44. +19 −19 CoreGraphics/{KGColorSpace.m → O2ColorSpace.m}
  45. +23 −52 testing/SWRender/CoreGraphics_KG.h
  46. +12 −12 testing/SWRender/SWRender.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -63,6 +63,7 @@ APPKIT_EXPORT NSString *NSViewFocusDidChangeNotification;
CGAffineTransform _transformFromWindow;
CGAffineTransform _transformToWindow;
NSRect _visibleRect;
+ NSFocusRingType _focusRingType;
}
+(NSView *)focusView;
@@ -83,6 +84,7 @@ APPKIT_EXPORT NSString *NSViewFocusDidChangeNotification;
-(NSArray *)subviews;
-(BOOL)autoresizesSubviews;
-(unsigned)autoresizingMask;
+-(NSFocusRingType)focusRingType;
-(int)tag;
-(BOOL)isFlipped;
@@ -132,6 +134,7 @@ APPKIT_EXPORT NSString *NSViewFocusDidChangeNotification;
-(void)replaceSubview:(NSView *)oldView with:(NSView *)newView;
-(void)setAutoresizesSubviews:(BOOL)flag;
-(void)setAutoresizingMask:(unsigned int)mask;
+-(void)setFocusRingType:(NSFocusRingType)value;
-(void)setTag:(int)tag;
View
@@ -262,6 +262,10 @@ -(unsigned)autoresizingMask {
return _autoresizingMask;
}
+-(NSFocusRingType)focusRingType {
+ return _focusRingType;
+}
+
-(int)tag {
return _tag;
}
@@ -632,6 +636,11 @@ -(void)setAutoresizingMask:(unsigned int)mask {
_autoresizingMask=mask;
}
+-(void)setFocusRingType:(NSFocusRingType)value {
+ _focusRingType=value;
+ [self setNeedsDisplay:YES];
+}
+
-(void)setTag:(int)tag {
_tag=tag;
}
@@ -10,7 +10,7 @@
#import "KGSurface_DIBSection.h"
#import "KGDeviceContext_gdi.h"
#import "KGFont_gdi.h"
-#import <CoreGraphics/KGColorSpace.h>
+#import <CoreGraphics/O2ColorSpace.h>
#import <CoreGraphics/O2Color.h>
#import <AppKit/Win32Font.h>
@@ -17,7 +17,7 @@
#import <AppKit/KGDeviceContext_gdi.h>
#import <CoreGraphics/O2MutablePath.h>
#import <CoreGraphics/O2Color.h>
-#import <CoreGraphics/KGColorSpace.h>
+#import <CoreGraphics/O2ColorSpace.h>
#import <CoreGraphics/KGDataProvider.h>
#import <CoreGraphics/KGShading.h>
#import <CoreGraphics/KGFunction.h>
@@ -403,8 +403,8 @@ static inline float axialBandIntervalFromMagnitude(KGFunction *function,float ma
#endif
-(void)drawInUserSpace:(CGAffineTransform)matrix axialShading:(KGShading *)shading {
- KGColorSpace *colorSpace=[shading colorSpace];
- KGColorSpaceType colorSpaceType=[colorSpace type];
+ O2ColorSpaceRef colorSpace=[shading colorSpace];
+ O2ColorSpaceType colorSpaceType=[colorSpace type];
KGFunction *function=[shading function];
const float *domain=[function domain];
const float *range=[function range];
@@ -442,16 +442,16 @@ -(void)drawInUserSpace:(CGAffineTransform)matrix axialShading:(KGShading *)shadi
switch(colorSpaceType){
- case KGColorSpaceDeviceGray:
+ case O2ColorSpaceDeviceGray:
outputToRGBA=GrayAToRGBA;
break;
- case KGColorSpaceDeviceRGB:
- case KGColorSpacePlatformRGB:
+ case O2ColorSpaceDeviceRGB:
+ case O2ColorSpacePlatformRGB:
outputToRGBA=RGBAToRGBA;
break;
- case KGColorSpaceDeviceCMYK:
+ case O2ColorSpaceDeviceCMYK:
outputToRGBA=CMYKAToRGBA;
break;
@@ -731,8 +731,8 @@ -(void)drawInUserSpace:(CGAffineTransform)matrix radialShading:(KGShading *)shad
- does not factor resolution/scaling can cause banding
- does not factor color sampling rate, generates multiple bands for same color
*/
- KGColorSpace *colorSpace=[shading colorSpace];
- KGColorSpaceType colorSpaceType=[colorSpace type];
+ O2ColorSpaceRef colorSpace=[shading colorSpace];
+ O2ColorSpaceType colorSpaceType=[colorSpace type];
KGFunction *function=[shading function];
const float *domain=[function domain];
const float *range=[function range];
@@ -751,16 +751,16 @@ -(void)drawInUserSpace:(CGAffineTransform)matrix radialShading:(KGShading *)shad
switch(colorSpaceType){
- case KGColorSpaceDeviceGray:
+ case O2ColorSpaceDeviceGray:
outputToRGBA=GrayAToRGBA;
break;
- case KGColorSpaceDeviceRGB:
- case KGColorSpacePlatformRGB:
+ case O2ColorSpaceDeviceRGB:
+ case O2ColorSpacePlatformRGB:
outputToRGBA=RGBAToRGBA;
break;
- case KGColorSpaceDeviceCMYK:
+ case O2ColorSpaceDeviceCMYK:
outputToRGBA=CMYKAToRGBA;
break;
@@ -9,9 +9,9 @@
#import <AppKit/KGDeviceContext_gdi.h>
#import <CoreGraphics/O2Path.h>
#import <CoreGraphics/O2Color.h>
-#import <CoreGraphics/KGColorSpace.h>
+#import <CoreGraphics/O2ColorSpace.h>
-static inline void CMYKAToRGBA(float *input,float *output){
+static inline void CMYKAToRGBA(const float *input,float *output){
float white=1-input[3];
output[0]=(input[0]>white)?0:white-input[0];
@@ -42,26 +42,26 @@ static COLORREF gammaAdjustedRGBFromComponents(float r,float g,float b){
}
COLORREF COLORREFFromColor(O2Color *color){
- KGColorSpace *colorSpace=[color colorSpace];
- float *components=[color components];
+ O2ColorSpaceRef colorSpace=O2ColorGetColorSpace(color);
+ const float *components=O2ColorGetComponents(color);
switch([colorSpace type]){
- case KGColorSpaceDeviceGray:
+ case O2ColorSpaceDeviceGray:
return gammaAdjustedRGBFromComponents(components[0],components[0],components[0]);
- case KGColorSpaceDeviceRGB:
+ case O2ColorSpaceDeviceRGB:
return gammaAdjustedRGBFromComponents(components[0],components[1],components[2]);
- case KGColorSpaceDeviceCMYK:{
+ case O2ColorSpaceDeviceCMYK:{
float rgba[4];
CMYKAToRGBA(components,rgba);
return gammaAdjustedRGBFromComponents(rgba[0],rgba[1],rgba[2]);
}
break;
- case KGColorSpacePlatformRGB:
+ case O2ColorSpacePlatformRGB:
return RGB(components[0]*255,components[1]*255,components[2]*255);
default:
@@ -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 "KGSurface_DIBSection.h"
#import "KGDeviceContext_gdiDIBSection.h"
-#import <CoreGraphics/KGColorSpace.h>
+#import <CoreGraphics/O2ColorSpace.h>
@implementation KGSurface_DIBSection
@@ -18,9 +18,9 @@ @implementation KGSurface_DIBSection
[super dealloc];
return nil;
}
- KGColorSpace *colorSpace=[[KGColorSpace alloc] initWithDeviceRGB];
+ O2ColorSpaceRef colorSpace=[[O2ColorSpace alloc] initWithDeviceRGB];
- if([super initWithBytes:[_deviceContext bitmapBytes] width:width height:height bitsPerComponent:[_deviceContext bitsPerComponent] bytesPerRow:[_deviceContext bytesPerRow] colorSpace:[[KGColorSpace alloc] initWithDeviceRGB] bitmapInfo:kCGImageAlphaPremultipliedFirst|kCGBitmapByteOrder32Little]==nil){
+ if([super initWithBytes:[_deviceContext bitmapBytes] width:width height:height bitsPerComponent:[_deviceContext bitsPerComponent] bytesPerRow:[_deviceContext bytesPerRow] colorSpace:[[O2ColorSpace alloc] initWithDeviceRGB] bitmapInfo:kCGImageAlphaPremultipliedFirst|kCGBitmapByteOrder32Little]==nil){
[colorSpace release];
return nil;
}
@@ -26,7 +26,7 @@
#import <AppKit/NSMenu.h>
#import <AppKit/NSCursor.h>
#import <AppKit/NSColor_CGColor.h>
-#import <CoreGraphics/KGColorSpace.h>
+#import <CoreGraphics/O2ColorSpace.h>
#import <AppKit/NSPrintInfo.h>
#import <AppKit/NSSavePanel-Win32.h>
#import <AppKit/NSOpenPanel-Win32.h>
@@ -233,7 +233,7 @@ -(void)buildSystemColors {
{ nil, 0 }
};
int i;
- CGColorSpaceRef colorSpace=[[KGColorSpace alloc] initWithPlatformRGB];
+ CGColorSpaceRef colorSpace=[[O2ColorSpace alloc] initWithPlatformRGB];
for(i=0;table[i].name!=nil;i++){
LOGBRUSH contents;
@@ -13,7 +13,7 @@
#import <Foundation/NSException.h>
#import <CoreGraphics/KGGraphicsState.h>
#import <AppKit/TTFFont.h>
-#import <CoreGraphics/KGColorSpace.h>
+#import <CoreGraphics/O2ColorSpace.h>
#import <CoreGraphics/KGSurface.h>
#import <AppKit/CairoCacheImage.h>
#import <Foundation/NSException.h>
View
@@ -8,64 +8,64 @@
#import <CoreGraphics/CGColor.h>
#import "O2Color.h"
-#import "KGColorSpace.h"
+#import "O2ColorSpace.h"
CGColorRef CGColorRetain(CGColorRef self) {
- return [self retain];
+ return O2ColorRetain(self);
}
-void CGColorRelease(CGColorRef self) {
- [self release];
+void CGColorRelease(CGColorRef self) {
+ O2ColorRelease(self);
}
CGColorRef CGColorCreate(CGColorSpaceRef colorSpace,const CGFloat *components) {
- return [[O2Color alloc] initWithColorSpace:colorSpace components:components];
+ return O2ColorCreate(colorSpace,components);
}
CGColorRef CGColorCreateGenericGray(CGFloat gray,CGFloat a) {
- return [[O2Color alloc] initWithDeviceGray:gray alpha:a];
+ return O2ColorCreateGenericGray(gray,a);
}
CGColorRef CGColorCreateGenericRGB(CGFloat r,CGFloat g,CGFloat b,CGFloat a) {
- return [[O2Color alloc] initWithDeviceRed:r green:g blue:b alpha:a];
+ return O2ColorCreateGenericRGB(r,g,b,a);
}
CGColorRef CGColorCreateGenericCMYK(CGFloat c,CGFloat m,CGFloat y,CGFloat k,CGFloat a) {
- return [[O2Color alloc] initWithDeviceCyan:c magenta:m yellow:y black:k alpha:a];
+ return O2ColorCreateGenericCMYK(c,m,y,k,a);
}
CGColorRef CGColorCreateWithPattern(CGColorSpaceRef colorSpace,CGPatternRef pattern,const CGFloat *components) {
- return [[O2Color alloc] initWithColorSpace:colorSpace pattern:pattern components:components];
+ return O2ColorCreateWithPattern(colorSpace,pattern,components);
}
CGColorRef CGColorCreateCopy(CGColorRef self) {
- return [self copy];
+ return O2ColorCreateCopy(self);
}
CGColorRef CGColorCreateCopyWithAlpha(CGColorRef self,CGFloat a) {
- return [self copyWithAlpha:a];
+ return O2ColorCreateCopyWithAlpha(self,a);
}
BOOL CGColorEqualToColor(CGColorRef self,CGColorRef other) {
- return [self isEqualToColor:other];
+ return O2ColorEqualToColor(self,other);
}
CGColorSpaceRef CGColorGetColorSpace(CGColorRef self) {
- return [self colorSpace];
+ return O2ColorGetColorSpace(self);
}
size_t CGColorGetNumberOfComponents(CGColorRef self) {
- return [self numberOfComponents];
+ return O2ColorGetNumberOfComponents(self);
}
const CGFloat *CGColorGetComponents(CGColorRef self) {
- return [self components];
+ return O2ColorGetComponents(self);
}
CGFloat CGColorGetAlpha(CGColorRef self) {
- return [self alpha];
+ return O2ColorGetAlpha(self);
}
CGPatternRef CGColorGetPattern(CGColorRef self) {
- return [self pattern];
+ return O2ColorGetPattern(self);
}
@@ -10,9 +10,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Foundation/NSObject.h>
#import <CoreGraphics/CoreGraphicsExport.h>
-@class KGColorSpace;
+@class O2ColorSpace;
-typedef KGColorSpace *CGColorSpaceRef;
+typedef O2ColorSpace *CGColorSpaceRef;
typedef enum {
kCGRenderingIntentDefault,
@@ -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/CGColorSpace.h>
-#import "KGColorSpace.h"
+#import "O2ColorSpace.h"
CGColorSpaceRef CGColorSpaceRetain(CGColorSpaceRef colorSpace) {
return [colorSpace retain];
@@ -18,15 +18,15 @@ void CGColorSpaceRelease(CGColorSpaceRef colorSpace) {
}
CGColorSpaceRef CGColorSpaceCreateDeviceRGB() {
- return [[KGColorSpace alloc] initWithDeviceRGB];
+ return [[O2ColorSpace alloc] initWithDeviceRGB];
}
CGColorSpaceRef CGColorSpaceCreateDeviceGray() {
- return [[KGColorSpace alloc] initWithDeviceGray];
+ return [[O2ColorSpace alloc] initWithDeviceGray];
}
CGColorSpaceRef CGColorSpaceCreateDeviceCMYK() {
- return [[KGColorSpace alloc] initWithDeviceCMYK];
+ return [[O2ColorSpace alloc] initWithDeviceCMYK];
}
size_t CGColorSpaceGetNumberOfComponents(CGColorSpaceRef self) {
Oops, something went wrong.

0 comments on commit 0065d5a

Please sign in to comment.