From 1078d6fc54fcab427964a132eb2865faa9bac37e Mon Sep 17 00:00:00 2001 From: ashn Date: Wed, 27 Dec 2023 17:56:17 -0500 Subject: [PATCH] De-macroify mu_header --- microui.c | 6 ++++++ microui.h | 2 +- microui.sunder | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/microui.c b/microui.c index 3dc3f80..331faae 100644 --- a/microui.c +++ b/microui.c @@ -1052,6 +1052,12 @@ header(mu_Context* ctx, char const* label, int istreenode, int opt) return expanded ? MU_RES_ACTIVE : 0; } +int +mu_header(mu_Context* ctx, char const* label) +{ + return mu_header_ex(ctx, label, 0); +} + int mu_header_ex(mu_Context* ctx, char const* label, int opt) { diff --git a/microui.h b/microui.h index d2567b0..141b4c6 100644 --- a/microui.h +++ b/microui.h @@ -267,7 +267,6 @@ void mu_draw_control_text(mu_Context* ctx, char const* str, mu_Rect rect, int co int mu_mouse_over(mu_Context* ctx, mu_Rect rect); void mu_update_control(mu_Context* ctx, mu_Id id, mu_Rect rect, int opt); -#define mu_header(ctx, label) mu_header_ex(ctx, label, 0) #define mu_begin_treenode(ctx, label) mu_begin_treenode_ex(ctx, label, 0) #define mu_begin_window(ctx, title, rect) mu_begin_window_ex(ctx, title, rect, 0) #define mu_begin_panel(ctx, name) mu_begin_panel_ex(ctx, name, 0) @@ -284,6 +283,7 @@ int mu_slider(mu_Context* ctx, mu_Real *value, mu_Real lo, mu_Real hi); int mu_slider_ex(mu_Context* ctx, mu_Real *value, mu_Real low, mu_Real high, mu_Real step, char const* fmt, int opt); int mu_number(mu_Context* ctx, mu_Real *value, mu_Real step); int mu_number_ex(mu_Context* ctx, mu_Real *value, mu_Real step, char const* fmt, int opt); +int mu_header(mu_Context* ctx, char const* label); int mu_header_ex(mu_Context* ctx, char const* label, int opt); int mu_begin_treenode_ex(mu_Context* ctx, char const* label, int opt); void mu_end_treenode(mu_Context* ctx); diff --git a/microui.sunder b/microui.sunder index 44d40a4..0d3e6f0 100644 --- a/microui.sunder +++ b/microui.sunder @@ -232,7 +232,6 @@ extern func mu_draw_control_text(ctx: *mu_Context, str: *char, rect: mu_Rect, co extern func mu_mouse_over(ctx: *mu_Context, rect: mu_Rect) sint; extern func mu_update_control(ctx: *mu_Context, id: mu_Id, rect: mu_Rect, opt: sint) void; -func mu_header(ctx: *mu_Context, label: *char) sint { return mu_header_ex(ctx, label, 0); } func mu_begin_treenode(ctx: *mu_Context, label: *char) sint { return mu_begin_treenode_ex(ctx, label, 0); } func mu_begin_window(ctx: *mu_Context, title: *char, rect: mu_Rect) sint { return mu_begin_window_ex(ctx, title, rect, 0); } func mu_begin_panel(ctx: *mu_Context, name: *char) void { mu_begin_panel_ex(ctx, name, 0); } @@ -251,6 +250,7 @@ extern func mu_number(ctx: *mu_Context, value: *mu_Real, step: mu_Real) sint; extern func mu_number_ex(ctx: *mu_Context, value: *mu_Real, step: mu_Real, fmt: *char, opt: sint) sint; extern func mu_begin_treenode_ex(ctx: *mu_Context, label: *char, opt: sint) sint; extern func mu_end_treenode(ctx: *mu_Context) void; +extern func mu_header(ctx: *mu_Context, label: *char) sint; extern func mu_header_ex(ctx: *mu_Context, label: *char, opt: sint) sint; extern func mu_begin_window_ex(ctx: *mu_Context, title: *char, rect: mu_Rect, opt: sint) sint; extern func mu_end_window(ctx: *mu_Context) void;