From 2fa72ee0dc67d973330aec4ba98260e9f57f7821 Mon Sep 17 00:00:00 2001 From: Lena Date: Thu, 1 Jan 2026 00:00:00 +0000 Subject: Enter mouseboard Keyboard-only pointing: a labelled grid over every monitor, type a label to jump to a cell, bisect it by quadrant until the crosshair is exact, then one key clicks. The coarse grid keeps labels short and bisection keeps precision unlimited, so a hotkey and a few keystrokes replace the mouse. The core talks only to the backend interface in platform.h; wlroots Wayland and Win32 backends supply the overlay, keyboard grab and pointer. --- draw.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 draw.h (limited to 'draw.h') diff --git a/draw.h b/draw.h new file mode 100644 index 0000000..945c0f7 --- /dev/null +++ b/draw.h @@ -0,0 +1,28 @@ +/* + * draw.h - software rendering onto an ARGB8888 mb_buffer. + * + * Colours are straight-alpha 0xAARRGGBB; they are premultiplied on the way in + * and overwrite the destination (the compositor blends the finished overlay + * over the desktop). All primitives clip to the buffer. + */ +#ifndef MOUSEBOARD_DRAW_H +#define MOUSEBOARD_DRAW_H + +#include "platform.h" + +void draw_fill(struct mb_buffer *b, int x, int y, int w, int h, uint32_t argb); +void draw_rect(struct mb_buffer *b, int x, int y, int w, int h, int thick, + uint32_t argb); +void draw_hline(struct mb_buffer *b, int x, int y, int len, int thick, + uint32_t argb); +void draw_vline(struct mb_buffer *b, int x, int y, int len, int thick, + uint32_t argb); + +/* Render text at scale (integer multiple of the 8x8 cell). Returns the pixel + * width drawn. */ +int draw_text(struct mb_buffer *b, int x, int y, const char *s, int scale, + uint32_t fg); +int text_width(const char *s, int scale); +int text_height(int scale); + +#endif /* MOUSEBOARD_DRAW_H */ -- cgit v1.2.3