(Menu) remove ident

This commit is contained in:
twinaphex 2020-03-28 01:59:15 +01:00
parent 66eed86ccf
commit 4fd3cac319
19 changed files with 25 additions and 129 deletions

View File

@ -25,9 +25,7 @@
#include "../widgets/menu_filebrowser.h" #include "../widgets/menu_filebrowser.h"
#ifndef BIND_ACTION_CANCEL #ifndef BIND_ACTION_CANCEL
#define BIND_ACTION_CANCEL(cbs, name) \ #define BIND_ACTION_CANCEL(cbs, name) (cbs)->action_cancel = (name)
cbs->action_cancel = name; \
cbs->action_cancel_ident = #name;
#endif #endif
/* Clicks the back button */ /* Clicks the back button */

View File

@ -17,9 +17,7 @@
#include "../menu_cbs.h" #include "../menu_cbs.h"
#ifndef BIND_ACTION_CONTENT_LIST_SWITCH #ifndef BIND_ACTION_CONTENT_LIST_SWITCH
#define BIND_ACTION_CONTENT_LIST_SWITCH(cbs, name) \ #define BIND_ACTION_CONTENT_LIST_SWITCH(cbs, name) (cbs)->action_content_list_switch = (name)
cbs->action_content_list_switch = name; \
cbs->action_content_list_switch_ident = #name;
#endif #endif
static int deferred_push_content_list(void *data, void *userdata, static int deferred_push_content_list(void *data, void *userdata,

View File

@ -36,9 +36,7 @@
#include "../../verbosity.h" #include "../../verbosity.h"
#ifndef BIND_ACTION_DEFERRED_PUSH #ifndef BIND_ACTION_DEFERRED_PUSH
#define BIND_ACTION_DEFERRED_PUSH(cbs, name) \ #define BIND_ACTION_DEFERRED_PUSH(cbs, name) (cbs)->action_deferred_push = (name)
cbs->action_deferred_push = name; \
cbs->action_deferred_push_ident = #name;
#endif #endif
enum enum

View File

@ -17,9 +17,7 @@
#include "../menu_cbs.h" #include "../menu_cbs.h"
#ifndef BIND_ACTION_DOWN #ifndef BIND_ACTION_DOWN
#define BIND_ACTION_DOWN(cbs, name) \ #define BIND_ACTION_DOWN(cbs, name) (cbs)->action_down = (name)
cbs->action_down = name; \
cbs->action_down_ident = #name;
#endif #endif
static int action_bind_down_generic(unsigned type, const char *label) static int action_bind_down_generic(unsigned type, const char *label)

View File

@ -53,9 +53,7 @@
#endif #endif
#ifndef BIND_ACTION_GET_VALUE #ifndef BIND_ACTION_GET_VALUE
#define BIND_ACTION_GET_VALUE(cbs, name) \ #define BIND_ACTION_GET_VALUE(cbs, name) (cbs)->action_get_value = (name)
cbs->action_get_value = name; \
cbs->action_get_value_ident = #name;
#endif #endif
extern struct key_desc key_descriptors[RARCH_MAX_KEYS]; extern struct key_desc key_descriptors[RARCH_MAX_KEYS];

View File

@ -22,16 +22,14 @@
#include "../../configuration.h" #include "../../configuration.h"
#ifndef BIND_ACTION_INFO
#define BIND_ACTION_INFO(cbs, name) \
cbs->action_info = name; \
cbs->action_info_ident = #name;
#endif
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
#include "../../network/netplay/netplay_discovery.h" #include "../../network/netplay/netplay_discovery.h"
#endif #endif
#ifndef BIND_ACTION_INFO
#define BIND_ACTION_INFO(cbs, name) (cbs)->action_info = (name)
#endif
static int action_info_default(unsigned type, const char *label) static int action_info_default(unsigned type, const char *label)
{ {
menu_displaylist_info_t info; menu_displaylist_info_t info;

View File

@ -23,9 +23,7 @@
#include "../../managers/cheat_manager.h" #include "../../managers/cheat_manager.h"
#ifndef BIND_ACTION_LABEL #ifndef BIND_ACTION_LABEL
#define BIND_ACTION_LABEL(cbs, name) \ #define BIND_ACTION_LABEL(cbs, name) (cbs)->action_label = (name)
cbs->action_label = name; \
cbs->action_label_ident = #name;
#endif #endif
static int action_bind_label_generic( static int action_bind_label_generic(

View File

@ -44,11 +44,7 @@
#include "../../manual_content_scan.h" #include "../../manual_content_scan.h"
#ifndef BIND_ACTION_LEFT #ifndef BIND_ACTION_LEFT
#define BIND_ACTION_LEFT(cbs, name) \ #define BIND_ACTION_LEFT(cbs, name) (cbs)->action_left = (name)
do { \
cbs->action_left = name; \
cbs->action_left_ident = #name; \
} while(0)
#endif #endif
extern struct key_desc key_descriptors[RARCH_MAX_KEYS]; extern struct key_desc key_descriptors[RARCH_MAX_KEYS];

View File

@ -130,11 +130,7 @@ enum
}; };
#ifndef BIND_ACTION_OK #ifndef BIND_ACTION_OK
#define BIND_ACTION_OK(cbs, name) \ #define BIND_ACTION_OK(cbs, name) (cbs)->action_ok = (name)
do { \
cbs->action_ok = name; \
cbs->action_ok_ident = #name; \
} while(0)
#endif #endif
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING

View File

@ -17,9 +17,7 @@
#include "../menu_cbs.h" #include "../menu_cbs.h"
#ifndef BIND_ACTION_REFRESH #ifndef BIND_ACTION_REFRESH
#define BIND_ACTION_REFRESH(cbs, name) \ #define BIND_ACTION_REFRESH(cbs, name) (cbs)->action_refresh = (name)
cbs->action_refresh = name; \
cbs->action_refresh_ident = #name;
#endif #endif
int action_refresh_default(file_list_t *list, file_list_t *menu_list) int action_refresh_default(file_list_t *list, file_list_t *menu_list)

View File

@ -45,11 +45,7 @@
#include "../../manual_content_scan.h" #include "../../manual_content_scan.h"
#ifndef BIND_ACTION_RIGHT #ifndef BIND_ACTION_RIGHT
#define BIND_ACTION_RIGHT(cbs, name) \ #define BIND_ACTION_RIGHT(cbs, name) (cbs)->action_right = (name)
do { \
cbs->action_right = name; \
cbs->action_right_ident = #name; \
} while(0)
#endif #endif
extern struct key_desc key_descriptors[RARCH_MAX_KEYS]; extern struct key_desc key_descriptors[RARCH_MAX_KEYS];

View File

@ -31,9 +31,7 @@
#include "../../tasks/tasks_internal.h" #include "../../tasks/tasks_internal.h"
#ifndef BIND_ACTION_SCAN #ifndef BIND_ACTION_SCAN
#define BIND_ACTION_SCAN(cbs, name) \ #define BIND_ACTION_SCAN(cbs, name) (cbs)->action_scan = (name)
cbs->action_scan = name; \
cbs->action_scan_ident = #name;
#endif #endif
#ifdef HAVE_LIBRETRODB #ifdef HAVE_LIBRETRODB

View File

@ -31,9 +31,7 @@
#endif #endif
#ifndef BIND_ACTION_SELECT #ifndef BIND_ACTION_SELECT
#define BIND_ACTION_SELECT(cbs, name) \ #define BIND_ACTION_SELECT(cbs, name) (cbs)->action_select = (name)
cbs->action_select = name; \
cbs->action_select_ident = #name;
#endif #endif
static int action_select_default(const char *path, const char *label, unsigned type, static int action_select_default(const char *path, const char *label, unsigned type,

View File

@ -45,9 +45,7 @@
#include "../../config.def.h" #include "../../config.def.h"
#ifndef BIND_ACTION_START #ifndef BIND_ACTION_START
#define BIND_ACTION_START(cbs, name) \ #define BIND_ACTION_START(cbs, name) (cbs)->action_start = (name)
cbs->action_start = name; \
cbs->action_start_ident = #name;
#endif #endif
/* Forward declarations */ /* Forward declarations */

View File

@ -31,12 +31,6 @@
#include "../../core_info.h" #include "../../core_info.h"
#include "../../verbosity.h" #include "../../verbosity.h"
#ifndef BIND_ACTION_SUBLABEL
#define BIND_ACTION_SUBLABEL(cbs, name) \
cbs->action_sublabel = name; \
cbs->action_sublabel_ident = #name;
#endif
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
#include "../../network/netplay/netplay.h" #include "../../network/netplay/netplay.h"
#include "../../network/netplay/netplay_discovery.h" #include "../../network/netplay/netplay_discovery.h"
@ -52,6 +46,11 @@
#include "../../playlist.h" #include "../../playlist.h"
#include "../../runtime_file.h" #include "../../runtime_file.h"
#ifndef BIND_ACTION_SUBLABEL
#define BIND_ACTION_SUBLABEL(cbs, name) (cbs)->action_sublabel = (name)
#endif
#define default_sublabel_macro(func_name, lbl) \ #define default_sublabel_macro(func_name, lbl) \
static int (func_name)(file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len) \ static int (func_name)(file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len) \
{ \ { \
@ -1592,7 +1591,7 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings_show_saving); BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings_show_saving);
break; break;
case MENU_ENUM_LABEL_SETTINGS_SHOW_LOGGING: case MENU_ENUM_LABEL_SETTINGS_SHOW_LOGGING:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings_show_logging) BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings_show_logging);
break; break;
case MENU_ENUM_LABEL_SETTINGS_SHOW_FRAME_THROTTLE: case MENU_ENUM_LABEL_SETTINGS_SHOW_FRAME_THROTTLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings_show_frame_throttle); BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings_show_frame_throttle);

View File

@ -27,9 +27,7 @@
#include "../../managers/core_option_manager.h" #include "../../managers/core_option_manager.h"
#ifndef BIND_ACTION_GET_TITLE #ifndef BIND_ACTION_GET_TITLE
#define BIND_ACTION_GET_TITLE(cbs, name) \ #define BIND_ACTION_GET_TITLE(cbs, name) (cbs)->action_get_title = (name)
cbs->action_get_title = name; \
cbs->action_get_title_ident = #name;
#endif #endif
#define sanitize_to_string(s, label, len) \ #define sanitize_to_string(s, label, len) \

View File

@ -17,9 +17,7 @@
#include "../menu_cbs.h" #include "../menu_cbs.h"
#ifndef BIND_ACTION_UP #ifndef BIND_ACTION_UP
#define BIND_ACTION_UP(cbs, name) \ #define BIND_ACTION_UP(cbs, name) (cbs)->action_up = (name)
cbs->action_up = name; \
cbs->action_up_ident = #name;
#endif #endif
static int action_bind_up_generic(unsigned type, const char *label) static int action_bind_up_generic(unsigned type, const char *label)

View File

@ -24,14 +24,6 @@
#define DEBUG_LOG #define DEBUG_LOG
#endif #endif
static void menu_cbs_init_log(const char *entry_label, const char *bind_label, const char *label)
{
#ifdef DEBUG_LOG
if (!string_is_empty(label))
RARCH_LOG("[%s]\t\t\tFound %s bind : [%s]\n", entry_label, bind_label, label);
#endif
}
struct key_desc key_descriptors[RARCH_MAX_KEYS] = struct key_desc key_descriptors[RARCH_MAX_KEYS] =
{ {
{RETROK_FIRST, "Unmapped"}, {RETROK_FIRST, "Unmapped"},
@ -208,7 +200,6 @@ void menu_cbs_init(void *data,
unsigned type, size_t idx) unsigned type, size_t idx)
{ {
menu_ctx_bind_t bind_info; menu_ctx_bind_t bind_info;
const char *repr_label = NULL;
const char *menu_label = NULL; const char *menu_label = NULL;
enum msg_hash_enums enum_idx = MSG_UNKNOWN; enum msg_hash_enums enum_idx = MSG_UNKNOWN;
file_list_t *list = (file_list_t*)data; file_list_t *list = (file_list_t*)data;
@ -222,11 +213,7 @@ void menu_cbs_init(void *data,
#ifdef DEBUG_LOG #ifdef DEBUG_LOG
RARCH_LOG("\n"); RARCH_LOG("\n");
#endif
repr_label = (!string_is_empty(label)) ? label : path;
#ifdef DEBUG_LOG
if (cbs && cbs->enum_idx != MSG_UNKNOWN) if (cbs && cbs->enum_idx != MSG_UNKNOWN)
RARCH_LOG("\t\t\tenum_idx %d [%s]\n", cbs->enum_idx, msg_hash_to_str(cbs->enum_idx)); RARCH_LOG("\t\t\tenum_idx %d [%s]\n", cbs->enum_idx, msg_hash_to_str(cbs->enum_idx));
#endif #endif
@ -235,104 +222,70 @@ void menu_cbs_init(void *data,
* menu_cbs_ok.c, then map this callback to the entry. */ * menu_cbs_ok.c, then map this callback to the entry. */
menu_cbs_init_bind_ok(cbs, path, label, type, idx, menu_label); menu_cbs_init_bind_ok(cbs, path, label, type, idx, menu_label);
menu_cbs_init_log(repr_label, "OK", cbs->action_ok_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_cancel.c, then map this callback to the entry. */ * menu_cbs_cancel.c, then map this callback to the entry. */
menu_cbs_init_bind_cancel(cbs, path, label, type, idx); menu_cbs_init_bind_cancel(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "CANCEL", cbs->action_cancel_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_scan.c, then map this callback to the entry. */ * menu_cbs_scan.c, then map this callback to the entry. */
menu_cbs_init_bind_scan(cbs, path, label, type, idx); menu_cbs_init_bind_scan(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "SCAN", cbs->action_scan_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_start.c, then map this callback to the entry. */ * menu_cbs_start.c, then map this callback to the entry. */
menu_cbs_init_bind_start(cbs, path, label, type, idx); menu_cbs_init_bind_start(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "START", cbs->action_start_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_select.c, then map this callback to the entry. */ * menu_cbs_select.c, then map this callback to the entry. */
menu_cbs_init_bind_select(cbs, path, label, type, idx); menu_cbs_init_bind_select(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "SELECT", cbs->action_select_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_info.c, then map this callback to the entry. */ * menu_cbs_info.c, then map this callback to the entry. */
menu_cbs_init_bind_info(cbs, path, label, type, idx); menu_cbs_init_bind_info(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "INFO", cbs->action_info_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_bind_content_list_switch.c, then map this callback to the entry. */ * menu_cbs_bind_content_list_switch.c, then map this callback to the entry. */
menu_cbs_init_bind_content_list_switch(cbs, path, label, type, idx); menu_cbs_init_bind_content_list_switch(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "CONTENT SWITCH", cbs->action_content_list_switch_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_up.c, then map this callback to the entry. */ * menu_cbs_up.c, then map this callback to the entry. */
menu_cbs_init_bind_up(cbs, path, label, type, idx); menu_cbs_init_bind_up(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "UP", cbs->action_up_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_down.c, then map this callback to the entry. */ * menu_cbs_down.c, then map this callback to the entry. */
menu_cbs_init_bind_down(cbs, path, label, type, idx); menu_cbs_init_bind_down(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "DOWN", cbs->action_down_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_left.c, then map this callback to the entry. */ * menu_cbs_left.c, then map this callback to the entry. */
menu_cbs_init_bind_left(cbs, path, label, type, idx, menu_label); menu_cbs_init_bind_left(cbs, path, label, type, idx, menu_label);
menu_cbs_init_log(repr_label, "LEFT", cbs->action_left_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_right.c, then map this callback to the entry. */ * menu_cbs_right.c, then map this callback to the entry. */
menu_cbs_init_bind_right(cbs, path, label, type, idx, menu_label); menu_cbs_init_bind_right(cbs, path, label, type, idx, menu_label);
menu_cbs_init_log(repr_label, "RIGHT", cbs->action_right_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_deferred_push.c, then map this callback to the entry. */ * menu_cbs_deferred_push.c, then map this callback to the entry. */
menu_cbs_init_bind_deferred_push(cbs, path, label, type, idx); menu_cbs_init_bind_deferred_push(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "DEFERRED PUSH", cbs->action_deferred_push_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_refresh.c, then map this callback to the entry. */ * menu_cbs_refresh.c, then map this callback to the entry. */
menu_cbs_init_bind_refresh(cbs, path, label, type, idx); menu_cbs_init_bind_refresh(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "REFRESH", cbs->action_refresh_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_get_string_representation.c, then map this callback to the entry. */ * menu_cbs_get_string_representation.c, then map this callback to the entry. */
menu_cbs_init_bind_get_string_representation(cbs, path, label, type, idx); menu_cbs_init_bind_get_string_representation(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "GET VALUE", cbs->action_get_value_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_title.c, then map this callback to the entry. */ * menu_cbs_title.c, then map this callback to the entry. */
menu_cbs_init_bind_title(cbs, path, label, type, idx); menu_cbs_init_bind_title(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "GET TITLE", cbs->action_get_title_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_label.c, then map this callback to the entry. */ * menu_cbs_label.c, then map this callback to the entry. */
menu_cbs_init_bind_label(cbs, path, label, type, idx); menu_cbs_init_bind_label(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "LABEL", cbs->action_label_ident);
/* It will try to find a corresponding callback function inside /* It will try to find a corresponding callback function inside
* menu_cbs_sublabel.c, then map this callback to the entry. */ * menu_cbs_sublabel.c, then map this callback to the entry. */
menu_cbs_init_bind_sublabel(cbs, path, label, type, idx); menu_cbs_init_bind_sublabel(cbs, path, label, type, idx);
menu_cbs_init_log(repr_label, "SUBLABEL", cbs->action_sublabel_ident);
bind_info.cbs = cbs; bind_info.cbs = cbs;
bind_info.path = path; bind_info.path = path;
bind_info.label = label; bind_info.label = label;

View File

@ -81,24 +81,6 @@ typedef struct menu_file_list_cbs
char action_title_cache [512]; char action_title_cache [512];
enum msg_hash_enums enum_idx; enum msg_hash_enums enum_idx;
const char *action_iterate_ident;
const char *action_deferred_push_ident;
const char *action_select_ident;
const char *action_get_title_ident;
const char *action_ok_ident;
const char *action_cancel_ident;
const char *action_scan_ident;
const char *action_right_ident;
const char *action_start_ident;
const char *action_info_ident;
const char *action_content_list_switch_ident;
const char *action_left_ident;
const char *action_refresh_ident;
const char *action_up_ident;
const char *action_label_ident;
const char *action_sublabel_ident;
const char *action_down_ident;
const char *action_get_value_ident;
bool checked; bool checked;