26 #include <wayland-client.h>
29 #if defined(__GNUC__) && (__GNUC__ >= 4)
30 #define UWAC_API __attribute__((visibility("default")))
41 typedef uint32_t UwacSeatId;
48 UWAC_ERROR_UNABLE_TO_CONNECT,
49 UWAC_ERROR_INVALID_DISPLAY,
50 UWAC_NOT_ENOUGH_RESOURCES,
62 UWAC_MOD_SHIFT_MASK = 0x01,
63 UWAC_MOD_ALT_MASK = 0x02,
64 UWAC_MOD_CONTROL_MASK = 0x04,
65 UWAC_MOD_CAPS_MASK = 0x08,
66 UWAC_MOD_NUM_MASK = 0x10,
86 UWAC_EVENT_NEW_SEAT = 0,
87 UWAC_EVENT_REMOVED_SEAT,
88 UWAC_EVENT_NEW_OUTPUT,
90 UWAC_EVENT_POINTER_ENTER,
91 UWAC_EVENT_POINTER_LEAVE,
92 UWAC_EVENT_POINTER_MOTION,
93 UWAC_EVENT_POINTER_BUTTONS,
94 UWAC_EVENT_POINTER_AXIS,
95 UWAC_EVENT_KEYBOARD_ENTER,
96 UWAC_EVENT_KEYBOARD_MODIFIERS,
98 UWAC_EVENT_TOUCH_FRAME_BEGIN,
100 UWAC_EVENT_TOUCH_DOWN,
101 UWAC_EVENT_TOUCH_MOTION,
102 UWAC_EVENT_TOUCH_CANCEL,
103 UWAC_EVENT_TOUCH_FRAME_END,
104 UWAC_EVENT_FRAME_DONE,
106 UWAC_EVENT_CLIPBOARD_AVAILABLE,
107 UWAC_EVENT_CLIPBOARD_SELECT,
108 UWAC_EVENT_CLIPBOARD_OFFER,
109 UWAC_EVENT_OUTPUT_GEOMETRY,
110 UWAC_EVENT_POINTER_AXIS_DISCRETE,
111 UWAC_EVENT_POINTER_FRAME,
112 UWAC_EVENT_POINTER_SOURCE
118 UWAC_WINDOW_MAXIMIZED = 0x1,
119 UWAC_WINDOW_RESIZING = 0x2,
120 UWAC_WINDOW_FULLSCREEN = 0x4,
121 UWAC_WINDOW_ACTIVATED = 0x8,
185 enum wl_pointer_button_state state;
213 enum wl_pointer_axis_source axis_source;
301 UwacOutputNewEvent output_new;
302 UwacOutputGeometryEvent output_geometry;
303 UwacSeatNewEvent seat_new;
304 UwacSeatRemovedEvent seat_removed;
305 UwacPointerEnterLeaveEvent mouse_enter_leave;
306 UwacPointerMotionEvent mouse_motion;
307 UwacPointerButtonEvent mouse_button;
308 UwacPointerAxisEvent mouse_axis;
309 UwacPointerFrameEvent mouse_frame;
310 UwacPointerSourceEvent mouse_source;
311 UwacKeyboardEnterLeaveEvent keyboard_enter_leave;
312 UwacKeyboardModifiersEvent keyboard_modifiers;
313 UwacClipboardEvent clipboard;
315 UwacTouchFrameBegin touchFrameBegin;
317 UwacTouchDown touchDown;
318 UwacTouchMotion touchMotion;
319 UwacTouchFrameEnd touchFrameEnd;
320 UwacTouchCancel touchCancel;
321 UwacFrameDoneEvent frame_done;
322 UwacConfigureEvent configure;
323 UwacCloseEvent close;
327 typedef bool (*UwacErrorHandler)(UwacDisplay* d, UwacReturnCode code,
const char* msg, ...);
328 typedef void (*UwacDataTransferHandler)(UwacSeat* seat,
void* context,
const char* mime,
int fd);
329 typedef void (*UwacCancelDataTransferHandler)(UwacSeat* seat,
void* context);
343 UWAC_API
void UwacInstallErrorHandler(UwacErrorHandler handler);
352 UWAC_API UwacDisplay* UwacOpenDisplay(
const char* name, UwacReturnCode* err);
360 UWAC_API UwacReturnCode UwacCloseDisplay(UwacDisplay** pdisplay);
369 UWAC_API
int UwacDisplayGetFd(UwacDisplay* display);
377 UWAC_API
const char* UwacErrorString(UwacReturnCode error);
385 UWAC_API UwacReturnCode UwacDisplayGetLastError(
const UwacDisplay* display);
395 UWAC_API UwacReturnCode UwacDisplayQueryInterfaceVersion(
const UwacDisplay* display,
396 const char* name, uint32_t* version);
404 UWAC_API uint32_t UwacDisplayQueryGetNbShmFormats(UwacDisplay* display);
416 UWAC_API UwacReturnCode UwacDisplayQueryShmFormats(
const UwacDisplay* display,
417 enum wl_shm_format* formats,
418 int formats_size,
int* filled);
426 UWAC_API uint32_t UwacDisplayGetNbOutputs(
const UwacDisplay* display);
436 UWAC_API
const UwacOutput* UwacDisplayGetOutput(UwacDisplay* display,
int index);
445 UWAC_API UwacReturnCode UwacOutputGetResolution(
const UwacOutput* output, UwacSize* resolution);
454 UWAC_API UwacReturnCode UwacOutputGetPosition(
const UwacOutput* output, UwacPosition* pos);
466 UWAC_API UwacWindow* UwacCreateWindowShm(UwacDisplay* display, uint32_t width, uint32_t height,
467 enum wl_shm_format format);
475 UWAC_API UwacReturnCode UwacDestroyWindow(UwacWindow** window);
487 UWAC_API UwacReturnCode UwacWindowSetOpaqueRegion(UwacWindow* window, uint32_t x, uint32_t y,
488 uint32_t width, uint32_t height);
500 UWAC_API UwacReturnCode UwacWindowSetInputRegion(UwacWindow* window, uint32_t x, uint32_t y,
501 uint32_t width, uint32_t height);
508 UWAC_API
void* UwacWindowGetDrawingBuffer(UwacWindow* window);
520 UWAC_API UwacReturnCode UwacWindowAddDamage(UwacWindow* window, uint32_t x, uint32_t y,
521 uint32_t width, uint32_t height);
531 UWAC_API UwacReturnCode UwacWindowGetDrawingBufferGeometry(UwacWindow* window,
532 UwacSize* geometry,
size_t* stride);
542 UWAC_API UwacReturnCode UwacWindowSubmitBuffer(UwacWindow* window,
543 bool copyContentForNextFrame);
552 UWAC_API UwacReturnCode UwacWindowGetGeometry(UwacWindow* window, UwacSize* geometry);
564 UWAC_API UwacReturnCode UwacWindowSetFullscreenState(UwacWindow* window, UwacOutput* output,
573 UWAC_API
void UwacWindowSetTitle(UwacWindow* window,
const char* name);
581 UWAC_API
void UwacWindowSetAppId(UwacWindow* window,
const char* app_id);
589 UWAC_API
int UwacDisplayDispatch(UwacDisplay* display,
int timeout);
597 UWAC_API
bool UwacHasEvent(UwacDisplay* display);
606 UWAC_API UwacReturnCode UwacNextEvent(UwacDisplay* display, UwacEvent* event);
614 UWAC_API
const char* UwacSeatGetName(
const UwacSeat* seat);
622 UWAC_API UwacSeatId UwacSeatGetId(
const UwacSeat* seat);
627 UWAC_API UwacReturnCode UwacClipboardOfferDestroy(UwacSeat* seat);
628 UWAC_API UwacReturnCode UwacClipboardOfferCreate(UwacSeat* seat,
const char* mime);
629 UWAC_API UwacReturnCode UwacClipboardOfferAnnounce(UwacSeat* seat,
void* context,
630 UwacDataTransferHandler transfer,
631 UwacCancelDataTransferHandler cancel);
632 UWAC_API
void* UwacClipboardDataGet(UwacSeat* seat,
const char* mime,
size_t* size);
642 UWAC_API UwacReturnCode UwacSeatInhibitShortcuts(UwacSeat* seat,
bool inhibit);
660 UWAC_API UwacReturnCode UwacSeatSetMouseCursor(UwacSeat* seat,
const void* data,
size_t length,
661 size_t width,
size_t height,
size_t hot_x,
main connection object to a wayland display
an output on a wayland display
a seat attached to a wayland display