commit bba7b61

uint  ·  2026-06-03 17:31:22 +0000 UTC
parent d50e9c3
Overall rename mauswin->maus, MausWin->Maus
6 files changed,  +18, -18
R maus.c
R maus.h
R mauswin.c => maus.c
+1, -1
1@@ -2,7 +2,7 @@
2 #include <stdio.h>
3 #include <stdlib.h>
4 
5-#include "mauswin.h"
6+#include "maus.h"
7 
8 static void vlog(FILE* fd, const char* fmt, va_list ap);
9 
R mauswin.h => maus.h
+7, -7
 1@@ -23,7 +23,7 @@
 2 #endif /* auto selection */
 3 
 4 #if defined(BACKEND_X11)
 5-#include "mauswin_x11.h"
 6+#include "maus_x11.h"
 7 
 8 #elif defined(BACKEND_WAY)
 9 /* ... */
10@@ -37,19 +37,19 @@
11 #endif
12 
13 /* close a Maus. returns false on fail */
14-bool maus_close(MausWindow* mw);
15+bool maus_close(Maus* mw);
16 
17 /* close a window without the whole Maus. returns false on fail */
18-bool maus_close_window(MausWindow* mw);
19+bool maus_close_window(Maus* mw);
20 
21-/* create window from MausWindow. returns false on fail */
22-bool maus_create_window(MausWindow* mw);
23+/* create window from Maus. returns false on fail */
24+bool maus_create_window(Maus* mw);
25 
26 /* log message to output `fd` and die */
27 void maus_die(const char* fmt, ...);
28 
29-/* initialise and fills the MausWindow. returns NULL on fail */
30-MausWindow* maus_init(const char* title, int x, int y, int width, int height);
31+/* initialise and fills the Maus. returns NULL on fail */
32+Maus* maus_init(const char* title, int x, int y, int width, int height);
33 
34 /* log message to output `fd` */
35 void maus_log(FILE* fd, const char* fmt, ...);
+6, -6
 1@@ -4,9 +4,9 @@
 2 
 3 #include <X11/Xlib.h>
 4 
 5-#include "mauswin.h"
 6+#include "maus.h"
 7 
 8-bool maus_close(MausWindow* mw)
 9+bool maus_close(Maus* mw)
10 {
11 	if (mw->pixels)
12 		free(mw->pixels);
13@@ -19,7 +19,7 @@ bool maus_close(MausWindow* mw)
14 	return true;
15 }
16 
17-bool maus_close_window(MausWindow* mw)
18+bool maus_close_window(Maus* mw)
19 {
20 	if (mw->win != None) {
21 		XUnmapWindow(mw->display, mw->win);
22@@ -29,7 +29,7 @@ bool maus_close_window(MausWindow* mw)
23 	return true;
24 }
25 
26-bool maus_create_window(MausWindow* mw)
27+bool maus_create_window(Maus* mw)
28 {
29 	mw->win = XCreateSimpleWindow(
30 		mw->display, mw->root,
31@@ -47,7 +47,7 @@ bool maus_create_window(MausWindow* mw)
32 	return true;
33 }
34 
35-MausWindow* maus_init(const char* title, int x, int y, int width, int height)
36+Maus* maus_init(const char* title, int x, int y, int width, int height)
37 {
38 	if (MAUS_WARN_BACKEND_AUTO_SEL)
39 		maus_log(stderr, "backend auto-selected: X11");
40@@ -64,7 +64,7 @@ MausWindow* maus_init(const char* title, int x, int y, int width, int height)
41 		return NULL;
42 	}
43 
44-	MausWindow* win = malloc(sizeof(MausWindow));
45+	Maus* win = malloc(sizeof(Maus));
46 	win->display = d;
47 	win->root = DefaultRootWindow(d);
48 	win->win = None;
R mauswin_x11.h => maus_x11.h
+1, -1
1@@ -17,7 +17,7 @@ typedef struct {
2 	int            y;
3 
4 	uint32_t*      pixels;
5-} MausWindow;
6+} Maus;
7 
8 #endif /* MAUSWIN_X11_H */
9 
+1, -1
1@@ -3,7 +3,7 @@ CFLAGS = -std=c99 -Wall -Wextra -O2
2 LIBS = -lX11
3 
4 SRC = main.c \
5-      ../../mauswin.c \
6+      ../../maus.c \
7       ../../maus_x11.c
8 
9 all:
+2, -2
 1@@ -1,9 +1,9 @@
 2 #define BACKEND_X11
 3-#include "../../mauswin.h"
 4+#include "../../maus.h"
 5 
 6 int main(void)
 7 {
 8-	MausWindow* mw = maus_init("basic window", 0, 0, 800, 600);
 9+	Maus* mw = maus_init("basic window", 0, 0, 800, 600);
10 	maus_create_window(mw);
11 
12 	XEvent e;