| 1 | // Copyright (C) 2017 ITAGE Corporation, author: <yusuke.binsaki@itage.co.jp> |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #include "qwaylandivisurface_p.h" |
| 5 | |
| 6 | #include <QtWaylandClient/private/qwaylanddisplay_p.h> |
| 7 | #include <QtWaylandClient/private/qwaylandwindow_p.h> |
| 8 | #include <QtWaylandClient/private/qwaylandscreen_p.h> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | namespace QtWaylandClient { |
| 13 | |
| 14 | QWaylandIviSurface::QWaylandIviSurface(struct ::ivi_surface *ivi_surface, QWaylandWindow *window) |
| 15 | : QtWayland::ivi_surface(ivi_surface) |
| 16 | , QWaylandShellSurface(window) |
| 17 | , m_window(window) |
| 18 | { |
| 19 | } |
| 20 | |
| 21 | QWaylandIviSurface::QWaylandIviSurface(struct ::ivi_surface *ivi_surface, QWaylandWindow *window, |
| 22 | struct ::ivi_controller_surface *iviControllerSurface) |
| 23 | : QtWayland::ivi_surface(ivi_surface) |
| 24 | , QWaylandShellSurface(window) |
| 25 | , QtWayland::ivi_controller_surface(iviControllerSurface) |
| 26 | , m_window(window) |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | QWaylandIviSurface::~QWaylandIviSurface() |
| 31 | { |
| 32 | ivi_surface::destroy(); |
| 33 | if (QtWayland::ivi_controller_surface::object()) |
| 34 | QtWayland::ivi_controller_surface::destroy(0); |
| 35 | } |
| 36 | |
| 37 | void QWaylandIviSurface::applyConfigure() |
| 38 | { |
| 39 | m_window->resizeFromApplyConfigure(sizeWithMargins: m_pendingSize); |
| 40 | } |
| 41 | |
| 42 | void QWaylandIviSurface::ivi_surface_configure(int32_t width, int32_t height) |
| 43 | { |
| 44 | m_pendingSize = {width, height}; |
| 45 | m_window->applyConfigureWhenPossible(); |
| 46 | } |
| 47 | |
| 48 | void QWaylandIviSurface::ivi_controller_surface_visibility(int32_t visibility) |
| 49 | { |
| 50 | this->m_window->window()->setVisible(visibility != 0); |
| 51 | } |
| 52 | |
| 53 | } |
| 54 | |
| 55 | QT_END_NAMESPACE |
| 56 | |