diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-07-30 15:21:17 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-08-28 13:09:42 +0200 |
commit | 0f3c1a1669aa133efd8701f25b8b8093517b81a7 (patch) | |
tree | 964e3be6ecd36c0c4eeafbab0f65e74eac9ee80b /examples/wayland | |
parent | d1359f8b0c2b8fcffc2112d2e29d530ac1ab7c9a (diff) |
Rename QWaylandSurfaceView to QWaylandView
and rename QWaylandSurfaceItem to QWaylandQuickView
Change-Id: I989b482eb79df06e9f265bc2b0ef6b3dce7509d6
Diffstat (limited to 'examples/wayland')
4 files changed, 28 insertions, 28 deletions
diff --git a/examples/wayland/qml-compositor/main.cpp b/examples/wayland/qml-compositor/main.cpp index 49a6e1f1d..bea503d14 100644 --- a/examples/wayland/qml-compositor/main.cpp +++ b/examples/wayland/qml-compositor/main.cpp @@ -42,7 +42,7 @@ #include "qwaylandquickcompositor.h" #include "qwaylandquicksurface.h" -#include <QtCompositor/qwaylandsurfaceitem.h> +#include <QtCompositor/qwaylandquickview.h> #include <QtCompositor/qwaylandoutput.h> #include <QtCompositor/qwaylandoutputspace.h> @@ -84,9 +84,9 @@ public: return m_fullscreenSurface; } - Q_INVOKABLE QWaylandSurfaceItem *item(QWaylandSurface *surf) + Q_INVOKABLE QWaylandQuickView *item(QWaylandSurface *surf) { - return static_cast<QWaylandSurfaceItem *>(surf->views().first()); + return static_cast<QWaylandQuickView *>(surf->views().first()); } signals: diff --git a/examples/wayland/qwindow-compositor/qwindowcompositor.cpp b/examples/wayland/qwindow-compositor/qwindowcompositor.cpp index ca271ce60..8cfea2ae2 100644 --- a/examples/wayland/qwindow-compositor/qwindowcompositor.cpp +++ b/examples/wayland/qwindow-compositor/qwindowcompositor.cpp @@ -55,7 +55,7 @@ #include <QtCompositor/qwaylandinput.h> #include <QtCompositor/qwaylandbufferref.h> -#include <QtCompositor/qwaylandsurfaceview.h> +#include <QtCompositor/qwaylandview.h> #include <QtCompositor/qwaylandoutput.h> #include <QtCompositor/qwaylandoutputspace.h> @@ -64,11 +64,11 @@ QT_BEGIN_NAMESPACE -class SurfaceView : public QWaylandSurfaceView +class SurfaceView : public QWaylandView { public: SurfaceView() - : QWaylandSurfaceView() + : QWaylandView() , m_texture(0) {} @@ -179,7 +179,7 @@ void QWindowCompositor::surfaceDestroyed() void QWindowCompositor::surfaceMapped() { QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); - QtWayland::ShellSurface *shellSurface = QtWayland::ShellSurface::get(surface); + QtWayland::ShellSurface *shellSurface = QtWayland::ShellSurface::findIn(surface); QPoint pos; if (!m_surfaces.contains(surface)) { if (!shellSurface || (shellSurface->surfaceType() != QtWayland::ShellSurface::Popup)) { @@ -190,7 +190,7 @@ void QWindowCompositor::surfaceMapped() py = 1 + (qrand() % (m_window->height() - surface->size().height() - 2)); } pos = QPoint(px, py); - QWaylandSurfaceView *view = surface->views().first(); + QWaylandView *view = surface->views().first(); view->setRequestedPosition(pos); } } else { @@ -198,7 +198,7 @@ void QWindowCompositor::surfaceMapped() } if (shellSurface && shellSurface->surfaceType() == QtWayland::ShellSurface::Popup) { - QWaylandSurfaceView *view = surface->views().first(); + QWaylandView *view = surface->views().first(); view->setRequestedPosition(shellSurface->transientParent()->views().first()->pos() + shellSurface->transientOffset()); } @@ -218,7 +218,7 @@ void QWindowCompositor::surfaceUnmapped() m_renderScheduler.start(0); } -QWaylandSurfaceView *QWindowCompositor::createView() +QWaylandView *QWindowCompositor::createView() { return new SurfaceView(); } @@ -253,7 +253,7 @@ void QWindowCompositor::onSurfaceCreated(QWaylandSurface *surface) void QWindowCompositor::sendExpose() { QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); - QtWayland::ExtendedSurface *extendedSurface = QtWayland::ExtendedSurface::get(surface); + QtWayland::ExtendedSurface *extendedSurface = QtWayland::ExtendedSurface::findIn(surface); if (extendedSurface) extendedSurface->sendOnScreenVisibilityChange(true); } @@ -278,7 +278,7 @@ void QWindowCompositor::updateCursor(bool hasBuffer) } } -QPointF QWindowCompositor::toView(QWaylandSurfaceView *view, const QPointF &pos) const +QPointF QWindowCompositor::toView(QWaylandView *view, const QPointF &pos) const { return pos - view->pos(); } @@ -297,11 +297,11 @@ void QWindowCompositor::adjustCursorSurface(QWaylandSurface *surface, int hotspo m_cursorHotspotY = hotspotY; } -QWaylandSurfaceView *QWindowCompositor::viewAt(const QPointF &point, QPointF *local) +QWaylandView *QWindowCompositor::viewAt(const QPointF &point, QPointF *local) { for (int i = m_surfaces.size() - 1; i >= 0; --i) { QWaylandSurface *surface = m_surfaces.at(i); - foreach (QWaylandSurfaceView *view, surface->views()) { + foreach (QWaylandView *view, surface->views()) { QRectF geo(view->pos(), surface->size()); if (geo.contains(point)) { if (local) @@ -385,7 +385,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) case QEvent::MouseButtonPress: { QPointF local; QMouseEvent *me = static_cast<QMouseEvent *>(event); - QWaylandSurfaceView *target = viewAt(me->localPos(), &local); + QWaylandView *target = viewAt(me->localPos(), &local); if (m_dragKeyIsPressed && target) { m_draggingWindow = target; m_drag_diff = local; @@ -401,7 +401,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) return true; } case QEvent::MouseButtonRelease: { - QWaylandSurfaceView *target = input->mouseFocus(); + QWaylandView *target = input->mouseFocus(); if (m_draggingWindow) { m_draggingWindow = 0; m_drag_diff = QPointF(); @@ -421,7 +421,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) m_renderScheduler.start(0); } else { QPointF local; - QWaylandSurfaceView *target = viewAt(me->localPos(), &local); + QWaylandView *target = viewAt(me->localPos(), &local); input->sendMouseMoveEvent(target, local, me->localPos()); } break; @@ -457,7 +457,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) case QEvent::TouchUpdate: case QEvent::TouchEnd: { - QWaylandSurfaceView *target = 0; + QWaylandView *target = 0; QTouchEvent *te = static_cast<QTouchEvent *>(event); QList<QTouchEvent::TouchPoint> points = te->touchPoints(); QPoint pointPos; diff --git a/examples/wayland/qwindow-compositor/qwindowcompositor.h b/examples/wayland/qwindow-compositor/qwindowcompositor.h index dd1527134..db7f9129a 100644 --- a/examples/wayland/qwindow-compositor/qwindowcompositor.h +++ b/examples/wayland/qwindow-compositor/qwindowcompositor.h @@ -43,7 +43,7 @@ #include <QtCompositor/QWaylandCompositor> #include <QtCompositor/QWaylandSurface> -#include <QtCompositor/QWaylandSurfaceView> +#include <QtCompositor/QWaylandView> #include "textureblitter.h" #include "compositorwindow.h" @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE -class QWaylandSurfaceView; +class QWaylandView; class QOpenGLTexture; class QWindowCompositor : public QWaylandCompositor @@ -74,13 +74,13 @@ private slots: void render(); void onSurfaceCreated(QWaylandSurface *surface); protected: - QWaylandSurfaceView *createView() Q_DECL_OVERRIDE; + QWaylandView *createView() Q_DECL_OVERRIDE; void surfaceCommitted(QWaylandSurface *surface); - QWaylandSurfaceView* viewAt(const QPointF &point, QPointF *local = 0); + QWaylandView* viewAt(const QPointF &point, QPointF *local = 0); bool eventFilter(QObject *obj, QEvent *event); - QPointF toView(QWaylandSurfaceView *view, const QPointF &pos) const; + QPointF toView(QWaylandView *view, const QPointF &pos) const; void adjustCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY); @@ -103,12 +103,12 @@ private: QTimer m_renderScheduler; //Dragging windows around - QWaylandSurfaceView *m_draggingWindow; + QWaylandView *m_draggingWindow; bool m_dragKeyIsPressed; QPointF m_drag_diff; //Cursor - QWaylandSurfaceView m_cursorView; + QWaylandView m_cursorView; int m_cursorHotspotX; int m_cursorHotspotY; diff --git a/examples/wayland/server-buffer/compositor/main.cpp b/examples/wayland/server-buffer/compositor/main.cpp index 22bce42e8..287c0cfe1 100644 --- a/examples/wayland/server-buffer/compositor/main.cpp +++ b/examples/wayland/server-buffer/compositor/main.cpp @@ -41,7 +41,7 @@ #include "qwaylandquickcompositor.h" #include "qwaylandsurface.h" -#include "qwaylandsurfaceitem.h" +#include "qwaylandquickview.h" #include "qwaylandoutputspace.h" #include <QGuiApplication> @@ -108,9 +108,9 @@ public: m_view.show(); } - Q_INVOKABLE QWaylandSurfaceItem *item(QWaylandSurface *surf) + Q_INVOKABLE QWaylandQuickView *item(QWaylandSurface *surf) { - return static_cast<QWaylandSurfaceItem *>(surf->views().first()); + return static_cast<QWaylandQuickView *>(surf->views().first()); } signals: |