aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_scene.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h
index 6e0aebf8..4b3c1aaf 100644
--- a/include/wlr/types/wlr_scene.h
+++ b/include/wlr/types/wlr_scene.h
@@ -28,6 +28,7 @@ struct wlr_output;
enum wlr_scene_node_type {
WLR_SCENE_NODE_ROOT,
WLR_SCENE_NODE_SURFACE,
+ WLR_SCENE_NODE_RECT,
};
struct wlr_scene_node_state {
@@ -67,6 +68,13 @@ struct wlr_scene_surface {
struct wl_listener surface_destroy;
};
+/** A scene-graph node displaying a solid-colored rectangle */
+struct wlr_scene_rect {
+ struct wlr_scene_node node;
+ int width, height;
+ float color[4];
+};
+
typedef void (*wlr_scene_node_iterator_func_t)(struct wlr_scene_node *node,
int sx, int sy, void *data);
@@ -134,4 +142,20 @@ void wlr_scene_render_output(struct wlr_scene *scene, struct wlr_output *output,
struct wlr_scene_surface *wlr_scene_surface_create(struct wlr_scene_node *parent,
struct wlr_surface *surface);
+/**
+ * Add a node displaying a solid-colored rectangle to the scene-graph.
+ */
+struct wlr_scene_rect *wlr_scene_rect_create(struct wlr_scene_node *parent,
+ int width, int height, const float color[static 4]);
+
+/**
+ * Change the width and height of an existing rectangle node.
+ */
+void wlr_scene_rect_set_size(struct wlr_scene_rect *rect, int width, int height);
+
+/**
+ * Change the color of an existing rectangle node.
+ */
+void wlr_scene_rect_set_color(struct wlr_scene_rect *rect, const float color[static 4]);
+
#endif