comparison examples/example-message/example-message.c @ 495:2af25db99273

ui: theme -> mlk_theme
author David Demelier <markand@malikania.fr>
date Tue, 28 Feb 2023 13:40:55 +0100
parents 734b598534c4
children 8d5a266a1774
comparison
equal deleted inserted replaced
494:35cc5d51bcb2 495:2af25db99273
107 mlk_game_push(&state); 107 mlk_game_push(&state);
108 mlk_game_loop(); 108 mlk_game_loop();
109 } 109 }
110 110
111 static void 111 static void
112 my_draw_frame(const struct theme *th, const struct mlk_frame *f) 112 my_draw_frame(const struct mlk_theme *th, const struct mlk_frame *f)
113 { 113 {
114 (void)th; 114 (void)th;
115 115
116 mlk_painter_set_color(0xff0000ff); 116 mlk_painter_set_color(0xff0000ff);
117 mlk_painter_draw_rectangle(f->x, f->y, f->w, f->h); 117 mlk_painter_draw_rectangle(f->x, f->y, f->w, f->h);
307 { 307 {
308 const char * const text[] = { 308 const char * const text[] = {
309 "This one will destroy your eyes.", 309 "This one will destroy your eyes.",
310 "Because it use a terrible custom theme." 310 "Because it use a terrible custom theme."
311 }; 311 };
312 struct theme theme; 312 struct mlk_theme theme;
313 struct message msg = { 313 struct message msg = {
314 .x = MX, 314 .x = MX,
315 .y = MY, 315 .y = MY,
316 .w = MW, 316 .w = MW,
317 .h = MH, 317 .h = MH,
319 .linesz = 2, 319 .linesz = 2,
320 .theme = &theme 320 .theme = &theme
321 }; 321 };
322 322
323 /* Borrow default theme and change its frame drawing. */ 323 /* Borrow default theme and change its frame drawing. */
324 theme_shallow(&theme, NULL); 324 mlk_theme_shallow(&theme, NULL);
325 theme.draw_frame = my_draw_frame; 325 theme.draw_frame = my_draw_frame;
326 theme.colors[THEME_COLOR_NORMAL] = 0x0000ffff; 326 theme.colors[MLK_THEME_COLOR_NORMAL] = 0x0000ffff;
327 327
328 run(&msg); 328 run(&msg);
329 } 329 }
330 330
331 int 331 int