20 #ifdef WITH_GHOST_WAYLAND_DYNLOAD
26 #ifdef WITH_GHOST_WAYLAND_DYNLOAD
29 #include <wayland-egl.h>
35 #include <unordered_map>
36 #include <unordered_set>
38 #ifdef WITH_GHOST_WAYLAND_DYNLOAD
41 #include <wayland-cursor.h>
45 #include <xkbcommon/xkbcommon.h>
48 #include <pointer-constraints-unstable-v1-client-protocol.h>
49 #include <relative-pointer-unstable-v1-client-protocol.h>
50 #include <tablet-unstable-v2-client-protocol.h>
51 #include <xdg-output-unstable-v1-client-protocol.h>
74 #define USE_GNOME_CONFINE_HACK
81 #ifdef USE_GNOME_CONFINE_HACK
97 #define BTN_LEFT 0x110
98 #define BTN_RIGHT 0x111
99 #define BTN_MIDDLE 0x112
100 #define BTN_SIDE 0x113
101 #define BTN_EXTRA 0x114
102 #define BTN_FORWARD 0x115
103 #define BTN_BACK 0x116
109 #define BTN_STYLUS 0x14b
110 #define BTN_STYLUS2 0x14c
112 #define BTN_STYLUS3 0x149
129 #define EVDEV_OFFSET 8
143 struct wl_cursor_image
wl_image = {0};
168 std::unordered_set<std::string>
types;
171 struct wl_data_offer *
id =
nullptr;
175 wl_fixed_t
xy[2] = {0, 0};
229 wl_fixed_t
xy[2] = {0, 0};
284 #ifdef USE_GNOME_CONFINE_HACK
342 #ifdef WITH_GHOST_WAYLAND_LIBDECOR
343 struct libdecor *decor_context =
nullptr;
350 struct wl_shm *
shm =
nullptr;
381 fprintf(stderr,
"GHOST/Wayland: ");
382 vfprintf(stderr, msg, arg);
386 backtrace_fn(stderr);
392 if (
input->pointer.serial ==
input->cursor_source_serial) {
393 return &
input->pointer;
395 if (
input->tablet.serial ==
input->cursor_source_serial) {
396 return &
input->tablet;
402 const wl_surface *wl_surface)
405 return &
input->pointer;
408 return &
input->tablet;
410 GHOST_ASSERT(0,
"Surface found without pointer/tablet tag");
416 if (d->data_device_manager) {
417 wl_data_device_manager_destroy(d->data_device_manager);
420 if (d->tablet_manager) {
421 zwp_tablet_manager_v2_destroy(d->tablet_manager);
425 wl_output_destroy(
output->wl_output);
434 std::lock_guard
lock{
input->data_source_mutex};
435 if (
input->data_source) {
437 if (
input->data_source->data_source) {
438 wl_data_source_destroy(
input->data_source->data_source);
440 delete input->data_source;
445 std::lock_guard
lock{
input->data_offer_dnd_mutex};
446 if (
input->data_offer_dnd) {
447 wl_data_offer_destroy(
input->data_offer_dnd->id);
448 delete input->data_offer_dnd;
453 std::lock_guard
lock{
input->data_offer_copy_paste_mutex};
454 if (
input->data_offer_copy_paste) {
455 wl_data_offer_destroy(
input->data_offer_copy_paste->id);
456 delete input->data_offer_copy_paste;
460 if (
input->data_device) {
461 wl_data_device_release(
input->data_device);
464 if (
input->cursor.custom_data) {
465 munmap(
input->cursor.custom_data,
input->cursor.custom_data_size);
468 if (
input->wl_pointer) {
469 if (
input->cursor.wl_surface) {
470 wl_surface_destroy(
input->cursor.wl_surface);
472 if (
input->cursor.wl_theme) {
475 if (
input->wl_pointer) {
476 wl_pointer_destroy(
input->wl_pointer);
479 if (
input->wl_keyboard) {
480 if (
input->key_repeat.timer) {
483 wl_keyboard_destroy(
input->wl_keyboard);
487 xkb_state_unref(
input->xkb_state);
488 xkb_state_unref(
input->xkb_state_empty);
489 xkb_state_unref(
input->xkb_state_empty_with_numlock);
491 xkb_context_unref(
input->xkb_context);
493 wl_seat_destroy(
input->wl_seat);
498 wl_shm_destroy(d->shm);
501 if (d->relative_pointer_manager) {
502 zwp_relative_pointer_manager_v1_destroy(d->relative_pointer_manager);
505 if (d->pointer_constraints) {
506 zwp_pointer_constraints_v1_destroy(d->pointer_constraints);
510 wl_compositor_destroy(d->compositor);
513 #ifdef WITH_GHOST_WAYLAND_LIBDECOR
514 if (d->decor_context) {
518 if (d->xdg_decoration_manager) {
519 zxdg_decoration_manager_v1_destroy(d->xdg_decoration_manager);
523 xdg_wm_base_destroy(d->xdg_shell);
528 ::eglTerminate(eglGetDisplay(EGLNativeDisplayType(d->display)));
542 if (
sym >= XKB_KEY_0 &&
sym <= XKB_KEY_9) {
545 else if (
sym >= XKB_KEY_KP_0 &&
sym <= XKB_KEY_KP_9) {
548 else if (
sym >= XKB_KEY_A &&
sym <= XKB_KEY_Z) {
551 else if (
sym >= XKB_KEY_a &&
sym <= XKB_KEY_z) {
554 else if (
sym >= XKB_KEY_F1 &&
sym <= XKB_KEY_F24) {
559 #define GXMAP(k, x, y) \
659 "unhandled key: " <<
std::hex << std::showbase <<
sym <<
660 std::dec <<
" (" <<
sym <<
"), " <<
662 "scan-code: " <<
std::hex << std::showbase << key <<
663 std::dec <<
" (" << key <<
")" <<
675 switch (wl_tablet_tool_type) {
676 case ZWP_TABLET_TOOL_V2_TYPE_ERASER: {
679 case ZWP_TABLET_TOOL_V2_TYPE_PEN:
680 case ZWP_TABLET_TOOL_V2_TYPE_BRUSH:
681 case ZWP_TABLET_TOOL_V2_TYPE_PENCIL:
682 case ZWP_TABLET_TOOL_V2_TYPE_AIRBRUSH:
683 case ZWP_TABLET_TOOL_V2_TYPE_FINGER:
684 case ZWP_TABLET_TOOL_V2_TYPE_MOUSE:
685 case ZWP_TABLET_TOOL_V2_TYPE_LENS: {
690 GHOST_PRINT(
"unknown tablet tool: " << wl_tablet_tool_type << std::endl);
696 static const std::unordered_map<GHOST_TStandardCursor, const char *>
cursors = {
741 static const std::unordered_map<std::string, GHOST_TDragnDropTypes>
mime_dnd = {
758 "text/plain;charset=utf-8",
764 #ifdef HAVE_MEMFD_CREATE
765 const int fd = memfd_create(name, MFD_CLOEXEC | MFD_ALLOW_SEALING);
767 fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
771 char *path = getenv(
"XDG_RUNTIME_DIR");
777 asprintf(&tmpname,
"%s/%s-XXXXXX", path, name);
778 const int fd = mkostemp(tmpname, O_CLOEXEC);
790 case WL_SHM_FORMAT_ARGB8888: {
810 enum wl_shm_format
format,
811 void **r_buffer_data,
812 size_t *r_buffer_data_size)
815 wl_buffer *
buffer =
nullptr;
818 const int32_t buffer_size = buffer_stride * size_xy[1];
819 if (posix_fallocate(fd, 0, buffer_size) == 0) {
820 void *buffer_data = mmap(
nullptr, buffer_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
821 if (buffer_data != MAP_FAILED) {
822 struct wl_shm_pool *
pool = wl_shm_create_pool(shm, fd, buffer_size);
824 wl_shm_pool_destroy(
pool);
826 *r_buffer_data = buffer_data;
827 *r_buffer_data_size = (size_t)buffer_size;
831 munmap(buffer_data, buffer_size);
850 #define LOG (&LOG_WL_RELATIVE_POINTER)
857 const wl_fixed_t
xy[2])
859 const wl_fixed_t scale = win->
scale();
864 #ifdef USE_GNOME_CONFINE_HACK
865 if (
input->use_pointer_software_confine) {
882 wl_fixed_to_int(scale *
input->pointer.xy[0]),
883 wl_fixed_to_int(scale *
input->pointer.xy[1]),
889 struct zwp_relative_pointer_v1 * ,
898 if (wl_surface *focus_surface =
input->pointer.wl_surface) {
901 const wl_fixed_t scale = win->
scale();
902 const wl_fixed_t xy_next[2] = {
903 input->pointer.xy[0] + (dx / scale),
904 input->pointer.xy[1] + (dy / scale),
926 #define LOG (&LOG_WL_DATA_SOURCE)
931 if (wl_surface *focus_surface =
input->focus_dnd) {
933 const wl_fixed_t scale = win->
scale();
934 const int event_xy[2] = {
935 wl_fixed_to_int(scale *
input->data_offer_dnd->dnd.xy[0]),
936 wl_fixed_to_int(scale *
input->data_offer_dnd->dnd.xy[1]),
948 const std::string mime_receive,
955 wl_data_offer_receive(data_offer->
id, mime_receive.c_str(), pipefd[1]);
958 data_offer->
in_use.store(
false);
983 struct wl_data_source * ,
990 struct wl_data_source * ,
995 std::lock_guard
lock{
input->data_source_mutex};
999 const char *
const buffer =
input->data_source->buffer_out;
1001 GHOST_PRINT(
"error writing to clipboard: " << std::strerror(errno) << std::endl);
1009 wl_data_source_destroy(wl_data_source);
1020 struct wl_data_source * )
1033 struct wl_data_source * )
1046 struct wl_data_source * ,
1049 CLOG_INFO(
LOG, 2,
"handle_action (dnd_action=%u)", dnd_action);
1070 #define LOG (&LOG_WL_DATA_OFFER)
1073 struct wl_data_offer * ,
1074 const char *mime_type)
1081 struct wl_data_offer * ,
1084 CLOG_INFO(
LOG, 2,
"source_actions (%u)", source_actions);
1089 struct wl_data_offer * ,
1111 #define LOG (&LOG_WL_DATA_DEVICE)
1114 struct wl_data_device * ,
1115 struct wl_data_offer *
id)
1120 data_offer->
id =
id;
1125 struct wl_data_device * ,
1130 struct wl_data_offer *
id)
1139 std::lock_guard
lock{
input->data_offer_dnd_mutex};
1141 input->data_offer_dnd =
static_cast<data_offer_t *
>(wl_data_offer_get_user_data(
id));
1144 data_offer->
in_use.store(
true);
1145 data_offer->
dnd.
xy[0] =
x;
1146 data_offer->
dnd.
xy[1] =
y;
1148 wl_data_offer_set_actions(
id,
1149 WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY |
1150 WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE,
1151 WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY);
1154 wl_data_offer_accept(
id, serial,
type.c_str());
1164 std::lock_guard
lock{
input->data_offer_dnd_mutex};
1169 input->focus_dnd =
nullptr;
1171 if (
input->data_offer_dnd && !
input->data_offer_dnd->in_use.load()) {
1172 wl_data_offer_destroy(
input->data_offer_dnd->id);
1173 delete input->data_offer_dnd;
1174 input->data_offer_dnd =
nullptr;
1179 struct wl_data_device * ,
1185 std::lock_guard
lock{
input->data_offer_dnd_mutex};
1189 input->data_offer_dnd->dnd.xy[0] =
x;
1190 input->data_offer_dnd->dnd.xy[1] =
y;
1198 std::lock_guard
lock{
input->data_offer_dnd_mutex};
1206 data_offer->
types.begin(),
1207 data_offer->
types.end());
1212 const std::string mime_receive) {
1215 const std::string
data =
read_pipe(data_offer, mime_receive,
nullptr);
1217 wl_data_offer_finish(data_offer->
id);
1218 wl_data_offer_destroy(data_offer->
id);
1221 data_offer =
nullptr;
1226 static constexpr
const char *file_proto =
"file://";
1227 static constexpr
const char *crlf =
"\r\n";
1230 std::vector<std::string> uris;
1235 const size_t start =
pos +
sizeof(file_proto) - 1;
1237 const size_t end =
pos;
1239 if (
pos == std::string::npos) {
1242 uris.push_back(
data.substr(start, end - start));
1247 flist->
count = int(uris.size());
1249 for (
size_t i = 0; i < uris.size(); i++) {
1251 memcpy(flist->
strings[i], uris[i].data(), uris[i].size() + 1);
1254 const wl_fixed_t scale = win->
scale();
1259 wl_fixed_to_int(scale *
xy[0]),
1260 wl_fixed_to_int(scale *
xy[1]),
1272 std::thread read_thread(read_uris_fn,
input, data_offer,
input->focus_dnd, mime_receive);
1273 read_thread.detach();
1277 struct wl_data_device * ,
1278 struct wl_data_offer *
id)
1282 std::lock_guard
lock{
input->data_offer_copy_paste_mutex};
1287 if (data_offer !=
nullptr) {
1288 wl_data_offer_destroy(data_offer->
id);
1290 data_offer =
nullptr;
1293 if (
id ==
nullptr) {
1300 data_offer =
static_cast<data_offer_t *
>(wl_data_offer_get_user_data(
id));
1301 input->data_offer_copy_paste = data_offer;
1305 input->data_offer_copy_paste_mutex.lock();
1308 std::string mime_receive;
1311 mime_receive =
type;
1316 data_offer, mime_receive, &
input->data_offer_copy_paste_mutex);
1324 std::thread read_thread(read_selection_fn,
input);
1325 read_thread.detach();
1346 #define LOG (&LOG_WL_CURSOR_BUFFER)
1353 wl_buffer_destroy(wl_buffer);
1374 #define LOG (&LOG_WL_CURSOR_SURFACE)
1379 wl_surface *cursor_surface)
1383 if (
output->scale > scale) {
1388 if (scale > 0 && input_state->
theme_scale != scale) {
1391 wl_surface_set_buffer_scale(cursor_surface, scale);
1401 struct wl_surface *wl_surface,
1402 struct wl_output *
output)
1413 input_state->
outputs.insert(reg_output);
1418 struct wl_surface *wl_surface,
1419 struct wl_output *
output)
1430 input_state->
outputs.erase(reg_output);
1448 #define LOG (&LOG_WL_POINTER)
1451 struct wl_pointer * ,
1454 const wl_fixed_t surface_x,
1455 const wl_fixed_t surface_y)
1468 input->cursor_source_serial = serial;
1469 input->pointer.serial = serial;
1470 input->pointer.xy[0] = surface_x;
1471 input->pointer.xy[1] = surface_y;
1476 const wl_fixed_t scale = win->
scale();
1480 wl_fixed_to_int(scale *
input->pointer.xy[0]),
1481 wl_fixed_to_int(scale *
input->pointer.xy[1]),
1486 struct wl_pointer * ,
1491 static_cast<input_t *
>(
data)->pointer.wl_surface =
nullptr;
1503 struct wl_pointer * ,
1505 const wl_fixed_t surface_x,
1506 const wl_fixed_t surface_y)
1509 input->pointer.xy[0] = surface_x;
1510 input->pointer.xy[1] = surface_y;
1512 if (wl_surface *focus_surface =
input->pointer.wl_surface) {
1515 const wl_fixed_t scale = win->
scale();
1519 wl_fixed_to_int(scale *
input->pointer.xy[0]),
1520 wl_fixed_to_int(scale *
input->pointer.xy[1]),
1529 struct wl_pointer * ,
1540 case WL_POINTER_BUTTON_STATE_RELEASED:
1543 case WL_POINTER_BUTTON_STATE_PRESSED:
1573 input->data_source_serial = serial;
1574 input->pointer.buttons.set(ebutton,
state == WL_POINTER_BUTTON_STATE_PRESSED);
1576 if (wl_surface *focus_surface =
input->pointer.wl_surface) {
1584 struct wl_pointer * ,
1587 const wl_fixed_t value)
1589 CLOG_INFO(
LOG, 2,
"axis (axis=%u, value=%d)", axis, value);
1597 struct wl_pointer * ,
1600 CLOG_INFO(
LOG, 2,
"axis_source (axis_source=%u)", axis_source);
1603 struct wl_pointer * ,
1610 struct wl_pointer * ,
1614 CLOG_INFO(
LOG, 2,
"axis_discrete (axis=%u, discrete=%d)", axis, discrete);
1617 if (axis != WL_POINTER_AXIS_VERTICAL_SCROLL) {
1621 if (wl_surface *focus_surface =
input->pointer.wl_surface) {
1624 input->system->getMilliSeconds(), win, std::signbit(discrete) ? +1 : -1));
1649 #define LOG (&LOG_WL_TABLET_TOOL)
1652 struct zwp_tablet_tool_v2 * ,
1663 struct zwp_tablet_tool_v2 * ,
1672 struct zwp_tablet_tool_v2 * ,
1680 struct zwp_tablet_tool_v2 * ,
1685 "capability (tilt=%d, distance=%d, rotation=%d, slider=%d, wheel=%d)",
1686 (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_TILT) != 0,
1687 (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_DISTANCE) != 0,
1688 (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_ROTATION) != 0,
1689 (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_SLIDER) != 0,
1690 (capability & ZWP_TABLET_TOOL_V2_CAPABILITY_WHEEL) != 0);
1694 struct zwp_tablet_tool_v2 * )
1708 input->tablet_tools.erase(zwp_tablet_tool_v2);
1713 struct zwp_tablet_tool_v2 * ,
1715 struct zwp_tablet_v2 * ,
1728 input->cursor_source_serial = serial;
1730 input->tablet.serial = serial;
1732 input->data_source_serial = serial;
1749 struct zwp_tablet_tool_v2 * )
1759 struct zwp_tablet_tool_v2 * ,
1769 input->data_source_serial = serial;
1770 input->tablet.buttons.set(ebutton,
true);
1772 if (wl_surface *focus_surface =
input->tablet.wl_surface) {
1775 input->system->getMilliSeconds(), etype, win, ebutton, tool_input->
data));
1788 input->tablet.buttons.set(ebutton,
false);
1790 if (wl_surface *focus_surface =
input->tablet.wl_surface) {
1793 input->system->getMilliSeconds(), etype, win, ebutton, tool_input->
data));
1798 struct zwp_tablet_tool_v2 * ,
1814 struct zwp_tablet_tool_v2 * ,
1817 const float pressure_unit = (
float)pressure / 65535;
1825 struct zwp_tablet_tool_v2 * ,
1832 struct zwp_tablet_tool_v2 * ,
1833 const wl_fixed_t tilt_x,
1834 const wl_fixed_t tilt_y)
1837 const float tilt_unit[2] = {
1838 (
float)(wl_fixed_to_double(tilt_x) / 90.0),
1839 (
float)(wl_fixed_to_double(tilt_y) / 90.0),
1844 td.
Xtilt = tilt_unit[0];
1845 td.
Ytilt = tilt_unit[1];
1851 struct zwp_tablet_tool_v2 * ,
1852 const wl_fixed_t degrees)
1854 CLOG_INFO(
LOG, 2,
"rotation (degrees=%.4f)", wl_fixed_to_double(degrees));
1858 struct zwp_tablet_tool_v2 * ,
1864 struct zwp_tablet_tool_v2 * ,
1875 if (wl_surface *focus_surface =
input->tablet.wl_surface) {
1881 struct zwp_tablet_tool_v2 * ,
1893 case WL_POINTER_BUTTON_STATE_RELEASED:
1896 case WL_POINTER_BUTTON_STATE_PRESSED:
1914 input->data_source_serial = serial;
1915 input->tablet.buttons.set(ebutton,
state == WL_POINTER_BUTTON_STATE_PRESSED);
1917 if (wl_surface *focus_surface =
input->tablet.wl_surface) {
1920 input->system->getMilliSeconds(), etype, win, ebutton, tool_input->
data));
1924 struct zwp_tablet_tool_v2 * ,
1933 if (wl_surface *focus_surface =
input->tablet.wl_surface) {
1935 const wl_fixed_t scale = win->
scale();
1939 wl_fixed_to_int(scale *
input->tablet.xy[0]),
1940 wl_fixed_to_int(scale *
input->tablet.xy[1]),
1948 input->tablet.wl_surface =
nullptr;
1983 #define LOG (&LOG_WL_TABLET_SEAT)
1986 struct zwp_tablet_seat_v2 * ,
1987 struct zwp_tablet_v2 *
id)
1993 struct zwp_tablet_seat_v2 * ,
1994 struct zwp_tablet_tool_v2 *
id)
2010 input->tablet_tools.insert(
id);
2014 struct zwp_tablet_seat_v2 * ,
2015 struct zwp_tablet_pad_v2 *
id)
2035 #define LOG (&LOG_WL_KEYBOARD)
2038 struct wl_keyboard * ,
2045 if ((!
data) || (
format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1)) {
2046 CLOG_INFO(
LOG, 2,
"keymap (no data or wrong version)");
2051 char *map_str =
static_cast<char *
>(mmap(
nullptr,
size, PROT_READ, MAP_PRIVATE, fd, 0));
2052 if (map_str == MAP_FAILED) {
2054 throw std::runtime_error(
"keymap mmap failed: " + std::string(std::strerror(errno)));
2057 struct xkb_keymap *keymap = xkb_keymap_new_from_string(
2058 input->xkb_context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
2059 munmap(map_str,
size);
2070 xkb_state_unref(
input->xkb_state);
2071 input->xkb_state = xkb_state_new(keymap);
2073 xkb_state_unref(
input->xkb_state_empty);
2074 input->xkb_state_empty = xkb_state_new(keymap);
2076 xkb_state_unref(
input->xkb_state_empty_with_numlock);
2077 input->xkb_state_empty_with_numlock =
nullptr;
2080 const xkb_mod_index_t mod2 = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_NUM);
2081 const xkb_mod_index_t num = xkb_keymap_mod_get_index(keymap,
"NumLock");
2082 if (num != XKB_MOD_INVALID && mod2 != XKB_MOD_INVALID) {
2083 input->xkb_state_empty_with_numlock = xkb_state_new(keymap);
2084 xkb_state_update_mask(
2085 input->xkb_state_empty_with_numlock, (1 << mod2), 0, (1 << num), 0, 0, 0);
2089 xkb_keymap_unref(keymap);
2099 struct wl_keyboard * ,
2111 input->keyboard.serial = serial;
2122 struct wl_keyboard * ,
2133 input->keyboard.wl_surface =
nullptr;
2136 if (
input->key_repeat.timer) {
2146 struct xkb_state *xkb_state_empty,
2147 struct xkb_state *xkb_state_empty_with_numlock,
2148 const xkb_keycode_t key)
2151 xkb_keysym_t
sym = xkb_state_key_get_one_sym(xkb_state_empty, key);
2161 if (xkb_state_empty_with_numlock && (
sym >= XKB_KEY_KP_Home &&
sym <= XKB_KEY_KP_Delete)) {
2162 const xkb_keysym_t sym_test = xkb_state_key_get_one_sym(xkb_state_empty_with_numlock, key);
2163 if (sym_test != XKB_KEY_NoSymbol) {
2173 GHOST_ASSERT(
input->key_repeat.timer !=
nullptr,
"Caller much check for timer");
2175 input->system->removeTimer(
input->key_repeat.timer);
2176 input->key_repeat.timer =
nullptr;
2186 GHOST_ASSERT(
input->key_repeat.timer !=
nullptr,
"Caller much check for timer");
2191 input->system->removeTimer(
input->key_repeat.timer);
2193 const uint64_t time_start = use_delay ?
input->key_repeat.delay : time_step;
2194 input->key_repeat.timer = system->
installTimer(time_start, time_step, key_repeat_fn, payload);
2198 struct wl_keyboard * ,
2208 input->xkb_state_empty,
input->xkb_state_empty_with_numlock, key_code);
2209 if (
sym == XKB_KEY_NoSymbol) {
2217 case WL_KEYBOARD_KEY_STATE_RELEASED:
2220 case WL_KEYBOARD_KEY_STATE_PRESSED:
2228 if (
input->key_repeat.timer) {
2229 enum { NOP = 1, RESET, CANCEL } timer_action = NOP;
2231 input->key_repeat.timer->getUserData());
2233 if (
input->key_repeat.rate == 0) {
2235 timer_action = CANCEL;
2239 timer_action = CANCEL;
2241 else if (xkb_keymap_key_repeats(xkb_state_get_keymap(
input->xkb_state),
key_code)) {
2244 timer_action = CANCEL;
2252 timer_action = RESET;
2256 switch (timer_action) {
2259 key_repeat_payload =
nullptr;
2264 input->system->removeTimer(
input->key_repeat.timer);
2265 input->key_repeat.timer =
nullptr;
2269 delete key_repeat_payload;
2270 key_repeat_payload =
nullptr;
2272 input->system->removeTimer(
input->key_repeat.timer);
2273 input->key_repeat.timer =
nullptr;
2282 xkb_state_key_get_utf8(
input->xkb_state,
key_code, utf8_buf,
sizeof(utf8_buf));
2285 input->data_source_serial = serial;
2287 if (wl_surface *focus_surface =
input->keyboard.wl_surface) {
2289 input->system->pushEvent(
2294 if (key_repeat_payload ==
nullptr) {
2297 xkb_keymap_key_repeats(xkb_state_get_keymap(
input->xkb_state),
key_code)) {
2301 .key_data = {.gkey =
gkey},
2306 if (key_repeat_payload) {
2309 task->getUserData());
2312 if (wl_surface *focus_surface =
input->keyboard.wl_surface) {
2317 xkb_state_key_get_utf8(
input->xkb_state, payload->
key_code, utf8_buf,
sizeof(utf8_buf));
2326 input->key_repeat.timer =
input->system->installTimer(
2327 input->key_repeat.delay, 1000 /
input->key_repeat.rate, key_repeat_fn, key_repeat_payload);
2332 struct wl_keyboard * ,
2342 xkb_state_update_mask(
input->xkb_state, mods_depressed, mods_latched, mods_locked, 0, 0, group);
2346 if (
input->key_repeat.timer) {
2352 struct wl_keyboard * ,
2356 CLOG_INFO(
LOG, 2,
"info (rate=%d, delay=%d)", rate, delay);
2359 input->key_repeat.rate = rate;
2360 input->key_repeat.delay = delay;
2363 if (
input->key_repeat.timer) {
2386 #define LOG (&LOG_WL_SEAT)
2389 struct wl_seat *wl_seat,
2394 "capabilities (pointer=%d, keyboard=%d, touch=%d)",
2395 (capabilities & WL_SEAT_CAPABILITY_POINTER) != 0,
2396 (capabilities & WL_SEAT_CAPABILITY_KEYBOARD) != 0,
2397 (capabilities & WL_SEAT_CAPABILITY_TOUCH) != 0);
2400 input->wl_pointer =
nullptr;
2401 input->wl_keyboard =
nullptr;
2403 if (capabilities & WL_SEAT_CAPABILITY_POINTER) {
2404 input->wl_pointer = wl_seat_get_pointer(wl_seat);
2405 input->cursor.wl_surface = wl_compositor_create_surface(
input->system->compositor());
2406 input->cursor.visible =
true;
2407 input->cursor.wl_buffer =
nullptr;
2409 input->cursor.theme_name = std::string();
2418 if (capabilities & WL_SEAT_CAPABILITY_KEYBOARD) {
2419 input->wl_keyboard = wl_seat_get_keyboard(wl_seat);
2427 static_cast<input_t *
>(
data)->name = std::string(name);
2444 #define LOG (&LOG_WL_XDG_OUTPUT)
2447 struct zxdg_output_v1 * ,
2454 output->position_logical[0] =
x;
2455 output->position_logical[1] =
y;
2456 output->has_position_logical =
true;
2460 struct zxdg_output_v1 * ,
2467 if (
output->size_logical[0] != 0 &&
output->size_logical[1] != 0) {
2475 if ((
output->size_logical[0] ==
width) && (
output->scale_fractional == wl_fixed_from_int(1))) {
2476 GHOST_PRINT(
"xdg_output scale did not match, overriding with wl_output scale");
2478 #ifdef USE_GNOME_CONFINE_HACK
2490 output->has_size_logical =
true;
2499 if (zxdg_output_v1_get_version(
output->xdg_output) < 3) {
2505 struct zxdg_output_v1 * ,
2512 struct zxdg_output_v1 * ,
2513 const char *description)
2515 CLOG_INFO(
LOG, 2,
"description (description=\"%s\")", description);
2535 #define LOG (&LOG_WL_OUTPUT)
2538 struct wl_output * ,
2542 const int32_t physical_height,
2550 "geometry (make=\"%s\", model=\"%s\", transform=%d, size=[%d, %d])",
2560 output->model = std::string(model);
2561 output->size_mm[0] = physical_width;
2562 output->size_mm[1] = physical_height;
2566 struct wl_output * ,
2572 if ((flags & WL_OUTPUT_MODE_CURRENT) == 0) {
2584 if (!
output->has_size_logical) {
2604 if (
output->transform & WL_OUTPUT_TRANSFORM_90) {
2605 size_native[0] =
output->size_native[1];
2606 size_native[1] =
output->size_native[0];
2609 size_native[0] =
output->size_native[0];
2610 size_native[1] =
output->size_native[1];
2614 if (
output->has_size_logical) {
2620 "Screen size values were not set when they were expected to be.");
2622 output->scale_fractional = wl_fixed_from_int(size_native[0]) /
output->size_logical[0];
2623 output->has_scale_fractional =
true;
2657 #ifndef WITH_GHOST_WAYLAND_LIBDECOR
2660 # define LOG (&LOG_WL_XDG_WM_BASE)
2663 struct xdg_wm_base *xdg_wm_base,
2667 xdg_wm_base_pong(xdg_wm_base, serial);
2684 #ifdef WITH_GHOST_WAYLAND_LIBDECOR
2686 static CLG_LogRef LOG_WL_LIBDECOR = {
"ghost.wl.handle.libdecor"};
2687 # define LOG (&LOG_WL_LIBDECOR)
2689 static void decor_handle_error(
struct libdecor * ,
2690 enum libdecor_error
error,
2691 const char *message)
2697 GHOST_PRINT(
"decoration error (" <<
error <<
"): " << message << std::endl);
2701 static struct libdecor_interface libdecor_interface = {
2716 #define LOG (&LOG_WL_REGISTRY)
2719 struct wl_registry *wl_registry,
2721 const char *interface,
2728 if (!strcmp(interface, wl_compositor_interface.name)) {
2729 display->compositor =
static_cast<wl_compositor *
>(
2730 wl_registry_bind(wl_registry, name, &wl_compositor_interface, 3));
2732 #ifdef WITH_GHOST_WAYLAND_LIBDECOR
2735 else if (!strcmp(interface, xdg_wm_base_interface.name)) {
2736 display->xdg_shell =
static_cast<xdg_wm_base *
>(
2737 wl_registry_bind(wl_registry, name, &xdg_wm_base_interface, 1));
2740 else if (!strcmp(interface, zxdg_decoration_manager_v1_interface.name)) {
2741 display->xdg_decoration_manager =
static_cast<zxdg_decoration_manager_v1 *
>(
2742 wl_registry_bind(wl_registry, name, &zxdg_decoration_manager_v1_interface, 1));
2745 else if (!strcmp(interface, zxdg_output_manager_v1_interface.name)) {
2746 display->xdg_output_manager =
static_cast<zxdg_output_manager_v1 *
>(
2747 wl_registry_bind(wl_registry, name, &zxdg_output_manager_v1_interface, 2));
2749 output->xdg_output = zxdg_output_manager_v1_get_xdg_output(
display->xdg_output_manager,
2754 else if (!strcmp(interface, wl_output_interface.name)) {
2756 output->wl_output =
static_cast<wl_output *
>(
2757 wl_registry_bind(wl_registry, name, &wl_output_interface, 2));
2764 if (
display->xdg_output_manager) {
2765 output->xdg_output = zxdg_output_manager_v1_get_xdg_output(
display->xdg_output_manager,
2770 else if (!strcmp(interface, wl_seat_interface.name)) {
2773 input->xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
2775 input->wl_seat =
static_cast<wl_seat *
>(
2776 wl_registry_bind(wl_registry, name, &wl_seat_interface, 5));
2780 else if (!strcmp(interface, wl_shm_interface.name)) {
2781 display->shm =
static_cast<wl_shm *
>(
2782 wl_registry_bind(wl_registry, name, &wl_shm_interface, 1));
2784 else if (!strcmp(interface, wl_data_device_manager_interface.name)) {
2785 display->data_device_manager =
static_cast<wl_data_device_manager *
>(
2786 wl_registry_bind(wl_registry, name, &wl_data_device_manager_interface, 3));
2788 else if (!strcmp(interface, zwp_tablet_manager_v2_interface.name)) {
2789 display->tablet_manager =
static_cast<zwp_tablet_manager_v2 *
>(
2790 wl_registry_bind(wl_registry, name, &zwp_tablet_manager_v2_interface, 1));
2792 else if (!strcmp(interface, zwp_relative_pointer_manager_v1_interface.name)) {
2793 display->relative_pointer_manager =
static_cast<zwp_relative_pointer_manager_v1 *
>(
2794 wl_registry_bind(wl_registry, name, &zwp_relative_pointer_manager_v1_interface, 1));
2796 else if (!strcmp(interface, zwp_pointer_constraints_v1_interface.name)) {
2797 display->pointer_constraints =
static_cast<zwp_pointer_constraints_v1 *
>(
2798 wl_registry_bind(wl_registry, name, &zwp_pointer_constraints_v1_interface, 1));
2806 "add %s(interface=%s, version=%u, name=%u)",
2807 found ?
"" :
"(skipped), ",
2823 struct wl_registry * ,
2853 throw std::runtime_error(
"Wayland: unable to connect to display!");
2857 struct wl_registry *registry = wl_display_get_registry(d->
display);
2863 wl_registry_destroy(registry);
2865 #ifdef WITH_GHOST_WAYLAND_LIBDECOR
2867 if (!d->decor_context) {
2869 throw std::runtime_error(
"Wayland: unable to create window decorations!");
2874 throw std::runtime_error(
"Wayland: unable to access xdg_shell!");
2926 static const xkb_state_component mods_all = xkb_state_component(
2927 XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED | XKB_STATE_MODS_LOCKED |
2928 XKB_STATE_MODS_EFFECTIVE);
2934 val = xkb_state_mod_name_is_active(d->
inputs[0]->xkb_state, XKB_MOD_NAME_SHIFT, mods_all) == 1;
2938 val = xkb_state_mod_name_is_active(d->
inputs[0]->xkb_state, XKB_MOD_NAME_ALT, mods_all) == 1;
2942 val = xkb_state_mod_name_is_active(d->
inputs[0]->xkb_state, XKB_MOD_NAME_CTRL, mods_all) == 1;
2946 val = xkb_state_mod_name_is_active(d->
inputs[0]->xkb_state, XKB_MOD_NAME_LOGO, mods_all) == 1;
2949 val = xkb_state_mod_name_is_active(d->
inputs[0]->xkb_state, XKB_MOD_NAME_NUM, mods_all) == 1;
2966 buttons = input_state->
buttons;
2972 char *clipboard =
static_cast<char *
>(malloc((selection.size() + 1)));
2973 memcpy(clipboard, selection.data(), selection.size() + 1);
2985 std::lock_guard
lock{
input->data_source_mutex};
2991 const size_t buffer_size = strlen(
buffer) + 1;
2992 data_source->
buffer_out =
static_cast<char *
>(malloc(buffer_size));
3003 if (
input->data_device) {
3004 wl_data_device_set_selection(
3020 const wl_fixed_t scale = win->
scale();
3021 x = wl_fixed_to_int(scale * input_state->
xy[0]);
3022 y = wl_fixed_to_int(scale * input_state->
xy[1]);
3034 if (!
input->relative_pointer) {
3037 const wl_fixed_t scale = win->
scale();
3038 const wl_fixed_t xy_next[2] = {
3039 wl_fixed_from_int(
x) / scale,
3040 wl_fixed_from_int(
y) / scale,
3058 if (!input_state || !input_state->
wl_surface) {
3088 if (wl_surface *focus_surface = input_state->
wl_surface) {
3104 if (wl_surface *focus_surface =
input->pointer.wl_surface) {
3128 if (
output->has_position_logical) {
3129 xy[0] =
output->position_logical[0];
3130 xy[1] =
output->position_logical[1];
3138 width = xy_max[0] - xy_min[0];
3139 height = xy_max[1] - xy_min[1];
3143 struct wl_display *wl_display,
3144 wl_egl_window *egl_window)
3148 for (
int minor = 6; minor >= 0; --minor) {
3151 EGLNativeWindowType(egl_window),
3152 EGLNativeDisplayType(wl_display),
3153 EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
3160 if (
context->initializeDrawingContext()) {
3168 EGLNativeWindowType(egl_window),
3169 EGLNativeDisplayType(wl_display),
3170 EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
3177 if (
context->initializeDrawingContext()) {
3187 wl_surface *wl_surface = wl_compositor_create_surface(
compositor());
3193 GHOST_PRINT(
"Cannot create off-screen EGL context" << std::endl);
3195 wl_surface_destroy(wl_surface);
3203 wl_surface_set_user_data(wl_surface, egl_window);
3204 context->setUserData(wl_surface);
3211 struct wl_surface *wl_surface = (
struct wl_surface *)((
GHOST_Context *)
context)->getUserData();
3212 wl_egl_window *egl_window = (wl_egl_window *)wl_surface_get_user_data(wl_surface);
3214 wl_surface_destroy(wl_surface);
3229 const bool exclusive,
3230 const bool is_dialog,
3277 if (
input->wl_pointer) {
3278 const int scale =
c->is_custom ?
c->custom_scale :
input->pointer.theme_scale;
3281 if (
input->wl_pointer) {
3282 wl_pointer_set_cursor(
3283 input->wl_pointer,
input->pointer.serial,
c->wl_surface, hotspot_x, hotspot_y);
3287 if (!
input->tablet_tools.empty()) {
3288 const int scale =
c->is_custom ?
c->custom_scale :
input->tablet.theme_scale;
3291 for (
struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2 :
input->tablet_tools) {
3293 zwp_tablet_tool_v2_get_user_data(zwp_tablet_tool_v2));
3294 zwp_tablet_tool_v2_set_cursor(zwp_tablet_tool_v2,
3295 input->tablet.serial,
3311 wl_pointer_set_cursor(
input->wl_pointer,
input->pointer.serial,
nullptr, 0, 0);
3312 for (
struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2 :
input->tablet_tools) {
3313 zwp_tablet_tool_v2_set_cursor(zwp_tablet_tool_v2,
input->tablet.serial,
nullptr, 0, 0);
3326 if ((image_size_x % scale) == 0 && (image_size_y % scale) == 0) {
3336 struct wl_surface *wl_surface,
3339 const wl_cursor_image *wl_image = &
input->cursor.wl_image;
3342 GHOST_ASSERT((image_size_x % scale) == 0 && (image_size_y % scale) == 0,
3343 "The size must be a multiple of the scale!");
3345 wl_surface_set_buffer_scale(wl_surface, scale);
3346 wl_surface_attach(wl_surface,
buffer, 0, 0);
3347 wl_surface_damage(wl_surface, 0, 0, image_size_x, image_size_y);
3348 wl_surface_commit(wl_surface);
3354 const wl_cursor_image *wl_image = &
input->cursor.wl_image;
3355 const bool visible = (
c->visible &&
c->is_hardware);
3359 if (
input->wl_pointer) {
3361 wl_image,
c->is_custom ?
c->custom_scale :
input->pointer.theme_scale);
3365 wl_pointer_set_cursor(
input->wl_pointer,
3366 input->pointer.serial,
3367 visible ?
c->wl_surface :
nullptr,
3373 if (!
input->tablet_tools.empty()) {
3375 wl_image,
c->is_custom ?
c->custom_scale :
input->tablet.theme_scale);
3378 for (
struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2 :
input->tablet_tools) {
3380 zwp_tablet_tool_v2_get_user_data(zwp_tablet_tool_v2));
3382 zwp_tablet_tool_v2_set_cursor(zwp_tablet_tool_v2,
3383 input->tablet.serial,
3399 const bool is_hardware,
3404 const bool use_visible = is_hardware && visible;
3439 #ifdef USE_GNOME_CONFINE_HACK
3441 if (use_software_confine) {
3446 (
void)use_software_confine;
3456 auto cursor_find =
cursors.find(shape);
3457 const char *cursor_name = (cursor_find ==
cursors.end()) ?
3459 (*cursor_find).second;
3467 c->theme_name.c_str(),
c->size, d->
inputs[0]->system->shm());
3473 GHOST_PRINT(
"cursor '" << cursor_name <<
"' does not exist" << std::endl);
3477 struct wl_cursor_image *
image = cursor->images[0];
3484 c->is_custom =
false;
3495 auto cursor_find =
cursors.find(cursorShape);
3496 if (cursor_find ==
cursors.end()) {
3499 const char *value = (*cursor_find).second;
3500 if (*value ==
'\0') {
3526 const int32_t size_xy[2] = {sizex, sizey};
3535 static constexpr
uint32_t black = 0xFF000000;
3536 static constexpr
uint32_t white = 0xFFFFFFFF;
3537 static constexpr
uint32_t transparent = 0x00000000;
3542 for (
int y = 0;
y < sizey; ++
y) {
3544 for (
int x = 0;
x < sizex; ++
x) {
3550 datab =
uint8_t((datab * 0x0202020202ULL & 0x010884422010ULL) % 1023);
3551 maskb =
uint8_t((maskb * 0x0202020202ULL & 0x010884422010ULL) % 1023);
3555 *pixel++ = (datab & 0x80) ? white : black;
3558 *pixel++ = (datab & 0x80) ? white : transparent;
3630 #ifdef USE_GNOME_CONFINE_HACK
3632 const bool use_software_confine =
input->use_pointer_software_confine;
3634 const bool use_software_confine =
false;
3640 #ifdef USE_GNOME_CONFINE_HACK
3644 # ifndef USE_GNOME_CONFINE_HACK_ALWAYS_ON
3657 # ifndef USE_GNOME_CONFINE_HACK_ALWAYS_ON
3658 if (win->
scale() <= 1) {
3667 const bool use_software_confine)
3747 #ifdef WITH_GHOST_WAYLAND_LIBDECOR
3749 libdecor *GHOST_SystemWayland::decor_context()
3751 return d->decor_context;
3810 this->selection = selection;
3815 #define SURFACE_CLEAR_PTR(surface_test) \
3816 if (surface_test == surface) { \
3817 surface_test = nullptr; \
3828 #undef SURFACE_CLEAR_PTR
3848 if (mode == mode_current) {
3854 #ifdef USE_GNOME_CONFINE_HACK
3855 const bool was_software_confine =
input->use_pointer_software_confine;
3858 const bool was_software_confine =
false;
3859 const bool use_software_confine =
false;
3863 mode_current, was_software_confine);
3865 mode, use_software_confine);
3879 if (
input->relative_pointer) {
3880 zwp_relative_pointer_v1_destroy(
input->relative_pointer);
3881 input->relative_pointer =
nullptr;
3883 if (
input->locked_pointer) {
3885 int32_t xy_motion[2] = {0, 0};
3886 bool xy_motion_create_event =
false;
3896 bounds_scale.
m_l = wl_fixed_from_int(wrap_bounds->
m_l) / scale;
3897 bounds_scale.
m_t = wl_fixed_from_int(wrap_bounds->
m_t) / scale;
3898 bounds_scale.
m_r = wl_fixed_from_int(wrap_bounds->
m_r) / scale;
3899 bounds_scale.
m_b = wl_fixed_from_int(wrap_bounds->
m_b) / scale;
3904 if ((xy_next[0] !=
input->pointer.xy[0]) || (xy_next[1] !=
input->pointer.xy[1])) {
3905 xy_motion[0] = xy_next[0];
3906 xy_motion[1] = xy_next[1];
3907 xy_motion_create_event =
true;
3909 input->pointer.xy[0] = xy_next[0];
3910 input->pointer.xy[1] = xy_next[1];
3912 zwp_locked_pointer_v1_set_cursor_position_hint(
input->locked_pointer,
UNPACK2(xy_next));
3916 if ((init_grab_xy[0] !=
input->grab_lock_xy[0]) ||
3917 (init_grab_xy[1] !=
input->grab_lock_xy[1])) {
3918 const wl_fixed_t xy_next[2] = {
3919 wl_fixed_from_int(init_grab_xy[0]) / scale,
3920 wl_fixed_from_int(init_grab_xy[1]) / scale,
3922 zwp_locked_pointer_v1_set_cursor_position_hint(
input->locked_pointer,
UNPACK2(xy_next));
3928 xy_motion[0] = xy_next[0];
3929 xy_motion[1] = xy_next[1];
3930 xy_motion_create_event =
true;
3933 #ifdef USE_GNOME_CONFINE_HACK
3935 if (was_software_confine) {
3936 zwp_locked_pointer_v1_set_cursor_position_hint(
input->locked_pointer,
3943 if (xy_motion_create_event) {
3947 wl_fixed_to_int(scale * xy_motion[0]),
3948 wl_fixed_to_int(scale * xy_motion[1]),
3952 zwp_locked_pointer_v1_destroy(
input->locked_pointer);
3953 input->locked_pointer =
nullptr;
3958 if (
input->confined_pointer) {
3959 zwp_confined_pointer_v1_destroy(
input->confined_pointer);
3960 input->confined_pointer =
nullptr;
3971 input->relative_pointer = zwp_relative_pointer_manager_v1_get_relative_pointer(
3973 zwp_relative_pointer_v1_add_listener(
3975 input->locked_pointer = zwp_pointer_constraints_v1_lock_pointer(
3980 ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT);
3985 init_grab_xy[0] = wl_fixed_to_int(scale *
input->pointer.xy[0]);
3986 init_grab_xy[1] = wl_fixed_to_int(scale *
input->pointer.xy[1]);
3987 input->grab_lock_xy[0] = init_grab_xy[0];
3988 input->grab_lock_xy[1] = init_grab_xy[1];
3993 input->confined_pointer = zwp_pointer_constraints_v1_confine_pointer(
3998 ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT);
4006 #ifdef USE_GNOME_CONFINE_HACK
4007 input->use_pointer_software_confine = use_software_confine;
4013 #ifdef WITH_GHOST_WAYLAND_DYNLOAD
4014 bool ghost_wl_dynload_libraries()
4018 # ifdef WITH_GHOST_X11
4027 # ifdef WITH_GHOST_WAYLAND_LIBDECOR
4033 # ifdef WITH_GHOST_WAYLAND_LIBDECOR
typedef float(TangentPoint)[2]
void BLI_kdtree_nd_() free(KDTree *tree)
KDTree *BLI_kdtree_nd_() new(unsigned int maxsize)
#define CLOG_INFO(clg_ref, level,...)
#define GHOST_OPENGL_EGL_CONTEXT_FLAGS
#define GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY
#define GHOST_ASSERT(x, info)
static void tablet_tool_handle_down(void *data, struct zwp_tablet_tool_v2 *, const uint32_t serial)
static void tablet_tool_handle_distance(void *, struct zwp_tablet_tool_v2 *, const uint32_t distance)
void ghost_wl_surface_tag_cursor_pointer(struct wl_surface *surface)
void ghost_wl_surface_tag_cursor_tablet(struct wl_surface *surface)
static const struct wl_data_source_listener data_source_listener
static CLG_LogRef LOG_WL_TABLET_TOOL
static void shell_handle_ping(void *, struct xdg_wm_base *xdg_wm_base, const uint32_t serial)
static void tablet_tool_handle_up(void *data, struct zwp_tablet_tool_v2 *)
static GHOST_WindowManager * window_manager
static void tablet_tool_handle_wheel(void *data, struct zwp_tablet_tool_v2 *, const wl_fixed_t, const int32_t clicks)
static GHOST_TSuccess getCursorPositionClientRelative_impl(const input_state_pointer_t *input_state, const GHOST_WindowWayland *win, int32_t &x, int32_t &y)
static const char * ghost_wl_surface_cursor_tablet_tag_id
void ghost_wl_surface_tag(struct wl_surface *surface)
static const struct wl_output_listener output_listener
static void xdg_output_handle_done(void *data, struct zxdg_output_v1 *)
static CLG_LogRef LOG_WL_TABLET_SEAT
static const zwp_relative_pointer_v1_listener relative_pointer_listener
static void keyboard_handle_key_repeat_cancel(struct input_t *input)
static void tablet_tool_handle_done(void *, struct zwp_tablet_tool_v2 *)
static const std::unordered_map< std::string, GHOST_TDragnDropTypes > mime_dnd
struct output_t * ghost_wl_output_user_data(struct wl_output *wl_output)
static const struct xdg_wm_base_listener shell_listener
static const struct zxdg_output_v1_listener xdg_output_listener
static int memfd_create_sealed(const char *name)
static GHOST_Context * createOffscreenContext_impl(GHOST_SystemWayland *system, struct wl_display *wl_display, wl_egl_window *egl_window)
static const struct wl_surface_listener cursor_surface_listener
static void xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *, const int32_t width, const int32_t height)
static void data_source_handle_dnd_drop_performed(void *, struct wl_data_source *)
static const struct wl_data_device_listener data_device_listener
static const std::unordered_map< GHOST_TStandardCursor, const char * > cursors
static void dnd_events(const input_t *const input, const GHOST_TEventType event)
bool ghost_wl_surface_own_cursor_pointer(const struct wl_surface *surface)
static void xdg_output_handle_logical_position(void *data, struct zxdg_output_v1 *, const int32_t x, const int32_t y)
static input_state_pointer_t * input_state_pointer_from_cursor_surface(input_t *input, const wl_surface *wl_surface)
static void cursor_surface_handle_leave(void *data, struct wl_surface *wl_surface, struct wl_output *output)
static void pointer_handle_axis_discrete(void *data, struct wl_pointer *, uint32_t axis, int32_t discrete)
static void data_device_handle_leave(void *data, struct wl_data_device *)
static void pointer_handle_enter(void *data, struct wl_pointer *, const uint32_t serial, struct wl_surface *surface, const wl_fixed_t surface_x, const wl_fixed_t surface_y)
static CLG_LogRef LOG_WL_RELATIVE_POINTER
static void display_destroy(display_t *d)
static void data_device_handle_motion(void *data, struct wl_data_device *, const uint32_t, const wl_fixed_t x, const wl_fixed_t y)
static void cursor_buffer_show(const input_t *input)
static CLG_LogRef LOG_WL_XDG_OUTPUT
static void tablet_tool_handle_rotation(void *, struct zwp_tablet_tool_v2 *, const wl_fixed_t degrees)
static void cursor_buffer_set(const input_t *input, wl_buffer *buffer)
static void data_device_handle_enter(void *data, struct wl_data_device *, const uint32_t serial, struct wl_surface *surface, const wl_fixed_t x, const wl_fixed_t y, struct wl_data_offer *id)
static void relative_pointer_handle_relative_motion_impl(input_t *input, GHOST_WindowWayland *win, const wl_fixed_t xy[2])
static void cursor_buffer_set_surface_impl(const input_t *input, wl_buffer *buffer, struct wl_surface *wl_surface, const int scale)
static void data_device_handle_selection(void *data, struct wl_data_device *, struct wl_data_offer *id)
static void data_source_handle_cancelled(void *, struct wl_data_source *wl_data_source)
static const struct wl_buffer_listener cursor_buffer_listener
static const struct wl_seat_listener seat_listener
static GHOST_TKey xkb_map_gkey(const xkb_keysym_t sym)
static void data_device_handle_data_offer(void *, struct wl_data_device *, struct wl_data_offer *id)
static void tablet_seat_handle_tool_added(void *data, struct zwp_tablet_seat_v2 *, struct zwp_tablet_tool_v2 *id)
static void tablet_tool_handle_slider(void *, struct zwp_tablet_tool_v2 *, const int32_t position)
static void output_handle_geometry(void *data, struct wl_output *, const int32_t, const int32_t, const int32_t physical_width, const int32_t physical_height, const int32_t, const char *make, const char *model, const int32_t transform)
static void tablet_tool_handle_frame(void *data, struct zwp_tablet_tool_v2 *, const uint32_t)
static void pointer_handle_axis(void *, struct wl_pointer *, const uint32_t, const uint32_t axis, const wl_fixed_t value)
static void tablet_tool_handle_hardware_serial(void *, struct zwp_tablet_tool_v2 *, const uint32_t, const uint32_t)
static void data_device_handle_drop(void *data, struct wl_data_device *)
static void global_handle_remove(void *, struct wl_registry *, const uint32_t name)
static void keyboard_handle_modifiers(void *data, struct wl_keyboard *, const uint32_t, const uint32_t mods_depressed, const uint32_t mods_latched, const uint32_t mods_locked, const uint32_t group)
static CLG_LogRef LOG_WL_OUTPUT
static void global_handle_add(void *data, struct wl_registry *wl_registry, const uint32_t name, const char *interface, const uint32_t version)
static const struct wl_data_offer_listener data_offer_listener
static void pointer_handle_button(void *data, struct wl_pointer *, const uint32_t serial, const uint32_t, const uint32_t button, const uint32_t state)
static void keyboard_repeat_handle_info(void *data, struct wl_keyboard *, const int32_t rate, const int32_t delay)
static void data_offer_handle_offer(void *data, struct wl_data_offer *, const char *mime_type)
static void tablet_tool_handle_tilt(void *data, struct zwp_tablet_tool_v2 *, const wl_fixed_t tilt_x, const wl_fixed_t tilt_y)
static void tablet_tool_handle_proximity_out(void *data, struct zwp_tablet_tool_v2 *)
static std::string read_pipe(data_offer_t *data_offer, const std::string mime_receive, std::mutex *mutex)
static bool setCursorGrab_use_software_confine(const GHOST_TGrabCursorMode mode, wl_surface *surface)
static bool update_cursor_scale(cursor_t &cursor, wl_shm *shm, input_state_pointer_t *input_state, wl_surface *cursor_surface)
static bool cursor_is_software(const GHOST_TGrabCursorMode mode, const bool use_software_confine)
static void keyboard_handle_enter(void *data, struct wl_keyboard *, const uint32_t serial, struct wl_surface *surface, struct wl_array *)
static void tablet_tool_handle_pressure(void *data, struct zwp_tablet_tool_v2 *, const uint32_t pressure)
static void tablet_tool_handle_capability(void *, struct zwp_tablet_tool_v2 *, const uint32_t capability)
bool ghost_wl_surface_own(const struct wl_surface *surface)
static void keyboard_handle_key(void *data, struct wl_keyboard *, const uint32_t serial, const uint32_t, const uint32_t key, const uint32_t state)
static const std::vector< std::string > mime_preference_order
static const struct wl_registry_listener registry_listener
static constexpr const char * mime_text_utf8
static CLG_LogRef LOG_WL_KEYBOARD
static void output_handle_scale(void *data, struct wl_output *, const int32_t factor)
static GHOST_TKey xkb_map_gkey_or_scan_code(const xkb_keysym_t sym, const uint32_t key)
static void output_handle_mode(void *data, struct wl_output *, const uint32_t flags, const int32_t width, const int32_t height, const int32_t)
static void cursor_surface_handle_enter(void *data, struct wl_surface *wl_surface, struct wl_output *output)
static void ghost_wayland_log_handler(const char *msg, va_list arg)
static CLG_LogRef LOG_WL_REGISTRY
static void cursor_buffer_handle_release(void *data, struct wl_buffer *wl_buffer)
@ CURSOR_VISIBLE_ONLY_HIDE
@ CURSOR_VISIBLE_ALWAYS_SET
@ CURSOR_VISIBLE_ONLY_SHOW
static const struct wl_pointer_listener pointer_listener
bool ghost_wl_surface_own_cursor_tablet(const struct wl_surface *surface)
static CLG_LogRef LOG_WL_POINTER
static const struct zwp_tablet_seat_v2_listener tablet_seat_listener
static std::mutex system_selection_mutex
static void data_offer_handle_source_actions(void *data, struct wl_data_offer *, const uint32_t source_actions)
static void cursor_buffer_hide(const input_t *input)
static void tablet_tool_handle_proximity_in(void *data, struct zwp_tablet_tool_v2 *, const uint32_t serial, struct zwp_tablet_v2 *, struct wl_surface *surface)
static void tablet_tool_handle_removed(void *data, struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
static xkb_keysym_t xkb_state_key_get_one_sym_without_modifiers(struct xkb_state *xkb_state_empty, struct xkb_state *xkb_state_empty_with_numlock, const xkb_keycode_t key)
static void data_source_handle_target(void *, struct wl_data_source *, const char *)
void ghost_wl_output_tag(struct wl_output *output)
static int cursor_buffer_compatible_scale_from_image(const struct wl_cursor_image *wl_image, int scale)
static void data_offer_handle_action(void *data, struct wl_data_offer *, const uint32_t dnd_action)
static GHOST_TSuccess setCursorPositionClientRelative_impl(input_t *input, GHOST_WindowWayland *win, const int32_t x, const int32_t y)
static void keyboard_handle_keymap(void *data, struct wl_keyboard *, const uint32_t format, const int32_t fd, const uint32_t size)
static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, const uint32_t capabilities)
static void pointer_handle_axis_stop(void *, struct wl_pointer *, uint32_t, uint32_t axis)
static const struct zwp_tablet_tool_v2_listener tablet_tool_listner
static wl_buffer * ghost_wl_buffer_create_for_image(struct wl_shm *shm, const int32_t size_xy[2], enum wl_shm_format format, void **r_buffer_data, size_t *r_buffer_data_size)
static void cursor_visible_set(input_t *input, const bool visible, const bool is_hardware, const enum eCursorSetMode set_mode)
static CLG_LogRef LOG_WL_DATA_OFFER
static void relative_pointer_handle_relative_motion(void *data, struct zwp_relative_pointer_v1 *, const uint32_t, const uint32_t, const wl_fixed_t dx, const wl_fixed_t dy, const wl_fixed_t, const wl_fixed_t)
static CLG_LogRef LOG_WL_SEAT
#define SURFACE_CLEAR_PTR(surface_test)
static CLG_LogRef LOG_WL_CURSOR_SURFACE
static const char * ghost_wl_surface_cursor_pointer_tag_id
static void data_source_handle_send(void *data, struct wl_data_source *, const char *, const int32_t fd)
static void tablet_tool_handle_motion(void *data, struct zwp_tablet_tool_v2 *, const wl_fixed_t x, const wl_fixed_t y)
static GHOST_TTabletMode tablet_tool_map_type(enum zwp_tablet_tool_v2_type wl_tablet_tool_type)
static CLG_LogRef LOG_WL_XDG_WM_BASE
static void keyboard_handle_leave(void *data, struct wl_keyboard *, const uint32_t, struct wl_surface *surface)
static const char * ghost_wl_surface_tag_id
static void pointer_handle_axis_source(void *, struct wl_pointer *, uint32_t axis_source)
static void seat_handle_name(void *data, struct wl_seat *, const char *name)
static void output_handle_done(void *data, struct wl_output *wl_output)
static void xdg_output_handle_description(void *, struct zxdg_output_v1 *, const char *description)
static const struct wl_keyboard_listener keyboard_listener
static CLG_LogRef LOG_WL_DATA_SOURCE
static CLG_LogRef LOG_WL_CURSOR_BUFFER
GHOST_WindowWayland * ghost_wl_surface_user_data(struct wl_surface *surface)
static void tablet_tool_handle_button(void *data, struct zwp_tablet_tool_v2 *, const uint32_t serial, const uint32_t button, const uint32_t state)
static CLG_LogRef LOG_WL_DATA_DEVICE
static constexpr const char * mime_text_uri
static void xdg_output_handle_name(void *, struct zxdg_output_v1 *, const char *name)
static void pointer_handle_leave(void *data, struct wl_pointer *, const uint32_t, struct wl_surface *surface)
static void keyboard_handle_key_repeat_reset(input_t *input, const bool use_delay)
static void tablet_seat_handle_pad_added(void *, struct zwp_tablet_seat_v2 *, struct zwp_tablet_pad_v2 *id)
static const int default_cursor_size
static input_grab_state_t input_grab_state_from_mode(const GHOST_TGrabCursorMode mode, const bool use_software_confine)
static void tablet_tool_handle_hardware_id_wacom(void *, struct zwp_tablet_tool_v2 *, const uint32_t, const uint32_t)
static void data_source_handle_action(void *, struct wl_data_source *, const uint32_t dnd_action)
static input_state_pointer_t * input_state_pointer_active(input_t *input)
static const std::vector< std::string > mime_send
static void tablet_tool_handle_type(void *data, struct zwp_tablet_tool_v2 *, const uint32_t tool_type)
static bool use_gnome_confine_hack
static void data_source_handle_dnd_finished(void *, struct wl_data_source *)
static void pointer_handle_motion(void *data, struct wl_pointer *, const uint32_t, const wl_fixed_t surface_x, const wl_fixed_t surface_y)
static const char * ghost_wl_output_tag_id
bool ghost_wl_output_own(const struct wl_output *output)
static void pointer_handle_frame(void *, struct wl_pointer *)
static constexpr const char * mime_text_plain
static void tablet_seat_handle_tablet_added(void *, struct zwp_tablet_seat_v2 *, struct zwp_tablet_v2 *id)
static size_t ghost_wl_shm_format_as_size(enum wl_shm_format format)
void * GHOST_TUserDataPtr
@ GHOST_kStandardCursorBottomLeftCorner
@ GHOST_kStandardCursorZoomIn
@ GHOST_kStandardCursorVerticalSplit
@ GHOST_kStandardCursorHelp
@ GHOST_kStandardCursorCopy
@ GHOST_kStandardCursorWait
@ GHOST_kStandardCursorHorizontalSplit
@ GHOST_kStandardCursorTopSide
@ GHOST_kStandardCursorStop
@ GHOST_kStandardCursorCrosshair
@ GHOST_kStandardCursorNSEWScroll
@ GHOST_kStandardCursorLeftRight
@ GHOST_kStandardCursorPencil
@ GHOST_kStandardCursorNSScroll
@ GHOST_kStandardCursorCrosshairA
@ GHOST_kStandardCursorUpDown
@ GHOST_kStandardCursorUpArrow
@ GHOST_kStandardCursorBottomSide
@ GHOST_kStandardCursorInfo
@ GHOST_kStandardCursorTopLeftCorner
@ GHOST_kStandardCursorEyedropper
@ GHOST_kStandardCursorKnife
@ GHOST_kStandardCursorMove
@ GHOST_kStandardCursorCrosshairB
@ GHOST_kStandardCursorBottomRightCorner
@ GHOST_kStandardCursorDownArrow
@ GHOST_kStandardCursorEraser
@ GHOST_kStandardCursorDefault
@ GHOST_kStandardCursorEWScroll
@ GHOST_kStandardCursorRightSide
@ GHOST_kStandardCursorRightArrow
@ GHOST_kStandardCursorTopRightCorner
@ GHOST_kStandardCursorDestroy
@ GHOST_kStandardCursorCrosshairC
@ GHOST_kStandardCursorZoomOut
@ GHOST_kStandardCursorLeftSide
@ GHOST_kStandardCursorText
@ GHOST_kStandardCursorLeftArrow
@ GHOST_kEventDraggingDropDone
@ GHOST_kEventDraggingExited
@ GHOST_kEventDraggingUpdated
@ GHOST_kEventDraggingEntered
static const GHOST_TabletData GHOST_TABLET_DATA_NONE
@ GHOST_kTabletModeEraser
@ GHOST_kTabletModeStylus
void(* GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__ *task, uint64_t time)
@ GHOST_kKeyNumpadAsterisk
GHOST_TDrawingContextType
@ GHOST_kModifierKeyRightControl
@ GHOST_kModifierKeyLeftControl
@ GHOST_kModifierKeyRightAlt
@ GHOST_kModifierKeyRightShift
@ GHOST_kModifierKeyLeftAlt
@ GHOST_kModifierKeyLeftShift
void(* GHOST_TBacktraceFn)(void *file_handle)
@ GHOST_kDragnDropTypeFilenames
@ GHOST_kDragnDropTypeString
@ GHOST_kButtonMaskButton4
@ GHOST_kButtonMaskButton7
@ GHOST_kButtonMaskButton6
@ GHOST_kButtonMaskButton5
@ GHOST_kButtonMaskMiddle
GHOST_TConsoleWindowState
static bool get_cursor_settings(std::string &theme, int &size)
static struct wl_surface_listener wl_surface_listener
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble top
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
static GHOST_TBacktraceFn getBacktraceFn()
virtual GHOST_TimerProcPtr getTimerProc() const =0
virtual void wrapPoint(int32_t &x, int32_t &y, int32_t ofs, GHOST_TAxisFlag axis)
zxdg_decoration_manager_v1 * xdg_decoration_manager()
bool supportsCursorWarp()
bool supportsWindowPosition()
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const override
char * getClipboard(bool selection) const override
GHOST_TSuccess setCursorPosition(int32_t x, int32_t y) override
GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override
GHOST_TSuccess disposeContext(GHOST_IContext *context) override
void window_surface_unref(const wl_surface *surface)
GHOST_IContext * createOffscreenContext(GHOST_GLSettings glSettings) override
wl_compositor * compositor()
void selection_set(const std::string &selection)
GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const override
uint8_t getNumDisplays() const override
~GHOST_SystemWayland() override
void putClipboard(const char *buffer, bool selection) const override
GHOST_IWindow * createWindow(const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings, const bool exclusive, const bool is_dialog, const GHOST_IWindow *parentWindow) override
GHOST_TSuccess setCursorVisibility(bool visible)
bool window_cursor_grab_set(const GHOST_TGrabCursorMode mode, const GHOST_TGrabCursorMode mode_current, int32_t init_grab_xy[2], const GHOST_Rect *wrap_bounds, GHOST_TAxisFlag wrap_axis, wl_surface *surface, int scale)
const std::vector< output_t * > & outputs() const
GHOST_TSuccess getCursorBitmap(GHOST_CursorBitmapRef *bitmap)
GHOST_TSuccess setCursorShape(GHOST_TStandardCursor shape)
bool processEvents(bool waitForEvent) override
GHOST_TSuccess getCursorPositionClientRelative(const GHOST_IWindow *window, int32_t &x, int32_t &y) const override
GHOST_TSuccess setCursorPositionClientRelative(GHOST_IWindow *window, int32_t x, int32_t y) override
int setConsoleWindowState(GHOST_TConsoleWindowState action) override
xdg_wm_base * xdg_shell()
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor cursorShape)
GHOST_TSuccess setCustomCursorShape(uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override
bool getCursorGrabUseSoftwareDisplay(const GHOST_TGrabCursorMode mode)
void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override
virtual uint64_t getMilliSeconds() const
GHOST_EventManager * getEventManager() const
GHOST_WindowManager * getWindowManager() const
GHOST_TimerManager * getTimerManager() const
GHOST_WindowManager * m_windowManager
GHOST_ITimerTask * installTimer(uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=NULL)
GHOST_TSuccess pushEvent(GHOST_IEvent *event)
bool fireTimers(uint64_t time)
GHOST_TSuccess addWindow(GHOST_IWindow *window)
const std::vector< GHOST_IWindow * > & getWindows() const
GHOST_TSuccess setActiveWindow(GHOST_IWindow *window)
GHOST_TSuccess deactivate()
bool outputs_changed_update_scale()
void getClientBounds(GHOST_Rect &bounds) const override
GHOST_TSuccess activate()
virtual bool getValid() const
GHOST_TSuccess setCursorShape(GHOST_TStandardCursor cursorShape)
GHOST_TStandardCursor getCursorShape() const
SyclQueue void void size_t num_bytes void
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
struct @211::@212 surface
ccl_global float * buffer
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static void error(const char *str)
static int make(const char *input_file_name, const char *output_file_name)
struct blender::compositor::@179::@181 task
T distance(const T &a, const T &b)
SymEdge< T > * sym(const SymEdge< T > *se)
unsigned __int64 uint64_t
void set(GHOST_TModifierKey mask, bool down)
struct wl_cursor_image wl_image
struct wl_surface * wl_surface
struct wl_buffer * wl_buffer
struct wl_cursor_theme * wl_theme
struct data_offer_t::@1291 dnd
std::atomic< bool > in_use
std::unordered_set< std::string > types
struct wl_data_offer * id
struct wl_data_source * data_source
struct zwp_tablet_manager_v2 * tablet_manager
std::vector< output_t * > outputs
struct zxdg_output_manager_v1 * xdg_output_manager
struct zxdg_decoration_manager_v1 * xdg_decoration_manager
struct zwp_relative_pointer_manager_v1 * relative_pointer_manager
GHOST_SystemWayland * system
struct wl_compositor * compositor
std::vector< input_t * > inputs
struct xdg_wm_base * xdg_shell
struct wl_display * display
struct zwp_pointer_constraints_v1 * pointer_constraints
struct wl_data_device_manager * data_device_manager
struct key_repeat_payload_t::@1292 key_data
struct wl_output * wl_output
static const char hex[17]
bool wayland_dynload_egl_init(bool verbose)
void wayland_dynload_client_exit(void)
void wayland_dynload_cursor_exit(void)
bool wayland_dynload_cursor_init(bool verbose)
bool wayland_dynload_client_init(bool verbose)
void wayland_dynload_egl_exit(void)
#define wl_proxy_get_tag(...)
#define wl_display_connect(...)
#define wl_log_set_handler_client(...)
#define wl_proxy_set_tag(...)
#define wl_display_dispatch(...)
#define wl_display_disconnect(...)
#define wl_display_roundtrip(...)
#define wl_cursor_theme_get_cursor(...)
#define wl_cursor_theme_load(...)
#define wl_cursor_image_get_buffer(...)
#define wl_cursor_theme_destroy(...)
#define wl_egl_window_create(...)
#define wl_egl_window_destroy(...)
bool wayland_dynload_libdecor_init(const bool verbose)
void wayland_dynload_libdecor_exit(void)
#define libdecor_unref(...)
#define libdecor_new(...)