mirror of
https://github.com/swaywm/sway.git
synced 2026-02-11 04:28:15 -05:00
Add solid-color rendering to swaybg
This commit is contained in:
parent
eccf0b2598
commit
632bb948b7
11 changed files with 550 additions and 39 deletions
21
include/buffer_pool.h
Normal file
21
include/buffer_pool.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef _SWAY_BUFFERS_H
|
||||
#define _SWAY_BUFFERS_H
|
||||
#include <cairo/cairo.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <wayland-client.h>
|
||||
|
||||
struct pool_buffer {
|
||||
struct wl_buffer *buffer;
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cairo;
|
||||
PangoContext *pango;
|
||||
uint32_t width, height;
|
||||
bool busy;
|
||||
};
|
||||
|
||||
struct pool_buffer *get_next_buffer(struct wl_shm *shm,
|
||||
struct pool_buffer pool[static 2], uint32_t width, uint32_t height);
|
||||
|
||||
#endif
|
||||
18
include/cairo.h
Normal file
18
include/cairo.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef _SWAY_CAIRO_H
|
||||
#define _SWAY_CAIRO_H
|
||||
#include <stdint.h>
|
||||
#include <cairo/cairo.h>
|
||||
|
||||
void cairo_set_source_u32(cairo_t *cairo, uint32_t color);
|
||||
|
||||
cairo_surface_t *cairo_image_surface_scale(cairo_surface_t *image,
|
||||
int width, int height);
|
||||
|
||||
#ifdef WITH_GDK_PIXBUF
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
cairo_surface_t* gdk_cairo_image_surface_create_from_pixbuf(
|
||||
const GdkPixbuf *gdkbuf);
|
||||
#endif //WITH_GDK_PIXBUF
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue