diff options
61 files changed, 164 insertions, 164 deletions
diff --git a/examples/wayland/custom-extension/compositor/customextension.h b/examples/wayland/custom-extension/compositor/customextension.h index de7df6ac..dc44dfc2 100644 --- a/examples/wayland/custom-extension/compositor/customextension.h +++ b/examples/wayland/custom-extension/compositor/customextension.h @@ -65,7 +65,7 @@ class CustomExtension : public QWaylandCompositorExtensionTemplate<CustomExtens { Q_OBJECT public: - CustomExtension(QWaylandCompositor *compositor = 0); + CustomExtension(QWaylandCompositor *compositor = nullptr); void initialize() override; signals: diff --git a/examples/wayland/minimal-cpp/compositor.h b/examples/wayland/minimal-cpp/compositor.h index d20ccb3c..76af25ec 100644 --- a/examples/wayland/minimal-cpp/compositor.h +++ b/examples/wayland/minimal-cpp/compositor.h @@ -64,7 +64,7 @@ class View : public QWaylandView { Q_OBJECT public: - View() : m_texture(0) {} + View() : m_texture(nullptr) {} QOpenGLTexture *getTexture(); bool isCursor() const; private: diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp index a66a33d5..9de81e5f 100644 --- a/examples/wayland/minimal-cpp/window.cpp +++ b/examples/wayland/minimal-cpp/window.cpp @@ -58,7 +58,7 @@ #include <QRandomGenerator> Window::Window() - : m_compositor(0) + : m_compositor(nullptr) { } diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp index 64f46826..11516a18 100644 --- a/examples/wayland/qwindow-compositor/compositor.cpp +++ b/examples/wayland/qwindow-compositor/compositor.cpp @@ -69,7 +69,7 @@ View::View(Compositor *compositor) : m_compositor(compositor) , m_textureTarget(GL_TEXTURE_2D) - , m_texture(0) + , m_texture(nullptr) , m_wlShellSurface(nullptr) , m_xdgSurface(nullptr) , m_xdgPopup(nullptr) @@ -502,7 +502,7 @@ void Compositor::startDrag() void Compositor::handleDrag(View *target, QMouseEvent *me) { QPointF pos = me->localPos(); - QWaylandSurface *surface = 0; + QWaylandSurface *surface = nullptr; if (target) { pos -= target->position(); surface = target->surface(); diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp index c795f70a..9d5b4395 100644 --- a/examples/wayland/qwindow-compositor/window.cpp +++ b/examples/wayland/qwindow-compositor/window.cpp @@ -60,10 +60,10 @@ #include <QtWaylandCompositor/qwaylandseat.h> Window::Window() - : m_backgroundTexture(0) - , m_compositor(0) + : m_backgroundTexture(nullptr) + , m_compositor(nullptr) , m_grabState(NoGrab) - , m_dragIconView(0) + , m_dragIconView(nullptr) { } @@ -162,7 +162,7 @@ void Window::paintGL() View *Window::viewAt(const QPointF &point) { - View *ret = 0; + View *ret = nullptr; Q_FOREACH (View *view, m_compositor->views()) { if (view == m_dragIconView) continue; @@ -226,7 +226,7 @@ void Window::mouseReleaseEvent(QMouseEvent *e) View *view = viewAt(e->localPos()); m_compositor->handleDrag(view, e); } - m_mouseView = 0; + m_mouseView = nullptr; m_grabState = NoGrab; } } diff --git a/src/client/global/qwaylandclientextension.cpp b/src/client/global/qwaylandclientextension.cpp index ad266a68..60a8944f 100644 --- a/src/client/global/qwaylandclientextension.cpp +++ b/src/client/global/qwaylandclientextension.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE QWaylandClientExtensionPrivate::QWaylandClientExtensionPrivate() : QObjectPrivate() - , waylandIntegration(NULL) + , waylandIntegration(nullptr) , version(-1) , active(false) { diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp index eebd69a8..02bed461 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp @@ -90,7 +90,7 @@ QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create( if (QWaylandClientBufferIntegration *ret = qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args)) return ret; #endif - return 0; + return nullptr; } } diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h index 6496b33e..1711852c 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationPlugin : public QOb { Q_OBJECT public: - explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = 0); + explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = nullptr); ~QWaylandClientBufferIntegrationPlugin(); virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp index 1d64e0f5..013ddae9 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandServerBuffer::QWaylandServerBuffer() - : m_user_data(0) + : m_user_data(nullptr) { } diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp index aa2f54cb..39d65f88 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp @@ -90,7 +90,7 @@ QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create( if (QWaylandServerBufferIntegration *ret = qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args)) return ret; #endif - return 0; + return nullptr; } } diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h index b3ed3ccc..bf6c04f8 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationPlugin : public QOb { Q_OBJECT public: - explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = 0); + explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = nullptr); ~QWaylandServerBufferIntegrationPlugin(); virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h index 2d9961db..104d594c 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationPlugin : public QObj { Q_OBJECT public: - explicit QWaylandInputDeviceIntegrationPlugin(QObject *parent = 0); + explicit QWaylandInputDeviceIntegrationPlugin(QObject *parent = nullptr); ~QWaylandInputDeviceIntegrationPlugin(); virtual QWaylandInputDeviceIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp index daaf4e6b..6a7a2ef4 100644 --- a/src/client/qwaylandabstractdecoration.cpp +++ b/src/client/qwaylandabstractdecoration.cpp @@ -70,10 +70,10 @@ public: }; QWaylandAbstractDecorationPrivate::QWaylandAbstractDecorationPrivate() - : m_window(0) - , m_wayland_window(0) + : m_window(nullptr) + , m_wayland_window(nullptr) , m_isDirty(true) - , m_decorationContentImage(0) + , m_decorationContentImage(nullptr) , m_mouseButtons(Qt::NoButton) { } diff --git a/src/client/qwaylandbuffer.cpp b/src/client/qwaylandbuffer.cpp index a0fcc532..2dc99b3b 100644 --- a/src/client/qwaylandbuffer.cpp +++ b/src/client/qwaylandbuffer.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandBuffer::QWaylandBuffer() - : mBuffer(0) + : mBuffer(nullptr) , mBusy(false) { } diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp index 5da12026..60820da9 100644 --- a/src/client/qwaylandclipboard.cpp +++ b/src/client/qwaylandclipboard.cpp @@ -90,7 +90,7 @@ void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) static const QString utf8 = QStringLiteral("text/plain;charset=utf-8"); if (data && data->hasFormat(plain) && !data->hasFormat(utf8)) data->setData(utf8, data->data(plain)); - inputDevice->dataDevice()->setSelectionSource(data ? new QWaylandDataSource(mDisplay->dndSelectionHandler(), data) : 0); + inputDevice->dataDevice()->setSelectionSource(data ? new QWaylandDataSource(mDisplay->dndSelectionHandler(), data) : nullptr); emitChanged(mode); } @@ -109,7 +109,7 @@ bool QWaylandClipboard::ownsMode(QClipboard::Mode mode) const if (!inputDevice || !inputDevice->dataDevice()) return false; - return inputDevice->dataDevice()->selectionSource() != 0; + return inputDevice->dataDevice()->selectionSource() != nullptr; } } diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp index bd820e28..21a6c081 100644 --- a/src/client/qwaylandcursor.cpp +++ b/src/client/qwaylandcursor.cpp @@ -79,13 +79,13 @@ QWaylandCursor::~QWaylandCursor() struct wl_cursor_image *QWaylandCursor::cursorImage(Qt::CursorShape newShape) { - struct wl_cursor *waylandCursor = 0; + struct wl_cursor *waylandCursor = nullptr; /* Hide cursor */ if (newShape == Qt::BlankCursor) { - mDisplay->setCursor(NULL, NULL); - return NULL; + mDisplay->setCursor(nullptr, nullptr); + return nullptr; } if (newShape < Qt::BitmapCursor) { @@ -99,14 +99,14 @@ struct wl_cursor_image *QWaylandCursor::cursorImage(Qt::CursorShape newShape) if (!waylandCursor) { qDebug("Could not find cursor for shape %d", newShape); - return NULL; + return nullptr; } struct wl_cursor_image *image = waylandCursor->images[0]; struct wl_buffer *buffer = wl_cursor_image_get_buffer(image); if (!buffer) { qDebug("Could not find buffer for cursor"); - return NULL; + return nullptr; } return image; @@ -166,7 +166,7 @@ wl_cursor *QWaylandCursor::requestCursor(WaylandCursor shape) //If the cursor has not been loaded already, load it if (!cursor) { if (!mCursorTheme) - return NULL; + return nullptr; QList<QByteArray> cursorNames = mCursorNamesMap.values(shape); foreach (const QByteArray &name, cursorNames) { diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index 66f36f75..83912035 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -67,7 +67,7 @@ QWaylandDataDevice::QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWayl , m_display(manager->display()) , m_inputDevice(inputDevice) , m_enterSerial(0) - , m_dragWindow(0) + , m_dragWindow(nullptr) , m_dragPoint() , m_dragOffer() , m_selectionOffer() @@ -135,7 +135,7 @@ void QWaylandDataDevice::data_device_drop() { QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag(); - QMimeData *dragData = 0; + QMimeData *dragData = nullptr; Qt::DropActions supportedActions; if (drag) { dragData = drag->mimeData(); @@ -182,14 +182,14 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface, if (response.isAccepted()) { wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); } else { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, 0); + wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, nullptr); } } void QWaylandDataDevice::data_device_leave() { if (m_dragWindow) - QWindowSystemInterface::handleDrag(m_dragWindow, 0, QPoint(), Qt::IgnoreAction); + QWindowSystemInterface::handleDrag(m_dragWindow, nullptr, QPoint(), Qt::IgnoreAction); QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag(); if (!drag) { @@ -227,7 +227,7 @@ void QWaylandDataDevice::data_device_motion(uint32_t time, wl_fixed_t x, wl_fixe if (response.isAccepted()) { wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); } else { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, 0); + wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, nullptr); } } #endif // QT_CONFIG(draganddrop) diff --git a/src/client/qwaylanddecorationfactory.cpp b/src/client/qwaylanddecorationfactory.cpp index ccf2c806..32db96e5 100644 --- a/src/client/qwaylanddecorationfactory.cpp +++ b/src/client/qwaylanddecorationfactory.cpp @@ -91,7 +91,7 @@ QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &nam return ret; #endif - return 0; + return nullptr; } } diff --git a/src/client/qwaylanddecorationplugin_p.h b/src/client/qwaylanddecorationplugin_p.h index c549b24b..4255de46 100644 --- a/src/client/qwaylanddecorationplugin_p.h +++ b/src/client/qwaylanddecorationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationPlugin : public QObject { Q_OBJECT public: - explicit QWaylandDecorationPlugin(QObject *parent = 0); + explicit QWaylandDecorationPlugin(QObject *parent = nullptr); ~QWaylandDecorationPlugin(); virtual QWaylandAbstractDecoration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 02b1fd9a..942494f9 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -89,7 +89,7 @@ struct wl_surface *QWaylandDisplay::createSurface(void *handle) QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window) { if (!mWaylandIntegration->shellIntegration()) - return 0; + return nullptr; return mWaylandIntegration->shellIntegration()->createShellSurface(window); } @@ -106,7 +106,7 @@ struct ::wl_region *QWaylandDisplay::createRegion(const QRegion &qregion) ::wl_subsurface *QWaylandDisplay::createSubSurface(QWaylandWindow *window, QWaylandWindow *parent) { if (!mSubCompositor) { - return NULL; + return nullptr; } return mSubCompositor->get_subsurface(window->object(), parent->object()); @@ -125,24 +125,24 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) : mWaylandIntegration(waylandIntegration) #if QT_CONFIG(wayland_datadevice) - , mDndSelectionHandler(0) + , mDndSelectionHandler(nullptr) #endif - , mWindowExtension(0) - , mSubCompositor(0) - , mTouchExtension(0) - , mQtKeyExtension(0) - , mTextInputManager(0) - , mHardwareIntegration(0) + , mWindowExtension(nullptr) + , mSubCompositor(nullptr) + , mTouchExtension(nullptr) + , mQtKeyExtension(nullptr) + , mTextInputManager(nullptr) + , mHardwareIntegration(nullptr) , mLastInputSerial(0) - , mLastInputDevice(0) - , mLastInputWindow(0) + , mLastInputDevice(nullptr) + , mLastInputWindow(nullptr) , mLastKeyboardFocus(nullptr) , mSyncCallback(nullptr) { qRegisterMetaType<uint32_t>("uint32_t"); - mDisplay = wl_display_connect(NULL); - if (mDisplay == NULL) { + mDisplay = wl_display_connect(nullptr); + if (mDisplay == nullptr) { qErrnoWarning(errno, "Failed to create display"); ::exit(1); } @@ -219,7 +219,7 @@ QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const if (screen->output() == output) return screen; } - return 0; + return nullptr; } void QWaylandDisplay::waitForScreens() @@ -333,7 +333,7 @@ uint32_t QWaylandDisplay::currentTimeMillisec() { //### we throw away the time information struct timeval tv; - int ret = gettimeofday(&tv, 0); + int ret = gettimeofday(&tv, nullptr); if (ret == 0) return tv.tv_sec*1000 + tv.tv_usec/1000; return 0; diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp index fac5fb84..16ee057c 100644 --- a/src/client/qwaylandinputcontext.cpp +++ b/src/client/qwaylandinputcontext.cpp @@ -403,7 +403,7 @@ QWaylandInputContext::~QWaylandInputContext() bool QWaylandInputContext::isValid() const { - return mDisplay->textInputManager() != 0; + return mDisplay->textInputManager() != nullptr; } void QWaylandInputContext::reset() diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index f0182218..698abd8f 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -121,7 +121,7 @@ public: }; QWaylandIntegration::QWaylandIntegration() - : mClientBufferIntegration(0) + : mClientBufferIntegration(nullptr) , mInputDeviceIntegration(nullptr) , mFontDb(new QGenericUnixFontDatabase()) , mNativeInterface(new QWaylandNativeInterface(this)) @@ -198,7 +198,7 @@ QPlatformOpenGLContext *QWaylandIntegration::createPlatformOpenGLContext(QOpenGL { if (mDisplay->clientBufferIntegration()) return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle()); - return 0; + return nullptr; } #endif // opengl diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index b6336f2e..fba75557 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -65,7 +65,7 @@ QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uin , mOutputName(QStringLiteral("Screen%1").arg(id)) , m_orientation(Qt::PrimaryOrientation) #if QT_CONFIG(cursor) - , mWaylandCursor(0) + , mWaylandCursor(nullptr) #endif { } diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index a13a5f76..24554ee4 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -73,8 +73,8 @@ Q_LOGGING_CATEGORY(logCategory, "qt.qpa.wayland.backingstore") QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, const QSize &size, QImage::Format format, int scale) : QWaylandBuffer() - , mShmPool(0) - , mMarginsImage(0) + , mShmPool(nullptr) + , mMarginsImage(nullptr) { int stride = size.width() * 4; int alloc = stride * size.height(); @@ -105,7 +105,7 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, // map ourselves: QFile::map() will unmap when the object is destroyed, // but we want this mapping to persist (unmapping in destructor) uchar *data = (uchar *) - mmap(NULL, alloc, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + mmap(nullptr, alloc, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == (uchar *) MAP_FAILED) { qErrnoWarning("QWaylandShmBuffer: mmap failed"); return; @@ -147,7 +147,7 @@ QImage *QWaylandShmBuffer::imageInsideMargins(const QMargins &marginsIn) } if (margins.isNull()) { delete mMarginsImage; - mMarginsImage = 0; + mMarginsImage = nullptr; } mMargins = margins; @@ -161,8 +161,8 @@ QImage *QWaylandShmBuffer::imageInsideMargins(const QMargins &marginsIn) QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window) : QPlatformBackingStore(window) , mDisplay(QWaylandScreen::waylandScreenFromWindow(window)->display()) - , mFrontBuffer(0) - , mBackBuffer(0) + , mFrontBuffer(nullptr) + , mBackBuffer(nullptr) , mPainting(false) { @@ -249,7 +249,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size) } else { mBuffers.removeOne(b); if (mBackBuffer == b) - mBackBuffer = 0; + mBackBuffer = nullptr; delete b; } } @@ -262,7 +262,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size) mBuffers.prepend(b); return b; } - return 0; + return nullptr; } void QWaylandShmBackingStore::resize(const QSize &size) diff --git a/src/client/qwaylandtouch.cpp b/src/client/qwaylandtouch.cpp index f5521a31..48c869a6 100644 --- a/src/client/qwaylandtouch.cpp +++ b/src/client/qwaylandtouch.cpp @@ -48,11 +48,11 @@ namespace QtWaylandClient { QWaylandTouchExtension::QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id) : QtWayland::qt_touch_extension(display->wl_registry(), id, 1), mDisplay(display), - mTouchDevice(0), + mTouchDevice(nullptr), mPointsLeft(0), mFlags(0), mMouseSourceId(-1), - mInputDevice(0) + mInputDevice(nullptr) { } diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 2e709440..75dfaa49 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -75,15 +75,15 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -QWaylandWindow *QWaylandWindow::mMouseGrab = 0; +QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr; QWaylandWindow::QWaylandWindow(QWindow *window) : QObject() , QPlatformWindow(window) , mDisplay(waylandScreen()->display()) - , mShellSurface(0) - , mSubSurfaceWindow(0) - , mWindowDecoration(0) + , mShellSurface(nullptr) + , mSubSurfaceWindow(nullptr) + , mWindowDecoration(nullptr) , mMouseEventsInContentArea(false) , mMousePressedInContentArea(Qt::NoButton) , mWaitingForFrameSync(false) @@ -124,7 +124,7 @@ QWaylandWindow::~QWaylandWindow() } if (mMouseGrab == this) { - mMouseGrab = 0; + mMouseGrab = nullptr; } } @@ -256,9 +256,9 @@ void QWaylandWindow::reset(bool sendDestroyEvent) QGuiApplication::sendEvent(window(), &e); } delete mShellSurface; - mShellSurface = 0; + mShellSurface = nullptr; delete mSubSurfaceWindow; - mSubSurfaceWindow = 0; + mSubSurfaceWindow = nullptr; if (isInitialized()) destroy(); @@ -285,7 +285,7 @@ void QWaylandWindow::setParent(const QPlatformWindow *parent) if (!window()->isVisible()) return; - QWaylandWindow *oldparent = mSubSurfaceWindow ? mSubSurfaceWindow->parent() : 0; + QWaylandWindow *oldparent = mSubSurfaceWindow ? mSubSurfaceWindow->parent() : nullptr; if (oldparent == parent) return; @@ -574,7 +574,7 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y) attach(buffer->buffer(), x, y); } else { - QtWayland::wl_surface::attach(0, 0, 0); + QtWayland::wl_surface::attach(nullptr, 0, 0); } } @@ -777,7 +777,7 @@ bool QWaylandWindow::createDecoration() } } else { delete mWindowDecoration; - mWindowDecoration = 0; + mWindowDecoration = nullptr; } if (hadDecoration != (bool)mWindowDecoration) { @@ -984,7 +984,7 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab) return false; } - mMouseGrab = grab ? this : 0; + mMouseGrab = grab ? this : nullptr; return true; } diff --git a/src/client/qwaylandwlshellsurface.cpp b/src/client/qwaylandwlshellsurface.cpp index 185cfc4a..7c8d5172 100644 --- a/src/client/qwaylandwlshellsurface.cpp +++ b/src/client/qwaylandwlshellsurface.cpp @@ -127,14 +127,14 @@ void QWaylandWlShellSurface::setMaximized() { m_maximized = true; m_size = m_window->window()->geometry().size(); - set_maximized(0); + set_maximized(nullptr); } void QWaylandWlShellSurface::setFullscreen() { m_fullscreen = true; m_size = m_window->window()->geometry().size(); - set_fullscreen(WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, 0); + set_fullscreen(WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, nullptr); } void QWaylandWlShellSurface::setNormal() diff --git a/src/client/shellintegration/qwaylandshellintegrationplugin_p.h b/src/client/shellintegration/qwaylandshellintegrationplugin_p.h index 266e6980..8ec9a542 100644 --- a/src/client/shellintegration/qwaylandshellintegrationplugin_p.h +++ b/src/client/shellintegration/qwaylandshellintegrationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationPlugin : public QObject { Q_OBJECT public: - explicit QWaylandShellIntegrationPlugin(QObject *parent = 0); + explicit QWaylandShellIntegrationPlugin(QObject *parent = nullptr); ~QWaylandShellIntegrationPlugin(); virtual QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp index 8ceeeea5..affd7af3 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.cpp +++ b/src/compositor/compositor_api/qwaylandbufferref.cpp @@ -71,7 +71,7 @@ public: QWaylandBufferRef::QWaylandBufferRef() : d(new QWaylandBufferRefPrivate) { - d->buffer = 0; + d->buffer = nullptr; } /*! diff --git a/src/compositor/compositor_api/qwaylandclient.cpp b/src/compositor/compositor_api/qwaylandclient.cpp index 122fd41c..471c1b5a 100644 --- a/src/compositor/compositor_api/qwaylandclient.cpp +++ b/src/compositor/compositor_api/qwaylandclient.cpp @@ -69,7 +69,7 @@ public: Q_UNUSED(data); QWaylandClient *client = reinterpret_cast<Listener *>(listener)->parent; - Q_ASSERT(client != 0); + Q_ASSERT(client != nullptr); delete client; } @@ -144,7 +144,7 @@ QWaylandClient::~QWaylandClient() QWaylandClient *QWaylandClient::fromWlClient(QWaylandCompositor *compositor, wl_client *wlClient) { if (!wlClient) - return 0; + return nullptr; QWaylandClient *client = nullptr; @@ -152,7 +152,7 @@ QWaylandClient *QWaylandClient::fromWlClient(QWaylandCompositor *compositor, wl_ QWaylandClientPrivate::client_destroy_callback); if (l) client = reinterpret_cast<QWaylandClientPrivate::Listener *>( - wl_container_of(l, (QWaylandClientPrivate::Listener *)0, listener))->parent; + wl_container_of(l, (QWaylandClientPrivate::Listener *)nullptr, listener))->parent; if (!client) { // The original idea was to create QWaylandClient instances when diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 4c662a34..289af2f3 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -148,11 +148,11 @@ public: } // namespace QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) - : display(0) + : display(nullptr) #if QT_CONFIG(opengl) , use_hw_integration_extension(true) - , client_buffer_integration(0) - , server_buffer_integration(0) + , client_buffer_integration(nullptr) + , server_buffer_integration(nullptr) #endif , retainSelection(false) , preInitialized(false) @@ -834,7 +834,7 @@ QWaylandSeat *QWaylandCompositor::defaultSeat() const QWaylandSeat *QWaylandCompositor::seatFor(QInputEvent *inputEvent) { Q_D(QWaylandCompositor); - QWaylandSeat *dev = NULL; + QWaylandSeat *dev = nullptr; for (int i = 0; i < d->seats.size(); i++) { QWaylandSeat *candidate = d->seats.at(i); if (candidate->isOwner(inputEvent)) { diff --git a/src/compositor/compositor_api/qwaylanddrag.cpp b/src/compositor/compositor_api/qwaylanddrag.cpp index c52e424d..34f936a5 100644 --- a/src/compositor/compositor_api/qwaylanddrag.cpp +++ b/src/compositor/compositor_api/qwaylanddrag.cpp @@ -83,7 +83,7 @@ QWaylandSurface *QWaylandDrag::icon() const const QtWayland::DataDevice *dataDevice = d->dataDevice(); if (!dataDevice) - return 0; + return nullptr; return dataDevice->dragIcon(); } @@ -110,7 +110,7 @@ bool QWaylandDrag::visible() const if (!dataDevice) return false; - return dataDevice->dragIcon() != 0; + return dataDevice->dragIcon() != nullptr; } void QWaylandDrag::dragMove(QWaylandSurface *target, const QPointF &pos) diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp index 575a64df..69e5971e 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp @@ -138,7 +138,7 @@ void QWaylandInputMethodControl::defaultSeatChanged() { Q_D(QWaylandInputMethodControl); - disconnect(d->textInput(), 0, this, 0); + disconnect(d->textInput(), nullptr, this, nullptr); d->seat = d->compositor->defaultSeat(); QWaylandTextInput *textInput = d->textInput(); diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index 930eae1a..e35c0f37 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -71,7 +71,7 @@ QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) , pendingKeymap(false) #if QT_CONFIG(xkbcommon_evdev) , keymap_fd(-1) - , xkb_state(0) + , xkb_state(nullptr) #endif , repeatRate(40) , repeatDelay(400) @@ -168,7 +168,7 @@ void QWaylandKeyboardPrivate::keyboard_bind_resource(wl_keyboard::Resource *reso void QWaylandKeyboardPrivate::keyboard_destroy_resource(wl_keyboard::Resource *resource) { if (focusResource == resource) - focusResource = 0; + focusResource = nullptr; } void QWaylandKeyboardPrivate::keyboard_release(wl_keyboard::Resource *resource) @@ -333,7 +333,7 @@ void QWaylandKeyboardPrivate::createXKBState(xkb_keymap *keymap) return; } - keymap_area = static_cast<char *>(mmap(0, keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, keymap_fd, 0)); + keymap_area = static_cast<char *>(mmap(nullptr, keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, keymap_fd, 0)); if (keymap_area == MAP_FAILED) { close(keymap_fd); keymap_fd = -1; @@ -448,8 +448,8 @@ void QWaylandKeyboard::focusDestroyed(void *data) Q_D(QWaylandKeyboard); d->focusDestroyListener.reset(); - d->focus = 0; - d->focusResource = 0; + d->focus = nullptr; + d->focusResource = nullptr; } void QWaylandKeyboard::updateKeymap() diff --git a/src/compositor/compositor_api/qwaylandoutput_p.h b/src/compositor/compositor_api/qwaylandoutput_p.h index dab6daf7..5a21c3de 100644 --- a/src/compositor/compositor_api/qwaylandoutput_p.h +++ b/src/compositor/compositor_api/qwaylandoutput_p.h @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE struct QWaylandSurfaceViewMapper { QWaylandSurfaceViewMapper() - : surface(0) + : surface(nullptr) , views() , has_entered(false) {} diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 74ce326e..91e85b88 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -163,7 +163,7 @@ void QWaylandBufferMaterialShader::updateState(const QSGMaterialShader::RenderSt const char * const *QWaylandBufferMaterialShader::attributeNames() const { - static char const *const attr[] = { "qt_VertexPosition", "qt_VertexTexCoord", 0 }; + static char const *const attr[] = { "qt_VertexPosition", "qt_VertexTexCoord", nullptr }; return attr; } @@ -261,14 +261,14 @@ void QWaylandBufferMaterial::ensureTextures(int count) } } -QMutex *QWaylandQuickItemPrivate::mutex = 0; +QMutex *QWaylandQuickItemPrivate::mutex = nullptr; class QWaylandSurfaceTextureProvider : public QSGTextureProvider { public: QWaylandSurfaceTextureProvider() : m_smooth(false) - , m_sgTex(0) + , m_sgTex(nullptr) { } @@ -283,7 +283,7 @@ public: Q_ASSERT(QThread::currentThread() == thread()); m_ref = buffer; delete m_sgTex; - m_sgTex = 0; + m_sgTex = nullptr; if (m_ref.hasBuffer()) { if (buffer.isSharedMemory()) { m_sgTex = surfaceItem->window()->createTextureFromImage(buffer.image()); diff --git a/src/compositor/compositor_api/qwaylandresource.cpp b/src/compositor/compositor_api/qwaylandresource.cpp index 07e67a9b..7cfcce13 100644 --- a/src/compositor/compositor_api/qwaylandresource.cpp +++ b/src/compositor/compositor_api/qwaylandresource.cpp @@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE QWaylandResource::QWaylandResource() - : m_resource(0) + : m_resource(nullptr) { } diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp index 4b506bcd..2ee32bfb 100644 --- a/src/compositor/compositor_api/qwaylandseat.cpp +++ b/src/compositor/compositor_api/qwaylandseat.cpp @@ -89,15 +89,15 @@ void QWaylandSeatPrivate::setCapabilities(QWaylandSeat::CapabilityFlags caps) QWaylandSeat::CapabilityFlags changed = caps ^ capabilities; if (changed & QWaylandSeat::Pointer) { - pointer.reset(pointer.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreatePointerDevice(q) : 0); + pointer.reset(pointer.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreatePointerDevice(q) : nullptr); } if (changed & QWaylandSeat::Keyboard) { - keyboard.reset(keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateKeyboardDevice(q) : 0); + keyboard.reset(keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateKeyboardDevice(q) : nullptr); } if (changed & QWaylandSeat::Touch) { - touch.reset(touch.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateTouchDevice(q) : 0); + touch.reset(touch.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateTouchDevice(q) : nullptr); } capabilities = caps; diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 37b6876a..a5316f53 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -81,7 +81,7 @@ public: res->data = this; res->destroy = destroyCallback; #else - wl_resource_set_implementation(res, 0, this, destroyCallback); + wl_resource_set_implementation(res, nullptr, this, destroyCallback); #endif } ~FrameCallback() @@ -129,7 +129,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate() , compositor(nullptr) , refCount(1) , client(nullptr) - , role(0) + , role(nullptr) , inputRegion(infiniteRegion()) , bufferScale(1) , isCursorSurface(false) @@ -140,7 +140,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate() #if QT_CONFIG(im) , inputMethodControl(nullptr) #endif - , subsurface(0) + , subsurface(nullptr) { pending.buffer = QWaylandBufferRef(); pending.newlyAttached = false; @@ -843,7 +843,7 @@ void QWaylandSurfacePrivate::derefView(QWaylandView *view) void QWaylandSurfacePrivate::initSubsurface(QWaylandSurface *parent, wl_client *client, int id, int version) { Q_Q(QWaylandSurface); - QWaylandSurface *oldParent = 0; // TODO: implement support for switching parents + QWaylandSurface *oldParent = nullptr; // TODO: implement support for switching parents subsurface = new Subsurface(this); subsurface->init(client, id, version); diff --git a/src/compositor/extensions/qwaylandtextinput.cpp b/src/compositor/extensions/qwaylandtextinput.cpp index 11454da0..552aa066 100644 --- a/src/compositor/extensions/qwaylandtextinput.cpp +++ b/src/compositor/extensions/qwaylandtextinput.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QWaylandTextInputClientState::QWaylandTextInputClientState() - : hints(0) + : hints(Qt::ImhNone) , cursorRectangle() , surroundingText() , cursorPosition(0) @@ -339,7 +339,7 @@ void QWaylandTextInputPrivate::zwp_text_input_v2_bind_resource(Resource *resourc void QWaylandTextInputPrivate::zwp_text_input_v2_destroy_resource(Resource *resource) { if (focusResource == resource) - focusResource = 0; + focusResource = nullptr; } void QWaylandTextInputPrivate::zwp_text_input_v2_destroy(Resource *resource) @@ -426,7 +426,7 @@ void QWaylandTextInputPrivate::zwp_text_input_v2_set_content_type(Resource *reso if (resource != focusResource) return; - pendingState->hints = 0; + pendingState->hints = Qt::ImhNone; if ((hint & content_hint_auto_completion) == 0 && (hint & content_hint_auto_correction) == 0) diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index c588c106..59b31191 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -704,7 +704,7 @@ QWaylandWlShellSurface *QWaylandWlShellSurface::fromResource(wl_resource *resour QWaylandWlShellSurfacePrivate::Resource *res = QWaylandWlShellSurfacePrivate::Resource::fromResource(resource); if (res) return static_cast<QWaylandWlShellSurfacePrivate *>(res->shell_surface_object)->q_func(); - return 0; + return nullptr; } QT_END_NAMESPACE diff --git a/src/compositor/extensions/qwlqtkey.cpp b/src/compositor/extensions/qwlqtkey.cpp index 99f71f14..73d06ae6 100644 --- a/src/compositor/extensions/qwlqtkey.cpp +++ b/src/compositor/extensions/qwlqtkey.cpp @@ -61,7 +61,7 @@ bool QtKeyExtensionGlobal::postQtKeyEvent(QKeyEvent *event, QWaylandSurface *sur if (target) { send_qtkey(target->handle, - surface ? surface->resource() : 0, + surface ? surface->resource() : nullptr, time, event->type(), event->key(), event->modifiers(), event->nativeScanCode(), event->nativeVirtualKey(), diff --git a/src/compositor/extensions/qwlqttouch.cpp b/src/compositor/extensions/qwlqttouch.cpp index 3a0752b8..161ec6c1 100644 --- a/src/compositor/extensions/qwlqttouch.cpp +++ b/src/compositor/extensions/qwlqttouch.cpp @@ -52,7 +52,7 @@ TouchExtensionGlobal::TouchExtensionGlobal(QWaylandCompositor *compositor) : QWaylandCompositorExtensionTemplate(compositor) , QtWaylandServer::qt_touch_extension(compositor->display(), 1) , m_compositor(compositor) - , m_flags(0) + , m_flags(BehaviorFlag::None) , m_resources() , m_posData(maxRawPos * 2) { diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp index 67d4e5f5..3f4d4a41 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE namespace QtWayland { ClientBufferIntegration::ClientBufferIntegration() - : m_compositor(0) + : m_compositor(nullptr) { } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp index 57359190..68c8ac4c 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp @@ -90,7 +90,7 @@ ClientBufferIntegration *ClientBufferIntegrationFactory::create(const QString &n if (ClientBufferIntegration *ret = qLoadPlugin<ClientBufferIntegration, ClientBufferIntegrationPlugin>(loader(), name, args)) return ret; #endif - return 0; + return nullptr; } } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h index bc8f0a48..edf4fea0 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h @@ -68,7 +68,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT ClientBufferIntegrationPlugin : public QObject { Q_OBJECT public: - explicit ClientBufferIntegrationPlugin(QObject *parent = 0); + explicit ClientBufferIntegrationPlugin(QObject *parent = nullptr); ~ClientBufferIntegrationPlugin(); virtual ClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp index 6425f7c3..2b60de5e 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp @@ -90,7 +90,7 @@ ServerBufferIntegration *ServerBufferIntegrationFactory::create(const QString &n if (ServerBufferIntegration *ret = qLoadPlugin<ServerBufferIntegration, ServerBufferIntegrationPlugin>(loader(), name, args)) return ret; #endif - return 0; + return nullptr; } } diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h index e1b123c6..0cb5ed32 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h @@ -68,7 +68,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT ServerBufferIntegrationPlugin : public QObject { Q_OBJECT public: - explicit ServerBufferIntegrationPlugin(QObject *parent = 0); + explicit ServerBufferIntegrationPlugin(QObject *parent = nullptr); ~ServerBufferIntegrationPlugin(); virtual ServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp index a8314dae..86331a74 100644 --- a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp +++ b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp @@ -57,7 +57,7 @@ BufferManager::BufferManager(QWaylandCompositor *compositor) struct buffer_manager_destroy_listener : wl_listener { buffer_manager_destroy_listener() - : d(0) + : d(nullptr) { notify = BufferManager::destroy_listener_callback; wl_list_init(&this->link); diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 73d7bb1f..3b557a10 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -64,13 +64,13 @@ DataDevice::DataDevice(QWaylandSeat *seat) : wl_data_device() , m_compositor(seat->compositor()) , m_seat(seat) - , m_selectionSource(0) + , m_selectionSource(nullptr) #if QT_CONFIG(draganddrop) - , m_dragClient(0) - , m_dragDataSource(0) - , m_dragFocus(0) - , m_dragFocusResource(0) - , m_dragIcon(0) + , m_dragClient(nullptr) + , m_dragDataSource(nullptr) + , m_dragFocus(nullptr) + , m_dragFocusResource(nullptr) + , m_dragIcon(nullptr) , m_dragOrigin(nullptr) #endif { @@ -95,7 +95,7 @@ void DataDevice::setFocus(QWaylandClient *focusClient) void DataDevice::sourceDestroyed(DataSource *source) { if (m_selectionSource == source) - m_selectionSource = 0; + m_selectionSource = nullptr; } #if QT_CONFIG(draganddrop) @@ -103,8 +103,8 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi { if (m_dragFocusResource) { send_leave(m_dragFocusResource->handle); - m_dragFocus = 0; - m_dragFocusResource = 0; + m_dragFocus = nullptr; + m_dragFocusResource = nullptr; } if (!focus) @@ -120,7 +120,7 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi uint32_t serial = m_compositor->nextSerial(); - DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : 0; + DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : nullptr; if (m_dragDataSource && !offer) return; @@ -174,7 +174,7 @@ void DataDevice::cancelDrag() void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) { m_dragClient = resource->client(); - m_dragDataSource = source ? DataSource::fromResource(source) : 0; + m_dragDataSource = source ? DataSource::fromResource(source) : nullptr; m_dragOrigin = QWaylandSurface::fromResource(origin); QWaylandDrag *drag = m_seat->drag(); setDragIcon(icon ? QWaylandSurface::fromResource(icon) : nullptr); @@ -198,7 +198,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou { Q_UNUSED(serial); - DataSource *dataSource = source ? DataSource::fromResource(source) : 0; + DataSource *dataSource = source ? DataSource::fromResource(source) : nullptr; if (m_selectionSource) m_selectionSource->cancel(); @@ -215,7 +215,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou DataOffer *offer = new DataOffer(m_selectionSource, resource); send_selection(resource->handle, offer->resource()->handle); } else if (resource) { - send_selection(resource->handle, 0); + send_selection(resource->handle, nullptr); } } diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index a1937c92..0c0855d2 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -59,11 +59,11 @@ QT_BEGIN_NAMESPACE namespace QtWayland { DataDeviceManager::DataDeviceManager(QWaylandCompositor *compositor) - : QObject(0) + : QObject(nullptr) , wl_data_device_manager(compositor->display(), 1) , m_compositor(compositor) - , m_current_selection_source(0) - , m_retainedReadNotifier(0) + , m_current_selection_source(nullptr) + , m_retainedReadNotifier(nullptr) , m_compositorOwnsSelection(false) { } @@ -137,7 +137,7 @@ void DataDeviceManager::finishReadFromClient(bool exhausted) // or else clients may SIGPIPE. m_obsoleteRetainedReadNotifiers.append(m_retainedReadNotifier); } - m_retainedReadNotifier = 0; + m_retainedReadNotifier = nullptr; } } @@ -219,7 +219,7 @@ bool DataDeviceManager::offerFromCompositorToClient(wl_resource *clientDataDevic struct wl_resource *selectionOffer = wl_resource_create(client, &wl_data_offer_interface, -1, 0); - wl_resource_set_implementation(selectionOffer, &compositor_offer_interface, this, 0); + wl_resource_set_implementation(selectionOffer, &compositor_offer_interface, this, nullptr); wl_data_device_send_data_offer(clientDataDeviceResource, selectionOffer); foreach (const QString &format, m_retainedData.formats()) { QByteArray ba = format.toLatin1(); diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp index 3a50cd0f..2d523dad 100644 --- a/src/compositor/wayland_wrapper/qwldatasource.cpp +++ b/src/compositor/wayland_wrapper/qwldatasource.cpp @@ -52,8 +52,8 @@ namespace QtWayland { DataSource::DataSource(struct wl_client *client, uint32_t id, uint32_t time) : QtWaylandServer::wl_data_source(client, id, 1) , m_time(time) - , m_device(0) - , m_manager(0) + , m_device(nullptr) + , m_manager(nullptr) { } diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp index 35fdc827..c7dbe1be 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp @@ -103,7 +103,7 @@ struct ::wl_resource *DrmEglServerBuffer::resourceForClient(struct ::wl_client * auto integrationResource = m_integration->resourceMap().value(client); if (!integrationResource) { qWarning("DrmEglServerBuffer::resourceForClient: Trying to get resource for ServerBuffer. But client is not bound to the drm_egl interface"); - return 0; + return nullptr; } struct ::wl_resource *drm_egl_integration_resource = integrationResource->handle; Resource *resource = add(client, 1); diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index fdaddb6a..a088027a 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -217,12 +217,12 @@ WaylandEglClientBufferIntegrationPrivate::WaylandEglClientBufferIntegrationPriva : egl_display(EGL_NO_DISPLAY) , valid(false) , display_bound(false) - , egl_bind_wayland_display(0) - , egl_unbind_wayland_display(0) - , egl_query_wayland_buffer(0) - , egl_create_image(0) - , egl_destroy_image(0) - , gl_egl_image_target_texture_2d(0) + , egl_bind_wayland_display(nullptr) + , egl_unbind_wayland_display(nullptr) + , egl_query_wayland_buffer(nullptr) + , egl_create_image(nullptr) + , egl_destroy_image(nullptr) + , gl_egl_image_target_texture_2d(nullptr) , funcs(nullptr) { } @@ -593,7 +593,7 @@ quintptr WaylandEglClientBuffer::lockNativeBuffer() EGLImageKHR image = p->egl_create_image(p->egl_display, EGL_NO_CONTEXT, EGL_WAYLAND_BUFFER_WL, - m_buffer, NULL); + m_buffer, nullptr); return reinterpret_cast<quintptr>(image); } diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp index 071b0882..049b8b3f 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp @@ -69,7 +69,7 @@ QVector<EGLint> eglbuildSpec() XCompositeEglClientBufferIntegration::XCompositeEglClientBufferIntegration() : QtWayland::ClientBufferIntegration() - , mDisplay(0) + , mDisplay(nullptr) { } diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp index 296a205c..b1c947b5 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp @@ -72,8 +72,8 @@ QVector<int> qglx_buildSpec() XCompositeGLXClientBufferIntegration::XCompositeGLXClientBufferIntegration() : QtWayland::ClientBufferIntegration() - , mDisplay(0) - , mHandler(0) + , mDisplay(nullptr) + , mHandler(nullptr) { qDebug() << "Loading GLX integration"; } @@ -162,7 +162,7 @@ QOpenGLTexture *XCompositeGLXClientBuffer::toOpenGlTexture(int plane) } tex->bind(); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - m_integration->m_glxBindTexImageEXT(m_integration->xDisplay(),m_glxPixmap,GLX_FRONT_EXT, 0); + m_integration->m_glxBindTexImageEXT(m_integration->xDisplay(),m_glxPixmap,GLX_FRONT_EXT, nullptr); // TODO: release in the destructor? // m_glxReleaseTexImageEXT(mDisplay,glxPixmap,GLX_FRONT_EXT); diff --git a/src/imports/compositor/qwaylandmousetracker_p.h b/src/imports/compositor/qwaylandmousetracker_p.h index a50abbbb..fa9dedfd 100644 --- a/src/imports/compositor/qwaylandmousetracker_p.h +++ b/src/imports/compositor/qwaylandmousetracker_p.h @@ -58,7 +58,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandMouseTracker : public QQuickItem Q_PROPERTY(bool windowSystemCursorEnabled READ windowSystemCursorEnabled WRITE setWindowSystemCursorEnabled NOTIFY windowSystemCursorEnabledChanged) public: - QWaylandMouseTracker(QQuickItem *parent = 0); + QWaylandMouseTracker(QQuickItem *parent = nullptr); qreal mouseX() const; qreal mouseY() const; diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp index d6a83dbb..057002c9 100644 --- a/src/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/qtwaylandscanner/qtwaylandscanner.cpp @@ -228,7 +228,7 @@ const WaylandArgument *newIdArgument(const QList<WaylandArgument> &arguments) if (arguments.at(i).type == "new_id") return &arguments.at(i); } - return 0; + return nullptr; } void printEvent(const WaylandEvent &e, bool omitNames = false, bool withResource = false) diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp index 94198b45..0e086c7a 100644 --- a/tests/auto/client/client/tst_client.cpp +++ b/tests/auto/client/client/tst_client.cpp @@ -295,9 +295,9 @@ void tst_WaylandClient::events() QTRY_COMPARE(QGuiApplication::focusWindow(), &window); QCOMPARE(window.focusOutEventCount, 0); - compositor->setKeyboardFocus(QSharedPointer<MockSurface>(0)); + compositor->setKeyboardFocus(QSharedPointer<MockSurface>(nullptr)); QTRY_COMPARE(window.focusOutEventCount, 1); - QTRY_COMPARE(QGuiApplication::focusWindow(), static_cast<QWindow *>(0)); + QTRY_COMPARE(QGuiApplication::focusWindow(), static_cast<QWindow *>(nullptr)); compositor->setKeyboardFocus(surface); QTRY_COMPARE(window.focusInEventCount, 2); @@ -375,7 +375,7 @@ class DndWindow : public QWindow Q_OBJECT public: - DndWindow(QWindow *parent = 0) + DndWindow(QWindow *parent = nullptr) : QWindow(parent) , dragStarted(false) { diff --git a/tests/auto/compositor/compositor/mockclient.cpp b/tests/auto/compositor/compositor/mockclient.cpp index bdc2b3b9..4720b0d9 100644 --- a/tests/auto/compositor/compositor/mockclient.cpp +++ b/tests/auto/compositor/compositor/mockclient.cpp @@ -47,9 +47,9 @@ const struct wl_registry_listener MockClient::registryListener = { MockClient::MockClient() : display(wl_display_connect("wayland-qt-test-0")) - , compositor(0) - , registry(0) - , wlshell(0) + , compositor(nullptr) + , registry(nullptr) + , wlshell(nullptr) , xdgShell(nullptr) , iviApplication(nullptr) , refreshRate(-1) @@ -223,7 +223,7 @@ ivi_surface *MockClient::createIviSurface(wl_surface *surface, uint iviId) } ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm) - : handle(0) + : handle(nullptr) { int stride = size.width() * 4; int alloc = stride * size.height(); @@ -242,7 +242,7 @@ ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm) return; } - void *data = mmap(0, alloc, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + void *data = mmap(nullptr, alloc, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); unlink(filename); if (data == MAP_FAILED) { diff --git a/tests/auto/compositor/compositor/tst_compositor.cpp b/tests/auto/compositor/compositor/tst_compositor.cpp index 96095a0d..575ea646 100644 --- a/tests/auto/compositor/compositor/tst_compositor.cpp +++ b/tests/auto/compositor/compositor/tst_compositor.cpp @@ -106,7 +106,7 @@ void tst_WaylandCompositor::singleClient() QWaylandClient *cb = compositor.surfaces.at(1)->client(); QCOMPARE(ca, cb); - QVERIFY(ca != 0); + QVERIFY(ca != nullptr); QList<QWaylandSurface *> surfaces = compositor.surfacesForClient(ca); QCOMPARE(surfaces.size(), 2); @@ -142,7 +142,7 @@ void tst_WaylandCompositor::multipleClients() QVERIFY(ca != cb); QVERIFY(ca != cc); QVERIFY(cb != cc); - QVERIFY(ca != 0); + QVERIFY(ca != nullptr); QCOMPARE(compositor.surfacesForClient(ca).size(), 1); QCOMPARE(compositor.surfacesForClient(ca).at(0), compositor.surfaces.at(0)); |