mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
Replace multi_rect with lab_scene_rect
lab_scene_rect accepts the arbitrary number of borders and a background color.
This commit is contained in:
parent
4cc6b354b0
commit
ffd400503e
12 changed files with 187 additions and 140 deletions
40
include/common/lab-scene-rect.h
Normal file
40
include/common/lab-scene-rect.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef LABWC_LAB_SCENE_RECT_H
|
||||
#define LABWC_LAB_SCENE_RECT_H
|
||||
#include <wayland-server-core.h>
|
||||
|
||||
struct wlr_scene_tree;
|
||||
|
||||
struct lab_scene_rect_options {
|
||||
float **border_colors;
|
||||
int nr_borders;
|
||||
int border_width;
|
||||
float *bg_color; /* can be NULL */
|
||||
int width;
|
||||
int height;
|
||||
};
|
||||
|
||||
struct lab_scene_rect {
|
||||
struct wlr_scene_tree *tree;
|
||||
int border_width;
|
||||
int nr_borders;
|
||||
struct border_scene *borders;
|
||||
struct wlr_scene_rect *fill;
|
||||
|
||||
struct wl_listener node_destroy;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new rectangle with borders.
|
||||
*
|
||||
* The rectangle can be positioned by positioning border_rect->tree->node.
|
||||
*
|
||||
* It can be destroyed by destroying its tree node (or one of its parent nodes).
|
||||
* Once the tree node has been destroyed the struct will be free'd automatically.
|
||||
*/
|
||||
struct lab_scene_rect *lab_scene_rect_create(struct wlr_scene_tree *parent,
|
||||
struct lab_scene_rect_options *opts);
|
||||
|
||||
void lab_scene_rect_set_size(struct lab_scene_rect *rect, int width, int height);
|
||||
|
||||
#endif /* LABWC_LAB_SCENE_RECT_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue