|
|
1.1 root 1: /*
1.1.1.5 root 2: Hatari - Shared.h
1.1 root 3:
1.1.1.6 root 4: This file is distributed under the GNU General Public License, version 2
5: or at your option any later version. Read the file gpl.txt for details.
1.1.1.7 root 6: M. SARO 2013
1.1 root 7: */
8:
9: #import <Cocoa/Cocoa.h>
10:
1.1.1.7 root 11: // add some macro for easy writing
12:
13: #define localize(laklef) [[NSBundle mainBundle] localizedStringForKey:laklef value:(laklef != nil ? laklef : @"???") table:@"Localizable"]
14:
15: // disk extensions alowed in open box
16: #define allF @"st",@"msa",@"dim",@"gz",@"zip",@"stx",@"ipf",@"raw",@"ctr"
17: // cartdridge extensions
18: #define allC @"img",@"rom",@"bin",@"cart"
19: // TOS extensions
20: #define allT @"img",@"rom",@"bin"
21:
22:
23:
1.1 root 24: // Wrapper to run an NSWindow modally
1.1.1.5 root 25: @protocol NSWindowDelegate;
1.1.1.7 root 26:
1.1.1.4 root 27: @interface ModalWrapper : NSWindowController <NSWindowDelegate>
1.1 root 28: {
29: IBOutlet NSWindow *modalWindow;
30: }
31: - (void)runModal:(NSWindow*)window;
32: - (void)windowWillClose:(NSNotification*)notification;
33: @end
34:
35: // Helper function to write the contents of a path as an NSString to a string
36: void GuiOsx_ExportPathString(NSString* path, char* szTarget, size_t cchTarget);
37:
38: // Pauses emulation and gets ready to use Cocoa UI
1.1.1.3 root 39: void GuiOsx_Pause(void);
1.1 root 40:
41: // Switches back to emulation mode and resume emulation
1.1.1.3 root 42: void GuiOsx_Resume(void);
1.1.1.7 root 43:
44:
45: // Add method for general Usage
46: //
47: @interface NSApplication (service)
48:
49: // Some usefull tools
50: // choose file to open
51: - (NSString *)hopenfile:(BOOL)chooseDir defoDir:(NSString *)defoDir defoFile:(NSString *)defoFile types:(NSArray *)types ;
52: - (NSString *)hopenfile:(BOOL)chooseDir defoDir:(NSString *)defoDir defoFile:(NSString *)defoFile types:(NSArray *)types titre:(NSString *)titre ;
53:
54: // choose file to save
55: - (NSString *)hsavefile:(BOOL)creatDir defoDir:(NSString *)defoDir defoFile:(NSString *)defoFile types:(NSArray *)types ;
56: - (NSString *)hsavefile:(BOOL)creatDir defoDir:(NSString *)defoDir defoFile:(NSString *)defoFile types:(NSArray *)types titre:(NSString *)titre ;
57:
58: // Return localized path, Full path or partial path.
59: - (NSString *)localpath:(NSString *)thepath ; // Full
60: - (NSString *)pathUser:(NSString *)thepath ; // Partial if possible.
61:
1.1.1.8 ! root 62: // Alert available 10.4 to 10.9 (styles: NSWarningAlertStyle, NSInformationalAlertStyle, NSCriticalAlertStyle)
! 63: // return: NSAlertDefaultReturn, NSAlertAlternateReturn, and NSAlertOtherReturn.
! 64: - (NSInteger)myAlerte:(NSUInteger)style Txt:(NSString *)Txt firstB:(NSString *)firstB alternateB:(NSString *)alternateB
! 65: otherB:(NSString *)otherB informativeTxt:(NSString *)informativeT ;
! 66:
1.1.1.7 root 67: @end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.