diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-02-16 09:27:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-16 09:27:26 -0500 |
commit | 8c1cc45c7db9be4b49ffb27541e908f492fd59ba (patch) | |
tree | d95947d79b2a55b87c76d8a31781f6d9402d5496 /include | |
parent | 4ded535354229022dda66c474b097d9e9234effa (diff) | |
parent | 392d54a35d34ff08baaffdd50b9d11072481706e (diff) |
Merge pull request #629 from emersion/safe-wl-resource-get-user-data
Wrap wl_resource_get_user_data into safer helper functions
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_output.h | 1 | ||||
-rw-r--r-- | include/wlr/types/wlr_region.h | 7 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_surface.h | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 5c2ffee0..a8138a80 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -157,6 +157,7 @@ void wlr_output_set_gamma(struct wlr_output *output, uint32_t wlr_output_get_gamma_size(struct wlr_output *output); void wlr_output_set_fullscreen_surface(struct wlr_output *output, struct wlr_surface *surface); +struct wlr_output *wlr_output_from_resource(struct wl_resource *resource); struct wlr_output_cursor *wlr_output_cursor_create(struct wlr_output *output); diff --git a/include/wlr/types/wlr_region.h b/include/wlr/types/wlr_region.h index 6d59ee5e..ffacea72 100644 --- a/include/wlr/types/wlr_region.h +++ b/include/wlr/types/wlr_region.h @@ -1,13 +1,16 @@ #ifndef WLR_TYPES_WLR_REGION_H #define WLR_TYPES_WLR_REGION_H +#include <pixman.h> + struct wl_resource; /* * Implements the given resource as region. - * Sets the associated pixman_region32_t as userdata. */ void wlr_region_create(struct wl_client *client, struct wl_resource *res, - uint32_t id); + uint32_t id); + +pixman_region32_t *wlr_region_from_resource(struct wl_resource *resource); #endif diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index b03cab6e..124c1cb8 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -530,4 +530,6 @@ bool wlr_seat_touch_has_grab(struct wlr_seat *seat); */ bool wlr_seat_validate_grab_serial(struct wlr_seat *seat, uint32_t serial); +struct wlr_seat_client *wlr_seat_client_from_resource(struct wl_resource *resource); + #endif diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index 998b5ae5..203345bd 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -164,4 +164,6 @@ void wlr_surface_set_role_committed(struct wlr_surface *surface, void (*role_committed)(struct wlr_surface *surface, void *role_data), void *role_data); +struct wlr_surface *wlr_surface_from_resource(struct wl_resource *resource); + #endif |