├── .gitignore ├── CustomNCUI.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ └── CustomNCUI.xcscheme ├── CustomNCUI ├── CNCAppDelegate.h ├── CNCAppDelegate.m ├── CustomNC-Info.plist ├── CustomNC-Prefix.pch ├── CustomNC │ ├── CustomNC.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── CustomNC.xcscheme │ └── CustomNC │ │ ├── CustomNC-Info.plist │ │ ├── CustomNC-Prefix.pch │ │ ├── CustomNC.h │ │ ├── CustomNC.m │ │ ├── NCAlertDelegate-Protocol.h │ │ ├── NCAppInfo.h │ │ ├── NCAppInfoDelegate-Protocol.h │ │ ├── NCBannerAnimation.h │ │ ├── NCBannerAnimationFadeIn.h │ │ ├── NCBannerAnimationFadeOut.h │ │ ├── NCBannerAnimationHorizontalOut.h │ │ ├── NCBannerAnimationPoofOut.h │ │ ├── NCBannerAnimationVerticalIn.h │ │ ├── NCBannerAnimationVerticalOut.h │ │ ├── NCBannerDelegate-Protocol.h │ │ ├── NCBannerWindowController.h │ │ ├── NCModel.h │ │ ├── NCNotificationWindow.h │ │ ├── NCNotificationWindowDelegate-Protocol.h │ │ ├── NCRoundedWindowContentDelegate-Protocol.h │ │ ├── NCRoundedWindowContentView.h │ │ ├── NCWindowLayoutController.h │ │ ├── NCWindowLayoutDelegate-Protocol.h │ │ ├── QLPreviewItem-Protocol.h │ │ └── en.lproj │ │ └── InfoPlist.strings ├── CustomNCLauncher.app │ └── Contents │ │ ├── Info.plist │ │ ├── MacOS │ │ └── Application Stub │ │ ├── Resources │ │ ├── English.lproj │ │ │ └── ApplicationStub.nib │ │ └── icon.icns │ │ └── document.wflow ├── LoginItem.h ├── LoginItem.m ├── MBSlider.h ├── MBSlider.m ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib └── main.m ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | /Resources/* 3 | .DS_Store 4 | */build/* 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | *.xcworkspace 14 | !default.xcworkspace 15 | xcuserdata 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | .idea/ 20 | *.hmap 21 | -------------------------------------------------------------------------------- /CustomNCUI.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B21B399B16D21D4E00278191 /* CustomNC.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = B21B399816D21D3000278191 /* CustomNC.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 11 | B243E6F315C76F1300713CB5 /* LoginItem.m in Sources */ = {isa = PBXBuildFile; fileRef = B243E6F215C76F1300713CB5 /* LoginItem.m */; }; 12 | B29D098B15C45E0900E25374 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B29D098A15C45E0900E25374 /* Cocoa.framework */; }; 13 | B29D099515C45E0900E25374 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B29D099315C45E0900E25374 /* InfoPlist.strings */; }; 14 | B29D099715C45E0900E25374 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B29D099615C45E0900E25374 /* main.m */; }; 15 | B29D099B15C45E0900E25374 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = B29D099915C45E0900E25374 /* Credits.rtf */; }; 16 | B29D099E15C45E0900E25374 /* CNCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B29D099D15C45E0900E25374 /* CNCAppDelegate.m */; }; 17 | B29D09A115C45E0A00E25374 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = B29D099F15C45E0A00E25374 /* MainMenu.xib */; }; 18 | B29D09B315C498EF00E25374 /* MBSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = B29D09B215C498EF00E25374 /* MBSlider.m */; }; 19 | B2B4372D15C79B6000632102 /* CustomNCLauncher.app in Resources */ = {isa = PBXBuildFile; fileRef = B2B4372C15C79B6000632102 /* CustomNCLauncher.app */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | B21B399716D21D3000278191 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = B230DFAE16D1EA61005A4ED0 /* CustomNC.xcodeproj */; 26 | proxyType = 2; 27 | remoteGlobalIDString = B28BA54A15C1E83E00897E82; 28 | remoteInfo = CustomNC; 29 | }; 30 | B21B399916D21D4A00278191 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = B230DFAE16D1EA61005A4ED0 /* CustomNC.xcodeproj */; 33 | proxyType = 1; 34 | remoteGlobalIDString = B28BA54915C1E83E00897E82; 35 | remoteInfo = CustomNC; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXCopyFilesBuildPhase section */ 40 | B230DFB716D1ECA6005A4ED0 /* CopyFiles */ = { 41 | isa = PBXCopyFilesBuildPhase; 42 | buildActionMask = 2147483647; 43 | dstPath = ""; 44 | dstSubfolderSpec = 7; 45 | files = ( 46 | B21B399B16D21D4E00278191 /* CustomNC.bundle in CopyFiles */, 47 | ); 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | /* End PBXCopyFilesBuildPhase section */ 51 | 52 | /* Begin PBXFileReference section */ 53 | B230DFAE16D1EA61005A4ED0 /* CustomNC.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CustomNC.xcodeproj; path = CustomNCUI/CustomNC/CustomNC.xcodeproj; sourceTree = SOURCE_ROOT; }; 54 | B243E6F115C76F1300713CB5 /* LoginItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginItem.h; sourceTree = ""; }; 55 | B243E6F215C76F1300713CB5 /* LoginItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginItem.m; sourceTree = ""; }; 56 | B29D098615C45E0900E25374 /* CustomNC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomNC.app; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | B29D098A15C45E0900E25374 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 58 | B29D098D15C45E0900E25374 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 59 | B29D098E15C45E0900E25374 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 60 | B29D098F15C45E0900E25374 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 61 | B29D099215C45E0900E25374 /* CustomNC-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CustomNC-Info.plist"; sourceTree = ""; }; 62 | B29D099415C45E0900E25374 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 63 | B29D099615C45E0900E25374 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 64 | B29D099815C45E0900E25374 /* CustomNC-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CustomNC-Prefix.pch"; sourceTree = ""; }; 65 | B29D099A15C45E0900E25374 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 66 | B29D099C15C45E0900E25374 /* CNCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNCAppDelegate.h; sourceTree = ""; }; 67 | B29D099D15C45E0900E25374 /* CNCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNCAppDelegate.m; sourceTree = ""; }; 68 | B29D09A015C45E0A00E25374 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 69 | B29D09B115C498EF00E25374 /* MBSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBSlider.h; sourceTree = ""; }; 70 | B29D09B215C498EF00E25374 /* MBSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBSlider.m; sourceTree = ""; }; 71 | B2B4372C15C79B6000632102 /* CustomNCLauncher.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; path = CustomNCLauncher.app; sourceTree = ""; }; 72 | /* End PBXFileReference section */ 73 | 74 | /* Begin PBXFrameworksBuildPhase section */ 75 | B29D098315C45E0900E25374 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | B29D098B15C45E0900E25374 /* Cocoa.framework in Frameworks */, 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | B21B399416D21D3000278191 /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | B21B399816D21D3000278191 /* CustomNC.bundle */, 90 | ); 91 | name = Products; 92 | sourceTree = ""; 93 | }; 94 | B29D097B15C45E0900E25374 = { 95 | isa = PBXGroup; 96 | children = ( 97 | B230DFAE16D1EA61005A4ED0 /* CustomNC.xcodeproj */, 98 | B29D099015C45E0900E25374 /* CustomNCUI */, 99 | B29D098915C45E0900E25374 /* Frameworks */, 100 | B29D098715C45E0900E25374 /* Products */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | B29D098715C45E0900E25374 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | B29D098615C45E0900E25374 /* CustomNC.app */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | B29D098915C45E0900E25374 /* Frameworks */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | B29D098A15C45E0900E25374 /* Cocoa.framework */, 116 | B29D098C15C45E0900E25374 /* Other Frameworks */, 117 | ); 118 | name = Frameworks; 119 | sourceTree = ""; 120 | }; 121 | B29D098C15C45E0900E25374 /* Other Frameworks */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | B29D098D15C45E0900E25374 /* AppKit.framework */, 125 | B29D098E15C45E0900E25374 /* CoreData.framework */, 126 | B29D098F15C45E0900E25374 /* Foundation.framework */, 127 | ); 128 | name = "Other Frameworks"; 129 | sourceTree = ""; 130 | }; 131 | B29D099015C45E0900E25374 /* CustomNCUI */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | B2B4372C15C79B6000632102 /* CustomNCLauncher.app */, 135 | B243E6F115C76F1300713CB5 /* LoginItem.h */, 136 | B243E6F215C76F1300713CB5 /* LoginItem.m */, 137 | B29D099C15C45E0900E25374 /* CNCAppDelegate.h */, 138 | B29D099D15C45E0900E25374 /* CNCAppDelegate.m */, 139 | B29D099F15C45E0A00E25374 /* MainMenu.xib */, 140 | B29D099115C45E0900E25374 /* Supporting Files */, 141 | B29D09B115C498EF00E25374 /* MBSlider.h */, 142 | B29D09B215C498EF00E25374 /* MBSlider.m */, 143 | ); 144 | path = CustomNCUI; 145 | sourceTree = ""; 146 | }; 147 | B29D099115C45E0900E25374 /* Supporting Files */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | B29D099215C45E0900E25374 /* CustomNC-Info.plist */, 151 | B29D099315C45E0900E25374 /* InfoPlist.strings */, 152 | B29D099615C45E0900E25374 /* main.m */, 153 | B29D099815C45E0900E25374 /* CustomNC-Prefix.pch */, 154 | B29D099915C45E0900E25374 /* Credits.rtf */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | /* End PBXGroup section */ 160 | 161 | /* Begin PBXNativeTarget section */ 162 | B29D098515C45E0900E25374 /* CustomNC */ = { 163 | isa = PBXNativeTarget; 164 | buildConfigurationList = B29D09A415C45E0A00E25374 /* Build configuration list for PBXNativeTarget "CustomNC" */; 165 | buildPhases = ( 166 | B29D098215C45E0900E25374 /* Sources */, 167 | B29D098315C45E0900E25374 /* Frameworks */, 168 | B29D098415C45E0900E25374 /* Resources */, 169 | B230DFB716D1ECA6005A4ED0 /* CopyFiles */, 170 | B2A058561CCDAA67006ABFDF /* ShellScript */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | B21B399A16D21D4A00278191 /* PBXTargetDependency */, 176 | ); 177 | name = CustomNC; 178 | productName = CustomNCUI; 179 | productReference = B29D098615C45E0900E25374 /* CustomNC.app */; 180 | productType = "com.apple.product-type.application"; 181 | }; 182 | /* End PBXNativeTarget section */ 183 | 184 | /* Begin PBXProject section */ 185 | B29D097D15C45E0900E25374 /* Project object */ = { 186 | isa = PBXProject; 187 | attributes = { 188 | CLASSPREFIX = CNC; 189 | LastUpgradeCheck = 0730; 190 | ORGANIZATIONNAME = inket; 191 | }; 192 | buildConfigurationList = B29D098015C45E0900E25374 /* Build configuration list for PBXProject "CustomNCUI" */; 193 | compatibilityVersion = "Xcode 3.2"; 194 | developmentRegion = English; 195 | hasScannedForEncodings = 0; 196 | knownRegions = ( 197 | en, 198 | ); 199 | mainGroup = B29D097B15C45E0900E25374; 200 | productRefGroup = B29D098715C45E0900E25374 /* Products */; 201 | projectDirPath = ""; 202 | projectReferences = ( 203 | { 204 | ProductGroup = B21B399416D21D3000278191 /* Products */; 205 | ProjectRef = B230DFAE16D1EA61005A4ED0 /* CustomNC.xcodeproj */; 206 | }, 207 | ); 208 | projectRoot = ""; 209 | targets = ( 210 | B29D098515C45E0900E25374 /* CustomNC */, 211 | ); 212 | }; 213 | /* End PBXProject section */ 214 | 215 | /* Begin PBXReferenceProxy section */ 216 | B21B399816D21D3000278191 /* CustomNC.bundle */ = { 217 | isa = PBXReferenceProxy; 218 | fileType = wrapper.cfbundle; 219 | path = CustomNC.bundle; 220 | remoteRef = B21B399716D21D3000278191 /* PBXContainerItemProxy */; 221 | sourceTree = BUILT_PRODUCTS_DIR; 222 | }; 223 | /* End PBXReferenceProxy section */ 224 | 225 | /* Begin PBXResourcesBuildPhase section */ 226 | B29D098415C45E0900E25374 /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | B29D099515C45E0900E25374 /* InfoPlist.strings in Resources */, 231 | B29D099B15C45E0900E25374 /* Credits.rtf in Resources */, 232 | B29D09A115C45E0A00E25374 /* MainMenu.xib in Resources */, 233 | B2B4372D15C79B6000632102 /* CustomNCLauncher.app in Resources */, 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | }; 237 | /* End PBXResourcesBuildPhase section */ 238 | 239 | /* Begin PBXShellScriptBuildPhase section */ 240 | B2A058561CCDAA67006ABFDF /* ShellScript */ = { 241 | isa = PBXShellScriptBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | ); 245 | inputPaths = ( 246 | ); 247 | outputPaths = ( 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "codesign -s \"Developer ID Application\" \"$BUILT_PRODUCTS_DIR/CustomNC.app/Contents/Resources/CustomNCLauncher.app/Contents/document.wflow\"\ncodesign -s \"Developer ID Application\" \"$BUILT_PRODUCTS_DIR/CustomNC.app/Contents/Resources/CustomNCLauncher.app\""; 252 | }; 253 | /* End PBXShellScriptBuildPhase section */ 254 | 255 | /* Begin PBXSourcesBuildPhase section */ 256 | B29D098215C45E0900E25374 /* Sources */ = { 257 | isa = PBXSourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | B29D099715C45E0900E25374 /* main.m in Sources */, 261 | B29D099E15C45E0900E25374 /* CNCAppDelegate.m in Sources */, 262 | B29D09B315C498EF00E25374 /* MBSlider.m in Sources */, 263 | B243E6F315C76F1300713CB5 /* LoginItem.m in Sources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | /* End PBXSourcesBuildPhase section */ 268 | 269 | /* Begin PBXTargetDependency section */ 270 | B21B399A16D21D4A00278191 /* PBXTargetDependency */ = { 271 | isa = PBXTargetDependency; 272 | name = CustomNC; 273 | targetProxy = B21B399916D21D4A00278191 /* PBXContainerItemProxy */; 274 | }; 275 | /* End PBXTargetDependency section */ 276 | 277 | /* Begin PBXVariantGroup section */ 278 | B29D099315C45E0900E25374 /* InfoPlist.strings */ = { 279 | isa = PBXVariantGroup; 280 | children = ( 281 | B29D099415C45E0900E25374 /* en */, 282 | ); 283 | name = InfoPlist.strings; 284 | sourceTree = ""; 285 | }; 286 | B29D099915C45E0900E25374 /* Credits.rtf */ = { 287 | isa = PBXVariantGroup; 288 | children = ( 289 | B29D099A15C45E0900E25374 /* en */, 290 | ); 291 | name = Credits.rtf; 292 | sourceTree = ""; 293 | }; 294 | B29D099F15C45E0A00E25374 /* MainMenu.xib */ = { 295 | isa = PBXVariantGroup; 296 | children = ( 297 | B29D09A015C45E0A00E25374 /* en */, 298 | ); 299 | name = MainMenu.xib; 300 | sourceTree = ""; 301 | }; 302 | /* End PBXVariantGroup section */ 303 | 304 | /* Begin XCBuildConfiguration section */ 305 | B29D09A215C45E0A00E25374 /* Debug */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ALWAYS_SEARCH_USER_PATHS = NO; 309 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 312 | COPY_PHASE_STRIP = NO; 313 | ENABLE_TESTABILITY = YES; 314 | GCC_C_LANGUAGE_STANDARD = gnu99; 315 | GCC_DYNAMIC_NO_PIC = NO; 316 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 317 | GCC_OPTIMIZATION_LEVEL = 0; 318 | GCC_PREPROCESSOR_DEFINITIONS = ( 319 | "DEBUG=1", 320 | "$(inherited)", 321 | ); 322 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 323 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 324 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 325 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 326 | GCC_WARN_UNUSED_VARIABLE = YES; 327 | MACOSX_DEPLOYMENT_TARGET = 10.10; 328 | ONLY_ACTIVE_ARCH = YES; 329 | SDKROOT = macosx; 330 | }; 331 | name = Debug; 332 | }; 333 | B29D09A315C45E0A00E25374 /* Release */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 340 | COPY_PHASE_STRIP = YES; 341 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 342 | GCC_C_LANGUAGE_STANDARD = gnu99; 343 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 344 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 345 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 347 | GCC_WARN_UNUSED_VARIABLE = YES; 348 | MACOSX_DEPLOYMENT_TARGET = 10.10; 349 | SDKROOT = macosx; 350 | }; 351 | name = Release; 352 | }; 353 | B29D09A515C45E0A00E25374 /* Debug */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | CODE_SIGN_IDENTITY = "Developer ID Application"; 357 | COMBINE_HIDPI_IMAGES = YES; 358 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 359 | GCC_PREFIX_HEADER = "CustomNCUI/CustomNC-Prefix.pch"; 360 | INFOPLIST_FILE = "CustomNCUI/CustomNC-Info.plist"; 361 | PRODUCT_BUNDLE_IDENTIFIER = "me.inket.${PRODUCT_NAME:rfc1034identifier}"; 362 | PRODUCT_NAME = CustomNC; 363 | WRAPPER_EXTENSION = app; 364 | }; 365 | name = Debug; 366 | }; 367 | B29D09A615C45E0A00E25374 /* Release */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | CODE_SIGN_IDENTITY = "Developer ID Application"; 371 | COMBINE_HIDPI_IMAGES = YES; 372 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 373 | GCC_PREFIX_HEADER = "CustomNCUI/CustomNC-Prefix.pch"; 374 | INFOPLIST_FILE = "CustomNCUI/CustomNC-Info.plist"; 375 | PRODUCT_BUNDLE_IDENTIFIER = "me.inket.${PRODUCT_NAME:rfc1034identifier}"; 376 | PRODUCT_NAME = CustomNC; 377 | WRAPPER_EXTENSION = app; 378 | }; 379 | name = Release; 380 | }; 381 | /* End XCBuildConfiguration section */ 382 | 383 | /* Begin XCConfigurationList section */ 384 | B29D098015C45E0900E25374 /* Build configuration list for PBXProject "CustomNCUI" */ = { 385 | isa = XCConfigurationList; 386 | buildConfigurations = ( 387 | B29D09A215C45E0A00E25374 /* Debug */, 388 | B29D09A315C45E0A00E25374 /* Release */, 389 | ); 390 | defaultConfigurationIsVisible = 0; 391 | defaultConfigurationName = Release; 392 | }; 393 | B29D09A415C45E0A00E25374 /* Build configuration list for PBXNativeTarget "CustomNC" */ = { 394 | isa = XCConfigurationList; 395 | buildConfigurations = ( 396 | B29D09A515C45E0A00E25374 /* Debug */, 397 | B29D09A615C45E0A00E25374 /* Release */, 398 | ); 399 | defaultConfigurationIsVisible = 0; 400 | defaultConfigurationName = Release; 401 | }; 402 | /* End XCConfigurationList section */ 403 | }; 404 | rootObject = B29D097D15C45E0900E25374 /* Project object */; 405 | } 406 | -------------------------------------------------------------------------------- /CustomNCUI.xcodeproj/xcshareddata/xcschemes/CustomNCUI.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /CustomNCUI/CNCAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CNCAppDelegate.h 3 | // CustomNCUI 4 | // 5 | // Copyright (c) 2012-2016 Mahdi Bchetnia. Licensed under GNU GPL v3.0. See LICENSE for details. 6 | // 7 | 8 | #import 9 | #import "MBSlider.h" 10 | #import "LoginItem.h" 11 | 12 | @interface CNCAppDelegate : NSObject { 13 | BOOL SIMBLInstalled; 14 | 15 | NSTimeInterval apply; 16 | } 17 | 18 | @property (assign) IBOutlet NSWindow *window; 19 | 20 | @property (assign) IBOutlet NSButton* alwaysPulseIcon; 21 | @property (assign) IBOutlet NSButton* hideIcon; 22 | 23 | @property (assign) IBOutlet NSPopUpButton* entryAnimationStyle; 24 | @property (assign) IBOutlet MBSlider* entryAnimationDuration; 25 | 26 | @property (assign) IBOutlet MBSlider* bannerIdleDuration; 27 | 28 | @property (assign) IBOutlet NSPopUpButton* exitAnimationStyle; 29 | @property (assign) IBOutlet MBSlider* exitAnimationDuration; 30 | 31 | @property (assign) IBOutlet NSButton* fixGrowl; 32 | @property (assign) IBOutlet NSButton* removeAppName; 33 | 34 | @property (assign) IBOutlet NSButton* applyButton; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /CustomNCUI/CNCAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CNCAppDelegate.m 3 | // CustomNCUI 4 | // 5 | // Copyright (c) 2012-2016 Mahdi Bchetnia. Licensed under GNU GPL v3.0. See LICENSE for details. 6 | // 7 | 8 | #import "CNCAppDelegate.h" 9 | 10 | #define RUNNING_NC ([NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.apple.notificationcenterui"]) 11 | 12 | @implementation CNCAppDelegate 13 | 14 | #pragma mark - Setting up the UI 15 | 16 | - (void)awakeFromNib { 17 | [_entryAnimationDuration setAltIncrementValue:0.5]; 18 | [_entryAnimationDuration setFormatString:@"%@ second%@"]; 19 | [_bannerIdleDuration setAltIncrementValue:0.5]; 20 | [_bannerIdleDuration setFormatString:@"approx. %@ second%@"]; 21 | [_exitAnimationDuration setAltIncrementValue:0.5]; 22 | [_exitAnimationDuration setFormatString:@"%@ second%@"]; 23 | 24 | if (![self OSIsMountainLion]) 25 | { 26 | [_alwaysPulseIcon setState:NSOffState]; 27 | [_alwaysPulseIcon setEnabled:NO]; 28 | } 29 | 30 | // Recreate the entry animation styles list, taking into account the OS version 31 | NSMenu* entryMenu = [[NSMenu alloc] init]; 32 | [entryMenu addItemWithTitle:[self OSIsYosemiteOrHigher] ? @"Slide" : @"Drop" action:nil keyEquivalent:@""]; 33 | [entryMenu addItemWithTitle:@"Fade" action:nil keyEquivalent:@""]; 34 | [_entryAnimationStyle setMenu:entryMenu]; 35 | 36 | // Recreate the exit animation styles list, taking into account the OS version 37 | NSMenu* exitMenu = [[NSMenu alloc] init]; 38 | [exitMenu addItemWithTitle:@"Slide" action:nil keyEquivalent:@""]; 39 | [exitMenu addItemWithTitle:@"Fade" action:nil keyEquivalent:@""]; 40 | [exitMenu addItemWithTitle:([self OSIsMavericks] ? @"Raise" : @"Poof") action:nil keyEquivalent:@""]; 41 | [exitMenu addItemWithTitle:@"None" action:nil keyEquivalent:@""]; 42 | [_exitAnimationStyle setMenu:exitMenu]; 43 | 44 | [self install]; // Install/update plug-in if necessary 45 | 46 | // SIMBL doesn't inject apps at user login 47 | // so we have to do that with an automator workflow set as a login item 48 | [self addLoginItem]; 49 | 50 | // Sync the UI elements to the saved preferences 51 | NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; 52 | 53 | NSNumber* entryStyle = [userDefaults objectForKey:@"entryAnimationStyle"]; 54 | [_entryAnimationStyle selectItemAtIndex:entryStyle ? [entryStyle integerValue] : 0]; 55 | 56 | NSNumber* entryDuration = [userDefaults objectForKey:@"entryAnimationDuration"]; 57 | [_entryAnimationDuration setMaxDigits:4]; 58 | [_entryAnimationDuration setDoubleValue:entryDuration ? [entryDuration doubleValue] : 0.7]; 59 | 60 | NSNumber* idleDuration = [userDefaults objectForKey:@"bannerIdleDuration"]; 61 | [_bannerIdleDuration setMaxDigits:3]; 62 | [_bannerIdleDuration setDoubleValue:idleDuration ? [idleDuration doubleValue] : 5]; 63 | 64 | NSNumber* exitStyle = [userDefaults objectForKey:@"exitAnimationStyle"]; 65 | [_exitAnimationStyle selectItemAtIndex:exitStyle ? [exitStyle integerValue] : 0]; 66 | [self changeExitAnimationStyle:_exitAnimationStyle]; 67 | 68 | NSNumber* exitDuration = [userDefaults objectForKey:@"exitAnimationDuration"]; 69 | [_exitAnimationDuration setMaxDigits:4]; 70 | [_exitAnimationDuration setDoubleValue:exitDuration ? [exitDuration doubleValue] : 0.6]; 71 | 72 | BOOL alwaysPulse = [userDefaults boolForKey:@"alwaysPulseIcon"] && [self OSIsMountainLion]; 73 | [_alwaysPulseIcon setState:alwaysPulse ? NSOnState : NSOffState]; 74 | 75 | [_hideIcon setState:[userDefaults boolForKey:@"hideIcon"] ? NSOnState : NSOffState]; 76 | 77 | [_fixGrowl setState:[userDefaults boolForKey:@"fixGrowl"] ? NSOnState : NSOffState]; 78 | [self changeGrowlCheckboxValue:_fixGrowl]; 79 | 80 | [_removeAppName setState:[userDefaults boolForKey:@"removeAppName"] ? NSOnState : NSOffState]; 81 | } 82 | 83 | #pragma mark - UI Actions/Controls 84 | 85 | - (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag { 86 | [_window makeKeyAndOrderFront:nil]; 87 | 88 | return YES; 89 | } 90 | 91 | - (void)activate { 92 | [(NSApplication*)NSApp activateIgnoringOtherApps:YES]; 93 | } 94 | 95 | - (IBAction)changeGrowlCheckboxValue:(id)sender { 96 | [_removeAppName setEnabled:[_fixGrowl state]]; 97 | if (![_removeAppName isEnabled]) [_removeAppName setState:NSOffState]; 98 | } 99 | 100 | - (IBAction)changeSliderValue:(id)sender { 101 | [[sender valueLabel] setStringValue:[sender formatString]]; 102 | } 103 | 104 | - (IBAction)changeExitAnimationStyle:(id)sender { 105 | if ([(NSPopUpButton*)sender indexOfSelectedItem] == 2 && [self OSIsMountainLion]) // Poof animation (in ML) duration can't be changed 106 | { 107 | [_exitAnimationDuration setEnabled:NO]; 108 | [_exitAnimationDuration setDoubleValue:0.25]; 109 | } 110 | else 111 | [_exitAnimationDuration setEnabled:YES]; 112 | } 113 | 114 | - (IBAction)defaults:(id)sender { 115 | [_alwaysPulseIcon setState:NSOffState]; 116 | [_hideIcon setState:NSOffState]; 117 | 118 | [_entryAnimationStyle selectItemAtIndex:0]; 119 | [_entryAnimationDuration setDoubleValue:0.7]; 120 | 121 | [_bannerIdleDuration setDoubleValue:5]; 122 | 123 | [_exitAnimationStyle selectItemAtIndex:0]; 124 | [_exitAnimationDuration setEnabled:YES]; 125 | [_exitAnimationDuration setDoubleValue:0.6]; 126 | 127 | [_fixGrowl setState:NSOffState]; 128 | [self changeGrowlCheckboxValue:_fixGrowl]; 129 | 130 | [_removeAppName setState:NSOffState]; 131 | } 132 | 133 | - (IBAction)uninstall:(id)sender { 134 | NSFileManager* fileManager = [NSFileManager defaultManager]; 135 | 136 | NSString* pluginsDirectory = [@"~/Library/Application Support/SIMBL/Plugins/" stringByExpandingTildeInPath]; 137 | NSString* destination = [NSString stringWithFormat:@"%@/CustomNC.bundle", pluginsDirectory]; 138 | 139 | NSError* error = nil; 140 | [fileManager removeItemAtPath:destination error:&error]; 141 | 142 | if (error) 143 | [NSAlert alertWithError:error]; 144 | 145 | [self removeLoginItem]; 146 | 147 | NSArray* runningNC = RUNNING_NC; 148 | 149 | if ([runningNC count] > 0) 150 | [(NSRunningApplication*)runningNC[0] terminate]; 151 | 152 | [fileManager trashItemAtURL:[NSURL URLWithString:[NSString stringWithFormat:@"file://%@", [[NSBundle mainBundle] bundlePath]]] resultingItemURL:nil error:&error]; 153 | 154 | [NSApp terminate:self]; 155 | } 156 | 157 | #pragma mark - Applying Settings 158 | 159 | - (IBAction)apply:(id)sender { 160 | if (DEBUG_ENABLED) NSLog(@"SIMBL user clicked Apply"); 161 | 162 | [_applyButton setTitle:@"Applying…"]; 163 | [_applyButton setEnabled:NO]; 164 | 165 | NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; 166 | 167 | [userDefaults setBool:[_alwaysPulseIcon state] forKey:@"alwaysPulseIcon"]; 168 | [userDefaults setBool:[_hideIcon state] forKey:@"hideIcon"]; 169 | 170 | [userDefaults setInteger:[_entryAnimationStyle indexOfSelectedItem] forKey:@"entryAnimationStyle"]; 171 | [userDefaults setDouble:[[_entryAnimationDuration stringValue] doubleValue] forKey:@"entryAnimationDuration"]; 172 | 173 | [userDefaults setInteger:[_exitAnimationStyle indexOfSelectedItem] forKey:@"exitAnimationStyle"]; 174 | [userDefaults setDouble:[[_exitAnimationDuration stringValue] doubleValue] forKey:@"exitAnimationDuration"]; 175 | 176 | [userDefaults setDouble:[[_bannerIdleDuration stringValue] doubleValue] forKey:@"bannerIdleDuration"]; 177 | 178 | [userDefaults setBool:[_fixGrowl state] forKey:@"fixGrowl"]; 179 | [userDefaults setBool:[_removeAppName state] forKey:@"removeAppName"]; 180 | 181 | [userDefaults synchronize]; 182 | 183 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(updatedSettings:) name:@"CustomNCUpdatedSettings" object:nil]; 184 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"CustomNCUpdateSettings" object:nil]; 185 | 186 | apply = [NSDate timeIntervalSinceReferenceDate]; 187 | [self performSelector:@selector(NCDidNotRespondToNotification) withObject:nil afterDelay:1.5]; 188 | } 189 | 190 | - (void)updatedSettings:(NSNotification*)notification { 191 | [_applyButton setTitle:@"Apply"]; 192 | [_applyButton setEnabled:YES]; 193 | 194 | [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:@"CustomNCUpdatedSettings" object:nil]; 195 | 196 | [self sendNotification]; 197 | } 198 | 199 | - (void)NCDidNotRespondToNotification { 200 | if (![_applyButton isEnabled] && ([NSDate timeIntervalSinceReferenceDate] - apply) > 1) 201 | { 202 | NSLog(@"NCDidNotRespondToNotification"); 203 | apply = 0; 204 | 205 | [_applyButton setTitle:@"Installing…"]; 206 | [_applyButton setEnabled:NO]; 207 | 208 | [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:@"CustomNCUpdatedSettings" object:nil]; 209 | 210 | [self restartNC]; 211 | } 212 | } 213 | 214 | #pragma mark - Installing CustomNC's SIMBL plug-in 215 | 216 | - (void)install { 217 | NSFileManager* fileManager = [NSFileManager defaultManager]; 218 | 219 | // *** Making sure SIMBL is installed 220 | BOOL isDir = NO; 221 | NSString* systemSIMBLpath = @"/System/Library/ScriptingAdditions/SIMBL.osax"; 222 | NSString* SIMBLpath = @"/Library/ScriptingAdditions/SIMBL.osax"; 223 | 224 | SIMBLInstalled = [fileManager fileExistsAtPath:SIMBLpath isDirectory:&isDir] || [fileManager fileExistsAtPath:systemSIMBLpath isDirectory:&isDir]; 225 | 226 | if (DEBUG_ENABLED) NSLog(@"SIMBL: %@", SIMBLInstalled ? @"YES" : @"NO"); 227 | 228 | if (!SIMBLInstalled) 229 | { 230 | NSAlert* alert = [NSAlert alertWithMessageText:@"CustomNC requires SIMBL to function" 231 | defaultButton:@"Take me there!" 232 | alternateButton:@"Cancel" 233 | otherButton:@"" informativeTextWithFormat:@"SIMBL is a transparent app that enables modifications like CustomNC. \n\nmySIMBL allows you to easily install SIMBL. Get mySIMBL at https://github.com/w0lfschild/mySIMBL"]; 234 | 235 | NSInteger buttonClicked = [alert runModal]; 236 | 237 | if (buttonClicked == 1) 238 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/w0lfschild/mySIMBL"]]; 239 | 240 | [NSApp terminate:self]; 241 | } 242 | 243 | // *** Making sure the plugin is in place 244 | NSString* resourcePath = [[NSBundle mainBundle] resourcePath]; 245 | 246 | NSString* pluginPath = [NSBundle pathForResource:@"CustomNC" ofType:@"bundle" inDirectory:resourcePath]; 247 | double newPluginVersion = [[[[NSBundle bundleWithPath:pluginPath] infoDictionary] objectForKey:@"CFBundleShortVersionString"] doubleValue]; 248 | 249 | NSString* pluginsDirectory = [@"~/Library/Application Support/SIMBL/Plugins/" stringByExpandingTildeInPath]; 250 | NSString* destination = [NSString stringWithFormat:@"%@/CustomNC.bundle", pluginsDirectory]; 251 | BOOL isDirectory = NO; 252 | 253 | NSBundle* bundle = [NSBundle bundleWithPath:destination]; 254 | double pluginVersion = [[[bundle infoDictionary] objectForKey:@"CFBundleShortVersionString"] doubleValue]; 255 | 256 | if (!bundle) 257 | { 258 | NSError* error = nil; 259 | 260 | [fileManager createDirectoryAtPath:pluginsDirectory withIntermediateDirectories:YES attributes:nil error:&error]; 261 | 262 | if (![fileManager fileExistsAtPath:pluginsDirectory isDirectory:&isDirectory]) 263 | { 264 | [[NSAlert alertWithError:error] runModal]; 265 | NSLog(@"Couldn't find/create plugins directory @ %@", pluginsDirectory); 266 | [NSApp terminate:self]; 267 | } 268 | 269 | error = nil; 270 | [fileManager copyItemAtPath:pluginPath toPath:destination error:&error]; 271 | 272 | if (error) 273 | { 274 | [[NSAlert alertWithError:error] runModal]; 275 | NSLog(@"Couldn't install CustomNC SIMBL plugin. Quitting…"); 276 | [NSApp terminate:self]; 277 | } 278 | } 279 | else 280 | { 281 | BOOL differentVersion = newPluginVersion != pluginVersion; 282 | #ifdef DEBUG 283 | differentVersion = YES; 284 | #endif 285 | 286 | if (differentVersion) 287 | { 288 | NSError* error = nil; 289 | [fileManager removeItemAtPath:destination error:&error]; 290 | 291 | if (error) 292 | { 293 | [[NSAlert alertWithError:error] runModal]; 294 | NSLog(@"Couldn't replace CustomNC plugin @ %@ with a newer version", destination); 295 | [NSApp terminate:self]; 296 | } 297 | 298 | error = nil; 299 | [fileManager copyItemAtPath:pluginPath toPath:destination error:&error]; 300 | 301 | if (error) 302 | { 303 | [[NSAlert alertWithError:error] runModal]; 304 | NSLog(@"Couldn't install CustomNC SIMBL plugin. Quitting…"); 305 | [NSApp terminate:self]; 306 | } 307 | 308 | NSLog(@"Replaced CustomNC plugin with a newer version successfully."); 309 | [_applyButton setTitle:@"Installing…"]; 310 | [_applyButton setEnabled:NO]; 311 | [self restartNC]; 312 | } 313 | } 314 | } 315 | 316 | #pragma mark - Reinjecting CustomNC 317 | 318 | - (void)restartNC { 319 | NSArray* runningNC = RUNNING_NC; 320 | 321 | if ([runningNC count] > 0) 322 | { 323 | [(NSRunningApplication*)runningNC[0] terminate]; 324 | if (DEBUG_ENABLED) NSLog(@"Killed NC"); 325 | 326 | double slept = 0; 327 | 328 | while ([RUNNING_NC count] == 0 && slept < 5) 329 | { 330 | sleep(1); 331 | slept += 1; 332 | } 333 | 334 | if ([RUNNING_NC count] == 0) 335 | { 336 | NSAlert* alert = [NSAlert alertWithMessageText:@"Uh oh. There seems to be a problem." defaultButton:@"Try later" alternateButton:@"" otherButton:@"" informativeTextWithFormat:@"Notification Center is not running. Please restart and try again."]; 337 | 338 | [alert runModal]; 339 | 340 | [NSApp terminate:self]; 341 | } 342 | else 343 | { 344 | [self performSelector:@selector(inject) withObject:nil afterDelay:2]; 345 | } 346 | } 347 | } 348 | 349 | - (void)inject { 350 | if (SIMBLInstalled) 351 | [self SIMBLInject]; 352 | 353 | [_applyButton setTitle:@"Apply"]; 354 | [_applyButton setEnabled:YES]; 355 | 356 | // Re-activate CustomNC because relaunching NotificationCenter would take focus away 357 | [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(activate) userInfo:nil repeats:NO]; 358 | } 359 | 360 | - (void)SIMBLInject { 361 | if (DEBUG_ENABLED) NSLog(@"User has SIMBL, trying to start the injector"); 362 | 363 | NSString* launcherPath = [[NSBundle mainBundle] pathForResource:@"CustomNCLauncher" ofType:@"app"]; 364 | 365 | [[NSWorkspace sharedWorkspace] openFile:launcherPath]; 366 | 367 | if (DEBUG_ENABLED) NSLog(@"Told SIMBL to inject CustomNC"); 368 | } 369 | 370 | #pragma mark - Sending a Test Notification 371 | 372 | - (void)sendNotification { 373 | NSUserNotification* notification = [[NSUserNotification alloc] init]; 374 | [notification setTitle:@"Settings applied."]; 375 | [notification setSubtitle:@"This is a test notification"]; 376 | 377 | NSDateFormatter *format = [[NSDateFormatter alloc] init]; 378 | [format setDateFormat:@"HH:mm:ss"]; 379 | 380 | NSString* informativeText = [NSString stringWithFormat:@"It's %@ now!", [format stringFromDate:[NSDate date]]]; 381 | [notification setInformativeText:informativeText]; 382 | 383 | NSUserNotificationCenter* notificationCenter = [NSUserNotificationCenter defaultUserNotificationCenter]; 384 | [notificationCenter setDelegate:(id)self]; 385 | [notificationCenter deliverNotification:notification]; 386 | } 387 | 388 | - (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification { 389 | return YES; 390 | } 391 | 392 | #pragma mark - Sending a Growl Test Notification 393 | 394 | - (IBAction)sendGrowlNotification:(id)sender { 395 | NSString* asSource = @"\ 396 | tell application \"System Events\"\n\ 397 | set isRunning to (count of (every process whose bundle identifier is \"com.Growl.GrowlHelperApp\")) > 0\n\ 398 | end tell\n\ 399 | \n\ 400 | if isRunning then\n\ 401 | tell application id \"com.Growl.GrowlHelperApp\"\n\ 402 | set the allNotificationsList to ¬\n\ 403 | {\"Test Notification\"}\n\ 404 | \n\ 405 | set the enabledNotificationsList to ¬\n\ 406 | {\"Test Notification\"}\n\ 407 | \n\ 408 | \n\ 409 | register as application ¬\n\ 410 | \"CustomNC\" all notifications allNotificationsList ¬\n\ 411 | default notifications enabledNotificationsList ¬\n\ 412 | icon of application \"CustomNC\"\n\ 413 | \n\ 414 | \n\ 415 | notify with name ¬\n\ 416 | \"Test Notification\" title ¬\n\ 417 | \"Test Notification\" description ¬\n\ 418 | \"Lorem Ipsum Dolor Sit Amet, Consectetur Adipiscing Elit.\" application name \"CustomNC\"\n\ 419 | \n\ 420 | end tell\n\ 421 | end if"; 422 | 423 | NSAppleScript* as = [[NSAppleScript alloc] initWithSource:asSource]; 424 | 425 | NSDictionary* error = nil; 426 | [as executeAndReturnError:&error]; 427 | 428 | if (error) 429 | NSLog(@"%@", error); 430 | } 431 | 432 | #pragma mark - Managing the login item to inject at startup 433 | 434 | - (void)addLoginItem { 435 | if (![LoginItem loginItemExists]) 436 | [LoginItem addLoginItem]; 437 | } 438 | 439 | - (void)removeLoginItem { 440 | if ([LoginItem loginItemExists]) 441 | [LoginItem removeLoginItem]; 442 | } 443 | 444 | #pragma mark - Getting the OS version 445 | 446 | - (BOOL)OSIsMountainLion { 447 | return ![NSProcessInfo instancesRespondToSelector:@selector(endActivity:)]; 448 | } 449 | 450 | - (BOOL)OSIsMavericks { 451 | return ![self OSIsMountainLion] && ![self OSIsYosemiteOrHigher]; 452 | } 453 | 454 | - (BOOL)OSIsYosemiteOrHigher { 455 | return [NSProcessInfo instancesRespondToSelector:@selector(isOperatingSystemAtLeastVersion:)]; 456 | } 457 | 458 | @end 459 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | CustomNCLauncher.app/Contents/Resources/icon.icns 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.5 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.5 25 | LSApplicationCategoryType 26 | public.app-category.utilities 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSHumanReadableCopyright 30 | Copyright © 2012-2016 Mahdi Bchetnia. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CustomNCUI' target in the 'CustomNCUI' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #define DEBUG_ENABLED NO 8 | #endif 9 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B28BA54E15C1E83E00897E82 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B28BA54D15C1E83E00897E82 /* Cocoa.framework */; }; 11 | B28BA55815C1E83E00897E82 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B28BA55615C1E83E00897E82 /* InfoPlist.strings */; }; 12 | B28BA56115C1E87000897E82 /* CustomNC.m in Sources */ = {isa = PBXBuildFile; fileRef = B28BA56015C1E87000897E82 /* CustomNC.m */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | B20CEBBD17773E4100D4AEA3 /* NCBannerAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCBannerAnimation.h; sourceTree = ""; }; 17 | B20CEBBE1777419B00D4AEA3 /* NCBannerAnimationVerticalIn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCBannerAnimationVerticalIn.h; sourceTree = ""; }; 18 | B20CEBBF1777436B00D4AEA3 /* NCBannerAnimationFadeIn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCBannerAnimationFadeIn.h; sourceTree = ""; }; 19 | B20CEBC01777455000D4AEA3 /* NCBannerAnimationFadeOut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCBannerAnimationFadeOut.h; sourceTree = ""; }; 20 | B20CEBC11777455000D4AEA3 /* NCBannerAnimationHorizontalOut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCBannerAnimationHorizontalOut.h; sourceTree = ""; }; 21 | B20CEBC21777455000D4AEA3 /* NCBannerAnimationPoofOut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCBannerAnimationPoofOut.h; sourceTree = ""; }; 22 | B20CEBC31777455000D4AEA3 /* NCBannerAnimationVerticalOut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCBannerAnimationVerticalOut.h; sourceTree = ""; }; 23 | B2804EF5160CA2C6008F7AEC /* NCAppInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCAppInfo.h; sourceTree = ""; }; 24 | B2804EF7160CA2EB008F7AEC /* NCModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCModel.h; sourceTree = ""; }; 25 | B2804EF8160CA3CB008F7AEC /* NCAppInfoDelegate-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NCAppInfoDelegate-Protocol.h"; sourceTree = ""; }; 26 | B2804EF9160CA408008F7AEC /* QLPreviewItem-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "QLPreviewItem-Protocol.h"; sourceTree = ""; }; 27 | B28AA7F917C9B0D300FE4FEC /* NCBannerWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCBannerWindowController.h; sourceTree = ""; }; 28 | B28BA54A15C1E83E00897E82 /* CustomNC.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CustomNC.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | B28BA54D15C1E83E00897E82 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 30 | B28BA55015C1E83E00897E82 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 31 | B28BA55115C1E83E00897E82 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 32 | B28BA55215C1E83E00897E82 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 33 | B28BA55515C1E83E00897E82 /* CustomNC-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CustomNC-Info.plist"; sourceTree = ""; }; 34 | B28BA55715C1E83E00897E82 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 35 | B28BA55915C1E83E00897E82 /* CustomNC-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CustomNC-Prefix.pch"; sourceTree = ""; }; 36 | B28BA55F15C1E87000897E82 /* CustomNC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomNC.h; sourceTree = ""; }; 37 | B28BA56015C1E87000897E82 /* CustomNC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomNC.m; sourceTree = ""; }; 38 | B28BA57415C20C8200897E82 /* NCNotificationWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCNotificationWindow.h; sourceTree = ""; }; 39 | B28BA57515C20C8200897E82 /* NCNotificationWindowDelegate-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NCNotificationWindowDelegate-Protocol.h"; sourceTree = ""; }; 40 | B28BA57615C20C8200897E82 /* NCWindowLayoutController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCWindowLayoutController.h; sourceTree = ""; }; 41 | B28BA57715C20C8200897E82 /* NCWindowLayoutDelegate-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NCWindowLayoutDelegate-Protocol.h"; sourceTree = ""; }; 42 | B28BA57815C20CA600897E82 /* NCRoundedWindowContentDelegate-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NCRoundedWindowContentDelegate-Protocol.h"; sourceTree = ""; }; 43 | B28BA57915C20CA600897E82 /* NCRoundedWindowContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCRoundedWindowContentView.h; sourceTree = ""; }; 44 | B28BA57A15C20CF200897E82 /* NCAlertDelegate-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NCAlertDelegate-Protocol.h"; sourceTree = ""; }; 45 | B28BA57B15C20CF300897E82 /* NCBannerDelegate-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NCBannerDelegate-Protocol.h"; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | B28BA54715C1E83E00897E82 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | B28BA54E15C1E83E00897E82 /* Cocoa.framework in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | B28BA53F15C1E83E00897E82 = { 61 | isa = PBXGroup; 62 | children = ( 63 | B28BA55315C1E83E00897E82 /* CustomNC */, 64 | B28BA54C15C1E83E00897E82 /* Frameworks */, 65 | B28BA54B15C1E83E00897E82 /* Products */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | B28BA54B15C1E83E00897E82 /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | B28BA54A15C1E83E00897E82 /* CustomNC.bundle */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | B28BA54C15C1E83E00897E82 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | B28BA54F15C1E83E00897E82 /* Other Frameworks */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | B28BA54F15C1E83E00897E82 /* Other Frameworks */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | B28BA54D15C1E83E00897E82 /* Cocoa.framework */, 89 | B28BA55015C1E83E00897E82 /* AppKit.framework */, 90 | B28BA55115C1E83E00897E82 /* CoreData.framework */, 91 | B28BA55215C1E83E00897E82 /* Foundation.framework */, 92 | ); 93 | name = "Other Frameworks"; 94 | sourceTree = ""; 95 | }; 96 | B28BA55315C1E83E00897E82 /* CustomNC */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | B28AA7F917C9B0D300FE4FEC /* NCBannerWindowController.h */, 100 | B20CEBC01777455000D4AEA3 /* NCBannerAnimationFadeOut.h */, 101 | B20CEBC11777455000D4AEA3 /* NCBannerAnimationHorizontalOut.h */, 102 | B20CEBC21777455000D4AEA3 /* NCBannerAnimationPoofOut.h */, 103 | B20CEBC31777455000D4AEA3 /* NCBannerAnimationVerticalOut.h */, 104 | B20CEBBF1777436B00D4AEA3 /* NCBannerAnimationFadeIn.h */, 105 | B20CEBBE1777419B00D4AEA3 /* NCBannerAnimationVerticalIn.h */, 106 | B20CEBBD17773E4100D4AEA3 /* NCBannerAnimation.h */, 107 | B2804EF9160CA408008F7AEC /* QLPreviewItem-Protocol.h */, 108 | B2804EF8160CA3CB008F7AEC /* NCAppInfoDelegate-Protocol.h */, 109 | B2804EF7160CA2EB008F7AEC /* NCModel.h */, 110 | B2804EF5160CA2C6008F7AEC /* NCAppInfo.h */, 111 | B28BA57A15C20CF200897E82 /* NCAlertDelegate-Protocol.h */, 112 | B28BA57B15C20CF300897E82 /* NCBannerDelegate-Protocol.h */, 113 | B28BA57815C20CA600897E82 /* NCRoundedWindowContentDelegate-Protocol.h */, 114 | B28BA57915C20CA600897E82 /* NCRoundedWindowContentView.h */, 115 | B28BA57415C20C8200897E82 /* NCNotificationWindow.h */, 116 | B28BA57515C20C8200897E82 /* NCNotificationWindowDelegate-Protocol.h */, 117 | B28BA57615C20C8200897E82 /* NCWindowLayoutController.h */, 118 | B28BA57715C20C8200897E82 /* NCWindowLayoutDelegate-Protocol.h */, 119 | B28BA55415C1E83E00897E82 /* Supporting Files */, 120 | B28BA55F15C1E87000897E82 /* CustomNC.h */, 121 | B28BA56015C1E87000897E82 /* CustomNC.m */, 122 | ); 123 | path = CustomNC; 124 | sourceTree = ""; 125 | }; 126 | B28BA55415C1E83E00897E82 /* Supporting Files */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | B28BA55515C1E83E00897E82 /* CustomNC-Info.plist */, 130 | B28BA55615C1E83E00897E82 /* InfoPlist.strings */, 131 | B28BA55915C1E83E00897E82 /* CustomNC-Prefix.pch */, 132 | ); 133 | name = "Supporting Files"; 134 | sourceTree = ""; 135 | }; 136 | /* End PBXGroup section */ 137 | 138 | /* Begin PBXNativeTarget section */ 139 | B28BA54915C1E83E00897E82 /* CustomNC */ = { 140 | isa = PBXNativeTarget; 141 | buildConfigurationList = B28BA55C15C1E83E00897E82 /* Build configuration list for PBXNativeTarget "CustomNC" */; 142 | buildPhases = ( 143 | B28BA54615C1E83E00897E82 /* Sources */, 144 | B28BA54715C1E83E00897E82 /* Frameworks */, 145 | B28BA54815C1E83E00897E82 /* Resources */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | ); 151 | name = CustomNC; 152 | productName = CustomNC; 153 | productReference = B28BA54A15C1E83E00897E82 /* CustomNC.bundle */; 154 | productType = "com.apple.product-type.bundle"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | B28BA54115C1E83E00897E82 /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | LastUpgradeCheck = 0730; 163 | ORGANIZATIONNAME = inket; 164 | }; 165 | buildConfigurationList = B28BA54415C1E83E00897E82 /* Build configuration list for PBXProject "CustomNC" */; 166 | compatibilityVersion = "Xcode 3.2"; 167 | developmentRegion = English; 168 | hasScannedForEncodings = 0; 169 | knownRegions = ( 170 | en, 171 | ); 172 | mainGroup = B28BA53F15C1E83E00897E82; 173 | productRefGroup = B28BA54B15C1E83E00897E82 /* Products */; 174 | projectDirPath = ""; 175 | projectRoot = ""; 176 | targets = ( 177 | B28BA54915C1E83E00897E82 /* CustomNC */, 178 | ); 179 | }; 180 | /* End PBXProject section */ 181 | 182 | /* Begin PBXResourcesBuildPhase section */ 183 | B28BA54815C1E83E00897E82 /* Resources */ = { 184 | isa = PBXResourcesBuildPhase; 185 | buildActionMask = 2147483647; 186 | files = ( 187 | B28BA55815C1E83E00897E82 /* InfoPlist.strings in Resources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXResourcesBuildPhase section */ 192 | 193 | /* Begin PBXSourcesBuildPhase section */ 194 | B28BA54615C1E83E00897E82 /* Sources */ = { 195 | isa = PBXSourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | B28BA56115C1E87000897E82 /* CustomNC.m in Sources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | /* End PBXSourcesBuildPhase section */ 203 | 204 | /* Begin PBXVariantGroup section */ 205 | B28BA55615C1E83E00897E82 /* InfoPlist.strings */ = { 206 | isa = PBXVariantGroup; 207 | children = ( 208 | B28BA55715C1E83E00897E82 /* en */, 209 | ); 210 | name = InfoPlist.strings; 211 | sourceTree = ""; 212 | }; 213 | /* End PBXVariantGroup section */ 214 | 215 | /* Begin XCBuildConfiguration section */ 216 | B28BA55A15C1E83E00897E82 /* Debug */ = { 217 | isa = XCBuildConfiguration; 218 | buildSettings = { 219 | ALWAYS_SEARCH_USER_PATHS = NO; 220 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 223 | COPY_PHASE_STRIP = NO; 224 | ENABLE_TESTABILITY = YES; 225 | GCC_C_LANGUAGE_STANDARD = gnu99; 226 | GCC_DYNAMIC_NO_PIC = NO; 227 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 228 | GCC_OPTIMIZATION_LEVEL = 0; 229 | GCC_PREPROCESSOR_DEFINITIONS = ( 230 | "DEBUG=1", 231 | "$(inherited)", 232 | ); 233 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 234 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 235 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 236 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 237 | GCC_WARN_UNUSED_VARIABLE = YES; 238 | MACOSX_DEPLOYMENT_TARGET = 10.10; 239 | ONLY_ACTIVE_ARCH = YES; 240 | SDKROOT = macosx; 241 | }; 242 | name = Debug; 243 | }; 244 | B28BA55B15C1E83E00897E82 /* Release */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | ALWAYS_SEARCH_USER_PATHS = NO; 248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 249 | CLANG_ENABLE_OBJC_ARC = YES; 250 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 251 | COPY_PHASE_STRIP = YES; 252 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 253 | GCC_C_LANGUAGE_STANDARD = gnu99; 254 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 255 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 256 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 257 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 258 | GCC_WARN_UNUSED_VARIABLE = YES; 259 | MACOSX_DEPLOYMENT_TARGET = 10.10; 260 | SDKROOT = macosx; 261 | }; 262 | name = Release; 263 | }; 264 | B28BA55D15C1E83E00897E82 /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | COMBINE_HIDPI_IMAGES = YES; 268 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 269 | GCC_PREFIX_HEADER = "CustomNC/CustomNC-Prefix.pch"; 270 | INFOPLIST_FILE = "CustomNC/CustomNC-Info.plist"; 271 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; 272 | PRODUCT_BUNDLE_IDENTIFIER = "me.inket.${PRODUCT_NAME:rfc1034identifier}"; 273 | PRODUCT_NAME = "$(TARGET_NAME)"; 274 | WRAPPER_EXTENSION = bundle; 275 | }; 276 | name = Debug; 277 | }; 278 | B28BA55E15C1E83E00897E82 /* Release */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | COMBINE_HIDPI_IMAGES = YES; 282 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 283 | GCC_PREFIX_HEADER = "CustomNC/CustomNC-Prefix.pch"; 284 | INFOPLIST_FILE = "CustomNC/CustomNC-Info.plist"; 285 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; 286 | PRODUCT_BUNDLE_IDENTIFIER = "me.inket.${PRODUCT_NAME:rfc1034identifier}"; 287 | PRODUCT_NAME = "$(TARGET_NAME)"; 288 | WRAPPER_EXTENSION = bundle; 289 | }; 290 | name = Release; 291 | }; 292 | /* End XCBuildConfiguration section */ 293 | 294 | /* Begin XCConfigurationList section */ 295 | B28BA54415C1E83E00897E82 /* Build configuration list for PBXProject "CustomNC" */ = { 296 | isa = XCConfigurationList; 297 | buildConfigurations = ( 298 | B28BA55A15C1E83E00897E82 /* Debug */, 299 | B28BA55B15C1E83E00897E82 /* Release */, 300 | ); 301 | defaultConfigurationIsVisible = 0; 302 | defaultConfigurationName = Release; 303 | }; 304 | B28BA55C15C1E83E00897E82 /* Build configuration list for PBXNativeTarget "CustomNC" */ = { 305 | isa = XCConfigurationList; 306 | buildConfigurations = ( 307 | B28BA55D15C1E83E00897E82 /* Debug */, 308 | B28BA55E15C1E83E00897E82 /* Release */, 309 | ); 310 | defaultConfigurationIsVisible = 0; 311 | defaultConfigurationName = Release; 312 | }; 313 | /* End XCConfigurationList section */ 314 | }; 315 | rootObject = B28BA54115C1E83E00897E82 /* Project object */; 316 | } 317 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC.xcodeproj/xcshareddata/xcschemes/CustomNC.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/CustomNC-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.5 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.5 25 | NSHumanReadableCopyright 26 | Copyright © 2012-2016 Mahdi Bchetnia. 27 | NSPrincipalClass 28 | CustomNC 29 | SIMBLTargetApplications 30 | 31 | 32 | BundleIdentifier 33 | com.apple.notificationcenterui 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/CustomNC-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CustomNC' target in the 'CustomNC' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/CustomNC.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomNC.h 3 | // CustomNC 4 | // 5 | // Copyright (c) 2012-2016 Mahdi Bchetnia. Licensed under GNU GPL v3.0. See LICENSE for details. 6 | // 7 | 8 | #import 9 | #import 10 | #import 11 | 12 | // OS X 10.8 13 | #import "NCNotificationWindow.h" 14 | #import "NCWindowLayoutController.h" 15 | #import "NCRoundedWindowContentView.h" 16 | #import "NCAppInfo.h" 17 | #import "NCModel.h" 18 | 19 | // OS X 10.9 20 | #import "NCBannerAnimation.h" 21 | #import "NCBannerAnimationVerticalIn.h" 22 | #import "NCBannerAnimationFadeIn.h" 23 | #import "NCBannerAnimationFadeOut.h" 24 | #import "NCBannerAnimationVerticalOut.h" 25 | #import "NCBannerAnimationPoofOut.h" 26 | #import "NCBannerAnimationHorizontalOut.h" 27 | #import "NCBannerWindowController.h" 28 | 29 | @interface CustomNC : NSObject 30 | 31 | + (void)set:(id)obj name:(NSString*)name val:(NSNumber*)val; 32 | - (NSImage*)iconForAppName:(NSString *)appName; 33 | 34 | @end -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/CustomNC.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomNC.m 3 | // CustomNC 4 | // 5 | // Copyright (c) 2012-2016 Mahdi Bchetnia. Licensed under GNU GPL v3.0. See LICENSE for details. 6 | // 7 | 8 | #import "CustomNC.h" 9 | 10 | static CustomNC* plugin = nil; 11 | static BOOL customNCInstalled = NO; 12 | static NSImage* currentAppIcon = nil; 13 | 14 | static BOOL hideIcon = NO; 15 | static BOOL alwaysPulseIcon = NO; 16 | static BOOL fixGrowl = NO; 17 | static BOOL removeAppName = YES; 18 | static double entryAnimationDuration = 0.7; 19 | static NSInteger entryAnimationStyle = 0; 20 | static double exitAnimationDuration = 0.6; 21 | static NSInteger exitAnimationStyle = 0; 22 | static double bannerIdleDuration = 5; 23 | 24 | @implementation NSObject (CustomNC) 25 | 26 | #pragma mark - Entry animation 27 | 28 | #pragma mark -- OS X 10.9+ 29 | 30 | // Entry animation style 31 | + (id)new_animationInWithWindow:(id)arg1 delegate:(id)arg2 animation:(int)arg3 { 32 | // CustomNCUI on 10.9: 0 = Drop, 1 = Fade, 2 = None 33 | // CustomNCUI on 10.10: 0 = Slide, 1 = Fade, 2 = None 34 | // NotificationCenter 10.9: 0 = None, 1 = invalid, 2 = FadeIn, 3 = None, 4 = None, 5 = VerticalIn 35 | // NotificationCenter 10.10: 0 = invalid, 1 = invalid, 2 = FadeIn, 3 = invalid, 4 = invalid, 5 = HorizontalIn 36 | 37 | int style = arg3; 38 | switch (entryAnimationStyle) { 39 | case 0: style = 5; break; 40 | case 1: style = 2; break; 41 | } 42 | 43 | return [self new_animationInWithWindow:arg1 delegate:arg2 animation:style]; 44 | } 45 | 46 | #pragma mark - Idle duration 47 | 48 | #pragma mark -- OS X 10.10+ 49 | 50 | // Banner idle duration 51 | - (void)new__displayNotification:(id)arg1 forApplication:(id)arg2 withUnpresentedCount:(unsigned long long)arg3 animation:(int)arg4 { 52 | if (!customNCInstalled) 53 | { 54 | [CustomNC set:self name:@"_bannerTime" val:[NSNumber numberWithDouble:bannerIdleDuration+entryAnimationDuration]]; 55 | customNCInstalled = YES; 56 | } 57 | 58 | [self new__displayNotification:arg1 forApplication:arg2 withUnpresentedCount:arg3 animation:4]; 59 | } 60 | 61 | #pragma mark - Exit animation 62 | 63 | #pragma mark -- OS X 10.10+ 64 | 65 | // Exit animation style 66 | + (id)new_animationOutWithWindow:(id)arg1 delegate:(id)arg2 animation:(int)style { 67 | // CustomNCUI on 10.10: 0 = Slide, 1 = Fade, 2 = Poof, 3 = None 68 | // NotificationCenter 10.10: 0 = None, 1 = invalid, 2 = FadeOut, 3 = invalid, 4 = PoofOut, 5 = HorizontalOut 69 | 70 | switch (exitAnimationStyle) { 71 | case 0: style = 5; break; 72 | case 1: style = 2; break; 73 | case 2: style = 4; break; 74 | case 3: style = 0; break; 75 | } 76 | 77 | return [self new_animationOutWithWindow:arg1 delegate:arg2 animation:style]; 78 | } 79 | 80 | #pragma mark - Hiding icon 81 | 82 | #pragma mark -- OS X 10.10+ 83 | 84 | // Hiding the icon 85 | - (BOOL)new_updateBodyWidthConstraint { 86 | BOOL result = [self new_updateBodyWidthConstraint]; 87 | 88 | if (!hideIcon) return result; 89 | 90 | NSView* bodyTFContainer = ((NSTextField*)[self performSelector:@selector(bodyTF)]).superview; 91 | NSView* scrollView = bodyTFContainer.superview.superview; 92 | NSView* underMasterView = scrollView.superview; 93 | NSView* masterView = scrollView.superview.superview; 94 | 95 | // Reduce scrollView's left margin from 46 to 8 96 | NSLayoutConstraint* constraintToRemove = nil; 97 | for (NSLayoutConstraint* constraint in masterView.constraints) { 98 | if (constraint.firstItem == scrollView) 99 | { 100 | constraintToRemove = constraint; 101 | break; 102 | } 103 | } 104 | [masterView removeConstraint:constraintToRemove]; 105 | 106 | NSArray* constraintsToAdd = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(8)-[scrollView]" 107 | options:0 108 | metrics:nil 109 | views:@{@"|": masterView, @"scrollView": scrollView}]; 110 | [masterView addConstraints:constraintsToAdd]; 111 | 112 | 113 | // Replace the notification title's constraint 114 | for (NSView* subview in underMasterView.subviews) { 115 | if ([subview isKindOfClass:NSClassFromString(@"NCFadedClipView")]) 116 | { 117 | NSView* fadedClipView = subview; 118 | NSArray* newConstraint = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(11)-[NCFadedClipView]" 119 | options:0 120 | metrics:nil 121 | views:@{@"|": underMasterView, @"NCFadedClipView": fadedClipView}]; 122 | [underMasterView addConstraints:newConstraint]; 123 | 124 | break; 125 | } 126 | } 127 | 128 | for (NSView* subview in masterView.subviews) { 129 | if ([subview isKindOfClass:NSClassFromString(@"NCIdentityImageView")]) 130 | { 131 | // Resize the icon to 0x0 using constraints 132 | NSImageView* identity = (NSImageView*)subview; 133 | [identity removeConstraints:[identity constraints]]; 134 | NSDictionary* views = @{@"image": identity}; 135 | [identity addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[image(0)]" options:0 metrics:nil views:views]]; 136 | [identity addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[image(0)]" options:0 metrics:nil views:views]]; 137 | break; 138 | } 139 | } 140 | 141 | return result; 142 | } 143 | 144 | #pragma mark -- OS X 10.9+ 145 | 146 | - (void)new__setHorizontalMask { 147 | [self new__setHorizontalMask]; 148 | 149 | // Overwrite width with a hardcoded value :( 150 | if (hideIcon) 151 | [(NSView*)self setFrameSize:NSMakeSize(292, ((NSView*)self).frame.size.height)]; 152 | } 153 | 154 | #pragma mark - OS X 10.9+ Banner animations duration 155 | 156 | // Entry animation duration + Exit animation duration 157 | - (id)new_initWithWindow:(id)arg1 type:(int)arg2 delegate:(id)arg3 duration:(double)arg4 transitionType:(int)arg5 { 158 | id result = nil; 159 | 160 | if (arg5 == 1) // Entry animation 161 | result = [self new_initWithWindow:arg1 type:arg2 delegate:arg3 duration:entryAnimationDuration transitionType:arg5]; 162 | else // Exit animation 163 | result = [self new_initWithWindow:arg1 type:arg2 delegate:arg3 duration:exitAnimationDuration transitionType:arg5]; 164 | 165 | return result; 166 | } 167 | 168 | #pragma mark - Fixing Growl 169 | 170 | // Show app icon in Notification Center instead of Growl's and optionally remove the app name 171 | - (void)new_setNote:(NSUserNotification*)note { 172 | if (fixGrowl) 173 | { 174 | if ([[[self performSelector:@selector(app)] performSelector:@selector(bundleIdentifier)] isEqualToString:@"com.Growl.GrowlHelperApp"] 175 | && (!removeAppName || !([[note subtitle] isEqualToString:@""]))) 176 | { 177 | NSString* appName = [note title]; 178 | NSImage* newIcon = [plugin iconForAppName:appName]; 179 | NCAppInfo* app = [self performSelector:@selector(app)]; 180 | 181 | NSString* varName = @"_image"; 182 | currentAppIcon = newIcon; 183 | object_setIvar(app, 184 | class_getInstanceVariable([app class], [varName cStringUsingEncoding:NSUTF8StringEncoding]), 185 | currentAppIcon); 186 | 187 | if (removeAppName) 188 | { 189 | [note setTitle:[note subtitle]]; 190 | [note setSubtitle:@""]; 191 | } 192 | } 193 | } 194 | 195 | [self new_setNote:note]; 196 | } 197 | 198 | @end 199 | 200 | @implementation CustomNC 201 | 202 | #pragma mark - SIMBL methods and loading 203 | 204 | + (CustomNC*)sharedInstance { 205 | if (plugin == nil) 206 | plugin = [[CustomNC alloc] init]; 207 | 208 | return plugin; 209 | } 210 | 211 | + (void)load { 212 | [[CustomNC sharedInstance] loadPlugin]; 213 | [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(gotNewSettings:) name:@"CustomNCUpdateSettings" object:nil]; 214 | 215 | NSLog(@"CustomNC loaded."); 216 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"CustomNCInjected" object:nil]; 217 | } 218 | 219 | + (void)set:(id)obj name:(NSString*)name val:(NSNumber*)val { 220 | // Sanitize val for __NSTaggedDate (only accepts integers passed as double) 221 | NSString* stringVal = [val stringValue]; 222 | double value = 5; 223 | if ([stringVal length] > 3) 224 | stringVal = [stringVal substringToIndex:3]; 225 | 226 | value = [stringVal doubleValue]; 227 | NSInteger tmp = [stringVal integerValue]; 228 | if (value-tmp < 0.5) 229 | value = (double)tmp; 230 | else 231 | value = (double)tmp+1; 232 | 233 | // Needed object 234 | id r = objc_msgSend(NSClassFromString(@"__NSTaggedDate"), @selector(__new:), (double)value); 235 | 236 | // Setting 237 | object_setIvar(obj, class_getInstanceVariable([obj class], [name cStringUsingEncoding:NSUTF8StringEncoding]), r); 238 | } 239 | 240 | - (void)loadPlugin { 241 | [self reloadValues]; 242 | [self swizzle]; 243 | } 244 | 245 | - (void)reloadValues { 246 | NSDictionary* userDefaults = [[[NSUserDefaults alloc] init] persistentDomainForName:@"me.inket.CustomNC"]; 247 | 248 | // Notification icon settings 249 | alwaysPulseIcon = [userDefaults objectForKey:@"alwaysPulseIcon"]?[[userDefaults objectForKey:@"alwaysPulseIcon"] boolValue]:NO; 250 | hideIcon = [userDefaults objectForKey:@"hideIcon"]?[[userDefaults objectForKey:@"hideIcon"] boolValue]:NO; 251 | 252 | // Notification entry animation settings 253 | entryAnimationStyle = [userDefaults objectForKey:@"entryAnimationStyle"]?[[userDefaults objectForKey:@"entryAnimationStyle"] integerValue]:0; 254 | entryAnimationDuration = [userDefaults objectForKey:@"entryAnimationDuration"]?[[userDefaults objectForKey:@"entryAnimationDuration"] doubleValue]:0.7; 255 | if (entryAnimationDuration == 0) 256 | entryAnimationDuration = 0.001; 257 | 258 | // Notification idle settings 259 | bannerIdleDuration = [userDefaults objectForKey:@"bannerIdleDuration"]?[[userDefaults objectForKey:@"bannerIdleDuration"] doubleValue]:5; 260 | 261 | // Notification exit animation settings 262 | exitAnimationStyle = [userDefaults objectForKey:@"exitAnimationStyle"]?[[userDefaults objectForKey:@"exitAnimationStyle"] integerValue]:0; 263 | exitAnimationDuration = [userDefaults objectForKey:@"exitAnimationDuration"]?[[userDefaults objectForKey:@"exitAnimationDuration"] doubleValue]:0.6; 264 | if (exitAnimationDuration == 0) 265 | exitAnimationDuration = 0.001; 266 | 267 | // Growl notifications settings 268 | fixGrowl = [userDefaults objectForKey:@"fixGrowl"]?[[userDefaults objectForKey:@"fixGrowl"] boolValue]:NO; 269 | removeAppName = [userDefaults objectForKey:@"removeAppName"]?[[userDefaults objectForKey:@"removeAppName"] boolValue]:NO; 270 | 271 | customNCInstalled = NO; 272 | } 273 | 274 | - (void)swizzle { 275 | // Fixing Growl 276 | [self swizzle:NSClassFromString(@"NCModel") method:@selector(setNote:)]; 277 | 278 | Class class = NSClassFromString(@"NCBannerAnimation"); 279 | 280 | // Entry animation style 281 | [self swizzle:class classMethod:@selector(animationInWithWindow:delegate:animation:)]; 282 | 283 | // Exit animation style 284 | [self swizzle:class classMethod:@selector(animationOutWithWindow:delegate:animation:)]; 285 | 286 | // Entry animation duration + Exit animation duration 287 | [self swizzle:class method:@selector(initWithWindow:type:delegate:duration:transitionType:)]; 288 | 289 | // Banner idle duration 290 | [self swizzle:NSClassFromString(@"NCWindowLayoutController") 291 | method:@selector(_displayNotification:forApplication:withUnpresentedCount:animation:)]; 292 | 293 | // Hiding the icon 294 | [self swizzle:NSClassFromString(@"NCBannerViewController") method:@selector(updateBodyWidthConstraint)]; 295 | 296 | [self swizzle:NSClassFromString(@"NCAlertScrollView") method:@selector(_setHorizontalMask)]; 297 | } 298 | 299 | - (void)swizzle:(Class)class method:(SEL)oldSelector prefix:(NSString*)prefix { 300 | SEL newSelector = NSSelectorFromString([NSString stringWithFormat:@"new_%@_%@", prefix, NSStringFromSelector(oldSelector)]); 301 | 302 | Method new = class_getInstanceMethod(class, newSelector); 303 | Method old = class_getInstanceMethod(class, oldSelector); 304 | 305 | method_exchangeImplementations(old, new); 306 | } 307 | 308 | - (void)swizzle:(Class)class method:(SEL)oldSelector { 309 | SEL newSelector = NSSelectorFromString([NSString stringWithFormat:@"new_%@", NSStringFromSelector(oldSelector)]); 310 | 311 | Method new = class_getInstanceMethod(class, newSelector); 312 | Method old = class_getInstanceMethod(class, oldSelector); 313 | 314 | method_exchangeImplementations(old, new); 315 | } 316 | 317 | - (void)swizzle:(Class)class classMethod:(SEL)oldSelector prefix:(NSString*)prefix { 318 | SEL newSelector = NSSelectorFromString([NSString stringWithFormat:@"new_%@_%@", prefix, NSStringFromSelector(oldSelector)]); 319 | 320 | Method new = class_getClassMethod(class, newSelector); 321 | Method old = class_getClassMethod(class, oldSelector); 322 | 323 | method_exchangeImplementations(old, new); 324 | } 325 | 326 | - (void)swizzle:(Class)class classMethod:(SEL)oldSelector { 327 | SEL newSelector = NSSelectorFromString([NSString stringWithFormat:@"new_%@", NSStringFromSelector(oldSelector)]); 328 | 329 | Method new = class_getClassMethod(class, newSelector); 330 | Method old = class_getClassMethod(class, oldSelector); 331 | 332 | method_exchangeImplementations(old, new); 333 | } 334 | 335 | - (NSImage*)iconForAppName:(NSString *)appName { 336 | NSWorkspace* workspace = [NSWorkspace sharedWorkspace]; 337 | 338 | NSString* appPath = [workspace fullPathForApplication:appName]; 339 | 340 | if (!appPath) 341 | // Fallback to Growl's icon for network notifications 342 | appPath = [[workspace URLForApplicationWithBundleIdentifier:@"com.Growl.GrowlHelperApp"] path]; 343 | 344 | NSImage* icon = [workspace iconForFile:appPath]; 345 | return icon ? icon : nil; 346 | } 347 | 348 | + (void)gotNewSettings:(NSNotification*)notification { 349 | [[self sharedInstance] reloadValues]; 350 | NSLog(@"Updated CustomNC settings."); 351 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"CustomNCUpdatedSettings" object:nil]; 352 | } 353 | 354 | @end 355 | 356 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCAlertDelegate-Protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | #import "NCNotificationWindowDelegate-Protocol.h" 8 | 9 | @protocol NCAlertDelegate 10 | - (void)alert:(id)arg1 snoozedWithTimeInterval:(double)arg2; 11 | - (void)alertClose:(id)arg1; 12 | - (void)alertPerformActionAndDismiss:(id)arg1; 13 | - (void)alertViewNotification:(id)arg1; 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCAppInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | #import "NCAppInfoDelegate-Protocol.h" 8 | 9 | @class NSArray, NSDictionary, NSImage, NSMutableArray, NSMutableDictionary, NSObject, NSString, NSURL; 10 | 11 | @interface NCAppInfo : NSObject 12 | { 13 | NSString *_name; 14 | NSImage *_image; 15 | NSString *_bundleIdentifier; 16 | BOOL _found; 17 | NSArray *_notifications; 18 | NSMutableArray *_unseenNotifications; 19 | unsigned long long _notificationsToShow; 20 | BOOL _showInNotificationCenter; 21 | BOOL _playSounds; 22 | BOOL _badgeIcons; 23 | BOOL _warnedAboutInvalidIdentity; 24 | unsigned long long _alertStyle; 25 | NSURL *_lastKnownURL; 26 | NSObject *_delivered_timer; 27 | id _delivered_block; 28 | double _sound_last_play_time; 29 | double _lastestNotificationTime; 30 | NSMutableDictionary *_soundDictionary; 31 | id delegate; 32 | id _delegate; 33 | BOOL _needsToFetchData; 34 | } 35 | 36 | @property BOOL needsToFetchData; // @synthesize needsToFetchData=_needsToFetchData; 37 | @property(readonly) BOOL found; // @synthesize found=_found; 38 | @property double lastestNotificationTime; // @synthesize lastestNotificationTime=_lastestNotificationTime; 39 | @property unsigned long long alertStyle; // @synthesize alertStyle=_alertStyle; 40 | @property BOOL playSounds; // @synthesize playSounds=_playSounds; 41 | @property BOOL badgeIcons; // @synthesize badgeIcons=_badgeIcons; 42 | @property BOOL showInNotificationCenter; // @synthesize showInNotificationCenter=_showInNotificationCenter; 43 | @property unsigned long long notificationsToShow; // @synthesize notificationsToShow=_notificationsToShow; 44 | @property(retain, nonatomic) NSArray *notifications; // @synthesize notifications=_notifications; 45 | @property(readonly) NSImage *image; // @synthesize image=_image; 46 | @property(readonly) NSString *bundleIdentifier; // @synthesize bundleIdentifier=_bundleIdentifier; 47 | @property(readonly) NSString *name; // @synthesize name=_name; 48 | @property id delegate; // @synthesize delegate=_delegate; 49 | - (void)clearUnreadNotificationMatching:(id)arg1; 50 | - (void)clearUnreadNotifications; 51 | - (void)setDeliveredActionBlock:(id)arg1; 52 | - (void)playSound:(id)arg1; 53 | - (void)_playSoundWithBlock:(id)arg1; 54 | - (void)lookupInfoInBackgroundOnQueue:(id)arg1; 55 | @property(copy) NSDictionary *preferenceDictionary; 56 | @property(readonly) BOOL clearable; 57 | @property(readonly) NSString *lastKnownPath; 58 | @property(readonly) BOOL hasUnreadNotifications; 59 | - (void)dealloc; 60 | - (id)initWithBundleIdentifier:(id)arg1 lastKnownPath:(id)arg2 loadInfoOnQueue:(id)arg3; 61 | 62 | @end 63 | 64 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCAppInfoDelegate-Protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | @protocol NCAppInfoDelegate 8 | - (void)app:(id)arg1 foundAtLocation:(id)arg2; 9 | - (void)appUnreadNotificationsChanged:(id)arg1; 10 | - (void)appNotFound:(id)arg1; 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerAnimation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. 5 | */ 6 | 7 | @class NCNotificationWindow; 8 | 9 | @interface NCBannerAnimation : NSObject 10 | { 11 | _Bool _invalid; 12 | _Bool _delayCompletion; 13 | int _type; 14 | int _transitionType; 15 | // id _delegate; 16 | NCNotificationWindow *_window; 17 | double _duration; 18 | id _animate_to_block; 19 | id _completed_block; 20 | } 21 | 22 | + (void)setAnimationsDisabled:(BOOL)arg1; 23 | + (BOOL)animationsDisabled; 24 | + (void)runAnimations:(id)arg1 containerView:(id)arg2 withDuration:(double)arg3 animation:(id)arg4 completed:(void)arg5; 25 | + (double)defaultDuration; 26 | + (id)genericAnimationWithWindow:(id)arg1 delegate:(id)arg2; 27 | + (id)animationOutWithWindow:(id)arg1 delegate:(id)arg2 animation:(int)arg3; 28 | + (id)animationInWithWindow:(id)arg1 delegate:(id)arg2 animation:(int)arg3; 29 | @property(readonly) _Bool delayCompletion; // @synthesize delayCompletion=_delayCompletion; 30 | @property(readonly) _Bool invalid; // @synthesize invalid=_invalid; 31 | @property(copy) id completed_block; // @synthesize completed_block=_completed_block; 32 | @property(copy) id animate_to_block; // @synthesize animate_to_block=_animate_to_block; 33 | @property(readonly) int transitionType; // @synthesize transitionType=_transitionType; 34 | @property(readonly) double duration; // @synthesize duration=_duration; 35 | @property(readonly) int type; // @synthesize type=_type; 36 | @property(readonly) NCNotificationWindow *window; // @synthesize window=_window; 37 | //@property __weak id delegate; // @synthesize delegate=_delegate; 38 | //- (void).cxx_destruct; 39 | - (void)completed; 40 | - (void)start; 41 | - (void)setup; 42 | - (void)invalidate; 43 | - (id)initWithWindow:(id)arg1 type:(int)arg2 delegate:(id)arg3 duration:(double)arg4 transitionType:(int)arg5; 44 | 45 | @end 46 | 47 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerAnimationFadeIn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. 5 | */ 6 | 7 | #import "NCBannerAnimation.h" 8 | 9 | @interface NCBannerAnimationFadeIn : NCBannerAnimation 10 | { 11 | } 12 | 13 | - (void)start; 14 | - (void)setup; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerAnimationFadeOut.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. 5 | */ 6 | 7 | #import "NCBannerAnimation.h" 8 | 9 | @interface NCBannerAnimationFadeOut : NCBannerAnimation 10 | { 11 | } 12 | 13 | - (void)completed; 14 | - (void)start; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerAnimationHorizontalOut.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. 5 | */ 6 | 7 | #import "NCBannerAnimation.h" 8 | 9 | @interface NCBannerAnimationHorizontalOut : NCBannerAnimation 10 | { 11 | } 12 | 13 | + (double)defaultDuration; 14 | - (void)start; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerAnimationPoofOut.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. 5 | */ 6 | 7 | #import "NCBannerAnimation.h" 8 | 9 | @interface NCBannerAnimationPoofOut : NCBannerAnimation 10 | { 11 | } 12 | 13 | + (double)defaultDuration; 14 | - (void)start; 15 | - (void)setup; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerAnimationVerticalIn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. 5 | */ 6 | 7 | #import "NCBannerAnimation.h" 8 | 9 | @interface NCBannerAnimationVerticalIn : NCBannerAnimation 10 | { 11 | } 12 | 13 | + (double)defaultDuration; 14 | - (_Bool)delayCompletion; 15 | - (void)setup; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerAnimationVerticalOut.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. 5 | */ 6 | 7 | #import "NCBannerAnimation.h" 8 | 9 | @interface NCBannerAnimationVerticalOut : NCBannerAnimation 10 | { 11 | } 12 | 13 | + (double)defaultDuration; 14 | - (void)completed; 15 | - (void)start; 16 | - (void)setup; 17 | 18 | @end 19 | 20 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerDelegate-Protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | #import "NCNotificationWindowDelegate-Protocol.h" 8 | 9 | @protocol NCBannerDelegate 10 | - (void)bannerAnimatedOut:(id)arg1; 11 | - (void)bannerMoreClicked:(id)arg1; 12 | - (void)bannerCloseClicked:(id)arg1; 13 | - (void)bannerClicked:(id)arg1; 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCBannerWindowController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. 5 | */ 6 | 7 | @interface NCBannerWindowController : NSObject 8 | { 9 | double _dockRightMargin; 10 | } 11 | 12 | @end -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCModel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | #import "QLPreviewItem-Protocol.h" 8 | 9 | @class NCAppInfo, NCWidget, NSString, NSURL, NSUserNotification; 10 | 11 | @interface NCModel : NSObject 12 | { 13 | NCAppInfo *_app; 14 | NSUserNotification *_note; 15 | BOOL _drawsDividerLine; 16 | double _cachedRowHeight; 17 | unsigned long long _notesRepresented; 18 | NCWidget *_widget; 19 | } 20 | 21 | + (id)modelWithApp:(id)arg1 note:(id)arg2; 22 | @property(retain) NCWidget *widget; // @synthesize widget=_widget; 23 | @property unsigned long long notesRepresented; // @synthesize notesRepresented=_notesRepresented; 24 | @property double cachedRowHeight; // @synthesize cachedRowHeight=_cachedRowHeight; 25 | @property BOOL drawsDividerLine; // @synthesize drawsDividerLine=_drawsDividerLine; 26 | @property(retain) NSUserNotification *note; // @synthesize note=_note; 27 | @property(retain) NCAppInfo *app; // @synthesize app=_app; 28 | @property(readonly) NSString *previewItemTitle; 29 | @property(readonly) NSURL *previewItemURL; 30 | - (unsigned long long)hash; 31 | - (BOOL)isEqual:(id)arg1; 32 | - (id)description; 33 | - (void)dealloc; 34 | 35 | // Remaining properties 36 | @property(readonly) id previewItemDisplayState; 37 | 38 | @end 39 | 40 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCNotificationWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | #import "NCRoundedWindowContentDelegate-Protocol.h" 8 | #import "NCNotificationWindowDelegate-Protocol.h" 9 | 10 | @class NCAppInfo, NCBannerViewController, NCModel, NCRoundedWindowContentView, NSLayoutConstraint, NSMutableSet, NSString, NSUserNotification, NSView; 11 | 12 | @interface NCNotificationWindow : NSObject 13 | { 14 | NCBannerViewController *_contentViewController; 15 | NCRoundedWindowContentView *_view; 16 | NSView *_containerView; 17 | NSMutableSet *_constraints; 18 | NSLayoutConstraint *_horizontalLayoutConstraint; 19 | BOOL applicationUpdated; 20 | BOOL _closing; 21 | BOOL _needsLayout; 22 | char *_swipeAnimationCanceled; 23 | BOOL _trackingSwipes; 24 | BOOL _addedObsever; 25 | BOOL _movedAside; 26 | id _delegate; 27 | BOOL _hiddenDueToOverflow; 28 | } 29 | 30 | + (unsigned long long)minNotificationHeight; 31 | + (unsigned long long)maxNotificationHeight; 32 | + (unsigned long long)notificationWidth; 33 | @property(readonly) BOOL needsLayout; // @synthesize needsLayout=_needsLayout; 34 | @property BOOL hiddenDueToOverflow; // @synthesize hiddenDueToOverflow=_hiddenDueToOverflow; 35 | @property(readonly) NSMutableSet *constraints; // @synthesize constraints=_constraints; 36 | @property id delegate; // @synthesize delegate=_delegate; 37 | @property BOOL movedAside; // @synthesize movedAside=_movedAside; 38 | @property(retain) NSLayoutConstraint *horizontalLayoutConstraint; // @synthesize horizontalLayoutConstraint=_horizontalLayoutConstraint; 39 | @property(readonly) NCRoundedWindowContentView *view; // @synthesize view=_view; 40 | @property(readonly) NCBannerViewController *contentViewController; // @synthesize contentViewController=_contentViewController; 41 | - (void)contentView:(id)arg1 velocity:(double)arg2 draggedCompleted:(BOOL)arg3; 42 | - (void)contentView:(id)arg1 dragged:(id)arg2; 43 | - (BOOL)contentView:(id)arg1 dragStarted:(id)arg2; 44 | - (BOOL)contentView:(id)arg1 scrolled:(id)arg2; 45 | - (void)performDropInAnimationWithDuration:(double)arg1 completion:(id)arg2; 46 | - (void)cancelTalkingAlert; 47 | - (void)registerTalkingAlertIfNecessary; 48 | - (void)pulseIcon; 49 | - (void)windowAnimateOutComplete; 50 | - (void)windowAnimateOutStart; 51 | - (void)windowAnimateInComplete; 52 | - (void)dumpLayerTree; 53 | - (void)removeFromView; 54 | - (void)modelDidUpdate; 55 | - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; 56 | - (void)layout; 57 | - (void)_updateViewFromModel; 58 | @property(retain, nonatomic) NCModel *model; 59 | @property(readonly) NCAppInfo *application; 60 | @property(readonly) NSUserNotification *notification; 61 | @property(readonly) BOOL onScreen; 62 | @property(readonly) NSString *accessibilitySubRole; 63 | - (void)dealloc; 64 | - (id)initWithModel:(id)arg1; 65 | 66 | @end 67 | 68 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCNotificationWindowDelegate-Protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | @protocol NCNotificationWindowDelegate 8 | - (void)notificationWindow:(id)arg1 velocity:(double)arg2 draggedCompleted:(BOOL)arg3; 9 | - (void)notificationWindow:(id)arg1 dragged:(id)arg2; 10 | - (BOOL)notificationWindow:(id)arg1 dragStarted:(id)arg2; 11 | - (void)notificationWindowSwipeEnded:(id)arg1 cancelled:(BOOL)arg2; 12 | - (void)notificationWindowSwipeProgressed:(id)arg1 progress:(double)arg2; 13 | - (BOOL)notificationWindowSwipeStarted:(id)arg1 rightToLeft:(BOOL)arg2 withEvent:(id)arg3; 14 | - (BOOL)notificationWindowCanSwipe:(id)arg1 left:(BOOL)arg2; 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCRoundedWindowContentDelegate-Protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | @protocol NCRoundedWindowContentDelegate 8 | 9 | @optional 10 | - (void)contentView:(id)arg1 velocity:(double)arg2 draggedCompleted:(BOOL)arg3; 11 | - (void)contentView:(id)arg1 dragged:(id)arg2; 12 | - (BOOL)contentView:(id)arg1 dragStarted:(id)arg2; 13 | - (void)contentViewLayedOut:(id)arg1; 14 | - (BOOL)contentView:(id)arg1 scrolled:(id)arg2; 15 | - (void)contentViewCloseButtonClicked:(id)arg1; 16 | - (void)contentView:(id)arg1 mouseEntered:(BOOL)arg2; 17 | - (void)contentView:(id)arg1 mouseClicked:(long long)arg2; 18 | @end 19 | 20 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCRoundedWindowContentView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | @class CALayer, NSTrackingArea; 8 | 9 | @interface NCRoundedWindowContentView : NSView 10 | { 11 | CALayer *_backgroundLayer; 12 | double _height; 13 | NSTrackingArea *_dragTrackingArea; 14 | double _lastDragDeltaX; 15 | BOOL _dragStartedLeft; 16 | BOOL _wasAcceptingMouseEvents; 17 | BOOL _mouseDownInView; 18 | BOOL _dragging; 19 | BOOL _delegateSupportsClick; 20 | BOOL _delegateSupportsEnterExit; 21 | BOOL _delegateSupportsCloseButton; 22 | BOOL _delegateSupportsScroll; 23 | BOOL _delegateSupportsDragging; 24 | BOOL _delegateSupportsLayout; 25 | BOOL _setupLayer; 26 | BOOL _contentHidden; 27 | id _delegate; 28 | } 29 | 30 | @property(nonatomic) id delegate; // @synthesize delegate=_delegate; 31 | @property(nonatomic) BOOL contentHidden; // @synthesize contentHidden=_contentHidden; 32 | - (void)_closeButtonPressed:(id)arg1; 33 | - (void)accessibilityPerformAction:(id)arg1; 34 | - (id)accessibilityActionDescription:(id)arg1; 35 | - (id)accessibilityActionNames; 36 | - (id)accessibilityAttributeValue:(id)arg1; 37 | - (BOOL)accessibilityIsIgnored; 38 | - (void)scrollWheel:(id)arg1; 39 | - (void)mouseUp:(id)arg1; 40 | - (void)mouseDragged:(id)arg1; 41 | - (void)mouseDown:(id)arg1; 42 | - (void)updateLayer; 43 | - (void)setFrameSize:(struct CGSize)arg1; 44 | - (void)layout; 45 | - (void)_updateBackgroundLayer; 46 | - (BOOL)isOpaque; 47 | - (BOOL)wantsUpdateLayer; 48 | - (BOOL)isFlipped; 49 | - (void)awakeFromNib; 50 | - (void)dealloc; 51 | - (id)initWithFrame:(struct CGRect)arg1; 52 | 53 | @end 54 | 55 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCWindowLayoutController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | #import "NCAlertDelegate-Protocol.h" 8 | #import "NCBannerDelegate-Protocol.h" 9 | #import "NCWindowLayoutDelegate-Protocol.h" 10 | 11 | @class NCAlert, NCBanner, NCModel, NSMutableArray, NSMutableDictionary, NSMutableSet, NSObject, NSTrackingArea, NSView, NSWindow, _NCAlertsAndBannersWindow; 12 | 13 | @interface NCWindowLayoutController : NSObject 14 | { 15 | struct CGRect _visibleRect; 16 | struct CGRect _screenRect; 17 | _NCAlertsAndBannersWindow *_window; 18 | NSView *_contentView; 19 | BOOL _needsLayout; 20 | NSMutableArray *_verticalConstraints; 21 | long long _windowRaisedCount; 22 | NSTrackingArea *_windowTrackingArea; 23 | NSMutableArray *_alerts; 24 | NSMutableSet *_windowsToRemoveOnNextLayout; 25 | NSMutableDictionary *_alertsPerApplication; 26 | NSMutableArray *_overflowAlerts; 27 | NCAlert *_keyAlert; 28 | BOOL _restoringAlerts; 29 | double _bannerTime; 30 | NSMutableArray *_bannerQueue; 31 | double _currentBannerTime; 32 | NCBanner *_currentBanner; 33 | NCModel *_pendingBanner; 34 | NSObject *_banner_timer; 35 | NSObject *_banner_performance_timer; 36 | struct CGPoint _lastMousePosition; 37 | unsigned long long _ignoredBanners; 38 | double _dropDownAnimationDuration; 39 | double _leftColumnConstraintConstant; 40 | double _rightColumnConstraintConstant; 41 | NSObject *_alert_move_timer; 42 | double _alertMoveTime; 43 | BOOL _windowBeingSwiped; 44 | BOOL _alertsDisabled; 45 | BOOL _allowDragToLeft; 46 | id _delegate; 47 | BOOL _centerOpen; 48 | } 49 | 50 | @property(nonatomic) BOOL alertsDisabled; // @synthesize alertsDisabled=_alertsDisabled; 51 | @property(nonatomic) BOOL centerOpen; // @synthesize centerOpen=_centerOpen; 52 | @property(readonly) NSWindow *window; // @synthesize window=_window; 53 | @property id delegate; // @synthesize delegate=_delegate; 54 | - (void)alert:(id)arg1 snoozedWithTimeInterval:(double)arg2; 55 | - (void)alertClose:(id)arg1; 56 | - (void)alertPerformActionAndDismiss:(id)arg1; 57 | - (void)alertViewNotification:(id)arg1; 58 | - (void)bannerAnimatedOut:(id)arg1; 59 | - (void)bannerMoreClicked:(id)arg1; 60 | - (void)bannerCloseClicked:(id)arg1; 61 | - (void)bannerClicked:(id)arg1; 62 | - (void)notificationWindow:(id)arg1 velocity:(double)arg2 draggedCompleted:(BOOL)arg3; 63 | - (void)notificationWindow:(id)arg1 dragged:(id)arg2; 64 | - (BOOL)notificationWindow:(id)arg1 dragStarted:(id)arg2; 65 | - (void)notificationWindowSwipeEnded:(id)arg1 cancelled:(BOOL)arg2; 66 | - (void)notificationWindowSwipeProgressed:(id)arg1 progress:(double)arg2; 67 | - (BOOL)notificationWindowSwipeStarted:(id)arg1 rightToLeft:(BOOL)arg2 withEvent:(id)arg3; 68 | - (BOOL)notificationWindowCanSwipe:(id)arg1 left:(BOOL)arg2; 69 | - (void)_lockAnimatingOutViewYPosition:(id)arg1; 70 | - (void)animateOutSlide:(id)arg1 duration:(double)arg2; 71 | - (void)animateOutFade:(id)arg1 duration:(double)arg2; 72 | - (void)animateInFade:(id)arg1 duration:(double)arg2; 73 | - (void)animateInDrop:(id)arg1 duration:(double)arg2; 74 | - (void)_animateDuration:(double)arg1 identifier:(id)arg2 withAnimation:(id)arg3 completion:(void)arg4; 75 | - (void)_addWindow:(id)arg1 startsHidden:(BOOL)arg2; 76 | - (void)startWatchingMouseToMoveAlertsBack; 77 | - (void)mouseExited:(id)arg1; 78 | - (void)_checkMousePosition; 79 | - (void)mouseEntered:(id)arg1; 80 | - (void)createTrackingArea; 81 | - (void)removeTrackingArea; 82 | - (void)_orderWindowOnIfNecessary; 83 | - (void)_orderWindowOutIfNecessary; 84 | - (void)_fixupWindowOrder:(id)arg1; 85 | - (void)_verticalLayout; 86 | - (struct CGRect)_windowFrame; 87 | - (void)_animateAlertOff:(id)arg1 poof:(BOOL)arg2 slide:(BOOL)arg3; 88 | - (void)_removeAlert:(id)arg1; 89 | - (void)_addAlert:(id)arg1; 90 | - (id)_alertMatchingAlert:(id)arg1 forApplication:(id)arg2; 91 | - (void)_presentAlert:(id)arg1; 92 | - (void)_dismissAndReleaseBanner:(id)arg1; 93 | - (void)_actuallyDisplayBanner:(id)arg1 inPlace:(BOOL)arg2; 94 | - (void)_presentBanner:(id)arg1 withUnpresentedCount:(unsigned long long)arg2; 95 | - (void)debugDump:(id)arg1; 96 | - (BOOL)switchKeyNotification:(BOOL)arg1; 97 | - (BOOL)canSwitchKeyNotifications; 98 | - (void)layoutWindowForScreenRect:(struct CGRect)arg1 visibleRect:(struct CGRect)arg2; 99 | - (void)needsLayout; 100 | - (void)layout; 101 | - (void)removeAllDisplayedNotificationsForApplication:(id)arg1; 102 | - (void)removeDisplayedNotification:(id)arg1 forApplication:(id)arg2; 103 | - (void)restoreDisplayedNotifications:(id)arg1 forApplication:(id)arg2; 104 | - (void)displayNotification:(id)arg1 forApplication:(id)arg2 withUnpresentedCount:(unsigned long long)arg3; 105 | - (void)dealloc; 106 | - (id)initWithScreenFrame:(struct CGRect)arg1 andVisibleFrame:(struct CGRect)arg2 spaces:(struct __CFArray *)arg3; 107 | 108 | @end 109 | 110 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/NCWindowLayoutDelegate-Protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | @protocol NCWindowLayoutDelegate 8 | - (void)windowLayout:(id)arg1 showNotificationInCenter:(id)arg2; 9 | @end 10 | 11 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/QLPreviewItem-Protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.4 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. 5 | */ 6 | 7 | @class NSString, NSURL; 8 | 9 | @protocol QLPreviewItem 10 | @property(readonly) NSURL *previewItemURL; 11 | 12 | @optional 13 | @property(readonly) id previewItemDisplayState; 14 | @property(readonly) NSString *previewItemTitle; 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNC/CustomNC/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNCLauncher.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AMIsApplet 6 | 7 | AMStayOpen 8 | 9 | BuildMachineOSBuild 10 | 12A251 11 | CFBundleDevelopmentRegion 12 | English 13 | CFBundleDocumentTypes 14 | 15 | 16 | CFBundleTypeExtensions 17 | 18 | * 19 | 20 | CFBundleTypeName 21 | Automator workflow file 22 | CFBundleTypeOSTypes 23 | 24 | **** 25 | 26 | CFBundleTypeRole 27 | Viewer 28 | 29 | 30 | CFBundleExecutable 31 | Application Stub 32 | CFBundleIconFile 33 | icon.icns 34 | CFBundleIdentifier 35 | com.apple.automator.CustomNC 36 | CFBundleInfoDictionaryVersion 37 | 6.0 38 | CFBundleName 39 | CustomNC 40 | CFBundlePackageType 41 | APPL 42 | CFBundleShortVersionString 43 | 1.1.1 44 | CFBundleSignature 45 | ???? 46 | CFBundleURLTypes 47 | 48 | CFBundleVersion 49 | 346 50 | DTCompiler 51 | com.apple.compilers.llvm.clang.1_0 52 | DTPlatformBuild 53 | 4F212 54 | DTPlatformVersion 55 | GM 56 | DTSDKBuild 57 | 12A251 58 | DTSDKName 59 | 60 | DTXcode 61 | 0440 62 | DTXcodeBuild 63 | 4F212 64 | LSMinimumSystemVersion 65 | 10.5 66 | LSMinimumSystemVersionByArchitecture 67 | 68 | x86_64 69 | 10.6 70 | 71 | LSUIElement 72 | 73 | NSAppleScriptEnabled 74 | YES 75 | NSMainNibFile 76 | ApplicationStub 77 | NSPrincipalClass 78 | NSApplication 79 | NSServices 80 | 81 | UTExportedTypeDeclarations 82 | 83 | UTImportedTypeDeclarations 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /CustomNCUI/CustomNCLauncher.app/Contents/MacOS/Application Stub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inket/CustomNC/a37c83e1f186ce8b58704126ddb558689fd4d0c5/CustomNCUI/CustomNCLauncher.app/Contents/MacOS/Application Stub -------------------------------------------------------------------------------- /CustomNCUI/CustomNCLauncher.app/Contents/Resources/English.lproj/ApplicationStub.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inket/CustomNC/a37c83e1f186ce8b58704126ddb558689fd4d0c5/CustomNCUI/CustomNCLauncher.app/Contents/Resources/English.lproj/ApplicationStub.nib -------------------------------------------------------------------------------- /CustomNCUI/CustomNCLauncher.app/Contents/Resources/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inket/CustomNC/a37c83e1f186ce8b58704126ddb558689fd4d0c5/CustomNCUI/CustomNCLauncher.app/Contents/Resources/icon.icns -------------------------------------------------------------------------------- /CustomNCUI/CustomNCLauncher.app/Contents/document.wflow: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AMApplicationBuild 6 | 346 7 | AMApplicationVersion 8 | 2.3 9 | AMDocumentVersion 10 | 2 11 | actions 12 | 13 | 14 | action 15 | 16 | AMAccepts 17 | 18 | Container 19 | List 20 | Optional 21 | 22 | Types 23 | 24 | com.apple.applescript.object 25 | 26 | 27 | AMActionVersion 28 | 1.0.2 29 | AMApplication 30 | 31 | Automator 32 | 33 | AMParameterProperties 34 | 35 | source 36 | 37 | 38 | AMProvides 39 | 40 | Container 41 | List 42 | Types 43 | 44 | com.apple.applescript.object 45 | 46 | 47 | ActionBundlePath 48 | /System/Library/Automator/Run AppleScript.action 49 | ActionName 50 | Run AppleScript 51 | ActionParameters 52 | 53 | source 54 | on run {input, parameters} tell application id "com.apple.notificationcenterui" inject SIMBL into Snow Leopard end tell return input end run 55 | 56 | BundleIdentifier 57 | com.apple.Automator.RunScript 58 | CFBundleVersion 59 | 1.0.2 60 | CanShowSelectedItemsWhenRun 61 | 62 | CanShowWhenRun 63 | 64 | Category 65 | 66 | AMCategoryUtilities 67 | 68 | Class Name 69 | RunScriptAction 70 | IgnoresInput 71 | 72 | InputUUID 73 | C0AD172B-2C50-4C1F-B476-01BD5ECF2560 74 | Keywords 75 | 76 | Run 77 | 78 | OutputUUID 79 | DD25463A-948E-46EB-86C6-424B405210E8 80 | UUID 81 | 48ACF25A-D3B1-4A51-821B-457E3BCE2D3B 82 | UnlocalizedApplications 83 | 84 | Automator 85 | 86 | arguments 87 | 88 | 0 89 | 90 | default value 91 | on run {input, parameters} 92 | 93 | (* Your script goes here *) 94 | 95 | return input 96 | end run 97 | name 98 | source 99 | required 100 | 0 101 | type 102 | 0 103 | uuid 104 | 0 105 | 106 | 107 | isViewVisible 108 | 109 | location 110 | 309.500000:496.000000 111 | nibPath 112 | /System/Library/Automator/Run AppleScript.action/Contents/Resources/English.lproj/main.nib 113 | 114 | isViewVisible 115 | 116 | 117 | 118 | connectors 119 | 120 | workflowMetaData 121 | 122 | workflowTypeIdentifier 123 | com.apple.Automator.application 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /CustomNCUI/LoginItem.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface LoginItem : NSObject { 4 | 5 | } 6 | 7 | + (void)addLoginItem; 8 | + (void)removeLoginItem; 9 | + (BOOL)loginItemExists; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /CustomNCUI/LoginItem.m: -------------------------------------------------------------------------------- 1 | #import "LoginItem.h" 2 | 3 | @implementation LoginItem 4 | 5 | + (void)addLoginItem { 6 | NSString * appPath = [[NSBundle mainBundle] pathForResource:@"CustomNCLauncher" ofType:@"app"]; 7 | 8 | // This will retrieve the path for the application 9 | // For example, /Applications/test.app 10 | NSURL* url = [NSURL fileURLWithPath:appPath]; 11 | 12 | // Create a reference to the shared file list. 13 | // We are adding it to the current user only. 14 | // If we want to add it all users, use 15 | // kLSSharedFileListGlobalLoginItems instead of 16 | //kLSSharedFileListSessionLoginItems 17 | LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL); 18 | 19 | if (loginItems) { 20 | //Insert an item to the list. 21 | NSDictionary *properties = [NSDictionary 22 | dictionaryWithObject:[NSNumber numberWithBool:YES] 23 | forKey:@"com.apple.loginitem.HideOnLaunch"]; 24 | 25 | LSSharedFileListItemRef item = LSSharedFileListInsertItemURL(loginItems, 26 | kLSSharedFileListItemLast, NULL, NULL, 27 | (__bridge CFURLRef)url, (__bridge CFDictionaryRef)properties, NULL); 28 | if (item){ 29 | CFRelease(item); 30 | } 31 | } 32 | 33 | if (loginItems) CFRelease(loginItems); 34 | } 35 | 36 | + (void)removeLoginItem { 37 | NSString * appPath = [[NSBundle mainBundle] pathForResource:@"CustomNCLauncher" ofType:@"app"]; 38 | 39 | // This will retrieve the path for the application 40 | // For example, /Applications/test.app 41 | NSURL* url = [NSURL fileURLWithPath:appPath]; 42 | 43 | // Create a reference to the shared file list. 44 | LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL); 45 | 46 | if (loginItems) { 47 | UInt32 seedValue; 48 | //Retrieve the list of Login Items and cast them to 49 | // a NSArray so that it will be easier to iterate. 50 | NSArray *loginItemsArray = (__bridge NSArray *)LSSharedFileListCopySnapshot(loginItems, &seedValue); 51 | 52 | for(int i=0 ; i< [loginItemsArray count]; i++){ 53 | LSSharedFileListItemRef itemRef = (__bridge LSSharedFileListItemRef)[loginItemsArray 54 | objectAtIndex:i]; 55 | //Resolve the item with URL 56 | CFURLRef newUrl = (__bridge CFURLRef)url; 57 | if (LSSharedFileListItemResolve(itemRef, 0, &newUrl, NULL) == noErr) { 58 | NSString *urlPath = [(__bridge NSURL*)newUrl path]; 59 | if ([urlPath isEqualToString:appPath]){ 60 | LSSharedFileListItemRemove(loginItems, itemRef); 61 | } 62 | } 63 | 64 | } 65 | } 66 | 67 | if (loginItems) CFRelease(loginItems); 68 | } 69 | 70 | + (BOOL)loginItemExists { 71 | BOOL found = NO; 72 | NSString * appPath = [[NSBundle mainBundle] pathForResource:@"CustomNCLauncher" ofType:@"app"]; 73 | 74 | // This will retrieve the path for the application 75 | // For example, /Applications/test.app 76 | NSURL* url = [NSURL fileURLWithPath:appPath]; 77 | 78 | // Create a reference to the shared file list. 79 | LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL); 80 | 81 | if (loginItems) { 82 | UInt32 seedValue; 83 | //Retrieve the list of Login Items and cast them to 84 | // a NSArray so that it will be easier to iterate. 85 | NSArray *loginItemsArray = (__bridge NSArray *)LSSharedFileListCopySnapshot(loginItems, &seedValue); 86 | 87 | for(int i=0 ; i< [loginItemsArray count]; i++){ 88 | LSSharedFileListItemRef itemRef = (__bridge LSSharedFileListItemRef)[loginItemsArray 89 | objectAtIndex:i]; 90 | //Resolve the item with URL 91 | CFURLRef newUrl = (__bridge CFURLRef)url; 92 | if (LSSharedFileListItemResolve(itemRef, 0, &newUrl, NULL) == noErr) { 93 | NSString * urlPath = [(__bridge NSURL*)newUrl path]; 94 | if ([urlPath isEqualToString:appPath]){ 95 | found = YES; 96 | } 97 | } 98 | } 99 | } 100 | 101 | if (loginItems) CFRelease(loginItems); 102 | return found; 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /CustomNCUI/MBSlider.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBSlider.h 3 | // CustomNC 4 | // 5 | // Copyright (c) 2012-2016 Mahdi Bchetnia. Licensed under GNU GPL v3.0. See LICENSE for details. 6 | // 7 | 8 | #import 9 | 10 | @interface MBSlider : NSSlider 11 | 12 | @property (assign) NSInteger maxDigits; 13 | @property (assign) IBOutlet NSTextField* valueLabel; 14 | @property (assign, nonatomic) NSString* formatString; 15 | 16 | - (NSString*)formatString; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /CustomNCUI/MBSlider.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBSlider.m 3 | // CustomNC 4 | // 5 | // Copyright (c) 2012-2016 Mahdi Bchetnia. Licensed under GNU GPL v3.0. See LICENSE for details. 6 | // 7 | 8 | #import "MBSlider.h" 9 | 10 | @implementation MBSlider 11 | 12 | @synthesize valueLabel = _valueLabel; 13 | @synthesize formatString = _formatString; 14 | 15 | - (void)setDoubleValue:(double)aDouble { 16 | [super setDoubleValue:aDouble]; 17 | [_valueLabel setStringValue:[self formatString]]; 18 | } 19 | 20 | - (NSString*)stringValue { 21 | NSString* str = [super stringValue]; 22 | 23 | if ([str length] > _maxDigits) 24 | str = [str substringToIndex:_maxDigits]; 25 | 26 | if ([str hasSuffix:@".0"] || [str hasSuffix:@".00"]) 27 | { 28 | str = [str stringByReplacingOccurrencesOfString:@".00" withString:@""]; 29 | str = [str stringByReplacingOccurrencesOfString:@".0" withString:@""]; 30 | } 31 | 32 | return str; 33 | } 34 | 35 | - (NSString*)formatString { 36 | return [NSString stringWithFormat:_formatString, [self stringValue], [[self stringValue] doubleValue]==1?@"":@"s"]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /CustomNCUI/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1265 2 | {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \paperw11900\paperh16840\vieww9600\viewh8400\viewkind0 5 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc 6 | {\field{\*\fldinst{HYPERLINK "http://bch.us.to/apps/customnc"}}{\fldrslt 7 | \f0\fs28 \cf0 bch.us.to/apps/customnc}} 8 | \f0\fs28 \ 9 | \ 10 | {\field{\*\fldinst{HYPERLINK "https://github.com/inket/CustomNC"}}{\fldrslt github.com/inket/CustomNC}}} -------------------------------------------------------------------------------- /CustomNCUI/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CustomNCUI/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CustomNCUI 4 | // 5 | // Copyright (c) 2012-2016 Mahdi Bchetnia. Licensed under GNU GPL v3.0. See LICENSE for details. 6 | // 7 | 8 | #import 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | return NSApplicationMain(argc, (const char **)argv); 13 | } 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Mahdi Bchetnia 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | See http://www.gnu.org/licenses/gpl-3.0.txt for details. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## CustomNC 2 | 3 | 4 | 5 | **Original description** 6 | 7 | When Mountain Lion came out and I had to switch to Notification Centre from Growl (in an effort to reduce redundancy), I kind of missed the control I had over how notifications are displayed. Especially banners, which seemed to stay on screen for an unnecessary long time. 8 | 9 | So I came up with this. 10 | 11 | Essentially, it's an app to personalise your Notification Centre banners and alerts. It's risk-free, easy to setup and uninstalls with a single click. 12 | 13 | What it does behind the scenes is: 14 | 15 | - Install a SIMBL plugin and gives it your parameters 16 | 17 | **Mavericks update** 18 | 19 | Apple changed LOTS of things in Notification Center with Mavericks. As you can see in CustomNC.m, the only thing that didn't require a rewrite is the bit relating to Growl. It's why this update took so much time. 20 | 21 | Please note that the icon pulse and the Poof exit animation options were removed/disabled from Notification Center and can't be selected in CustomNC anymore. On the upper hand, they gave us a new exit animation, "Raise", which is pretty cool. 22 | 23 | **Yosemite update** 24 | 25 | Apple didn't change much so updating the app was pretty easy and straightforward but this time around they took away the "Raise" animation and put back "Poof". Why can't we have both ? 26 | 27 | **El Capitan update** 28 | 29 | Notification Center didn't change that much so this update is more about supporting new locations for SIMBL. 30 | 31 | #### Requirements 32 | 33 | - SIMBL (install easily with [mySIMBL](https://github.com/w0lfschild/mySIMBL)) 34 | 35 | #### Download 36 | 37 | [Download here!](https://github.com/inket/CustomNC/releases) 38 | 39 | #### Changelog 40 | 41 | ###### 1.5 42 | - Dropped EasySIMBL support. 43 | - Dropped support for Mavericks and older. 44 | - Added support for El Capitan & Yosemite 10.10.4+ 45 | - Codesigned. 46 | 47 | ###### 1.4 48 | - Added support for Yosemite. 49 | 50 | ###### 1.3 51 | - Added support for Mavericks. 52 | - Settings are now applied instantly instead of re-injecting the plug-in each time. 53 | 54 | ###### 1.2 55 | - Growl: network notifications will have Growl's icon instead of a random app icon 56 | - Fixed *Notify* button not working in some cases 57 | - Sharing on Github! 58 | 59 | ###### 1.1.1 60 | - Added EasySIMBL support & ability to test Growl notifications 61 | 62 | ###### 1.1 63 | - Now with Growl enhancements! 64 | 65 | #### License 66 | This program is licensed under GNU GPL v3.0 (see LICENSE) 67 | --------------------------------------------------------------------------------