├── .gitignore ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── assets ├── MacGap.app │ └── Contents │ │ ├── Frameworks │ │ └── Growl.framework │ │ │ ├── Growl │ │ │ ├── Headers │ │ │ ├── Resources │ │ │ └── Versions │ │ │ ├── A │ │ │ ├── Growl │ │ │ ├── Headers │ │ │ │ ├── Growl.h │ │ │ │ ├── GrowlApplicationBridge.h │ │ │ │ └── GrowlDefines.h │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ │ └── Current │ │ ├── Info.plist │ │ ├── MacOS │ │ └── MacGap │ │ ├── PkgInfo │ │ └── Resources │ │ ├── application.icns │ │ ├── en.lproj │ │ ├── Credits.rtf │ │ ├── InfoPlist.strings │ │ ├── MainMenu.nib │ │ └── Window.nib │ │ └── public │ │ └── index.html └── index.html ├── bin └── macgap ├── macgap.gemspec └── test └── public └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | .bundle 3 | Gemfile.lock 4 | pkg/* 5 | .DS_Store 6 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | 3 | # Specify your gem's dependencies in macgap-rb.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Alex MacCaw (info@eribium.org) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MacGap generator 2 | 3 | MacGap is a lightweight WebKit wrapper for HTML apps, allowing you to distribute web applications as desktop apps. 4 | 5 | For more information on MacGap, please see [its repository](http://github.com/maccman/macgap). 6 | 7 | # Usage 8 | 9 | gem install macgap 10 | 11 | # macgap new DIR 12 | # macgap build DIR 13 | 14 | For example, to create a new MacGap app use the `new` command: 15 | 16 | macgap new MyApp 17 | 18 | To build a MacGap app use the `build` command, specifying the app's directory. 19 | 20 | macgap build MyApp 21 | 22 | # Advanced 23 | 24 | Or a more advanced example: 25 | 26 | macgap build --name MyApp --output ./build ./public 27 | 28 | The directory (`DIR`) you specify should contain a file called `index.html` which will be loaded when the application starts. 29 | 30 | # Icon 31 | 32 | If the your application's root directory contains a file called `application.png`, that'll be used as the application's icon. -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Growl: -------------------------------------------------------------------------------- 1 | Versions/Current/Growl -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Versions/A/Growl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccman/macgap-rb/ce80848be03dc1f345a57e693dd814767a52211b/assets/MacGap.app/Contents/Frameworks/Growl.framework/Versions/A/Growl -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Versions/A/Headers/Growl.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef __OBJC__ 4 | # include 5 | #endif 6 | -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // GrowlApplicationBridge.h 3 | // Growl 4 | // 5 | // Created by Evan Schoenberg on Wed Jun 16 2004. 6 | // Copyright 2004-2006 The Growl Project. All rights reserved. 7 | // 8 | 9 | /*! 10 | * @header GrowlApplicationBridge.h 11 | * @abstract Defines the GrowlApplicationBridge class. 12 | * @discussion This header defines the GrowlApplicationBridge class as well as 13 | * the GROWL_PREFPANE_BUNDLE_IDENTIFIER constant. 14 | */ 15 | 16 | #ifndef __GrowlApplicationBridge_h__ 17 | #define __GrowlApplicationBridge_h__ 18 | 19 | #import 20 | #import 21 | #import 22 | 23 | //Forward declarations 24 | @protocol GrowlApplicationBridgeDelegate; 25 | 26 | //------------------------------------------------------------------------------ 27 | #pragma mark - 28 | 29 | /*! 30 | * @class GrowlApplicationBridge 31 | * @abstract A class used to interface with Growl. 32 | * @discussion This class provides a means to interface with Growl. 33 | * 34 | * Currently it provides a way to detect if Growl is installed and launch the 35 | * GrowlHelperApp if it's not already running. 36 | */ 37 | @interface GrowlApplicationBridge : NSObject { 38 | 39 | } 40 | 41 | /*! 42 | * @method isGrowlInstalled 43 | * @abstract Detects whether Growl is installed. 44 | * @discussion Determines if the Growl prefpane and its helper app are installed. 45 | * @result this method will forever return YES. 46 | */ 47 | + (BOOL) isGrowlInstalled __attribute__((deprecated)); 48 | 49 | /*! 50 | * @method isGrowlRunning 51 | * @abstract Detects whether GrowlHelperApp is currently running. 52 | * @discussion Cycles through the process list to find whether GrowlHelperApp is running and returns its findings. 53 | * @result Returns YES if GrowlHelperApp is running, NO otherwise. 54 | */ 55 | + (BOOL) isGrowlRunning; 56 | 57 | 58 | /*! 59 | * @method isMistEnabled 60 | * @abstract Gives the caller a fairly good indication of whether or not built-in notifications(Mist) will be used. 61 | * @discussion since this call makes use of isGrowlRunning it is entirely possible for this value to change between call and 62 | * executing a notification dispatch 63 | * @result Returns YES if Growl isn't reachable and the developer has not opted-out of 64 | * Mist and the user hasn't set the global mist enable key to false. 65 | */ 66 | + (BOOL)isMistEnabled; 67 | 68 | /*! 69 | * @method setShouldUseBuiltInNotifications 70 | * @abstract opt-out mechanism for the mist notification style in the event growl can't be reached. 71 | * @discussion if growl is unavailable due to not being installed or as a result of being turned off then 72 | * this option can enable/disable a built-in fire and forget display style 73 | * @param should Specifies whether or not the developer wants to opt-in (default) or opt out 74 | * of the built-in Mist style in the event Growl is unreachable. 75 | */ 76 | + (void)setShouldUseBuiltInNotifications:(BOOL)should; 77 | 78 | /*! 79 | * @method shouldUseBuiltInNotifications 80 | * @abstract returns the current opt-in state of the framework's use of the Mist display style. 81 | * @result Returns NO if the developer opt-ed out of Mist, the default value is YES. 82 | */ 83 | + (BOOL)shouldUseBuiltInNotifications; 84 | 85 | #pragma mark - 86 | 87 | /*! 88 | * @method setGrowlDelegate: 89 | * @abstract Set the object which will be responsible for providing and receiving Growl information. 90 | * @discussion This must be called before using GrowlApplicationBridge. 91 | * 92 | * The methods in the GrowlApplicationBridgeDelegate protocol are required 93 | * and return the basic information needed to register with Growl. 94 | * 95 | * The methods in the GrowlApplicationBridgeDelegate_InformalProtocol 96 | * informal protocol are individually optional. They provide a greater 97 | * degree of interaction between the application and growl such as informing 98 | * the application when one of its Growl notifications is clicked by the user. 99 | * 100 | * The methods in the GrowlApplicationBridgeDelegate_Installation_InformalProtocol 101 | * informal protocol are individually optional and are only applicable when 102 | * using the Growl-WithInstaller.framework which allows for automated Growl 103 | * installation. 104 | * 105 | * When this method is called, data will be collected from inDelegate, Growl 106 | * will be launched if it is not already running, and the application will be 107 | * registered with Growl. 108 | * 109 | * If using the Growl-WithInstaller framework, if Growl is already installed 110 | * but this copy of the framework has an updated version of Growl, the user 111 | * will be prompted to update automatically. 112 | * 113 | * @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol. 114 | */ 115 | + (void) setGrowlDelegate:(NSObject *)inDelegate; 116 | 117 | /*! 118 | * @method growlDelegate 119 | * @abstract Return the object responsible for providing and receiving Growl information. 120 | * @discussion See setGrowlDelegate: for details. 121 | * @result The Growl delegate. 122 | */ 123 | + (NSObject *) growlDelegate; 124 | 125 | #pragma mark - 126 | 127 | /*! 128 | * @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext: 129 | * @abstract Send a Growl notification. 130 | * @discussion This is the preferred means for sending a Growl notification. 131 | * The notification name and at least one of the title and description are 132 | * required (all three are preferred). All other parameters may be 133 | * nil (or 0 or NO as appropriate) to accept default values. 134 | * 135 | * If using the Growl-WithInstaller framework, if Growl is not installed the 136 | * user will be prompted to install Growl. If the user cancels, this method 137 | * will have no effect until the next application session, at which time when 138 | * it is called the user will be prompted again. The user is also given the 139 | * option to not be prompted again. If the user does choose to install Growl, 140 | * the requested notification will be displayed once Growl is installed and 141 | * running. 142 | * 143 | * @param title The title of the notification displayed to the user. 144 | * @param description The full description of the notification displayed to the user. 145 | * @param notifName The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane. 146 | * @param iconData NSData object to show with the notification as its icon. If nil, the application's icon will be used instead. 147 | * @param priority The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority. 148 | * @param isSticky If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications. 149 | * @param clickContext A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of NSString, NSArray, NSNumber, NSDictionary, and NSData types). 150 | */ 151 | + (void) notifyWithTitle:(NSString *)title 152 | description:(NSString *)description 153 | notificationName:(NSString *)notifName 154 | iconData:(NSData *)iconData 155 | priority:(signed int)priority 156 | isSticky:(BOOL)isSticky 157 | clickContext:(id)clickContext; 158 | 159 | /*! 160 | * @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier: 161 | * @abstract Send a Growl notification. 162 | * @discussion This is the preferred means for sending a Growl notification. 163 | * The notification name and at least one of the title and description are 164 | * required (all three are preferred). All other parameters may be 165 | * nil (or 0 or NO as appropriate) to accept default values. 166 | * 167 | * If using the Growl-WithInstaller framework, if Growl is not installed the 168 | * user will be prompted to install Growl. If the user cancels, this method 169 | * will have no effect until the next application session, at which time when 170 | * it is called the user will be prompted again. The user is also given the 171 | * option to not be prompted again. If the user does choose to install Growl, 172 | * the requested notification will be displayed once Growl is installed and 173 | * running. 174 | * 175 | * @param title The title of the notification displayed to the user. 176 | * @param description The full description of the notification displayed to the user. 177 | * @param notifName The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane. 178 | * @param iconData NSData object to show with the notification as its icon. If nil, the application's icon will be used instead. 179 | * @param priority The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority. 180 | * @param isSticky If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications. 181 | * @param clickContext A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of NSString, NSArray, NSNumber, NSDictionary, and NSData types). 182 | * @param identifier An identifier for this notification. Notifications with equal identifiers are coalesced. 183 | */ 184 | + (void) notifyWithTitle:(NSString *)title 185 | description:(NSString *)description 186 | notificationName:(NSString *)notifName 187 | iconData:(NSData *)iconData 188 | priority:(signed int)priority 189 | isSticky:(BOOL)isSticky 190 | clickContext:(id)clickContext 191 | identifier:(NSString *)identifier; 192 | 193 | /*! @method notifyWithDictionary: 194 | * @abstract Notifies using a userInfo dictionary suitable for passing to 195 | * NSDistributedNotificationCenter. 196 | * @param userInfo The dictionary to notify with. 197 | * @discussion Before Growl 0.6, your application would have posted 198 | * notifications using NSDistributedNotificationCenter by 199 | * creating a userInfo dictionary with the notification data. This had the 200 | * advantage of allowing you to add other data to the dictionary for programs 201 | * besides Growl that might be listening. 202 | * 203 | * This method allows you to use such dictionaries without being restricted 204 | * to using NSDistributedNotificationCenter. The keys for this dictionary 205 | * can be found in GrowlDefines.h. 206 | */ 207 | + (void) notifyWithDictionary:(NSDictionary *)userInfo; 208 | 209 | #pragma mark - 210 | 211 | /*! @method registerWithDictionary: 212 | * @abstract Register your application with Growl without setting a delegate. 213 | * @discussion When you call this method with a dictionary, 214 | * GrowlApplicationBridge registers your application using that dictionary. 215 | * If you pass nil, GrowlApplicationBridge will ask the delegate 216 | * (if there is one) for a dictionary, and if that doesn't work, it will look 217 | * in your application's bundle for an auto-discoverable plist. 218 | * (XXX refer to more information on that) 219 | * 220 | * If you pass a dictionary to this method, it must include the 221 | * GROWL_APP_NAME key, unless a delegate is set. 222 | * 223 | * This method is mainly an alternative to the delegate system introduced 224 | * with Growl 0.6. Without a delegate, you cannot receive callbacks such as 225 | * -growlIsReady (since they are sent to the delegate). You can, 226 | * however, set a delegate after registering without one. 227 | * 228 | * This method was introduced in Growl.framework 0.7. 229 | */ 230 | + (BOOL) registerWithDictionary:(NSDictionary *)regDict; 231 | 232 | /*! @method reregisterGrowlNotifications 233 | * @abstract Reregister the notifications for this application. 234 | * @discussion This method does not normally need to be called. If your 235 | * application changes what notifications it is registering with Growl, call 236 | * this method to have the Growl delegate's 237 | * -registrationDictionaryForGrowl method called again and the 238 | * Growl registration information updated. 239 | * 240 | * This method is now implemented using -registerWithDictionary:. 241 | */ 242 | + (void) reregisterGrowlNotifications; 243 | 244 | #pragma mark - 245 | 246 | /*! @method setWillRegisterWhenGrowlIsReady: 247 | * @abstract Tells GrowlApplicationBridge to register with Growl when Growl 248 | * launches (or not). 249 | * @discussion When Growl has started listening for notifications, it posts a 250 | * GROWL_IS_READY notification on the Distributed Notification 251 | * Center. GrowlApplicationBridge listens for this notification, using it to 252 | * perform various tasks (such as calling your delegate's 253 | * -growlIsReady method, if it has one). If this method is 254 | * called with YES, one of those tasks will be to reregister 255 | * with Growl (in the manner of -reregisterGrowlNotifications). 256 | * 257 | * This attribute is automatically set back to NO (the default) 258 | * after every GROWL_IS_READY notification. 259 | * @param flag YES if you want GrowlApplicationBridge to register with 260 | * Growl when next it is ready; NO if not. 261 | */ 262 | + (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag; 263 | /*! @method willRegisterWhenGrowlIsReady 264 | * @abstract Reports whether GrowlApplicationBridge will register with Growl 265 | * when Growl next launches. 266 | * @result YES if GrowlApplicationBridge will register with Growl 267 | * when next it posts GROWL_IS_READY; NO if not. 268 | */ 269 | + (BOOL) willRegisterWhenGrowlIsReady; 270 | 271 | #pragma mark - 272 | 273 | /*! @method registrationDictionaryFromDelegate 274 | * @abstract Asks the delegate for a registration dictionary. 275 | * @discussion If no delegate is set, or if the delegate's 276 | * -registrationDictionaryForGrowl method returns 277 | * nil, this method returns nil. 278 | * 279 | * This method does not attempt to clean up the dictionary in any way - for 280 | * example, if it is missing the GROWL_APP_NAME key, the result 281 | * will be missing it too. Use +[GrowlApplicationBridge 282 | * registrationDictionaryByFillingInDictionary:] or 283 | * +[GrowlApplicationBridge 284 | * registrationDictionaryByFillingInDictionary:restrictToKeys:] to try 285 | * to fill in missing keys. 286 | * 287 | * This method was introduced in Growl.framework 0.7. 288 | * @result A registration dictionary. 289 | */ 290 | + (NSDictionary *) registrationDictionaryFromDelegate; 291 | 292 | /*! @method registrationDictionaryFromBundle: 293 | * @abstract Looks in a bundle for a registration dictionary. 294 | * @discussion This method looks in a bundle for an auto-discoverable 295 | * registration dictionary file using -[NSBundle 296 | * pathForResource:ofType:]. If it finds one, it loads the file using 297 | * +[NSDictionary dictionaryWithContentsOfFile:] and returns the 298 | * result. 299 | * 300 | * If you pass nil as the bundle, the main bundle is examined. 301 | * 302 | * This method does not attempt to clean up the dictionary in any way - for 303 | * example, if it is missing the GROWL_APP_NAME key, the result 304 | * will be missing it too. Use +[GrowlApplicationBridge 305 | * registrationDictionaryByFillingInDictionary:] or 306 | * +[GrowlApplicationBridge 307 | * registrationDictionaryByFillingInDictionary:restrictToKeys:] to try 308 | * to fill in missing keys. 309 | * 310 | * This method was introduced in Growl.framework 0.7. 311 | * @result A registration dictionary. 312 | */ 313 | + (NSDictionary *) registrationDictionaryFromBundle:(NSBundle *)bundle; 314 | 315 | /*! @method bestRegistrationDictionary 316 | * @abstract Obtains a registration dictionary, filled out to the best of 317 | * GrowlApplicationBridge's knowledge. 318 | * @discussion This method creates a registration dictionary as best 319 | * GrowlApplicationBridge knows how. 320 | * 321 | * First, GrowlApplicationBridge contacts the Growl delegate (if there is 322 | * one) and gets the registration dictionary from that. If no such dictionary 323 | * was obtained, GrowlApplicationBridge looks in your application's main 324 | * bundle for an auto-discoverable registration dictionary file. If that 325 | * doesn't exist either, this method returns nil. 326 | * 327 | * Second, GrowlApplicationBridge calls 328 | * +registrationDictionaryByFillingInDictionary: with whatever 329 | * dictionary was obtained. The result of that method is the result of this 330 | * method. 331 | * 332 | * GrowlApplicationBridge uses this method when you call 333 | * +setGrowlDelegate:, or when you call 334 | * +registerWithDictionary: with nil. 335 | * 336 | * This method was introduced in Growl.framework 0.7. 337 | * @result A registration dictionary. 338 | */ 339 | + (NSDictionary *) bestRegistrationDictionary; 340 | 341 | #pragma mark - 342 | 343 | /*! @method registrationDictionaryByFillingInDictionary: 344 | * @abstract Tries to fill in missing keys in a registration dictionary. 345 | * @discussion This method examines the passed-in dictionary for missing keys, 346 | * and tries to work out correct values for them. As of 0.7, it uses: 347 | * 348 | * Key Value 349 | * --- ----- 350 | * GROWL_APP_NAME CFBundleExecutableName 351 | * GROWL_APP_ICON_DATA The data of the icon of the application. 352 | * GROWL_APP_LOCATION The location of the application. 353 | * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL 354 | * 355 | * Keys are only filled in if missing; if a key is present in the dictionary, 356 | * its value will not be changed. 357 | * 358 | * This method was introduced in Growl.framework 0.7. 359 | * @param regDict The dictionary to fill in. 360 | * @result The dictionary with the keys filled in. This is an autoreleased 361 | * copy of regDict. 362 | */ 363 | + (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict; 364 | /*! @method registrationDictionaryByFillingInDictionary:restrictToKeys: 365 | * @abstract Tries to fill in missing keys in a registration dictionary. 366 | * @discussion This method examines the passed-in dictionary for missing keys, 367 | * and tries to work out correct values for them. As of 0.7, it uses: 368 | * 369 | * Key Value 370 | * --- ----- 371 | * GROWL_APP_NAME CFBundleExecutableName 372 | * GROWL_APP_ICON_DATA The data of the icon of the application. 373 | * GROWL_APP_LOCATION The location of the application. 374 | * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL 375 | * 376 | * Only those keys that are listed in keys will be filled in. 377 | * Other missing keys are ignored. Also, keys are only filled in if missing; 378 | * if a key is present in the dictionary, its value will not be changed. 379 | * 380 | * This method was introduced in Growl.framework 0.7. 381 | * @param regDict The dictionary to fill in. 382 | * @param keys The keys to fill in. If nil, any missing keys are filled in. 383 | * @result The dictionary with the keys filled in. This is an autoreleased 384 | * copy of regDict. 385 | */ 386 | + (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys; 387 | 388 | /*! @brief Tries to fill in missing keys in a notification dictionary. 389 | * @param notifDict The dictionary to fill in. 390 | * @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict. 391 | * @discussion This function examines the \a notifDict for missing keys, and 392 | * tries to get them from the last known registration dictionary. As of 1.1, 393 | * the keys that it will look for are: 394 | * 395 | * \li GROWL_APP_NAME 396 | * \li GROWL_APP_ICON_DATA 397 | * 398 | * @since Growl.framework 1.1 399 | */ 400 | + (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict; 401 | 402 | + (NSDictionary *) frameworkInfoDictionary; 403 | @end 404 | 405 | //------------------------------------------------------------------------------ 406 | #pragma mark - 407 | 408 | /*! 409 | * @protocol GrowlApplicationBridgeDelegate 410 | * @abstract Required protocol for the Growl delegate. 411 | * @discussion The methods in this protocol are required and are called 412 | * automatically as needed by GrowlApplicationBridge. See 413 | * +[GrowlApplicationBridge setGrowlDelegate:]. 414 | * See also GrowlApplicationBridgeDelegate_InformalProtocol. 415 | */ 416 | 417 | @protocol GrowlApplicationBridgeDelegate 418 | 419 | // -registrationDictionaryForGrowl has moved to the informal protocol as of 0.7. 420 | 421 | @end 422 | 423 | //------------------------------------------------------------------------------ 424 | #pragma mark - 425 | 426 | /*! 427 | * @category NSObject(GrowlApplicationBridgeDelegate_InformalProtocol) 428 | * @abstract Methods which may be optionally implemented by the GrowlDelegate. 429 | * @discussion The methods in this informal protocol will only be called if implemented by the delegate. 430 | */ 431 | @interface NSObject (GrowlApplicationBridgeDelegate_InformalProtocol) 432 | 433 | /*! 434 | * @method registrationDictionaryForGrowl 435 | * @abstract Return the dictionary used to register this application with Growl. 436 | * @discussion The returned dictionary gives Growl the complete list of 437 | * notifications this application will ever send, and it also specifies which 438 | * notifications should be enabled by default. Each is specified by an array 439 | * of NSString objects. 440 | * 441 | * For most applications, these two arrays can be the same (if all sent 442 | * notifications should be displayed by default). 443 | * 444 | * The NSString objects of these arrays will correspond to the 445 | * notificationName: parameter passed in 446 | * +[GrowlApplicationBridge 447 | * notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:] calls. 448 | * 449 | * The dictionary should have the required key object pairs: 450 | * key: GROWL_NOTIFICATIONS_ALL object: NSArray of NSString objects 451 | * key: GROWL_NOTIFICATIONS_DEFAULT object: NSArray of NSString objects 452 | * 453 | * The dictionary may have the following key object pairs: 454 | * key: GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES object: NSDictionary of key: notification name object: human-readable notification name 455 | * 456 | * You do not need to implement this method if you have an auto-discoverable 457 | * plist file in your app bundle. (XXX refer to more information on that) 458 | * 459 | * @result The NSDictionary to use for registration. 460 | */ 461 | - (NSDictionary *) registrationDictionaryForGrowl; 462 | 463 | /*! 464 | * @method applicationNameForGrowl 465 | * @abstract Return the name of this application which will be used for Growl bookkeeping. 466 | * @discussion This name is used both internally and in the Growl preferences. 467 | * 468 | * This should remain stable between different versions and incarnations of 469 | * your application. 470 | * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and 471 | * "SurfWriter Lite" are not. 472 | * 473 | * You do not need to implement this method if you are providing the 474 | * application name elsewhere, meaning in an auto-discoverable plist file in 475 | * your app bundle (XXX refer to more information on that) or in the result 476 | * of -registrationDictionaryForGrowl. 477 | * 478 | * @result The name of the application using Growl. 479 | */ 480 | - (NSString *) applicationNameForGrowl; 481 | 482 | /*! 483 | * @method applicationIconForGrowl 484 | * @abstract Return the NSImage to treat as the application icon. 485 | * @discussion The delegate may optionally return an NSImage 486 | * object to use as the application icon. If this method is not implemented, 487 | * {{{-applicationIconDataForGrowl}}} is tried. If that method is not 488 | * implemented, the application's own icon is used. Neither method is 489 | * generally needed. 490 | * @result The NSImage to treat as the application icon. 491 | */ 492 | - (NSImage *) applicationIconForGrowl; 493 | 494 | /*! 495 | * @method applicationIconDataForGrowl 496 | * @abstract Return the NSData to treat as the application icon. 497 | * @discussion The delegate may optionally return an NSData 498 | * object to use as the application icon; if this is not implemented, the 499 | * application's own icon is used. This is not generally needed. 500 | * @result The NSData to treat as the application icon. 501 | * @deprecated In version 1.1, in favor of {{{-applicationIconForGrowl}}}. 502 | */ 503 | - (NSData *) applicationIconDataForGrowl; 504 | 505 | /*! 506 | * @method growlIsReady 507 | * @abstract Informs the delegate that Growl has launched. 508 | * @discussion Informs the delegate that Growl (specifically, the 509 | * GrowlHelperApp) was launched successfully. The application can take actions 510 | * with the knowledge that Growl is installed and functional. 511 | */ 512 | - (void) growlIsReady; 513 | 514 | /*! 515 | * @method growlNotificationWasClicked: 516 | * @abstract Informs the delegate that a Growl notification was clicked. 517 | * @discussion Informs the delegate that a Growl notification was clicked. It 518 | * is only sent for notifications sent with a non-nil 519 | * clickContext, so if you want to receive a message when a notification is 520 | * clicked, clickContext must not be nil when calling 521 | * +[GrowlApplicationBridge notifyWithTitle: description:notificationName:iconData:priority:isSticky:clickContext:]. 522 | * @param clickContext The clickContext passed when displaying the notification originally via +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:]. 523 | */ 524 | - (void) growlNotificationWasClicked:(id)clickContext; 525 | 526 | /*! 527 | * @method growlNotificationTimedOut: 528 | * @abstract Informs the delegate that a Growl notification timed out. 529 | * @discussion Informs the delegate that a Growl notification timed out. It 530 | * is only sent for notifications sent with a non-nil 531 | * clickContext, so if you want to receive a message when a notification is 532 | * clicked, clickContext must not be nil when calling 533 | * +[GrowlApplicationBridge notifyWithTitle: description:notificationName:iconData:priority:isSticky:clickContext:]. 534 | * @param clickContext The clickContext passed when displaying the notification originally via +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:]. 535 | */ 536 | - (void) growlNotificationTimedOut:(id)clickContext; 537 | 538 | 539 | /*! 540 | * @method hasNetworkClientEntitlement 541 | * @abstract Used only in sandboxed situations since we don't know whether the app has com.apple.security.network.client entitlement 542 | * @discussion GrowlDelegate calls to find out if we have the com.apple.security.network.client entitlement, 543 | * since we can't find this out without hitting the sandbox. We only call it if we detect that the application is sandboxed. 544 | */ 545 | - (BOOL) hasNetworkClientEntitlement; 546 | 547 | @end 548 | 549 | #pragma mark - 550 | 551 | #endif /* __GrowlApplicationBridge_h__ */ 552 | -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // GrowlDefines.h 3 | // 4 | 5 | #ifndef _GROWLDEFINES_H 6 | #define _GROWLDEFINES_H 7 | 8 | #ifdef __OBJC__ 9 | #define XSTR(x) (@x) 10 | #else 11 | #define XSTR CFSTR 12 | #endif 13 | 14 | /*! @header GrowlDefines.h 15 | * @abstract Defines all the notification keys. 16 | * @discussion Defines all the keys used for registration with Growl and for 17 | * Growl notifications. 18 | * 19 | * Most applications should use the functions or methods of Growl.framework 20 | * instead of posting notifications such as those described here. 21 | * @updated 2004-01-25 22 | */ 23 | 24 | // UserInfo Keys for Registration 25 | #pragma mark UserInfo Keys for Registration 26 | 27 | /*! @group Registration userInfo keys */ 28 | /* @abstract Keys for the userInfo dictionary of a GROWL_APP_REGISTRATION distributed notification. 29 | * @discussion The values of these keys describe the application and the 30 | * notifications it may post. 31 | * 32 | * Your application must register with Growl before it can post Growl 33 | * notifications (and have them not be ignored). However, as of Growl 0.6, 34 | * posting GROWL_APP_REGISTRATION notifications directly is no longer the 35 | * preferred way to register your application. Your application should instead 36 | * use Growl.framework's delegate system. 37 | * See +[GrowlApplicationBridge setGrowlDelegate:] or Growl_SetDelegate for 38 | * more information. 39 | */ 40 | 41 | /*! @defined GROWL_APP_NAME 42 | * @abstract The name of your application. 43 | * @discussion The name of your application. This should remain stable between 44 | * different versions and incarnations of your application. 45 | * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and 46 | * "SurfWriter Lite" are not. 47 | */ 48 | #define GROWL_APP_NAME XSTR("ApplicationName") 49 | /*! @defined GROWL_APP_ID 50 | * @abstract The bundle identifier of your application. 51 | * @discussion The bundle identifier of your application. This key should 52 | * be unique for your application while there may be several applications 53 | * with the same GROWL_APP_NAME. 54 | * This key is optional. 55 | */ 56 | #define GROWL_APP_ID XSTR("ApplicationId") 57 | /*! @defined GROWL_APP_ICON_DATA 58 | * @abstract The image data for your application's icon. 59 | * @discussion Image data representing your application's icon. This may be 60 | * superimposed on a notification icon as a badge, used as the notification 61 | * icon when a notification-specific icon is not supplied, or ignored 62 | * altogether, depending on the display. Must be in a format supported by 63 | * NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. 64 | * 65 | * Optional. Not supported by all display plugins. 66 | */ 67 | #define GROWL_APP_ICON_DATA XSTR("ApplicationIcon") 68 | /*! @defined GROWL_NOTIFICATIONS_DEFAULT 69 | * @abstract The array of notifications to turn on by default. 70 | * @discussion These are the names of the notifications that should be enabled 71 | * by default when your application registers for the first time. If your 72 | * application reregisters, Growl will look here for any new notification 73 | * names found in GROWL_NOTIFICATIONS_ALL, but ignore any others. 74 | */ 75 | #define GROWL_NOTIFICATIONS_DEFAULT XSTR("DefaultNotifications") 76 | /*! @defined GROWL_NOTIFICATIONS_ALL 77 | * @abstract The array of all notifications your application can send. 78 | * @discussion These are the names of all of the notifications that your 79 | * application may post. See GROWL_NOTIFICATION_NAME for a discussion of good 80 | * notification names. 81 | */ 82 | #define GROWL_NOTIFICATIONS_ALL XSTR("AllNotifications") 83 | /*! @defined GROWL_NOTIFICATIONS_HUMAN_READABLE_DESCRIPTIONS 84 | * @abstract A dictionary of human-readable names for your notifications. 85 | * @discussion By default, the Growl UI will display notifications by the names given in GROWL_NOTIFICATIONS_ALL 86 | * which correspond to the GROWL_NOTIFICATION_NAME. This dictionary specifies the human-readable name to display. 87 | * The keys of the dictionary are GROWL_NOTIFICATION_NAME strings; the objects are the human-readable versions. 88 | * For any GROWL_NOTIFICATION_NAME not specific in this dictionary, the GROWL_NOTIFICATION_NAME will be displayed. 89 | * 90 | * This key is optional. 91 | */ 92 | #define GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES XSTR("HumanReadableNames") 93 | /*! @defined GROWL_NOTIFICATIONS_DESCRIPTIONS 94 | * @abstract A dictionary of descriptions of _when_ each notification occurs 95 | * @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are 96 | * descriptions of _when_ each notification occurs, such as "You received a new mail message" or 97 | * "A file finished downloading". 98 | * 99 | * This key is optional. 100 | */ 101 | #define GROWL_NOTIFICATIONS_DESCRIPTIONS XSTR("NotificationDescriptions") 102 | 103 | /*! @defined GROWL_TICKET_VERSION 104 | * @abstract The version of your registration ticket. 105 | * @discussion Include this key in a ticket plist file that you put in your 106 | * application bundle for auto-discovery. The current ticket version is 1. 107 | */ 108 | #define GROWL_TICKET_VERSION XSTR("TicketVersion") 109 | // UserInfo Keys for Notifications 110 | #pragma mark UserInfo Keys for Notifications 111 | 112 | /*! @group Notification userInfo keys */ 113 | /* @abstract Keys for the userInfo dictionary of a GROWL_NOTIFICATION distributed notification. 114 | * @discussion The values of these keys describe the content of a Growl 115 | * notification. 116 | * 117 | * Not all of these keys are supported by all displays. Only the name, title, 118 | * and description of a notification are universal. Most of the built-in 119 | * displays do support all of these keys, and most other visual displays 120 | * probably will also. But, as of 0.6, the Log, MailMe, and Speech displays 121 | * support only textual data. 122 | */ 123 | 124 | /*! @defined GROWL_NOTIFICATION_NAME 125 | * @abstract The name of the notification. 126 | * @discussion The name of the notification. Note that if you do not define 127 | * GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES when registering your ticket originally this name 128 | * will the one displayed within the Growl preference pane and should be human-readable. 129 | */ 130 | #define GROWL_NOTIFICATION_NAME XSTR("NotificationName") 131 | /*! @defined GROWL_NOTIFICATION_TITLE 132 | * @abstract The title to display in the notification. 133 | * @discussion The title of the notification. Should be very brief. 134 | * The title usually says what happened, e.g. "Download complete". 135 | */ 136 | #define GROWL_NOTIFICATION_TITLE XSTR("NotificationTitle") 137 | /*! @defined GROWL_NOTIFICATION_DESCRIPTION 138 | * @abstract The description to display in the notification. 139 | * @discussion The description should be longer and more verbose than the title. 140 | * The description usually tells the subject of the action, 141 | * e.g. "Growl-0.6.dmg downloaded in 5.02 minutes". 142 | */ 143 | #define GROWL_NOTIFICATION_DESCRIPTION XSTR("NotificationDescription") 144 | /*! @defined GROWL_NOTIFICATION_ICON 145 | * @discussion Image data for the notification icon. Image data must be in a format 146 | * supported by NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. 147 | * 148 | * Optional. Not supported by all display plugins. 149 | */ 150 | #define GROWL_NOTIFICATION_ICON_DATA XSTR("NotificationIcon") 151 | /*! @defined GROWL_NOTIFICATION_APP_ICON 152 | * @discussion Image data for the application icon, in case GROWL_APP_ICON does 153 | * not apply for some reason. Image data be in a format supported by NSImage, such 154 | * as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. 155 | * 156 | * Optional. Not supported by all display plugins. 157 | */ 158 | #define GROWL_NOTIFICATION_APP_ICON_DATA XSTR("NotificationAppIcon") 159 | /*! @defined GROWL_NOTIFICATION_PRIORITY 160 | * @discussion The priority of the notification as an integer number from 161 | * -2 to +2 (+2 being highest). 162 | * 163 | * Optional. Not supported by all display plugins. 164 | */ 165 | #define GROWL_NOTIFICATION_PRIORITY XSTR("NotificationPriority") 166 | /*! @defined GROWL_NOTIFICATION_STICKY 167 | * @discussion A Boolean number controlling whether the notification is sticky. 168 | * 169 | * Optional. Not supported by all display plugins. 170 | */ 171 | #define GROWL_NOTIFICATION_STICKY XSTR("NotificationSticky") 172 | /*! @defined GROWL_NOTIFICATION_CLICK_CONTEXT 173 | * @abstract Identifies which notification was clicked. 174 | * @discussion An identifier for the notification for clicking purposes. 175 | * 176 | * This will be passed back to the application when the notification is 177 | * clicked. It must be plist-encodable (a data, dictionary, array, number, or 178 | * string object), and it should be unique for each notification you post. 179 | * A good click context would be a UUID string returned by NSProcessInfo or 180 | * CFUUID. 181 | * 182 | * Optional. Not supported by all display plugins. 183 | */ 184 | #define GROWL_NOTIFICATION_CLICK_CONTEXT XSTR("NotificationClickContext") 185 | 186 | /*! @defined GROWL_NOTIFICATION_IDENTIFIER 187 | * @abstract An identifier for the notification for coalescing purposes. 188 | * Notifications with the same identifier fall into the same class; only 189 | * the last notification of a class is displayed on the screen. If a 190 | * notification of the same class is currently being displayed, it is 191 | * replaced by this notification. 192 | * 193 | * Optional. Not supported by all display plugins. 194 | */ 195 | #define GROWL_NOTIFICATION_IDENTIFIER XSTR("GrowlNotificationIdentifier") 196 | 197 | /*! @defined GROWL_APP_PID 198 | * @abstract The process identifier of the process which sends this 199 | * notification. If this field is set, the application will only receive 200 | * clicked and timed out notifications which originate from this process. 201 | * 202 | * Optional. 203 | */ 204 | #define GROWL_APP_PID XSTR("ApplicationPID") 205 | 206 | /*! @defined GROWL_NOTIFICATION_PROGRESS 207 | * @abstract If this key is set, it should contain a double value wrapped 208 | * in a NSNumber which describes some sort of progress (from 0.0 to 100.0). 209 | * If this is key is not set, no progress bar is shown. 210 | * 211 | * Optional. Not supported by all display plugins. 212 | */ 213 | #define GROWL_NOTIFICATION_PROGRESS XSTR("NotificationProgress") 214 | 215 | // Notifications 216 | #pragma mark Notifications 217 | 218 | /*! @group Notification names */ 219 | /* @abstract Names of distributed notifications used by Growl. 220 | * @discussion These are notifications used by applications (directly or 221 | * indirectly) to interact with Growl, and by Growl for interaction between 222 | * its components. 223 | * 224 | * Most of these should no longer be used in Growl 0.6 and later, in favor of 225 | * Growl.framework's GrowlApplicationBridge APIs. 226 | */ 227 | 228 | /*! @defined GROWL_APP_REGISTRATION 229 | * @abstract The distributed notification for registering your application. 230 | * @discussion This is the name of the distributed notification that can be 231 | * used to register applications with Growl. 232 | * 233 | * The userInfo dictionary for this notification can contain these keys: 234 | *
    235 | *
  • GROWL_APP_NAME
  • 236 | *
  • GROWL_APP_ICON_DATA
  • 237 | *
  • GROWL_NOTIFICATIONS_ALL
  • 238 | *
  • GROWL_NOTIFICATIONS_DEFAULT
  • 239 | *
240 | * 241 | * No longer recommended as of Growl 0.6. An alternate method of registering 242 | * is to use Growl.framework's delegate system. 243 | * See +[GrowlApplicationBridge setGrowlDelegate:] or Growl_SetDelegate for 244 | * more information. 245 | */ 246 | #define GROWL_APP_REGISTRATION XSTR("GrowlApplicationRegistrationNotification") 247 | /*! @defined GROWL_APP_REGISTRATION_CONF 248 | * @abstract The distributed notification for confirming registration. 249 | * @discussion The name of the distributed notification sent to confirm the 250 | * registration. Used by the Growl preference pane. Your application probably 251 | * does not need to use this notification. 252 | */ 253 | #define GROWL_APP_REGISTRATION_CONF XSTR("GrowlApplicationRegistrationConfirmationNotification") 254 | /*! @defined GROWL_NOTIFICATION 255 | * @abstract The distributed notification for Growl notifications. 256 | * @discussion This is what it all comes down to. This is the name of the 257 | * distributed notification that your application posts to actually send a 258 | * Growl notification. 259 | * 260 | * The userInfo dictionary for this notification can contain these keys: 261 | *
    262 | *
  • GROWL_NOTIFICATION_NAME (required)
  • 263 | *
  • GROWL_NOTIFICATION_TITLE (required)
  • 264 | *
  • GROWL_NOTIFICATION_DESCRIPTION (required)
  • 265 | *
  • GROWL_NOTIFICATION_ICON
  • 266 | *
  • GROWL_NOTIFICATION_APP_ICON
  • 267 | *
  • GROWL_NOTIFICATION_PRIORITY
  • 268 | *
  • GROWL_NOTIFICATION_STICKY
  • 269 | *
  • GROWL_NOTIFICATION_CLICK_CONTEXT
  • 270 | *
  • GROWL_APP_NAME (required)
  • 271 | *
272 | * 273 | * No longer recommended as of Growl 0.6. Three alternate methods of posting 274 | * notifications are +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:], 275 | * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext, and 276 | * Growl_PostNotification. 277 | */ 278 | #define GROWL_NOTIFICATION XSTR("GrowlNotification") 279 | /*! @defined GROWL_PING 280 | * @abstract A distributed notification to check whether Growl is running. 281 | * @discussion This is used by the Growl preference pane. If it receives a 282 | * GROWL_PONG, the preference pane takes this to mean that Growl is running. 283 | */ 284 | #define GROWL_PING XSTR("Honey, Mind Taking Out The Trash") 285 | /*! @defined GROWL_PONG 286 | * @abstract The distributed notification sent in reply to GROWL_PING. 287 | * @discussion GrowlHelperApp posts this in reply to GROWL_PING. 288 | */ 289 | #define GROWL_PONG XSTR("What Do You Want From Me, Woman") 290 | /*! @defined GROWL_IS_READY 291 | * @abstract The distributed notification sent when Growl starts up. 292 | * @discussion GrowlHelperApp posts this when it has begin listening on all of 293 | * its sources for new notifications. GrowlApplicationBridge (in 294 | * Growl.framework), upon receiving this notification, reregisters using the 295 | * registration dictionary supplied by its delegate. 296 | */ 297 | #define GROWL_IS_READY XSTR("Lend Me Some Sugar; I Am Your Neighbor!") 298 | 299 | 300 | /*! @defined GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX 301 | * @abstract Part of the name of the distributed notification sent when a supported notification is clicked. 302 | * @discussion When a Growl notification with a click context is clicked on by 303 | * the user, Growl posts a distributed notification whose name is in the format: 304 | * [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX] 305 | * The GrowlApplicationBridge responds to this notification by calling a callback in its delegate. 306 | */ 307 | #define GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX XSTR("GrowlClicked!") 308 | 309 | /*! @defined GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX 310 | * @abstract Part of the name of the distributed notification sent when a supported notification times out without being clicked. 311 | * @discussion When a Growl notification with a click context times out, Growl posts a distributed notification 312 | * whose name is in the format: 313 | * [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX] 314 | * The GrowlApplicationBridge responds to this notification by calling a callback in its delegate. 315 | * NOTE: The user may have actually clicked the 'close' button; this triggers an *immediate* time-out of the notification. 316 | */ 317 | #define GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX XSTR("GrowlTimedOut!") 318 | 319 | /*! @group Other symbols */ 320 | /* Symbols which don't fit into any of the other categories. */ 321 | 322 | /*! @defined GROWL_KEY_CLICKED_CONTEXT 323 | * @abstract Used internally as the key for the clickedContext passed over DNC. 324 | * @discussion This key is used in GROWL_NOTIFICATION_CLICKED, and contains the 325 | * click context that was supplied in the original notification. 326 | */ 327 | #define GROWL_KEY_CLICKED_CONTEXT XSTR("ClickedContext") 328 | /*! @defined GROWL_REG_DICT_EXTENSION 329 | * @abstract The filename extension for registration dictionaries. 330 | * @discussion The GrowlApplicationBridge in Growl.framework registers with 331 | * Growl by creating a file with the extension of .(GROWL_REG_DICT_EXTENSION) 332 | * and opening it in the GrowlHelperApp. This happens whether or not Growl is 333 | * running; if it was stopped, it quits immediately without listening for 334 | * notifications. 335 | */ 336 | #define GROWL_REG_DICT_EXTENSION XSTR("growlRegDict") 337 | 338 | 339 | #define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition" 340 | 341 | #endif //ndef _GROWLDEFINES_H 342 | -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11C74 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | Growl 11 | CFBundleIdentifier 12 | com.growl.growlframework 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.3.1 19 | CFBundleSignature 20 | GRRR 21 | CFBundleVersion 22 | 1.3.1 23 | DTCompiler 24 | com.apple.compilers.llvm.clang.1_0 25 | DTPlatformBuild 26 | 4D199 27 | DTPlatformVersion 28 | GM 29 | DTSDKBuild 30 | 11C63 31 | DTSDKName 32 | macosx10.7 33 | DTXcode 34 | 0420 35 | DTXcodeBuild 36 | 4D199 37 | NSPrincipalClass 38 | GrowlApplicationBridge 39 | 40 | 41 | -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | SwzGt9RQsuVafBBrfBalB75dCwU= 10 | 11 | 12 | rules 13 | 14 | ^Resources/ 15 | 16 | ^Resources/.*\.lproj/ 17 | 18 | optional 19 | 20 | weight 21 | 1000 22 | 23 | ^Resources/.*\.lproj/locversion.plist$ 24 | 25 | omit 26 | 27 | weight 28 | 1100 29 | 30 | ^version.plist$ 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Frameworks/Growl.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 13D65 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | MacGap 11 | CFBundleIconFile 12 | application.icns 13 | CFBundleIdentifier 14 | com.MacGap 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | MacGap 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 5B1008 31 | DTPlatformVersion 32 | GM 33 | DTSDKBuild 34 | 13C64 35 | DTSDKName 36 | macosx10.9 37 | DTXcode 38 | 0511 39 | DTXcodeBuild 40 | 5B1008 41 | LSMinimumSystemVersion 42 | 10.8 43 | NSMainNibFile 44 | MainMenu 45 | NSPrincipalClass 46 | NSApplication 47 | 48 | 49 | -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/MacOS/MacGap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccman/macgap-rb/ce80848be03dc1f345a57e693dd814767a52211b/assets/MacGap.app/Contents/MacOS/MacGap -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Resources/application.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccman/macgap-rb/ce80848be03dc1f345a57e693dd814767a52211b/assets/MacGap.app/Contents/Resources/application.icns -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Resources/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Resources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccman/macgap-rb/ce80848be03dc1f345a57e693dd814767a52211b/assets/MacGap.app/Contents/Resources/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Resources/en.lproj/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccman/macgap-rb/ce80848be03dc1f345a57e693dd814767a52211b/assets/MacGap.app/Contents/Resources/en.lproj/MainMenu.nib -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Resources/en.lproj/Window.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccman/macgap-rb/ce80848be03dc1f345a57e693dd814767a52211b/assets/MacGap.app/Contents/Resources/en.lproj/Window.nib -------------------------------------------------------------------------------- /assets/MacGap.app/Contents/Resources/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MacGap 5 | 23 | 24 | 25 | 26 | 27 | 30 | 31 |

MacGap

32 | 33 | -------------------------------------------------------------------------------- /assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MacGap 5 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 |

MacGap

33 | 34 | -------------------------------------------------------------------------------- /bin/macgap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "optparse" 4 | require "plist" 5 | require "pathname" 6 | require "fileutils" 7 | 8 | options = {} 9 | 10 | optparse = OptionParser.new do|opts| 11 | opts.banner = "Usage: macgap COMMAND [OPTIONS] DIR" 12 | opts.banner += "\n\tAvailable commands are:" 13 | opts.banner += "\n\t build - build application in DIR" 14 | opts.banner += "\n\t new - new application in DIR" 15 | 16 | opts.on( "-n", "--name NAME", "Application name" ) do |name| 17 | options[:name] = name 18 | end 19 | 20 | options[:output] = Dir.pwd 21 | opts.on( "-o", "--output DIR", "Output application to DIR" ) do |dir| 22 | options[:output] = dir 23 | end 24 | 25 | options[:version] = '1.0' 26 | opts.on( "-v", "--version VER", "Generated application version" ) do |ver| 27 | options[:version] = ver 28 | end 29 | 30 | opts.on( "-h", "--help", "Display this screen" ) do 31 | puts opts 32 | exit 33 | end 34 | end 35 | 36 | optparse.parse! 37 | 38 | command = ARGV[0] 39 | public_dir = ARGV[1] 40 | 41 | unless command && public_dir 42 | puts optparse 43 | exit 44 | end 45 | 46 | # Setup directories 47 | public_dir = Pathname.new(public_dir).expand_path 48 | options[:name] ||= public_dir.basename.to_s 49 | build_dir = Pathname.new(options[:output]).join(options[:name] + ".app") 50 | lib_dir = Pathname.new(File.join(__FILE__, *%w{.. ..})).expand_path 51 | 52 | case command 53 | when "build" 54 | when "new" 55 | public_dir.mkpath 56 | FileUtils.cp_r( 57 | lib_dir.join("assets", "index.html"), 58 | public_dir 59 | ) 60 | puts "Created application in #{public_dir}" 61 | exit 62 | else 63 | puts optparse 64 | exit 65 | end 66 | 67 | FileUtils.rm_rf build_dir 68 | build_dir.parent.mkpath 69 | 70 | # Copy over MacGap 71 | FileUtils.cp_r( 72 | lib_dir.join("assets", "MacGap.app"), 73 | build_dir 74 | ) 75 | 76 | FileUtils.cd build_dir.join("Contents") do 77 | build_dir = Pathname.new(Dir.pwd) 78 | 79 | # Copy over public dir 80 | build_public_dir = build_dir.join("Resources", "public") 81 | FileUtils.rm_rf build_public_dir 82 | FileUtils.cp_r(public_dir, build_public_dir) 83 | 84 | png_icon_path = public_dir.join("application.png") 85 | icon_path = public_dir.join("application.icns") 86 | 87 | if png_icon_path.exist? 88 | `sips -s format icns #{png_icon_path} --out #{icon_path}` 89 | end 90 | 91 | # Copy over icon 92 | if icon_path.exist? 93 | FileUtils.cp_r( 94 | icon_path, 95 | build_dir.join("Resources", "application.icns") 96 | ) 97 | end 98 | 99 | # Rename MacGap to specified name 100 | exe_path = build_dir.join("MacOS", "MacGap") 101 | renamed_exe_path = build_dir.join("MacOS", options[:name]) 102 | exe_path.rename(renamed_exe_path) 103 | renamed_exe_path.chmod(0755) 104 | 105 | plist = Plist::parse_xml(build_dir.join("Info.plist")) 106 | 107 | %W(CFBundleExecutable CFBundleIdentifier CFBundleName).each do |key| 108 | plist[key].gsub!("MacGap", options[:name]) 109 | end 110 | plist['CFBundleShortVersionString'] = options[:version] 111 | 112 | build_dir.join("Info.plist").open("w+") {|io| io.write plist.to_plist } 113 | end 114 | 115 | puts "Built application in #{build_dir.parent}" -------------------------------------------------------------------------------- /macgap.gemspec: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | $:.push File.expand_path("../lib", __FILE__) 3 | 4 | Gem::Specification.new do |s| 5 | s.name = "macgap" 6 | s.version = "0.0.9" 7 | s.authors = ["Alex MacCaw"] 8 | s.email = ["info@eribium.org"] 9 | s.homepage = "http://github.com/maccman/macgap-rb" 10 | s.summary = %q{Generate MacGap applications} 11 | s.description = %q{Command line utility for generating MacGap applications} 12 | 13 | s.rubyforge_project = "macgap" 14 | 15 | s.add_runtime_dependency "plist" 16 | 17 | s.files = `git ls-files`.split("\n") 18 | s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") 19 | s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } 20 | s.require_paths = ["lib"] 21 | end 22 | -------------------------------------------------------------------------------- /test/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MacGap Test 5 | 23 | 24 | 25 |

MacGap Test

26 | 27 | --------------------------------------------------------------------------------