extern "C" {
struct native_surface
{
- struct wl_surface surface;
+ struct wl_surface* surface;
WaylandBaseWindowSystem* windowSystem;
struct wl_buffer* buffer;
int connectionId;
struct native_frame_callback
{
- struct wl_resource resource;
+ struct wl_resource* resource;
struct wl_list link;
};
// Properties
private:
struct wl_display* m_wlDisplay;
- struct wl_seat m_wlSeat;
+ struct wl_seat* m_wlSeat;
bool m_hasPointer;
bool m_hasKeyboard;
bool m_hasTouch;
struct
{
- struct wl_pointer wlPointer;
- struct wl_keyboard wlKeyboard;
- struct wl_touch wlTouch;
+ struct wl_pointer* wlPointer;
+ struct wl_keyboard* wlKeyboard;
+ struct wl_touch* wlTouch;
} m_deviceInterfaces;
// Methods
inline struct wl_seat* WaylandInputDevice::seat()
{
- return &m_wlSeat;
+ return m_wlSeat;
}
inline bool WaylandInputDevice::hasPointer() const
inline struct wl_pointer* WaylandInputDevice::pointerDevice()
{
- return &m_deviceInterfaces.wlPointer;
+ return m_deviceInterfaces.wlPointer;
}
inline struct wl_keyboard* WaylandInputDevice::keyboardDevice()
{
- return &m_deviceInterfaces.wlKeyboard;
+ return m_deviceInterfaces.wlKeyboard;
}
inline struct wl_touch* WaylandInputDevice::touchDevice()
{
- return &m_deviceInterfaces.wlTouch;
+ return m_deviceInterfaces.wlTouch;
}
inline const struct wl_pointer* WaylandInputDevice::pointerDevice() const
{
- return &m_deviceInterfaces.wlPointer;
+ return m_deviceInterfaces.wlPointer;
}
inline const struct wl_keyboard* WaylandInputDevice::keyboardDevice() const
{
- return &m_deviceInterfaces.wlKeyboard;
+ return m_deviceInterfaces.wlKeyboard;
}
inline const struct wl_touch* WaylandInputDevice::touchDevice() const
{
- return &m_deviceInterfaces.wlTouch;
+ return m_deviceInterfaces.wlTouch;
}
#endif /* _WAYLANDINPUTDEVICE_H_ */
if (nativeSurface && nativeSurface->isReadyForRendering())
{
struct wl_buffer* buffer = (struct wl_buffer*)surface->getNativeContent();
- if (wl_buffer_is_shm(buffer))
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ if (0 // wl_buffer_is_shm(buffer)
+ )
{
/* Wayland SHM buffer */
- unsigned int* pBuf = (unsigned int*)wl_shm_buffer_get_data(buffer);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ unsigned int* pBuf = (unsigned int*)wl_shm_buffer_get_data(NULL // buffer
+ );
if ((NULL != buffer) && (NULL != pBuf))
{
LOG_DEBUG("WaylandGLESTexture", "SHM buffer address:" << pBuf);
if (NULL != nativeSurface)
{
struct wl_buffer* buffer = (struct wl_buffer*)surface->getNativeContent();
- if (wl_buffer_is_shm(buffer))
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ if (0 // wl_buffer_is_shm(buffer)
+ )
{
if (nativeSurface->texture)
{
EglWaylandPlatformSurface* nativeSurface = (EglWaylandPlatformSurface*)surface->platform;
struct wl_buffer* buffer = (struct wl_buffer*)surface->getNativeContent();
- if (wl_buffer_is_shm(buffer))
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ if (0 // wl_buffer_is_shm(buffer)
+ )
{
if (nativeSurface && nativeSurface->texture)
{
{
continue;
}
- if (nativePlatform->surfaceId != nativeSurface->surface.resource.object.id)
- {
- continue;
- }
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // if (nativePlatform->surfaceId != nativeSurface->surface->resource.object.id)
+ // {
+ // continue;
+ // }
return currentSurface;
}
LOG_DEBUG("WaylandBaseWindowSystem", "could not find surface for surface " << nativeSurface);
wl_list_for_each(nativeSurface, &m_nativeSurfaceList, link)
{
- if ((nativeSurface->connectionId == platformSurface->connectionId) &&
- (nativeSurface->surface.resource.object.id == platformSurface->surfaceId))
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ if ((nativeSurface->connectionId == platformSurface->connectionId)// &&
+ // (nativeSurface->surface->resource.object.id == platformSurface->surfaceId)
+ )
{
break; // FOUND
}
return NULL;
}
- wl_signal_init(&surface->surface.resource.destroy_signal);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_signal_init(&surface->surface->resource.destroy_signal);
wl_list_init(&surface->link);
- surface->surface.resource.client = NULL;
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // surface->surface->resource.client = NULL;
surface->windowSystem = this;
// TODO visual
void WaylandBaseWindowSystem::destroySurfaceCallback(struct wl_resource* resource)
{
- struct native_surface* nativeSurface = wl_container_of(resource, nativeSurface, surface.resource);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ struct native_surface* nativeSurface = NULL; // wl_container_of(resource, nativeSurface, surface->resource);
WaylandBaseWindowSystem* windowSystem = static_cast<WaylandBaseWindowSystem*>((WaylandBaseWindowSystem*)nativeSurface->windowSystem);
Surface* ilmSurface = windowSystem->getSurfaceFromNativeSurface(nativeSurface);
return;
}
- cb->resource.object.interface = &wl_callback_interface;
- cb->resource.object.id = callback;
- cb->resource.destroy = destroyFrameCallback;
- cb->resource.client = client;
- cb->resource.data = cb;
+ cb->resource = wl_resource_create(client, &wl_callback_interface, 1,
+ callback);
+ if (cb->resource == NULL) {
+ free(cb);
+ wl_resource_post_no_memory(resource);
+ return;
+ }
+
+ wl_resource_set_implementation(cb->resource, NULL, cb,
+ destroyFrameCallback);
- wl_client_add_resource(client, &cb->resource);
wl_list_insert(es->pending.frame_callback_list.prev, &cb->link);
LOG_DEBUG("WaylandBaseWindowSystem", "surfaceIFFrame OUT");
wl_signal_add(&buffer->resource.destroy_signal, &nativeSurface->buffer_destroy_listener);
}
}
- windowSystem->attachBufferToNativeSurface(buffer, &nativeSurface->surface);
+ windowSystem->attachBufferToNativeSurface(buffer, nativeSurface->surface);
nativeSurface->buffer = buffer;
if (NULL != surface)
return;
}
- surface->surface.resource.destroy = destroySurfaceCallback;
- surface->windowSystem = windowSystem;
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // surface->surface.resource.destroy = destroySurfaceCallback;
+ // surface->windowSystem = windowSystem;
- surface->surface.resource.object.id = id;
- surface->surface.resource.object.interface = &wl_surface_interface;
- surface->surface.resource.object.implementation = (void (**)(void))&g_surfaceInterface;
- surface->surface.resource.data = surface;
+ // surface->surface.resource.object.id = id;
+ // surface->surface.resource.object.interface = &wl_surface_interface;
+ // surface->surface.resource.object.implementation = (void (**)(void))&g_surfaceInterface;
+ // surface->surface.resource.data = surface;
struct serverinfoClient* serverinfoPairNode;
}
windowSystem->checkForNewSurfaceNativeContent();
- wl_client_add_resource(client, &surface->surface.resource);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_client_add_resource(client, &surface->surface.resource);
wl_list_insert(windowSystem->m_nativeSurfaceList.prev, &surface->link);
LOG_DEBUG("WaylandBaseWindowSystem", "compositorIFCreateSurface OUT");
}
wl_list_for_each_safe(cb, cnext, &m_listFrameCallback, link)
{
- wl_callback_send_done(&cb->resource, msecs);
- wl_resource_destroy(&cb->resource);
+ wl_callback_send_done(cb->resource, msecs);
+ wl_resource_destroy(cb->resource);
}
LOG_DEBUG("WaylandBaseWindowSystem", "repaint OUT");
}
{
case INPUT_STATE_PRESSED:
m_inputEvent->inputDevice().sendKeyPressEvent(
- &nativeSurface->surface, time, wlEvent->keyCode);
+ nativeSurface->surface, time, wlEvent->keyCode);
break;
case INPUT_STATE_RELEASED:
m_inputEvent->inputDevice().sendKeyReleaseEvent(
- &nativeSurface->surface, time, wlEvent->keyCode);
+ nativeSurface->surface, time, wlEvent->keyCode);
break;
case INPUT_STATE_OTHER:
default:
break;
case INPUT_STATE_MOTION:
m_inputEvent->inputDevice().sendMouseMotionEvent(
- &nativeSurface->surface, globalPos, localPos, time);
+ nativeSurface->surface, globalPos, localPos, time);
break;
case INPUT_STATE_OTHER:
default:
case INPUT_STATE_MOTION:
case INPUT_STATE_RELEASED:
m_inputEvent->inputDevice().sendTouchPointEvent(
- &nativeSurface->surface, time, wlEvent->touchId,
+ nativeSurface->surface, time, wlEvent->touchId,
wlEvent->touchType, ptVec[0]);
break;
case INPUT_STATE_OTHER:
{
return;
}
- if (!wlSeat->keyboard)
- {
- return;
- }
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // if (!wlSeat->keyboard)
+ // {
+ // return;
+ // }
serial = wl_display_next_serial(m_inputDevice->display());
- wl_array_init(&wlSeat->keyboard->keys);
- wl_array_copy(&wlSeat->keyboard->keys, keys);
-
- struct wl_array *array = &wlSeat->keyboard->keys;
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_array_init(&wlSeat->keyboard->keys);
+ // wl_array_copy(&wlSeat->keyboard->keys, keys);
+
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ struct wl_array *array = NULL; // &wlSeat->keyboard->keys;
for (k = (uint32_t*)array->data;
(const char*)k < (const char*)array->data + array->size;
++k)
if (wlSeat)
{
// notify_motion
- notifyMotion(device, time,
- wlSeat->pointer->x + device->rel.dx,
- wlSeat->pointer->y + device->rel.dy);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // notifyMotion(device, time,
+ // wlSeat->pointer->x + device->rel.dx,
+ // wlSeat->pointer->y + device->rel.dy);
}
device->pending_events &= ~EVDEV_RELATIVE_MOTION;
device->rel.dx = 0;
wlSeat = inputEvent->inputDevice().seat();
serial = wl_display_next_serial(inputEvent->inputDevice().display());
- if (state == WL_POINTER_BUTTON_STATE_PRESSED)
- {
- if (wlSeat->pointer->button_count == 0)
- {
- wlSeat->pointer->grab_button = button;
- wlSeat->pointer->grab_time = time;
- wlSeat->pointer->grab_x = wlSeat->pointer->x;
- wlSeat->pointer->grab_y = wlSeat->pointer->y;
- }
- ++wlSeat->pointer->button_count;
- }
- else
- {
- --wlSeat->pointer->button_count;
- }
- wlEvent.x = wl_fixed_to_int(wlSeat->pointer->x);
- wlEvent.y = wl_fixed_to_int(wlSeat->pointer->y);
- wlEvent.buttonState = state;
- wlEvent.serial = serial;
-
- inputEvent->windowSystem().manageWLInputEvent(INPUT_DEVICE_POINTER,
- state == WL_POINTER_BUTTON_STATE_PRESSED ? INPUT_STATE_PRESSED :
- INPUT_STATE_RELEASED, &wlEvent);
-
- if (wlSeat->pointer->button_count == 1)
- {
- wlSeat->pointer->grab_serial =
- wl_display_get_serial(inputEvent->inputDevice().display());
- }
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // if (state == WL_POINTER_BUTTON_STATE_PRESSED)
+ // {
+ // if (wlSeat->pointer->button_count == 0)
+ // {
+ // wlSeat->pointer->grab_button = button;
+ // wlSeat->pointer->grab_time = time;
+ // wlSeat->pointer->grab_x = wlSeat->pointer->x;
+ // wlSeat->pointer->grab_y = wlSeat->pointer->y;
+ // }
+ // ++wlSeat->pointer->button_count;
+ // }
+ // else
+ // {
+ // --wlSeat->pointer->button_count;
+ // }
+ // wlEvent.x = wl_fixed_to_int(wlSeat->pointer->x);
+ // wlEvent.y = wl_fixed_to_int(wlSeat->pointer->y);
+ // wlEvent.buttonState = state;
+ // wlEvent.serial = serial;
+
+ // inputEvent->windowSystem().manageWLInputEvent(INPUT_DEVICE_POINTER,
+ // state == WL_POINTER_BUTTON_STATE_PRESSED ? INPUT_STATE_PRESSED :
+ // INPUT_STATE_RELEASED, &wlEvent);
+
+ // if (wlSeat->pointer->button_count == 1)
+ // {
+ // wlSeat->pointer->grab_serial =
+ // wl_display_get_serial(inputEvent->inputDevice().display());
+ // }
}
void
if (y < 0) y = 0;
if (y > h) y = h;
- wlSeat->pointer->x = wl_fixed_from_int(x);
- wlSeat->pointer->y = wl_fixed_from_int(y);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wlSeat->pointer->x = wl_fixed_from_int(x);
+ // wlSeat->pointer->y = wl_fixed_from_int(y);
wlEvent.x = x;
wlEvent.y = y;
wlSeat = inputEvent->inputDevice().seat();
if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
{
- wlSeat->keyboard->grab_key = key;
- wlSeat->keyboard->grab_time = time;
- }
-
- end = (uint32_t*)(((unsigned char*)wlSeat->keyboard->keys.data) + wlSeat->keyboard->keys.size);
- for (k = (uint32_t*)wlSeat->keyboard->keys.data; k < end; ++k)
- {
- if (*k == key)
- {
- // Ignore server-generated repeats
- if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
- return;
- *k = *--end;
- }
- }
- wlSeat->keyboard->keys.size = end - (uint32_t*)wlSeat->keyboard->keys.data;
- if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
- {
- k = (uint32_t*)wl_array_add(&wlSeat->keyboard->keys, sizeof(*k));
- *k = key;
- }
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wlSeat->keyboard->grab_key = key;
+ // wlSeat->keyboard->grab_time = time;
+ }
+
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // end = (uint32_t*)(((unsigned char*)wlSeat->keyboard->keys.data) + wlSeat->keyboard->keys.size);
+ // for (k = (uint32_t*)wlSeat->keyboard->keys.data; k < end; ++k)
+ // {
+ // if (*k == key)
+ // {
+ // // Ignore server-generated repeats
+ // if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
+ // return;
+ // *k = *--end;
+ // }
+ // }
+ // wlSeat->keyboard->keys.size = end - (uint32_t*)wlSeat->keyboard->keys.data;
+ // if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
+ // {
+ // k = (uint32_t*)wl_array_add(&wlSeat->keyboard->keys, sizeof(*k));
+ // *k = key;
+ // }
wlEvent.keyCode = key;
wlEvent.keyState = state;
mods_locked = xkb_state_serialize_mods(m_xkbState.state, (xkb_state_component)XKB_STATE_LOCKED);
group = xkb_state_serialize_mods(m_xkbState.state, (xkb_state_component)XKB_STATE_EFFECTIVE);
- if (mods_depressed != wlSeat->keyboard->modifiers.mods_depressed ||
- mods_latched != wlSeat->keyboard->modifiers.mods_latched ||
- mods_locked != wlSeat->keyboard->modifiers.mods_locked ||
- group != wlSeat->keyboard->modifiers.group)
- {
- changed = 1;
- }
-
- wlSeat->keyboard->modifiers.mods_depressed = mods_depressed;
- wlSeat->keyboard->modifiers.mods_latched = mods_latched;
- wlSeat->keyboard->modifiers.mods_locked = mods_locked;
- wlSeat->keyboard->modifiers.group = group;
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // if (mods_depressed != wlSeat->keyboard->modifiers.mods_depressed ||
+ // mods_latched != wlSeat->keyboard->modifiers.mods_latched ||
+ // mods_locked != wlSeat->keyboard->modifiers.mods_locked ||
+ // group != wlSeat->keyboard->modifiers.group)
+ // {
+ // changed = 1;
+ // }
+
+ // wlSeat->keyboard->modifiers.mods_depressed = mods_depressed;
+ // wlSeat->keyboard->modifiers.mods_latched = mods_latched;
+ // wlSeat->keyboard->modifiers.mods_locked = mods_locked;
+ // wlSeat->keyboard->modifiers.group = group;
// And update the modifier_state for bindings
mods_lookup = mods_depressed | mods_latched;
#include <string.h>
#include "WindowSystems/WaylandInputDevice.h"
+/**
+ * @todo Port to Wayland 1.3.
+ */
+#include <wayland-client.h>
+
/////////////////////////////////////////////////////////////////////////////
static struct wl_resource*
/////////////////////////////////////////////////////////////////////////////
+/**
+ * @todo Port to Wayland 1.3.
+ */
+static const struct wl_seat_listener seat_listener = {
+ NULL, NULL
+ // seat_handle_capabilities,
+ // seat_handle_name
+};
+
+
+static void
+registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
+ const char *interface, uint32_t version)
+{
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ void * user_data = NULL;
+
+ if (strcmp(interface, "wl_seat") == 0) {
+ wl_seat ** seat = (wl_seat **) data;
+ *seat = (wl_seat *) wl_registry_bind(registry, id, &wl_seat_interface,
+ version);
+
+ wl_seat_add_listener(*seat, &seat_listener, user_data);
+ }
+}
+
+static void
+registry_handle_global_remove(void *data, struct wl_registry *registry,
+ uint32_t name)
+{
+}
+
+static const struct wl_registry_listener registry_listener = {
+ registry_handle_global,
+ registry_handle_global_remove
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
WaylandInputDevice::WaylandInputDevice(struct wl_display *display)
: m_wlDisplay(display)
+, m_wlSeat(0)
, m_hasPointer(false)
, m_hasKeyboard(false)
, m_hasTouch(false)
, m_nTp(0)
{
- wl_seat_init(&m_wlSeat);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ wl_registry * const registry = wl_display_get_registry(display);
+ wl_registry_add_listener(registry, ®istry_listener, this);
+
wl_display_add_global(m_wlDisplay,
- &wl_seat_interface,
+ &wl_seat_interface,
this,
WaylandInputDevice::bindInputDevice);
}
if (m_hasPointer)
return;
- wl_pointer_init(&m_deviceInterfaces.wlPointer);
- wl_seat_set_pointer(&m_wlSeat, &m_deviceInterfaces.wlPointer);
+ m_deviceInterfaces.wlPointer = wl_seat_get_pointer(m_wlSeat);
m_hasPointer = true;
LOG_INFO("WaylandInputDevice", "Available pointer");
if (m_hasKeyboard)
return;
- wl_keyboard_init(&m_deviceInterfaces.wlKeyboard);
- wl_seat_set_keyboard(&m_wlSeat, &m_deviceInterfaces.wlKeyboard);
+ m_deviceInterfaces.wlKeyboard = wl_seat_get_keyboard(m_wlSeat);
m_hasKeyboard = true;
LOG_INFO("WaylandInputDevice", "Available keyboard");
if (m_hasTouch)
return;
- wl_touch_init(&m_deviceInterfaces.wlTouch);
- wl_seat_set_touch(&m_wlSeat, &m_deviceInterfaces.wlTouch);
+ m_deviceInterfaces.wlTouch = wl_seat_get_touch(m_wlSeat);
m_hasTouch = true;
LOG_INFO("WaylandInputDevice", "Available touch");
WaylandInputDevice::releaseDevices()
{
if (m_hasPointer)
- wl_pointer_release(&m_deviceInterfaces.wlPointer);
+ wl_pointer_release(m_deviceInterfaces.wlPointer);
if (m_hasKeyboard)
- wl_keyboard_release(&m_deviceInterfaces.wlKeyboard);
+ wl_keyboard_release(m_deviceInterfaces.wlKeyboard);
if (m_hasTouch)
- wl_touch_release(&m_deviceInterfaces.wlTouch);
+ wl_touch_release(m_deviceInterfaces.wlTouch);
}
void
struct wl_seat *seat = inputDevice->seat();
resource->destroy = WaylandInputDevice::destroyResource;
- wl_list_insert(&seat->base_resource_list, &resource->link);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_list_insert(&seat->base_resource_list, &resource->link);
uint32_t caps = 0;
WaylandInputDevice::destroyResource(struct wl_resource *resource)
{
WaylandInputDevice *inputDevice = static_cast<WaylandInputDevice*>(resource->data);
- if (inputDevice->keyboardDevice()->focus_resource == resource)
- {
- inputDevice->keyboardDevice()->focus_resource = 0;
- }
- if (inputDevice->pointerDevice()->focus_resource == resource)
- {
- inputDevice->pointerDevice()->focus_resource = 0;
- }
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // if (inputDevice->keyboardDevice()->focus_resource == resource)
+ // {
+ // inputDevice->keyboardDevice()->focus_resource = 0;
+ // }
+ // if (inputDevice->pointerDevice()->focus_resource == resource)
+ // {
+ // inputDevice->pointerDevice()->focus_resource = 0;
+ // }
inputDevice->cleanupDataDeviceForClient(resource->client, true);
0,
id,
pointer);
- wl_list_insert(&pointer->resource_list, &clientResource->link);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_list_insert(&pointer->resource_list, &clientResource->link);
clientResource->destroy = WaylandInputDevice::destroyDeviceResource;
}
0,
id,
keyboard);
- wl_list_insert(&keyboard->resource_list, &clientResource->link);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_list_insert(&keyboard->resource_list, &clientResource->link);
clientResource->destroy = WaylandInputDevice::destroyDeviceResource;
}
0,
id,
touch);
- wl_list_insert(&touch->resource_list, &clientResource->link);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_list_insert(&touch->resource_list, &clientResource->link);
clientResource->destroy = WaylandInputDevice::destroyDeviceResource;
}
{
sendMouseMotionEvent(globalPos, localPos, time);
wl_pointer *pointer = pointerDevice();
- pointer->button_count++;
- const struct wl_pointer_grab_interface *interface = pointer->grab->interface;
- interface->button(pointer->grab,
- time,
- button,
- WL_POINTER_BUTTON_STATE_PRESSED);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // pointer->button_count++;
+ // const struct wl_pointer_grab_interface *interface = pointer->grab->interface;
+ // interface->button(pointer->grab,
+ // time,
+ // button,
+ // WL_POINTER_BUTTON_STATE_PRESSED);
}
void
{
sendMouseMotionEvent(globalPos, localPos, time);
wl_pointer *pointer = pointerDevice();
- pointer->button_count--;
- const struct wl_pointer_grab_interface *interface = pointer->grab->interface;
- interface->button(pointer->grab,
- time,
- button,
- WL_POINTER_BUTTON_STATE_RELEASED);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // pointer->button_count--;
+ // const struct wl_pointer_grab_interface *interface = pointer->grab->interface;
+ // interface->button(pointer->grab,
+ // time,
+ // button,
+ // WL_POINTER_BUTTON_STATE_RELEASED);
}
void
uint32_t time)
{
wl_pointer *pointer = pointerDevice();
- const struct wl_pointer_grab_interface *interface = pointer->grab->interface;
- pointer->x = wl_fixed_from_double(globalPos.x);
- pointer->y = wl_fixed_from_double(globalPos.y);
- interface->motion(pointer->grab,
- time,
- wl_fixed_from_double(localPos.x),
- wl_fixed_from_double(localPos.y));
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // const struct wl_pointer_grab_interface *interface = pointer->grab->interface;
+ // pointer->x = wl_fixed_from_double(globalPos.x);
+ // pointer->y = wl_fixed_from_double(globalPos.y);
+ // interface->motion(pointer->grab,
+ // time,
+ // wl_fixed_from_double(localPos.x),
+ // wl_fixed_from_double(localPos.y));
}
void
uint32_t time, uint32_t code)
{
wl_keyboard *keyboard = keyboardDevice();
- if (!keyboard->focus)
- {
- setKeyboardFocus(surface);
- }
- if (keyboard->focus_resource)
- {
- uint32_t serial = wl_display_next_serial(m_wlDisplay);
- wl_keyboard_send_key(keyboard->focus_resource,
- serial, time, code, 1);
- }
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // if (!keyboard->focus)
+ // {
+ // setKeyboardFocus(surface);
+ // }
+ // if (keyboard->focus_resource)
+ // {
+ // uint32_t serial = wl_display_next_serial(m_wlDisplay);
+ // wl_keyboard_send_key(keyboard->focus_resource,
+ // serial, time, code, 1);
+ // }
}
void
uint32_t time, uint32_t code)
{
wl_keyboard *keyboard = keyboardDevice();
- if (keyboard->focus_resource)
- {
- uint32_t serial = wl_display_next_serial(m_wlDisplay);
- wl_keyboard_send_key(keyboard->focus_resource,
- serial, time, code, 0);
- }
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // if (keyboard->focus_resource)
+ // {
+ // uint32_t serial = wl_display_next_serial(m_wlDisplay);
+ // wl_keyboard_send_key(keyboard->focus_resource,
+ // serial, time, code, 0);
+ // }
}
void
}
if (m_wlTouchFocusResource && m_wlTouchFocus)
{
- wl_touch_send_down(m_wlTouchFocusResource,
- 0 /*serial*/, time,
- &m_wlTouchFocus->resource, touchId,
- wl_fixed_from_double(touchPos.x),
- wl_fixed_from_double(touchPos.y));
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_touch_send_down(m_wlTouchFocusResource,
+ // 0 /*serial*/, time,
+ // &m_wlTouchFocus->resource, touchId,
+ // wl_fixed_from_double(touchPos.x),
+ // wl_fixed_from_double(touchPos.y));
}
break;
case WL_TOUCH_MOTION:
WaylandInputDevice::sendTouchFrameEvent()
{
wl_touch *touch = touchDevice();
- wl_resource *resource = touch->focus_resource;
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ wl_resource *resource = NULL; // touch->focus_resource;
if (resource)
{
wl_touch_send_frame(resource);
WaylandInputDevice::sendTouchCancelEvent()
{
wl_touch *touch = touchDevice();
- wl_resource *resource = touch->focus_resource;
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ wl_resource *resource = NULL; // touch->focus_resource;
if (resource)
{
wl_touch_send_cancel(resource);
const Point& globalPos,
const Point& localPos)
{
+ /**
+ * @todo Port to Wayland 1.3.
+ */
wl_pointer* pointer = pointerDevice();
- pointer->x = wl_fixed_from_double(globalPos.x);
- pointer->y = wl_fixed_from_double(globalPos.y);
- pointer->current = surface;
- pointer->current_x = wl_fixed_from_double(localPos.x);
- pointer->current_y = wl_fixed_from_double(localPos.y);
- pointer->grab->interface->focus(pointer->grab,
- surface,
- wl_fixed_from_double(localPos.x),
- wl_fixed_from_double(localPos.y));
+ // pointer->x = wl_fixed_from_double(globalPos.x);
+ // pointer->y = wl_fixed_from_double(globalPos.y);
+ // pointer->current = surface;
+ // pointer->current_x = wl_fixed_from_double(localPos.x);
+ // pointer->current_y = wl_fixed_from_double(localPos.y);
+ // pointer->grab->interface->focus(pointer->grab,
+ // surface,
+ // wl_fixed_from_double(localPos.x),
+ // wl_fixed_from_double(localPos.y));
}
void
WaylandInputDevice::setKeyboardFocus(struct wl_surface* surface)
{
- wl_keyboard_set_focus(keyboardDevice(), surface);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ // wl_keyboard_set_focus(keyboardDevice(), surface);
}
void
if (surface)
{
- resource = findResourceForClient(&m_wlSeat.touch->resource_list,
- surface->resource.client);
+ /**
+ * @todo Port to Wayland 1.3.
+ */
+ resource = NULL; // findResourceForClient(m_wlSeat.touch->resource_list,
+ // surface->resource.client);
if (!resource)
{
return;
}
- m_wlSeat.touch->focus = surface;
- m_wlSeat.touch->focus_resource = resource;
+ // m_wlSeat->touch->focus = surface;
+ // m_wlSeat->touch->focus_resource = resource;
}
else
{
- m_wlSeat.touch->focus = NULL;
- m_wlSeat.touch->focus_resource = NULL;
+ // m_wlSeat->touch->focus = NULL;
+ // m_wlSeat->touch->focus_resource = NULL;
}
}
void
WaylandInputDevice::sendModifiers(uint32_t serial)
{
+ /**
+ * @todo Port to Wayland 1.3.
+ */
struct wl_keyboard *keyboard = keyboardDevice();
- struct wl_keyboard_grab *grab = keyboard->grab;
- grab->interface->modifiers(grab, serial,
- keyboard->modifiers.mods_depressed,
- keyboard->modifiers.mods_latched,
- keyboard->modifiers.mods_locked,
- keyboard->modifiers.group);
+ // struct wl_keyboard_grab *grab = keyboard->grab;
+ // grab->interface->modifiers(grab, serial,
+ // keyboard->modifiers.mods_depressed,
+ // keyboard->modifiers.mods_latched,
+ // keyboard->modifiers.mods_locked,
+ // keyboard->modifiers.group);
}