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