blob: 693233860cc97db117ed2f7ddb4fd845fdc17366 [file] [log] [blame]
leng.fangdbaf6fa2024-06-20 19:31:04 +08001/*
2 * Copyright (c) 2022 Amlogic, Inc. All rights reserved.
3 *
4 * This source code is subject to the terms and conditions defined in the
5 * file 'LICENSE' which is part of this source code package.
6 *
7 * Description:
8 */
9
10#ifndef AML_SIMPLESHELL_H
11#define AML_SIMPLESHELL_H
12
13#include <libweston/libweston.h>
14
15#define WESTON_ZORDER_MAX 1000
16#define WESTON_ZORDER_DEFAULT 50
17#define WESTON_ZORDER_INTERVAL 10
18
19struct weston_surface_id {
20 int id;
21 struct weston_surface *surface;
22 struct wl_list link;
23};
24
25struct weston_key_intercept {
26 uint32_t key_code;
27 uint32_t flags;
28 struct wl_resource *keyboard_object;
29 struct weston_surface *surface;
30 struct wl_list link;
31};
32
33struct weston_key_info {
34 struct wl_resource *resource;
35 uint32_t key;
36 struct wl_list link;
37};
38
39int
40load_simple_shell(struct weston_compositor *compositor,
41 void* (*load_module)(const char *, const char *));
42
43bool
44weston_keyboard_is_intercepted_keycode(struct weston_keyboard *keyboard,
45 uint32_t keycode, uint32_t mods_depressed,
46 uint32_t mods_latched,
47 uint32_t mods_locked, uint32_t group,
48 uint32_t serial, enum wl_keyboard_key_state state,
49 uint32_t msecs, bool modifier);
50
51void
52weston_keyboard_add_key_info(struct weston_keyboard *keyboard,
53 struct wl_resource *resource, uint32_t key);
54
55void
56weston_compositor_build_view_list_by_zorder(struct weston_compositor *compositor);
57
58void
59weston_surface_destroy_info_for_surface(struct weston_surface *surface);
60
61void
62weston_compositor_add_surface_id(
63 struct weston_compositor *compositor,
64 struct weston_surface *surface);
65
66void
67weston_compositor_clear_surface_id(struct weston_compositor *compositor);
68
69void
70weston_keyboard_clear_key_intercept(struct weston_keyboard *keyboard);
71
72void
73weston_keyboard_clear_key_info_for_resource(
74 struct weston_keyboard *keyboard, struct wl_resource *resource);
75
76void
77weston_keyboard_get_resource_and_key(struct weston_keyboard *keyboard,
78 struct wl_resource **resource, uint32_t *key);
79
80#endif