Mercurial > dwindows
comparison mac/dw.m @ 717:17923b931393
Fixes for building for MacOS 10.5 and PPC
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 13 Mar 2011 05:38:59 +0000 |
parents | 5f8102bd7646 |
children | 002f33d4439d |
comparison
equal
deleted
inserted
replaced
716:67f2e890b9df | 717:17923b931393 |
---|---|
387 * only add methods and no variables, which isn't | 387 * only add methods and no variables, which isn't |
388 * going to work. -Brian | 388 * going to work. -Brian |
389 */ | 389 */ |
390 | 390 |
391 /* Subclass for a box type */ | 391 /* Subclass for a box type */ |
392 @interface DWBox : NSView <NSWindowDelegate> | 392 @interface DWBox : NSView |
393 #if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED | |
394 <NSWindowDelegate> | |
395 #endif | |
393 { | 396 { |
394 Box *box; | 397 Box *box; |
395 void *userdata; | 398 void *userdata; |
396 NSColor *bgcolor; | 399 NSColor *bgcolor; |
397 } | 400 } |
571 -(void)setUserdata:(void *)input { userdata = input; } | 574 -(void)setUserdata:(void *)input { userdata = input; } |
572 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } | 575 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } |
573 @end | 576 @end |
574 | 577 |
575 /* Subclass for a Notebook control type */ | 578 /* Subclass for a Notebook control type */ |
576 @interface DWNotebook : NSTabView <NSTabViewDelegate> | 579 @interface DWNotebook : NSTabView |
580 #if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED | |
581 <NSTabViewDelegate> | |
582 #endif | |
577 { | 583 { |
578 void *userdata; | 584 void *userdata; |
579 int pageid; | 585 int pageid; |
580 } | 586 } |
581 -(void *)userdata; | 587 -(void *)userdata; |
643 } | 649 } |
644 -(void)setDialog:(DWDialog *)input { dialog = input; } | 650 -(void)setDialog:(DWDialog *)input { dialog = input; } |
645 @end | 651 @end |
646 | 652 |
647 /* Subclass for a splitbar type */ | 653 /* Subclass for a splitbar type */ |
648 @interface DWSplitBar : NSSplitView <NSSplitViewDelegate> | 654 @interface DWSplitBar : NSSplitView |
655 #if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED | |
656 <NSSplitViewDelegate> | |
657 #endif | |
649 { | 658 { |
650 void *userdata; | 659 void *userdata; |
651 float percent; | 660 float percent; |
652 } | 661 } |
653 -(void)splitViewDidResizeSubviews:(NSNotification *)aNotification; | 662 -(void)splitViewDidResizeSubviews:(NSNotification *)aNotification; |
818 -(void)setUserdata:(void *)input { userdata = input; } | 827 -(void)setUserdata:(void *)input { userdata = input; } |
819 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } | 828 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } |
820 @end | 829 @end |
821 | 830 |
822 /* Subclass for a Container/List type */ | 831 /* Subclass for a Container/List type */ |
823 @interface DWContainer : NSTableView <NSTableViewDataSource> | 832 @interface DWContainer : NSTableView |
833 #if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED | |
834 <NSTableViewDataSource> | |
835 #endif | |
824 { | 836 { |
825 void *userdata; | 837 void *userdata; |
826 NSMutableArray *tvcols; | 838 NSMutableArray *tvcols; |
827 NSMutableArray *data; | 839 NSMutableArray *data; |
828 NSMutableArray *types; | 840 NSMutableArray *types; |
895 return nil; | 907 return nil; |
896 } | 908 } |
897 -(BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { return NO; } | 909 -(BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { return NO; } |
898 -(void *)userdata { return userdata; } | 910 -(void *)userdata { return userdata; } |
899 -(void)setUserdata:(void *)input { userdata = input; } | 911 -(void)setUserdata:(void *)input { userdata = input; } |
900 -(NSScrollView *)scrollview { return scrollview; } | 912 -(id)scrollview { return scrollview; } |
901 -(void)setScrollview:(NSScrollView *)input { scrollview = input; } | 913 -(void)setScrollview:(id)input { scrollview = input; } |
902 -(void)addColumn:(NSTableColumn *)input andType:(int)type { if(tvcols) { [tvcols addObject:input]; [types addObject:[NSNumber numberWithInt:type]]; } } | 914 -(void)addColumn:(NSTableColumn *)input andType:(int)type { if(tvcols) { [tvcols addObject:input]; [types addObject:[NSNumber numberWithInt:type]]; } } |
903 -(NSTableColumn *)getColumn:(int)col { if(tvcols) { return [tvcols objectAtIndex:col]; } return nil; } | 915 -(NSTableColumn *)getColumn:(int)col { if(tvcols) { return [tvcols objectAtIndex:col]; } return nil; } |
904 -(int)insertRow:(NSArray *)input at:(int)index | 916 -(int)insertRow:(NSArray *)input at:(int)index |
905 { | 917 { |
906 if(data) | 918 if(data) |
1049 [node release]; | 1061 [node release]; |
1050 } | 1062 } |
1051 } | 1063 } |
1052 | 1064 |
1053 /* Subclass for a Tree type */ | 1065 /* Subclass for a Tree type */ |
1054 @interface DWTree : NSOutlineView <NSOutlineViewDataSource> | 1066 @interface DWTree : NSOutlineView |
1067 #if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED | |
1068 <NSOutlineViewDataSource> | |
1069 #endif | |
1055 { | 1070 { |
1056 void *userdata; | 1071 void *userdata; |
1057 NSTableColumn *imagecol; | 1072 NSTableColumn *imagecol; |
1058 NSTableColumn *textcol; | 1073 NSTableColumn *textcol; |
1059 NSMutableArray *data; | 1074 NSMutableArray *data; |
1225 -(void)setUserdata:(void *)input { userdata = input; } | 1240 -(void)setUserdata:(void *)input { userdata = input; } |
1226 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } | 1241 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } |
1227 @end | 1242 @end |
1228 | 1243 |
1229 /* Subclass for a Combobox type */ | 1244 /* Subclass for a Combobox type */ |
1230 @interface DWComboBox : NSComboBox <NSComboBoxDelegate> | 1245 @interface DWComboBox : NSComboBox |
1246 #if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED | |
1247 <NSComboBoxDelegate> | |
1248 #endif | |
1231 { | 1249 { |
1232 void *userdata; | 1250 void *userdata; |
1233 } | 1251 } |
1234 -(void *)userdata; | 1252 -(void *)userdata; |
1235 -(void)setUserdata:(void *)input; | 1253 -(void)setUserdata:(void *)input; |
1278 _event_handler(parent, (void *)[self integerValue], 14); | 1296 _event_handler(parent, (void *)[self integerValue], 14); |
1279 } | 1297 } |
1280 @end | 1298 @end |
1281 | 1299 |
1282 /* Subclass for a Spinbutton type */ | 1300 /* Subclass for a Spinbutton type */ |
1283 @interface DWSpinButton : NSView <NSTextFieldDelegate> | 1301 @interface DWSpinButton : NSView |
1302 #if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED | |
1303 <NSTextFieldDelegate> | |
1304 #endif | |
1284 { | 1305 { |
1285 void *userdata; | 1306 void *userdata; |
1286 NSTextField *textfield; | 1307 NSTextField *textfield; |
1287 DWStepper *stepper; | 1308 DWStepper *stepper; |
1288 } | 1309 } |
1772 } | 1793 } |
1773 } | 1794 } |
1774 | 1795 |
1775 NSMenu *_generate_main_menu() | 1796 NSMenu *_generate_main_menu() |
1776 { | 1797 { |
1798 NSString *applicationName = nil; | |
1799 | |
1777 /* This only works on 10.6 so we have a backup method */ | 1800 /* This only works on 10.6 so we have a backup method */ |
1778 NSString * applicationName = [[NSRunningApplication currentApplication] localizedName]; | 1801 #if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED |
1802 applicationName = [[NSRunningApplication currentApplication] localizedName]; | |
1803 #endif | |
1779 if(applicationName == nil) | 1804 if(applicationName == nil) |
1780 { | 1805 { |
1781 applicationName = [[NSProcessInfo processInfo] processName]; | 1806 applicationName = [[NSProcessInfo processInfo] processName]; |
1782 } | 1807 } |
1783 | 1808 |