Skip to content

Commit 0f55f2c

Browse files
committed
renamed CTGradient to CTFGradient to avoid namespace collisions with other projects using CTGradient and WebKit
1 parent b8e2abe commit 0f55f2c

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

ClickToFlash.xcodeproj/project.pbxproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
6953E4360F3EDE9D0014ECF7 /* CTFMenubarMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6953E4340F3EDE9D0014ECF7 /* CTFMenubarMenuController.m */; };
4646
6953E43C0F3EDEB50014ECF7 /* MenubarMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6953E43A0F3EDEB50014ECF7 /* MenubarMenu.xib */; };
4747
69A26D0C0F302C10006648BC /* NSBezierPath-RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = 69A26D0B0F302C10006648BC /* NSBezierPath-RoundedRectangle.m */; };
48-
79166CBD0FF69E1800B1F69B /* CTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79166CBB0FF69E1800B1F69B /* CTGradient.m */; };
48+
79166CBD0FF69E1800B1F69B /* CTFGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79166CBB0FF69E1800B1F69B /* CTFGradient.m */; };
4949
79A21C4D0F30B735009424B8 /* CTFWhitelistWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79A21C490F30B735009424B8 /* CTFWhitelistWindowController.m */; };
5050
79C040700FF1CCE6002DA6A5 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 79A060EB0FF1CBF50035F03A /* Sparkle.framework */; };
5151
79E2EB930F86AAD3005CF170 /* SparkleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 79E2EB920F86AAD3005CF170 /* SparkleManager.m */; };
@@ -142,8 +142,8 @@
142142
6953E43B0F3EDEB50014ECF7 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/MenubarMenu.xib; sourceTree = "<group>"; };
143143
69A26D0A0F302C10006648BC /* NSBezierPath-RoundedRectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSBezierPath-RoundedRectangle.h"; path = "Plugin/NSBezierPath-RoundedRectangle.h"; sourceTree = "<group>"; };
144144
69A26D0B0F302C10006648BC /* NSBezierPath-RoundedRectangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSBezierPath-RoundedRectangle.m"; path = "Plugin/NSBezierPath-RoundedRectangle.m"; sourceTree = "<group>"; };
145-
79166CBB0FF69E1800B1F69B /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTGradient.m; path = Plugin/CTGradient.m; sourceTree = "<group>"; };
146-
79166CBC0FF69E1800B1F69B /* CTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTGradient.h; path = Plugin/CTGradient.h; sourceTree = "<group>"; };
145+
79166CBB0FF69E1800B1F69B /* CTFGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFGradient.m; path = Plugin/CTFGradient.m; sourceTree = "<group>"; };
146+
79166CBC0FF69E1800B1F69B /* CTFGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFGradient.h; path = Plugin/CTFGradient.h; sourceTree = "<group>"; };
147147
79475E0C0F658D9A00FD82E3 /* Sparkle.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Sparkle.xcodeproj; path = Plugin/Sparkle/Sparkle.xcodeproj; sourceTree = "<group>"; };
148148
79A21C490F30B735009424B8 /* CTFWhitelistWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFWhitelistWindowController.m; path = Plugin/CTFWhitelistWindowController.m; sourceTree = "<group>"; };
149149
79A21C4A0F30B735009424B8 /* CTFWhitelistWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFWhitelistWindowController.h; path = Plugin/CTFWhitelistWindowController.h; sourceTree = "<group>"; };
@@ -249,8 +249,8 @@
249249
69A26D0A0F302C10006648BC /* NSBezierPath-RoundedRectangle.h */,
250250
0038DE230FC0CCF0007B54E9 /* MATrackingArea.m */,
251251
0038DE220FC0CCF0007B54E9 /* MATrackingArea.h */,
252-
79166CBB0FF69E1800B1F69B /* CTGradient.m */,
253-
79166CBC0FF69E1800B1F69B /* CTGradient.h */,
252+
79166CBB0FF69E1800B1F69B /* CTFGradient.m */,
253+
79166CBC0FF69E1800B1F69B /* CTFGradient.h */,
254254
00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */,
255255
);
256256
name = "10.4 Support";
@@ -418,7 +418,7 @@
418418
0038DE240FC0CCF0007B54E9 /* MATrackingArea.m in Sources */,
419419
A4DEFC7A0FF33F7400CCB6A8 /* CTFPreferencesDictionary.m in Sources */,
420420
A4DEFC7B0FF33F7400CCB6A8 /* CTFUserDefaultsController.m in Sources */,
421-
79166CBD0FF69E1800B1F69B /* CTGradient.m in Sources */,
421+
79166CBD0FF69E1800B1F69B /* CTFGradient.m in Sources */,
422422
);
423423
runOnlyForDeploymentPostprocessing = 0;
424424
};

Plugin/CTGradient.h renamed to Plugin/CTFGradient.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// CTGradient.h
2+
// CTFGradient.h (renamed from CTGradient to avoid namespace collisions with other projects using CTGradient and WebKit)
33
//
44
// Created by Chad Weider on 2/14/07.
55
// Writtin by Chad Weider.
@@ -26,7 +26,7 @@ typedef enum _CTBlendingMode
2626
} CTGradientBlendingMode;
2727

2828

29-
@interface CTGradient : NSObject <NSCopying, NSCoding>
29+
@interface CTFGradient : NSObject <NSCopying, NSCoding>
3030
{
3131
CTGradientElement* elementList;
3232
CTGradientBlendingMode blendingMode;
@@ -51,11 +51,11 @@ typedef enum _CTBlendingMode
5151
+ (id)rainbowGradient;
5252
+ (id)hydrogenSpectrumGradient;
5353

54-
- (CTGradient *)gradientWithAlphaComponent:(float)alpha;
54+
- (CTFGradient *)gradientWithAlphaComponent:(float)alpha;
5555

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

6060
- (CTGradientBlendingMode)blendingMode;
6161
- (NSColor *)colorStopAtIndex:(unsigned)index;

Plugin/CTGradient.m renamed to Plugin/CTFGradient.m

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// CTGradient.m
2+
// CTFGradient.m (renamed from CTGradient to avoid namespace collisions with other projects using CTGradient and WebKit)
33
//
44
// Created by Chad Weider on 2/14/07.
55
// Writtin by Chad Weider.
@@ -8,9 +8,9 @@
88
//
99
// Version: 1.8
1010

11-
#import "CTGradient.h"
11+
#import "CTFGradient.h"
1212

13-
@interface CTGradient (Private)
13+
@interface CTFGradient (Private)
1414
- (void)_commonInit;
1515
- (void)setBlendingMode:(CTGradientBlendingMode)mode;
1616
- (void)addElement:(CTGradientElement*)newElement;
@@ -30,7 +30,7 @@ - (CTGradientElement)removeElementAtPosition:(float)position;
3030
static void resolveHSV(float *color1, float *color2);
3131

3232

33-
@implementation CTGradient
33+
@implementation CTFGradient
3434
/////////////////////////////////////Initialization Type Stuff
3535
- (id)init
3636
{
@@ -66,7 +66,7 @@ - (void)dealloc
6666

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

7171
//now just copy my elementlist
7272
CTGradientElement *currentElement = elementList;
@@ -495,7 +495,7 @@ + (id)hydrogenSpectrumGradient
495495

496496

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

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

517-
- (CTGradient *)gradientWithBlendingMode:(CTGradientBlendingMode)mode
517+
- (CTFGradient *)gradientWithBlendingMode:(CTGradientBlendingMode)mode
518518
{
519-
CTGradient *newGradient = [self copy];
519+
CTFGradient *newGradient = [self copy];
520520

521521
[newGradient setBlendingMode:mode];
522522

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

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

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

547547

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

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

560-
- (CTGradient *)removeColorStopAtIndex:(unsigned)index
560+
- (CTFGradient *)removeColorStopAtIndex:(unsigned)index
561561
{
562-
CTGradient *newGradient = [self copy];
562+
CTFGradient *newGradient = [self copy];
563563
CTGradientElement removedElement = [newGradient removeElementAtIndex:index];
564564

565565
if(isnan(removedElement.position))

Plugin/Plugin.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ of this software and associated documentation files (the "Software"), to deal
3434
#import "CTFUtilities.h"
3535
#import "CTFWhitelist.h"
3636
#import "NSBezierPath-RoundedRectangle.h"
37-
#import "CTGradient.h"
37+
#import "CTFGradient.h"
3838
#import "SparkleManager.h"
3939

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

1012-
gradient = [CTGradient gradientWithBeginningColor:startingColor
1012+
gradient = [CTFGradient gradientWithBeginningColor:startingColor
10131013
endingColor:endingColor];
10141014

10151015
//angle is reversed compared to NSGradient

0 commit comments

Comments
 (0)