forked from francma/wob
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
664 lines (559 loc) · 19 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
#define WOB_FILE "main.c"
#define MIN_PERCENTAGE_BAR_WIDTH 1
#define MIN_PERCENTAGE_BAR_HEIGHT 1
// sizeof already includes NULL byte
#define INPUT_BUFFER_LENGTH (3 * sizeof(unsigned long) + sizeof(" 000000FF FFFFFFFF FFFFFFFF\n"))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define STDIN_BUFFER_LENGTH INPUT_BUFFER_LENGTH
#define _POSIX_C_SOURCE 200809L
#include <errno.h>
#include <getopt.h>
#include <poll.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "buffer.h"
#include "color.h"
#include "config.h"
#include "log.h"
#include "parse.h"
#include "pledge.h"
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
#include "xdg-output-unstable-v1-client-protocol.h"
struct wob_surface {
struct zwlr_layer_surface_v1 *wlr_layer_surface;
struct wl_surface *wl_surface;
};
struct wob_output {
char *name;
struct wl_list link;
struct wl_output *wl_output;
struct wob *app;
struct wob_surface *wob_surface;
struct zxdg_output_v1 *xdg_output;
uint32_t wl_name;
};
struct wob {
int shmid;
struct wl_buffer *wl_buffer;
struct wl_compositor *wl_compositor;
struct wl_display *wl_display;
struct wl_list wob_outputs;
struct wl_registry *wl_registry;
struct wl_shm *wl_shm;
struct zwlr_layer_shell_v1 *wlr_layer_shell;
struct zxdg_output_manager_v1 *xdg_output_manager;
struct wob_config wob_config;
};
unsigned long
wob_anchor_to_wlr_layer_surface_anchor(enum wob_anchor wob_anchor)
{
unsigned long wlr_layer_surface_anchor = 0;
if (WOB_ANCHOR_TOP & wob_anchor) {
wlr_layer_surface_anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP;
}
if (WOB_ANCHOR_RIGHT & wob_anchor) {
wlr_layer_surface_anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
}
if (WOB_ANCHOR_BOTTOM & wob_anchor) {
wlr_layer_surface_anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
}
if (WOB_ANCHOR_LEFT & wob_anchor) {
wlr_layer_surface_anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT;
}
return wlr_layer_surface_anchor;
}
void
noop()
{
/* intentionally left blank */
}
void
layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface, uint32_t serial, uint32_t w, uint32_t h)
{
zwlr_layer_surface_v1_ack_configure(surface, serial);
}
struct wob_surface *
wob_surface_create(struct wob *app, struct wl_output *wl_output)
{
struct wob_config config = app->wob_config;
const static struct zwlr_layer_surface_v1_listener zwlr_layer_surface_listener = {
.configure = layer_surface_configure,
.closed = noop,
};
struct wob_surface *wob_surface = calloc(1, sizeof(struct wob_surface));
if (wob_surface == NULL) {
wob_log_error("calloc failed");
exit(EXIT_FAILURE);
}
wob_surface->wl_surface = wl_compositor_create_surface(app->wl_compositor);
if (wob_surface->wl_surface == NULL) {
wob_log_error("wl_compositor_create_surface failed");
exit(EXIT_FAILURE);
}
wob_surface->wlr_layer_surface = zwlr_layer_shell_v1_get_layer_surface(app->wlr_layer_shell, wob_surface->wl_surface, wl_output, ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY, "wob");
if (wob_surface->wlr_layer_surface == NULL) {
wob_log_error("wlr_layer_shell_v1_get_layer_surface failed");
exit(EXIT_FAILURE);
}
struct wob_dimensions dimensions = config.dimensions;
unsigned long margin = config.margin;
enum wob_anchor anchor = config.anchor;
zwlr_layer_surface_v1_set_size(wob_surface->wlr_layer_surface, dimensions.width, dimensions.height);
zwlr_layer_surface_v1_set_anchor(wob_surface->wlr_layer_surface, wob_anchor_to_wlr_layer_surface_anchor(anchor));
zwlr_layer_surface_v1_set_margin(wob_surface->wlr_layer_surface, margin, margin, margin, margin);
zwlr_layer_surface_v1_add_listener(wob_surface->wlr_layer_surface, &zwlr_layer_surface_listener, app);
wl_surface_commit(wob_surface->wl_surface);
return wob_surface;
}
void
wob_surface_destroy(struct wob_surface *wob_surface)
{
zwlr_layer_surface_v1_destroy(wob_surface->wlr_layer_surface);
wl_surface_destroy(wob_surface->wl_surface);
wob_surface->wl_surface = NULL;
wob_surface->wlr_layer_surface = NULL;
}
void
wob_output_destroy(struct wob_output *output)
{
if (output->wob_surface != NULL) {
wob_surface_destroy(output->wob_surface);
}
if (output->xdg_output != NULL) {
zxdg_output_v1_destroy(output->xdg_output);
}
if (output->wl_output != NULL) {
wl_output_destroy(output->wl_output);
}
free(output->name);
free(output->wob_surface);
output->wob_surface = NULL;
output->wl_output = NULL;
output->xdg_output = NULL;
output->name = NULL;
}
void
xdg_output_handle_name(void *data, struct zxdg_output_v1 *xdg_output, const char *name)
{
struct wob_output *output = (struct wob_output *) data;
output->name = strdup(name);
if (output->name == NULL) {
wob_log_error("strdup failed\n");
exit(EXIT_FAILURE);
}
}
void
xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output)
{
struct wob_output *output = (struct wob_output *) data;
struct wob *app = output->app;
struct wob_output_config *output_config;
wob_log_info("Detected output name %s", output->name);
if (app->wob_config.output_mode == WOB_OUTPUT_MODE_ALL) {
wl_list_insert(&output->app->wob_outputs, &output->link);
wob_log_info("Bar will be displayed on %s, because 'output_mode = all' is selected", output->name);
return;
}
wl_list_for_each (output_config, &app->wob_config.outputs, link) {
if (strcmp(output->name, output_config->name) == 0) {
wl_list_insert(&output->app->wob_outputs, &output->link);
wob_log_info("Bar will be displayed on output %s, because it matches whitelist rule", output->name);
return;
}
}
wob_log_info("Bar will NOT be displayed on output %s", output->name);
wob_output_destroy(output);
free(output);
}
void
handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
{
const static struct zxdg_output_v1_listener xdg_output_listener = {
.logical_position = noop,
.logical_size = noop,
.name = xdg_output_handle_name,
.description = noop,
.done = xdg_output_handle_done,
};
struct wob *app = (struct wob *) data;
if (strcmp(interface, wl_shm_interface.name) == 0) {
app->wl_shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
}
else if (strcmp(interface, wl_compositor_interface.name) == 0) {
app->wl_compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1);
}
else if (strcmp(interface, "wl_output") == 0) {
if (app->wob_config.output_mode == WOB_OUTPUT_MODE_FOCUSED) {
struct wob_output *output = calloc(1, sizeof(struct wob_output));
output->wl_output = NULL;
output->app = app;
output->wl_name = 0;
output->xdg_output = NULL;
output->name = strdup("focused");
wl_list_insert(&output->app->wob_outputs, &output->link);
}
else {
struct wob_output *output = calloc(1, sizeof(struct wob_output));
output->wl_output = wl_registry_bind(registry, name, &wl_output_interface, 1);
output->app = app;
output->wl_name = name;
output->xdg_output = zxdg_output_manager_v1_get_xdg_output(app->xdg_output_manager, output->wl_output);
zxdg_output_v1_add_listener(output->xdg_output, &xdg_output_listener, output);
if (wl_display_roundtrip(app->wl_display) < 1) {
wob_log_error("wl_display_roundtrip failed");
exit(EXIT_FAILURE);
}
}
}
else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) {
app->wlr_layer_shell = wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, 1);
}
else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0) {
app->xdg_output_manager = wl_registry_bind(registry, name, &zxdg_output_manager_v1_interface, 2);
}
}
void
handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
{
struct wob *app = (struct wob *) data;
struct wob_output *output, *output_tmp;
wl_list_for_each_safe (output, output_tmp, &(app->wob_outputs), link) {
if (output->wl_name == name) {
wob_log_info("Output %s disconnected", output->name);
wob_output_destroy(output);
wl_list_remove(&output->link);
free(output);
return;
}
}
}
void
wob_hide(struct wob *app)
{
struct wob_output *output;
wl_list_for_each (output, &app->wob_outputs, link) {
if (output->wob_surface == NULL) continue;
wob_log_info("Hiding bar on output %s", output->name);
wob_surface_destroy(output->wob_surface);
free(output->wob_surface);
output->wob_surface = NULL;
}
if (wl_display_roundtrip(app->wl_display) < 1) {
wob_log_error("wl_display_roundtrip failed");
exit(EXIT_FAILURE);
}
}
void
wob_show(struct wob *app)
{
struct wob_output *output;
wl_list_for_each (output, &app->wob_outputs, link) {
if (output->wob_surface != NULL) continue;
wob_log_info("Showing bar on output %s", output->name);
output->wob_surface = wob_surface_create(app, output->wl_output);
}
if (wl_display_roundtrip(app->wl_display) < 1) {
wob_log_error("wl_display_roundtrip failed");
exit(EXIT_FAILURE);
}
wl_list_for_each (output, &(app->wob_outputs), link) {
wl_surface_attach(output->wob_surface->wl_surface, app->wl_buffer, 0, 0);
wl_surface_damage(output->wob_surface->wl_surface, 0, 0, INT32_MAX, INT32_MAX);
wl_surface_commit(output->wob_surface->wl_surface);
}
if (wl_display_roundtrip(app->wl_display) < 1) {
wob_log_error("wl_display_roundtrip failed");
exit(EXIT_FAILURE);
}
}
void
wob_destroy(struct wob *app)
{
struct wob_output *output, *output_tmp;
wl_list_for_each_safe (output, output_tmp, &app->wob_outputs, link) {
wob_output_destroy(output);
free(output);
}
wob_config_destroy(&app->wob_config);
zwlr_layer_shell_v1_destroy(app->wlr_layer_shell);
wl_registry_destroy(app->wl_registry);
wl_buffer_destroy(app->wl_buffer);
wl_compositor_destroy(app->wl_compositor);
wl_shm_destroy(app->wl_shm);
zxdg_output_manager_v1_destroy(app->xdg_output_manager);
wl_display_disconnect(app->wl_display);
}
void
wob_connect(struct wob *app)
{
const static struct wl_registry_listener wl_registry_listener = {
.global = handle_global,
.global_remove = handle_global_remove,
};
app->wl_display = wl_display_connect(NULL);
if (app->wl_display == NULL) {
wob_log_error("wl_display_connect failed");
exit(EXIT_FAILURE);
}
app->wl_registry = wl_display_get_registry(app->wl_display);
if (app->wl_registry == NULL) {
wob_log_error("wl_display_get_registry failed");
exit(EXIT_FAILURE);
}
wl_registry_add_listener(app->wl_registry, &wl_registry_listener, app);
wl_list_init(&app->wob_outputs);
if (wl_display_roundtrip(app->wl_display) < 1) {
wob_log_error("wl_display_roundtrip failed");
exit(EXIT_FAILURE);
}
struct wob_dimensions dimensions = app->wob_config.dimensions;
struct wl_shm_pool *pool = wl_shm_create_pool(app->wl_shm, app->shmid, dimensions.height * dimensions.width * 4);
if (pool == NULL) {
wob_log_error("wl_shm_create_pool failed");
exit(EXIT_FAILURE);
}
app->wl_buffer = wl_shm_pool_create_buffer(pool, 0, dimensions.width, dimensions.height, dimensions.width * 4, WL_SHM_FORMAT_ARGB8888);
wl_shm_pool_destroy(pool);
if (app->wl_buffer == NULL) {
wob_log_error("wl_shm_pool_create_buffer failed");
exit(EXIT_FAILURE);
}
}
void
wob_draw(uint32_t *argb, struct wob_colors colors, struct wob_dimensions dimensions, unsigned long percentage, unsigned long maximum)
{
uint32_t argb_bar_color = wob_color_to_argb(wob_color_premultiply_alpha(colors.value));
uint32_t argb_background_color = wob_color_to_argb(wob_color_premultiply_alpha(colors.background));
uint32_t argb_border_color = wob_color_to_argb(wob_color_premultiply_alpha(colors.border));
size_t offset_border_padding = dimensions.border_offset + dimensions.border_size + dimensions.bar_padding;
size_t bar_width = dimensions.width - 2 * offset_border_padding;
size_t bar_height = dimensions.height - 2 * offset_border_padding;
size_t bar_colored_width = (bar_width * percentage) / maximum;
for (size_t i = 0; i < dimensions.width * dimensions.height; ++i) {
argb[i] = argb_background_color;
}
// create top and bottom line
size_t i = dimensions.width * dimensions.border_offset;
size_t k = dimensions.width * (dimensions.height - dimensions.border_offset - dimensions.border_size);
for (size_t line = 0; line < dimensions.border_size; ++line) {
i += dimensions.border_offset;
k += dimensions.border_offset;
for (size_t pixel = 0; pixel < dimensions.width - 2 * dimensions.border_offset; ++pixel) {
argb[i++] = argb_border_color;
argb[k++] = argb_border_color;
}
i += dimensions.border_offset;
k += dimensions.border_offset;
}
// create left and right horizontal line
i = dimensions.width * (dimensions.border_offset + dimensions.border_size);
k = dimensions.width * (dimensions.border_offset + dimensions.border_size);
for (size_t line = 0; line < dimensions.height - 2 * (dimensions.border_size + dimensions.border_offset); ++line) {
i += dimensions.border_offset;
k += dimensions.width - dimensions.border_offset - dimensions.border_size;
for (size_t pixel = 0; pixel < dimensions.border_size; ++pixel) {
argb[i++] = argb_border_color;
argb[k++] = argb_border_color;
}
i += dimensions.width - dimensions.border_offset - dimensions.border_size;
k += dimensions.border_offset;
}
// draw 1px horizontal line
uint32_t *start, *end, *pixel;
start = &argb[offset_border_padding * (dimensions.width + 1)];
end = start + bar_colored_width;
for (pixel = start; pixel < end; ++pixel) {
*pixel = argb_bar_color;
}
for (end = start + bar_width; pixel < end; ++pixel) {
*pixel = argb_background_color;
}
// copy it to make full percentage bar
uint32_t *source = &argb[offset_border_padding * dimensions.width];
uint32_t *destination = source + dimensions.width;
end = &argb[dimensions.width * (bar_height + offset_border_padding)];
while (destination != end) {
memcpy(destination, source, MIN(destination - source, end - destination) * sizeof(uint32_t));
destination += MIN(destination - source, end - destination);
}
}
bool
wob_pledge_enabled()
{
char *disable_pledge_env = getenv("WOB_DISABLE_PLEDGE");
if (disable_pledge_env != NULL && strcmp(disable_pledge_env, "0") != 0) {
return false;
}
return true;
}
int
main(int argc, char **argv)
{
wob_log_use_colors(isatty(STDERR_FILENO));
wob_log_level_warn();
// libc is doing fstat syscall to determine the optimal buffer size and that can be problematic to wob_pledge()
// to solve this problem we can just pass the optimal buffer ourselves
static char stdin_buffer[STDIN_BUFFER_LENGTH];
if (setvbuf(stdin, stdin_buffer, _IOFBF, sizeof(stdin_buffer)) != 0) {
wob_log_error("Failed to set stdin buffer size to %zu", sizeof(stdin_buffer));
return EXIT_FAILURE;
}
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
const char *usage = "usage: wob [-c config]\n";
int c;
char *wob_config_path = NULL;
while ((c = getopt(argc, argv, "vc:")) != -1) {
switch (c) {
case 'v':
wob_log_inc_verbosity();
break;
case 'c':
// fail if -c option is given multiple times
if (wob_config_path != NULL) {
free(wob_config_path);
fprintf(stderr, "%s", usage);
return EXIT_FAILURE;
}
free(wob_config_path);
wob_config_path = strdup(optarg);
break;
default:
fprintf(stderr, "%s", usage);
free(wob_config_path);
return EXIT_FAILURE;
}
}
wob_log_info("wob version %s started", WOB_VERSION);
struct wob app = {0};
if (wob_config_path == NULL) {
wob_config_path = wob_config_default_path();
}
wob_config_init(&app.wob_config);
if (wob_config_path != NULL) {
wob_log_info("Using configuration file at %s", wob_config_path);
if (!wob_config_load(&app.wob_config, wob_config_path)) {
wob_config_destroy(&app.wob_config);
free(wob_config_path);
return EXIT_FAILURE;
}
}
wob_config_debug(&app.wob_config);
free(wob_config_path);
int shmid = wob_shm_create();
if (shmid < 0) {
return EXIT_FAILURE;
}
app.shmid = shmid;
uint32_t *argb = wob_shm_alloc(shmid, app.wob_config.dimensions.width * app.wob_config.dimensions.height * 4);
if (argb == NULL) {
return EXIT_FAILURE;
}
wob_connect(&app);
if (app.wl_shm == NULL || app.wl_compositor == NULL || app.wlr_layer_shell == NULL) {
wob_log_error("Wayland compositor doesn't support all required protocols");
return EXIT_FAILURE;
}
if (wob_pledge_enabled()) {
if (!wob_pledge()) {
return EXIT_FAILURE;
}
}
struct wob_colors effective_colors;
struct pollfd fds[2] = {
{
.fd = wl_display_get_fd(app.wl_display),
.events = POLLIN,
},
{
.fd = STDIN_FILENO,
.events = POLLIN,
},
};
bool hidden = true;
for (;;) {
unsigned long percentage = 0;
char input_buffer[INPUT_BUFFER_LENGTH] = {0};
char *fgets_rv;
switch (poll(fds, 2, hidden ? -1 : app.wob_config.timeout_msec)) {
case -1:
wob_log_error("poll() failed: %s", strerror(errno));
return EXIT_FAILURE;
case 0:
if (!hidden) wob_hide(&app);
hidden = true;
break;
default:
if (fds[0].revents) {
if (!(fds[0].revents & POLLIN)) {
wob_log_error("WL_DISPLAY_FD unexpectedly closed, revents = %hd", fds[0].revents);
return EXIT_FAILURE;
}
if (wl_display_dispatch(app.wl_display) == -1) {
return EXIT_FAILURE;
}
}
if (fds[1].revents) {
if (!(fds[1].revents & POLLIN)) {
wob_log_error("STDIN unexpectedly closed, revents = %hd", fds[1].revents);
if (!hidden) wob_hide(&app);
wob_destroy(&app);
return EXIT_FAILURE;
}
fgets_rv = fgets(input_buffer, INPUT_BUFFER_LENGTH, stdin);
if (feof(stdin)) {
wob_log_info("Received EOF");
if (!hidden) wob_hide(&app);
wob_destroy(&app);
return EXIT_SUCCESS;
}
if (fgets_rv == NULL) {
wob_log_error("fgets() failed: %s", strerror(errno));
if (!hidden) wob_hide(&app);
wob_destroy(&app);
return EXIT_FAILURE;
}
effective_colors = app.wob_config.colors;
if (!wob_parse_input(input_buffer, &percentage, &effective_colors.background, &effective_colors.border, &effective_colors.value)) {
wob_log_error("Received invalid input");
if (!hidden) wob_hide(&app);
wob_destroy(&app);
return EXIT_FAILURE;
}
wob_log_info(
"Received input { value = %lu, bg = #%08jx, border = #%08jx, bar = #%08jx }",
percentage,
wob_color_to_rgba(effective_colors.background),
wob_color_to_rgba(effective_colors.border),
wob_color_to_rgba(effective_colors.value));
if (percentage > app.wob_config.max) {
effective_colors = app.wob_config.overflow_colors;
switch (app.wob_config.overflow_mode) {
case WOB_OVERFLOW_MODE_WRAP:
percentage %= app.wob_config.max;
break;
case WOB_OVERFLOW_MODE_NOWRAP:
percentage = app.wob_config.max;
break;
}
}
if (wl_list_empty(&app.wob_outputs) == 1) {
wob_log_info("No output found to render wob on");
break;
}
wob_log_info(
"Rendering { value = %lu, bg = #%08jx, border = #%08jx, bar = #%08jx }",
percentage,
wob_color_to_rgba(effective_colors.background),
wob_color_to_rgba(effective_colors.border),
wob_color_to_rgba(effective_colors.value));
wob_draw(argb, effective_colors, app.wob_config.dimensions, percentage, app.wob_config.max);
wob_show(&app);
hidden = false;
}
}
}
}