Add stub menu_entries_cbs.c/menu_entries_cbs.h

This commit is contained in:
twinaphex 2014-10-12 00:45:42 +02:00
parent c6e12f4806
commit 48e2c62e10
8 changed files with 76 additions and 11 deletions

View File

@ -280,6 +280,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
frontend/menu/menu_action.o \
frontend/menu/menu_shader.o \
frontend/menu/menu_entries.o \
frontend/menu/menu_entries_cbs.o \
frontend/menu/menu_animation.o
endif

View File

@ -41,7 +41,8 @@ void file_list_push(file_list_t *list,
driver.menu_ctx->list_insert(list, path, label, list->size);
if (driver.menu_ctx->backend->list_insert)
driver.menu_ctx->backend->list_insert(list, path, label, list->size);
driver.menu_ctx->backend->list_insert(list, path,
label, type,list->size);
}
#endif

View File

@ -5,13 +5,19 @@
extern "C" {
#endif
typedef struct menu_file_list_cbs
{
int (*action_ok)(const char *path, const char *label, unsigned type,
size_t index);
} menu_file_list_cbs_t;
typedef struct menu_ctx_driver_backend
{
int (*iterate)(unsigned);
unsigned (*type_is)(const char *, unsigned);
void (*setting_set_label)(char *, size_t, unsigned *,
unsigned, const char *, const char *, unsigned);
void (*list_insert)(void *, const char *, const char *, size_t);
void (*list_insert)(void *, const char *, const char *, unsigned, size_t);
void (*list_delete)(void *, size_t, size_t);
void (*list_clear)(void *);
void (*list_set_selection)(void *);

View File

@ -25,6 +25,7 @@
#include "menu_backend.h"
#include "../menu_action.h"
#include "../menu_entries.h"
#include "../menu_entries_cbs.h"
#include "../menu_navigation.h"
#include "../menu_input_line_cb.h"
@ -1119,23 +1120,24 @@ static void menu_common_setting_set_label(char *type_str,
}
static void menu_common_list_insert(void *data,
const char *path, const char *unused, size_t list_size)
const char *path, const char *label,
unsigned type, size_t index)
{
int i = list_size;
file_list_t *list = (file_list_t*)data;
if (!list)
return;
list->list[i].actiondata = (menu_file_list_cbs_t*)
list->list[index].actiondata = (menu_file_list_cbs_t*)
calloc(1, sizeof(menu_file_list_cbs_t));
if (!list->list[i].actiondata)
if (!list->list[index].actiondata)
{
RARCH_ERR("Action data could not be allocated.\n");
return;
}
menu_entries_cbs_init(list, path, label, type, index);
}
static void menu_common_list_delete(void *data, size_t index,

View File

@ -5,11 +5,6 @@
extern "C" {
#endif
typedef struct menu_file_list_cbs
{
int (*action_ok)(const char *path, const char *label, unsigned type);
} menu_file_list_cbs_t;
typedef struct menu_ctx_driver
{
void (*set_texture)(void*);

View File

@ -0,0 +1,34 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2014 - 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 "menu_common.h"
#include "backend/menu_backend.h"
void menu_entries_cbs_init(void *data,
const char *path, const char *label,
unsigned type, size_t index)
{
menu_file_list_cbs_t *cbs = NULL;
file_list_t *list = (file_list_t*)data;
if (!list)
return;
cbs = (menu_file_list_cbs_t*)list->list[index].actiondata;
if (!cbs)
return;
}

View File

@ -0,0 +1,25 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2014 - 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/>.
*/
#ifndef MENU_ENTRIES_CBS_H__
#define MENU_ENTRIES_CBS_H__
#include <stdlib.h>
void menu_entries_cbs_init(void *data,
const char *path, const char *label,
unsigned type, size_t index);
#endif

View File

@ -648,6 +648,7 @@ MENU
#include "../frontend/menu/menu_common.c"
#include "../frontend/menu/menu_action.c"
#include "../frontend/menu/menu_entries.c"
#include "../frontend/menu/menu_entries_cbs.c"
#include "../frontend/menu/menu_shader.c"
#include "../frontend/menu/menu_navigation.c"
#include "../frontend/menu/menu_animation.c"