ui colors
This commit is contained in:
@@ -1,34 +1,48 @@
|
||||
// automatically generated using: C:\dev\wasm\src/ui/ui.meta.c
|
||||
fn void ui_push_id(ui_id_t v) { ui_id_node_t *n = ma_push_type(tcx.temp, ui_id_node_t); n->value = v; SLLS_PUSH(ui->id_stack, n); }
|
||||
fn void ui_pop_id(void) { SLLS_POP(ui->id_stack); }
|
||||
fn ui_id_t ui_top_id(void) { return ui->id_stack->value; }
|
||||
#define ui_set_id(x) defer_block(ui_push_id(x), ui_pop_id())
|
||||
fn void ui_push_lop(ui_lop_t v) { ui_lop_node_t *n = ma_push_type(tcx.temp, ui_lop_node_t); n->value = v; SLLS_PUSH(ui->lop_stack, n); }
|
||||
fn void ui_pop_lop(void) { SLLS_POP(ui->lop_stack); }
|
||||
fn ui_lop_t ui_top_lop(void) { return ui->lop_stack->value; }
|
||||
#define ui_set_lop(x) defer_block(ui_push_lop(x), ui_pop_lop())
|
||||
fn void ui_push_border_thickness(f32 v) { ui_f32_node_t *n = ma_push_type(tcx.temp, ui_f32_node_t); n->value = v; SLLS_PUSH(ui->border_thickness_stack, n); }
|
||||
fn void ui_pop_border_thickness(void) { SLLS_POP(ui->border_thickness_stack); }
|
||||
fn f32 ui_top_border_thickness(void) { return ui->border_thickness_stack->value; }
|
||||
#define ui_set_border_thickness(x) defer_block(ui_push_border_thickness(x), ui_pop_border_thickness())
|
||||
fn void ui_push_text_align(ui_text_align_t v) { ui_text_align_node_t *n = ma_push_type(tcx.temp, ui_text_align_node_t); n->value = v; SLLS_PUSH(ui->text_align_stack, n); }
|
||||
fn void ui_pop_text_align(void) { SLLS_POP(ui->text_align_stack); }
|
||||
fn ui_text_align_t ui_top_text_align(void) { return ui->text_align_stack->value; }
|
||||
#define ui_set_text_align(x) defer_block(ui_push_text_align(x), ui_pop_text_align())
|
||||
fn void ui_push_required_width(f32 v) { ui_f32_node_t *n = ma_push_type(tcx.temp, ui_f32_node_t); n->value = v; SLLS_PUSH(ui->required_width_stack, n); }
|
||||
fn void ui_pop_required_width(void) { SLLS_POP(ui->required_width_stack); }
|
||||
fn f32 ui_top_required_width(void) { return ui->required_width_stack->value; }
|
||||
#define ui_set_required_width(x) defer_block(ui_push_required_width(x), ui_pop_required_width())
|
||||
fn void ui_push_required_height(f32 v) { ui_f32_node_t *n = ma_push_type(tcx.temp, ui_f32_node_t); n->value = v; SLLS_PUSH(ui->required_height_stack, n); }
|
||||
fn void ui_pop_required_height(void) { SLLS_POP(ui->required_height_stack); }
|
||||
fn f32 ui_top_required_height(void) { return ui->required_height_stack->value; }
|
||||
#define ui_set_required_height(x) defer_block(ui_push_required_height(x), ui_pop_required_height())
|
||||
fn void ui_push_padding(v2f32_t v) { ui_v2f32_node_t *n = ma_push_type(tcx.temp, ui_v2f32_node_t); n->value = v; SLLS_PUSH(ui->padding_stack, n); }
|
||||
fn void ui_pop_padding(void) { SLLS_POP(ui->padding_stack); }
|
||||
fn v2f32_t ui_top_padding(void) { return ui->padding_stack->value; }
|
||||
#define ui_set_padding(x) defer_block(ui_push_padding(x), ui_pop_padding())
|
||||
fn void ui_push_background_color(v4f32_t v) { ui_v4f32_node_t *n = ma_push_type(tcx.temp, ui_v4f32_node_t); n->value = v; SLLS_PUSH(ui->background_color_stack, n); }
|
||||
fn void ui_pop_background_color(void) { SLLS_POP(ui->background_color_stack); }
|
||||
fn v4f32_t ui_top_background_color(void) { return ui->background_color_stack->value; }
|
||||
#define ui_set_background_color(x) defer_block(ui_push_background_color(x), ui_pop_background_color())
|
||||
fn void ui_push_border_color(v4f32_t v) { ui_v4f32_node_t *n = ma_push_type(tcx.temp, ui_v4f32_node_t); n->value = v; SLLS_PUSH(ui->border_color_stack, n); }
|
||||
fn void ui_pop_border_color(void) { SLLS_POP(ui->border_color_stack); }
|
||||
fn v4f32_t ui_top_border_color(void) { return ui->border_color_stack->value; }
|
||||
#define ui_set_border_color(x) defer_block(ui_push_border_color(x), ui_pop_border_color())
|
||||
fn void ui_push_text_color(v4f32_t v) { ui_v4f32_node_t *n = ma_push_type(tcx.temp, ui_v4f32_node_t); n->value = v; SLLS_PUSH(ui->text_color_stack, n); }
|
||||
fn void ui_pop_text_color(void) { SLLS_POP(ui->text_color_stack); }
|
||||
fn v4f32_t ui_top_text_color(void) { return ui->text_color_stack->value; }
|
||||
#define ui_set_text_color(x) defer_block(ui_push_text_color(x), ui_pop_text_color())
|
||||
fn void ui_push_radio_color(v4f32_t v) { ui_v4f32_node_t *n = ma_push_type(tcx.temp, ui_v4f32_node_t); n->value = v; SLLS_PUSH(ui->radio_color_stack, n); }
|
||||
fn void ui_pop_radio_color(void) { SLLS_POP(ui->radio_color_stack); }
|
||||
fn v4f32_t ui_top_radio_color(void) { return ui->radio_color_stack->value; }
|
||||
#define ui_set_radio_color(x) defer_block(ui_push_radio_color(x), ui_pop_radio_color())
|
||||
|
||||
fn void ui_assert_stacks_are_null(void) {
|
||||
assert(ui->id_stack == NULL);
|
||||
@@ -41,4 +55,25 @@ assert(ui->padding_stack == NULL);
|
||||
assert(ui->background_color_stack == NULL);
|
||||
assert(ui->border_color_stack == NULL);
|
||||
assert(ui->text_color_stack == NULL);
|
||||
assert(ui->radio_color_stack == NULL);
|
||||
}
|
||||
fn void ui_push_init_values(void) {
|
||||
ui_push_id(ui_idf("root"));
|
||||
ui_push_lop(ui_lop_cut_top);
|
||||
ui_push_border_thickness(1.0f);
|
||||
ui_push_text_align(ui_text_align_left);
|
||||
ui_push_background_color(v4f32_rgba255(245, 238, 230, 255));
|
||||
ui_push_border_color(v4f32_rgba255(230, 164, 180, 255));
|
||||
ui_push_text_color(v4f32_rgba255(0, 0, 0, 255));
|
||||
ui_push_radio_color(v4f32_rgba255(243, 215, 202, 255));
|
||||
}
|
||||
fn void ui_pop_init_values(void) {
|
||||
ui_pop_id();
|
||||
ui_pop_lop();
|
||||
ui_pop_border_thickness();
|
||||
ui_pop_text_align();
|
||||
ui_pop_background_color();
|
||||
ui_pop_border_color();
|
||||
ui_pop_text_color();
|
||||
ui_pop_radio_color();
|
||||
}
|
||||
Reference in New Issue
Block a user