changeset 491:734b598534c4

ui: frame -> mlk_frame
author David Demelier <markand@malikania.fr>
date Tue, 28 Feb 2023 13:16:47 +0100
parents d4e50da7e5c5
children c7b18475f640
files examples/example-message/example-message.c examples/example-ui/example-ui.c libmlk-rpg/mlk/rpg/battle-bar-default.c libmlk-rpg/mlk/rpg/battle-message.c libmlk-rpg/mlk/rpg/message.c libmlk-ui/mlk/ui/frame.c libmlk-ui/mlk/ui/frame.h libmlk-ui/mlk/ui/gridmenu.c libmlk-ui/mlk/ui/notify.c libmlk-ui/mlk/ui/theme.c libmlk-ui/mlk/ui/theme.h
diffstat 11 files changed, 31 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/examples/example-message/example-message.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/examples/example-message/example-message.c	Tue Feb 28 13:16:47 2023 +0100
@@ -109,7 +109,7 @@
 }
 
 static void
-my_draw_frame(const struct theme *th, const struct frame *f)
+my_draw_frame(const struct theme *th, const struct mlk_frame *f)
 {
 	(void)th;
 
--- a/examples/example-ui/example-ui.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/examples/example-ui/example-ui.c	Tue Feb 28 13:16:47 2023 +0100
@@ -68,7 +68,7 @@
 	} motion;
 
 	struct {
-		struct frame frame;
+		struct mlk_frame frame;
 	} panel;
 
 	struct {
@@ -132,7 +132,7 @@
 static void
 resize_header(void)
 {
-	struct frame *f = &ui.panel.frame;
+	struct mlk_frame *f = &ui.panel.frame;
 	struct label *l = &ui.header.label;
 	unsigned int w, h;
 
@@ -147,7 +147,7 @@
 resize_autosave(void)
 {
 	unsigned int padding = theme_default()->padding;
-	struct frame *f = &ui.panel.frame;
+	struct mlk_frame *f = &ui.panel.frame;
 	struct mlk_checkbox *c = &ui.autosave.cb;
 	struct label *l = &ui.autosave.label;
 
@@ -162,7 +162,7 @@
 resize_button(void)
 {
 	unsigned int padding = theme_default()->padding;
-	struct frame *f = &ui.panel.frame;
+	struct mlk_frame *f = &ui.panel.frame;
 	struct mlk_button *b = &ui.quit.button;
 
 	/* Button. */
@@ -243,7 +243,7 @@
 
 	mlk_painter_set_color(0xffffffff);
 	mlk_painter_clear();
-	frame_draw(&ui.panel.frame);
+	mlk_frame_draw(&ui.panel.frame);
 	label_draw(&ui.header.label);
 	mlk_checkbox_draw(&ui.autosave.cb);
 	label_draw(&ui.autosave.label);
--- a/libmlk-rpg/mlk/rpg/battle-bar-default.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-rpg/mlk/rpg/battle-bar-default.c	Tue Feb 28 13:16:47 2023 +0100
@@ -305,7 +305,7 @@
 static void
 draw_status(const struct battle_bar_default *bar, const struct battle *bt, const struct geo *geo)
 {
-	frame_draw(&(const struct frame) {
+	mlk_frame_draw(&(const struct mlk_frame) {
 		.x = geo->x,
 		.y = geo->y,
 		.w = geo->w,
@@ -364,7 +364,7 @@
 	bh = geo->h - theme->padding * 2;
 
 	/* Draw menu frame. */
-	frame_draw(&(const struct frame) {
+	mlk_frame_draw(&(const struct mlk_frame) {
 		.x = geo->x,
 		.y = geo->y,
 		.w = geo->w,
--- a/libmlk-rpg/mlk/rpg/battle-message.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-rpg/mlk/rpg/battle-message.c	Tue Feb 28 13:16:47 2023 +0100
@@ -43,7 +43,7 @@
 {
 	assert(msg);
 
-	struct frame f = {0};
+	struct mlk_frame f = {0};
 	struct label l = {0};
 	unsigned int lw = 0, lh = 0;
 
@@ -64,6 +64,6 @@
 	/* Align the text in the box. */
 	mlk_align(MLK_ALIGN_CENTER, &l.x, &l.y, lw, lh, f.x, f.y, f.w, f.h);
 
-	frame_draw(&f);
+	mlk_frame_draw(&f);
 	label_draw(&l);
 }
--- a/libmlk-rpg/mlk/rpg/message.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-rpg/mlk/rpg/message.c	Tue Feb 28 13:16:47 2023 +0100
@@ -43,13 +43,13 @@
 {
 	assert(msg);
 
-	struct frame frame = {
+	struct mlk_frame frame = {
 		.w = msg->w,
 		.h = msg->h,
 		.theme = msg->theme
 	};
 
-	frame_draw(&frame);
+	mlk_frame_draw(&frame);
 }
 
 static inline unsigned int
--- a/libmlk-ui/mlk/ui/frame.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-ui/mlk/ui/frame.c	Tue Feb 28 13:16:47 2023 +0100
@@ -25,14 +25,14 @@
 #include "theme.h"
 
 void
-frame_draw_default(const struct theme *t, const struct frame *frame)
+mlk_frame_draw_default(const struct theme *t, const struct mlk_frame *frame)
 {
 	assert(t);
 	assert(frame);
 
 	(void)t;
 
-	if (frame->style == FRAME_STYLE_BOX)
+	if (frame->style == MLK_FRAME_STYLE_BOX)
 		mlk_painter_set_color(0x7a4841ff);
 	else
 		mlk_painter_set_color(0xad7757ff);
@@ -41,7 +41,7 @@
 }
 
 void
-frame_draw(const struct frame *frame)
+mlk_frame_draw(const struct mlk_frame *frame)
 {
 	assert(frame);
 
--- a/libmlk-ui/mlk/ui/frame.h	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-ui/mlk/ui/frame.h	Tue Feb 28 13:16:47 2023 +0100
@@ -23,27 +23,27 @@
 
 struct theme;
 
-enum frame_style {
-	FRAME_STYLE_NORMAL,
-	FRAME_STYLE_BOX
+enum mlk_frame_style {
+	MLK_FRAME_STYLE_NORMAL,
+	MLK_FRAME_STYLE_BOX
 };
 
-struct frame {
+struct mlk_frame {
 	int x;
 	int y;
 	unsigned int w;
 	unsigned int h;
-	enum frame_style style;
+	enum mlk_frame_style style;
 	const struct theme *theme;
 };
 
 MLK_CORE_BEGIN_DECLS
 
 void
-frame_draw_default(const struct theme *, const struct frame *);
+mlk_frame_draw_default(const struct theme *, const struct mlk_frame *);
 
 void
-frame_draw(const struct frame *);
+mlk_frame_draw(const struct mlk_frame *);
 
 MLK_CORE_END_DECLS
 
--- a/libmlk-ui/mlk/ui/gridmenu.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-ui/mlk/ui/gridmenu.c	Tue Feb 28 13:16:47 2023 +0100
@@ -101,7 +101,7 @@
 static void
 draw_frame(const struct gridmenu *menu)
 {
-	const struct frame f = {
+	const struct mlk_frame f = {
 		.x = menu->x,
 		.y = menu->y,
 		.w = menu->w,
@@ -109,7 +109,7 @@
 		.theme = menu->theme,
 	};
 
-	frame_draw(&f);
+	mlk_frame_draw(&f);
 }
 
 static void
--- a/libmlk-ui/mlk/ui/notify.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-ui/mlk/ui/notify.c	Tue Feb 28 13:16:47 2023 +0100
@@ -102,14 +102,14 @@
 static void
 draw_frame(const struct geo *geo)
 {
-	const struct frame f = {
+	const struct mlk_frame f = {
 		.x = geo->frame_x,
 		.y = geo->frame_y,
 		.w = geo->frame_w,
 		.h = geo->frame_h
 	};
 
-	frame_draw(&f);
+	mlk_frame_draw(&f);
 }
 
 static void
--- a/libmlk-ui/mlk/ui/theme.c	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-ui/mlk/ui/theme.c	Tue Feb 28 13:16:47 2023 +0100
@@ -53,7 +53,7 @@
 		[THEME_COLOR_SHADOW]    = 0x000000ff
 	},
 	.padding = 10,
-	.draw_frame = frame_draw_default,
+	.draw_frame = mlk_frame_draw_default,
 	.draw_label = label_draw_default,
 	.draw_button = mlk_button_draw_default,
 	.draw_checkbox = mlk_checkbox_draw_default
@@ -114,7 +114,7 @@
 }
 
 void
-theme_draw_frame(const struct theme *t, const struct frame *frame)
+theme_draw_frame(const struct theme *t, const struct mlk_frame *frame)
 {
 	assert(frame);
 
--- a/libmlk-ui/mlk/ui/theme.h	Tue Feb 28 13:14:59 2023 +0100
+++ b/libmlk-ui/mlk/ui/theme.h	Tue Feb 28 13:16:47 2023 +0100
@@ -24,7 +24,7 @@
 struct mlk_button;
 struct mlk_checkbox;
 struct mlk_font;
-struct frame;
+struct mlk_frame;
 struct label;
 struct mlk_sprite;
 
@@ -54,7 +54,7 @@
 	unsigned long colors[THEME_COLOR_NUM];
 	unsigned int padding;
 
-	void (*draw_frame)(const struct theme *, const struct frame *);
+	void (*draw_frame)(const struct theme *, const struct mlk_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 mlk_checkbox *);
@@ -72,7 +72,7 @@
 theme_shallow(struct theme *, const struct theme *);
 
 void
-theme_draw_frame(const struct theme *, const struct frame *);
+theme_draw_frame(const struct theme *, const struct mlk_frame *);
 
 void
 theme_draw_label(const struct theme *, const struct label *);