Skip to content

Commit

Permalink
renamed CTGradient to CTFGradient to avoid namespace collisions with …
Browse files Browse the repository at this point in the history
…other projects using CTGradient and WebKit
  • Loading branch information
roddi committed Sep 10, 2009
1 parent b8e2abe commit 0f55f2c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
12 changes: 6 additions & 6 deletions ClickToFlash.xcodeproj/project.pbxproj
Expand Up @@ -45,7 +45,7 @@
6953E4360F3EDE9D0014ECF7 /* CTFMenubarMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6953E4340F3EDE9D0014ECF7 /* CTFMenubarMenuController.m */; };
6953E43C0F3EDEB50014ECF7 /* MenubarMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6953E43A0F3EDEB50014ECF7 /* MenubarMenu.xib */; };
69A26D0C0F302C10006648BC /* NSBezierPath-RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = 69A26D0B0F302C10006648BC /* NSBezierPath-RoundedRectangle.m */; };
79166CBD0FF69E1800B1F69B /* CTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79166CBB0FF69E1800B1F69B /* CTGradient.m */; };
79166CBD0FF69E1800B1F69B /* CTFGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79166CBB0FF69E1800B1F69B /* CTFGradient.m */; };
79A21C4D0F30B735009424B8 /* CTFWhitelistWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79A21C490F30B735009424B8 /* CTFWhitelistWindowController.m */; };
79C040700FF1CCE6002DA6A5 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 79A060EB0FF1CBF50035F03A /* Sparkle.framework */; };
79E2EB930F86AAD3005CF170 /* SparkleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E2EB920F86AAD3005CF170 /* SparkleManager.m */; };
Expand Down Expand Up @@ -142,8 +142,8 @@
6953E43B0F3EDEB50014ECF7 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/MenubarMenu.xib; sourceTree = "<group>"; };
69A26D0A0F302C10006648BC /* NSBezierPath-RoundedRectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSBezierPath-RoundedRectangle.h"; path = "Plugin/NSBezierPath-RoundedRectangle.h"; sourceTree = "<group>"; };
69A26D0B0F302C10006648BC /* NSBezierPath-RoundedRectangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSBezierPath-RoundedRectangle.m"; path = "Plugin/NSBezierPath-RoundedRectangle.m"; sourceTree = "<group>"; };
79166CBB0FF69E1800B1F69B /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTGradient.m; path = Plugin/CTGradient.m; sourceTree = "<group>"; };
79166CBC0FF69E1800B1F69B /* CTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTGradient.h; path = Plugin/CTGradient.h; sourceTree = "<group>"; };
79166CBB0FF69E1800B1F69B /* CTFGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFGradient.m; path = Plugin/CTFGradient.m; sourceTree = "<group>"; };
79166CBC0FF69E1800B1F69B /* CTFGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFGradient.h; path = Plugin/CTFGradient.h; sourceTree = "<group>"; };
79475E0C0F658D9A00FD82E3 /* Sparkle.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Sparkle.xcodeproj; path = Plugin/Sparkle/Sparkle.xcodeproj; sourceTree = "<group>"; };
79A21C490F30B735009424B8 /* CTFWhitelistWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFWhitelistWindowController.m; path = Plugin/CTFWhitelistWindowController.m; sourceTree = "<group>"; };
79A21C4A0F30B735009424B8 /* CTFWhitelistWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFWhitelistWindowController.h; path = Plugin/CTFWhitelistWindowController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -249,8 +249,8 @@
69A26D0A0F302C10006648BC /* NSBezierPath-RoundedRectangle.h */,
0038DE230FC0CCF0007B54E9 /* MATrackingArea.m */,
0038DE220FC0CCF0007B54E9 /* MATrackingArea.h */,
79166CBB0FF69E1800B1F69B /* CTGradient.m */,
79166CBC0FF69E1800B1F69B /* CTGradient.h */,
79166CBB0FF69E1800B1F69B /* CTFGradient.m */,
79166CBC0FF69E1800B1F69B /* CTFGradient.h */,
00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */,
);
name = "10.4 Support";
Expand Down Expand Up @@ -418,7 +418,7 @@
0038DE240FC0CCF0007B54E9 /* MATrackingArea.m in Sources */,
A4DEFC7A0FF33F7400CCB6A8 /* CTFPreferencesDictionary.m in Sources */,
A4DEFC7B0FF33F7400CCB6A8 /* CTFUserDefaultsController.m in Sources */,
79166CBD0FF69E1800B1F69B /* CTGradient.m in Sources */,
79166CBD0FF69E1800B1F69B /* CTFGradient.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
12 changes: 6 additions & 6 deletions Plugin/CTGradient.h → Plugin/CTFGradient.h
@@ -1,5 +1,5 @@
//
// CTGradient.h
// CTFGradient.h (renamed from CTGradient to avoid namespace collisions with other projects using CTGradient and WebKit)
//
// Created by Chad Weider on 2/14/07.
// Writtin by Chad Weider.
Expand All @@ -26,7 +26,7 @@ typedef enum _CTBlendingMode
} CTGradientBlendingMode;


@interface CTGradient : NSObject <NSCopying, NSCoding>
@interface CTFGradient : NSObject <NSCopying, NSCoding>
{
CTGradientElement* elementList;
CTGradientBlendingMode blendingMode;
Expand All @@ -51,11 +51,11 @@ typedef enum _CTBlendingMode
+ (id)rainbowGradient;
+ (id)hydrogenSpectrumGradient;

- (CTGradient *)gradientWithAlphaComponent:(float)alpha;
- (CTFGradient *)gradientWithAlphaComponent:(float)alpha;

- (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position; //positions given relative to [0,1]
- (CTGradient *)removeColorStopAtIndex:(unsigned)index;
- (CTGradient *)removeColorStopAtPosition:(float)position;
- (CTFGradient *)addColorStop:(NSColor *)color atPosition:(float)position; //positions given relative to [0,1]
- (CTFGradient *)removeColorStopAtIndex:(unsigned)index;
- (CTFGradient *)removeColorStopAtPosition:(float)position;

- (CTGradientBlendingMode)blendingMode;
- (NSColor *)colorStopAtIndex:(unsigned)index;
Expand Down
28 changes: 14 additions & 14 deletions Plugin/CTGradient.m → Plugin/CTFGradient.m
@@ -1,5 +1,5 @@
//
// CTGradient.m
// CTFGradient.m (renamed from CTGradient to avoid namespace collisions with other projects using CTGradient and WebKit)
//
// Created by Chad Weider on 2/14/07.
// Writtin by Chad Weider.
Expand All @@ -8,9 +8,9 @@
//
// Version: 1.8

#import "CTGradient.h"
#import "CTFGradient.h"

@interface CTGradient (Private)
@interface CTFGradient (Private)
- (void)_commonInit;
- (void)setBlendingMode:(CTGradientBlendingMode)mode;
- (void)addElement:(CTGradientElement*)newElement;
Expand All @@ -30,7 +30,7 @@ - (CTGradientElement)removeElementAtPosition:(float)position;
static void resolveHSV(float *color1, float *color2);


@implementation CTGradient
@implementation CTFGradient
/////////////////////////////////////Initialization Type Stuff
- (id)init
{
Expand Down Expand Up @@ -66,7 +66,7 @@ - (void)dealloc

- (id)copyWithZone:(NSZone *)zone
{
CTGradient *copy = [[[self class] allocWithZone:zone] init];
CTFGradient *copy = [[[self class] allocWithZone:zone] init];

//now just copy my elementlist
CTGradientElement *currentElement = elementList;
Expand Down Expand Up @@ -495,7 +495,7 @@ + (id)hydrogenSpectrumGradient


#pragma mark Modification
- (CTGradient *)gradientWithAlphaComponent:(float)alpha
- (CTFGradient *)gradientWithAlphaComponent:(float)alpha
{
id newInstance = [[[self class] alloc] init];

Expand All @@ -514,9 +514,9 @@ - (CTGradient *)gradientWithAlphaComponent:(float)alpha
return [newInstance autorelease];
}

- (CTGradient *)gradientWithBlendingMode:(CTGradientBlendingMode)mode
- (CTFGradient *)gradientWithBlendingMode:(CTGradientBlendingMode)mode
{
CTGradient *newGradient = [self copy];
CTFGradient *newGradient = [self copy];

[newGradient setBlendingMode:mode];

Expand All @@ -526,9 +526,9 @@ - (CTGradient *)gradientWithBlendingMode:(CTGradientBlendingMode)mode

//Adds a color stop with <color> at <position> in elementList
//(if two elements are at the same position then added imediatly after the one that was there already)
- (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position
- (CTFGradient *)addColorStop:(NSColor *)color atPosition:(float)position
{
CTGradient *newGradient = [self copy];
CTFGradient *newGradient = [self copy];
CTGradientElement newGradientElement;

//put the components of color into the newGradientElement - must make sure it is a RGB color (not Gray or CMYK)
Expand All @@ -546,9 +546,9 @@ - (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position


//Removes the color stop at <position> from elementList
- (CTGradient *)removeColorStopAtPosition:(float)position
- (CTFGradient *)removeColorStopAtPosition:(float)position
{
CTGradient *newGradient = [self copy];
CTFGradient *newGradient = [self copy];
CTGradientElement removedElement = [newGradient removeElementAtPosition:position];

if(isnan(removedElement.position))
Expand All @@ -557,9 +557,9 @@ - (CTGradient *)removeColorStopAtPosition:(float)position
return [newGradient autorelease];
}

- (CTGradient *)removeColorStopAtIndex:(unsigned)index
- (CTFGradient *)removeColorStopAtIndex:(unsigned)index
{
CTGradient *newGradient = [self copy];
CTFGradient *newGradient = [self copy];
CTGradientElement removedElement = [newGradient removeElementAtIndex:index];

if(isnan(removedElement.position))
Expand Down
4 changes: 2 additions & 2 deletions Plugin/Plugin.m
Expand Up @@ -34,7 +34,7 @@ of this software and associated documentation files (the "Software"), to deal
#import "CTFUtilities.h"
#import "CTFWhitelist.h"
#import "NSBezierPath-RoundedRectangle.h"
#import "CTGradient.h"
#import "CTFGradient.h"
#import "SparkleManager.h"

#define LOGGING_ENABLED 0
Expand Down Expand Up @@ -1009,7 +1009,7 @@ - (void) _drawBackground
//tweak the opacity of the endingColor for compatibility with CTGradient
endingColor = [NSColor colorWithDeviceWhite:0.0 alpha:0.00];

gradient = [CTGradient gradientWithBeginningColor:startingColor
gradient = [CTFGradient gradientWithBeginningColor:startingColor
endingColor:endingColor];

//angle is reversed compared to NSGradient
Expand Down

0 comments on commit 0f55f2c

Please sign in to comment.