blob: 0f10a43f1a06ec9853e07a8fac18307dfd4f1faf [file] [log] [blame]
Marius Vlada72e3712019-07-10 13:46:39 +03001/*
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
46void
47weston_buffer_send_server_error(struct weston_buffer *buffer,
48 const char *msg);
49void
50weston_buffer_reference(struct weston_buffer_reference *ref,
51 struct weston_buffer *buffer);
52
53void
54weston_buffer_release_move(struct weston_buffer_release_reference *dest,
55 struct weston_buffer_release_reference *src);
56
57void
58weston_buffer_release_reference(struct weston_buffer_release_reference *ref,
59 struct weston_buffer_release *buf_release);
60
Marius Vlad56f3a682019-07-10 14:48:39 +030061/* weston_bindings */
62void
Marius Vlad56f3a682019-07-10 14:48:39 +030063weston_binding_list_destroy_all(struct wl_list *list);
64
65/* weston_compositor */
66
67void
68touch_calibrator_mode_changed(struct weston_compositor *compositor);
69
70int
71noop_renderer_init(struct weston_compositor *ec);
72
73void
74weston_compositor_add_head(struct weston_compositor *compositor,
75 struct weston_head *head);
76void
77weston_compositor_add_pending_output(struct weston_output *output,
78 struct weston_compositor *compositor);
Marius Vlad56f3a682019-07-10 14:48:39 +030079bool
80weston_compositor_import_dmabuf(struct weston_compositor *compositor,
81 struct linux_dmabuf_buffer *buffer);
82void
83weston_compositor_offscreen(struct weston_compositor *compositor);
84
85char *
86weston_compositor_print_scene_graph(struct weston_compositor *ec);
87
88void
89weston_compositor_read_presentation_clock(
90 const struct weston_compositor *compositor,
91 struct timespec *ts);
92
93int
94weston_compositor_run_axis_binding(struct weston_compositor *compositor,
95 struct weston_pointer *pointer,
96 const struct timespec *time,
97 struct weston_pointer_axis_event *event);
98void
99weston_compositor_run_button_binding(struct weston_compositor *compositor,
100 struct weston_pointer *pointer,
101 const struct timespec *time,
102 uint32_t button,
103 enum wl_pointer_button_state value);
104int
105weston_compositor_run_debug_binding(struct weston_compositor *compositor,
106 struct weston_keyboard *keyboard,
107 const struct timespec *time,
108 uint32_t key,
109 enum wl_keyboard_key_state state);
110void
111weston_compositor_run_key_binding(struct weston_compositor *compositor,
112 struct weston_keyboard *keyboard,
113 const struct timespec *time,
114 uint32_t key,
115 enum wl_keyboard_key_state state);
116void
117weston_compositor_run_modifier_binding(struct weston_compositor *compositor,
118 struct weston_keyboard *keyboard,
119 enum weston_keyboard_modifier modifier,
120 enum wl_keyboard_key_state state);
121void
122weston_compositor_run_touch_binding(struct weston_compositor *compositor,
123 struct weston_touch *touch,
124 const struct timespec *time,
125 int touch_type);
126void
127weston_compositor_stack_plane(struct weston_compositor *ec,
128 struct weston_plane *plane,
129 struct weston_plane *above);
130void
131weston_compositor_set_touch_mode_normal(struct weston_compositor *compositor);
132
133void
134weston_compositor_set_touch_mode_calib(struct weston_compositor *compositor);
135
136int
137weston_compositor_set_presentation_clock(struct weston_compositor *compositor,
138 clockid_t clk_id);
139int
140weston_compositor_set_presentation_clock_software(
141 struct weston_compositor *compositor);
142void
143weston_compositor_shutdown(struct weston_compositor *ec);
144
145void
146weston_compositor_xkb_destroy(struct weston_compositor *ec);
147
148int
149weston_input_init(struct weston_compositor *compositor);
150
Marius Vlad58cac082019-07-10 16:29:05 +0300151/* weston_plane */
152
153void
154weston_plane_init(struct weston_plane *plane,
155 struct weston_compositor *ec,
156 int32_t x, int32_t y);
157void
158weston_plane_release(struct weston_plane *plane);
Marius Vlad0bf3f5a2019-07-10 17:32:42 +0300159
160/* weston_seat */
161
162struct clipboard *
163clipboard_create(struct weston_seat *seat);
164
165void
166weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
167 const char *seat_name);
168
169void
170weston_seat_repick(struct weston_seat *seat);
171
172void
173weston_seat_release(struct weston_seat *seat);
174
175void
176weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client);
177
178void
179weston_seat_init_pointer(struct weston_seat *seat);
180
181int
182weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
183
184void
185weston_seat_init_touch(struct weston_seat *seat);
186
187void
188weston_seat_release_keyboard(struct weston_seat *seat);
189
190void
191weston_seat_release_pointer(struct weston_seat *seat);
192
193void
194weston_seat_release_touch(struct weston_seat *seat);
195
196void
197weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap);
198
199void
200wl_data_device_set_keyboard_focus(struct weston_seat *seat);
201
Marius Vlad9eb20642019-07-10 18:23:43 +0300202/* weston_pointer */
203
204void
205weston_pointer_clamp(struct weston_pointer *pointer,
206 wl_fixed_t *fx, wl_fixed_t *fy);
207void
208weston_pointer_set_default_grab(struct weston_pointer *pointer,
209 const struct weston_pointer_grab_interface *interface);
210
211void
212weston_pointer_constraint_destroy(struct weston_pointer_constraint *constraint);
213
214/* weston_keyboard */
215bool
216weston_keyboard_has_focus_resource(struct weston_keyboard *keyboard);
217
218/* weston_touch */
219
220struct weston_touch_device *
221weston_touch_create_touch_device(struct weston_touch *touch,
222 const char *syspath,
223 void *backend_data,
224 const struct weston_touch_device_ops *ops);
225
226void
227weston_touch_device_destroy(struct weston_touch_device *device);
228
229bool
230weston_touch_has_focus_resource(struct weston_touch *touch);
231
232int
233weston_touch_start_drag(struct weston_touch *touch,
234 struct weston_data_source *source,
235 struct weston_surface *icon,
236 struct wl_client *client);
237
238
239/* weston_touch_device */
240
241bool
242weston_touch_device_can_calibrate(struct weston_touch_device *device);
243
Marius Vladf1a65942019-07-10 20:42:45 +0300244/* weston_surface */
245void
246weston_surface_to_buffer_float(struct weston_surface *surface,
247 float x, float y, float *bx, float *by);
248pixman_box32_t
249weston_surface_to_buffer_rect(struct weston_surface *surface,
250 pixman_box32_t rect);
251
252void
253weston_surface_to_buffer_region(struct weston_surface *surface,
254 pixman_region32_t *surface_region,
255 pixman_region32_t *buffer_region);
256void
257weston_surface_schedule_repaint(struct weston_surface *surface);
Marius Vlad4e1d0972019-07-10 20:56:04 +0300258
259/* weston_spring */
260
261void
262weston_spring_init(struct weston_spring *spring,
263 double k, double current, double target);
264int
265weston_spring_done(struct weston_spring *spring);
266
267void
268weston_spring_update(struct weston_spring *spring, const struct timespec *time);
Marius Vlad7e4f58f2019-07-10 21:06:15 +0300269
270/* weston_view */
271
272void
273weston_view_to_global_fixed(struct weston_view *view,
274 wl_fixed_t sx, wl_fixed_t sy,
275 wl_fixed_t *x, wl_fixed_t *y);
276void
277weston_view_from_global_float(struct weston_view *view,
278 float x, float y, float *vx, float *vy);
279bool
280weston_view_is_opaque(struct weston_view *ev, pixman_region32_t *region);
281
282void
283weston_view_move_to_plane(struct weston_view *view,
284 struct weston_plane *plane);
285
Marius Vlad3ff296e2019-07-10 21:27:49 +0300286void
287weston_transformed_coord(int width, int height,
288 enum wl_output_transform transform,
289 int32_t scale,
290 float sx, float sy, float *bx, float *by);
291pixman_box32_t
292weston_transformed_rect(int width, int height,
293 enum wl_output_transform transform,
294 int32_t scale,
295 pixman_box32_t rect);
296void
297weston_transformed_region(int width, int height,
298 enum wl_output_transform transform,
299 int32_t scale,
300 pixman_region32_t *src, pixman_region32_t *dest);
301void
302weston_matrix_transform_region(pixman_region32_t *dest,
303 struct weston_matrix *matrix,
304 pixman_region32_t *src);
305
Marius Vlada9b69b42019-07-10 21:31:20 +0300306/* protected_surface */
307void
308weston_protected_surface_send_event(struct protected_surface *psurface,
309 enum weston_hdcp_protection protection);
310
Marius Vlad0260fed2019-07-11 14:54:46 +0300311/* others */
312int
313wl_data_device_manager_init(struct wl_display *display);
314
Marius Vlada72e3712019-07-10 13:46:39 +0300315#endif