diff --git a/ui/drivers/cocoa/cocoa_common.h b/ui/drivers/cocoa/cocoa_common.h index 0e16697b67..ceee24fc97 100644 --- a/ui/drivers/cocoa/cocoa_common.h +++ b/ui/drivers/cocoa/cocoa_common.h @@ -34,10 +34,7 @@ #include #import -@protocol RAMenuItemBase -- (UITableViewCell*)cellForTableView:(UITableView*)tableView; -- (void)wasSelectedOnTableView:(UITableView*)tableView ofController:(UIViewController*)controller; -@end + /*********************************************/ /* RAMenuBase */ @@ -53,100 +50,6 @@ @end -/*********************************************/ -/* RAMenuItemBasic */ -/* A simple menu item that displays a text */ -/* description and calls a block object when */ -/* selected. */ -/*********************************************/ -@interface RAMenuItemBasic : NSObject -@property (nonatomic) NSString* description; -@property (nonatomic) id userdata; -@property (copy) void (^action)(id userdata); -@property (copy) NSString* (^detail)(id userdata); - -+ (RAMenuItemBasic*)itemWithDescription:(NSString*)description action:(void (^)())action; -+ (RAMenuItemBasic*)itemWithDescription:(NSString*)description action:(void (^)())action detail:(NSString* (^)())detail; -+ (RAMenuItemBasic*)itemWithDescription:(NSString*)description association:(id)userdata action:(void (^)())action detail:(NSString* (^)())detail; - -@end - -/*********************************************/ -/* RAMenuItemGeneralSetting */ -/* A simple menu item that displays the */ -/* state, and allows editing, of a string or */ -/* numeric setting. */ -/*********************************************/ -@interface RAMenuItemGeneralSetting : NSObject -@property (nonatomic) rarch_setting_t* setting; -@property (copy) void (^action)(); -@property (nonatomic, weak) UITableView* parentTable; -+ (id)itemForSetting:(rarch_setting_t*)setting action:(void (^)())action; -- (id)initWithSetting:(rarch_setting_t*)setting action:(void (^)())action; -@end - -/*********************************************/ -/* RAMenuItemBooleanSetting */ -/* A simple menu item that displays the */ -/* state, and allows editing, of a boolean */ -/* setting. */ -/*********************************************/ -@interface RAMenuItemBooleanSetting : NSObject -@property (nonatomic) rarch_setting_t* setting; -@property (copy) void (^action)(); -- (id)initWithSetting:(rarch_setting_t*)setting action:(void (^)())action; -@end - -/*********************************************/ -/* RAMenuItemPathSetting */ -/* A menu item that displays and allows */ -/* browsing for a path setting. */ -/*********************************************/ -@interface RAMenuItemPathSetting : RAMenuItemGeneralSetting @end - -/*********************************************/ -/* RAMenuItemEnumSetting */ -/* A menu item that displays and allows */ -/* a setting to be set from a list of */ -/* allowed choices. */ -/*********************************************/ -@interface RAMenuItemEnumSetting : RAMenuItemGeneralSetting @end - -/*********************************************/ -/* RAMenuItemBindSetting */ -/* A menu item that displays and allows */ -/* mapping of a keybinding. */ -/*********************************************/ -@interface RAMenuItemBindSetting : RAMenuItemGeneralSetting @end - -/*********************************************/ -/* RAMainMenu */ -/* Menu object that is displayed immediately */ -/* after startup. */ -/*********************************************/ -@interface RAMainMenu : RAMenuBase -@property (nonatomic) NSString* core; -@end - -@interface RADirectoryItem : NSObject -@property (nonatomic) NSString* path; -@property (nonatomic) bool isDirectory; -@end - -@interface RADirectoryList : RAMenuBase -@property (nonatomic, weak) RADirectoryItem* selectedItem; - -@property (nonatomic, copy) void (^chooseAction)(RADirectoryList* list, RADirectoryItem* item); -@property (nonatomic, copy) NSString* path; -@property (nonatomic, copy) NSString* extensions; - -@property (nonatomic) bool allowBlank; -@property (nonatomic) bool forDirectory; - -- (id)initWithPath:(NSString*)path extensions:(const char*)extensions action:(void (^)(RADirectoryList* list, RADirectoryItem* item))action; -- (void)browseTo:(NSString*)path; -@end - @interface RAFoldersList : RAMenuBase - (id) initWithFilePath:(NSString*)path; @end diff --git a/ui/drivers/cocoa/cocoatouch_menu.m b/ui/drivers/cocoa/cocoatouch_menu.m index 8afb73f1f2..a11eba022f 100644 --- a/ui/drivers/cocoa/cocoatouch_menu.m +++ b/ui/drivers/cocoa/cocoatouch_menu.m @@ -27,6 +27,105 @@ #include "../../../menu/menu_entries.h" #include "../../../menu/drivers/shared.h" +@protocol RAMenuItemBase +- (UITableViewCell*)cellForTableView:(UITableView*)tableView; +- (void)wasSelectedOnTableView:(UITableView*)tableView ofController:(UIViewController*)controller; +@end + +/*********************************************/ +/* RAMenuItemBasic */ +/* A simple menu item that displays a text */ +/* description and calls a block object when */ +/* selected. */ +/*********************************************/ +@interface RAMenuItemBasic : NSObject +@property (nonatomic) NSString* description; +@property (nonatomic) id userdata; +@property (copy) void (^action)(id userdata); +@property (copy) NSString* (^detail)(id userdata); + ++ (RAMenuItemBasic*)itemWithDescription:(NSString*)description action:(void (^)())action; ++ (RAMenuItemBasic*)itemWithDescription:(NSString*)description action:(void (^)())action detail:(NSString* (^)())detail; ++ (RAMenuItemBasic*)itemWithDescription:(NSString*)description association:(id)userdata action:(void (^)())action detail:(NSString* (^)())detail; + +@end + +/*********************************************/ +/* RAMenuItemGeneralSetting */ +/* A simple menu item that displays the */ +/* state, and allows editing, of a string or */ +/* numeric setting. */ +/*********************************************/ +@interface RAMenuItemGeneralSetting : NSObject +@property (nonatomic) rarch_setting_t* setting; +@property (copy) void (^action)(); +@property (nonatomic, weak) UITableView* parentTable; ++ (id)itemForSetting:(rarch_setting_t*)setting action:(void (^)())action; +- (id)initWithSetting:(rarch_setting_t*)setting action:(void (^)())action; +@end + +/*********************************************/ +/* RAMenuItemBooleanSetting */ +/* A simple menu item that displays the */ +/* state, and allows editing, of a boolean */ +/* setting. */ +/*********************************************/ +@interface RAMenuItemBooleanSetting : NSObject +@property (nonatomic) rarch_setting_t* setting; +@property (copy) void (^action)(); +- (id)initWithSetting:(rarch_setting_t*)setting action:(void (^)())action; +@end + +/*********************************************/ +/* RAMenuItemPathSetting */ +/* A menu item that displays and allows */ +/* browsing for a path setting. */ +/*********************************************/ +@interface RAMenuItemPathSetting : RAMenuItemGeneralSetting @end + +/*********************************************/ +/* RAMenuItemEnumSetting */ +/* A menu item that displays and allows */ +/* a setting to be set from a list of */ +/* allowed choices. */ +/*********************************************/ +@interface RAMenuItemEnumSetting : RAMenuItemGeneralSetting @end + +/*********************************************/ +/* RAMenuItemBindSetting */ +/* A menu item that displays and allows */ +/* mapping of a keybinding. */ +/*********************************************/ +@interface RAMenuItemBindSetting : RAMenuItemGeneralSetting @end + +/*********************************************/ +/* RAMainMenu */ +/* Menu object that is displayed immediately */ +/* after startup. */ +/*********************************************/ +@interface RAMainMenu : RAMenuBase +@property (nonatomic) NSString* core; +@end + +@interface RADirectoryItem : NSObject +@property (nonatomic) NSString* path; +@property (nonatomic) bool isDirectory; +@end + +@interface RADirectoryList : RAMenuBase +@property (nonatomic, weak) RADirectoryItem* selectedItem; + +@property (nonatomic, copy) void (^chooseAction)(RADirectoryList* list, RADirectoryItem* item); +@property (nonatomic, copy) NSString* path; +@property (nonatomic, copy) NSString* extensions; + +@property (nonatomic) bool allowBlank; +@property (nonatomic) bool forDirectory; + +- (id)initWithPath:(NSString*)path extensions:(const char*)extensions action:(void (^)(RADirectoryList* list, RADirectoryItem* item))action; +- (void)browseTo:(NSString*)path; +@end + @interface RANumberFormatter : NSNumberFormatter - (id)initWithSetting:(const rarch_setting_t*)setting;