Use nullptr instead of 0 or NULL
Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some manual cleanup to prevent QFlag macros to be affected. Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
8de7183ae1
commit
6eac43515d
@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
QWaylandClientExtensionPrivate::QWaylandClientExtensionPrivate()
|
QWaylandClientExtensionPrivate::QWaylandClientExtensionPrivate()
|
||||||
: QObjectPrivate()
|
: QObjectPrivate()
|
||||||
, waylandIntegration(NULL)
|
, waylandIntegration(nullptr)
|
||||||
, version(-1)
|
, version(-1)
|
||||||
, active(false)
|
, active(false)
|
||||||
{
|
{
|
||||||
|
@ -90,7 +90,7 @@ QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create(
|
|||||||
if (QWaylandClientBufferIntegration *ret = qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args))
|
if (QWaylandClientBufferIntegration *ret = qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args))
|
||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationPlugin : public QOb
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = 0);
|
explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = nullptr);
|
||||||
~QWaylandClientBufferIntegrationPlugin();
|
~QWaylandClientBufferIntegrationPlugin();
|
||||||
|
|
||||||
virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
||||||
|
@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
QWaylandServerBuffer::QWaylandServerBuffer()
|
QWaylandServerBuffer::QWaylandServerBuffer()
|
||||||
: m_user_data(0)
|
: m_user_data(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create(
|
|||||||
if (QWaylandServerBufferIntegration *ret = qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args))
|
if (QWaylandServerBufferIntegration *ret = qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args))
|
||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationPlugin : public QOb
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = 0);
|
explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = nullptr);
|
||||||
~QWaylandServerBufferIntegrationPlugin();
|
~QWaylandServerBufferIntegrationPlugin();
|
||||||
|
|
||||||
virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
||||||
|
@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationPlugin : public QObj
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QWaylandInputDeviceIntegrationPlugin(QObject *parent = 0);
|
explicit QWaylandInputDeviceIntegrationPlugin(QObject *parent = nullptr);
|
||||||
~QWaylandInputDeviceIntegrationPlugin();
|
~QWaylandInputDeviceIntegrationPlugin();
|
||||||
|
|
||||||
virtual QWaylandInputDeviceIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
virtual QWaylandInputDeviceIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
||||||
|
@ -70,10 +70,10 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QWaylandAbstractDecorationPrivate::QWaylandAbstractDecorationPrivate()
|
QWaylandAbstractDecorationPrivate::QWaylandAbstractDecorationPrivate()
|
||||||
: m_window(0)
|
: m_window(nullptr)
|
||||||
, m_wayland_window(0)
|
, m_wayland_window(nullptr)
|
||||||
, m_isDirty(true)
|
, m_isDirty(true)
|
||||||
, m_decorationContentImage(0)
|
, m_decorationContentImage(nullptr)
|
||||||
, m_mouseButtons(Qt::NoButton)
|
, m_mouseButtons(Qt::NoButton)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
QWaylandBuffer::QWaylandBuffer()
|
QWaylandBuffer::QWaylandBuffer()
|
||||||
: mBuffer(0)
|
: mBuffer(nullptr)
|
||||||
, mBusy(false)
|
, mBusy(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
|
|||||||
static const QString utf8 = QStringLiteral("text/plain;charset=utf-8");
|
static const QString utf8 = QStringLiteral("text/plain;charset=utf-8");
|
||||||
if (data && data->hasFormat(plain) && !data->hasFormat(utf8))
|
if (data && data->hasFormat(plain) && !data->hasFormat(utf8))
|
||||||
data->setData(utf8, data->data(plain));
|
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);
|
emitChanged(mode);
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ bool QWaylandClipboard::ownsMode(QClipboard::Mode mode) const
|
|||||||
if (!inputDevice || !inputDevice->dataDevice())
|
if (!inputDevice || !inputDevice->dataDevice())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return inputDevice->dataDevice()->selectionSource() != 0;
|
return inputDevice->dataDevice()->selectionSource() != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,13 +79,13 @@ QWaylandCursor::~QWaylandCursor()
|
|||||||
|
|
||||||
struct wl_cursor_image *QWaylandCursor::cursorImage(Qt::CursorShape newShape)
|
struct wl_cursor_image *QWaylandCursor::cursorImage(Qt::CursorShape newShape)
|
||||||
{
|
{
|
||||||
struct wl_cursor *waylandCursor = 0;
|
struct wl_cursor *waylandCursor = nullptr;
|
||||||
|
|
||||||
/* Hide cursor */
|
/* Hide cursor */
|
||||||
if (newShape == Qt::BlankCursor)
|
if (newShape == Qt::BlankCursor)
|
||||||
{
|
{
|
||||||
mDisplay->setCursor(NULL, NULL);
|
mDisplay->setCursor(nullptr, nullptr);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newShape < Qt::BitmapCursor) {
|
if (newShape < Qt::BitmapCursor) {
|
||||||
@ -99,14 +99,14 @@ struct wl_cursor_image *QWaylandCursor::cursorImage(Qt::CursorShape newShape)
|
|||||||
|
|
||||||
if (!waylandCursor) {
|
if (!waylandCursor) {
|
||||||
qDebug("Could not find cursor for shape %d", newShape);
|
qDebug("Could not find cursor for shape %d", newShape);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wl_cursor_image *image = waylandCursor->images[0];
|
struct wl_cursor_image *image = waylandCursor->images[0];
|
||||||
struct wl_buffer *buffer = wl_cursor_image_get_buffer(image);
|
struct wl_buffer *buffer = wl_cursor_image_get_buffer(image);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
qDebug("Could not find buffer for cursor");
|
qDebug("Could not find buffer for cursor");
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
@ -166,7 +166,7 @@ wl_cursor *QWaylandCursor::requestCursor(WaylandCursor shape)
|
|||||||
//If the cursor has not been loaded already, load it
|
//If the cursor has not been loaded already, load it
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
if (!mCursorTheme)
|
if (!mCursorTheme)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
QList<QByteArray> cursorNames = mCursorNamesMap.values(shape);
|
QList<QByteArray> cursorNames = mCursorNamesMap.values(shape);
|
||||||
foreach (const QByteArray &name, cursorNames) {
|
foreach (const QByteArray &name, cursorNames) {
|
||||||
|
@ -67,7 +67,7 @@ QWaylandDataDevice::QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWayl
|
|||||||
, m_display(manager->display())
|
, m_display(manager->display())
|
||||||
, m_inputDevice(inputDevice)
|
, m_inputDevice(inputDevice)
|
||||||
, m_enterSerial(0)
|
, m_enterSerial(0)
|
||||||
, m_dragWindow(0)
|
, m_dragWindow(nullptr)
|
||||||
, m_dragPoint()
|
, m_dragPoint()
|
||||||
, m_dragOffer()
|
, m_dragOffer()
|
||||||
, m_selectionOffer()
|
, m_selectionOffer()
|
||||||
@ -135,7 +135,7 @@ void QWaylandDataDevice::data_device_drop()
|
|||||||
{
|
{
|
||||||
QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag();
|
QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag();
|
||||||
|
|
||||||
QMimeData *dragData = 0;
|
QMimeData *dragData = nullptr;
|
||||||
Qt::DropActions supportedActions;
|
Qt::DropActions supportedActions;
|
||||||
if (drag) {
|
if (drag) {
|
||||||
dragData = drag->mimeData();
|
dragData = drag->mimeData();
|
||||||
@ -182,14 +182,14 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface,
|
|||||||
if (response.isAccepted()) {
|
if (response.isAccepted()) {
|
||||||
wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData());
|
wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData());
|
||||||
} else {
|
} 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()
|
void QWaylandDataDevice::data_device_leave()
|
||||||
{
|
{
|
||||||
if (m_dragWindow)
|
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();
|
QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag();
|
||||||
if (!drag) {
|
if (!drag) {
|
||||||
@ -227,7 +227,7 @@ void QWaylandDataDevice::data_device_motion(uint32_t time, wl_fixed_t x, wl_fixe
|
|||||||
if (response.isAccepted()) {
|
if (response.isAccepted()) {
|
||||||
wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData());
|
wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData());
|
||||||
} else {
|
} 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)
|
#endif // QT_CONFIG(draganddrop)
|
||||||
|
@ -91,7 +91,7 @@ QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &nam
|
|||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationPlugin : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QWaylandDecorationPlugin(QObject *parent = 0);
|
explicit QWaylandDecorationPlugin(QObject *parent = nullptr);
|
||||||
~QWaylandDecorationPlugin();
|
~QWaylandDecorationPlugin();
|
||||||
|
|
||||||
virtual QWaylandAbstractDecoration *create(const QString &key, const QStringList ¶mList) = 0;
|
virtual QWaylandAbstractDecoration *create(const QString &key, const QStringList ¶mList) = 0;
|
||||||
|
@ -89,7 +89,7 @@ struct wl_surface *QWaylandDisplay::createSurface(void *handle)
|
|||||||
QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window)
|
QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window)
|
||||||
{
|
{
|
||||||
if (!mWaylandIntegration->shellIntegration())
|
if (!mWaylandIntegration->shellIntegration())
|
||||||
return 0;
|
return nullptr;
|
||||||
return mWaylandIntegration->shellIntegration()->createShellSurface(window);
|
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)
|
::wl_subsurface *QWaylandDisplay::createSubSurface(QWaylandWindow *window, QWaylandWindow *parent)
|
||||||
{
|
{
|
||||||
if (!mSubCompositor) {
|
if (!mSubCompositor) {
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSubCompositor->get_subsurface(window->object(), parent->object());
|
return mSubCompositor->get_subsurface(window->object(), parent->object());
|
||||||
@ -125,24 +125,24 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co
|
|||||||
QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
|
QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
|
||||||
: mWaylandIntegration(waylandIntegration)
|
: mWaylandIntegration(waylandIntegration)
|
||||||
#if QT_CONFIG(wayland_datadevice)
|
#if QT_CONFIG(wayland_datadevice)
|
||||||
, mDndSelectionHandler(0)
|
, mDndSelectionHandler(nullptr)
|
||||||
#endif
|
#endif
|
||||||
, mWindowExtension(0)
|
, mWindowExtension(nullptr)
|
||||||
, mSubCompositor(0)
|
, mSubCompositor(nullptr)
|
||||||
, mTouchExtension(0)
|
, mTouchExtension(nullptr)
|
||||||
, mQtKeyExtension(0)
|
, mQtKeyExtension(nullptr)
|
||||||
, mTextInputManager(0)
|
, mTextInputManager(nullptr)
|
||||||
, mHardwareIntegration(0)
|
, mHardwareIntegration(nullptr)
|
||||||
, mLastInputSerial(0)
|
, mLastInputSerial(0)
|
||||||
, mLastInputDevice(0)
|
, mLastInputDevice(nullptr)
|
||||||
, mLastInputWindow(0)
|
, mLastInputWindow(nullptr)
|
||||||
, mLastKeyboardFocus(nullptr)
|
, mLastKeyboardFocus(nullptr)
|
||||||
, mSyncCallback(nullptr)
|
, mSyncCallback(nullptr)
|
||||||
{
|
{
|
||||||
qRegisterMetaType<uint32_t>("uint32_t");
|
qRegisterMetaType<uint32_t>("uint32_t");
|
||||||
|
|
||||||
mDisplay = wl_display_connect(NULL);
|
mDisplay = wl_display_connect(nullptr);
|
||||||
if (mDisplay == NULL) {
|
if (mDisplay == nullptr) {
|
||||||
qErrnoWarning(errno, "Failed to create display");
|
qErrnoWarning(errno, "Failed to create display");
|
||||||
::exit(1);
|
::exit(1);
|
||||||
}
|
}
|
||||||
@ -219,7 +219,7 @@ QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const
|
|||||||
if (screen->output() == output)
|
if (screen->output() == output)
|
||||||
return screen;
|
return screen;
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandDisplay::waitForScreens()
|
void QWaylandDisplay::waitForScreens()
|
||||||
@ -333,7 +333,7 @@ uint32_t QWaylandDisplay::currentTimeMillisec()
|
|||||||
{
|
{
|
||||||
//### we throw away the time information
|
//### we throw away the time information
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int ret = gettimeofday(&tv, 0);
|
int ret = gettimeofday(&tv, nullptr);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
return tv.tv_sec*1000 + tv.tv_usec/1000;
|
return tv.tv_sec*1000 + tv.tv_usec/1000;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -403,7 +403,7 @@ QWaylandInputContext::~QWaylandInputContext()
|
|||||||
|
|
||||||
bool QWaylandInputContext::isValid() const
|
bool QWaylandInputContext::isValid() const
|
||||||
{
|
{
|
||||||
return mDisplay->textInputManager() != 0;
|
return mDisplay->textInputManager() != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandInputContext::reset()
|
void QWaylandInputContext::reset()
|
||||||
|
@ -121,7 +121,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QWaylandIntegration::QWaylandIntegration()
|
QWaylandIntegration::QWaylandIntegration()
|
||||||
: mClientBufferIntegration(0)
|
: mClientBufferIntegration(nullptr)
|
||||||
, mInputDeviceIntegration(nullptr)
|
, mInputDeviceIntegration(nullptr)
|
||||||
, mFontDb(new QGenericUnixFontDatabase())
|
, mFontDb(new QGenericUnixFontDatabase())
|
||||||
, mNativeInterface(new QWaylandNativeInterface(this))
|
, mNativeInterface(new QWaylandNativeInterface(this))
|
||||||
@ -198,7 +198,7 @@ QPlatformOpenGLContext *QWaylandIntegration::createPlatformOpenGLContext(QOpenGL
|
|||||||
{
|
{
|
||||||
if (mDisplay->clientBufferIntegration())
|
if (mDisplay->clientBufferIntegration())
|
||||||
return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle());
|
return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle());
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
#endif // opengl
|
#endif // opengl
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uin
|
|||||||
, mOutputName(QStringLiteral("Screen%1").arg(id))
|
, mOutputName(QStringLiteral("Screen%1").arg(id))
|
||||||
, m_orientation(Qt::PrimaryOrientation)
|
, m_orientation(Qt::PrimaryOrientation)
|
||||||
#if QT_CONFIG(cursor)
|
#if QT_CONFIG(cursor)
|
||||||
, mWaylandCursor(0)
|
, mWaylandCursor(nullptr)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -73,8 +73,8 @@ Q_LOGGING_CATEGORY(logCategory, "qt.qpa.wayland.backingstore")
|
|||||||
QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
|
QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
|
||||||
const QSize &size, QImage::Format format, int scale)
|
const QSize &size, QImage::Format format, int scale)
|
||||||
: QWaylandBuffer()
|
: QWaylandBuffer()
|
||||||
, mShmPool(0)
|
, mShmPool(nullptr)
|
||||||
, mMarginsImage(0)
|
, mMarginsImage(nullptr)
|
||||||
{
|
{
|
||||||
int stride = size.width() * 4;
|
int stride = size.width() * 4;
|
||||||
int alloc = stride * size.height();
|
int alloc = stride * size.height();
|
||||||
@ -105,7 +105,7 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
|
|||||||
// map ourselves: QFile::map() will unmap when the object is destroyed,
|
// map ourselves: QFile::map() will unmap when the object is destroyed,
|
||||||
// but we want this mapping to persist (unmapping in destructor)
|
// but we want this mapping to persist (unmapping in destructor)
|
||||||
uchar *data = (uchar *)
|
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) {
|
if (data == (uchar *) MAP_FAILED) {
|
||||||
qErrnoWarning("QWaylandShmBuffer: mmap failed");
|
qErrnoWarning("QWaylandShmBuffer: mmap failed");
|
||||||
return;
|
return;
|
||||||
@ -147,7 +147,7 @@ QImage *QWaylandShmBuffer::imageInsideMargins(const QMargins &marginsIn)
|
|||||||
}
|
}
|
||||||
if (margins.isNull()) {
|
if (margins.isNull()) {
|
||||||
delete mMarginsImage;
|
delete mMarginsImage;
|
||||||
mMarginsImage = 0;
|
mMarginsImage = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
mMargins = margins;
|
mMargins = margins;
|
||||||
@ -161,8 +161,8 @@ QImage *QWaylandShmBuffer::imageInsideMargins(const QMargins &marginsIn)
|
|||||||
QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window)
|
QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window)
|
||||||
: QPlatformBackingStore(window)
|
: QPlatformBackingStore(window)
|
||||||
, mDisplay(QWaylandScreen::waylandScreenFromWindow(window)->display())
|
, mDisplay(QWaylandScreen::waylandScreenFromWindow(window)->display())
|
||||||
, mFrontBuffer(0)
|
, mFrontBuffer(nullptr)
|
||||||
, mBackBuffer(0)
|
, mBackBuffer(nullptr)
|
||||||
, mPainting(false)
|
, mPainting(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size)
|
|||||||
} else {
|
} else {
|
||||||
mBuffers.removeOne(b);
|
mBuffers.removeOne(b);
|
||||||
if (mBackBuffer == b)
|
if (mBackBuffer == b)
|
||||||
mBackBuffer = 0;
|
mBackBuffer = nullptr;
|
||||||
delete b;
|
delete b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size)
|
|||||||
mBuffers.prepend(b);
|
mBuffers.prepend(b);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandShmBackingStore::resize(const QSize &size)
|
void QWaylandShmBackingStore::resize(const QSize &size)
|
||||||
|
@ -48,11 +48,11 @@ namespace QtWaylandClient {
|
|||||||
QWaylandTouchExtension::QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id)
|
QWaylandTouchExtension::QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id)
|
||||||
: QtWayland::qt_touch_extension(display->wl_registry(), id, 1),
|
: QtWayland::qt_touch_extension(display->wl_registry(), id, 1),
|
||||||
mDisplay(display),
|
mDisplay(display),
|
||||||
mTouchDevice(0),
|
mTouchDevice(nullptr),
|
||||||
mPointsLeft(0),
|
mPointsLeft(0),
|
||||||
mFlags(0),
|
mFlags(0),
|
||||||
mMouseSourceId(-1),
|
mMouseSourceId(-1),
|
||||||
mInputDevice(0)
|
mInputDevice(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,15 +75,15 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
QWaylandWindow *QWaylandWindow::mMouseGrab = 0;
|
QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
|
||||||
|
|
||||||
QWaylandWindow::QWaylandWindow(QWindow *window)
|
QWaylandWindow::QWaylandWindow(QWindow *window)
|
||||||
: QObject()
|
: QObject()
|
||||||
, QPlatformWindow(window)
|
, QPlatformWindow(window)
|
||||||
, mDisplay(waylandScreen()->display())
|
, mDisplay(waylandScreen()->display())
|
||||||
, mShellSurface(0)
|
, mShellSurface(nullptr)
|
||||||
, mSubSurfaceWindow(0)
|
, mSubSurfaceWindow(nullptr)
|
||||||
, mWindowDecoration(0)
|
, mWindowDecoration(nullptr)
|
||||||
, mMouseEventsInContentArea(false)
|
, mMouseEventsInContentArea(false)
|
||||||
, mMousePressedInContentArea(Qt::NoButton)
|
, mMousePressedInContentArea(Qt::NoButton)
|
||||||
, mWaitingForFrameSync(false)
|
, mWaitingForFrameSync(false)
|
||||||
@ -124,7 +124,7 @@ QWaylandWindow::~QWaylandWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mMouseGrab == this) {
|
if (mMouseGrab == this) {
|
||||||
mMouseGrab = 0;
|
mMouseGrab = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,9 +256,9 @@ void QWaylandWindow::reset(bool sendDestroyEvent)
|
|||||||
QGuiApplication::sendEvent(window(), &e);
|
QGuiApplication::sendEvent(window(), &e);
|
||||||
}
|
}
|
||||||
delete mShellSurface;
|
delete mShellSurface;
|
||||||
mShellSurface = 0;
|
mShellSurface = nullptr;
|
||||||
delete mSubSurfaceWindow;
|
delete mSubSurfaceWindow;
|
||||||
mSubSurfaceWindow = 0;
|
mSubSurfaceWindow = nullptr;
|
||||||
if (isInitialized())
|
if (isInitialized())
|
||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ void QWaylandWindow::setParent(const QPlatformWindow *parent)
|
|||||||
if (!window()->isVisible())
|
if (!window()->isVisible())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QWaylandWindow *oldparent = mSubSurfaceWindow ? mSubSurfaceWindow->parent() : 0;
|
QWaylandWindow *oldparent = mSubSurfaceWindow ? mSubSurfaceWindow->parent() : nullptr;
|
||||||
if (oldparent == parent)
|
if (oldparent == parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -574,7 +574,7 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
|
|||||||
|
|
||||||
attach(buffer->buffer(), x, y);
|
attach(buffer->buffer(), x, y);
|
||||||
} else {
|
} else {
|
||||||
QtWayland::wl_surface::attach(0, 0, 0);
|
QtWayland::wl_surface::attach(nullptr, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -777,7 +777,7 @@ bool QWaylandWindow::createDecoration()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
delete mWindowDecoration;
|
delete mWindowDecoration;
|
||||||
mWindowDecoration = 0;
|
mWindowDecoration = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hadDecoration != (bool)mWindowDecoration) {
|
if (hadDecoration != (bool)mWindowDecoration) {
|
||||||
@ -984,7 +984,7 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mMouseGrab = grab ? this : 0;
|
mMouseGrab = grab ? this : nullptr;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,14 +127,14 @@ void QWaylandWlShellSurface::setMaximized()
|
|||||||
{
|
{
|
||||||
m_maximized = true;
|
m_maximized = true;
|
||||||
m_size = m_window->window()->geometry().size();
|
m_size = m_window->window()->geometry().size();
|
||||||
set_maximized(0);
|
set_maximized(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandWlShellSurface::setFullscreen()
|
void QWaylandWlShellSurface::setFullscreen()
|
||||||
{
|
{
|
||||||
m_fullscreen = true;
|
m_fullscreen = true;
|
||||||
m_size = m_window->window()->geometry().size();
|
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()
|
void QWaylandWlShellSurface::setNormal()
|
||||||
|
@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationPlugin : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QWaylandShellIntegrationPlugin(QObject *parent = 0);
|
explicit QWaylandShellIntegrationPlugin(QObject *parent = nullptr);
|
||||||
~QWaylandShellIntegrationPlugin();
|
~QWaylandShellIntegrationPlugin();
|
||||||
|
|
||||||
virtual QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
virtual QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
||||||
|
@ -228,7 +228,7 @@ const WaylandArgument *newIdArgument(const QList<WaylandArgument> &arguments)
|
|||||||
if (arguments.at(i).type == "new_id")
|
if (arguments.at(i).type == "new_id")
|
||||||
return &arguments.at(i);
|
return &arguments.at(i);
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void printEvent(const WaylandEvent &e, bool omitNames = false, bool withResource = false)
|
void printEvent(const WaylandEvent &e, bool omitNames = false, bool withResource = false)
|
||||||
|
@ -295,9 +295,9 @@ void tst_WaylandClient::events()
|
|||||||
QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
|
QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
|
||||||
|
|
||||||
QCOMPARE(window.focusOutEventCount, 0);
|
QCOMPARE(window.focusOutEventCount, 0);
|
||||||
compositor->setKeyboardFocus(QSharedPointer<MockSurface>(0));
|
compositor->setKeyboardFocus(QSharedPointer<MockSurface>(nullptr));
|
||||||
QTRY_COMPARE(window.focusOutEventCount, 1);
|
QTRY_COMPARE(window.focusOutEventCount, 1);
|
||||||
QTRY_COMPARE(QGuiApplication::focusWindow(), static_cast<QWindow *>(0));
|
QTRY_COMPARE(QGuiApplication::focusWindow(), static_cast<QWindow *>(nullptr));
|
||||||
|
|
||||||
compositor->setKeyboardFocus(surface);
|
compositor->setKeyboardFocus(surface);
|
||||||
QTRY_COMPARE(window.focusInEventCount, 2);
|
QTRY_COMPARE(window.focusInEventCount, 2);
|
||||||
@ -375,7 +375,7 @@ class DndWindow : public QWindow
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DndWindow(QWindow *parent = 0)
|
DndWindow(QWindow *parent = nullptr)
|
||||||
: QWindow(parent)
|
: QWindow(parent)
|
||||||
, dragStarted(false)
|
, dragStarted(false)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user