Marius Vlad | a72e371 | 2019-07-10 13:46:39 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2008-2011 Kristian Høgsberg |
| 3 | * Copyright © 2017, 2018 General Electric Company |
| 4 | * Copyright © 2012, 2017-2019 Collabora, Ltd. |
| 5 | * |
| 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: |
| 13 | * |
| 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. |
| 26 | */ |
| 27 | |
| 28 | #ifndef LIBWESTON_INTERNAL_H |
| 29 | #define LIBWESTON_INTERNAL_H |
| 30 | |
| 31 | /* |
| 32 | * This is the internal (private) part of libweston. All symbols found here |
| 33 | * are, and should be only (with a few exceptions) used within the internal |
| 34 | * parts of libweston. Notable exception(s) include a few files in tests/ that |
| 35 | * need access to these functions, screen-share file from compositor/ and those |
| 36 | * remoting/. Those will require some further fixing as to avoid including this |
| 37 | * private header. |
| 38 | * |
| 39 | * Eventually, these symbols should reside naturally into their own scope. New |
| 40 | * features should either provide their own (internal) header or use this one. |
| 41 | */ |
| 42 | |
| 43 | |
| 44 | /* weston_buffer */ |
| 45 | |
| 46 | void |
| 47 | weston_buffer_send_server_error(struct weston_buffer *buffer, |
| 48 | const char *msg); |
| 49 | void |
| 50 | weston_buffer_reference(struct weston_buffer_reference *ref, |
| 51 | struct weston_buffer *buffer); |
| 52 | |
| 53 | void |
| 54 | weston_buffer_release_move(struct weston_buffer_release_reference *dest, |
| 55 | struct weston_buffer_release_reference *src); |
| 56 | |
| 57 | void |
| 58 | weston_buffer_release_reference(struct weston_buffer_release_reference *ref, |
| 59 | struct weston_buffer_release *buf_release); |
| 60 | |
Marius Vlad | 56f3a68 | 2019-07-10 14:48:39 +0300 | [diff] [blame] | 61 | /* weston_bindings */ |
| 62 | void |
| 63 | weston_binding_destroy(struct weston_binding *binding); |
| 64 | |
| 65 | void |
| 66 | weston_binding_list_destroy_all(struct wl_list *list); |
| 67 | |
| 68 | /* weston_compositor */ |
| 69 | |
| 70 | void |
| 71 | touch_calibrator_mode_changed(struct weston_compositor *compositor); |
| 72 | |
| 73 | int |
| 74 | noop_renderer_init(struct weston_compositor *ec); |
| 75 | |
| 76 | void |
| 77 | weston_compositor_add_head(struct weston_compositor *compositor, |
| 78 | struct weston_head *head); |
| 79 | void |
| 80 | weston_compositor_add_pending_output(struct weston_output *output, |
| 81 | struct weston_compositor *compositor); |
| 82 | struct weston_binding * |
| 83 | weston_compositor_add_debug_binding(struct weston_compositor *compositor, |
| 84 | uint32_t key, |
| 85 | weston_key_binding_handler_t binding, |
| 86 | void *data); |
| 87 | bool |
| 88 | weston_compositor_import_dmabuf(struct weston_compositor *compositor, |
| 89 | struct linux_dmabuf_buffer *buffer); |
| 90 | void |
| 91 | weston_compositor_offscreen(struct weston_compositor *compositor); |
| 92 | |
| 93 | char * |
| 94 | weston_compositor_print_scene_graph(struct weston_compositor *ec); |
| 95 | |
| 96 | void |
| 97 | weston_compositor_read_presentation_clock( |
| 98 | const struct weston_compositor *compositor, |
| 99 | struct timespec *ts); |
| 100 | |
| 101 | int |
| 102 | weston_compositor_run_axis_binding(struct weston_compositor *compositor, |
| 103 | struct weston_pointer *pointer, |
| 104 | const struct timespec *time, |
| 105 | struct weston_pointer_axis_event *event); |
| 106 | void |
| 107 | weston_compositor_run_button_binding(struct weston_compositor *compositor, |
| 108 | struct weston_pointer *pointer, |
| 109 | const struct timespec *time, |
| 110 | uint32_t button, |
| 111 | enum wl_pointer_button_state value); |
| 112 | int |
| 113 | weston_compositor_run_debug_binding(struct weston_compositor *compositor, |
| 114 | struct weston_keyboard *keyboard, |
| 115 | const struct timespec *time, |
| 116 | uint32_t key, |
| 117 | enum wl_keyboard_key_state state); |
| 118 | void |
| 119 | weston_compositor_run_key_binding(struct weston_compositor *compositor, |
| 120 | struct weston_keyboard *keyboard, |
| 121 | const struct timespec *time, |
| 122 | uint32_t key, |
| 123 | enum wl_keyboard_key_state state); |
| 124 | void |
| 125 | weston_compositor_run_modifier_binding(struct weston_compositor *compositor, |
| 126 | struct weston_keyboard *keyboard, |
| 127 | enum weston_keyboard_modifier modifier, |
| 128 | enum wl_keyboard_key_state state); |
| 129 | void |
| 130 | weston_compositor_run_touch_binding(struct weston_compositor *compositor, |
| 131 | struct weston_touch *touch, |
| 132 | const struct timespec *time, |
| 133 | int touch_type); |
| 134 | void |
| 135 | weston_compositor_stack_plane(struct weston_compositor *ec, |
| 136 | struct weston_plane *plane, |
| 137 | struct weston_plane *above); |
| 138 | void |
| 139 | weston_compositor_set_touch_mode_normal(struct weston_compositor *compositor); |
| 140 | |
| 141 | void |
| 142 | weston_compositor_set_touch_mode_calib(struct weston_compositor *compositor); |
| 143 | |
| 144 | int |
| 145 | weston_compositor_set_presentation_clock(struct weston_compositor *compositor, |
| 146 | clockid_t clk_id); |
| 147 | int |
| 148 | weston_compositor_set_presentation_clock_software( |
| 149 | struct weston_compositor *compositor); |
| 150 | void |
| 151 | weston_compositor_shutdown(struct weston_compositor *ec); |
| 152 | |
| 153 | void |
| 154 | weston_compositor_xkb_destroy(struct weston_compositor *ec); |
| 155 | |
| 156 | int |
| 157 | weston_input_init(struct weston_compositor *compositor); |
| 158 | |
Marius Vlad | 58cac08 | 2019-07-10 16:29:05 +0300 | [diff] [blame] | 159 | /* weston_plane */ |
| 160 | |
| 161 | void |
| 162 | weston_plane_init(struct weston_plane *plane, |
| 163 | struct weston_compositor *ec, |
| 164 | int32_t x, int32_t y); |
| 165 | void |
| 166 | weston_plane_release(struct weston_plane *plane); |
Marius Vlad | 0bf3f5a | 2019-07-10 17:32:42 +0300 | [diff] [blame] | 167 | |
| 168 | /* weston_seat */ |
| 169 | |
| 170 | struct clipboard * |
| 171 | clipboard_create(struct weston_seat *seat); |
| 172 | |
| 173 | void |
| 174 | weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec, |
| 175 | const char *seat_name); |
| 176 | |
| 177 | void |
| 178 | weston_seat_repick(struct weston_seat *seat); |
| 179 | |
| 180 | void |
| 181 | weston_seat_release(struct weston_seat *seat); |
| 182 | |
| 183 | void |
| 184 | weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client); |
| 185 | |
| 186 | void |
| 187 | weston_seat_init_pointer(struct weston_seat *seat); |
| 188 | |
| 189 | int |
| 190 | weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap); |
| 191 | |
| 192 | void |
| 193 | weston_seat_init_touch(struct weston_seat *seat); |
| 194 | |
| 195 | void |
| 196 | weston_seat_release_keyboard(struct weston_seat *seat); |
| 197 | |
| 198 | void |
| 199 | weston_seat_release_pointer(struct weston_seat *seat); |
| 200 | |
| 201 | void |
| 202 | weston_seat_release_touch(struct weston_seat *seat); |
| 203 | |
| 204 | void |
| 205 | weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap); |
| 206 | |
| 207 | void |
| 208 | wl_data_device_set_keyboard_focus(struct weston_seat *seat); |
| 209 | |
Marius Vlad | 9eb2064 | 2019-07-10 18:23:43 +0300 | [diff] [blame] | 210 | /* weston_pointer */ |
| 211 | |
| 212 | void |
| 213 | weston_pointer_clamp(struct weston_pointer *pointer, |
| 214 | wl_fixed_t *fx, wl_fixed_t *fy); |
| 215 | void |
| 216 | weston_pointer_set_default_grab(struct weston_pointer *pointer, |
| 217 | const struct weston_pointer_grab_interface *interface); |
| 218 | |
| 219 | void |
| 220 | weston_pointer_constraint_destroy(struct weston_pointer_constraint *constraint); |
| 221 | |
| 222 | /* weston_keyboard */ |
| 223 | bool |
| 224 | weston_keyboard_has_focus_resource(struct weston_keyboard *keyboard); |
| 225 | |
| 226 | /* weston_touch */ |
| 227 | |
| 228 | struct weston_touch_device * |
| 229 | weston_touch_create_touch_device(struct weston_touch *touch, |
| 230 | const char *syspath, |
| 231 | void *backend_data, |
| 232 | const struct weston_touch_device_ops *ops); |
| 233 | |
| 234 | void |
| 235 | weston_touch_device_destroy(struct weston_touch_device *device); |
| 236 | |
| 237 | bool |
| 238 | weston_touch_has_focus_resource(struct weston_touch *touch); |
| 239 | |
| 240 | int |
| 241 | weston_touch_start_drag(struct weston_touch *touch, |
| 242 | struct weston_data_source *source, |
| 243 | struct weston_surface *icon, |
| 244 | struct wl_client *client); |
| 245 | |
| 246 | |
| 247 | /* weston_touch_device */ |
| 248 | |
| 249 | bool |
| 250 | weston_touch_device_can_calibrate(struct weston_touch_device *device); |
| 251 | |
Marius Vlad | f1a6594 | 2019-07-10 20:42:45 +0300 | [diff] [blame] | 252 | /* weston_surface */ |
| 253 | void |
| 254 | weston_surface_to_buffer_float(struct weston_surface *surface, |
| 255 | float x, float y, float *bx, float *by); |
| 256 | pixman_box32_t |
| 257 | weston_surface_to_buffer_rect(struct weston_surface *surface, |
| 258 | pixman_box32_t rect); |
| 259 | |
| 260 | void |
| 261 | weston_surface_to_buffer_region(struct weston_surface *surface, |
| 262 | pixman_region32_t *surface_region, |
| 263 | pixman_region32_t *buffer_region); |
| 264 | void |
| 265 | weston_surface_schedule_repaint(struct weston_surface *surface); |
Marius Vlad | 4e1d097 | 2019-07-10 20:56:04 +0300 | [diff] [blame] | 266 | |
| 267 | /* weston_spring */ |
| 268 | |
| 269 | void |
| 270 | weston_spring_init(struct weston_spring *spring, |
| 271 | double k, double current, double target); |
| 272 | int |
| 273 | weston_spring_done(struct weston_spring *spring); |
| 274 | |
| 275 | void |
| 276 | weston_spring_update(struct weston_spring *spring, const struct timespec *time); |
Marius Vlad | 7e4f58f | 2019-07-10 21:06:15 +0300 | [diff] [blame] | 277 | |
| 278 | /* weston_view */ |
| 279 | |
| 280 | void |
| 281 | weston_view_to_global_fixed(struct weston_view *view, |
| 282 | wl_fixed_t sx, wl_fixed_t sy, |
| 283 | wl_fixed_t *x, wl_fixed_t *y); |
| 284 | void |
| 285 | weston_view_from_global_float(struct weston_view *view, |
| 286 | float x, float y, float *vx, float *vy); |
| 287 | bool |
| 288 | weston_view_is_opaque(struct weston_view *ev, pixman_region32_t *region); |
| 289 | |
| 290 | void |
| 291 | weston_view_move_to_plane(struct weston_view *view, |
| 292 | struct weston_plane *plane); |
| 293 | |
Marius Vlad | 3ff296e | 2019-07-10 21:27:49 +0300 | [diff] [blame] | 294 | void |
| 295 | weston_transformed_coord(int width, int height, |
| 296 | enum wl_output_transform transform, |
| 297 | int32_t scale, |
| 298 | float sx, float sy, float *bx, float *by); |
| 299 | pixman_box32_t |
| 300 | weston_transformed_rect(int width, int height, |
| 301 | enum wl_output_transform transform, |
| 302 | int32_t scale, |
| 303 | pixman_box32_t rect); |
| 304 | void |
| 305 | weston_transformed_region(int width, int height, |
| 306 | enum wl_output_transform transform, |
| 307 | int32_t scale, |
| 308 | pixman_region32_t *src, pixman_region32_t *dest); |
| 309 | void |
| 310 | weston_matrix_transform_region(pixman_region32_t *dest, |
| 311 | struct weston_matrix *matrix, |
| 312 | pixman_region32_t *src); |
| 313 | |
Marius Vlad | a9b69b4 | 2019-07-10 21:31:20 +0300 | [diff] [blame] | 314 | /* protected_surface */ |
| 315 | void |
| 316 | weston_protected_surface_send_event(struct protected_surface *psurface, |
| 317 | enum weston_hdcp_protection protection); |
| 318 | |
Marius Vlad | 0260fed | 2019-07-11 14:54:46 +0300 | [diff] [blame^] | 319 | /* others */ |
| 320 | int |
| 321 | wl_data_device_manager_init(struct wl_display *display); |
| 322 | |
Marius Vlad | a72e371 | 2019-07-10 13:46:39 +0300 | [diff] [blame] | 323 | #endif |