Changes for compiling a native 10.6 version of these plugins.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 26 Sep 2009 14:23:33 +0000 (10:23 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 26 Sep 2009 14:23:33 +0000 (10:23 -0400)
Replace some method calls that were deprecated in the 10.6 SDK,
add some interface declarations that are now required in 10.6. Add
preprocessor directives to make sure the proper methods are used.

ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h
ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m
ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj
ApertureToAnselExportPlugin/TURAnselKit/TURAnsel.h
iPhoto2Ansel/AnselExportController.h
iPhoto2Ansel/AnselExportController.m
iPhoto2Ansel/TURAnselKit/TURAnsel.h
iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj

index e1277d2..16ed66b 100644 (file)
 #import "ApertureExportPlugIn.h"
 
 @class TURAnsel, TURAnselGallery;
-
+#if  MAC_OS_X_VERSION_10_6
+@interface ApertureToAnselExportPlugin : NSObject <ApertureExportPlugIn, NSComboBoxDelegate>
+#else
 @interface ApertureToAnselExportPlugin : NSObject <ApertureExportPlugIn>
+#endif
 {
        // The cached API Manager object, as passed to the -initWithAPIManager: method.
        id _apiManager; 
@@ -88,6 +91,5 @@
 // Server List
 - (IBAction) closeServerList: (id)sender;
 - (IBAction) removeServer: (id)sender;
-
 - (NSWindow *)window;
-@end
+@end
\ No newline at end of file
index 3145457..92d4602 100644 (file)
@@ -464,8 +464,13 @@ NSString * const TURAnselServerPasswordKey = @"password";
     // Obtain and properly size the image for screen
     NSImage *theImage = [[NSImage alloc] initWithContentsOfURL: [_currentGallery galleryKeyImageURL]];
     NSSize imageSize;
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5
+    imageSize.width = [[theImage bestRepresentationForRect:[defaultImageView bounds] context:nil hints:nil] pixelsWide];
+    imageSize.height = [[theImage bestRepresentationForRect:[defaultImageView bounds] context:nil hints:nil] pixelsHigh];
+#else
     imageSize.width = [[theImage bestRepresentationForDevice:nil] pixelsWide];
-    imageSize.height = [[theImage bestRepresentationForDevice:nil] pixelsHigh];    
+    imageSize.height = [[theImage bestRepresentationForDevice:nil] pixelsHigh];
+#endif
     [theImage setScalesWhenResized:YES];
     [theImage setSize:imageSize];
     
@@ -514,14 +519,13 @@ NSString * const TURAnselServerPasswordKey = @"password";
 }
 #pragma mark -
 #pragma mark NSTableView Datasource
-- (int)numberOfRowsInTableView:(NSTableView *)aTableView
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
 {
     return [_anselServers count];
 }
-
 - (id)tableView:(NSTableView *)aTableView
 objectValueForTableColumn:(NSTableColumn *)aTableColumn
-            row:(int)rowIndex
+            row:(NSInteger)rowIndex
 {
     return [[_anselServers objectAtIndex: rowIndex] objectForKey: [aTableColumn identifier]];
 }
@@ -766,8 +770,6 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
         modalDelegate: nil
        didEndSelector: nil
           contextInfo: nil];
-    
-    [serverTable setDelegate: self];
 }
 
 // Start the connection process.
index 61ced22..02166fa 100644 (file)
                1DEB913B08733D840010E9CD /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               ARCHS = "$(ARCHS_STANDARD_32_BIT)";
                                COPY_PHASE_STRIP = NO;
                                DEPLOYMENT_LOCATION = YES;
                                DSTROOT = /;
                                GCC_PREFIX_HEADER = ApertureToAnselExportPlugin_Prefix.pch;
                                INFOPLIST_FILE = Info.plist;
                                INSTALL_PATH = "/Users/mrubinsk/Library/Application Support/Aperture/Plug-Ins";
+                               MACOSX_DEPLOYMENT_TARGET = 10.5;
                                PRODUCT_NAME = ApertureToAnselExportPlugin;
-                               SDKROOT = macosx10.5;
+                               SDKROOT = macosx10.6;
                                WRAPPER_EXTENSION = ApertureExport;
                                ZERO_LINK = YES;
                        };
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+                               CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/ApertureToAnselExportPlugin-1.0/Library/Application Support/Aperture/Plugins/Export";
                                DSTROOT = /;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
                                GCC_MODEL_TUNING = G5;
                                GCC_PREFIX_HEADER = ApertureToAnselExportPlugin_Prefix.pch;
                                INFOPLIST_FILE = Info.plist;
                                INSTALL_PATH = "$(HOME)/Library/Application Support/Aperture/Plug-Ins/Export/";
+                               MACOSX_DEPLOYMENT_TARGET = 10.5;
                                PRODUCT_NAME = ApertureToAnselExportPlugin;
-                               SDKROOT = macosx10.5;
+                               SDKROOT = macosx10.6;
                                VALID_ARCHS = "ppc64 i386_64 i386 ppc";
                                WRAPPER_EXTENSION = ApertureExport;
                        };
                1DEB913F08733D840010E9CD /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               ARCHS = "$(NATIVE_ARCH_ACTUAL)";
+                               ARCHS = "$(ARCHS_STANDARD_32_BIT)";
                                FRAMEWORK_SEARCH_PATHS = "/Library/Frameworks//**";
                                GCC_ENABLE_OBJC_EXCEPTIONS = YES;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
+                               MACOSX_DEPLOYMENT_TARGET = 10.5;
+                               ONLY_ACTIVE_ARCH = YES;
                                PREBINDING = NO;
-                               SDKROOT = macosx10.5;
+                               SDKROOT = macosx10.6;
                                VALID_ARCHS = i386;
                        };
                        name = Debug;
                                GCC_ENABLE_OBJC_EXCEPTIONS = YES;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
+                               MACOSX_DEPLOYMENT_TARGET = 10.5;
                                PREBINDING = NO;
-                               SDKROOT = macosx10.5;
-                               VALID_ARCHS = "i386_64 ppc64 i386 ppc";
+                               SDKROOT = macosx10.6;
+                               VALID_ARCHS = "ppc64 x386_64 i386 ppc";
                        };
                        name = Release;
                };
index b1997fa..68aed5c 100644 (file)
@@ -29,7 +29,12 @@ typedef enum {
 - (void)TURAnselHadError: (NSError *)error;
 @end
 
-@interface TURAnsel : NSObject {
+#if MAC_OS_X_VERSION_10_6
+@interface TURAnsel : NSObject <NSComboBoxDataSource>
+#else
+@interface TURAnsel : NSObject
+#endif         
+{
     NSString *userAgent;
     NSString *rpcEndPoint;
     NSString *username;
@@ -57,4 +62,7 @@ typedef enum {
 - (TURAnselState)state;
 - (id)delegate;
 - (void)setDelegate: (id)newDelegate;
+
+- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox;
+- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index;
 @end
index 29c1d44..e253b06 100644 (file)
 @class FBProgressController;
 @class TURNewGalleryController;
 
+#if MAC_OS_X_VERSION_10_6
+@interface AnselExportController : NSObject <ExportPluginProtocol, NSComboBoxDelegate> {
+#else
 @interface AnselExportController : NSObject <ExportPluginProtocol> {
-
+#endif
     // Export manager passed in from iPhoto
     id <ExportImageProtocol> mExportMgr;
     
index 90d4c1f..d4e7165 100644 (file)
@@ -229,8 +229,13 @@ NSString * const TURAnselServerPasswordKey = @"password";
     // Obtain and properly size the image for screen
     NSImage *theImage = [[NSImage alloc] initWithContentsOfURL: [currentGallery galleryKeyImageURL]];
     NSSize imageSize;
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5
+    imageSize.width = [[theImage bestRepresentationForRect:[defaultImageView bounds] context:nil hints:nil] pixelsWide];
+    imageSize.height = [[theImage bestRepresentationForRect:[defaultImageView bounds] context:nil hints:nil] pixelsHigh];
+#else
     imageSize.width = [[theImage bestRepresentationForDevice:nil] pixelsWide];
-    imageSize.height = [[theImage bestRepresentationForDevice:nil] pixelsHigh];    
+    imageSize.height = [[theImage bestRepresentationForDevice:nil] pixelsHigh];
+#endif
     [theImage setScalesWhenResized:YES];
     [theImage setSize:imageSize];
     [self doSwapImage: theImage];
@@ -429,8 +434,6 @@ NSString * const TURAnselServerPasswordKey = @"password";
         modalDelegate: nil
        didEndSelector: nil
           contextInfo: nil];
-    
-    [serverTable setDelegate: self];
 }
 
 // See if we have everything we need to export...
index b1997fa..c02018c 100644 (file)
@@ -29,7 +29,12 @@ typedef enum {
 - (void)TURAnselHadError: (NSError *)error;
 @end
 
-@interface TURAnsel : NSObject {
+#if MAC_OS_X_VERSION_10_6
+@interface TURAnsel : NSObject <NSComboBoxDataSource>
+#else
+@interface TURAnsel : NSObject
+#endif         
+{
     NSString *userAgent;
     NSString *rpcEndPoint;
     NSString *username;
index 9350623..73c6bbb 100644 (file)
                                GCC_PREFIX_HEADER = iPhoto2Ansel_Prefix.pch;
                                INFOPLIST_FILE = Info.plist;
                                INSTALL_PATH = "Library/Application Support/iPhoto/Plugins";
+                               MACOSX_DEPLOYMENT_TARGET = 10.5;
                                PRODUCT_NAME = iPhoto2Ansel;
                                SKIP_INSTALL = NO;
                                VALID_ARCHS = "i386 x86_64 ppc64 ppc";
                1DEB913F08733D840010E9CD /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)";
                                COPY_PHASE_STRIP = NO;
                                DEPLOYMENT_LOCATION = NO;
                                DSTROOT = "/tmp/$(PROJECT_NAME).dst";
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                INSTALL_PATH = "";
-                               ONLY_ACTIVE_ARCH = YES;
+                               MACOSX_DEPLOYMENT_TARGET = 10.5;
+                               ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_ACTUAL)";
                                PREBINDING = NO;
-                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
-                               VALID_ARCHS = "i386 x86_64";
+                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
+                               VALID_ARCHS = "ppc64 ppc i386 x86_64";
                        };
                        name = Debug;
                };
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                INSTALL_PATH = "";
+                               MACOSX_DEPLOYMENT_TARGET = 10.5;
                                PREBINDING = NO;
-                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
-                               VALID_ARCHS = "i386 x86_64";
+                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
+                               VALID_ARCHS = "ppc64 ppc i386 x86_64";
                        };
                        name = Release;
                };