Rename menu_entries_cbs_* to menu_cbs_*

This commit is contained in:
twinaphex 2015-06-12 16:01:46 +02:00
parent 015a882c2b
commit fd38003fd1
24 changed files with 266 additions and 267 deletions

View File

@ -340,23 +340,23 @@ ifeq ($(HAVE_MENU_COMMON), 1)
menu/menu_navigation.o \
menu/menu_setting.o \
menu/menu_shader.o \
menu/menu_entries.o \
menu/cbs/menu_entries_cbs_ok.o \
menu/cbs/menu_entries_cbs_cancel.o \
menu/cbs/menu_entries_cbs_select.o \
menu/cbs/menu_entries_cbs_start.o \
menu/cbs/menu_entries_cbs_info.o \
menu/cbs/menu_entries_cbs_refresh.o \
menu/cbs/menu_entries_cbs_left.o \
menu/cbs/menu_entries_cbs_right.o \
menu/cbs/menu_entries_cbs_deferred_push.o \
menu/cbs/menu_entries_cbs_scan.o \
menu/cbs/menu_entries_cbs_get_value.o \
menu/cbs/menu_entries_cbs_iterate.o \
menu/cbs/menu_entries_cbs_title.o \
menu/cbs/menu_entries_cbs_up.o \
menu/cbs/menu_entries_cbs_down.o \
menu/cbs/menu_entries_cbs_contentlist_switch.o \
menu/menu_cbs.o \
menu/cbs/menu_cbs_ok.o \
menu/cbs/menu_cbs_cancel.o \
menu/cbs/menu_cbs_select.o \
menu/cbs/menu_cbs_start.o \
menu/cbs/menu_cbs_info.o \
menu/cbs/menu_cbs_refresh.o \
menu/cbs/menu_cbs_left.o \
menu/cbs/menu_cbs_right.o \
menu/cbs/menu_cbs_deferred_push.o \
menu/cbs/menu_cbs_scan.o \
menu/cbs/menu_cbs_get_value.o \
menu/cbs/menu_cbs_iterate.o \
menu/cbs/menu_cbs_title.o \
menu/cbs/menu_cbs_up.o \
menu/cbs/menu_cbs_down.o \
menu/cbs/menu_cbs_contentlist_switch.o \
menu/menu_list.o \
menu/menu_display.o \
menu/menu_displaylist.o \

View File

@ -715,23 +715,23 @@ MENU
#include "../menu/menu_entry.c"
#include "../menu/menu_setting.c"
#include "../menu/menu_list.c"
#include "../menu/menu_entries.c"
#include "../menu/cbs/menu_entries_cbs_ok.c"
#include "../menu/cbs/menu_entries_cbs_cancel.c"
#include "../menu/cbs/menu_entries_cbs_select.c"
#include "../menu/cbs/menu_entries_cbs_start.c"
#include "../menu/cbs/menu_entries_cbs_info.c"
#include "../menu/cbs/menu_entries_cbs_refresh.c"
#include "../menu/cbs/menu_entries_cbs_left.c"
#include "../menu/cbs/menu_entries_cbs_right.c"
#include "../menu/cbs/menu_entries_cbs_title.c"
#include "../menu/cbs/menu_entries_cbs_deferred_push.c"
#include "../menu/cbs/menu_entries_cbs_scan.c"
#include "../menu/cbs/menu_entries_cbs_get_value.c"
#include "../menu/cbs/menu_entries_cbs_iterate.c"
#include "../menu/cbs/menu_entries_cbs_up.c"
#include "../menu/cbs/menu_entries_cbs_down.c"
#include "../menu/cbs/menu_entries_cbs_contentlist_switch.c"
#include "../menu/menu_cbs.c"
#include "../menu/cbs/menu_cbs_ok.c"
#include "../menu/cbs/menu_cbs_cancel.c"
#include "../menu/cbs/menu_cbs_select.c"
#include "../menu/cbs/menu_cbs_start.c"
#include "../menu/cbs/menu_cbs_info.c"
#include "../menu/cbs/menu_cbs_refresh.c"
#include "../menu/cbs/menu_cbs_left.c"
#include "../menu/cbs/menu_cbs_right.c"
#include "../menu/cbs/menu_cbs_title.c"
#include "../menu/cbs/menu_cbs_deferred_push.c"
#include "../menu/cbs/menu_cbs_scan.c"
#include "../menu/cbs/menu_cbs_get_value.c"
#include "../menu/cbs/menu_cbs_iterate.c"
#include "../menu/cbs/menu_cbs_up.c"
#include "../menu/cbs/menu_cbs_down.c"
#include "../menu/cbs/menu_cbs_contentlist_switch.c"
#include "../menu/menu_shader.c"
#include "../menu/menu_navigation.c"
#include "../menu/menu_display.c"

View File

@ -23,7 +23,7 @@ static int action_cancel_pop_default(const char *path,
return menu_entry_go_back();
}
int menu_entries_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)

View File

@ -14,9 +14,9 @@
*/
#include "../menu.h"
#include "../menu_entries.h"
#include "../menu_cbs.h"
int menu_entries_cbs_init_bind_content_list_switch(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_content_list_switch(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)

View File

@ -448,7 +448,7 @@ static int deferred_push_default(menu_displaylist_info_t *info)
return menu_displaylist_push_list(info, DISPLAYLIST_DEFAULT);
}
static int menu_entries_cbs_init_bind_deferred_push_compare_label(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_deferred_push_compare_label(menu_file_list_cbs_t *cbs,
const char *label, uint32_t label_hash)
{
if (strstr(label, "deferred_rdb_entry_detail"))
@ -608,7 +608,7 @@ static int menu_entries_cbs_init_bind_deferred_push_compare_label(menu_file_list
return 0;
}
static int menu_entries_cbs_init_bind_deferred_push_compare_type(menu_file_list_cbs_t *cbs, unsigned type,
static int menu_cbs_init_bind_deferred_push_compare_type(menu_file_list_cbs_t *cbs, unsigned type,
uint32_t label_hash)
{
if (type == MENU_SETTING_GROUP)
@ -621,7 +621,7 @@ static int menu_entries_cbs_init_bind_deferred_push_compare_type(menu_file_list_
return 0;
}
int menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)
@ -646,10 +646,10 @@ int menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
}
}
if (menu_entries_cbs_init_bind_deferred_push_compare_label(cbs, label, label_hash) == 0)
if (menu_cbs_init_bind_deferred_push_compare_label(cbs, label, label_hash) == 0)
return 0;
if (menu_entries_cbs_init_bind_deferred_push_compare_type(cbs, type, label_hash) == 0)
if (menu_cbs_init_bind_deferred_push_compare_type(cbs, type, label_hash) == 0)
return 0;
return -1;

View File

@ -15,7 +15,7 @@
#include "../menu.h"
#include "../menu_navigation.h"
#include "../menu_entries.h"
#include "../menu_cbs.h"
static int action_bind_down_generic(unsigned type, const char *label)
{
@ -35,7 +35,7 @@ static int action_bind_down_generic(unsigned type, const char *label)
return 0;
}
int menu_entries_cbs_init_bind_down(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_down(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)

View File

@ -17,7 +17,7 @@
#include <rhash.h>
#include "../menu.h"
#include "../menu_entries.h"
#include "../menu_cbs.h"
#include "../menu_shader.h"
#include "../../performance.h"
@ -789,7 +789,7 @@ static void menu_action_setting_disp_set_label(file_list_t* list,
strlcpy(s2, path, len2);
}
static int menu_entries_cbs_init_bind_get_string_representation_compare_label(
static int menu_cbs_init_bind_get_string_representation_compare_label(
menu_file_list_cbs_t *cbs, uint32_t label_hash)
{
switch (label_hash)
@ -837,7 +837,7 @@ static int menu_entries_cbs_init_bind_get_string_representation_compare_label(
return 0;
}
static int menu_entries_cbs_init_bind_get_string_representation_compare_type(
static int menu_cbs_init_bind_get_string_representation_compare_type(
menu_file_list_cbs_t *cbs, unsigned type)
{
if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
@ -961,7 +961,7 @@ static int menu_entries_cbs_init_bind_get_string_representation_compare_type(
return 0;
}
int menu_entries_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)
@ -969,10 +969,10 @@ int menu_entries_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *c
if (!cbs)
return -1;
if (menu_entries_cbs_init_bind_get_string_representation_compare_label(cbs, label_hash) == 0)
if (menu_cbs_init_bind_get_string_representation_compare_label(cbs, label_hash) == 0)
return 0;
if (menu_entries_cbs_init_bind_get_string_representation_compare_type(cbs, type) == 0)
if (menu_cbs_init_bind_get_string_representation_compare_type(cbs, type) == 0)
return 0;
return -1;

View File

@ -28,7 +28,7 @@ static int action_info_default(unsigned type, const char *label)
return menu_displaylist_push_list(&info, DISPLAYLIST_HELP);
}
int menu_entries_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)

View File

@ -586,7 +586,7 @@ static int action_iterate_main(const char *label, unsigned action)
return ret;
}
int menu_entries_cbs_init_bind_iterate(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_iterate(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)

View File

@ -343,7 +343,7 @@ static int bind_left_generic(unsigned type, const char *label,
return menu_setting_set(type, label, action, wraparound);
}
static int menu_entries_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
const char *label, uint32_t label_hash, const char *elem0)
{
unsigned i;
@ -403,7 +403,7 @@ static int menu_entries_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *c
return 0;
}
static int menu_entries_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
unsigned type, uint32_t menu_label_hash)
{
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
@ -473,7 +473,7 @@ static int menu_entries_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cb
return 0;
}
int menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1, const char *menu_label,
uint32_t label_hash, uint32_t menu_label_hash)
@ -483,10 +483,10 @@ int menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
cbs->action_left = bind_left_generic;
if (menu_entries_cbs_init_bind_left_compare_label(cbs, label, label_hash, elem0) == 0)
if (menu_cbs_init_bind_left_compare_label(cbs, label, label_hash, elem0) == 0)
return 0;
if (menu_entries_cbs_init_bind_left_compare_type(cbs, type, menu_label_hash) == 0)
if (menu_cbs_init_bind_left_compare_type(cbs, type, menu_label_hash) == 0)
return 0;
return -1;

View File

@ -1479,7 +1479,7 @@ static int is_rdb_entry(uint32_t label_hash)
return 0;
}
static int menu_entries_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
const char *label, uint32_t hash, const char *elem0)
{
rarch_setting_t *setting = menu_setting_find(label);
@ -1629,7 +1629,7 @@ static int menu_entries_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs
return 0;
}
static int menu_entries_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
uint32_t label_hash, uint32_t menu_label_hash, unsigned type)
{
if (type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD ||
@ -1789,7 +1789,7 @@ static int menu_entries_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
return 0;
}
int menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1, const char *menu_label,
uint32_t label_hash, uint32_t menu_label_hash)
@ -1799,10 +1799,10 @@ int menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
cbs->action_ok = action_ok_lookup_setting;
if (menu_entries_cbs_init_bind_ok_compare_label(cbs, label, label_hash, elem0) == 0)
if (menu_cbs_init_bind_ok_compare_label(cbs, label, label_hash, elem0) == 0)
return 0;
if (menu_entries_cbs_init_bind_ok_compare_type(cbs, label_hash, menu_label_hash, type) == 0)
if (menu_cbs_init_bind_ok_compare_type(cbs, label_hash, menu_label_hash, type) == 0)
return 0;
return -1;

View File

@ -21,7 +21,7 @@ static int action_refresh_default(file_list_t *list, file_list_t *menu_list)
return menu_displaylist_push(list, menu_list);
}
int menu_entries_cbs_init_bind_refresh(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_refresh(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)

View File

@ -346,7 +346,7 @@ static int bind_right_generic(unsigned type, const char *label,
return menu_setting_set(type, label, MENU_ACTION_RIGHT, wraparound);
}
static int menu_entries_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
unsigned type, uint32_t menu_label_hash)
{
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
@ -415,7 +415,7 @@ static int menu_entries_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *c
return 0;
}
static int menu_entries_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
const char *label, uint32_t label_hash, uint32_t menu_label_hash, const char *elem0)
{
unsigned i;
@ -475,7 +475,7 @@ static int menu_entries_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *
return 0;
}
int menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1, const char *menu_label,
uint32_t label_hash, uint32_t menu_label_hash)
@ -485,10 +485,10 @@ int menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
cbs->action_right = bind_right_generic;
if (menu_entries_cbs_init_bind_right_compare_label(cbs, label, label_hash, menu_label_hash, elem0) == 0)
if (menu_cbs_init_bind_right_compare_label(cbs, label, label_hash, menu_label_hash, elem0) == 0)
return 0;
if (menu_entries_cbs_init_bind_right_compare_type(cbs, type, menu_label_hash) == 0)
if (menu_cbs_init_bind_right_compare_type(cbs, type, menu_label_hash) == 0)
return 0;
return -1;

View File

@ -58,7 +58,7 @@ static int action_scan_directory(const char *path,
return 0;
}
static int menu_entries_cbs_init_bind_scan_compare_type(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_scan_compare_type(menu_file_list_cbs_t *cbs,
unsigned type)
{
switch (type)
@ -77,7 +77,7 @@ static int menu_entries_cbs_init_bind_scan_compare_type(menu_file_list_cbs_t *cb
return 0;
}
int menu_entries_cbs_init_bind_scan(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_scan(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)
@ -87,7 +87,7 @@ int menu_entries_cbs_init_bind_scan(menu_file_list_cbs_t *cbs,
cbs->action_scan = NULL;
menu_entries_cbs_init_bind_scan_compare_type(cbs, type);
menu_cbs_init_bind_scan_compare_type(cbs, type);
return -1;
}

View File

@ -15,7 +15,7 @@
#include "../menu.h"
#include "../menu_entry.h"
#include "../menu_entries.h"
#include "../menu_cbs.h"
#include "../menu_setting.h"
#include "../../runloop_data.h"
@ -75,7 +75,7 @@ static int action_select_input_desc(const char *path, const char *label, unsigne
return action_right_input_desc(type, label, true);
}
static int menu_entries_cbs_init_bind_select_compare_type(
static int menu_cbs_init_bind_select_compare_type(
menu_file_list_cbs_t *cbs, unsigned type)
{
if (type >= MENU_SETTINGS_CHEAT_BEGIN
@ -103,7 +103,7 @@ static int menu_entries_cbs_init_bind_select_compare_type(
return 0;
}
int menu_entries_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)
@ -113,7 +113,7 @@ int menu_entries_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
cbs->action_select = action_select_default;
if (menu_entries_cbs_init_bind_select_compare_type(cbs, type) == 0)
if (menu_cbs_init_bind_select_compare_type(cbs, type) == 0)
return 0;
return -1;

View File

@ -14,7 +14,7 @@
*/
#include "../menu.h"
#include "../menu_entries.h"
#include "../menu_cbs.h"
#include "../menu_setting.h"
#include "../menu_shader.h"
@ -264,7 +264,7 @@ static int action_start_lookup_setting(unsigned type, const char *label)
return ret;
}
int menu_entries_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs,
uint32_t hash)
{
switch (hash)
@ -297,7 +297,7 @@ int menu_entries_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs,
return 0;
}
static int menu_entries_cbs_init_bind_start_compare_type(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_start_compare_type(menu_file_list_cbs_t *cbs,
unsigned type)
{
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
@ -323,7 +323,7 @@ static int menu_entries_cbs_init_bind_start_compare_type(menu_file_list_cbs_t *c
return 0;
}
int menu_entries_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)
@ -333,10 +333,10 @@ int menu_entries_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
cbs->action_start = action_start_lookup_setting;
if (menu_entries_cbs_init_bind_start_compare_label(cbs, label_hash) == 0)
if (menu_cbs_init_bind_start_compare_label(cbs, label_hash) == 0)
return 0;
if (menu_entries_cbs_init_bind_start_compare_type(cbs, type) == 0)
if (menu_cbs_init_bind_start_compare_type(cbs, type) == 0)
return 0;
return -1;

View File

@ -505,7 +505,7 @@ static int action_get_title_input_settings(const char *path, const char *label,
return 0;
}
static int menu_entries_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
const char *label, uint32_t label_hash, const char *elem1)
{
rarch_setting_t *setting = menu_setting_find(label);
@ -720,7 +720,7 @@ static int menu_entries_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *
return 0;
}
static int menu_entries_cbs_init_bind_title_compare_type(menu_file_list_cbs_t *cbs,
static int menu_cbs_init_bind_title_compare_type(menu_file_list_cbs_t *cbs,
unsigned type)
{
switch (type)
@ -742,7 +742,7 @@ static int menu_entries_cbs_init_bind_title_compare_type(menu_file_list_cbs_t *c
return 0;
}
int menu_entries_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)
@ -752,10 +752,10 @@ int menu_entries_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
cbs->action_get_title = action_get_title_default;
if (menu_entries_cbs_init_bind_title_compare_label(cbs, label, label_hash, elem1) == 0)
if (menu_cbs_init_bind_title_compare_label(cbs, label, label_hash, elem1) == 0)
return 0;
if (menu_entries_cbs_init_bind_title_compare_type(cbs, type) == 0)
if (menu_cbs_init_bind_title_compare_type(cbs, type) == 0)
return 0;
return -1;

View File

@ -34,7 +34,7 @@ static int action_bind_up_generic(unsigned type, const char *label)
return 0;
}
int menu_entries_cbs_init_bind_up(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_up(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)

View File

@ -19,7 +19,7 @@
#include "../menu_setting.h"
#include "../menu_display.h"
#include "../menu_entries.h"
#include "../menu_cbs.h"
#ifdef HAVE_OPENGL
#include "../../gfx/drivers/gl_common.h"

View File

@ -31,7 +31,7 @@
#include "../menu_animation.h"
#include "../menu_display.h"
#include "../menu_entries.h"
#include "../menu_cbs.h"
#include "../../file_ext.h"
#include "../../gfx/video_texture.h"

156
menu/menu_cbs.c Normal file
View File

@ -0,0 +1,156 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2015 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <rhash.h>
#include "menu.h"
#include "menu_cbs.h"
#if 0
#define DEBUG_LOG
#endif
static void menu_cbs_init_log(int ret,
const char *bind_label, const char *label, const char *elem0, const char *elem1,
unsigned type)
{
switch (ret)
{
case 0:
#ifdef DEBUG_LOG
RARCH_WARN("Found %s bind (label: [%s], elem0: [%s], elem1: [%s], type: [%d]).\n",
bind_label, label, elem0, elem1, type);
#endif
break;
default:
#ifdef DEBUG_LOG
RARCH_WARN("Could not find %s bind (label: [%s], elem0: [%s], elem1: [%s], type: [%d]).\n",
bind_label, label, elem0, elem1, type);
#endif
break;
}
}
void menu_cbs_init(void *data,
const char *path, const char *label,
unsigned type, size_t idx)
{
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
int ret = 0;
struct string_list *str_list = NULL;
const char *menu_label = NULL;
menu_file_list_cbs_t *cbs = NULL;
file_list_t *list = (file_list_t*)data;
menu_handle_t *menu = menu_driver_get_ptr();
uint32_t label_hash = 0, menu_label_hash = 0;
if (!menu)
return;
if (!list)
return;
cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset(list, idx);
if (!cbs)
return;
menu_list_get_last_stack(menu->menu_list,
NULL, &menu_label, NULL, NULL);
if (label)
str_list = string_split(label, "|");
if (str_list && str_list->size > 0)
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
else elem0[0]='\0';
if (str_list && str_list->size > 1)
strlcpy(elem1, str_list->elems[1].data, sizeof(elem1));
else elem1[0]='\0';
if (str_list)
{
string_list_free(str_list);
str_list = NULL;
}
label_hash = djb2_calculate(label);
menu_label_hash = djb2_calculate(menu_label);
ret = menu_cbs_init_bind_ok(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "OK", label, elem0, elem1, type);
ret = menu_cbs_init_bind_cancel(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "CANCEL", label, elem0, elem1, type);
ret = menu_cbs_init_bind_scan(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "SCAN", label, elem0, elem1, type);
ret = menu_cbs_init_bind_start(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "START", label, elem0, elem1, type);
ret = menu_cbs_init_bind_select(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "SELECT", label, elem0, elem1, type);
ret = menu_cbs_init_bind_info(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "INFO", label, elem0, elem1, type);
ret = menu_cbs_init_bind_content_list_switch(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "CONTENT SWITCH", label, elem0, elem1, type);
ret = menu_cbs_init_bind_up(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "UP", label, elem0, elem1, type);
ret = menu_cbs_init_bind_down(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "DOWN", label, elem0, elem1, type);
ret = menu_cbs_init_bind_left(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "LEFT", label, elem0, elem1, type);
ret = menu_cbs_init_bind_right(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "RIGHT", label, elem0, elem1, type);
ret = menu_cbs_init_bind_deferred_push(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "DEFERRED PUSH", label, elem0, elem1, type);
ret = menu_cbs_init_bind_refresh(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "REFRESH", label, elem0, elem1, type);
ret = menu_cbs_init_bind_iterate(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "ITERATE", label, elem0, elem1, type);
ret = menu_cbs_init_bind_get_string_representation(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "REPRESENTATION", label, elem0, elem1, type);
ret = menu_cbs_init_bind_title(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_cbs_init_log(ret, "TITLE", label, elem0, elem1, type);
ret = menu_driver_bind_init(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
}

View File

@ -13,8 +13,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MENU_ENTRIES_CBS_H__
#define MENU_ENTRIES_CBS_H__
#ifndef MENU_CBS_H__
#define MENU_CBS_H__
#include <stdlib.h>
#include <boolean.h>
@ -43,82 +43,82 @@ int action_right_cheat(unsigned type, const char *label,
bool wraparound);
/* End of function callbacks */
int menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1, const char *menu_label,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1, const char *menu_label,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_refresh(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_refresh(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_up(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_up(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_down(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_down(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_content_list_switch(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_content_list_switch(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1, const char *menu_label,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_iterate(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_iterate(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_scan(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_scan(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
int menu_entries_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
@ -126,7 +126,7 @@ int menu_entries_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
int deferred_push_content_list(void *data, void *userdata,
const char *path, const char *label, unsigned type);
void menu_entries_init(void *data,
void menu_cbs_init(void *data,
const char *path, const char *label,
unsigned type, size_t idx);

View File

@ -19,7 +19,7 @@
#include "menu_driver.h"
#include "menu.h"
#include "menu_entries.h"
#include "menu_cbs.h"
#include "menu_displaylist.h"
#include "../driver.h"
#include "../general.h"
@ -241,8 +241,7 @@ void menu_driver_list_insert(file_list_t *list, const char *path,
}
file_list_set_actiondata(list, idx, cbs);
menu_entries_init(list, path, label, type, idx);
menu_cbs_init(list, path, label, type, idx);
}
void menu_driver_list_cache(menu_list_type_t type, unsigned action)

View File

@ -1,156 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2015 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <rhash.h>
#include "menu.h"
#include "menu_entries.h"
#if 0
#define DEBUG_LOG
#endif
static void menu_entries_init_log(int ret,
const char *bind_label, const char *label, const char *elem0, const char *elem1,
unsigned type)
{
switch (ret)
{
case 0:
#ifdef DEBUG_LOG
RARCH_WARN("Found %s bind (label: [%s], elem0: [%s], elem1: [%s], type: [%d]).\n",
bind_label, label, elem0, elem1, type);
#endif
break;
default:
#ifdef DEBUG_LOG
RARCH_WARN("Could not find %s bind (label: [%s], elem0: [%s], elem1: [%s], type: [%d]).\n",
bind_label, label, elem0, elem1, type);
#endif
break;
}
}
void menu_entries_init(void *data,
const char *path, const char *label,
unsigned type, size_t idx)
{
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
int ret = 0;
struct string_list *str_list = NULL;
const char *menu_label = NULL;
menu_file_list_cbs_t *cbs = NULL;
file_list_t *list = (file_list_t*)data;
menu_handle_t *menu = menu_driver_get_ptr();
uint32_t label_hash = 0, menu_label_hash = 0;
if (!menu)
return;
if (!list)
return;
cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset(list, idx);
if (!cbs)
return;
menu_list_get_last_stack(menu->menu_list,
NULL, &menu_label, NULL, NULL);
if (label)
str_list = string_split(label, "|");
if (str_list && str_list->size > 0)
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
else elem0[0]='\0';
if (str_list && str_list->size > 1)
strlcpy(elem1, str_list->elems[1].data, sizeof(elem1));
else elem1[0]='\0';
if (str_list)
{
string_list_free(str_list);
str_list = NULL;
}
label_hash = djb2_calculate(label);
menu_label_hash = djb2_calculate(menu_label);
ret = menu_entries_cbs_init_bind_ok(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
menu_entries_init_log(ret, "OK", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_cancel(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "CANCEL", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_scan(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "SCAN", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_start(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "START", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_select(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "SELECT", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_info(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "INFO", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_content_list_switch(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "CONTENT SWITCH", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_up(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "UP", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_down(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "DOWN", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_left(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
menu_entries_init_log(ret, "LEFT", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_right(cbs, path, label, type, idx, elem0, elem1, menu_label, label_hash, menu_label_hash);
menu_entries_init_log(ret, "RIGHT", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_deferred_push(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "DEFERRED PUSH", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_refresh(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "REFRESH", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_iterate(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "ITERATE", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_get_string_representation(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "REPRESENTATION", label, elem0, elem1, type);
ret = menu_entries_cbs_init_bind_title(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
menu_entries_init_log(ret, "TITLE", label, elem0, elem1, type);
ret = menu_driver_bind_init(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
}