include/layers.h
changeset 0 5f04caa7212d
equal deleted inserted replaced
-1:000000000000 0:5f04caa7212d
       
     1 #ifndef _GOOSE_LAYERS_H
       
     2 #define _GOOSE_LAYERS_H
       
     3 #include <stdbool.h>
       
     4 #include <wlr/types/wlr_box.h>
       
     5 #include <wlr/types/wlr_surface.h>
       
     6 #include <wlr/types/wlr_layer_shell_v1.h>
       
     7 
       
     8 enum layer_parent {
       
     9 	LAYER_PARENT_LAYER,
       
    10 	LAYER_PARENT_POPUP,
       
    11 };
       
    12 
       
    13 struct goose_layer_surface {
       
    14 	struct wlr_layer_surface_v1 *layer_surface;
       
    15 	struct wl_list link;
       
    16 
       
    17 	struct wl_listener destroy;
       
    18 	struct wl_listener map;
       
    19 	struct wl_listener unmap;
       
    20 	struct wl_listener surface_commit;
       
    21 	struct wl_listener output_destroy;
       
    22 	struct wl_listener new_popup;
       
    23 	struct wl_listener new_subsurface;
       
    24 
       
    25 	struct wlr_box geo;
       
    26 	enum zwlr_layer_shell_v1_layer layer;
       
    27 };
       
    28 
       
    29 struct goose_layer_popup {
       
    30 	struct wlr_xdg_popup *wlr_popup;
       
    31 	enum layer_parent parent_type;
       
    32 	union {
       
    33 		struct goose_layer_surface *parent_layer;
       
    34 		struct goose_layer_popup *parent_popup;
       
    35 	};
       
    36 	struct wl_listener map;
       
    37 	struct wl_listener unmap;
       
    38 	struct wl_listener destroy;
       
    39 	struct wl_listener commit;
       
    40 	struct wl_listener new_popup;
       
    41 };
       
    42 
       
    43 struct goose_layer_subsurface {
       
    44 	struct wlr_subsurface *wlr_subsurface;
       
    45 	struct goose_layer_surface *layer_surface;
       
    46 
       
    47 	struct wl_listener map;
       
    48 	struct wl_listener unmap;
       
    49 	struct wl_listener destroy;
       
    50 	struct wl_listener commit;
       
    51 };
       
    52 
       
    53 struct goose_output;
       
    54 void arrange_layers(struct goose_output *output);
       
    55 
       
    56 struct goose_layer_surface *layer_from_wlr_layer_surface_v1(
       
    57 	struct wlr_layer_surface_v1 *layer_surface);
       
    58 
       
    59 #endif