N64FlashcartMenu
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
ui_components.h File Reference

Menu Graphical User Interface Components. More...

Go to the source code of this file.

Data Structures

struct  component_context_menu_t
 Context menu structure. More...
 
struct  component_boxart_t
 Box Art Structure. More...
 
struct  component_context_menu_t.list
 

Macros

#define COMPONENT_CONTEXT_MENU_LIST_END   { .text = NULL }
 

Enumerations

enum  file_image_type_t {
  IMAGE_BOXART_FRONT , IMAGE_BOXART_BACK , IMAGE_BOXART_TOP , IMAGE_BOXART_BOTTOM ,
  IMAGE_BOXART_LEFT , IMAGE_BOXART_RIGHT , IMAGE_GAMEPAK_FRONT , IMAGE_GAMEPAK_BACK ,
  IMAGE_THUMBNAIL , IMAGE_TYPE_END
}
 File image Enumeration. More...
 

Functions

void ui_components_box_draw (int x0, int y0, int x1, int y1, color_t color)
 Draw a box component.
 
void ui_components_border_draw (int x0, int y0, int x1, int y1)
 Draw a border component.
 
void ui_components_layout_draw (void)
 Draw the layout component.
 
void ui_components_progressbar_draw (int x0, int y0, int x1, int y1, float progress)
 Draw a progress bar component.
 
void ui_components_seekbar_draw (float progress)
 Draw a seek bar component.
 
void ui_components_loader_draw (float position)
 Draw a loader component.
 
void ui_components_scrollbar_draw (int x, int y, int width, int height, int position, int items, int visible_items)
 Draw a scrollbar component.
 
void ui_components_list_scrollbar_draw (int position, int items, int visible_items)
 Draw a list scrollbar component.
 
void ui_components_dialog_draw (int width, int height)
 Draw a dialog component.
 
void ui_components_messagebox_draw (char *fmt,...)
 Draw a message box component.
 
void ui_components_main_text_draw (rdpq_align_t align, rdpq_valign_t valign, char *fmt,...)
 Draw the main text component.
 
void ui_components_actions_bar_text_draw (rdpq_align_t align, rdpq_valign_t valign, char *fmt,...)
 Draw the actions bar text component.
 
void ui_components_background_init (char *cache_location)
 Initialize the background component.
 
void ui_components_background_free (void)
 Free the background component resources.
 
void ui_components_background_replace_image (surface_t *image)
 Replace the background image.
 
void ui_components_background_draw (void)
 Draw the background component.
 
void ui_components_file_list_draw (entry_t *list, int entries, int selected)
 Draw the file list component.
 
void ui_components_context_menu_init (component_context_menu_t *cm)
 Initialize the context menu component.
 
void ui_components_context_menu_show (component_context_menu_t *cm)
 Show the context menu component.
 
bool ui_components_context_menu_process (menu_t *menu, component_context_menu_t *cm)
 Process the context menu component.
 
void ui_components_context_menu_draw (component_context_menu_t *cm)
 Draw the context menu component.
 
component_boxart_tui_components_boxart_init (const char *storage_prefix, char *game_code, file_image_type_t current_image_view)
 Initialize the box art component.
 
void ui_components_boxart_free (component_boxart_t *b)
 Free the box art component resources.
 
void ui_components_boxart_draw (component_boxart_t *b)
 Draw the box art component.
 

Detailed Description

Menu Graphical User Interface Components.


Data Structure Documentation

◆ component_context_menu_t

struct component_context_menu_t

Context menu structure.

Data Fields
int row_count

Number of rows in the context menu

int row_selected

Index of the selected row

bool hide_pending

Flag to indicate if hiding is pending

struct component_context_menu * parent

Pointer to the parent context menu

struct component_context_menu * submenu

Pointer to the submenu

struct component_context_menu_t.list list[]

List of menu items

◆ component_boxart_t

struct component_boxart_t

Box Art Structure.

Data Fields
bool loading

Flag to indicate if the box art is loading

surface_t * image

Pointer to the box art image

Macro Definition Documentation

◆ COMPONENT_CONTEXT_MENU_LIST_END

#define COMPONENT_CONTEXT_MENU_LIST_END   { .text = NULL }

End marker for the context menu list

Enumeration Type Documentation

◆ file_image_type_t

File image Enumeration.

Enumeration for different types of file images used in the user interface.

Enumerator
IMAGE_BOXART_FRONT 

Boxart image from the front

IMAGE_BOXART_BACK 

Boxart image from the back

IMAGE_BOXART_TOP 

Boxart image from the top

IMAGE_BOXART_BOTTOM 

Boxart image from the bottom

IMAGE_BOXART_LEFT 

Boxart image from the left side

IMAGE_BOXART_RIGHT 

Boxart image from the right side

IMAGE_GAMEPAK_FRONT 

GamePak image from the front

IMAGE_GAMEPAK_BACK 

GamePak image from the back

IMAGE_THUMBNAIL 

File image thumbnail

IMAGE_TYPE_END 

List end marker

Function Documentation

◆ ui_components_box_draw()

void ui_components_box_draw ( int  x0,
int  y0,
int  x1,
int  y1,
color_t  color 
)

Draw a box component.

Parameters
x0Starting x-coordinate.
y0Starting y-coordinate.
x1Ending x-coordinate.
y1Ending y-coordinate.
colorColor of the box.

◆ ui_components_border_draw()

void ui_components_border_draw ( int  x0,
int  y0,
int  x1,
int  y1 
)

Draw a border component.

Parameters
x0Starting x-coordinate.
y0Starting y-coordinate.
x1Ending x-coordinate.
y1Ending y-coordinate.

◆ ui_components_progressbar_draw()

void ui_components_progressbar_draw ( int  x0,
int  y0,
int  x1,
int  y1,
float  progress 
)

Draw a progress bar component.

Parameters
x0Starting x-coordinate.
y0Starting y-coordinate.
x1Ending x-coordinate.
y1Ending y-coordinate.
progressProgress value (0.0 to 1.0).

◆ ui_components_seekbar_draw()

void ui_components_seekbar_draw ( float  progress)

Draw a seek bar component.

Parameters
progressProgress value (0.0 to 1.0).

◆ ui_components_loader_draw()

void ui_components_loader_draw ( float  position)

Draw a loader component.

Parameters
positionPosition value (0.0 to 1.0).

◆ ui_components_scrollbar_draw()

void ui_components_scrollbar_draw ( int  x,
int  y,
int  width,
int  height,
int  position,
int  items,
int  visible_items 
)

Draw a scrollbar component.

Parameters
xStarting x-coordinate.
yStarting y-coordinate.
widthWidth of the scrollbar.
heightHeight of the scrollbar.
positionCurrent position.
itemsTotal number of items.
visible_itemsNumber of visible items.

◆ ui_components_list_scrollbar_draw()

void ui_components_list_scrollbar_draw ( int  position,
int  items,
int  visible_items 
)

Draw a list scrollbar component.

Parameters
positionCurrent position.
itemsTotal number of items.
visible_itemsNumber of visible items.

◆ ui_components_dialog_draw()

void ui_components_dialog_draw ( int  width,
int  height 
)

Draw a dialog component.

Parameters
widthWidth of the dialog.
heightHeight of the dialog.

◆ ui_components_messagebox_draw()

void ui_components_messagebox_draw ( char *  fmt,
  ... 
)

Draw a message box component.

Parameters
fmtFormat string for the message.
...Additional arguments for the format string.

◆ ui_components_main_text_draw()

void ui_components_main_text_draw ( rdpq_align_t  align,
rdpq_valign_t  valign,
char *  fmt,
  ... 
)

Draw the main text component.

Parameters
alignHorizontal alignment.
valignVertical alignment.
fmtFormat string for the text.
...Additional arguments for the format string.

◆ ui_components_actions_bar_text_draw()

void ui_components_actions_bar_text_draw ( rdpq_align_t  align,
rdpq_valign_t  valign,
char *  fmt,
  ... 
)

Draw the actions bar text component.

Parameters
alignHorizontal alignment.
valignVertical alignment.
fmtFormat string for the text.
...Additional arguments for the format string.

◆ ui_components_background_init()

void ui_components_background_init ( char *  cache_location)

Initialize the background component.

Parameters
cache_locationLocation of the cache.

◆ ui_components_background_replace_image()

void ui_components_background_replace_image ( surface_t *  image)

Replace the background image.

Parameters
imageNew background image.

◆ ui_components_file_list_draw()

void ui_components_file_list_draw ( entry_t list,
int  entries,
int  selected 
)

Draw the file list component.

Parameters
listList of entries.
entriesNumber of entries.
selectedIndex of the selected entry.

◆ ui_components_context_menu_init()

void ui_components_context_menu_init ( component_context_menu_t cm)

Initialize the context menu component.

Parameters
cmPointer to the context menu structure.

◆ ui_components_context_menu_show()

void ui_components_context_menu_show ( component_context_menu_t cm)

Show the context menu component.

Parameters
cmPointer to the context menu structure.

◆ ui_components_context_menu_process()

bool ui_components_context_menu_process ( menu_t menu,
component_context_menu_t cm 
)

Process the context menu component.

Parameters
menuPointer to the menu structure.
cmPointer to the context menu structure.
Returns
True if the context menu was processed, false otherwise.

◆ ui_components_context_menu_draw()

void ui_components_context_menu_draw ( component_context_menu_t cm)

Draw the context menu component.

Parameters
cmPointer to the context menu structure.

◆ ui_components_boxart_init()

component_boxart_t * ui_components_boxart_init ( const char *  storage_prefix,
char *  game_code,
file_image_type_t  current_image_view 
)

Initialize the box art component.

Parameters
storage_prefixPrefix for the storage location.
game_codeGame code for the box art.
current_image_viewCurrent image view type.
Returns
Pointer to the initialized box art component.

◆ ui_components_boxart_free()

void ui_components_boxart_free ( component_boxart_t b)

Free the box art component resources.

Parameters
bPointer to the box art component.

◆ ui_components_boxart_draw()

void ui_components_boxart_draw ( component_boxart_t b)

Draw the box art component.

Parameters
bPointer to the box art component.