initial commit
This commit is contained in:
commit
1c606d0274
36 changed files with 9908 additions and 0 deletions
47
include/graphics.h
Normal file
47
include/graphics.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
/*
|
||||
* Interface for drawing keys to a buffer.
|
||||
*
|
||||
* Copyright (c) 2024, Richard Acayan. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef UFKBD_GRAPHICS_H
|
||||
#define UFKBD_GRAPHICS_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <pixman.h>
|
||||
|
||||
struct fcft_font;
|
||||
|
||||
struct ufkbd_ctx;
|
||||
struct ufkbd_key;
|
||||
struct ufkbd_layout;
|
||||
|
||||
struct ufkbd_graphics_ctx {
|
||||
struct fcft_font *font;
|
||||
struct fcft_font *font_sec;
|
||||
|
||||
pixman_image_t *fill_bg;
|
||||
pixman_image_t *fill_keycap;
|
||||
pixman_image_t *key_default;
|
||||
pixman_image_t *key_pressed;
|
||||
|
||||
pixman_image_t *target;
|
||||
|
||||
unsigned int scale;
|
||||
|
||||
size_t size;
|
||||
void *buf;
|
||||
};
|
||||
|
||||
struct ufkbd_graphics_ctx *ufkbd_graphics_init(void);
|
||||
void ufkbd_graphics_uninit(struct ufkbd_graphics_ctx *graphics);
|
||||
|
||||
int ufkbd_graphics_set_scale(struct ufkbd_graphics_ctx *graphics, unsigned int scale);
|
||||
|
||||
void ufkbd_graphics_draw_key(struct ufkbd_ctx *ctx, struct ufkbd_key *key,
|
||||
int x1, int y1, int x2, int y2);
|
||||
void ufkbd_graphics_draw_layout(struct ufkbd_ctx *ctx, struct ufkbd_layout *layout,
|
||||
size_t width, size_t height);
|
||||
|
||||
#endif /* UFKBD_GRAPHICS_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue