FreeRDP
Loading...
Searching...
No Matches
uwac-priv.h
1/*
2 * Copyright © 2014 David FORT <contact@hardening-consulting.com>
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22
23#ifndef UWAC_PRIV_H_
24#define UWAC_PRIV_H_
25
26#include <uwac/config.h>
27
28#include <stdbool.h>
29#include <wayland-client.h>
30#include "xdg-shell-client-protocol.h"
31#include "keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h"
32#include "xdg-decoration-unstable-v1-client-protocol.h"
33#include "server-decoration-client-protocol.h"
34#include "viewporter-client-protocol.h"
35#include "linux-dmabuf-v1-client-protocol.h"
36
37#ifdef BUILD_IVI
38#include "ivi-application-client-protocol.h"
39#endif
40#ifdef BUILD_FULLSCREEN_SHELL
41#include "fullscreen-shell-unstable-v1-client-protocol.h"
42#endif
43
44#ifdef UWAC_HAVE_PIXMAN_REGION
45#include <pixman-1/pixman.h>
46#else
47#include <freerdp/codec/region.h>
48#endif
49
50#include <xkbcommon/xkbcommon.h>
51
52#include <uwac/uwac.h>
53
54extern UwacErrorHandler uwacErrorHandler;
55
56typedef struct uwac_task UwacTask;
57
61{
62 void (*run)(UwacTask* task, uint32_t events);
63 struct wl_list link;
64};
65
69{
70 uint32_t name;
71 char* interface;
72 uint32_t version;
73 struct wl_list link;
74};
75typedef struct uwac_global UwacGlobal;
76
78typedef struct uwac_event_list_item UwacEventListItem;
79
83{
84 UwacEvent event;
85 UwacEventListItem *tail, *head;
86};
87
91{
92 struct wl_list globals;
93
94 struct wl_display* display;
95 struct wl_registry* registry;
96 struct wl_compositor* compositor;
97 struct wp_viewporter* viewporter;
98 struct wl_subcompositor* subcompositor;
99 struct wl_shell* shell;
100 struct xdg_toplevel* xdg_toplevel;
101 struct xdg_wm_base* xdg_base;
102 struct wl_data_device_manager* devicemanager;
103 struct zwp_keyboard_shortcuts_inhibit_manager_v1* keyboard_inhibit_manager;
104 struct zxdg_decoration_manager_v1* deco_manager;
105 struct org_kde_kwin_server_decoration_manager* kde_deco_manager;
106#ifdef BUILD_IVI
107 struct ivi_application* ivi_application;
108#endif
109#ifdef BUILD_FULLSCREEN_SHELL
110 struct zwp_fullscreen_shell_v1* fullscreen_shell;
111#endif
112
113 struct wl_shm* shm;
114 struct zwp_linux_dmabuf_v1* linux_dmabuf;
115 enum wl_shm_format* shm_formats;
116 uint32_t shm_formats_nb;
117 bool has_rgb565;
118
119 struct wl_data_device_manager* data_device_manager;
120 struct text_cursor_position* text_cursor_position;
121 struct workspace_manager* workspace_manager;
122
123 struct wl_list seats;
124
125 int display_fd;
126 UwacReturnCode last_error;
127 uint32_t display_fd_events;
128 int epoll_fd;
129 bool running;
130 UwacTask dispatch_fd_task;
131 uint32_t serial;
132 uint32_t pointer_focus_serial;
133 int actual_scale;
134
135 struct wl_list windows;
136
137 struct wl_list outputs;
138
139 UwacEventListItem *push_queue, *pop_queue;
140};
141
144{
145 UwacDisplay* display;
146
147 bool doneNeeded;
148 bool doneReceived;
149
150 UwacPosition position;
151 UwacSize resolution;
152 int transform;
153 int scale;
154 char* make;
155 char* model;
156 uint32_t server_output_id;
157 struct wl_output* output;
158
159 struct wl_list link;
160 char* name;
161 char* description;
162};
163
166{
167 UwacDisplay* display;
168 char* name;
169 struct wl_seat* seat;
170 uint32_t seat_id;
171 uint32_t seat_version;
172 struct wl_data_device* data_device;
173 struct wl_data_source* data_source;
174 struct wl_pointer* pointer;
175 struct wl_surface* pointer_surface;
176 struct wl_cursor_image* pointer_image;
177 struct wl_cursor_theme* cursor_theme;
178 struct wl_cursor* default_cursor;
179 void* pointer_data;
180 size_t pointer_size;
181 int pointer_type;
182 struct wl_keyboard* keyboard;
183 struct wl_touch* touch;
184 struct wl_data_offer* offer;
185 struct xkb_context* xkb_context;
186 struct zwp_keyboard_shortcuts_inhibitor_v1* keyboard_inhibitor;
187
188 struct
189 {
190 struct xkb_keymap* keymap;
191 struct xkb_state* state;
192 xkb_mod_mask_t control_mask;
193 xkb_mod_mask_t alt_mask;
194 xkb_mod_mask_t shift_mask;
195 xkb_mod_mask_t caps_mask;
196 xkb_mod_mask_t num_mask;
197 } xkb;
198 uint32_t modifiers;
199 int32_t repeat_rate_sec, repeat_rate_nsec;
200 int32_t repeat_delay_sec, repeat_delay_nsec;
201 uint32_t repeat_sym, repeat_key, repeat_time;
202
203 struct wl_array pressed_keys;
204
205 UwacWindow* pointer_focus;
206
207 UwacWindow* keyboard_focus;
208
209 UwacWindow* touch_focus;
210 bool touch_frame_started;
211
212 int repeat_timer_fd;
213 UwacTask repeat_task;
214 double sx, sy;
215 struct wl_list link;
216
217 void* data_context;
218 UwacDataTransferHandler transfer_data;
219 UwacCancelDataTransferHandler cancel_data;
220 bool ignore_announcement;
221};
222
225{
226 bool used;
227 bool dirty;
228#ifdef UWAC_HAVE_PIXMAN_REGION
229 pixman_region32_t damage;
230#else
231 REGION16 damage;
232#endif
233 struct wl_buffer* wayland_buffer;
234 void* data;
235 size_t size;
236};
237typedef struct uwac_buffer UwacBuffer;
238
241{
242 UwacDisplay* display;
243 int width, height, stride;
244 int surfaceStates;
245 enum wl_shm_format format;
246
247 size_t nbuffers;
248 UwacBuffer* buffers;
249
250 struct wl_region* opaque_region;
251 struct wl_region* input_region;
252 ssize_t drawingBufferIdx;
253 ssize_t pendingBufferIdx;
254 struct wl_surface* surface;
255 struct wp_viewport* viewport;
256 struct wl_shell_surface* shell_surface;
257 struct xdg_surface* xdg_surface;
258 struct xdg_toplevel* xdg_toplevel;
259 struct zxdg_toplevel_decoration_v1* deco;
260 struct org_kde_kwin_server_decoration* kde_deco;
261#ifdef BUILD_IVI
262 struct ivi_surface* ivi_surface;
263#endif
264 struct wl_list link;
265
266 uint32_t pointer_enter_serial;
267 uint32_t pointer_cursor_serial;
268 int pointer_current_cursor;
269};
270
273{
274 UwacWindow* window;
275 size_t bufferIdx;
276};
277typedef struct uwac_buffer_release_data UwacBufferReleaseData;
278
279/* in uwa-display.c */
280UwacEvent* UwacDisplayNewEvent(UwacDisplay* d, int type);
281int UwacDisplayWatchFd(UwacDisplay* display, int fd, uint32_t events, UwacTask* task);
282
283/* in uwac-input.c */
284UwacSeat* UwacSeatNew(UwacDisplay* d, uint32_t id, uint32_t version);
285void UwacSeatDestroy(UwacSeat* s);
286
287/* in uwac-output.c */
288UwacOutput* UwacCreateOutput(UwacDisplay* d, uint32_t id, uint32_t version);
289int UwacDestroyOutput(UwacOutput* output);
290
291UwacReturnCode UwacSeatRegisterClipboard(UwacSeat* s);
292
293#endif /* UWAC_PRIV_H_ */
data to pass to wl_buffer release listener
Definition uwac-priv.h:273
a buffer used for drawing a surface frame
Definition uwac-priv.h:225
main connection object to a wayland display
Definition uwac-priv.h:91
double linked list element
Definition uwac-priv.h:83
a global registry object
Definition uwac-priv.h:69
an output on a wayland display
Definition uwac-priv.h:144
a seat attached to a wayland display
Definition uwac-priv.h:166
task struct
Definition uwac-priv.h:61
a window
Definition uwac-priv.h:241