From fad3cbdb500c8a42c285655e3a97d1c860fb6181 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 15 Oct 2014 21:04:21 +0200 Subject: [PATCH] Remove menu_parse_check --- frontend/menu/menu_entries.c | 30 +------ frontend/menu/menu_entries_cbs.c | 150 ++++++++++++++++++++++++++++++- 2 files changed, 149 insertions(+), 31 deletions(-) diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index 3e3dd4aa4c..5f667c8d99 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -729,27 +729,6 @@ int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list, return 0; } -static int menu_parse_check(const char *label, unsigned menu_type) -{ -#if 0 - RARCH_LOG("label is menu_parse_check: %s\n", label); -#endif - if ( - menu_type == MENU_FILE_CATEGORY || - !strcmp(label, "Main Menu") || - !strcmp(label, "settings") || - !strcmp(label, "performance_counters") || - !strcmp(label, "core_counters") || - !strcmp(label, "frontend_counters") || - !strcmp(label, "Input Options") || - !strcmp(label, "Shader Options") || - !strcmp(label, "video_shader_preset_parameters") || - !strcmp(label, "video_shader_parameters") - ) - return -1; - return 0; -} - int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list) { unsigned type = 0; @@ -760,13 +739,8 @@ int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list) file_list_get_last(menu_list, &path, &label, &type); - if (((menu_parse_check(label, type)) == -1)) - { - if (strcmp(label, "history_list") != 0) - return push_list(driver.menu, list, path, label, type); - } - - RARCH_LOG("label is: %s\n", label); + if (!strcmp(label, "Main Menu")) + return push_list(driver.menu, list, path, label, type); cbs = (menu_file_list_cbs_t*) file_list_get_last_actiondata(menu_list); diff --git a/frontend/menu/menu_entries_cbs.c b/frontend/menu/menu_entries_cbs.c index 717420fff7..8a72287a47 100644 --- a/frontend/menu/menu_entries_cbs.c +++ b/frontend/menu/menu_entries_cbs.c @@ -1338,6 +1338,132 @@ static int deferred_push_core_information(void *data, void *userdata, return 0; } +static int deferred_push_performance_counters(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + +static int deferred_push_video_shader_preset_parameters(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + +static int deferred_push_video_shader_parameters(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + +static int deferred_push_settings(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + +static int deferred_push_category(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + +static int deferred_push_input_options(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + +static int deferred_push_shader_options(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + +static int deferred_push_core_counters(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + +static int deferred_push_frontend_counters(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + file_list_t *list = (file_list_t*)data; + file_list_t *menu_list = (file_list_t*)userdata; + + if (!list || !menu_list) + return -1; + + return push_list(driver.menu, list, path, label, type); + + return 0; +} + static int deferred_push_core_options(void *data, void *userdata, const char *path, const char *label, unsigned type) { @@ -1814,18 +1940,36 @@ static void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs, cbs->action_deferred_push = deferred_push_default; - if (!strcmp(label, "deferred_core_list")) + if (!strcmp(label, "history_list")) + cbs->action_deferred_push = deferred_push_history_list; + else if (type == MENU_FILE_CATEGORY) + cbs->action_deferred_push = deferred_push_category; + else if (!strcmp(label, "deferred_core_list")) cbs->action_deferred_push = deferred_push_core_list_deferred; + else if (!strcmp(label, "Input Options")) + cbs->action_deferred_push = deferred_push_input_options; + else if (!strcmp(label, "Shader Options")) + cbs->action_deferred_push = deferred_push_shader_options; else if (!strcmp(label, "core_information")) cbs->action_deferred_push = deferred_push_core_information; + else if (!strcmp(label, "performance_counters")) + cbs->action_deferred_push = deferred_push_performance_counters; + else if (!strcmp(label, "core_counters")) + cbs->action_deferred_push = deferred_push_core_counters; + else if (!strcmp(label, "video_shader_preset_parameters")) + cbs->action_deferred_push = deferred_push_video_shader_preset_parameters; + else if (!strcmp(label, "video_shader_parameters")) + cbs->action_deferred_push = deferred_push_video_shader_parameters; + else if (!strcmp(label, "settings")) + cbs->action_deferred_push = deferred_push_settings; + else if (!strcmp(label, "frontend_counters")) + cbs->action_deferred_push = deferred_push_frontend_counters; else if (!strcmp(label, "core_options")) cbs->action_deferred_push = deferred_push_core_options; else if (!strcmp(label, "disk_options")) cbs->action_deferred_push = deferred_push_disk_options; else if (!strcmp(label, "core_list")) cbs->action_deferred_push = deferred_push_core_list; - else if (!strcmp(label, "history_list")) - cbs->action_deferred_push = deferred_push_history_list; else if (!strcmp(label, "configurations")) cbs->action_deferred_push = deferred_push_configurations; else if (!strcmp(label, "video_shader_preset"))