gecko/toolkit/components/alerts/mac/growl/GrowlApplicationBridge.m
Mitchell Field 0b02d21584 Bug 595513 - Reduce makefile recursion in toolkit. r=khuey
--HG--
rename : toolkit/components/alerts/src/mac/Makefile.in => toolkit/components/alerts/mac/Makefile.in
rename : toolkit/components/alerts/src/mac/growl/CFGrowlAdditions.c => toolkit/components/alerts/mac/growl/CFGrowlAdditions.c
rename : toolkit/components/alerts/src/mac/growl/CFGrowlAdditions.h => toolkit/components/alerts/mac/growl/CFGrowlAdditions.h
rename : toolkit/components/alerts/src/mac/growl/CFGrowlDefines.h => toolkit/components/alerts/mac/growl/CFGrowlDefines.h
rename : toolkit/components/alerts/src/mac/growl/CFMutableDictionaryAdditions.c => toolkit/components/alerts/mac/growl/CFMutableDictionaryAdditions.c
rename : toolkit/components/alerts/src/mac/growl/CFMutableDictionaryAdditions.h => toolkit/components/alerts/mac/growl/CFMutableDictionaryAdditions.h
rename : toolkit/components/alerts/src/mac/growl/CFURLAdditions.c => toolkit/components/alerts/mac/growl/CFURLAdditions.c
rename : toolkit/components/alerts/src/mac/growl/CFURLAdditions.h => toolkit/components/alerts/mac/growl/CFURLAdditions.h
rename : toolkit/components/alerts/src/mac/growl/GrowlAbstractSingletonObject.h => toolkit/components/alerts/mac/growl/GrowlAbstractSingletonObject.h
rename : toolkit/components/alerts/src/mac/growl/GrowlApplicationBridge.h => toolkit/components/alerts/mac/growl/GrowlApplicationBridge.h
rename : toolkit/components/alerts/src/mac/growl/GrowlApplicationBridge.m => toolkit/components/alerts/mac/growl/GrowlApplicationBridge.m
rename : toolkit/components/alerts/src/mac/growl/GrowlDefines.h => toolkit/components/alerts/mac/growl/GrowlDefines.h
rename : toolkit/components/alerts/src/mac/growl/GrowlDefinesInternal.h => toolkit/components/alerts/mac/growl/GrowlDefinesInternal.h
rename : toolkit/components/alerts/src/mac/growl/GrowlPathUtilities.h => toolkit/components/alerts/mac/growl/GrowlPathUtilities.h
rename : toolkit/components/alerts/src/mac/growl/GrowlPathUtilities.m => toolkit/components/alerts/mac/growl/GrowlPathUtilities.m
rename : toolkit/components/alerts/src/mac/growl/GrowlPathway.h => toolkit/components/alerts/mac/growl/GrowlPathway.h
rename : toolkit/components/alerts/src/mac/growl/GrowlPreferencesController.h => toolkit/components/alerts/mac/growl/GrowlPreferencesController.h
rename : toolkit/components/alerts/src/mac/growl/GrowlTicketController.h => toolkit/components/alerts/mac/growl/GrowlTicketController.h
rename : toolkit/components/alerts/src/mac/growl/Makefile.in => toolkit/components/alerts/mac/growl/Makefile.in
rename : toolkit/components/alerts/src/mac/growl/license.txt => toolkit/components/alerts/mac/growl/license.txt
rename : toolkit/components/alerts/src/mac/mozGrowlDelegate.h => toolkit/components/alerts/mac/mozGrowlDelegate.h
rename : toolkit/components/alerts/src/mac/mozGrowlDelegate.mm => toolkit/components/alerts/mac/mozGrowlDelegate.mm
rename : toolkit/components/alerts/src/mac/nsAlertsImageLoadListener.h => toolkit/components/alerts/mac/nsAlertsImageLoadListener.h
rename : toolkit/components/alerts/src/mac/nsAlertsImageLoadListener.mm => toolkit/components/alerts/mac/nsAlertsImageLoadListener.mm
rename : toolkit/components/alerts/src/mac/nsAlertsService.h => toolkit/components/alerts/mac/nsAlertsService.h
rename : toolkit/components/alerts/src/mac/nsAlertsService.mm => toolkit/components/alerts/mac/nsAlertsService.mm
rename : toolkit/components/alerts/src/mac/nsAlertsServiceModule.cpp => toolkit/components/alerts/mac/nsAlertsServiceModule.cpp
rename : toolkit/components/alerts/src/mac/nsNotificationsList.h => toolkit/components/alerts/mac/nsNotificationsList.h
rename : toolkit/components/alerts/src/mac/nsNotificationsList.mm => toolkit/components/alerts/mac/nsNotificationsList.mm
rename : toolkit/components/alerts/src/nsAlertsService.cpp => toolkit/components/alerts/nsAlertsService.cpp
rename : toolkit/components/alerts/src/nsAlertsService.h => toolkit/components/alerts/nsAlertsService.h
rename : toolkit/components/alerts/public/nsIAlertsService.idl => toolkit/components/alerts/nsIAlertsService.idl
rename : toolkit/components/alerts/public/nsINotificationsList.idl => toolkit/components/alerts/nsINotificationsList.idl
rename : toolkit/components/autocomplete/src/nsAutoCompleteController.cpp => toolkit/components/autocomplete/nsAutoCompleteController.cpp
rename : toolkit/components/autocomplete/src/nsAutoCompleteController.h => toolkit/components/autocomplete/nsAutoCompleteController.h
rename : toolkit/components/autocomplete/src/nsAutoCompleteSimpleResult.cpp => toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp
rename : toolkit/components/autocomplete/src/nsAutoCompleteSimpleResult.h => toolkit/components/autocomplete/nsAutoCompleteSimpleResult.h
rename : toolkit/components/autocomplete/public/nsIAutoCompleteController.idl => toolkit/components/autocomplete/nsIAutoCompleteController.idl
rename : toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl => toolkit/components/autocomplete/nsIAutoCompleteInput.idl
rename : toolkit/components/autocomplete/public/nsIAutoCompletePopup.idl => toolkit/components/autocomplete/nsIAutoCompletePopup.idl
rename : toolkit/components/autocomplete/public/nsIAutoCompleteResult.idl => toolkit/components/autocomplete/nsIAutoCompleteResult.idl
rename : toolkit/components/autocomplete/public/nsIAutoCompleteSearch.idl => toolkit/components/autocomplete/nsIAutoCompleteSearch.idl
rename : toolkit/components/autocomplete/public/nsIAutoCompleteSimpleResult.idl => toolkit/components/autocomplete/nsIAutoCompleteSimpleResult.idl
rename : toolkit/components/commandlines/src/nsCommandLine.cpp => toolkit/components/commandlines/nsCommandLine.cpp
rename : toolkit/components/commandlines/public/nsICommandLine.idl => toolkit/components/commandlines/nsICommandLine.idl
rename : toolkit/components/commandlines/public/nsICommandLineHandler.idl => toolkit/components/commandlines/nsICommandLineHandler.idl
rename : toolkit/components/commandlines/public/nsICommandLineRunner.idl => toolkit/components/commandlines/nsICommandLineRunner.idl
rename : toolkit/components/commandlines/public/nsICommandLineValidator.idl => toolkit/components/commandlines/nsICommandLineValidator.idl
rename : toolkit/components/contentprefs/src/nsContentPrefService.js => toolkit/components/contentprefs/nsContentPrefService.js
rename : toolkit/components/contentprefs/src/nsContentPrefService.manifest => toolkit/components/contentprefs/nsContentPrefService.manifest
rename : toolkit/components/downloads/src/nsDownloadManager.cpp => toolkit/components/downloads/nsDownloadManager.cpp
rename : toolkit/components/downloads/src/nsDownloadManager.h => toolkit/components/downloads/nsDownloadManager.h
rename : toolkit/components/downloads/src/nsDownloadManagerUI.js => toolkit/components/downloads/nsDownloadManagerUI.js
rename : toolkit/components/downloads/src/nsDownloadManagerUI.manifest => toolkit/components/downloads/nsDownloadManagerUI.manifest
rename : toolkit/components/downloads/src/nsDownloadProxy.h => toolkit/components/downloads/nsDownloadProxy.h
rename : toolkit/components/downloads/src/nsDownloadScanner.cpp => toolkit/components/downloads/nsDownloadScanner.cpp
rename : toolkit/components/downloads/src/nsDownloadScanner.h => toolkit/components/downloads/nsDownloadScanner.h
rename : toolkit/components/downloads/public/nsIDownload.idl => toolkit/components/downloads/nsIDownload.idl
rename : toolkit/components/downloads/public/nsIDownloadManager.idl => toolkit/components/downloads/nsIDownloadManager.idl
rename : toolkit/components/downloads/public/nsIDownloadManagerUI.idl => toolkit/components/downloads/nsIDownloadManagerUI.idl
rename : toolkit/components/downloads/public/nsIDownloadProgressListener.idl => toolkit/components/downloads/nsIDownloadProgressListener.idl
rename : toolkit/components/feeds/src/FeedProcessor.js => toolkit/components/feeds/FeedProcessor.js
rename : toolkit/components/feeds/src/FeedProcessor.manifest => toolkit/components/feeds/FeedProcessor.manifest
rename : toolkit/components/feeds/public/nsIFeed.idl => toolkit/components/feeds/nsIFeed.idl
rename : toolkit/components/feeds/public/nsIFeedContainer.idl => toolkit/components/feeds/nsIFeedContainer.idl
rename : toolkit/components/feeds/public/nsIFeedElementBase.idl => toolkit/components/feeds/nsIFeedElementBase.idl
rename : toolkit/components/feeds/public/nsIFeedEntry.idl => toolkit/components/feeds/nsIFeedEntry.idl
rename : toolkit/components/feeds/public/nsIFeedGenerator.idl => toolkit/components/feeds/nsIFeedGenerator.idl
rename : toolkit/components/feeds/public/nsIFeedListener.idl => toolkit/components/feeds/nsIFeedListener.idl
rename : toolkit/components/feeds/public/nsIFeedPerson.idl => toolkit/components/feeds/nsIFeedPerson.idl
rename : toolkit/components/feeds/public/nsIFeedProcessor.idl => toolkit/components/feeds/nsIFeedProcessor.idl
rename : toolkit/components/feeds/public/nsIFeedResult.idl => toolkit/components/feeds/nsIFeedResult.idl
rename : toolkit/components/feeds/public/nsIFeedTextConstruct.idl => toolkit/components/feeds/nsIFeedTextConstruct.idl
rename : toolkit/components/feeds/public/nsIScriptableUnescapeHTML.idl => toolkit/components/feeds/nsIScriptableUnescapeHTML.idl
rename : toolkit/components/feeds/src/nsScriptableUnescapeHTML.cpp => toolkit/components/feeds/nsScriptableUnescapeHTML.cpp
rename : toolkit/components/feeds/src/nsScriptableUnescapeHTML.h => toolkit/components/feeds/nsScriptableUnescapeHTML.h
rename : toolkit/components/filepicker/src/nsFilePicker.js => toolkit/components/filepicker/nsFilePicker.js
rename : toolkit/components/filepicker/src/nsFilePicker.manifest => toolkit/components/filepicker/nsFilePicker.manifest
rename : toolkit/components/filepicker/src/nsFileView.cpp => toolkit/components/filepicker/nsFileView.cpp
rename : toolkit/components/filepicker/public/nsIFileView.idl => toolkit/components/filepicker/nsIFileView.idl
rename : toolkit/components/find/src/nsFindService.cpp => toolkit/components/find/nsFindService.cpp
rename : toolkit/components/find/src/nsFindService.h => toolkit/components/find/nsFindService.h
rename : toolkit/components/find/public/nsIFindService.idl => toolkit/components/find/nsIFindService.idl
rename : toolkit/components/microformats/src/Microformats.js => toolkit/components/microformats/Microformats.js
rename : toolkit/components/parentalcontrols/public/nsIParentalControlsService.idl => toolkit/components/parentalcontrols/nsIParentalControlsService.idl
rename : toolkit/components/parentalcontrols/src/nsParentalControlsServiceWin.cpp => toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp
rename : toolkit/components/parentalcontrols/src/nsParentalControlsServiceWin.h => toolkit/components/parentalcontrols/nsParentalControlsServiceWin.h
rename : toolkit/components/passwordmgr/src/crypto-SDR.js => toolkit/components/passwordmgr/crypto-SDR.js
rename : toolkit/components/passwordmgr/public/nsILoginInfo.idl => toolkit/components/passwordmgr/nsILoginInfo.idl
rename : toolkit/components/passwordmgr/public/nsILoginManager.idl => toolkit/components/passwordmgr/nsILoginManager.idl
rename : toolkit/components/passwordmgr/public/nsILoginManagerCrypto.idl => toolkit/components/passwordmgr/nsILoginManagerCrypto.idl
rename : toolkit/components/passwordmgr/public/nsILoginManagerIEMigrationHelper.idl => toolkit/components/passwordmgr/nsILoginManagerIEMigrationHelper.idl
rename : toolkit/components/passwordmgr/public/nsILoginManagerPrompter.idl => toolkit/components/passwordmgr/nsILoginManagerPrompter.idl
rename : toolkit/components/passwordmgr/public/nsILoginManagerStorage.idl => toolkit/components/passwordmgr/nsILoginManagerStorage.idl
rename : toolkit/components/passwordmgr/public/nsILoginMetaInfo.idl => toolkit/components/passwordmgr/nsILoginMetaInfo.idl
rename : toolkit/components/passwordmgr/src/nsLoginInfo.js => toolkit/components/passwordmgr/nsLoginInfo.js
rename : toolkit/components/passwordmgr/src/nsLoginManager.js => toolkit/components/passwordmgr/nsLoginManager.js
rename : toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js => toolkit/components/passwordmgr/nsLoginManagerPrompter.js
rename : toolkit/components/passwordmgr/src/passwordmgr.manifest => toolkit/components/passwordmgr/passwordmgr.manifest
rename : toolkit/components/passwordmgr/src/storage-Legacy.js => toolkit/components/passwordmgr/storage-Legacy.js
rename : toolkit/components/passwordmgr/src/storage-mozStorage.js => toolkit/components/passwordmgr/storage-mozStorage.js
rename : toolkit/components/places/src/AsyncFaviconHelpers.cpp => toolkit/components/places/AsyncFaviconHelpers.cpp
rename : toolkit/components/places/src/AsyncFaviconHelpers.h => toolkit/components/places/AsyncFaviconHelpers.h
rename : toolkit/components/places/src/Helpers.cpp => toolkit/components/places/Helpers.cpp
rename : toolkit/components/places/src/Helpers.h => toolkit/components/places/Helpers.h
rename : toolkit/components/places/src/History.cpp => toolkit/components/places/History.cpp
rename : toolkit/components/places/src/History.h => toolkit/components/places/History.h
rename : toolkit/components/places/src/PlaceInfo.cpp => toolkit/components/places/PlaceInfo.cpp
rename : toolkit/components/places/src/PlaceInfo.h => toolkit/components/places/PlaceInfo.h
rename : toolkit/components/places/src/PlacesCategoriesStarter.js => toolkit/components/places/PlacesCategoriesStarter.js
rename : toolkit/components/places/src/PlacesDBUtils.jsm => toolkit/components/places/PlacesDBUtils.jsm
rename : toolkit/components/places/src/PlacesUtils.jsm => toolkit/components/places/PlacesUtils.jsm
rename : toolkit/components/places/src/SQLFunctions.cpp => toolkit/components/places/SQLFunctions.cpp
rename : toolkit/components/places/src/SQLFunctions.h => toolkit/components/places/SQLFunctions.h
rename : toolkit/components/places/src/VisitInfo.cpp => toolkit/components/places/VisitInfo.cpp
rename : toolkit/components/places/src/VisitInfo.h => toolkit/components/places/VisitInfo.h
rename : toolkit/components/places/public/mozIAsyncHistory.idl => toolkit/components/places/mozIAsyncHistory.idl
rename : toolkit/components/places/public/mozIPlacesAutoComplete.idl => toolkit/components/places/mozIPlacesAutoComplete.idl
rename : toolkit/components/places/src/nsAnnoProtocolHandler.cpp => toolkit/components/places/nsAnnoProtocolHandler.cpp
rename : toolkit/components/places/src/nsAnnoProtocolHandler.h => toolkit/components/places/nsAnnoProtocolHandler.h
rename : toolkit/components/places/src/nsAnnotationService.cpp => toolkit/components/places/nsAnnotationService.cpp
rename : toolkit/components/places/src/nsAnnotationService.h => toolkit/components/places/nsAnnotationService.h
rename : toolkit/components/places/src/nsFaviconService.cpp => toolkit/components/places/nsFaviconService.cpp
rename : toolkit/components/places/src/nsFaviconService.h => toolkit/components/places/nsFaviconService.h
rename : toolkit/components/places/public/nsIAnnotationService.idl => toolkit/components/places/nsIAnnotationService.idl
rename : toolkit/components/places/public/nsIBrowserHistory.idl => toolkit/components/places/nsIBrowserHistory.idl
rename : toolkit/components/places/public/nsIDynamicContainer.idl => toolkit/components/places/nsIDynamicContainer.idl
rename : toolkit/components/places/public/nsIFaviconService.idl => toolkit/components/places/nsIFaviconService.idl
rename : toolkit/components/places/public/nsILivemarkService.idl => toolkit/components/places/nsILivemarkService.idl
rename : toolkit/components/places/public/nsIMicrosummaryService.idl => toolkit/components/places/nsIMicrosummaryService.idl
rename : toolkit/components/places/public/nsINavBookmarksService.idl => toolkit/components/places/nsINavBookmarksService.idl
rename : toolkit/components/places/public/nsINavHistoryService.idl => toolkit/components/places/nsINavHistoryService.idl
rename : toolkit/components/places/public/nsIPlacesImportExportService.idl => toolkit/components/places/nsIPlacesImportExportService.idl
rename : toolkit/components/places/public/nsITaggingService.idl => toolkit/components/places/nsITaggingService.idl
rename : toolkit/components/places/src/nsLivemarkService.js => toolkit/components/places/nsLivemarkService.js
rename : toolkit/components/places/src/nsMaybeWeakPtr.cpp => toolkit/components/places/nsMaybeWeakPtr.cpp
rename : toolkit/components/places/src/nsMaybeWeakPtr.h => toolkit/components/places/nsMaybeWeakPtr.h
rename : toolkit/components/places/src/nsMicrosummaryService.js => toolkit/components/places/nsMicrosummaryService.js
rename : toolkit/components/places/src/nsMorkHistoryImporter.cpp => toolkit/components/places/nsMorkHistoryImporter.cpp
rename : toolkit/components/places/src/nsNavBookmarks.cpp => toolkit/components/places/nsNavBookmarks.cpp
rename : toolkit/components/places/src/nsNavBookmarks.h => toolkit/components/places/nsNavBookmarks.h
rename : toolkit/components/places/src/nsNavHistory.cpp => toolkit/components/places/nsNavHistory.cpp
rename : toolkit/components/places/src/nsNavHistory.h => toolkit/components/places/nsNavHistory.h
rename : toolkit/components/places/src/nsNavHistoryQuery.cpp => toolkit/components/places/nsNavHistoryQuery.cpp
rename : toolkit/components/places/src/nsNavHistoryQuery.h => toolkit/components/places/nsNavHistoryQuery.h
rename : toolkit/components/places/src/nsNavHistoryResult.cpp => toolkit/components/places/nsNavHistoryResult.cpp
rename : toolkit/components/places/src/nsNavHistoryResult.h => toolkit/components/places/nsNavHistoryResult.h
rename : toolkit/components/places/public/nsPIPlacesDatabase.idl => toolkit/components/places/nsPIPlacesDatabase.idl
rename : toolkit/components/places/public/nsPIPlacesHistoryListenersNotifier.idl => toolkit/components/places/nsPIPlacesHistoryListenersNotifier.idl
rename : toolkit/components/places/src/nsPlacesAutoComplete.js => toolkit/components/places/nsPlacesAutoComplete.js
rename : toolkit/components/places/src/nsPlacesAutoComplete.manifest => toolkit/components/places/nsPlacesAutoComplete.manifest
rename : toolkit/components/places/src/nsPlacesExpiration.js => toolkit/components/places/nsPlacesExpiration.js
rename : toolkit/components/places/src/nsPlacesImportExportService.cpp => toolkit/components/places/nsPlacesImportExportService.cpp
rename : toolkit/components/places/src/nsPlacesImportExportService.h => toolkit/components/places/nsPlacesImportExportService.h
rename : toolkit/components/places/src/nsPlacesIndexes.h => toolkit/components/places/nsPlacesIndexes.h
rename : toolkit/components/places/src/nsPlacesMacros.h => toolkit/components/places/nsPlacesMacros.h
rename : toolkit/components/places/src/nsPlacesModule.cpp => toolkit/components/places/nsPlacesModule.cpp
rename : toolkit/components/places/src/nsPlacesTables.h => toolkit/components/places/nsPlacesTables.h
rename : toolkit/components/places/src/nsPlacesTriggers.h => toolkit/components/places/nsPlacesTriggers.h
rename : toolkit/components/places/src/nsTaggingService.js => toolkit/components/places/nsTaggingService.js
rename : toolkit/components/places/src/toolkitplaces.manifest => toolkit/components/places/toolkitplaces.manifest
rename : toolkit/components/places/src/utils.js => toolkit/components/places/utils.js
rename : toolkit/components/satchel/src/formSubmitListener.js => toolkit/components/satchel/formSubmitListener.js
rename : toolkit/components/satchel/src/nsFormAutoComplete.js => toolkit/components/satchel/nsFormAutoComplete.js
rename : toolkit/components/satchel/src/nsFormAutoCompleteResult.jsm => toolkit/components/satchel/nsFormAutoCompleteResult.jsm
rename : toolkit/components/satchel/src/nsFormFillController.cpp => toolkit/components/satchel/nsFormFillController.cpp
rename : toolkit/components/satchel/src/nsFormFillController.h => toolkit/components/satchel/nsFormFillController.h
rename : toolkit/components/satchel/src/nsFormHistory.js => toolkit/components/satchel/nsFormHistory.js
rename : toolkit/components/satchel/public/nsIFormAutoComplete.idl => toolkit/components/satchel/nsIFormAutoComplete.idl
rename : toolkit/components/satchel/public/nsIFormFillController.idl => toolkit/components/satchel/nsIFormFillController.idl
rename : toolkit/components/satchel/public/nsIFormHistory.idl => toolkit/components/satchel/nsIFormHistory.idl
rename : toolkit/components/satchel/public/nsIInputListAutoComplete.idl => toolkit/components/satchel/nsIInputListAutoComplete.idl
rename : toolkit/components/satchel/src/nsInputListAutoComplete.js => toolkit/components/satchel/nsInputListAutoComplete.js
rename : toolkit/components/satchel/src/satchel.manifest => toolkit/components/satchel/satchel.manifest
rename : toolkit/components/startup/src/nsAppStartup.cpp => toolkit/components/startup/nsAppStartup.cpp
rename : toolkit/components/startup/src/nsAppStartup.h => toolkit/components/startup/nsAppStartup.h
rename : toolkit/components/startup/src/nsTryToClose.js => toolkit/components/startup/nsTryToClose.js
rename : toolkit/components/startup/src/nsTryToClose.manifest => toolkit/components/startup/nsTryToClose.manifest
rename : toolkit/components/startup/src/nsUserInfo.h => toolkit/components/startup/nsUserInfo.h
rename : toolkit/components/startup/src/nsUserInfoMac.h => toolkit/components/startup/nsUserInfoMac.h
rename : toolkit/components/startup/src/nsUserInfoMac.mm => toolkit/components/startup/nsUserInfoMac.mm
rename : toolkit/components/startup/src/nsUserInfoOS2.cpp => toolkit/components/startup/nsUserInfoOS2.cpp
rename : toolkit/components/startup/src/nsUserInfoUnix.cpp => toolkit/components/startup/nsUserInfoUnix.cpp
rename : toolkit/components/startup/src/nsUserInfoWin.cpp => toolkit/components/startup/nsUserInfoWin.cpp
rename : toolkit/components/typeaheadfind/public/nsITypeAheadFind.idl => toolkit/components/typeaheadfind/nsITypeAheadFind.idl
rename : toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp => toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
rename : toolkit/components/typeaheadfind/src/nsTypeAheadFind.h => toolkit/components/typeaheadfind/nsTypeAheadFind.h
rename : toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl => toolkit/components/url-classifier/nsIUrlClassifierDBService.idl
rename : toolkit/components/url-classifier/public/nsIUrlClassifierHashCompleter.idl => toolkit/components/url-classifier/nsIUrlClassifierHashCompleter.idl
rename : toolkit/components/url-classifier/public/nsIUrlClassifierStreamUpdater.idl => toolkit/components/url-classifier/nsIUrlClassifierStreamUpdater.idl
rename : toolkit/components/url-classifier/public/nsIUrlClassifierTable.idl => toolkit/components/url-classifier/nsIUrlClassifierTable.idl
rename : toolkit/components/url-classifier/public/nsIUrlClassifierUtils.idl => toolkit/components/url-classifier/nsIUrlClassifierUtils.idl
rename : toolkit/components/url-classifier/public/nsIUrlListManager.idl => toolkit/components/url-classifier/nsIUrlListManager.idl
rename : toolkit/components/url-classifier/src/nsURLClassifier.manifest => toolkit/components/url-classifier/nsURLClassifier.manifest
rename : toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp => toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
rename : toolkit/components/url-classifier/src/nsUrlClassifierDBService.h => toolkit/components/url-classifier/nsUrlClassifierDBService.h
rename : toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.cpp => toolkit/components/url-classifier/nsUrlClassifierHashCompleter.cpp
rename : toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.h => toolkit/components/url-classifier/nsUrlClassifierHashCompleter.h
rename : toolkit/components/url-classifier/src/nsUrlClassifierLib.js => toolkit/components/url-classifier/nsUrlClassifierLib.js
rename : toolkit/components/url-classifier/src/nsUrlClassifierListManager.js => toolkit/components/url-classifier/nsUrlClassifierListManager.js
rename : toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp => toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp
rename : toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h => toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.h
rename : toolkit/components/url-classifier/src/nsUrlClassifierUtils.cpp => toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
rename : toolkit/components/url-classifier/src/nsUrlClassifierUtils.h => toolkit/components/url-classifier/nsUrlClassifierUtils.h
rename : toolkit/components/urlformatter/public/nsIURLFormatter.idl => toolkit/components/urlformatter/nsIURLFormatter.idl
rename : toolkit/components/urlformatter/src/nsURLFormatter.js => toolkit/components/urlformatter/nsURLFormatter.js
rename : toolkit/components/urlformatter/src/nsURLFormatter.manifest => toolkit/components/urlformatter/nsURLFormatter.manifest
rename : toolkit/profile/public/nsIProfileMigrator.idl => toolkit/profile/nsIProfileMigrator.idl
rename : toolkit/profile/public/nsIToolkitProfile.idl => toolkit/profile/nsIToolkitProfile.idl
rename : toolkit/profile/public/nsIToolkitProfileService.idl => toolkit/profile/nsIToolkitProfileService.idl
rename : toolkit/profile/src/nsToolkitProfileService.cpp => toolkit/profile/nsToolkitProfileService.cpp
2011-03-08 14:58:46 +11:00

867 lines
32 KiB
Objective-C

//
// GrowlApplicationBridge.m
// Growl
//
// Created by Evan Schoenberg on Wed Jun 16 2004.
// Copyright 2004-2006 The Growl Project. All rights reserved.
//
#import "GrowlApplicationBridge.h"
#ifdef GROWL_WITH_INSTALLER
#import "GrowlInstallationPrompt.h"
#import "GrowlVersionUtilities.h"
#endif
#include "CFGrowlAdditions.h"
#include "CFURLAdditions.h"
#include "CFMutableDictionaryAdditions.h"
#import "GrowlDefinesInternal.h"
#import "GrowlPathUtilities.h"
#import "GrowlPathway.h"
#import <ApplicationServices/ApplicationServices.h>
/*!
* The 10.3+ exception handling can only work if -fobjc-exceptions is enabled
*/
#if 0
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
# define TRY @try {
# define ENDTRY }
# define CATCH @catch(NSException *localException) {
# define ENDCATCH }
#else
# define TRY NS_DURING
# define ENDTRY
# define CATCH NS_HANDLER
# define ENDCATCH NS_ENDHANDLER
#endif
#else
# define TRY NS_DURING
# define ENDTRY
# define CATCH NS_HANDLER
# define ENDCATCH NS_ENDHANDLER
#endif
@interface GrowlApplicationBridge (PRIVATE)
/*!
* @method launchGrowlIfInstalled
* @abstract Launches GrowlHelperApp.
* @discussion Launches the GrowlHelperApp if it's not already running.
* GROWL_IS_READY will be posted to the distributed notification center
* once it is ready.
*
* Uses <code>+_launchGrowlIfInstalledWithRegistrationDictionary:</code>.
* @result Returns YES if GrowlHelperApp began launching or was already running, NO if Growl isn't installed
*/
+ (BOOL) launchGrowlIfInstalled;
/*!
* @method _launchGrowlIfInstalledWithRegistrationDictionary:
* @abstract Launches GrowlHelperApp and registers.
* @discussion Launches the GrowlHelperApp if it's not already running, and passes it a registration dictionary.
* If Growl is turned on in the Growl prefpane, GROWL_IS_READY will be posted
* to the distributed notification center when Growl is listening for
* notifications.
* @param regDict The dictionary with which to register.
* @result Returns YES if GrowlHelperApp began launching or was already running, NO if Growl isn't installed
*/
+ (BOOL) _launchGrowlIfInstalledWithRegistrationDictionary:(NSDictionary *)regDict;
#ifdef GROWL_WITH_INSTALLER
+ (void) _checkForPackagedUpdateForGrowlPrefPaneBundle:(NSBundle *)growlPrefPaneBundle;
#endif
/*! @method _applicationNameForGrowlSearchingRegistrationDictionary:
* @abstract Obtain the name of the current application.
* @param regDict The dictionary to search, or <code>nil</code> not to.
* @result The name of the current application.
* @discussion Does not call +bestRegistrationDictionary, and is therefore safe to call from it.
*/
+ (NSString *) _applicationNameForGrowlSearchingRegistrationDictionary:(NSDictionary *)regDict;
/*! @method _applicationNameForGrowlSearchingRegistrationDictionary:
* @abstract Obtain the icon of the current application.
* @param regDict The dictionary to search, or <code>nil</code> not to.
* @result The icon of the current application, in IconFamily format (same as is used in 'icns' resources and .icns files).
* @discussion Does not call +bestRegistrationDictionary, and is therefore safe to call from it.
*/
+ (NSData *) _applicationIconDataForGrowlSearchingRegistrationDictionary:(NSDictionary *)regDict;
/*! @method growlProxy
* @abstract Obtain (creating a connection if needed) a proxy to the Growl Helper Application
*/
+ (NSProxy<GrowlNotificationProtocol> *) growlProxy;
@end
static NSDictionary *cachedRegistrationDictionary = nil;
static NSString *appName = nil;
static NSData *appIconData = nil;
static id delegate = nil;
static BOOL growlLaunched = NO;
static NSProxy<GrowlNotificationProtocol> *growlProxy = nil;
#ifdef GROWL_WITH_INSTALLER
static NSMutableArray *queuedGrowlNotifications = nil;
static BOOL userChoseNotToInstallGrowl = NO;
static BOOL promptedToInstallGrowl = NO;
static BOOL promptedToUpgradeGrowl = NO;
#endif
//used primarily by GIP, but could be useful elsewhere.
static BOOL registerWhenGrowlIsReady = NO;
#pragma mark -
@implementation GrowlApplicationBridge
+ (void) setGrowlDelegate:(NSObject<GrowlApplicationBridgeDelegate> *)inDelegate {
NSDistributedNotificationCenter *NSDNC = [NSDistributedNotificationCenter defaultCenter];
if (inDelegate != delegate) {
[delegate release];
delegate = [inDelegate retain];
}
[cachedRegistrationDictionary release];
cachedRegistrationDictionary = [[self bestRegistrationDictionary] retain];
//Cache the appName from the delegate or the process name
[appName autorelease];
appName = [[self _applicationNameForGrowlSearchingRegistrationDictionary:cachedRegistrationDictionary] retain];
if (!appName) {
NSLog(@"%@", @"GrowlApplicationBridge: Cannot register because the application name was not supplied and could not be determined");
return;
}
/* Cache the appIconData from the delegate if it responds to the
* applicationIconDataForGrowl selector, or the application if not
*/
[appIconData autorelease];
appIconData = [[self _applicationIconDataForGrowlSearchingRegistrationDictionary:cachedRegistrationDictionary] retain];
//Add the observer for GROWL_IS_READY which will be triggered later if all goes well
[NSDNC addObserver:self
selector:@selector(_growlIsReady:)
name:GROWL_IS_READY
object:nil];
/* Watch for notification clicks if our delegate responds to the
* growlNotificationWasClicked: selector. Notifications will come in on a
* unique notification name based on our app name, pid and
* GROWL_NOTIFICATION_CLICKED.
*/
int pid = [[NSProcessInfo processInfo] processIdentifier];
NSString *growlNotificationClickedName = [[NSString alloc] initWithFormat:@"%@-%d-%@",
appName, pid, GROWL_NOTIFICATION_CLICKED];
if ([delegate respondsToSelector:@selector(growlNotificationWasClicked:)])
[NSDNC addObserver:self
selector:@selector(growlNotificationWasClicked:)
name:growlNotificationClickedName
object:nil];
else
[NSDNC removeObserver:self
name:growlNotificationClickedName
object:nil];
[growlNotificationClickedName release];
NSString *growlNotificationTimedOutName = [[NSString alloc] initWithFormat:@"%@-%d-%@",
appName, pid, GROWL_NOTIFICATION_TIMED_OUT];
if ([delegate respondsToSelector:@selector(growlNotificationTimedOut:)])
[NSDNC addObserver:self
selector:@selector(growlNotificationTimedOut:)
name:growlNotificationTimedOutName
object:nil];
else
[NSDNC removeObserver:self
name:growlNotificationTimedOutName
object:nil];
[growlNotificationTimedOutName release];
#ifdef GROWL_WITH_INSTALLER
//Determine if the user has previously told us not to ever request installation again
userChoseNotToInstallGrowl = [[NSUserDefaults standardUserDefaults] boolForKey:@"Growl Installation:Do Not Prompt Again"];
#endif
growlLaunched = [self _launchGrowlIfInstalledWithRegistrationDictionary:cachedRegistrationDictionary];
}
+ (NSObject<GrowlApplicationBridgeDelegate> *) growlDelegate {
return delegate;
}
#pragma mark -
+ (void) notifyWithTitle:(NSString *)title
description:(NSString *)description
notificationName:(NSString *)notifName
iconData:(NSData *)iconData
priority:(int)priority
isSticky:(BOOL)isSticky
clickContext:(id)clickContext
{
[GrowlApplicationBridge notifyWithTitle:title
description:description
notificationName:notifName
iconData:iconData
priority:priority
isSticky:isSticky
clickContext:clickContext
identifier:nil];
}
/* Send a notification to Growl for display.
* title, description, and notifName are required.
* All other id parameters may be nil to accept defaults.
* priority is 0 by default; isSticky is NO by default.
*/
+ (void) notifyWithTitle:(NSString *)title
description:(NSString *)description
notificationName:(NSString *)notifName
iconData:(NSData *)iconData
priority:(int)priority
isSticky:(BOOL)isSticky
clickContext:(id)clickContext
identifier:(NSString *)identifier
{
NSParameterAssert(notifName); //Notification name is required.
NSParameterAssert(title || description); //At least one of title or description is required.
// Build our noteDict from all passed parameters
NSMutableDictionary *noteDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
notifName, GROWL_NOTIFICATION_NAME,
nil];
if (title) setObjectForKey(noteDict, GROWL_NOTIFICATION_TITLE, title);
if (description) setObjectForKey(noteDict, GROWL_NOTIFICATION_DESCRIPTION, description);
if (iconData) setObjectForKey(noteDict, GROWL_NOTIFICATION_ICON, iconData);
if (clickContext) setObjectForKey(noteDict, GROWL_NOTIFICATION_CLICK_CONTEXT, clickContext);
if (priority) setIntegerForKey(noteDict, GROWL_NOTIFICATION_PRIORITY, priority);
if (isSticky) setBooleanForKey(noteDict, GROWL_NOTIFICATION_STICKY, isSticky);
if (identifier) setObjectForKey(noteDict, GROWL_NOTIFICATION_IDENTIFIER, identifier);
[self notifyWithDictionary:noteDict];
[noteDict release];
}
+ (void) notifyWithDictionary:(NSDictionary *)userInfo {
//post it.
if (growlLaunched) {
NSProxy<GrowlNotificationProtocol> *currentGrowlProxy = [self growlProxy];
//Make sure we have everything that we need (that we can retrieve from the registration dictionary).
userInfo = [self notificationDictionaryByFillingInDictionary:userInfo];
if (currentGrowlProxy) {
//Post to Growl via GrowlApplicationBridgePathway
TRY
[currentGrowlProxy postNotificationWithDictionary:userInfo];
ENDTRY
CATCH
NSLog(@"GrowlApplicationBridge: exception while sending notification: %@", localException);
ENDCATCH
} else {
//NSLog(@"GrowlApplicationBridge: could not find local GrowlApplicationBridgePathway, falling back to NSDistributedNotificationCenter");
//DNC needs a plist. this means we must pass data, not an NSImage.
Class NSImageClass = [NSImage class];
NSImage *icon = [userInfo objectForKey:GROWL_NOTIFICATION_ICON];
NSImage *appIcon = [userInfo objectForKey:GROWL_NOTIFICATION_APP_ICON];
BOOL iconIsImage = icon && [icon isKindOfClass:NSImageClass];
BOOL appIconIsImage = appIcon && [appIcon isKindOfClass:NSImageClass];
if (iconIsImage || appIconIsImage) {
NSMutableDictionary *mUserInfo = [userInfo mutableCopy];
//notification icon.
if (iconIsImage)
[mUserInfo setObject:[icon TIFFRepresentation] forKey:GROWL_NOTIFICATION_ICON];
//per-notification application icon.
if (appIconIsImage)
[mUserInfo setObject:[appIcon TIFFRepresentation] forKey:GROWL_NOTIFICATION_APP_ICON];
userInfo = [mUserInfo autorelease];
}
//Post to Growl via NSDistributedNotificationCenter
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:GROWL_NOTIFICATION
object:nil
userInfo:userInfo
deliverImmediately:NO];
}
} else {
#ifdef GROWL_WITH_INSTALLER
/*if Growl launches, and the user hasn't already said NO to installing
* it, store this notification for posting
*/
if (!userChoseNotToInstallGrowl) {
if (!queuedGrowlNotifications)
queuedGrowlNotifications = [[NSMutableArray alloc] init];
[queuedGrowlNotifications addObject:userInfo];
//if we have not already asked the user to install Growl, do it now
if (!promptedToInstallGrowl) {
[GrowlInstallationPrompt showInstallationPrompt];
promptedToInstallGrowl = YES;
}
}
#endif
}
}
#pragma mark -
+ (BOOL) isGrowlInstalled {
return ([GrowlPathUtilities growlPrefPaneBundle] != nil);
}
+ (BOOL) isGrowlRunning {
BOOL growlIsRunning = NO;
ProcessSerialNumber PSN = { kNoProcess, kNoProcess };
while (GetNextProcess(&PSN) == noErr) {
CFDictionaryRef infoDict = ProcessInformationCopyDictionary(&PSN, kProcessDictionaryIncludeAllInformationMask);
CFStringRef bundleId = CFDictionaryGetValue(infoDict, kCFBundleIdentifierKey);
if (bundleId && CFStringCompare(bundleId, CFSTR("com.Growl.GrowlHelperApp"), 0) == kCFCompareEqualTo) {
growlIsRunning = YES;
CFRelease(infoDict);
break;
}
CFRelease(infoDict);
}
return growlIsRunning;
}
+ (void) displayInstallationPromptIfNeeded {
#ifdef GROWL_WITH_INSTALLER
//if we have not already asked the user to install Growl, do it now
if (!promptedToInstallGrowl) {
[GrowlInstallationPrompt showInstallationPrompt];
promptedToInstallGrowl = YES;
}
#endif
}
#pragma mark -
+ (BOOL) registerWithDictionary:(NSDictionary *)regDict {
if (regDict)
regDict = [self registrationDictionaryByFillingInDictionary:regDict];
else
regDict = [self bestRegistrationDictionary];
[cachedRegistrationDictionary release];
cachedRegistrationDictionary = [regDict retain];
return [self _launchGrowlIfInstalledWithRegistrationDictionary:regDict];
}
+ (void) reregisterGrowlNotifications {
[self registerWithDictionary:nil];
}
+ (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag {
registerWhenGrowlIsReady = flag;
}
+ (BOOL) willRegisterWhenGrowlIsReady {
return registerWhenGrowlIsReady;
}
#pragma mark -
+ (NSDictionary *) registrationDictionaryFromDelegate {
NSDictionary *regDict = nil;
if (delegate && [delegate respondsToSelector:@selector(registrationDictionaryForGrowl)])
regDict = [delegate registrationDictionaryForGrowl];
return regDict;
}
+ (NSDictionary *) registrationDictionaryFromBundle:(NSBundle *)bundle {
if (!bundle) bundle = [NSBundle mainBundle];
NSDictionary *regDict = nil;
NSString *regDictPath = [bundle pathForResource:@"Growl Registration Ticket" ofType:GROWL_REG_DICT_EXTENSION];
if (regDictPath) {
regDict = [NSDictionary dictionaryWithContentsOfFile:regDictPath];
if (!regDict)
NSLog(@"GrowlApplicationBridge: The bundle at %@ contains a registration dictionary, but it is not a valid property list. Please tell this application's developer.", [bundle bundlePath]);
}
return regDict;
}
+ (NSDictionary *) bestRegistrationDictionary {
NSDictionary *registrationDictionary = [self registrationDictionaryFromDelegate];
if (!registrationDictionary) {
registrationDictionary = [self registrationDictionaryFromBundle:nil];
if (!registrationDictionary)
NSLog(@"GrowlApplicationBridge: The Growl delegate did not supply a registration dictionary, and the app bundle at %@ does not have one. Please tell this application's developer.", [[NSBundle mainBundle] bundlePath]);
}
return [self registrationDictionaryByFillingInDictionary:registrationDictionary];
}
#pragma mark -
+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict {
return [self registrationDictionaryByFillingInDictionary:regDict restrictToKeys:nil];
}
+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys {
if (!regDict) return nil;
NSMutableDictionary *mRegDict = [regDict mutableCopy];
if ((!keys) || [keys containsObject:GROWL_APP_NAME]) {
if (![mRegDict objectForKey:GROWL_APP_NAME]) {
if (!appName)
appName = [[self _applicationNameForGrowlSearchingRegistrationDictionary:regDict] retain];
[mRegDict setObject:appName
forKey:GROWL_APP_NAME];
}
}
if ((!keys) || [keys containsObject:GROWL_APP_ICON]) {
if (![mRegDict objectForKey:GROWL_APP_ICON]) {
if (!appIconData)
appIconData = [[self _applicationIconDataForGrowlSearchingRegistrationDictionary:regDict] retain];
if (appIconData)
[mRegDict setObject:appIconData forKey:GROWL_APP_ICON];
}
}
if ((!keys) || [keys containsObject:GROWL_APP_LOCATION]) {
if (![mRegDict objectForKey:GROWL_APP_LOCATION]) {
NSURL *myURL = copyCurrentProcessURL();
if (myURL) {
NSDictionary *file_data = createDockDescriptionWithURL(myURL);
if (file_data) {
NSDictionary *location = [[NSDictionary alloc] initWithObjectsAndKeys:file_data, @"file-data", nil];
[file_data release];
[mRegDict setObject:location forKey:GROWL_APP_LOCATION];
[location release];
} else {
[mRegDict removeObjectForKey:GROWL_APP_LOCATION];
}
[myURL release];
}
}
}
if ((!keys) || [keys containsObject:GROWL_NOTIFICATIONS_DEFAULT]) {
if (![mRegDict objectForKey:GROWL_NOTIFICATIONS_DEFAULT]) {
NSArray *all = [mRegDict objectForKey:GROWL_NOTIFICATIONS_ALL];
if (all)
[mRegDict setObject:all forKey:GROWL_NOTIFICATIONS_DEFAULT];
}
}
if ((!keys) || [keys containsObject:GROWL_APP_ID])
if (![mRegDict objectForKey:GROWL_APP_ID])
[mRegDict setObject:(NSString *)CFBundleGetIdentifier(CFBundleGetMainBundle()) forKey:GROWL_APP_ID];
return [mRegDict autorelease];
}
+ (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)notifDict {
NSMutableDictionary *mNotifDict = [notifDict mutableCopy];
if (![mNotifDict objectForKey:GROWL_APP_NAME]) {
if (!appName)
appName = [[self _applicationNameForGrowlSearchingRegistrationDictionary:cachedRegistrationDictionary] retain];
if (appName) {
[mNotifDict setObject:appName
forKey:GROWL_APP_NAME];
}
}
if (![mNotifDict objectForKey:GROWL_APP_ICON]) {
if (!appIconData)
appIconData = [[self _applicationIconDataForGrowlSearchingRegistrationDictionary:cachedRegistrationDictionary] retain];
if (appIconData) {
[mNotifDict setObject:appIconData
forKey:GROWL_APP_ICON];
}
}
//Only include the PID when there's a click context. We do this because NSDNC imposes a 15-MiB limit on the serialized notification, and we wouldn't want to overrun it because of a 4-byte PID.
if ([mNotifDict objectForKey:GROWL_NOTIFICATION_CLICK_CONTEXT] && ![mNotifDict objectForKey:GROWL_APP_PID]) {
NSNumber *pidNum = [[NSNumber alloc] initWithInt:[[NSProcessInfo processInfo] processIdentifier]];
[mNotifDict setObject:pidNum
forKey:GROWL_APP_PID];
[pidNum release];
}
return [mNotifDict autorelease];
}
+ (NSDictionary *) frameworkInfoDictionary {
#ifdef GROWL_WITH_INSTALLER
return (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetBundleWithIdentifier(CFSTR("com.growl.growlwithinstallerframework")));
#else
return (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetBundleWithIdentifier(CFSTR("com.growl.growlframework")));
#endif
}
#pragma mark -
#pragma mark Private methods
+ (NSString *) _applicationNameForGrowlSearchingRegistrationDictionary:(NSDictionary *)regDict {
NSString *applicationNameForGrowl = nil;
if (delegate && [delegate respondsToSelector:@selector(applicationNameForGrowl)])
applicationNameForGrowl = [delegate applicationNameForGrowl];
if (!applicationNameForGrowl) {
applicationNameForGrowl = [regDict objectForKey:GROWL_APP_NAME];
if (!applicationNameForGrowl)
applicationNameForGrowl = [[NSProcessInfo processInfo] processName];
}
return applicationNameForGrowl;
}
+ (NSData *) _applicationIconDataForGrowlSearchingRegistrationDictionary:(NSDictionary *)regDict {
NSData *iconData = nil;
if (delegate) {
if ([delegate respondsToSelector:@selector(applicationIconForGrowl)])
iconData = (NSData *)[delegate applicationIconForGrowl];
else if ([delegate respondsToSelector:@selector(applicationIconDataForGrowl)])
iconData = [delegate applicationIconDataForGrowl];
}
if (!iconData)
iconData = [regDict objectForKey:GROWL_APP_ICON];
if (iconData && [iconData isKindOfClass:[NSImage class]])
iconData = [(NSImage *)iconData TIFFRepresentation];
if (!iconData) {
NSURL *URL = copyCurrentProcessURL();
iconData = [copyIconDataForURL(URL) autorelease];
[URL release];
}
return iconData;
}
/*Selector called when a growl notification is clicked. This should never be
* called manually, and the calling observer should only be registered if the
* delegate responds to growlNotificationWasClicked:.
*/
+ (void) growlNotificationWasClicked:(NSNotification *)notification {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[delegate growlNotificationWasClicked:
[[notification userInfo] objectForKey:GROWL_KEY_CLICKED_CONTEXT]];
[pool drain];
}
+ (void) growlNotificationTimedOut:(NSNotification *)notification {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[delegate growlNotificationTimedOut:
[[notification userInfo] objectForKey:GROWL_KEY_CLICKED_CONTEXT]];
[pool drain];
}
#pragma mark -
//When a connection dies, release our reference to its proxy
+ (void) connectionDidDie:(NSNotification *)notification {
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NSConnectionDidDieNotification
object:[notification object]];
[growlProxy release]; growlProxy = nil;
}
+ (NSProxy<GrowlNotificationProtocol> *) growlProxy {
if (!growlProxy) {
NSConnection *connection = [NSConnection connectionWithRegisteredName:@"GrowlApplicationBridgePathway" host:nil];
if (connection) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(connectionDidDie:)
name:NSConnectionDidDieNotification
object:connection];
TRY
{
NSDistantObject *theProxy = [connection rootProxy];
if ([theProxy respondsToSelector:@selector(registerApplicationWithDictionary:)]) {
[theProxy setProtocolForProxy:@protocol(GrowlNotificationProtocol)];
growlProxy = [(NSProxy<GrowlNotificationProtocol> *)theProxy retain];
} else {
NSLog(@"Received a fake GrowlApplicationBridgePathway object. Some other application is interfering with Growl, or something went horribly wrong. Please file a bug report.");
growlProxy = nil;
}
}
ENDTRY
CATCH
{
NSLog(@"GrowlApplicationBridge: exception while sending notification: %@", localException);
growlProxy = nil;
}
ENDCATCH
}
}
return growlProxy;
}
+ (void) _growlIsReady:(NSNotification *)notification {
#pragma unused(notification)
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//Growl has now launched; we may get here with (growlLaunched == NO) when the user first installs
growlLaunched = YES;
//Inform our delegate if it is interested
if ([delegate respondsToSelector:@selector(growlIsReady)])
[delegate growlIsReady];
//Post a notification locally
[[NSNotificationCenter defaultCenter] postNotificationName:GROWL_IS_READY
object:nil
userInfo:nil];
//Stop observing for GROWL_IS_READY
[[NSDistributedNotificationCenter defaultCenter] removeObserver:self
name:GROWL_IS_READY
object:nil];
//register (fixes #102: this is necessary if we got here by Growl having just been installed)
if (registerWhenGrowlIsReady) {
[self reregisterGrowlNotifications];
registerWhenGrowlIsReady = NO;
}
#ifdef GROWL_WITH_INSTALLER
//Perform any queued notifications
NSEnumerator *enumerator = [queuedGrowlNotifications objectEnumerator];
NSDictionary *noteDict;
//Configure the growl proxy if it isn't currently configured
NSProxy<GrowlNotificationProtocol> *currentGrowlProxy = [self growlProxy];
while ((noteDict = [enumerator nextObject])) {
if (currentGrowlProxy) {
//Post to Growl via GrowlApplicationBridgePathway
NS_DURING
[currentGrowlProxy postNotificationWithDictionary:noteDict];
NS_HANDLER
NSLog(@"GrowlApplicationBridge: exception while sending notification: %@", localException);
NS_ENDHANDLER
} else {
//Post to Growl via NSDistributedNotificationCenter
NSLog(@"GrowlApplicationBridge: could not find local GrowlApplicationBridgePathway, falling back to NSDistributedNotificationCenter");
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:GROWL_NOTIFICATION
object:NULL
userInfo:noteDict
deliverImmediately:FALSE];
}
}
[queuedGrowlNotifications release]; queuedGrowlNotifications = nil;
#endif
[pool drain];
}
#ifdef GROWL_WITH_INSTALLER
/*Sent to us by GrowlInstallationPrompt if the user clicks Cancel so we can
* avoid prompting again this session (or ever if they checked Don't Ask Again)
*/
+ (void) _userChoseNotToInstallGrowl {
//Note the user's action so we stop queueing notifications, etc.
userChoseNotToInstallGrowl = YES;
//Clear our queued notifications; we won't be needing them
[queuedGrowlNotifications release]; queuedGrowlNotifications = nil;
}
// Check against our current version number and ensure the installed Growl pane is the same or later
+ (void) _checkForPackagedUpdateForGrowlPrefPaneBundle:(NSBundle *)growlPrefPaneBundle {
NSString *ourGrowlPrefPaneInfoPath;
NSDictionary *infoDictionary;
NSString *packagedVersion, *installedVersion;
BOOL upgradeIsAvailable;
ourGrowlPrefPaneInfoPath = [[NSBundle bundleWithIdentifier:@"com.growl.growlwithinstallerframework"] pathForResource:@"GrowlPrefPaneInfo"
ofType:@"plist"];
NSObject *infoPropertyList = createPropertyListFromURL([NSURL fileURLWithPath:ourGrowlPrefPaneInfoPath],
kCFPropertyListImmutable,
/* outFormat */ NULL, /* outErrorString */ NULL);
NSDictionary *infoDict = ([infoPropertyList isKindOfClass:[NSDictionary class]] ? (NSDictionary *)infoPropertyList : nil);
packagedVersion = [infoDict objectForKey:(NSString *)kCFBundleVersionKey];
infoDictionary = [growlPrefPaneBundle infoDictionary];
installedVersion = [infoDictionary objectForKey:(NSString *)kCFBundleVersionKey];
//If the installed version is earlier than our packaged version, we can offer an upgrade.
upgradeIsAvailable = (compareVersionStringsTranslating1_0To0_5(packagedVersion, installedVersion) == kCFCompareGreaterThan);
if (upgradeIsAvailable && !promptedToUpgradeGrowl) {
NSString *lastDoNotPromptVersion = [[NSUserDefaults standardUserDefaults] objectForKey:@"Growl Update:Do Not Prompt Again:Last Version"];
if (!lastDoNotPromptVersion ||
(compareVersionStringsTranslating1_0To0_5(packagedVersion, lastDoNotPromptVersion) == kCFCompareGreaterThan))
{
[GrowlInstallationPrompt showUpdatePromptForVersion:packagedVersion];
promptedToUpgradeGrowl = YES;
}
}
[infoDict release];
}
#endif
#pragma mark -
+ (BOOL) _launchGrowlIfInstalledWithRegistrationDictionary:(NSDictionary *)regDict {
BOOL success = NO;
NSBundle *growlPrefPaneBundle;
NSString *growlHelperAppPath;
#ifdef DEBUG
//For a debug build, first look for a running GHA. It might not actually be within a Growl prefpane bundle.
growlHelperAppPath = [[GrowlPathUtilities runningHelperAppBundle] bundlePath];
if (!growlHelperAppPath) {
growlPrefPaneBundle = [GrowlPathUtilities growlPrefPaneBundle];
growlHelperAppPath = [growlPrefPaneBundle pathForResource:@"GrowlHelperApp"
ofType:@"app"];
}
NSLog(@"Will use GrowlHelperApp at %@", growlHelperAppPath);
#else
growlPrefPaneBundle = [GrowlPathUtilities growlPrefPaneBundle];
growlHelperAppPath = [growlPrefPaneBundle pathForResource:@"GrowlHelperApp"
ofType:@"app"];
#endif
#ifdef GROWL_WITH_INSTALLER
if (growlPrefPaneBundle) {
/* Check against our current version number and ensure the installed Growl pane is the same or later */
[self _checkForPackagedUpdateForGrowlPrefPaneBundle:growlPrefPaneBundle];
}
#endif
//Houston, we are go for launch.
if (growlHelperAppPath) {
//Let's launch in the background (requires sending the Apple Event ourselves, as LS may activate the application anyway if it's already running)
NSURL *appURL = [NSURL fileURLWithPath:growlHelperAppPath];
if (appURL) {
OSStatus err;
//Find the PSN for GrowlHelperApp. (We'll need this later.)
struct ProcessSerialNumber appPSN = {
0, kNoProcess
};
while ((err = GetNextProcess(&appPSN)) == noErr) {
NSDictionary *dict = [(id)ProcessInformationCopyDictionary(&appPSN, kProcessDictionaryIncludeAllInformationMask) autorelease];
NSString *bundlePath = [dict objectForKey:@"BundlePath"];
if ([bundlePath isEqualToString:growlHelperAppPath]) {
//Match!
break;
}
}
if (err == noErr) {
NSURL *regItemURL = nil;
BOOL passRegDict = NO;
if (regDict) {
NSString *regDictFileName;
NSString *regDictPath;
//Obtain a truly unique file name
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuid);
CFRelease(uuid);
regDictFileName = [[NSString stringWithFormat:@"%@-%u-%@", [self _applicationNameForGrowlSearchingRegistrationDictionary:regDict], getpid(), (NSString *)uuidString] stringByAppendingPathExtension:GROWL_REG_DICT_EXTENSION];
CFRelease(uuidString);
if ([regDictFileName length] > NAME_MAX)
regDictFileName = [[regDictFileName substringToIndex:(NAME_MAX - [GROWL_REG_DICT_EXTENSION length])] stringByAppendingPathExtension:GROWL_REG_DICT_EXTENSION];
//make sure it's within pathname length constraints
regDictPath = [NSTemporaryDirectory() stringByAppendingPathComponent:regDictFileName];
if ([regDictPath length] > PATH_MAX)
regDictPath = [[regDictPath substringToIndex:(PATH_MAX - [GROWL_REG_DICT_EXTENSION length])] stringByAppendingPathExtension:GROWL_REG_DICT_EXTENSION];
//Write the registration dictionary out to the temporary directory
NSData *plistData;
NSString *error;
plistData = [NSPropertyListSerialization dataFromPropertyList:regDict
format:NSPropertyListBinaryFormat_v1_0
errorDescription:&error];
if (plistData) {
if (![plistData writeToFile:regDictPath atomically:NO])
NSLog(@"GrowlApplicationBridge: Error writing registration dictionary at %@", regDictPath);
} else {
NSLog(@"GrowlApplicationBridge: Error writing registration dictionary at %@: %@", regDictPath, error);
NSLog(@"GrowlApplicationBridge: Registration dictionary follows\n%@", regDict);
[error release];
}
if ([[NSFileManager defaultManager] fileExistsAtPath:regDictPath]) {
regItemURL = [NSURL fileURLWithPath:regDictPath];
passRegDict = YES;
}
}
AEStreamRef stream = AEStreamCreateEvent(kCoreEventClass, kAEOpenDocuments,
//Target application
typeProcessSerialNumber, &appPSN, sizeof(appPSN),
kAutoGenerateReturnID, kAnyTransactionID);
if (!stream) {
NSLog(@"%@: Could not create open-document event to register this application with Growl", [self class]);
} else {
if (passRegDict) {
NSString *regItemURLString = [regItemURL absoluteString];
NSData *regItemURLUTF8Data = [regItemURLString dataUsingEncoding:NSUTF8StringEncoding];
err = AEStreamWriteKeyDesc(stream, keyDirectObject, typeFileURL, [regItemURLUTF8Data bytes], [regItemURLUTF8Data length]);
if (err != noErr) {
NSLog(@"%@: Could not set direct object of open-document event to register this application with Growl because AEStreamWriteKeyDesc returned %li/%s", [self class], (long)err, GetMacOSStatusCommentString(err));
}
}
AppleEvent event;
err = AEStreamClose(stream, &event);
if (err != noErr) {
NSLog(@"%@: Could not finish open-document event to register this application with Growl because AEStreamClose returned %li/%s", [self class], (long)err, GetMacOSStatusCommentString(err));
} else {
err = AESendMessage(&event, /*reply*/ NULL, kAENoReply | kAEDontReconnect | kAENeverInteract | kAEDontRecord, kAEDefaultTimeout);
if (err != noErr) {
NSLog(@"%@: Could not send open-document event to register this application with Growl because AESend returned %li/%s", [self class], (long)err, GetMacOSStatusCommentString(err));
}
}
success = (err == noErr);
}
}
}
}
return success;
}
/* + (BOOL)launchGrowlIfInstalled
*
*Returns YES if the Growl helper app began launching or was already running.
*Returns NO and performs no other action if the Growl prefPane is not properly
* installed.
*If Growl is installed but disabled, the application will be registered and
* GrowlHelperApp will then quit. This method will still return YES if Growl
* is installed but disabled.
*/
+ (BOOL) launchGrowlIfInstalled {
return [self _launchGrowlIfInstalledWithRegistrationDictionary:nil];
}
@end