mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
27 lines
649 B
C
27 lines
649 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
#include <assert.h>
|
|
#include <wlr/types/wlr_scene.h>
|
|
|
|
struct wlr_scene_rect *
|
|
lab_wlr_scene_get_rect(struct wlr_scene_node *node)
|
|
{
|
|
assert(node->type == WLR_SCENE_NODE_RECT);
|
|
return (struct wlr_scene_rect *)node;
|
|
}
|
|
|
|
struct wlr_surface *
|
|
lab_wlr_surface_from_node(struct wlr_scene_node *node)
|
|
{
|
|
struct wlr_scene_buffer *buffer;
|
|
struct wlr_scene_surface *scene_surface;
|
|
|
|
if (node && node->type == WLR_SCENE_NODE_BUFFER) {
|
|
buffer = wlr_scene_buffer_from_node(node);
|
|
scene_surface = wlr_scene_surface_from_buffer(buffer);
|
|
if (scene_surface) {
|
|
return scene_surface->surface;
|
|
}
|
|
}
|
|
return NULL;
|
|
}
|