adium 3884:3113b7777263: Moved AIDockIconSelectionSheet to use A...
commits at adium.im
commits at adium.im
Thu Apr 28 23:41:46 UTC 2011
details: http://hg.adium.im/adium/rev/3113b7777263
revision: 3884:3113b7777263
branch: (none)
author: Adrian Godoroja <robotive at me.com>
date: Fri Apr 29 02:38:40 2011 +0300
Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Also some fixes and improvements (Refs #15158 - Fix_ed for 1.5hg).
Lots of improvements/additions to AIImageCollectionView.
Moved AIImageCollectionView to AIUtilities Framework.
Subject: adium 3885:a1c9c5edab48: Failed to remove with previous commit.
details: http://hg.adium.im/adium/rev/a1c9c5edab48
revision: 3885:a1c9c5edab48
branch: (none)
author: Adrian Godoroja <robotive at me.com>
date: Fri Apr 29 02:40:26 2011 +0300
Failed to remove with previous commit.
diffs (truncated from 4041 to 1000 lines):
diff -r df3768063e2e -r a1c9c5edab48 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj Thu Apr 28 20:33:32 2011 +0200
+++ b/Adium.xcodeproj/project.pbxproj Fri Apr 29 02:40:26 2011 +0300
@@ -1042,7 +1042,7 @@
377EC8940AE9525B00CB7BDF /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 377EC8930AE9525B00CB7BDF /* PSMTabBarControl.framework */; };
377ED0220AE95D7D00CB7BDF /* PSMTabBarControl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 377EC8930AE9525B00CB7BDF /* PSMTabBarControl.framework */; };
4B08399507D2350D0034A001 /* AIDockIconSelectionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B08399307D2350D0034A001 /* AIDockIconSelectionSheet.m */; };
- 4B08399C07D235190034A001 /* DockIconSelectionSheet.nib in Resources */ = {isa = PBXBuildFile; fileRef = 4B08399B07D235190034A001 /* DockIconSelectionSheet.nib */; };
+ 4B08399C07D235190034A001 /* DockIconSelectionSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B08399B07D235190034A001 /* DockIconSelectionSheet.xib */; };
4B191D8A0611C10800E8A4E7 /* License.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4B191D880611C10800E8A4E7 /* License.txt */; };
4B191D8B0611C10800E8A4E7 /* ReadMe.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 4B191D890611C10800E8A4E7 /* ReadMe.rtf */; };
4B7A567B07A1754400BDC540 /* AIEditAccountWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B7A567807A1754400BDC540 /* AIEditAccountWindowController.m */; };
@@ -1248,8 +1248,6 @@
633400560F9C14C2003C77A9 /* AITextViewWithPlaceholder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF7B0F9C14C0003C77A9 /* AITextViewWithPlaceholder.m */; };
633400570F9C14C2003C77A9 /* AIFlexibleToolbarItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF7D0F9C14C0003C77A9 /* AIFlexibleToolbarItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
633400580F9C14C2003C77A9 /* AIFlexibleToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF7E0F9C14C0003C77A9 /* AIFlexibleToolbarItem.m */; };
- 633400590F9C14C2003C77A9 /* AIImageGridView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF800F9C14C0003C77A9 /* AIImageGridView.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 6334005A0F9C14C2003C77A9 /* AIImageGridView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF810F9C14C0003C77A9 /* AIImageGridView.m */; };
6334005B0F9C14C2003C77A9 /* AIDockingWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF830F9C14C0003C77A9 /* AIDockingWindow.h */; settings = {ATTRIBUTES = (Public, ); }; };
6334005C0F9C14C2003C77A9 /* AIDockingWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF840F9C14C0003C77A9 /* AIDockingWindow.m */; };
6334005D0F9C14C2003C77A9 /* AIBorderlessWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF860F9C14C0003C77A9 /* AIBorderlessWindow.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1486,10 +1484,10 @@
81DAED520C26F4F700780E4C /* AMPurpleJabberServiceDiscoveryBrowsing.h in Headers */ = {isa = PBXBuildFile; fileRef = 81DAED500C26F4F700780E4C /* AMPurpleJabberServiceDiscoveryBrowsing.h */; };
81DAED530C26F4F700780E4C /* AMPurpleJabberServiceDiscoveryBrowsing.m in Sources */ = {isa = PBXBuildFile; fileRef = 81DAED510C26F4F700780E4C /* AMPurpleJabberServiceDiscoveryBrowsing.m */; };
81E45D760C15BFF800B7381B /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E839050583207E00F2AADB /* SystemConfiguration.framework */; };
+ 9718DF45136A2C5200013760 /* AIImageCollectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 9718DF43136A2C5200013760 /* AIImageCollectionView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9718DF46136A2C5200013760 /* AIImageCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9718DF44136A2C5200013760 /* AIImageCollectionView.m */; };
9722ABC813257D7F00CAB486 /* ContactListWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9722ABC713257D7F00CAB486 /* ContactListWindow.xib */; };
97AF5CDB13191DE200550C41 /* AIContactListUserPictureMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = 97AF5CDA13191DE200550C41 /* AIContactListUserPictureMenuController.m */; };
- 97AF5CE713191E4800550C41 /* AIImageCollectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AF5CE213191E2800550C41 /* AIImageCollectionView.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 97AF5CE813191E4800550C41 /* AIImageCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97AF5CE313191E2800550C41 /* AIImageCollectionView.m */; };
97AF5CF413191E9A00550C41 /* ContactListChangeUserPictureMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 97AF5CF313191E9A00550C41 /* ContactListChangeUserPictureMenu.xib */; };
9E124DEC07D34C7300AA91C5 /* CBGrowlAlertDetailPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E124DE807D34C7300AA91C5 /* CBGrowlAlertDetailPane.m */; };
9E124DEE07D34C7400AA91C5 /* NEHGrowlPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E124DEA07D34C7300AA91C5 /* NEHGrowlPlugin.m */; };
@@ -3063,7 +3061,7 @@
346C9C200E70E1F8002314EE /* hu */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = hu; path = "Plugins/WebKit Message View/hu.lproj/WebKitPreferencesView.nib"; sourceTree = "<group>"; };
346CFDC4087B7836009711C8 /* AdiumIdleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AdiumIdleManager.h; path = Source/AdiumIdleManager.h; sourceTree = "<group>"; };
346CFDC5087B7836009711C8 /* AdiumIdleManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AdiumIdleManager.m; path = Source/AdiumIdleManager.m; sourceTree = "<group>"; };
- 346F5CB308A418FB0055C610 /* CurrentTunes.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.scpt; name = CurrentTunes.scpt; path = Resources/CurrentTunes.scpt; sourceTree = "<group>"; };
+ 346F5CB308A418FB0055C610 /* CurrentTunes.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = file; name = CurrentTunes.scpt; path = Resources/CurrentTunes.scpt; sourceTree = "<group>"; };
347065E406015DC5004F0D20 /* WebKit Defaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; name = "WebKit Defaults.plist"; path = "Plugins/WebKit Message View/WebKit Defaults.plist"; sourceTree = "<group>"; };
347374BC0AA9206B00AD18E3 /* en */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/ShortcutRecorder.strings; sourceTree = "<group>"; };
347374F00AA920F300AD18E3 /* ca */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ca; path = Resources/ca.lproj/ShortcutRecorder.strings; sourceTree = "<group>"; };
@@ -3848,7 +3846,7 @@
34F4675B080F46AC007800AB /* ESBonjourAccountView.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = ESBonjourAccountView.nib; sourceTree = "<group>"; };
34F4675C080F46AC007800AB /* AWBonjourService.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AWBonjourService.m; sourceTree = "<group>"; };
34F4675D080F46AC007800AB /* AWBonjourService.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AWBonjourService.h; sourceTree = "<group>"; };
- 34F46778080F49C5007800AB /* Safari.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.scpt; name = Safari.scpt; path = Resources/Safari.scpt; sourceTree = "<group>"; };
+ 34F46778080F49C5007800AB /* Safari.scpt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = file; name = Safari.scpt; path = Resources/Safari.scpt; sourceTree = "<group>"; };
34F46779080F49C5007800AB /* Safari.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Safari.png; path = Resources/Safari.png; sourceTree = "<group>"; };
34F46783080F7FFB007800AB /* ESSafariLinkToolbarItemPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ESSafariLinkToolbarItemPlugin.m; path = Source/ESSafariLinkToolbarItemPlugin.m; sourceTree = "<group>"; };
34F46784080F7FFB007800AB /* ESSafariLinkToolbarItemPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ESSafariLinkToolbarItemPlugin.h; path = Source/ESSafariLinkToolbarItemPlugin.h; sourceTree = "<group>"; };
@@ -3926,7 +3924,7 @@
4B03711506595A70008F5981 /* Template.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; name = Template.html; path = "Plugins/WebKit Message View/Template.html"; sourceTree = "<group>"; };
4B08399207D2350D0034A001 /* AIDockIconSelectionSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIDockIconSelectionSheet.h; path = Source/AIDockIconSelectionSheet.h; sourceTree = "<group>"; };
4B08399307D2350D0034A001 /* AIDockIconSelectionSheet.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AIDockIconSelectionSheet.m; path = Source/AIDockIconSelectionSheet.m; sourceTree = "<group>"; };
- 4B08399B07D235190034A001 /* DockIconSelectionSheet.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = DockIconSelectionSheet.nib; path = Resources/DockIconSelectionSheet.nib; sourceTree = "<group>"; };
+ 4B08399B07D235190034A001 /* DockIconSelectionSheet.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DockIconSelectionSheet.xib; path = Resources/DockIconSelectionSheet.xib; sourceTree = "<group>"; };
4B09D5C005D5265800BC00F0 /* AIMetaContact.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIMetaContact.h; path = "Frameworks/Adium Framework/Source/AIMetaContact.h"; sourceTree = "<group>"; };
4B09D5C105D5265800BC00F0 /* AIMetaContact.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AIMetaContact.m; path = "Frameworks/Adium Framework/Source/AIMetaContact.m"; sourceTree = "<group>"; };
4B14CF24085FBC5800C88949 /* AdiumSound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AdiumSound.h; path = Source/AdiumSound.h; sourceTree = "<group>"; };
@@ -4347,8 +4345,6 @@
6334FF7B0F9C14C0003C77A9 /* AITextViewWithPlaceholder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AITextViewWithPlaceholder.m; path = "Frameworks/AIUtilities Framework/Source/AITextViewWithPlaceholder.m"; sourceTree = "<group>"; };
6334FF7D0F9C14C0003C77A9 /* AIFlexibleToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIFlexibleToolbarItem.h; path = "Frameworks/AIUtilities Framework/Source/AIFlexibleToolbarItem.h"; sourceTree = "<group>"; };
6334FF7E0F9C14C0003C77A9 /* AIFlexibleToolbarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIFlexibleToolbarItem.m; path = "Frameworks/AIUtilities Framework/Source/AIFlexibleToolbarItem.m"; sourceTree = "<group>"; };
- 6334FF800F9C14C0003C77A9 /* AIImageGridView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIImageGridView.h; path = "Frameworks/AIUtilities Framework/Source/AIImageGridView.h"; sourceTree = "<group>"; };
- 6334FF810F9C14C0003C77A9 /* AIImageGridView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIImageGridView.m; path = "Frameworks/AIUtilities Framework/Source/AIImageGridView.m"; sourceTree = "<group>"; };
6334FF830F9C14C0003C77A9 /* AIDockingWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIDockingWindow.h; path = "Frameworks/AIUtilities Framework/Source/AIDockingWindow.h"; sourceTree = "<group>"; };
6334FF840F9C14C0003C77A9 /* AIDockingWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIDockingWindow.m; path = "Frameworks/AIUtilities Framework/Source/AIDockingWindow.m"; sourceTree = "<group>"; };
6334FF860F9C14C0003C77A9 /* AIBorderlessWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIBorderlessWindow.h; path = "Frameworks/AIUtilities Framework/Source/AIBorderlessWindow.h"; sourceTree = "<group>"; };
@@ -4511,12 +4507,12 @@
6360B2590BF2EB93004CD99B /* AIWebKitDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIWebKitDelegate.m; path = "Plugins/WebKit Message View/AIWebKitDelegate.m"; sourceTree = "<group>"; };
636C6E5D0ED56D0100E0E528 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = /usr/lib/libcrypto.dylib; sourceTree = "<absolute>"; };
636D8C970E4E95A500E5F558 /* AIAddressBookController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIAddressBookController.m; path = "Frameworks/Adium Framework/Source/AIAddressBookController.m"; sourceTree = "<group>"; };
- 636D93660E4E9FD300E5F558 /* AdiumAddressBookAction_Yahoo.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.scpt; name = AdiumAddressBookAction_Yahoo.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_Yahoo.scpt"; sourceTree = "<group>"; };
- 636D93670E4E9FD300E5F558 /* AdiumAddressBookAction_SMS.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.scpt; name = AdiumAddressBookAction_SMS.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_SMS.scpt"; sourceTree = "<group>"; };
- 636D93680E4E9FD300E5F558 /* AdiumAddressBookAction_MSN.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.scpt; name = AdiumAddressBookAction_MSN.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_MSN.scpt"; sourceTree = "<group>"; };
- 636D93690E4E9FD300E5F558 /* AdiumAddressBookAction_Jabber.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.scpt; name = AdiumAddressBookAction_Jabber.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_Jabber.scpt"; sourceTree = "<group>"; };
- 636D936A0E4E9FD300E5F558 /* AdiumAddressBookAction_ICQ.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.scpt; name = AdiumAddressBookAction_ICQ.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_ICQ.scpt"; sourceTree = "<group>"; };
- 636D936B0E4E9FD300E5F558 /* AdiumAddressBookAction_AIM.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.scpt; name = AdiumAddressBookAction_AIM.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_AIM.scpt"; sourceTree = "<group>"; };
+ 636D93660E4E9FD300E5F558 /* AdiumAddressBookAction_Yahoo.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = AdiumAddressBookAction_Yahoo.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_Yahoo.scpt"; sourceTree = "<group>"; };
+ 636D93670E4E9FD300E5F558 /* AdiumAddressBookAction_SMS.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = AdiumAddressBookAction_SMS.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_SMS.scpt"; sourceTree = "<group>"; };
+ 636D93680E4E9FD300E5F558 /* AdiumAddressBookAction_MSN.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = AdiumAddressBookAction_MSN.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_MSN.scpt"; sourceTree = "<group>"; };
+ 636D93690E4E9FD300E5F558 /* AdiumAddressBookAction_Jabber.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = AdiumAddressBookAction_Jabber.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_Jabber.scpt"; sourceTree = "<group>"; };
+ 636D936A0E4E9FD300E5F558 /* AdiumAddressBookAction_ICQ.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = AdiumAddressBookAction_ICQ.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_ICQ.scpt"; sourceTree = "<group>"; };
+ 636D936B0E4E9FD300E5F558 /* AdiumAddressBookAction_AIM.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = AdiumAddressBookAction_AIM.scpt; path = "Frameworks/Adium Framework/Resources/AdiumAddressBookAction_AIM.scpt"; sourceTree = "<group>"; };
638392F609D4D67A0067B9B7 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Frameworks/Sparkle.framework; sourceTree = "<group>"; };
638BC1FA0FC932E000CE7600 /* AIObjectDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIObjectDebug.h; path = Source/AIObjectDebug.h; sourceTree = "<group>"; };
638BC1FB0FC932E000CE7600 /* AIObjectDebug.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIObjectDebug.m; path = Source/AIObjectDebug.m; sourceTree = "<group>"; };
@@ -4692,11 +4688,11 @@
81DAE8710C261E8A00780E4C /* AMPurpleTuneTooltip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AMPurpleTuneTooltip.m; path = "Plugins/Purple Service/AMPurpleTuneTooltip.m"; sourceTree = "<group>"; };
81DAED500C26F4F700780E4C /* AMPurpleJabberServiceDiscoveryBrowsing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AMPurpleJabberServiceDiscoveryBrowsing.h; path = "Plugins/Purple Service/AMPurpleJabberServiceDiscoveryBrowsing.h"; sourceTree = "<group>"; };
81DAED510C26F4F700780E4C /* AMPurpleJabberServiceDiscoveryBrowsing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AMPurpleJabberServiceDiscoveryBrowsing.m; path = "Plugins/Purple Service/AMPurpleJabberServiceDiscoveryBrowsing.m"; sourceTree = "<group>"; };
+ 9718DF43136A2C5200013760 /* AIImageCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIImageCollectionView.h; path = "Frameworks/AIUtilities Framework/Source/AIImageCollectionView.h"; sourceTree = "<group>"; };
+ 9718DF44136A2C5200013760 /* AIImageCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIImageCollectionView.m; path = "Frameworks/AIUtilities Framework/Source/AIImageCollectionView.m"; sourceTree = "<group>"; };
9722ABC713257D7F00CAB486 /* ContactListWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ContactListWindow.xib; path = Resources/ContactListWindow.xib; sourceTree = "<group>"; };
97AF5CD913191DE200550C41 /* AIContactListUserPictureMenuController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIContactListUserPictureMenuController.h; path = Source/AIContactListUserPictureMenuController.h; sourceTree = "<group>"; };
97AF5CDA13191DE200550C41 /* AIContactListUserPictureMenuController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIContactListUserPictureMenuController.m; path = Source/AIContactListUserPictureMenuController.m; sourceTree = "<group>"; };
- 97AF5CE213191E2800550C41 /* AIImageCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIImageCollectionView.h; path = Source/AIImageCollectionView.h; sourceTree = "<group>"; };
- 97AF5CE313191E2800550C41 /* AIImageCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIImageCollectionView.m; path = Source/AIImageCollectionView.m; sourceTree = "<group>"; };
97AF5CF313191E9A00550C41 /* ContactListChangeUserPictureMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ContactListChangeUserPictureMenu.xib; path = Resources/ContactListChangeUserPictureMenu.xib; sourceTree = "<group>"; };
9C103FAE057127A500F3C158 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = "<absolute>"; };
9E124DE707D34C7300AA91C5 /* CBGrowlAlertDetailPane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CBGrowlAlertDetailPane.h; path = Source/CBGrowlAlertDetailPane.h; sourceTree = "<group>"; };
@@ -7148,7 +7144,7 @@
343EB40108086D9000E27095 /* AppearancePrefs.nib */,
4B08399207D2350D0034A001 /* AIDockIconSelectionSheet.h */,
4B08399307D2350D0034A001 /* AIDockIconSelectionSheet.m */,
- 4B08399B07D235190034A001 /* DockIconSelectionSheet.nib */,
+ 4B08399B07D235190034A001 /* DockIconSelectionSheet.xib */,
34A48A3A06F64664002C7C5F /* AIListLayoutWindowController.h */,
34A48A3D06F64665002C7C5F /* AIListLayoutWindowController.m */,
343EC6910809DD3400E27095 /* ListLayoutSheet.nib */,
@@ -7933,10 +7929,8 @@
6334FF7F0F9C14C0003C77A9 /* View that displays images in a grid iPhoto style */ = {
isa = PBXGroup;
children = (
- 97AF5CE213191E2800550C41 /* AIImageCollectionView.h */,
- 97AF5CE313191E2800550C41 /* AIImageCollectionView.m */,
- 6334FF800F9C14C0003C77A9 /* AIImageGridView.h */,
- 6334FF810F9C14C0003C77A9 /* AIImageGridView.m */,
+ 9718DF43136A2C5200013760 /* AIImageCollectionView.h */,
+ 9718DF44136A2C5200013760 /* AIImageCollectionView.m */,
);
name = "View that displays images in a grid iPhoto style";
sourceTree = "<group>";
@@ -9272,7 +9266,6 @@
633400530F9C14C2003C77A9 /* AITextFieldWithDraggingDelegate.h in Headers */,
633400550F9C14C2003C77A9 /* AITextViewWithPlaceholder.h in Headers */,
633400570F9C14C2003C77A9 /* AIFlexibleToolbarItem.h in Headers */,
- 633400590F9C14C2003C77A9 /* AIImageGridView.h in Headers */,
6334005B0F9C14C2003C77A9 /* AIDockingWindow.h in Headers */,
6334005D0F9C14C2003C77A9 /* AIBorderlessWindow.h in Headers */,
6334005F0F9C14C2003C77A9 /* AIGenericViewCell.h in Headers */,
@@ -9328,7 +9321,7 @@
11AA10130FCE0969003908B6 /* AIProgressDataUploader.h in Headers */,
7E959AD010E3187000C26397 /* AIMathCompatibility.h in Headers */,
5A5F601E12962ECE007A2232 /* AISegmentedControl.h in Headers */,
- 97AF5CE713191E4800550C41 /* AIImageCollectionView.h in Headers */,
+ 9718DF45136A2C5200013760 /* AIImageCollectionView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -9491,6 +9484,7 @@
};
buildConfigurationList = DADE8E3A085507450062B664 /* Build configuration list for PBXProject "Adium" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
@@ -9772,7 +9766,7 @@
343EB40208086D9000E27095 /* AppearancePrefs.nib in Resources */,
4BF3CB4207D1771E00A8112A /* pref-appearance.png in Resources */,
4BF3CBED07D192F500A8112A /* pref-accounts.png in Resources */,
- 4B08399C07D235190034A001 /* DockIconSelectionSheet.nib in Resources */,
+ 4B08399C07D235190034A001 /* DockIconSelectionSheet.xib in Resources */,
3474E0910825634300BF30F0 /* StatusPreferences.nib in Resources */,
342838EE07D2D004004F01C9 /* Shared Dock Icon Images in Resources */,
4BB5B78207D2DC4900CFE06F /* pref-status.png in Resources */,
@@ -10745,7 +10739,6 @@
633400540F9C14C2003C77A9 /* AITextFieldWithDraggingDelegate.m in Sources */,
633400560F9C14C2003C77A9 /* AITextViewWithPlaceholder.m in Sources */,
633400580F9C14C2003C77A9 /* AIFlexibleToolbarItem.m in Sources */,
- 6334005A0F9C14C2003C77A9 /* AIImageGridView.m in Sources */,
6334005C0F9C14C2003C77A9 /* AIDockingWindow.m in Sources */,
6334005E0F9C14C2003C77A9 /* AIBorderlessWindow.m in Sources */,
633400600F9C14C2003C77A9 /* AIGenericViewCell.m in Sources */,
@@ -10797,7 +10790,7 @@
63BB1CC90F9EDDB600424B80 /* AISharedWriterQueue.m in Sources */,
11AA10140FCE0969003908B6 /* AIProgressDataUploader.m in Sources */,
5A5F601D12962EC0007A2232 /* AISegmentedControl.m in Sources */,
- 97AF5CE813191E4800550C41 /* AIImageCollectionView.m in Sources */,
+ 9718DF46136A2C5200013760 /* AIImageCollectionView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff -r df3768063e2e -r a1c9c5edab48 Frameworks/AIUtilities Framework/Source/AIImageCollectionView.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/AIUtilities Framework/Source/AIImageCollectionView.h Fri Apr 29 02:40:26 2011 +0300
@@ -0,0 +1,107 @@
+/*
+ * Adium is the legal property of its developers, whose names are listed in the copyright file included
+ * with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License as published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program; if not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+ at protocol AIImageCollectionViewDelegate;
+
+#pragma mark - AIImageCollectionView
+
+/*!
+ * @class AIImageCollectionView
+ * @brief NSCollectionView subclass
+ *
+ * Displays images in a grid
+ * supports item highlighting and selection
+ */
+ at interface AIImageCollectionView : NSCollectionView {
+
+ id <AIImageCollectionViewDelegate> delegate;
+
+ at protected
+ IBOutlet NSArrayController *itemsController;
+
+ NSInteger highlightStyle;
+ CGFloat highlightSize;
+ CGFloat highlightCornerRadius;
+
+ NSUInteger highlightedIndex;
+}
+
+ at property (readwrite, assign, nonatomic) id <AIImageCollectionViewDelegate> delegate;
+
+ at property (assign) IBOutlet NSArrayController *itemsController;
+
+ at property (assign) NSInteger highlightStyle;
+ at property (assign) CGFloat highlightSize;
+ at property (assign) CGFloat highlightCornerRadius;
+ at property (assign) NSUInteger highlightedIndex;
+
+#pragma mark -
+
+/*!
+ * @brief Set the image for item at index
+ *
+ * @param <tt>NSImage</tt>
+ * @param <tt>NSUInteger</tt>
+ */
+- (void)setImage:(NSImage *)anImage forItemAtIndex:(NSUInteger)anIndex;
+
+ at end
+
+#pragma mark -
+
+/*!
+ * @brief AIImageCollectionViewCornerStyle
+ *
+ * Item & Highlight corners style, squared|rounded
+ */
+enum {
+ AIImageCollectionViewCornerSquaredStyle = 0,
+ AIImageCollectionViewCornerRoundedStyle = 1
+};
+
+typedef NSInteger AIImageCollectionViewCornerStyle;
+
+/*!
+ * @brief AIImageCollectionViewHighlightStyle
+ *
+ * Highlight style, border|background
+ */
+enum {
+ AIImageCollectionViewHighlightBorderStyle = 0,
+ AIImageCollectionViewHighlightBackgroundStyle = 1
+};
+
+typedef NSInteger AIImageCollectionViewHighlightStyle;
+
+#pragma mark - AIImageCollectionViewDelegate
+
+/*!
+ * @protocol AIImageCollectionViewDelegate
+ * @brief Sends highlighting/selection related messages to a delegate
+ */
+ at protocol AIImageCollectionViewDelegate <NSObject>
+
+ at optional
+
+- (BOOL)imageCollectionView:(AIImageCollectionView *)imageCollectionView shouldSelectItemAtIndex:(NSUInteger)index;
+- (BOOL)imageCollectionView:(AIImageCollectionView *)imageCollectionView shouldHighlightItemAtIndex:(NSUInteger)index;
+- (BOOL)imageCollectionView:(AIImageCollectionView *)imageCollectionView shouldDeleteItemsAtIndexes:(NSIndexSet *)indexes;
+- (void)imageCollectionView:(AIImageCollectionView *)imageCollectionView didSelectItemAtIndex:(NSUInteger)index;
+- (void)imageCollectionView:(AIImageCollectionView *)imageCollectionView didHighlightItemAtIndex:(NSUInteger)index;
+- (void)imageCollectionView:(AIImageCollectionView *)imageCollectionView didDeleteItemsAtIndexes:(NSIndexSet *)indexes;
+
+ at end
diff -r df3768063e2e -r a1c9c5edab48 Frameworks/AIUtilities Framework/Source/AIImageCollectionView.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/AIUtilities Framework/Source/AIImageCollectionView.m Fri Apr 29 02:40:26 2011 +0300
@@ -0,0 +1,339 @@
+/*
+ * Adium is the legal property of its developers, whose names are listed in the copyright file included
+ * with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License as published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program; if not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+#import "AIImageCollectionView.h"
+
+
+ at interface AIImageCollectionView ()
+
+- (void)AI_initImageCollectionView;
+
+- (NSUInteger)indexAtPoint:(NSPoint)aPoint;
+
+- (void)highlightItemAtIndex:(NSUInteger)anIndex;
+- (void)selectItemAtIndex:(NSUInteger)anIndex;
+
+- (void)resetHighlight;
+
+ at end
+
+
+ at implementation AIImageCollectionView
+
+
+ at synthesize delegate;
+ at synthesize itemsController;
+ at synthesize highlightStyle, highlightSize, highlightCornerRadius;
+ at synthesize highlightedIndex;
+
+
+- (id)initWithFrame:(NSRect)frame
+{
+ if ((self = [super initWithFrame:frame])) {
+ // Initialize
+ [self AI_initImageCollectionView];
+ }
+
+ return self;
+}
+
+- (void)awakeFromNib
+{
+ // Initialize
+ [self AI_initImageCollectionView];
+}
+
+/*!
+ * @brief Initialize object using default values
+ */
+- (void)AI_initImageCollectionView
+{
+ highlightStyle = AIImageCollectionViewHighlightBorderStyle;
+ highlightSize = 2.0f;
+ highlightCornerRadius = 0.0f;
+
+ highlightedIndex = NSNotFound;
+
+ // Mouse Tracking
+ [self addTrackingArea:[[[NSTrackingArea alloc] initWithRect:[self bounds]
+ options:(NSTrackingMouseEnteredAndExited |
+ NSTrackingActiveInKeyWindow |
+ NSTrackingInVisibleRect)
+ owner:self
+ userInfo:nil] autorelease]];
+
+ // Temporary solution, 1st tracking area will only report MouseMoved Events
+ [self addTrackingArea:[[[NSTrackingArea alloc] initWithRect:[self bounds]
+ options:(NSTrackingMouseMoved |
+ NSTrackingActiveInKeyWindow |
+ NSTrackingInVisibleRect)
+ owner:self
+ userInfo:nil] autorelease]];
+
+ // Track for item's selection changes
+ [self addObserver:self forKeyPath:@"selectionIndexes"
+ options:(NSKeyValueObservingOptionNew)
+ context:NULL];
+
+ // Track for item's content changes
+ [self addObserver:self forKeyPath:@"content"
+ options:(NSKeyValueObservingOptionNew)
+ context:NULL];
+}
+
+- (void)dealloc
+{
+ [self removeObserver:self forKeyPath:@"selectionIndexes"];
+ [self removeObserver:self forKeyPath:@"content"];
+
+ [super dealloc];
+}
+
+- (void)drawRect:(NSRect)dirtyRect
+{
+ // Draw selection
+ if ([[self selectionIndexes] count] > 0) {
+ [[NSColor selectedMenuItemColor] set];
+
+ [[self selectionIndexes] enumerateIndexesUsingBlock:^(NSUInteger anIndex, BOOL *stop) {
+ NSRect highlightRect = [self frameForItemAtIndex:anIndex];
+
+ // Adjust Pattern
+ [[NSGraphicsContext currentContext] setPatternPhase:NSMakePoint(0.0f, NSMaxY([self convertRect:highlightRect toView:nil]))];
+
+ // Adjust highlight rect
+ highlightRect.origin.x += (highlightSize / 2);
+ highlightRect.origin.y += (highlightSize / 2);
+ highlightRect.size.width -= highlightSize;
+ highlightRect.size.height -= highlightSize;
+
+ NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:highlightRect xRadius:[self highlightCornerRadius]
+ yRadius:[self highlightCornerRadius]];
+ [path setLineWidth:[self highlightSize]];
+
+ // Style
+ switch ([self highlightStyle]) {
+ // Border
+ case AIImageCollectionViewHighlightBorderStyle:
+ [path stroke];
+ break;
+
+ // Background
+ case AIImageCollectionViewHighlightBackgroundStyle:
+ default:
+ [path fill];
+ break;
+ }
+ }];
+ }
+
+ // Draw highlight
+ if ([self highlightedIndex] != NSNotFound) {
+ NSRect highlightRect = [[[self subviews] objectAtIndex:[self highlightedIndex]] frame];
+
+ [[NSColor selectedMenuItemColor] set];
+
+ // Adjust Pattern
+ [[NSGraphicsContext currentContext] setPatternPhase:NSMakePoint(0.0f, NSMaxY([self convertRect:highlightRect toView:nil]))];
+
+ // Adjust highlight rect
+ highlightRect.origin.x += (highlightSize / 2);
+ highlightRect.origin.y += (highlightSize / 2);
+ highlightRect.size.width -= highlightSize;
+ highlightRect.size.height -= highlightSize;
+
+ NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:highlightRect xRadius:[self highlightCornerRadius]
+ yRadius:[self highlightCornerRadius]];
+ [path setLineWidth:[self highlightSize]];
+
+ // Style
+ switch ([self highlightStyle]) {
+ // Border
+ case AIImageCollectionViewHighlightBorderStyle:
+ [path stroke];
+ break;
+
+ // Background
+ case AIImageCollectionViewHighlightBackgroundStyle:
+ default:
+ [path fill];
+ break;
+ }
+ }
+}
+
+#pragma mark -
+
+/*!
+ * We are registered to receive KVO notifiactions for "selectionIndexes"
+ */
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+ // Selection has changed
+ if ([keyPath isEqual:@"selectionIndexes"]) {
+ [[change objectForKey:NSKeyValueChangeNewKey] enumerateIndexesUsingBlock:^(NSUInteger anIndex, BOOL *stop) {
+ [self selectItemAtIndex:anIndex];
+ }];
+
+ // No selection
+ if ([[self selectionIndexes] isEqualToIndexSet:[NSIndexSet indexSet]]) {
+ [self selectItemAtIndex:NSNotFound];
+ }
+
+ [self setNeedsDisplay:YES];
+
+ // Content has changed
+ } else if ([keyPath isEqual:@"content"]) {
+ // We don't want to highlight a removed item
+ if ([self highlightedIndex] == [[self content] count]) {
+ // Reset highlight
+ [self resetHighlight];
+ }
+ }
+}
+
+#pragma mark - AIImageCollectionView ()
+
+/*!
+ * @brief Called when an item is highlighted
+ *
+ * @param <tt>NSUInteger</tt>
+ */
+- (void)highlightItemAtIndex:(NSUInteger)anIndex
+{
+ // Set highlight
+ if (anIndex != NSNotFound && anIndex < [[self content] count] && [self highlightedIndex] != anIndex) {
+ // Message delegate: Should Highlight
+ if ([[self delegate] respondsToSelector:@selector(imageCollectionView:shouldHighlightItemAtIndex:)]) {
+ if ([[self delegate] imageCollectionView:self shouldHighlightItemAtIndex:anIndex]) {
+ [self setHighlightedIndex:anIndex];
+ [self setNeedsDisplay:YES];
+
+ // Message delegate : Did Highlight
+ if ([[self delegate] respondsToSelector:@selector(imageCollectionView:didHighlightItemAtIndex:)]) {
+ [[self delegate] imageCollectionView:self didHighlightItemAtIndex:anIndex];
+ }
+ } else if ([self highlightedIndex] != NSNotFound) {
+ // Reset highlight
+ [self resetHighlight];
+ }
+ }
+ } else if ([self highlightedIndex] != NSNotFound && (anIndex == NSNotFound || anIndex >= [[self content] count])) {
+ // Reset highlight
+ [self resetHighlight];
+ }
+}
+
+/*!
+ * @brief Called when an item is selected
+ *
+ * @param <tt>NSUInteger</tt>
+ */
+- (void)selectItemAtIndex:(NSUInteger)anIndex
+{
+ // Message delegate: Should Select
+ if ([[self delegate] respondsToSelector:@selector(imageCollectionView:shouldSelectItemAtIndex:)]) {
+ if ([[self delegate] imageCollectionView:self shouldSelectItemAtIndex:anIndex]) {
+ // Message delegate : Did Select
+ if ([[self delegate] respondsToSelector:@selector(imageCollectionView:didSelectItemAtIndex:)]) {
+ [[self delegate] imageCollectionView:self didSelectItemAtIndex:anIndex];
+ }
+ } /*else {
+ // @todo Reset selection
+ }*/
+ }
+}
+
+/*!
+ * @brief Reset highlight
+ *
+ */
+- (void)resetHighlight
+{
+ [self setHighlightedIndex:NSNotFound];
+ [self setNeedsDisplay:YES];
+
+ // Message delegate: Should Highlight
+ if ([[self delegate] respondsToSelector:@selector(imageCollectionView:shouldHighlightItemAtIndex:)]) {
+ [[self delegate] imageCollectionView:self shouldHighlightItemAtIndex:NSNotFound];
+ }
+}
+
+/*!
+ * @brief Return the item index at a point
+ *
+ * @param <tt>NSPoint</tt> aPoint - the point in local coords
+ * @return <tt>NSUInteger</tt>
+ */
+- (NSUInteger)indexAtPoint:(NSPoint)aPoint
+{
+ NSUInteger numberOfCols = [self maxNumberOfColumns];
+
+ NSUInteger indexX = AIceil(aPoint.x / self.maxItemSize.width);
+ NSUInteger indexY = AIceil(aPoint.y / self.maxItemSize.height);
+
+ NSUInteger anIndex = (((indexY * numberOfCols) - (numberOfCols - indexX)) - 1);
+
+ return (NSPointInRect(aPoint, [self frameForItemAtIndex:anIndex]) ? anIndex : NSNotFound);
+}
+
+#pragma mark -
+
+- (void)setImage:(NSImage *)anImage forItemAtIndex:(NSUInteger)anIndex
+{
+ if (anIndex != NSNotFound && anIndex < [[self content] count]) {
+ [(NSImageView *)[[self itemAtIndex:anIndex] view] setImage:anImage];
+ }
+}
+
+#pragma mark - Mouse Events
+
+- (void)mouseMoved:(NSEvent *)anEvent
+{
+ // Highlight item
+ [self highlightItemAtIndex:[self indexAtPoint:[self convertPoint:[anEvent locationInWindow] fromView:nil]]];
+}
+
+- (void)mouseExited:(NSEvent *)anEvent
+{
+ // Reset highlight
+ [self resetHighlight];
+}
+
+#pragma mark - Key Events
+
+- (void)keyDown:(NSEvent *)anEvent
+{
+ // Delete
+ if ([[self delegate] respondsToSelector:@selector(imageCollectionView:shouldDeleteItemsAtIndexes:)] && [[anEvent charactersIgnoringModifiers] length]) {
+ unichar pressedKey = [[anEvent charactersIgnoringModifiers] characterAtIndex:0];
+
+ if (pressedKey == NSDeleteFunctionKey || pressedKey == NSBackspaceCharacter || pressedKey == NSDeleteCharacter) {
+ // Delete selected items
+ // Message delegate: Should Delete
+ if ([[self delegate] imageCollectionView:self shouldDeleteItemsAtIndexes:[self selectionIndexes]] &&
+ [[self delegate] respondsToSelector:@selector(imageCollectionView:didDeleteItemsAtIndexes:)]) {
+ // Message delegate: Did Delete
+ [[self delegate] imageCollectionView:self didDeleteItemsAtIndexes:[self selectionIndexes]];
+ }
+ }
+ }
+
+ [super keyDown:anEvent];
+}
+
+ at end
diff -r df3768063e2e -r a1c9c5edab48 Frameworks/AIUtilities Framework/Source/AIImageGridView.h
--- a/Frameworks/AIUtilities Framework/Source/AIImageGridView.h Thu Apr 28 20:33:32 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
- * Adium is the legal property of its developers, whose names are listed in the copyright file included
- * with this source distribution.
- *
- * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-//Selection changed notification. Object is the image grid whose selection changed.
-#define AIImageGridViewSelectionDidChangeNotification @"AIImageGridViewSelectionDidChangeNotification"
-#define AIImageGridViewSelectionIsChangingNotification @"AIImageGridViewSelectionIsChangingNotification"
-
- at class AIScaledImageCell;
- at protocol AIImageGridViewDelegate;
-
-/*!
- * @class AIImageGridView
- * @brief View that displays a grid of images
- *
- * This view displays images in a grid similiar to iPhoto. Image size is adjustable and the view handles image layout
- * and spacing automatically.
- *
- * Important note: This view MUST be enclosed within an NSScrollView to function properly! Make it borderless, non-background-drawing,
- * and with neither horizontal nor vertical scrollers if you don't want there to be any scrolling.
- */
- at interface AIImageGridView : NSView {
- id<AIImageGridViewDelegate> delegate;
- AIScaledImageCell *cell;
- NSTrackingRectTag trackingTag;
-
- NSSize imageSize;
- NSSize padding; //Padding between images
- NSInteger columns; //Number of columns
- NSInteger selectedIndex; //Currently selected image index
- NSInteger hoveredIndex; //Currently hovered image index
-
- //The optional methods our current delegate responds to (So we don't have to ask it repeatedly)
- BOOL _respondsToShouldSelect;
- BOOL _respondsToSelectionDidChange;
- BOOL _respondsToSelectionIsChanging;
- BOOL _respondsToDeleteSelection;
- BOOL _respondsToImageHovered;
- BOOL drawsBackground;
- BOOL isTracking;
-}
-
-/*!
- * @brief The delegate for this view
- *
- * The delegate is informed of selection changes, cursor movement, and serves as the data source for the images
- * that will be displayed.
- * @param inDelegate Delegate and datasource
- */
- at property (readwrite, assign, nonatomic) id<AIImageGridViewDelegate> delegate;
-
-/*!
- * @brief Set the size images will display
- *
- * Set the size for image display and layout within the grid. The view will automatically re-layout and column the
- * the images as this value is changed.
- * @param inSize <tt>NSSize</tt> for image display
- */
-- (void)setImageSize:(NSSize)inSize;
-
-/*!
- * @brief Retrieve image display size
- *
- * @return <tt>NSSize</tt> current image size
- */
-- (NSSize)imageSize;
-
-/*!
- * @brief Reload images from delegate
- *
- * Invokes a reload of images from the delegate. Call this method when the images or number of images changes and the
- * view needs re-layout in response. The view will automatically redisplay if needed.
- */
-- (void)reloadData;
-
-/*!
- * @brief Returns the rect occupied by an image in our grid
- *
- * @param index Index of the image
- * @return <tt>NSRect</tt> the image occupies in our grid
- */
-- (NSRect)rectForImageAtIndex:(NSInteger)idx;
-
-/*!
- * @brief Returns the image present at a point in our grid
- *
- * @param point Location
- * @return index of the image at point
- */
-- (NSInteger)imageIndexAtPoint:(NSPoint)point;
-
-/*!
- * @brief Redisplay an image in our grid
- *
- * @param index Index of the image
- */
-- (void)setNeedsDisplayOfImageAtIndex:(NSInteger)idx;
-
-/*!
- * @brief Set the selected image
- *
- * Set the currently selected image. The delegate is informed of selection changes.
- * @param index Image index to select
- */
-- (void)selectIndex:(NSInteger)idx;
-
-/*!
- * @brief Set the selected image, relative to the current one
- *
- * Select an image with a position relative to the current selected image. The delegate is informed of selection changes.
- * @param delta Amount of positions to relocate the selection (0 = keep current selection; +1 = select next item)
- */
-- (void)selectRelativeIndex:(NSInteger)delta;
-
-/*!
- * @brief Retrieve the selected image
- *
- * @return index of the currently selected image
- */
-- (NSInteger)selectedIndex;
-
-/*!
- * @brief Check whether the receiver is set to draw its background
- *
- * @return a BOOL indicating if the background is drawn
- */
-- (BOOL)drawsBackground;
-
-/*!
- * @brief Set whether the receiver draws its background
- *
- * @param flag A BOOL indicating whether or not to draw the background
- */
-- (void)setDrawsBackground:(BOOL)flag;
-
- at end
-
-//AIImageGridView delegate methods. These are very similar to NSTableView.
- at protocol AIImageGridViewDelegate <NSObject>
-- (NSUInteger)numberOfImagesInImageGridView:(AIImageGridView *)imageGridView;
-- (NSImage *)imageGridView:(AIImageGridView *)imageGridView imageAtIndex:(NSUInteger)idx;
- at optional
-- (BOOL)imageGridView:(AIImageGridView *)imageGridView shouldSelectIndex:(NSUInteger)idx;
-- (void)imageGridViewDeleteSelectedImage:(AIImageGridView *)imageGridView;
-- (void)imageGridView:(AIImageGridView *)imageGridView cursorIsHoveringImageAtIndex:(NSUInteger)idx;
-
-//Notifications. These are automatically sent to the delegate.
-- (void)imageGridViewSelectionDidChange:(NSNotification *)notification;
-- (void)imageGridViewSelectionIsChanging:(NSNotification *)notification;
- at end
diff -r df3768063e2e -r a1c9c5edab48 Frameworks/AIUtilities Framework/Source/AIImageGridView.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageGridView.m Thu Apr 28 20:33:32 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,388 +0,0 @@
-/*
- * Adium is the legal property of its developers, whose names are listed in the copyright file included
- * with this source distribution.
- *
- * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#import "AIImageGridView.h"
-#import "AIScaledImageCell.h"
-
-#define MIN_PADDING 1 //The minimum padding between images
-
- at interface AIImageGridView ()
-- (void)_initImageGridView;
-- (void)_updateGrid;
-- (void)_updateGridForNewFrame:(NSRect)newFrame;
-- (void)_setHoveredIndex:(NSInteger)idx;
- at end
-
- at implementation AIImageGridView
-
-//Init
-- (id)initWithCoder:(NSCoder *)aDecoder
-{
- if ((self = [super initWithCoder:aDecoder])) {
- [self _initImageGridView];
- }
- return self;
-}
-
-- (id)initWithFrame:(NSRect)frameRect
-{
- if ((self = [super initWithFrame:frameRect])) {
- [self _initImageGridView];
- }
- return self;
-}
-
-- (void)_initImageGridView
-{
- cell = [[AIScaledImageCell alloc] init];
- imageSize = NSMakeSize(64,64);
- selectedIndex = -1;
- hoveredIndex = -1;
- [self _updateGrid];
-}
-
-- (void)dealloc
-{
- [cell release];
- [super dealloc];
-}
-
-//Configuration --------------------------------------------------------------------------------------------------------
-#pragma mark Configuration
-
-//Set our delegate
-- (void)setDelegate:(id<AIImageGridViewDelegate>)inDelegate
-{
- delegate = inDelegate;
-
- //Make sure this delegate responds to the required methods
- NSParameterAssert([delegate respondsToSelector:@selector(numberOfImagesInImageGridView:)]);
- NSParameterAssert([delegate respondsToSelector:@selector(imageGridView:imageAtIndex:)]);
-
- //Determine (and cache) the optional methods it responds to
- _respondsToShouldSelect = [delegate respondsToSelector:@selector(imageGridView:shouldSelectIndex:)];
- _respondsToSelectionDidChange = [delegate respondsToSelector:@selector(imageGridViewSelectionDidChange:)];
- _respondsToSelectionIsChanging = [delegate respondsToSelector:@selector(imageGridViewSelectionIsChanging:)];
- _respondsToDeleteSelection = [delegate respondsToSelector:@selector(imageGridViewDeleteSelectedImage:)];
- _respondsToImageHovered = [delegate respondsToSelector:@selector(imageGridView:cursorIsHoveringImageAtIndex:)];
-
- //If the delegate wants mouse moved messages, enable them
- if (_respondsToImageHovered) [[self window] setAcceptsMouseMovedEvents:YES];
- [self reloadData];
-}
-- (id<AIImageGridViewDelegate>)delegate
-{
- return delegate;
-}
-
-//Called when delegate data changes
-- (void)reloadData
-{
- [self _updateGrid];
-}
-
-//Set the size of the images in our grid
-- (void)setImageSize:(NSSize)inSize
-{
- imageSize = inSize;
- [self _updateGrid];
-}
-- (NSSize)imageSize
-{
- return imageSize;
-}
-
-//Set the frame of our view
-- (void)setFrame:(NSRect)frameRect
-{
- [self _updateGridForNewFrame:frameRect];
-}
-
-//Drawing and sizing ---------------------------------------------------------------------------------------------------
-#pragma mark Drawing and sizing
-
-//Redisplay an image in the grid
-- (void)setNeedsDisplayOfImageAtIndex:(NSInteger)idx
-{
- if (idx >= 0) {
- [self setNeedsDisplayInRect:[self rectForImageAtIndex:idx]];
- }
-}
-
-//Returns the rect for an image in our grid
-- (NSRect)rectForImageAtIndex:(NSInteger)idx
-{
- NSInteger row = idx / columns;
- NSInteger column = idx % columns;
-
- return NSMakeRect(column * (imageSize.width + padding.width) + padding.width,
- row * (imageSize.height + padding.height) + padding.height,
- imageSize.width,
- imageSize.height);
-}
-
-//Returns the image index at the specified point in our grid
-- (NSInteger)imageIndexAtPoint:(NSPoint)point
-{
- NSUInteger numberOfImages = [delegate numberOfImagesInImageGridView:self];
- //Determine which image was clicked
- for (NSUInteger i = 0; i < numberOfImages; i++) {
- if (NSPointInRect(point, [self rectForImageAtIndex:i])) {
- return i;
- }
- }
-
- return -1;
-}
-
-- (void)setDrawsBackground:(BOOL)flag
-{
- if (flag != drawsBackground) {
- drawsBackground = flag;
- [self setNeedsDisplay:YES];
- }
-}
-- (BOOL)drawsBackground
-{
- return drawsBackground;
-}
-
-//Draw
-- (void)drawRect:(NSRect)drawRect
-{
- NSUInteger numberOfImages = [delegate numberOfImagesInImageGridView:self];
-
- if (drawsBackground) {
- [[NSColor controlBackgroundColor] set];
- [NSBezierPath fillRect:drawRect];
- }
-
- //Draw all images that lie in the dirty rect
- for (NSUInteger i = 0; i < numberOfImages; i++) {
- NSRect imageRect = [self rectForImageAtIndex:i];
-
- if (NSIntersectsRect(drawRect, imageRect)) {
- [cell setImage:[delegate imageGridView:self imageAtIndex:i]];
- [cell setHighlighted:(selectedIndex == i)];
- [cell drawWithFrame:imageRect inView:self];
- }
- }
-}
-
-//This view is flipped since we intend for it to be within a scrollview
-- (BOOL)isFlipped
-{
- return YES;
-}
-
-//Update our frame height, number of columns, and padding
-- (void)_updateGrid
-{
- [self _updateGridForNewFrame:[self frame]];
-}
-- (void)_updateGridForNewFrame:(NSRect)newFrame
-{
- NSScrollView *scrollView = [self enclosingScrollView];
- NSUInteger numberOfImages = [delegate numberOfImagesInImageGridView:self];
- NSUInteger rows;
More information about the commits
mailing list