mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-16 06:59:44 -05:00
Wrap wl_resource_get_user_data into safer helper functions
This ensures we're not incorrectly casting a resource. Fixes #628
This commit is contained in:
parent
71cba94e73
commit
392d54a35d
18 changed files with 474 additions and 213 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue