diff options
| author | Simon Ser <contact@emersion.fr> | 2021-01-18 12:31:20 +0100 | 
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2021-02-02 23:42:53 +0100 | 
| commit | 45f992b27b7a8f74dd5b05e9961dead25bb7a248 (patch) | |
| tree | a352f2b5e72b7a4f81164d8a6cb987be6603a1fb | |
| parent | 3d7aa7386706f6aa8041f27a3fba22d5b4290e82 (diff) | |
| download | wlroots-45f992b27b7a8f74dd5b05e9961dead25bb7a248.tar.xz | |
region: make wlr_region_create private
This function should only be called from the handler for
wl_compositor.create_region requests.
| -rw-r--r-- | include/types/wlr_region.h | 13 | ||||
| -rw-r--r-- | include/wlr/types/wlr_region.h | 7 | ||||
| -rw-r--r-- | types/wlr_compositor.c | 4 | ||||
| -rw-r--r-- | types/wlr_region.c | 3 | 
4 files changed, 17 insertions, 10 deletions
| diff --git a/include/types/wlr_region.h b/include/types/wlr_region.h new file mode 100644 index 00000000..b0cda349 --- /dev/null +++ b/include/types/wlr_region.h @@ -0,0 +1,13 @@ +#ifndef TYPES_WLR_REGION_H +#define TYPES_WLR_REGION_H + +#include <wlr/types/wlr_region.h> + +/* + * Creates a new region resource with the provided new ID. If `resource_list` is + * non-NULL, adds the region's resource to the list. + */ +struct wl_resource *region_create(struct wl_client *client, +	uint32_t version, uint32_t id); + +#endif diff --git a/include/wlr/types/wlr_region.h b/include/wlr/types/wlr_region.h index ec7f73aa..532f86df 100644 --- a/include/wlr/types/wlr_region.h +++ b/include/wlr/types/wlr_region.h @@ -12,13 +12,6 @@  #include <pixman.h>  #include <wayland-server-protocol.h> -/* - * Creates a new region resource with the provided new ID. If `resource_list` is - * non-NULL, adds the region's resource to the list. - */ -struct wl_resource *wlr_region_create(struct wl_client *client, -	uint32_t version, uint32_t id, struct wl_list *resource_list); -  pixman_region32_t *wlr_region_from_resource(struct wl_resource *resource);  #endif diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c index d49dcc18..2bab57c6 100644 --- a/types/wlr_compositor.c +++ b/types/wlr_compositor.c @@ -2,9 +2,9 @@  #include <stdlib.h>  #include <wayland-server-core.h>  #include <wlr/types/wlr_compositor.h> -#include <wlr/types/wlr_region.h>  #include <wlr/types/wlr_surface.h>  #include <wlr/util/log.h> +#include "types/wlr_region.h"  #include "util/signal.h"  #define COMPOSITOR_VERSION 4 @@ -131,7 +131,7 @@ static void compositor_create_surface(struct wl_client *client,  static void compositor_create_region(struct wl_client *client,  		struct wl_resource *resource, uint32_t id) { -	wlr_region_create(client, wl_resource_get_version(resource), id, NULL); +	region_create(client, wl_resource_get_version(resource), id, NULL);  }  static const struct wl_compositor_interface compositor_impl = { diff --git a/types/wlr_region.c b/types/wlr_region.c index 808cbb72..6cdcf4e8 100644 --- a/types/wlr_region.c +++ b/types/wlr_region.c @@ -4,6 +4,7 @@  #include <stdlib.h>  #include <wayland-server-core.h>  #include <wlr/types/wlr_region.h> +#include "types/wlr_region.h"  static void region_add(struct wl_client *client, struct wl_resource *resource,  		int32_t x, int32_t y, int32_t width, int32_t height) { @@ -41,7 +42,7 @@ static void region_handle_resource_destroy(struct wl_resource *resource) {  	free(reg);  } -struct wl_resource *wlr_region_create(struct wl_client *client, +struct wl_resource *region_create(struct wl_client *client,  		uint32_t version, uint32_t id, struct wl_list *resource_list) {  	pixman_region32_t *region = calloc(1, sizeof(pixman_region32_t));  	if (region == NULL) { | 
