blob: 568fcec43505c1d742e0f8fc801db6c1808261ba [file] [log] [blame]
Marius Vlade41c1bf2019-07-16 23:11:25 +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_BACKEND_INTERNAL_H
29#define LIBWESTON_BACKEND_INTERNAL_H
30
31/* weston_head */
32
33void
34weston_head_init(struct weston_head *head, const char *name);
35
36void
37weston_head_release(struct weston_head *head);
38
39void
40weston_head_set_connection_status(struct weston_head *head, bool connected);
41
42void
43weston_head_set_internal(struct weston_head *head);
44
45void
46weston_head_set_monitor_strings(struct weston_head *head,
47 const char *make,
48 const char *model,
49 const char *serialno);
50void
51weston_head_set_non_desktop(struct weston_head *head, bool non_desktop);
52
53void
54weston_head_set_physical_size(struct weston_head *head,
55 int32_t mm_width, int32_t mm_height);
56
57void
58weston_head_set_subpixel(struct weston_head *head,
59 enum wl_output_subpixel sp);
Marius Vlad63ef0782019-07-16 23:34:14 +030060/* weston_output */
61
62void
63weston_output_init(struct weston_output *output,
64 struct weston_compositor *compositor,
65 const char *name);
66void
67weston_output_damage(struct weston_output *output);
68
69void
70weston_output_move(struct weston_output *output, int x, int y);
71
72void
73weston_output_release(struct weston_output *output);
74
75void
76weston_output_init_zoom(struct weston_output *output);
77
78void
79weston_output_finish_frame(struct weston_output *output,
80 const struct timespec *stamp,
81 uint32_t presented_flags);
82int
83weston_output_mode_set_native(struct weston_output *output,
84 struct weston_mode *mode,
85 int32_t scale);
86void
87weston_output_transform_coordinate(struct weston_output *output,
88 double device_x, double device_y,
89 double *x, double *y);
90
Marius Vlad5d649b62019-07-16 23:44:21 +030091/* weston_seat */
92
93void
94notify_axis(struct weston_seat *seat, const struct timespec *time,
95 struct weston_pointer_axis_event *event);
96void
97notify_axis_source(struct weston_seat *seat, uint32_t source);
98
99void
100notify_button(struct weston_seat *seat, const struct timespec *time,
101 int32_t button, enum wl_pointer_button_state state);
102
103void
104notify_key(struct weston_seat *seat, const struct timespec *time, uint32_t key,
105 enum wl_keyboard_key_state state,
106 enum weston_key_state_update update_state);
107void
108notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys,
109 enum weston_key_state_update update_state);
110void
111notify_keyboard_focus_out(struct weston_seat *seat);
112
113void
114notify_motion(struct weston_seat *seat, const struct timespec *time,
115 struct weston_pointer_motion_event *event);
116void
117notify_motion_absolute(struct weston_seat *seat, const struct timespec *time,
118 double x, double y);
119void
120notify_modifiers(struct weston_seat *seat, uint32_t serial);
121
122void
123notify_pointer_frame(struct weston_seat *seat);
124
125void
126notify_pointer_focus(struct weston_seat *seat, struct weston_output *output,
127 double x, double y);
128
129/* weston_touch_device */
130
131void
132notify_touch_normalized(struct weston_touch_device *device,
133 const struct timespec *time,
134 int touch_id,
135 double x, double y,
136 const struct weston_point2d_device_normalized *norm,
137 int touch_type);
138
139/** Feed in touch down, motion, and up events, non-calibratable device.
140 *
141 * @sa notify_touch_cal
142 */
143static inline void
144notify_touch(struct weston_touch_device *device, const struct timespec *time,
145 int touch_id, double x, double y, int touch_type)
146{
147 notify_touch_normalized(device, time, touch_id, x, y, NULL, touch_type);
148}
149
150void
151notify_touch_frame(struct weston_touch_device *device);
152
153void
154notify_touch_cancel(struct weston_touch_device *device);
155
156void
157notify_touch_calibrator(struct weston_touch_device *device,
158 const struct timespec *time, int32_t slot,
159 const struct weston_point2d_device_normalized *norm,
160 int touch_type);
161void
162notify_touch_calibrator_cancel(struct weston_touch_device *device);
163void
164notify_touch_calibrator_frame(struct weston_touch_device *device);
Marius Vlade41c1bf2019-07-16 23:11:25 +0300165
166#endif