changeset 489:ad6e9970a191

ui: checkbox -> mlk_checkbox
author David Demelier <markand@malikania.fr>
date Tue, 28 Feb 2023 13:13:19 +0100
parents 441c37e7474f
children d4e50da7e5c5
files examples/example-ui/example-ui.c libmlk-ui/mlk/ui/checkbox.c libmlk-ui/mlk/ui/checkbox.h libmlk-ui/mlk/ui/theme.c libmlk-ui/mlk/ui/theme.h
diffstat 5 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/examples/example-ui/example-ui.c	Tue Feb 28 13:12:05 2023 +0100
+++ b/examples/example-ui/example-ui.c	Tue Feb 28 13:13:19 2023 +0100
@@ -76,7 +76,7 @@
 	} header;
 
 	struct {
-		struct checkbox cb;
+		struct mlk_checkbox cb;
 		struct label label;
 	} autosave;
 
@@ -148,7 +148,7 @@
 {
 	unsigned int padding = theme_default()->padding;
 	struct frame *f = &ui.panel.frame;
-	struct checkbox *c = &ui.autosave.cb;
+	struct mlk_checkbox *c = &ui.autosave.cb;
 	struct label *l = &ui.autosave.label;
 
 	c->x = f->x + padding;
@@ -230,7 +230,7 @@
 		break;
 	}
 
-	checkbox_handle(&ui.autosave.cb, ev);
+	mlk_checkbox_handle(&ui.autosave.cb, ev);
 
 	if (mlk_button_handle(&ui.quit.button, ev))
 		mlk_game_quit();
@@ -245,7 +245,7 @@
 	mlk_painter_clear();
 	frame_draw(&ui.panel.frame);
 	label_draw(&ui.header.label);
-	checkbox_draw(&ui.autosave.cb);
+	mlk_checkbox_draw(&ui.autosave.cb);
 	label_draw(&ui.autosave.label);
 	mlk_button_draw(&ui.quit.button);
 	mlk_painter_present();
--- a/libmlk-ui/mlk/ui/checkbox.c	Tue Feb 28 13:12:05 2023 +0100
+++ b/libmlk-ui/mlk/ui/checkbox.c	Tue Feb 28 13:13:19 2023 +0100
@@ -28,7 +28,7 @@
 #include "theme.h"
 
 static int
-is_boxed(const struct checkbox *cb, const struct mlk_event_click *click)
+is_boxed(const struct mlk_checkbox *cb, const struct mlk_event_click *click)
 {
 	assert(cb);
 	assert(click && click->type == MLK_EVENT_CLICKDOWN);
@@ -37,7 +37,7 @@
 }
 
 void
-checkbox_draw_default(const struct theme *t, const struct checkbox *cb)
+mlk_checkbox_draw_default(const struct theme *t, const struct mlk_checkbox *cb)
 {
 	(void)t;
 
@@ -55,7 +55,7 @@
 }
 
 int
-checkbox_handle(struct checkbox *cb, const union mlk_event *ev)
+mlk_checkbox_handle(struct mlk_checkbox *cb, const union mlk_event *ev)
 {
 	assert(cb);
 	assert(ev);
@@ -73,7 +73,7 @@
 }
 
 void
-checkbox_draw(const struct checkbox *cb)
+mlk_checkbox_draw(const struct mlk_checkbox *cb)
 {
 	theme_draw_checkbox(cb->theme, cb);
 }
--- a/libmlk-ui/mlk/ui/checkbox.h	Tue Feb 28 13:12:05 2023 +0100
+++ b/libmlk-ui/mlk/ui/checkbox.h	Tue Feb 28 13:13:19 2023 +0100
@@ -25,7 +25,7 @@
 
 struct theme;
 
-struct checkbox {
+struct mlk_checkbox {
 	int x;
 	int y;
 	unsigned int w;
@@ -37,13 +37,13 @@
 MLK_CORE_BEGIN_DECLS
 
 void
-checkbox_draw_default(const struct theme *, const struct checkbox *);
+mlk_checkbox_draw_default(const struct theme *, const struct mlk_checkbox *);
 
 int
-checkbox_handle(struct checkbox *, const union mlk_event *);
+mlk_checkbox_handle(struct mlk_checkbox *, const union mlk_event *);
 
 void
-checkbox_draw(const struct checkbox *);
+mlk_checkbox_draw(const struct mlk_checkbox *);
 
 MLK_CORE_END_DECLS
 
--- a/libmlk-ui/mlk/ui/theme.c	Tue Feb 28 13:12:05 2023 +0100
+++ b/libmlk-ui/mlk/ui/theme.c	Tue Feb 28 13:13:19 2023 +0100
@@ -56,7 +56,7 @@
 	.draw_frame = frame_draw_default,
 	.draw_label = label_draw_default,
 	.draw_button = mlk_button_draw_default,
-	.draw_checkbox = checkbox_draw_default
+	.draw_checkbox = mlk_checkbox_draw_default
 };
 
 static struct font_catalog {
@@ -138,7 +138,7 @@
 }
 
 void
-theme_draw_checkbox(const struct theme *t, const struct checkbox *cb)
+theme_draw_checkbox(const struct theme *t, const struct mlk_checkbox *cb)
 {
 	assert(cb);
 
--- a/libmlk-ui/mlk/ui/theme.h	Tue Feb 28 13:12:05 2023 +0100
+++ b/libmlk-ui/mlk/ui/theme.h	Tue Feb 28 13:13:19 2023 +0100
@@ -22,7 +22,7 @@
 #include <mlk/core/core.h>
 
 struct mlk_button;
-struct checkbox;
+struct mlk_checkbox;
 struct mlk_font;
 struct frame;
 struct label;
@@ -57,7 +57,7 @@
 	void (*draw_frame)(const struct theme *, const struct frame *);
 	void (*draw_label)(const struct theme *, const struct label *);
 	void (*draw_button)(const struct theme *, const struct mlk_button *);
-	void (*draw_checkbox)(const struct theme *t, const struct checkbox *);
+	void (*draw_checkbox)(const struct theme *t, const struct mlk_checkbox *);
 };
 
 MLK_CORE_BEGIN_DECLS
@@ -81,7 +81,7 @@
 theme_draw_button(const struct theme *, const struct mlk_button *);
 
 void
-theme_draw_checkbox(const struct theme *, const struct checkbox *);
+theme_draw_checkbox(const struct theme *, const struct mlk_checkbox *);
 
 void
 theme_finish(void);