diff --git a/.gitignore b/.gitignore index b83de51fab..c9b403843f 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,9 @@ packaging/osx/launcher/OpenRA.xcodeproj/*.mode1v3 temp.c temp.o temp.s - +OpenRA.Launcher.Mac/build/ +OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.pbxuser +OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.perspectivev3 +OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.mode1v3 *.config *.resources diff --git a/OpenRA.Launcher.Mac/Controller.h b/OpenRA.Launcher.Mac/Controller.h new file mode 100644 index 0000000000..4d0fc23193 --- /dev/null +++ b/OpenRA.Launcher.Mac/Controller.h @@ -0,0 +1,18 @@ +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ + +#import + +@class ModEntry; +@interface Controller : NSObject +{ + ModEntry *sidebarItems; + IBOutlet NSOutlineView *outlineView; +} +- (ModEntry *)modTree; +@end diff --git a/OpenRA.Launcher.Mac/Controller.m b/OpenRA.Launcher.Mac/Controller.m new file mode 100644 index 0000000000..42a81dcea8 --- /dev/null +++ b/OpenRA.Launcher.Mac/Controller.m @@ -0,0 +1,113 @@ +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ + +#import "Controller.h" +#import "ModEntry.h" +#import "ImageAndTextCell.h" + +@implementation Controller + +- (void) awakeFromNib +{ + sidebarItems = [[ModEntry headerWithTitle:@""] retain]; + [sidebarItems addChild:[self modTree]]; + + NSTableColumn *col = [outlineView tableColumnWithIdentifier:@"mods"]; + ImageAndTextCell *imageAndTextCell = [[[ImageAndTextCell alloc] init] autorelease]; + [col setDataCell:imageAndTextCell]; + + [outlineView reloadData]; + [outlineView expandItem:[outlineView itemAtRow:1] expandChildren:YES]; + [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO]; +} + +- (void) dealloc +{ + [sidebarItems release]; sidebarItems = nil; + [super dealloc]; +} + +- (ModEntry *)modTree +{ + // Create root item + ModEntry *rootItem = [ModEntry headerWithTitle:@"MODS"]; + + NSString* imageName = [[NSBundle mainBundle] pathForResource:@"OpenRA" ofType:@"icns"]; + NSImage* imageObj = [[NSImage alloc] initWithContentsOfFile:imageName]; + + NSDictionary *foo = [NSDictionary dictionaryWithObjectsAndKeys: + @"Test mod", @"Title", + @"Foobar", @"Author", + imageObj, @"Icon", + nil]; + [imageObj release]; + [rootItem addChild:[ModEntry modWithFields:foo]]; + return rootItem; +} + +#pragma mark Sidebar Datasource and Delegate +- (int)outlineView:(NSOutlineView *)anOutlineView numberOfChildrenOfItem:(id)item +{ + // Can be called before awakeFromNib; return nothing + if (sidebarItems == nil) + return 0; + + // Root item + if (item == nil) + return [[sidebarItems children] count]; + + return [[item children] count]; +} + +- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item +{ + return (item == nil) ? YES : [[item children] count] != 0; +} + +- (id)outlineView:(NSOutlineView *)outlineView + child:(int)index + ofItem:(id)item +{ + if (item == nil) + return [[sidebarItems children] objectAtIndex:index]; + + return [[item children] objectAtIndex:index]; +} + +-(BOOL)outlineView:(NSOutlineView*)outlineView isGroupItem:(id)item +{ + if (item == nil) + return NO; + + return [item isHeader]; +} + +- (id)outlineView:(NSOutlineView *)outlineView +objectValueForTableColumn:(NSTableColumn *)tableColumn + byItem:(id)item +{ + return [item title]; +} + +- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item; +{ + // don't allow headers to be selected + return ![item isHeader]; +} + +- (void)outlineView:(NSOutlineView *)olv willDisplayCell:(NSCell*)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item +{ + if ([[tableColumn identifier] isEqualToString:@"mods"]) + { + if ([cell isKindOfClass:[ImageAndTextCell class]]) + { + [(ImageAndTextCell*)cell setImage:[item icon]]; + } + } +} +@end diff --git a/OpenRA.Launcher.Mac/English.lproj/InfoPlist.strings b/OpenRA.Launcher.Mac/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000..477b28ff8f --- /dev/null +++ b/OpenRA.Launcher.Mac/English.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/OpenRA.Launcher.Mac/English.lproj/MainMenu.xib b/OpenRA.Launcher.Mac/English.lproj/MainMenu.xib new file mode 100644 index 0000000000..5e7bf36e3b --- /dev/null +++ b/OpenRA.Launcher.Mac/English.lproj/MainMenu.xib @@ -0,0 +1,1581 @@ + + + + 1060 + 10H574 + 804 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 804 + + + YES + + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + OpenRA + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + OpenRA + + YES + + + About OpenRA + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide OpenRA + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit OpenRA + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + OpenRA Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + 15 + 2 + {{335, 281}, {659, 469}} + 1954021376 + OpenRA Launcher + NSWindow + + {3.40282e+38, 3.40282e+38} + + + 256 + + YES + + + 274 + + YES + + + 256 + + YES + + + 274 + + YES + + + 2304 + + YES + + + 256 + {144, 468} + + YES + + + -2147483392 + {{224, 0}, {16, 17}} + + + YES + + mods + 141 + 16 + 1000 + + 75628096 + 2048 + + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337772096 + 2048 + Text Cell + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2ODY1AA + + + + 6 + System + controlTextColor + + + + 3 + YES + YES + + + + 3 + 0.0 + + 6 + System + _sourceListBackgroundColor + + 1 + MC44MzkyMTU2OTU5IDAuODY2NjY2Njc0NiAwLjg5ODAzOTIyMTgAA + + + + 6 + System + gridColor + + 3 + MC41AA + + + 20 + -767557632 + + + 4 + 15 + 0 + YES + 1 + 1 + 14 + + + {{1, 1}, {144, 468}} + + + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + _doScroller: + 0.99786323308944702 + + + + -2147483392 + {{1, 453}, {141, 15}} + + 1 + + _doScroller: + 0.99295777082443237 + + + {146, 470} + + + 562 + + + + QSAAAEEgAABBoAAAQaAAAA + + + {145, 469} + + 2 + NSView + + + + 256 + {{146, 0}, {513, 469}} + + 2 + NSView + + + {659, 469} + + 2 + YES + 2 + + + {659, 469} + + 2 + + {{0, 0}, {1920, 1178}} + {3.40282e+38, 3.40282e+38} + + + OpenRAAppDelegate + + + Controller + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + terminate: + + + + 449 + + + + showHelp: + + + + 493 + + + + delegate + + + + 495 + + + + window + + + + 532 + + + + dataSource + + + + 582 + + + + delegate + + + + 583 + + + + outlineView + + + + 585 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 371 + + + YES + + + + + + 372 + + + YES + + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 494 + + + + + 555 + + + YES + + + + + + + 557 + + + YES + + + + + 556 + + + YES + + + + + + 568 + + + YES + + + + + + + + 569 + + + + + 570 + + + + + 571 + + + YES + + + + + + 573 + + + YES + + + + + + 576 + + + + + 579 + + + + + + + YES + + YES + -3.IBPluginDependency + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBEditorWindowLastContentRect + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 371.IBEditorWindowLastContentRect + 371.IBPluginDependency + 371.IBWindowTemplateEditedContentRect + 371.NSWindowTemplate.visibleAtLaunch + 371.editorWindowContentRectSynchronizationRect + 371.windowTemplate.maxSize + 372.IBPluginDependency + 490.IBPluginDependency + 491.IBEditorWindowLastContentRect + 491.IBPluginDependency + 492.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 555.IBPluginDependency + 556.IBPluginDependency + 557.IBPluginDependency + 56.IBPluginDependency + 56.ImportedFromIB2 + 568.IBPluginDependency + 568.IBViewBoundsToFrameTransform + 569.IBPluginDependency + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 570.IBPluginDependency + 571.IBPluginDependency + 573.IBPluginDependency + 576.IBPluginDependency + 579.IBPluginDependency + 58.IBPluginDependency + 58.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{582, 770}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{469, 763}, {194, 73}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{380, 836}, {221, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{6, 978}, {478, 20}} + {{174, 257}, {659, 469}} + com.apple.InterfaceBuilder.CocoaPlugin + {{174, 257}, {659, 469}} + + {{33, 99}, {480, 360}} + {3.40282e+38, 3.40282e+38} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{540, 813}, {161, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAADBoAAAwy4AAA + + com.apple.InterfaceBuilder.CocoaPlugin + {{392, 653}, {190, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 585 + + + + YES + + Controller + NSObject + + outlineView + NSOutlineView + + + outlineView + + outlineView + NSOutlineView + + + + IBProjectSource + Controller.h + + + + OpenRAAppDelegate + NSObject + + window + NSWindow + + + window + + window + NSWindow + + + + IBProjectSource + OpenRAAppDelegate.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSOutlineView + NSTableView + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableView + NSControl + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../OpenRA.xcodeproj + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/OpenRA.Launcher.Mac/ImageAndTextCell.h b/OpenRA.Launcher.Mac/ImageAndTextCell.h new file mode 100755 index 0000000000..f75674d6e4 --- /dev/null +++ b/OpenRA.Launcher.Mac/ImageAndTextCell.h @@ -0,0 +1,62 @@ +// +// File: ImageAndTextCell.h +// +// Abstract: Subclass of NSTextFieldCell which can display text and an image simultaneously. +// +// Version: 1.0 +// +// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") +// in consideration of your agreement to the following terms, and your use, +// installation, modification or redistribution of this Apple software +// constitutes acceptance of these terms. If you do not agree with these +// terms, please do not use, install, modify or redistribute this Apple +// software. +// +// In consideration of your agreement to abide by the following terms, and +// subject to these terms, Apple grants you a personal, non - exclusive +// license, under Apple's copyrights in this original Apple software ( the +// "Apple Software" ), to use, reproduce, modify and redistribute the Apple +// Software, with or without modifications, in source and / or binary forms; +// provided that if you redistribute the Apple Software in its entirety and +// without modifications, you must retain this notice and the following text +// and disclaimers in all such redistributions of the Apple Software. Neither +// the name, trademarks, service marks or logos of Apple Inc. may be used to +// endorse or promote products derived from the Apple Software without specific +// prior written permission from Apple. Except as expressly stated in this +// notice, no other rights or licenses, express or implied, are granted by +// Apple herein, including but not limited to any patent rights that may be +// infringed by your derivative works or by other works in which the Apple +// Software may be incorporated. +// +// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION +// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. +// +// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION +// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR +// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Copyright (C) 2007 Apple Inc. All Rights Reserved. +// + +#import + +@interface ImageAndTextCell : NSTextFieldCell +{ +@private + NSImage *image; +} + +- (void)setImage:(NSImage *)anImage; +- (NSImage*)image; + +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView; +- (NSSize)cellSize; + +@end diff --git a/OpenRA.Launcher.Mac/ImageAndTextCell.m b/OpenRA.Launcher.Mac/ImageAndTextCell.m new file mode 100755 index 0000000000..58f28d80df --- /dev/null +++ b/OpenRA.Launcher.Mac/ImageAndTextCell.m @@ -0,0 +1,252 @@ +// +// File: ImageAndTextCell.m +// +// Abstract: Subclass of NSTextFieldCell which can display text and an image simultaneously. +// +// Version: 1.0 +// +// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") +// in consideration of your agreement to the following terms, and your use, +// installation, modification or redistribution of this Apple software +// constitutes acceptance of these terms. If you do not agree with these +// terms, please do not use, install, modify or redistribute this Apple +// software. +// +// In consideration of your agreement to abide by the following terms, and +// subject to these terms, Apple grants you a personal, non - exclusive +// license, under Apple's copyrights in this original Apple software ( the +// "Apple Software" ), to use, reproduce, modify and redistribute the Apple +// Software, with or without modifications, in source and / or binary forms; +// provided that if you redistribute the Apple Software in its entirety and +// without modifications, you must retain this notice and the following text +// and disclaimers in all such redistributions of the Apple Software. Neither +// the name, trademarks, service marks or logos of Apple Inc. may be used to +// endorse or promote products derived from the Apple Software without specific +// prior written permission from Apple. Except as expressly stated in this +// notice, no other rights or licenses, express or implied, are granted by +// Apple herein, including but not limited to any patent rights that may be +// infringed by your derivative works or by other works in which the Apple +// Software may be incorporated. +// +// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION +// ALONE OR IN COMBINATION WITH YOUR PRODUCTS. +// +// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION +// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER +// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR +// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Copyright (C) 2007 Apple Inc. All Rights Reserved. +// + +#import "ImageAndTextCell.h" +//#import "BaseNode.h" + +@implementation ImageAndTextCell + +#define kIconImageSize 16.0 + +#define kImageOriginXOffset 3 +#define kImageOriginYOffset 1 + +#define kTextOriginXOffset 2 +#define kTextOriginYOffset 2 +#define kTextHeightAdjust 4 + +// ------------------------------------------------------------------------------- +// init: +// ------------------------------------------------------------------------------- +- (id)init +{ + self = [super init]; + + // we want a smaller font + [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + + return self; +} + +// ------------------------------------------------------------------------------- +// dealloc: +// ------------------------------------------------------------------------------- +- (void)dealloc +{ + [image release]; + image = nil; + [super dealloc]; +} + +// ------------------------------------------------------------------------------- +// copyWithZone:zone +// ------------------------------------------------------------------------------- +- (id)copyWithZone:(NSZone*)zone +{ + ImageAndTextCell *cell = (ImageAndTextCell*)[super copyWithZone:zone]; + cell->image = [image retain]; + return cell; +} + +// ------------------------------------------------------------------------------- +// setImage:anImage +// ------------------------------------------------------------------------------- +- (void)setImage:(NSImage*)anImage +{ + if (anImage != image) + { + [image autorelease]; + image = [anImage retain]; + [image setSize:NSMakeSize(kIconImageSize, kIconImageSize)]; + } +} + +// ------------------------------------------------------------------------------- +// image: +// ------------------------------------------------------------------------------- +- (NSImage*)image +{ + return image; +} + +// ------------------------------------------------------------------------------- +// isGroupCell: +// ------------------------------------------------------------------------------- +- (BOOL)isGroupCell +{ + return ([self image] == nil && [[self title] length] > 0); +} + +// ------------------------------------------------------------------------------- +// titleRectForBounds:cellRect +// +// Returns the proper bound for the cell's title while being edited +// ------------------------------------------------------------------------------- +- (NSRect)titleRectForBounds:(NSRect)cellRect +{ + // the cell has an image: draw the normal item cell + NSSize imageSize; + NSRect imageFrame; + + imageSize = [image size]; + NSDivideRect(cellRect, &imageFrame, &cellRect, 3 + imageSize.width, NSMinXEdge); + + imageFrame.origin.x += kImageOriginXOffset; + imageFrame.origin.y -= kImageOriginYOffset; + imageFrame.size = imageSize; + + imageFrame.origin.y += ceil((cellRect.size.height - imageFrame.size.height) / 2); + + NSRect newFrame = cellRect; + newFrame.origin.x += kTextOriginXOffset; + newFrame.origin.y += kTextOriginYOffset; + newFrame.size.height -= kTextHeightAdjust; + + return newFrame; +} + +// ------------------------------------------------------------------------------- +// editWithFrame:inView:editor:delegate:event +// ------------------------------------------------------------------------------- +- (void)editWithFrame:(NSRect)aRect inView:(NSView*)controlView editor:(NSText*)textObj delegate:(id)anObject event:(NSEvent*)theEvent +{ + NSRect textFrame = [self titleRectForBounds:aRect]; + [super editWithFrame:textFrame inView:controlView editor:textObj delegate:anObject event:theEvent]; +} + +// ------------------------------------------------------------------------------- +// selectWithFrame:inView:editor:delegate:event:start:length +// ------------------------------------------------------------------------------- +- (void)selectWithFrame:(NSRect)aRect inView:(NSView*)controlView editor:(NSText*)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength +{ + NSRect textFrame = [self titleRectForBounds:aRect]; + [super selectWithFrame:textFrame inView:controlView editor:textObj delegate:anObject start:selStart length:selLength]; +} + +// ------------------------------------------------------------------------------- +// drawWithFrame:cellFrame:controlView: +// ------------------------------------------------------------------------------- +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView +{ + if (image != nil) + { + // the cell has an image: draw the normal item cell + NSSize imageSize; + NSRect imageFrame; + + imageSize = [image size]; + NSDivideRect(cellFrame, &imageFrame, &cellFrame, 3 + imageSize.width, NSMinXEdge); + + imageFrame.origin.x += kImageOriginXOffset; + imageFrame.origin.y -= kImageOriginYOffset; + imageFrame.size = imageSize; + + if ([controlView isFlipped]) + imageFrame.origin.y += ceil((cellFrame.size.height + imageFrame.size.height) / 2); + else + imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2); + [image compositeToPoint:imageFrame.origin operation:NSCompositeSourceOver]; + + NSRect newFrame = cellFrame; + newFrame.origin.x += kTextOriginXOffset; + newFrame.origin.y += kTextOriginYOffset; + newFrame.size.height -= kTextHeightAdjust; + [super drawWithFrame:newFrame inView:controlView]; + } + else + { + if ([self isGroupCell]) + { + // Center the text in the cellFrame, and call super to do thew ork of actually drawing. + CGFloat yOffset = floor((NSHeight(cellFrame) - [[self attributedStringValue] size].height) / 2.0); + cellFrame.origin.y += yOffset; + cellFrame.size.height -= (kTextOriginYOffset*yOffset); + [super drawWithFrame:cellFrame inView:controlView]; + } + } +} + +// ------------------------------------------------------------------------------- +// cellSize: +// ------------------------------------------------------------------------------- +- (NSSize)cellSize +{ + NSSize cellSize = [super cellSize]; + cellSize.width += (image ? [image size].width : 0) + 3; + return cellSize; +} + +// ------------------------------------------------------------------------------- +// hitTestForEvent: +// +// In 10.5, we need you to implement this method for blocking drag and drop of a given cell. +// So NSCell hit testing will determine if a row can be dragged or not. +// +// NSTableView calls this cell method when starting a drag, if the hit cell returns +// NSCellHitTrackableArea, the particular row will be tracked instead of dragged. +// +// ------------------------------------------------------------------------------- +/* +- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView +{ + NSInteger result = NSCellHitContentArea; + + NSOutlineView* hostingOutlineView = (NSOutlineView*)[self controlView]; + if (hostingOutlineView) + { + NSInteger selectedRow = [hostingOutlineView selectedRow]; + BaseNode* node = [[hostingOutlineView itemAtRow:selectedRow] representedObject]; + + if (![node isDraggable]) // is the node isDraggable (i.e. non-file system based objects) + result = NSCellHitTrackableArea; + } + + return result; +} +*/ +@end + diff --git a/OpenRA.Launcher.Mac/ModEntry.h b/OpenRA.Launcher.Mac/ModEntry.h new file mode 100644 index 0000000000..38dad235ab --- /dev/null +++ b/OpenRA.Launcher.Mac/ModEntry.h @@ -0,0 +1,37 @@ +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ + +#import + +@interface ModEntry : NSObject { + BOOL isHeader; + NSString *title; + NSString *version; + NSString *author; + NSString *requires; + BOOL standalone; + NSMutableArray *children; + NSImage *icon; +} + +@property (readonly) BOOL isHeader; +@property (readonly) NSString *title; +@property (readonly) NSString *version; +@property (readonly) NSString *author; +@property (readonly) NSString *description; +@property (readonly) NSString *requires; +@property (readonly) BOOL standalone; +@property (readonly) NSMutableArray* children; +@property (readonly) NSImage* icon; + ++ (id)headerWithTitle:(NSString *)aTitle; ++ (id)modWithFields:(id)fields; +- (id)initWithFields:(NSDictionary *)fields isHeader:(BOOL)header; +- (void)addChild:(id)child; +- (id)icon; +@end diff --git a/OpenRA.Launcher.Mac/ModEntry.m b/OpenRA.Launcher.Mac/ModEntry.m new file mode 100644 index 0000000000..a8225ebe91 --- /dev/null +++ b/OpenRA.Launcher.Mac/ModEntry.m @@ -0,0 +1,66 @@ +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ + +#import "ModEntry.h" + + +@implementation ModEntry +@synthesize isHeader; +@synthesize title; +@synthesize version; +@synthesize author; +@synthesize description; +@synthesize requires; +@synthesize standalone; +@synthesize children; +@synthesize icon; + ++ (id)headerWithTitle:(NSString *)aTitle +{ + id newObject = [[self alloc] initWithFields:[NSDictionary dictionaryWithObject:aTitle forKey:@"Title"] isHeader:YES]; + [newObject autorelease]; + return newObject; +} + ++ (id)modWithFields:(id)fields +{ + id newObject = [[self alloc] initWithFields:fields isHeader:NO]; + [newObject autorelease]; + return newObject; +} + +- (id)initWithFields:(NSDictionary *)fields isHeader:(BOOL)header +{ + self = [super init]; + if (self) + { + isHeader = header; + title = [fields objectForKey:@"Title"]; + version = [fields objectForKey:@"Version"]; + author = [fields objectForKey:@"Author"]; + description = [fields objectForKey:@"Description"]; + requires = [fields objectForKey:@"Requires"]; + standalone = ([fields objectForKey:@"Standalone"] == @"True"); + icon = [[fields objectForKey:@"Icon"] retain]; + children = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void)addChild:(ModEntry *)child +{ + [children addObject:child]; +} + +- (void) dealloc +{ + [icon release]; icon = nil; + [super dealloc]; +} + +@end diff --git a/OpenRA.Launcher.Mac/OpenRA-Info.plist b/OpenRA.Launcher.Mac/OpenRA-Info.plist new file mode 100644 index 0000000000..8524368158 --- /dev/null +++ b/OpenRA.Launcher.Mac/OpenRA-Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + OpenRA.icns + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/OpenRA.Launcher.Mac/OpenRA.icns b/OpenRA.Launcher.Mac/OpenRA.icns new file mode 100755 index 0000000000..c5b938fbc0 Binary files /dev/null and b/OpenRA.Launcher.Mac/OpenRA.icns differ diff --git a/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj b/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..249a805b13 --- /dev/null +++ b/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj @@ -0,0 +1,311 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; + 256AC3DA0F4B6AC300CF3369 /* OpenRAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* OpenRAAppDelegate.m */; }; + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; + 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + DA81FA821290F5C800C48F2F /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = DA81FA811290F5C800C48F2F /* Controller.m */; }; + DA81FAAA1290FA0000C48F2F /* ModEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = DA81FAA91290FA0000C48F2F /* ModEntry.m */; }; + DA81FB9312910A8B00C48F2F /* ImageAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DA81FB9212910A8B00C48F2F /* ImageAndTextCell.m */; }; + DA81FBDC12910E4900C48F2F /* OpenRA.icns in Resources */ = {isa = PBXBuildFile; fileRef = DA81FBDB12910E4900C48F2F /* OpenRA.icns */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; + 256AC3D80F4B6AC300CF3369 /* OpenRAAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenRAAppDelegate.h; sourceTree = ""; }; + 256AC3D90F4B6AC300CF3369 /* OpenRAAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OpenRAAppDelegate.m; sourceTree = ""; }; + 256AC3F00F4B6AF500CF3369 /* OpenRA_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenRA_Prefix.pch; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* OpenRA-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "OpenRA-Info.plist"; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* OpenRA.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenRA.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DA81FA801290F5C800C48F2F /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = ""; }; + DA81FA811290F5C800C48F2F /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = ""; }; + DA81FAA81290FA0000C48F2F /* ModEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModEntry.h; sourceTree = ""; }; + DA81FAA91290FA0000C48F2F /* ModEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModEntry.m; sourceTree = ""; }; + DA81FB9112910A8B00C48F2F /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageAndTextCell.h; sourceTree = ""; }; + DA81FB9212910A8B00C48F2F /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageAndTextCell.m; sourceTree = ""; }; + DA81FBDB12910E4900C48F2F /* OpenRA.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = OpenRA.icns; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + DA81FB9112910A8B00C48F2F /* ImageAndTextCell.h */, + DA81FB9212910A8B00C48F2F /* ImageAndTextCell.m */, + 256AC3D80F4B6AC300CF3369 /* OpenRAAppDelegate.h */, + 256AC3D90F4B6AC300CF3369 /* OpenRAAppDelegate.m */, + DA81FA801290F5C800C48F2F /* Controller.h */, + DA81FA811290F5C800C48F2F /* Controller.m */, + DA81FAA81290FA0000C48F2F /* ModEntry.h */, + DA81FAA91290FA0000C48F2F /* ModEntry.m */, + ); + name = Classes; + sourceTree = ""; + }; + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D1107320486CEB800E47090 /* OpenRA.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* OpenRA */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = OpenRA; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 256AC3F00F4B6AF500CF3369 /* OpenRA_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + DA81FBDB12910E4900C48F2F /* OpenRA.icns */, + 8D1107310486CEB800E47090 /* OpenRA-Info.plist */, + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, + 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D1107260486CEB800E47090 /* OpenRA */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "OpenRA" */; + buildPhases = ( + 8D1107290486CEB800E47090 /* Resources */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OpenRA; + productInstallPath = "$(HOME)/Applications"; + productName = OpenRA; + productReference = 8D1107320486CEB800E47090 /* OpenRA.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OpenRA" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* OpenRA */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* OpenRA */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, + 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, + DA81FBDC12910E4900C48F2F /* OpenRA.icns in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072D0486CEB800E47090 /* main.m in Sources */, + 256AC3DA0F4B6AC300CF3369 /* OpenRAAppDelegate.m in Sources */, + DA81FA821290F5C800C48F2F /* Controller.m in Sources */, + DA81FAAA1290FA0000C48F2F /* ModEntry.m in Sources */, + DA81FB9312910A8B00C48F2F /* ImageAndTextCell.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C165DFE840E0CC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 1DDD58150DA1D0A300B32029 /* English */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = OpenRA_Prefix.pch; + INFOPLIST_FILE = "OpenRA-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = OpenRA; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = OpenRA_Prefix.pch; + INFOPLIST_FILE = "OpenRA-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = OpenRA; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.6; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = macosx10.6; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "OpenRA" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OpenRA" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/OpenRA.Launcher.Mac/OpenRAAppDelegate.h b/OpenRA.Launcher.Mac/OpenRAAppDelegate.h new file mode 100644 index 0000000000..167f09836f --- /dev/null +++ b/OpenRA.Launcher.Mac/OpenRAAppDelegate.h @@ -0,0 +1,17 @@ +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ + +#import + +@interface OpenRAAppDelegate : NSObject { + NSWindow *window; +} + +@property (assign) IBOutlet NSWindow *window; + +@end diff --git a/OpenRA.Launcher.Mac/OpenRAAppDelegate.m b/OpenRA.Launcher.Mac/OpenRAAppDelegate.m new file mode 100644 index 0000000000..4269dd985c --- /dev/null +++ b/OpenRA.Launcher.Mac/OpenRAAppDelegate.m @@ -0,0 +1,19 @@ +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ + +#import "OpenRAAppDelegate.h" + +@implementation OpenRAAppDelegate + +@synthesize window; + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + +@end diff --git a/OpenRA.Launcher.Mac/OpenRA_Prefix.pch b/OpenRA.Launcher.Mac/OpenRA_Prefix.pch new file mode 100644 index 0000000000..125a669ad6 --- /dev/null +++ b/OpenRA.Launcher.Mac/OpenRA_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'OpenRA' target in the 'OpenRA' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/OpenRA.Launcher.Mac/main.m b/OpenRA.Launcher.Mac/main.m new file mode 100644 index 0000000000..6eaf818c94 --- /dev/null +++ b/OpenRA.Launcher.Mac/main.m @@ -0,0 +1,14 @@ +// +// main.m +// OpenRA +// +// Created by Paul Chote on 15/11/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **) argv); +}