9495dcc881f9ed3e15eab590a20c5a5765c67489
[AGL/meta-agl-demo.git] / recipes-qt / qt5 / qtwayland / 0001-Implement-initial-IVI-shell-support-with-shell-integ.patch
1 From f41ceb82b1adb1bae15d36a426bf39ea0e75cb68 Mon Sep 17 00:00:00 2001
2 From: Nobuhiko Tanibata <ntanibata@jp.adit-jv.com>
3 Date: Thu, 5 Nov 2015 20:13:26 +0900
4 Subject: [PATCH 1/2] Implement initial IVI-shell support with shell
5  integration.
6
7 QApplication can set numeric surface ID to its surface by
8 following steps
9 -------------------------------------------------------
10 #include <QApplication>
11 #include <QQuickView>
12
13 int main(int argc, char *argv[])
14 {
15     QGuiApplication app(argc, argv);
16     QQuickView view(QUrl(QStringLiteral("qrc:/main.qml")));
17
18     view.setProperty("IVI-Surface-ID", 8000);
19     view.show();
20     return app.exec();
21 }
22 -------------------------------------------------------
23
24 If QApplication doesn't set the surface ID by itself, the ID is
25 automatically assigned by qtwayland from 8000. When the application creates
26 several surfaces, the ID is incremented like 8001,8002,,,,.
27
28 Additionally, qtwayland now supports shell integration Framework. So
29 The enviromental value QT_WAYLAND_SHELL_INTEGRATION=ivi-shell are required for
30 Qt application.
31
32 Signed-off-by: Nobuhiko Tanibata <ntanibata@jp.adit-jv.com>
33 ---
34  .gitignore                                         |   6 ++
35  src/3rdparty/protocol/ivi-application.xml          |  99 +++++++++++++++++++
36  src/client/client.pro                              |   3 +-
37  src/plugins/plugins.pro                            |   3 +-
38  .../shellintegration/ivi-shell/ivi-shell.json      |   3 +
39  .../shellintegration/ivi-shell/ivi-shell.pro       |  30 ++++++
40  src/plugins/shellintegration/ivi-shell/main.cpp    |  69 +++++++++++++
41  .../ivi-shell/qwaylandivishellintegration.cpp      | 109 +++++++++++++++++++++
42  .../ivi-shell/qwaylandivishellintegration.h        |  79 +++++++++++++++
43  .../ivi-shell/qwaylandivisurface.cpp               |  71 ++++++++++++++
44  .../ivi-shell/qwaylandivisurface_p.h               |  76 ++++++++++++++
45  src/plugins/shellintegration/shellintegration.pro  |   3 +
46  12 files changed, 549 insertions(+), 2 deletions(-)
47  create mode 100644 src/3rdparty/protocol/ivi-application.xml
48  create mode 100644 src/plugins/shellintegration/ivi-shell/ivi-shell.json
49  create mode 100644 src/plugins/shellintegration/ivi-shell/ivi-shell.pro
50  create mode 100644 src/plugins/shellintegration/ivi-shell/main.cpp
51  create mode 100644 src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp
52  create mode 100644 src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h
53  create mode 100644 src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp
54  create mode 100644 src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h
55  create mode 100644 src/plugins/shellintegration/shellintegration.pro
56
57 diff --git a/.gitignore b/.gitignore
58 index b33ca90..924afb2 100644
59 --- a/.gitignore
60 +++ b/.gitignore
61 @@ -61,6 +61,12 @@ src/plugins/hardwareintegration/*/*/qwayland*.h
62  src/plugins/hardwareintegration/*/*/*-server-protocol.h
63  src/plugins/hardwareintegration/*/*/*-client-protocol.h
64  src/plugins/hardwareintegration/*/*/*-protocol.c
65 +src/plugins/shellintegration/ivi-shell/qwayland-ivi-application.h
66 +src/plugins/shellintegration/ivi-shell/qwayland-ivi-application.cpp
67 +src/plugins/shellintegration/ivi-shell/qwayland-ivi-controller.h
68 +src/plugins/shellintegration/ivi-shell/qwayland-ivi-controller.cpp
69 +src/plugins/shellintegration/*/*-client-protocol.h
70 +src/plugins/shellintegration/*/*-protocol.c
71  tests/auto/client/tst_client
72  tests/auto/compositor/tst_compositor
73  *~
74 diff --git a/src/3rdparty/protocol/ivi-application.xml b/src/3rdparty/protocol/ivi-application.xml
75 new file mode 100644
76 index 0000000..61ec7d2
77 --- /dev/null
78 +++ b/src/3rdparty/protocol/ivi-application.xml
79 @@ -0,0 +1,99 @@
80 +<?xml version="1.0" encoding="UTF-8"?>
81 +<protocol name="ivi_application">
82 +
83 +  <copyright>
84 +    Copyright (C) 2013 DENSO CORPORATION
85 +    Copyright (c) 2013 BMW Car IT GmbH
86 +
87 +    Permission to use, copy, modify, distribute, and sell this software and
88 +    its documentation for any purpose is hereby granted without fee, provided
89 +    that the above copyright notice appear in all copies and that both that
90 +    copyright notice and this permission notice appear in supporting
91 +    documentation, and that the name of the copyright holders not be used in
92 +    advertising or publicity pertaining to distribution of the software
93 +    without specific, written prior permission.  The copyright holders make
94 +    no representations about the suitability of this software for any
95 +    purpose.  It is provided "as is" without express or implied warranty.
96 +
97 +    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
98 +    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
99 +    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
100 +    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
101 +    RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
102 +    CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
103 +    CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
104 +  </copyright>
105 +
106 +  <interface name="ivi_surface" version="1">
107 +    <description summary="application interface to surface in ivi compositor"/>
108 +
109 +    <request name="destroy" type="destructor">
110 +      <description summary="destroy ivi_surface">
111 +        This removes link from ivi_id to wl_surface and destroys ivi_surface.
112 +        The ID, ivi_id, is free and can be used for surface_create again.
113 +      </description>
114 +    </request>
115 +
116 +    <event name="configure">
117 +      <description summary="suggest resize">
118 +        The configure event asks the client to resize its surface.
119 +
120 +        The size is a hint, in the sense that the client is free to
121 +        ignore it if it doesn't resize, pick a smaller size (to
122 +        satisfy aspect ratio or resize in steps of NxM pixels).
123 +
124 +        The client is free to dismiss all but the last configure
125 +        event it received.
126 +
127 +        The width and height arguments specify the size of the window
128 +        in surface local coordinates.
129 +      </description>
130 +      <arg name="width" type="int"/>
131 +      <arg name="height" type="int"/>
132 +    </event>
133 +  </interface>
134 +
135 +  <interface name="ivi_application" version="1">
136 +    <description summary="create ivi-style surfaces">
137 +      This interface is exposed as a global singleton.
138 +      This interface is implemented by servers that provide IVI-style user interfaces.
139 +      It allows clients to associate a ivi_surface with wl_surface.
140 +    </description>
141 +
142 +    <enum name="error">
143 +      <entry name="role" value="0" summary="given wl_surface has another role"/>
144 +      <entry name="ivi_id" value="1" summary="given ivi_id is assigned to another wl_surface"/>
145 +    </enum>
146 +
147 +    <request name="surface_create">
148 +      <description summary="create ivi_surface with numeric ID in ivi compositor">
149 +        This request gives the wl_surface the role of an IVI Surface. Creating more than
150 +        one ivi_surface for a wl_surface is not allowed. Note, that this still allows the
151 +        following example:
152 +
153 +         1. create a wl_surface
154 +         2. create ivi_surface for the wl_surface
155 +         3. destroy the ivi_surface
156 +         4. create ivi_surface for the wl_surface (with the same or another ivi_id as before)
157 +
158 +        surface_create will create a interface:ivi_surface with numeric ID; ivi_id in
159 +        ivi compositor. These ivi_ids are defined as unique in the system to identify
160 +        it inside of ivi compositor. The ivi compositor implements business logic how to
161 +        set properties of the surface with ivi_id according to status of the system.
162 +        E.g. a unique ID for Car Navigation application is used for implementing special
163 +        logic of the application about where it shall be located.
164 +        The server regards following cases as protocol errors and disconnects the client.
165 +         - wl_surface already has an nother role.
166 +         - ivi_id is already assigned to an another wl_surface.
167 +
168 +        If client destroys ivi_surface or wl_surface which is assigne to the ivi_surface,
169 +        ivi_id which is assigned to the ivi_surface is free for reuse.
170 +      </description>
171 +      <arg name="ivi_id" type="uint"/>
172 +      <arg name="surface" type="object" interface="wl_surface"/>
173 +      <arg name="id" type="new_id" interface="ivi_surface"/>
174 +    </request>
175 +
176 +  </interface>
177 +
178 +</protocol>
179 diff --git a/src/client/client.pro b/src/client/client.pro
180 index 0c13a4a..ca48cce 100644
181 --- a/src/client/client.pro
182 +++ b/src/client/client.pro
183 @@ -6,7 +6,8 @@ MODULE=waylandclient
184  MODULE_PLUGIN_TYPES = \
185              wayland-graphics-integration-client \
186              wayland-inputdevice-integration \
187 -            wayland-decoration-client
188 +            wayland-decoration-client \
189 +            wayland-shell-integration
190
191  CONFIG += generated_privates
192
193 diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
194 index a1a8a5b..9b66b85 100644
195 --- a/src/plugins/plugins.pro
196 +++ b/src/plugins/plugins.pro
197 @@ -2,4 +2,5 @@ TEMPLATE=subdirs
198  SUBDIRS += \
199      platforms \
200      hardwareintegration \
201 -    decorations
202 +    decorations \
203 +    shellintegration
204 diff --git a/src/plugins/shellintegration/ivi-shell/ivi-shell.json b/src/plugins/shellintegration/ivi-shell/ivi-shell.json
205 new file mode 100644
206 index 0000000..c48528e
207 --- /dev/null
208 +++ b/src/plugins/shellintegration/ivi-shell/ivi-shell.json
209 @@ -0,0 +1,3 @@
210 +{
211 +    "Keys":[ "ivi-shell" ]
212 +}
213 diff --git a/src/plugins/shellintegration/ivi-shell/ivi-shell.pro b/src/plugins/shellintegration/ivi-shell/ivi-shell.pro
214 new file mode 100644
215 index 0000000..ac12858
216 --- /dev/null
217 +++ b/src/plugins/shellintegration/ivi-shell/ivi-shell.pro
218 @@ -0,0 +1,30 @@
219 +PLUGIN_TYPE = wayland-shell-integration
220 +load(qt_plugin)
221 +
222 +QT += waylandclient-private
223 +CONFIG += wayland-scanner
224 +
225 +!contains(QT_CONFIG, no-pkg-config) {
226 +    PKGCONFIG += wayland-client wayland-cursor
227 +    CONFIG += link_pkgconfig
228 +    contains(QT_CONFIG, glib): PKGCONFIG_PRIVATE += glib-2.0
229 +} else {
230 +    LIBS += -lwayland-client -lwayland-cursor $$QT_LIBS_GLIB
231 +}
232 +
233 +WAYLANDCLIENTSOURCES += \
234 +    ../../../3rdparty/protocol/ivi-application.xml
235 +
236 +include(../../../../include/QtWaylandClient/headers.pri)
237 +
238 +HEADERS += \
239 +    qwaylandivishellintegration.h \
240 +    qwaylandivisurface_p.h
241 +
242 +SOURCES += \
243 +    main.cpp \
244 +    qwaylandivishellintegration.cpp \
245 +    qwaylandivisurface.cpp
246 +
247 +OTHER_FILES += \
248 +    ivi-shell.json
249 diff --git a/src/plugins/shellintegration/ivi-shell/main.cpp b/src/plugins/shellintegration/ivi-shell/main.cpp
250 new file mode 100644
251 index 0000000..2382ff7
252 --- /dev/null
253 +++ b/src/plugins/shellintegration/ivi-shell/main.cpp
254 @@ -0,0 +1,69 @@
255 +/****************************************************************************
256 +**
257 +** Copyright (C) 2015 ITAGE Corporation, author: <yusuke.binsaki@itage.co.jp>
258 +** Contact: http://www.qt-project.org/legal
259 +**
260 +** This file is part of the config.tests of the Qt Toolkit.
261 +**
262 +** $QT_BEGIN_LICENSE:LGPL$
263 +** Commercial License Usage
264 +** Licensees holding valid commercial Qt licenses may use this file in
265 +** accordance with the commercial license agreement provided with the
266 +** Software or, alternatively, in accordance with the terms contained in
267 +** a written agreement between you and Digia.  For licensing terms and
268 +** conditions see http://qt.digia.com/licensing.  For further information
269 +** use the contact form at http://qt.digia.com/contact-us.
270 +**
271 +** GNU Lesser General Public License Usage
272 +** Alternatively, this file may be used under the terms of the GNU Lesser
273 +** General Public License version 2.1 as published by the Free Software
274 +** Foundation and appearing in the file LICENSE.LGPL included in the
275 +** packaging of this file.  Please review the following information to
276 +** ensure the GNU Lesser General Public License version 2.1 requirements
277 +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
278 +**
279 +** In addition, as a special exception, Digia gives you certain additional
280 +** rights.  These rights are described in the Digia Qt LGPL Exception
281 +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
282 +**
283 +** GNU General Public License Usage
284 +** Alternatively, this file may be used under the terms of the GNU
285 +** General Public License version 3.0 as published by the Free Software
286 +** Foundation and appearing in the file LICENSE.GPL included in the
287 +** packaging of this file.  Please review the following information to
288 +** ensure the GNU General Public License version 3.0 requirements will be
289 +** met: http://www.gnu.org/copyleft/gpl.html.
290 +**
291 +**
292 +** $QT_END_LICENSE$
293 +**
294 +****************************************************************************/
295 +
296 +#include <QtWaylandClient/private/qwaylandshellintegrationplugin_p.h>
297 +#include "qwaylandivishellintegration.h"
298 +
299 +QT_BEGIN_NAMESPACE
300 +
301 +namespace QtWaylandClient {
302 +
303 +class QWaylandIviShellIntegrationPlugin : public QWaylandShellIntegrationPlugin
304 +{
305 +    Q_OBJECT
306 +    Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "ivi-shell.json")
307 +
308 +public:
309 +    virtual QWaylandShellIntegration *create(const QString &key, const QStringList &paramList) Q_DECL_OVERRIDE;
310 +};
311 +
312 +QWaylandShellIntegration *QWaylandIviShellIntegrationPlugin::create(const QString &key, const QStringList &paramList)
313 +{
314 +    Q_UNUSED(key);
315 +    Q_UNUSED(paramList);
316 +    return new QWaylandIviShellIntegration();
317 +}
318 +
319 +}
320 +
321 +QT_END_NAMESPACE
322 +
323 +#include "main.moc"
324 diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp
325 new file mode 100644
326 index 0000000..763fafb
327 --- /dev/null
328 +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp
329 @@ -0,0 +1,109 @@
330 +/****************************************************************************
331 +**
332 +** Copyright (C) 2015 ITAGE Corporation, author: <yusuke.binsaki@itage.co.jp>
333 +** Contact: http://www.qt-project.org/legal
334 +**
335 +** This file is part of the config.tests of the Qt Toolkit.
336 +**
337 +** $QT_BEGIN_LICENSE:LGPL$
338 +** Commercial License Usage
339 +** Licensees holding valid commercial Qt licenses may use this file in
340 +** accordance with the commercial license agreement provided with the
341 +** Software or, alternatively, in accordance with the terms contained in
342 +** a written agreement between you and Digia.  For licensing terms and
343 +** conditions see http://qt.digia.com/licensing.  For further information
344 +** use the contact form at http://qt.digia.com/contact-us.
345 +**
346 +** GNU Lesser General Public License Usage
347 +** Alternatively, this file may be used under the terms of the GNU Lesser
348 +** General Public License version 2.1 as published by the Free Software
349 +** Foundation and appearing in the file LICENSE.LGPL included in the
350 +** packaging of this file.  Please review the following information to
351 +** ensure the GNU Lesser General Public License version 2.1 requirements
352 +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
353 +**
354 +** In addition, as a special exception, Digia gives you certain additional
355 +** rights.  These rights are described in the Digia Qt LGPL Exception
356 +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
357 +**
358 +** GNU General Public License Usage
359 +** Alternatively, this file may be used under the terms of the GNU
360 +** General Public License version 3.0 as published by the Free Software
361 +** Foundation and appearing in the file LICENSE.GPL included in the
362 +** packaging of this file.  Please review the following information to
363 +** ensure the GNU General Public License version 3.0 requirements will be
364 +** met: http://www.gnu.org/copyleft/gpl.html.
365 +**
366 +**
367 +** $QT_END_LICENSE$
368 +**
369 +****************************************************************************/
370 +
371 +#include <sys/types.h>
372 +#include <unistd.h>
373 +#include <stdint.h>
374 +#include <stdlib.h>
375 +
376 +#include <QtWaylandClient/private/qwayland-wayland.h>
377 +#include <QtWaylandClient/private/qwaylanddisplay_p.h>
378 +#include <QtWaylandClient/private/qwaylandwindow_p.h>
379 +#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
380 +#include "qwaylandivishellintegration.h"
381 +#include "qwaylandivisurface_p.h"
382 +#include "qwayland-ivi-application.h"
383 +
384 +QT_BEGIN_NAMESPACE
385 +
386 +namespace QtWaylandClient {
387 +
388 +QWaylandIviShellIntegration::QWaylandIviShellIntegration()
389 +    : m_iviApplication(Q_NULLPTR)
390 +{
391 +}
392 +
393 +QWaylandIviShellIntegration::~QWaylandIviShellIntegration()
394 +{
395 +    delete m_iviApplication;
396 +}
397 +
398 +bool QWaylandIviShellIntegration::initialize(QWaylandDisplay *display)
399 +{
400 +    display->addRegistryListener(registryIvi, this);
401 +
402 +    return true;
403 +}
404 +
405 +QWaylandShellSurface *QWaylandIviShellIntegration::createShellSurface(QWaylandWindow *window)
406 +{
407 +    const int IVI_SURFACE_ID = 8000;
408 +    if (!m_iviApplication)
409 +        return Q_NULLPTR;
410 +
411 +    uint32_t id = 0;
412 +    QVariant value = window->property("IVI-Surface-ID");
413 +    if (value.isValid()) {
414 +        id = value.toUInt();
415 +    } else {
416 +        id = IVI_SURFACE_ID + getpid();
417 +    }
418 +
419 +    struct ivi_surface *surface = m_iviApplication->surface_create(id, window->object());
420 +
421 +    return new QWaylandIviSurface(surface, window);
422 +}
423 +
424 +void QWaylandIviShellIntegration::registryIvi(void *data,
425 +                                              struct wl_registry *registry,
426 +                                              uint32_t id,
427 +                                              const QString &interface,
428 +                                              uint32_t version)
429 +{
430 +    QWaylandIviShellIntegration *shell = static_cast<QWaylandIviShellIntegration *>(data);
431 +
432 +    if (interface == QStringLiteral("ivi_application"))
433 +        shell->m_iviApplication = new QtWayland::ivi_application(registry, id, version);
434 +}
435 +
436 +}
437 +
438 +QT_END_NAMESPACE
439 diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h
440 new file mode 100644
441 index 0000000..4856ec6
442 --- /dev/null
443 +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h
444 @@ -0,0 +1,79 @@
445 +/****************************************************************************
446 +**
447 +** Copyright (C) 2015 ITAGE Corporation, author: <yusuke.binsaki@itage.co.jp>
448 +** Contact: http://www.qt-project.org/legal
449 +**
450 +** This file is part of the config.tests of the Qt Toolkit.
451 +**
452 +** $QT_BEGIN_LICENSE:LGPL$
453 +** Commercial License Usage
454 +** Licensees holding valid commercial Qt licenses may use this file in
455 +** accordance with the commercial license agreement provided with the
456 +** Software or, alternatively, in accordance with the terms contained in
457 +** a written agreement between you and Digia.  For licensing terms and
458 +** conditions see http://qt.digia.com/licensing.  For further information
459 +** use the contact form at http://qt.digia.com/contact-us.
460 +**
461 +** GNU Lesser General Public License Usage
462 +** Alternatively, this file may be used under the terms of the GNU Lesser
463 +** General Public License version 2.1 as published by the Free Software
464 +** Foundation and appearing in the file LICENSE.LGPL included in the
465 +** packaging of this file.  Please review the following information to
466 +** ensure the GNU Lesser General Public License version 2.1 requirements
467 +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
468 +**
469 +** In addition, as a special exception, Digia gives you certain additional
470 +** rights.  These rights are described in the Digia Qt LGPL Exception
471 +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
472 +**
473 +** GNU General Public License Usage
474 +** Alternatively, this file may be used under the terms of the GNU
475 +** General Public License version 3.0 as published by the Free Software
476 +** Foundation and appearing in the file LICENSE.GPL included in the
477 +** packaging of this file.  Please review the following information to
478 +** ensure the GNU General Public License version 3.0 requirements will be
479 +** met: http://www.gnu.org/copyleft/gpl.html.
480 +**
481 +**
482 +** $QT_END_LICENSE$
483 +**
484 +****************************************************************************/
485 +
486 +#ifndef QWAYLANDIVIINTEGRATION_H
487 +#define QWAYLANDIVIINTEGRATION_H
488 +
489 +#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
490 +
491 +QT_BEGIN_NAMESPACE
492 +
493 +namespace QtWayland {
494 +    struct wl_registry;
495 +    class ivi_application;
496 +}
497 +
498 +namespace QtWaylandClient {
499 +
500 +class QWaylandWindow;
501 +class QWaylandDisplay;
502 +
503 +class Q_WAYLAND_CLIENT_EXPORT QWaylandIviShellIntegration : public QWaylandShellIntegration
504 +{
505 +public:
506 +    QWaylandIviShellIntegration();
507 +    ~QWaylandIviShellIntegration();
508 +    bool initialize(QWaylandDisplay *display);
509 +    QWaylandShellSurface *createShellSurface(QWaylandWindow *window);
510 +
511 +private:
512 +    static void registryIvi(void *data, struct wl_registry *registry
513 +                            , uint32_t id, const QString &interface, uint32_t version);
514 +
515 +private:
516 +    QtWayland::ivi_application *m_iviApplication;
517 +};
518 +
519 +}
520 +
521 +QT_END_NAMESPACE
522 +
523 +#endif //  QWAYLANDIVIINTEGRATION_H
524 diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp
525 new file mode 100644
526 index 0000000..3ce3b4e
527 --- /dev/null
528 +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp
529 @@ -0,0 +1,71 @@
530 +/****************************************************************************
531 +**
532 +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
533 +** Contact: http://www.qt-project.org/legal
534 +**
535 +** This file is part of the config.tests of the Qt Toolkit.
536 +**
537 +** $QT_BEGIN_LICENSE:LGPL$
538 +** Commercial License Usage
539 +** Licensees holding valid commercial Qt licenses may use this file in
540 +** accordance with the commercial license agreement provided with the
541 +** Software or, alternatively, in accordance with the terms contained in
542 +** a written agreement between you and Digia.  For licensing terms and
543 +** conditions see http://qt.digia.com/licensing.  For further information
544 +** use the contact form at http://qt.digia.com/contact-us.
545 +**
546 +** GNU Lesser General Public License Usage
547 +** Alternatively, this file may be used under the terms of the GNU Lesser
548 +** General Public License version 2.1 as published by the Free Software
549 +** Foundation and appearing in the file LICENSE.LGPL included in the
550 +** packaging of this file.  Please review the following information to
551 +** ensure the GNU Lesser General Public License version 2.1 requirements
552 +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
553 +**
554 +** In addition, as a special exception, Digia gives you certain additional
555 +** rights.  These rights are described in the Digia Qt LGPL Exception
556 +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
557 +**
558 +** GNU General Public License Usage
559 +** Alternatively, this file may be used under the terms of the GNU
560 +** General Public License version 3.0 as published by the Free Software
561 +** Foundation and appearing in the file LICENSE.GPL included in the
562 +** packaging of this file.  Please review the following information to
563 +** ensure the GNU General Public License version 3.0 requirements will be
564 +** met: http://www.gnu.org/copyleft/gpl.html.
565 +**
566 +**
567 +** $QT_END_LICENSE$
568 +**
569 +****************************************************************************/
570 +
571 +#include <QtWaylandClient/private/qwaylanddisplay_p.h>
572 +#include <QtWaylandClient/private/qwaylandwindow_p.h>
573 +#include <QtWaylandClient/private/qwaylandinputdevice_p.h>
574 +#include <QtWaylandClient/private/qwaylandscreen_p.h>
575 +#include "qwaylandivisurface_p.h"
576 +
577 +QT_BEGIN_NAMESPACE
578 +
579 +namespace QtWaylandClient {
580 +
581 +QWaylandIviSurface::QWaylandIviSurface(struct ::ivi_surface *ivi_surface, QWaylandWindow *window)
582 +    : QtWayland::ivi_surface(ivi_surface)
583 +    , QWaylandShellSurface(window)
584 +    , m_window(window)
585 +{
586 +}
587 +
588 +QWaylandIviSurface::~QWaylandIviSurface()
589 +{
590 +    ivi_surface::destroy();
591 +}
592 +
593 +void QWaylandIviSurface::ivi_surface_configure(int32_t width, int32_t height)
594 +{
595 +    this->m_window->configure(0, width, height);
596 +}
597 +
598 +}
599 +
600 +QT_END_NAMESPACE
601 diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h
602 new file mode 100644
603 index 0000000..d8331c5
604 --- /dev/null
605 +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h
606 @@ -0,0 +1,76 @@
607 +/****************************************************************************
608 +**
609 +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
610 +** Contact: http://www.qt-project.org/legal
611 +**
612 +** This file is part of the config.tests of the Qt Toolkit.
613 +**
614 +** $QT_BEGIN_LICENSE:LGPL$
615 +** Commercial License Usage
616 +** Licensees holding valid commercial Qt licenses may use this file in
617 +** accordance with the commercial license agreement provided with the
618 +** Software or, alternatively, in accordance with the terms contained in
619 +** a written agreement between you and Digia.  For licensing terms and
620 +** conditions see http://qt.digia.com/licensing.  For further information
621 +** use the contact form at http://qt.digia.com/contact-us.
622 +**
623 +** GNU Lesser General Public License Usage
624 +** Alternatively, this file may be used under the terms of the GNU Lesser
625 +** General Public License version 2.1 as published by the Free Software
626 +** Foundation and appearing in the file LICENSE.LGPL included in the
627 +** packaging of this file.  Please review the following information to
628 +** ensure the GNU Lesser General Public License version 2.1 requirements
629 +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
630 +**
631 +** In addition, as a special exception, Digia gives you certain additional
632 +** rights.  These rights are described in the Digia Qt LGPL Exception
633 +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
634 +**
635 +** GNU General Public License Usage
636 +** Alternatively, this file may be used under the terms of the GNU
637 +** General Public License version 3.0 as published by the Free Software
638 +** Foundation and appearing in the file LICENSE.GPL included in the
639 +** packaging of this file.  Please review the following information to
640 +** ensure the GNU General Public License version 3.0 requirements will be
641 +** met: http://www.gnu.org/copyleft/gpl.html.
642 +**
643 +**
644 +** $QT_END_LICENSE$
645 +**
646 +****************************************************************************/
647 +
648 +#ifndef QWAYLANDIVISURFACE_H
649 +#define QWAYLANDIVISURFACE_H
650 +
651 +#include <wayland-client.h>
652 +
653 +#include <QtWaylandClient/private/qwaylandclientexport_p.h>
654 +#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
655 +#include "qwayland-ivi-application.h"
656 +
657 +QT_BEGIN_NAMESPACE
658 +
659 +namespace QtWaylandClient {
660 +
661 +class QWaylandWindow;
662 +
663 +class Q_WAYLAND_CLIENT_EXPORT QWaylandIviSurface : public QtWayland::ivi_surface
664 +        , public QWaylandShellSurface
665 +{
666 +public:
667 +    QWaylandIviSurface(struct ::ivi_surface *shell_surface, QWaylandWindow *window);
668 +    virtual ~QWaylandIviSurface();
669 +
670 +private:
671 +    virtual void ivi_surface_configure(int32_t width, int32_t height);
672 +
673 +    QWaylandWindow *m_window;
674 +
675 +    friend class QWaylandWindow;
676 +};
677 +
678 +}
679 +
680 +QT_END_NAMESPACE
681 +
682 +#endif // QWAYLANDIVISURFACE_H
683 diff --git a/src/plugins/shellintegration/shellintegration.pro b/src/plugins/shellintegration/shellintegration.pro
684 new file mode 100644
685 index 0000000..7abd6cc
686 --- /dev/null
687 +++ b/src/plugins/shellintegration/shellintegration.pro
688 @@ -0,0 +1,3 @@
689 +TEMPLATE=subdirs
690 +
691 +SUBDIRS += ivi-shell
692 --
693 1.8.3.1