muteki
Loading...
Searching...
No Matches
ui_component_s Struct Reference

Common part of all widgets and views. More...

#include <common.h>

Data Fields

ui_component_tnext
 Next component in a component ring or list.
 
ui_component_tparent
 Parent component.
 
unsigned short state
 Component state bit field.
 
short unk_0xa
 Unknown. Set to 1 on buttons and 0xfd01 on deskbox views.
 
ui_rect_t footprint
 Component visual footprint.
 
void(* on_change_state )(ui_component_t *self, unsigned short mask, bool value)
 Component state change callback.
 
void(* on_erase_bg )(ui_component_t *self)
 Component callback for erasing background.
 
void(* on_draw )(ui_component_t *self)
 Component draw callback.
 
void(* on_event )(ui_component_t *self, ui_event_t *event)
 Component event callback.
 
void * unk_0x24
 Unknown. Used in MessageBox().
 
short unk_0x28
 Unknown.
 
short unk_0x2a
 Unknown. Set to 0x65 on buttons.
 
int unk_0x2c
 Unknown.
 
unsigned short tag
 
short unk_0x32
 Unknown. Probably padding.
 

Detailed Description

Common part of all widgets and views.

Todo:
Find a way to make the callbacks respect subtypes? Currently type-specific callbacks need to have their self argument defined as ui_component_t * (or void * if we opt to do that) which is a bit less ideal.

Field Documentation

◆ footprint

ui_rect_t ui_component_s::footprint

Component visual footprint.

This defines the size and location of the component on screen.

◆ next

ui_component_t* ui_component_s::next

Next component in a component ring or list.

This will be set to NULL when initialized, and, depending on context, will be a pointer to the next component, a pointer to this component or NULL.

◆ on_erase_bg

void(* ui_component_s::on_erase_bg) (ui_component_t *self)

Component callback for erasing background.

Todo:
Figure out exactly what this does.

◆ parent

ui_component_t* ui_component_s::parent

Parent component.

This will usually be a view.

◆ state

unsigned short ui_component_s::state

Component state bit field.

Each component may use this differently to represent different states.

◆ tag

unsigned short ui_component_s::tag

Component tag. Can be used to distinguish components under some circumstances (like when sharing a callback with another component). Does not need to be unique. Usually will be set by AllocBlock() after the memory was allocated.


The documentation for this struct was generated from the following file: