2015-02-27 03:08:30 +01:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2016-01-10 04:06:50 +01:00
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
2015-02-27 03:08:30 +01:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2015-06-13 19:12:10 +02:00
|
|
|
#include <compat/strl.h>
|
|
|
|
|
2015-12-06 17:55:27 +01:00
|
|
|
#include "../menu_driver.h"
|
2015-12-09 09:53:43 +01:00
|
|
|
#include "../menu_navigation.h"
|
2015-06-26 15:28:01 +02:00
|
|
|
#include "../menu_cbs.h"
|
2015-06-13 19:12:10 +02:00
|
|
|
#include "../menu_hash.h"
|
2015-02-27 03:08:30 +01:00
|
|
|
|
2015-10-11 20:26:44 +02:00
|
|
|
#ifndef BIND_ACTION_INFO
|
|
|
|
#define BIND_ACTION_INFO(cbs, name) \
|
|
|
|
cbs->action_info = name; \
|
|
|
|
cbs->action_info_ident = #name;
|
|
|
|
#endif
|
|
|
|
|
2015-05-31 22:40:26 +02:00
|
|
|
static int action_info_default(unsigned type, const char *label)
|
2015-02-27 03:08:30 +01:00
|
|
|
{
|
2015-09-25 18:46:12 +02:00
|
|
|
size_t selection = 0;
|
2015-05-18 03:18:39 +02:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-10-27 10:33:19 +01:00
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2015-06-13 16:22:05 +02:00
|
|
|
|
2015-09-25 18:46:12 +02:00
|
|
|
if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection))
|
|
|
|
return 0;
|
2015-06-13 16:22:05 +02:00
|
|
|
|
2015-10-17 18:09:05 +02:00
|
|
|
info.list = menu_stack;
|
2015-09-25 18:46:12 +02:00
|
|
|
info.directory_ptr = selection;
|
2015-06-19 04:40:43 +02:00
|
|
|
strlcpy(info.label,
|
|
|
|
menu_hash_to_str(MENU_LABEL_INFO_SCREEN),
|
|
|
|
sizeof(info.label));
|
2015-05-18 03:18:39 +02:00
|
|
|
|
2016-02-24 23:05:54 +01:00
|
|
|
if (menu_displaylist_ctl(DISPLAYLIST_HELP, &info))
|
2016-02-24 22:56:41 +01:00
|
|
|
{
|
|
|
|
menu_displaylist_push_list_process(&info);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-02-24 23:05:54 +01:00
|
|
|
return -1;
|
2015-02-27 03:08:30 +01:00
|
|
|
}
|
|
|
|
|
2015-06-12 16:01:46 +02:00
|
|
|
int menu_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
|
2015-02-27 03:08:30 +01:00
|
|
|
const char *path, const char *label, unsigned type, size_t idx,
|
2015-06-05 13:17:44 +02:00
|
|
|
const char *elem0, const char *elem1,
|
|
|
|
uint32_t label_hash, uint32_t menu_label_hash)
|
2015-02-27 03:08:30 +01:00
|
|
|
{
|
|
|
|
if (!cbs)
|
2015-06-07 18:36:10 +02:00
|
|
|
return -1;
|
2015-02-27 03:08:30 +01:00
|
|
|
|
2015-10-11 20:26:44 +02:00
|
|
|
BIND_ACTION_INFO(cbs, action_info_default);
|
2015-06-07 18:36:10 +02:00
|
|
|
|
|
|
|
return -1;
|
2015-02-27 03:08:30 +01:00
|
|
|
}
|