Mercurial > molko
diff examples/example-cursor/example-cursor.c @ 485:3ff1fe64d0cd
core: window -> mlk_window
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 28 Feb 2023 08:40:35 +0100 |
parents | ca30ff96bbe0 |
children | d6757c30658e |
line wrap: on
line diff
--- a/examples/example-cursor/example-cursor.c Mon Feb 27 19:47:09 2023 +0100 +++ b/examples/example-cursor/example-cursor.c Tue Feb 28 08:40:35 2023 +0100 @@ -37,7 +37,7 @@ static struct mlk_state *states[1]; static char help_text[128]; -static enum window_cursor cursor = WINDOW_CURSOR_ARROW; +static enum mlk_window_cursor cursor = MLK_WINDOW_CURSOR_ARROW; static struct label help = { .x = 10, @@ -51,12 +51,12 @@ { if (mlk_core_init("fr.malikania", "example-cursor") < 0 || ui_init() < 0) mlk_panic(); - if (window_open("Example - Cursor", W, H) < 0) + if (mlk_window_open("Example - Cursor", W, H) < 0) mlk_panic(); } static void -change(enum window_cursor cursor) +change(enum mlk_window_cursor cursor) { static const char *names[] = { [WINDOW_CURSOR_ARROW] = "WINDOW_CURSOR_ARROW", @@ -69,7 +69,7 @@ }; snprintf(help_text, sizeof (help_text), "Keys: <Left>/<Right> to change cursor. Current: %s", names[cursor]); - window_set_cursor(cursor); + mlk_window_set_cursor(cursor); } static void @@ -85,7 +85,7 @@ change(--cursor); break; case MLK_KEY_RIGHT: - if (cursor + 1 < WINDOW_CURSOR_LAST) + if (cursor + 1 < MLK_WINDOW_CURSOR_LAST) change(++cursor); break; default: @@ -131,7 +131,7 @@ static void quit(void) { - window_finish(); + mlk_window_finish(); ui_finish(); mlk_core_finish(); }