Run .clang-format

This commit is contained in:
Vlad Zahorodnii 2022-04-19 13:14:26 +03:00
parent 14ae6e3100
commit 227ab071be
50 changed files with 247 additions and 220 deletions

View file

@ -60,7 +60,8 @@ public:
/** /**
* Structure containing DBus service name and path * Structure containing DBus service name and path
*/ */
struct InterfaceAddress { struct InterfaceAddress
{
/** Service name of host with the AppMenu object*/ /** Service name of host with the AppMenu object*/
QString serviceName; QString serviceName;
/** Object path of the AppMenu interface*/ /** Object path of the AppMenu interface*/

View file

@ -39,7 +39,8 @@ private:
SeatInterface *m_seatInterface = nullptr; SeatInterface *m_seatInterface = nullptr;
DataDeviceManagerInterface *m_ddmInterface = nullptr; DataDeviceManagerInterface *m_ddmInterface = nullptr;
struct Connection { struct Connection
{
ConnectionThread *connection = nullptr; ConnectionThread *connection = nullptr;
QThread *thread = nullptr; QThread *thread = nullptr;
EventQueue *queue = nullptr; EventQueue *queue = nullptr;

View file

@ -1100,7 +1100,7 @@ class PointerHoldGesture : public QObject, public QtWayland::zwp_pointer_gesture
cancelled ? Q_EMIT this->cancelled(serial, time) : Q_EMIT ended(serial, time); cancelled ? Q_EMIT this->cancelled(serial, time) : Q_EMIT ended(serial, time);
} }
Q_SIGNALS: Q_SIGNALS:
void started(quint32 serial , quint32 time, void *surface, quint32 fingers); void started(quint32 serial, quint32 time, void *surface, quint32 fingers);
void ended(quint32 serial, quint32 time); void ended(quint32 serial, quint32 time);
void cancelled(quint32 serial, quint32 time); void cancelled(quint32 serial, quint32 time);
}; };
@ -1126,7 +1126,6 @@ void TestWaylandSeat::testPointerHoldGesture()
PointerHoldGesture gesture(gestures.get_hold_gesture(*pointer)); PointerHoldGesture gesture(gestures.get_hold_gesture(*pointer));
QVERIFY(gesture.isInitialized()); QVERIFY(gesture.isInitialized());
QSignalSpy startSpy(&gesture, &PointerHoldGesture::started); QSignalSpy startSpy(&gesture, &PointerHoldGesture::started);
QVERIFY(startSpy.isValid()); QVERIFY(startSpy.isValid());
QSignalSpy endSpy(&gesture, &PointerHoldGesture::ended); QSignalSpy endSpy(&gesture, &PointerHoldGesture::ended);
@ -1139,7 +1138,7 @@ void TestWaylandSeat::testPointerHoldGesture()
QVERIFY(surfaceCreatedSpy.isValid()); QVERIFY(surfaceCreatedSpy.isValid());
QScopedPointer<Surface> surface(m_compositor->createSurface()); QScopedPointer<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait()); QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface*>(); auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
QVERIFY(serverSurface); QVERIFY(serverSurface);
QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied);
@ -1162,7 +1161,7 @@ void TestWaylandSeat::testPointerHoldGesture()
QCOMPARE(startSpy.count(), 1); QCOMPARE(startSpy.count(), 1);
QCOMPARE(startSpy.first().at(0).value<quint32>(), m_display->serial()); QCOMPARE(startSpy.first().at(0).value<quint32>(), m_display->serial());
QCOMPARE(startSpy.first().at(1).value<quint32>(), 1u); QCOMPARE(startSpy.first().at(1).value<quint32>(), 1u);
QCOMPARE(startSpy.first().at(2).value<void*>(), *surface.get()); QCOMPARE(startSpy.first().at(2).value<void *>(), *surface.get());
QCOMPARE(startSpy.first().at(3).value<quint32>(), 3); QCOMPARE(startSpy.first().at(3).value<quint32>(), 3);
// another start should not be possible // another start should not be possible

View file

@ -35,7 +35,8 @@ public:
QPointer<DataSourceInterface> selection; QPointer<DataSourceInterface> selection;
QPointer<SurfaceInterface> proxyRemoteSurface; QPointer<SurfaceInterface> proxyRemoteSurface;
struct Drag { struct Drag
{
SurfaceInterface *surface = nullptr; SurfaceInterface *surface = nullptr;
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
QMetaObject::Connection posConnection; QMetaObject::Connection posConnection;

View file

@ -157,7 +157,7 @@ QList<OutputInterface *> Display::outputs() const
return d->outputs; return d->outputs;
} }
QList< OutputDeviceV2Interface* > Display::outputDevices() const QList<OutputDeviceV2Interface *> Display::outputDevices() const
{ {
return d->outputdevicesV2; return d->outputdevicesV2;
} }
@ -233,7 +233,8 @@ void *Display::eglDisplay() const
return d->eglDisplay; return d->eglDisplay;
} }
struct ClientBufferDestroyListener : wl_listener { struct ClientBufferDestroyListener : wl_listener
{
ClientBufferDestroyListener(Display *display, ClientBuffer *buffer); ClientBufferDestroyListener(Display *display, ClientBuffer *buffer);
~ClientBufferDestroyListener(); ~ClientBufferDestroyListener();

View file

@ -111,7 +111,7 @@ public:
/** /**
* @returns All SeatInterface currently managed on the Display. * @returns All SeatInterface currently managed on the Display.
*/ */
QVector<SeatInterface*> seats() const; QVector<SeatInterface *> seats() const;
QList<OutputDeviceV2Interface *> outputDevices() const; QList<OutputDeviceV2Interface *> outputDevices() const;
QList<OutputInterface *> outputs() const; QList<OutputInterface *> outputs() const;
QVector<OutputInterface *> outputsIntersecting(const QRect &rect) const; QVector<OutputInterface *> outputsIntersecting(const QRect &rect) const;

View file

@ -5,8 +5,8 @@
*/ */
#include "drmleasedevice_v1_interface.h" #include "drmleasedevice_v1_interface.h"
#include "drmleasedevice_v1_interface_p.h"
#include "display.h" #include "display.h"
#include "drmleasedevice_v1_interface_p.h"
#include "logging.h" #include "logging.h"
#include "utils.h" #include "utils.h"
@ -60,7 +60,6 @@ void DrmLeaseDeviceV1Interface::setDrmMaster(bool hasDrmMaster)
d->hasDrmMaster = hasDrmMaster; d->hasDrmMaster = hasDrmMaster;
} }
DrmLeaseDeviceV1InterfacePrivate::DrmLeaseDeviceV1InterfacePrivate(Display *display, DrmLeaseDeviceV1Interface *device, std::function<int()> createNonMasterFd) DrmLeaseDeviceV1InterfacePrivate::DrmLeaseDeviceV1InterfacePrivate(Display *display, DrmLeaseDeviceV1Interface *device, std::function<int()> createNonMasterFd)
: QtWaylandServer::wp_drm_lease_device_v1(*display, s_version) : QtWaylandServer::wp_drm_lease_device_v1(*display, s_version)
, q(device) , q(device)
@ -165,7 +164,6 @@ void DrmLeaseDeviceV1InterfacePrivate::wp_drm_lease_device_v1_destroy_global()
delete this; delete this;
} }
DrmLeaseConnectorV1Interface::DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, DrmLeaseConnectorV1Interface::DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice,
uint32_t id, uint32_t id,
const QString &name, const QString &name,
@ -186,7 +184,7 @@ DrmLeaseConnectorV1Interface::~DrmLeaseConnectorV1Interface()
DrmLeaseConnectorV1Interface *DrmLeaseConnectorV1Interface::get(wl_resource *resource) DrmLeaseConnectorV1Interface *DrmLeaseConnectorV1Interface::get(wl_resource *resource)
{ {
if (auto connectorPrivate = resource_cast<DrmLeaseConnectorV1InterfacePrivate*>(resource)) { if (auto connectorPrivate = resource_cast<DrmLeaseConnectorV1InterfacePrivate *>(resource)) {
return connectorPrivate->q; return connectorPrivate->q;
} }
return nullptr; return nullptr;
@ -239,7 +237,6 @@ void DrmLeaseConnectorV1InterfacePrivate::wp_drm_lease_connector_v1_destroy(Reso
wl_resource_destroy(resource->handle); wl_resource_destroy(resource->handle);
} }
DrmLeaseRequestV1Interface::DrmLeaseRequestV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource) DrmLeaseRequestV1Interface::DrmLeaseRequestV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource)
: wp_drm_lease_request_v1(resource) : wp_drm_lease_request_v1(resource)
, device(device) , device(device)
@ -363,7 +360,6 @@ QVector<DrmLeaseConnectorV1Interface *> DrmLeaseV1Interface::connectors() const
return d->connectors; return d->connectors;
} }
DrmLeaseV1InterfacePrivate::DrmLeaseV1InterfacePrivate(DrmLeaseDeviceV1InterfacePrivate *device, DrmLeaseV1Interface *q, wl_resource *resource) DrmLeaseV1InterfacePrivate::DrmLeaseV1InterfacePrivate(DrmLeaseDeviceV1InterfacePrivate *device, DrmLeaseV1Interface *q, wl_resource *resource)
: wp_drm_lease_v1(resource) : wp_drm_lease_v1(resource)
, device(device) , device(device)

View file

@ -40,6 +40,7 @@ public:
std::function<int()> createNonMasterFd; std::function<int()> createNonMasterFd;
bool hasDrmMaster = true; bool hasDrmMaster = true;
bool removed = false; bool removed = false;
protected: protected:
void wp_drm_lease_device_v1_create_lease_request(Resource *resource, uint32_t id) override; void wp_drm_lease_device_v1_create_lease_request(Resource *resource, uint32_t id) override;
void wp_drm_lease_device_v1_release(Resource *resource) override; void wp_drm_lease_device_v1_release(Resource *resource) override;
@ -66,6 +67,7 @@ public:
QString name; QString name;
QString description; QString description;
bool withdrawn = false; bool withdrawn = false;
protected: protected:
void wp_drm_lease_connector_v1_destroy(Resource *resource) override; void wp_drm_lease_connector_v1_destroy(Resource *resource) override;
}; };
@ -79,6 +81,7 @@ public:
DrmLeaseDeviceV1InterfacePrivate *device; DrmLeaseDeviceV1InterfacePrivate *device;
QVector<DrmLeaseConnectorV1Interface *> connectors; QVector<DrmLeaseConnectorV1Interface *> connectors;
bool invalid = false; bool invalid = false;
protected: protected:
void wp_drm_lease_request_v1_request_connector(Resource *resource, struct ::wl_resource *connector) override; void wp_drm_lease_request_v1_request_connector(Resource *resource, struct ::wl_resource *connector) override;
void wp_drm_lease_request_v1_submit(Resource *resource, uint32_t id) override; void wp_drm_lease_request_v1_submit(Resource *resource, uint32_t id) override;
@ -95,10 +98,10 @@ public:
QVector<DrmLeaseConnectorV1Interface *> connectors; QVector<DrmLeaseConnectorV1Interface *> connectors;
uint32_t lesseeId = 0; uint32_t lesseeId = 0;
bool finished = false; bool finished = false;
protected: protected:
void wp_drm_lease_v1_destroy(Resource *resource) override; void wp_drm_lease_v1_destroy(Resource *resource) override;
void wp_drm_lease_v1_destroy_resource(Resource *resource) override; void wp_drm_lease_v1_destroy_resource(Resource *resource) override;
}; };
} }

View file

@ -39,12 +39,14 @@ public:
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
QByteArray keymap; QByteArray keymap;
struct { struct
{
qint32 charactersPerSecond = 0; qint32 charactersPerSecond = 0;
qint32 delay = 0; qint32 delay = 0;
} keyRepeat; } keyRepeat;
struct Modifiers { struct Modifiers
{
quint32 depressed = 0; quint32 depressed = 0;
quint32 latched = 0; quint32 latched = 0;
quint32 locked = 0; quint32 locked = 0;

View file

@ -59,7 +59,12 @@ class KWAYLANDSERVER_EXPORT LayerSurfaceV1Interface : public QObject
Q_OBJECT Q_OBJECT
public: public:
enum Layer { BackgroundLayer, BottomLayer, TopLayer, OverlayLayer }; enum Layer {
BackgroundLayer,
BottomLayer,
TopLayer,
OverlayLayer,
};
LayerSurfaceV1Interface(LayerShellV1Interface *shell, LayerSurfaceV1Interface(LayerShellV1Interface *shell,
SurfaceInterface *surface, SurfaceInterface *surface,

View file

@ -16,8 +16,8 @@
#include "surface_interface_p.h" #include "surface_interface_p.h"
#include <QTemporaryFile> #include <QTemporaryFile>
#include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <unistd.h> #include <unistd.h>
namespace KWaylandServer namespace KWaylandServer
@ -508,7 +508,8 @@ void LinuxDmaBufV1FeedbackPrivate::zwp_linux_dmabuf_feedback_v1_destroy(Resource
wl_resource_destroy(resource->handle); wl_resource_destroy(resource->handle);
} }
struct linux_dmabuf_feedback_v1_table_entry { struct linux_dmabuf_feedback_v1_table_entry
{
uint32_t format; uint32_t format;
uint32_t pad; // unused uint32_t pad; // unused
uint64_t modifier; uint64_t modifier;

View file

@ -24,7 +24,8 @@ class LinuxDmaBufV1FeedbackPrivate;
/** /**
* The LinuxDmaBufV1Plane type represents a plane in a client buffer. * The LinuxDmaBufV1Plane type represents a plane in a client buffer.
*/ */
struct LinuxDmaBufV1Plane { struct LinuxDmaBufV1Plane
{
int fd = -1; ///< The dmabuf file descriptor int fd = -1; ///< The dmabuf file descriptor
quint32 offset = 0; ///< The offset from the start of buffer quint32 offset = 0; ///< The offset from the start of buffer
quint32 stride = 0; ///< The distance from the start of a row to the next row in bytes quint32 stride = 0; ///< The distance from the start of a row to the next row in bytes
@ -70,7 +71,8 @@ public:
}; };
Q_DECLARE_FLAGS(TrancheFlags, TrancheFlag) Q_DECLARE_FLAGS(TrancheFlags, TrancheFlag)
struct Tranche { struct Tranche
{
dev_t device; dev_t device;
TrancheFlags flags; TrancheFlags flags;
QHash<uint32_t, QVector<uint64_t>> formatTable; QHash<uint32_t, QVector<uint64_t>> formatTable;

View file

@ -40,7 +40,8 @@ public:
OutputInterface::SubPixel subPixel = OutputInterface::SubPixel::Unknown; OutputInterface::SubPixel subPixel = OutputInterface::SubPixel::Unknown;
OutputInterface::Transform transform = OutputInterface::Transform::Normal; OutputInterface::Transform transform = OutputInterface::Transform::Normal;
OutputInterface::Mode mode; OutputInterface::Mode mode;
struct { struct
{
OutputInterface::DpmsMode mode = OutputInterface::DpmsMode::Off; OutputInterface::DpmsMode mode = OutputInterface::DpmsMode::Off;
bool supported = false; bool supported = false;
} dpms; } dpms;

View file

@ -54,7 +54,8 @@ public:
Flipped180, Flipped180,
Flipped270, Flipped270,
}; };
struct Mode { struct Mode
{
QSize size = QSize(); QSize size = QSize();
int refreshRate = 60000; int refreshRate = 60000;
}; };

View file

@ -5,14 +5,14 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/ */
#include "display.h"
#include "outputconfiguration_v2_interface.h" #include "outputconfiguration_v2_interface.h"
#include "outputdevice_v2_interface.h" #include "display.h"
#include "logging.h" #include "logging.h"
#include "outputchangeset_v2_p.h" #include "outputchangeset_v2_p.h"
#include "outputdevice_v2_interface.h"
#include "qwayland-server-kde-output-management-v2.h"
#include "qwayland-server-kde-output-device-v2.h" #include "qwayland-server-kde-output-device-v2.h"
#include "qwayland-server-kde-output-management-v2.h"
#include <wayland-client-protocol.h> #include <wayland-client-protocol.h>
@ -190,7 +190,7 @@ OutputConfigurationV2InterfacePrivate::OutputConfigurationV2InterfacePrivate(Out
{ {
} }
QHash<OutputDeviceV2Interface*, OutputChangeSetV2*> OutputConfigurationV2Interface::changes() const QHash<OutputDeviceV2Interface *, OutputChangeSetV2 *> OutputConfigurationV2Interface::changes() const
{ {
return d->changes; return d->changes;
} }
@ -244,12 +244,7 @@ bool OutputConfigurationV2InterfacePrivate::hasPendingChanges(OutputDeviceV2Inte
return false; return false;
} }
auto c = *it; auto c = *it;
return c->enabledChanged() || return c->enabledChanged() || c->sizeChanged() || c->refreshRateChanged() || c->transformChanged() || c->positionChanged() || c->scaleChanged();
c->sizeChanged() ||
c->refreshRateChanged() ||
c->transformChanged() ||
c->positionChanged() ||
c->scaleChanged();
} }
void OutputConfigurationV2InterfacePrivate::clearPendingChanges() void OutputConfigurationV2InterfacePrivate::clearPendingChanges()

View file

@ -6,9 +6,9 @@
*/ */
#pragma once #pragma once
#include "outputmanagement_v2_interface.h"
#include "outputdevice_v2_interface.h"
#include "outputchangeset_v2.h" #include "outputchangeset_v2.h"
#include "outputdevice_v2_interface.h"
#include "outputmanagement_v2_interface.h"
#include <KWaylandServer/kwaylandserver_export.h> #include <KWaylandServer/kwaylandserver_export.h>
@ -88,7 +88,6 @@ private:
QScopedPointer<OutputConfigurationV2InterfacePrivate> d; QScopedPointer<OutputConfigurationV2InterfacePrivate> d;
}; };
} }
Q_DECLARE_METATYPE(KWaylandServer::OutputConfigurationV2Interface*) Q_DECLARE_METATYPE(KWaylandServer::OutputConfigurationV2Interface *)

View file

@ -6,14 +6,14 @@
*/ */
#include "outputdevice_v2_interface.h" #include "outputdevice_v2_interface.h"
#include "display_p.h"
#include "display.h" #include "display.h"
#include "display_p.h"
#include "logging.h" #include "logging.h"
#include "utils.h" #include "utils.h"
#include <QDebug> #include <QDebug>
#include <QString>
#include <QPointer> #include <QPointer>
#include <QString>
#include <wayland-client-protocol.h> #include <wayland-client-protocol.h>
@ -84,7 +84,8 @@ protected:
class OutputDeviceModeV2InterfacePrivate : public QtWaylandServer::kde_output_device_mode_v2 class OutputDeviceModeV2InterfacePrivate : public QtWaylandServer::kde_output_device_mode_v2
{ {
public: public:
struct ModeResource : Resource { struct ModeResource : Resource
{
OutputDeviceV2InterfacePrivate::Resource *output; OutputDeviceV2InterfacePrivate::Resource *output;
}; };
@ -96,7 +97,10 @@ public:
void bindResource(wl_resource *resource); void bindResource(wl_resource *resource);
static OutputDeviceModeV2InterfacePrivate *get(OutputDeviceModeV2Interface *mode) { return mode->d.data(); } static OutputDeviceModeV2InterfacePrivate *get(OutputDeviceModeV2Interface *mode)
{
return mode->d.data();
}
OutputDeviceModeV2Interface *q; OutputDeviceModeV2Interface *q;
@ -191,11 +195,9 @@ void OutputDeviceV2Interface::setCurrentMode(OutputDeviceModeV2Interface *mode)
bool OutputDeviceV2Interface::setCurrentMode(const QSize &size, int refreshRate) bool OutputDeviceV2Interface::setCurrentMode(const QSize &size, int refreshRate)
{ {
auto mode = std::find_if(d->modes.begin(), d->modes.end(), auto mode = std::find_if(d->modes.begin(), d->modes.end(), [size, refreshRate](OutputDeviceModeV2Interface *mode) {
[size, refreshRate](OutputDeviceModeV2Interface *mode) {
return mode->size() == size && mode->refreshRate() == refreshRate; return mode->size() == size && mode->refreshRate() == refreshRate;
} });
);
if (mode == d->modes.end()) { if (mode == d->modes.end()) {
return false; return false;
} }
@ -692,12 +694,14 @@ OutputDeviceModeV2InterfacePrivate::OutputDeviceModeV2InterfacePrivate(OutputDev
, m_size(size) , m_size(size)
, m_refreshRate(refreshRate) , m_refreshRate(refreshRate)
, m_flags(flags) , m_flags(flags)
{} {
}
OutputDeviceModeV2Interface::OutputDeviceModeV2Interface(const QSize &size, int refreshRate, ModeFlags flags, QObject *parent) OutputDeviceModeV2Interface::OutputDeviceModeV2Interface(const QSize &size, int refreshRate, ModeFlags flags, QObject *parent)
: QObject(parent) : QObject(parent)
, d(new OutputDeviceModeV2InterfacePrivate(this, size, refreshRate, flags)) , d(new OutputDeviceModeV2InterfacePrivate(this, size, refreshRate, flags))
{} {
}
OutputDeviceModeV2Interface::~OutputDeviceModeV2Interface() = default; OutputDeviceModeV2Interface::~OutputDeviceModeV2Interface() = default;

View file

@ -24,7 +24,6 @@ class OutputDeviceV2InterfacePrivate;
class OutputDeviceModeV2Interface; class OutputDeviceModeV2Interface;
class OutputDeviceModeV2InterfacePrivate; class OutputDeviceModeV2InterfacePrivate;
/** @class OutputDeviceV2Interface /** @class OutputDeviceV2Interface
* *
* Represents an output device, the difference to Output is that this output can be disabled, * Represents an output device, the difference to Output is that this output can be disabled,
@ -146,7 +145,7 @@ private:
* *
* Represents an output device mode. * Represents an output device mode.
* *
* @see OutputDeviceV2Interface * @see OutputDeviceV2Interface
*/ */
class KWAYLANDSERVER_EXPORT OutputDeviceModeV2Interface : public QObject class KWAYLANDSERVER_EXPORT OutputDeviceModeV2Interface : public QObject
{ {

View file

@ -4,12 +4,12 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/ */
#include "display.h"
#include "outputmanagement_v2_interface.h" #include "outputmanagement_v2_interface.h"
#include "display.h"
#include "outputconfiguration_v2_interface.h" #include "outputconfiguration_v2_interface.h"
#include <wayland-server.h>
#include "qwayland-server-kde-output-management-v2.h" #include "qwayland-server-kde-output-management-v2.h"
#include <wayland-server.h>
#include <QHash> #include <QHash>

View file

@ -538,7 +538,6 @@ public:
*/ */
void startPointerHoldGesture(quint32 fingerCount); void startPointerHoldGesture(quint32 fingerCount);
/** /**
* The multi-finger hold gesture ended. This may happen when one or more fingers are lifted. * The multi-finger hold gesture ended. This may happen when one or more fingers are lifted.
* @see startPointerHoldGesture * @see startPointerHoldGesture

View file

@ -69,7 +69,8 @@ public:
AbstractDataSource *currentPrimarySelection = nullptr; AbstractDataSource *currentPrimarySelection = nullptr;
// Pointer related members // Pointer related members
struct Pointer { struct Pointer
{
enum class State { enum class State {
Released, Released,
Pressed, Pressed,
@ -77,7 +78,8 @@ public:
QHash<quint32, quint32> buttonSerials; QHash<quint32, quint32> buttonSerials;
QHash<quint32, State> buttonStates; QHash<quint32, State> buttonStates;
QPointF pos; QPointF pos;
struct Focus { struct Focus
{
SurfaceInterface *surface = nullptr; SurfaceInterface *surface = nullptr;
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
QPointF offset = QPointF(); QPointF offset = QPointF();
@ -91,8 +93,10 @@ public:
void updatePointerButtonState(quint32 button, Pointer::State state); void updatePointerButtonState(quint32 button, Pointer::State state);
// Keyboard related members // Keyboard related members
struct Keyboard { struct Keyboard
struct Focus { {
struct Focus
{
SurfaceInterface *surface = nullptr; SurfaceInterface *surface = nullptr;
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
quint32 serial = 0; quint32 serial = 0;
@ -104,8 +108,10 @@ public:
Keyboard globalKeyboard; Keyboard globalKeyboard;
// Touch related members // Touch related members
struct Touch { struct Touch
struct Focus { {
struct Focus
{
SurfaceInterface *surface = nullptr; SurfaceInterface *surface = nullptr;
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
QPointF offset = QPointF(); QPointF offset = QPointF();
@ -117,7 +123,8 @@ public:
}; };
Touch globalTouch; Touch globalTouch;
struct Drag { struct Drag
{
enum class Mode { enum class Mode {
None, None,
Pointer, Pointer,

View file

@ -91,7 +91,8 @@ public:
ShadowInterfacePrivate(ShadowInterface *_q, wl_resource *resource); ShadowInterfacePrivate(ShadowInterface *_q, wl_resource *resource);
~ShadowInterfacePrivate(); ~ShadowInterfacePrivate();
struct State { struct State
{
enum Flags { enum Flags {
None = 0, None = 0,
LeftBuffer = 1 << 0, LeftBuffer = 1 << 0,

View file

@ -30,7 +30,8 @@ public:
bool hasAlphaChannel = false; bool hasAlphaChannel = false;
QImage savedData; QImage savedData;
struct DestroyListener { struct DestroyListener
{
wl_listener listener; wl_listener listener;
ShmClientBufferPrivate *receiver; ShmClientBufferPrivate *receiver;
}; };

View file

@ -38,16 +38,13 @@ SurfaceInterfacePrivate::~SurfaceInterfacePrivate()
wl_resource *resource; wl_resource *resource;
wl_resource *tmp; wl_resource *tmp;
wl_resource_for_each_safe(resource, tmp, &current.frameCallbacks) wl_resource_for_each_safe (resource, tmp, &current.frameCallbacks) {
{
wl_resource_destroy(resource); wl_resource_destroy(resource);
} }
wl_resource_for_each_safe(resource, tmp, &pending.frameCallbacks) wl_resource_for_each_safe (resource, tmp, &pending.frameCallbacks) {
{
wl_resource_destroy(resource); wl_resource_destroy(resource);
} }
wl_resource_for_each_safe(resource, tmp, &cached.frameCallbacks) wl_resource_for_each_safe (resource, tmp, &cached.frameCallbacks) {
{
wl_resource_destroy(resource); wl_resource_destroy(resource);
} }
@ -368,8 +365,7 @@ void SurfaceInterface::frameRendered(quint32 msec)
wl_resource *resource; wl_resource *resource;
wl_resource *tmp; wl_resource *tmp;
wl_resource_for_each_safe(resource, tmp, &d->current.frameCallbacks) wl_resource_for_each_safe (resource, tmp, &d->current.frameCallbacks) {
{
wl_callback_send_done(resource, msec); wl_callback_send_done(resource, msec);
wl_resource_destroy(resource); wl_resource_destroy(resource);
} }

View file

@ -20,7 +20,8 @@ class IdleInhibitorV1Interface;
class SurfaceRole; class SurfaceRole;
class ViewportInterface; class ViewportInterface;
struct SurfaceState { struct SurfaceState
{
void mergeInto(SurfaceState *target); void mergeInto(SurfaceState *target);
QRegion damage = QRegion(); QRegion damage = QRegion();
@ -53,7 +54,8 @@ struct SurfaceState {
QList<SubSurfaceInterface *> below; QList<SubSurfaceInterface *> below;
QList<SubSurfaceInterface *> above; QList<SubSurfaceInterface *> above;
struct { struct
{
QRectF sourceGeometry = QRectF(); QRectF sourceGeometry = QRectF();
QSize destinationSize = QSize(); QSize destinationSize = QSize();
bool sourceGeometryIsSet = false; bool sourceGeometryIsSet = false;

View file

@ -59,7 +59,8 @@ private:
PlasmaShell *m_plasmaShell = nullptr; PlasmaShell *m_plasmaShell = nullptr;
PlasmaShellSurface *m_plasmaShellSurface = nullptr; PlasmaShellSurface *m_plasmaShellSurface = nullptr;
PlasmaWindowManagement *m_windowManagement = nullptr; PlasmaWindowManagement *m_windowManagement = nullptr;
struct { struct
{
Surface *surface = nullptr; Surface *surface = nullptr;
ShellSurface *shellSurface = nullptr; ShellSurface *shellSurface = nullptr;
PlasmaShellSurface *plasmaSurface = nullptr; PlasmaShellSurface *plasmaSurface = nullptr;

View file

@ -63,7 +63,8 @@ public:
qint32 surroundingTextSelectionAnchor = 0; qint32 surroundingTextSelectionAnchor = 0;
TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod; TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod;
struct { struct
{
QRect cursorRectangle; QRect cursorRectangle;
TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod; TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod;
TextInputContentHints contentHints = TextInputContentHint::None; TextInputContentHints contentHints = TextInputContentHint::None;

View file

@ -18,7 +18,8 @@ struct wl_resource;
namespace KWaylandServer namespace KWaylandServer
{ {
template<typename T> template<typename T>
struct SafeGlobalDeleter { struct SafeGlobalDeleter
{
static inline void cleanup(T *global) static inline void cleanup(T *global)
{ {
if (global) { if (global) {

View file

@ -61,7 +61,12 @@ class KWAYLANDSERVER_EXPORT XdgToplevelDecorationV1Interface : public QObject
Q_OBJECT Q_OBJECT
public: public:
enum class Mode { Undefined, None, Client, Server }; enum class Mode {
Undefined,
None,
Client,
Server,
};
Q_ENUM(Mode) Q_ENUM(Mode)
/** /**

View file

@ -83,7 +83,8 @@ protected:
void xdg_positioner_set_parent_configure(Resource *resource, uint32_t serial) override; void xdg_positioner_set_parent_configure(Resource *resource, uint32_t serial) override;
}; };
struct XdgSurfaceState { struct XdgSurfaceState
{
QRect windowGeometry; QRect windowGeometry;
quint32 acknowledgedConfigure; quint32 acknowledgedConfigure;
bool acknowledgedConfigureIsSet = false; bool acknowledgedConfigureIsSet = false;
@ -139,7 +140,8 @@ public:
QString windowTitle; QString windowTitle;
QString windowClass; QString windowClass;
struct State { struct State
{
QSize minimumSize; QSize minimumSize;
QSize maximumSize; QSize maximumSize;
}; };