Changeset 850

Show
Ignore:
Timestamp:
04/28/08 19:02:43 (4 months ago)
Author:
takkaria
Message:

Commit the latest work on the OS X port by Rowan Beentje:

  • Fix #545: add a recent items menu, tracking the last ten savefiles used.
  • Fix #549: disable the automatic window handling and added manual term tracking, preventing double display of terms in the Window menu
  • Also remove the "Zoom" menu item from the Windows menu, as it does nothing and the corresponding window button is disabled.
  • Overhaul the About dialog so that it is generated dynamically, to avoid problems with information becoming out-of-date.
  • Fix a crash bug. The original cause was that closing the main game window during play followed by a normal quit resulted in pref loading failing an integrity check and aborting early, so prevent that particular bug as well as fixing the crasher.
  • Clean up code formatting a tad where it was still using multiple spaces.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main-crb.c

    r824 r850  
    363363 
    364364/* 
     365 * A mutable array for Recent Items 
     366 */  
     367CFMutableArrayRef recentItemsArrayRef = NULL; 
     368 
     369/* 
    365370 * Support the improved game command handling 
    366371 */ 
     
    385390         * First heirarchical call, find and initialize all menu IDs. 
    386391         * Subsequent misses will attempt to update the menuRefs array. 
    387     * This will work for any depth heirarchy, so long as child menus have 
    388     * higher IDs than their parents.  
     392        * This will work for any depth heirarchy, so long as child menus have 
     393        * higher IDs than their parents.       
    389394         * 
    390395         * Invariant: all MenuRefs with ID < MenuID(tmp) have been initialized. 
     
    544549                } 
    545550                else { 
    546                       const ATSUAttributeTag itags[] =  { kATSUCGContextTag, 
     551                      const ATSUAttributeTag itags[] =  { kATSUCGContextTag, 
    547552                                                                                kATSUImposeWidthTag }; 
    548553                        Fixed advance = (1<<16)*(td->tile_wid - td->font_wid); 
     
    22132218 
    22142219        /* 
     2220         * Save the recent items array - directly. 
     2221         */ 
     2222        CFPreferencesSetAppValue( 
     2223                CFSTR("recent_items"), 
     2224                recentItemsArrayRef, 
     2225                kCFPreferencesCurrentApplication); 
     2226         
     2227        /* 
    22152228         * Make sure preferences are persistent 
    22162229         */ 
     
    23222335 
    23232336                load_pref_short(format("term%d.mapped", i), &td->mapped); 
     2337                CheckMenuItem(MyGetMenuHandle(kWindowMenu), kAngbandTerm+i, td->mapped); 
    23242338 
    23252339                load_pref_short(format("term%d.tile_wid", i), &td->tile_wid); 
     
    23452359                } 
    23462360        } 
     2361         
     2362        /* 
     2363         * Load the recent items array, if present, directly 
     2364         */ 
     2365        CFArrayRef recentItemsLoaded = (CFArrayRef)CFPreferencesCopyAppValue( 
     2366                CFSTR("recent_items"), 
     2367                kCFPreferencesCurrentApplication); 
     2368        if (recentItemsLoaded != NULL) 
     2369                recentItemsArrayRef = CFArrayCreateMutableCopy(kCFAllocatorDefault, 0, recentItemsLoaded); 
    23472370} 
    23482371 
     
    24522475        /* Main window */ 
    24532476        Term_activate(td->t); 
     2477} 
     2478 
     2479 
     2480/* Set up the contents of the about dialog */ 
     2481static void init_aboutdialogcontent() 
     2482{ 
     2483        HIViewRef aboutDialogViewRef; 
     2484        OSStatus err; 
     2485         
     2486        /* Set the application name from the constants set in defines.h */ 
     2487        char *applicationName = format("%s %s", VERSION_NAME, VERSION_STRING); 
     2488        CFStringRef cfstr_applicationName = CFStringCreateWithBytes(NULL, (byte *)applicationName, 
     2489                                                                                strlen(applicationName), kCFStringEncodingASCII, false); 
     2490        HIViewFindByID(HIViewGetRoot(aboutDialog), aboutDialogName, &aboutDialogViewRef); 
     2491        HIViewSetText(aboutDialogViewRef, cfstr_applicationName); 
     2492         
     2493        /* Set the application copyright as set up in variable.c */ 
     2494        HIViewFindByID(HIViewGetRoot(aboutDialog), aboutDialogCopyright, &aboutDialogViewRef); 
     2495        CFStringRef cfstr_applicationCopyright = CFStringCreateWithBytes(NULL, (byte *)copyright, 
     2496                                                                                strlen(copyright), kCFStringEncodingASCII, false); 
     2497        HIViewSetText(aboutDialogViewRef, cfstr_applicationCopyright); 
     2498 
     2499        /* Use a small font for the copyright text */ 
     2500        TXNObject txnObject = HITextViewGetTXNObject(aboutDialogViewRef); 
     2501        TXNTypeAttributes typeAttr[1]; 
     2502        typeAttr[0].tag = kTXNQDFontSizeAttribute; 
     2503        typeAttr[0].size = kTXNFontSizeAttributeSize; 
     2504        typeAttr[0].data.dataValue = FloatToFixed(10); 
     2505        err = TXNSetTypeAttributes(txnObject, 1, typeAttr, kTXNStartOffset, kTXNEndOffset); 
     2506 
     2507        /* Get the application icon and draw it */ 
     2508        ProcessSerialNumber psn = { 0, kCurrentProcess }; 
     2509        ControlRef iconControl; 
     2510        FSRef ref; 
     2511        FSSpec appSpec; 
     2512        IconRef iconRef; 
     2513        ControlButtonContentInfo cInfo; 
     2514 
     2515        err = GetProcessBundleLocation(&psn, &ref); 
     2516        if(err == noErr) 
     2517                err = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL, &appSpec, NULL); 
     2518        if( err == noErr ) 
     2519                err = GetIconRefFromFile((const FSSpec *)&appSpec, &iconRef, nil); 
     2520        if(err == noErr) 
     2521                err = GetControlByID(aboutDialog, &aboutDialogIcon, &iconControl); 
     2522        if( err == noErr ) 
     2523        { 
     2524                cInfo.contentType = kControlContentIconRef; 
     2525                cInfo.u.iconRef = iconRef; 
     2526                err = SetControlData(iconControl, 0, kControlIconContentTag, sizeof(cInfo), (Ptr)&cInfo); 
     2527        } 
    24542528} 
    24552529 
     
    25882662                quit("Cannot prepare menu bar!"); 
    25892663 
     2664        /* Load the about dialog and set its contents */ 
    25902665        (void) CreateWindowFromNib(nib, CFSTR("DLOG:about"), &aboutDialog); 
     2666        init_aboutdialogcontent(); 
    25912667 
    25922668        DisposeNibReference(nib); 
     
    26702746        MenuHandle m; 
    26712747 
    2672         if(game_in_progress) { 
     2748        if(cmd.command != CMD_NULL) { 
    26732749                EnableAllMenuItems(MyGetMenuHandle(kSpecialMenu)); 
    26742750                EnableAllMenuItems(MyGetMenuHandle(kStyleMenu)); 
     
    26922768 
    26932769        m = MyGetMenuHandle(kFileMenu); 
    2694         if(inkey_flag && character_generated) { 
     2770        if(inkey_flag && character_generated) 
     2771        { 
    26952772                EnableMenuItem(MyGetMenuHandle(kFileMenu), kSave); 
    26962773        } 
    2697         else { 
     2774        else 
     2775        { 
    26982776                DisableMenuItem(MyGetMenuHandle(kFileMenu), kSave); 
    2699         } 
    2700         for(int i = kNew; i <= kImport; i++) { 
    2701                 if(cmd.command == CMD_NULL)  
    2702                         EnableMenuItem(MyGetMenuHandle(kFileMenu), i); 
    2703                 else 
    2704                         DisableMenuItem(MyGetMenuHandle(kFileMenu), i); 
    27052777        } 
    27062778 
     
    27092781                CheckMenuItem(m, toggle_defs[i].menuItem, *(toggle_defs[i].var)); 
    27102782        } 
     2783         
     2784        /* Populate the recent items menu */ 
     2785        DeleteMenuItems(MyGetMenuHandle(kOpenRecentMenu), 1, CountMenuItems(MyGetMenuHandle(kOpenRecentMenu))); 
     2786        if (!recentItemsArrayRef || CFArrayGetCount(recentItemsArrayRef) == 0) 
     2787        { 
     2788                AppendMenuItemTextWithCFString(MyGetMenuHandle(kOpenRecentMenu), CFSTR("No recent items"), kMenuItemAttrDisabled, kOpenRecentMenu, NULL); 
     2789        } 
     2790        else 
     2791        { 
     2792                for (int i = 0; i < CFArrayGetCount(recentItemsArrayRef); i++) 
     2793                { 
     2794                        OSErr err; 
     2795                        FSRef recentFileRef; 
     2796                        CFDataRef recentFileData; 
     2797                        Boolean updateAlias = FALSE; 
     2798 
     2799                        recentFileData = CFArrayGetValueAtIndex(recentItemsArrayRef, i); 
     2800                        if (CFDataGetTypeID() != CFGetTypeID(recentFileData)) continue; 
     2801                        AliasHandle recentFileAlias = (AliasHandle)NewHandle(CFDataGetLength(recentFileData)); 
     2802                        CFDataGetBytes(recentFileData, CFRangeMake(0, CFDataGetLength(recentFileData)), (UInt8 *) *recentFileAlias); 
     2803                         
     2804                        err = FSResolveAlias(NULL, recentFileAlias, &recentFileRef, &updateAlias); 
     2805                        if (err != noErr) continue; 
     2806                         
     2807                        HFSUniStr255 recentFileName; 
     2808                        err = FSGetCatalogInfo(&recentFileRef, kFSCatInfoNone, NULL, &recentFileName, NULL, NULL); 
     2809                        if (err != noErr) continue; 
     2810                         
     2811                        CFStringRef cfstr = CFStringCreateWithCharacters(kCFAllocatorDefault, recentFileName.unicode, recentFileName.length); 
     2812                        AppendMenuItemTextWithCFString(MyGetMenuHandle(kOpenRecentMenu), cfstr, 0, i, NULL); 
     2813                } 
     2814                AppendMenuItemTextWithCFString(MyGetMenuHandle(kOpenRecentMenu), CFSTR("-"), kMenuItemAttrSeparator, -1, NULL); 
     2815                AppendMenuItemTextWithCFString(MyGetMenuHandle(kOpenRecentMenu), CFSTR("Clear menu"), 0, -1, NULL); 
     2816        } 
    27112817} 
    27122818 
     
    27182824} 
    27192825 
    2720  
     2826/* Add a savefile to the recent items list, or update its existing status */ 
     2827static void updateRecentItems(char *savefile) 
     2828
     2829        OSErr err; 
     2830        FSRef recentFileRef; 
     2831        AliasHandle recentFileAlias; 
     2832        CFDataRef newRecentFileData; 
     2833        CFDataRef recentFileData; 
     2834 
     2835        /* Convert the save path to an FSRef, then an Alias, and convert to data ready for storage */ 
     2836        err = FSPathMakeRef((byte *)savefile, &recentFileRef, NULL); 
     2837        if (err != noErr) return; 
     2838        err = FSNewAlias(NULL, &recentFileRef, &recentFileAlias); 
     2839        if (err != noErr) return; 
     2840        newRecentFileData = CFDataCreate(kCFAllocatorDefault, (UInt8 *) *recentFileAlias, GetHandleSize((Handle)recentFileAlias)); 
     2841         
     2842        /* Loop through the recent items array, and delete any matches */ 
     2843        for (int i = CFArrayGetCount(recentItemsArrayRef) - 1; i >= 0; i--) 
     2844        { 
     2845                Boolean updateAlias = FALSE; 
     2846                char recentFilePath[1024]; 
     2847 
     2848                /* Retrieve the recent item, resolve the alias, and extract a path */ 
     2849                recentFileData = CFArrayGetValueAtIndex(recentItemsArrayRef, i); 
     2850                if (CFDataGetTypeID() != CFGetTypeID(recentFileData)) continue; 
     2851                AliasHandle recentFileAlias = (AliasHandle)NewHandle(CFDataGetLength(recentFileData)); 
     2852                CFDataGetBytes(recentFileData, CFRangeMake(0, CFDataGetLength(recentFileData)), (UInt8 *) *recentFileAlias); 
     2853                 
     2854                /* If resolving an alias fails, don't delete it - the array is size-limited 
     2855                 * anyway, and this allows network shares or removeable drives to come back later */ 
     2856                err = FSResolveAlias(NULL, recentFileAlias, &recentFileRef, &updateAlias); 
     2857                if (err != noErr) continue; 
     2858                err = FSRefMakePath(&recentFileRef, (byte *)recentFilePath, 1024); 
     2859                if (err != noErr) continue; 
     2860 
     2861                /* Remove the item from the array if the paths match */ 
     2862                if (strcmp(recentFilePath, savefile) == 0) 
     2863                { 
     2864                        CFArrayRemoveValueAtIndex(recentItemsArrayRef, i); 
     2865                        continue; 
     2866                } 
     2867 
     2868                /* If performing a file search via the alias updated it, save changes */ 
     2869                if (updateAlias) 
     2870                { 
     2871                        recentFileData = CFDataCreate(kCFAllocatorDefault, (UInt8 *) *recentFileAlias, GetHandleSize((Handle)recentFileAlias)); 
     2872                        CFArraySetValueAtIndex(recentItemsArrayRef, i, newRecentFileData); 
     2873                } 
     2874        } 
     2875         
     2876        /* Insert the encoded alias at the start of the recent items array */ 
     2877        CFArrayInsertValueAtIndex(recentItemsArrayRef, 0, newRecentFileData); 
     2878         
     2879        /* Limit to ten items */ 
     2880        if (CFArrayGetCount(recentItemsArrayRef) > 10) 
     2881                CFArrayRemoveValueAtIndex(recentItemsArrayRef, 10); 
     2882
     2883 
     2884/* Handle a selection in the recent items menu */ 
     2885static OSStatus OpenRecentCommand(EventHandlerCallRef inCallRef, 
     2886                                                        EventRef inEvent, void *inUserData ) 
     2887
     2888        HICommand command; 
     2889        command.commandID = 0; 
     2890        GetEventParameter( inEvent, kEventParamDirectObject, typeHICommand, 
     2891                                                        NULL, sizeof(command), NULL, &command); 
     2892         
     2893        /* If the 'Clear menu' command was selected, flush the recent items array */ 
     2894        if (command.commandID == -1) { 
     2895                CFArrayRemoveAllValues(recentItemsArrayRef); 
     2896         
     2897        /* Otherwise locate the correct filepath and open it. */ 
     2898        } else { 
     2899                if (cmd.command != CMD_NULL || command.commandID < 0 || command.commandID >= CFArrayGetCount(recentItemsArrayRef)) 
     2900                        return eventNotHandledErr; 
     2901 
     2902                OSErr err; 
     2903                FSRef recentFileRef; 
     2904                AliasHandle recentFileAlias; 
     2905                CFDataRef recentFileData; 
     2906                Boolean updateAlias = FALSE; 
     2907 
     2908                recentFileData = CFArrayGetValueAtIndex(recentItemsArrayRef, command.commandID); 
     2909                if (CFDataGetTypeID() != CFGetTypeID(recentFileData)) return eventNotHandledErr; 
     2910                recentFileAlias = (AliasHandle)NewHandle(CFDataGetLength(recentFileData)); 
     2911                CFDataGetBytes(recentFileData, CFRangeMake(0, CFDataGetLength(recentFileData)), (UInt8 *) *recentFileAlias); 
     2912                err = FSResolveAlias(NULL, recentFileAlias, &recentFileRef, &updateAlias); 
     2913                if (err != noErr) return eventNotHandledErr; 
     2914                err = FSRefMakePath(&recentFileRef, (byte *)savefile, 1024); 
     2915                if (err != noErr) return eventNotHandledErr; 
     2916                 
     2917                cmd.command = CMD_LOADFILE; 
     2918        } 
     2919 
     2920        return noErr; 
     2921
    27212922 
    27222923static OSStatus AngbandGame(EventHandlerCallRef inCallRef, 
    27232924                                                        EventRef inEvent, void *inUserData ) 
    27242925{ 
    2725         // Only enabled options are Fonts, Open/New/Import and Quit.  
     2926        /* Only enabled options are Fonts, Open/New/Import and Quit. */ 
    27262927        DisableAllMenuItems(MyGetMenuHandle(kTileWidMenu)); 
    27272928        DisableAllMenuItems(MyGetMenuHandle(kTileHgtMenu)); 
     
    27542955{ 
    27552956        /* If a game is in progress, do not proceed */ 
    2756         if (game_in_progress) return noErr; 
     2957        if (cmd.command != CMD_NULL) return noErr; 
    27572958 
    27582959        /* Let the player to choose savefile */ 
     
    27622963                return noErr; 
    27632964        } 
     2965 
     2966        /* Disable the file-handling options in the file menu */ 
     2967        for(int i = kNew; i <= kImport; i++) 
     2968                DisableMenuItem(MyGetMenuHandle(kFileMenu), i); 
    27642969 
    27652970        /* Wait for a keypress */ 
     
    27722977                cmd.command = CMD_LOADFILE; 
    27732978                 
    2774         /* Game is in progress */ 
    2775         game_in_progress = TRUE; 
    2776  
    2777         /* Disable the file-handling options in the file menu */ 
    2778         for(int i = kNew; i <= kImport; i++) 
    2779                 DisableMenuItem(MyGetMenuHandle(kFileMenu), i); 
    2780          
    27812979        return noErr; 
    27822980} 
     
    28023000                } 
    28033001        } 
    2804          
    2805         /* Bit of a hack, we'll do this when we leave the INIT context in future. */  
     3002                
     3003        /* A game is starting - update status and tracking as appropriate. */  
    28063004        game_in_progress = TRUE;  
    2807          
     3005        term_data *td0 = &data[0]; 
     3006        ChangeWindowAttributes(td0->w, kWindowNoAttributes, kWindowCloseBoxAttribute); 
     3007        DisableMenuItem(MyGetMenuHandle(kFileMenu), kClose); 
     3008 
     3009        /* Disable the file-handling options in the file menu. 
     3010         * This has to be done separately for new/open due to messages/prompts 
     3011         * which may delay open while the menus are still accessibile. */ 
     3012        for(int i = kNew; i <= kImport; i++) 
     3013                DisableMenuItem(MyGetMenuHandle(kFileMenu), i); 
     3014                         
     3015        /* If supplied with a savefile, update the Recent Items list */ 
     3016        if (savefile[0]) 
     3017                updateRecentItems(savefile); 
     3018 
    28083019        return cmd;  
    28093020}  
     
    28503061                } 
    28513062                CFStringRef tags[] = {CFSTR("Show Fonts"), CFSTR("Hide Fonts")}; 
    2852         FPShowHideFontPanel();  
     3063               FPShowHideFontPanel();  
    28533064                SetMenuItemTextWithCFString(command.menu.menuRef, kFonts, 
    28543065                                                                                        tags[FPIsFontPanelVisible()] ); 
     
    28773088 
    28783089        /* Track the go-away box */ 
    2879         if (td
     3090        if (td && td != &data[0]
    28803091        { 
    28813092                /* Not Mapped */ 
     
    28903101                                                kWindowHideTransitionAction, 
    28913102                                                NULL); 
     3103 
     3104                /* Update the menu status */ 
     3105                CheckMenuItem(MyGetMenuHandle(kWindowMenu), kAngbandTerm+(td - &data[0]), FALSE); 
    28923106        } 
    28933107        return noErr; 
     
    30713285        SelectWindow(td->w); 
    30723286 
     3287        /* Update menu states */ 
     3288        if (td == &data[0] && cmd.command != CMD_NULL) 
     3289                DisableMenuItem(MyGetMenuHandle(kFileMenu), kClose); 
     3290        else 
     3291                EnableMenuItem(MyGetMenuHandle(kFileMenu), kClose); 
     3292         
    30733293        return noErr; 
    30743294} 
     
    31043324                                kWindowShowTransitionAction, 
    31053325                                NULL); 
     3326 
     3327        /* Update the menu status */ 
     3328        CheckMenuItem(MyGetMenuHandle(kWindowMenu), kAngbandTerm+i, TRUE); 
    31063329 
    31073330        term_data_check_font(td); 
     
    32863509 
    32873510static OSStatus MouseCommand ( EventHandlerCallRef inCallRef, 
    3288     EventRef inEvent, void *inUserData ) 
     3511       EventRef inEvent, void *inUserData ) 
    32893512{ 
    32903513        WindowRef w = 0; 
     
    33253548 
    33263549static OSStatus KeyboardCommand ( EventHandlerCallRef inCallRef, 
    3327     EventRef inEvent, void *inUserData ) 
     3550       EventRef inEvent, void *inUserData ) 
    33283551{ 
    33293552 
     
    34073630 
    34083631static OSStatus PrintCommand(EventHandlerCallRef inCallRef, EventRef inEvent, 
    3409     void *inUserData ) 
     3632       void *inUserData ) 
    34103633{ 
    34113634        mac_warning((const char*) inUserData); 
     
    34153638/* About angband... */ 
    34163639static OSStatus AboutCommand(EventHandlerCallRef inCallRef, EventRef inEvent, 
    3417     void *inUserData ) 
     3640       void *inUserData ) 
    34183641{ 
    34193642        HICommand command; 
     
    34863709 
    34873710        /* If a game is in progress, do not proceed */ 
    3488         if (game_in_progress) return noErr; 
     3711        if (cmd.command != CMD_NULL) return noErr; 
    34893712         
    34903713        /* Put the direct parameter (a descriptor list) into a docList */ 
     
    35103733                        (void)spec_to_path(&myFSS, savefile, sizeof(savefile)); 
    35113734                        cmd.command = CMD_LOADFILE; 
    3512                          
     3735 
    35133736                        break; 
    35143737                } 
     
    36933916        cleanup_sound(); 
    36943917 
     3918        /* Update the Recent Items list - inserts newly created characters */ 
     3919        if (savefile[0]) 
     3920                updateRecentItems(savefile); 
    36953921 
    36963922        /* Dispose of graphic tiles */ 
     
    37553981        (void)Gestalt(gestaltSystemVersion, &mac_os_version); 
    37563982 
    3757  
    3758  
    37593983        /* Hooks in some "z-util.c" hooks */ 
    37603984        plog_aux = hook_plog; 
     
    37673991        SetCursor(*(GetCursor(watchCursor))); 
    37683992 
    3769  
     3993        /* Ensure that the recent items array is always an array */ 
     3994        recentItemsArrayRef = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); 
     3995         
    37703996        /* Prepare the menubar */ 
    37713997        init_menubar(); 
     
    37774003        init_windows(); 
    37784004 
    3779     /* Install the 'Apple Event' handler hook (ignore error codes) */ 
    3780     (void)AEInstallEventHandler( 
    3781         kCoreEventClass, 
    3782         kAEOpenDocuments, 
    3783         NewAEEventHandlerUPP(AEH_Open), 
    3784         0L, 
    3785         FALSE); 
     4005       /* Install the 'Apple Event' handler hook (ignore error codes) */ 
     4006       (void)AEInstallEventHandler( 
     4007               kCoreEventClass, 
     4008               kAEOpenDocuments, 
     4009               NewAEEventHandlerUPP(AEH_Open), 
     4010               0L, 
     4011               FALSE); 
    37864012 
    37874013        /* Install menu and application handlers */ 
     
    38264052        /* Start playing! */ 
    38274053        EventRef newGameEvent = nil; 
    3828         CreateEvent ( nil, 'Play', 'Band', GetCurrentEventTime(),     
     4054        CreateEvent ( nil, 'Play', 'Band', GetCurrentEventTime(), 
    38294055                                                                        kEventAttributeNone, &newGameEvent );  
    38304056        PostEventToQueue(GetMainEventQueue(), newGameEvent, kEventPriorityLow); 
  • trunk/src/osx/English.lproj/main.nib/classes.nib

    r1 r850  
    1 
    2 IBClasses = (); 
    3 IBVersion = 1; 
    4 
     1<?xml version="1.0" encoding="UTF-8"?> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     3<plist version="1.0"> 
     4<dict> 
     5        <key>IBVersion</key> 
     6        <string>1</string> 
     7</dict> 
     8</plist> 
  • trunk/src/osx/English.lproj/main.nib/info.nib

    r9 r850  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
    33<plist version="1.0"> 
    44<dict> 
    5         <key>IBDocumentLocation</key> 
    6         <string>81 68 356 240 0 0 1280 832 </string> 
    7         <key>IBEditorPositions</key> 
    8         <dict> 
    9                 <key>29</key> 
    10                 <string>75 721 402 44 0 0 1280 832 </string> 
    11         </dict> 
    125        <key>IBFramework Version</key> 
    13         <string>446.1</string> 
     6        <string>644</string> 
    147        <key>IBOldestOS</key> 
    158        <integer>3</integer> 
    169        <key>IBOpenObjects</key> 
    1710        <array> 
    18                 <integer>29</integer> 
     11                <integer>325</integer> 
    1912        </array> 
    2013        <key>IBSystem Version</key> 
    21         <string>8L127</string> 
     14        <string>9C7010</string> 
    2215        <key>targetFramework</key> 
    2316        <string>IBCarbonFramework</string> 
  • trunk/src/osx/English.lproj/main.nib/objects.xib

    r9 r850  
    11<?xml version="1.0" standalone="yes"?> 
    22<object class="NSIBObjectData"> 
    3   <string name="targetFramework">IBCarbonFramework</string> 
    43  <object name="rootObject" class="NSCustomObject" id="1"> 
    5     <string name="customClass">NSApplication</string> 
    64  </object> 
    7   <array count="73" name="allObjects"> 
     5  <array count="67" name="allObjects"> 
     6    <object class="IBCarbonMenuItem" id="192"> 
     7      <string name="title">Window</string> 
     8      <boolean name="updateSingleItem">TRUE</boolean> 
     9      <object name="submenu" class="IBCarbonMenu" id="195"> 
     10        <string name="title">Window</string> 
     11        <int name="menuID">105</int> 
     12        <array count="14" name="items"> 
     13          <object class="IBCarbonMenuItem" id="190"> 
     14            <string name="title">Minimize Window</string> 
     15            <string name="keyEquivalent">m</string> 
     16            <ostype name="command">mini</ostype> 
     17          </object> 
     18          <object class="IBCarbonMenuItem" id="191"> 
     19            <string name="title">Minimize All Windows</string> 
     20            <string name="keyEquivalent">m</string> 
     21            <int name="keyEquivalentModifier">1572864</int> 
     22            <ostype name="command">mina</ostype> 
     23          </object> 
     24          <object class="IBCarbonMenuItem" id="194"> 
     25            <boolean name="separator">TRUE</boolean> 
     26          </object> 
     27          <object class="IBCarbonMenuItem" id="207"> 
     28            <string name="title">Angband</string> 
     29            <string name="keyEquivalent">0</string> 
     30            <boolean name="checked">TRUE</boolean> 
     31            <boolean name="updateSingleItem">TRUE</boolean> 
     32            <ostype name="command">wnd </ostype> 
     33          </object> 
     34          <object class="IBCarbonMenuItem" id="208"> 
     35            <string name="title">Terminal 1</string> 
     36            <string name="keyEquivalent">1</string> 
     37            <boolean name="updateSingleItem">TRUE</boolean> 
     38            <ostype name="command">wnd </ostype> 
     39          </object> 
     40          <object class="IBCarbonMenuItem" id="209"> 
     41            <string name="title">Terminal 2</string> 
     42            <string name="keyEquivalent">2</string> 
     43            <boolean name="updateSingleItem">TRUE</boolean> 
     44            <ostype name="command">wnd </ostype> 
     45          </object> 
     46          <object class="IBCarbonMenuItem" id="210"> 
     47            <string name="title">Terminal 3</string> 
     48            <string name="keyEquivalent">3</string> 
     49            <boolean name="updateSingleItem">TRUE</boolean> 
     50            <ostype name="command">wnd </ostype> 
     51          </object> 
     52          <object class="IBCarbonMenuItem" id="211"> 
     53            <string name="title">Terminal 4</string> 
     54            <string name="keyEquivalent">4</string> 
     55            <boolean name="updateSingleItem">TRUE</boolean> 
     56            <ostype name="command">wnd </ostype> 
     57          </object> 
     58          <object class="IBCarbonMenuItem" id="212"> 
     59            <string name="title">Terminal 5</string> 
     60            <string name="keyEquivalent">5</string> 
     61            <boolean name="updateSingleItem">TRUE</boolean> 
     62            <ostype name="command">wnd </ostype> 
     63          </object> 
     64          <object class="IBCarbonMenuItem" id="213"> 
     65            <string name="title">Terminal 6</string> 
     66            <string name="keyEquivalent">6</string> 
     67            <boolean name="updateSingleItem">TRUE</boolean> 
     68            <ostype name="command">wnd </ostype> 
     69          </object> 
     70          <object class="IBCarbonMenuItem" id="214"> 
     71            <string name="title">Terminal 7</string> 
     72            <string name="keyEquivalent">7</string> 
     73            <boolean name="updateSingleItem">TRUE</boolean> 
     74            <ostype name="command">wnd </ostype> 
     75          </object> 
     76          <object class="IBCarbonMenuItem" id="205"> 
     77            <boolean name="separator">TRUE</boolean> 
     78            <boolean name="updateSingleItem">TRUE</boolean> 
     79          </object> 
     80          <object class="IBCarbonMenuItem" id="196"> 
     81            <string name="title">Bring All to Front</string> 
     82            <string name="keyEquivalent">f</string> 
     83            <boolean name="updateSingleItem">TRUE</boolean> 
     84            <ostype name="command">bfrt</ostype> 
     85          </object> 
     86          <object class="IBCarbonMenuItem" id="193"> 
     87            <string name="title">Arrange in Front</string> 
     88            <string name="keyEquivalent">f</string> 
     89            <boolean name="updateSingleItem">TRUE</boolean> 
     90            <int name="keyEquivalentModifier">1572864</int> 
     91            <ostype name="command">frnt</ostype> 
     92          </object> 
     93        </array> 
     94      </object> 
     95    </object> 
     96    <reference idRef="208"/> 
     97    <object class="IBCarbonMenuItem" id="338"> 
     98      <string name="title">Open Recent</string> 
     99      <boolean name="disabled">TRUE</boolean> 
     100      <boolean name="notPreviousAlternate">TRUE</boolean> 
     101      <object name="submenu" class="IBCarbonMenu" id="339"> 
     102        <string name="title">Open Recent</string> 
     103        <int name="menuID">109</int> 
     104      </object> 
     105    </object> 
     106    <object class="IBCarbonTextView" id="345"> 
     107      <ostype name="controlSignature">DLOG</ostype> 
     108      <int name="controlID">4</int> 
     109      <int name="fontStyle">7</int> 
     110      <object name="layoutInfo" class="IBCarbonHILayoutInfo"> 
     111        <int name="bindingTopKind">1</int> 
     112        <int name="bindingLeftKind">1</int> 
     113        <int name="bindingBottomKind">2</int> 
     114        <int name="bindingRightKind">2</int> 
     115      </object> 
     116      <boolean name="noSelection">TRUE</boolean> 
     117      <boolean name="outputInUnicode">TRUE</boolean> 
     118      <boolean name="noDragProcs">TRUE</boolean> 
     119      <boolean name="noCaretWhenInactive">TRUE</boolean> 
     120      <boolean name="noSelectionWhenInactive">TRUE</boolean> 
     121      <boolean name="disableDragAndDrop">TRUE</boolean> 
     122      <boolean name="fontSubstitution">TRUE</boolean> 
     123      <string name="viewFrame">0 0 403 190 </string> 
     124      <string name="bounds">170 20 360 423 </string> 
     125    </object> 
     126    <reference idRef="339"/> 
    8127    <object class="IBCarbonMenu" id="29"> 
    9128      <string name="title">main</string> 
     129      <string name="name">_NSMainMenu</string> 
    10130      <array count="6" name="items"> 
    11131        <object class="IBCarbonMenuItem" id="185"> 
     132          <string name="title">Angband</string> 
    12133          <boolean name="updateSingleItem">TRUE</boolean> 
    13           <string name="title">Angband</string> 
    14134          <object name="submenu" class="IBCarbonMenu" id="184"> 
    15135            <string name="title">Angband</string> 
    16136            <int name="menuID">100</int> 
     137            <string name="name">_NSAppleMenu</string> 
    17138            <array count="1" name="items"> 
    18139              <object class="IBCarbonMenuItem" id="187"> 
     
    22143              </object> 
    23144            </array> 
    24             <string name="name">_NSAppleMenu</string> 
    25145          </object> 
    26146        </object> 
    27147        <object class="IBCarbonMenuItem" id="127"> 
     148          <string name="title">File</string> 
    28149          <boolean name="updateSingleItem">TRUE</boolean> 
    29           <string name="title">File</string> 
    30150          <object name="submenu" class="IBCarbonMenu" id="131"> 
    31151            <string name="title">File</string> 
    32152            <int name="menuID">101</int> 
    33             <array count="9" name="items"> 
     153            <array count="10" name="items"> 
    34154              <object class="IBCarbonMenuItem" id="139"> 
    35                 <boolean name="updateSingleItem">TRUE</boolean> 
    36155                <string name="title">New</string> 
    37156                <string name="keyEquivalent">n</string> 
     157                <boolean name="updateSingleItem">TRUE</boolean> 
    38158                <ostype name="command">open</ostype> 
    39159              </object> 
    40160              <object class="IBCarbonMenuItem" id="134"> 
    41                 <boolean name="updateSingleItem">TRUE</boolean> 
    42161                <string name="title">Open
</string> 
    43162                <string name="keyEquivalent">o</string> 
     163                <boolean name="updateSingleItem">TRUE</boolean> 
    44164                <ostype name="command">open</ostype> 
    45165              </object> 
     166              <reference idRef="338"/> 
    46167              <object class="IBCarbonMenuItem" id="200"> 
    47                 <boolean name="updateSingleItem">TRUE</boolean> 
    48168                <string name="title">Import...</string> 
    49169                <string name="keyEquivalent">i</string> 
     170                <boolean name="updateSingleItem">TRUE</boolean> 
    50171                <ostype name="command">open</ostype> 
    51172              </object> 
     
    54175              </object> 
    55176              <object class="IBCarbonMenuItem" id="138"> 
    56                 <boolean name="disabled">TRUE</boolean> 
    57177                <string name="title">Save</string> 
    58178                <string name="keyEquivalent">s</string> 
     179                <boolean name="disabled">TRUE</boolean> 
    59180                <ostype name="command">save</ostype> 
    60181              </object> 
    61182              <object class="IBCarbonMenuItem" id="245"> 
    62                 <boolean name="updateSingleItem">TRUE</boolean> 
    63183                <string name="title">Close</string> 
    64184                <string name="keyEquivalent">w</string> 
     185                <boolean name="updateSingleItem">TRUE</boolean> 
    65186                <ostype name="command">clos</ostype> 
    66187              </object> 
     
    69190              </object> 
    70191              <object class="IBCarbonMenuItem" id="135"> 
    71                 <boolean name="disabled">TRUE</boolean> 
    72192                <string name="title">Page Setup
</string> 
    73193                <string name="keyEquivalent">P</string> 
     194                <boolean name="disabled">TRUE</boolean> 
    74195                <ostype name="command">page</ostype> 
    75196              </object> 
    76197              <object class="IBCarbonMenuItem" id="136"> 
    77                 <boolean name="disabled">TRUE</boolean> 
    78198                <string name="title">Print
</string> 
    79199                <string name="keyEquivalent">p</string> 
     200                <boolean name="disabled">TRUE</boolean> 
    80201                <ostype name="command">prnt</ostype> 
    81202              </object> 
     
    84205        </object> 
    85206        <object class="IBCarbonMenuItem" id="152"> 
     207          <string name="title">Edit</string> 
    86208          <boolean name="updateSingleItem">TRUE</boolean> 
    87           <string name="title">Edit</string> 
    88209          <object name="submenu" class="IBCarbonMenu" id="147"> 
    89210            <string name="title">Edit</string> 
     
    91212            <array count="3" name="items"> 
    92213              <object class="IBCarbonMenuItem" id="149"> 
    93                 <boolean name="disabled">TRUE</boolean> 
    94214                <string name="title">Copy</string> 
    95215                <string name="keyEquivalent">c</string> 
     216                <boolean name="disabled">TRUE</boolean> 
    96217                <ostype name="command">copy</ostype> 
    97218              </object> 
    98219              <object class="IBCarbonMenuItem" id="148"> 
    99                 <boolean name="disabled">TRUE</boolean> 
    100                 <boolean name="updateSingleItem">TRUE</boolean> 
    101220                <string name="title">Select All</string> 
    102221                <string name="keyEquivalent">a</string> 
     222                <boolean name="disabled">TRUE</boolean> 
     223                <boolean name="updateSingleItem">TRUE</boolean> 
    103224                <ostype name="command">sall</ostype> 
    104225              </object> 
    105226              <object class="IBCarbonMenuItem" id="316"> 
    106                 <boolean name="updateSingleItem">TRUE</boolean> 
    107227                <string name="title">Undo</string> 
    108228                <string name="keyEquivalent">z</string> 
     229                <boolean name="updateSingleItem">TRUE</boolean> 
    109230                <ostype name="command">undo</ostype> 
    110231              </object> 
     
    113234        </object> 
    114235        <object class="IBCarbonMenuItem" id="217"> 
     236          <string name="title">Appearance</string> 
    115237          <boolean name="autoDisable">TRUE</boolean> 
    116238          <boolean name="updateSingleItem">TRUE</boolean> 
    117           <string name="title">Appearance</string> 
    118239          <object name="submenu" class="IBCarbonMenu" id="215"> 
    119240            <string name="title">Appearance</string> 
    120241            <int name="menuID">103</int> 
     242            <boolean name="autoDisable">TRUE</boolean> 
    121243            <array count="13" name="items"> 
    122244              <object class="IBCarbonMenuItem" id="297"> 
    123                 <boolean name="updateSingleItem">TRUE</boolean> 
    124245                <string name="title">Show Fonts</string> 
    125246                <string name="keyEquivalent">t</string> 
     247                <boolean name="updateSingleItem">TRUE</boolean> 
    126248                <ostype name="command">font</ostype> 
    127249              </object> 
    128250              <object class="IBCarbonMenuItem" id="317"> 
    129                 <boolean name="updateSingleItem">TRUE</boolean> 
    130251                <string name="title">Antialias</string> 
     252                <boolean name="updateSingleItem">TRUE</boolean> 
    131253              </object> 
    132254              <object class="IBCarbonMenuItem" id="305"> 
     
    135257              </object> 
    136258              <object class="IBCarbonMenuItem" id="306"> 
     259                <string name="title">ASCII Graphics</string> 
    137260                <boolean name="checked">TRUE</boolean> 
    138261                <boolean name="updateSingleItem">TRUE</boolean> 
    139                 <string name="title">ASCII Graphics</string> 
    140262                <ostype name="command">graf</ostype> 
    141263              </object> 
    142264              <object class="IBCarbonMenuItem" id="304"> 
    143                 <boolean name="disabled">TRUE</boolean> 
    144                 <boolean name="updateSingleItem">TRUE</boolean> 
    145265                <string name="title">    8x8 Tiles</string> 
     266                <boolean name="disabled">TRUE</boolean> 
     267                <boolean name="updateSingleItem">TRUE</boolean> 
    146268                <ostype name="command">graf</ostype> 
    147269&nb