mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
Centralize buffer preparation and standardize placement
This commit is contained in:
parent
90e652a8a1
commit
d80dd2470b
16 changed files with 251 additions and 431 deletions
|
|
@ -3,10 +3,14 @@
|
|||
#ifndef LABWC_BORDERSET_H
|
||||
#define LABWC_BORDERSET_H
|
||||
|
||||
enum border_type {
|
||||
BORDER_FLAT, BORDER_SINGLE, BORDER_DOUBLE, BORDER_INSET
|
||||
};
|
||||
|
||||
struct borderset {
|
||||
uint32_t id; // Base colour, but could be used as a tracking hash for images or whatever in the future
|
||||
int size; // width (since I suspect a 2px border scaled up to 20px might look weird)
|
||||
int type; // Single or double bevel
|
||||
enum border_type type; // Single or double bevel
|
||||
uint32_t * top;
|
||||
uint32_t * left;
|
||||
uint32_t * right;
|
||||
|
|
@ -18,12 +22,29 @@ struct borderset {
|
|||
struct borderset * next;
|
||||
};
|
||||
|
||||
struct bufferset {
|
||||
enum border_type type;
|
||||
int border_width;
|
||||
struct wlr_scene_buffer * top;
|
||||
struct wlr_scene_buffer * left;
|
||||
struct wlr_scene_buffer * right;
|
||||
struct wlr_scene_buffer * bottom;
|
||||
struct wlr_scene_buffer * tl;
|
||||
struct wlr_scene_buffer * tr;
|
||||
struct wlr_scene_buffer * bl;
|
||||
struct wlr_scene_buffer * br;
|
||||
|
||||
};
|
||||
|
||||
extern struct borderset * borderCache;
|
||||
|
||||
struct borderset * getBorders(uint32_t id, int size, int type, int bevelSize);
|
||||
struct borderset * getBorders(uint32_t id, int size, enum border_type, int bevelSize);
|
||||
|
||||
struct borderset * createBuffer(uint32_t id, int size, int type, int bevelSize);
|
||||
struct borderset * createBuffer(uint32_t id, int size, enum border_type, int bevelSize);
|
||||
|
||||
struct bufferset * generateBufferset(struct wlr_scene_tree * tree, struct borderset *borderset, int bw);
|
||||
|
||||
void renderBufferset(struct bufferset *, int width, int height, int y);
|
||||
|
||||
void clearBorderCache(struct borderset *borderset);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue