diff --git a/include/types/wlr_surface.h b/include/types/wlr_surface.h new file mode 100644 index 00000000..1de8ea0e --- /dev/null +++ b/include/types/wlr_surface.h @@ -0,0 +1,15 @@ +#ifndef TYPES_WLR_SURFACE_H +#define TYPES_WLR_SURFACE_H + +#include + +struct wlr_renderer; + +/** + * Create a new surface resource with the provided new ID. If `resource_list` + * is non-NULL, adds the surface's resource to the list. + */ +struct wlr_surface *surface_create(struct wl_client *client, + uint32_t version, uint32_t id, struct wlr_renderer *renderer); + +#endif diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index b3ff905c..d99c182a 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -187,16 +187,6 @@ struct wlr_subsurface { typedef void (*wlr_surface_iterator_func_t)(struct wlr_surface *surface, int sx, int sy, void *data); -struct wlr_renderer; - -/** - * Create a new surface resource with the provided new ID. If `resource_list` - * is non-NULL, adds the surface's resource to the list. - */ -struct wlr_surface *wlr_surface_create(struct wl_client *client, - uint32_t version, uint32_t id, struct wlr_renderer *renderer, - struct wl_list *resource_list); - /** * Set the lifetime role for this surface. Returns 0 on success or -1 if the * role cannot be set. diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c index ae4cc10e..ac2f0144 100644 --- a/types/wlr_compositor.c +++ b/types/wlr_compositor.c @@ -5,6 +5,7 @@ #include #include #include "types/wlr_region.h" +#include "types/wlr_surface.h" #include "util/signal.h" #define COMPOSITOR_VERSION 4 @@ -119,7 +120,7 @@ static void compositor_create_surface(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct wlr_compositor *compositor = compositor_from_resource(resource); - struct wlr_surface *surface = wlr_surface_create(client, + struct wlr_surface *surface = surface_create(client, wl_resource_get_version(resource), id, compositor->renderer, NULL); if (surface == NULL) { wl_client_post_no_memory(client); diff --git a/types/wlr_surface.c b/types/wlr_surface.c index a472b844..3e58e9d5 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -10,6 +10,7 @@ #include #include #include +#include "types/wlr_surface.h" #include "util/signal.h" #include "util/time.h" @@ -702,7 +703,7 @@ static void surface_handle_renderer_destroy(struct wl_listener *listener, wl_resource_destroy(surface->resource); } -struct wlr_surface *wlr_surface_create(struct wl_client *client, +struct wlr_surface *surface_create(struct wl_client *client, uint32_t version, uint32_t id, struct wlr_renderer *renderer, struct wl_list *resource_list) { assert(version <= SURFACE_VERSION);