Permalink
Browse files

Upgrade to latest Growl framework.

Latest framework acts as a notification center proxy if Growl is not
installed, and if it is, then it allows the end user to forward
notifications
to notification center.
  • Loading branch information...
1 parent 33cc90f commit 49ae3ca10f0aeff8e244bacc9457d6b71866b3dc @emsquared emsquared committed Oct 15, 2012
@@ -73,11 +73,12 @@
#endif
#ifdef TXMacOSMountainLionOrNewer
- #define TXNativeNotificationCenterAvailable
#define TXUserScriptsFolderAvailable
#define TXFoundationBasedUUIDAvailable
#endif
+//#define TXForceNativeNotificationCenterDispatch — Force notification center use regardless of Growl's installation.
+
#define LogToConsole(fmt, ...) NSLog([@"%s [Line %d]: " stringByAppendingString:fmt], \
__PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
@@ -44,7 +44,7 @@ @implementation TLOGrowlController
- (id)init
{
if ((self = [super init])) {
-#ifdef TXNativeNotificationCenterAvailable
+#ifdef TXForceNativeNotificationCenterDispatch
if ([TPCPreferences featureAvailableToOSXMountainLion]) {
[_NSUserNotificationCenter() setDelegate:self];
@@ -139,7 +139,7 @@ - (void)notify:(TXNotificationType)type title:(NSString *)title
}
}
-#ifdef TXNativeNotificationCenterAvailable
+#ifdef TXForceNativeNotificationCenterDispatch
if ([TPCPreferences featureAvailableToOSXMountainLion]) {
NSUserNotification *notification = [NSUserNotification new];
@@ -165,7 +165,7 @@ - (void)notify:(TXNotificationType)type title:(NSString *)title
/* NSUserNotificationCenter */
-#ifdef TXNativeNotificationCenterAvailable
+#ifdef TXForceNativeNotificationCenterDispatch
- (void)userNotificationCenter:(NSUserNotificationCenter *)center
didActivateNotification:(NSUserNotification *)notification
Binary file not shown.
@@ -112,15 +112,15 @@
*
* @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol.
*/
-+ (void) setGrowlDelegate:(NSObject<GrowlApplicationBridgeDelegate> *)inDelegate;
++ (void) setGrowlDelegate:(id<GrowlApplicationBridgeDelegate>)inDelegate;
/*!
* @method growlDelegate
* @abstract Return the object responsible for providing and receiving Growl information.
* @discussion See setGrowlDelegate: for details.
* @result The Growl delegate.
*/
-+ (NSObject<GrowlApplicationBridgeDelegate> *) growlDelegate;
++ (id<GrowlApplicationBridgeDelegate>) growlDelegate;
#pragma mark -
@@ -260,6 +260,7 @@
* Growl when next it is ready; <code>NO</code> if not.
*/
+ (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag;
+
/*! @method willRegisterWhenGrowlIsReady
* @abstract Reports whether GrowlApplicationBridge will register with Growl
* when Growl next launches.
@@ -361,6 +362,7 @@
* copy of <code>regDict</code>.
*/
+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
+
/*! @method registrationDictionaryByFillingInDictionary:restrictToKeys:
* @abstract Tries to fill in missing keys in a registration dictionary.
* @discussion This method examines the passed-in dictionary for missing keys,
@@ -400,35 +402,49 @@
+ (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
+ (NSDictionary *) frameworkInfoDictionary;
-@end
-//------------------------------------------------------------------------------
#pragma mark -
/*!
- * @protocol GrowlApplicationBridgeDelegate
- * @abstract Required protocol for the Growl delegate.
- * @discussion The methods in this protocol are required and are called
- * automatically as needed by GrowlApplicationBridge. See
- * <code>+[GrowlApplicationBridge setGrowlDelegate:]</code>.
- * See also <code>GrowlApplicationBridgeDelegate_InformalProtocol</code>.
+ *@method growlURLSchemeAvailable
+ *@abstract Lets the app know whether growl:// is registered on the system, used for certain methods below this
+ *@return Returns whether growl:// is registered on the system
+ *@discussion Methods such as openGrowlPreferences rely on the growl:// URL scheme to function
+ * Further, this method can provide a check on whether Growl is installed,
+ * however, the framework will not be relying on this method for choosing when/how to notify,
+ * and it is not recommended that the app rely on it for other than whether to use growl:// methods
+ *@since Growl.framework 1.4
*/
++ (BOOL) isGrowlURLSchemeAvailable;
-@protocol GrowlApplicationBridgeDelegate
-
-// -registrationDictionaryForGrowl has moved to the informal protocol as of 0.7.
+/*!
+ * @method openGrowlPreferences:
+ * @abstract Open Growl preferences, optionally to this app's settings, growl:// method
+ * @param showApp Whether to show the application's settings, otherwise just opens to the last position
+ * @return Return's whether opening the URL was succesfull or not.
+ * @discussion Will launch if Growl is installed, but not running, and open the preferences window
+ * Uses growl:// URL scheme
+ * @since Growl.framework 1.4
+ */
++ (BOOL) openGrowlPreferences:(BOOL)showApp;
@end
//------------------------------------------------------------------------------
#pragma mark -
/*!
- * @category NSObject(GrowlApplicationBridgeDelegate_InformalProtocol)
- * @abstract Methods which may be optionally implemented by the GrowlDelegate.
- * @discussion The methods in this informal protocol will only be called if implemented by the delegate.
+ * @protocol GrowlApplicationBridgeDelegate
+ * @abstract Required protocol for the Growl delegate.
+ * @discussion The methods in this protocol are optional and are called
+ * automatically as needed by GrowlApplicationBridge. See
+ * <code>+[GrowlApplicationBridge setGrowlDelegate:]</code>.
+ * See also <code>GrowlApplicationBridgeDelegate_InformalProtocol</code>.
*/
-@interface NSObject (GrowlApplicationBridgeDelegate_InformalProtocol)
+
+@protocol GrowlApplicationBridgeDelegate <NSObject>
+
+@optional
/*!
* @method registrationDictionaryForGrowl
@@ -99,6 +99,14 @@
* This key is optional.
*/
#define GROWL_NOTIFICATIONS_DESCRIPTIONS XSTR("NotificationDescriptions")
+/*! @defined GROWL_NOTIFICATIONS_ICONS
+ * @abstract A dictionary of icons for each notification
+ * @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are
+ * icons for each notification, for GNTP spec
+ *
+ * This key is optional.
+ */
+#define GROWL_NOTIFICATIONS_ICONS XSTR("NotificationIcons")
/*! @defined GROWL_TICKET_VERSION
* @abstract The version of your registration ticket.
@@ -212,6 +220,19 @@
*/
#define GROWL_NOTIFICATION_PROGRESS XSTR("NotificationProgress")
+/*! @defined GROWL_NOTIFICATION_ALREADY_SHOWN
+ * @abstract If this key is set, it should contain a bool value wrapped
+ * in a NSNumber which describes whether the notification has
+ * already been displayed, for instance by built in Notification
+ * Center support. This value can be used to allow display
+ * plugins to skip a notification, while still allowing Growl
+ * actions to run on them.
+ *
+ * Optional. Not supported by all display plugins.
+ */
+#define GROWL_NOTIFICATION_ALREADY_SHOWN XSTR("AlreadyShown")
+
+
// Notifications
#pragma mark Notifications
@@ -316,6 +337,28 @@
*/
#define GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX XSTR("GrowlTimedOut!")
+/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON
+ * @abstract The distributed notification sent when the Notification Center support is toggled on in Growl 2.0
+ * @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
+ * to inform all running apps that they should now speak to Notification Center directly.
+ */
+#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON XSTR("GrowlNotificationCenterOn!")
+
+/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF
+ * @abstract The distributed notification sent when the Notification Center support is toggled off in Growl 2.0
+ * @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
+ * to inform all running apps that they should no longer speak to Notification Center directly.
+ */
+#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF XSTR("GrowlNotificationCenterOff!")
+
+/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY
+ * @abstract The distributed notification sent by an application to query Growl 2.0's notification center support.
+ * @discussion When an app starts up, it will send this query to get Growl 2.0 to spit out whether notification
+ * center support is on or off.
+ */
+#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY XSTR("GrowlNotificationCenterYN?")
+
+
/*! @group Other symbols */
/* Symbols which don't fit into any of the other categories. */
@@ -338,4 +381,6 @@
#define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition"
+#define GROWL_PLUGIN_CONFIG_ID XSTR("GrowlPluginConfigurationID")
+
#endif //ndef _GROWLDEFINES_H
@@ -0,0 +1,67 @@
+//
+// GrowlPluginPreferenceStrings.h
+// Growl
+//
+// Created by Daniel Siemer on 1/30/12.
+// Copyright (c) 2012 The Growl Project. All rights reserved.
+//
+
+/* FOR GROWL DEVELOPED COCOA PLUGINS ONLY AT THIS TIME, NOT STABLE */
+
+#import <Foundation/Foundation.h>
+
+#define GrowlDisplayOpacity NSLocalizedStringFromTable(@"Opacity:", @"PluginPrefStrings", @"How clear the display is")
+#define GrowlDisplayDuration NSLocalizedStringFromTable(@"Duration:", @"PluginPrefStrings", @"How long a notification will stay on screen")
+
+#define GrowlDisplayPriority NSLocalizedStringFromTable(@"Priority: (low to high)", @"PluginPrefStrings", @"Label for columns of color wells for various priority levels")
+#define GrowlDisplayPriorityLow NSLocalizedStringFromTable(@"Very Low", @"PluginPrefStrings", @"Notification Priority Very Low")
+#define GrowlDisplayPriorityModerate NSLocalizedStringFromTable(@"Moderate", @"PluginPrefStrings", @"Notification Priority Moderate")
+#define GrowlDisplayPriorityNormal NSLocalizedStringFromTable(@"Normal", @"PluginPrefStrings", @"Notification Priority Normal")
+#define GrowlDisplayPriorityHigh NSLocalizedStringFromTable(@"High", @"PluginPrefStrings", @"Notification Priority High")
+#define GrowlDisplayPriorityEmergency NSLocalizedStringFromTable(@"Emergency", @"PluginPrefStrings", @"Notification Priority Emergency")
+
+#define GrowlDisplayTextColor NSLocalizedStringFromTable(@"Text", @"PluginPrefStrings", @"Label for row of color wells for the text element of the plugin")
+#define GrowlDisplayBackgroundColor NSLocalizedStringFromTable(@"Background", @"PluginPrefStrings", @"Label for row of color wells for the background of the plugin")
+
+#define GrowlDisplayLimitLines NSLocalizedStringFromTable(@"Limit to 2-5 lines", @"PluginPrefStrings", @"Checkbox to limit the display to 2-5 lines")
+#define GrowlDisplayScreen NSLocalizedStringFromTable(@"Screen:", @"PluginPrefStrings", @"Label for box to select screen for display to use")
+#define GrowlDisplaySize NSLocalizedStringFromTable(@"Size:", @"PluginPrefStrings", @"Label for pop up box for selecting the size of the display")
+#define GrowlDisplaySizeNormal NSLocalizedStringFromTable(@"Normal", @"PluginPrefStrings", @"Normal size for the display")
+#define GrowlDisplaySizeLarge NSLocalizedStringFromTable(@"Large", @"PluginPrefStrings", @"Large size for the display")
+#define GrowlDisplaySizeSmall NSLocalizedStringFromTable(@"Small", @"PluginPrefStrings", @"Small size for the display")
+
+#define GrowlDisplayFloatingIcon NSLocalizedStringFromTable(@"Floating Icon", @"PluginPrefStrings", @"Label for checkbox that says to do a floating icon")
+
+#define GrowlDisplayEffect NSLocalizedStringFromTable(@"Effect:", @"PluginPrefStrings", @"Label for the effect to use")
+#define GrowlDisplayEffectSlide NSLocalizedStringFromTable(@"Slide", @"PluginPrefStrings", @"A slide effect")
+#define GrowlDisplayEffectFade NSLocalizedStringFromTable(@"Fade", @"PluginPrefStrings", @"A fade effect")
+
+@interface GrowlPluginPreferenceStrings : NSObject
+
+@property (nonatomic, retain) NSString *growlDisplayOpacity;
+@property (nonatomic, retain) NSString *growlDisplayDuration;
+
+@property (nonatomic, retain) NSString *growlDisplayPriority;
+@property (nonatomic, retain) NSString *growlDisplayPriorityVeryLow;
+@property (nonatomic, retain) NSString *growlDisplayPriorityModerate;
+@property (nonatomic, retain) NSString *growlDisplayPriorityNormal;
+@property (nonatomic, retain) NSString *growlDisplayPriorityHigh;
+@property (nonatomic, retain) NSString *growlDisplayPriorityEmergency;
+
+@property (nonatomic, retain) NSString *growlDisplayTextColor;
+@property (nonatomic, retain) NSString *growlDisplayBackgroundColor;
+
+@property (nonatomic, retain) NSString *growlDisplayLimitLines;
+@property (nonatomic, retain) NSString *growlDisplayScreen;
+@property (nonatomic, retain) NSString *growlDisplaySize;
+@property (nonatomic, retain) NSString *growlDisplaySizeNormal;
+@property (nonatomic, retain) NSString *growlDisplaySizeLarge;
+@property (nonatomic, retain) NSString *growlDisplaySizeSmall;
+
+@property (nonatomic, retain) NSString *growlDisplayFloatingIcon;
+
+@property (nonatomic, retain) NSString *effectLabel;
+@property (nonatomic, retain) NSString *slideEffect;
+@property (nonatomic, retain) NSString *fadeEffect;
+
+@end
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
- <string>11C74</string>
+ <string>12A269</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
@@ -15,25 +15,25 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>1.3.1</string>
+ <string>2.0</string>
<key>CFBundleSignature</key>
<string>GRRR</string>
<key>CFBundleVersion</key>
- <string>1.3.1</string>
+ <string>2.0</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
- <string>4D199</string>
+ <string>4F250</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
- <string>11C63</string>
+ <string>12A264</string>
<key>DTSDKName</key>
- <string>macosx10.7</string>
+ <string>macosx10.8</string>
<key>DTXcode</key>
- <string>0420</string>
+ <string>0440</string>
<key>DTXcodeBuild</key>
- <string>4D199</string>
+ <string>4F250</string>
<key>NSPrincipalClass</key>
<string>GrowlApplicationBridge</string>
</dict>
@@ -6,7 +6,7 @@
<dict>
<key>Resources/Info.plist</key>
<data>
- SwzGt9RQsuVafBBrfBalB75dCwU=
+ lnx8exuPwE/bsUq32R5DXDQholc=
</data>
</dict>
<key>rules</key>
View
@@ -47,8 +47,8 @@
<key>TXBundleBuildCodeName</key>
<string>Turtle Soup</string>
<key>TXBundleBuildNumber</key>
- <string>12526</string>
+ <string>12531</string>
<key>TXBundleBuildReference</key>
- <string>2.1.1-340-gd805c5c-stdbuild</string>
+ <string>2.1.1-345-g33cc90f-debug</string>
</dict>
</plist>

0 comments on commit 49ae3ca

Please sign in to comment.