diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-08-07 14:25:30 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-08-28 13:10:33 +0200 |
commit | bc331abe8e8ffaa3db12be7ae69e7b658dd700ac (patch) | |
tree | 5e8aeaba53f8967b4962dcbf05077b9bfed7fa06 /src/compositor/wayland_wrapper | |
parent | 35d27a6761bb375ca8457c8be11dcd57eb9de554 (diff) |
Remove the Surface role functionality
This replaced by the QWaylandExtension and QWaylandExtensionContainers
Change-Id: Iba0299725542ede618b636fb2d40715acfcb3b51
Diffstat (limited to 'src/compositor/wayland_wrapper')
-rw-r--r-- | src/compositor/wayland_wrapper/qwlsurface.cpp | 13 | ||||
-rw-r--r-- | src/compositor/wayland_wrapper/qwlsurface_p.h | 62 |
2 files changed, 0 insertions, 75 deletions
diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 961163b88..45194f13a 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -123,8 +123,6 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom , m_destroyed(false) , m_contentOrientation(Qt::PrimaryOrientation) , m_visibility(QWindow::Hidden) - , m_role(0) - , m_roleHandler(0) { m_pending.buffer = 0; m_pending.newlyAttached = false; @@ -146,17 +144,6 @@ Surface::~Surface() c->destroy(); } -bool Surface::setRole(const SurfaceRole *role, wl_resource *errorResource, uint32_t errorCode) -{ - if (m_role && m_role != role) { - wl_resource_post_error(errorResource, errorCode, "Cannot assign role %s to wl_surface@%d, already has role %s\n", role->name, - wl_resource_get_id(resource()->handle), m_role->name); - return false; - } - m_role = role; - return true; -} - Surface *Surface::fromResource(struct ::wl_resource *resource) { return static_cast<Surface *>(Resource::fromResource(resource)->surface_object); diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 4014d3d2e..ae92d6f47 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -69,20 +69,12 @@ class InputPanelSurface; class SubSurface; class FrameCallback; -class SurfaceRole; -class RoleBase; - class Q_COMPOSITOR_EXPORT Surface : public QtWaylandServer::wl_surface { public: Surface(struct wl_client *client, uint32_t id, int version, QWaylandCompositor *compositor, QWaylandSurface *surface); ~Surface(); - bool setRole(const SurfaceRole *role, wl_resource *errorResource, uint32_t errorCode); - const SurfaceRole *role() const { return m_role; } - template<class T> - bool setRoleHandler(T *handler); - static Surface *fromResource(struct ::wl_resource *resource); bool mapped() const; @@ -190,67 +182,13 @@ protected: Qt::ScreenOrientation m_contentOrientation; QWindow::Visibility m_visibility; - const SurfaceRole *m_role; - RoleBase *m_roleHandler; - void setBackBuffer(SurfaceBuffer *buffer, const QRegion &damage); SurfaceBuffer *createSurfaceBuffer(struct ::wl_resource *buffer); friend class QWaylandSurface; - friend class RoleBase; -}; - -class SurfaceRole -{ -public: - const char *name; -}; - -class RoleBase -{ -public: - virtual ~RoleBase() { - if (m_surface) { - m_surface->m_roleHandler = 0; m_surface = 0; - } - } - -protected: - RoleBase() : m_surface(0) {} - static inline RoleBase *roleOf(Surface *s) { return s->m_roleHandler; } - - virtual void configure(int dx, int dy) = 0; - -private: - Surface *m_surface; - friend class Surface; }; -template<class T> -class SurfaceRoleHandler : public RoleBase -{ -public: - static T *get(Surface *surface) { - if (surface->role() == T::role()) { - return static_cast<T *>(roleOf(surface)); - } - return 0; - } -}; - -template<class T> -bool Surface::setRoleHandler(T *handler) -{ - RoleBase *base = handler; - if (m_role == T::role()) { - m_roleHandler = base; - base->m_surface = this; - return true; - } - return false; -} - } QT_END_NAMESPACE |