Get rid of menu_common_settings.c - add remaining public functions to

menu backend interface
This commit is contained in:
twinaphex 2014-04-26 02:40:38 +02:00
parent 40409a2ab0
commit 6f05cce0de
13 changed files with 2347 additions and 2312 deletions

View File

@ -106,7 +106,7 @@ endif
endif
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += frontend/menu/backend/menu_common_backend.o frontend/menu/backend/menu_common_settings.o
OBJ += frontend/menu/backend/menu_common_backend.o
endif
ifeq ($(HAVE_THREADS), 1)

View File

@ -76,7 +76,7 @@ ifeq ($(HAVE_RGUI), 1)
endif
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += frontend/menu/backend/menu_common_backend.o frontend/menu/backend/menu_common_settings.o
OBJ += frontend/menu/backend/menu_common_backend.o
endif
ifeq ($(HAVE_SDL), 1)

View File

@ -120,7 +120,7 @@ ifeq ($(HAVE_RGUI), 1)
endif
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += frontend/menu/backend/menu_common_backend.o frontend/menu/backend/menu_common_settings.o
OBJ += frontend/menu/backend/menu_common_backend.o
endif
ifeq ($(HAVE_SDL), 1)

View File

@ -396,7 +396,12 @@ typedef struct menu_ctx_driver_backend
void (*shader_manager_set_preset)(void *, unsigned, const char*);
void (*shader_manager_save_preset)(void *, const char *, bool);
unsigned (*shader_manager_get_type)(void *);
int (*shader_manager_toggle_setting)(void *, unsigned, unsigned);
int (*shader_manager_setting_toggle)(void *, unsigned, unsigned);
unsigned (*type_is)(unsigned);
int (*core_setting_toggle)(unsigned, unsigned);
int (*setting_toggle)(void *, unsigned, unsigned, unsigned);
int (*setting_set)(void *, unsigned, unsigned);
void (*setting_set_label)(char *, size_t, unsigned *, unsigned);
const char *ident;
} menu_ctx_driver_backend_t;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -387,8 +387,12 @@ static void lakka_render(void *data)
char title[256];
const char *dir = NULL;
unsigned menu_type = 0;
unsigned menu_type_is = 0;
file_list_get_last(rgui->menu_stack, &dir, &menu_type);
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->type_is)
menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
if (menu_type == RGUI_SETTINGS_CORE)
snprintf(title, sizeof(title), "CORE SELECTION %s", dir);
else if (menu_type == RGUI_SETTINGS_DEFERRED_CORE)
@ -412,7 +416,7 @@ static void lakka_render(void *data)
else if (menu_type == RGUI_SETTINGS_CORE_OPTIONS)
strlcpy(title, "CORE OPTIONS", sizeof(title));
#ifdef HAVE_SHADER_MANAGER
else if (menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
else if (menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS)
snprintf(title, sizeof(title), "SHADER %s", dir);
#endif
else if ((menu_type == RGUI_SETTINGS_INPUT_OPTIONS) ||
@ -515,8 +519,8 @@ static void lakka_render(void *data)
type <= RGUI_SETTINGS_SHADER_LAST)
{
// HACK. Work around that we're using the menu_type as dir type to propagate state correctly.
if ((menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
&& (menu_type_is(type) == RGUI_SETTINGS_SHADER_OPTIONS))
if ((menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS)
&& (menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS))
{
type = RGUI_FILE_DIRECTORY;
strlcpy(type_str, "(DIR)", sizeof(type_str));
@ -553,7 +557,7 @@ static void lakka_render(void *data)
menu_type == RGUI_SETTINGS_OVERLAY_PRESET ||
#endif
menu_type == RGUI_SETTINGS_DISK_APPEND ||
menu_type_is(menu_type) == RGUI_FILE_DIRECTORY)
menu_type_is == RGUI_FILE_DIRECTORY)
{
if (type == RGUI_FILE_PLAIN)
{
@ -581,8 +585,8 @@ static void lakka_render(void *data)
strlcpy(type_str,
core_option_get_val(g_extern.system.core_options, type - RGUI_SETTINGS_CORE_OPTION_START),
sizeof(type_str));
else
menu_set_settings_label(type_str, sizeof(type_str), &w, type);
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_set_label)
driver.menu_ctx->backend->setting_set_label(type_str, sizeof(type_str), &w, type);
char entry_title_buf[256];
char type_str_buf[64];

View File

@ -283,8 +283,12 @@ static void rgui_render(void *data)
char title[256];
const char *dir = NULL;
unsigned menu_type = 0;
unsigned menu_type_is = 0;
file_list_get_last(rgui->menu_stack, &dir, &menu_type);
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->type_is)
menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
if (menu_type == RGUI_SETTINGS_CORE)
snprintf(title, sizeof(title), "CORE SELECTION %s", dir);
else if (menu_type == RGUI_SETTINGS_DEFERRED_CORE)
@ -328,7 +332,7 @@ static void rgui_render(void *data)
else if (menu_type == RGUI_SETTINGS_PRIVACY_OPTIONS)
strlcpy(title, "PRIVACY OPTIONS", sizeof(title));
#ifdef HAVE_SHADER_MANAGER
else if (menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
else if (menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS)
snprintf(title, sizeof(title), "SHADER %s", dir);
#endif
else if (menu_type == RGUI_SETTINGS_PATH_OPTIONS ||
@ -432,8 +436,8 @@ static void rgui_render(void *data)
type <= RGUI_SETTINGS_SHADER_LAST)
{
// HACK. Work around that we're using the menu_type as dir type to propagate state correctly.
if ((menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
&& (menu_type_is(type) == RGUI_SETTINGS_SHADER_OPTIONS))
if ((menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS)
&& (menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS))
{
type = RGUI_FILE_DIRECTORY;
strlcpy(type_str, "(DIR)", sizeof(type_str));
@ -471,7 +475,7 @@ static void rgui_render(void *data)
#endif
menu_type == RGUI_SETTINGS_VIDEO_SOFTFILTER ||
menu_type == RGUI_SETTINGS_DISK_APPEND ||
menu_type_is(menu_type) == RGUI_FILE_DIRECTORY)
menu_type_is == RGUI_FILE_DIRECTORY)
{
if (type == RGUI_FILE_PLAIN)
{
@ -499,8 +503,8 @@ static void rgui_render(void *data)
strlcpy(type_str,
core_option_get_val(g_extern.system.core_options, type - RGUI_SETTINGS_CORE_OPTION_START),
sizeof(type_str));
else
menu_set_settings_label(type_str, sizeof(type_str), &w, type);
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_set_label)
driver.menu_ctx->backend->setting_set_label(type_str, sizeof(type_str), &w, type);
char entry_title_buf[256];
char type_str_buf[64];

View File

@ -143,8 +143,12 @@ static void rmenu_render(void *data)
char title[256];
const char *dir = NULL;
unsigned menu_type = 0;
unsigned menu_type_is = 0;
file_list_get_last(rgui->menu_stack, &dir, &menu_type);
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->type_is)
menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
if (menu_type == RGUI_SETTINGS_CORE)
snprintf(title, sizeof(title), "CORE SELECTION %s", dir);
else if (menu_type == RGUI_SETTINGS_DEFERRED_CORE)
@ -186,7 +190,7 @@ static void rmenu_render(void *data)
else if (menu_type == RGUI_SETTINGS_PRIVACY_OPTIONS)
strlcpy(title, "PRIVACY OPTIONS", sizeof(title));
#ifdef HAVE_SHADER_MANAGER
else if (menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
else if (menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS)
snprintf(title, sizeof(title), "SHADER %s", dir);
#endif
else if ((menu_type == RGUI_SETTINGS_INPUT_OPTIONS) ||
@ -301,8 +305,8 @@ static void rmenu_render(void *data)
type <= RGUI_SETTINGS_SHADER_LAST)
{
// HACK. Work around that we're using the menu_type as dir type to propagate state correctly.
if ((menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
&& (menu_type_is(type) == RGUI_SETTINGS_SHADER_OPTIONS))
if ((menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS)
&& (menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS))
{
type = RGUI_FILE_DIRECTORY;
strlcpy(type_str, "(DIR)", sizeof(type_str));
@ -339,7 +343,7 @@ static void rmenu_render(void *data)
menu_type == RGUI_SETTINGS_OVERLAY_PRESET ||
#endif
menu_type == RGUI_SETTINGS_DISK_APPEND ||
menu_type_is(menu_type) == RGUI_FILE_DIRECTORY)
menu_type_is == RGUI_FILE_DIRECTORY)
{
if (type == RGUI_FILE_PLAIN)
{
@ -367,8 +371,8 @@ static void rmenu_render(void *data)
strlcpy(type_str,
core_option_get_val(g_extern.system.core_options, type - RGUI_SETTINGS_CORE_OPTION_START),
sizeof(type_str));
else
menu_set_settings_label(type_str, sizeof(type_str), &w, type);
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_set_label)
driver.menu_ctx->backend->setting_set_label(type_str, sizeof(type_str), &w, type);
char entry_title_buf[256];
char type_str_buf[64];

View File

@ -395,8 +395,12 @@ static void rmenu_xui_render(void *data)
char title[256];
const char *dir = NULL;
unsigned menu_type = 0;
unsigned menu_type_is = 0;
file_list_get_last(rgui->menu_stack, &dir, &menu_type);
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->type_is)
menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
if (menu_type == RGUI_SETTINGS_CORE)
snprintf(title, sizeof(title), "CORE SELECTION %s", dir);
else if (menu_type == RGUI_SETTINGS_DEFERRED_CORE)
@ -438,7 +442,7 @@ static void rmenu_xui_render(void *data)
else if (menu_type == RGUI_SETTINGS_PRIVACY_OPTIONS)
strlcpy(title, "PRIVACY OPTIONS", sizeof(title));
#ifdef HAVE_SHADER_MANAGER
else if (menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
else if (menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS)
snprintf(title, sizeof(title), "SHADER %s", dir);
#endif
else if ((menu_type == RGUI_SETTINGS_INPUT_OPTIONS) ||
@ -543,8 +547,8 @@ static void rmenu_xui_render(void *data)
type <= RGUI_SETTINGS_SHADER_LAST)
{
// HACK. Work around that we're using the menu_type as dir type to propagate state correctly.
if ((menu_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
&& (menu_type_is(type) == RGUI_SETTINGS_SHADER_OPTIONS))
if ((menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS)
&& (menu_type_is == RGUI_SETTINGS_SHADER_OPTIONS))
{
type = RGUI_FILE_DIRECTORY;
strlcpy(type_str, "(DIR)", sizeof(type_str));
@ -580,7 +584,7 @@ static void rmenu_xui_render(void *data)
menu_type == RGUI_SETTINGS_OVERLAY_PRESET ||
#endif
menu_type == RGUI_SETTINGS_DISK_APPEND ||
menu_type_is(menu_type) == RGUI_FILE_DIRECTORY)
menu_type_is == RGUI_FILE_DIRECTORY)
{
if (type == RGUI_FILE_PLAIN)
{
@ -608,8 +612,8 @@ static void rmenu_xui_render(void *data)
strlcpy(type_str,
core_option_get_val(g_extern.system.core_options, type - RGUI_SETTINGS_CORE_OPTION_START),
sizeof(type_str));
else
menu_set_settings_label(type_str, sizeof(type_str), &w, type);
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_set_label)
driver.menu_ctx->backend->setting_set_label(type_str, sizeof(type_str), &w, type);
char entry_title_buf[256];
char type_str_buf[64];

View File

@ -601,7 +601,6 @@ MENU
#if defined(HAVE_RMENU) || defined(HAVE_RGUI) || defined(HAVE_RMENU_XUI)
#include "../frontend/menu/backend/menu_common_backend.c"
#include "../frontend/menu/backend/menu_common_settings.c"
#endif
#ifdef HAVE_RMENU

View File

@ -216,7 +216,6 @@
<ClCompile Include="..\..\deps\rzlib\unzip.c" />
<ClCompile Include="..\..\deps\rzlib\zutil.c" />
<ClCompile Include="..\..\file_extract.c" />
<ClCompile Include="..\..\frontend\menu\backend\menu_common_settings.c" />
<ClCompile Include="..\..\frontend\menu\history.c" />
<ClCompile Include="..\..\frontend\menu\file_list.c" />
<ClCompile Include="..\..\frontend\menu\backend\menu_common_backend.c" />
@ -335,4 +334,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -234,9 +234,6 @@
<ClCompile Include="..\..\frontend\menu\backend\menu_common_backend.c">
<Filter>frontend\menu\backend</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\backend\menu_common_settings.c">
<Filter>frontend\menu\backend</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
@ -306,4 +303,4 @@
<UniqueIdentifier>{dd1ca879-56f4-43f6-8bd8-ae50222061e8}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
</Project>