renamed hook functions

This commit is contained in:
vurtun 2015-05-12 17:05:12 +02:00
parent 43f492c34a
commit 4083142e71
3 changed files with 11 additions and 11 deletions

View File

@ -374,11 +374,11 @@ while (1) {
struct gui_canvas canvas; struct gui_canvas canvas;
gui_buffer_begin(&canvas, &buffer, window_width, window_height); gui_buffer_begin(&canvas, &buffer, window_width, window_height);
gui_hook_begin(&layout, &win.hook, &stack, "Demo", &canvas, &input); gui_panel_hook_begin(&layout, &win.hook, &stack, "Demo", &canvas, &input);
gui_panel_row(&layout, 30, 1); gui_panel_row(&layout, 30, 1);
if (gui_panel_button_text(&layout, "button", GUI_BUTTON_DEFAULT)) if (gui_panel_button_text(&layout, "button", GUI_BUTTON_DEFAULT))
fprintf(stdout, "button pressed!\n"); fprintf(stdout, "button pressed!\n");
gui_hook_end(&layout, &win.hook); gui_panel_hook_end(&layout, &win.hook);
gui_buffer_end(gui_hook_list(&win.hook), buffer, &status); gui_buffer_end(gui_hook_list(&win.hook), buffer, &status);
/* draw each panel */ /* draw each panel */

View File

@ -158,12 +158,12 @@ show_panel(struct show_window *show, struct gui_panel_stack *stack,
struct gui_input *in, struct gui_canvas *canvas) struct gui_input *in, struct gui_canvas *canvas)
{ {
struct gui_panel_layout layout; struct gui_panel_layout layout;
gui_hook_begin(&layout, &show->hook, stack, "Show", canvas, in); gui_panel_hook_begin(&layout, &show->hook, stack, "Show", canvas, in);
combobox_panel(&layout, show); combobox_panel(&layout, show);
widget_panel(&layout, show); widget_panel(&layout, show);
graph_panel(&layout, show); graph_panel(&layout, show);
table_panel(&layout, show); table_panel(&layout, show);
gui_hook_end(&layout, &show->hook); gui_panel_hook_end(&layout, &show->hook);
} }
static void static void
@ -299,11 +299,11 @@ control_panel(struct control_window *control, struct gui_panel_stack *stack,
{ {
gui_bool running; gui_bool running;
struct gui_panel_layout layout; struct gui_panel_layout layout;
running = gui_hook_begin(&layout, &control->hook, stack, "Control", canvas, in); running = gui_panel_hook_begin(&layout, &control->hook, stack, "Control", canvas, in);
flags_tab(&layout, control); flags_tab(&layout, control);
style_tab(&layout, control, config); style_tab(&layout, control, config);
color_tab(&layout, control, config); color_tab(&layout, control, config);
gui_hook_end(&layout, &control->hook); gui_panel_hook_end(&layout, &control->hook);
return running; return running;
} }
@ -312,7 +312,7 @@ init_demo(struct show_window *show, struct control_window *control,
struct gui_panel_stack *stack, struct gui_config *config, struct gui_font *font) struct gui_panel_stack *stack, struct gui_config *config, struct gui_font *font)
{ {
memset(show, 0, sizeof(*show)); memset(show, 0, sizeof(*show));
gui_hook_init(&show->hook, 50, 50, 300, 500, gui_panel_hook_init(&show->hook, 50, 50, 300, 500,
GUI_PANEL_BORDER|GUI_PANEL_MOVEABLE| GUI_PANEL_BORDER|GUI_PANEL_MOVEABLE|
GUI_PANEL_CLOSEABLE|GUI_PANEL_SCALEABLE| GUI_PANEL_CLOSEABLE|GUI_PANEL_SCALEABLE|
GUI_PANEL_MINIMIZABLE, config, font); GUI_PANEL_MINIMIZABLE, config, font);
@ -325,7 +325,7 @@ init_demo(struct show_window *show, struct control_window *control,
show->spinner = 100; show->spinner = 100;
memset(control, 0, sizeof(*control)); memset(control, 0, sizeof(*control));
gui_hook_init(&control->hook, 380, 50, 400, 350, gui_panel_hook_init(&control->hook, 380, 50, 400, 350,
GUI_PANEL_BORDER|GUI_PANEL_MOVEABLE|GUI_PANEL_CLOSEABLE|GUI_PANEL_SCALEABLE, config, font); GUI_PANEL_BORDER|GUI_PANEL_MOVEABLE|GUI_PANEL_CLOSEABLE|GUI_PANEL_SCALEABLE, config, font);
gui_stack_push(stack, &control->hook); gui_stack_push(stack, &control->hook);
control->show_flags = gui_hook_panel(&show->hook)->flags; control->show_flags = gui_hook_panel(&show->hook)->flags;

6
gui.h
View File

@ -612,11 +612,11 @@ void gui_stack_pop(struct gui_panel_stack*, struct gui_panel_hook*);
/* Hook */ /* Hook */
#define gui_hook_panel(h) (&((h)->GUI_HOOK_PANEL_NAME)) #define gui_hook_panel(h) (&((h)->GUI_HOOK_PANEL_NAME))
#define gui_hook_output(h) (&((h)->GUI_HOOK_OUTPUT_NAME)) #define gui_hook_output(h) (&((h)->GUI_HOOK_OUTPUT_NAME))
#define gui_hook_init(hook, x, y, w, h, flags, config, font)\ #define gui_panel_hook_init(hook, x, y, w, h, flags, config, font)\
gui_panel_init(&(*(hook)).GUI_HOOK_PANEL_NAME, x, y, w, h, flags, config, font) gui_panel_init(&(*(hook)).GUI_HOOK_PANEL_NAME, x, y, w, h, flags, config, font)
#define gui_hook_begin(layout, hook, stack, title, canvas, in)\ #define gui_panel_hook_begin(layout, hook, stack, title, canvas, in)\
gui_panel_begin_stacked(layout, &(*(hook)).GUI_HOOK_PANEL_NAME, stack, title, canvas, in) gui_panel_begin_stacked(layout, &(*(hook)).GUI_HOOK_PANEL_NAME, stack, title, canvas, in)
#define gui_hook_end(layout, hook)\ #define gui_panel_hook_end(layout, hook)\
gui_panel_end((layout), &(hook)->GUI_HOOK_PANEL_NAME) gui_panel_end((layout), &(hook)->GUI_HOOK_PANEL_NAME)
#ifdef __cplusplus #ifdef __cplusplus