2 * Copyright 2014-2016 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU 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/>.
18 import Ubuntu.Components 1.3
19 import Ubuntu.Gestures 0.1 // For TouchGate
20 import Utils 0.1 // for InputWatcher
21 import Unity.Application 0.1 // for MirSurfaceItem
25 objectName: "surfaceContainer"
26 implicitWidth: surfaceItem.implicitWidth
27 implicitHeight: surfaceItem.implicitHeight
29 // Must be set from outside
30 property var surface: null
32 // Might be changed from outside
33 property int requestedWidth: -1
34 property int requestedHeight: -1
35 property bool interactive
36 property int surfaceOrientationAngle: 0
37 property bool isPromptSurface: false
38 // FIME - dont export, use interactive property. Need to fix qtmir to handle consumesInputChanged
39 // to update surface activeFocus. See mock MirSurfaceItem.
40 property alias consumesInput: surfaceItem.consumesInput
43 // Not a binding because animations might remove the surface from the surfaceItem
44 // programatically (in order to signal that a zombie surface is free for deletion),
45 // even though root.surface is still !null.
46 surfaceItem.surface = surface;
51 onTargetPressedChanged: {
52 if (targetPressed && root.interactive) {
54 root.forceActiveFocus();
61 objectName: "surfaceItem"
66 fillMode: MirSurfaceItem.PadOrCrop
69 surfaceWidth: root.requestedWidth
70 surfaceHeight: root.requestedHeight
72 enabled: root.interactive
73 antialiasing: !root.interactive
74 orientationAngle: root.surfaceOrientationAngle
78 targetItem: surfaceItem
80 enabled: surfaceItem.enabled
85 objectName: "animationsLoader"
88 if (root.isPromptSurface) {
89 return "PromptSurfaceAnimations.qml";
91 // Let ApplicationWindow do the animations
96 target: animationsLoader.item
97 when: animationsLoader.item
98 property: "surfaceItem"
102 target: animationsLoader.item
103 when: animationsLoader.item
104 property: "container"