├── .gitignore ├── Afloat.h ├── Afloat.m ├── Afloat.xcconfig ├── Afloat.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── millenomi.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings └── xcuserdata │ └── millenomi.xcuserdatad │ └── xcschemes │ ├── Afloat.xcscheme │ ├── Donate for Afloat.xcscheme │ ├── Update Localizations.xcscheme │ └── xcschememanagement.plist ├── Afloat2.icns ├── AfloatBadgeController.h ├── AfloatBadgeController.m ├── AfloatButton.png ├── AfloatButtonPressed.png ├── AfloatDonateFirstAlert.alert ├── AfloatDonateLastAlert.alert ├── AfloatFloatingBadge.png ├── AfloatHUDBackdrop.png ├── AfloatMenuBadge (Vectorial).png ├── AfloatMenuBadge.png ├── AfloatNag.h ├── AfloatNag.m ├── AfloatNagPreferences.h ├── AfloatPanel.h ├── AfloatPanel.m ├── AfloatPanelController.h ├── AfloatPanelController.m ├── AfloatScripting ├── AfloatDisableOverlaysCommand.h ├── AfloatDisableOverlaysCommand.m ├── AfloatMakeLessTransparentCommand.h ├── AfloatMakeLessTransparentCommand.m ├── AfloatMakeMoreTransparentCommand.h ├── AfloatMakeMoreTransparentCommand.m ├── AfloatScripting.sdef ├── AfloatScripting.xcconfig ├── AfloatScripting.xcodeproj │ ├── TemplateIcon.icns │ ├── project.pbxproj │ └── xcuserdata │ │ └── millenomi.xcuserdatad │ │ └── xcschemes │ │ ├── AfloatScripting.xcscheme │ │ └── xcschememanagement.plist ├── AfloatScriptingAppDelegate.h ├── AfloatScriptingAppDelegate.m ├── AfloatScriptingSetAlphaValueCommand.h ├── AfloatScriptingSetAlphaValueCommand.m ├── AfloatScriptingSetKeptAfloatCommand.h ├── AfloatScriptingSetKeptAfloatCommand.m ├── AfloatScriptingSetKeptOnAllSpacesCommand.h ├── AfloatScriptingSetKeptOnAllSpacesCommand.m ├── AfloatScriptingToggleKeptAfloatCommand.h ├── AfloatScriptingToggleKeptAfloatCommand.m ├── AfloatScriptingWire.h ├── AfloatScripting_Prefix.pch ├── AfloatSetOverlayCommand.h ├── AfloatSetOverlayCommand.m ├── AfloatSetPinnedToDesktopCommand.h ├── AfloatSetPinnedToDesktopCommand.m ├── AfloatShowWindowFileInFinderCommand.h ├── AfloatShowWindowFileInFinderCommand.m ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib ├── Info.plist └── main.m ├── AfloatSinkingBadge.png ├── AfloatStorage.h ├── AfloatStorage.m ├── AfloatWindowIdentifier.h ├── AfloatWindowIdentifier.m ├── Afloat_AfloatNagging.h ├── Afloat_AfloatNagging.m ├── Afloat_AfloatScripting.h ├── Afloat_AfloatScripting.m ├── Afloat_Prefix.pch ├── COPYING.txt ├── Donate for Afloat-Info.plist ├── Info.plist ├── JRSwizzle.h ├── JRSwizzle.m ├── Locales └── it │ ├── Afloat.nib.alair │ ├── Afloat.nib.strings │ ├── AfloatBadge.nib.alair │ ├── AfloatBadge.nib.strings │ ├── AfloatDonateFirstAlert.alair │ ├── AfloatDonateFirstAlert.strings │ ├── AfloatDonateLastAlert.alair │ ├── AfloatDonateLastAlert.strings │ ├── AfloatPanel.nib.alair │ ├── AfloatPanel.nib.strings │ ├── Corpus.corpus │ ├── Donate.alair │ ├── Donate.nib.alair │ ├── Donate.nib.strings │ ├── Donate.strings │ ├── InfoPlist.alair │ ├── InfoPlist.strings │ └── Project.project ├── Nag.pch ├── Support └── BGHUDAppKitPlugin.ibplugin │ └── Contents │ ├── Info.plist │ ├── MacOS │ └── BGHUDAppKitPlugin │ └── Resources │ ├── BGHUDAppKitInspector.nib │ ├── designable.nib │ └── keyedobjects.nib │ ├── BGHUDAppKitLibrary.nib │ ├── designable.nib │ └── keyedobjects.nib │ ├── BGHUDButtonCell.classdescription │ ├── BGHUDColorWell.classdescription │ ├── BGHUDColorWellInspector.nib │ ├── BGHUDLabel.classdescription │ ├── BGHUDOutlineView.classdescription │ ├── BGHUDPopUpButtonCell.classdescription │ ├── BGHUDProgressIndicator.classdescription │ ├── BGHUDScrollView.classdescription │ ├── BGHUDScroller.classdescription │ ├── BGHUDSearchFieldCell.classdescription │ ├── BGHUDSecureTextFieldCell.classdescription │ ├── BGHUDSegmentedCell.classdescription │ ├── BGHUDSliderCell.classdescription │ ├── BGHUDTableView.classdescription │ ├── BGHUDTextFieldCell.classdescription │ ├── BGHUDTokenFieldCell.classdescription │ ├── English.lproj │ └── InfoPlist.strings │ ├── outlineview.png │ ├── scrollview.png │ ├── tableview.png │ └── textview.png ├── en.lproj ├── Afloat.nib │ ├── designable.nib │ └── keyedobjects.nib ├── AfloatBadge.nib │ ├── designable.nib │ └── keyedobjects.nib ├── AfloatDonateFirstAlert.strings ├── AfloatDonateLastAlert.strings ├── AfloatPanel.nib 2.original │ ├── designable.nib │ └── keyedobjects.nib ├── AfloatPanel.nib 3.original │ ├── designable.nib │ └── keyedobjects.nib ├── AfloatPanel.nib.original │ ├── designable.nib │ └── keyedobjects.nib ├── AfloatPanel.nib │ ├── designable.nib │ └── keyedobjects.nib ├── Donate.nib │ ├── designable.nib │ └── keyedobjects.nib └── InfoPlist.strings ├── libBGHUDAppKit.a └── main-Nag.m /.gitignore: -------------------------------------------------------------------------------- 1 | *.mode2v3 2 | *.pbxuser 3 | *.perspectivev3 4 | /Compiled Locales 5 | Build 6 | build 7 | TemporaryItems 8 | .DS_Store -------------------------------------------------------------------------------- /Afloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Emanuele Vulcano 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | #import 14 | 15 | 16 | @interface Afloat : NSObject { 17 | IBOutlet NSMenu* _menuWithItems; 18 | BOOL _settingOverlay; 19 | } 20 | 21 | + (id) sharedInstance; 22 | - (NSBundle*) bundle; 23 | 24 | - (IBAction) toggleAlwaysOnTop:(id) sender; 25 | - (void) setKeptAfloat:(BOOL) afloat forWindow:(NSWindow*) c showBadgeAnimation:(BOOL) animated; 26 | - (BOOL) isWindowKeptAfloat:(NSWindow*) w; 27 | 28 | - (IBAction) makeTranslucent:(id) sender; 29 | - (IBAction) makeOpaque:(id) sender; 30 | - (IBAction) makeMoreTransparent:(id) sender; 31 | - (IBAction) makeLessTransparent:(id) sender; 32 | 33 | - (IBAction) showAdjustEffectsPanel:(id) sender; 34 | 35 | - (CGFloat) currentAlphaValueForWindow:(NSWindow*) w; 36 | - (void) setAlphaValue:(CGFloat) f forWindow:(NSWindow*) window animated:(BOOL) animate; 37 | - (void) setAlphaValueByDelta:(CGFloat) f forWindow:(NSWindow*) window animate:(BOOL) animate; 38 | - (void) setAlphaValueAnimatesOnMouseOver:(BOOL) animates forWindow:(NSWindow*) window; 39 | - (BOOL) alphaValueAnimatesOnMouseOverForWindow:(NSWindow*) window; 40 | 41 | - (NSWindow*) currentWindow; 42 | 43 | - (void) setOnAllSpaces:(BOOL) afloat forWindow:(NSWindow*) c; // animated:(BOOL) animated; 44 | - (BOOL) isWindowOnAllSpaces:(NSWindow*) w; 45 | 46 | - (void) setOverlay:(BOOL) overlay forWindow:(NSWindow*) w animated:(BOOL) animated showBadgeAnimation:(BOOL) badge; 47 | - (BOOL) isWindowOverlay:(NSWindow*) w; 48 | - (IBAction) disableAllOverlays:(id) sender; 49 | - (void) disableAllOverlaysShowingBadgeAnimation:(BOOL) badge; 50 | 51 | 52 | - (IBAction) showWindowFileInFinder:(id) sender; 53 | 54 | 55 | - (void) setKeptPinnedToDesktop:(BOOL) pinned forWindow:(NSWindow*) c showBadgeAnimation:(BOOL) animated; 56 | - (BOOL) isWindowKeptPinnedToDesktop:(NSWindow*) w; 57 | 58 | - (void) animateFadeInForWindow:(NSWindow*) w; 59 | - (void) animateFadeOutForWindow:(NSWindow*) w; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Afloat.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Emanuele Vulcano 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | #import "Afloat.h" 14 | #import 15 | #import "JRSwizzle.h" 16 | 17 | #import "AfloatStorage.h" 18 | #import "AfloatPanelController.h" 19 | #import "AfloatBadgeController.h" 20 | #import "Afloat_AfloatNagging.h" 21 | #import "Afloat_AfloatScripting.h" 22 | 23 | #define kAfloatTranslucentAlphaValue (0.7f) 24 | #define kAfloatMinimumAlphaValue (0.3f) 25 | #define kAfloatOverlayAlphaValue (0.4f) 26 | 27 | #define kAfloatLastAlphaValueKey @"AfloatLastAlphaValue" 28 | #define kAfloatTrackingAreaKey @"AfloatTrackingArea" 29 | #define kAfloatTrackedViewKey @"AfloatTrackedView" 30 | #define kAfloatLastSpacesSettingKey @"AfloatLastSpacesSetting" 31 | #define kAfloatAlphaValueAnimationEnabledKey @"AfloatAlphaValueAnimationEnabled" 32 | #define kAfloatIsOverlayKey @"AfloatIsOverlay" 33 | 34 | /////////////////////////////////////// 35 | 36 | @interface NSApplication (Afloat) 37 | - (void) afloat_sendEvent:(NSEvent*) event; 38 | @end 39 | 40 | /////////////////////////////////////// 41 | 42 | @interface Afloat () 43 | 44 | - (NSUInteger) indexForInstallingInMenu:(NSMenu*) m; 45 | - (void) install; 46 | 47 | - (void) beginTrackingWindow:(NSWindow*) w; 48 | - (void) endTrackingWindow:(NSWindow*) w; 49 | 50 | - (BOOL) isWindowIgnoredByAfloat:(NSWindow*) w; 51 | - (NSWindow*) highestWindowInHierarchyFor:(NSWindow*) w; 52 | 53 | @end 54 | 55 | 56 | @implementation Afloat 57 | 58 | + (id) sharedInstance { 59 | static id myself = nil; 60 | if (!myself) myself = [self new]; 61 | return myself; 62 | } 63 | 64 | + (void) load { 65 | static BOOL alreadyLoaded = NO; 66 | if (alreadyLoaded) return; alreadyLoaded = YES; 67 | 68 | [[self sharedInstance] install]; 69 | } 70 | 71 | - (id) init { 72 | self = [super init]; 73 | if (self != nil) { 74 | AfloatStorage* shared = [AfloatStorage sharedStorage]; 75 | shared.delegate = self; 76 | } 77 | return self; 78 | } 79 | 80 | - (void) storage:(AfloatStorage*) s willRemoveMutableDictionary:(NSMutableDictionary*) d forWindow:(NSWindow*) w { 81 | 82 | [self endTrackingWindow:w]; 83 | 84 | } 85 | 86 | - (void) install { 87 | // Set up menu items --------------------------------------- 88 | 89 | NSMenu* menu = [NSApp windowsMenu]; 90 | if (!menu) { 91 | L0Log(@"%@ found no Window menu in NSApp %@", self, NSApp); 92 | return; 93 | } 94 | 95 | NSUInteger index = [self indexForInstallingInMenu:menu]; 96 | 97 | [NSBundle loadNibNamed:@"Afloat" owner:self]; 98 | 99 | NSImage* badge = [[NSImage alloc] initWithContentsOfFile: 100 | [[self bundle] pathForImageResource:@"AfloatMenuBadge"]]; 101 | 102 | NSArray* a = [NSArray arrayWithArray:[_menuWithItems itemArray]]; 103 | 104 | if (index < [menu numberOfItems] && ![[menu itemAtIndex:index] isSeparatorItem]) 105 | [menu insertItem:[NSMenuItem separatorItem] atIndex:index]; 106 | 107 | for (NSMenuItem* item in a) { 108 | [_menuWithItems removeItem:item]; 109 | 110 | if (![item isSeparatorItem]) 111 | [item setImage:badge]; 112 | 113 | [menu insertItem:item atIndex:index]; 114 | index++; 115 | } 116 | 117 | if (index < [menu numberOfItems] && ![[menu itemAtIndex:index] isSeparatorItem]) 118 | [menu insertItem:[NSMenuItem separatorItem] atIndex:index]; 119 | 120 | [badge release]; 121 | 122 | [_menuWithItems release]; _menuWithItems = nil; 123 | 124 | // Set up swizzling sendEvents: in NSApplication -------------- 125 | 126 | NSError* err = nil; 127 | BOOL result = [NSApplication jr_swizzleMethod:@selector(sendEvent:) withMethod:@selector(afloat_sendEvent:) error:&err]; 128 | 129 | if (!result) // we want this to be visible to end users, too :) 130 | NSLog(@" Could not install events filter (error: %@). Some features may not work.", err); 131 | 132 | // Set up window did become main/did resign main notification 133 | 134 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeMain:) name:NSWindowDidBecomeMainNotification object:nil]; 135 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidResignMain:) name:NSWindowDidResignMainNotification object:nil]; 136 | 137 | // Nag, nag, nag, nag, nag, nag, nag, nag... 138 | // delayed -- PS already slows down app launch enough. 139 | //[self checkForNagOnInstall]; 140 | [self performSelector:@selector(checkForNagOnInstall) withObject:nil afterDelay:7.0]; 141 | 142 | // Scripting support. 143 | [self installScriptingSupport]; 144 | } 145 | 146 | - (NSUInteger) indexForInstallingInMenu:(NSMenu*) m { 147 | NSUInteger i = 0, lastSeparator = -1; 148 | for (NSMenuItem* item in [m itemArray]) { 149 | if ([item isSeparatorItem]) 150 | lastSeparator = i; 151 | else if ([item action] == @selector(arrangeInFront:)) 152 | return i + 1; 153 | 154 | i++; 155 | } 156 | 157 | if (lastSeparator != -1) 158 | return lastSeparator + 1; 159 | else 160 | return 0; 161 | } 162 | 163 | - (NSBundle*) bundle { 164 | return [NSBundle bundleForClass:[self class]]; 165 | } 166 | 167 | - (IBAction) toggleAlwaysOnTop:(id) sender { 168 | NSWindow* c = [self currentWindow]; 169 | if (c) 170 | [self setKeptAfloat:![self isWindowKeptAfloat:c] forWindow:c showBadgeAnimation:YES]; 171 | } 172 | 173 | - (BOOL) validateMenuItem:(NSMenuItem*) item { 174 | if ([item action] == @selector(toggleAlwaysOnTop:)) { 175 | NSWindow* c = [self currentWindow]; 176 | if (!c) 177 | [item setState:NSOffState]; 178 | else 179 | [item setState:[self isWindowKeptAfloat:c]? NSOnState : NSOffState]; 180 | return c != nil; 181 | } else if ([item action] == @selector(showWindowFileInFinder:)) 182 | return [[self currentWindow] representedURL]? [[[self currentWindow] representedURL] isFileURL] : NO; 183 | 184 | return YES; 185 | } 186 | 187 | - (BOOL) isWindowKeptAfloat:(NSWindow*) w { 188 | return [w level] != NSNormalWindowLevel; 189 | } 190 | 191 | - (void) setKeptAfloat:(BOOL) afloat forWindow:(NSWindow*) c showBadgeAnimation:(BOOL) animated { 192 | L0Log(@"window = %@, will be afloat = %d, was afloat = %d", c, afloat, [self isWindowKeptAfloat:c]); 193 | BOOL wasKeptElsewhere = [self isWindowKeptAfloat:c] || [self isWindowKeptPinnedToDesktop:c]; 194 | 195 | if (afloat) { 196 | [c setLevel:NSFloatingWindowLevel]; 197 | 198 | if (!wasKeptElsewhere && animated) { 199 | L0LogS(@"Starting begin keeping afloat animation..."); 200 | [[AfloatBadgeController badgeControllerForWindow:c] animateWithBadgeType:AfloatBadgeDidBeginKeepingAfloat]; 201 | } 202 | 203 | } else if (!afloat) { 204 | [c setLevel:NSNormalWindowLevel]; 205 | 206 | if (wasKeptElsewhere && animated) { 207 | L0LogS(@"Starting end keeping afloat animation..."); 208 | [[AfloatBadgeController badgeControllerForWindow:c] animateWithBadgeType:AfloatBadgeDidEndKeepingAfloat]; 209 | } 210 | } 211 | 212 | if (!afloat && [self isWindowOverlay:c] && !_settingOverlay) 213 | [self setOverlay:NO forWindow:c animated:animated showBadgeAnimation:NO]; 214 | } 215 | 216 | - (void) setOnAllSpaces:(BOOL) spaces forWindow:(NSWindow*) c { 217 | if ([c collectionBehavior] != NSWindowCollectionBehaviorCanJoinAllSpaces && spaces) { 218 | [AfloatStorage setSharedValue:[NSNumber numberWithUnsignedInteger:[c collectionBehavior]] 219 | window:c key:kAfloatLastSpacesSettingKey]; 220 | [c setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; 221 | } else { 222 | NSNumber* n = [AfloatStorage sharedValueForWindow:c key:kAfloatLastSpacesSettingKey]; 223 | NSUInteger setting = NSWindowCollectionBehaviorDefault; 224 | if (c) 225 | setting = [n unsignedIntegerValue]; 226 | 227 | [c setCollectionBehavior:setting]; 228 | [AfloatStorage removeSharedValueForWindow:c key:kAfloatLastSpacesSettingKey]; 229 | } 230 | } 231 | 232 | - (BOOL) isWindowOnAllSpaces:(NSWindow*) w { 233 | return [w collectionBehavior] == NSWindowCollectionBehaviorCanJoinAllSpaces; 234 | } 235 | 236 | - (NSWindow*) highestWindowInHierarchyFor:(NSWindow*) w; 237 | { 238 | while ([w parentWindow]) 239 | w = [w parentWindow]; 240 | 241 | return w; 242 | } 243 | 244 | - (NSWindow*) currentWindow { 245 | NSWindow* w; 246 | 247 | w = [self highestWindowInHierarchyFor:[NSApp keyWindow]]; 248 | if (![self isWindowIgnoredByAfloat:w]) return w; 249 | 250 | w = [self highestWindowInHierarchyFor:[NSApp mainWindow]]; 251 | if (![self isWindowIgnoredByAfloat:w]) return w; 252 | 253 | for (NSWindow* window in [NSApp orderedWindows]) { 254 | w = [self highestWindowInHierarchyFor:window]; 255 | if (![self isWindowIgnoredByAfloat:w]) 256 | return w; 257 | } 258 | 259 | return nil; 260 | } 261 | 262 | - (BOOL) isWindowIgnoredByAfloat:(NSWindow*) w { 263 | return [w isKindOfClass:[NSPanel class]] || ![w isVisible]; 264 | } 265 | 266 | - (IBAction) makeTranslucent:(id) sender { 267 | NSWindow* c = [self currentWindow]; 268 | if (c) 269 | [self setAlphaValue:kAfloatTranslucentAlphaValue forWindow:[self currentWindow] animated:YES]; 270 | } 271 | 272 | - (IBAction) makeOpaque:(id) sender { 273 | NSWindow* c = [self currentWindow]; 274 | if (c) 275 | [self setAlphaValue:1.0 forWindow:[self currentWindow] animated:YES]; 276 | } 277 | 278 | - (IBAction) makeMoreTransparent:(id) sender { 279 | NSWindow* c = [self currentWindow]; 280 | if (c) 281 | [self setAlphaValueByDelta:-0.1 forWindow:[self currentWindow] animate:NO]; 282 | } 283 | 284 | - (IBAction) makeLessTransparent:(id) sender { 285 | NSWindow* c = [self currentWindow]; 286 | if (c) 287 | [self setAlphaValueByDelta:0.1 forWindow:[self currentWindow] animate:NO]; 288 | } 289 | 290 | - (CGFloat) currentAlphaValueForWindow:(NSWindow*) window { 291 | id alphaValue = [AfloatStorage sharedValueForWindow:window key:kAfloatLastAlphaValueKey]; 292 | return (alphaValue)? [alphaValue floatValue] : [window alphaValue]; 293 | } 294 | 295 | - (void) setAlphaValueByDelta:(CGFloat) delta forWindow:(NSWindow*) window animate:(BOOL) animate { 296 | if (!window) return; 297 | 298 | float a = [self currentAlphaValueForWindow:window]; 299 | [self setAlphaValue:a + delta forWindow:window animated:animate]; 300 | } 301 | 302 | - (void) setAlphaValue:(CGFloat) f forWindow:(NSWindow*) window animated:(BOOL) animate { 303 | if (!window) return; 304 | 305 | if (f > 1.0) 306 | f = 1.0; 307 | else if (f < kAfloatMinimumAlphaValue) 308 | f = kAfloatMinimumAlphaValue; 309 | 310 | [AfloatStorage setSharedValue:[NSNumber numberWithFloat:f] window:window key:kAfloatLastAlphaValueKey]; 311 | 312 | if (f == 1.0) 313 | [self endTrackingWindow:window]; 314 | else 315 | [self beginTrackingWindow:window]; 316 | 317 | if (animate) { 318 | [NSAnimationContext beginGrouping]; 319 | [[NSAnimationContext currentContext] setDuration:0.3]; 320 | [(NSWindow*)[window animator] setAlphaValue:f]; 321 | [NSAnimationContext endGrouping]; 322 | } else 323 | [window setAlphaValue:f]; 324 | } 325 | 326 | - (void) setAlphaValueAnimatesOnMouseOver:(BOOL) animates forWindow:(NSWindow*) window { 327 | if (animates) 328 | [AfloatStorage setSharedValue:[NSNumber numberWithBool:YES] window:window key:kAfloatAlphaValueAnimationEnabledKey]; 329 | else 330 | [AfloatStorage removeSharedValueForWindow:window key:kAfloatAlphaValueAnimationEnabledKey]; 331 | } 332 | 333 | - (BOOL) alphaValueAnimatesOnMouseOverForWindow:(NSWindow*) window { 334 | return [AfloatStorage sharedValueForWindow:window key:kAfloatAlphaValueAnimationEnabledKey] != nil; 335 | } 336 | 337 | - (void) beginTrackingWindow:(NSWindow*) window { 338 | L0Log(@"window = %@", window); 339 | if ([AfloatStorage sharedValueForWindow:window key:kAfloatTrackingAreaKey]) 340 | return; 341 | 342 | NSView* v = [[window contentView] superview]; 343 | NSTrackingArea* tracker = [[NSTrackingArea alloc] initWithRect:[v bounds] options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways | NSTrackingInVisibleRect owner:self userInfo:nil]; 344 | [v addTrackingArea:tracker]; 345 | 346 | [AfloatStorage setSharedValue:tracker window:window key:kAfloatTrackingAreaKey]; 347 | [AfloatStorage setSharedValue:v window:window key:kAfloatTrackedViewKey]; 348 | 349 | L0Log(@"tracker = %@ view = %@", tracker, v); 350 | 351 | [tracker release]; 352 | } 353 | 354 | - (void) endTrackingWindow:(NSWindow*) window { 355 | L0Log(@"window = %@", window); 356 | NSTrackingArea* area = [AfloatStorage sharedValueForWindow:window key:kAfloatTrackingAreaKey]; 357 | NSView* view = [AfloatStorage sharedValueForWindow:window key:kAfloatTrackedViewKey]; 358 | if (view && area) 359 | [view removeTrackingArea:area]; 360 | 361 | [AfloatStorage removeSharedValueForWindow:window key:kAfloatTrackingAreaKey]; 362 | [AfloatStorage removeSharedValueForWindow:window key:kAfloatTrackedViewKey]; 363 | } 364 | 365 | - (void) mouseEntered:(NSEvent*) e { 366 | L0Log(@"%@", e); 367 | 368 | [self animateFadeInForWindow:[e window]]; 369 | } 370 | 371 | - (void) windowDidBecomeMain:(NSNotification*) n { 372 | [self animateFadeInForWindow:[n object]]; 373 | } 374 | 375 | - (void) animateFadeInForWindow:(NSWindow*) w { 376 | if (![self alphaValueAnimatesOnMouseOverForWindow:w]) return; 377 | 378 | [NSAnimationContext beginGrouping]; 379 | [[NSAnimationContext currentContext] setDuration:0.2]; 380 | [[w animator] setAlphaValue:1.0]; 381 | [NSAnimationContext endGrouping]; 382 | 383 | } 384 | 385 | - (void) mouseExited:(NSEvent*) e { 386 | L0Log(@"%@", e); 387 | 388 | [self animateFadeOutForWindow:[e window]]; 389 | } 390 | 391 | - (void) windowDidResignMain:(NSNotification*) n { 392 | [self animateFadeOutForWindow:[n object]]; 393 | } 394 | 395 | - (void) animateFadeOutForWindow:(NSWindow*) w { 396 | if (![self alphaValueAnimatesOnMouseOverForWindow:w]) return; 397 | 398 | id alphaValue = [AfloatStorage sharedValueForWindow:w key:kAfloatLastAlphaValueKey]; 399 | if (!alphaValue) return; 400 | 401 | float a = [alphaValue floatValue]; 402 | [NSAnimationContext beginGrouping]; 403 | [[NSAnimationContext currentContext] setDuration:0.5]; 404 | [[w animator] setAlphaValue:a]; 405 | [NSAnimationContext endGrouping]; 406 | 407 | } 408 | 409 | - (IBAction) showAdjustEffectsPanel:(id) sender { 410 | NSWindow* w = [self currentWindow]; 411 | if (!w) { NSBeep(); return; } 412 | 413 | AfloatPanelController* ctl = [AfloatPanelController panelControllerForWindow:w]; 414 | [ctl toggleWindow:self]; 415 | } 416 | 417 | - (void) setOverlay:(BOOL) overlay forWindow:(NSWindow*) w animated:(BOOL) animated showBadgeAnimation:(BOOL) badge { 418 | _settingOverlay = YES; 419 | 420 | if (overlay) { 421 | [self setKeptAfloat:YES forWindow:w showBadgeAnimation:badge]; 422 | [self setAlphaValue:kAfloatOverlayAlphaValue forWindow:w animated:animated]; 423 | [self setAlphaValueAnimatesOnMouseOver:NO forWindow:w]; 424 | [w setIgnoresMouseEvents:YES]; 425 | [AfloatStorage setSharedValue:[NSNumber numberWithBool:YES] window:w key:kAfloatIsOverlayKey]; 426 | } else { 427 | if ([w alphaValue] <= kAfloatOverlayAlphaValue) 428 | [self setAlphaValue:1.0 forWindow:w animated:animated]; 429 | // [self setAlphaValueAnimatesOnMouseOver:YES forWindow:w]; 430 | [self setKeptAfloat:NO forWindow:w showBadgeAnimation:badge]; 431 | [w setIgnoresMouseEvents:NO]; 432 | [AfloatStorage removeSharedValueForWindow:w key:kAfloatIsOverlayKey]; 433 | } 434 | 435 | _settingOverlay = NO; 436 | } 437 | 438 | - (BOOL) isWindowOverlay:(NSWindow*) overlay { 439 | return [AfloatStorage sharedValueForWindow:overlay key:kAfloatIsOverlayKey] != nil; 440 | } 441 | 442 | - (IBAction) disableAllOverlays:(id) sender { 443 | [self disableAllOverlaysShowingBadgeAnimation:YES]; 444 | } 445 | 446 | - (void) disableAllOverlaysShowingBadgeAnimation:(BOOL) badge { 447 | for (NSWindow* w in [NSApp orderedWindows]) { 448 | if (![self isWindowIgnoredByAfloat:w]) 449 | [self setOverlay:NO forWindow:w animated:YES showBadgeAnimation:badge]; 450 | } 451 | } 452 | 453 | - (IBAction) showWindowFileInFinder:(id) sender { 454 | NSURL* url = [[self currentWindow] representedURL]; 455 | if (!url || ![url isFileURL]) { NSBeep(); return; } 456 | 457 | [[NSWorkspace sharedWorkspace] selectFile:[url path] inFileViewerRootedAtPath:@""]; 458 | } 459 | 460 | - (void) setKeptPinnedToDesktop:(BOOL) pinned forWindow:(NSWindow*) c showBadgeAnimation:(BOOL) animated { 461 | L0Log(@"window = %@, will be pinned to desktop = %d, was pinned to desktop = %d", c, pinned, [self isWindowKeptPinnedToDesktop:c]); 462 | // BOOL wasPinned = [self isWindowKeptAfloat:c]; 463 | // TODO: make a badge for "Pinned to Desktop" 464 | 465 | [c setLevel:(pinned)? kCGDesktopWindowLevel : NSNormalWindowLevel]; 466 | 467 | if (!pinned && [self isWindowOverlay:c] && !_settingOverlay) 468 | [self setOverlay:NO forWindow:c animated:animated showBadgeAnimation:NO]; 469 | 470 | } 471 | 472 | - (BOOL) isWindowKeptPinnedToDesktop:(NSWindow*) w { 473 | return [w level] == kCGDesktopWindowLevel; 474 | } 475 | 476 | @end 477 | 478 | @implementation NSApplication (Afloat) 479 | 480 | - (void) afloat_sendEvent:(NSEvent*) evt { 481 | unsigned mods = [evt modifierFlags] & NSDeviceIndependentModifierFlagsMask; 482 | NSPoint ori; 483 | NSRect frame; 484 | Afloat* hub = [Afloat sharedInstance]; 485 | NSWindow* wnd; 486 | 487 | if (mods == (NSCommandKeyMask | NSControlKeyMask)) { 488 | 489 | switch ([evt type]) { 490 | // The three-finger swipe gesture on a multitouch (MB Air/Pro) trackpad 491 | #define kAfloatNSSwipeGestureEvent (31) 492 | case kAfloatNSSwipeGestureEvent: { 493 | NSWindow* w = [evt window]; 494 | if ([hub isWindowIgnoredByAfloat:w]) w = [hub currentWindow]; 495 | if (w) { 496 | if ([evt deltaY] > 0) 497 | [hub setKeptAfloat:YES forWindow:w showBadgeAnimation:YES]; 498 | else if ([evt deltaY] < 0) 499 | [hub setKeptAfloat:NO forWindow:w showBadgeAnimation:YES]; 500 | return; // filter it 501 | } 502 | } 503 | 504 | case NSLeftMouseDown: 505 | case NSRightMouseDown: 506 | return; // filter it 507 | 508 | case NSLeftMouseDragged: { 509 | wnd = [evt window]; 510 | if ([hub isWindowIgnoredByAfloat:wnd]) wnd = [hub currentWindow]; 511 | 512 | ori = [wnd frame].origin; 513 | ori.x += [evt deltaX]; 514 | ori.y -= [evt deltaY]; 515 | [wnd setFrameOrigin:ori]; 516 | return; // filter it once done 517 | } 518 | 519 | case NSRightMouseDragged: { 520 | wnd = [evt window]; 521 | if ([hub isWindowIgnoredByAfloat:wnd]) wnd = [hub currentWindow]; 522 | 523 | if (wnd && ([wnd styleMask] & NSResizableWindowMask)) { 524 | NSSize minSize = [wnd minSize]; 525 | 526 | frame = [wnd frame]; 527 | frame.size.width += [evt deltaX]; 528 | frame.size.height += [evt deltaY]; 529 | 530 | if (frame.size.width < minSize.width) 531 | frame.size.width = minSize.width; 532 | 533 | if (frame.size.height < minSize.height) 534 | frame.size.height = minSize.height; 535 | else 536 | frame.origin.y -= [evt deltaY]; 537 | 538 | [wnd setFrame:frame display:YES]; 539 | return; // filter it once done 540 | } 541 | } 542 | 543 | case NSLeftMouseUp: 544 | case NSRightMouseUp: 545 | return; // filter it 546 | 547 | case NSScrollWheel: { 548 | wnd = [evt window]; 549 | if ([hub isWindowIgnoredByAfloat:wnd]) wnd = [hub currentWindow]; 550 | 551 | [hub setAlphaValueByDelta:([evt deltaY] * 0.10) forWindow:wnd animate:NO]; 552 | return; // filter it 553 | } 554 | } 555 | } 556 | 557 | // If we didn't return above, we return the event to its 558 | // regular code path. 559 | [self afloat_sendEvent:evt]; 560 | } 561 | 562 | @end 563 | -------------------------------------------------------------------------------- /Afloat.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Afloat.xcconfig 3 | // Afloat 4 | // 5 | // Created by ∞ on 18/06/08. 6 | // Copyright 2008 Emanuele Vulcano. All rights reserved. 7 | // 8 | 9 | 10 | VERSION = 2.3 11 | USER_VISIBLE_VERSION = 2.3 12 | 13 | INFINITELABS_CODE_SIGNING_IDENTITY = Infinite Labs Code Signing (Mac OS X) 14 | -------------------------------------------------------------------------------- /Afloat.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Afloat.xcodeproj/project.xcworkspace/xcuserdata/millenomi.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_BuildLocationStyle 6 | 2 7 | IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 8 | 9 | IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Afloat.xcodeproj/xcuserdata/millenomi.xcuserdatad/xcschemes/Afloat.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | 47 | 48 | 50 | 51 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Afloat.xcodeproj/xcuserdata/millenomi.xcuserdatad/xcschemes/Donate for Afloat.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 39 | 40 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | 57 | 63 | 64 | 65 | 66 | 68 | 69 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Afloat.xcodeproj/xcuserdata/millenomi.xcuserdatad/xcschemes/Update Localizations.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | 47 | 48 | 50 | 51 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Afloat.xcodeproj/xcuserdata/millenomi.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Afloat.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | Donate for Afloat.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | Update Localizations.xcscheme 18 | 19 | orderHint 20 | 0 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 151354240D9E3E31007D56FA 26 | 27 | primary 28 | 29 | 30 | 15FBC38E0E9BF71A0005A4C0 31 | 32 | primary 33 | 34 | 35 | 8D5B49AC048680CD000E48DA 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Afloat2.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Afloat2.icns -------------------------------------------------------------------------------- /AfloatBadgeController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatBadgeController.h 3 | // Afloat 4 | // 5 | // Created by ∞ on 13/03/08. 6 | // Copyright 2008 Emanuele Vulcano. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | enum { 12 | AfloatBadgeDidBeginKeepingAfloat, 13 | AfloatBadgeDidEndKeepingAfloat 14 | }; 15 | typedef NSUInteger AfloatBadgeType; 16 | 17 | @interface AfloatBadgeController : NSWindowController { 18 | NSWindow* _parentWindow; 19 | IBOutlet NSImageView* badgeView; 20 | 21 | BOOL fadingOut; 22 | unsigned int enqueuedFades; 23 | } 24 | 25 | @property(retain) NSWindow* parentWindow; 26 | 27 | - (id) initAttachedToWindow:(NSWindow*) parentWindow; 28 | + (id) badgeControllerForWindow:(NSWindow*) w; 29 | 30 | - (void) animateWithBadgeType:(AfloatBadgeType) type; 31 | + (NSImage*) didBeginKeepingAfloatBadge; 32 | + (NSImage*) didEndKeepingAfloatBadge; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /AfloatBadgeController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatBadgeController.m 3 | // Afloat 4 | // 5 | // Created by ∞ on 13/03/08. 6 | // Copyright 2008 Emanuele Vulcano. All rights reserved. 7 | // 8 | 9 | #import "AfloatBadgeController.h" 10 | #import "AfloatStorage.h" 11 | #import 12 | 13 | #define kAfloatBadgeControllerKey @"AfloatBadgeController" 14 | 15 | @implementation AfloatBadgeController 16 | 17 | + (id) badgeControllerForWindow:(NSWindow*) w { 18 | id panel = [AfloatStorage sharedValueForWindow:w key:kAfloatBadgeControllerKey]; 19 | if (panel) 20 | return panel; 21 | else 22 | return [[[self alloc] initAttachedToWindow:w] autorelease]; 23 | } 24 | 25 | - (id) initAttachedToWindow:(NSWindow*) parentWindow { 26 | if (self = [self initWithWindowNibName:@"AfloatBadge" owner:self]) { 27 | self.parentWindow = parentWindow; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | - (void) windowDidLoad { 34 | [[self window] setIgnoresMouseEvents:YES]; 35 | [[self window] setLevel:NSStatusWindowLevel]; 36 | 37 | CABasicAnimation* ani = [CABasicAnimation animation]; 38 | ani.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 39 | [[self window] setAnimations: 40 | [NSDictionary dictionaryWithObject:ani forKey:@"frameOrigin"]]; 41 | 42 | L0Log(@"badge view = %@", badgeView); 43 | } 44 | 45 | @synthesize parentWindow = _parentWindow; 46 | - (void) setParentWindow:(NSWindow*) newParent { 47 | if (newParent != _parentWindow) { 48 | if (_parentWindow) { 49 | [AfloatStorage removeSharedValueForWindow:_parentWindow key:kAfloatBadgeControllerKey]; 50 | 51 | [_parentWindow release]; 52 | } 53 | 54 | if (newParent) { 55 | [AfloatStorage setSharedValue:self window:newParent key:kAfloatBadgeControllerKey]; 56 | 57 | // [[NSNotificationCenter defaultCenter] 58 | // addObserver:self selector:@selector(parentWindowDidResize:) name:NSWindowDidResizeNotification object:_parentWindow]; 59 | 60 | 61 | [newParent retain]; 62 | } 63 | 64 | _parentWindow = newParent; 65 | } 66 | } 67 | 68 | - (NSPoint) middleOriginForParentWindow { 69 | if (!self.parentWindow) return NSZeroPoint; 70 | 71 | NSRect parentFrame = [self.parentWindow frame]; 72 | NSRect windowFrame = [[self window] frame]; 73 | NSRect screenFrame = [[self.parentWindow screen] visibleFrame]; 74 | parentFrame = NSIntersectionRect(parentFrame, screenFrame); 75 | 76 | NSPoint origin = parentFrame.origin; 77 | origin.x += parentFrame.size.width / 2; 78 | origin.x -= windowFrame.size.width / 2; 79 | origin.y += parentFrame.size.height / 2; 80 | origin.y -= windowFrame.size.height / 2; 81 | 82 | return origin; 83 | } 84 | 85 | - (void) animateWithBadgeType:(AfloatBadgeType) type { 86 | [self window]; // so the window is loaded. 87 | 88 | switch (type) { 89 | case AfloatBadgeDidBeginKeepingAfloat: 90 | [badgeView setImage:[[self class] didBeginKeepingAfloatBadge]]; 91 | 92 | { 93 | NSPoint targetOrigin = [self middleOriginForParentWindow]; 94 | NSPoint startingOrigin = targetOrigin; 95 | startingOrigin.y -= 20; 96 | 97 | NSRect r = [[self window] frame]; 98 | r.origin = startingOrigin; 99 | [[self window] setFrame:r display:NO]; 100 | [[self window] makeKeyAndOrderFront:self]; 101 | 102 | [NSAnimationContext beginGrouping]; 103 | { 104 | [[NSAnimationContext currentContext] setDuration:0.4]; 105 | r.origin = targetOrigin; 106 | [[[self window] animator] setFrame:r display:YES]; 107 | } 108 | [NSAnimationContext endGrouping]; 109 | 110 | enqueuedFades++; 111 | [self performSelector:@selector(_fadeOut) withObject:nil afterDelay:0.7]; 112 | } 113 | break; 114 | 115 | case AfloatBadgeDidEndKeepingAfloat: 116 | [badgeView setImage:[[self class] didEndKeepingAfloatBadge]]; 117 | 118 | { 119 | NSPoint targetOrigin = [self middleOriginForParentWindow]; 120 | NSPoint startingOrigin = targetOrigin; 121 | targetOrigin.y -= 30; 122 | 123 | NSRect r = [[self window] frame]; 124 | r.origin = startingOrigin; 125 | [[self window] setFrame:r display:NO]; 126 | [[self window] makeKeyAndOrderFront:self]; 127 | 128 | [NSAnimationContext beginGrouping]; 129 | { 130 | [[NSAnimationContext currentContext] setDuration:0.4]; 131 | r.origin = targetOrigin; 132 | [[[self window] animator] setFrame:r display:YES]; 133 | } 134 | [NSAnimationContext endGrouping]; 135 | 136 | enqueuedFades++; 137 | [self performSelector:@selector(_fadeOut) withObject:nil afterDelay:0.7]; 138 | } 139 | break; 140 | } 141 | } 142 | 143 | - (void) _fadeOut { 144 | if (enqueuedFades <= 1) 145 | enqueuedFades = 0; 146 | else { 147 | enqueuedFades--; 148 | return; 149 | } 150 | 151 | if (fadingOut || ![[self window] isVisible]) return; 152 | fadingOut = YES; 153 | 154 | [[NSAnimationContext currentContext] setDuration:0.2]; 155 | [[[self window] animator] setAlphaValue:0]; 156 | [NSAnimationContext endGrouping]; 157 | 158 | [AfloatStorage removeSharedValueForWindow:self.parentWindow key:kAfloatBadgeControllerKey]; 159 | 160 | [self performSelector:@selector(_endAnimation) withObject:nil afterDelay:0.3]; 161 | } 162 | 163 | - (void) _endAnimation { 164 | fadingOut = NO; 165 | [[self window] orderOut:self]; 166 | } 167 | 168 | + (NSImage*) didBeginKeepingAfloatBadge { 169 | static NSImage* image = nil; if (!image) { 170 | NSBundle* bundle = [NSBundle bundleForClass:self]; 171 | L0Log(@"loading %@", [bundle pathForImageResource:@"AfloatFloatingBadge"]); 172 | image = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"AfloatFloatingBadge"]]; 173 | L0Log(@"%@", image); 174 | } 175 | 176 | return image; 177 | } 178 | 179 | + (NSImage*) didEndKeepingAfloatBadge { 180 | static NSImage* image = nil; if (!image) { 181 | NSBundle* bundle = [NSBundle bundleForClass:self]; 182 | L0Log(@"loading %@", [bundle pathForImageResource:@"AfloatSinkingBadge"]); 183 | image = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"AfloatSinkingBadge"]]; 184 | L0Log(@"%@", image); 185 | } 186 | 187 | return image; 188 | } 189 | 190 | 191 | - (void) dealloc { 192 | self.parentWindow = nil; 193 | [super dealloc]; 194 | } 195 | 196 | @end 197 | -------------------------------------------------------------------------------- /AfloatButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatButton.png -------------------------------------------------------------------------------- /AfloatButtonPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatButtonPressed.png -------------------------------------------------------------------------------- /AfloatDonateFirstAlert.alert: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | L0AlertButtons 6 | 7 | Maybe Later 8 | Donate… 9 | 10 | L0AlertInformativeText 11 | If you do, you can support Afloat's author with a small token of your gratitude. 12 | L0AlertMessage 13 | Do you like keeping your windows afloat? 14 | L0AlertShowsSuppressionButton 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /AfloatDonateLastAlert.alert: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | L0AlertButtons 6 | 7 | Donate… 8 | No, thanks 9 | 10 | L0AlertInformativeText 11 | If you do, you can support Afloat's author with a small token of your gratitude. 12 | L0AlertMessage 13 | Do you like keeping your windows afloat? 14 | L0AlertShowsSuppressionButton 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /AfloatFloatingBadge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatFloatingBadge.png -------------------------------------------------------------------------------- /AfloatHUDBackdrop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatHUDBackdrop.png -------------------------------------------------------------------------------- /AfloatMenuBadge (Vectorial).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatMenuBadge (Vectorial).png -------------------------------------------------------------------------------- /AfloatMenuBadge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatMenuBadge.png -------------------------------------------------------------------------------- /AfloatNag.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatNag.h 3 | // Afloat 4 | // 5 | // Created by ∞ on 29/03/08. 6 | // Copyright 2008 Emanuele Vulcano. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatNag : NSObject { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatNag.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatNag.m 3 | // Afloat 4 | // 5 | // Created by ∞ on 29/03/08. 6 | // Copyright 2008 Emanuele Vulcano. All rights reserved. 7 | // 8 | 9 | #import "AfloatNag.h" 10 | #import 11 | #import "NSAlert+L0Alert.h" 12 | #import "AfloatNagPreferences.h" 13 | 14 | @implementation AfloatNag 15 | 16 | - (void) applicationDidFinishLaunching:(NSNotification*) n { 17 | NSAlert* a = nil; NSInteger donateButton; 18 | 19 | switch (AfloatNagCurrentAction()) { 20 | case kAfloatDoNotShowAlerts: 21 | break; 22 | 23 | case kAfloatShouldShowFirstAlert: 24 | AfloatNagSetPreferenceForKey(kAfloatFirstAlertShownKey, [NSNumber numberWithBool:YES]); 25 | a = [NSAlert alertNamed:@"AfloatDonateFirstAlert"]; 26 | donateButton = NSAlertSecondButtonReturn; 27 | break; 28 | 29 | case kAfloatShouldShowLastAlert: 30 | AfloatNagSetPreferenceForKey(kAfloatDidEndAlertsKey, [NSNumber numberWithBool:YES]); 31 | a = [NSAlert alertNamed:@"AfloatDonateLastAlert"]; 32 | donateButton = NSAlertFirstButtonReturn; 33 | break; 34 | } 35 | 36 | if (a) { 37 | [NSApp activateIgnoringOtherApps:YES]; 38 | NSInteger result = [a runModal]; 39 | if (result == donateButton) { 40 | AfloatNagSetPreferenceForKey(kAfloatDidEndAlertsKey, [NSNumber numberWithBool:YES]); 41 | NSURL* url = [NSURL URLWithString:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"AfloatDonationsURL"]]; 42 | [[NSWorkspace sharedWorkspace] openURL:url]; 43 | } 44 | } 45 | 46 | [NSApp terminate:self]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /AfloatNagPreferences.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #define kAfloatNagPreferencesIdentifier (CFSTR("net.infinite-labs.Afloat.Donations")) 4 | #define kAfloatDidEndAlertsKey (CFSTR("AfloatDidEndAlerts")) 5 | #define kAfloatFirstAlertShownKey (CFSTR("AfloatFirstAlertShown")) 6 | #define kAfloatInstallationDateKey (CFSTR("AfloatInstallationDate")) 7 | 8 | #define kAfloatOneDay (24 * 60 * 60) 9 | 10 | enum { 11 | kAfloatDoNotShowAlerts = 0, 12 | kAfloatShouldShowFirstAlert = 1, 13 | kAfloatShouldShowLastAlert = 2 14 | }; 15 | typedef NSInteger AfloatNagAction; 16 | 17 | static id AfloatNagGetPreferenceForKey(CFStringRef key, Class cl) { 18 | id obj = (id) CFPreferencesCopyAppValue(key, kAfloatNagPreferencesIdentifier); 19 | if (cl && obj && ![obj isKindOfClass:cl]) { 20 | [obj release]; 21 | obj = nil; 22 | } 23 | 24 | return [obj autorelease]; 25 | } 26 | 27 | static BOOL AfloatNagGetBooleanForKey(CFStringRef key) { 28 | id obj = AfloatNagGetPreferenceForKey(key, nil); 29 | return obj && [obj respondsToSelector:@selector(boolValue)] && [obj boolValue]; 30 | } 31 | 32 | static void AfloatNagSetPreferenceForKey(CFStringRef key, id obj) { 33 | CFPreferencesSetAppValue(key, (CFPropertyListRef) obj, kAfloatNagPreferencesIdentifier); 34 | CFPreferencesAppSynchronize(kAfloatNagPreferencesIdentifier); 35 | } 36 | 37 | static AfloatNagAction AfloatNagCurrentAction() { 38 | if (AfloatNagGetBooleanForKey(kAfloatDidEndAlertsKey)) 39 | return kAfloatDoNotShowAlerts; 40 | 41 | NSDate* date = AfloatNagGetPreferenceForKey(kAfloatInstallationDateKey, [NSDate class]); 42 | if (!date) 43 | return kAfloatDoNotShowAlerts; 44 | 45 | NSTimeInterval i = -[date timeIntervalSinceNow]; 46 | 47 | if (i < kAfloatOneDay) 48 | return kAfloatDoNotShowAlerts; 49 | else if (i < 8* kAfloatOneDay) 50 | return AfloatNagGetBooleanForKey(kAfloatFirstAlertShownKey)? kAfloatDoNotShowAlerts : kAfloatShouldShowFirstAlert; 51 | else 52 | return kAfloatShouldShowLastAlert; 53 | } 54 | -------------------------------------------------------------------------------- /AfloatPanel.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatPanel.h 3 | // AfloatHUD 4 | // 5 | // Created by ∞ on 04/03/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface AfloatPanel : NSPanel { 13 | } 14 | 15 | @property NSPoint frameOrigin; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AfloatPanel.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatPanel.m 3 | // AfloatHUD 4 | // 5 | // Created by ∞ on 04/03/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatPanel.h" 10 | #import 11 | 12 | @interface AfloatPanelBackdropView : NSView { 13 | NSImage* _image; 14 | } 15 | @end 16 | 17 | @implementation AfloatPanelBackdropView 18 | 19 | - (id) initWithFrame:(NSRect) frame { 20 | if (self = [super initWithFrame:frame]) { 21 | NSString* pathToBackdrop = [[NSBundle bundleForClass:[self class]] pathForImageResource:@"AfloatHUDBackdrop"]; 22 | _image = [[NSImage alloc] initWithContentsOfFile:pathToBackdrop]; 23 | } 24 | 25 | return self; 26 | } 27 | 28 | - (void) dealloc { 29 | [_image release]; 30 | [super dealloc]; 31 | } 32 | 33 | - (void) drawRect:(NSRect) r { 34 | [[NSColor clearColor] set]; NSRectFill(r); 35 | 36 | [_image drawInRect:r fromRect:r operation:NSCompositeSourceOver fraction:1.0]; 37 | } 38 | 39 | @end 40 | 41 | 42 | 43 | @implementation AfloatPanel 44 | 45 | - (id) initWithContentRect:(NSRect) contentRect styleMask:(NSUInteger) aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag { 46 | self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:flag]; 47 | if (!self) return nil; 48 | 49 | [self setBackgroundColor:[NSColor clearColor]]; 50 | [self setOpaque:NO]; 51 | [self setHasShadow:YES]; 52 | [self setMovableByWindowBackground:NO]; 53 | return self; 54 | } 55 | 56 | - (NSPoint) frameOrigin { 57 | return [self frame].origin; 58 | } 59 | 60 | @dynamic frameOrigin; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /AfloatPanelController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatPanelController.h 3 | // AfloatHUD 4 | // 5 | // Created by ∞ on 04/03/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | kAfloatWindowStateNormal = 0, 13 | kAfloatWindowStateAfloat = 1, 14 | kAfloatWindowStatePinnedToDesktop = 2, 15 | } AfloatWindowState; 16 | 17 | @interface AfloatPanelController : NSWindowController { 18 | NSWindow* _parentWindow; 19 | float lastAlpha; 20 | } 21 | 22 | - (id) initAttachedToWindow:(NSWindow*) window; 23 | + (id) panelControllerForWindow:(NSWindow*) w; 24 | 25 | - (IBAction) hideWindow:(id) sender; 26 | - (IBAction) toggleWindow:(id) sender; 27 | 28 | - (IBAction) disableAllOverlays:(id) sender; 29 | 30 | @property(retain) NSWindow* parentWindow; 31 | @property CGFloat alphaValue; 32 | // @property(getter=isKeptAfloat) BOOL keptAfloat; 33 | @property AfloatWindowState windowState; 34 | 35 | @property(getter=isOnAllSpaces) BOOL onAllSpaces; 36 | @property(getter=isOverlay) BOOL overlay; 37 | @property BOOL alphaValueAnimatesOnMouseOver; 38 | 39 | @property(readonly) BOOL canSetAlphaValueAnimatesOnMouseOver; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /AfloatPanelController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatPanelController.m 3 | // AfloatHUD 4 | // 5 | // Created by ∞ on 04/03/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatPanelController.h" 10 | #import 11 | #import "AfloatStorage.h" 12 | #import "Afloat.h" 13 | 14 | #define kAfloatPanelControllerKey @"AfloatPanelController" 15 | 16 | @interface AfloatPanelController () 17 | - (void) positionWindowRelativeToParentWindow; 18 | @end 19 | 20 | @implementation AfloatPanelController 21 | 22 | /* 23 | + (void) initialize { 24 | [self setKeys:[NSArray arrayWithObject:@"parentWindow"] triggerChangeNotificationsForDependentKey:@"alphaValue"]; 25 | } 26 | 27 | // Replaced by nondeprecated variant below. 28 | 29 | */ 30 | + (NSSet*) keyPathsForValuesAffectingAlphaValue; 31 | { 32 | return [NSSet setWithObject:@"parentWindow"]; 33 | } 34 | 35 | @synthesize parentWindow = _parentWindow; 36 | 37 | - (void) setParentWindow:(NSWindow*) newParent { 38 | if (newParent != _parentWindow) { 39 | if (_parentWindow) { 40 | [AfloatStorage removeSharedValueForWindow:_parentWindow key:kAfloatPanelControllerKey]; 41 | [_parentWindow removeChildWindow:[self window]]; 42 | 43 | [[NSNotificationCenter defaultCenter] 44 | removeObserver:self name:NSWindowDidResizeNotification object:_parentWindow]; 45 | 46 | [_parentWindow release]; 47 | } 48 | 49 | if (newParent) { 50 | [AfloatStorage setSharedValue:self window:newParent key:kAfloatPanelControllerKey]; 51 | 52 | [[NSNotificationCenter defaultCenter] 53 | addObserver:self selector:@selector(parentWindowDidResize:) name:NSWindowDidResizeNotification object:_parentWindow]; 54 | 55 | 56 | [newParent retain]; 57 | } 58 | 59 | _parentWindow = newParent; 60 | 61 | [[self window] setCollectionBehavior:[self.parentWindow collectionBehavior]]; 62 | } 63 | } 64 | 65 | - (void) parentWindowDidResize:(NSNotification*) n { 66 | NSWindow* w = [self window]; 67 | if (![w isVisible]) return; 68 | 69 | [self positionWindowRelativeToParentWindow]; 70 | } 71 | 72 | - (void) positionWindowRelativeToParentWindow { 73 | NSRect contentRect = [self.parentWindow contentRectForFrameRect:[self.parentWindow frame]]; 74 | NSWindow* w = [self window]; 75 | NSRect frame = [w frame]; 76 | 77 | NSPoint newOrigin = contentRect.origin; 78 | newOrigin.x += contentRect.size.width / 2; 79 | newOrigin.x -= frame.size.width / 2; 80 | newOrigin.y += contentRect.size.height; 81 | newOrigin.y -= frame.size.height; 82 | newOrigin.y += 4; 83 | 84 | [w setFrameOrigin:newOrigin]; 85 | } 86 | 87 | - (id) initAttachedToWindow:(NSWindow*) parentWindow { 88 | if (self = [self initWithWindowNibName:@"AfloatPanel" owner:self]) { 89 | self.parentWindow = parentWindow; 90 | lastAlpha = -1; 91 | } 92 | 93 | return self; 94 | } 95 | 96 | + (id) panelControllerForWindow:(NSWindow*) w { 97 | id panel = [AfloatStorage sharedValueForWindow:w key:kAfloatPanelControllerKey]; 98 | if (panel) 99 | return panel; 100 | else 101 | return [[[self alloc] initAttachedToWindow:w] autorelease]; 102 | } 103 | 104 | - (void) dealloc { 105 | [AfloatStorage removeSharedValueForWindow:self.parentWindow key:kAfloatPanelControllerKey]; 106 | self.parentWindow = nil; 107 | [super dealloc]; 108 | } 109 | 110 | - (IBAction) toggleWindow:(id) sender { 111 | if ([[self window] isVisible]) 112 | [self hideWindow:sender]; 113 | else 114 | [self showWindow:sender]; 115 | } 116 | 117 | - (IBAction) showWindow:(id) sender { 118 | [self positionWindowRelativeToParentWindow]; 119 | 120 | [self willChangeValueForKey:@"alphaValue"]; 121 | [self didChangeValueForKey:@"alphaValue"]; // causes an update to trigger, just in case 122 | 123 | NSDisableScreenUpdates(); 124 | 125 | NSWindow* w = [self window]; 126 | [w setAlphaValue:0]; 127 | [self.parentWindow addChildWindow:[self window] ordered:NSWindowAbove]; 128 | 129 | NSEnableScreenUpdates(); 130 | 131 | [NSAnimationContext beginGrouping]; 132 | [[NSAnimationContext currentContext] setDuration:0.2]; 133 | [(NSWindow*)[w animator] setAlphaValue:1.0]; 134 | [NSAnimationContext endGrouping]; 135 | 136 | } 137 | 138 | - (IBAction) hideWindow:(id) sender { 139 | self.parentWindow = nil; 140 | NSWindow* w = [self window]; 141 | 142 | [NSAnimationContext beginGrouping]; 143 | [[NSAnimationContext currentContext] setDuration:0.2]; 144 | [(NSWindow*)[w animator] setAlphaValue:0]; 145 | [NSAnimationContext endGrouping]; 146 | 147 | [self performSelector:@selector(hideWindowImmediatly) withObject:nil afterDelay:0.5]; 148 | } 149 | 150 | - (void) hideWindowImmediatly { 151 | [self.parentWindow removeChildWindow:[self window]]; 152 | [[self window] orderOut:self]; 153 | } 154 | 155 | - (CGFloat) alphaValue { 156 | if (self.parentWindow) { 157 | lastAlpha = [[Afloat sharedInstance] currentAlphaValueForWindow:self.parentWindow]; 158 | return lastAlpha; 159 | } else if (lastAlpha >= 0.0) 160 | return lastAlpha; 161 | else 162 | return 0.0; 163 | 164 | } 165 | 166 | - (void) setAlphaValue:(CGFloat) newAlpha { 167 | lastAlpha = newAlpha; 168 | [[Afloat sharedInstance] setAlphaValue:newAlpha forWindow:self.parentWindow animated:YES]; 169 | } 170 | 171 | //- (BOOL) isKeptAfloat { 172 | // return [[Afloat sharedInstance] isWindowKeptAfloat:self.parentWindow]; 173 | //} 174 | 175 | - (AfloatWindowState) windowState { 176 | Afloat* a = [Afloat sharedInstance]; 177 | 178 | if ([a isWindowKeptAfloat:self.parentWindow]) 179 | return kAfloatWindowStateAfloat; 180 | else if ([a isWindowKeptPinnedToDesktop:self.parentWindow]) 181 | return kAfloatWindowStatePinnedToDesktop; 182 | else 183 | return kAfloatWindowStateNormal; 184 | } 185 | 186 | - (void) setWindowState:(AfloatWindowState) state { 187 | [self willChangeValueForKey:@"overlay"]; 188 | 189 | Afloat* a = [Afloat sharedInstance]; 190 | 191 | switch (state) { 192 | case kAfloatWindowStateNormal: 193 | [a setKeptAfloat:NO forWindow:self.parentWindow showBadgeAnimation:NO]; 194 | [a setKeptPinnedToDesktop:NO forWindow:self.parentWindow showBadgeAnimation:NO]; 195 | break; 196 | 197 | case kAfloatWindowStateAfloat: 198 | [a setKeptAfloat:YES forWindow:self.parentWindow showBadgeAnimation:NO]; 199 | break; 200 | 201 | case kAfloatWindowStatePinnedToDesktop: 202 | [a setKeptPinnedToDesktop:YES forWindow:self.parentWindow showBadgeAnimation:NO]; 203 | break; 204 | } 205 | 206 | [self didChangeValueForKey:@"overlay"]; 207 | } 208 | 209 | //- (void) setKeptAfloat:(BOOL) afloat { 210 | // [self willChangeValueForKey:@"overlay"]; 211 | // 212 | // [[Afloat sharedInstance] setKeptAfloat:afloat forWindow:self.parentWindow showBadgeAnimation:NO]; 213 | // 214 | // [self didChangeValueForKey:@"overlay"]; 215 | //} 216 | 217 | - (BOOL) isOnAllSpaces { 218 | return [[Afloat sharedInstance] isWindowOnAllSpaces:self.parentWindow]; 219 | } 220 | 221 | - (void) setOnAllSpaces:(BOOL) spaces { 222 | [[Afloat sharedInstance] setOnAllSpaces:spaces forWindow:self.parentWindow]; 223 | [[self window] setCollectionBehavior:[self.parentWindow collectionBehavior]]; 224 | } 225 | 226 | - (BOOL) alphaValueAnimatesOnMouseOver { 227 | return [[Afloat sharedInstance] alphaValueAnimatesOnMouseOverForWindow:self.parentWindow]; 228 | } 229 | 230 | - (void) setAlphaValueAnimatesOnMouseOver:(BOOL) animates { 231 | [[Afloat sharedInstance] setAlphaValueAnimatesOnMouseOver:animates forWindow:self.parentWindow]; 232 | } 233 | 234 | - (BOOL) isOverlay { 235 | return [[Afloat sharedInstance] isWindowOverlay:self.parentWindow]; 236 | } 237 | 238 | - (void) setOverlay:(BOOL) overlay { 239 | [self willChangeValueForKey:@"alphaValue"]; 240 | [self willChangeValueForKey:@"keptAfloat"]; 241 | [self willChangeValueForKey:@"alphaValueAnimatesOnMouseOver"]; 242 | [self willChangeValueForKey:@"canSetAlphaValueAnimatesOnMouseOver"]; 243 | [self willChangeValueForKey:@"windowState"]; 244 | 245 | [[Afloat sharedInstance] setOverlay:overlay forWindow:self.parentWindow animated:YES showBadgeAnimation:NO]; 246 | 247 | [self didChangeValueForKey:@"windowState"]; 248 | [self didChangeValueForKey:@"canSetAlphaValueAnimatesOnMouseOver"]; 249 | [self didChangeValueForKey:@"alphaValueAnimatesOnMouseOver"]; 250 | [self didChangeValueForKey:@"keptAfloat"]; 251 | [self didChangeValueForKey:@"alphaValue"]; 252 | } 253 | 254 | - (IBAction) disableAllOverlays:(id) sender { 255 | [self willChangeValueForKey:@"overlay"]; 256 | [self willChangeValueForKey:@"alphaValue"]; 257 | [self willChangeValueForKey:@"keptAfloat"]; 258 | [self willChangeValueForKey:@"alphaValueAnimatesOnMouseOver"]; 259 | [self willChangeValueForKey:@"canSetAlphaValueAnimatesOnMouseOver"]; 260 | 261 | [[Afloat sharedInstance] disableAllOverlaysShowingBadgeAnimation:NO]; 262 | 263 | [self didChangeValueForKey:@"canSetAlphaValueAnimatesOnMouseOver"]; 264 | [self didChangeValueForKey:@"alphaValueAnimatesOnMouseOver"]; 265 | [self didChangeValueForKey:@"keptAfloat"]; 266 | [self didChangeValueForKey:@"alphaValue"]; 267 | [self didChangeValueForKey:@"overlay"]; 268 | } 269 | 270 | - (BOOL) canSetAlphaValueAnimatesOnMouseOver { 271 | return !self.overlay; 272 | } 273 | 274 | @end 275 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatDisableOverlaysCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatDisableOverlaysCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatDisableOverlaysCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatDisableOverlaysCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatDisableOverlaysCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatDisableOverlaysCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatDisableOverlaysCommand 14 | 15 | - (id) performDefaultImplementation { 16 | [[NSApp delegate] rearmDeathTimer]; 17 | 18 | [[NSDistributedNotificationCenter defaultCenter] 19 | postNotificationName:kAfloatScriptDisableAllOverlaysNotification object:kAfloatScriptWireObject]; 20 | return nil; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatMakeLessTransparentCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatMakeLessTransparentCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatMakeLessTransparentCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatMakeLessTransparentCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatMakeLessTransparentCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatMakeLessTransparentCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatMakeLessTransparentCommand 14 | 15 | - (id) performDefaultImplementation { 16 | [[NSApp delegate] rearmDeathTimer]; 17 | 18 | [[NSDistributedNotificationCenter defaultCenter] 19 | postNotificationName:kAfloatScriptLessTransparentNotification object:kAfloatScriptWireObject]; 20 | return nil; 21 | } 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatMakeMoreTransparentCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatMakeMoreTransparentCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatMakeMoreTransparentCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatMakeMoreTransparentCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatMakeMoreTransparentCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatMakeMoreTransparentCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatMakeMoreTransparentCommand 14 | 15 | - (id) performDefaultImplementation { 16 | [[NSApp delegate] rearmDeathTimer]; 17 | 18 | [[NSDistributedNotificationCenter defaultCenter] 19 | postNotificationName:kAfloatScriptMoreTransparentNotification object:kAfloatScriptWireObject]; 20 | return nil; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScripting.sdef: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScripting.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../Afloat.xcconfig" 2 | ONLY_ACTIVE_ARCH = NO 3 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScripting.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatScripting/AfloatScripting.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /AfloatScripting/AfloatScripting.xcodeproj/xcuserdata/millenomi.xcuserdatad/xcschemes/AfloatScripting.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 39 | 40 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | 57 | 63 | 64 | 65 | 66 | 68 | 69 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScripting.xcodeproj/xcuserdata/millenomi.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AfloatScripting.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8D1107260486CEB800E47090 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingAppDelegate.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatScriptingAppDelegate : NSObject { 13 | NSTimer* deathTimer; 14 | } 15 | 16 | - (void) rearmDeathTimer; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingAppDelegate.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatScriptingAppDelegate.h" 10 | 11 | 12 | @implementation AfloatScriptingAppDelegate 13 | 14 | - (void) applicationDidFinishLaunching:(NSNotification*) n { 15 | [self rearmDeathTimer]; 16 | } 17 | 18 | - (void) rearmDeathTimer { 19 | if (deathTimer) { 20 | [deathTimer invalidate]; 21 | [deathTimer release]; 22 | } 23 | 24 | deathTimer = [[NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(deathTimerTicked:) userInfo:nil repeats:NO] retain]; 25 | } 26 | 27 | - (void) deathTimerTicked:(NSTimer*) t { 28 | [NSApp terminate:self]; 29 | } 30 | 31 | - (void) dealloc { 32 | [deathTimer invalidate]; 33 | [deathTimer release]; 34 | [super dealloc]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingSetAlphaValueCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingSetAlphaValueCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatScriptingSetAlphaValueCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingSetAlphaValueCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingSetAlphaValueCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatScriptingSetAlphaValueCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatScriptingSetAlphaValueCommand 14 | 15 | - (id) performDefaultImplementation { 16 | float alphaValue = [[self directParameter] floatValue]; 17 | 18 | [[NSApp delegate] rearmDeathTimer]; 19 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfloatScriptSetAlphaValueNotification object:kAfloatScriptWireObject userInfo: 20 | [NSDictionary dictionaryWithObjectsAndKeys: 21 | [NSNumber numberWithFloat:alphaValue], @"alphaValue", 22 | nil] 23 | ]; 24 | return nil; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingSetKeptAfloatCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingSetKeptAfloatCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatScriptingSetKeptAfloatCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingSetKeptAfloatCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingSetKeptAfloatCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatScriptingSetKeptAfloatCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatScriptingSetKeptAfloatCommand 14 | 15 | - (id) performDefaultImplementation { 16 | BOOL showsBadgeAnimation = AfloatBOOLFromObject([[self evaluatedArguments] objectForKey:@"showsBadgeAnimation"], YES); 17 | BOOL keptAfloat = AfloatBOOLFromObject([self directParameter], NO); 18 | 19 | [[NSApp delegate] rearmDeathTimer]; 20 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfloatScriptSetKeptAfloatNotification object:kAfloatScriptWireObject userInfo: 21 | [NSDictionary dictionaryWithObjectsAndKeys: 22 | [NSNumber numberWithBool:showsBadgeAnimation], @"showsBadgeAnimation", 23 | [NSNumber numberWithBool:keptAfloat], @"keptAfloat", 24 | nil] 25 | ]; 26 | return nil; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingSetKeptOnAllSpacesCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingSetKeptOnAllSpacesCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatScriptingSetKeptOnAllSpacesCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingSetKeptOnAllSpacesCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingSetKeptOnAllSpacesCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatScriptingSetKeptOnAllSpacesCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatScriptingSetKeptOnAllSpacesCommand 14 | 15 | - (id) performDefaultImplementation { 16 | BOOL keptOnAllSpaces = [[self directParameter] boolValue]; 17 | 18 | [[NSApp delegate] rearmDeathTimer]; 19 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfloatScriptSetKeptOnAllSpacesNotification object:kAfloatScriptWireObject userInfo: 20 | [NSDictionary dictionaryWithObjectsAndKeys: 21 | [NSNumber numberWithBool:keptOnAllSpaces], @"keptOnAllSpaces", 22 | nil] 23 | ]; 24 | return nil; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingToggleKeptAfloatCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingToggleKeptAfloatCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatScriptingToggleKeptAfloatCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingToggleKeptAfloatCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatScriptingToggleKeptAfloatCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatScriptingToggleKeptAfloatCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatScriptingToggleKeptAfloatCommand 14 | 15 | - (id) performDefaultImplementation { 16 | BOOL showsBadgeAnimation = AfloatBOOLFromObject([[self evaluatedArguments] objectForKey:@"showsBadgeAnimation"], YES); 17 | [[NSApp delegate] rearmDeathTimer]; 18 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfloatScriptToggleKeptAfloatNotification object:kAfloatScriptWireObject userInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:showsBadgeAnimation] forKey:@"showsBadgeAnimation"]]; 19 | return nil; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScriptingWire.h: -------------------------------------------------------------------------------- 1 | 2 | #define kAfloatScriptWireObject @"net.infinite-labs.Afloat.Scripting" 3 | 4 | // Toggles the "kept afloat" flag for the topmost window. 5 | // userInfo: 6 | // @"showsBadgeAnimation" -- if NO suppresses badge animation; otherwise or YES shows the badge animation. 7 | #define kAfloatScriptToggleKeptAfloatNotification @"net.infinite-labs.Afloat.Scripting.ToggleKeptAfloat" 8 | 9 | // Sets the "kept afloat" flag for a window. 10 | // userInfo: 11 | // @"showsBadgeAnimation" -- if NO suppresses badge animation; otherwise or YES shows the badge animation. 12 | // @"keptAfloat" -- YES to keep a window afloat, NO to return it to normal. 13 | // NOTE: keptAfloat = NO may return a pinned-to-desktop window to normal. 14 | #define kAfloatScriptSetKeptAfloatNotification @"net.infinite-labs.Afloat.Scripting.SetKeptAfloat" 15 | 16 | // Sets the alpha value for a window. 17 | // userInfo: 18 | // @"alphaValue" -- Real 0.0 to 1.0. It will be clamped to the built-in default range (which may be smaller). 0.0 means fully transparent, 1.0 fully opaque. 19 | #define kAfloatScriptSetAlphaValueNotification @"net.infinite-labs.Afloat.Scripting.SetAlphaValue" 20 | 21 | // Sets the "to be kept on the screen on all Spaces" flag for the topmost window. 22 | // userInfo: 23 | // @"keptOnAllSpaces" -- YES to keep on all Spaces, NO to return to normal. 24 | #define kAfloatScriptSetKeptOnAllSpacesNotification @"net.infinite-labs.Afloat.Scripting.SetKeptOnAllSpaces" 25 | 26 | // Sets the "pinned to desktop" flag for a window. 27 | // userInfo: 28 | // @"showsBadgeAnimation" -- YES to show a badge animation, NO otherwise. 29 | // @"pinnedToDesktop" -- YES to keep a window pinned, NO to return it to normal. 30 | // NOTE: pinnedToDesktop = NO may return an afloat window to normal. 31 | #define kAfloatScriptSetPinnedToDesktopNotification @"net.infinite-labs.Afloat.Scripting.SetKeptPinnedToDesktop" 32 | 33 | // Sets the "overlay" flag for a window. 34 | // userInfo: 35 | // @"showsBadgeAnimation" -- YES to show a badge animation, NO otherwise. 36 | // @"overlay" -- YES to make the window an overlay, NO to return it to normal. 37 | // NOTE: same behavior as the overlay checkbox in Adjust Effects. (Long to describe here.) 38 | #define kAfloatScriptSetOverlayNotification @"net.infinite-labs.Afloat.Scripting.SetOverlay" 39 | 40 | // Disables all overlays in the topmost app. 41 | #define kAfloatScriptDisableAllOverlaysNotification @"net.infinite-labs.Afloat.Scripting.DisableAllOverlays" 42 | 43 | // Makes one step more transparent. 44 | #define kAfloatScriptMoreTransparentNotification @"net.infinite-labs.Afloat.Scripting.MoreTransparent" 45 | 46 | // Makes one step less transparent. 47 | #define kAfloatScriptLessTransparentNotification @"net.infinite-labs.Afloat.Scripting.LessTransparent" 48 | 49 | // Shows the topmost window's file in the Finder, if any. 50 | #define kAfloatScriptShowWindowFileInFinderNotification @"net.infinite-labs.Afloat.Scripting.ShowWindowFileInFinder" 51 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatScripting_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'AfloatScripting' target in the 'AfloatScripting' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | 8 | static inline BOOL AfloatBOOLFromObject(id object, BOOL defaultValue) { 9 | if (!object) return defaultValue; 10 | else return [object respondsToSelector:@selector(boolValue)] && [object boolValue]; 11 | } 12 | 13 | static inline float AfloatFloatFromObject(id object, float defaultValue) { 14 | if (!object || ![object respondsToSelector:@selector(floatValue)]) return defaultValue; 15 | else return [object floatValue]; 16 | } 17 | #endif 18 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatSetOverlayCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatSetOverlayCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatSetOverlayCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatSetOverlayCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatSetOverlayCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatSetOverlayCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatSetOverlayCommand 14 | 15 | - (id) performDefaultImplementation { 16 | BOOL showsBadgeAnimation = AfloatBOOLFromObject([[self evaluatedArguments] objectForKey:@"showsBadgeAnimation"], YES); 17 | BOOL overlay = AfloatBOOLFromObject([self directParameter], NO); 18 | 19 | [[NSApp delegate] rearmDeathTimer]; 20 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfloatScriptSetOverlayNotification object:kAfloatScriptWireObject userInfo: 21 | [NSDictionary dictionaryWithObjectsAndKeys: 22 | [NSNumber numberWithBool:showsBadgeAnimation], @"showsBadgeAnimation", 23 | [NSNumber numberWithBool:overlay], @"overlay", 24 | nil] 25 | ]; 26 | return nil; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatSetPinnedToDesktopCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatSetPinnedToDesktopCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatSetPinnedToDesktopCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatSetPinnedToDesktopCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatSetPinnedToDesktopCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatSetPinnedToDesktopCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatSetPinnedToDesktopCommand 14 | 15 | - (id) performDefaultImplementation { 16 | BOOL pinnedToDesktop = AfloatBOOLFromObject([self directParameter], NO); 17 | NSLog(@"Will pin to desktop = %@ (%d)", [self directParameter], pinnedToDesktop); 18 | BOOL showsBadgeAnimation = AfloatBOOLFromObject([[self evaluatedArguments] objectForKey:@"showsBadgeAnimation"], YES); 19 | 20 | [[NSApp delegate] rearmDeathTimer]; 21 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfloatScriptSetPinnedToDesktopNotification object:kAfloatScriptWireObject userInfo: 22 | [NSDictionary dictionaryWithObjectsAndKeys: 23 | [NSNumber numberWithBool:pinnedToDesktop], @"pinnedToDesktop", 24 | [NSNumber numberWithBool:showsBadgeAnimation], @"showsBadgeAnimation", 25 | nil] 26 | ]; 27 | return nil; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatShowWindowFileInFinderCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatShowWindowFileInFinderCommand.h 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AfloatShowWindowFileInFinderCommand : NSScriptCommand { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AfloatScripting/AfloatShowWindowFileInFinderCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatShowWindowFileInFinderCommand.m 3 | // AfloatScripting 4 | // 5 | // Created by ∞ on 31/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatShowWindowFileInFinderCommand.h" 10 | #import "AfloatScriptingWire.h" 11 | #import "AfloatScriptingAppDelegate.h" 12 | 13 | @implementation AfloatShowWindowFileInFinderCommand 14 | 15 | - (id) performDefaultImplementation { 16 | [[NSApp delegate] rearmDeathTimer]; 17 | 18 | [[NSDistributedNotificationCenter defaultCenter] 19 | postNotificationName:kAfloatScriptShowWindowFileInFinderNotification object:kAfloatScriptWireObject]; 20 | return nil; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /AfloatScripting/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatScripting/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /AfloatScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | NSAppleScriptEnabled 12 | 13 | OSAScriptingDefinition 14 | 15 | CFBundleIdentifier 16 | net.infinite-labs.Afloat.Scripting 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | ${PRODUCT_NAME} 21 | LSUIElement 22 | 23 | CFBundlePackageType 24 | APPL 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 1.0 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /AfloatScripting/main.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatScripting/main.m -------------------------------------------------------------------------------- /AfloatSinkingBadge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/AfloatSinkingBadge.png -------------------------------------------------------------------------------- /AfloatStorage.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Emanuele Vulcano 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | #import 14 | 15 | @interface AfloatStorage : NSObject { 16 | NSMutableDictionary* _backingStorage; 17 | id _delegate; 18 | NSArray* _persistedKeys; 19 | } 20 | 21 | + (id) sharedStorage; 22 | + (NSMutableDictionary*) sharedMutableDictionaryForWindow:(NSWindow*) window; 23 | + (id) sharedValueForWindow:(NSWindow*) w key:(NSString*) k; 24 | + (void) setSharedValue:(id) v window:(NSWindow*) w key:(NSString*) k; 25 | 26 | - (id) valueForWindow:(NSWindow*) w key:(NSString*) k; 27 | - (void) setValue:(id) v forWindow:(NSWindow*) w key:(NSString*) k; 28 | 29 | - (NSMutableDictionary*) mutableDictionaryForWindow:(NSWindow*) w; 30 | 31 | @property(assign) id delegate; 32 | @property(copy) NSArray* persistedKeys; 33 | 34 | - (void) removeValueForWindow:(NSWindow*) w key:(NSString*) k; 35 | + (void) removeSharedValueForWindow:(NSWindow*) w key:(NSString*) k; 36 | 37 | - (void) saveWindowIfRequired:(NSWindow*) w; 38 | + (void) removeSavedWindowWithCategory:(NSString*) cat identifier:(NSString*) ident; 39 | 40 | @end 41 | 42 | @interface NSObject (AfloatStorageDelegate) 43 | - (void) storage:(AfloatStorage*) s willRemoveMutableDictionary:(NSMutableDictionary*) d forWindow:(NSWindow*) w; 44 | @end 45 | 46 | -------------------------------------------------------------------------------- /AfloatStorage.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Emanuele Vulcano 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | #import "AfloatStorage.h" 14 | 15 | #define kAfloatNamedWindowsCategoryAutosaveKey @"AfloatNamedWindowsCategoryAutosave" 16 | 17 | #define kAfloatShouldSaveWindowKey @"AfloatShouldSaveWindow" 18 | 19 | @interface AfloatStorage () 20 | 21 | // Is Afloat able to save this window? (doesn't take setShouldSave:...) into account 22 | - (BOOL) canSaveWindow:(NSWindow*) w category:(NSString**) cat key:(NSString**) key; 23 | 24 | // Should Afloat save this window? (setShouldSave:NO ... makes this return NO) 25 | - (BOOL) shouldSaveWindow:(NSWindow*) w category:(NSString**) cat key:(NSString**) key; 26 | 27 | @end 28 | 29 | 30 | @implementation AfloatStorage 31 | 32 | - (id) init { 33 | self = [super init]; 34 | if (self != nil) { 35 | _backingStorage = [NSMutableDictionary new]; 36 | } 37 | return self; 38 | } 39 | 40 | - (void) dealloc { 41 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 42 | [_backingStorage release]; 43 | [super dealloc]; 44 | } 45 | 46 | - (id) valueForWindow:(NSWindow*) w key:(NSString*) k { 47 | return [[_backingStorage objectForKey:[NSValue valueWithNonretainedObject:w]] objectForKey:k]; 48 | } 49 | 50 | - (void) setValue:(id) v forWindow:(NSWindow*) w key:(NSString*) k { 51 | NSMutableDictionary* d = [self mutableDictionaryForWindow:w]; 52 | [d setObject:v forKey:k]; 53 | [self saveWindowIfRequired:w]; 54 | } 55 | 56 | - (NSMutableDictionary*) mutableDictionaryForWindow:(NSWindow*) w { 57 | NSValue* value = [NSValue valueWithNonretainedObject:w]; 58 | NSMutableDictionary* d = [_backingStorage objectForKey:value]; 59 | if (!d) { 60 | d = [NSMutableDictionary dictionary]; 61 | [_backingStorage setObject:d forKey:value]; 62 | 63 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:w]; 64 | } 65 | 66 | return d; 67 | } 68 | 69 | - (void) windowWillClose:(NSNotification*) n { 70 | NSValue* v = [NSValue valueWithNonretainedObject:[n object]]; 71 | NSMutableDictionary* d = 72 | [_backingStorage objectForKey:v]; 73 | if (d) { 74 | [self.delegate storage:self willRemoveMutableDictionary:d forWindow:[n object]]; 75 | [_backingStorage removeObjectForKey:v]; 76 | } 77 | 78 | [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:[n object]]; 79 | } 80 | 81 | - (void) removeValueForWindow:(NSWindow*) w key:(NSString*) k { 82 | [[self mutableDictionaryForWindow:w] removeObjectForKey:k]; 83 | [self saveWindowIfRequired:w]; 84 | } 85 | 86 | // Takes the current state of the storage (including persistedKeys and 87 | // setShouldSave:...) into account. 88 | - (BOOL) shouldSaveWindow:(NSWindow*) w category:(NSString**) cat key:(NSString**) key { 89 | if (!self.persistedKeys || [self.persistedKeys count] == 0) return NO; 90 | 91 | if (![[self valueForWindow:w key:kAfloatShouldSaveWindowKey] boolValue]) return NO; 92 | 93 | return [self canSaveWindow:w category:cat key:key]; 94 | } 95 | 96 | // YES if Afloat could save the window's state (returns cat/key if YES). 97 | // NO otherwise. 98 | - (BOOL) canSaveWindow:(NSWindow*) w category:(NSString**) cat key:(NSString**) key { 99 | if ([w frameAutosaveName] && ![[w frameAutosaveName] isEqual:@""]) { 100 | if (cat) *cat = kAfloatNamedWindowsCategoryAutosaveKey; 101 | if (key) *key = [w frameAutosaveName]; 102 | return YES; 103 | } 104 | 105 | 106 | 107 | return NO; 108 | } 109 | 110 | - (void) setShouldSave:(BOOL) save forWindow:(NSWindow*) w { 111 | [self setValue:[NSNumber numberWithBool:save] forWindow:w key:kAfloatShouldSaveWindowKey]; 112 | if (save) 113 | [self saveWindowIfRequired:w]; 114 | } 115 | 116 | - (void) saveWindowIfRequired:(NSWindow*) w { 117 | NSString* cat = nil, * key = nil; 118 | BOOL canSave = [self shouldSaveWindow:w category:&cat key:&key]; 119 | if (!canSave) return; 120 | 121 | cat = [NSString stringWithFormat:@"Afloat:%@:%@", cat, key]; 122 | 123 | NSMutableDictionary* m = [NSMutableDictionary dictionary]; 124 | for (NSString* persistedKey in self.persistedKeys) 125 | [m setObject:[self valueForWindow:w key:persistedKey] forKey:persistedKey]; 126 | 127 | [[NSUserDefaults standardUserDefaults] setObject:m forKey:cat]; 128 | } 129 | 130 | + (void) removeSavedWindowWithCategory:(NSString*) cat identifier:(NSString*) ident { 131 | NSString* key = [NSString stringWithFormat:@"Afloat:%@:%@", cat, ident]; 132 | [[NSUserDefaults standardUserDefaults] removeObjectForKey:key]; 133 | } 134 | 135 | @synthesize persistedKeys = _persistedKeys; 136 | 137 | + (id) sharedStorage { 138 | static id myself = nil; if (!myself) myself = [self new]; 139 | return myself; 140 | } 141 | 142 | + (NSMutableDictionary*) sharedMutableDictionaryForWindow:(NSWindow*) window { 143 | return [[self sharedStorage] mutableDictionaryForWindow:window]; 144 | } 145 | 146 | + (id) sharedValueForWindow:(NSWindow*) w key:(NSString*) k { 147 | return [[self sharedStorage] valueForWindow:w key:k]; 148 | } 149 | 150 | + (void) removeSharedValueForWindow:(NSWindow*) w key:(NSString*) k { 151 | [[self sharedStorage] removeValueForWindow:w key:k]; 152 | } 153 | 154 | + (void) setSharedValue:(id) v window:(NSWindow*) w key:(NSString*) k { 155 | [[self sharedStorage] setValue:v forWindow:w key:k]; 156 | } 157 | 158 | @synthesize delegate = _delegate; 159 | 160 | @end 161 | -------------------------------------------------------------------------------- /AfloatWindowIdentifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatWindowIdentifier.h 3 | // Afloat 4 | // 5 | // Created by ∞ on 28/08/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // A window identifier is used to identify windows 12 | // even after they are closed. They're used by AfloatStorage 13 | // to persist settings and reapply them correctly. 14 | 15 | // PLEASE NOTE: This is an abstract class that should not 16 | // be subclassed by clients. Use the +identifiersForWindow: 17 | // method to return suitable identifiers for a window. 18 | 19 | @interface AfloatWindowIdentifier : NSObject { 20 | NSString* _key; 21 | NSString* _category; 22 | 23 | BOOL _canMatchMultipleWindows; 24 | } 25 | 26 | // An identifier is made up of a category and a key; 27 | // a category is one of the constants above, while 28 | // a key identifies a window or class of windows 29 | // for that identifier category. 30 | @property(readonly, copy) NSString* category; 31 | @property(readonly, copy) NSString* key; 32 | 33 | // If YES, then the identifier is collective 34 | // (ie it can happen that more than one window 35 | // is selected that corresponds to the above). 36 | @property(readonly, assign) BOOL canMatchMultipleWindows; 37 | 38 | // YES if this identifier matches the given window, 39 | // NO otherwise. 40 | - (BOOL) matchesWindow:(NSWindow*) w; 41 | 42 | // Returns an array of identifiers that match 43 | // the given window. 44 | // NOTE: A window may have no identifiers, in which 45 | // case the storage won't be able to save settings 46 | // for it! 47 | // NOTE 2: Identifiers are returned in order of 48 | // decreasing specificity. The first identifier 49 | // returned is the one most likely to select the 50 | // fewest windows (possibly an individual identifier, 51 | // eg one with canMatchMultipleWindows = NO). 52 | // Following identifiers are likely to select more 53 | // windows. 54 | + (NSArray*) allIdentifiersForWindow:(NSWindow*) w; 55 | 56 | // 57 | 58 | @end 59 | 60 | // This category of identifiers uses autosave name as a key. 61 | // They're always individual (canMatchMultipleWindows = NO). 62 | #define kAfloatByWindowAutosaveNameCategory @"AfloatByWindowAutosaveNameCategory" 63 | 64 | // This category of identifiers uses the window's custom subclass's 65 | // name as a key. It only selects instances of subclasses of NSWindow, 66 | // not instances of NSWindow itself. (Note that NSPanel instances are never 67 | // selected.) 68 | #define kAfloatByWindowCustomSubclassCategory @"AfloatByWindowCustomSubclassCategory" 69 | 70 | // This category of identifiers uses the window's custom delegate 71 | // class as a key. It only selects windows that have a delegate. 72 | #define kAfloatByDelegateCustomSubclassCategory @"AfloatByDelegateCustomSubclassCategory" 73 | 74 | // This category of identifiers uses the window's NSWindowController 75 | // custom subclass as a key. It only selects windows whose controller 76 | // is a subclass of NSWindowController, not NSWindowController itself. 77 | #define kAfloatByWindowCustomControllerCategory @"AfloatByWindowCustomControllerCategory" 78 | -------------------------------------------------------------------------------- /AfloatWindowIdentifier.m: -------------------------------------------------------------------------------- 1 | // 2 | // AfloatWindowIdentifier.m 3 | // Afloat 4 | // 5 | // Created by ∞ on 28/08/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AfloatWindowIdentifier.h" 10 | 11 | @interface AfloatWindowIdentifier () 12 | 13 | @property(setter=_setCategory:, copy) NSString* category; 14 | @property(setter=_setKey:, copy) NSString* key; 15 | @property(setter=_setCanMatchMultipleWindows:, assign) BOOL canMatchMultipleWindows; 16 | 17 | + (NSArray*) identifierSubclasses; 18 | 19 | @end 20 | 21 | @interface AfloatWindowIdentifier (AfloatAbstractPrivateMethods) 22 | + (BOOL) canInitWithWindow:(NSWindow*) w; 23 | - (id) initWithWindow:(NSWindow*) w; 24 | @end 25 | 26 | // the class that implements kAfloatByWindowCustomSubclassCategory 27 | 28 | @interface _AfloatWindowByClassIdentifier : AfloatWindowIdentifier {} 29 | @end 30 | @implementation _AfloatWindowByClassIdentifier 31 | 32 | + (BOOL) canInitWithWindow:(NSWindow*) w { 33 | return ![w isKindOfClass:[NSPanel class]] && ![w isMemberOfClass:[NSWindow class]]; 34 | } 35 | 36 | - (id) initWithWindow:(NSWindow*) w { 37 | if (self = [super init]) { 38 | self.category = kAfloatByWindowCustomSubclassCategory; 39 | self.key = NSStringFromClass([w class]); 40 | self.canMatchMultipleWindows = YES; 41 | } 42 | 43 | return self; 44 | } 45 | 46 | - (BOOL) matchesWindow:(NSWindow*) w { 47 | return [(NSStringFromClass([w class])) isEqual:self.key]; 48 | } 49 | 50 | @end 51 | 52 | // the class that implements kAfloatByDelegateCustomSubclassCategory 53 | 54 | @interface _AfloatWindowByDelegateClassIdentifier : AfloatWindowIdentifier {} 55 | @end 56 | @implementation _AfloatWindowByDelegateClassIdentifier 57 | 58 | + (BOOL) canInitWithWindow:(NSWindow*) w { 59 | return [w delegate] != nil; 60 | } 61 | 62 | - (id) initWithWindow:(NSWindow*) w { 63 | if (self = [super init]) { 64 | self.category = kAfloatByDelegateCustomSubclassCategory; 65 | self.key = NSStringFromClass([[w delegate] class]); 66 | self.canMatchMultipleWindows = YES; 67 | } 68 | 69 | return self; 70 | } 71 | 72 | - (BOOL) matchesWindow:(NSWindow*) w { 73 | return [w delegate] && [(NSStringFromClass([[w delegate] class])) isEqual:self.key]; 74 | } 75 | 76 | @end 77 | 78 | // the class that implements kAfloatByWindowCustomControllerCategory 79 | 80 | @interface _AfloatWindowByControllerClassIdentifier : AfloatWindowIdentifier {} 81 | @end 82 | @implementation _AfloatWindowByControllerClassIdentifier 83 | 84 | + (BOOL) canInitWithWindow:(NSWindow*) w { 85 | return [w windowController] && ![[w windowController] isMemberOfClass:[NSWindowController class]]; 86 | } 87 | 88 | - (id) initWithWindow:(NSWindow*) w { 89 | if (self = [super init]) { 90 | self.category = kAfloatByWindowCustomControllerCategory; 91 | self.key = NSStringFromClass([[w windowController] class]); 92 | self.canMatchMultipleWindows = YES; 93 | } 94 | 95 | return self; 96 | } 97 | 98 | - (BOOL) matchesWindow:(NSWindow*) w { 99 | return [w windowController] && [(NSStringFromClass([[w windowController] class])) isEqual:self.key]; 100 | } 101 | 102 | @end 103 | 104 | // the class that implements kAfloatByWindowAutosaveNameCategory 105 | 106 | @interface _AfloatWindowByAutosaveNameIdentifier : AfloatWindowIdentifier {} 107 | @end 108 | @implementation _AfloatWindowByAutosaveNameIdentifier 109 | 110 | + (BOOL) canInitWithWindow:(NSWindow*) w { 111 | return [w frameAutosaveName] && ![[w frameAutosaveName] isEqual:@""]; 112 | } 113 | 114 | - (id) initWithWindow:(NSWindow*) w { 115 | if (self = [super init]) { 116 | self.category = kAfloatByWindowAutosaveNameCategory; 117 | self.key = [w frameAutosaveName]; 118 | self.canMatchMultipleWindows = YES; 119 | } 120 | 121 | return self; 122 | } 123 | 124 | - (BOOL) matchesWindow:(NSWindow*) w { 125 | return [w frameAutosaveName] && [[w frameAutosaveName] isEqual:self.key]; 126 | } 127 | 128 | @end 129 | 130 | // - * - - * - - * - - * - - * - - * - - * - 131 | 132 | @implementation AfloatWindowIdentifier 133 | 134 | + (NSArray*) identifierSubclasses { 135 | static id classes = nil; if (!classes) { 136 | classes = [[NSArray alloc] initWithObjects: 137 | [_AfloatWindowByAutosaveNameIdentifier class], 138 | [_AfloatWindowByClassIdentifier class], 139 | [_AfloatWindowByDelegateClassIdentifier class], 140 | [_AfloatWindowByControllerClassIdentifier class], 141 | nil]; 142 | } 143 | 144 | return classes; 145 | } 146 | 147 | - (void) dealloc { 148 | self.category = nil; 149 | self.key = nil; 150 | 151 | [super dealloc]; 152 | } 153 | 154 | @synthesize category = _category, key = _key, canMatchMultipleWindows = _canMatchMultipleWindows; 155 | 156 | + (NSArray*) allIdentifiersForWindow:(NSWindow*) w { 157 | NSMutableArray* results = [NSArray array]; 158 | 159 | for (Class c in [self identifierSubclasses]) { 160 | if ([c canInitWithWindow:w]) 161 | [results addObject:[[[c alloc] initWithWindow:w] autorelease]]; 162 | } 163 | 164 | return results; 165 | } 166 | 167 | - (BOOL) matchesWindow:(NSWindow*) w { 168 | return NO; 169 | } 170 | 171 | @end 172 | -------------------------------------------------------------------------------- /Afloat_AfloatNagging.h: -------------------------------------------------------------------------------- 1 | // 2 | // Afloat_AfloatNagging.h 3 | // Afloat 4 | // 5 | // Created by ∞ on 29/03/08. 6 | // Copyright 2008 Emanuele Vulcano. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Afloat.h" 11 | 12 | @interface Afloat (AfloatNagging) 13 | 14 | - (void) checkForNagOnInstall; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Afloat_AfloatNagging.m: -------------------------------------------------------------------------------- 1 | // 2 | // Afloat_AfloatNagging.m 3 | // Afloat 4 | // 5 | // Created by ∞ on 29/03/08. 6 | // Copyright 2008 Emanuele Vulcano. All rights reserved. 7 | // 8 | 9 | #import "Afloat_AfloatNagging.h" 10 | #import 11 | #import "AfloatNagPreferences.h" 12 | 13 | @implementation Afloat (AfloatNagging) 14 | 15 | - (void) checkForNagOnInstall { 16 | #if kAfloatEnableNag 17 | #warning Nagging is enabled. 18 | if (!AfloatNagGetPreferenceForKey(kAfloatInstallationDateKey, [NSDate class])) 19 | AfloatNagSetPreferenceForKey(kAfloatInstallationDateKey, [NSDate date]); 20 | 21 | if (AfloatNagCurrentAction() != kAfloatDoNotShowAlerts) { 22 | NSBundle* b = [NSBundle bundleForClass:[self class]]; 23 | NSString* donateApp = [[[b bundlePath] stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"Donate for Afloat.app"]; 24 | [[NSWorkspace sharedWorkspace] openFile:donateApp]; 25 | } 26 | #endif 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Afloat_AfloatScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // Afloat_AfloatScripting.h 3 | // Afloat 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Afloat.h" 11 | 12 | #import "AfloatScripting/AfloatScriptingWire.h" 13 | 14 | @interface Afloat (AfloatScripting) 15 | 16 | - (void) installScriptingSupport; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Afloat_AfloatScripting.m: -------------------------------------------------------------------------------- 1 | // 2 | // Afloat_AfloatScripting.m 3 | // Afloat 4 | // 5 | // Created by ∞ on 30/12/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Afloat_AfloatScripting.h" 10 | #import 11 | 12 | static BOOL AfloatBOOLFromObject(id object, BOOL defaultValue) { 13 | if (!object) return defaultValue; 14 | else return [object respondsToSelector:@selector(boolValue)] && [object boolValue]; 15 | } 16 | 17 | static float AfloatFloatFromObject(id object, float defaultValue) { 18 | if (!object || ![object respondsToSelector:@selector(floatValue)]) return defaultValue; 19 | else return [object floatValue]; 20 | } 21 | 22 | 23 | @implementation Afloat (AfloatScripting) 24 | 25 | - (void) installScriptingSupport { 26 | // Toggle kept afloat 27 | [[NSDistributedNotificationCenter defaultCenter] 28 | addObserver:self 29 | selector:@selector(_scriptShouldToggleKeptAfloat:) 30 | name:kAfloatScriptToggleKeptAfloatNotification 31 | object:kAfloatScriptWireObject]; 32 | 33 | // Set kept afloat 34 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldSetKeptAfloat:) name:kAfloatScriptSetKeptAfloatNotification object:kAfloatScriptWireObject]; 35 | 36 | // Set alpha value 37 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldSetAlphaValue:) name:kAfloatScriptSetAlphaValueNotification object:kAfloatScriptWireObject]; 38 | 39 | // Set to be kept in all spaces 40 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldSetKeptOnAllSpaces:) name:kAfloatScriptSetKeptOnAllSpacesNotification object:kAfloatScriptWireObject]; 41 | 42 | // Set pinned to desktop 43 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldSetPinnedToDesktop:) name:kAfloatScriptSetPinnedToDesktopNotification object:kAfloatScriptWireObject]; 44 | 45 | // Set overlay 46 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldSetOverlay:) name:kAfloatScriptSetOverlayNotification object:kAfloatScriptWireObject]; 47 | 48 | // Disable all overlays 49 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldDisableAllOverlays:) name:kAfloatScriptDisableAllOverlaysNotification object:kAfloatScriptWireObject]; 50 | 51 | // Make more transparent 52 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldMakeMoreTransparent:) name:kAfloatScriptMoreTransparentNotification object:kAfloatScriptWireObject]; 53 | 54 | // Make less transparent 55 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldMakeLessTransparent:) name:kAfloatScriptLessTransparentNotification object:kAfloatScriptWireObject]; 56 | 57 | // Show window's file in finder 58 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldShowWindowFileInFinder:) name:kAfloatScriptShowWindowFileInFinderNotification object:kAfloatScriptWireObject]; 59 | 60 | NSString* pathToScriptingApp = [[[[NSBundle bundleForClass:[self class]] bundlePath] stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"Afloat Scripting.app"]; 61 | LSRegisterURL((CFURLRef) [NSURL fileURLWithPath:pathToScriptingApp], false); 62 | 63 | L0LogS(@"Scripting support installed."); 64 | } 65 | 66 | - (void) _scriptShouldShowWindowFileInFinder:(NSNotification*) n { 67 | if (![NSApp isActive]) return; 68 | 69 | [self showWindowFileInFinder:self]; 70 | 71 | L0LogS(@"Script: Tried to show the window's file in the Finder."); 72 | } 73 | 74 | - (void) _scriptShouldMakeLessTransparent:(NSNotification*) n { 75 | if (![NSApp isActive]) return; 76 | 77 | [self makeLessTransparent:self]; 78 | 79 | L0LogS(@"Script: Made less transparent."); 80 | } 81 | 82 | - (void) _scriptShouldMakeMoreTransparent:(NSNotification*) n { 83 | if (![NSApp isActive]) return; 84 | 85 | [self makeMoreTransparent:self]; 86 | 87 | L0LogS(@"Script: Made more transparent."); 88 | } 89 | 90 | - (void) _scriptShouldDisableAllOverlays:(NSNotification*) n { 91 | if (![NSApp isActive]) return; 92 | 93 | [self disableAllOverlays:self]; 94 | 95 | L0LogS(@"Script: Disabled all overlays."); 96 | } 97 | 98 | - (void) _scriptShouldSetOverlay:(NSNotification*) n { 99 | if (![NSApp isActive]) return; 100 | 101 | NSWindow* w = [self currentWindow]; 102 | BOOL isOverlay = AfloatBOOLFromObject([[n userInfo] objectForKey:@"overlay"], NO); 103 | BOOL showsBadgeAnimation = AfloatBOOLFromObject([[n userInfo] objectForKey:@"showsBadgeAnimation"], YES); 104 | 105 | [self setOverlay:isOverlay forWindow:w animated:YES showBadgeAnimation:showsBadgeAnimation]; 106 | 107 | L0Log(@"Script: Set window overlay = %d with badge animation = %d", isOverlay, showsBadgeAnimation); 108 | } 109 | 110 | - (void) _scriptShouldSetPinnedToDesktop:(NSNotification*) n { 111 | if (![NSApp isActive]) return; 112 | 113 | L0Log(@"Script: will pin to desktop with notification = %@ userInfo = %@", n, [n userInfo]); 114 | 115 | NSWindow* w = [self currentWindow]; 116 | BOOL isPinnedToDesktop = AfloatBOOLFromObject([[n userInfo] objectForKey:@"pinnedToDesktop"], NO); 117 | BOOL showsBadgeAnimation = AfloatBOOLFromObject([[n userInfo] objectForKey:@"showsBadgeAnimation"], YES); 118 | 119 | [self setKeptPinnedToDesktop:isPinnedToDesktop forWindow:w showBadgeAnimation:showsBadgeAnimation]; 120 | 121 | L0Log(@"Script: Set window pinned to desktop = %d with badge animation = %d", isPinnedToDesktop, showsBadgeAnimation); 122 | } 123 | 124 | - (void) _scriptShouldSetKeptOnAllSpaces:(NSNotification*) n { 125 | if (![NSApp isActive]) return; 126 | 127 | NSWindow* w = [self currentWindow]; 128 | BOOL isKeptOnAllSpaces = AfloatBOOLFromObject([[n userInfo] objectForKey:@"keptOnAllSpaces"], NO); 129 | 130 | [self setOnAllSpaces:isKeptOnAllSpaces forWindow:w]; 131 | 132 | L0Log(@"Script: Set window on all spaces = %d", isKeptOnAllSpaces); 133 | } 134 | 135 | - (void) _scriptShouldToggleKeptAfloat:(NSNotification*) n { 136 | if (![NSApp isActive]) return; 137 | 138 | NSWindow* w = [self currentWindow]; 139 | BOOL isKeptAfloat = [self isWindowKeptAfloat:w]; 140 | BOOL showsBadgeAnimation = AfloatBOOLFromObject([[n userInfo] objectForKey:@"showsBadgeAnimation"], YES); 141 | 142 | if (w) 143 | [self setKeptAfloat:!isKeptAfloat forWindow:w showBadgeAnimation:showsBadgeAnimation]; 144 | 145 | L0Log(@"Script: Did toggle kept afloat with badge animation = %d", showsBadgeAnimation); 146 | } 147 | 148 | - (void) _scriptShouldSetKeptAfloat:(NSNotification*) n { 149 | if (![NSApp isActive]) return; 150 | 151 | NSWindow* w = [self currentWindow]; 152 | BOOL isKeptAfloat = [self isWindowKeptAfloat:w]; 153 | BOOL showsBadgeAnimation = AfloatBOOLFromObject([[n userInfo] objectForKey:@"showsBadgeAnimation"], YES); 154 | BOOL keepAfloat = AfloatBOOLFromObject([[n userInfo] objectForKey:@"keptAfloat"], NO); 155 | 156 | if (keepAfloat == isKeptAfloat) return; 157 | 158 | if (w) 159 | [self setKeptAfloat:keepAfloat forWindow:w showBadgeAnimation:showsBadgeAnimation]; 160 | 161 | L0Log(@"Script: Did set kept afloat = %d with badge animation = %d", keepAfloat, showsBadgeAnimation); 162 | } 163 | 164 | - (void) _scriptShouldSetAlphaValue:(NSNotification*) n { 165 | if (![NSApp isActive]) return; 166 | 167 | NSWindow* w = [self currentWindow]; 168 | float alphaValue = AfloatFloatFromObject([[n userInfo] objectForKey:@"alphaValue"], 1.0); 169 | 170 | if (w) 171 | [self setAlphaValue:alphaValue forWindow:w animated:YES]; 172 | 173 | L0Log(@"Script: Did set alpha value = %f", alphaValue); 174 | } 175 | 176 | @end 177 | -------------------------------------------------------------------------------- /Afloat_Prefix.pch: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Emanuele Vulcano 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #endif 16 | 17 | #ifdef __OBJC__ 18 | #ifdef DEBUG 19 | 20 | #define L0Log(x, args...) NSLog(@": " x, __func__, args) 21 | #define L0LogS(x) NSLog(@": " x, __func__) 22 | 23 | #else 24 | 25 | // this removes any "unused variables" warnings for variables 26 | // that are only used to log debug values. 27 | #define L0Log(x, args...) do { {args;} } while(0) 28 | #define L0LogS(x) do {} while(0) 29 | 30 | #endif // DEBUG 31 | #endif // __OBJC__ -------------------------------------------------------------------------------- /COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | Except for those files subject to other licenses (as noted in the file or in documentation accompanying the file), all files distributed along with this file are subject to the following license: 3 | 4 | - * - 5 | 6 | Copyright (c) 2008, Emanuele Vulcano 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | 11 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | 16 | - * - 17 | -------------------------------------------------------------------------------- /Donate for Afloat-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AfloatDonationsURL 6 | http://infinite-labs.net/afloat/donate/ 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | Afloat2 13 | CFBundleIdentifier 14 | net.infinite-labs.Afloat.Donations 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${VERSION} 23 | LSUIElement 24 | 25 | CFBundleShortVersionString 26 | ${USER_VISIBLE_VERSION} 27 | NSMainNibFile 28 | Donate 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Afloat2 11 | CFBundleIdentifier 12 | net.infinite-labs.Afloat 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${VERSION} 23 | CFBundleShortVersionString 24 | ${USER_VISIBLE_VERSION} 25 | NSPrincipalClass 26 | Afloat 27 | SIMBLTargetApplications 28 | 29 | 30 | BundleIdentifier 31 | * 32 | 33 | 34 | PlSUpdatesCheckURL 35 | http://infinite-labs.net/afloat/current/ 36 | 37 | 38 | -------------------------------------------------------------------------------- /JRSwizzle.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | JRSwizzle.h 3 | Copyright (c) 2007 Jonathan 'Wolf' Rentzsch: 4 | Some rights reserved: 5 | 6 | ***************************************************************************/ 7 | 8 | #import 9 | 10 | @interface NSObject (JRSwizzle) 11 | + (BOOL)jr_swizzleMethod:(SEL)origSel_ withMethod:(SEL)altSel_ error:(NSError**)error_; 12 | + (BOOL)jr_swizzleClassMethod:(SEL)origSel_ withClassMethod:(SEL)altSel_ error:(NSError**)error_; 13 | @end 14 | -------------------------------------------------------------------------------- /JRSwizzle.m: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | JRSwizzle.m 3 | Copyright (c) 2007 Jonathan 'Wolf' Rentzsch: 4 | Some rights reserved: 5 | 6 | ***************************************************************************/ 7 | 8 | #import "JRSwizzle.h" 9 | #import 10 | 11 | #define SetNSError(ERROR_VAR, FORMAT,...) \ 12 | if (ERROR_VAR) { \ 13 | NSString *errStr = [@"+[NSObject(JRSwizzle) jr_swizzleMethod:withMethod:error:]: " stringByAppendingFormat:FORMAT,##__VA_ARGS__]; \ 14 | *ERROR_VAR = [NSError errorWithDomain:@"NSCocoaErrorDomain" \ 15 | code:-1 \ 16 | userInfo:[NSDictionary dictionaryWithObject:errStr forKey:NSLocalizedDescriptionKey]]; \ 17 | } 18 | 19 | @implementation NSObject (JRSwizzle) 20 | 21 | + (BOOL)jr_swizzleMethod:(SEL)origSel_ withMethod:(SEL)altSel_ error:(NSError**)error_ { 22 | #if OBJC_API_VERSION >= 2 23 | Method origMethod = class_getInstanceMethod(self, origSel_); 24 | if (!origMethod) { 25 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]); 26 | return NO; 27 | } 28 | 29 | Method altMethod = class_getInstanceMethod(self, altSel_); 30 | if (!altMethod) { 31 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]); 32 | return NO; 33 | } 34 | 35 | class_addMethod(self, 36 | origSel_, 37 | class_getMethodImplementation(self, origSel_), 38 | method_getTypeEncoding(origMethod)); 39 | class_addMethod(self, 40 | altSel_, 41 | class_getMethodImplementation(self, altSel_), 42 | method_getTypeEncoding(altMethod)); 43 | 44 | method_exchangeImplementations(class_getInstanceMethod(self, origSel_), class_getInstanceMethod(self, altSel_)); 45 | return YES; 46 | #else 47 | // Scan for non-inherited methods. 48 | Method directOriginalMethod = NULL, directAlternateMethod = NULL; 49 | 50 | void *iterator = NULL; 51 | struct objc_method_list *mlist = class_nextMethodList(self, &iterator); 52 | while (mlist) { 53 | int method_index = 0; 54 | for (; method_index < mlist->method_count; method_index++) { 55 | if (mlist->method_list[method_index].method_name == origSel_) { 56 | assert(!directOriginalMethod); 57 | directOriginalMethod = &mlist->method_list[method_index]; 58 | } 59 | if (mlist->method_list[method_index].method_name == altSel_) { 60 | assert(!directAlternateMethod); 61 | directAlternateMethod = &mlist->method_list[method_index]; 62 | } 63 | } 64 | mlist = class_nextMethodList(self, &iterator); 65 | } 66 | 67 | // If either method is inherited, copy it up to the target class to make it non-inherited. 68 | if (!directOriginalMethod || !directAlternateMethod) { 69 | Method inheritedOriginalMethod = NULL, inheritedAlternateMethod = NULL; 70 | if (!directOriginalMethod) { 71 | inheritedOriginalMethod = class_getInstanceMethod(self, origSel_); 72 | if (!inheritedOriginalMethod) { 73 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]); 74 | return NO; 75 | } 76 | } 77 | if (!directAlternateMethod) { 78 | inheritedAlternateMethod = class_getInstanceMethod(self, altSel_); 79 | if (!inheritedAlternateMethod) { 80 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]); 81 | return NO; 82 | } 83 | } 84 | 85 | int hoisted_method_count = !directOriginalMethod && !directAlternateMethod ? 2 : 1; 86 | struct objc_method_list *hoisted_method_list = malloc(sizeof(struct objc_method_list) + (sizeof(struct objc_method)*(hoisted_method_count-1))); 87 | hoisted_method_list->method_count = hoisted_method_count; 88 | Method hoisted_method = hoisted_method_list->method_list; 89 | 90 | if (!directOriginalMethod) { 91 | bcopy(inheritedOriginalMethod, hoisted_method, sizeof(struct objc_method)); 92 | directOriginalMethod = hoisted_method++; 93 | } 94 | if (!directAlternateMethod) { 95 | bcopy(inheritedAlternateMethod, hoisted_method, sizeof(struct objc_method)); 96 | directAlternateMethod = hoisted_method; 97 | } 98 | class_addMethods(self, hoisted_method_list); 99 | } 100 | 101 | // Swizzle. 102 | IMP temp = directOriginalMethod->method_imp; 103 | directOriginalMethod->method_imp = directAlternateMethod->method_imp; 104 | directAlternateMethod->method_imp = temp; 105 | 106 | return YES; 107 | #endif 108 | } 109 | 110 | + (BOOL)jr_swizzleClassMethod:(SEL)origSel_ withClassMethod:(SEL)altSel_ error:(NSError**)error_ { 111 | assert(0); 112 | return NO; 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /Locales/it/Afloat.nib.alair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/Afloat.nib.alair -------------------------------------------------------------------------------- /Locales/it/Afloat.nib.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "NSMenuItem"; title = "Keep Afloat"; ObjectID = "2"; */ 3 | "2.title" = "Fluttuante"; 4 | 5 | /* Class = "NSMenuItem"; title = "Adjust Effects"; ObjectID = "4"; */ 6 | "4.title" = "Regola Effetti"; 7 | 8 | /* Class = "NSMenuItem"; title = "Transparency"; ObjectID = "5"; */ 9 | "5.title" = "Trasparenza"; 10 | 11 | /* Class = "NSMenu"; title = "Transparency"; ObjectID = "6"; */ 12 | "6.title" = "Trasparenza"; 13 | 14 | /* Class = "NSMenuItem"; title = "Translucent"; ObjectID = "7"; */ 15 | "7.title" = "Traslucido"; 16 | 17 | /* Class = "NSMenuItem"; title = "Opaque"; ObjectID = "9"; */ 18 | "9.title" = "Opaca"; 19 | 20 | /* Class = "NSMenuItem"; title = "Make More Transparent"; ObjectID = "10"; */ 21 | "10.title" = "Rendi più trasparente"; 22 | 23 | /* Class = "NSMenuItem"; title = "Make Less Transparent"; ObjectID = "11"; */ 24 | "11.title" = "Rendi meno trasparente"; 25 | 26 | /* Class = "NSMenuItem"; title = "Turn Overlays Back to Normal"; ObjectID = "19"; */ 27 | "19.title" = "Disattiva tutte le sovrimpressioni"; 28 | 29 | /* Class = "NSMenuItem"; title = "Show Window's File in Finder"; ObjectID = "22"; */ 30 | "22.title" = "Mostra il documento nel Finder"; 31 | -------------------------------------------------------------------------------- /Locales/it/AfloatBadge.nib.alair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/AfloatBadge.nib.alair -------------------------------------------------------------------------------- /Locales/it/AfloatBadge.nib.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/AfloatBadge.nib.strings -------------------------------------------------------------------------------- /Locales/it/AfloatDonateFirstAlert.alair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/AfloatDonateFirstAlert.alair -------------------------------------------------------------------------------- /Locales/it/AfloatDonateFirstAlert.strings: -------------------------------------------------------------------------------- 1 | "If you do, you can support Afloat's author with a small token of your gratitude." = "Se sì, puoi aiutare l'autore di Afloat con un piccolo segno della tua gratitudine."; 2 | "Donate\U2026" = "Dona\U2026"; 3 | "Maybe Later" = "Forse più tardi"; 4 | "Do you like keeping your windows afloat?" = "Ti piace mantenere le tue finestre sempre a galla?"; 5 | -------------------------------------------------------------------------------- /Locales/it/AfloatDonateLastAlert.alair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/AfloatDonateLastAlert.alair -------------------------------------------------------------------------------- /Locales/it/AfloatDonateLastAlert.strings: -------------------------------------------------------------------------------- 1 | "If you do, you can support Afloat's author with a small token of your gratitude." = "Se sì, puoi aiutare l'autore di Afloat con un piccolo segno della tua gratitudine."; 2 | "Donate\U2026" = "Dona\U2026"; 3 | "No, thanks" = "No, grazie"; 4 | "Do you like keeping your windows afloat?" = "Ti piace mantenere le tue finestre sempre a galla?"; 5 | -------------------------------------------------------------------------------- /Locales/it/AfloatPanel.nib.alair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/AfloatPanel.nib.alair -------------------------------------------------------------------------------- /Locales/it/AfloatPanel.nib.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "AfloatPanel"; title = "Afloat — Adjust Effects"; ObjectID = "1"; */ 3 | "1.title" = "Afloat — Regola Effetti"; 4 | 5 | /* Class = "NSTextFieldCell"; title = "Transparency:"; ObjectID = "21"; */ 6 | "21.title" = "Trasparenza:"; 7 | 8 | /* Class = "NSTextFieldCell"; title = "Overlay windows float on top of all others and clicks on them \"fall through\" to the windows below."; ObjectID = "27"; */ 9 | "27.title" = "Le sovrimpressioni rimangono sopra tutte le altre finestre. I clic su di esse sono \"passati\" alle finestre sottostanti."; 10 | 11 | /* Class = "NSTextFieldCell"; title = "Barely visible"; ObjectID = "37"; */ 12 | "37.title" = "Appena visibile"; 13 | 14 | /* Class = "NSTextFieldCell"; title = "Opaque"; ObjectID = "39"; */ 15 | "39.title" = "Opaca"; 16 | 17 | /* Class = "NSTextFieldCell"; title = "Keep this window:"; ObjectID = "65"; */ 18 | "65.title" = "Mantieni la finestra:"; 19 | 20 | /* Class = "NSMenu"; title = "OtherViews"; ObjectID = "75"; */ 21 | "75.title" = "OtherViews"; 22 | 23 | /* Class = "NSMenuItem"; title = "Regular"; ObjectID = "76"; */ 24 | "76.title" = "Normale"; 25 | 26 | /* Class = "NSMenuItem"; title = "Afloat"; ObjectID = "77"; */ 27 | "77.title" = "Fluttuante"; 28 | 29 | /* Class = "NSMenuItem"; title = "Pinned to the desktop"; ObjectID = "78"; */ 30 | "78.title" = "Incollata alla scrivania"; 31 | 32 | /* Class = "BGHUDButtonCell"; title = "Make this window an overlay"; ObjectID = "80"; */ 33 | "80.title" = "Mantieni in sovrimpressione"; 34 | 35 | /* Class = "BGHUDButtonCell"; title = "Keep this window on the screen on all Spaces"; ObjectID = "83"; */ 36 | "83.title" = "Mantieni questa finestra in tutti gli Spaces"; 37 | 38 | /* Class = "BGHUDButtonCell"; title = "Make it opaque while I'm working with it"; ObjectID = "89"; */ 39 | "89.title" = "Rendila opaca mentre la uso per lavorare"; 40 | 41 | /* Class = "BGHUDButtonCell"; title = "Done"; ObjectID = "94"; */ 42 | "94.title" = "Fine"; 43 | -------------------------------------------------------------------------------- /Locales/it/Corpus.corpus: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/Corpus.corpus -------------------------------------------------------------------------------- /Locales/it/Donate.alair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/Donate.alair -------------------------------------------------------------------------------- /Locales/it/Donate.nib.alair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/Donate.nib.alair -------------------------------------------------------------------------------- /Locales/it/Donate.nib.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "5"; */ 3 | "5.title" = "Bring All to Front"; 4 | 5 | /* Class = "NSMenuItem"; title = "Window"; ObjectID = "19"; */ 6 | "19.title" = "Window"; 7 | 8 | /* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "23"; */ 9 | "23.title" = "Minimize"; 10 | 11 | /* Class = "NSMenu"; title = "Window"; ObjectID = "24"; */ 12 | "24.title" = "Window"; 13 | 14 | /* Class = "NSMenu"; title = "AMainMenu"; ObjectID = "29"; */ 15 | "29.title" = "AMainMenu"; 16 | 17 | /* Class = "NSMenuItem"; title = "Donate for Afloat"; ObjectID = "56"; */ 18 | "56.title" = "Dona per Afloat"; 19 | 20 | /* Class = "NSMenu"; title = "Donate for Afloat"; ObjectID = "57"; */ 21 | "57.title" = "Dona per Afloat"; 22 | 23 | /* Class = "NSMenuItem"; title = "About Donate for Afloat"; ObjectID = "58"; */ 24 | "58.title" = "Informazioni su Dona per Afloat"; 25 | 26 | /* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */ 27 | "130.title" = "Services"; 28 | 29 | /* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */ 30 | "131.title" = "Services"; 31 | 32 | /* Class = "NSMenuItem"; title = "Hide Donate for Afloat"; ObjectID = "134"; */ 33 | "134.title" = "Nascondi Dona per Afloat"; 34 | 35 | /* Class = "NSMenuItem"; title = "Quit Donate for Afloat"; ObjectID = "136"; */ 36 | "136.title" = "Esci da Dona per Afloat"; 37 | 38 | /* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */ 39 | "145.title" = "Hide Others"; 40 | 41 | /* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */ 42 | "150.title" = "Show All"; 43 | 44 | /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "197"; */ 45 | "197.title" = "Copy"; 46 | 47 | /* Class = "NSMenuItem"; title = "Select All"; ObjectID = "198"; */ 48 | "198.title" = "Select All"; 49 | 50 | /* Class = "NSMenuItem"; title = "Cut"; ObjectID = "199"; */ 51 | "199.title" = "Cut"; 52 | 53 | /* Class = "NSMenuItem"; title = "Delete"; ObjectID = "202"; */ 54 | "202.title" = "Delete"; 55 | 56 | /* Class = "NSMenuItem"; title = "Paste"; ObjectID = "203"; */ 57 | "203.title" = "Paste"; 58 | 59 | /* Class = "NSMenu"; title = "Edit"; ObjectID = "205"; */ 60 | "205.title" = "Edit"; 61 | 62 | /* Class = "NSMenuItem"; title = "Undo"; ObjectID = "207"; */ 63 | "207.title" = "Undo"; 64 | 65 | /* Class = "NSMenuItem"; title = "Redo"; ObjectID = "215"; */ 66 | "215.title" = "Redo"; 67 | 68 | /* Class = "NSMenuItem"; title = "Edit"; ObjectID = "217"; */ 69 | "217.title" = "Edit"; 70 | 71 | /* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "239"; */ 72 | "239.title" = "Zoom"; 73 | -------------------------------------------------------------------------------- /Locales/it/Donate.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "5"; */ 3 | "5.title" = "Porta tutto in primo piano"; 4 | 5 | /* Class = "NSMenuItem"; title = "Window"; ObjectID = "19"; */ 6 | "19.title" = "Finestra"; 7 | 8 | /* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "23"; */ 9 | "23.title" = "Contrai"; 10 | 11 | /* Class = "NSMenu"; title = "Window"; ObjectID = "24"; */ 12 | "24.title" = "Finestra"; 13 | 14 | /* Class = "NSMenu"; title = "AMainMenu"; ObjectID = "29"; */ 15 | "29.title" = "AMainMenu"; 16 | 17 | /* Class = "NSMenuItem"; title = "Donate for Afloat"; ObjectID = "56"; */ 18 | "56.title" = "Dona per Afloat"; 19 | 20 | /* Class = "NSMenu"; title = "Donate for Afloat"; ObjectID = "57"; */ 21 | "57.title" = "Dona per Afloat"; 22 | 23 | /* Class = "NSMenuItem"; title = "About Donate for Afloat"; ObjectID = "58"; */ 24 | "58.title" = "Informazioni su Dona per Afloat"; 25 | 26 | /* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */ 27 | "130.title" = "Servizi"; 28 | 29 | /* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */ 30 | "131.title" = "Servizi"; 31 | 32 | /* Class = "NSMenuItem"; title = "Hide Donate for Afloat"; ObjectID = "134"; */ 33 | "134.title" = "Nascondi Dona per Afloat"; 34 | 35 | /* Class = "NSMenuItem"; title = "Quit Donate for Afloat"; ObjectID = "136"; */ 36 | "136.title" = "Esci da Dona per Afloat"; 37 | 38 | /* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */ 39 | "145.title" = "Nascondi altre"; 40 | 41 | /* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */ 42 | "150.title" = "Mostra tutte"; 43 | 44 | /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "197"; */ 45 | "197.title" = "Copia"; 46 | 47 | /* Class = "NSMenuItem"; title = "Select All"; ObjectID = "198"; */ 48 | "198.title" = "Seleziona tutto"; 49 | 50 | /* Class = "NSMenuItem"; title = "Cut"; ObjectID = "199"; */ 51 | "199.title" = "Taglia"; 52 | 53 | /* Class = "NSMenuItem"; title = "Delete"; ObjectID = "202"; */ 54 | "202.title" = "Elimina"; 55 | 56 | /* Class = "NSMenuItem"; title = "Paste"; ObjectID = "203"; */ 57 | "203.title" = "Incolla"; 58 | 59 | /* Class = "NSMenu"; title = "Edit"; ObjectID = "205"; */ 60 | "205.title" = "Composizione"; 61 | 62 | /* Class = "NSMenuItem"; title = "Undo"; ObjectID = "207"; */ 63 | "207.title" = "Annulla"; 64 | 65 | /* Class = "NSMenuItem"; title = "Redo"; ObjectID = "215"; */ 66 | "215.title" = "Ripristina originale"; 67 | 68 | /* Class = "NSMenuItem"; title = "Edit"; ObjectID = "217"; */ 69 | "217.title" = "Composizione"; 70 | 71 | /* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "239"; */ 72 | "239.title" = "Ridimensiona"; 73 | -------------------------------------------------------------------------------- /Locales/it/InfoPlist.alair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/InfoPlist.alair -------------------------------------------------------------------------------- /Locales/it/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | NSHumanReadableCopyright = "© Emanuele Vulcano (infinite-labs.net), 2008"; 4 | -------------------------------------------------------------------------------- /Locales/it/Project.project: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Locales/it/Project.project -------------------------------------------------------------------------------- /Nag.pch: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #ifdef __OBJC__ 4 | #import 5 | #endif -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | BGHUDAppKitPlugin 9 | CFBundleIdentifier 10 | com.binarymethod.BGHUDAppKitPlugin 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | BGHUDAppKitPlugin 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | NSPrincipalClass 24 | BGHUDAppKitPlugin 25 | 26 | 27 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/MacOS/BGHUDAppKitPlugin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/MacOS/BGHUDAppKitPlugin -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDAppKitInspector.nib/designable.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1050 5 | 9C7010 6 | 629 7 | 949.26 8 | 352.00 9 | 10 | YES 11 | 12 | 13 | 14 | YES 15 | com.apple.InterfaceBuilderKit 16 | com.apple.InterfaceBuilder.CocoaPlugin 17 | 18 | 19 | YES 20 | 21 | IBInspector 22 | 23 | 24 | FirstResponder 25 | 26 | 27 | NSApplication 28 | 29 | 30 | 31 | 256 32 | 33 | YES 34 | 35 | 36 | 268 37 | {{84, 6}, {180, 19}} 38 | 39 | 40 | YES 41 | 42 | -1804468671 43 | -1874721792 44 | 45 | 46 | LucidaGrande 47 | 1.100000e+01 48 | 3100 49 | 50 | 51 | YES 52 | 53 | 6 54 | System 55 | textBackgroundColor 56 | 57 | 3 58 | MQA 59 | 60 | 61 | 62 | 6 63 | 64 | textColor 65 | 66 | 3 67 | MAA 68 | 69 | 70 | 71 | 72 | 73 | 74 | 268 75 | {{8, 8}, {70, 14}} 76 | 77 | 78 | YES 79 | 80 | 67239488 81 | 4326400 82 | Theme Key 83 | 84 | LucidaGrande-Bold 85 | 1.100000e+01 86 | 16 87 | 88 | 89 | 90 | 6 91 | 92 | controlColor 93 | 94 | 3 95 | MC42NjY2NjY2OQA 96 | 97 | 98 | 99 | 6 100 | 101 | controlTextColor 102 | 103 | 104 | 105 | 106 | 107 | {275, 29} 108 | 109 | 110 | NSView 111 | NSResponder 112 | 113 | 114 | 115 | 116 | YES 117 | 118 | 119 | inspectorView 120 | 121 | 122 | 123 | 36 124 | 125 | 126 | 127 | value: inspectedObjectsController.selection.themeKey 128 | 129 | 130 | 131 | 132 | 133 | 134 | value 135 | inspectedObjectsController.selection.themeKey 136 | 2 137 | 138 | 139 | 85 140 | 141 | 142 | 143 | 144 | YES 145 | 146 | 0 147 | 148 | YES 149 | 150 | 151 | 152 | 153 | 154 | -2 155 | 156 | 157 | RmlsZSdzIE93bmVyA 158 | 159 | 160 | -1 161 | 162 | 163 | First Responder 164 | 165 | 166 | -3 167 | 168 | 169 | Application 170 | 171 | 172 | 21 173 | 174 | 175 | YES 176 | 177 | 178 | 179 | 180 | Inspector View 181 | 182 | 183 | 52 184 | 185 | 186 | YES 187 | 188 | 189 | 190 | 191 | 192 | 62 193 | 194 | 195 | YES 196 | 197 | 198 | 199 | 200 | 201 | 66 202 | 203 | 204 | 205 | 206 | 82 207 | 208 | 209 | 210 | 211 | 212 | 213 | YES 214 | 215 | YES 216 | -1.IBPluginDependency 217 | -2.IBPluginDependency 218 | -3.IBPluginDependency 219 | -3.ImportedFromIB2 220 | 21.GUserGuides 221 | 21.IBPluginDependency 222 | 21.IBUserGuides 223 | 21.ImportedFromIB2 224 | 21.WindowOrigin 225 | 21.editorWindowContentRectSynchronizationRect 226 | 52.IBPluginDependency 227 | 62.IBPluginDependency 228 | 66.IBPluginDependency 229 | 82.IBPluginDependency 230 | 231 | 232 | YES 233 | 234 | 235 | 236 | 237 | 238 | YES 239 | 240 | 241 | 9.000000e+01 242 | 0 243 | 244 | 245 | 246 | 2.270000e+02 247 | 0 248 | 249 | 250 | 251 | 252 | YES 253 | 254 | 255 | {155, 478} 256 | {{535, 792}, {275, 29}} 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | YES 265 | 266 | YES 267 | 268 | 269 | YES 270 | 271 | 272 | 273 | 274 | YES 275 | 276 | YES 277 | 278 | 279 | YES 280 | 281 | 282 | 283 | 85 284 | 285 | 286 | 287 | YES 288 | 289 | 290 | 0 291 | 292 | 3 293 | 294 | YnBsaXN0MDDUAAEAAgADAAQABQAGAAkAClgkdmVyc2lvblQkdG9wWSRhcmNoaXZlclgkb2JqZWN0cxIA 295 | AYag0QAHAAhdSUIub2JqZWN0ZGF0YYABXxAPTlNLZXllZEFyY2hpdmVyrxBVAAsADAAxADUANgA8AD0A 296 | QQBFAEoAUgALAGMAaAB0AHUAhwCIAJAAkQCUAJ4AnwCgAKUApwCsAK0AsAC0ALoAwgDDAMwAzQDRANIA 297 | 1wDYANsA4ADhAOUACwC4ALkA5gDpAOoA7gD5APoA+wD8AP8BCAELAQwBDgEXASEBKwEsAS0BLgEvATAB 298 | MQEyATUBOAFEAVABUQFSAVMBVAFVAVYBVwFYAVkBXAFfAWJVJG51bGzfEBIADQAOAA8AEAARABIAEwAU 299 | ABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADBWTlNS 300 | b290ViRjbGFzc11OU09iamVjdHNLZXlzXxAPTlNDbGFzc2VzVmFsdWVzXxAZTlNBY2Nlc3NpYmlsaXR5 301 | T2lkc1ZhbHVlc11OU0Nvbm5lY3Rpb25zW05TTmFtZXNLZXlzW05TRnJhbWV3b3JrXU5TQ2xhc3Nlc0tl 302 | eXNaTlNPaWRzS2V5c11OU05hbWVzVmFsdWVzXxAZTlNBY2Nlc3NpYmlsaXR5Q29ubmVjdG9yc11OU0Zv 303 | bnRNYW5hZ2VyXxAQTlNWaXNpYmxlV2luZG93c18QD05TT2JqZWN0c1ZhbHVlc18QF05TQWNjZXNzaWJp 304 | bGl0eU9pZHNLZXlzWU5TTmV4dE9pZFxOU09pZHNWYWx1ZXOAAoBUgDaARYBTgAiAO4AFgESARoA8gFGA 305 | AIAGgDqAUhBXgEfSAA4AMgAzADRbTlNDbGFzc05hbWWABIADW0lCSW5zcGVjdG9y0gA3ADgAOQA6WCRj 306 | bGFzc2VzWiRjbGFzc25hbWWiADoAO15OU0N1c3RvbU9iamVjdFhOU09iamVjdF8QEElCQ29jb2FGcmFt 307 | ZXdvcmvSAA4APgA/AEBaTlMub2JqZWN0c4AHoNIANwA4AEIAQ6MAQwBEADtcTlNNdXRhYmxlU2V0VU5T 308 | U2V00gAOAD4ARgBHgCmiAEgASYAJgDHUAA4ASwBMAE0ATgBPAB8AUV1OU0Rlc3RpbmF0aW9uWE5TU291 309 | cmNlV05TTGFiZWyAMIAKgAKAL9kAUwAOAFQAVQBWAFcAMgBYAFkAWgBbAFwAXQBeAFoAYABhAGJfEA9O 310 | U05leHRSZXNwb25kZXJaTlNTdWJ2aWV3c1hOU3ZGbGFnc1tOU0ZyYW1lU2l6ZVhOU1dpbmRvd1tOU0V4 311 | dGVuc2lvbltOU1N1cGVydmlld4ALgC6ADBEBAIAqgAuALIAtgCvSAA4APgBGAGWAKaIAZgBngA2AHtgA 312 | UwAOAGkAagBVAGsAVwBZAE8AbQBuAG8AcABxAFoAT1dOU0ZyYW1lVk5TQ2VsbFlOU0VuYWJsZWSACoAd 313 | gA6ADxEBDAmAC4AKXxAUe3s4NCwgNn0sIHsxODAsIDE5fX3ZAHYADgB3AHgAeQB6AHsAfAB9AH4AfwCA 314 | AIEAggBmAIQAcQCGW05TQ2VsbEZsYWdzXxARTlNCYWNrZ3JvdW5kQ29sb3JaTlNDb250ZW50c1lOU1N1 315 | cHBvcnRdTlNDb250cm9sVmlld1xOU0NlbGxGbGFnczJfEBFOU0RyYXdzQmFja2dyb3VuZFtOU1RleHRD 316 | b2xvchP/////lHH+QYAcgBSAEIARgA0T/////5BCBAAJgBlQ1AAOAIkAigCLAIwAjQCOAI9WTlNTaXpl 317 | Vk5TTmFtZVhOU2ZGbGFnc4ATI0AmAAAAAAAAgBIRDBxcTHVjaWRhR3JhbmRl0gA3ADgAkgCTogCTADtW 318 | TlNGb2501QAOAJUAlgCXAJgAmQCaAJsAnACdV05TQ29sb3JcTlNDb2xvclNwYWNlW05TQ29sb3JOYW1l 319 | XU5TQ2F0YWxvZ05hbWWAGIAXEAaAFoAVVlN5c3RlbV8QE3RleHRCYWNrZ3JvdW5kQ29sb3LTAA4AlgCh 320 | AJkAowCkV05TV2hpdGWAGBADQjEA0gA3ADgApgCVogCVADvVAA4AlQCWAJcAmACZAKkAmwCqAJ2AGIAb 321 | gBqAFVl0ZXh0Q29sb3LTAA4AlgChAJkAowCvgBhCMADSADcAOACxALKkALIAswBqADtfEA9OU1RleHRG 322 | aWVsZENlbGxcTlNBY3Rpb25DZWxs0gA3ADgAtQC2pQC2ALcAuAC5ADtbTlNUZXh0RmllbGRZTlNDb250 323 | cm9sVk5TVmlld1tOU1Jlc3BvbmRlctgAUwAOAGkAagBVAGsAVwBZAE8AbQC9AL4AcABxAFoAT4AKgB2A 324 | H4AgCYALgApfEBJ7ezgsIDh9LCB7NzAsIDE0fX3YAHYADgB3AHgAeQB6AHsAfQDEAH8AxgDHAMgAZwDK 325 | AMsSBAH+QIAcgCSAIYAigB4SAEIEAIAnWVRoZW1lIEtledQADgCJAIoAiwCMAI0AzwDQgBOAIxAQXxAR 326 | THVjaWRhR3JhbmRlLUJvbGTVAA4AlQCWAJcAmACZANQAmwDVAJ2AGIAmgCWAFVxjb250cm9sQ29sb3LT 327 | AA4AlgChAJkAowDagBhLMC42NjY2NjY2OQDVAA4AlQCWAJcAmACZAKkAmwDeAJ2AGIAbgCiAFV8QEGNv 328 | bnRyb2xUZXh0Q29sb3LSADcAOADiAOOjAOMA5AA7Xk5TTXV0YWJsZUFycmF5V05TQXJyYXlZezI3NSwg 329 | Mjl90gA3ADgA5wDopADoALgAuQA7XE5TQ3VzdG9tVmlld11pbnNwZWN0b3JWaWV30gA3ADgA6wDsowDs 330 | AO0AO18QFE5TTmliT3V0bGV0Q29ubmVjdG9yXk5TTmliQ29ubmVjdG9y1wAOAEsA7wDwAEwATQDxAPIA 331 | HwD0APUAZgD3APhZTlNLZXlQYXRoWU5TQmluZGluZ18QHE5TTmliQmluZGluZ0Nvbm5lY3RvclZlcnNp 332 | b26ANYACgDSAM4ANgDIQAl8QNHZhbHVlOiBpbnNwZWN0ZWRPYmplY3RzQ29udHJvbGxlci5zZWxlY3Rp 333 | b24udGhlbWVLZXlVdmFsdWVfEC1pbnNwZWN0ZWRPYmplY3RzQ29udHJvbGxlci5zZWxlY3Rpb24udGhl 334 | bWVLZXnSADcAOAD9AP6jAP4A7QA7XxAVTlNOaWJCaW5kaW5nQ29ubmVjdG9y0gAOAD4BAAEBgDmmAGYB 335 | AwBvAGcAvgBPgA2AN4APgB6AIIAK0gAOADIAMwEKgASAOF1OU0FwcGxpY2F0aW9u0gA3ADgBDQDkogDk 336 | ADvSAA4APgEAARCAOaYATwAfAGYATwBnAB+ACoACgA2ACoAegALSAA4APgEAARmAOacAvgBvAGcBAwBm 337 | AE8AH4AggA+AHoA3gA2ACoAC0gAOAD4BAAEjgDmnASQBJQEmAScBKAEpASqAPYA+gD+AQIBBgEKAQ18Q 338 | G1RleHQgRmllbGQgQ2VsbCAoVGhlbWUgS2V5KV8QD1RleHQgRmllbGQgQ2VsbF8QF1N0YXRpYyBUZXh0 339 | IChUaGVtZSBLZXkpW0FwcGxpY2F0aW9uWlRleHQgRmllbGReSW5zcGVjdG9yIFZpZXdcRmlsZSdzIE93 340 | bmVy0gAOAD4BAAE0gDmg0gAOAD4BAAE3gDmg0gAOAD4BAAE6gDmpAL4AbwBnAEkBAwBmAE8AHwBIgCCA 341 | D4AegDGAN4ANgAqAAoAJ0gAOAD4BAAFGgDmpAUcBSAFJAUoBSwFMAU0BTgFPgEiASYBKgEuATIBNgE6A 342 | T4BQEEIQUhA+EFUT//////////0QNBAVEFYQJNIADgA+AEYBW4ApoNIADgA+AQABXoA5oNIADgA+AQAB 343 | YYA5oNIANwA4AWMBZKIBZAA7Xk5TSUJPYmplY3REYXRhAAgAGQAiACcAMQA6AD8ARABSAFQAZgETARkB 344 | ZAFrAXIBgAGSAa4BvAHIAdQB4gHtAfsCFwIlAjgCSgJkAm4CewJ9An8CgQKDAoUChwKJAosCjQKPApEC 345 | kwKVApcCmQKbAp0CnwKoArQCtgK4AsQCzQLWAuEC5gL1Av4DEQMaAyUDJwMoAzEDOANFA0sDVANWA1sD 346 | XQNfA3ADfgOHA48DkQOTA5UDlwO8A84D2QPiA+4D9wQDBA8EEQQTBBUEGAQaBBwEHgQgBCIEKwQtBDIE 347 | NAQ2BFcEXwRmBHAEcgR0BHYEeAR7BHwEfgSABJcEvATIBNwE5wTxBP8FDAUgBSwFNQU3BTkFOwU9BT8F 348 | SAVJBUsFTAVdBWQFawV0BXYFfwWBBYQFkQWaBZ8FpgW7BcMF0AXcBeoF7AXuBfAF8gX0BfsGEQYeBiYG 349 | KAYqBi0GNgY7BlAGUgZUBlYGWAZiBm8GcQZ0Bn0GhgaYBqUGrga5BsUGzwbWBuIHAwcFBwcHCQcLBwwH 350 | DgcQByUHRgdLB00HTwdRB1MHVQdaB1wHZgd3B3kHewd9B5EHpgeoB6oHrAeuB7sHyAfKB9YH6wftB+8H 351 | 8QfzCAYIDwgWCCUILQg3CEAISQhWCGQIbQh0CIsImgi3CMEIywjqCOwI7gjwCPII9Aj2CPgJLwk1CWUJ 352 | bgl1CY0JlgmYCaUJpwmpCasJrQmvCbEJugm8Cb4JzAnVCdoJ4wnlCfIJ9An2CfgJ+gn8Cf4KBwoJChgK 353 | GgocCh4KIAoiCiQKJgovCjEKQApCCkQKRgpICkoKTApOCmwKfgqYCqQKrwq+CssK1ArWCtcK4AriCuMK 354 | 7AruCwELAwsFCwcLCQsLCw0LDwsRCxMLHAseCzELMws1CzcLOQs7Cz0LPwtBC0MLRQtHC0kLSwtUC1YL 355 | WAtaC1wLZQtnC2gLcQtzC3QLfQt/C4ALiQuOAAAAAAAAAgIAAAAAAAABZQAAAAAAAAAAAAAAAAAAC50 356 | 357 | 358 | 359 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDAppKitInspector.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDAppKitInspector.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDAppKitLibrary.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDAppKitLibrary.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDButtonCell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDButtonCell; 11 | SuperClass = NSButtonCell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDColorWell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDColorWell; 11 | SuperClass = NSColorWell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDColorWellInspector.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDColorWellInspector.nib -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDLabel.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDLabel; 11 | SuperClass = NSTextField; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDOutlineView.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDOutlineView; 11 | SuperClass = NSOutlineView; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDPopUpButtonCell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDPopUpButtonCell; 11 | SuperClass = NSPopUpButtonCell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDProgressIndicator.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDProgressIndicator; 11 | SuperClass = NSProgressIndicator; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDScrollView.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDScrollView; 11 | SuperClass = NSScrollView; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDScroller.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDScroller; 11 | SuperClass = NSScroller; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDSearchFieldCell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDSearchFieldCell; 11 | SuperClass = NSSearchFieldCell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDSecureTextFieldCell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDSecureTextFieldCell; 11 | SuperClass = NSSecureTextFieldCell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDSegmentedCell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDSegmentedCell; 11 | SuperClass = NSSegmentedCell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDSliderCell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDSliderCell; 11 | SuperClass = NSSliderCell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDTableView.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDTableView; 11 | SuperClass = NSTableView; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDTextFieldCell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDTextFieldCell; 11 | SuperClass = NSTextFieldCell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/BGHUDTokenFieldCell.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | Actions = { 3 | // Define action descriptions here, for example 4 | // "myAction:" = id; 5 | }; 6 | Outlets = { 7 | // Define outlet descriptions here, for example 8 | // myOutlet = NSView; 9 | }; 10 | ClassName = BGHUDTokenFieldCell; 11 | SuperClass = NSTokenFieldCell; 12 | } 13 | -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/outlineview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/outlineview.png -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/scrollview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/scrollview.png -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/tableview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/tableview.png -------------------------------------------------------------------------------- /Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/textview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/Support/BGHUDAppKitPlugin.ibplugin/Contents/Resources/textview.png -------------------------------------------------------------------------------- /en.lproj/Afloat.nib/designable.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1050 5 | 9C31 6 | 644 7 | 949.26 8 | 352.00 9 | 10 | YES 11 | 12 | 13 | 14 | YES 15 | com.apple.InterfaceBuilder.CocoaPlugin 16 | 17 | 18 | YES 19 | 20 | Afloat 21 | 22 | 23 | FirstResponder 24 | 25 | 26 | NSApplication 27 | 28 | 29 | 30 | 31 | YES 32 | 33 | 34 | Keep Afloat 35 | a 36 | 1310985 37 | 2147483647 38 | 39 | NSImage 40 | NSMenuCheckmark 41 | 42 | 43 | NSImage 44 | NSMenuMixedState 45 | 46 | 47 | 48 | 49 | Transparency 50 | 51 | 1048576 52 | 2147483647 53 | 54 | 55 | submenuAction: 56 | 57 | Transparency 58 | 59 | YES 60 | 61 | 62 | Translucent 63 | 1 64 | 1310985 65 | 2147483647 66 | 67 | 68 | 69 | 70 | 71 | Opaque 72 | 0 73 | 1310985 74 | 2147483647 75 | 76 | 77 | 78 | 79 | 80 | Make Less Transparent 81 | 75ysA 82 | 1310720 83 | 2147483647 84 | 85 | 86 | 87 | 88 | 89 | Make More Transparent 90 | 75ytA 91 | 1310720 92 | 2147483647 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | Turn Overlays Back to Normal 102 | 103 | 2147483647 104 | 105 | 106 | 107 | 108 | 109 | YES 110 | YES 111 | 112 | 113 | 1048576 114 | 2147483647 115 | 116 | 117 | 118 | 119 | 120 | Adjust Effects 121 | f 122 | 1310985 123 | 2147483647 124 | 125 | 126 | 127 | 128 | 129 | YES 130 | YES 131 | 132 | 133 | 2147483647 134 | 135 | 136 | 137 | 138 | 139 | U2hvdyBXaW5kb3cncyBGaWxlIGluIEZpbmRlcg 140 | 75yAA 141 | 1310720 142 | 2147483647 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | YES 152 | 153 | 154 | _menuWithItems 155 | 156 | 157 | 158 | 12 159 | 160 | 161 | 162 | toggleAlwaysOnTop: 163 | 164 | 165 | 166 | 13 167 | 168 | 169 | 170 | makeTranslucent: 171 | 172 | 173 | 174 | 14 175 | 176 | 177 | 178 | makeOpaque: 179 | 180 | 181 | 182 | 15 183 | 184 | 185 | 186 | makeLessTransparent: 187 | 188 | 189 | 190 | 16 191 | 192 | 193 | 194 | makeMoreTransparent: 195 | 196 | 197 | 198 | 17 199 | 200 | 201 | 202 | showAdjustEffectsPanel: 203 | 204 | 205 | 206 | 18 207 | 208 | 209 | 210 | disableAllOverlays: 211 | 212 | 213 | 214 | 20 215 | 216 | 217 | 218 | showWindowFileInFinder: 219 | 220 | 221 | 222 | 23 223 | 224 | 225 | 226 | 227 | YES 228 | 229 | 0 230 | 231 | YES 232 | 233 | 234 | 235 | 236 | 237 | -2 238 | 239 | 240 | RmlsZSdzIE93bmVyA 241 | 242 | 243 | -1 244 | 245 | 246 | First Responder 247 | 248 | 249 | -3 250 | 251 | 252 | Application 253 | 254 | 255 | 1 256 | 257 | 258 | YES 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 2 271 | 272 | 273 | 274 | 275 | 4 276 | 277 | 278 | 279 | 280 | 5 281 | 282 | 283 | YES 284 | 285 | 286 | 287 | 288 | 289 | 6 290 | 291 | 292 | YES 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 7 302 | 303 | 304 | 305 | 306 | 8 307 | 308 | 309 | 310 | 311 | 9 312 | 313 | 314 | 315 | 316 | 10 317 | 318 | 319 | 320 | 321 | 11 322 | 323 | 324 | 325 | 326 | 19 327 | 328 | 329 | 330 | 331 | 21 332 | 333 | 334 | 335 | 336 | 22 337 | 338 | 339 | 340 | 341 | 342 | 343 | YES 344 | 345 | YES 346 | -1.IBPluginDependency 347 | -2.IBPluginDependency 348 | -3.IBPluginDependency 349 | 1.IBEditorWindowLastContentRect 350 | 1.IBPluginDependency 351 | 1.editorWindowContentRectSynchronizationRect 352 | 10.IBPluginDependency 353 | 11.IBPluginDependency 354 | 19.IBPluginDependency 355 | 2.IBPluginDependency 356 | 21.IBPluginDependency 357 | 22.IBPluginDependency 358 | 4.IBPluginDependency 359 | 5.IBPluginDependency 360 | 6.IBEditorWindowLastContentRect 361 | 6.IBPluginDependency 362 | 6.editorWindowContentRectSynchronizationRect 363 | 7.IBPluginDependency 364 | 8.IBPluginDependency 365 | 9.IBPluginDependency 366 | 367 | 368 | YES 369 | com.apple.InterfaceBuilder.CocoaPlugin 370 | com.apple.InterfaceBuilder.CocoaPlugin 371 | com.apple.InterfaceBuilder.CocoaPlugin 372 | {{338, 394}, {294, 123}} 373 | com.apple.InterfaceBuilder.CocoaPlugin 374 | {{170, 454}, {185, 73}} 375 | com.apple.InterfaceBuilder.CocoaPlugin 376 | com.apple.InterfaceBuilder.CocoaPlugin 377 | com.apple.InterfaceBuilder.CocoaPlugin 378 | com.apple.InterfaceBuilder.CocoaPlugin 379 | com.apple.InterfaceBuilder.CocoaPlugin 380 | com.apple.InterfaceBuilder.CocoaPlugin 381 | com.apple.InterfaceBuilder.CocoaPlugin 382 | com.apple.InterfaceBuilder.CocoaPlugin 383 | {{632, 414}, {253, 83}} 384 | com.apple.InterfaceBuilder.CocoaPlugin 385 | {{355, 424}, {253, 83}} 386 | com.apple.InterfaceBuilder.CocoaPlugin 387 | com.apple.InterfaceBuilder.CocoaPlugin 388 | com.apple.InterfaceBuilder.CocoaPlugin 389 | 390 | 391 | 392 | YES 393 | 394 | YES 395 | 396 | 397 | YES 398 | 399 | 400 | 401 | 402 | YES 403 | 404 | YES 405 | 406 | 407 | YES 408 | 409 | 410 | 411 | 23 412 | 413 | 414 | 415 | YES 416 | 417 | Afloat 418 | NSObject 419 | 420 | YES 421 | 422 | YES 423 | disableAllOverlays: 424 | makeLessTransparent: 425 | makeMoreTransparent: 426 | makeOpaque: 427 | makeTranslucent: 428 | showAdjustEffectsPanel: 429 | showWindowFileInFinder: 430 | toggleAlwaysOnTop: 431 | 432 | 433 | YES 434 | id 435 | id 436 | id 437 | id 438 | id 439 | id 440 | id 441 | id 442 | 443 | 444 | 445 | _menuWithItems 446 | NSMenu 447 | 448 | 449 | IBProjectSource 450 | Afloat.h 451 | 452 | 453 | 454 | NSObject 455 | 456 | IBProjectSource 457 | AfloatStorage.h 458 | 459 | 460 | 461 | NSObject 462 | 463 | IBProjectSource 464 | JRSwizzle.h 465 | 466 | 467 | 468 | 469 | 0 470 | ../Afloat.xcodeproj 471 | 3 472 | 473 | 474 | -------------------------------------------------------------------------------- /en.lproj/Afloat.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/en.lproj/Afloat.nib/keyedobjects.nib -------------------------------------------------------------------------------- /en.lproj/AfloatBadge.nib/designable.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1050 5 | 9C31 6 | 644 7 | 949.26 8 | 352.00 9 | 10 | YES 11 | 12 | 13 | 14 | YES 15 | com.apple.InterfaceBuilder.CocoaPlugin 16 | 17 | 18 | YES 19 | 20 | AfloatBadgeController 21 | 22 | 23 | FirstResponder 24 | 25 | 26 | NSApplication 27 | 28 | 29 | 17 30 | 2 31 | {{196, 363}, {146, 147}} 32 | 1610612736 33 | 34 | AfloatPanel 35 | 36 | 37 | 38 | 256 39 | 40 | YES 41 | 42 | 43 | 256 44 | 45 | YES 46 | 47 | YES 48 | Apple PDF pasteboard type 49 | Apple PICT pasteboard type 50 | Apple PNG pasteboard type 51 | NSFilenamesPboardType 52 | NeXT Encapsulated PostScript v1.2 pasteboard type 53 | NeXT TIFF v4.0 pasteboard type 54 | 55 | 56 | {146, 147} 57 | 58 | YES 59 | 60 | 130560 61 | 33554432 62 | 63 | NSImage 64 | AfloatSinkingBadge 65 | 66 | 0 67 | 1 68 | 0 69 | YES 70 | 71 | YES 72 | 73 | 74 | {146, 147} 75 | 76 | 77 | {{0, 0}, {1280, 778}} 78 | 79 | 80 | 81 | 82 | YES 83 | 84 | 85 | window 86 | 87 | 88 | 89 | 6 90 | 91 | 92 | 93 | badgeView 94 | 95 | 96 | 97 | 7 98 | 99 | 100 | 101 | 102 | YES 103 | 104 | 0 105 | 106 | YES 107 | 108 | 109 | 110 | 111 | 112 | -2 113 | 114 | 115 | RmlsZSdzIE93bmVyA 116 | 117 | 118 | -1 119 | 120 | 121 | First Responder 122 | 123 | 124 | -3 125 | 126 | 127 | Application 128 | 129 | 130 | 1 131 | 132 | 133 | YES 134 | 135 | 136 | 137 | 138 | 139 | 2 140 | 141 | 142 | YES 143 | 144 | 145 | 146 | 147 | 148 | 3 149 | 150 | 151 | YES 152 | 153 | 154 | 155 | 156 | 157 | 4 158 | 159 | 160 | 161 | 162 | 163 | 164 | YES 165 | 166 | YES 167 | -1.IBPluginDependency 168 | -2.IBPluginDependency 169 | -3.IBPluginDependency 170 | 1.IBEditorWindowLastContentRect 171 | 1.IBPluginDependency 172 | 1.IBWindowTemplateEditedContentRect 173 | 1.NSWindowTemplate.visibleAtLaunch 174 | 1.WindowOrigin 175 | 1.editorWindowContentRectSynchronizationRect 176 | 1.lastResizeAction 177 | 2.IBPluginDependency 178 | 179 | 180 | YES 181 | com.apple.InterfaceBuilder.CocoaPlugin 182 | com.apple.InterfaceBuilder.CocoaPlugin 183 | com.apple.InterfaceBuilder.CocoaPlugin 184 | {{347, 364}, {146, 147}} 185 | com.apple.InterfaceBuilder.CocoaPlugin 186 | {{347, 364}, {146, 147}} 187 | 188 | {196, 240} 189 | {{357, 418}, {480, 270}} 190 | 191 | YES 192 | 193 | YES 194 | IBResizeActionFinalFrame 195 | IBResizeActionInitialFrame 196 | 197 | 198 | YES 199 | {{196, 363}, {146, 147}} 200 | {{196, 240}, {480, 270}} 201 | 202 | 203 | com.apple.InterfaceBuilder.CocoaPlugin 204 | 205 | 206 | 207 | YES 208 | 209 | YES 210 | 211 | 212 | YES 213 | 214 | 215 | 216 | 217 | YES 218 | 219 | YES 220 | 221 | 222 | YES 223 | 224 | 225 | 226 | 7 227 | 228 | 229 | 230 | YES 231 | 232 | AfloatBadgeController 233 | NSWindowController 234 | 235 | badgeView 236 | NSImageView 237 | 238 | 239 | IBProjectSource 240 | AfloatBadgeController.h 241 | 242 | 243 | 244 | AfloatPanel 245 | NSPanel 246 | 247 | IBProjectSource 248 | AfloatPanel.h 249 | 250 | 251 | 252 | NSObject 253 | 254 | IBProjectSource 255 | AfloatStorage.h 256 | 257 | 258 | 259 | NSObject 260 | 261 | IBProjectSource 262 | JRSwizzle.h 263 | 264 | 265 | 266 | 267 | 0 268 | ../Afloat.xcodeproj 269 | 3 270 | 271 | 272 | -------------------------------------------------------------------------------- /en.lproj/AfloatBadge.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/en.lproj/AfloatBadge.nib/keyedobjects.nib -------------------------------------------------------------------------------- /en.lproj/AfloatDonateFirstAlert.strings: -------------------------------------------------------------------------------- 1 | "If you do, you can support Afloat's author with a small token of your gratitude." = "If you do, you can support Afloat's author with a small token of your gratitude."; 2 | "Donate\U2026" = "Donate\U2026"; 3 | "Maybe Later" = "Maybe Later"; 4 | "Do you like keeping your windows afloat?" = "Do you like keeping your windows afloat?"; 5 | -------------------------------------------------------------------------------- /en.lproj/AfloatDonateLastAlert.strings: -------------------------------------------------------------------------------- 1 | "If you do, you can support Afloat's author with a small token of your gratitude." = "If you do, you can support Afloat's author with a small token of your gratitude."; 2 | "Donate\U2026" = "Donate\U2026"; 3 | "No, thanks" = "No, thanks"; 4 | "Do you like keeping your windows afloat?" = "Do you like keeping your windows afloat?"; 5 | -------------------------------------------------------------------------------- /en.lproj/AfloatPanel.nib 2.original/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/en.lproj/AfloatPanel.nib 2.original/keyedobjects.nib -------------------------------------------------------------------------------- /en.lproj/AfloatPanel.nib 3.original/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/en.lproj/AfloatPanel.nib 3.original/keyedobjects.nib -------------------------------------------------------------------------------- /en.lproj/AfloatPanel.nib.original/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/en.lproj/AfloatPanel.nib.original/keyedobjects.nib -------------------------------------------------------------------------------- /en.lproj/AfloatPanel.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/en.lproj/AfloatPanel.nib/keyedobjects.nib -------------------------------------------------------------------------------- /en.lproj/Donate.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/en.lproj/Donate.nib/keyedobjects.nib -------------------------------------------------------------------------------- /en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /libBGHUDAppKit.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/millenomi/afloat/1bbe7d6d27b75c42b74aa59f20e468366087bb4f/libBGHUDAppKit.a -------------------------------------------------------------------------------- /main-Nag.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main(int argc, const char* argv[]) { 4 | return NSApplicationMain(argc, argv); 5 | } 6 | --------------------------------------------------------------------------------