diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-09-27 20:24:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-27 20:24:13 -0400 |
commit | 38bb3b960852f9e358ec40c516f99eafeaf83ab2 (patch) | |
tree | 755f57a424364aa991e9303760a2040ae324cfd8 /include | |
parent | 1ddda91b1b647df339b5b0a6aefa383e48d634d8 (diff) | |
parent | 4e70d36e61dd720e9caadb74b39d3a0cd6c8cad7 (diff) |
Merge pull request #162 from emersion/wl_shell
Add wl_shell to rootston
Diffstat (limited to 'include')
-rw-r--r-- | include/rootston/desktop.h | 2 | ||||
-rw-r--r-- | include/rootston/view.h | 12 | ||||
-rw-r--r-- | include/wlr/types/wlr_wl_shell.h | 90 |
3 files changed, 99 insertions, 5 deletions
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h index 62050972..ef361d87 100644 --- a/include/rootston/desktop.h +++ b/include/rootston/desktop.h @@ -39,6 +39,7 @@ struct roots_desktop { struct wl_listener output_add; struct wl_listener output_remove; struct wl_listener xdg_shell_v6_surface; + struct wl_listener wl_shell_surface; }; struct roots_server; @@ -55,5 +56,6 @@ void output_add_notify(struct wl_listener *listener, void *data); void output_remove_notify(struct wl_listener *listener, void *data); void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); +void handle_wl_shell_surface(struct wl_listener *listener, void *data); #endif diff --git a/include/rootston/view.h b/include/rootston/view.h index b74d1075..1010566a 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -6,8 +6,14 @@ #include <wlr/types/wlr_xdg_shell_v6.h> struct roots_wl_shell_surface { - // TODO - void *_placeholder; + struct roots_view *view; + // TODO: Maybe destroy listener should go in roots_view + struct wl_listener destroy; + struct wl_listener ping_timeout; + struct wl_listener request_move; + struct wl_listener request_resize; + struct wl_listener request_set_fullscreen; + struct wl_listener request_set_maximized; }; struct roots_xdg_surface_v6 { @@ -34,7 +40,7 @@ struct roots_view { // TODO: Something for roots-enforced width/height enum roots_view_type type; union { - struct wlr_shell_surface *wl_shell_surface; + struct wlr_wl_shell_surface *wl_shell_surface; struct wlr_xdg_surface_v6 *xdg_surface_v6; }; union { diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h index 1443bbf0..11d30d95 100644 --- a/include/wlr/types/wlr_wl_shell.h +++ b/include/wlr/types/wlr_wl_shell.h @@ -1,26 +1,112 @@ #ifndef WLR_TYPES_WLR_WL_SHELL_H #define WLR_TYPES_WLR_WL_SHELL_H +#include <stdbool.h> #include <wayland-server.h> struct wlr_wl_shell { struct wl_global *wl_global; struct wl_list wl_resources; struct wl_list surfaces; + uint32_t ping_timeout; + + struct { + struct wl_signal new_surface; + } events; void *data; }; +struct wlr_wl_shell_surface_transient_state { + struct wlr_wl_shell_surface *parent; + int32_t x; + int32_t y; + uint32_t flags; +}; + +struct wlr_wl_shell_surface_popup_state { + struct wlr_seat_handle *seat_handle; + uint32_t serial; +}; + +enum wlr_wl_shell_surface_role { + WLR_WL_SHELL_SURFACE_ROLE_NONE, + WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL, + WLR_WL_SHELL_SURFACE_ROLE_TRANSCIENT, + WLR_WL_SHELL_SURFACE_ROLE_POPUP, +}; + struct wlr_wl_shell_surface { - struct wl_resource *surface; - struct wlr_texture *wlr_texture; + struct wlr_wl_shell *shell; + struct wl_client *client; + struct wl_resource *resource; + struct wlr_surface *surface; struct wl_list link; + uint32_t ping_serial; + struct wl_event_source *ping_timer; + + enum wlr_wl_shell_surface_role role; + struct wlr_wl_shell_surface_transient_state *transient_state; + struct wlr_wl_shell_surface_popup_state *popup_state; + + char *title; + char *class; + + struct wl_listener surface_destroy_listener; + + struct { + struct wl_signal destroy; + struct wl_signal ping_timeout; + + struct wl_signal request_move; + struct wl_signal request_resize; + struct wl_signal request_set_fullscreen; + struct wl_signal request_set_maximized; + + struct wl_signal set_role; + struct wl_signal set_title; + struct wl_signal set_class; + } events; + void *data; }; +struct wlr_wl_shell_surface_move_event { + struct wl_client *client; + struct wlr_wl_shell_surface *surface; + struct wlr_seat_handle *seat_handle; + uint32_t serial; +}; + +struct wlr_wl_shell_surface_resize_event { + struct wl_client *client; + struct wlr_wl_shell_surface *surface; + struct wlr_seat_handle *seat_handle; + uint32_t serial; + uint32_t edges; +}; + +struct wlr_wl_shell_surface_set_fullscreen_event { + struct wl_client *client; + struct wlr_wl_shell_surface *surface; + uint32_t method; + uint32_t framerate; + struct wlr_output *output; +}; + +struct wlr_wl_shell_surface_set_maximized_event { + struct wl_client *client; + struct wlr_wl_shell_surface *surface; + struct wlr_output *output; +}; struct wlr_wl_shell *wlr_wl_shell_create(struct wl_display *display); void wlr_wl_shell_destroy(struct wlr_wl_shell *wlr_wl_shell); +void wlr_wl_shell_surface_ping(struct wlr_wl_shell_surface *surface); +void wlr_wl_shell_surface_configure(struct wlr_wl_shell_surface *surface, + uint32_t edges, int32_t width, int32_t height); +void wlr_wl_shell_surface_popup_done(struct wlr_wl_shell_surface *surface); + #endif |