--- hatari/src/gui-osx/Shared.h 2019/04/01 07:13:04 1.1 +++ hatari/src/gui-osx/Shared.h 2019/04/09 08:54:09 1.1.1.7 @@ -1,14 +1,30 @@ /* - Hatari - CreateFloppyController.m + Hatari - Shared.h - This file is distributed under the GNU Public License, version 2 or at - your option any later version. Read the file gpl.txt for details. + This file is distributed under the GNU General Public License, version 2 + or at your option any later version. Read the file gpl.txt for details. + M. SARO 2013 */ #import +// add some macro for easy writing + +#define localize(laklef) [[NSBundle mainBundle] localizedStringForKey:laklef value:(laklef != nil ? laklef : @"???") table:@"Localizable"] + +// disk extensions alowed in open box +#define allF @"st",@"msa",@"dim",@"gz",@"zip",@"stx",@"ipf",@"raw",@"ctr" +// cartdridge extensions +#define allC @"img",@"rom",@"bin",@"cart" +// TOS extensions +#define allT @"img",@"rom",@"bin" + + + // Wrapper to run an NSWindow modally -@interface ModalWrapper : NSObject +@protocol NSWindowDelegate; + +@interface ModalWrapper : NSWindowController { IBOutlet NSWindow *modalWindow; } @@ -20,7 +36,27 @@ void GuiOsx_ExportPathString(NSString* path, char* szTarget, size_t cchTarget); // Pauses emulation and gets ready to use Cocoa UI -void GuiOsx_PauseAndSwitchToCocoaUI(); +void GuiOsx_Pause(void); // Switches back to emulation mode and resume emulation -void GuiOsx_ResumeFromCocoaUI(); \ No newline at end of file +void GuiOsx_Resume(void); + + +// Add method for general Usage +// +@interface NSApplication (service) + +// Some usefull tools +// choose file to open +- (NSString *)hopenfile:(BOOL)chooseDir defoDir:(NSString *)defoDir defoFile:(NSString *)defoFile types:(NSArray *)types ; +- (NSString *)hopenfile:(BOOL)chooseDir defoDir:(NSString *)defoDir defoFile:(NSString *)defoFile types:(NSArray *)types titre:(NSString *)titre ; + +// choose file to save +- (NSString *)hsavefile:(BOOL)creatDir defoDir:(NSString *)defoDir defoFile:(NSString *)defoFile types:(NSArray *)types ; +- (NSString *)hsavefile:(BOOL)creatDir defoDir:(NSString *)defoDir defoFile:(NSString *)defoFile types:(NSArray *)types titre:(NSString *)titre ; + +// Return localized path, Full path or partial path. +- (NSString *)localpath:(NSString *)thepath ; // Full +- (NSString *)pathUser:(NSString *)thepath ; // Partial if possible. + +@end