mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20: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.
67 lines
1.3 KiB
C
67 lines
1.3 KiB
C
#pragma once
|
|
|
|
#include <cairo.h>
|
|
#include <cairo-xcb.h>
|
|
|
|
#include "../bar/bar.h"
|
|
#include "backend.h"
|
|
|
|
struct private {
|
|
/* From bar_config */
|
|
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;
|
|
struct exposable **exps;
|
|
size_t count;
|
|
} left;
|
|
struct {
|
|
struct module **mods;
|
|
struct exposable **exps;
|
|
size_t count;
|
|
} center;
|
|
struct {
|
|
struct module **mods;
|
|
struct exposable **exps;
|
|
size_t count;
|
|
} right;
|
|
|
|
/* Calculated run-time */
|
|
int width;
|
|
int height_with_border;
|
|
|
|
/* Name of currently active cursor */
|
|
char *cursor_name;
|
|
|
|
cairo_t *cairo;
|
|
cairo_surface_t *cairo_surface;
|
|
|
|
struct {
|
|
void *data;
|
|
const struct backend *iface;
|
|
} backend;
|
|
#if 0
|
|
/* Backend specifics */
|
|
xcb_connection_t *conn;
|
|
|
|
xcb_window_t win;
|
|
xcb_colormap_t colormap;
|
|
xcb_pixmap_t pixmap;
|
|
xcb_gc_t gc;
|
|
xcb_cursor_context_t *cursor_ctx;
|
|
xcb_cursor_t cursor;
|
|
#endif
|
|
};
|