1 /* 2 * Copyright 2020 Collabora, Ltd. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 * DEALINGS IN THE SOFTWARE. 22 */ 23 24 #ifndef WESTON_KIOSK_SHELL_H 25 #define WESTON_KIOSK_SHELL_H 26 27 #include <libweston-desktop/libweston-desktop.h> 28 #include <libweston/libweston.h> 29 30 struct kiosk_shell { 31 struct weston_compositor *compositor; 32 struct weston_desktop *desktop; 33 34 struct wl_listener destroy_listener; 35 struct wl_listener output_created_listener; 36 struct wl_listener output_resized_listener; 37 struct wl_listener output_moved_listener; 38 struct wl_listener seat_created_listener; 39 40 struct weston_layer background_layer; 41 struct weston_layer normal_layer; 42 43 struct wl_list output_list; 44 }; 45 46 struct kiosk_shell_surface { 47 struct weston_desktop_surface *desktop_surface; 48 struct weston_view *view; 49 50 struct kiosk_shell *shell; 51 52 struct weston_output *output; 53 struct wl_listener output_destroy_listener; 54 55 struct wl_signal destroy_signal; 56 struct wl_listener parent_destroy_listener; 57 struct kiosk_shell_surface *parent; 58 59 int focus_count; 60 61 int32_t last_width, last_height; 62 bool grabbed; 63 64 struct { 65 bool is_set; 66 int32_t x; 67 int32_t y; 68 } xwayland; 69 }; 70 71 struct kiosk_shell_seat { 72 struct weston_seat *seat; 73 struct wl_listener seat_destroy_listener; 74 struct weston_surface *focused_surface; 75 76 struct wl_listener caps_changed_listener; 77 struct wl_listener keyboard_focus_listener; 78 }; 79 80 struct kiosk_shell_output { 81 struct weston_output *output; 82 struct wl_listener output_destroy_listener; 83 struct weston_view *background_view; 84 85 struct kiosk_shell *shell; 86 struct wl_list link; 87 88 char *app_ids; 89 }; 90 91 #endif /* WESTON_KIOSK_SHELL_H */ 92