Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2008-2011 Kristian Høgsberg |
Pekka Paalanen | 1a4f87d | 2021-04-30 14:48:52 +0300 | [diff] [blame] | 3 | * Copyright © 2012, 2017, 2018, 2021 Collabora, Ltd. |
Pekka Paalanen | 925788f | 2018-04-19 14:20:01 +0300 | [diff] [blame] | 4 | * Copyright © 2017, 2018 General Electric Company |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 5 | * |
Bryce Harrington | a0bbfea | 2015-06-11 15:35:43 -0700 | [diff] [blame] | 6 | * Permission is hereby granted, free of charge, to any person obtaining |
| 7 | * a copy of this software and associated documentation files (the |
| 8 | * "Software"), to deal in the Software without restriction, including |
| 9 | * without limitation the rights to use, copy, modify, merge, publish, |
| 10 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 11 | * permit persons to whom the Software is furnished to do so, subject to |
| 12 | * the following conditions: |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 13 | * |
Bryce Harrington | a0bbfea | 2015-06-11 15:35:43 -0700 | [diff] [blame] | 14 | * The above copyright notice and this permission notice (including the |
| 15 | * next paragraph) shall be included in all copies or substantial |
| 16 | * portions of the Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 22 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 23 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 24 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 25 | * SOFTWARE. |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | #ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_ |
| 29 | #define _WAYLAND_SYSTEM_COMPOSITOR_H_ |
| 30 | |
Giulio Camuffo | 7fe01b1 | 2013-03-28 18:02:42 +0100 | [diff] [blame] | 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
Derek Foreman | 280e7dd | 2014-10-03 13:13:42 -0500 | [diff] [blame] | 35 | #include <stdbool.h> |
Jussi Kukkonen | 649bbce | 2016-07-19 14:16:27 +0300 | [diff] [blame] | 36 | #include <stdint.h> |
Pekka Paalanen | b5eedad | 2014-09-23 22:08:45 -0400 | [diff] [blame] | 37 | #include <time.h> |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 38 | #include <pixman.h> |
Daniel Stone | 855028f | 2012-05-01 20:37:10 +0100 | [diff] [blame] | 39 | #include <xkbcommon/xkbcommon.h> |
Kristian Høgsberg | 3c17933 | 2013-08-06 19:27:04 -0700 | [diff] [blame] | 40 | |
| 41 | #define WL_HIDE_DEPRECATED |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 42 | #include <wayland-server.h> |
| 43 | |
Pekka Paalanen | 96dc449 | 2019-04-04 13:47:40 +0300 | [diff] [blame] | 44 | #include <libweston/matrix.h> |
Pekka Paalanen | ecbdcfd | 2019-04-04 14:46:00 +0300 | [diff] [blame] | 45 | #include <libweston/zalloc.h> |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 46 | #define MESON_VIDEO_PLAN_SUPPORT 1 |
| 47 | #define SURFACE_QUEUE_CAPACITY 10 |
Pekka Paalanen | 2eaa11e | 2012-03-30 15:45:40 +0300 | [diff] [blame] | 48 | |
Quentin Glidic | 248dd10 | 2016-08-12 10:41:34 +0200 | [diff] [blame] | 49 | struct weston_geometry { |
| 50 | int32_t x, y; |
| 51 | int32_t width, height; |
| 52 | }; |
| 53 | |
| 54 | struct weston_position { |
| 55 | int32_t x, y; |
| 56 | }; |
| 57 | |
| 58 | struct weston_size { |
| 59 | int32_t width, height; |
| 60 | }; |
| 61 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 62 | struct weston_transform { |
| 63 | struct weston_matrix matrix; |
Pekka Paalanen | c61eca6 | 2012-01-06 14:10:06 +0200 | [diff] [blame] | 64 | struct wl_list link; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 65 | }; |
| 66 | |
Pekka Paalanen | f406253 | 2018-02-26 16:18:29 +0200 | [diff] [blame] | 67 | /** 2D device coordinates normalized to [0, 1] range */ |
| 68 | struct weston_point2d_device_normalized { |
| 69 | double x; |
| 70 | double y; |
| 71 | }; |
| 72 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 73 | struct weston_surface; |
Jason Ekstrand | 6bd6294 | 2013-06-20 20:38:23 -0500 | [diff] [blame] | 74 | struct weston_buffer; |
Tiago Vignatti | bc052c9 | 2012-04-19 16:18:18 +0300 | [diff] [blame] | 75 | struct shell_surface; |
Daniel Stone | 37816df | 2012-05-16 18:45:18 +0100 | [diff] [blame] | 76 | struct weston_seat; |
Scott Moreau | 062be7e | 2012-04-20 13:37:33 -0600 | [diff] [blame] | 77 | struct weston_output; |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 78 | struct input_method; |
Derek Foreman | e4d6c83 | 2015-08-05 14:48:11 -0500 | [diff] [blame] | 79 | struct weston_pointer; |
Pekka Paalanen | 230f3b1 | 2014-09-29 14:18:40 -0400 | [diff] [blame] | 80 | struct linux_dmabuf_buffer; |
Giulio Camuffo | 26f62d4 | 2016-06-02 21:48:09 +0300 | [diff] [blame] | 81 | struct weston_recorder; |
Jonas Ådahl | d3414f2 | 2016-07-22 17:56:31 +0800 | [diff] [blame] | 82 | struct weston_pointer_constraint; |
Sebastian Wick | abec512 | 2019-11-01 02:38:45 +0100 | [diff] [blame] | 83 | struct ro_anonymous_file; |
Pekka Paalanen | aa6346f | 2021-05-28 14:46:14 +0300 | [diff] [blame] | 84 | struct weston_color_profile; |
Pekka Paalanen | 1d2eee2 | 2021-02-25 12:03:28 +0200 | [diff] [blame] | 85 | struct weston_color_transform; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 86 | |
Daniel Stone | 496ca17 | 2012-05-30 16:31:42 +0100 | [diff] [blame] | 87 | enum weston_keyboard_modifier { |
| 88 | MODIFIER_CTRL = (1 << 0), |
| 89 | MODIFIER_ALT = (1 << 1), |
| 90 | MODIFIER_SUPER = (1 << 2), |
Kristian Høgsberg | 73694c8 | 2012-06-28 14:13:10 -0400 | [diff] [blame] | 91 | MODIFIER_SHIFT = (1 << 3), |
Daniel Stone | 496ca17 | 2012-05-30 16:31:42 +0100 | [diff] [blame] | 92 | }; |
| 93 | |
Giulio Camuffo | 6ef444d | 2014-08-28 19:44:09 +0300 | [diff] [blame] | 94 | enum weston_keyboard_locks { |
| 95 | WESTON_NUM_LOCK = (1 << 0), |
| 96 | WESTON_CAPS_LOCK = (1 << 1), |
| 97 | }; |
| 98 | |
Daniel Stone | 8c8164f | 2012-05-30 16:31:45 +0100 | [diff] [blame] | 99 | enum weston_led { |
| 100 | LED_NUM_LOCK = (1 << 0), |
| 101 | LED_CAPS_LOCK = (1 << 1), |
| 102 | LED_SCROLL_LOCK = (1 << 2), |
| 103 | }; |
| 104 | |
Ankit Nautiyal | a21c393 | 2097-03-19 00:24:57 +0530 | [diff] [blame] | 105 | enum weston_mode_aspect_ratio { |
| 106 | /** The picture aspect ratio values, for the aspect_ratio field of |
| 107 | * weston_mode. The values here, are taken from |
| 108 | * DRM_MODE_PICTURE_ASPECT_* from drm_mode.h. |
| 109 | */ |
| 110 | WESTON_MODE_PIC_AR_NONE = 0, /* DRM_MODE_PICTURE_ASPECT_NONE */ |
| 111 | WESTON_MODE_PIC_AR_4_3 = 1, /* DRM_MODE_PICTURE_ASPECT_4_3 */ |
| 112 | WESTON_MODE_PIC_AR_16_9 = 2, /* DRM_MODE_PICTURE_ASPECT_16_9 */ |
| 113 | WESTON_MODE_PIC_AR_64_27 = 3, /* DRM_MODE_PICTURE_ASPECT_64_27 */ |
| 114 | WESTON_MODE_PIC_AR_256_135 = 4, /* DRM_MODE_PICTURE_ASPECT_256_135*/ |
| 115 | }; |
| 116 | |
Ankit Nautiyal | 5cfe03c | 2019-03-28 15:05:42 +0530 | [diff] [blame] | 117 | enum weston_surface_protection_mode { |
| 118 | WESTON_SURFACE_PROTECTION_MODE_RELAXED, |
| 119 | WESTON_SURFACE_PROTECTION_MODE_ENFORCED |
| 120 | }; |
Ankit Nautiyal | a21c393 | 2097-03-19 00:24:57 +0530 | [diff] [blame] | 121 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 122 | struct weston_mode { |
| 123 | uint32_t flags; |
Ankit Nautiyal | a21c393 | 2097-03-19 00:24:57 +0530 | [diff] [blame] | 124 | enum weston_mode_aspect_ratio aspect_ratio; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 125 | int32_t width, height; |
| 126 | uint32_t refresh; |
| 127 | struct wl_list link; |
| 128 | }; |
| 129 | |
Scott Moreau | e660398 | 2012-06-11 13:07:51 -0600 | [diff] [blame] | 130 | struct weston_animation { |
| 131 | void (*frame)(struct weston_animation *animation, |
Alexandros Frantzis | 8250a61 | 2017-11-16 18:20:52 +0200 | [diff] [blame] | 132 | struct weston_output *output, |
| 133 | const struct timespec *time); |
Scott Moreau | e660398 | 2012-06-11 13:07:51 -0600 | [diff] [blame] | 134 | int frame_counter; |
| 135 | struct wl_list link; |
| 136 | }; |
| 137 | |
Kristian Høgsberg | 7eec9b3 | 2013-06-17 09:15:22 -0400 | [diff] [blame] | 138 | enum { |
| 139 | WESTON_SPRING_OVERSHOOT, |
| 140 | WESTON_SPRING_CLAMP, |
| 141 | WESTON_SPRING_BOUNCE |
| 142 | }; |
| 143 | |
Scott Moreau | e660398 | 2012-06-11 13:07:51 -0600 | [diff] [blame] | 144 | struct weston_spring { |
| 145 | double k; |
| 146 | double friction; |
| 147 | double current; |
| 148 | double target; |
| 149 | double previous; |
Kristian Høgsberg | 091b096 | 2013-06-17 09:23:14 -0400 | [diff] [blame] | 150 | double min, max; |
Alexandros Frantzis | 8250a61 | 2017-11-16 18:20:52 +0200 | [diff] [blame] | 151 | struct timespec timestamp; |
Kristian Høgsberg | 7eec9b3 | 2013-06-17 09:15:22 -0400 | [diff] [blame] | 152 | uint32_t clip; |
Scott Moreau | e660398 | 2012-06-11 13:07:51 -0600 | [diff] [blame] | 153 | }; |
| 154 | |
Scott Moreau | ccbf29d | 2012-02-22 14:21:41 -0700 | [diff] [blame] | 155 | struct weston_output_zoom { |
Derek Foreman | a36eb50 | 2015-07-23 14:55:12 -0500 | [diff] [blame] | 156 | bool active; |
Scott Moreau | ccbf29d | 2012-02-22 14:21:41 -0700 | [diff] [blame] | 157 | float increment; |
| 158 | float level; |
Scott Moreau | e660398 | 2012-06-11 13:07:51 -0600 | [diff] [blame] | 159 | float max_level; |
Scott Moreau | ccbf29d | 2012-02-22 14:21:41 -0700 | [diff] [blame] | 160 | float trans_x, trans_y; |
Giulio Camuffo | 6850e7b | 2015-10-07 20:14:18 +0300 | [diff] [blame] | 161 | struct { |
| 162 | double x, y; |
| 163 | } current; |
Derek Foreman | 22276a5 | 2015-07-23 14:55:15 -0500 | [diff] [blame] | 164 | struct weston_seat *seat; |
Scott Moreau | e660398 | 2012-06-11 13:07:51 -0600 | [diff] [blame] | 165 | struct weston_animation animation_z; |
| 166 | struct weston_spring spring_z; |
Giulio Camuffo | 412b024 | 2013-11-14 23:42:51 +0100 | [diff] [blame] | 167 | struct wl_listener motion_listener; |
Scott Moreau | ccbf29d | 2012-02-22 14:21:41 -0700 | [diff] [blame] | 168 | }; |
| 169 | |
Tiago Vignatti | 8e53c7f | 2012-02-29 19:53:50 +0200 | [diff] [blame] | 170 | /* bit compatible with drm definitions. */ |
| 171 | enum dpms_enum { |
| 172 | WESTON_DPMS_ON, |
| 173 | WESTON_DPMS_STANDBY, |
| 174 | WESTON_DPMS_SUSPEND, |
| 175 | WESTON_DPMS_OFF |
| 176 | }; |
| 177 | |
Ankit Nautiyal | 2690a77 | 2019-03-25 17:57:59 +0530 | [diff] [blame] | 178 | /* enum for content protection requests/status |
| 179 | * |
| 180 | * This enum represents the content protection requests and statuses in |
| 181 | * libweston and its enum values correspond to those of 'type' enum defined in |
| 182 | * weston-content-protection protocol. The values should exactly match to the |
| 183 | * values of the 'type' enum of the protocol. |
| 184 | */ |
| 185 | |
| 186 | enum weston_hdcp_protection { |
| 187 | WESTON_HDCP_DISABLE = 0, |
| 188 | WESTON_HDCP_ENABLE_TYPE_0, |
| 189 | WESTON_HDCP_ENABLE_TYPE_1 |
| 190 | }; |
| 191 | |
Leandro Ribeiro | 32a5acd | 2020-10-19 16:06:22 -0300 | [diff] [blame] | 192 | /** Weston test suite quirks |
| 193 | * |
| 194 | * There are some things that need a specific behavior when we run Weston in the |
| 195 | * test suite. Tests can use this struct to select for certain behaviors. |
| 196 | * |
| 197 | * \sa compositor_setup |
| 198 | * \ingroup testharness |
| 199 | */ |
| 200 | struct weston_testsuite_quirks { |
Pekka Paalanen | fbd4160 | 2020-12-04 15:20:11 +0200 | [diff] [blame] | 201 | /** Force GL-renderer to do a full upload of wl_shm buffers. */ |
| 202 | bool gl_force_full_upload; |
Pekka Paalanen | b1e5614 | 2020-12-08 14:13:56 +0200 | [diff] [blame] | 203 | /** Ensure GL shadow fb is used, and always repaint it fully. */ |
| 204 | bool gl_force_full_redraw_of_shadow_fb; |
Pekka Paalanen | 19d31dd | 2021-03-01 11:24:59 +0200 | [diff] [blame] | 205 | /** Required enum weston_capability bit mask, otherwise skip run. */ |
| 206 | uint32_t required_capabilities; |
Leandro Ribeiro | 32a5acd | 2020-10-19 16:06:22 -0300 | [diff] [blame] | 207 | }; |
| 208 | |
| 209 | /** Weston test suite data that is given to compositor |
| 210 | * |
Leandro Ribeiro | cdb7218 | 2020-11-06 11:24:22 -0300 | [diff] [blame] | 211 | * It contains two members: |
| 212 | * |
| 213 | * 1. The struct weston_testsuite_quirks, which can be used by the tests to |
| 214 | * change certain behavior of Weston when running these tests. |
| 215 | * 2. The void *test_private_data member which can be used by the testsuite of |
| 216 | * projects that uses libweston in order to give arbitrary test data to the |
| 217 | * compositor. Its type should be defined by the testsuite of the project. |
| 218 | * |
Leandro Ribeiro | 32a5acd | 2020-10-19 16:06:22 -0300 | [diff] [blame] | 219 | * \sa compositor_setup |
| 220 | * \ingroup testharness |
| 221 | */ |
| 222 | struct weston_testsuite_data { |
| 223 | struct weston_testsuite_quirks test_quirks; |
Leandro Ribeiro | 2d4dd70 | 2020-10-19 16:24:44 -0300 | [diff] [blame] | 224 | void *test_private_data; |
Leandro Ribeiro | 32a5acd | 2020-10-19 16:06:22 -0300 | [diff] [blame] | 225 | }; |
| 226 | |
Pekka Paalanen | 9dccfd1 | 2020-01-16 17:44:51 +0200 | [diff] [blame] | 227 | /** Represents a head, usually a display connector |
Pekka Paalanen | 01f6021 | 2017-03-24 15:39:24 +0200 | [diff] [blame] | 228 | * |
Pekka Paalanen | 9dccfd1 | 2020-01-16 17:44:51 +0200 | [diff] [blame] | 229 | * \rst |
| 230 | See :ref:`libweston-head`. \endrst |
Marius Vlad | 78984ee | 2019-06-11 00:05:08 +0300 | [diff] [blame] | 231 | * |
| 232 | * \ingroup head |
Pekka Paalanen | 01f6021 | 2017-03-24 15:39:24 +0200 | [diff] [blame] | 233 | */ |
| 234 | struct weston_head { |
Pekka Paalanen | 1adcbac | 2017-08-14 16:05:35 +0300 | [diff] [blame] | 235 | struct weston_compositor *compositor; /**< owning compositor */ |
| 236 | struct wl_list compositor_link; /**< in weston_compositor::head_list */ |
Pekka Paalanen | 2e1bedb | 2017-10-10 11:21:58 +0300 | [diff] [blame] | 237 | struct wl_signal destroy_signal; /**< destroy callbacks */ |
Pekka Paalanen | 1adcbac | 2017-08-14 16:05:35 +0300 | [diff] [blame] | 238 | |
Pekka Paalanen | 0534762 | 2017-03-27 12:24:34 +0300 | [diff] [blame] | 239 | struct weston_output *output; /**< the output driving this head */ |
Pekka Paalanen | 7cdbabe | 2017-03-28 16:27:25 +0300 | [diff] [blame] | 240 | struct wl_list output_link; /**< in weston_output::head_list */ |
Pekka Paalanen | 0534762 | 2017-03-27 12:24:34 +0300 | [diff] [blame] | 241 | |
Pekka Paalanen | 1b9bf59 | 2017-03-27 12:15:38 +0300 | [diff] [blame] | 242 | struct wl_list resource_list; /**< wl_output protocol objects */ |
| 243 | struct wl_global *global; /**< wl_output global */ |
| 244 | |
Roman Gilg | e97391c | 2019-03-29 13:01:06 +0100 | [diff] [blame] | 245 | struct wl_list xdg_output_resource_list; /**< xdg_output protocol objects */ |
| 246 | |
Pekka Paalanen | 01f6021 | 2017-03-24 15:39:24 +0200 | [diff] [blame] | 247 | int32_t mm_width; /**< physical image width in mm */ |
| 248 | int32_t mm_height; /**< physical image height in mm */ |
Lucas Stach | a69cb71 | 2019-11-25 23:29:31 +0000 | [diff] [blame] | 249 | |
| 250 | /** WL_OUTPUT_TRANSFORM enum to apply to match native orientation */ |
| 251 | uint32_t transform; |
| 252 | |
Pekka Paalanen | 01f6021 | 2017-03-24 15:39:24 +0200 | [diff] [blame] | 253 | char *make; /**< monitor manufacturer (PNP ID) */ |
| 254 | char *model; /**< monitor model */ |
| 255 | char *serial_number; /**< monitor serial */ |
| 256 | uint32_t subpixel; /**< enum wl_output_subpixel */ |
| 257 | bool connection_internal; /**< embedded monitor (e.g. laptop) */ |
Pekka Paalanen | e19970f | 2017-08-28 14:11:02 +0300 | [diff] [blame] | 258 | bool device_changed; /**< monitor information has changed */ |
Pekka Paalanen | 9b02e47 | 2017-08-14 14:43:13 +0300 | [diff] [blame] | 259 | |
| 260 | char *name; /**< head name, e.g. connector name */ |
Pekka Paalanen | 7fe858b | 2017-08-14 15:45:14 +0300 | [diff] [blame] | 261 | bool connected; /**< is physically connected */ |
Philipp Zabel | c18ffd3 | 2018-08-30 17:38:03 +0200 | [diff] [blame] | 262 | bool non_desktop; /**< non-desktop display, e.g. HMD */ |
Ankit Nautiyal | 4f64ff8 | 2019-04-03 18:44:35 +0530 | [diff] [blame] | 263 | |
| 264 | /** Current content protection status */ |
| 265 | enum weston_hdcp_protection current_protection; |
Pekka Paalanen | 01f6021 | 2017-03-24 15:39:24 +0200 | [diff] [blame] | 266 | }; |
| 267 | |
Pekka Paalanen | 9dccfd1 | 2020-01-16 17:44:51 +0200 | [diff] [blame] | 268 | /** Content producer for heads |
| 269 | * |
| 270 | * \rst |
| 271 | See :ref:`libweston-output`. \endrst |
Marius Vlad | 55d8736 | 2019-06-11 01:15:35 +0300 | [diff] [blame] | 272 | * |
| 273 | * \ingroup output |
| 274 | */ |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 275 | struct weston_output { |
Casey Dahlin | 58ba137 | 2012-04-19 22:50:08 -0400 | [diff] [blame] | 276 | uint32_t id; |
Richard Hughes | afe690c | 2013-05-02 10:10:04 +0100 | [diff] [blame] | 277 | char *name; |
Casey Dahlin | 58ba137 | 2012-04-19 22:50:08 -0400 | [diff] [blame] | 278 | |
Pekka Paalanen | 37b7c6e | 2017-11-07 10:15:01 +0200 | [diff] [blame] | 279 | /** Matches the lifetime from the user perspective */ |
| 280 | struct wl_signal user_destroy_signal; |
| 281 | |
John Kåre Alsaker | 9465927 | 2012-11-13 19:10:18 +0100 | [diff] [blame] | 282 | void *renderer_state; |
| 283 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 284 | struct wl_list link; |
| 285 | struct weston_compositor *compositor; |
Jason Ekstrand | fb23df7 | 2014-10-16 10:55:21 -0500 | [diff] [blame] | 286 | |
Pekka Paalanen | 1a4f87d | 2021-04-30 14:48:52 +0300 | [diff] [blame] | 287 | /* struct weston_paint_node::output_link */ |
| 288 | struct wl_list paint_node_list; |
| 289 | |
Jason Ekstrand | fb23df7 | 2014-10-16 10:55:21 -0500 | [diff] [blame] | 290 | /** From global to output buffer coordinates. */ |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 291 | struct weston_matrix matrix; |
Derek Foreman | c002321 | 2015-03-24 11:36:13 -0500 | [diff] [blame] | 292 | /** From output buffer to global coordinates. */ |
| 293 | struct weston_matrix inverse_matrix; |
Jason Ekstrand | fb23df7 | 2014-10-16 10:55:21 -0500 | [diff] [blame] | 294 | |
Scott Moreau | 9d1b112 | 2012-06-08 19:40:53 -0600 | [diff] [blame] | 295 | struct wl_list animation_list; |
Scott Moreau | 1bad5db | 2012-08-18 01:04:05 -0600 | [diff] [blame] | 296 | int32_t x, y, width, height; |
Pekka Paalanen | efd08c7 | 2015-02-23 13:54:49 +0200 | [diff] [blame] | 297 | |
Pekka Paalanen | 2fddc53 | 2021-04-30 17:41:29 +0300 | [diff] [blame] | 298 | /** List of paint nodes in z-order, from top to bottom, maybe pruned |
| 299 | * |
| 300 | * struct weston_paint_node::z_order_link |
| 301 | */ |
| 302 | struct wl_list paint_node_z_order_list; |
| 303 | |
Pekka Paalanen | efd08c7 | 2015-02-23 13:54:49 +0200 | [diff] [blame] | 304 | /** Output area in global coordinates, simple rect */ |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 305 | pixman_region32_t region; |
Pekka Paalanen | efd08c7 | 2015-02-23 13:54:49 +0200 | [diff] [blame] | 306 | |
Daniel Stone | 09a97e2 | 2017-03-01 11:34:06 +0000 | [diff] [blame] | 307 | /** True if damage has occurred since the last repaint for this output; |
| 308 | * if set, a repaint will eventually occur. */ |
| 309 | bool repaint_needed; |
Daniel Stone | 05df8c1 | 2017-03-03 16:59:42 +0000 | [diff] [blame] | 310 | |
Tomohito Esaki | 7f4d9ff | 2018-06-05 10:37:06 +0900 | [diff] [blame] | 311 | /** Used only between repaint_begin and repaint_cancel. */ |
| 312 | bool repainted; |
| 313 | |
Daniel Stone | 05df8c1 | 2017-03-03 16:59:42 +0000 | [diff] [blame] | 314 | /** State of the repaint loop */ |
| 315 | enum { |
| 316 | REPAINT_NOT_SCHEDULED = 0, /**< idle; no repaint will occur */ |
| 317 | REPAINT_BEGIN_FROM_IDLE, /**< start_repaint_loop scheduled */ |
| 318 | REPAINT_SCHEDULED, /**< repaint is scheduled to occur */ |
| 319 | REPAINT_AWAITING_COMPLETION, /**< last repaint not yet finished */ |
| 320 | } repaint_status; |
| 321 | |
Daniel Stone | 6847b85 | 2017-03-01 11:34:08 +0000 | [diff] [blame] | 322 | /** If repaint_status is REPAINT_SCHEDULED, contains the time the |
| 323 | * next repaint should be run */ |
| 324 | struct timespec next_repaint; |
| 325 | |
Pekka Paalanen | dcbcfc7 | 2017-10-26 14:33:59 +0300 | [diff] [blame] | 326 | /** For cancelling the idle_repaint callback on output destruction. */ |
| 327 | struct wl_event_source *idle_repaint_source; |
| 328 | |
Scott Moreau | ccbf29d | 2012-02-22 14:21:41 -0700 | [diff] [blame] | 329 | struct weston_output_zoom zoom; |
| 330 | int dirty; |
Kristian Høgsberg | 5fb70bf | 2012-05-24 12:29:46 -0400 | [diff] [blame] | 331 | struct wl_signal frame_signal; |
Pekka Paalanen | 37b7c6e | 2017-11-07 10:15:01 +0200 | [diff] [blame] | 332 | struct wl_signal destroy_signal; /**< sent when disabled */ |
Zhang, Xiong Y | f301241 | 2013-12-13 22:10:53 +0200 | [diff] [blame] | 333 | int move_x, move_y; |
Alexandros Frantzis | e6ac2af | 2017-11-16 18:20:53 +0200 | [diff] [blame] | 334 | struct timespec frame_time; /* presentation timestamp */ |
Pekka Paalanen | 641307c | 2014-09-23 22:08:47 -0400 | [diff] [blame] | 335 | uint64_t msc; /* media stream counter */ |
Kristian Høgsberg | 79af73e | 2012-08-03 15:45:23 -0400 | [diff] [blame] | 336 | int disable_planes; |
Ander Conselvan de Oliveira | e1e2352 | 2013-12-13 22:10:55 +0200 | [diff] [blame] | 337 | int destroying; |
Pekka Paalanen | 133e439 | 2014-09-23 22:08:46 -0400 | [diff] [blame] | 338 | struct wl_list feedback_list; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 339 | |
Kristian Høgsberg | 05890dc | 2012-08-10 10:09:20 -0400 | [diff] [blame] | 340 | uint32_t transform; |
Hardening | 57388e4 | 2013-09-18 23:56:36 +0200 | [diff] [blame] | 341 | int32_t native_scale; |
Hardening | ff39efa | 2013-09-18 23:56:35 +0200 | [diff] [blame] | 342 | int32_t current_scale; |
Hardening | 57388e4 | 2013-09-18 23:56:36 +0200 | [diff] [blame] | 343 | int32_t original_scale; |
Alexander Larsson | 4ea9552 | 2013-05-22 14:41:37 +0200 | [diff] [blame] | 344 | |
Hardening | 57388e4 | 2013-09-18 23:56:36 +0200 | [diff] [blame] | 345 | struct weston_mode *native_mode; |
Hardening | ff39efa | 2013-09-18 23:56:35 +0200 | [diff] [blame] | 346 | struct weston_mode *current_mode; |
| 347 | struct weston_mode *original_mode; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 348 | struct wl_list mode_list; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 349 | |
Pekka Paalanen | 7cdbabe | 2017-03-28 16:27:25 +0300 | [diff] [blame] | 350 | struct wl_list head_list; /**< List of driven weston_heads */ |
Pekka Paalanen | 01f6021 | 2017-03-24 15:39:24 +0200 | [diff] [blame] | 351 | |
Ankit Nautiyal | 2690a77 | 2019-03-25 17:57:59 +0530 | [diff] [blame] | 352 | enum weston_hdcp_protection desired_protection; |
Ankit Nautiyal | 4f64ff8 | 2019-04-03 18:44:35 +0530 | [diff] [blame] | 353 | enum weston_hdcp_protection current_protection; |
Ankit Nautiyal | 2844f8e | 2019-04-03 10:14:59 +0530 | [diff] [blame] | 354 | bool allow_protection; |
Ankit Nautiyal | 2690a77 | 2019-03-25 17:57:59 +0530 | [diff] [blame] | 355 | |
Antonio Borneo | c90fccc | 2019-06-30 15:51:10 +0200 | [diff] [blame] | 356 | int (*start_repaint_loop)(struct weston_output *output); |
David Herrmann | 1edf44c | 2013-10-22 17:11:26 +0200 | [diff] [blame] | 357 | int (*repaint)(struct weston_output *output, |
Daniel Stone | b1f166d | 2017-03-01 11:34:10 +0000 | [diff] [blame] | 358 | pixman_region32_t *damage, |
| 359 | void *repaint_data); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 360 | void (*destroy)(struct weston_output *output); |
Daniel Stone | b1f166d | 2017-03-01 11:34:10 +0000 | [diff] [blame] | 361 | void (*assign_planes)(struct weston_output *output, void *repaint_data); |
Alex Wu | 2dda604 | 2012-04-17 17:20:47 +0800 | [diff] [blame] | 362 | int (*switch_mode)(struct weston_output *output, struct weston_mode *mode); |
Tiago Vignatti | 8e53c7f | 2012-02-29 19:53:50 +0200 | [diff] [blame] | 363 | |
Tiago Vignatti | 5ab91ad | 2012-03-12 19:40:09 -0300 | [diff] [blame] | 364 | /* backlight values are on 0-255 range, where higher is brighter */ |
Kristian Høgsberg | 7c60912 | 2013-05-23 20:30:26 -0400 | [diff] [blame] | 365 | int32_t backlight_current; |
Tiago Vignatti | 8e53c7f | 2012-02-29 19:53:50 +0200 | [diff] [blame] | 366 | void (*set_backlight)(struct weston_output *output, uint32_t value); |
| 367 | void (*set_dpms)(struct weston_output *output, enum dpms_enum level); |
Richard Hughes | e729996 | 2013-05-01 21:52:12 +0100 | [diff] [blame] | 368 | |
| 369 | uint16_t gamma_size; |
| 370 | void (*set_gamma)(struct weston_output *output, |
| 371 | uint16_t size, |
| 372 | uint16_t *r, |
| 373 | uint16_t *g, |
| 374 | uint16_t *b); |
Pekka Paalanen | b502654 | 2014-11-12 15:09:24 +0200 | [diff] [blame] | 375 | |
Pekka Paalanen | 7f340ff | 2017-03-30 14:56:22 +0300 | [diff] [blame] | 376 | bool enabled; /**< is in the output_list, not pending list */ |
Armin Krezović | a01ab6d | 2016-09-30 14:11:02 +0200 | [diff] [blame] | 377 | int scale; |
| 378 | |
Pekka Paalanen | 9a9e6ce | 2021-06-08 14:17:44 +0300 | [diff] [blame] | 379 | struct weston_color_profile *color_profile; |
Pekka Paalanen | cda3951 | 2021-03-22 17:32:07 +0200 | [diff] [blame] | 380 | struct weston_color_transform *from_sRGB_to_output; |
Pekka Paalanen | 8fb23ed | 2021-03-23 13:40:43 +0200 | [diff] [blame] | 381 | struct weston_color_transform *from_sRGB_to_blend; |
Pekka Paalanen | 1d2eee2 | 2021-02-25 12:03:28 +0200 | [diff] [blame] | 382 | struct weston_color_transform *from_blend_to_output; |
| 383 | bool from_blend_to_output_by_backend; |
Pekka Paalanen | b5265af | 2020-12-02 11:57:58 +0200 | [diff] [blame] | 384 | |
Armin Krezović | a01ab6d | 2016-09-30 14:11:02 +0200 | [diff] [blame] | 385 | int (*enable)(struct weston_output *output); |
| 386 | int (*disable)(struct weston_output *output); |
Pekka Paalanen | 992a8cb | 2017-08-16 10:39:17 +0300 | [diff] [blame] | 387 | |
| 388 | /** Attach a head in the backend |
| 389 | * |
| 390 | * @param output The output to attach to. |
| 391 | * @param head The head to attach. |
| 392 | * @return 0 on success, -1 on failure. |
| 393 | * |
| 394 | * Do anything necessary to account for a new head being attached to |
| 395 | * the output, and check any conditions possible. On failure, both |
| 396 | * the head and the output must be left as before the call. |
| 397 | * |
| 398 | * Libweston core will add the head to the head_list after a successful |
| 399 | * call. |
| 400 | */ |
| 401 | int (*attach_head)(struct weston_output *output, |
| 402 | struct weston_head *head); |
| 403 | |
| 404 | /** Detach a head in the backend |
| 405 | * |
| 406 | * @param output The output to detach from. |
| 407 | * @param head The head to detach. |
| 408 | * |
| 409 | * Do any clean-up necessary to detach this head from the output. |
| 410 | * The head has already been removed from the output's head_list. |
| 411 | */ |
| 412 | void (*detach_head)(struct weston_output *output, |
| 413 | struct weston_head *head); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 414 | }; |
| 415 | |
Jonas Ådahl | d251010 | 2014-10-05 21:39:14 +0200 | [diff] [blame] | 416 | enum weston_pointer_motion_mask { |
| 417 | WESTON_POINTER_MOTION_ABS = 1 << 0, |
| 418 | WESTON_POINTER_MOTION_REL = 1 << 1, |
Jonas Ådahl | 3845b32 | 2014-10-21 23:51:29 +0200 | [diff] [blame] | 419 | WESTON_POINTER_MOTION_REL_UNACCEL = 1 << 2, |
Jonas Ådahl | d251010 | 2014-10-05 21:39:14 +0200 | [diff] [blame] | 420 | }; |
| 421 | |
| 422 | struct weston_pointer_motion_event { |
| 423 | uint32_t mask; |
Alexandros Frantzis | 84b31f8 | 2017-11-24 18:01:46 +0200 | [diff] [blame] | 424 | struct timespec time; |
Jonas Ådahl | d251010 | 2014-10-05 21:39:14 +0200 | [diff] [blame] | 425 | double x; |
| 426 | double y; |
| 427 | double dx; |
| 428 | double dy; |
Jonas Ådahl | 3845b32 | 2014-10-21 23:51:29 +0200 | [diff] [blame] | 429 | double dx_unaccel; |
| 430 | double dy_unaccel; |
Jonas Ådahl | d251010 | 2014-10-05 21:39:14 +0200 | [diff] [blame] | 431 | }; |
| 432 | |
Peter Hutterer | 89b6a49 | 2016-01-18 15:58:17 +1000 | [diff] [blame] | 433 | struct weston_pointer_axis_event { |
| 434 | uint32_t axis; |
Giulio Camuffo | 90a6fc6 | 2016-03-22 17:44:54 +0200 | [diff] [blame] | 435 | double value; |
Peter Hutterer | 87743e9 | 2016-01-18 16:38:22 +1000 | [diff] [blame] | 436 | bool has_discrete; |
| 437 | int32_t discrete; |
Peter Hutterer | 89b6a49 | 2016-01-18 15:58:17 +1000 | [diff] [blame] | 438 | }; |
| 439 | |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 440 | struct weston_pointer_grab; |
| 441 | struct weston_pointer_grab_interface { |
Kristian Høgsberg | 6848c25 | 2013-05-08 22:02:59 -0400 | [diff] [blame] | 442 | void (*focus)(struct weston_pointer_grab *grab); |
Alexandros Frantzis | 84b31f8 | 2017-11-24 18:01:46 +0200 | [diff] [blame] | 443 | void (*motion)(struct weston_pointer_grab *grab, |
| 444 | const struct timespec *time, |
Jonas Ådahl | d251010 | 2014-10-05 21:39:14 +0200 | [diff] [blame] | 445 | struct weston_pointer_motion_event *event); |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 446 | void (*button)(struct weston_pointer_grab *grab, |
Alexandros Frantzis | 215bedc | 2017-11-16 18:20:55 +0200 | [diff] [blame] | 447 | const struct timespec *time, |
| 448 | uint32_t button, uint32_t state); |
Jonas Ådahl | 0336ca0 | 2014-10-04 16:28:29 +0200 | [diff] [blame] | 449 | void (*axis)(struct weston_pointer_grab *grab, |
Alexandros Frantzis | 8032194 | 2017-11-16 18:20:56 +0200 | [diff] [blame] | 450 | const struct timespec *time, |
Peter Hutterer | 89b6a49 | 2016-01-18 15:58:17 +1000 | [diff] [blame] | 451 | struct weston_pointer_axis_event *event); |
Peter Hutterer | 87743e9 | 2016-01-18 16:38:22 +1000 | [diff] [blame] | 452 | void (*axis_source)(struct weston_pointer_grab *grab, uint32_t source); |
| 453 | void (*frame)(struct weston_pointer_grab *grab); |
Jonas Ådahl | 1ea343e | 2013-10-25 23:18:05 +0200 | [diff] [blame] | 454 | void (*cancel)(struct weston_pointer_grab *grab); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 455 | }; |
| 456 | |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 457 | struct weston_pointer_grab { |
| 458 | const struct weston_pointer_grab_interface *interface; |
| 459 | struct weston_pointer *pointer; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 460 | }; |
| 461 | |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 462 | struct weston_keyboard_grab; |
| 463 | struct weston_keyboard_grab_interface { |
Alexandros Frantzis | 47e79c8 | 2017-11-16 18:20:57 +0200 | [diff] [blame] | 464 | void (*key)(struct weston_keyboard_grab *grab, |
| 465 | const struct timespec *time, uint32_t key, uint32_t state); |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 466 | void (*modifiers)(struct weston_keyboard_grab *grab, uint32_t serial, |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 467 | uint32_t mods_depressed, uint32_t mods_latched, |
| 468 | uint32_t mods_locked, uint32_t group); |
Jonas Ådahl | 1ea343e | 2013-10-25 23:18:05 +0200 | [diff] [blame] | 469 | void (*cancel)(struct weston_keyboard_grab *grab); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 470 | }; |
| 471 | |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 472 | struct weston_keyboard_grab { |
| 473 | const struct weston_keyboard_grab_interface *interface; |
| 474 | struct weston_keyboard *keyboard; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 475 | }; |
| 476 | |
Kristian Høgsberg | e329f36 | 2013-05-06 22:19:57 -0400 | [diff] [blame] | 477 | struct weston_touch_grab; |
| 478 | struct weston_touch_grab_interface { |
| 479 | void (*down)(struct weston_touch_grab *grab, |
Alexandros Frantzis | 9448deb | 2017-11-16 18:20:58 +0200 | [diff] [blame] | 480 | const struct timespec *time, |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 481 | int touch_id, |
| 482 | wl_fixed_t sx, |
| 483 | wl_fixed_t sy); |
Kristian Høgsberg | e329f36 | 2013-05-06 22:19:57 -0400 | [diff] [blame] | 484 | void (*up)(struct weston_touch_grab *grab, |
Alexandros Frantzis | 27a51b8 | 2017-11-16 18:20:59 +0200 | [diff] [blame] | 485 | const struct timespec *time, |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 486 | int touch_id); |
Kristian Høgsberg | e329f36 | 2013-05-06 22:19:57 -0400 | [diff] [blame] | 487 | void (*motion)(struct weston_touch_grab *grab, |
Alexandros Frantzis | 7d2abcf | 2017-11-16 18:21:00 +0200 | [diff] [blame] | 488 | const struct timespec *time, |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 489 | int touch_id, |
| 490 | wl_fixed_t sx, |
| 491 | wl_fixed_t sy); |
Jonas Ådahl | 1679f23 | 2014-04-12 09:39:51 +0200 | [diff] [blame] | 492 | void (*frame)(struct weston_touch_grab *grab); |
Jonas Ådahl | 1ea343e | 2013-10-25 23:18:05 +0200 | [diff] [blame] | 493 | void (*cancel)(struct weston_touch_grab *grab); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 494 | }; |
| 495 | |
Kristian Høgsberg | e329f36 | 2013-05-06 22:19:57 -0400 | [diff] [blame] | 496 | struct weston_touch_grab { |
| 497 | const struct weston_touch_grab_interface *interface; |
| 498 | struct weston_touch *touch; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 499 | }; |
| 500 | |
Kristian Høgsberg | 5e76a49 | 2013-07-25 16:09:37 -0700 | [diff] [blame] | 501 | struct weston_data_offer { |
Jason Ekstrand | 8a4a9eb | 2013-06-14 10:07:55 -0500 | [diff] [blame] | 502 | struct wl_resource *resource; |
Kristian Høgsberg | 7ff3bdb | 2013-07-25 15:52:14 -0700 | [diff] [blame] | 503 | struct weston_data_source *source; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 504 | struct wl_listener source_destroy_listener; |
Carlos Garnacho | 9c93179 | 2016-01-18 23:52:12 +0100 | [diff] [blame] | 505 | uint32_t dnd_actions; |
| 506 | enum wl_data_device_manager_dnd_action preferred_dnd_action; |
| 507 | bool in_ask; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 508 | }; |
| 509 | |
Kristian Høgsberg | 7ff3bdb | 2013-07-25 15:52:14 -0700 | [diff] [blame] | 510 | struct weston_data_source { |
Jason Ekstrand | 8a4a9eb | 2013-06-14 10:07:55 -0500 | [diff] [blame] | 511 | struct wl_resource *resource; |
| 512 | struct wl_signal destroy_signal; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 513 | struct wl_array mime_types; |
Carlos Garnacho | 78d4bf9 | 2016-01-15 21:14:23 +0100 | [diff] [blame] | 514 | struct weston_data_offer *offer; |
| 515 | struct weston_seat *seat; |
| 516 | bool accepted; |
Carlos Garnacho | 9c93179 | 2016-01-18 23:52:12 +0100 | [diff] [blame] | 517 | bool actions_set; |
Harish Krupo | 737ac0d | 2019-04-19 22:06:37 +0530 | [diff] [blame] | 518 | bool set_selection; |
Carlos Garnacho | 9c93179 | 2016-01-18 23:52:12 +0100 | [diff] [blame] | 519 | uint32_t dnd_actions; |
| 520 | enum wl_data_device_manager_dnd_action current_dnd_action; |
Carlos Garnacho | b288988 | 2016-01-15 21:14:26 +0100 | [diff] [blame] | 521 | enum wl_data_device_manager_dnd_action compositor_action; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 522 | |
Kristian Høgsberg | 7ff3bdb | 2013-07-25 15:52:14 -0700 | [diff] [blame] | 523 | void (*accept)(struct weston_data_source *source, |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 524 | uint32_t serial, const char *mime_type); |
Kristian Høgsberg | 7ff3bdb | 2013-07-25 15:52:14 -0700 | [diff] [blame] | 525 | void (*send)(struct weston_data_source *source, |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 526 | const char *mime_type, int32_t fd); |
Kristian Høgsberg | 7ff3bdb | 2013-07-25 15:52:14 -0700 | [diff] [blame] | 527 | void (*cancel)(struct weston_data_source *source); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 528 | }; |
| 529 | |
Jonas Ådahl | 2cbf293 | 2015-07-22 12:05:38 +0800 | [diff] [blame] | 530 | struct weston_pointer_client { |
| 531 | struct wl_list link; |
| 532 | struct wl_client *client; |
| 533 | struct wl_list pointer_resources; |
Jonas Ådahl | 30d61d8 | 2014-10-22 21:21:17 +0200 | [diff] [blame] | 534 | struct wl_list relative_pointer_resources; |
Jonas Ådahl | 2cbf293 | 2015-07-22 12:05:38 +0800 | [diff] [blame] | 535 | }; |
| 536 | |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 537 | struct weston_pointer { |
Kristian Høgsberg | e314875 | 2013-05-06 23:19:49 -0400 | [diff] [blame] | 538 | struct weston_seat *seat; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 539 | |
Jonas Ådahl | 2cbf293 | 2015-07-22 12:05:38 +0800 | [diff] [blame] | 540 | struct wl_list pointer_clients; |
| 541 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 542 | struct weston_view *focus; |
Jonas Ådahl | 2cbf293 | 2015-07-22 12:05:38 +0800 | [diff] [blame] | 543 | struct weston_pointer_client *focus_client; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 544 | uint32_t focus_serial; |
Giulio Camuffo | 576fe2a | 2013-11-20 18:00:24 +0100 | [diff] [blame] | 545 | struct wl_listener focus_view_listener; |
| 546 | struct wl_listener focus_resource_listener; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 547 | struct wl_signal focus_signal; |
Giulio Camuffo | 6fcb378 | 2013-11-14 23:42:50 +0100 | [diff] [blame] | 548 | struct wl_signal motion_signal; |
Jonas Ådahl | 3eb4ddd | 2016-07-22 17:52:58 +0800 | [diff] [blame] | 549 | struct wl_signal destroy_signal; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 550 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 551 | struct weston_view *sprite; |
Kristian Høgsberg | 195b869 | 2013-05-08 15:02:05 -0400 | [diff] [blame] | 552 | struct wl_listener sprite_destroy_listener; |
| 553 | int32_t hotspot_x, hotspot_y; |
| 554 | |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 555 | struct weston_pointer_grab *grab; |
| 556 | struct weston_pointer_grab default_grab; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 557 | wl_fixed_t grab_x, grab_y; |
| 558 | uint32_t grab_button; |
| 559 | uint32_t grab_serial; |
Alexandros Frantzis | 215bedc | 2017-11-16 18:20:55 +0200 | [diff] [blame] | 560 | struct timespec grab_time; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 561 | |
| 562 | wl_fixed_t x, y; |
Kristian Høgsberg | db1fccb | 2014-02-05 17:14:42 -0800 | [diff] [blame] | 563 | wl_fixed_t sx, sy; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 564 | uint32_t button_count; |
Ander Conselvan de Oliveira | f84327a | 2014-01-29 18:47:51 +0200 | [diff] [blame] | 565 | |
| 566 | struct wl_listener output_destroy_listener; |
Alexandros Frantzis | db907b7 | 2018-02-20 14:06:26 +0200 | [diff] [blame] | 567 | |
| 568 | struct wl_list timestamps_list; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 569 | }; |
| 570 | |
Louis-Francis Ratté-Boulianne | 6ef59c9 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 571 | /** libinput style calibration matrix |
| 572 | * |
| 573 | * See https://wayland.freedesktop.org/libinput/doc/latest/absolute_axes.html |
| 574 | * and libinput_device_config_calibration_set_matrix(). |
| 575 | */ |
| 576 | struct weston_touch_device_matrix { |
| 577 | float m[6]; |
| 578 | }; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 579 | |
Louis-Francis Ratté-Boulianne | 6ef59c9 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 580 | struct weston_touch_device; |
| 581 | |
| 582 | /** Operations for a calibratable touchscreen */ |
| 583 | struct weston_touch_device_ops { |
| 584 | /** Get the associated output if existing. */ |
| 585 | struct weston_output *(*get_output)(struct weston_touch_device *device); |
| 586 | |
| 587 | /** Get the name of the associated head if existing. */ |
| 588 | const char * |
| 589 | (*get_calibration_head_name)(struct weston_touch_device *device); |
| 590 | |
| 591 | /** Retrieve the current calibration matrix. */ |
| 592 | void (*get_calibration)(struct weston_touch_device *device, |
| 593 | struct weston_touch_device_matrix *cal); |
| 594 | |
| 595 | /** Set a new calibration matrix. */ |
| 596 | void (*set_calibration)(struct weston_touch_device *device, |
| 597 | const struct weston_touch_device_matrix *cal); |
| 598 | }; |
| 599 | |
Louis-Francis Ratté-Boulianne | c4689ff | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 600 | enum weston_touch_mode { |
| 601 | /** Normal touch event handling */ |
| 602 | WESTON_TOUCH_MODE_NORMAL, |
| 603 | |
| 604 | /** Prepare moving to WESTON_TOUCH_MODE_CALIB. |
| 605 | * |
| 606 | * Move to WESTON_TOUCH_MODE_CALIB as soon as no touches are down on |
| 607 | * any seat. Until then, all touch events are routed normally. |
| 608 | */ |
| 609 | WESTON_TOUCH_MODE_PREP_CALIB, |
| 610 | |
| 611 | /** Calibration mode |
| 612 | * |
| 613 | * Only a single weston_touch_device forwards events to the calibrator |
| 614 | * all other touch device cause a calibrator "wrong device" event to |
| 615 | * be sent. |
| 616 | */ |
| 617 | WESTON_TOUCH_MODE_CALIB, |
| 618 | |
| 619 | /** Prepare moving to WESTON_TOUCH_MODE_NORMAL. |
| 620 | * |
| 621 | * Move to WESTON_TOUCH_MODE_NORMAL as soon as no touches are down on |
| 622 | * any seat. Until then, touch events are routed as in |
| 623 | * WESTON_TOUCH_MODE_CALIB except "wrong device" events are not sent. |
| 624 | */ |
| 625 | WESTON_TOUCH_MODE_PREP_NORMAL |
| 626 | }; |
| 627 | |
Louis-Francis Ratté-Boulianne | 6ef59c9 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 628 | /** Represents a physical touchscreen input device */ |
| 629 | struct weston_touch_device { |
| 630 | char *syspath; /**< unique name */ |
| 631 | |
| 632 | struct weston_touch *aggregate; /**< weston_touch this is part of */ |
| 633 | struct wl_list link; /**< in weston_touch::device_list */ |
| 634 | struct wl_signal destroy_signal; /**< destroy notifier */ |
| 635 | |
| 636 | void *backend_data; /**< backend-specific private */ |
| 637 | |
| 638 | const struct weston_touch_device_ops *ops; |
Louis-Francis Ratté-Boulianne | 8363098 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 639 | struct weston_touch_device_matrix saved_calibration; |
Louis-Francis Ratté-Boulianne | 6ef59c9 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 640 | }; |
| 641 | |
| 642 | /** Represents a set of touchscreen devices aggregated under a seat */ |
Kristian Høgsberg | e329f36 | 2013-05-06 22:19:57 -0400 | [diff] [blame] | 643 | struct weston_touch { |
Kristian Høgsberg | e314875 | 2013-05-06 23:19:49 -0400 | [diff] [blame] | 644 | struct weston_seat *seat; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 645 | |
Louis-Francis Ratté-Boulianne | 6ef59c9 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 646 | struct wl_list device_list; /* struct weston_touch_device::link */ |
| 647 | |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 648 | struct wl_list resource_list; |
Neil Roberts | 96d790e | 2013-09-19 17:32:00 +0100 | [diff] [blame] | 649 | struct wl_list focus_resource_list; |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 650 | struct weston_view *focus; |
Giulio Camuffo | 576fe2a | 2013-11-20 18:00:24 +0100 | [diff] [blame] | 651 | struct wl_listener focus_view_listener; |
| 652 | struct wl_listener focus_resource_listener; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 653 | uint32_t focus_serial; |
| 654 | struct wl_signal focus_signal; |
| 655 | |
Jonas Ådahl | 9484b69 | 2013-12-02 22:05:03 +0100 | [diff] [blame] | 656 | uint32_t num_tp; |
| 657 | |
Kristian Høgsberg | e329f36 | 2013-05-06 22:19:57 -0400 | [diff] [blame] | 658 | struct weston_touch_grab *grab; |
| 659 | struct weston_touch_grab default_grab; |
Neil Roberts | 306fe08 | 2013-10-03 16:43:06 +0100 | [diff] [blame] | 660 | int grab_touch_id; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 661 | wl_fixed_t grab_x, grab_y; |
| 662 | uint32_t grab_serial; |
Alexandros Frantzis | 9448deb | 2017-11-16 18:20:58 +0200 | [diff] [blame] | 663 | struct timespec grab_time; |
Alexandros Frantzis | d715784 | 2018-02-20 14:07:03 +0200 | [diff] [blame] | 664 | |
| 665 | struct wl_list timestamps_list; |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 666 | }; |
| 667 | |
Jonas Ådahl | d251010 | 2014-10-05 21:39:14 +0200 | [diff] [blame] | 668 | void |
| 669 | weston_pointer_motion_to_abs(struct weston_pointer *pointer, |
| 670 | struct weston_pointer_motion_event *event, |
| 671 | wl_fixed_t *x, wl_fixed_t *y); |
| 672 | |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 673 | void |
Alexandros Frantzis | 84b31f8 | 2017-11-24 18:01:46 +0200 | [diff] [blame] | 674 | weston_pointer_send_motion(struct weston_pointer *pointer, |
| 675 | const struct timespec *time, |
Quentin Glidic | cde1345 | 2016-08-12 10:41:32 +0200 | [diff] [blame] | 676 | struct weston_pointer_motion_event *event); |
| 677 | bool |
| 678 | weston_pointer_has_focus_resource(struct weston_pointer *pointer); |
| 679 | void |
| 680 | weston_pointer_send_button(struct weston_pointer *pointer, |
Alexandros Frantzis | 215bedc | 2017-11-16 18:20:55 +0200 | [diff] [blame] | 681 | const struct timespec *time, |
| 682 | uint32_t button, uint32_t state_w); |
Quentin Glidic | cde1345 | 2016-08-12 10:41:32 +0200 | [diff] [blame] | 683 | void |
Jonas Ådahl | 0336ca0 | 2014-10-04 16:28:29 +0200 | [diff] [blame] | 684 | weston_pointer_send_axis(struct weston_pointer *pointer, |
Alexandros Frantzis | 8032194 | 2017-11-16 18:20:56 +0200 | [diff] [blame] | 685 | const struct timespec *time, |
Peter Hutterer | 89b6a49 | 2016-01-18 15:58:17 +1000 | [diff] [blame] | 686 | struct weston_pointer_axis_event *event); |
Jonas Ådahl | 0336ca0 | 2014-10-04 16:28:29 +0200 | [diff] [blame] | 687 | void |
Peter Hutterer | 87743e9 | 2016-01-18 16:38:22 +1000 | [diff] [blame] | 688 | weston_pointer_send_axis_source(struct weston_pointer *pointer, |
| 689 | uint32_t source); |
| 690 | void |
| 691 | weston_pointer_send_frame(struct weston_pointer *pointer); |
| 692 | |
| 693 | void |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 694 | weston_pointer_set_focus(struct weston_pointer *pointer, |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 695 | struct weston_view *view, |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 696 | wl_fixed_t sx, wl_fixed_t sy); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 697 | void |
Derek Foreman | f9318d1 | 2015-05-11 15:40:11 -0500 | [diff] [blame] | 698 | weston_pointer_clear_focus(struct weston_pointer *pointer); |
| 699 | void |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 700 | weston_pointer_start_grab(struct weston_pointer *pointer, |
| 701 | struct weston_pointer_grab *grab); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 702 | void |
Kristian Høgsberg | 02bbabb | 2013-05-06 22:15:05 -0400 | [diff] [blame] | 703 | weston_pointer_end_grab(struct weston_pointer *pointer); |
Rob Bradford | 806d8c0 | 2013-06-25 18:56:41 +0100 | [diff] [blame] | 704 | void |
Giulio Camuffo | 1959ab8 | 2013-11-14 23:42:52 +0100 | [diff] [blame] | 705 | weston_pointer_move(struct weston_pointer *pointer, |
Jonas Ådahl | d251010 | 2014-10-05 21:39:14 +0200 | [diff] [blame] | 706 | struct weston_pointer_motion_event *event); |
Giulio Camuffo | cdb4d29 | 2013-11-14 23:42:53 +0100 | [diff] [blame] | 707 | void |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 708 | weston_keyboard_set_focus(struct weston_keyboard *keyboard, |
Kristian Høgsberg | fe7aa90 | 2013-05-08 09:54:37 -0400 | [diff] [blame] | 709 | struct weston_surface *surface); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 710 | void |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 711 | weston_keyboard_start_grab(struct weston_keyboard *device, |
| 712 | struct weston_keyboard_grab *grab); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 713 | void |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 714 | weston_keyboard_end_grab(struct weston_keyboard *keyboard); |
Giulio Camuffo | 6ef444d | 2014-08-28 19:44:09 +0300 | [diff] [blame] | 715 | int |
| 716 | /* |
| 717 | * 'mask' and 'value' should be a bitwise mask of one or more |
| 718 | * valued of the weston_keyboard_locks enum. |
| 719 | */ |
| 720 | weston_keyboard_set_locks(struct weston_keyboard *keyboard, |
| 721 | uint32_t mask, uint32_t value); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 722 | |
Quentin Glidic | cde1345 | 2016-08-12 10:41:32 +0200 | [diff] [blame] | 723 | void |
| 724 | weston_keyboard_send_key(struct weston_keyboard *keyboard, |
Alexandros Frantzis | 47e79c8 | 2017-11-16 18:20:57 +0200 | [diff] [blame] | 725 | const struct timespec *time, uint32_t key, |
Quentin Glidic | cde1345 | 2016-08-12 10:41:32 +0200 | [diff] [blame] | 726 | enum wl_keyboard_key_state state); |
| 727 | void |
| 728 | weston_keyboard_send_modifiers(struct weston_keyboard *keyboard, |
| 729 | uint32_t serial, uint32_t mods_depressed, |
| 730 | uint32_t mods_latched, |
| 731 | uint32_t mods_locked, uint32_t group); |
| 732 | |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 733 | void |
Derek Foreman | 4c93c08 | 2015-04-30 16:45:41 -0500 | [diff] [blame] | 734 | weston_touch_set_focus(struct weston_touch *touch, |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 735 | struct weston_view *view); |
Michael Fu | a2bb791 | 2013-07-23 15:51:06 +0800 | [diff] [blame] | 736 | void |
Louis-Francis Ratté-Boulianne | 8549e16 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 737 | weston_touch_start_grab(struct weston_touch *touch, |
Kristian Høgsberg | e329f36 | 2013-05-06 22:19:57 -0400 | [diff] [blame] | 738 | struct weston_touch_grab *grab); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 739 | void |
Kristian Høgsberg | e329f36 | 2013-05-06 22:19:57 -0400 | [diff] [blame] | 740 | weston_touch_end_grab(struct weston_touch *touch); |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 741 | |
Quentin Glidic | cde1345 | 2016-08-12 10:41:32 +0200 | [diff] [blame] | 742 | void |
Alexandros Frantzis | 9448deb | 2017-11-16 18:20:58 +0200 | [diff] [blame] | 743 | weston_touch_send_down(struct weston_touch *touch, const struct timespec *time, |
Quentin Glidic | cde1345 | 2016-08-12 10:41:32 +0200 | [diff] [blame] | 744 | int touch_id, wl_fixed_t x, wl_fixed_t y); |
| 745 | void |
Alexandros Frantzis | 27a51b8 | 2017-11-16 18:20:59 +0200 | [diff] [blame] | 746 | weston_touch_send_up(struct weston_touch *touch, const struct timespec *time, |
| 747 | int touch_id); |
Quentin Glidic | cde1345 | 2016-08-12 10:41:32 +0200 | [diff] [blame] | 748 | void |
Alexandros Frantzis | 7d2abcf | 2017-11-16 18:21:00 +0200 | [diff] [blame] | 749 | weston_touch_send_motion(struct weston_touch *touch, |
| 750 | const struct timespec *time, int touch_id, |
| 751 | wl_fixed_t x, wl_fixed_t y); |
Quentin Glidic | cde1345 | 2016-08-12 10:41:32 +0200 | [diff] [blame] | 752 | void |
| 753 | weston_touch_send_frame(struct weston_touch *touch); |
| 754 | |
Kristian Høgsberg | 2158a88 | 2013-04-18 15:07:39 -0400 | [diff] [blame] | 755 | |
| 756 | void |
Kristian Høgsberg | e314875 | 2013-05-06 23:19:49 -0400 | [diff] [blame] | 757 | weston_seat_set_selection(struct weston_seat *seat, |
Kristian Høgsberg | 7ff3bdb | 2013-07-25 15:52:14 -0700 | [diff] [blame] | 758 | struct weston_data_source *source, uint32_t serial); |
Giulio Camuffo | dddf9e6 | 2015-05-01 12:59:35 +0300 | [diff] [blame] | 759 | |
Kristian Høgsberg | 85de9c2 | 2013-09-04 20:44:26 -0700 | [diff] [blame] | 760 | int |
Xiong Zhang | fd51e7b | 2013-11-25 18:42:49 +0800 | [diff] [blame] | 761 | weston_pointer_start_drag(struct weston_pointer *pointer, |
Kristian Høgsberg | 85de9c2 | 2013-09-04 20:44:26 -0700 | [diff] [blame] | 762 | struct weston_data_source *source, |
| 763 | struct weston_surface *icon, |
| 764 | struct wl_client *client); |
Daniel Stone | d65b909 | 2012-05-30 16:32:05 +0100 | [diff] [blame] | 765 | struct weston_xkb_info { |
| 766 | struct xkb_keymap *keymap; |
Sebastian Wick | abec512 | 2019-11-01 02:38:45 +0100 | [diff] [blame] | 767 | struct ro_anonymous_file *keymap_rofile; |
Andrew Wedgbury | 9a6f02a | 2013-09-05 13:31:40 +0000 | [diff] [blame] | 768 | int32_t ref_count; |
Daniel Stone | abb9dcd | 2012-06-22 13:21:33 +0100 | [diff] [blame] | 769 | xkb_mod_index_t shift_mod; |
| 770 | xkb_mod_index_t caps_mod; |
Daniel Stone | d65b909 | 2012-05-30 16:32:05 +0100 | [diff] [blame] | 771 | xkb_mod_index_t ctrl_mod; |
| 772 | xkb_mod_index_t alt_mod; |
Daniel Stone | abb9dcd | 2012-06-22 13:21:33 +0100 | [diff] [blame] | 773 | xkb_mod_index_t mod2_mod; |
| 774 | xkb_mod_index_t mod3_mod; |
Daniel Stone | d65b909 | 2012-05-30 16:32:05 +0100 | [diff] [blame] | 775 | xkb_mod_index_t super_mod; |
Daniel Stone | abb9dcd | 2012-06-22 13:21:33 +0100 | [diff] [blame] | 776 | xkb_mod_index_t mod5_mod; |
Daniel Stone | d65b909 | 2012-05-30 16:32:05 +0100 | [diff] [blame] | 777 | xkb_led_index_t num_led; |
| 778 | xkb_led_index_t caps_led; |
| 779 | xkb_led_index_t scroll_led; |
| 780 | }; |
| 781 | |
Jan Arne Petersen | a75a789 | 2013-01-16 21:26:50 +0100 | [diff] [blame] | 782 | struct weston_keyboard { |
Kristian Høgsberg | e314875 | 2013-05-06 23:19:49 -0400 | [diff] [blame] | 783 | struct weston_seat *seat; |
Jan Arne Petersen | a75a789 | 2013-01-16 21:26:50 +0100 | [diff] [blame] | 784 | |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 785 | struct wl_list resource_list; |
Neil Roberts | 96d790e | 2013-09-19 17:32:00 +0100 | [diff] [blame] | 786 | struct wl_list focus_resource_list; |
Kristian Høgsberg | fe7aa90 | 2013-05-08 09:54:37 -0400 | [diff] [blame] | 787 | struct weston_surface *focus; |
Giulio Camuffo | 576fe2a | 2013-11-20 18:00:24 +0100 | [diff] [blame] | 788 | struct wl_listener focus_resource_listener; |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 789 | uint32_t focus_serial; |
| 790 | struct wl_signal focus_signal; |
| 791 | |
| 792 | struct weston_keyboard_grab *grab; |
| 793 | struct weston_keyboard_grab default_grab; |
| 794 | uint32_t grab_key; |
| 795 | uint32_t grab_serial; |
Alexandros Frantzis | 47e79c8 | 2017-11-16 18:20:57 +0200 | [diff] [blame] | 796 | struct timespec grab_time; |
Kristian Høgsberg | 29139d4 | 2013-04-18 15:25:39 -0400 | [diff] [blame] | 797 | |
| 798 | struct wl_array keys; |
| 799 | |
| 800 | struct { |
| 801 | uint32_t mods_depressed; |
| 802 | uint32_t mods_latched; |
| 803 | uint32_t mods_locked; |
| 804 | uint32_t group; |
| 805 | } modifiers; |
| 806 | |
| 807 | struct weston_keyboard_grab input_method_grab; |
Jan Arne Petersen | a75a789 | 2013-01-16 21:26:50 +0100 | [diff] [blame] | 808 | struct wl_resource *input_method_resource; |
Jonas Ådahl | 7395ea0 | 2013-12-03 09:14:26 +0100 | [diff] [blame] | 809 | |
| 810 | struct weston_xkb_info *xkb_info; |
| 811 | struct { |
| 812 | struct xkb_state *state; |
| 813 | enum weston_led leds; |
| 814 | } xkb_state; |
| 815 | struct xkb_keymap *pending_keymap; |
Alexandros Frantzis | 2b44248 | 2018-02-20 14:05:50 +0200 | [diff] [blame] | 816 | |
| 817 | struct wl_list timestamps_list; |
leng.fang | dbaf6fa | 2024-06-20 19:31:04 +0800 | [diff] [blame^] | 818 | struct wl_list intercept_resource; |
| 819 | struct wl_list key_info; |
Jan Arne Petersen | a75a789 | 2013-01-16 21:26:50 +0100 | [diff] [blame] | 820 | }; |
| 821 | |
Daniel Stone | 37816df | 2012-05-16 18:45:18 +0100 | [diff] [blame] | 822 | struct weston_seat { |
Kristian Høgsberg | e314875 | 2013-05-06 23:19:49 -0400 | [diff] [blame] | 823 | struct wl_list base_resource_list; |
| 824 | |
Kristian Høgsberg | aaadc77 | 2013-07-08 16:20:31 -0400 | [diff] [blame] | 825 | struct wl_global *global; |
Derek Foreman | 1281a36 | 2015-07-31 16:55:32 -0500 | [diff] [blame] | 826 | struct weston_pointer *pointer_state; |
| 827 | struct weston_keyboard *keyboard_state; |
| 828 | struct weston_touch *touch_state; |
Jonas Ådahl | d6e1c34 | 2013-10-17 23:04:05 +0200 | [diff] [blame] | 829 | int pointer_device_count; |
| 830 | int keyboard_device_count; |
| 831 | int touch_device_count; |
Kristian Høgsberg | e314875 | 2013-05-06 23:19:49 -0400 | [diff] [blame] | 832 | |
Rob Bradford | 66bd9f5 | 2013-06-25 18:56:42 +0100 | [diff] [blame] | 833 | struct weston_output *output; /* constraint */ |
| 834 | |
Giulio Camuffo | 5085a75 | 2013-03-25 21:42:45 +0100 | [diff] [blame] | 835 | struct wl_signal destroy_signal; |
Jason Ekstrand | a4ab542 | 2014-04-02 19:53:45 -0500 | [diff] [blame] | 836 | struct wl_signal updated_caps_signal; |
Daniel Stone | 74419a2 | 2012-05-30 16:32:02 +0100 | [diff] [blame] | 837 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 838 | struct weston_compositor *compositor; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 839 | struct wl_list link; |
Daniel Stone | 496ca17 | 2012-05-30 16:31:42 +0100 | [diff] [blame] | 840 | enum weston_keyboard_modifier modifier_state; |
Kristian Høgsberg | fe7aa90 | 2013-05-08 09:54:37 -0400 | [diff] [blame] | 841 | struct weston_surface *saved_kbd_focus; |
Ander Conselvan de Oliveira | 71b1d0c | 2012-03-16 17:25:11 +0200 | [diff] [blame] | 842 | struct wl_listener saved_kbd_focus_listener; |
Derek Foreman | a822afa | 2021-08-10 17:17:24 -0500 | [diff] [blame] | 843 | bool use_saved_kbd_focus; |
Kristian Høgsberg | 054c50a | 2013-05-08 15:27:47 -0400 | [diff] [blame] | 844 | struct wl_list drag_resource_list; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 845 | |
Kristian Høgsberg | e314875 | 2013-05-06 23:19:49 -0400 | [diff] [blame] | 846 | uint32_t selection_serial; |
Kristian Høgsberg | 7ff3bdb | 2013-07-25 15:52:14 -0700 | [diff] [blame] | 847 | struct weston_data_source *selection_data_source; |
Kristian Høgsberg | e314875 | 2013-05-06 23:19:49 -0400 | [diff] [blame] | 848 | struct wl_listener selection_data_source_listener; |
| 849 | struct wl_signal selection_signal; |
| 850 | |
Daniel Stone | 8c8164f | 2012-05-30 16:31:45 +0100 | [diff] [blame] | 851 | void (*led_update)(struct weston_seat *ws, enum weston_led leds); |
| 852 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 853 | struct input_method *input_method; |
Rob Bradford | 9af5f9e | 2013-05-31 18:09:50 +0100 | [diff] [blame] | 854 | char *seat_name; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 855 | }; |
| 856 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 857 | enum { |
Emmanuel Gil Peyrot | eff793a | 2021-07-31 17:25:41 +0200 | [diff] [blame] | 858 | WESTON_COMPOSITOR_ACTIVE, /* normal rendering and events */ |
| 859 | WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */ |
| 860 | WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */ |
| 861 | WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dpms |
| 862 | * to off */ |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 863 | }; |
| 864 | |
Giulio Camuffo | 412e6a5 | 2014-07-09 22:12:56 +0300 | [diff] [blame] | 865 | struct weston_layer_entry { |
| 866 | struct wl_list link; |
| 867 | struct weston_layer *layer; |
| 868 | }; |
| 869 | |
Quentin Glidic | 8268157 | 2016-12-17 13:40:51 +0100 | [diff] [blame] | 870 | /** |
| 871 | * Higher value means higher in the stack. |
| 872 | * |
| 873 | * These values are based on well-known concepts in a classic desktop |
| 874 | * environment. Third-party modules based on libweston are encouraged to use |
| 875 | * them to integrate better with other projects. |
| 876 | * |
| 877 | * A fully integrated environment can use any value, based on these or not, |
| 878 | * at their discretion. |
| 879 | */ |
| 880 | enum weston_layer_position { |
| 881 | /* |
| 882 | * Special value to make the layer invisible and still rendered. |
| 883 | * This is used by compositors wanting e.g. minimized surfaces to still |
| 884 | * receive frame callbacks. |
| 885 | */ |
| 886 | WESTON_LAYER_POSITION_HIDDEN = 0x00000000, |
| 887 | |
| 888 | /* |
| 889 | * There should always be a background layer with a surface covering |
| 890 | * the visible area. |
| 891 | * |
| 892 | * If the compositor handles the background itself, it should use |
| 893 | * BACKGROUND. |
| 894 | * |
| 895 | * If the compositor supports runtime-loadable modules to set the |
| 896 | * background, it should put a solid color surface at (BACKGROUND - 1) |
| 897 | * and modules must use BACKGROUND. |
| 898 | */ |
| 899 | WESTON_LAYER_POSITION_BACKGROUND = 0x00000002, |
| 900 | |
| 901 | /* For "desktop widgets" and applications like conky. */ |
| 902 | WESTON_LAYER_POSITION_BOTTOM_UI = 0x30000000, |
| 903 | |
| 904 | /* For regular applications, only one layer should have this value |
| 905 | * to ensure proper stacking control. */ |
| 906 | WESTON_LAYER_POSITION_NORMAL = 0x50000000, |
| 907 | |
| 908 | /* For desktop UI, like panels. */ |
| 909 | WESTON_LAYER_POSITION_UI = 0x80000000, |
| 910 | |
| 911 | /* For fullscreen applications that should cover UI. */ |
| 912 | WESTON_LAYER_POSITION_FULLSCREEN = 0xb0000000, |
| 913 | |
| 914 | /* For special UI like on-screen keyboard that fullscreen applications |
| 915 | * will need. */ |
| 916 | WESTON_LAYER_POSITION_TOP_UI = 0xe0000000, |
| 917 | |
| 918 | /* For the lock surface. */ |
| 919 | WESTON_LAYER_POSITION_LOCK = 0xffff0000, |
| 920 | |
| 921 | /* Values reserved for libweston internal usage */ |
| 922 | WESTON_LAYER_POSITION_CURSOR = 0xfffffffe, |
| 923 | WESTON_LAYER_POSITION_FADE = 0xffffffff, |
| 924 | }; |
| 925 | |
Kristian Høgsberg | 3be2ce9 | 2012-02-29 12:42:35 -0500 | [diff] [blame] | 926 | struct weston_layer { |
Quentin Glidic | 8268157 | 2016-12-17 13:40:51 +0100 | [diff] [blame] | 927 | struct weston_compositor *compositor; |
| 928 | struct wl_list link; /* weston_compositor::layer_list */ |
| 929 | enum weston_layer_position position; |
Giulio Camuffo | 95ec0f9 | 2014-07-09 22:12:57 +0300 | [diff] [blame] | 930 | pixman_box32_t mask; |
Quentin Glidic | 8268157 | 2016-12-17 13:40:51 +0100 | [diff] [blame] | 931 | struct weston_layer_entry view_list; |
Kristian Høgsberg | 3be2ce9 | 2012-02-29 12:42:35 -0500 | [diff] [blame] | 932 | }; |
| 933 | |
Kristian Høgsberg | 65a11e1 | 2012-08-03 11:30:18 -0400 | [diff] [blame] | 934 | struct weston_plane { |
Xiong Zhang | 9711653 | 2013-10-23 13:58:31 +0800 | [diff] [blame] | 935 | struct weston_compositor *compositor; |
Pekka Paalanen | 502f5e0 | 2015-02-23 14:08:25 +0200 | [diff] [blame] | 936 | pixman_region32_t damage; /**< in global coords */ |
Ander Conselvan de Oliveira | e1bd5a0 | 2013-03-05 17:30:29 +0200 | [diff] [blame] | 937 | pixman_region32_t clip; |
Kristian Høgsberg | 65a11e1 | 2012-08-03 11:30:18 -0400 | [diff] [blame] | 938 | int32_t x, y; |
Ander Conselvan de Oliveira | 8ad1982 | 2013-03-05 17:30:27 +0200 | [diff] [blame] | 939 | struct wl_list link; |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 940 | bool keep_last_frame; |
Kristian Høgsberg | 65a11e1 | 2012-08-03 11:30:18 -0400 | [diff] [blame] | 941 | }; |
| 942 | |
Leandro Ribeiro | 1b40326 | 2021-03-04 17:47:13 -0300 | [diff] [blame] | 943 | struct weston_drm_format_array; |
| 944 | |
Kristian Høgsberg | fa1be02 | 2012-09-05 22:49:55 -0400 | [diff] [blame] | 945 | struct weston_renderer { |
John Kåre Alsaker | a95b2d6 | 2012-11-13 19:10:21 +0100 | [diff] [blame] | 946 | int (*read_pixels)(struct weston_output *output, |
| 947 | pixman_format_code_t format, void *pixels, |
| 948 | uint32_t x, uint32_t y, |
| 949 | uint32_t width, uint32_t height); |
Kristian Høgsberg | fa1be02 | 2012-09-05 22:49:55 -0400 | [diff] [blame] | 950 | void (*repaint_output)(struct weston_output *output, |
| 951 | pixman_region32_t *output_damage); |
| 952 | void (*flush_damage)(struct weston_surface *surface); |
Jason Ekstrand | 6bd6294 | 2013-06-20 20:38:23 -0500 | [diff] [blame] | 953 | void (*attach)(struct weston_surface *es, struct weston_buffer *buffer); |
John Kåre Alsaker | 878f449 | 2012-11-13 19:10:23 +0100 | [diff] [blame] | 954 | void (*surface_set_color)(struct weston_surface *surface, |
| 955 | float red, float green, |
| 956 | float blue, float alpha); |
Vasily Khoruzhick | 52cfd61 | 2013-01-08 19:09:01 +0300 | [diff] [blame] | 957 | void (*destroy)(struct weston_compositor *ec); |
Pekka Paalanen | c647ed7 | 2015-02-09 13:16:57 +0200 | [diff] [blame] | 958 | |
| 959 | |
| 960 | /** See weston_surface_get_content_size() */ |
| 961 | void (*surface_get_content_size)(struct weston_surface *surface, |
| 962 | int *width, int *height); |
| 963 | |
| 964 | /** See weston_surface_copy_content() */ |
| 965 | int (*surface_copy_content)(struct weston_surface *surface, |
| 966 | void *target, size_t size, |
| 967 | int src_x, int src_y, |
| 968 | int width, int height); |
Pekka Paalanen | 230f3b1 | 2014-09-29 14:18:40 -0400 | [diff] [blame] | 969 | |
| 970 | /** See weston_compositor_import_dmabuf() */ |
| 971 | bool (*import_dmabuf)(struct weston_compositor *ec, |
| 972 | struct linux_dmabuf_buffer *buffer); |
Varad Gautam | 0775cd1 | 2016-11-23 14:03:20 +0530 | [diff] [blame] | 973 | |
Leandro Ribeiro | 1b40326 | 2021-03-04 17:47:13 -0300 | [diff] [blame] | 974 | const struct weston_drm_format_array * |
| 975 | (*get_supported_formats)(struct weston_compositor *ec); |
Kristian Høgsberg | fa1be02 | 2012-09-05 22:49:55 -0400 | [diff] [blame] | 976 | }; |
| 977 | |
Pekka Paalanen | 7bb6510 | 2013-05-22 18:03:04 +0300 | [diff] [blame] | 978 | enum weston_capability { |
| 979 | /* backend/renderer supports arbitrary rotation */ |
| 980 | WESTON_CAP_ROTATION_ANY = 0x0001, |
Pekka Paalanen | 4fc5dd0 | 2013-05-22 18:03:05 +0300 | [diff] [blame] | 981 | |
| 982 | /* screencaptures need to be y-flipped */ |
| 983 | WESTON_CAP_CAPTURE_YFLIP = 0x0002, |
Jason Ekstrand | 9fc7151 | 2014-04-02 19:53:46 -0500 | [diff] [blame] | 984 | |
Bryce Harrington | a86c3ee | 2015-03-18 18:42:00 -0700 | [diff] [blame] | 985 | /* backend/renderer has a separate cursor plane */ |
Jason Ekstrand | 9fc7151 | 2014-04-02 19:53:46 -0500 | [diff] [blame] | 986 | WESTON_CAP_CURSOR_PLANE = 0x0004, |
| 987 | |
| 988 | /* backend supports setting arbitrary resolutions */ |
| 989 | WESTON_CAP_ARBITRARY_MODES = 0x0008, |
Pekka Paalanen | 380adf5 | 2015-02-16 14:39:11 +0200 | [diff] [blame] | 990 | |
| 991 | /* renderer supports weston_view_set_mask() clipping */ |
| 992 | WESTON_CAP_VIEW_CLIP_MASK = 0x0010, |
Alexandros Frantzis | acff29b | 2018-10-19 12:14:11 +0300 | [diff] [blame] | 993 | |
| 994 | /* renderer supports explicit synchronization */ |
| 995 | WESTON_CAP_EXPLICIT_SYNC = 0x0020, |
Pekka Paalanen | b5265af | 2020-12-02 11:57:58 +0200 | [diff] [blame] | 996 | |
| 997 | /* renderer supports color management operations */ |
| 998 | WESTON_CAP_COLOR_OPS = 0x0040, |
Pekka Paalanen | 7bb6510 | 2013-05-22 18:03:04 +0300 | [diff] [blame] | 999 | }; |
| 1000 | |
Giulio Camuffo | e3c0d8a | 2015-10-17 19:24:13 +0300 | [diff] [blame] | 1001 | /* Configuration struct for a backend. |
| 1002 | * |
| 1003 | * This struct carries the configuration for a backend, and it's |
| 1004 | * passed to the backend's init entry point. The backend will |
| 1005 | * likely want to subclass this in order to handle backend specific |
| 1006 | * data. |
Bryce Harrington | 20b66c3 | 2016-04-15 20:28:29 -0700 | [diff] [blame] | 1007 | * |
Marius Vlad | ae26341 | 2019-06-06 23:10:49 +0300 | [diff] [blame] | 1008 | * \rststar |
| 1009 | * .. note: |
Bryce Harrington | 20b66c3 | 2016-04-15 20:28:29 -0700 | [diff] [blame] | 1010 | * |
Marius Vlad | ae26341 | 2019-06-06 23:10:49 +0300 | [diff] [blame] | 1011 | * Alternate designs were proposed (Feb 2016) for using opaque structures[1] |
| 1012 | * and for section+key/value getter/setters[2]. The rationale for selecting |
| 1013 | * the transparent structure design is based on several assumptions[3] which |
| 1014 | * may require re-evaluating the design choice if they fail to hold. |
| 1015 | * |
| 1016 | * 1. https://lists.freedesktop.org/archives/wayland-devel/2016-February/026989.html |
| 1017 | * 2. https://lists.freedesktop.org/archives/wayland-devel/2016-February/026929.html |
| 1018 | * 3. https://lists.freedesktop.org/archives/wayland-devel/2016-February/027228.html |
| 1019 | * |
| 1020 | * \endrststar |
Giulio Camuffo | e3c0d8a | 2015-10-17 19:24:13 +0300 | [diff] [blame] | 1021 | */ |
| 1022 | struct weston_backend_config { |
Emmanuel Gil Peyrot | eff793a | 2021-07-31 17:25:41 +0200 | [diff] [blame] | 1023 | /** Major version for the backend-specific config struct |
| 1024 | * |
| 1025 | * This version must match exactly what the backend expects, otherwise |
| 1026 | * the struct is incompatible. |
| 1027 | */ |
| 1028 | uint32_t struct_version; |
Bryce Harrington | 20b66c3 | 2016-04-15 20:28:29 -0700 | [diff] [blame] | 1029 | |
Emmanuel Gil Peyrot | eff793a | 2021-07-31 17:25:41 +0200 | [diff] [blame] | 1030 | /** Minor version of the backend-specific config struct |
| 1031 | * |
| 1032 | * This must be set to sizeof(struct backend-specific config). |
| 1033 | * If the value here is smaller than what the backend expects, the |
| 1034 | * extra config members will assume their default values. |
| 1035 | * |
| 1036 | * A value greater than what the backend expects is incompatible. |
| 1037 | */ |
| 1038 | size_t struct_size; |
Giulio Camuffo | e3c0d8a | 2015-10-17 19:24:13 +0300 | [diff] [blame] | 1039 | }; |
| 1040 | |
Pekka Paalanen | e48bfc7 | 2019-07-17 00:09:06 +0300 | [diff] [blame] | 1041 | struct weston_backend; |
Giulio Camuffo | 954f183 | 2014-10-11 18:27:30 +0300 | [diff] [blame] | 1042 | |
Louis-Francis Ratté-Boulianne | 8363098 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 1043 | /** Callback for saving calibration |
| 1044 | * |
| 1045 | * \param compositor The compositor. |
| 1046 | * \param device The physical touch device to save for. |
| 1047 | * \param calibration The new calibration from a client. |
| 1048 | * \return -1 on failure, 0 on success. |
| 1049 | * |
| 1050 | * Failure will prevent taking the new calibration into use. |
| 1051 | */ |
| 1052 | typedef int (*weston_touch_calibration_save_func)( |
| 1053 | struct weston_compositor *compositor, |
| 1054 | struct weston_touch_device *device, |
| 1055 | const struct weston_touch_device_matrix *calibration); |
| 1056 | struct weston_touch_calibrator; |
| 1057 | |
Quentin Glidic | 955cec0 | 2016-08-12 10:41:35 +0200 | [diff] [blame] | 1058 | struct weston_desktop_xwayland; |
| 1059 | struct weston_desktop_xwayland_interface; |
Pekka Paalanen | a5630ea | 2017-10-12 13:13:42 +0200 | [diff] [blame] | 1060 | struct weston_debug_compositor; |
Pekka Paalanen | 90a5ffa | 2021-02-25 12:03:28 +0200 | [diff] [blame] | 1061 | struct weston_color_manager; |
Leandro Ribeiro | 8eb8414 | 2021-01-18 19:36:48 -0300 | [diff] [blame] | 1062 | struct weston_dmabuf_feedback; |
| 1063 | struct weston_dmabuf_feedback_format_table; |
Quentin Glidic | 955cec0 | 2016-08-12 10:41:35 +0200 | [diff] [blame] | 1064 | |
Marius Vlad | 9fdda7f | 2019-06-11 16:08:55 +0300 | [diff] [blame] | 1065 | /** Main object, container-like structure which aggregates all other objects. |
| 1066 | * |
| 1067 | * \ingroup compositor |
| 1068 | */ |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1069 | struct weston_compositor { |
Kristian Høgsberg | 02e79dc | 2012-04-12 09:55:26 -0400 | [diff] [blame] | 1070 | struct wl_signal destroy_signal; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1071 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1072 | struct wl_display *wl_display; |
Quentin Glidic | 955cec0 | 2016-08-12 10:41:35 +0200 | [diff] [blame] | 1073 | struct weston_desktop_xwayland *xwayland; |
| 1074 | const struct weston_desktop_xwayland_interface *xwayland_interface; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1075 | |
leng.fang | dbaf6fa | 2024-06-20 19:31:04 +0800 | [diff] [blame^] | 1076 | int next_surface_id; |
| 1077 | |
Tiago Vignatti | fb2adba | 2013-06-12 15:43:21 -0300 | [diff] [blame] | 1078 | /* surface signals */ |
Kristian Høgsberg | f03a04a | 2014-04-06 22:04:50 -0700 | [diff] [blame] | 1079 | struct wl_signal create_surface_signal; |
Kristian Høgsberg | 02e79dc | 2012-04-12 09:55:26 -0400 | [diff] [blame] | 1080 | struct wl_signal activate_signal; |
Tiago Vignatti | fb2adba | 2013-06-12 15:43:21 -0300 | [diff] [blame] | 1081 | struct wl_signal transform_signal; |
| 1082 | |
Tiago Vignatti | 1d01b01 | 2012-09-27 17:48:36 +0300 | [diff] [blame] | 1083 | struct wl_signal kill_signal; |
Ander Conselvan de Oliveira | a457563 | 2013-02-21 18:35:23 +0200 | [diff] [blame] | 1084 | struct wl_signal idle_signal; |
| 1085 | struct wl_signal wake_signal; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1086 | |
Jan Arne Petersen | 42feced | 2012-06-21 21:52:17 +0200 | [diff] [blame] | 1087 | struct wl_signal show_input_panel_signal; |
| 1088 | struct wl_signal hide_input_panel_signal; |
Jan Arne Petersen | 14da96b | 2013-04-18 16:47:28 +0200 | [diff] [blame] | 1089 | struct wl_signal update_input_panel_signal; |
Jan Arne Petersen | 42feced | 2012-06-21 21:52:17 +0200 | [diff] [blame] | 1090 | |
Jan Arne Petersen | 674fd1d | 2012-11-18 19:06:42 +0100 | [diff] [blame] | 1091 | struct wl_signal seat_created_signal; |
Richard Hughes | 59d5da7 | 2013-05-01 21:52:11 +0100 | [diff] [blame] | 1092 | struct wl_signal output_created_signal; |
Ander Conselvan de Oliveira | f84327a | 2014-01-29 18:47:51 +0200 | [diff] [blame] | 1093 | struct wl_signal output_destroyed_signal; |
Ander Conselvan de Oliveira | a8a9baf | 2014-01-29 18:47:52 +0200 | [diff] [blame] | 1094 | struct wl_signal output_moved_signal; |
David Fort | 0de859e | 2016-05-27 23:22:57 +0200 | [diff] [blame] | 1095 | struct wl_signal output_resized_signal; /* callback argument: resized output */ |
Jan Arne Petersen | 674fd1d | 2012-11-18 19:06:42 +0100 | [diff] [blame] | 1096 | |
Pekka Paalanen | 8dc6db8 | 2018-03-20 13:29:40 +0200 | [diff] [blame] | 1097 | /* Signal for output changes triggered by configuration from frontend |
| 1098 | * or head state changes from backend. |
| 1099 | */ |
| 1100 | struct wl_signal output_heads_changed_signal; /* arg: weston_output */ |
| 1101 | |
Kristian Høgsberg | 61741a2 | 2013-09-17 16:02:57 -0700 | [diff] [blame] | 1102 | struct wl_signal session_signal; |
Robert Beckett | c569bdc | 2019-07-10 16:40:12 +0100 | [diff] [blame] | 1103 | bool session_active; |
Kristian Høgsberg | 61741a2 | 2013-09-17 16:02:57 -0700 | [diff] [blame] | 1104 | |
Kristian Høgsberg | 3be2ce9 | 2012-02-29 12:42:35 -0500 | [diff] [blame] | 1105 | struct weston_layer fade_layer; |
| 1106 | struct weston_layer cursor_layer; |
| 1107 | |
Armin Krezović | a01ab6d | 2016-09-30 14:11:02 +0200 | [diff] [blame] | 1108 | struct wl_list pending_output_list; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1109 | struct wl_list output_list; |
Pekka Paalanen | 1adcbac | 2017-08-14 16:05:35 +0300 | [diff] [blame] | 1110 | struct wl_list head_list; /* struct weston_head::compositor_link */ |
Daniel Stone | 37816df | 2012-05-16 18:45:18 +0100 | [diff] [blame] | 1111 | struct wl_list seat_list; |
Quentin Glidic | 8268157 | 2016-12-17 13:40:51 +0100 | [diff] [blame] | 1112 | struct wl_list layer_list; /* struct weston_layer::link */ |
Pekka Paalanen | 20c7e55 | 2016-03-30 14:08:24 +0300 | [diff] [blame] | 1113 | struct wl_list view_list; /* struct weston_view::link */ |
Ander Conselvan de Oliveira | 8ad1982 | 2013-03-05 17:30:27 +0200 | [diff] [blame] | 1114 | struct wl_list plane_list; |
Daniel Stone | 325fc2d | 2012-05-30 16:31:58 +0100 | [diff] [blame] | 1115 | struct wl_list key_binding_list; |
Daniel Stone | 96d47c0 | 2013-11-19 11:37:12 +0100 | [diff] [blame] | 1116 | struct wl_list modifier_binding_list; |
Daniel Stone | 325fc2d | 2012-05-30 16:31:58 +0100 | [diff] [blame] | 1117 | struct wl_list button_binding_list; |
Neil Roberts | a28c693 | 2013-10-03 16:43:04 +0100 | [diff] [blame] | 1118 | struct wl_list touch_binding_list; |
Daniel Stone | 325fc2d | 2012-05-30 16:31:58 +0100 | [diff] [blame] | 1119 | struct wl_list axis_binding_list; |
Ander Conselvan de Oliveira | c509d2b | 2012-11-08 17:20:45 +0200 | [diff] [blame] | 1120 | struct wl_list debug_binding_list; |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 1121 | struct wl_list video_surface_list; |
leng.fang | dbaf6fa | 2024-06-20 19:31:04 +0800 | [diff] [blame^] | 1122 | struct wl_list surface_id_list; |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 1123 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1124 | |
| 1125 | uint32_t state; |
| 1126 | struct wl_event_source *idle_source; |
| 1127 | uint32_t idle_inhibit; |
Philipp Brüschweiler | 4b409c3 | 2013-03-10 14:37:04 +0100 | [diff] [blame] | 1128 | int idle_time; /* timeout, s */ |
Daniel Stone | 6847b85 | 2017-03-01 11:34:08 +0000 | [diff] [blame] | 1129 | struct wl_event_source *repaint_timer; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1130 | |
Giulio Camuffo | cdb4d29 | 2013-11-14 23:42:53 +0100 | [diff] [blame] | 1131 | const struct weston_pointer_grab_interface *default_pointer_grab; |
| 1132 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1133 | /* Repaint state. */ |
Kristian Høgsberg | 65a11e1 | 2012-08-03 11:30:18 -0400 | [diff] [blame] | 1134 | struct weston_plane primary_plane; |
Pekka Paalanen | 7bb6510 | 2013-05-22 18:03:04 +0300 | [diff] [blame] | 1135 | uint32_t capabilities; /* combination of enum weston_capability */ |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1136 | |
Pekka Paalanen | 90a5ffa | 2021-02-25 12:03:28 +0200 | [diff] [blame] | 1137 | struct weston_color_manager *color_manager; |
Kristian Høgsberg | fa1be02 | 2012-09-05 22:49:55 -0400 | [diff] [blame] | 1138 | struct weston_renderer *renderer; |
John Kåre Alsaker | f9e710b | 2012-11-13 19:10:22 +0100 | [diff] [blame] | 1139 | pixman_format_code_t read_format; |
Pekka Paalanen | 52bfbaa | 2012-04-11 16:19:37 +0300 | [diff] [blame] | 1140 | |
Giulio Camuffo | 954f183 | 2014-10-11 18:27:30 +0300 | [diff] [blame] | 1141 | struct weston_backend *backend; |
Kristian Høgsberg | 05ad1e4 | 2013-09-17 14:41:03 -0700 | [diff] [blame] | 1142 | struct weston_launcher *launcher; |
Casey Dahlin | 58ba137 | 2012-04-19 22:50:08 -0400 | [diff] [blame] | 1143 | |
Leandro Ribeiro | 8eb8414 | 2021-01-18 19:36:48 -0300 | [diff] [blame] | 1144 | struct weston_dmabuf_feedback *default_dmabuf_feedback; |
| 1145 | struct weston_dmabuf_feedback_format_table *dmabuf_feedback_format_table; |
| 1146 | |
Pekka Paalanen | 827b5d2 | 2016-06-29 11:54:26 +0200 | [diff] [blame] | 1147 | struct wl_list plugin_api_list; /* struct weston_plugin_api::link */ |
| 1148 | |
Casey Dahlin | 58ba137 | 2012-04-19 22:50:08 -0400 | [diff] [blame] | 1149 | uint32_t output_id_pool; |
Daniel Stone | 855028f | 2012-05-01 20:37:10 +0100 | [diff] [blame] | 1150 | |
Daniel Stone | e379da9 | 2012-05-30 16:32:04 +0100 | [diff] [blame] | 1151 | struct xkb_rule_names xkb_names; |
| 1152 | struct xkb_context *xkb_context; |
Andrew Wedgbury | 9a6f02a | 2013-09-05 13:31:40 +0000 | [diff] [blame] | 1153 | struct weston_xkb_info *xkb_info; |
leng.fang | dbaf6fa | 2024-06-20 19:31:04 +0800 | [diff] [blame^] | 1154 | struct wl_simple_shell *simple_shell; |
Matt Roper | 01a9273 | 2013-06-24 16:52:44 +0100 | [diff] [blame] | 1155 | |
Jonny Lamb | 66a41a0 | 2014-08-12 14:58:25 +0200 | [diff] [blame] | 1156 | int32_t kb_repeat_rate; |
| 1157 | int32_t kb_repeat_delay; |
Pekka Paalanen | b5eedad | 2014-09-23 22:08:45 -0400 | [diff] [blame] | 1158 | |
Bob Ham | 91880f1 | 2016-01-12 10:21:47 +0000 | [diff] [blame] | 1159 | bool vt_switching; |
| 1160 | |
Pekka Paalanen | b5eedad | 2014-09-23 22:08:45 -0400 | [diff] [blame] | 1161 | clockid_t presentation_clock; |
Pekka Paalanen | 0513a95 | 2014-05-21 16:17:27 +0300 | [diff] [blame] | 1162 | int32_t repaint_msec; |
Pekka Paalanen | 1ed2cad | 2021-02-10 12:33:03 +0200 | [diff] [blame] | 1163 | struct timespec last_repaint_start; |
Frederic Plourde | c336f06 | 2014-10-29 14:44:33 -0400 | [diff] [blame] | 1164 | |
Jonas Ådahl | 94e2e2d | 2014-10-18 18:42:19 +0200 | [diff] [blame] | 1165 | unsigned int activate_serial; |
| 1166 | |
Jonas Ådahl | d3414f2 | 2016-07-22 17:56:31 +0800 | [diff] [blame] | 1167 | struct wl_global *pointer_constraints; |
| 1168 | |
Frederic Plourde | c336f06 | 2014-10-29 14:44:33 -0400 | [diff] [blame] | 1169 | int exit_code; |
Giulio Camuffo | 459137b | 2014-10-11 23:56:24 +0300 | [diff] [blame] | 1170 | |
| 1171 | void *user_data; |
| 1172 | void (*exit)(struct weston_compositor *c); |
Daniel Díaz | 75b7197 | 2016-10-21 14:03:13 -0500 | [diff] [blame] | 1173 | |
| 1174 | /* Whether to let the compositor run without any input device. */ |
| 1175 | bool require_input; |
| 1176 | |
Leandro Ribeiro | 32a5acd | 2020-10-19 16:06:22 -0300 | [diff] [blame] | 1177 | /* Test suite data */ |
| 1178 | struct weston_testsuite_data test_data; |
| 1179 | |
Pekka Paalanen | 8dc6db8 | 2018-03-20 13:29:40 +0200 | [diff] [blame] | 1180 | /* Signal for a backend to inform a frontend about possible changes |
| 1181 | * in head status. |
| 1182 | */ |
Pekka Paalanen | 37e6c9e | 2017-08-15 13:00:02 +0300 | [diff] [blame] | 1183 | struct wl_signal heads_changed_signal; |
| 1184 | struct wl_event_source *heads_changed_source; |
Louis-Francis Ratté-Boulianne | c4689ff | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 1185 | |
Louis-Francis Ratté-Boulianne | 8363098 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 1186 | /* Touchscreen calibrator support: */ |
Louis-Francis Ratté-Boulianne | c4689ff | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 1187 | enum weston_touch_mode touch_mode; |
Louis-Francis Ratté-Boulianne | 8363098 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 1188 | struct wl_global *touch_calibration; |
| 1189 | weston_touch_calibration_save_func touch_calibration_save; |
| 1190 | struct weston_layer calibrator_layer; |
| 1191 | struct weston_touch_calibrator *touch_calibrator; |
Pekka Paalanen | a5630ea | 2017-10-12 13:13:42 +0200 | [diff] [blame] | 1192 | |
Marius Vlad | 3d7d978 | 2019-04-17 12:35:38 +0300 | [diff] [blame] | 1193 | struct weston_log_context *weston_log_ctx; |
Marius Vlad | 5d5e335 | 2019-04-17 13:05:38 +0300 | [diff] [blame] | 1194 | struct weston_log_scope *debug_scene; |
Marius Vlad | da104eb | 2019-09-05 14:31:01 +0300 | [diff] [blame] | 1195 | struct weston_log_scope *timeline; |
Ankit Nautiyal | 5cfe03c | 2019-03-28 15:05:42 +0530 | [diff] [blame] | 1196 | |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 1197 | #ifdef ENABLE_DRM_HELP |
| 1198 | FILE* aml_logfile; |
| 1199 | bool aml_log_enable; |
| 1200 | int aml_log_nframes; |
| 1201 | bool aml_log_start; |
| 1202 | #endif |
| 1203 | bool use_gbm_modifiers; |
| 1204 | |
Ankit Nautiyal | 5cfe03c | 2019-03-28 15:05:42 +0530 | [diff] [blame] | 1205 | struct content_protection *content_protection; |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 1206 | struct weston_surface* last_keyboard_focus; |
| 1207 | int video_surface_count; |
| 1208 | bool enable_video_debug; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1209 | }; |
| 1210 | |
Jason Ekstrand | 6bd6294 | 2013-06-20 20:38:23 -0500 | [diff] [blame] | 1211 | struct weston_buffer { |
| 1212 | struct wl_resource *resource; |
| 1213 | struct wl_signal destroy_signal; |
| 1214 | struct wl_listener destroy_listener; |
| 1215 | |
| 1216 | union { |
| 1217 | struct wl_shm_buffer *shm_buffer; |
Jason Ekstrand | a85118c | 2013-06-27 20:17:02 -0500 | [diff] [blame] | 1218 | void *legacy_buffer; |
Jason Ekstrand | 6bd6294 | 2013-06-20 20:38:23 -0500 | [diff] [blame] | 1219 | }; |
| 1220 | int32_t width, height; |
| 1221 | uint32_t busy_count; |
Stanislav Vorobiov | bfbb8e5 | 2013-08-29 11:36:44 +0400 | [diff] [blame] | 1222 | int y_inverted; |
Daniel Stone | 7d27df4 | 2021-11-18 16:01:03 +0000 | [diff] [blame] | 1223 | void *backend_private; |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 1224 | uint64_t pts; |
| 1225 | bool commit_fail; |
Jason Ekstrand | 6bd6294 | 2013-06-20 20:38:23 -0500 | [diff] [blame] | 1226 | }; |
| 1227 | |
Pekka Paalanen | de685b8 | 2012-12-04 15:58:12 +0200 | [diff] [blame] | 1228 | struct weston_buffer_reference { |
Jason Ekstrand | 6bd6294 | 2013-06-20 20:38:23 -0500 | [diff] [blame] | 1229 | struct weston_buffer *buffer; |
Pekka Paalanen | de685b8 | 2012-12-04 15:58:12 +0200 | [diff] [blame] | 1230 | struct wl_listener destroy_listener; |
| 1231 | }; |
| 1232 | |
Pekka Paalanen | 1fd9c0f | 2013-11-26 18:19:41 +0100 | [diff] [blame] | 1233 | struct weston_buffer_viewport { |
Pekka Paalanen | 952b6c8 | 2014-03-14 14:38:15 +0200 | [diff] [blame] | 1234 | struct { |
| 1235 | /* wl_surface.set_buffer_transform */ |
| 1236 | uint32_t transform; |
Pekka Paalanen | 1fd9c0f | 2013-11-26 18:19:41 +0100 | [diff] [blame] | 1237 | |
Pekka Paalanen | 952b6c8 | 2014-03-14 14:38:15 +0200 | [diff] [blame] | 1238 | /* wl_surface.set_scaling_factor */ |
| 1239 | int32_t scale; |
Jonny Lamb | 7413076 | 2013-11-26 18:19:46 +0100 | [diff] [blame] | 1240 | |
Pekka Paalanen | f0cad48 | 2014-03-14 14:38:16 +0200 | [diff] [blame] | 1241 | /* |
| 1242 | * If src_width != wl_fixed_from_int(-1), |
| 1243 | * then and only then src_* are used. |
| 1244 | */ |
Pekka Paalanen | 952b6c8 | 2014-03-14 14:38:15 +0200 | [diff] [blame] | 1245 | wl_fixed_t src_x, src_y; |
| 1246 | wl_fixed_t src_width, src_height; |
| 1247 | } buffer; |
| 1248 | |
| 1249 | struct { |
Pekka Paalanen | f0cad48 | 2014-03-14 14:38:16 +0200 | [diff] [blame] | 1250 | /* |
| 1251 | * If width == -1, the size is inferred from the buffer. |
| 1252 | */ |
Pekka Paalanen | 952b6c8 | 2014-03-14 14:38:15 +0200 | [diff] [blame] | 1253 | int32_t width, height; |
| 1254 | } surface; |
George Kiagiadakis | 8f9e87f | 2014-06-13 18:14:20 +0200 | [diff] [blame] | 1255 | |
| 1256 | int changed; |
Pekka Paalanen | 1fd9c0f | 2013-11-26 18:19:41 +0100 | [diff] [blame] | 1257 | }; |
| 1258 | |
Alexandros Frantzis | 6762967 | 2018-10-19 12:14:11 +0300 | [diff] [blame] | 1259 | struct weston_buffer_release { |
| 1260 | /* The associated zwp_linux_buffer_release_v1 resource. */ |
| 1261 | struct wl_resource *resource; |
| 1262 | /* How many weston_buffer_release_reference objects point to this |
| 1263 | * object. */ |
| 1264 | uint32_t ref_count; |
| 1265 | /* The fence fd, if any, associated with this release. If the fence fd |
| 1266 | * is -1 then this is considered an immediate release. */ |
| 1267 | int fence_fd; |
| 1268 | }; |
| 1269 | |
| 1270 | struct weston_buffer_release_reference { |
| 1271 | struct weston_buffer_release *buffer_release; |
| 1272 | /* Listener for the destruction of the wl_resource associated with the |
| 1273 | * referenced buffer_release object. */ |
| 1274 | struct wl_listener destroy_listener; |
| 1275 | }; |
| 1276 | |
Kristian Høgsberg | 5e7e6f2 | 2012-02-23 16:11:59 -0500 | [diff] [blame] | 1277 | struct weston_region { |
Jason Ekstrand | 8895efc | 2013-06-14 10:07:56 -0500 | [diff] [blame] | 1278 | struct wl_resource *resource; |
Kristian Høgsberg | 5e7e6f2 | 2012-02-23 16:11:59 -0500 | [diff] [blame] | 1279 | pixman_region32_t region; |
| 1280 | }; |
| 1281 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1282 | /* Using weston_view transformations |
Pekka Paalanen | 44ab69c | 2012-02-07 13:18:00 +0200 | [diff] [blame] | 1283 | * |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1284 | * To add a transformation to a view, create a struct weston_transform, and |
| 1285 | * add it to the list view->geometry.transformation_list. Whenever you |
| 1286 | * change the list, anything under view->geometry, or anything in the |
Pekka Paalanen | c3ce738 | 2013-03-08 14:56:49 +0200 | [diff] [blame] | 1287 | * weston_transforms linked into the list, you must call |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1288 | * weston_view_geometry_dirty(). |
Pekka Paalanen | 44ab69c | 2012-02-07 13:18:00 +0200 | [diff] [blame] | 1289 | * |
| 1290 | * The order in the list defines the order of transformations. Let the list |
| 1291 | * contain the transformation matrices M1, ..., Mn as head to tail. The |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1292 | * transformation is applied to view-local coordinate vector p as |
Pekka Paalanen | 44ab69c | 2012-02-07 13:18:00 +0200 | [diff] [blame] | 1293 | * P = Mn * ... * M2 * M1 * p |
| 1294 | * to produce the global coordinate vector P. The total transform |
| 1295 | * Mn * ... * M2 * M1 |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1296 | * is cached in view->transform.matrix, and the inverse of it in |
| 1297 | * view->transform.inverse. |
Pekka Paalanen | 44ab69c | 2012-02-07 13:18:00 +0200 | [diff] [blame] | 1298 | * |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1299 | * The list always contains view->transform.position transformation, which |
| 1300 | * is the translation by view->geometry.x and y. |
Pekka Paalanen | 44ab69c | 2012-02-07 13:18:00 +0200 | [diff] [blame] | 1301 | * |
| 1302 | * If you want to apply a transformation in local coordinates, add your |
| 1303 | * weston_transform to the head of the list. If you want to apply a |
| 1304 | * transformation in global coordinates, add it to the tail of the list. |
Pekka Paalanen | 483243f | 2013-03-08 14:56:50 +0200 | [diff] [blame] | 1305 | * |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1306 | * If view->geometry.parent is set, the total transformation of this |
| 1307 | * view will be the parent's total transformation and this transformation |
Pekka Paalanen | 483243f | 2013-03-08 14:56:50 +0200 | [diff] [blame] | 1308 | * combined: |
| 1309 | * Mparent * Mn * ... * M2 * M1 |
Pekka Paalanen | 44ab69c | 2012-02-07 13:18:00 +0200 | [diff] [blame] | 1310 | */ |
| 1311 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1312 | struct weston_view { |
| 1313 | struct weston_surface *surface; |
| 1314 | struct wl_list surface_link; |
Jason Ekstrand | 26ed73c | 2013-06-06 22:34:41 -0500 | [diff] [blame] | 1315 | struct wl_signal destroy_signal; |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1316 | |
Pekka Paalanen | 1a4f87d | 2021-04-30 14:48:52 +0300 | [diff] [blame] | 1317 | /* struct weston_paint_node::view_link */ |
| 1318 | struct wl_list paint_node_list; |
| 1319 | |
Pekka Paalanen | 20c7e55 | 2016-03-30 14:08:24 +0300 | [diff] [blame] | 1320 | struct wl_list link; /* weston_compositor::view_list */ |
Pekka Paalanen | 8844bf2 | 2015-02-18 16:30:47 +0200 | [diff] [blame] | 1321 | struct weston_layer_entry layer_link; /* part of geometry */ |
Kristian Høgsberg | 65a11e1 | 2012-08-03 11:30:18 -0400 | [diff] [blame] | 1322 | struct weston_plane *plane; |
Pekka Paalanen | 2d6e551 | 2015-02-18 16:06:46 +0200 | [diff] [blame] | 1323 | |
| 1324 | /* For weston_layer inheritance from another view */ |
Giulio Camuffo | 95ec0f9 | 2014-07-09 22:12:57 +0300 | [diff] [blame] | 1325 | struct weston_view *parent_view; |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1326 | |
Jonas Ådahl | 94e2e2d | 2014-10-18 18:42:19 +0200 | [diff] [blame] | 1327 | unsigned int click_to_activate_serial; |
| 1328 | |
Pekka Paalanen | 51723d5 | 2015-02-17 13:10:01 +0200 | [diff] [blame] | 1329 | pixman_region32_t clip; /* See weston_view_damage_below() */ |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1330 | float alpha; /* part of geometry, see below */ |
leng.fang | dbaf6fa | 2024-06-20 19:31:04 +0800 | [diff] [blame^] | 1331 | bool visible; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1332 | |
Pekka Paalanen | bc0b7e7 | 2012-01-24 09:53:37 +0200 | [diff] [blame] | 1333 | /* Surface geometry state, mutable. |
Pekka Paalanen | c3ce738 | 2013-03-08 14:56:49 +0200 | [diff] [blame] | 1334 | * If you change anything, call weston_surface_geometry_dirty(). |
Pekka Paalanen | bc0b7e7 | 2012-01-24 09:53:37 +0200 | [diff] [blame] | 1335 | * That includes the transformations referenced from the list. |
| 1336 | */ |
Pekka Paalanen | c61eca6 | 2012-01-06 14:10:06 +0200 | [diff] [blame] | 1337 | struct { |
John Kåre Alsaker | 490d02a | 2012-09-30 02:57:21 +0200 | [diff] [blame] | 1338 | float x, y; /* surface translation on display */ |
Pekka Paalanen | ba3cf95 | 2012-01-25 16:22:05 +0200 | [diff] [blame] | 1339 | |
Pekka Paalanen | bc0b7e7 | 2012-01-24 09:53:37 +0200 | [diff] [blame] | 1340 | /* struct weston_transform */ |
| 1341 | struct wl_list transformation_list; |
Pekka Paalanen | 483243f | 2013-03-08 14:56:50 +0200 | [diff] [blame] | 1342 | |
Pekka Paalanen | 90687e1 | 2022-01-24 14:09:57 +0200 | [diff] [blame] | 1343 | /* managed by weston_view_set_transform_parent() */ |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1344 | struct weston_view *parent; |
Pekka Paalanen | 483243f | 2013-03-08 14:56:50 +0200 | [diff] [blame] | 1345 | struct wl_listener parent_destroy_listener; |
| 1346 | struct wl_list child_list; /* geometry.parent_link */ |
| 1347 | struct wl_list parent_link; |
Pekka Paalanen | 380adf5 | 2015-02-16 14:39:11 +0200 | [diff] [blame] | 1348 | |
| 1349 | /* managed by weston_view_set_mask() */ |
| 1350 | bool scissor_enabled; |
| 1351 | pixman_region32_t scissor; /* always a simple rect */ |
Pekka Paalanen | bc0b7e7 | 2012-01-24 09:53:37 +0200 | [diff] [blame] | 1352 | } geometry; |
| 1353 | |
| 1354 | /* State derived from geometry state, read-only. |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1355 | * This is updated by weston_view_update_transform(). |
Pekka Paalanen | bc0b7e7 | 2012-01-24 09:53:37 +0200 | [diff] [blame] | 1356 | */ |
| 1357 | struct { |
Pekka Paalanen | c3ce738 | 2013-03-08 14:56:49 +0200 | [diff] [blame] | 1358 | int dirty; |
| 1359 | |
Pekka Paalanen | fbd00f1 | 2015-02-19 11:49:18 +0200 | [diff] [blame] | 1360 | /* Approximations in global coordinates: |
| 1361 | * - boundingbox is guaranteed to include the whole view in |
| 1362 | * the smallest possible single rectangle. |
| 1363 | * - opaque is guaranteed to be fully opaque, though not |
| 1364 | * necessarily include all opaque areas. |
| 1365 | */ |
Pekka Paalanen | 6720d8f | 2012-01-25 15:17:40 +0200 | [diff] [blame] | 1366 | pixman_region32_t boundingbox; |
Pekka Paalanen | 730d87e | 2012-02-09 16:39:38 +0200 | [diff] [blame] | 1367 | pixman_region32_t opaque; |
Pekka Paalanen | 6720d8f | 2012-01-25 15:17:40 +0200 | [diff] [blame] | 1368 | |
Pekka Paalanen | bc0b7e7 | 2012-01-24 09:53:37 +0200 | [diff] [blame] | 1369 | /* matrix and inverse are used only if enabled = 1. |
| 1370 | * If enabled = 0, use x, y, width, height directly. |
| 1371 | */ |
| 1372 | int enabled; |
Pekka Paalanen | 061b747 | 2012-01-12 15:00:57 +0200 | [diff] [blame] | 1373 | struct weston_matrix matrix; |
Pekka Paalanen | d1f0ab6 | 2012-01-20 10:47:57 +0200 | [diff] [blame] | 1374 | struct weston_matrix inverse; |
Pekka Paalanen | cd40362 | 2012-01-25 13:37:39 +0200 | [diff] [blame] | 1375 | |
| 1376 | struct weston_transform position; /* matrix from x, y */ |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 1377 | #ifdef MESON_VIDEO_PLAN_SUPPORT |
| 1378 | pixman_region32_t transparent; |
| 1379 | #endif |
Pekka Paalanen | c61eca6 | 2012-01-06 14:10:06 +0200 | [diff] [blame] | 1380 | } transform; |
| 1381 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1382 | /* |
Pekka Paalanen | 130ae6e | 2016-03-30 14:33:33 +0300 | [diff] [blame] | 1383 | * The primary output for this view. |
| 1384 | * Used for picking the output for driving internal animations on the |
| 1385 | * view, inheriting the primary output for related views in shells, etc. |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1386 | */ |
| 1387 | struct weston_output *output; |
Semi Malinen | e7a52fb | 2018-04-26 11:08:10 +0200 | [diff] [blame] | 1388 | struct wl_listener output_destroy_listener; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1389 | |
Casey Dahlin | 9074db5 | 2012-04-19 22:50:09 -0400 | [diff] [blame] | 1390 | /* |
| 1391 | * A more complete representation of all outputs this surface is |
| 1392 | * displayed on. |
| 1393 | */ |
| 1394 | uint32_t output_mask; |
Pekka Paalanen | bf0e031 | 2014-12-17 16:20:41 +0200 | [diff] [blame] | 1395 | |
| 1396 | /* Per-surface Presentation feedback flags, controlled by backend. */ |
| 1397 | uint32_t psf_flags; |
Armin Krezović | f8486c3 | 2016-06-30 06:04:28 +0200 | [diff] [blame] | 1398 | |
| 1399 | bool is_mapped; |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1400 | }; |
| 1401 | |
Jason Ekstrand | 7b98207 | 2014-05-20 14:33:03 -0500 | [diff] [blame] | 1402 | struct weston_surface_state { |
| 1403 | /* wl_surface.attach */ |
| 1404 | int newly_attached; |
| 1405 | struct weston_buffer *buffer; |
| 1406 | struct wl_listener buffer_destroy_listener; |
| 1407 | int32_t sx; |
| 1408 | int32_t sy; |
| 1409 | |
| 1410 | /* wl_surface.damage */ |
Derek Foreman | 152254b | 2015-11-26 14:17:48 -0600 | [diff] [blame] | 1411 | pixman_region32_t damage_surface; |
| 1412 | /* wl_surface.damage_buffer */ |
| 1413 | pixman_region32_t damage_buffer; |
Jason Ekstrand | 7b98207 | 2014-05-20 14:33:03 -0500 | [diff] [blame] | 1414 | |
| 1415 | /* wl_surface.set_opaque_region */ |
| 1416 | pixman_region32_t opaque; |
| 1417 | |
| 1418 | /* wl_surface.set_input_region */ |
| 1419 | pixman_region32_t input; |
| 1420 | |
| 1421 | /* wl_surface.frame */ |
| 1422 | struct wl_list frame_callback_list; |
| 1423 | |
Pekka Paalanen | 133e439 | 2014-09-23 22:08:46 -0400 | [diff] [blame] | 1424 | /* presentation.feedback */ |
| 1425 | struct wl_list feedback_list; |
| 1426 | |
Jason Ekstrand | 7b98207 | 2014-05-20 14:33:03 -0500 | [diff] [blame] | 1427 | /* wl_surface.set_buffer_transform */ |
| 1428 | /* wl_surface.set_scaling_factor */ |
Pekka Paalanen | e95ad5c | 2016-04-15 14:47:08 +0300 | [diff] [blame] | 1429 | /* wp_viewport.set_source */ |
| 1430 | /* wp_viewport.set_destination */ |
Jason Ekstrand | 7b98207 | 2014-05-20 14:33:03 -0500 | [diff] [blame] | 1431 | struct weston_buffer_viewport buffer_viewport; |
Alexandros Frantzis | acff29b | 2018-10-19 12:14:11 +0300 | [diff] [blame] | 1432 | |
| 1433 | /* zwp_surface_synchronization_v1.set_acquire_fence */ |
| 1434 | int acquire_fence_fd; |
Alexandros Frantzis | 6762967 | 2018-10-19 12:14:11 +0300 | [diff] [blame] | 1435 | |
| 1436 | /* zwp_surface_synchronization_v1.get_release */ |
| 1437 | struct weston_buffer_release_reference buffer_release_ref; |
Ankit Nautiyal | 4b6e73d | 2019-03-26 13:37:12 +0530 | [diff] [blame] | 1438 | |
| 1439 | /* weston_protected_surface.set_type */ |
| 1440 | enum weston_hdcp_protection desired_protection; |
Ankit Nautiyal | 5cfe03c | 2019-03-28 15:05:42 +0530 | [diff] [blame] | 1441 | |
| 1442 | /* weston_protected_surface.enforced/relaxed */ |
| 1443 | enum weston_surface_protection_mode protection_mode; |
Jason Ekstrand | 7b98207 | 2014-05-20 14:33:03 -0500 | [diff] [blame] | 1444 | }; |
| 1445 | |
Jonas Ådahl | f7deb6a | 2016-07-22 17:50:26 +0800 | [diff] [blame] | 1446 | struct weston_surface_activation_data { |
| 1447 | struct weston_surface *surface; |
| 1448 | struct weston_seat *seat; |
| 1449 | }; |
| 1450 | |
Jonas Ådahl | d3414f2 | 2016-07-22 17:56:31 +0800 | [diff] [blame] | 1451 | struct weston_pointer_constraint { |
| 1452 | struct wl_list link; |
| 1453 | |
| 1454 | struct weston_surface *surface; |
| 1455 | struct weston_view *view; |
| 1456 | struct wl_resource *resource; |
| 1457 | struct weston_pointer_grab grab; |
| 1458 | struct weston_pointer *pointer; |
| 1459 | uint32_t lifetime; |
| 1460 | |
| 1461 | pixman_region32_t region; |
| 1462 | pixman_region32_t region_pending; |
| 1463 | bool region_is_pending; |
| 1464 | |
| 1465 | wl_fixed_t hint_x; |
| 1466 | wl_fixed_t hint_y; |
| 1467 | wl_fixed_t hint_x_pending; |
| 1468 | wl_fixed_t hint_y_pending; |
| 1469 | bool hint_is_pending; |
| 1470 | |
| 1471 | struct wl_listener pointer_destroy_listener; |
| 1472 | struct wl_listener surface_destroy_listener; |
| 1473 | struct wl_listener surface_commit_listener; |
| 1474 | struct wl_listener surface_activate_listener; |
| 1475 | }; |
| 1476 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1477 | struct weston_surface { |
| 1478 | struct wl_resource *resource; |
Pekka Paalanen | ca79076 | 2015-04-17 14:23:38 +0300 | [diff] [blame] | 1479 | struct wl_signal destroy_signal; /* callback argument: this surface */ |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1480 | struct weston_compositor *compositor; |
Jonas Ådahl | 5d9ca27 | 2016-07-22 17:48:03 +0800 | [diff] [blame] | 1481 | struct wl_signal commit_signal; |
Pekka Paalanen | e508ce6 | 2015-02-19 13:59:55 +0200 | [diff] [blame] | 1482 | |
Pekka Paalanen | 1a4f87d | 2021-04-30 14:48:52 +0300 | [diff] [blame] | 1483 | /* struct weston_paint_node::surface_link */ |
| 1484 | struct wl_list paint_node_list; |
| 1485 | |
Pekka Paalanen | e508ce6 | 2015-02-19 13:59:55 +0200 | [diff] [blame] | 1486 | /** Damage in local coordinates from the client, for tex upload. */ |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1487 | pixman_region32_t damage; |
Pekka Paalanen | e508ce6 | 2015-02-19 13:59:55 +0200 | [diff] [blame] | 1488 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1489 | pixman_region32_t opaque; /* part of geometry, see below */ |
| 1490 | pixman_region32_t input; |
| 1491 | int32_t width, height; |
| 1492 | int32_t ref_count; |
| 1493 | |
| 1494 | /* Not for long-term storage. This exists for book-keeping while |
| 1495 | * iterating over surfaces and views |
| 1496 | */ |
Derek Foreman | 060cf11 | 2015-11-18 16:32:26 -0600 | [diff] [blame] | 1497 | bool touched; |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1498 | |
| 1499 | void *renderer_state; |
| 1500 | |
| 1501 | struct wl_list views; |
| 1502 | |
| 1503 | /* |
| 1504 | * Which output to vsync this surface to. |
Pekka Paalanen | 130ae6e | 2016-03-30 14:33:33 +0300 | [diff] [blame] | 1505 | * Used to determine whether to send or queue frame events, and for |
| 1506 | * other client-visible syncing/throttling tied to the output |
| 1507 | * repaint cycle. |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1508 | */ |
| 1509 | struct weston_output *output; |
| 1510 | |
| 1511 | /* |
| 1512 | * A more complete representation of all outputs this surface is |
| 1513 | * displayed on. |
| 1514 | */ |
| 1515 | uint32_t output_mask; |
Casey Dahlin | 9074db5 | 2012-04-19 22:50:09 -0400 | [diff] [blame] | 1516 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1517 | struct wl_list frame_callback_list; |
Pekka Paalanen | 133e439 | 2014-09-23 22:08:46 -0400 | [diff] [blame] | 1518 | struct wl_list feedback_list; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1519 | |
Pekka Paalanen | de685b8 | 2012-12-04 15:58:12 +0200 | [diff] [blame] | 1520 | struct weston_buffer_reference buffer_ref; |
Pekka Paalanen | 1fd9c0f | 2013-11-26 18:19:41 +0100 | [diff] [blame] | 1521 | struct weston_buffer_viewport buffer_viewport; |
Pekka Paalanen | 0b4c535 | 2014-03-14 14:38:17 +0200 | [diff] [blame] | 1522 | int32_t width_from_buffer; /* before applying viewport */ |
| 1523 | int32_t height_from_buffer; |
Derek Foreman | 0fd6d4e | 2014-10-10 09:36:45 -0500 | [diff] [blame] | 1524 | bool keep_buffer; /* for backends to prevent early release */ |
Alex Wu | 8811bf9 | 2012-02-28 18:07:54 +0800 | [diff] [blame] | 1525 | |
Pekka Paalanen | e95ad5c | 2016-04-15 14:47:08 +0300 | [diff] [blame] | 1526 | /* wp_viewport resource for this surface */ |
Pekka Paalanen | b0420ae | 2014-01-08 15:39:17 +0200 | [diff] [blame] | 1527 | struct wl_resource *viewport_resource; |
Jonny Lamb | 7413076 | 2013-11-26 18:19:46 +0100 | [diff] [blame] | 1528 | |
Pekka Paalanen | 5df44de | 2012-10-10 12:49:23 +0300 | [diff] [blame] | 1529 | /* All the pending state, that wl_surface.commit will apply. */ |
Jason Ekstrand | 7b98207 | 2014-05-20 14:33:03 -0500 | [diff] [blame] | 1530 | struct weston_surface_state pending; |
Pekka Paalanen | 5df44de | 2012-10-10 12:49:23 +0300 | [diff] [blame] | 1531 | |
Maxime Roussin-Bélanger | 1d009c2 | 2020-12-17 17:10:13 -0500 | [diff] [blame] | 1532 | /* Matrices representing of the full transformation between |
Jason Ekstrand | 1e05904 | 2014-10-16 10:55:19 -0500 | [diff] [blame] | 1533 | * buffer and surface coordinates. These matrices are updated |
| 1534 | * using the weston_surface_build_buffer_matrix function. */ |
| 1535 | struct weston_matrix buffer_to_surface_matrix; |
| 1536 | struct weston_matrix surface_to_buffer_matrix; |
| 1537 | |
Ander Conselvan de Oliveira | 093bfa3 | 2012-03-27 17:36:41 +0300 | [diff] [blame] | 1538 | /* |
Jasper St. Pierre | d67b52a | 2014-04-28 11:19:27 -0400 | [diff] [blame] | 1539 | * If non-NULL, this function will be called on |
| 1540 | * wl_surface::commit after a new buffer has been set up for |
| 1541 | * this surface. The integer params are the sx and sy |
| 1542 | * parameters supplied to wl_surface::attach. |
Ander Conselvan de Oliveira | 093bfa3 | 2012-03-27 17:36:41 +0300 | [diff] [blame] | 1543 | */ |
Quentin Glidic | 2edc3d5 | 2016-08-12 10:41:33 +0200 | [diff] [blame] | 1544 | void (*committed)(struct weston_surface *es, int32_t sx, int32_t sy); |
| 1545 | void *committed_private; |
Pekka Paalanen | 8274d90 | 2014-08-06 19:36:51 +0300 | [diff] [blame] | 1546 | int (*get_label)(struct weston_surface *surface, char *buf, size_t len); |
Pekka Paalanen | e67858b | 2013-04-25 13:57:42 +0300 | [diff] [blame] | 1547 | |
| 1548 | /* Parent's list of its sub-surfaces, weston_subsurface:parent_link. |
| 1549 | * Contains also the parent itself as a dummy weston_subsurface, |
| 1550 | * if the list is not empty. |
| 1551 | */ |
| 1552 | struct wl_list subsurface_list; /* weston_subsurface::parent_link */ |
| 1553 | struct wl_list subsurface_list_pending; /* ...::parent_link_pending */ |
Pekka Paalanen | 50b6747 | 2014-10-01 15:02:41 +0300 | [diff] [blame] | 1554 | |
| 1555 | /* |
| 1556 | * For tracking protocol role assignments. Different roles may |
| 1557 | * have the same configure hook, e.g. in shell.c. Configure hook |
| 1558 | * may get reset, this will not. |
| 1559 | * XXX: map configure functions 1:1 to roles, and never reset it, |
| 1560 | * and replace role_name with configure. |
| 1561 | */ |
| 1562 | const char *role_name; |
Pekka Paalanen | b502654 | 2014-11-12 15:09:24 +0200 | [diff] [blame] | 1563 | |
leng.fang | dbaf6fa | 2024-06-20 19:31:04 +0800 | [diff] [blame^] | 1564 | int surface_id; |
| 1565 | const char *name; |
| 1566 | bool visible; |
| 1567 | int32_t x; |
| 1568 | int32_t y; |
| 1569 | float opacity; |
| 1570 | int32_t zorder; |
| 1571 | |
Armin Krezović | f8486c3 | 2016-06-30 06:04:28 +0200 | [diff] [blame] | 1572 | bool is_mapped; |
Philipp Zabel | 195dade | 2018-09-03 19:44:59 +0200 | [diff] [blame] | 1573 | bool is_opaque; |
Jonas Ådahl | d3414f2 | 2016-07-22 17:56:31 +0800 | [diff] [blame] | 1574 | |
| 1575 | /* An list of per seat pointer constraints. */ |
| 1576 | struct wl_list pointer_constraints; |
Alexandros Frantzis | 27d7c39 | 2018-10-19 12:14:11 +0300 | [diff] [blame] | 1577 | |
| 1578 | /* zwp_surface_synchronization_v1 resource for this surface */ |
| 1579 | struct wl_resource *synchronization_resource; |
Alexandros Frantzis | acff29b | 2018-10-19 12:14:11 +0300 | [diff] [blame] | 1580 | int acquire_fence_fd; |
Alexandros Frantzis | 6762967 | 2018-10-19 12:14:11 +0300 | [diff] [blame] | 1581 | struct weston_buffer_release_reference buffer_release_ref; |
Ankit Nautiyal | 4b6e73d | 2019-03-26 13:37:12 +0530 | [diff] [blame] | 1582 | |
Leandro Ribeiro | 8eb8414 | 2021-01-18 19:36:48 -0300 | [diff] [blame] | 1583 | struct weston_dmabuf_feedback *dmabuf_feedback; |
| 1584 | |
Ankit Nautiyal | 4b6e73d | 2019-03-26 13:37:12 +0530 | [diff] [blame] | 1585 | enum weston_hdcp_protection desired_protection; |
Ankit Nautiyal | 5cfe03c | 2019-03-28 15:05:42 +0530 | [diff] [blame] | 1586 | enum weston_hdcp_protection current_protection; |
| 1587 | enum weston_surface_protection_mode protection_mode; |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 1588 | |
| 1589 | #if MESON_VIDEO_PLAN_SUPPORT |
| 1590 | /* use this flag to mark video surface of amlogic |
| 1591 | * which surface mark as video surface need full fit with: |
| 1592 | * 1. is dmabuffer which need dri, for avoid memory/bus bandwidth increase by buffer. |
| 1593 | * 2. is YUV format. (for amlogic video plane it below primary plane (zpos can't effect for this situation) |
| 1594 | */ |
| 1595 | bool is_video_surface; |
| 1596 | // client will assign video path for current video surface |
| 1597 | int video_plane; |
| 1598 | |
| 1599 | #endif |
| 1600 | struct wl_list link; |
| 1601 | int queue_size; |
| 1602 | int queue_capacity; |
| 1603 | void* commit_queue; |
| 1604 | bool keep_last_frame; |
| 1605 | int frameN; |
| 1606 | uint64_t commit_time; |
| 1607 | struct weston_plane* plane; |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1608 | }; |
| 1609 | |
Jason Ekstrand | e9d40e3 | 2014-05-20 11:23:53 -0500 | [diff] [blame] | 1610 | struct weston_subsurface { |
| 1611 | struct wl_resource *resource; |
| 1612 | |
| 1613 | /* guaranteed to be valid and non-NULL */ |
| 1614 | struct weston_surface *surface; |
| 1615 | struct wl_listener surface_destroy_listener; |
| 1616 | |
| 1617 | /* can be NULL */ |
| 1618 | struct weston_surface *parent; |
| 1619 | struct wl_listener parent_destroy_listener; |
| 1620 | struct wl_list parent_link; |
| 1621 | struct wl_list parent_link_pending; |
| 1622 | |
| 1623 | struct { |
| 1624 | int32_t x; |
| 1625 | int32_t y; |
| 1626 | int set; |
| 1627 | } position; |
| 1628 | |
Jason Ekstrand | 7b98207 | 2014-05-20 14:33:03 -0500 | [diff] [blame] | 1629 | int has_cached_data; |
| 1630 | struct weston_surface_state cached; |
| 1631 | struct weston_buffer_reference cached_buffer_ref; |
Jason Ekstrand | e9d40e3 | 2014-05-20 11:23:53 -0500 | [diff] [blame] | 1632 | |
Emilio Pozuelo Monfort | 4f3cad7 | 2017-01-27 17:30:29 +0100 | [diff] [blame] | 1633 | /* Sub-surface has been reordered; need to apply damage. */ |
| 1634 | bool reordered; |
| 1635 | |
Jason Ekstrand | e9d40e3 | 2014-05-20 11:23:53 -0500 | [diff] [blame] | 1636 | int synchronized; |
| 1637 | |
| 1638 | /* Used for constructing the view tree */ |
| 1639 | struct wl_list unused_views; |
| 1640 | }; |
| 1641 | |
Ankit Nautiyal | 5cfe03c | 2019-03-28 15:05:42 +0530 | [diff] [blame] | 1642 | struct protected_surface { |
| 1643 | struct weston_surface *surface; |
| 1644 | struct wl_listener surface_destroy_listener; |
| 1645 | struct wl_list link; |
| 1646 | struct wl_resource *protection_resource; |
| 1647 | struct content_protection *cp_backptr; |
| 1648 | }; |
| 1649 | |
| 1650 | struct content_protection { |
| 1651 | struct weston_compositor *compositor; |
| 1652 | struct wl_listener destroy_listener; |
| 1653 | struct weston_log_scope *debug; |
| 1654 | struct wl_list protected_list; |
Ankit Nautiyal | f74c35b | 2019-04-03 19:21:58 +0530 | [diff] [blame] | 1655 | struct wl_event_source *surface_protection_update; |
Ankit Nautiyal | 5cfe03c | 2019-03-28 15:05:42 +0530 | [diff] [blame] | 1656 | }; |
| 1657 | |
| 1658 | |
Daniel Stone | d6da09e | 2012-06-22 13:21:29 +0100 | [diff] [blame] | 1659 | enum weston_key_state_update { |
| 1660 | STATE_UPDATE_AUTOMATIC, |
| 1661 | STATE_UPDATE_NONE, |
| 1662 | }; |
| 1663 | |
Jonas Ådahl | 4361b4e | 2014-10-18 18:20:16 +0200 | [diff] [blame] | 1664 | enum weston_activate_flag { |
| 1665 | WESTON_ACTIVATE_FLAG_NONE = 0, |
| 1666 | WESTON_ACTIVATE_FLAG_CONFIGURE = 1 << 0, |
Jonas Ådahl | 94e2e2d | 2014-10-18 18:42:19 +0200 | [diff] [blame] | 1667 | WESTON_ACTIVATE_FLAG_CLICKED = 1 << 1, |
Jonas Ådahl | 4361b4e | 2014-10-18 18:20:16 +0200 | [diff] [blame] | 1668 | }; |
| 1669 | |
Kristian Høgsberg | 9ddb826 | 2012-01-04 21:30:29 -0500 | [diff] [blame] | 1670 | void |
Kristian Høgsberg | af4f2aa | 2013-02-15 20:53:20 -0500 | [diff] [blame] | 1671 | weston_version(int *major, int *minor, int *micro); |
| 1672 | |
| 1673 | void |
Semi Malinen | e7a52fb | 2018-04-26 11:08:10 +0200 | [diff] [blame] | 1674 | weston_view_set_output(struct weston_view *view, struct weston_output *output); |
| 1675 | |
| 1676 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1677 | weston_view_update_transform(struct weston_view *view); |
Pekka Paalanen | 460099f | 2012-01-20 16:48:25 +0200 | [diff] [blame] | 1678 | |
| 1679 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1680 | weston_view_geometry_dirty(struct weston_view *view); |
Pekka Paalanen | c3ce738 | 2013-03-08 14:56:49 +0200 | [diff] [blame] | 1681 | |
| 1682 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1683 | weston_view_to_global_float(struct weston_view *view, |
| 1684 | float sx, float sy, float *x, float *y); |
Pekka Paalanen | e0f3cb2 | 2012-01-24 09:59:29 +0200 | [diff] [blame] | 1685 | |
| 1686 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1687 | weston_view_from_global(struct weston_view *view, |
| 1688 | int32_t x, int32_t y, int32_t *vx, int32_t *vy); |
Daniel Stone | bd3489b | 2012-05-08 17:17:53 +0100 | [diff] [blame] | 1689 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1690 | weston_view_from_global_fixed(struct weston_view *view, |
| 1691 | wl_fixed_t x, wl_fixed_t y, |
| 1692 | wl_fixed_t *vx, wl_fixed_t *vy); |
Pekka Paalanen | e0f3cb2 | 2012-01-24 09:59:29 +0200 | [diff] [blame] | 1693 | |
Derek Foreman | d1be312 | 2014-09-18 16:46:49 -0500 | [diff] [blame] | 1694 | void |
Marius Vlad | d6ccc8b | 2021-03-05 22:07:30 +0200 | [diff] [blame] | 1695 | weston_view_activate_input(struct weston_view *view, |
| 1696 | struct weston_seat *seat, |
| 1697 | uint32_t flags); |
Jonas Ådahl | 94e2e2d | 2014-10-18 18:42:19 +0200 | [diff] [blame] | 1698 | |
| 1699 | void |
Kristian Høgsberg | cb3eaae | 2012-08-10 09:50:11 -0400 | [diff] [blame] | 1700 | notify_modifiers(struct weston_seat *seat, uint32_t serial); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1701 | |
| 1702 | void |
Giulio Camuffo | 412e6a5 | 2014-07-09 22:12:56 +0300 | [diff] [blame] | 1703 | weston_layer_entry_insert(struct weston_layer_entry *list, |
| 1704 | struct weston_layer_entry *entry); |
| 1705 | void |
| 1706 | weston_layer_entry_remove(struct weston_layer_entry *entry); |
| 1707 | void |
Quentin Glidic | 8268157 | 2016-12-17 13:40:51 +0100 | [diff] [blame] | 1708 | weston_layer_init(struct weston_layer *layer, |
| 1709 | struct weston_compositor *compositor); |
| 1710 | void |
Pekka Paalanen | 8740037 | 2021-05-14 14:29:40 +0300 | [diff] [blame] | 1711 | weston_layer_fini(struct weston_layer *layer); |
| 1712 | void |
Quentin Glidic | 8268157 | 2016-12-17 13:40:51 +0100 | [diff] [blame] | 1713 | weston_layer_set_position(struct weston_layer *layer, |
| 1714 | enum weston_layer_position position); |
| 1715 | void |
| 1716 | weston_layer_unset_position(struct weston_layer *layer); |
Kristian Høgsberg | 3be2ce9 | 2012-02-29 12:42:35 -0500 | [diff] [blame] | 1717 | |
| 1718 | void |
Giulio Camuffo | 95ec0f9 | 2014-07-09 22:12:57 +0300 | [diff] [blame] | 1719 | weston_layer_set_mask(struct weston_layer *layer, int x, int y, int width, int height); |
| 1720 | |
| 1721 | void |
| 1722 | weston_layer_set_mask_infinite(struct weston_layer *layer); |
| 1723 | |
Daniel Stone | 3b77563 | 2018-07-20 08:38:25 +0100 | [diff] [blame] | 1724 | bool |
| 1725 | weston_layer_mask_is_infinite(struct weston_layer *layer); |
| 1726 | |
Pekka Paalanen | 363aa7b | 2014-12-17 16:20:40 +0200 | [diff] [blame] | 1727 | /* An invalid flag in presented_flags to catch logic errors. */ |
Pekka Paalanen | b00c79b | 2016-02-18 16:53:27 +0200 | [diff] [blame] | 1728 | #define WP_PRESENTATION_FEEDBACK_INVALID (1U << 31) |
Pekka Paalanen | 363aa7b | 2014-12-17 16:20:40 +0200 | [diff] [blame] | 1729 | |
Ander Conselvan de Oliveira | 8ad1982 | 2013-03-05 17:30:27 +0200 | [diff] [blame] | 1730 | void |
Kristian Høgsberg | 49952d1 | 2012-06-20 00:35:59 -0400 | [diff] [blame] | 1731 | weston_output_schedule_repaint(struct weston_output *output); |
| 1732 | void |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1733 | weston_compositor_schedule_repaint(struct weston_compositor *compositor); |
| 1734 | void |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1735 | weston_compositor_damage_all(struct weston_compositor *compositor); |
| 1736 | void |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1737 | weston_compositor_wake(struct weston_compositor *compositor); |
| 1738 | void |
Ander Conselvan de Oliveira | 87524b6 | 2013-02-21 18:35:22 +0200 | [diff] [blame] | 1739 | weston_compositor_sleep(struct weston_compositor *compositor); |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1740 | struct weston_view * |
| 1741 | weston_compositor_pick_view(struct weston_compositor *compositor, |
| 1742 | wl_fixed_t x, wl_fixed_t y, |
| 1743 | wl_fixed_t *sx, wl_fixed_t *sy); |
Ander Conselvan de Oliveira | 30eebc7 | 2012-02-15 17:02:57 +0200 | [diff] [blame] | 1744 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1745 | |
| 1746 | struct weston_binding; |
Derek Foreman | 8ae2db5 | 2015-07-15 13:00:36 -0500 | [diff] [blame] | 1747 | typedef void (*weston_key_binding_handler_t)(struct weston_keyboard *keyboard, |
Alexandros Frantzis | 47e79c8 | 2017-11-16 18:20:57 +0200 | [diff] [blame] | 1748 | const struct timespec *time, |
| 1749 | uint32_t key, |
Daniel Stone | 325fc2d | 2012-05-30 16:31:58 +0100 | [diff] [blame] | 1750 | void *data); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1751 | struct weston_binding * |
Daniel Stone | 325fc2d | 2012-05-30 16:31:58 +0100 | [diff] [blame] | 1752 | weston_compositor_add_key_binding(struct weston_compositor *compositor, |
| 1753 | uint32_t key, |
| 1754 | enum weston_keyboard_modifier modifier, |
| 1755 | weston_key_binding_handler_t binding, |
| 1756 | void *data); |
Marius Vlad | 3ee9d8e | 2019-07-18 11:01:51 +0300 | [diff] [blame] | 1757 | struct weston_binding * |
| 1758 | weston_compositor_add_debug_binding(struct weston_compositor *compositor, |
| 1759 | uint32_t key, |
| 1760 | weston_key_binding_handler_t binding, |
| 1761 | void *data); |
Daniel Stone | 325fc2d | 2012-05-30 16:31:58 +0100 | [diff] [blame] | 1762 | |
Derek Foreman | 8ae2db5 | 2015-07-15 13:00:36 -0500 | [diff] [blame] | 1763 | typedef void (*weston_modifier_binding_handler_t)(struct weston_keyboard *keyboard, |
Daniel Stone | 96d47c0 | 2013-11-19 11:37:12 +0100 | [diff] [blame] | 1764 | enum weston_keyboard_modifier modifier, |
| 1765 | void *data); |
| 1766 | struct weston_binding * |
| 1767 | weston_compositor_add_modifier_binding(struct weston_compositor *compositor, |
| 1768 | enum weston_keyboard_modifier modifier, |
| 1769 | weston_modifier_binding_handler_t binding, |
| 1770 | void *data); |
| 1771 | |
Derek Foreman | 8ae2db5 | 2015-07-15 13:00:36 -0500 | [diff] [blame] | 1772 | typedef void (*weston_button_binding_handler_t)(struct weston_pointer *pointer, |
Alexandros Frantzis | 215bedc | 2017-11-16 18:20:55 +0200 | [diff] [blame] | 1773 | const struct timespec *time, |
| 1774 | uint32_t button, |
Daniel Stone | 325fc2d | 2012-05-30 16:31:58 +0100 | [diff] [blame] | 1775 | void *data); |
| 1776 | struct weston_binding * |
| 1777 | weston_compositor_add_button_binding(struct weston_compositor *compositor, |
| 1778 | uint32_t button, |
| 1779 | enum weston_keyboard_modifier modifier, |
| 1780 | weston_button_binding_handler_t binding, |
| 1781 | void *data); |
| 1782 | |
Derek Foreman | 8ae2db5 | 2015-07-15 13:00:36 -0500 | [diff] [blame] | 1783 | typedef void (*weston_touch_binding_handler_t)(struct weston_touch *touch, |
Alexandros Frantzis | 9448deb | 2017-11-16 18:20:58 +0200 | [diff] [blame] | 1784 | const struct timespec *time, |
Neil Roberts | a28c693 | 2013-10-03 16:43:04 +0100 | [diff] [blame] | 1785 | void *data); |
| 1786 | struct weston_binding * |
| 1787 | weston_compositor_add_touch_binding(struct weston_compositor *compositor, |
| 1788 | enum weston_keyboard_modifier modifier, |
| 1789 | weston_touch_binding_handler_t binding, |
| 1790 | void *data); |
| 1791 | |
Derek Foreman | 8ae2db5 | 2015-07-15 13:00:36 -0500 | [diff] [blame] | 1792 | typedef void (*weston_axis_binding_handler_t)(struct weston_pointer *pointer, |
Alexandros Frantzis | 8032194 | 2017-11-16 18:20:56 +0200 | [diff] [blame] | 1793 | const struct timespec *time, |
Peter Hutterer | 89b6a49 | 2016-01-18 15:58:17 +1000 | [diff] [blame] | 1794 | struct weston_pointer_axis_event *event, |
| 1795 | void *data); |
Daniel Stone | 325fc2d | 2012-05-30 16:31:58 +0100 | [diff] [blame] | 1796 | struct weston_binding * |
| 1797 | weston_compositor_add_axis_binding(struct weston_compositor *compositor, |
| 1798 | uint32_t axis, |
| 1799 | enum weston_keyboard_modifier modifier, |
| 1800 | weston_axis_binding_handler_t binding, |
| 1801 | void *data); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1802 | |
| 1803 | void |
sichem | ec8c876 | 2019-08-23 11:47:44 +0000 | [diff] [blame] | 1804 | weston_binding_destroy(struct weston_binding *binding); |
| 1805 | |
| 1806 | void |
Pekka Paalanen | 2829f7c | 2015-02-19 17:02:13 +0200 | [diff] [blame] | 1807 | weston_install_debug_key_binding(struct weston_compositor *compositor, |
| 1808 | uint32_t mod); |
| 1809 | |
| 1810 | void |
Giulio Camuffo | cdb4d29 | 2013-11-14 23:42:53 +0100 | [diff] [blame] | 1811 | weston_compositor_set_default_pointer_grab(struct weston_compositor *compositor, |
| 1812 | const struct weston_pointer_grab_interface *interface); |
| 1813 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1814 | struct weston_surface * |
Kristian Høgsberg | 18c9300 | 2012-01-27 11:58:31 -0500 | [diff] [blame] | 1815 | weston_surface_create(struct weston_compositor *compositor); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1816 | |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 1817 | void |
| 1818 | weston_release_stranded_buffers(); |
| 1819 | |
| 1820 | void |
| 1821 | weston_view_opacity(struct weston_view *view, float opacity); |
| 1822 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1823 | struct weston_view * |
| 1824 | weston_view_create(struct weston_surface *surface); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1825 | |
| 1826 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1827 | weston_view_destroy(struct weston_view *view); |
Kristian Høgsberg | 3be2ce9 | 2012-02-29 12:42:35 -0500 | [diff] [blame] | 1828 | |
| 1829 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1830 | weston_view_set_position(struct weston_view *view, |
| 1831 | float x, float y); |
| 1832 | |
| 1833 | void |
| 1834 | weston_view_set_transform_parent(struct weston_view *view, |
| 1835 | struct weston_view *parent); |
| 1836 | |
Pekka Paalanen | 380adf5 | 2015-02-16 14:39:11 +0200 | [diff] [blame] | 1837 | void |
| 1838 | weston_view_set_mask(struct weston_view *view, |
| 1839 | int x, int y, int width, int height); |
| 1840 | |
| 1841 | void |
| 1842 | weston_view_set_mask_infinite(struct weston_view *view); |
| 1843 | |
Derek Foreman | 280e7dd | 2014-10-03 13:13:42 -0500 | [diff] [blame] | 1844 | bool |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1845 | weston_view_is_mapped(struct weston_view *view); |
| 1846 | |
| 1847 | void |
| 1848 | weston_view_schedule_repaint(struct weston_view *view); |
Pekka Paalanen | 483243f | 2013-03-08 14:56:50 +0200 | [diff] [blame] | 1849 | |
Derek Foreman | 280e7dd | 2014-10-03 13:13:42 -0500 | [diff] [blame] | 1850 | bool |
Ander Conselvan de Oliveira | b8ab14f | 2012-03-27 17:36:36 +0300 | [diff] [blame] | 1851 | weston_surface_is_mapped(struct weston_surface *surface); |
| 1852 | |
Derek Foreman | d1be312 | 2014-09-18 16:46:49 -0500 | [diff] [blame] | 1853 | void |
Jason Ekstrand | 5c11a33 | 2013-12-04 20:32:03 -0600 | [diff] [blame] | 1854 | weston_surface_set_size(struct weston_surface *surface, |
| 1855 | int32_t width, int32_t height); |
| 1856 | |
Pekka Paalanen | 8fb8d3b | 2012-02-13 13:03:59 +0200 | [diff] [blame] | 1857 | void |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1858 | weston_surface_damage(struct weston_surface *surface); |
| 1859 | |
| 1860 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1861 | weston_view_damage_below(struct weston_view *view); |
Kristian Høgsberg | d8bf90c | 2012-02-23 23:03:14 -0500 | [diff] [blame] | 1862 | |
| 1863 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1864 | weston_view_unmap(struct weston_view *view); |
| 1865 | |
Kristian Høgsberg | 65a11e1 | 2012-08-03 11:30:18 -0400 | [diff] [blame] | 1866 | void |
Kristian Høgsberg | af7b1ff | 2012-06-26 21:19:23 -0400 | [diff] [blame] | 1867 | weston_surface_unmap(struct weston_surface *surface); |
| 1868 | |
Pekka Paalanen | 01388e2 | 2013-04-25 13:57:44 +0300 | [diff] [blame] | 1869 | struct weston_surface * |
| 1870 | weston_surface_get_main_surface(struct weston_surface *surface); |
| 1871 | |
Pekka Paalanen | 50b6747 | 2014-10-01 15:02:41 +0300 | [diff] [blame] | 1872 | int |
| 1873 | weston_surface_set_role(struct weston_surface *surface, |
| 1874 | const char *role_name, |
| 1875 | struct wl_resource *error_resource, |
| 1876 | uint32_t error_code); |
Quentin Glidic | 9c5dd7e | 2016-08-12 10:41:37 +0200 | [diff] [blame] | 1877 | const char * |
| 1878 | weston_surface_get_role(struct weston_surface *surface); |
Pekka Paalanen | 50b6747 | 2014-10-01 15:02:41 +0300 | [diff] [blame] | 1879 | |
Pekka Paalanen | 8274d90 | 2014-08-06 19:36:51 +0300 | [diff] [blame] | 1880 | void |
| 1881 | weston_surface_set_label_func(struct weston_surface *surface, |
| 1882 | int (*desc)(struct weston_surface *, |
| 1883 | char *, size_t)); |
| 1884 | |
Pekka Paalanen | c647ed7 | 2015-02-09 13:16:57 +0200 | [diff] [blame] | 1885 | void |
| 1886 | weston_surface_get_content_size(struct weston_surface *surface, |
| 1887 | int *width, int *height); |
| 1888 | |
Quentin Glidic | 248dd10 | 2016-08-12 10:41:34 +0200 | [diff] [blame] | 1889 | struct weston_geometry |
| 1890 | weston_surface_get_bounding_box(struct weston_surface *surface); |
| 1891 | |
Pekka Paalanen | c647ed7 | 2015-02-09 13:16:57 +0200 | [diff] [blame] | 1892 | int |
| 1893 | weston_surface_copy_content(struct weston_surface *surface, |
| 1894 | void *target, size_t size, |
| 1895 | int src_x, int src_y, |
| 1896 | int width, int height); |
| 1897 | |
Jason Ekstrand | 6bd6294 | 2013-06-20 20:38:23 -0500 | [diff] [blame] | 1898 | struct weston_buffer * |
| 1899 | weston_buffer_from_resource(struct wl_resource *resource); |
| 1900 | |
Kristian Høgsberg | af7b1ff | 2012-06-26 21:19:23 -0400 | [diff] [blame] | 1901 | void |
Alexandros Frantzis | 409b01f | 2017-11-16 18:21:01 +0200 | [diff] [blame] | 1902 | weston_compositor_get_time(struct timespec *time); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1903 | |
Giulio Camuffo | 459137b | 2014-10-11 23:56:24 +0300 | [diff] [blame] | 1904 | void |
| 1905 | weston_compositor_destroy(struct weston_compositor *ec); |
Marius Vlad | 284d534 | 2019-06-24 12:00:47 +0300 | [diff] [blame] | 1906 | |
Giulio Camuffo | 459137b | 2014-10-11 23:56:24 +0300 | [diff] [blame] | 1907 | struct weston_compositor * |
Marius Vlad | 880b485 | 2019-04-07 17:07:58 +0300 | [diff] [blame] | 1908 | weston_compositor_create(struct wl_display *display, |
Leandro Ribeiro | cdb7218 | 2020-11-06 11:24:22 -0300 | [diff] [blame] | 1909 | struct weston_log_context *log_ctx, void *user_data, |
| 1910 | const struct weston_testsuite_data *test_data); |
Pekka Paalanen | 50dbf38 | 2016-06-03 15:23:46 +0300 | [diff] [blame] | 1911 | |
Leandro Ribeiro | 32a5acd | 2020-10-19 16:06:22 -0300 | [diff] [blame] | 1912 | void * |
| 1913 | weston_compositor_get_test_data(struct weston_compositor *ec); |
| 1914 | |
Pekka Paalanen | 6ffbba3 | 2019-11-06 12:59:32 +0200 | [diff] [blame] | 1915 | bool |
| 1916 | weston_compositor_add_destroy_listener_once(struct weston_compositor *compositor, |
| 1917 | struct wl_listener *listener, |
| 1918 | wl_notify_func_t destroy_handler); |
| 1919 | |
Pekka Paalanen | 50dbf38 | 2016-06-03 15:23:46 +0300 | [diff] [blame] | 1920 | enum weston_compositor_backend { |
| 1921 | WESTON_BACKEND_DRM, |
| 1922 | WESTON_BACKEND_FBDEV, |
| 1923 | WESTON_BACKEND_HEADLESS, |
| 1924 | WESTON_BACKEND_RDP, |
| 1925 | WESTON_BACKEND_WAYLAND, |
| 1926 | WESTON_BACKEND_X11, |
| 1927 | }; |
| 1928 | |
Pekka Paalanen | dd18673 | 2016-06-03 14:49:54 +0300 | [diff] [blame] | 1929 | int |
| 1930 | weston_compositor_load_backend(struct weston_compositor *compositor, |
Pekka Paalanen | 50dbf38 | 2016-06-03 15:23:46 +0300 | [diff] [blame] | 1931 | enum weston_compositor_backend backend, |
Pekka Paalanen | dd18673 | 2016-06-03 14:49:54 +0300 | [diff] [blame] | 1932 | struct weston_backend_config *config_base); |
Giulio Camuffo | 459137b | 2014-10-11 23:56:24 +0300 | [diff] [blame] | 1933 | void |
| 1934 | weston_compositor_exit(struct weston_compositor *ec); |
| 1935 | void * |
| 1936 | weston_compositor_get_user_data(struct weston_compositor *compositor); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1937 | void |
Frederic Plourde | c336f06 | 2014-10-29 14:44:33 -0400 | [diff] [blame] | 1938 | weston_compositor_exit_with_code(struct weston_compositor *compositor, |
| 1939 | int exit_code); |
| 1940 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1941 | weston_output_update_zoom(struct weston_output *output); |
Scott Moreau | ccbf29d | 2012-02-22 14:21:41 -0700 | [diff] [blame] | 1942 | void |
Derek Foreman | 22276a5 | 2015-07-23 14:55:15 -0500 | [diff] [blame] | 1943 | weston_output_activate_zoom(struct weston_output *output, |
| 1944 | struct weston_seat *seat); |
Giulio Camuffo | 412b024 | 2013-11-14 23:42:51 +0100 | [diff] [blame] | 1945 | void |
Pekka Paalanen | 37b7c6e | 2017-11-07 10:15:01 +0200 | [diff] [blame] | 1946 | weston_output_add_destroy_listener(struct weston_output *output, |
| 1947 | struct wl_listener *listener); |
| 1948 | struct wl_listener * |
| 1949 | weston_output_get_destroy_listener(struct weston_output *output, |
| 1950 | wl_notify_func_t notify); |
Kristian Høgsberg | b5e2610 | 2013-04-18 15:40:10 -0400 | [diff] [blame] | 1951 | int |
Giulio Camuffo | 0358af4 | 2016-06-02 21:48:08 +0300 | [diff] [blame] | 1952 | weston_compositor_set_xkb_rule_names(struct weston_compositor *ec, |
| 1953 | struct xkb_rule_names *names); |
Kristian Høgsberg | 3466bc8 | 2012-01-03 11:29:15 -0500 | [diff] [blame] | 1954 | |
Kristian Høgsberg | 64eca89 | 2012-08-01 00:00:57 -0400 | [diff] [blame] | 1955 | /* String literal of spaces, the same width as the timestamp. */ |
| 1956 | #define STAMP_SPACE " " |
| 1957 | |
Marius Vlad | 35ff4a8 | 2019-06-28 14:08:24 +0300 | [diff] [blame] | 1958 | /** |
| 1959 | * \ingroup wlog |
| 1960 | */ |
Giulio Camuffo | be2b11a | 2016-06-02 21:48:13 +0300 | [diff] [blame] | 1961 | typedef int (*log_func_t)(const char *fmt, va_list ap); |
Kristian Høgsberg | 64eca89 | 2012-08-01 00:00:57 -0400 | [diff] [blame] | 1962 | void |
Giulio Camuffo | be2b11a | 2016-06-02 21:48:13 +0300 | [diff] [blame] | 1963 | weston_log_set_handler(log_func_t log, log_func_t cont); |
Kristian Høgsberg | 64eca89 | 2012-08-01 00:00:57 -0400 | [diff] [blame] | 1964 | int |
Pekka Paalanen | d525b56 | 2012-08-06 14:57:04 +0300 | [diff] [blame] | 1965 | weston_log(const char *fmt, ...) |
| 1966 | __attribute__ ((format (printf, 1, 2))); |
Kristian Høgsberg | 64eca89 | 2012-08-01 00:00:57 -0400 | [diff] [blame] | 1967 | int |
Pekka Paalanen | d525b56 | 2012-08-06 14:57:04 +0300 | [diff] [blame] | 1968 | weston_log_continue(const char *fmt, ...) |
| 1969 | __attribute__ ((format (printf, 1, 2))); |
Kristian Høgsberg | 64eca89 | 2012-08-01 00:00:57 -0400 | [diff] [blame] | 1970 | |
Giulio Camuffo | e9022e7 | 2013-12-11 23:45:11 +0100 | [diff] [blame] | 1971 | enum weston_screenshooter_outcome { |
| 1972 | WESTON_SCREENSHOOTER_SUCCESS, |
| 1973 | WESTON_SCREENSHOOTER_NO_MEMORY, |
| 1974 | WESTON_SCREENSHOOTER_BAD_BUFFER |
| 1975 | }; |
| 1976 | |
| 1977 | typedef void (*weston_screenshooter_done_func_t)(void *data, |
| 1978 | enum weston_screenshooter_outcome outcome); |
| 1979 | int |
| 1980 | weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer, |
| 1981 | weston_screenshooter_done_func_t done, void *data); |
Giulio Camuffo | 26f62d4 | 2016-06-02 21:48:09 +0300 | [diff] [blame] | 1982 | struct weston_recorder * |
| 1983 | weston_recorder_start(struct weston_output *output, const char *filename); |
| 1984 | void |
| 1985 | weston_recorder_stop(struct weston_recorder *recorder); |
Giulio Camuffo | e9022e7 | 2013-12-11 23:45:11 +0100 | [diff] [blame] | 1986 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1987 | struct weston_view_animation; |
| 1988 | typedef void (*weston_view_animation_done_func_t)(struct weston_view_animation *animation, void *data); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1989 | |
Louis-Francis Ratté-Boulianne | b482dbd | 2013-11-19 11:37:11 +0100 | [diff] [blame] | 1990 | void |
| 1991 | weston_view_animation_destroy(struct weston_view_animation *animation); |
| 1992 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1993 | struct weston_view_animation * |
| 1994 | weston_zoom_run(struct weston_view *view, float start, float stop, |
| 1995 | weston_view_animation_done_func_t done, void *data); |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 1996 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 1997 | struct weston_view_animation * |
| 1998 | weston_fade_run(struct weston_view *view, |
Ander Conselvan de Oliveira | ee41605 | 2013-02-21 18:35:17 +0200 | [diff] [blame] | 1999 | float start, float end, float k, |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 2000 | weston_view_animation_done_func_t done, void *data); |
Daniel Stone | a67e6b9 | 2013-11-19 11:37:13 +0100 | [diff] [blame] | 2001 | |
| 2002 | struct weston_view_animation * |
| 2003 | weston_move_scale_run(struct weston_view *view, int dx, int dy, |
Quentin Glidic | 24d306c | 2016-08-10 15:53:33 +0200 | [diff] [blame] | 2004 | float start, float end, bool reverse, |
Daniel Stone | a67e6b9 | 2013-11-19 11:37:13 +0100 | [diff] [blame] | 2005 | weston_view_animation_done_func_t done, void *data); |
| 2006 | |
Quentin Glidic | 24d306c | 2016-08-10 15:53:33 +0200 | [diff] [blame] | 2007 | struct weston_view_animation * |
| 2008 | weston_move_run(struct weston_view *view, int dx, int dy, |
| 2009 | float start, float end, bool reverse, |
| 2010 | weston_view_animation_done_func_t done, void *data); |
| 2011 | |
Ander Conselvan de Oliveira | ee41605 | 2013-02-21 18:35:17 +0200 | [diff] [blame] | 2012 | void |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 2013 | weston_fade_update(struct weston_view_animation *fade, float target); |
Ander Conselvan de Oliveira | ee41605 | 2013-02-21 18:35:17 +0200 | [diff] [blame] | 2014 | |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 2015 | struct weston_view_animation * |
Louis-Francis Ratté-Boulianne | b482dbd | 2013-11-19 11:37:11 +0100 | [diff] [blame] | 2016 | weston_stable_fade_run(struct weston_view *front_view, float start, |
| 2017 | struct weston_view *back_view, float end, |
| 2018 | weston_view_animation_done_func_t done, void *data); |
| 2019 | |
| 2020 | struct weston_view_animation * |
Jason Ekstrand | a7af704 | 2013-10-12 22:38:11 -0500 | [diff] [blame] | 2021 | weston_slide_run(struct weston_view *view, float start, float stop, |
| 2022 | weston_view_animation_done_func_t done, void *data); |
Juan Zhao | e10d279 | 2012-04-25 19:09:52 +0800 | [diff] [blame] | 2023 | |
Alex Wu | 8811bf9 | 2012-02-28 18:07:54 +0800 | [diff] [blame] | 2024 | void |
| 2025 | weston_surface_set_color(struct weston_surface *surface, |
John Kåre Alsaker | 490d02a | 2012-09-30 02:57:21 +0200 | [diff] [blame] | 2026 | float red, float green, float blue, float alpha); |
Alex Wu | 8811bf9 | 2012-02-28 18:07:54 +0800 | [diff] [blame] | 2027 | |
| 2028 | void |
| 2029 | weston_surface_destroy(struct weston_surface *surface); |
| 2030 | |
Alex Wu | 2dda604 | 2012-04-17 17:20:47 +0800 | [diff] [blame] | 2031 | int |
Derek Foreman | 6ae7bc9 | 2014-11-04 10:47:33 -0600 | [diff] [blame] | 2032 | weston_output_mode_switch_to_temporary(struct weston_output *output, |
| 2033 | struct weston_mode *mode, |
| 2034 | int32_t scale); |
| 2035 | int |
| 2036 | weston_output_mode_switch_to_native(struct weston_output *output); |
Alex Wu | 2dda604 | 2012-04-17 17:20:47 +0800 | [diff] [blame] | 2037 | |
Ander Conselvan de Oliveira | 11f8d40 | 2012-10-29 18:19:24 +0200 | [diff] [blame] | 2038 | int |
Quentin Glidic | 23e1d6f | 2016-12-02 14:08:44 +0100 | [diff] [blame] | 2039 | weston_backend_init(struct weston_compositor *c, |
| 2040 | struct weston_backend_config *config_base); |
Kristian Høgsberg | b00a9d3 | 2012-09-11 14:06:27 -0400 | [diff] [blame] | 2041 | int |
Quentin Glidic | 3d7ca3b | 2016-12-02 14:20:35 +0100 | [diff] [blame] | 2042 | weston_module_init(struct weston_compositor *compositor); |
Kristian Høgsberg | b00a9d3 | 2012-09-11 14:06:27 -0400 | [diff] [blame] | 2043 | |
Ander Conselvan de Oliveira | 97f2952 | 2013-10-14 15:57:11 +0300 | [diff] [blame] | 2044 | void * |
| 2045 | weston_load_module(const char *name, const char *entrypoint); |
| 2046 | |
Daniel Stone | e03c111 | 2016-11-24 20:45:45 +0000 | [diff] [blame] | 2047 | size_t |
| 2048 | weston_module_path_from_env(const char *name, char *path, size_t path_len); |
| 2049 | |
Derek Foreman | 64a3df0 | 2014-10-23 12:24:18 -0500 | [diff] [blame] | 2050 | int |
| 2051 | weston_parse_transform(const char *transform, uint32_t *out); |
| 2052 | |
| 2053 | const char * |
| 2054 | weston_transform_to_string(uint32_t output_transform); |
| 2055 | |
Derek Foreman | 1281a36 | 2015-07-31 16:55:32 -0500 | [diff] [blame] | 2056 | struct weston_keyboard * |
| 2057 | weston_seat_get_keyboard(struct weston_seat *seat); |
| 2058 | |
| 2059 | struct weston_pointer * |
| 2060 | weston_seat_get_pointer(struct weston_seat *seat); |
| 2061 | |
| 2062 | struct weston_touch * |
| 2063 | weston_seat_get_touch(struct weston_seat *seat); |
| 2064 | |
Bryce Harrington | 24f917e | 2016-06-29 19:04:07 -0700 | [diff] [blame] | 2065 | void |
| 2066 | weston_seat_set_keyboard_focus(struct weston_seat *seat, |
| 2067 | struct weston_surface *surface); |
| 2068 | |
Derek Foreman | f8f7fd6 | 2017-06-28 11:41:43 -0500 | [diff] [blame] | 2069 | void |
| 2070 | weston_keyboard_send_keymap(struct weston_keyboard *kbd, |
| 2071 | struct wl_resource *resource); |
| 2072 | |
Giulio Camuffo | 9c764df | 2016-06-29 11:54:27 +0200 | [diff] [blame] | 2073 | int |
| 2074 | weston_compositor_load_xwayland(struct weston_compositor *compositor); |
| 2075 | |
Pekka Paalanen | 5e79dd4 | 2021-03-29 14:11:49 +0300 | [diff] [blame] | 2076 | int |
| 2077 | weston_compositor_load_color_manager(struct weston_compositor *compositor); |
| 2078 | |
Pekka Paalanen | 7fe858b | 2017-08-14 15:45:14 +0300 | [diff] [blame] | 2079 | bool |
| 2080 | weston_head_is_connected(struct weston_head *head); |
| 2081 | |
Pekka Paalanen | 8e552fd | 2018-02-15 15:18:20 +0200 | [diff] [blame] | 2082 | bool |
| 2083 | weston_head_is_enabled(struct weston_head *head); |
| 2084 | |
Pekka Paalanen | e19970f | 2017-08-28 14:11:02 +0300 | [diff] [blame] | 2085 | bool |
| 2086 | weston_head_is_device_changed(struct weston_head *head); |
| 2087 | |
Philipp Zabel | c18ffd3 | 2018-08-30 17:38:03 +0200 | [diff] [blame] | 2088 | bool |
| 2089 | weston_head_is_non_desktop(struct weston_head *head); |
| 2090 | |
Pekka Paalanen | e19970f | 2017-08-28 14:11:02 +0300 | [diff] [blame] | 2091 | void |
| 2092 | weston_head_reset_device_changed(struct weston_head *head); |
| 2093 | |
Pekka Paalanen | 992a8cb | 2017-08-16 10:39:17 +0300 | [diff] [blame] | 2094 | const char * |
| 2095 | weston_head_get_name(struct weston_head *head); |
| 2096 | |
| 2097 | struct weston_output * |
| 2098 | weston_head_get_output(struct weston_head *head); |
| 2099 | |
Lucas Stach | a69cb71 | 2019-11-25 23:29:31 +0000 | [diff] [blame] | 2100 | uint32_t |
| 2101 | weston_head_get_transform(struct weston_head *head); |
| 2102 | |
Pekka Paalanen | 992a8cb | 2017-08-16 10:39:17 +0300 | [diff] [blame] | 2103 | void |
| 2104 | weston_head_detach(struct weston_head *head); |
| 2105 | |
Pekka Paalanen | 2e1bedb | 2017-10-10 11:21:58 +0300 | [diff] [blame] | 2106 | void |
| 2107 | weston_head_add_destroy_listener(struct weston_head *head, |
| 2108 | struct wl_listener *listener); |
| 2109 | |
| 2110 | struct wl_listener * |
| 2111 | weston_head_get_destroy_listener(struct weston_head *head, |
| 2112 | wl_notify_func_t notify); |
| 2113 | |
Ankit Nautiyal | 4f64ff8 | 2019-04-03 18:44:35 +0530 | [diff] [blame] | 2114 | void |
| 2115 | weston_head_set_content_protection_status(struct weston_head *head, |
| 2116 | enum weston_hdcp_protection status); |
| 2117 | |
Pekka Paalanen | 1adcbac | 2017-08-14 16:05:35 +0300 | [diff] [blame] | 2118 | struct weston_head * |
| 2119 | weston_compositor_iterate_heads(struct weston_compositor *compositor, |
| 2120 | struct weston_head *iter); |
| 2121 | |
Pekka Paalanen | 01f6021 | 2017-03-24 15:39:24 +0200 | [diff] [blame] | 2122 | void |
Pekka Paalanen | 37e6c9e | 2017-08-15 13:00:02 +0300 | [diff] [blame] | 2123 | weston_compositor_add_heads_changed_listener(struct weston_compositor *compositor, |
| 2124 | struct wl_listener *listener); |
| 2125 | |
Pekka Paalanen | 992a8cb | 2017-08-16 10:39:17 +0300 | [diff] [blame] | 2126 | struct weston_output * |
Pekka Paalanen | 1ae9d08 | 2017-11-02 14:11:53 +0200 | [diff] [blame] | 2127 | weston_compositor_find_output_by_name(struct weston_compositor *compositor, |
| 2128 | const char *name); |
| 2129 | |
| 2130 | struct weston_output * |
| 2131 | weston_compositor_create_output(struct weston_compositor *compositor, |
| 2132 | const char *name); |
| 2133 | |
| 2134 | struct weston_output * |
Pekka Paalanen | 992a8cb | 2017-08-16 10:39:17 +0300 | [diff] [blame] | 2135 | weston_compositor_create_output_with_head(struct weston_compositor *compositor, |
| 2136 | struct weston_head *head); |
| 2137 | |
| 2138 | void |
| 2139 | weston_output_destroy(struct weston_output *output); |
| 2140 | |
| 2141 | int |
| 2142 | weston_output_attach_head(struct weston_output *output, |
| 2143 | struct weston_head *head); |
| 2144 | |
| 2145 | struct weston_head * |
| 2146 | weston_output_iterate_heads(struct weston_output *output, |
| 2147 | struct weston_head *iter); |
| 2148 | |
Pekka Paalanen | 37e6c9e | 2017-08-15 13:00:02 +0300 | [diff] [blame] | 2149 | void |
Armin Krezović | a01ab6d | 2016-09-30 14:11:02 +0200 | [diff] [blame] | 2150 | weston_output_set_scale(struct weston_output *output, |
| 2151 | int32_t scale); |
| 2152 | |
| 2153 | void |
| 2154 | weston_output_set_transform(struct weston_output *output, |
| 2155 | uint32_t transform); |
| 2156 | |
Pekka Paalanen | 9a9e6ce | 2021-06-08 14:17:44 +0300 | [diff] [blame] | 2157 | bool |
| 2158 | weston_output_set_color_profile(struct weston_output *output, |
| 2159 | struct weston_color_profile *cprof); |
| 2160 | |
Armin Krezović | a01ab6d | 2016-09-30 14:11:02 +0200 | [diff] [blame] | 2161 | void |
Armin Krezović | 4008740 | 2016-09-30 14:11:12 +0200 | [diff] [blame] | 2162 | weston_output_init(struct weston_output *output, |
Pekka Paalanen | 26ac2e1 | 2017-04-03 13:18:13 +0300 | [diff] [blame] | 2163 | struct weston_compositor *compositor, |
| 2164 | const char *name); |
Armin Krezović | a01ab6d | 2016-09-30 14:11:02 +0200 | [diff] [blame] | 2165 | |
sichem | b86eb20 | 2019-09-13 08:57:31 +0000 | [diff] [blame] | 2166 | void |
| 2167 | weston_output_move(struct weston_output *output, int x, int y); |
| 2168 | |
Armin Krezović | a01ab6d | 2016-09-30 14:11:02 +0200 | [diff] [blame] | 2169 | int |
| 2170 | weston_output_enable(struct weston_output *output); |
| 2171 | |
| 2172 | void |
| 2173 | weston_output_disable(struct weston_output *output); |
| 2174 | |
| 2175 | void |
Pekka Paalanen | 8a8dcac | 2017-08-17 17:29:36 +0300 | [diff] [blame] | 2176 | weston_compositor_flush_heads_changed(struct weston_compositor *compositor); |
Armin Krezović | a01ab6d | 2016-09-30 14:11:02 +0200 | [diff] [blame] | 2177 | |
Pekka Paalanen | 055c113 | 2017-03-27 16:31:25 +0300 | [diff] [blame] | 2178 | struct weston_head * |
| 2179 | weston_head_from_resource(struct wl_resource *resource); |
Pekka Paalanen | 9ffb250 | 2017-03-27 15:14:32 +0300 | [diff] [blame] | 2180 | |
Pekka Paalanen | cf0a476 | 2017-04-04 16:36:07 +0300 | [diff] [blame] | 2181 | struct weston_head * |
| 2182 | weston_output_get_first_head(struct weston_output *output); |
| 2183 | |
Ankit Nautiyal | 2844f8e | 2019-04-03 10:14:59 +0530 | [diff] [blame] | 2184 | void |
| 2185 | weston_output_allow_protection(struct weston_output *output, |
| 2186 | bool allow_protection); |
| 2187 | |
Louis-Francis Ratté-Boulianne | 8363098 | 2017-11-28 20:42:47 -0500 | [diff] [blame] | 2188 | int |
| 2189 | weston_compositor_enable_touch_calibrator(struct weston_compositor *compositor, |
| 2190 | weston_touch_calibration_save_func save); |
| 2191 | |
Marius Vlad | 3d7d978 | 2019-04-17 12:35:38 +0300 | [diff] [blame] | 2192 | struct weston_log_context * |
Leandro Ribeiro | 4f13595 | 2020-01-17 11:19:59 -0300 | [diff] [blame] | 2193 | weston_log_ctx_create(void); |
Marius Vlad | 880b485 | 2019-04-07 17:07:58 +0300 | [diff] [blame] | 2194 | |
Pekka Paalanen | a5630ea | 2017-10-12 13:13:42 +0200 | [diff] [blame] | 2195 | void |
Leandro Ribeiro | 4ec38d1 | 2020-01-24 01:12:59 -0300 | [diff] [blame] | 2196 | weston_log_ctx_destroy(struct weston_log_context *log_ctx); |
Pekka Paalanen | a5630ea | 2017-10-12 13:13:42 +0200 | [diff] [blame] | 2197 | |
Ankit Nautiyal | 5cfe03c | 2019-03-28 15:05:42 +0530 | [diff] [blame] | 2198 | int |
| 2199 | weston_compositor_enable_content_protection(struct weston_compositor *compositor); |
| 2200 | |
Marius Vlad | 5de9297 | 2019-10-15 13:25:41 +0300 | [diff] [blame] | 2201 | void |
| 2202 | weston_timeline_refresh_subscription_objects(struct weston_compositor *wc, |
| 2203 | void *object); |
| 2204 | |
Pekka Paalanen | aa6346f | 2021-05-28 14:46:14 +0300 | [diff] [blame] | 2205 | struct weston_color_profile * |
| 2206 | weston_color_profile_ref(struct weston_color_profile *cprof); |
| 2207 | |
| 2208 | void |
| 2209 | weston_color_profile_unref(struct weston_color_profile *cprof); |
| 2210 | |
| 2211 | const char * |
| 2212 | weston_color_profile_get_description(struct weston_color_profile *cprof); |
| 2213 | |
Pekka Paalanen | f45d576 | 2021-06-03 14:57:56 +0300 | [diff] [blame] | 2214 | struct weston_color_profile * |
| 2215 | weston_compositor_load_icc_file(struct weston_compositor *compositor, |
| 2216 | const char *path); |
| 2217 | |
Giulio Camuffo | 7fe01b1 | 2013-03-28 18:02:42 +0100 | [diff] [blame] | 2218 | #ifdef __cplusplus |
| 2219 | } |
| 2220 | #endif |
| 2221 | |
Kristian Høgsberg | 8334bc1 | 2012-01-03 10:29:47 -0500 | [diff] [blame] | 2222 | #endif |