From: Michael J. Rubinsky Date: Sat, 26 Sep 2009 14:23:33 +0000 (-0400) Subject: Changes for compiling a native 10.6 version of these plugins. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ee625ee0acb190d19ef51fc73391d96cc14f002d;p=horde.git Changes for compiling a native 10.6 version of these plugins. 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. --- diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h index e1277d2f2..16ed66b49 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h @@ -13,8 +13,11 @@ #import "ApertureExportPlugIn.h" @class TURAnsel, TURAnselGallery; - +#if MAC_OS_X_VERSION_10_6 +@interface ApertureToAnselExportPlugin : NSObject +#else @interface ApertureToAnselExportPlugin : NSObject +#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 diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m index 314545778..92d460200 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m @@ -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. diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj index 61ced225c..02166fa9d 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj @@ -317,6 +317,7 @@ 1DEB913B08733D840010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = NO; DEPLOYMENT_LOCATION = YES; DSTROOT = /; @@ -328,8 +329,9 @@ 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; }; @@ -339,6 +341,7 @@ 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; @@ -346,8 +349,9 @@ 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; }; @@ -356,13 +360,15 @@ 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; @@ -375,9 +381,10 @@ 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; }; diff --git a/ApertureToAnselExportPlugin/TURAnselKit/TURAnsel.h b/ApertureToAnselExportPlugin/TURAnselKit/TURAnsel.h index b1997fa43..68aed5cc2 100644 --- a/ApertureToAnselExportPlugin/TURAnselKit/TURAnsel.h +++ b/ApertureToAnselExportPlugin/TURAnselKit/TURAnsel.h @@ -29,7 +29,12 @@ typedef enum { - (void)TURAnselHadError: (NSError *)error; @end -@interface TURAnsel : NSObject { +#if MAC_OS_X_VERSION_10_6 +@interface TURAnsel : NSObject +#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 diff --git a/iPhoto2Ansel/AnselExportController.h b/iPhoto2Ansel/AnselExportController.h index 29c1d4400..e253b061c 100644 --- a/iPhoto2Ansel/AnselExportController.h +++ b/iPhoto2Ansel/AnselExportController.h @@ -14,8 +14,11 @@ @class FBProgressController; @class TURNewGalleryController; +#if MAC_OS_X_VERSION_10_6 +@interface AnselExportController : NSObject { +#else @interface AnselExportController : NSObject { - +#endif // Export manager passed in from iPhoto id mExportMgr; diff --git a/iPhoto2Ansel/AnselExportController.m b/iPhoto2Ansel/AnselExportController.m index 90d4c1f13..d4e716554 100644 --- a/iPhoto2Ansel/AnselExportController.m +++ b/iPhoto2Ansel/AnselExportController.m @@ -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... diff --git a/iPhoto2Ansel/TURAnselKit/TURAnsel.h b/iPhoto2Ansel/TURAnselKit/TURAnsel.h index b1997fa43..c02018ca3 100644 --- a/iPhoto2Ansel/TURAnselKit/TURAnsel.h +++ b/iPhoto2Ansel/TURAnselKit/TURAnsel.h @@ -29,7 +29,12 @@ typedef enum { - (void)TURAnselHadError: (NSError *)error; @end -@interface TURAnsel : NSObject { +#if MAC_OS_X_VERSION_10_6 +@interface TURAnsel : NSObject +#else +@interface TURAnsel : NSObject +#endif +{ NSString *userAgent; NSString *rpcEndPoint; NSString *username; diff --git a/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj b/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj index 93506236f..73c6bbbef 100644 --- a/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj +++ b/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj @@ -396,6 +396,7 @@ 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"; @@ -406,6 +407,7 @@ 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"; @@ -413,10 +415,11 @@ 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; }; @@ -431,9 +434,10 @@ 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; };