Create menu_display_setting_label

This commit is contained in:
twinaphex 2015-05-05 19:50:39 +02:00
parent 02d429b2dd
commit caaf6a8aa9
3 changed files with 35 additions and 16 deletions

View File

@ -491,24 +491,12 @@ static void rgui_render(void)
char message[PATH_MAX_LENGTH], type_str[PATH_MAX_LENGTH],
entry_title_buf[PATH_MAX_LENGTH], type_str_buf[PATH_MAX_LENGTH],
path_buf[PATH_MAX_LENGTH];
const char *path = NULL, *entry_label = NULL;
unsigned type = 0, w = 0;
unsigned w = 0;
bool selected = false;
menu_file_list_cbs_t *cbs = NULL;
menu_list_get_at_offset(menu->menu_list->selection_buf, i, &path,
&entry_label, &type);
cbs = (menu_file_list_cbs_t*)
menu_list_get_actiondata_at_offset(menu->menu_list->selection_buf,
i);
if (cbs && cbs->action_get_representation)
cbs->action_get_representation(menu->menu_list->selection_buf,
&w, type, i, label,
type_str, sizeof(type_str),
entry_label, path,
path_buf, sizeof(path_buf));
menu_display_setting_label(i, &w, label,
type_str, sizeof(type_str),
path_buf, sizeof(path_buf));
selected = (i == menu->navigation.selection_ptr);

View File

@ -206,3 +206,29 @@ void menu_display_unset_viewport(menu_handle_t *menu)
video_driver_set_viewport(global->video_data.width,
global->video_data.height, false, true);
}
void menu_display_setting_label(unsigned i, unsigned *w,
const char *label,
char *type_str, size_t sizeof_type_str,
char *path_buf, size_t sizeof_path_buf)
{
unsigned type = 0;
const char *path = NULL;
const char *entry_label = NULL;
menu_file_list_cbs_t *cbs = NULL;
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_get_at_offset(menu->menu_list->selection_buf, i, &path,
&entry_label, &type);
cbs = (menu_file_list_cbs_t*)
menu_list_get_actiondata_at_offset(menu->menu_list->selection_buf,
i);
if (cbs && cbs->action_get_representation)
cbs->action_get_representation(menu->menu_list->selection_buf,
w, type, i, label,
type_str, sizeof_type_str,
entry_label, path,
path_buf, sizeof_path_buf);
}

View File

@ -53,6 +53,11 @@ void menu_display_set_viewport(menu_handle_t *menu);
void menu_display_unset_viewport(menu_handle_t *menu);
void menu_display_setting_label(unsigned i, unsigned *w,
const char *label,
char *type_str, size_t sizeof_type_str,
char *path_buf, size_t sizeof_path_buf);
#ifdef __cplusplus
}
#endif