mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-20 11:35:42 +02:00
All decoration, particle and module interfaces now takes a pixman_image_t parameter, and all drawing is done using pixman APIs. The wayland/xcb backends implement a new interface functions, get_pixman_image(), that should return a pixman image instance that is suitable for rendering. In the wayland backend, the image uses the same backing data as the cairo surface. In the XCB backend, we create a new image each time, and then blit it to the cairo surface at commit time.
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include "../color.h"
|
|
#include "../module.h"
|
|
|
|
struct bar {
|
|
int abort_fd;
|
|
|
|
void *private;
|
|
int (*run)(struct bar *bar);
|
|
void (*destroy)(struct bar *bar);
|
|
|
|
void (*refresh)(const struct bar *bar);
|
|
void (*set_cursor)(struct bar *bar, const char *cursor);
|
|
};
|
|
|
|
enum bar_location { BAR_TOP, BAR_BOTTOM };
|
|
enum bar_backend { BAR_BACKEND_AUTO, BAR_BACKEND_XCB, BAR_BACKEND_WAYLAND };
|
|
|
|
struct bar_config {
|
|
enum bar_backend backend;
|
|
|
|
const char *monitor;
|
|
enum bar_location location;
|
|
int height;
|
|
int left_spacing, right_spacing;
|
|
int left_margin, right_margin;
|
|
|
|
pixman_color_t background;
|
|
|
|
struct {
|
|
int width;
|
|
pixman_color_t color;
|
|
int left_margin, right_margin;
|
|
int top_margin, bottom_margin;
|
|
} border;
|
|
|
|
struct {
|
|
struct module **mods;
|
|
size_t count;
|
|
} left;
|
|
struct {
|
|
struct module **mods;
|
|
size_t count;
|
|
} center;
|
|
struct {
|
|
struct module **mods;
|
|
size_t count;
|
|
} right;
|
|
};
|
|
|
|
struct bar *bar_new(const struct bar_config *config);
|