Rename menu_entries_init to menu_displaylist_init

This commit is contained in:
twinaphex 2015-05-12 13:02:10 +02:00
parent fa6db7d8f2
commit 168f681fa5
5 changed files with 39 additions and 42 deletions

View File

@ -580,3 +580,28 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
return ret;
}
/**
* menu_displaylist_init:
* @menu : Menu handle.
*
* Creates and initializes menu display list.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool menu_displaylist_init(menu_handle_t *menu)
{
menu_list_t *menu_list = menu_list_get_ptr();
menu_displaylist_info_t info = {0};
if (!menu || !menu_list)
return false;
info.list = menu_list->selection_buf;
info.type = MENU_SETTINGS;
info.flags = SL_FLAG_MAIN_MENU;
strlcpy(info.label, "Main Menu", sizeof(info.label));
menu_displaylist_push_list(&info, DISPLAYLIST_MAIN_MENU);
return true;
}

View File

@ -18,6 +18,7 @@
#include <stdint.h>
#include <retro_miscellaneous.h>
#include "menu.h"
#include "menu_list.h"
#include "menu_setting.h"
@ -72,6 +73,16 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type);
int menu_displaylist_push(file_list_t *list, file_list_t *menu_list);
/**
* menu_displaylist_init:
* @menu : Menu handle.
*
* Creates and initializes menu display list.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool menu_displaylist_init(menu_handle_t *menu);
#ifdef __cplusplus
}
#endif

View File

@ -18,7 +18,7 @@
#include <string/string_list.h>
#include "menu_driver.h"
#include "menu.h"
#include "menu_entries.h"
#include "menu_displaylist.h"
#include "../driver.h"
#include "../general.h"
@ -156,9 +156,9 @@ void init_menu(void)
rarch_fail(1, "init_menu()");
}
if (!(menu_entries_init(driver->menu)))
if (!(menu_displaylist_init(driver->menu)))
{
RARCH_ERR("Cannot initialize menu lists.\n");
RARCH_ERR("Cannot initialize menu display list.\n");
rarch_fail(1, "init_menu()");
}
}

View File

@ -18,10 +18,6 @@
#include "menu_entries.h"
#include "menu_setting.h"
#include "menu_navigation.h"
#include <file/file_list.h>
#include <file/file_path.h>
#include <file/file_extract.h>
#include <file/dir_list.h>
int menu_entries_setting_set_flags(rarch_setting_t *setting)
{
@ -47,28 +43,3 @@ int menu_entries_setting_set_flags(rarch_setting_t *setting)
return 0;
}
/**
* menu_entries_init:
* @menu : Menu handle.
*
* Creates and initializes menu entries.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool menu_entries_init(menu_handle_t *menu)
{
menu_list_t *menu_list = menu_list_get_ptr();
menu_displaylist_info_t info = {0};
if (!menu || !menu_list)
return false;
info.list = menu_list->selection_buf;
info.type = MENU_SETTINGS;
info.flags = SL_FLAG_MAIN_MENU;
strlcpy(info.label, "Main Menu", sizeof(info.label));
menu_displaylist_push_list(&info, DISPLAYLIST_MAIN_MENU);
return true;
}

View File

@ -33,16 +33,6 @@ void menu_entries_cbs_init_bind_toggle(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);
/**
* menu_entries_init:
* @menu : Menu handle.
*
* Creates and initializes menu entries.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool menu_entries_init(menu_handle_t *menu);
int menu_entries_setting_set_flags(rarch_setting_t *setting);
#ifdef __cplusplus