From 4083142e714e46ef68a43619649d902a6003c784 Mon Sep 17 00:00:00 2001 From: vurtun Date: Tue, 12 May 2015 17:05:12 +0200 Subject: [PATCH] renamed hook functions --- Readme.md | 4 ++-- demo/demo.c | 12 ++++++------ gui.h | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Readme.md b/Readme.md index 2347bdd..c2407ea 100644 --- a/Readme.md +++ b/Readme.md @@ -374,11 +374,11 @@ while (1) { struct gui_canvas canvas; 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); if (gui_panel_button_text(&layout, "button", GUI_BUTTON_DEFAULT)) 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); /* draw each panel */ diff --git a/demo/demo.c b/demo/demo.c index a2cec22..42d0875 100644 --- a/demo/demo.c +++ b/demo/demo.c @@ -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_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); widget_panel(&layout, show); graph_panel(&layout, show); table_panel(&layout, show); - gui_hook_end(&layout, &show->hook); + gui_panel_hook_end(&layout, &show->hook); } static void @@ -299,11 +299,11 @@ control_panel(struct control_window *control, struct gui_panel_stack *stack, { gui_bool running; 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); style_tab(&layout, control, config); color_tab(&layout, control, config); - gui_hook_end(&layout, &control->hook); + gui_panel_hook_end(&layout, &control->hook); 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) { 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_CLOSEABLE|GUI_PANEL_SCALEABLE| GUI_PANEL_MINIMIZABLE, config, font); @@ -325,7 +325,7 @@ init_demo(struct show_window *show, struct control_window *control, show->spinner = 100; 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_stack_push(stack, &control->hook); control->show_flags = gui_hook_panel(&show->hook)->flags; diff --git a/gui.h b/gui.h index 5328ebd..269c9f5 100644 --- a/gui.h +++ b/gui.h @@ -612,11 +612,11 @@ void gui_stack_pop(struct gui_panel_stack*, struct gui_panel_hook*); /* Hook */ #define gui_hook_panel(h) (&((h)->GUI_HOOK_PANEL_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) -#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) -#define gui_hook_end(layout, hook)\ +#define gui_panel_hook_end(layout, hook)\ gui_panel_end((layout), &(hook)->GUI_HOOK_PANEL_NAME) #ifdef __cplusplus