2
* Copyright (C) 2016 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#include "windowcontroller.h"
19
#include "windowmanagementpolicy.h"
20
#include "mirqtconversion.h"
22
using namespace qtmir;
25
WindowController::WindowController()
30
void WindowController::focus(const miral::Window &window)
33
m_policy->focus(window);
37
void WindowController::resize(const miral::Window &window, const QSize &size)
40
m_policy->resize(window, toMirSize(size));
44
void WindowController::move(const miral::Window &window, const QPoint &topLeft)
47
m_policy->move(window, toMirPoint(topLeft));
51
void WindowController::requestClose(const miral::Window &window)
54
m_policy->ask_client_to_close(window);
58
void WindowController::setActiveFocus(const miral::Window &/*window*/, const bool /*activeFocus*/)
63
void WindowController::setState(const miral::Window &/*window*/, const MirSurfaceState /*state*/)
68
void WindowController::deliverKeyboardEvent(const miral::Window &window, const MirKeyboardEvent *event)
71
m_policy->deliver_keyboard_event(event, window);
75
void WindowController::deliverTouchEvent(const miral::Window &window, const MirTouchEvent *event)
78
m_policy->deliver_touch_event(event, window);
82
void WindowController::deliverPointerEvent(const miral::Window &window, const MirPointerEvent *event)
85
m_policy->deliver_pointer_event(event, window);
89
void WindowController::setPolicy(WindowManagementPolicy * const policy)