# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1299994739 0 # Node ID 17923b931393e4e5fe933cbb016ddb5c11383b51 # Parent 67f2e890b9dfadb1006558265c33ce13c74a936e Fixes for building for MacOS 10.5 and PPC diff -r 67f2e890b9df -r 17923b931393 mac/dw.m --- a/mac/dw.m Sat Mar 12 17:42:42 2011 +0000 +++ b/mac/dw.m Sun Mar 13 05:38:59 2011 +0000 @@ -389,7 +389,10 @@ */ /* Subclass for a box type */ -@interface DWBox : NSView +@interface DWBox : NSView +#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED + +#endif { Box *box; void *userdata; @@ -573,7 +576,10 @@ @end /* Subclass for a Notebook control type */ -@interface DWNotebook : NSTabView +@interface DWNotebook : NSTabView +#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED + +#endif { void *userdata; int pageid; @@ -645,7 +651,10 @@ @end /* Subclass for a splitbar type */ -@interface DWSplitBar : NSSplitView +@interface DWSplitBar : NSSplitView +#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED + +#endif { void *userdata; float percent; @@ -820,7 +829,10 @@ @end /* Subclass for a Container/List type */ -@interface DWContainer : NSTableView +@interface DWContainer : NSTableView +#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED + +#endif { void *userdata; NSMutableArray *tvcols; @@ -897,8 +909,8 @@ -(BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { return NO; } -(void *)userdata { return userdata; } -(void)setUserdata:(void *)input { userdata = input; } --(NSScrollView *)scrollview { return scrollview; } --(void)setScrollview:(NSScrollView *)input { scrollview = input; } +-(id)scrollview { return scrollview; } +-(void)setScrollview:(id)input { scrollview = input; } -(void)addColumn:(NSTableColumn *)input andType:(int)type { if(tvcols) { [tvcols addObject:input]; [types addObject:[NSNumber numberWithInt:type]]; } } -(NSTableColumn *)getColumn:(int)col { if(tvcols) { return [tvcols objectAtIndex:col]; } return nil; } -(int)insertRow:(NSArray *)input at:(int)index @@ -1051,7 +1063,10 @@ } /* Subclass for a Tree type */ -@interface DWTree : NSOutlineView +@interface DWTree : NSOutlineView +#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED + +#endif { void *userdata; NSTableColumn *imagecol; @@ -1227,7 +1242,10 @@ @end /* Subclass for a Combobox type */ -@interface DWComboBox : NSComboBox +@interface DWComboBox : NSComboBox +#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED + +#endif { void *userdata; } @@ -1280,7 +1298,10 @@ @end /* Subclass for a Spinbutton type */ -@interface DWSpinButton : NSView +@interface DWSpinButton : NSView +#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED + +#endif { void *userdata; NSTextField *textfield; @@ -1774,8 +1795,12 @@ NSMenu *_generate_main_menu() { + NSString *applicationName = nil; + /* This only works on 10.6 so we have a backup method */ - NSString * applicationName = [[NSRunningApplication currentApplication] localizedName]; +#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED + applicationName = [[NSRunningApplication currentApplication] localizedName]; +#endif if(applicationName == nil) { applicationName = [[NSProcessInfo processInfo] processName];