From 35837fcc0f4283afdd76980f558b142cb19e5893 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 8 Jun 2015 16:06:51 +0200 Subject: [PATCH] (Menu) Call menu driver's 'bind_init' function callback --- menu/menu_driver.c | 15 +++++++++++++++ menu/menu_driver.h | 7 ++++++- menu/menu_entries.c | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 276f697f3b..ae9319f612 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -333,6 +333,21 @@ void menu_driver_frame(void) driver->frame(); } +int menu_driver_bind_init(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 ret = 0; + const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr(); + + if (driver && driver->bind_init) + ret = driver->bind_init(cbs, path, label, type, idx, elem0, elem1, + label_hash, menu_label_hash); + + return ret; +} + void menu_driver_free(menu_handle_t *menu) { const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr(); diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 943baea58b..b756c1d7ca 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -259,7 +259,7 @@ typedef struct menu_ctx_driver void (*list_cache)(menu_list_type_t, unsigned); size_t(*list_get_size)(void *data, menu_list_type_t); void (*list_set_selection)(file_list_t *list); - int (*menu_entries_cbs_init_bind)(menu_file_list_cbs_t *cbs, + int (*bind_init)(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); @@ -366,6 +366,11 @@ void menu_driver_set_alive(void); void menu_driver_unset_alive(void); +int menu_driver_bind_init(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); + /* HACK */ extern unsigned int rdb_entry_start_game_selection_ptr; diff --git a/menu/menu_entries.c b/menu/menu_entries.c index 7d298a7e4e..8c7199a8c2 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -149,4 +149,6 @@ void menu_entries_init(void *data, 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); }