mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-13 02:42:47 +01:00
54 lines
1.0 KiB
C
54 lines
1.0 KiB
C
#ifndef __DRW_H
|
|
#define __DRW_H
|
|
|
|
#include <pango/pangocairo.h>
|
|
#include <stdbool.h>
|
|
|
|
struct drw;
|
|
struct drwsurf;
|
|
struct kbd;
|
|
|
|
void drw_init(struct drw *d, const char *fc_pattern, void *iface);
|
|
void drwsurf_init(struct drw *d, struct drwsurf *ds, struct wl_surface *surf);
|
|
void drwsurf_resize(struct drwsurf *ds, uint32_t w, uint32_t h, uint32_t s);
|
|
void drwsurf_flip(struct drwsurf *ds);
|
|
|
|
typedef union {
|
|
uint8_t bgra[4];
|
|
uint32_t color;
|
|
} Color;
|
|
|
|
void
|
|
drw_fill_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
|
|
uint32_t w, uint32_t h);
|
|
|
|
void
|
|
drw_draw_text(struct drwsurf *d, Color color,
|
|
uint32_t x, uint32_t y,
|
|
uint32_t w, uint32_t h,
|
|
const char *label);
|
|
|
|
uint32_t
|
|
setup_buffer(struct drwsurf *drwsurf);
|
|
|
|
struct drw {
|
|
struct wl_shm *shm;
|
|
PangoFontDescription *font_description;
|
|
};
|
|
|
|
struct drwsurf {
|
|
uint32_t width, height, scale, size;
|
|
bool dirty;
|
|
|
|
struct drw *ctx;
|
|
struct wl_surface *surf;
|
|
struct wl_buffer *buf;
|
|
struct wl_shm *shm;
|
|
unsigned char *pool_data;
|
|
|
|
cairo_t *cairo;
|
|
PangoLayout *layout;
|
|
};
|
|
|
|
#endif
|