From fc960e5d060c78015e0037616ac568cbd7d64b07 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 14 Sep 2018 19:32:33 +0200 Subject: layer-shell: add _v1 suffix --- include/wlr/types/meson.build | 2 +- include/wlr/types/wlr_layer_shell.h | 133 -------------------------------- include/wlr/types/wlr_layer_shell_v1.h | 134 +++++++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 134 deletions(-) delete mode 100644 include/wlr/types/wlr_layer_shell.h create mode 100644 include/wlr/types/wlr_layer_shell_v1.h (limited to 'include/wlr') diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build index 8c81cb0e..8f44259e 100644 --- a/include/wlr/types/meson.build +++ b/include/wlr/types/meson.build @@ -12,7 +12,7 @@ install_headers( 'wlr_input_device.h', 'wlr_input_inhibitor.h', 'wlr_keyboard.h', - 'wlr_layer_shell.h', + 'wlr_layer_shell_v1.h', 'wlr_linux_dmabuf_v1.h', 'wlr_list.h', 'wlr_matrix.h', diff --git a/include/wlr/types/wlr_layer_shell.h b/include/wlr/types/wlr_layer_shell.h deleted file mode 100644 index c7ddd180..00000000 --- a/include/wlr/types/wlr_layer_shell.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * This an unstable interface of wlroots. No guarantees are made regarding the - * future consistency of this API. - */ -#ifndef WLR_USE_UNSTABLE -#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" -#endif - -#ifndef WLR_TYPES_WLR_LAYER_SHELL_H -#define WLR_TYPES_WLR_LAYER_SHELL_H -#include -#include -#include -#include -#include -#include "wlr-layer-shell-unstable-v1-protocol.h" - -/** - * wlr_layer_shell allows clients to arrange themselves in "layers" on the - * desktop in accordance with the wlr-layer-shell protocol. When a client is - * added, the new_surface signal will be raised and passed a reference to our - * wlr_layer_surface. At this time, the client will have configured the surface - * as it desires, including information like desired anchors and margins. The - * compositor should use this information to decide how to arrange the layer - * on-screen, then determine the dimensions of the layer and call - * wlr_layer_surface_configure. The client will then attach a buffer and commit - * the surface, at which point the wlr_layer_surface map signal is raised and - * the compositor should begin rendering the surface. - */ -struct wlr_layer_shell { - struct wl_global *global; - struct wl_list client_resources; // wl_resource - struct wl_list surfaces; // wl_layer_surface - - struct wl_listener display_destroy; - - struct { - // struct wlr_layer_surface * - // Note: the output may be NULL. In this case, it is your - // responsibility to assign an output before returning. - struct wl_signal new_surface; - struct wl_signal destroy; - } events; - - void *data; -}; - -struct wlr_layer_surface_state { - uint32_t anchor; - int32_t exclusive_zone; - struct { - uint32_t top, right, bottom, left; - } margin; - bool keyboard_interactive; - uint32_t desired_width, desired_height; - uint32_t actual_width, actual_height; -}; - -struct wlr_layer_surface_configure { - struct wl_list link; // wlr_layer_surface::configure_list - uint32_t serial; - struct wlr_layer_surface_state state; -}; - -struct wlr_layer_surface { - struct wl_list link; // wlr_layer_shell::surfaces - struct wlr_surface *surface; - struct wlr_output *output; - struct wl_resource *resource; - struct wlr_layer_shell *shell; - struct wl_list popups; // wlr_xdg_popup::link - - char *namespace; - enum zwlr_layer_shell_v1_layer layer; - - bool added, configured, mapped, closed; - uint32_t configure_serial; - struct wl_event_source *configure_idle; - uint32_t configure_next_serial; - struct wl_list configure_list; - - struct wlr_layer_surface_configure *acked_configure; - - struct wlr_layer_surface_state client_pending; - struct wlr_layer_surface_state server_pending; - struct wlr_layer_surface_state current; - - struct wl_listener surface_destroy; - - struct { - struct wl_signal destroy; - struct wl_signal map; - struct wl_signal unmap; - struct wl_signal new_popup; - } events; - - void *data; -}; - -struct wlr_layer_shell *wlr_layer_shell_create(struct wl_display *display); -void wlr_layer_shell_destroy(struct wlr_layer_shell *layer_shell); - -/** - * Notifies the layer surface to configure itself with this width/height. The - * layer_surface will signal its map event when the surface is ready to assume - * this size. - */ -void wlr_layer_surface_configure(struct wlr_layer_surface *surface, - uint32_t width, uint32_t height); - -/** - * Unmaps this layer surface and notifies the client that it has been closed. - */ -void wlr_layer_surface_close(struct wlr_layer_surface *surface); - -bool wlr_surface_is_layer_surface(struct wlr_surface *surface); - -struct wlr_layer_surface *wlr_layer_surface_from_wlr_surface( - struct wlr_surface *surface); - -/* Calls the iterator function for each sub-surface and popup of this surface */ -void wlr_layer_surface_for_each_surface(struct wlr_layer_surface *surface, - wlr_surface_iterator_func_t iterator, void *user_data); - -/** - * Find a surface within this layer-surface tree at the given surface-local - * coordinates. Returns the surface and coordinates in the leaf surface - * coordinate system or NULL if no surface is found at that location. - */ -struct wlr_surface *wlr_layer_surface_surface_at( - struct wlr_layer_surface *surface, double sx, double sy, - double *sub_x, double *sub_y); -#endif diff --git a/include/wlr/types/wlr_layer_shell_v1.h b/include/wlr/types/wlr_layer_shell_v1.h new file mode 100644 index 00000000..838b2e83 --- /dev/null +++ b/include/wlr/types/wlr_layer_shell_v1.h @@ -0,0 +1,134 @@ +/* + * This an unstable interface of wlroots. No guarantees are made regarding the + * future consistency of this API. + */ +#ifndef WLR_USE_UNSTABLE +#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" +#endif + +#ifndef WLR_TYPES_WLR_LAYER_SHELL_V1_H +#define WLR_TYPES_WLR_LAYER_SHELL_V1_H +#include +#include +#include +#include +#include +#include "wlr-layer-shell-unstable-v1-protocol.h" + +/** + * wlr_layer_shell_v1 allows clients to arrange themselves in "layers" on the + * desktop in accordance with the wlr-layer-shell protocol. When a client is + * added, the new_surface signal will be raised and passed a reference to our + * wlr_layer_surface_v1. At this time, the client will have configured the + * surface as it desires, including information like desired anchors and + * margins. The compositor should use this information to decide how to arrange + * the layer on-screen, then determine the dimensions of the layer and call + * wlr_layer_surface_v1_configure. The client will then attach a buffer and + * commit the surface, at which point the wlr_layer_surface_v1 map signal is + * raised and the compositor should begin rendering the surface. + */ +struct wlr_layer_shell_v1 { + struct wl_global *global; + struct wl_list resources; // wl_resource + struct wl_list surfaces; // wl_layer_surface + + struct wl_listener display_destroy; + + struct { + // struct wlr_layer_surface_v1 * + // Note: the output may be NULL. In this case, it is your + // responsibility to assign an output before returning. + struct wl_signal new_surface; + struct wl_signal destroy; + } events; + + void *data; +}; + +struct wlr_layer_surface_v1_state { + uint32_t anchor; + int32_t exclusive_zone; + struct { + uint32_t top, right, bottom, left; + } margin; + bool keyboard_interactive; + uint32_t desired_width, desired_height; + uint32_t actual_width, actual_height; +}; + +struct wlr_layer_surface_v1_configure { + struct wl_list link; // wlr_layer_surface_v1::configure_list + uint32_t serial; + struct wlr_layer_surface_v1_state state; +}; + +struct wlr_layer_surface_v1 { + struct wl_list link; // wlr_layer_shell_v1::surfaces + struct wlr_surface *surface; + struct wlr_output *output; + struct wl_resource *resource; + struct wlr_layer_shell_v1 *shell; + struct wl_list popups; // wlr_xdg_popup::link + + char *namespace; + enum zwlr_layer_shell_v1_layer layer; + + bool added, configured, mapped, closed; + uint32_t configure_serial; + struct wl_event_source *configure_idle; + uint32_t configure_next_serial; + struct wl_list configure_list; + + struct wlr_layer_surface_v1_configure *acked_configure; + + struct wlr_layer_surface_v1_state client_pending; + struct wlr_layer_surface_v1_state server_pending; + struct wlr_layer_surface_v1_state current; + + struct wl_listener surface_destroy; + + struct { + struct wl_signal destroy; + struct wl_signal map; + struct wl_signal unmap; + struct wl_signal new_popup; + } events; + + void *data; +}; + +struct wlr_layer_shell_v1 *wlr_layer_shell_v1_create(struct wl_display *display); +void wlr_layer_shell_v1_destroy(struct wlr_layer_shell_v1 *layer_shell); + +/** + * Notifies the layer surface to configure itself with this width/height. The + * layer_surface will signal its map event when the surface is ready to assume + * this size. + */ +void wlr_layer_surface_v1_configure(struct wlr_layer_surface_v1 *surface, + uint32_t width, uint32_t height); + +/** + * Unmaps this layer surface and notifies the client that it has been closed. + */ +void wlr_layer_surface_v1_close(struct wlr_layer_surface_v1 *surface); + +bool wlr_surface_is_layer_surface(struct wlr_surface *surface); + +struct wlr_layer_surface_v1 *wlr_layer_surface_v1_from_wlr_surface( + struct wlr_surface *surface); + +/* Calls the iterator function for each sub-surface and popup of this surface */ +void wlr_layer_surface_v1_for_each_surface(struct wlr_layer_surface_v1 *surface, + wlr_surface_iterator_func_t iterator, void *user_data); + +/** + * Find a surface within this layer-surface tree at the given surface-local + * coordinates. Returns the surface and coordinates in the leaf surface + * coordinate system or NULL if no surface is found at that location. + */ +struct wlr_surface *wlr_layer_surface_v1_surface_at( + struct wlr_layer_surface_v1 *surface, double sx, double sy, + double *sub_x, double *sub_y); + +#endif -- cgit v1.2.3