diff --git a/gui.c b/gui.c index 143206e..5442172 100644 --- a/gui.c +++ b/gui.c @@ -1793,6 +1793,24 @@ gui_panel_init(struct gui_panel *panel, gui_float x, gui_float y, gui_float w, panel->minimized = gui_false; } +void +gui_panel_add_flag(struct gui_panel *panel, gui_flags f) +{ + panel->flags |= f; +} + +void +gui_panel_remove_flag(struct gui_panel *panel, gui_flags f) +{ + panel->flags &= (gui_flags)~f; +} + +gui_bool +gui_panel_has_flag(struct gui_panel *panel, gui_flags f) +{ + return (panel->flags & f) ? gui_true: gui_false; +} + gui_bool gui_panel_begin(struct gui_panel_layout *l, struct gui_panel *p, const char *text, const struct gui_input *i) diff --git a/gui.h b/gui.h index d1606d8..900e433 100644 --- a/gui.h +++ b/gui.h @@ -1685,7 +1685,7 @@ struct gui_panel_layout { /* command draw call output command buffer */ }; -/* Panel */ + struct gui_layout; void gui_panel_init(struct gui_panel*, gui_float x, gui_float y, gui_float w, gui_float h, gui_flags, struct gui_command_buffer*, @@ -1699,6 +1699,21 @@ void gui_panel_init(struct gui_panel*, gui_float x, gui_float y, gui_float w, Output: - a newly initialized panel */ +void gui_panel_add_flag(struct gui_panel*, gui_flags); +/* this function adds panel flags to the panel + Input: + - panel flags to add the panel +*/ +void gui_panel_remove_flag(struct gui_panel*, gui_flags); +/* this function removes panel flags from the panel + Input: + - panel flags to remove from the panel +*/ +gui_bool gui_panel_has_flag(struct gui_panel*, gui_flags); +/* this function checks if a panel has given flag(s) + Input: + - panel flags to check for +*/ gui_bool gui_panel_begin(struct gui_panel_layout *layout, struct gui_panel*, const char *title, const struct gui_input*); /* this function begins the panel build up process