From 9b657f70101951239b6af94afedcedffe65e5f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 13 Feb 2012 14:19:22 +0100 Subject: Removing Wayland::SurfacePrivate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And moving Wayland::SurfaceBuffer into its own file. Also remove the extra functions in Wayland::Surface which just relayed down to extended surface. The pattern is that WaylandSurface is the entry point so we check there is the Wayland::Surface has the extension we'r looking for, then calling it directly from WaylandSurface. Last, the data of an extension is suppose to be members of the extension, so I moved the properties to be members of ExtendedSurface Change-Id: I5877671a17ee873b7644094f695fcd3e4677964a Reviewed-by: Samuel Rødal --- src/compositor/wayland_wrapper/wlsurface.h | 57 ++++++++++++++++++------------ 1 file changed, 35 insertions(+), 22 deletions(-) (limited to 'src/compositor/wayland_wrapper/wlsurface.h') diff --git a/src/compositor/wayland_wrapper/wlsurface.h b/src/compositor/wayland_wrapper/wlsurface.h index ecb4b5fe8..99476c826 100644 --- a/src/compositor/wayland_wrapper/wlsurface.h +++ b/src/compositor/wayland_wrapper/wlsurface.h @@ -44,6 +44,7 @@ #include "waylandexport.h" #include "wlshmbuffer.h" +#include "wlsurfacebuffer.h" #include "waylandsurface.h" #include "waylandobject.h" @@ -59,6 +60,8 @@ #include #endif +#include + class QTouchEvent; namespace Wayland { @@ -69,11 +72,8 @@ class ExtendedSurface; class SubSurface; class ShellSurface; -class SurfacePrivate; - class Q_COMPOSITOR_EXPORT Surface : public Object { - Q_DECLARE_PRIVATE(Surface) public: Surface(struct wl_client *client, uint32_t id, Compositor *compositor); ~Surface(); @@ -101,23 +101,7 @@ public: void frameFinished(); - void sendOnScreenVisibilityChange(bool visible); - - WaylandSurface *handle() const; - - qint64 processId() const; - void setProcessId(qint64 processId); - QByteArray authenticationToken() const; - void setAuthenticationToken(const QByteArray &authenticationToken); - - QVariantMap windowProperties() const; - QVariant windowProperty(const QString &propertyName) const; - void setWindowProperty(const QString &name, const QVariant &value, bool writeUpdateToClient = true); - - Qt::ScreenOrientation contentOrientation() const; - Qt::ScreenOrientation windowOrientation() const; - - WaylandSurface::WindowFlags windowFlags() const; + WaylandSurface *waylandSurface() const; QPoint lastMousePos() const; @@ -133,10 +117,39 @@ public: Compositor *compositor() const; static const struct wl_surface_interface surface_interface; -protected: - QScopedPointer d_ptr; + private: Q_DISABLE_COPY(Surface) + + Compositor *m_compositor; + WaylandSurface *m_waylandSurface; + + SurfaceBuffer *m_surfaceBuffer; + SurfaceBuffer *m_textureBuffer; + QList m_bufferQueue; + bool m_surfaceMapped; + + QPoint m_lastLocalMousePos; + QPoint m_lastGlobalMousePos; + + struct wl_list m_frame_callback_list; + + ExtendedSurface *m_extendedSurface; + SubSurface *m_subSurface; + ShellSurface *m_shellSurface; + + static const int buffer_pool_size = 3; + SurfaceBuffer m_bufferPool[buffer_pool_size]; + + QPointF m_position; + QSize m_size; + + void doUpdate(const QRect &rect); + void newCurrentBuffer(); + SurfaceBuffer *createSurfaceBuffer(struct wl_buffer *buffer); + void frameFinishedInternal(); + bool postBuffer(); + void attach(struct wl_buffer *buffer); void damage(const QRect &rect); -- cgit v1.2.3