Marius Vlad | e41c1bf | 2019-07-16 23:11:25 +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_BACKEND_INTERNAL_H |
| 29 | #define LIBWESTON_BACKEND_INTERNAL_H |
| 30 | |
| 31 | /* weston_head */ |
| 32 | |
| 33 | void |
| 34 | weston_head_init(struct weston_head *head, const char *name); |
| 35 | |
| 36 | void |
| 37 | weston_head_release(struct weston_head *head); |
| 38 | |
| 39 | void |
| 40 | weston_head_set_connection_status(struct weston_head *head, bool connected); |
| 41 | |
| 42 | void |
| 43 | weston_head_set_internal(struct weston_head *head); |
| 44 | |
| 45 | void |
| 46 | weston_head_set_monitor_strings(struct weston_head *head, |
| 47 | const char *make, |
| 48 | const char *model, |
| 49 | const char *serialno); |
| 50 | void |
| 51 | weston_head_set_non_desktop(struct weston_head *head, bool non_desktop); |
| 52 | |
| 53 | void |
| 54 | weston_head_set_physical_size(struct weston_head *head, |
| 55 | int32_t mm_width, int32_t mm_height); |
| 56 | |
| 57 | void |
| 58 | weston_head_set_subpixel(struct weston_head *head, |
| 59 | enum wl_output_subpixel sp); |
Marius Vlad | 63ef078 | 2019-07-16 23:34:14 +0300 | [diff] [blame] | 60 | /* weston_output */ |
| 61 | |
| 62 | void |
| 63 | weston_output_init(struct weston_output *output, |
| 64 | struct weston_compositor *compositor, |
| 65 | const char *name); |
| 66 | void |
| 67 | weston_output_damage(struct weston_output *output); |
| 68 | |
| 69 | void |
| 70 | weston_output_move(struct weston_output *output, int x, int y); |
| 71 | |
| 72 | void |
| 73 | weston_output_release(struct weston_output *output); |
| 74 | |
| 75 | void |
| 76 | weston_output_init_zoom(struct weston_output *output); |
| 77 | |
| 78 | void |
| 79 | weston_output_finish_frame(struct weston_output *output, |
| 80 | const struct timespec *stamp, |
| 81 | uint32_t presented_flags); |
| 82 | int |
| 83 | weston_output_mode_set_native(struct weston_output *output, |
| 84 | struct weston_mode *mode, |
| 85 | int32_t scale); |
| 86 | void |
| 87 | weston_output_transform_coordinate(struct weston_output *output, |
| 88 | double device_x, double device_y, |
| 89 | double *x, double *y); |
| 90 | |
Marius Vlad | 5d649b6 | 2019-07-16 23:44:21 +0300 | [diff] [blame^] | 91 | /* weston_seat */ |
| 92 | |
| 93 | void |
| 94 | notify_axis(struct weston_seat *seat, const struct timespec *time, |
| 95 | struct weston_pointer_axis_event *event); |
| 96 | void |
| 97 | notify_axis_source(struct weston_seat *seat, uint32_t source); |
| 98 | |
| 99 | void |
| 100 | notify_button(struct weston_seat *seat, const struct timespec *time, |
| 101 | int32_t button, enum wl_pointer_button_state state); |
| 102 | |
| 103 | void |
| 104 | notify_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); |
| 107 | void |
| 108 | notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys, |
| 109 | enum weston_key_state_update update_state); |
| 110 | void |
| 111 | notify_keyboard_focus_out(struct weston_seat *seat); |
| 112 | |
| 113 | void |
| 114 | notify_motion(struct weston_seat *seat, const struct timespec *time, |
| 115 | struct weston_pointer_motion_event *event); |
| 116 | void |
| 117 | notify_motion_absolute(struct weston_seat *seat, const struct timespec *time, |
| 118 | double x, double y); |
| 119 | void |
| 120 | notify_modifiers(struct weston_seat *seat, uint32_t serial); |
| 121 | |
| 122 | void |
| 123 | notify_pointer_frame(struct weston_seat *seat); |
| 124 | |
| 125 | void |
| 126 | notify_pointer_focus(struct weston_seat *seat, struct weston_output *output, |
| 127 | double x, double y); |
| 128 | |
| 129 | /* weston_touch_device */ |
| 130 | |
| 131 | void |
| 132 | notify_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 | */ |
| 143 | static inline void |
| 144 | notify_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 | |
| 150 | void |
| 151 | notify_touch_frame(struct weston_touch_device *device); |
| 152 | |
| 153 | void |
| 154 | notify_touch_cancel(struct weston_touch_device *device); |
| 155 | |
| 156 | void |
| 157 | notify_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); |
| 161 | void |
| 162 | notify_touch_calibrator_cancel(struct weston_touch_device *device); |
| 163 | void |
| 164 | notify_touch_calibrator_frame(struct weston_touch_device *device); |
Marius Vlad | e41c1bf | 2019-07-16 23:11:25 +0300 | [diff] [blame] | 165 | |
| 166 | #endif |