mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-13 02:42:47 +01:00
Simplify ctx initializer
This commit is contained in:
parent
283a758910
commit
b65ea995f1
12
drw.c
12
drw.c
@ -5,18 +5,6 @@
|
||||
#include "drw.h"
|
||||
#include "shm_open.h"
|
||||
|
||||
void
|
||||
drw_init(struct drw *d, const char *fc_pattern, void *shm) {
|
||||
d->shm = shm;
|
||||
d->font_description = pango_font_description_from_string(fc_pattern);
|
||||
}
|
||||
|
||||
void
|
||||
drwsurf_init(struct drw *d, struct drwsurf *ds, struct wl_surface *surf) {
|
||||
ds->ctx = d;
|
||||
ds->surf = surf;
|
||||
}
|
||||
|
||||
void
|
||||
drwsurf_resize(struct drwsurf *ds, uint32_t w, uint32_t h, uint32_t s) {
|
||||
if (ds->buf) {
|
||||
|
2
drw.h
2
drw.h
@ -8,8 +8,6 @@ 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);
|
||||
|
||||
|
7
main.c
7
main.c
@ -438,8 +438,11 @@ main(int argc, char **argv) {
|
||||
|
||||
/* create surface */
|
||||
wl_surface = wl_compositor_create_surface(compositor);
|
||||
drw_init(&draw_ctx, fc_font_pattern, shm);
|
||||
drwsurf_init(&draw_ctx, &draw_surf, wl_surface);
|
||||
|
||||
draw_ctx.shm = shm;
|
||||
draw_ctx.font_description = pango_font_description_from_string(fc_font_pattern);
|
||||
draw_surf.ctx = &draw_ctx;
|
||||
draw_surf.surf = wl_surface;
|
||||
|
||||
layer_surface = zwlr_layer_shell_v1_get_layer_surface(
|
||||
layer_shell, draw_surf.surf, wl_output, layer, namespace);
|
||||
|
Loading…
x
Reference in New Issue
Block a user