RetroArch
Classes | Macros | Typedefs | Enumerations | Functions | Variables
materialui.c File Reference
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <compat/posix_string.h>
#include <compat/strl.h>
#include <file/file_path.h>
#include <formats/image.h>
#include <gfx/math/matrix_4x4.h>
#include <string/stdstring.h>
#include <streams/file_stream.h>
#include <lists/string_list.h>
#include <encodings/utf.h>
#include "../../frontend/frontend_driver.h"
#include "menu_generic.h"
#include "../menu_driver.h"
#include "../menu_animation.h"
#include "../menu_input.h"
#include "../widgets/menu_input_dialog.h"
#include "../widgets/menu_osk.h"
#include "../../core_info.h"
#include "../../core.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../tasks/tasks_internal.h"
#include "../../file_path_special.h"
Include dependency graph for materialui.c:

Classes

struct  materialui_node_t
 
struct  materialui_handle
 

Macros

#define MUI_SYSTEM_TAB_END   MUI_SYSTEM_TAB_SETTINGS
 

Typedefs

typedef struct materialui_handle materialui_handle_t
 

Enumerations

enum  {
  MUI_TEXTURE_POINTER = 0, MUI_TEXTURE_BACK, MUI_TEXTURE_SWITCH_ON, MUI_TEXTURE_SWITCH_OFF,
  MUI_TEXTURE_TAB_MAIN, MUI_TEXTURE_TAB_PLAYLISTS, MUI_TEXTURE_TAB_SETTINGS, MUI_TEXTURE_KEY,
  MUI_TEXTURE_KEY_HOVER, MUI_TEXTURE_FOLDER, MUI_TEXTURE_PARENT_DIRECTORY, MUI_TEXTURE_IMAGE,
  MUI_TEXTURE_ARCHIVE, MUI_TEXTURE_VIDEO, MUI_TEXTURE_MUSIC, MUI_TEXTURE_QUIT,
  MUI_TEXTURE_HELP, MUI_TEXTURE_UPDATE, MUI_TEXTURE_HISTORY, MUI_TEXTURE_INFO,
  MUI_TEXTURE_ADD, MUI_TEXTURE_SETTINGS, MUI_TEXTURE_FILE, MUI_TEXTURE_PLAYLIST,
  MUI_TEXTURE_UPDATER, MUI_TEXTURE_QUICKMENU, MUI_TEXTURE_NETPLAY, MUI_TEXTURE_CORES,
  MUI_TEXTURE_SHADERS, MUI_TEXTURE_CONTROLS, MUI_TEXTURE_CLOSE, MUI_TEXTURE_CORE_OPTIONS,
  MUI_TEXTURE_CORE_CHEAT_OPTIONS, MUI_TEXTURE_RESUME, MUI_TEXTURE_RESTART, MUI_TEXTURE_ADD_TO_FAVORITES,
  MUI_TEXTURE_RUN, MUI_TEXTURE_RENAME, MUI_TEXTURE_DATABASE, MUI_TEXTURE_ADD_TO_MIXER,
  MUI_TEXTURE_SCAN, MUI_TEXTURE_REMOVE, MUI_TEXTURE_START_CORE, MUI_TEXTURE_LOAD_STATE,
  MUI_TEXTURE_SAVE_STATE, MUI_TEXTURE_UNDO_LOAD_STATE, MUI_TEXTURE_UNDO_SAVE_STATE, MUI_TEXTURE_STATE_SLOT,
  MUI_TEXTURE_TAKE_SCREENSHOT, MUI_TEXTURE_CONFIGURATIONS, MUI_TEXTURE_LOAD_CONTENT, MUI_TEXTURE_DISK,
  MUI_TEXTURE_EJECT, MUI_TEXTURE_LAST
}
 
enum  { MUI_SYSTEM_TAB_MAIN = 0, MUI_SYSTEM_TAB_PLAYLISTS, MUI_SYSTEM_TAB_SETTINGS }
 

Functions

static const char * materialui_texture_path (unsigned id)
 
static void materialui_context_reset_textures (materialui_handle_t *mui)
 
static void materialui_draw_icon (video_frame_info_t *video_info, unsigned icon_size, uintptr_t texture, float x, float y, unsigned width, unsigned height, float rotation, float scale_factor, float *color)
 
static void materialui_draw_tab (materialui_handle_t *mui, video_frame_info_t *video_info, unsigned i, unsigned width, unsigned height, float *tab_color, float *active_tab_color)
 
static void materialui_draw_tab_begin (materialui_handle_t *mui, video_frame_info_t *video_info, unsigned width, unsigned height, float *tabs_bg_color, float *tabs_separator_color)
 
static void materialui_draw_tab_end (materialui_handle_t *mui, video_frame_info_t *video_info, unsigned width, unsigned height, unsigned header_height, float *active_tab_marker_color)
 
static void materialui_draw_scrollbar (materialui_handle_t *mui, video_frame_info_t *video_info, unsigned width, unsigned height, float *coord_color)
 
static void materialui_get_message (void *data, const char *message)
 
static void materialui_render_messagebox (materialui_handle_t *mui, video_frame_info_t *video_info, const char *message, float *body_bg_color, uint32_t font_color)
 
static unsigned materialui_count_lines (const char *str)
 
static void materialui_compute_entries_box (materialui_handle_t *mui, int width)
 
static void materialui_render (void *data, bool is_idle)
 
static void materialui_render_label_value (materialui_handle_t *mui, video_frame_info_t *video_info, materialui_node_t *node, int i, int y, unsigned width, unsigned height, uint64_t index, uint32_t color, bool selected, const char *label, const char *value, float *label_color, uint32_t sublabel_color)
 
static void materialui_render_menu_list (video_frame_info_t *video_info, materialui_handle_t *mui, unsigned width, unsigned height, uint32_t font_normal_color, uint32_t font_hover_color, float *menu_list_color, uint32_t sublabel_color)
 
static size_t materialui_list_get_size (void *data, enum menu_list_type type)
 
static int materialui_get_core_title (char *s, size_t len)
 
static void materialui_draw_bg (menu_display_ctx_draw_t *draw, video_frame_info_t *video_info)
 
static void materialui_frame (void *data, video_frame_info_t *video_info)
 
static void materialui_layout (materialui_handle_t *mui, bool video_is_threaded)
 
static voidmaterialui_init (void **userdata, bool video_is_threaded)
 
static void materialui_free (void *data)
 
static void materialui_context_bg_destroy (materialui_handle_t *mui)
 
static void materialui_context_destroy (void *data)
 
static bool materialui_load_image (void *userdata, void *data, enum menu_image_type type)
 
static float materialui_get_scroll (materialui_handle_t *mui)
 
static void materialui_navigation_set (void *data, bool scroll)
 
static void materialui_list_set_selection (void *data, file_list_t *list)
 
static void materialui_navigation_clear (void *data, bool pending_push)
 
static void materialui_navigation_set_last (void *data)
 
static void materialui_navigation_alphabet (void *data, size_t *unused)
 
static void materialui_populate_entries (void *data, const char *path, const char *label, unsigned i)
 
static void materialui_context_reset (void *data, bool is_threaded)
 
static int materialui_environ (enum menu_environ_cb type, void *data, void *userdata)
 
static void materialui_preswitch_tabs (materialui_handle_t *mui, unsigned action)
 
static void materialui_list_cache (void *data, enum menu_list_type type, unsigned action)
 
static int materialui_list_push (void *data, void *userdata, menu_displaylist_info_t *info, unsigned type)
 
static size_t materialui_list_get_selection (void *data)
 
static int materialui_pointer_down (void *userdata, unsigned x, unsigned y, unsigned ptr, menu_file_list_cbs_t *cbs, menu_entry_t *entry, unsigned action)
 
static int materialui_pointer_up (void *userdata, unsigned x, unsigned y, unsigned ptr, menu_file_list_cbs_t *cbs, menu_entry_t *entry, unsigned action)
 
static void materialui_list_insert (void *userdata, file_list_t *list, const char *path, const char *fullpath, const char *label, size_t list_size, unsigned type)
 
static void materialui_list_clear (file_list_t *list)
 

Variables

menu_ctx_driver_t menu_ctx_mui
 

Macro Definition Documentation

◆ MUI_SYSTEM_TAB_END

#define MUI_SYSTEM_TAB_END   MUI_SYSTEM_TAB_SETTINGS

Typedef Documentation

◆ materialui_handle_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MUI_TEXTURE_POINTER 
MUI_TEXTURE_BACK 
MUI_TEXTURE_SWITCH_ON 
MUI_TEXTURE_SWITCH_OFF 
MUI_TEXTURE_TAB_MAIN 
MUI_TEXTURE_TAB_PLAYLISTS 
MUI_TEXTURE_TAB_SETTINGS 
MUI_TEXTURE_KEY 
MUI_TEXTURE_KEY_HOVER 
MUI_TEXTURE_FOLDER 
MUI_TEXTURE_PARENT_DIRECTORY 
MUI_TEXTURE_IMAGE 
MUI_TEXTURE_ARCHIVE 
MUI_TEXTURE_VIDEO 
MUI_TEXTURE_MUSIC 
MUI_TEXTURE_QUIT 
MUI_TEXTURE_HELP 
MUI_TEXTURE_UPDATE 
MUI_TEXTURE_HISTORY 
MUI_TEXTURE_INFO 
MUI_TEXTURE_ADD 
MUI_TEXTURE_SETTINGS 
MUI_TEXTURE_FILE 
MUI_TEXTURE_PLAYLIST 
MUI_TEXTURE_UPDATER 
MUI_TEXTURE_QUICKMENU 
MUI_TEXTURE_NETPLAY 
MUI_TEXTURE_CORES 
MUI_TEXTURE_SHADERS 
MUI_TEXTURE_CONTROLS 
MUI_TEXTURE_CLOSE 
MUI_TEXTURE_CORE_OPTIONS 
MUI_TEXTURE_CORE_CHEAT_OPTIONS 
MUI_TEXTURE_RESUME 
MUI_TEXTURE_RESTART 
MUI_TEXTURE_ADD_TO_FAVORITES 
MUI_TEXTURE_RUN 
MUI_TEXTURE_RENAME 
MUI_TEXTURE_DATABASE 
MUI_TEXTURE_ADD_TO_MIXER 
MUI_TEXTURE_SCAN 
MUI_TEXTURE_REMOVE 
MUI_TEXTURE_START_CORE 
MUI_TEXTURE_LOAD_STATE 
MUI_TEXTURE_SAVE_STATE 
MUI_TEXTURE_UNDO_LOAD_STATE 
MUI_TEXTURE_UNDO_SAVE_STATE 
MUI_TEXTURE_STATE_SLOT 
MUI_TEXTURE_TAKE_SCREENSHOT 
MUI_TEXTURE_CONFIGURATIONS 
MUI_TEXTURE_LOAD_CONTENT 
MUI_TEXTURE_DISK 
MUI_TEXTURE_EJECT 
MUI_TEXTURE_LAST 

◆ anonymous enum

anonymous enum
Enumerator
MUI_SYSTEM_TAB_MAIN 
MUI_SYSTEM_TAB_PLAYLISTS 
MUI_SYSTEM_TAB_SETTINGS 

Function Documentation

◆ materialui_compute_entries_box()

static void materialui_compute_entries_box ( materialui_handle_t mui,
int  width 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_context_bg_destroy()

static void materialui_context_bg_destroy ( materialui_handle_t mui)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_context_destroy()

static void materialui_context_destroy ( void data)
static
Here is the call graph for this function:

◆ materialui_context_reset()

static void materialui_context_reset ( void data,
bool  is_threaded 
)
static
Here is the call graph for this function:

◆ materialui_context_reset_textures()

static void materialui_context_reset_textures ( materialui_handle_t mui)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_count_lines()

static unsigned materialui_count_lines ( const char *  str)
static
Here is the caller graph for this function:

◆ materialui_draw_bg()

static void materialui_draw_bg ( menu_display_ctx_draw_t draw,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_draw_icon()

static void materialui_draw_icon ( video_frame_info_t video_info,
unsigned  icon_size,
uintptr_t  texture,
float  x,
float  y,
unsigned  width,
unsigned  height,
float  rotation,
float  scale_factor,
float *  color 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_draw_scrollbar()

static void materialui_draw_scrollbar ( materialui_handle_t mui,
video_frame_info_t video_info,
unsigned  width,
unsigned  height,
float *  coord_color 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_draw_tab()

static void materialui_draw_tab ( materialui_handle_t mui,
video_frame_info_t video_info,
unsigned  i,
unsigned  width,
unsigned  height,
float *  tab_color,
float *  active_tab_color 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_draw_tab_begin()

static void materialui_draw_tab_begin ( materialui_handle_t mui,
video_frame_info_t video_info,
unsigned  width,
unsigned  height,
float *  tabs_bg_color,
float *  tabs_separator_color 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_draw_tab_end()

static void materialui_draw_tab_end ( materialui_handle_t mui,
video_frame_info_t video_info,
unsigned  width,
unsigned  height,
unsigned  header_height,
float *  active_tab_marker_color 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_environ()

static int materialui_environ ( enum menu_environ_cb  type,
void data,
void userdata 
)
static

◆ materialui_frame()

static void materialui_frame ( void data,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:

◆ materialui_free()

static void materialui_free ( void data)
static
Here is the call graph for this function:

◆ materialui_get_core_title()

static int materialui_get_core_title ( char *  s,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_get_message()

static void materialui_get_message ( void data,
const char *  message 
)
static
Here is the call graph for this function:

◆ materialui_get_scroll()

static float materialui_get_scroll ( materialui_handle_t mui)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_init()

static void* materialui_init ( void **  userdata,
bool  video_is_threaded 
)
static
Here is the call graph for this function:

◆ materialui_layout()

static void materialui_layout ( materialui_handle_t mui,
bool  video_is_threaded 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_list_cache()

static void materialui_list_cache ( void data,
enum menu_list_type  type,
unsigned  action 
)
static
Here is the call graph for this function:

◆ materialui_list_clear()

static void materialui_list_clear ( file_list_t list)
static
Here is the call graph for this function:

◆ materialui_list_get_selection()

static size_t materialui_list_get_selection ( void data)
static

◆ materialui_list_get_size()

static size_t materialui_list_get_size ( void data,
enum menu_list_type  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_list_insert()

static void materialui_list_insert ( void userdata,
file_list_t list,
const char *  path,
const char *  fullpath,
const char *  label,
size_t  list_size,
unsigned  type 
)
static
Here is the call graph for this function:

◆ materialui_list_push()

static int materialui_list_push ( void data,
void userdata,
menu_displaylist_info_t info,
unsigned  type 
)
static
Here is the call graph for this function:

◆ materialui_list_set_selection()

static void materialui_list_set_selection ( void data,
file_list_t list 
)
static
Here is the call graph for this function:

◆ materialui_load_image()

static bool materialui_load_image ( void userdata,
void data,
enum menu_image_type  type 
)
static
Here is the call graph for this function:

◆ materialui_navigation_alphabet()

static void materialui_navigation_alphabet ( void data,
size_t *  unused 
)
static
Here is the call graph for this function:

◆ materialui_navigation_clear()

static void materialui_navigation_clear ( void data,
bool  pending_push 
)
static
Here is the call graph for this function:

◆ materialui_navigation_set()

static void materialui_navigation_set ( void data,
bool  scroll 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_navigation_set_last()

static void materialui_navigation_set_last ( void data)
static
Here is the call graph for this function:

◆ materialui_pointer_down()

static int materialui_pointer_down ( void userdata,
unsigned  x,
unsigned  y,
unsigned  ptr,
menu_file_list_cbs_t cbs,
menu_entry_t entry,
unsigned  action 
)
static
Here is the call graph for this function:

◆ materialui_pointer_up()

static int materialui_pointer_up ( void userdata,
unsigned  x,
unsigned  y,
unsigned  ptr,
menu_file_list_cbs_t cbs,
menu_entry_t entry,
unsigned  action 
)
static
Here is the call graph for this function:

◆ materialui_populate_entries()

static void materialui_populate_entries ( void data,
const char *  path,
const char *  label,
unsigned  i 
)
static
Here is the call graph for this function:

◆ materialui_preswitch_tabs()

static void materialui_preswitch_tabs ( materialui_handle_t mui,
unsigned  action 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_render()

static void materialui_render ( void data,
bool  is_idle 
)
static
Here is the call graph for this function:

◆ materialui_render_label_value()

static void materialui_render_label_value ( materialui_handle_t mui,
video_frame_info_t video_info,
materialui_node_t node,
int  i,
int  y,
unsigned  width,
unsigned  height,
uint64_t  index,
uint32_t  color,
bool  selected,
const char *  label,
const char *  value,
float *  label_color,
uint32_t  sublabel_color 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_render_menu_list()

static void materialui_render_menu_list ( video_frame_info_t video_info,
materialui_handle_t mui,
unsigned  width,
unsigned  height,
uint32_t  font_normal_color,
uint32_t  font_hover_color,
float *  menu_list_color,
uint32_t  sublabel_color 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_render_messagebox()

static void materialui_render_messagebox ( materialui_handle_t mui,
video_frame_info_t video_info,
const char *  message,
float *  body_bg_color,
uint32_t  font_color 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ materialui_texture_path()

static const char* materialui_texture_path ( unsigned  id)
static
Here is the caller graph for this function:

Variable Documentation

◆ menu_ctx_mui

menu_ctx_driver_t menu_ctx_mui