Rename functions/enums

This commit is contained in:
twinaphex 2016-06-11 19:55:27 +02:00
parent 538a8d9e18
commit 5ea923030b
4 changed files with 31 additions and 31 deletions

View File

@ -265,17 +265,17 @@ void fill_pathname_application_path(char *s, size_t len)
const char *xmb_theme_ident(void); const char *xmb_theme_ident(void);
#endif #endif
void fill_pathname_application_directory(char *s, size_t len, enum application_directory type) void fill_pathname_application_special(char *s, size_t len, enum application_special_type type)
{ {
switch (type) switch (type)
{ {
case APPLICATION_DIRECTORY_ASSETS_XMB_ICONS: case APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS:
#ifdef HAVE_XMB #ifdef HAVE_XMB
{ {
char s1[PATH_MAX_LENGTH] = {0}; char s1[PATH_MAX_LENGTH] = {0};
char s2[PATH_MAX_LENGTH] = {0}; char s2[PATH_MAX_LENGTH] = {0};
fill_pathname_application_directory(s1, sizeof(s1), fill_pathname_application_special(s1, sizeof(s1),
APPLICATION_DIRECTORY_ASSETS_XMB); APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB);
fill_pathname_join(s2, s1, "png", fill_pathname_join(s2, s1, "png",
sizeof(s2)); sizeof(s2));
fill_pathname_slash(s2, sizeof(s2)); fill_pathname_slash(s2, sizeof(s2));
@ -283,7 +283,7 @@ void fill_pathname_application_directory(char *s, size_t len, enum application_d
} }
#endif #endif
break; break;
case APPLICATION_DIRECTORY_ASSETS_XMB: case APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB:
#ifdef HAVE_XMB #ifdef HAVE_XMB
{ {
char s1[PATH_MAX_LENGTH] = {0}; char s1[PATH_MAX_LENGTH] = {0};
@ -301,7 +301,7 @@ void fill_pathname_application_directory(char *s, size_t len, enum application_d
} }
#endif #endif
break; break;
case APPLICATION_DIRECTORY_ASSETS_MATERIALUI: case APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI:
#ifdef HAVE_MATERIALUI #ifdef HAVE_MATERIALUI
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
@ -314,20 +314,20 @@ void fill_pathname_application_directory(char *s, size_t len, enum application_d
} }
#endif #endif
break; break;
case APPLICATION_DIRECTORY_ASSETS_MATERIALUI_ICONS: case APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS:
#ifdef HAVE_MATERIALUI #ifdef HAVE_MATERIALUI
{ {
char s1[PATH_MAX_LENGTH] = {0}; char s1[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
fill_pathname_application_directory(s1, fill_pathname_application_special(s1,
sizeof(s1), APPLICATION_DIRECTORY_ASSETS_MATERIALUI); sizeof(s1), APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI);
fill_pathname_slash(s1, sizeof(s1)); fill_pathname_slash(s1, sizeof(s1));
strlcpy(s, s1, len); strlcpy(s, s1, len);
} }
#endif #endif
break; break;
case APPLICATION_DIRECTORY_NONE: case APPLICATION_SPECIAL_NONE:
default: default:
break; break;
} }

View File

@ -22,17 +22,17 @@
#include <boolean.h> #include <boolean.h>
enum application_directory enum application_special_type
{ {
APPLICATION_DIRECTORY_NONE = 0, APPLICATION_SPECIAL_NONE = 0,
APPLICATION_DIRECTORY_ASSETS_MATERIALUI, APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI,
APPLICATION_DIRECTORY_ASSETS_MATERIALUI_ICONS, APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS,
APPLICATION_DIRECTORY_ASSETS_XMB, APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB,
APPLICATION_DIRECTORY_ASSETS_XMB_ICONS APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS
}; };
bool fill_pathname_application_data(char *s, size_t len); bool fill_pathname_application_data(char *s, size_t len);
void fill_pathname_application_directory(char *s, size_t len, enum application_directory type); void fill_pathname_application_special(char *s, size_t len, enum application_special_type type);
#endif #endif

View File

@ -149,8 +149,8 @@ static void mui_context_reset_textures(mui_handle_t *mui)
unsigned i; unsigned i;
char iconpath[PATH_MAX_LENGTH] = {0}; char iconpath[PATH_MAX_LENGTH] = {0};
fill_pathname_application_directory(iconpath, sizeof(iconpath), fill_pathname_application_special(iconpath, sizeof(iconpath),
APPLICATION_DIRECTORY_ASSETS_MATERIALUI_ICONS); APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS);
for (i = 0; i < MUI_TEXTURE_LAST; i++) for (i = 0; i < MUI_TEXTURE_LAST; i++)
{ {
@ -1010,8 +1010,8 @@ static void mui_font(void)
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
int font_size = menu_display_get_font_size(); int font_size = menu_display_get_font_size();
fill_pathname_application_directory(mediapath, sizeof(mediapath), fill_pathname_application_special(mediapath, sizeof(mediapath),
APPLICATION_DIRECTORY_ASSETS_MATERIALUI); APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI);
fill_pathname_join(fontpath, mediapath, fill_pathname_join(fontpath, mediapath,
"Roboto-Regular.ttf", sizeof(fontpath)); "Roboto-Regular.ttf", sizeof(fontpath));

View File

@ -389,8 +389,8 @@ static void xmb_fill_default_background_path(xmb_handle_t *xmb,
char iconpath[PATH_MAX_LENGTH] = {0}; char iconpath[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
fill_pathname_application_directory(iconpath, sizeof(iconpath), fill_pathname_application_special(iconpath, sizeof(iconpath),
APPLICATION_DIRECTORY_ASSETS_XMB_ICONS); APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
fill_pathname_join(path, iconpath, "bg.png", size); fill_pathname_join(path, iconpath, "bg.png", size);
@ -1334,8 +1334,8 @@ static void xmb_context_reset_horizontal_list(
size_t list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL); size_t list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL);
char themepath[PATH_MAX_LENGTH] = {0}; char themepath[PATH_MAX_LENGTH] = {0};
fill_pathname_application_directory(themepath, sizeof(themepath), fill_pathname_application_special(themepath, sizeof(themepath),
APPLICATION_DIRECTORY_ASSETS_XMB); APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB);
xmb->categories.x_pos = xmb->icon.spacing.horizontal * xmb->categories.x_pos = xmb->icon.spacing.horizontal *
-(float)xmb->categories.selection_ptr; -(float)xmb->categories.selection_ptr;
@ -1373,8 +1373,8 @@ static void xmb_context_reset_horizontal_list(
strlcpy(sysname, path, sizeof(sysname)); strlcpy(sysname, path, sizeof(sysname));
path_remove_extension(sysname); path_remove_extension(sysname);
fill_pathname_application_directory(iconpath, sizeof(iconpath), fill_pathname_application_special(iconpath, sizeof(iconpath),
APPLICATION_DIRECTORY_ASSETS_XMB_ICONS); APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
fill_pathname_join(texturepath, iconpath, sysname, fill_pathname_join(texturepath, iconpath, sysname,
sizeof(texturepath)); sizeof(texturepath));
@ -2280,8 +2280,8 @@ static void xmb_font(xmb_handle_t *xmb)
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
int font_size = menu_display_get_font_size(); int font_size = menu_display_get_font_size();
fill_pathname_application_directory(themepath, sizeof(themepath), fill_pathname_application_special(themepath, sizeof(themepath),
APPLICATION_DIRECTORY_ASSETS_XMB); APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB);
if (string_is_empty(settings->menu.xmb_font)) if (string_is_empty(settings->menu.xmb_font))
fill_pathname_join(fontpath, themepath, "font.ttf", sizeof(fontpath)); fill_pathname_join(fontpath, themepath, "font.ttf", sizeof(fontpath));
@ -2796,8 +2796,8 @@ static void xmb_context_reset(void *data)
xmb_fill_default_background_path(xmb, xmb_fill_default_background_path(xmb,
xmb->background_file_path, sizeof(xmb->background_file_path)); xmb->background_file_path, sizeof(xmb->background_file_path));
fill_pathname_application_directory(iconpath, sizeof(iconpath), fill_pathname_application_special(iconpath, sizeof(iconpath),
APPLICATION_DIRECTORY_ASSETS_XMB_ICONS); APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
xmb_layout(xmb); xmb_layout(xmb);
xmb_font(xmb); xmb_font(xmb);