From 5b222098649674042ca721583abcbee22ea60930 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 9 Aug 2016 14:04:32 +0200 Subject: Compositor API: rename QWaylandInputDevice to QWaylandSeat The name QWaylandInputDevice could be confusing and misleading: - A QWaylandInputDevice was not one input device, but a collection of many. - Classes that sounded like they should inherit from it did not, i.e: QWaylandKeyboard, QWaylandPointer and QWaylandTouch. - The Wayland protocol already has another term for this, which is seat. Change-Id: I9d9690d5b378075d9dddaeb8cf18395c7f47603e Reviewed-by: Giulio Camuffo --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 14 +++++++------- src/compositor/wayland_wrapper/qwldatadevice_p.h | 8 ++++---- src/compositor/wayland_wrapper/qwldatadevicemanager.cpp | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 521e5dda5..0d196b82e 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -45,7 +45,7 @@ #include "qwaylandview.h" #include #include -#include +#include #include #include @@ -55,10 +55,10 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -DataDevice::DataDevice(QWaylandInputDevice *inputDevice) +DataDevice::DataDevice(QWaylandSeat *seat) : wl_data_device() - , m_compositor(inputDevice->compositor()) - , m_inputDevice(inputDevice) + , m_compositor(seat->compositor()) + , m_seat(seat) , m_selectionSource(0) , m_dragClient(0) , m_dragDataSource(0) @@ -168,7 +168,7 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource m_dragClient = resource->client(); m_dragDataSource = source ? DataSource::fromResource(source) : 0; m_dragOrigin = QWaylandSurface::fromResource(origin); - QWaylandDrag *drag = m_inputDevice->drag(); + QWaylandDrag *drag = m_seat->drag(); setDragIcon(icon ? QWaylandSurface::fromResource(icon) : nullptr); Q_EMIT drag->dragStarted(); Q_EMIT m_dragOrigin->dragStarted(drag); @@ -191,7 +191,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou if (m_selectionSource) m_selectionSource->setDevice(this); - QWaylandClient *focusClient = m_inputDevice->keyboard()->focusClient(); + QWaylandClient *focusClient = m_seat->keyboard()->focusClient(); Resource *resource = focusClient ? resourceMap().value(focusClient->client()) : 0; if (resource && m_selectionSource) { @@ -207,7 +207,7 @@ void DataDevice::setDragIcon(QWaylandSurface *icon) if (icon == m_dragIcon) return; m_dragIcon = icon; - Q_EMIT m_inputDevice->drag()->iconChanged(); + Q_EMIT m_seat->drag()->iconChanged(); } } diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 6a8e4e381..17591ae27 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -49,7 +49,7 @@ // #include -#include +#include QT_BEGIN_NAMESPACE @@ -57,13 +57,13 @@ namespace QtWayland { class Compositor; class DataSource; -class InputDevice; +class Seat; class Surface; class DataDevice : public QtWaylandServer::wl_data_device { public: - DataDevice(QWaylandInputDevice *inputDevice); + DataDevice(QWaylandSeat *seat); void setFocus(QWaylandClient *client); @@ -86,7 +86,7 @@ private: void setDragIcon(QWaylandSurface *icon); QWaylandCompositor *m_compositor; - QWaylandInputDevice *m_inputDevice; + QWaylandSeat *m_seat; DataSource *m_selectionSource; diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index 2f40b0e43..5fed6ef18 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -39,7 +39,7 @@ #include #include -#include +#include #include "qwldatadevice_p.h" #include "qwldatasource_p.h" #include "qwldataoffer_p.h" @@ -199,11 +199,11 @@ void DataDeviceManager::overrideSelection(const QMimeData &mimeData) m_compositorOwnsSelection = true; - QWaylandInputDevice *dev = m_compositor->defaultInputDevice(); + QWaylandSeat *dev = m_compositor->defaultSeat(); QWaylandSurface *focusSurface = dev->keyboardFocus(); if (focusSurface) offerFromCompositorToClient( - QWaylandInputDevicePrivate::get(dev)->dataDevice()->resourceMap().value(focusSurface->waylandClient())->handle); + QWaylandSeatPrivate::get(dev)->dataDevice()->resourceMap().value(focusSurface->waylandClient())->handle); } bool DataDeviceManager::offerFromCompositorToClient(wl_resource *clientDataDeviceResource) @@ -243,8 +243,8 @@ void DataDeviceManager::data_device_manager_create_data_source(Resource *resourc void DataDeviceManager::data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat) { - QWaylandInputDevice *input_device = QWaylandInputDevice::fromSeatResource(seat); - QWaylandInputDevicePrivate::get(input_device)->clientRequestedDataDevice(this, resource->client(), id); + QWaylandSeat *input_device = QWaylandSeat::fromSeatResource(seat); + QWaylandSeatPrivate::get(input_device)->clientRequestedDataDevice(this, resource->client(), id); } void DataDeviceManager::comp_accept(wl_client *, wl_resource *, uint32_t, const char *) -- cgit v1.2.3