summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper/wlsurface.h
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2012-02-13 14:19:22 +0100
committerSamuel Rødal <samuel.rodal@nokia.com>2012-02-13 17:22:21 +0100
commit9b657f70101951239b6af94afedcedffe65e5f10 (patch)
tree722b4077136b092aae015c3da628e97cd20c1f58 /src/compositor/wayland_wrapper/wlsurface.h
parent742517582f29b1e8bbb05998c0722f2726f1545d (diff)
Removing Wayland::SurfacePrivate
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 <samuel.rodal@nokia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/wlsurface.h')
-rw-r--r--src/compositor/wayland_wrapper/wlsurface.h57
1 files changed, 35 insertions, 22 deletions
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 <QtGui/qopengl.h>
#endif
+#include <wayland-util.h>
+
class QTouchEvent;
namespace Wayland {
@@ -69,11 +72,8 @@ class ExtendedSurface;
class SubSurface;
class ShellSurface;
-class SurfacePrivate;
-
class Q_COMPOSITOR_EXPORT Surface : public Object<struct wl_surface>
{
- 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<SurfacePrivate> d_ptr;
+
private:
Q_DISABLE_COPY(Surface)
+
+ Compositor *m_compositor;
+ WaylandSurface *m_waylandSurface;
+
+ SurfaceBuffer *m_surfaceBuffer;
+ SurfaceBuffer *m_textureBuffer;
+ QList<SurfaceBuffer*> 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);