Permalink
Browse files

merge in ssp's 1.6b16 cutting-edge version

  • Loading branch information...
2 parents abe7ffe + 0a7c8d4 commit c2751ae7d1055e648791d6679b236c26478f4a8e Simone Manganelli committed Aug 17, 2010
Showing with 6,671 additions and 3,665 deletions.
  1. +103 −32 ClickToFlash.xcodeproj/project.pbxproj
  2. +23 −5 Plugin/CTFAboutBoxWindowController.h
  3. +23 −5 Plugin/CTFAboutBoxWindowController.m
  4. +35 −9 Plugin/CTFActionButton.h
  5. +114 −32 Plugin/CTFActionButton.m
  6. +37 −0 Plugin/CTFButton.h
  7. +56 −0 Plugin/CTFButton.m
  8. +41 −0 Plugin/CTFButtonsView.h
  9. +152 −0 Plugin/CTFButtonsView.m
  10. +41 −0 Plugin/CTFFullScreenWindow.h
  11. +83 −0 Plugin/CTFFullscreenWindow.m
  12. +1 −0 Plugin/CTFGradient.h
  13. +16 −1 Plugin/CTFKiller.h
  14. +16 −1 Plugin/CTFKiller.m
  15. +5 −1 Plugin/CTFKillerSIFR.h
  16. +112 −45 Plugin/CTFKillerSIFR.m
  17. +45 −0 Plugin/CTFKillerVideo-HTML.h
  18. +336 −0 Plugin/CTFKillerVideo-HTML.m
  19. +67 −0 Plugin/CTFKillerVideo-QT.h
  20. +855 −0 Plugin/CTFKillerVideo-QT.m
  21. +57 −15 Plugin/CTFKillerVideo.h
  22. +278 −323 Plugin/CTFKillerVideo.m
  23. +13 −2 Plugin/CTFKillerVimeo.h
  24. +126 −14 Plugin/CTFKillerVimeo.m
  25. +12 −8 Plugin/CTFKillerYouTube.h
  26. +192 −92 Plugin/CTFKillerYouTube.m
  27. +8 −2 Plugin/CTFLoader.h
  28. +90 −16 Plugin/CTFLoader.m
  29. +37 −10 Plugin/CTFMainButton.h
  30. +197 −78 Plugin/CTFMainButton.m
  31. +1 −0 Plugin/CTFMenubarMenuController.h
  32. +4 −3 Plugin/CTFMenubarMenuController.m
  33. +35 −0 Plugin/CTFMovieView.h
  34. +49 −0 Plugin/CTFMovieView.m
  35. +51 −1 Plugin/CTFUtilities.h
  36. +10 −4 Plugin/CTFWhitelist.h
  37. +105 −34 Plugin/CTFWhitelist.m
  38. +1 −1 Plugin/CTFWhitelistWindowController.m
  39. +122 −35 Plugin/English.lproj/AboutBox.xib
  40. +2 −10 Plugin/English.lproj/InfoPlist.strings
  41. +84 −67 Plugin/English.lproj/Localizable.strings
  42. +123 −10 Plugin/English.lproj/MenubarMenu.xib
  43. +332 −503 Plugin/English.lproj/{WhitelistPanel.xib → Preferences.xib}
  44. +3 −1 Plugin/Info-Plugin.plist
  45. +0 −106 Plugin/MATrackingArea.h
  46. +0 −432 Plugin/MATrackingArea.m
  47. +116 −49 Plugin/Plugin.h
  48. +858 −406 Plugin/Plugin.m
  49. +1 −1 Plugin/Sparkle/de.lproj/Sparkle.strings
  50. +112 −42 Plugin/de.lproj/AboutBox.xib
  51. +2 −10 Plugin/de.lproj/InfoPlist.strings
  52. +84 −67 Plugin/de.lproj/Localizable.strings
  53. +148 −35 Plugin/de.lproj/MenubarMenu.xib
  54. +468 −671 Plugin/de.lproj/{WhitelistPanel.xib → Preferences.xib}
  55. +134 −41 Plugin/fr.lproj/AboutBox.xib
  56. +2 −10 Plugin/fr.lproj/InfoPlist.strings
  57. +83 −69 Plugin/fr.lproj/Localizable.strings
  58. +123 −9 Plugin/fr.lproj/MenubarMenu.xib
  59. +395 −352 Plugin/fr.lproj/{WhitelistPanel.xib → Preferences.xib}
  60. +4 −4 Updater/CTFSparkleManager.m
  61. +1 −1 Updater/Info-Updater.plist
  62. +2 −0 Updater/de.lproj/InfoPlist.strings
  63. +13 −0 Updater/de.lproj/Localizable.strings
  64. +2 −0 Updater/en.lproj/InfoPlist.strings
  65. +13 −0 Updater/en.lproj/Localizable.strings
  66. +2 −0 Updater/fr.lproj/InfoPlist.strings
  67. +15 −0 Updater/fr.lproj/Localizable.strings
Oops, something went wrong.
@@ -1,9 +1,27 @@
/*
- CTFAboutBoxWindowController.h
- ClickToFlash
-
- Created by Sven on 04.09.09.
- Copyright 2009 earthlingsoft. All rights reserved.
+
+ The MIT License
+
+ Copyright (c) 2009 ClickToFlash Developers
+
+ 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:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ 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 <Cocoa/Cocoa.h>
@@ -1,9 +1,27 @@
/*
- CTFAboutBoxWindowController.m
- ClickToFlash
-
- Created by Sven on 04.09.09.
- Copyright 2009 earthlingsoft. All rights reserved.
+
+ The MIT License
+
+ Copyright (c) 2009 ClickToFlash Developers
+
+ 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:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ 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 "CTFAboutBoxWindowController.h"
@@ -1,25 +1,51 @@
-//
-// CTFActionButton.h
-// ClickToFlash
-//
-// Created by Sven on 09.10.09.
-// Copyright 2009 earthlingsoft. All rights reserved.
-//
+/*
+
+ The MIT License
+
+ Copyright (c) 2009 ClickToFlash Developers
+
+ 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:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ 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 <Cocoa/Cocoa.h>
+@class CTFClickToFlashPlugin;
-@interface CTFActionButton : NSButton {
+@interface CTFActionButton : NSPopUpButton {
+ CTFClickToFlashPlugin * plugin;
}
+ (id) actionButton;
+- (void) menuWillPopup: (NSNotification *) notification;
+
+- (CTFClickToFlashPlugin *) plugin;
+- (void) setPlugin: (CTFClickToFlashPlugin *) newPlugin;
+
@end
-@interface CTFActionButtonCell : NSButtonCell {
+
+@interface CTFActionButtonCell : NSPopUpButtonCell {
}
@@ -1,15 +1,32 @@
-//
-// CTFActionButton.m
-// ClickToFlash
-//
-// Created by Sven on 09.10.09.
-// Copyright 2009 earthlingsoft. All rights reserved.
-//
+/*
+
+ The MIT License
+
+ Copyright (c) 2009 ClickToFlash Developers
+
+ 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:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ 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 "CTFActionButton.h"
#import "CTFUtilities.h"
-
-static CGFloat padding = 3.;
+#import "Plugin.h"
@implementation CTFActionButton
@@ -20,61 +37,115 @@ + (id) actionButton {
NSRect gearButtonRect = NSMakeRect( .0, .0, size + 2.*margin , size + 2.*margin );
CTFActionButton * gearButton = [[[CTFActionButton alloc] initWithFrame: gearButtonRect] autorelease];
- [gearButton setButtonType: NSMomentaryPushInButton];
+ [gearButton setPullsDown: YES];
return gearButton;
}
-#pragma mark NSButton subclassing
+#pragma mark -
+#pragma mark Subclassing
+
+/*
+ Return and use our own NSPopupButtonCell subclass.
+ Overriding NSButton.
+*/
+ (Class) cellClass {
- return NSClassFromString(@"CTFActionButtonCell");
+ return [CTFActionButtonCell class];
}
-- (void) mouseDown: (NSEvent *) event {
- [NSMenu popUpContextMenu:[self menuForEvent:event] withEvent:event forView:self];
-}
+- (id) initWithFrame: (NSRect) frameRect {
+ self = [super initWithFrame: frameRect];
+ if (self != nil) {
+ [self setPlugin: nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuWillPopup:) name:NSPopUpButtonWillPopUpNotification object:self ];
+ }
+ return self;
+}
-- (NSMenu*) menuForEvent: (NSEvent*) event {
- return [[self superview] menuForEvent: event];
+- (void) dealloc {
+ [self setPlugin: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [super dealloc];
}
+/*
+ Automatically Show/Hide ourselves depending on whether the plugin is large enough for us.
+ Overriding NSView.
+*/
- (void) resizeWithOldSuperviewSize:(NSSize) oldBoundsSize {
- NSPoint newOrigin;
-
- if ( [[self cell ] gearVisible] ) {
- NSSize superSize = [[self superview] bounds].size;
+ if ( [[self cell] gearVisible] && ![[self plugin] isFullScreen]) {
+ [self setHidden:NO];
NSRect myRect = [self bounds];
- newOrigin = NSMakePoint(myRect.origin.x, superSize.height - myRect.size.height);
+ NSSize superSize = [[self superview] bounds].size;
+ NSPoint newOrigin = NSMakePoint(.0, superSize.height - myRect.size.height);
+ [self setFrameOrigin: newOrigin];
}
else {
- newOrigin = NSMakePoint( -1000. , -1000. );
+ [self setHidden:YES];
}
-
- [self setFrameOrigin: newOrigin];
}
-@end
+/*
+ Ignore clicks while in the background.
+ Overriding NSView.
+*/
+- (BOOL) acceptsFirstMouse:(NSEvent*) theEvent {
+ return NO;
+}
#pragma mark -
-#pragma mark NSView subclassing
+#pragma mark Notification
+
+/*
+ Called by NSPopUpButtonWillPopUpNotification.
+ Sets up the menu on-the-fly.
+*/
+- (void) menuWillPopup: (NSNotification *) notification {
+ [self setMenu: [[self plugin] menuForEvent: [NSApp currentEvent]]];
+}
+
+
+
+#pragma mark -
+#pragma mark Accessors
+
+- (CTFClickToFlashPlugin *) plugin {
+ return plugin;
+}
+
+- (void) setPlugin: (CTFClickToFlashPlugin *) newPlugin {
+ [newPlugin retain];
+ [plugin release];
+ plugin = newPlugin;
+}
+
+@end
+
+
+
+
+
+
+#pragma mark -
+
@implementation CTFActionButtonCell
#pragma mark NSCell subclassing
@@ -90,14 +161,15 @@ - (void) drawWithFrame: (NSRect) rect inView:(NSView *) controlView {
}
if( gearImage ) {
+ const CGFloat padding = 3.;
CGFloat gearSize = [gearImage size].width; // assumes the gear to be square
CGFloat size = gearSize + 2.0 * padding;
CGFloat x = round(bounds.size.width * .5) - round(size * .5);
CGFloat y = round(bounds.size.height * .5 ) - round(size * .5);
NSRect backgroundFrame = NSMakeRect(x, y, size, size);
NSBezierPath * circle = [NSBezierPath bezierPathWithOvalInRect:backgroundFrame];
- CGFloat alpha = ( [self isHighlighted] ) ? .9 : .7 ;
+ CGFloat alpha = [[(CTFActionButton *)[self controlView] plugin] overlayOpacityHighlighted: [self isHighlighted]];
[[NSColor colorWithDeviceWhite:1.0 alpha:alpha] set];
[circle fill];
@@ -111,7 +183,6 @@ - (void) drawWithFrame: (NSRect) rect inView:(NSView *) controlView {
-
#pragma mark -
#pragma mark Helper
@@ -127,6 +198,10 @@ - (BOOL) gearVisible {
#pragma mark -
#pragma mark Accessibility
+
+/*
+ Say that we also provide an AXDescription.
+*/
- (NSArray *) accessibilityAttributeNames {
NSMutableArray * attributes = [[[super accessibilityAttributeNames] mutableCopy] autorelease];
[attributes addObject: NSAccessibilityDescriptionAttribute];
@@ -135,14 +210,20 @@ - (NSArray *) accessibilityAttributeNames {
+/*
+ Provide values for accessibility attributes.
+ AXDescription -> description
+ AXParent -> plugin
+*/
- (id) accessibilityAttributeValue: (NSString *) attribute {
id value;
if ( [attribute isEqualToString: NSAccessibilityDescriptionAttribute] ) {
- value = CtFLocalizedString( @"ClickTo Flash Contextual menu", @"Accessibility: CTFActionButton, Title of Contextual Menu");
+ value = CtFLocalizedString( @"ClickTo Flash Menu", @"CTFActionButton Accessibility: Description");
}
- else if ( [attribute isEqualToString: NSAccessibilityParentAttribute] ){
- value = NSAccessibilityUnignoredAncestor([[self controlView] superview]);
+ else if ( [attribute isEqualToString: NSAccessibilityParentAttribute] ) {
+ // the plugin's view is our parent
+ value = NSAccessibilityUnignoredAncestor([self controlView]);
}
else {
value = [super accessibilityAttributeValue:attribute];
@@ -151,4 +232,5 @@ - (id) accessibilityAttributeValue: (NSString *) attribute {
}
+
@end
Oops, something went wrong.

0 comments on commit c2751ae

Please sign in to comment.