added panel flag getter/setter

This commit is contained in:
vurtun 2015-07-02 13:08:44 +02:00
parent 9f5bd8bdea
commit 9180bc0b59
2 changed files with 34 additions and 1 deletions

18
gui.c
View File

@ -1793,6 +1793,24 @@ gui_panel_init(struct gui_panel *panel, gui_float x, gui_float y, gui_float w,
panel->minimized = gui_false; 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_bool
gui_panel_begin(struct gui_panel_layout *l, struct gui_panel *p, gui_panel_begin(struct gui_panel_layout *l, struct gui_panel *p,
const char *text, const struct gui_input *i) const char *text, const struct gui_input *i)

17
gui.h
View File

@ -1685,7 +1685,7 @@ struct gui_panel_layout {
/* command draw call output command buffer */ /* command draw call output command buffer */
}; };
/* Panel */
struct gui_layout; struct gui_layout;
void gui_panel_init(struct gui_panel*, gui_float x, gui_float y, gui_float w, 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*, 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: Output:
- a newly initialized panel - 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*, gui_bool gui_panel_begin(struct gui_panel_layout *layout, struct gui_panel*,
const char *title, const struct gui_input*); const char *title, const struct gui_input*);
/* this function begins the panel build up process /* this function begins the panel build up process