diff --git a/ClickToFlash.xcodeproj/project.pbxproj b/ClickToFlash.xcodeproj/project.pbxproj index 640ba6c7..3394ac24 100755 --- a/ClickToFlash.xcodeproj/project.pbxproj +++ b/ClickToFlash.xcodeproj/project.pbxproj @@ -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 */; }; @@ -142,8 +142,8 @@ 6953E43B0F3EDEB50014ECF7 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/MenubarMenu.xib; sourceTree = ""; }; 69A26D0A0F302C10006648BC /* NSBezierPath-RoundedRectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSBezierPath-RoundedRectangle.h"; path = "Plugin/NSBezierPath-RoundedRectangle.h"; sourceTree = ""; }; 69A26D0B0F302C10006648BC /* NSBezierPath-RoundedRectangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSBezierPath-RoundedRectangle.m"; path = "Plugin/NSBezierPath-RoundedRectangle.m"; sourceTree = ""; }; - 79166CBB0FF69E1800B1F69B /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTGradient.m; path = Plugin/CTGradient.m; sourceTree = ""; }; - 79166CBC0FF69E1800B1F69B /* CTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTGradient.h; path = Plugin/CTGradient.h; sourceTree = ""; }; + 79166CBB0FF69E1800B1F69B /* CTFGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFGradient.m; path = Plugin/CTFGradient.m; sourceTree = ""; }; + 79166CBC0FF69E1800B1F69B /* CTFGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFGradient.h; path = Plugin/CTFGradient.h; sourceTree = ""; }; 79475E0C0F658D9A00FD82E3 /* Sparkle.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Sparkle.xcodeproj; path = Plugin/Sparkle/Sparkle.xcodeproj; sourceTree = ""; }; 79A21C490F30B735009424B8 /* CTFWhitelistWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFWhitelistWindowController.m; path = Plugin/CTFWhitelistWindowController.m; sourceTree = ""; }; 79A21C4A0F30B735009424B8 /* CTFWhitelistWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFWhitelistWindowController.h; path = Plugin/CTFWhitelistWindowController.h; sourceTree = ""; }; @@ -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"; @@ -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; }; diff --git a/Plugin/CTGradient.h b/Plugin/CTFGradient.h similarity index 76% rename from Plugin/CTGradient.h rename to Plugin/CTFGradient.h index ffb78835..169ffcd4 100755 --- a/Plugin/CTGradient.h +++ b/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. @@ -26,7 +26,7 @@ typedef enum _CTBlendingMode } CTGradientBlendingMode; -@interface CTGradient : NSObject +@interface CTFGradient : NSObject { CTGradientElement* elementList; CTGradientBlendingMode blendingMode; @@ -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; diff --git a/Plugin/CTGradient.m b/Plugin/CTFGradient.m similarity index 97% rename from Plugin/CTGradient.m rename to Plugin/CTFGradient.m index 5fff8535..cbe1ae5e 100755 --- a/Plugin/CTGradient.m +++ b/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. @@ -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; @@ -30,7 +30,7 @@ - (CTGradientElement)removeElementAtPosition:(float)position; static void resolveHSV(float *color1, float *color2); -@implementation CTGradient +@implementation CTFGradient /////////////////////////////////////Initialization Type Stuff - (id)init { @@ -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; @@ -495,7 +495,7 @@ + (id)hydrogenSpectrumGradient #pragma mark Modification -- (CTGradient *)gradientWithAlphaComponent:(float)alpha +- (CTFGradient *)gradientWithAlphaComponent:(float)alpha { id newInstance = [[[self class] alloc] init]; @@ -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]; @@ -526,9 +526,9 @@ - (CTGradient *)gradientWithBlendingMode:(CTGradientBlendingMode)mode //Adds a color stop with at 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) @@ -546,9 +546,9 @@ - (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position //Removes the color stop at 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)) @@ -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)) diff --git a/Plugin/Plugin.m b/Plugin/Plugin.m index 42c80b4a..3d1243bd 100755 --- a/Plugin/Plugin.m +++ b/Plugin/Plugin.m @@ -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 @@ -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