leng.fang | dbaf6fa | 2024-06-20 19:31:04 +0800 | [diff] [blame^] | 1 | /* |
| 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 | |
| 19 | struct weston_surface_id { |
| 20 | int id; |
| 21 | struct weston_surface *surface; |
| 22 | struct wl_list link; |
| 23 | }; |
| 24 | |
| 25 | struct 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 | |
| 33 | struct weston_key_info { |
| 34 | struct wl_resource *resource; |
| 35 | uint32_t key; |
| 36 | struct wl_list link; |
| 37 | }; |
| 38 | |
| 39 | int |
| 40 | load_simple_shell(struct weston_compositor *compositor, |
| 41 | void* (*load_module)(const char *, const char *)); |
| 42 | |
| 43 | bool |
| 44 | weston_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 | |
| 51 | void |
| 52 | weston_keyboard_add_key_info(struct weston_keyboard *keyboard, |
| 53 | struct wl_resource *resource, uint32_t key); |
| 54 | |
| 55 | void |
| 56 | weston_compositor_build_view_list_by_zorder(struct weston_compositor *compositor); |
| 57 | |
| 58 | void |
| 59 | weston_surface_destroy_info_for_surface(struct weston_surface *surface); |
| 60 | |
| 61 | void |
| 62 | weston_compositor_add_surface_id( |
| 63 | struct weston_compositor *compositor, |
| 64 | struct weston_surface *surface); |
| 65 | |
| 66 | void |
| 67 | weston_compositor_clear_surface_id(struct weston_compositor *compositor); |
| 68 | |
| 69 | void |
| 70 | weston_keyboard_clear_key_intercept(struct weston_keyboard *keyboard); |
| 71 | |
| 72 | void |
| 73 | weston_keyboard_clear_key_info_for_resource( |
| 74 | struct weston_keyboard *keyboard, struct wl_resource *resource); |
| 75 | |
| 76 | void |
| 77 | weston_keyboard_get_resource_and_key(struct weston_keyboard *keyboard, |
| 78 | struct wl_resource **resource, uint32_t *key); |
| 79 | |
| 80 | #endif |