diff options
author | Abhi Beckert <abhi@Twist-of-Lemon-2.local> | 2015-05-16 08:06:06 +1000 |
---|---|---|
committer | Abhi Beckert <abhi@Twist-of-Lemon-2.local> | 2015-05-16 08:06:06 +1000 |
commit | 57a6f6c73bdaa202164645370d37fcbe5d14a092 (patch) | |
tree | dd30aa6156064f1d4c0e10ea87059625470fc2f9 /Frameworks | |
parent | b5e972f4504043dfb9c358e272e93fb59ae2127f (diff) | |
parent | 0f0c43eb74408b6a65a42e2c6fd46f4142ef8e3f (diff) | |
download | sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.tar.gz sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.tar.bz2 sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.zip |
Merge remote-tracking branch 'sequelpro/master'
Diffstat (limited to 'Frameworks')
36 files changed, 654 insertions, 1023 deletions
diff --git a/Frameworks/Growl.framework/Versions/A/Growl b/Frameworks/Growl.framework/Versions/A/Growl Binary files differindex ee84bef2..e3567301 100755 --- a/Frameworks/Growl.framework/Versions/A/Growl +++ b/Frameworks/Growl.framework/Versions/A/Growl diff --git a/Frameworks/Growl.framework/Versions/A/Headers/Growl.h b/Frameworks/Growl.framework/Versions/A/Headers/Growl.h index e2a44255..7b1a3247 100644 --- a/Frameworks/Growl.framework/Versions/A/Headers/Growl.h +++ b/Frameworks/Growl.framework/Versions/A/Headers/Growl.h @@ -1,6 +1,5 @@ -#include "GrowlDefines.h" +#include <Growl/GrowlDefines.h> #ifdef __OBJC__ -# include "GrowlApplicationBridge.h" +# include <Growl/GrowlApplicationBridge.h> #endif -#include "GrowlApplicationBridge-Carbon.h" diff --git a/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h b/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h deleted file mode 100644 index e7213dbe..00000000 --- a/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h +++ /dev/null @@ -1,780 +0,0 @@ -// -// GrowlApplicationBridge-Carbon.h -// Growl -// -// Created by Peter Hosey on Wed Jun 18 2004. -// Based on GrowlApplicationBridge.h by Evan Schoenberg. -// This source code is in the public domain. You may freely link it into any -// program. -// - -#ifndef _GROWLAPPLICATIONBRIDGE_CARBON_H_ -#define _GROWLAPPLICATIONBRIDGE_CARBON_H_ - -#include <sys/cdefs.h> -#include <Carbon/Carbon.h> - -#ifndef GROWL_EXPORT -#define GROWL_EXPORT __attribute__((visibility("default"))) DEPRECATED_ATTRIBUTE -#endif - -/*! @header GrowlApplicationBridge-Carbon.h - * @abstract Declares an API that Carbon applications can use to interact with Growl. - * @discussion GrowlApplicationBridge uses a delegate to provide information //XXX - * to Growl (such as your application's name and what notifications it may - * post) and to provide information to your application (such as that Growl - * is listening for notifications or that a notification has been clicked). - * - * You can set the Growldelegate with Growl_SetDelegate and find out the - * current delegate with Growl_GetDelegate. See struct Growl_Delegate for more - * information about the delegate. - */ - -__BEGIN_DECLS - -/*! @struct Growl_Delegate - * @abstract Delegate to supply GrowlApplicationBridge with information and respond to events. - * @discussion The Growl delegate provides your interface to - * GrowlApplicationBridge. When GrowlApplicationBridge needs information about - * your application, it looks for it in the delegate; when Growl or the user - * does something that you might be interested in, GrowlApplicationBridge - * looks for a callback in the delegate and calls it if present - * (meaning, if it is not <code>NULL</code>). - * XXX on all of that - * @field size The size of the delegate structure. - * @field applicationName The name of your application. - * @field registrationDictionary A dictionary describing your application and the notifications it can send out. - * @field applicationIconData Your application's icon. - * @field growlInstallationWindowTitle The title of the installation window. - * @field growlInstallationInformation Text to display in the installation window. - * @field growlUpdateWindowTitle The title of the update window. - * @field growlUpdateInformation Text to display in the update window. - * @field referenceCount A count of owners of the delegate. - * @field retain Called when GrowlApplicationBridge receives this delegate. - * @field release Called when GrowlApplicationBridge no longer needs this delegate. - * @field growlIsReady Called when GrowlHelperApp is listening for notifications. - * @field growlNotificationWasClicked Called when a Growl notification is clicked. - * @field growlNotificationTimedOut Called when a Growl notification timed out. - */ -struct Growl_Delegate { - /* @discussion This should be sizeof(struct Growl_Delegate). - */ - size_t size; - - /*All of these attributes are optional. - *Optional attributes can be NULL; required attributes that - * are NULL cause setting the Growl delegate to fail. - *XXX - move optional/required status into the discussion for each field - */ - - /* This name is used both internally and in the Growl preferences. - * - * This should remain stable between different versions and incarnations of - * your application. - * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and - * "SurfWriter Lite" are not. - * - * This can be <code>NULL</code> if it is provided elsewhere, namely in an - * auto-discoverable plist file in your app bundle - * (XXX refer to more information on that) or in registrationDictionary. - */ - CFStringRef applicationName; - - /* - * Must contain at least these keys: - * GROWL_NOTIFICATIONS_ALL (CFArray): - * Contains the names of all notifications your application may post. - * - * Can also contain these keys: - * GROWL_NOTIFICATIONS_DEFAULT (CFArray): - * Names of notifications that should be enabled by default. - * If omitted, GROWL_NOTIFICATIONS_ALL will be used. - * GROWL_APP_NAME (CFString): - * Same as the applicationName member of this structure. - * If both are present, the applicationName member shall prevail. - * If this key is present, you may omit applicationName (set it to <code>NULL</code>). - * GROWL_APP_ICON (CFData): - * Same as the iconData member of this structure. - * If both are present, the iconData member shall prevail. - * If this key is present, you may omit iconData (set it to <code>NULL</code>). - * - * If you change the contents of this dictionary after setting the delegate, - * be sure to call Growl_Reregister. - * - * This can be <code>NULL</code> if you have an auto-discoverable plist file in your app - * bundle. (XXX refer to more information on that) - */ - CFDictionaryRef registrationDictionary; - - /* The data can be in any format supported by NSImage. As of - * Mac OS X 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and - * PICT formats. - * - * If this is not supplied, Growl will look up your application's icon by - * its application name. - */ - CFDataRef applicationIconData; - - /* Installer display attributes - * - * These four attributes are used by the Growl installer, if this framework - * supports it. - * For any of these being <code>NULL</code>, a localised default will be - * supplied. - */ - - /* If this is <code>NULL</code>, Growl will use a default, - * localized title. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlInstallationWindowTitle; - /* This information may be as long or short as desired (the - * window will be sized to fit it). If Growl is not installed, it will - * be displayed to the user as an explanation of what Growl is and what - * it can do in your application. - * It should probably note that no download is required to install. - * - * If this is <code>NULL</code>, Growl will use a default, localized - * explanation. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlInstallationInformation; - /* If this is <code>NULL</code>, Growl will use a default, - * localized title. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlUpdateWindowTitle; - /* This information may be as long or short as desired (the - * window will be sized to fit it). If an older version of Growl is - * installed, it will be displayed to the user as an explanation that an - * updated version of Growl is included in your application and - * no download is required. - * - * If this is <code>NULL</code>, Growl will use a default, localized - * explanation. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlUpdateInformation; - - /* This member is provided for use by your retain and release - * callbacks (see below). - * - * GrowlApplicationBridge never directly uses this member. Instead, it - * calls your retain callback (if non-<code>NULL</code>) and your release - * callback (if non-<code>NULL</code>). - */ - unsigned referenceCount; - - //Functions. Currently all of these are optional (any of them can be NULL). - - /* When you call Growl_SetDelegate(newDelegate), it will call - * oldDelegate->release(oldDelegate), and then it will call - * newDelegate->retain(newDelegate), and the return value from retain - * is what will be set as the delegate. - * (This means that this member works like CFRetain and -[NSObject retain].) - * This member is optional (it can be <code>NULL</code>). - * For a delegate allocated with malloc, this member would be - * <code>NULL</code>. - * @result A delegate to which GrowlApplicationBridge holds a reference. - */ - void *(*retain)(void *); - /* When you call Growl_SetDelegate(newDelegate), it will call - * oldDelegate->release(oldDelegate), and then it will call - * newDelegate->retain(newDelegate), and the return value from retain - * is what will be set as the delegate. - * (This means that this member works like CFRelease and - * -[NSObject release].) - * This member is optional (it can be NULL). - * For a delegate allocated with malloc, this member might be - * <code>free</code>(3). - */ - void (*release)(void *); - - /* Informs the delegate that Growl (specifically, the GrowlHelperApp) was - * launched successfully (or was already running). The application can - * take actions with the knowledge that Growl is installed and functional. - */ - void (*growlIsReady)(void); - - /* Informs the delegate that a Growl notification was clicked. It is only - * sent for notifications sent with a non-<code>NULL</code> clickContext, - * so if you want to receive a message when a notification is clicked, - * clickContext must not be <code>NULL</code> when calling - * Growl_PostNotification or - * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. - */ - void (*growlNotificationWasClicked)(CFPropertyListRef clickContext); - - /* Informs the delegate that a Growl notification timed out. It is only - * sent for notifications sent with a non-<code>NULL</code> clickContext, - * so if you want to receive a message when a notification is clicked, - * clickContext must not be <code>NULL</code> when calling - * Growl_PostNotification or - * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. - */ - void (*growlNotificationTimedOut)(CFPropertyListRef clickContext); -}; - -/*! @struct Growl_Notification - * @abstract Structure describing a Growl notification. - * @discussion XXX - * @field size The size of the notification structure. - * @field name Identifies the notification. - * @field title Short synopsis of the notification. - * @field description Additional text. - * @field iconData An icon for the notification. - * @field priority An indicator of the notification's importance. - * @field reserved Bits reserved for future usage. - * @field isSticky Requests that a notification stay on-screen until dismissed explicitly. - * @field clickContext An identifier to be passed to your click callback when a notification is clicked. - * @field clickCallback A callback to call when the notification is clicked. - */ -struct Growl_Notification { - /* This should be sizeof(struct Growl_Notification). - */ - size_t size; - - /* The notification name distinguishes one type of - * notification from another. The name should be human-readable, as it - * will be displayed in the Growl preference pane. - * - * The name is used in the GROWL_NOTIFICATIONS_ALL and - * GROWL_NOTIFICATIONS_DEFAULT arrays in the registration dictionary, and - * in this member of the Growl_Notification structure. - */ - CFStringRef name; - - /* A notification's title describes the notification briefly. - * It should be easy to read quickly by the user. - */ - CFStringRef title; - - /* The description supplements the title with more - * information. It is usually longer and sometimes involves a list of - * subjects. For example, for a 'Download complete' notification, the - * description might have one filename per line. GrowlMail in Growl 0.6 - * uses a description of '%d new mail(s)' (formatted with the number of - * messages). - */ - CFStringRef description; - - /* The notification icon usually indicates either what - * happened (it may have the same icon as e.g. a toolbar item that - * started the process that led to the notification), or what it happened - * to (e.g. a document icon). - * - * The icon data is optional, so it can be <code>NULL</code>. In that - * case, the application icon is used alone. Not all displays support - * icons. - * - * The data can be in any format supported by NSImage. As of Mac OS X - * 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT form - * ats. - */ - CFDataRef iconData; - - /* Priority is new in Growl 0.6, and is represented as a - * signed integer from -2 to +2. 0 is Normal priority, -2 is Very Low - * priority, and +2 is Very High priority. - * - * Not all displays support priority. If you do not wish to assign a - * priority to your notification, assign 0. - */ - signed int priority; - - /* These bits are not used in Growl 0.6. Set them to 0. - */ - unsigned reserved: 31; - - /* When the sticky bit is clear, in most displays, - * notifications disappear after a certain amount of time. Sticky - * notifications, however, remain on-screen until the user dismisses them - * explicitly, usually by clicking them. - * - * Sticky notifications were introduced in Growl 0.6. Most notifications - * should not be sticky. Not all displays support sticky notifications, - * and the user may choose in Growl's preference pane to force the - * notification to be sticky or non-sticky, in which case the sticky bit - * in the notification will be ignored. - */ - unsigned isSticky: 1; - - /* If this is not <code>NULL</code>, and your click callback - * is not <code>NULL</code> either, this will be passed to the callback - * when your notification is clicked by the user. - * - * Click feedback was introduced in Growl 0.6, and it is optional. Not - * all displays support click feedback. - */ - CFPropertyListRef clickContext; - - /* If this is not <code>NULL</code>, it will be called instead - * of the Growl delegate's click callback when clickContext is - * non-<code>NULL</code> and the notification is clicked on by the user. - * - * Click feedback was introduced in Growl 0.6, and it is optional. Not - * all displays support click feedback. - * - * The per-notification click callback is not yet supported as of Growl - * 0.7. - */ - void (*clickCallback)(CFPropertyListRef clickContext); - - CFStringRef identifier; -}; - -#pragma mark - -#pragma mark Easy initialisers - -/*! @defined InitGrowlDelegate - * @abstract Callable macro. Initializes a Growl delegate structure to defaults. - * @discussion Call with a pointer to a struct Growl_Delegate. All of the - * members of the structure will be set to 0 or <code>NULL</code>, except for - * size (which will be set to <code>sizeof(struct Growl_Delegate)</code>) and - * referenceCount (which will be set to 1). - */ -#define InitGrowlDelegate(delegate) \ - do { \ - if (delegate) { \ - (delegate)->size = sizeof(struct Growl_Delegate); \ - (delegate)->applicationName = NULL; \ - (delegate)->registrationDictionary = NULL; \ - (delegate)->applicationIconData = NULL; \ - (delegate)->growlInstallationWindowTitle = NULL; \ - (delegate)->growlInstallationInformation = NULL; \ - (delegate)->growlUpdateWindowTitle = NULL; \ - (delegate)->growlUpdateInformation = NULL; \ - (delegate)->referenceCount = 1U; \ - (delegate)->retain = NULL; \ - (delegate)->release = NULL; \ - (delegate)->growlIsReady = NULL; \ - (delegate)->growlNotificationWasClicked = NULL; \ - (delegate)->growlNotificationTimedOut = NULL; \ - } \ - } while(0) - -/*! @defined InitGrowlNotification - * @abstract Callable macro. Initializes a Growl notification structure to defaults. - * @discussion Call with a pointer to a struct Growl_Notification. All of - * the members of the structure will be set to 0 or <code>NULL</code>, except - * for size (which will be set to - * <code>sizeof(struct Growl_Notification)</code>). - */ -#define InitGrowlNotification(notification) \ - do { \ - if (notification) { \ - (notification)->size = sizeof(struct Growl_Notification); \ - (notification)->name = NULL; \ - (notification)->title = NULL; \ - (notification)->description = NULL; \ - (notification)->iconData = NULL; \ - (notification)->priority = 0; \ - (notification)->reserved = 0U; \ - (notification)->isSticky = false; \ - (notification)->clickContext = NULL; \ - (notification)->clickCallback = NULL; \ - (notification)->identifier = NULL; \ - } \ - } while(0) - -#pragma mark - -#pragma mark Public API - -// @functiongroup Managing the Growl delegate - -/*! @function Growl_SetDelegate - * @abstract Replaces the current Growl delegate with a new one, or removes - * the Growl delegate. - * @param newDelegate - * @result Returns false and does nothing else if a pointer that was passed in - * is unsatisfactory (because it is non-<code>NULL</code>, but at least one - * required member of it is <code>NULL</code>). Otherwise, sets or unsets the - * delegate and returns true. - * @discussion When <code>newDelegate</code> is non-<code>NULL</code>, sets - * the delegate to <code>newDelegate</code>. When it is <code>NULL</code>, - * the current delegate will be unset, and no delegate will be in place. - * - * It is legal for <code>newDelegate</code> to be the current delegate; - * nothing will happen, and Growl_SetDelegate will return true. It is also - * legal for it to be <code>NULL</code>, as described above; again, it will - * return true. - * - * If there was a delegate in place before the call, Growl_SetDelegate will - * call the old delegate's release member if it was non-<code>NULL</code>. If - * <code>newDelegate</code> is non-<code>NULL</code>, Growl_SetDelegate will - * call <code>newDelegate->retain</code>, and set the delegate to its return - * value. - * - * If you are using Growl-WithInstaller.framework, and an older version of - * Growl is installed on the user's system, the user will automatically be - * prompted to update. - * - * GrowlApplicationBridge currently does not copy this structure, nor does it - * retain any of the CF objects in the structure (it regards the structure as - * a container that retains the objects when they are added and releases them - * when they are removed or the structure is destroyed). Also, - * GrowlApplicationBridge currently does not modify any member of the - * structure, except possibly the referenceCount by calling the retain and - * release members. - */ -GROWL_EXPORT Boolean Growl_SetDelegate(struct Growl_Delegate *newDelegate); - -/*! @function Growl_GetDelegate - * @abstract Returns the current Growl delegate, if any. - * @result The current Growl delegate. - * @discussion Returns the last pointer passed into Growl_SetDelegate, or - * <code>NULL</code> if no such call has been made. - * - * This function follows standard Core Foundation reference-counting rules. - * Because it is a Get function, not a Copy function, it will not retain the - * delegate on your behalf. You are responsible for retaining and releasing - * the delegate as needed. - */ -GROWL_EXPORT struct Growl_Delegate *Growl_GetDelegate(void); - -#pragma mark - - -// @functiongroup Posting Growl notifications - -/*! @function Growl_PostNotification - * @abstract Posts a Growl notification. - * @param notification The notification to post. - * @discussion This is the preferred means for sending a Growl notification. - * The notification name and at least one of the title and description are - * required (all three are preferred). All other parameters may be - * <code>NULL</code> (or 0 or false as appropriate) to accept default values. - * - * If using the Growl-WithInstaller framework, if Growl is not installed the - * user will be prompted to install Growl. - * If the user cancels, this function will have no effect until the next - * application session, at which time when it is called the user will be - * prompted again. The user is also given the option to not be prompted again. - * If the user does choose to install Growl, the requested notification will - * be displayed once Growl is installed and running. - */ -GROWL_EXPORT void Growl_PostNotification(const struct Growl_Notification *notification); - -/*! @function Growl_PostNotificationWithDictionary -* @abstract Notifies using a userInfo dictionary suitable for passing to -* CFDistributedNotificationCenter. -* @param userInfo The dictionary to notify with. -* @discussion Before Growl 0.6, your application would have posted -* notifications using CFDistributedNotificationCenter by creating a userInfo -* dictionary with the notification data. This had the advantage of allowing -* you to add other data to the dictionary for programs besides Growl that -* might be listening. -* -* This function allows you to use such dictionaries without being restricted -* to using CFDistributedNotificationCenter. The keys for this dictionary - * can be found in GrowlDefines.h. -*/ -GROWL_EXPORT void Growl_PostNotificationWithDictionary(CFDictionaryRef userInfo); - -/*! @function Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext - * @abstract Posts a Growl notification using parameter values. - * @param title The title of the notification. - * @param description The description of the notification. - * @param notificationName The name of the notification as listed in the - * registration dictionary. - * @param iconData Data representing a notification icon. Can be <code>NULL</code>. - * @param priority The priority of the notification (-2 to +2, with -2 - * being Very Low and +2 being Very High). - * @param isSticky If true, requests that this notification wait for a - * response from the user. - * @param clickContext An object to pass to the clickCallback, if any. Can - * be <code>NULL</code>, in which case the clickCallback is not called. - * @discussion Creates a temporary Growl_Notification, fills it out with the - * supplied information, and calls Growl_PostNotification on it. - * See struct Growl_Notification and Growl_PostNotification for more - * information. - * - * The icon data can be in any format supported by NSImage. As of Mac OS X - * 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT formats. - */ -GROWL_EXPORT void Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext( - /*inhale*/ - CFStringRef title, - CFStringRef description, - CFStringRef notificationName, - CFDataRef iconData, - signed int priority, - Boolean isSticky, - CFPropertyListRef clickContext); - -#pragma mark - - -// @functiongroup Registering - -/*! @function Growl_RegisterWithDictionary - * @abstract Register your application with Growl without setting a delegate. - * @discussion When you call this function with a dictionary, - * GrowlApplicationBridge registers your application using that dictionary. - * If you pass <code>NULL</code>, GrowlApplicationBridge will ask the delegate - * (if there is one) for a dictionary, and if that doesn't work, it will look - * in your application's bundle for an auto-discoverable plist. - * (XXX refer to more information on that) - * - * If you pass a dictionary to this function, it must include the - * <code>GROWL_APP_NAME</code> key, unless a delegate is set. - * - * This function is mainly an alternative to the delegate system introduced - * with Growl 0.6. Without a delegate, you cannot receive callbacks such as - * <code>growlIsReady</code> (since they are sent to the delegate). You can, - * however, set a delegate after registering without one. - * - * This function was introduced in Growl.framework 0.7. - * @result <code>false</code> if registration failed (e.g. if Growl isn't installed). - */ -GROWL_EXPORT Boolean Growl_RegisterWithDictionary(CFDictionaryRef regDict); - -/*! @function Growl_Reregister - * @abstract Updates your registration with Growl. - * @discussion If your application changes the contents of the - * GROWL_NOTIFICATIONS_ALL key in the registrationDictionary member of the - * Growl delegate, or if it changes the value of that member, or if it - * changes the contents of its auto-discoverable plist, call this function - * to have Growl update its registration information for your application. - * - * Otherwise, this function does not normally need to be called. If you're - * using a delegate, your application will be registered when you set the - * delegate if both the delegate and its registrationDictionary member are - * non-<code>NULL</code>. - * - * This function is now implemented using - * <code>Growl_RegisterWithDictionary</code>. - */ -GROWL_EXPORT void Growl_Reregister(void); - -#pragma mark - - -/*! @function Growl_SetWillRegisterWhenGrowlIsReady - * @abstract Tells GrowlApplicationBridge to register with Growl when Growl - * launches (or not). - * @discussion When Growl has started listening for notifications, it posts a - * <code>GROWL_IS_READY</code> notification on the Distributed Notification - * Center. GrowlApplicationBridge listens for this notification, using it to - * perform various tasks (such as calling your delegate's - * <code>growlIsReady</code> callback, if it has one). If this function is - * called with <code>true</code>, one of those tasks will be to reregister - * with Growl (in the manner of <code>Growl_Reregister</code>). - * - * This attribute is automatically set back to <code>false</code> - * (the default) after every <code>GROWL_IS_READY</code> notification. - * @param flag <code>true</code> if you want GrowlApplicationBridge to register with - * Growl when next it is ready; <code>false</code> if not. - */ -GROWL_EXPORT void Growl_SetWillRegisterWhenGrowlIsReady(Boolean flag); -/*! @function Growl_WillRegisterWhenGrowlIsReady - * @abstract Reports whether GrowlApplicationBridge will register with Growl - * when Growl next launches. - * @result <code>true</code> if GrowlApplicationBridge will register with - * Growl when next it posts GROWL_IS_READY; <code>false</code> if not. - */ -GROWL_EXPORT Boolean Growl_WillRegisterWhenGrowlIsReady(void); - -#pragma mark - - -// @functiongroup Obtaining registration dictionaries - -/*! @function Growl_CopyRegistrationDictionaryFromDelegate - * @abstract Asks the delegate for a registration dictionary. - * @discussion If no delegate is set, or if the delegate's - * <code>registrationDictionary</code> member is <code>NULL</code>, this - * function returns <code>NULL</code>. - * - * This function does not attempt to clean up the dictionary in any way - for - * example, if it is missing the <code>GROWL_APP_NAME</code> key, the result - * will be missing it too. Use - * <code>Growl_CreateRegistrationDictionaryByFillingInDictionary</code> or - * <code>Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys</code> - * to try to fill in missing keys. - * - * This function was introduced in Growl.framework 0.7. - * @result A registration dictionary. - */ -GROWL_EXPORT CFDictionaryRef Growl_CopyRegistrationDictionaryFromDelegate(void); - -/*! @function Growl_CopyRegistrationDictionaryFromBundle - * @abstract Looks in a bundle for a registration dictionary. - * @discussion This function looks in a bundle for an auto-discoverable - * registration dictionary file using <code>CFBundleCopyResourceURL</code>. - * If it finds one, it loads the file using <code>CFPropertyList</code> and - * returns the result. - * - * If you pass <code>NULL</code> as the bundle, the main bundle is examined. - * - * This function does not attempt to clean up the dictionary in any way - for - * example, if it is missing the <code>GROWL_APP_NAME</code> key, the result - * will be missing it too. Use - * <code>Growl_CreateRegistrationDictionaryByFillingInDictionary:</code> or - * <code>Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys</code> - * to try to fill in missing keys. - * - * This function was introduced in Growl.framework 0.7. - * @result A registration dictionary. - */ -GROWL_EXPORT CFDictionaryRef Growl_CopyRegistrationDictionaryFromBundle(CFBundleRef bundle); - -/*! @function Growl_CreateBestRegistrationDictionary - * @abstract Obtains a registration dictionary, filled out to the best of - * GrowlApplicationBridge's knowledge. - * @discussion This function creates a registration dictionary as best - * GrowlApplicationBridge knows how. - * - * First, GrowlApplicationBridge examines the Growl delegate (if there is - * one) and gets the registration dictionary from that. If no such dictionary - * was obtained, GrowlApplicationBridge looks in your application's main - * bundle for an auto-discoverable registration dictionary file. If that - * doesn't exist either, this function returns <code>NULL</code>. - * - * Second, GrowlApplicationBridge calls - * <code>Growl_CreateRegistrationDictionaryByFillingInDictionary</code> with - * whatever dictionary was obtained. The result of that function is the - * result of this function. - * - * GrowlApplicationBridge uses this function when you call - * <code>Growl_SetDelegate</code>, or when you call - * <code>Growl_RegisterWithDictionary</code> with <code>NULL</code>. - * - * This function was introduced in Growl.framework 0.7. - * @result A registration dictionary. - */ -GROWL_EXPORT CFDictionaryRef Growl_CreateBestRegistrationDictionary(void); - -#pragma mark - - -// @functiongroup Filling in registration dictionaries - -/*! @function Growl_CreateRegistrationDictionaryByFillingInDictionary - * @abstract Tries to fill in missing keys in a registration dictionary. - * @param regDict The dictionary to fill in. - * @result The dictionary with the keys filled in. - * @discussion This function examines the passed-in dictionary for missing keys, - * and tries to work out correct values for them. As of 0.7, it uses: - * - * Key Value - * --- ----- - * <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code> - * <code>GROWL_APP_ICON</code> The icon of the application. - * <code>GROWL_APP_LOCATION</code> The location of the application. - * <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code> - * - * Keys are only filled in if missing; if a key is present in the dictionary, - * its value will not be changed. - * - * This function was introduced in Growl.framework 0.7. - */ -GROWL_EXPORT CFDictionaryRef Growl_CreateRegistrationDictionaryByFillingInDictionary(CFDictionaryRef regDict); -/*! @function Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys - * @abstract Tries to fill in missing keys in a registration dictionary. - * @param regDict The dictionary to fill in. - * @param keys The keys to fill in. If <code>NULL</code>, any missing keys are filled in. - * @result The dictionary with the keys filled in. - * @discussion This function examines the passed-in dictionary for missing keys, - * and tries to work out correct values for them. As of 0.7, it uses: - * - * Key Value - * --- ----- - * <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code> - * <code>GROWL_APP_ICON</code> The icon of the application. - * <code>GROWL_APP_LOCATION</code> The location of the application. - * <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code> - * - * Only those keys that are listed in <code>keys</code> will be filled in. - * Other missing keys are ignored. Also, keys are only filled in if missing; - * if a key is present in the dictionary, its value will not be changed. - * - * This function was introduced in Growl.framework 0.7. - */ -GROWL_EXPORT CFDictionaryRef Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys(CFDictionaryRef regDict, CFSetRef keys); - -/*! @brief Tries to fill in missing keys in a notification dictionary. - * @param notifDict The dictionary to fill in. - * @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict. - * @discussion This function examines the \a notifDict for missing keys, and - * tries to get them from the last known registration dictionary. As of 1.1, - * the keys that it will look for are: - * - * \li <code>GROWL_APP_NAME</code> - * \li <code>GROWL_APP_ICON</code> - * - * @since Growl.framework 1.1 - */ -GROWL_EXPORT CFDictionaryRef Growl_CreateNotificationDictionaryByFillingInDictionary(CFDictionaryRef notifDict); - -#pragma mark - - -// @functiongroup Querying Growl's status - -/*! @function Growl_IsInstalled - * @abstract Determines whether the Growl prefpane and its helper app are - * installed. - * @result Returns true if Growl is installed, false otherwise. - */ -GROWL_EXPORT Boolean Growl_IsInstalled(void); - -/*! @function Growl_IsRunning - * @abstract Cycles through the process list to find whether GrowlHelperApp - * is running. - * @result Returns true if Growl is running, false otherwise. - */ -GROWL_EXPORT Boolean Growl_IsRunning(void); - -#pragma mark - - -// @functiongroup Launching Growl - -/*! @typedef GrowlLaunchCallback - * @abstract Callback to notify you that Growl is running. - * @param context The context pointer passed to Growl_LaunchIfInstalled. - * @discussion Growl_LaunchIfInstalled calls this callback function if Growl - * was already running or if it launched Growl successfully. - */ -typedef void (*GrowlLaunchCallback)(void *context); - -/*! @function Growl_LaunchIfInstalled - * @abstract Launches GrowlHelperApp if it is not already running. - * @param callback A callback function which will be called if Growl was successfully - * launched or was already running. Can be <code>NULL</code>. - * @param context The context pointer to pass to the callback. Can be <code>NULL</code>. - * @result Returns true if Growl was successfully launched or was already - * running; returns false and does not call the callback otherwise. - * @discussion Returns true and calls the callback (if the callback is not - * <code>NULL</code>) if the Growl helper app began launching or was already - * running. Returns false and performs no other action if Growl could not be - * launched (e.g. because the Growl preference pane is not properly installed). - * - * If <code>Growl_CreateBestRegistrationDictionary</code> returns - * non-<code>NULL</code>, this function will register with Growl atomically. - * - * The callback should take a single argument; this is to allow applications - * to have context-relevant information passed back. It is perfectly - * acceptable for context to be <code>NULL</code>. The callback itself can be - * <code>NULL</code> if you don't want one. - */ -GROWL_EXPORT Boolean Growl_LaunchIfInstalled(GrowlLaunchCallback callback, void *context); - -#pragma mark - -#pragma mark Constants - -/*! @defined GROWL_PREFPANE_BUNDLE_IDENTIFIER - * @abstract The CFBundleIdentifier of the Growl preference pane bundle. - * @discussion GrowlApplicationBridge uses this to determine whether Growl is - * currently installed, by searching for the Growl preference pane. Your - * application probably does not need to use this macro itself. - */ -#ifndef GROWL_PREFPANE_BUNDLE_IDENTIFIER -#define GROWL_PREFPANE_BUNDLE_IDENTIFIER CFSTR("com.growl.prefpanel") -#endif - -__END_DECLS - -#endif /* _GROWLAPPLICATIONBRIDGE_CARBON_H_ */ diff --git a/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h b/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h index 8afda27e..36397576 100644 --- a/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h +++ b/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h @@ -18,14 +18,11 @@ #import <Foundation/Foundation.h> #import <AppKit/AppKit.h> -#import "GrowlDefines.h" +#import <Growl/GrowlDefines.h> //Forward declarations @protocol GrowlApplicationBridgeDelegate; -//Internal notification when the user chooses not to install (to avoid continuing to cache notifications awaiting installation) -#define GROWL_USER_CHOSE_NOT_TO_INSTALL_NOTIFICATION @"User chose not to install" - //------------------------------------------------------------------------------ #pragma mark - @@ -45,7 +42,7 @@ * @method isGrowlInstalled * @abstract Detects whether Growl is installed. * @discussion Determines if the Growl prefpane and its helper app are installed. - * @result this method will forever return YES + * @result this method will forever return YES. */ + (BOOL) isGrowlInstalled __attribute__((deprecated)); @@ -57,6 +54,34 @@ */ + (BOOL) isGrowlRunning; + +/*! + * @method isMistEnabled + * @abstract Gives the caller a fairly good indication of whether or not built-in notifications(Mist) will be used. + * @discussion since this call makes use of isGrowlRunning it is entirely possible for this value to change between call and + * executing a notification dispatch + * @result Returns YES if Growl isn't reachable and the developer has not opted-out of + * Mist and the user hasn't set the global mist enable key to false. + */ ++ (BOOL)isMistEnabled; + +/*! + * @method setShouldUseBuiltInNotifications + * @abstract opt-out mechanism for the mist notification style in the event growl can't be reached. + * @discussion if growl is unavailable due to not being installed or as a result of being turned off then + * this option can enable/disable a built-in fire and forget display style + * @param should Specifies whether or not the developer wants to opt-in (default) or opt out + * of the built-in Mist style in the event Growl is unreachable. + */ ++ (void)setShouldUseBuiltInNotifications:(BOOL)should; + +/*! + * @method shouldUseBuiltInNotifications + * @abstract returns the current opt-in state of the framework's use of the Mist display style. + * @result Returns NO if the developer opt-ed out of Mist, the default value is YES. + */ ++ (BOOL)shouldUseBuiltInNotifications; + #pragma mark - /*! @@ -87,7 +112,7 @@ * * @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 @@ -95,7 +120,7 @@ * @discussion See setGrowlDelegate: for details. * @result The Growl delegate. */ -+ (NSObject<GrowlApplicationBridgeDelegate> *) growlDelegate; ++ (id<GrowlApplicationBridgeDelegate>) growlDelegate; #pragma mark - @@ -235,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. @@ -323,7 +349,7 @@ * Key Value * --- ----- * <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code> - * <code>GROWL_APP_ICON</code> The icon of the application. + * <code>GROWL_APP_ICON_DATA</code> The data of the icon of the application. * <code>GROWL_APP_LOCATION</code> The location of the application. * <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code> * @@ -336,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, @@ -344,7 +371,7 @@ * Key Value * --- ----- * <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code> - * <code>GROWL_APP_ICON</code> The icon of the application. + * <code>GROWL_APP_ICON_DATA</code> The data of the icon of the application. * <code>GROWL_APP_LOCATION</code> The location of the application. * <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code> * @@ -368,30 +395,38 @@ * the keys that it will look for are: * * \li <code>GROWL_APP_NAME</code> - * \li <code>GROWL_APP_ICON</code> + * \li <code>GROWL_APP_ICON_DATA</code> * * @since Growl.framework 1.1 */ + (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 @@ -399,11 +434,17 @@ #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 @@ -510,66 +551,17 @@ */ - (void) growlNotificationTimedOut:(id)clickContext; -@end - -#pragma mark - -/*! - * @category NSObject(GrowlApplicationBridgeDelegate_Installation_InformalProtocol) - * @abstract Methods which may be optionally implemented by the Growl delegate when used with Growl-WithInstaller.framework. - * @discussion The methods in this informal protocol will only be called if - * implemented by the delegate. They allow greater control of the information - * presented to the user when installing or upgrading Growl from within your - * application when using Growl-WithInstaller.framework. - */ -@interface NSObject (GrowlApplicationBridgeDelegate_Installation_InformalProtocol) - -/*! - * @method growlInstallationWindowTitle - * @abstract Return the title of the installation window. - * @discussion If not implemented, Growl will use a default, localized title. - * @result An NSString object to use as the title. - */ -- (NSString *)growlInstallationWindowTitle; - -/*! - * @method growlUpdateWindowTitle - * @abstract Return the title of the upgrade window. - * @discussion If not implemented, Growl will use a default, localized title. - * @result An NSString object to use as the title. - */ -- (NSString *)growlUpdateWindowTitle; - -/*! - * @method growlInstallationInformation - * @abstract Return the information to display when installing. - * @discussion This information may be as long or short as desired (the window - * will be sized to fit it). It will be displayed to the user as an - * explanation of what Growl is and what it can do in your application. It - * should probably note that no download is required to install. - * - * If this is not implemented, Growl will use a default, localized explanation. - * @result An NSAttributedString object to display. - */ -- (NSAttributedString *)growlInstallationInformation; /*! - * @method growlUpdateInformation - * @abstract Return the information to display when upgrading. - * @discussion This information may be as long or short as desired (the window - * will be sized to fit it). It will be displayed to the user as an - * explanation that an updated version of Growl is included in your - * application and no download is required. - * - * If this is not implemented, Growl will use a default, localized explanation. - * @result An NSAttributedString object to display. + * @method hasNetworkClientEntitlement + * @abstract Used only in sandboxed situations since we don't know whether the app has com.apple.security.network.client entitlement + * @discussion GrowlDelegate calls to find out if we have the com.apple.security.network.client entitlement, + * since we can't find this out without hitting the sandbox. We only call it if we detect that the application is sandboxed. */ -- (NSAttributedString *)growlUpdateInformation; +- (BOOL) hasNetworkClientEntitlement; @end -//private -@interface GrowlApplicationBridge (GrowlInstallationPrompt_private) -+ (void) _userChoseNotToInstallGrowl; -@end +#pragma mark - #endif /* __GrowlApplicationBridge_h__ */ diff --git a/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h b/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h index 2b971cfe..0a196f1e 100644 --- a/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h +++ b/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h @@ -7,10 +7,8 @@ #ifdef __OBJC__ #define XSTR(x) (@x) -#define STRING_TYPE NSString * #else #define XSTR CFSTR -#define STRING_TYPE CFStringRef #endif /*! @header GrowlDefines.h @@ -56,7 +54,7 @@ * This key is optional. */ #define GROWL_APP_ID XSTR("ApplicationId") -/*! @defined GROWL_APP_ICON +/*! @defined GROWL_APP_ICON_DATA * @abstract The image data for your application's icon. * @discussion Image data representing your application's icon. This may be * superimposed on a notification icon as a badge, used as the notification @@ -66,7 +64,7 @@ * * Optional. Not supported by all display plugins. */ -#define GROWL_APP_ICON XSTR("ApplicationIcon") +#define GROWL_APP_ICON_DATA XSTR("ApplicationIcon") /*! @defined GROWL_NOTIFICATIONS_DEFAULT * @abstract The array of notifications to turn on by default. * @discussion These are the names of the notifications that should be enabled @@ -101,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. @@ -144,20 +150,20 @@ */ #define GROWL_NOTIFICATION_DESCRIPTION XSTR("NotificationDescription") /*! @defined GROWL_NOTIFICATION_ICON - * @discussion Image data for the notification icon. Must be in a format + * @discussion Image data for the notification icon. Image data must be in a format * supported by NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. * * Optional. Not supported by all display plugins. */ -#define GROWL_NOTIFICATION_ICON XSTR("NotificationIcon") +#define GROWL_NOTIFICATION_ICON_DATA XSTR("NotificationIcon") /*! @defined GROWL_NOTIFICATION_APP_ICON * @discussion Image data for the application icon, in case GROWL_APP_ICON does - * not apply for some reason. Must be in a format supported by NSImage, such + * not apply for some reason. Image data be in a format supported by NSImage, such * as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. * * Optional. Not supported by all display plugins. */ -#define GROWL_NOTIFICATION_APP_ICON XSTR("NotificationAppIcon") +#define GROWL_NOTIFICATION_APP_ICON_DATA XSTR("NotificationAppIcon") /*! @defined GROWL_NOTIFICATION_PRIORITY * @discussion The priority of the notification as an integer number from * -2 to +2 (+2 being highest). @@ -185,16 +191,6 @@ */ #define GROWL_NOTIFICATION_CLICK_CONTEXT XSTR("NotificationClickContext") -/*! @defined GROWL_DISPLAY_PLUGIN - * @discussion The name of a display plugin which should be used for this notification. - * Optional. If this key is not set or the specified display plugin does not - * exist, the display plugin stored in the application ticket is used. This key - * allows applications to use different default display plugins for their - * notifications. The user can still override those settings in the preference - * pane. - */ -#define GROWL_DISPLAY_PLUGIN XSTR("NotificationDisplayPlugin") - /*! @defined GROWL_NOTIFICATION_IDENTIFIER * @abstract An identifier for the notification for coalescing purposes. * Notifications with the same identifier fall into the same class; only @@ -224,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 @@ -245,7 +254,7 @@ * The userInfo dictionary for this notification can contain these keys: * <ul> * <li>GROWL_APP_NAME</li> - * <li>GROWL_APP_ICON</li> + * <li>GROWL_APP_ICON_DATA</li> * <li>GROWL_NOTIFICATIONS_ALL</li> * <li>GROWL_NOTIFICATIONS_DEFAULT</li> * </ul> @@ -288,12 +297,6 @@ * Growl_PostNotification. */ #define GROWL_NOTIFICATION XSTR("GrowlNotification") -/*! @defined GROWL_SHUTDOWN -* @abstract The distributed notification name that tells Growl to shutdown. -* @discussion The Growl preference pane posts this notification when the -* "Stop Growl" button is clicked. -*/ -#define GROWL_SHUTDOWN XSTR("GrowlShutdown") /*! @defined GROWL_PING * @abstract A distributed notification to check whether Growl is running. * @discussion This is used by the Growl preference pane. If it receives a @@ -313,15 +316,48 @@ * registration dictionary supplied by its delegate. */ #define GROWL_IS_READY XSTR("Lend Me Some Sugar; I Am Your Neighbor!") -/*! @defined GROWL_NOTIFICATION_CLICKED - * @abstract The distributed notification sent when a supported notification is clicked. + + +/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX + * @abstract Part of the name of the distributed notification sent when a supported notification is clicked. * @discussion When a Growl notification with a click context is clicked on by - * the user, Growl posts this distributed notification. - * The GrowlApplicationBridge responds to this notification by calling a - * callback in its delegate. + * the user, Growl posts a distributed notification whose name is in the format: + * [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX] + * The GrowlApplicationBridge responds to this notification by calling a callback in its delegate. + */ +#define GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX XSTR("GrowlClicked!") + +/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX + * @abstract Part of the name of the distributed notification sent when a supported notification times out without being clicked. + * @discussion When a Growl notification with a click context times out, Growl posts a distributed notification + * whose name is in the format: + * [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX] + * The GrowlApplicationBridge responds to this notification by calling a callback in its delegate. + * NOTE: The user may have actually clicked the 'close' button; this triggers an *immediate* time-out of the notification. */ -#define GROWL_NOTIFICATION_CLICKED XSTR("GrowlClicked!") -#define GROWL_NOTIFICATION_TIMED_OUT XSTR("GrowlTimedOut!") +#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. */ @@ -345,4 +381,6 @@ #define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition" +#define GROWL_PLUGIN_CONFIG_ID XSTR("GrowlPluginConfigurationID") + #endif //ndef _GROWLDEFINES_H diff --git a/Frameworks/Growl.framework/Versions/A/Resources/Info.plist b/Frameworks/Growl.framework/Versions/A/Resources/Info.plist index fa23da2d..6a90f41b 100644 --- a/Frameworks/Growl.framework/Versions/A/Resources/Info.plist +++ b/Frameworks/Growl.framework/Versions/A/Resources/Info.plist @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>BuildMachineOSBuild</key> - <string>11C74</string> + <string>12C60</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.2.3</string> + <string>2.0.1</string> <key>CFBundleSignature</key> <string>GRRR</string> <key>CFBundleVersion</key> - <string>1.2.3</string> + <string>2.0.1</string> <key>DTCompiler</key> - <string>4.0</string> + <string>com.apple.compilers.llvm.clang.1_0</string> <key>DTPlatformBuild</key> - <string>10M2518</string> + <string>4G2008a</string> <key>DTPlatformVersion</key> - <string>PG</string> + <string>GM</string> <key>DTSDKBuild</key> - <string>9L31a</string> + <string>12C37</string> <key>DTSDKName</key> - <string>macosx10.5</string> + <string>macosx10.8</string> <key>DTXcode</key> - <string>0400</string> + <string>0452</string> <key>DTXcodeBuild</key> - <string>10M2518</string> + <string>4G2008a</string> <key>NSPrincipalClass</key> <string>GrowlApplicationBridge</string> </dict> diff --git a/Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources b/Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources new file mode 100644 index 00000000..420b594a --- /dev/null +++ b/Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>files</key> + <dict> + <key>Resources/Info.plist</key> + <data> + VZb3f8My4te/5JwcjfvotgCXTAs= + </data> + </dict> + <key>rules</key> + <dict> + <key>^Resources/</key> + <true/> + <key>^Resources/.*\.lproj/</key> + <dict> + <key>optional</key> + <true/> + <key>weight</key> + <real>1000</real> + </dict> + <key>^Resources/.*\.lproj/locversion.plist$</key> + <dict> + <key>omit</key> + <true/> + <key>weight</key> + <real>1100</real> + </dict> + <key>^version.plist$</key> + <true/> + </dict> +</dict> +</plist> diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h b/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h index ae2e37d0..c20a9c2b 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h @@ -1,15 +1,26 @@ -//--------------------------------------------------------------------------------------- -// $Id: NSNotificationCenter+OCMAdditions.h$ -// Copyright (c) 2009 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2009-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import <Foundation/Foundation.h> -@class OCMockObserver; +@class OCObserverMockObject; @interface NSNotificationCenter(OCMAdditions) -- (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; @end diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h index a775f39f..d53437cb 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h @@ -1,7 +1,18 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2009 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2009-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import <Foundation/Foundation.h> @@ -10,15 +21,21 @@ // constraining arguments + (id)any; ++ (SEL)anySelector; + (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; + (id)isNil; + (id)isNotNil; ++ (id)isEqual:(id)value; + (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; // manipulating arguments + (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; // internal use only @@ -27,4 +44,10 @@ @end #define OCMOCK_ANY [OCMArg any] -#define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(typeof(variable))] + +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) + #define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) +#else + #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] +#endif diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h index 0bab7775..777966ab 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h @@ -1,21 +1,34 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2007-2009 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2007-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import <Foundation/Foundation.h> + @interface OCMConstraint : NSObject -+ (id)constraint; ++ (instancetype)constraint; - (BOOL)evaluate:(id)value; // if you are looking for any, isNil, etc, they have moved to OCMArg -+ (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; -+ (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; -// try to use [OCMArg checkWith...] instead of constraintWithSelector in here @end @@ -44,5 +57,15 @@ @end +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + + #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h new file mode 100644 index 00000000..e510db7a --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import <Foundation/Foundation.h> + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h new file mode 100644 index 00000000..4b2d6350 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import <Foundation/Foundation.h> + +@class OCMLocation; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +@end diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h new file mode 100644 index 00000000..f56d2ca4 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import <Foundation/Foundation.h> + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; + +- (OCMInvocationMatcher *)invocationMatcher; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h new file mode 100644 index 00000000..890c9ef3 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import "OCMRecorder.h" + + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ __typeof__(aValue) _v = (aValue); [NSValue value:&_v withObjCType:@encode(__typeof__(_v))]; })) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +@end + + + diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h index e18de58a..f0083b35 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h @@ -1,10 +1,84 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2004-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import <OCMock/OCMockObject.h> -#import <OCMock/OCMockRecorder.h> +#import <OCMock/OCMRecorder.h> +#import <OCMock/OCMStubRecorder.h> #import <OCMock/OCMConstraint.h> #import <OCMock/OCMArg.h> +#import <OCMock/OCMLocation.h> +#import <OCMock/OCMMacroState.h> #import <OCMock/NSNotificationCenter+OCMAdditions.h> + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + invocation; \ + [OCMMacroState endStubMacro]; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + invocation; \ + [OCMMacroState endExpectMacro]; \ + ); \ +}) + +#define ClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + invocation; \ + [OCMMacroState endVerifyMacro]; \ + ); \ +}) + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h index 87e7b82e..63f2bae2 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h @@ -1,17 +1,36 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2004-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import <Foundation/Foundation.h> +@class OCMLocation; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + @interface OCMockObject : NSProxy { BOOL isNice; BOOL expectationOrderMatters; - NSMutableArray *recorders; + NSMutableArray *stubs; NSMutableArray *expectations; NSMutableArray *exceptions; + NSMutableArray *invocations; } + (id)mockForClass:(Class)aClass; @@ -23,19 +42,33 @@ + (id)observerMock; -- (id)init; +- (instancetype)init; - (void)setExpectationOrderMatters:(BOOL)flag; - (id)stub; - (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; -- (void)verify; +- (void)stopMocking; // internal use only -- (id)getNewRecorder; +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; + - (BOOL)handleInvocation:(NSInvocation *)anInvocation; - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; @end + diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h deleted file mode 100644 index 7463a3f4..00000000 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h +++ /dev/null @@ -1,28 +0,0 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2004-2009 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- - -#import <Foundation/Foundation.h> - -@interface OCMockRecorder : NSProxy -{ - id signatureResolver; - NSInvocation *recordedInvocation; - NSMutableArray *invocationHandlers; -} - -- (id)initWithSignatureResolver:(id)anObject; - -- (BOOL)matchesInvocation:(NSInvocation *)anInvocation; -- (void)releaseInvocation; - -- (id)andReturn:(id)anObject; -- (id)andReturnValue:(NSValue *)aValue; -- (id)andThrow:(NSException *)anException; -- (id)andPost:(NSNotification *)aNotification; -- (id)andCall:(SEL)selector onObject:(id)anObject; - -- (NSArray *)invocationHandlers; - -@end diff --git a/Frameworks/OCMock.framework/Versions/A/OCMock b/Frameworks/OCMock.framework/Versions/A/OCMock Binary files differindex 303e9337..3fb5afb5 100755 --- a/Frameworks/OCMock.framework/Versions/A/OCMock +++ b/Frameworks/OCMock.framework/Versions/A/OCMock diff --git a/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist b/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist index 4634d14c..20bc2603 100644 --- a/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist +++ b/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist @@ -2,6 +2,8 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> + <key>BuildMachineOSBuild</key> + <string>13F34</string> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> @@ -15,12 +17,26 @@ <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> - <string>1.29</string> + <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> + <key>DTCompiler</key> + <string>com.apple.compilers.llvm.clang.1_0</string> + <key>DTPlatformBuild</key> + <string>6A2008a</string> + <key>DTPlatformVersion</key> + <string>GM</string> + <key>DTSDKBuild</key> + <string>14A382</string> + <key>DTSDKName</key> + <string>macosx10.10</string> + <key>DTXcode</key> + <string>0611</string> + <key>DTXcodeBuild</key> + <string>6A2008a</string> <key>NSHumanReadableCopyright</key> - <string>Copyright © 2004-2009 Mulle Kybernetik.</string> + <string>Copyright © 2004-2013 Mulle Kybernetik.</string> </dict> </plist> diff --git a/Frameworks/OCMock.framework/Versions/A/Resources/License.txt b/Frameworks/OCMock.framework/Versions/A/Resources/License.txt deleted file mode 100644 index e2c13960..00000000 --- a/Frameworks/OCMock.framework/Versions/A/Resources/License.txt +++ /dev/null @@ -1,15 +0,0 @@ - - Copyright (c) 2004-2009 by Mulle Kybernetik. All rights reserved. - - Permission to use, copy, modify and distribute this software and its documentation - is hereby granted, provided that both the copyright notice and this permission - notice appear in all copies of the software, derivative works or modified versions, - and any portions thereof, and that both notices appear in supporting documentation, - and that credit is given to Mulle Kybernetik in all documents and publicity - pertaining to direct or indirect use of this code or its derivatives. - - THIS IS EXPERIMENTAL SOFTWARE AND IT IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE - SERIOUS CONSEQUENCES. THE COPYRIGHT HOLDER ALLOWS FREE USE OF THIS SOFTWARE IN ITS - "AS IS" CONDITION. THE COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY - DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE - OR OF ANY DERIVATIVE WORK.
\ No newline at end of file diff --git a/Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings b/Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings Binary files differnew file mode 100644 index 00000000..5e45963c --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m index 7e8eae87..7c1b059c 100644 --- a/Frameworks/PSMTabBar/PSMTabBarControl.m +++ b/Frameworks/PSMTabBar/PSMTabBarControl.m @@ -193,7 +193,7 @@ if (self) { // Initialization [self initAddedProperties]; - [self registerForDraggedTypes:[NSArray arrayWithObjects:@"PSMTabBarControlItemPBType", nil]]; + [self registerForDraggedTypes:@[@"PSMTabBarControlItemPBType"]]; // resize [self setPostsFrameChangedNotifications:YES]; @@ -1497,7 +1497,7 @@ } // NSDraggingSource -- (NSUInteger)draggingSourceOperationMaskForLocal:(BOOL)isLocal +- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { return (isLocal ? NSDragOperationMove : NSDragOperationNone); } @@ -1990,7 +1990,7 @@ // Initialization [self initAddedProperties]; - [self registerForDraggedTypes:[NSArray arrayWithObjects:@"PSMTabBarControlItemPBType", nil]]; + [self registerForDraggedTypes:@[@"PSMTabBarControlItemPBType"]]; if ([aDecoder allowsKeyedCoding]) { _cells = [[aDecoder decodeObjectForKey:@"PSMcells"] retain]; diff --git a/Frameworks/PSMTabBar/PSMTabBarController.m b/Frameworks/PSMTabBar/PSMTabBarController.m index 4ab2c1ef..eddf4174 100644 --- a/Frameworks/PSMTabBar/PSMTabBarController.m +++ b/Frameworks/PSMTabBar/PSMTabBarController.m @@ -633,7 +633,7 @@ static NSInteger potentialMinimumForArray(NSArray *array, NSInteger minimum) } } - return TRUE; + return YES; } - (NSInteger)numberOfItemsInMenu:(NSMenu *)menu diff --git a/Frameworks/PSMTabBar/PSMTabDragAssistant.m b/Frameworks/PSMTabBar/PSMTabDragAssistant.m index bb2d255a..f10eadd4 100644 --- a/Frameworks/PSMTabBar/PSMTabDragAssistant.m +++ b/Frameworks/PSMTabBar/PSMTabDragAssistant.m @@ -192,7 +192,7 @@ static PSMTabDragAssistant *sharedDragAssistant = nil; } [cell setHighlighted:NO]; NSSize offset = NSZeroSize; - [pboard declareTypes:[NSArray arrayWithObjects:@"PSMTabBarControlItemPBType", nil] owner: nil]; + [pboard declareTypes:@[@"PSMTabBarControlItemPBType"] owner:nil]; [pboard setString:[[NSNumber numberWithInteger:[[control cells] indexOfObject:cell]] stringValue] forType:@"PSMTabBarControlItemPBType"]; _animationTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0/30.0) target:self selector:@selector(animateDrag:) userInfo:nil repeats:YES]; @@ -768,7 +768,7 @@ static PSMTabDragAssistant *sharedDragAssistant = nil; PSMTabBarControl *tabBar; while ( (tabBar = [e nextObject]) ) { [self calculateDragAnimationForTabBar:tabBar]; - [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:tabBar argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; + [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:tabBar argument:nil order:1 modes:@[@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode"]]; } } diff --git a/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h b/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h index 350e9f1c..7a8578ad 100644 --- a/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h +++ b/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h @@ -1,6 +1,7 @@ -/* Copyright (c) 1996, 1999-2004, 2007 MySQL AB - Use is subject to license terms - This file is public domain and comes with NO WARRANTY of any kind */ +/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB + & Detron HB, 1996, 1999-2004, 2007 MySQL AB. + This file is public domain and comes with NO WARRANTY of any kind +*/ /* Version numbers for protocol & mysqld */ @@ -10,11 +11,11 @@ #include <custom_conf.h> #else #define PROTOCOL_VERSION 10 -#define MYSQL_SERVER_VERSION "5.5.33" +#define MYSQL_SERVER_VERSION "5.5.42" #define MYSQL_BASE_VERSION "mysqld-5.5" #define MYSQL_SERVER_SUFFIX_DEF "" #define FRM_VER 6 -#define MYSQL_VERSION_ID 50533 +#define MYSQL_VERSION_ID 50542 #define MYSQL_PORT 3306 #define MYSQL_PORT_DEFAULT 0 #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" diff --git a/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a b/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a Binary files differindex aad3f2a3..aa0d6109 100644 --- a/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a +++ b/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m index 022708b8..32efa375 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m @@ -54,6 +54,7 @@ [copy setSocketPath:socketPath]; [copy setUseSSL:useSSL]; [copy setSslKeyFilePath:sslKeyFilePath]; + [copy setSslCipherList:sslCipherList]; [copy setSslCertificatePath:sslCertificatePath]; [copy setSslCACertificatePath:sslCACertificatePath]; [copy setTimeout:timeout]; diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m index 85b2db9b..be6d054b 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m @@ -111,7 +111,7 @@ // Trigger a reconnect depending on connection usage recently. If the connection has // actively been used in the last couple of minutes, trigger a full reconnection attempt. if (_elapsedSecondsSinceAbsoluteTime(lastConnectionUsedTime) < 60 * 2) { - reconnectionThread = [[[NSThread alloc] initWithTarget:self selector:@selector(_reconnectAllowingRetries:) object:[NSNumber numberWithBool:YES]] autorelease]; + reconnectionThread = [[[NSThread alloc] initWithTarget:self selector:@selector(_reconnectAllowingRetries:) object:@YES] autorelease]; [reconnectionThread setName:@"SPMySQL reconnection thread (full)"]; [reconnectionThread start]; diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h index 34b21043..1720fcf6 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h @@ -51,6 +51,7 @@ NSString *sslKeyFilePath; NSString *sslCertificatePath; NSString *sslCACertificatePath; + NSString *sslCipherList; // MySQL connection details and state struct st_mysql *mySQLConnection; @@ -143,6 +144,15 @@ @property (readwrite, retain) NSString *sslCertificatePath; @property (readwrite, retain) NSString *sslCACertificatePath; +/** + * List of supported ciphers for SSL/TLS connections. + * This is a colon-separated string of names as used by + * `openssl ciphers`. The order of entries specifies + * their preference (earlier = better). + * A value of nil (default) means SPMySQL will use its built-in cipher list. + */ +@property (readwrite, retain) NSString *sslCipherList; + @property (readwrite, assign) NSUInteger timeout; @property (readwrite, assign) BOOL useKeepAlive; @property (readwrite, assign) CGFloat keepAliveInterval; diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m index 79d5060a..9fa5a9c8 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m @@ -65,6 +65,7 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS @synthesize sslKeyFilePath; @synthesize sslCertificatePath; @synthesize sslCACertificatePath; +@synthesize sslCipherList; @synthesize timeout; @synthesize useKeepAlive; @synthesize keepAliveInterval; @@ -217,6 +218,8 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS [proxy setConnectionStateChangeSelector:NULL delegate:nil]; [proxy release]; } + + [self setSslCipherList:nil]; // Ensure the query lock is unlocked, thereafter setting to nil in case of pending calls if ([connectionLock condition] != SPMySQLConnectionIdle) { @@ -377,20 +380,20 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS { NSFileManager *fileManager = [NSFileManager defaultManager]; - NSArray *possibleSocketLocations = [NSArray arrayWithObjects: - @"/tmp/mysql.sock", // Default - @"/Applications/MAMP/tmp/mysql/mysql.sock", // MAMP default location - @"/Applications/xampp/xamppfiles/var/mysql/mysql.sock", // XAMPP default location - @"/var/mysql/mysql.sock", // Mac OS X Server default - @"/opt/local/var/run/mysqld/mysqld.sock", // Darwinports MySQL - @"/opt/local/var/run/mysql4/mysqld.sock", // Darwinports MySQL 4 - @"/opt/local/var/run/mysql5/mysqld.sock", // Darwinports MySQL 5 - @"/usr/local/zend/mysql/tmp/mysql.sock", // Zend Server CE (see Issue #1251) - @"/var/run/mysqld/mysqld.sock", // As used on Debian/Gentoo - @"/var/tmp/mysql.sock", // As used on FreeBSD - @"/var/lib/mysql/mysql.sock", // As used by Fedora - @"/opt/local/lib/mysql/mysql.sock", // Alternate fedora - nil]; + NSArray *possibleSocketLocations = @[ + @"/tmp/mysql.sock", // Default + @"/Applications/MAMP/tmp/mysql/mysql.sock", // MAMP default location + @"/Applications/xampp/xamppfiles/var/mysql/mysql.sock", // XAMPP default location + @"/var/mysql/mysql.sock", // Mac OS X Server default + @"/opt/local/var/run/mysqld/mysqld.sock", // Darwinports MySQL + @"/opt/local/var/run/mysql4/mysqld.sock", // Darwinports MySQL 4 + @"/opt/local/var/run/mysql5/mysqld.sock", // Darwinports MySQL 5 + @"/usr/local/zend/mysql/tmp/mysql.sock", // Zend Server CE (see Issue #1251) + @"/var/run/mysqld/mysqld.sock", // As used on Debian/Gentoo + @"/var/tmp/mysql.sock", // As used on FreeBSD + @"/var/lib/mysql/mysql.sock", // As used by Fedora + @"/opt/local/lib/mysql/mysql.sock" + ]; for (NSUInteger i = 0; i < [possibleSocketLocations count]; i++) { if ([fileManager fileExistsAtPath:[possibleSocketLocations objectAtIndex:i]]) @@ -546,6 +549,7 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS const char *theSSLKeyFilePath = NULL; const char *theSSLCertificatePath = NULL; const char *theCACertificatePath = NULL; + const char *theSSLCiphers = SPMySQLSSLPermissibleCiphers; if (sslKeyFilePath) { theSSLKeyFilePath = [[sslKeyFilePath stringByExpandingTildeInPath] UTF8String]; @@ -556,8 +560,11 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS if (sslCACertificatePath) { theCACertificatePath = [[sslCACertificatePath stringByExpandingTildeInPath] UTF8String]; } + if(sslCipherList) { + theSSLCiphers = [sslCipherList UTF8String]; + } - mysql_ssl_set(theConnection, theSSLKeyFilePath, theSSLCertificatePath, theCACertificatePath, NULL, SPMySQLSSLPermissibleCiphers); + mysql_ssl_set(theConnection, theSSLKeyFilePath, theSSLCertificatePath, theCACertificatePath, NULL, theSSLCiphers); } MYSQL *connectionStatus = mysql_real_connect(theConnection, theHost, theUsername, thePassword, NULL, (unsigned int)port, theSocket, SPMySQLConnectionOptions); diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h b/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h index a6f84567..3622b312 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h @@ -33,11 +33,12 @@ * Connection proxy state constants. */ typedef enum { - SPMySQLProxyIdle = 0, - SPMySQLProxyConnecting = 1, - SPMySQLProxyWaitingForAuth = 2, - SPMySQLProxyConnected = 3, - SPMySQLProxyForwardingFailed = 4 + SPMySQLProxyIdle = 0, + SPMySQLProxyConnecting = 1, + SPMySQLProxyWaitingForAuth = 2, + SPMySQLProxyConnected = 3, + SPMySQLProxyForwardingFailed = 4, + SPMySQLProxyLaunchFailed = 5 } SPMySQLConnectionProxyState; diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m index 357eb53f..639ff0b9 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m @@ -247,9 +247,9 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da { // Fast case - if not using a preview length, or if the data length is shorter, return the requested data. - if (previewLength == NSNotFound || dataLength <= previewLength) { - return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; - } + if (previewLength == NSNotFound || dataLength <= previewLength) { + return [NSString stringForDataBytes:dataBytes length:dataLength encoding:aStringEncoding]; + } NSUInteger i = 0, characterLength = 0, byteLength = previewLength; uint16_t continuationStart, continuationEnd; @@ -394,7 +394,7 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da // If returning the full string, use a fast path if (byteLength >= dataLength) { - return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; + return [NSString stringForDataBytes:dataBytes length:dataLength encoding:aStringEncoding]; } // Get a string using the calculated details diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m b/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m index 447cf19b..86a6b2b5 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m @@ -630,8 +630,8 @@ static inline void SPMySQLStreamingResultStoreFreeRowData(SPMySQLStreamingResult { // Throw an exception if the range is out of bounds - if (rangeToRemove.location + rangeToRemove.length > numberOfRows) { - [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(rangeToRemove.location + rangeToRemove.length), (unsigned long long)numberOfRows]; + if (NSMaxRange(rangeToRemove) > numberOfRows) { + [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(NSMaxRange(rangeToRemove)), (unsigned long long)numberOfRows]; } // Lock the data mutex @@ -639,14 +639,14 @@ static inline void SPMySQLStreamingResultStoreFreeRowData(SPMySQLStreamingResult // Free rows in the range NSUInteger i; - for (i = rangeToRemove.location; i < rangeToRemove.location + rangeToRemove.length; i++) { + for (i = rangeToRemove.location; i < NSMaxRange(rangeToRemove); i++) { SPMySQLStreamingResultStoreFreeRowData(dataStorage[i]); } numberOfRows -= rangeToRemove.length; // Renumber all subsequent indices to fill the gap size_t pointerSize = sizeof(SPMySQLStreamingResultStoreRowData *); - memmove(dataStorage + rangeToRemove.location, dataStorage + rangeToRemove.location + rangeToRemove.length, (numberOfRows - rangeToRemove.location) * pointerSize); + memmove(dataStorage + rangeToRemove.location, dataStorage + NSMaxRange(rangeToRemove), (numberOfRows - rangeToRemove.location) * pointerSize); // Unlock the mutex pthread_mutex_unlock(&dataLock); diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h index bb29c02b..60832c53 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h @@ -33,5 +33,6 @@ - (NSString *)mySQLBacktickQuotedString; - (NSString *)mySQLTickQuotedString; ++ (NSString *)stringForDataBytes:(const void *)dataBytes length:(NSUInteger)dataLength encoding:(NSStringEncoding)aStringEncoding; @end diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m index 39688ea8..f987c98b 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m @@ -52,4 +52,18 @@ return [NSString stringWithFormat: @"'%@'", [self stringByReplacingOccurrencesOfString:@"'" withString:@"''"]]; } +/** + * Returns the string for the bytes according to the encoding, decode in ASCII if failed + */ ++ (NSString *) stringForDataBytes:(const void *)dataBytes length:(NSUInteger)dataLength encoding:(NSStringEncoding)aStringEncoding +{ + NSString * string = [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; + + if (string == nil) { + return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:NSASCIIStringEncoding] autorelease]; + } + + return string; +} + @end diff --git a/Frameworks/SPMySQLFramework/build-mysql-client.sh b/Frameworks/SPMySQLFramework/build-mysql-client.sh index 5fd1accb..2e7c4fc9 100755 --- a/Frameworks/SPMySQLFramework/build-mysql-client.sh +++ b/Frameworks/SPMySQLFramework/build-mysql-client.sh @@ -30,7 +30,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # -# More info at <http://code.google.com/p/sequel-pro/> +# More info at <https://github.com/sequelpro/sequelpro> # Builds the MySQL client libraries for distrubution in Sequel Pro's MySQL framework. # |