blob: 0bbd2196b856f648ea645ca6916182030f8ba92b [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
63weston_binding_destroy(struct weston_binding *binding);
64
65void
66weston_binding_list_destroy_all(struct wl_list *list);
67
68/* weston_compositor */
69
70void
71touch_calibrator_mode_changed(struct weston_compositor *compositor);
72
73int
74noop_renderer_init(struct weston_compositor *ec);
75
76void
77weston_compositor_add_head(struct weston_compositor *compositor,
78 struct weston_head *head);
79void
80weston_compositor_add_pending_output(struct weston_output *output,
81 struct weston_compositor *compositor);
82struct weston_binding *
83weston_compositor_add_debug_binding(struct weston_compositor *compositor,
84 uint32_t key,
85 weston_key_binding_handler_t binding,
86 void *data);
87bool
88weston_compositor_import_dmabuf(struct weston_compositor *compositor,
89 struct linux_dmabuf_buffer *buffer);
90void
91weston_compositor_offscreen(struct weston_compositor *compositor);
92
93char *
94weston_compositor_print_scene_graph(struct weston_compositor *ec);
95
96void
97weston_compositor_read_presentation_clock(
98 const struct weston_compositor *compositor,
99 struct timespec *ts);
100
101int
102weston_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);
106void
107weston_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);
112int
113weston_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);
118void
119weston_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);
124void
125weston_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);
129void
130weston_compositor_run_touch_binding(struct weston_compositor *compositor,
131 struct weston_touch *touch,
132 const struct timespec *time,
133 int touch_type);
134void
135weston_compositor_stack_plane(struct weston_compositor *ec,
136 struct weston_plane *plane,
137 struct weston_plane *above);
138void
139weston_compositor_set_touch_mode_normal(struct weston_compositor *compositor);
140
141void
142weston_compositor_set_touch_mode_calib(struct weston_compositor *compositor);
143
144int
145weston_compositor_set_presentation_clock(struct weston_compositor *compositor,
146 clockid_t clk_id);
147int
148weston_compositor_set_presentation_clock_software(
149 struct weston_compositor *compositor);
150void
151weston_compositor_shutdown(struct weston_compositor *ec);
152
153void
154weston_compositor_xkb_destroy(struct weston_compositor *ec);
155
156int
157weston_input_init(struct weston_compositor *compositor);
158
Marius Vlad58cac082019-07-10 16:29:05 +0300159/* weston_plane */
160
161void
162weston_plane_init(struct weston_plane *plane,
163 struct weston_compositor *ec,
164 int32_t x, int32_t y);
165void
166weston_plane_release(struct weston_plane *plane);
Marius Vlad0bf3f5a2019-07-10 17:32:42 +0300167
168/* weston_seat */
169
170struct clipboard *
171clipboard_create(struct weston_seat *seat);
172
173void
174weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
175 const char *seat_name);
176
177void
178weston_seat_repick(struct weston_seat *seat);
179
180void
181weston_seat_release(struct weston_seat *seat);
182
183void
184weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client);
185
186void
187weston_seat_init_pointer(struct weston_seat *seat);
188
189int
190weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
191
192void
193weston_seat_init_touch(struct weston_seat *seat);
194
195void
196weston_seat_release_keyboard(struct weston_seat *seat);
197
198void
199weston_seat_release_pointer(struct weston_seat *seat);
200
201void
202weston_seat_release_touch(struct weston_seat *seat);
203
204void
205weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap);
206
207void
208wl_data_device_set_keyboard_focus(struct weston_seat *seat);
209
Marius Vlad9eb20642019-07-10 18:23:43 +0300210/* weston_pointer */
211
212void
213weston_pointer_clamp(struct weston_pointer *pointer,
214 wl_fixed_t *fx, wl_fixed_t *fy);
215void
216weston_pointer_set_default_grab(struct weston_pointer *pointer,
217 const struct weston_pointer_grab_interface *interface);
218
219void
220weston_pointer_constraint_destroy(struct weston_pointer_constraint *constraint);
221
222/* weston_keyboard */
223bool
224weston_keyboard_has_focus_resource(struct weston_keyboard *keyboard);
225
226/* weston_touch */
227
228struct weston_touch_device *
229weston_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
234void
235weston_touch_device_destroy(struct weston_touch_device *device);
236
237bool
238weston_touch_has_focus_resource(struct weston_touch *touch);
239
240int
241weston_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
249bool
250weston_touch_device_can_calibrate(struct weston_touch_device *device);
251
Marius Vladf1a65942019-07-10 20:42:45 +0300252/* weston_surface */
253void
254weston_surface_to_buffer_float(struct weston_surface *surface,
255 float x, float y, float *bx, float *by);
256pixman_box32_t
257weston_surface_to_buffer_rect(struct weston_surface *surface,
258 pixman_box32_t rect);
259
260void
261weston_surface_to_buffer_region(struct weston_surface *surface,
262 pixman_region32_t *surface_region,
263 pixman_region32_t *buffer_region);
264void
265weston_surface_schedule_repaint(struct weston_surface *surface);
Marius Vlada72e3712019-07-10 13:46:39 +0300266#endif