Use QScopedPointer in QWaylandDisplay for extensions
Change-Id: I783639fcefd36967f42f18417b0e07ec34b49dbb Reviewed-by: Andy Nichols <andy.nichols@digia.com>
This commit is contained in:
parent
d44fe6a530
commit
a719dbfe80
@ -85,7 +85,7 @@ QWaylandClientBufferIntegration * QWaylandDisplay::clientBufferIntegration() con
|
|||||||
|
|
||||||
QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() const
|
QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() const
|
||||||
{
|
{
|
||||||
return mWindowManagerIntegration;
|
return mWindowManagerIntegration.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
QWaylandInputDevice *QWaylandDisplay::lastKeyboardFocusInputDevice() const
|
QWaylandInputDevice *QWaylandDisplay::lastKeyboardFocusInputDevice() const
|
||||||
@ -133,7 +133,7 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
|
|||||||
|
|
||||||
connect(mEventThreadObject, SIGNAL(newEventsRead()), this, SLOT(flushRequests()));
|
connect(mEventThreadObject, SIGNAL(newEventsRead()), this, SLOT(flushRequests()));
|
||||||
|
|
||||||
mWindowManagerIntegration = new QWaylandWindowManagerIntegration(this);
|
mWindowManagerIntegration.reset(new QWaylandWindowManagerIntegration(this));
|
||||||
|
|
||||||
blockingReadEvents();
|
blockingReadEvents();
|
||||||
|
|
||||||
@ -213,28 +213,28 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
|
|||||||
} else if (interface == QStringLiteral("wl_shm")) {
|
} else if (interface == QStringLiteral("wl_shm")) {
|
||||||
mShm = static_cast<struct wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface,1));
|
mShm = static_cast<struct wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface,1));
|
||||||
} else if (interface == QStringLiteral("wl_shell")){
|
} else if (interface == QStringLiteral("wl_shell")){
|
||||||
mShell = new QtWayland::wl_shell(registry, id);
|
mShell.reset(new QtWayland::wl_shell(registry, id));
|
||||||
} else if (interface == QStringLiteral("wl_seat")) {
|
} else if (interface == QStringLiteral("wl_seat")) {
|
||||||
QWaylandInputDevice *inputDevice = new QWaylandInputDevice(this, id);
|
QWaylandInputDevice *inputDevice = new QWaylandInputDevice(this, id);
|
||||||
mInputDevices.append(inputDevice);
|
mInputDevices.append(inputDevice);
|
||||||
} else if (interface == QStringLiteral("wl_data_device_manager")) {
|
} else if (interface == QStringLiteral("wl_data_device_manager")) {
|
||||||
mDndSelectionHandler = new QWaylandDataDeviceManager(this, id);
|
mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id));
|
||||||
} else if (interface == QStringLiteral("qt_output_extension")) {
|
} else if (interface == QStringLiteral("qt_output_extension")) {
|
||||||
mOutputExtension = new QtWayland::qt_output_extension(registry, id);
|
mOutputExtension.reset(new QtWayland::qt_output_extension(registry, id));
|
||||||
foreach (QPlatformScreen *screen, screens())
|
foreach (QPlatformScreen *screen, screens())
|
||||||
static_cast<QWaylandScreen *>(screen)->createExtendedOutput();
|
static_cast<QWaylandScreen *>(screen)->createExtendedOutput();
|
||||||
} else if (interface == QStringLiteral("qt_surface_extension")) {
|
} else if (interface == QStringLiteral("qt_surface_extension")) {
|
||||||
mWindowExtension = new QtWayland::qt_surface_extension(registry, id);
|
mWindowExtension.reset(new QtWayland::qt_surface_extension(registry, id));
|
||||||
} else if (interface == QStringLiteral("qt_sub_surface_extension")) {
|
} else if (interface == QStringLiteral("qt_sub_surface_extension")) {
|
||||||
mSubSurfaceExtension = new QtWayland::qt_sub_surface_extension(registry, id);
|
mSubSurfaceExtension.reset(new QtWayland::qt_sub_surface_extension(registry, id));
|
||||||
} else if (interface == QStringLiteral("qt_touch_extension")) {
|
} else if (interface == QStringLiteral("qt_touch_extension")) {
|
||||||
mTouchExtension = new QWaylandTouchExtension(this, id);
|
mTouchExtension.reset(new QWaylandTouchExtension(this, id));
|
||||||
} else if (interface == QStringLiteral("qt_key_extension")) {
|
} else if (interface == QStringLiteral("qt_key_extension")) {
|
||||||
mQtKeyExtension = new QWaylandQtKeyExtension(this, id);
|
mQtKeyExtension.reset(new QWaylandQtKeyExtension(this, id));
|
||||||
} else if (interface == QStringLiteral("wl_text_input_manager")) {
|
} else if (interface == QStringLiteral("wl_text_input_manager")) {
|
||||||
mTextInputManager = new QtWayland::wl_text_input_manager(registry, id);
|
mTextInputManager.reset(new QtWayland::wl_text_input_manager(registry, id));
|
||||||
} else if (interface == QStringLiteral("qt_hardware_integration")) {
|
} else if (interface == QStringLiteral("qt_hardware_integration")) {
|
||||||
mHardwareIntegration = new QWaylandHardwareIntegration(registry, id);
|
mHardwareIntegration.reset(new QWaylandHardwareIntegration(registry, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Listener l, mRegistryListeners)
|
foreach (Listener l, mRegistryListeners)
|
||||||
|
@ -112,7 +112,7 @@ public:
|
|||||||
const struct wl_compositor *wl_compositor() const { return mCompositor.object(); }
|
const struct wl_compositor *wl_compositor() const { return mCompositor.object(); }
|
||||||
QtWayland::wl_compositor *compositor() { return &mCompositor; }
|
QtWayland::wl_compositor *compositor() { return &mCompositor; }
|
||||||
|
|
||||||
QtWayland::wl_shell *shell() { return mShell; }
|
QtWayland::wl_shell *shell() { return mShell.data(); }
|
||||||
|
|
||||||
QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
|
QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
|
||||||
QWaylandInputDevice *defaultInputDevice() const;
|
QWaylandInputDevice *defaultInputDevice() const;
|
||||||
@ -121,14 +121,14 @@ public:
|
|||||||
QWaylandInputDevice *lastKeyboardFocusInputDevice() const;
|
QWaylandInputDevice *lastKeyboardFocusInputDevice() const;
|
||||||
void setLastKeyboardFocusInputDevice(QWaylandInputDevice *device);
|
void setLastKeyboardFocusInputDevice(QWaylandInputDevice *device);
|
||||||
|
|
||||||
QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler; }
|
QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); }
|
||||||
|
|
||||||
QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension; }
|
QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); }
|
||||||
QtWayland::qt_sub_surface_extension *subSurfaceExtension() const { return mSubSurfaceExtension; }
|
QtWayland::qt_sub_surface_extension *subSurfaceExtension() const { return mSubSurfaceExtension.data(); }
|
||||||
QtWayland::qt_output_extension *outputExtension() const { return mOutputExtension; }
|
QtWayland::qt_output_extension *outputExtension() const { return mOutputExtension.data(); }
|
||||||
QWaylandTouchExtension *touchExtension() const { return mTouchExtension; }
|
QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); }
|
||||||
QtWayland::wl_text_input_manager *textInputManager() const { return mTextInputManager; }
|
QtWayland::wl_text_input_manager *textInputManager() const { return mTextInputManager.data(); }
|
||||||
QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration; }
|
QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); }
|
||||||
|
|
||||||
/* wl_registry_add_listener does not add but rather sets a listener, so this function is used
|
/* wl_registry_add_listener does not add but rather sets a listener, so this function is used
|
||||||
* to enable many listeners at once. */
|
* to enable many listeners at once. */
|
||||||
@ -158,21 +158,21 @@ private:
|
|||||||
struct wl_shm *mShm;
|
struct wl_shm *mShm;
|
||||||
QThread *mEventThread;
|
QThread *mEventThread;
|
||||||
QWaylandEventThread *mEventThreadObject;
|
QWaylandEventThread *mEventThreadObject;
|
||||||
QtWayland::wl_shell *mShell;
|
QScopedPointer<QtWayland::wl_shell> mShell;
|
||||||
QList<QPlatformScreen *> mScreens;
|
QList<QPlatformScreen *> mScreens;
|
||||||
QList<QWaylandInputDevice *> mInputDevices;
|
QList<QWaylandInputDevice *> mInputDevices;
|
||||||
QList<Listener> mRegistryListeners;
|
QList<Listener> mRegistryListeners;
|
||||||
QWaylandIntegration *mWaylandIntegration;
|
QWaylandIntegration *mWaylandIntegration;
|
||||||
QWaylandInputDevice *mLastKeyboardFocusInputDevice;
|
QWaylandInputDevice *mLastKeyboardFocusInputDevice;
|
||||||
QWaylandDataDeviceManager *mDndSelectionHandler;
|
QScopedPointer<QWaylandDataDeviceManager> mDndSelectionHandler;
|
||||||
QtWayland::qt_surface_extension *mWindowExtension;
|
QScopedPointer<QtWayland::qt_surface_extension> mWindowExtension;
|
||||||
QtWayland::qt_sub_surface_extension *mSubSurfaceExtension;
|
QScopedPointer<QtWayland::qt_sub_surface_extension> mSubSurfaceExtension;
|
||||||
QtWayland::qt_output_extension *mOutputExtension;
|
QScopedPointer<QtWayland::qt_output_extension> mOutputExtension;
|
||||||
QWaylandTouchExtension *mTouchExtension;
|
QScopedPointer<QWaylandTouchExtension> mTouchExtension;
|
||||||
QWaylandQtKeyExtension *mQtKeyExtension;
|
QScopedPointer<QWaylandQtKeyExtension> mQtKeyExtension;
|
||||||
QWaylandWindowManagerIntegration *mWindowManagerIntegration;
|
QScopedPointer<QWaylandWindowManagerIntegration> mWindowManagerIntegration;
|
||||||
QtWayland::wl_text_input_manager *mTextInputManager;
|
QScopedPointer<QtWayland::wl_text_input_manager> mTextInputManager;
|
||||||
QWaylandHardwareIntegration *mHardwareIntegration;
|
QScopedPointer<QWaylandHardwareIntegration> mHardwareIntegration;
|
||||||
|
|
||||||
QSocketNotifier *mReadNotifier;
|
QSocketNotifier *mReadNotifier;
|
||||||
int mFd;
|
int mFd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user