diff options
author | emersion <contact@emersion.fr> | 2018-07-07 22:45:16 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-07-07 22:45:16 +0100 |
commit | 33db4263a0706df90946112d34a927103bf26ff9 (patch) | |
tree | 294298ed46a1f24396a403117ee6f0a071ddaef7 /include/wlr | |
parent | be54278207f5099b77a538e3043758aa59e5c998 (diff) |
surface: replace wlr_surface_set_role_committed with wlr_surface_role
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/wlr_layer_shell.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_surface.h | 24 | ||||
-rw-r--r-- | include/wlr/types/wlr_wl_shell.h | 4 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell.h | 3 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell_v6.h | 3 |
6 files changed, 19 insertions, 19 deletions
diff --git a/include/wlr/types/wlr_layer_shell.h b/include/wlr/types/wlr_layer_shell.h index 1477989d..8f69cbbb 100644 --- a/include/wlr/types/wlr_layer_shell.h +++ b/include/wlr/types/wlr_layer_shell.h @@ -76,7 +76,7 @@ struct wlr_layer_surface { struct wlr_layer_surface_state server_pending; struct wlr_layer_surface_state current; - struct wl_listener surface_destroy_listener; + struct wl_listener surface_destroy; struct { struct wl_signal destroy; diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index 5e04003d..11fd9e15 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -540,4 +540,6 @@ 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); +bool wlr_surface_is_pointer_cursor(struct wlr_surface *surface); + #endif diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index b89da87a..93f456cd 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -36,6 +36,11 @@ struct wlr_surface_state { struct wl_listener buffer_destroy; }; +struct wlr_surface_role { + const char *name; + void (*commit)(struct wlr_surface *surface); +}; + struct wlr_surface { struct wl_resource *resource; struct wlr_renderer *renderer; @@ -68,7 +73,9 @@ struct wlr_surface { * the previous commit. */ struct wlr_surface_state current, pending, previous; - const char *role; // the lifetime-bound role or null + + const struct wlr_surface_role *role; // the lifetime-bound role or NULL + void *role_data; // role-specific data struct { struct wl_signal commit; @@ -76,10 +83,6 @@ struct wlr_surface { struct wl_signal destroy; } events; - // surface commit callback for the role that runs before all others - void (*role_committed)(struct wlr_surface *surface, void *role_data); - void *role_data; - struct wl_list subsurfaces; // wlr_subsurface::parent_link // wlr_subsurface::parent_pending_link @@ -137,7 +140,8 @@ struct wlr_surface *wlr_surface_create(struct wl_client *client, * Set the lifetime role for this surface. Returns 0 on success or -1 if the * role cannot be set. */ -int wlr_surface_set_role(struct wlr_surface *surface, const char *role, +bool wlr_surface_set_role(struct wlr_surface *surface, + const struct wlr_surface_role *role, void *role_data, struct wl_resource *error_resource, uint32_t error_code); /** @@ -200,14 +204,6 @@ struct wlr_box; */ void wlr_surface_get_extends(struct wlr_surface *surface, struct wlr_box *box); -/** - * Set a callback for surface commit that runs before all the other callbacks. - * This is intended for use by the surface role. - */ -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); /** diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h index b60a0ddd..226b27a0 100644 --- a/include/wlr/types/wlr_wl_shell.h +++ b/include/wlr/types/wlr_wl_shell.h @@ -69,7 +69,7 @@ struct wlr_wl_shell_surface { char *title; char *class; - struct wl_listener surface_destroy_listener; + struct wl_listener surface_destroy; struct wlr_wl_shell_surface *parent; struct wl_list popup_link; @@ -152,7 +152,7 @@ struct wlr_surface *wlr_wl_shell_surface_surface_at( bool wlr_surface_is_wl_shell_surface(struct wlr_surface *surface); -struct wlr_wl_surface *wlr_wl_shell_surface_from_wlr_surface( +struct wlr_wl_shell_surface *wlr_wl_shell_surface_from_wlr_surface( struct wlr_surface *surface); /** diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index d2dfaacb..7b1c8f13 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -163,7 +163,8 @@ struct wlr_xdg_surface { struct wlr_box next_geometry; struct wlr_box geometry; - struct wl_listener surface_destroy_listener; + struct wl_listener surface_destroy; + struct wl_listener surface_commit; struct { struct wl_signal destroy; diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index 38f85635..dfefb58b 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -161,7 +161,8 @@ struct wlr_xdg_surface_v6 { struct wlr_box next_geometry; struct wlr_box geometry; - struct wl_listener surface_destroy_listener; + struct wl_listener surface_destroy; + struct wl_listener surface_commit; struct { struct wl_signal destroy; |