(CocoaTouch) Cleanups

This commit is contained in:
Twinaphex 2015-05-07 05:26:41 +02:00
parent b95ceeb406
commit 9def9c2285

View File

@ -26,6 +26,8 @@
#include "../../../input/drivers/cocoa_input.h" #include "../../../input/drivers/cocoa_input.h"
#include "../../../menu/menu_entries.h" #include "../../../menu/menu_entries.h"
#include "../../../menu/menu_navigation.h"
#include "../../../menu/menu_list.h"
#include "../../../menu/drivers/shared.h" #include "../../../menu/drivers/shared.h"
@protocol RAMenuItemBase @protocol RAMenuItemBase
@ -728,9 +730,9 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
[everything addObject:BOXSTRING(title)]; [everything addObject:BOXSTRING(title)];
end = menu_list_get_size(menu->menu_list); end = menu_list_get_size(menu->menu_list);
for (i = menu->begin; i < end; i++) {
for (i = menu->begin; i < end; i++)
[everything addObject:[self make_menu_item_for_entry: i]]; [everything addObject:[self make_menu_item_for_entry: i]];
}
self.sections = [NSMutableArray array]; self.sections = [NSMutableArray array];
[self.sections addObject:everything]; [self.sections addObject:everything];
@ -884,9 +886,8 @@ void get_core_title(char *title_msg, size_t title_msg_len)
} }
// JM: This could be moved down to RA // JM: This could be moved down to RA
uint menu_select_entry(uint i) uint32_t menu_select_entry(uint32_t i)
{ {
menu_handle_t *menu = menu_driver_get_ptr();
rarch_setting_t *setting; rarch_setting_t *setting;
menu_file_list_cbs_t *cbs = NULL; menu_file_list_cbs_t *cbs = NULL;
const char *path = NULL, *entry_label = NULL; const char *path = NULL, *entry_label = NULL;
@ -894,25 +895,27 @@ uint menu_select_entry(uint i)
const char *dir = NULL; const char *dir = NULL;
const char *label = NULL; const char *label = NULL;
unsigned menu_type = 0; unsigned menu_type = 0;
menu_handle_t *menu = menu_driver_get_ptr();
menu_navigation_t *nav = menu_navigation_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
menu_list_get_last_stack(menu->menu_list, &dir, &label, &menu_type); menu_list_get_last_stack(menu_list, &dir, &label, &menu_type);
menu_list_get_at_offset(menu->menu_list->selection_buf, i, &path, menu_list_get_at_offset(menu_list->selection_buf, i, &path,
&entry_label, &type); &entry_label, &type);
setting = setting = setting_find_setting
(rarch_setting_t*)setting_find_setting
(menu->list_settings, (menu->list_settings,
menu->menu_list->selection_buf->list[i].label); menu_list->selection_buf->list[i].label);
cbs = (menu_file_list_cbs_t*) cbs = (menu_file_list_cbs_t*)
menu_list_get_actiondata_at_offset(menu->menu_list->selection_buf, i); menu_list_get_actiondata_at_offset(menu_list->selection_buf, i);
if (setting_is_of_path_type(setting)) if (setting_is_of_path_type(setting))
return false; return false;
else if (setting_is_of_general_type(setting)) else if (setting_is_of_general_type(setting))
{ {
menu->navigation.selection_ptr = i; nav->selection_ptr = i;
if (cbs && cbs->action_ok) if (cbs && cbs->action_ok)
cbs->action_ok(path, entry_label, type, i); cbs->action_ok(path, entry_label, type, i);
@ -920,7 +923,7 @@ uint menu_select_entry(uint i)
} }
else else
{ {
menu->navigation.selection_ptr = i; nav->selection_ptr = i;
if (cbs && cbs->action_ok) if (cbs && cbs->action_ok)
cbs->action_ok(path, entry_label, type, i); cbs->action_ok(path, entry_label, type, i);
else else
@ -929,7 +932,7 @@ uint menu_select_entry(uint i)
cbs->action_start(type, entry_label, MENU_ACTION_START); cbs->action_start(type, entry_label, MENU_ACTION_START);
if (cbs && cbs->action_toggle) if (cbs && cbs->action_toggle)
cbs->action_toggle(type, entry_label, MENU_ACTION_RIGHT, true); cbs->action_toggle(type, entry_label, MENU_ACTION_RIGHT, true);
menu_list_push_stack(menu->menu_list, "", menu_list_push_stack(menu_list, "",
"info_screen", 0, i); "info_screen", 0, i);
} }
return true; return true;
@ -939,24 +942,25 @@ uint menu_select_entry(uint i)
- (void)menuRefresh - (void)menuRefresh
{ {
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return; return;
if (!menu->need_refresh) if (!menu->need_refresh)
return; return;
menu_entries_deferred_push(menu->menu_list->selection_buf, menu_entries_deferred_push(menu_list->selection_buf,
menu->menu_list->menu_stack); menu_list->menu_stack);
menu->need_refresh = false; menu->need_refresh = false;
} }
- (void)menuBack - (void)menuBack
{ {
menu_handle_t *menu = menu_driver_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu_list)
return; return;
menu_apply_deferred_settings(); menu_apply_deferred_settings();
menu_list_pop_stack(menu->menu_list); menu_list_pop_stack(menu_list);
[self menuRefresh]; [self menuRefresh];
[self reloadData]; [self reloadData];
} }