summaryrefslogtreecommitdiff
path: root/kiosk-shell/kiosk-shell.h
blob: 5f7b6851f66e0018d9a3f291847e21983d3d5705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
 * Copyright 2020 Collabora, Ltd.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

#ifndef WESTON_KIOSK_SHELL_H
#define WESTON_KIOSK_SHELL_H

#include <libweston/desktop.h>
#include <libweston/libweston.h>
#include <libweston/config-parser.h>

struct kiosk_shell {
	struct weston_compositor *compositor;
	struct weston_desktop *desktop;

	struct wl_listener destroy_listener;
	struct wl_listener output_created_listener;
	struct wl_listener output_resized_listener;
	struct wl_listener output_moved_listener;
	struct wl_listener seat_created_listener;
	struct wl_listener transform_listener;

	struct weston_layer background_layer;
	struct weston_layer normal_layer;
	struct weston_layer inactive_layer;

	struct wl_list output_list;
	struct wl_list seat_list;

	const struct weston_xwayland_surface_api *xwayland_surface_api;
	struct weston_config *config;
};

struct kiosk_shell_surface {
	struct weston_desktop_surface *desktop_surface;
	struct weston_view *view;

	struct kiosk_shell *shell;

	struct weston_output *output;
	struct wl_listener output_destroy_listener;

	struct wl_signal destroy_signal;

	struct wl_signal parent_destroy_signal;
	struct wl_listener parent_destroy_listener;
	struct kiosk_shell_surface *parent;

	struct wl_list surface_tree_list;
	struct wl_list surface_tree_link;

	int focus_count;

	int32_t last_width, last_height;
	bool grabbed;

	struct {
		bool is_set;
		struct weston_coord_global pos;
	} xwayland;

	bool appid_output_assigned;
};

struct kiosk_shell_seat {
	struct weston_seat *seat;
	struct wl_listener seat_destroy_listener;
	struct weston_surface *focused_surface;

	struct wl_list link;	/** kiosk_shell::seat_list */
};

struct kiosk_shell_output {
	struct weston_output *output;
	struct wl_listener output_destroy_listener;
	struct weston_curtain *curtain;

	struct kiosk_shell *shell;
	struct wl_list link;

	char *app_ids;

	struct wl_list *active_surface_tree;
};

#endif /* WESTON_KIOSK_SHELL_H */