1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the Qt Compositor.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
42 #ifndef WAYLANDWINDOWMANAGERINTEGRATION_H
43 #define WAYLANDWINDOWMANAGERINTEGRATION_H
45 #include <qwindowdefs.h>
47 #include "wayland_wrapper/wldisplay.h"
55 class WindowManagerObject;
56 class WaylandManagedClient;
58 class WindowManagerServerIntegration : public QObject
62 WindowManagerServerIntegration(QObject *parent = 0);
63 static WindowManagerServerIntegration *instance();
64 void initialize(Wayland::Display *waylandDisplay);
65 void removeClient(wl_client *client);
67 WaylandManagedClient *managedClient(wl_client *client) const;
69 void changeScreenVisibility(wl_client *client, int visible);
70 void setScreenOrientation(wl_client *client, qint32 orientationInDegrees);
71 void updateOrientation(wl_client *client);
74 void mapClientToProcess(wl_client *client, uint32_t processId);
75 void authenticateWithToken(wl_client *client, const char *token);
78 QMap<wl_client*, WaylandManagedClient*> m_managedClients;
79 static WindowManagerServerIntegration *m_instance;
81 WindowManagerObject *m_windowManagerObject;
82 qint32 m_orientationInDegrees;
84 friend class WindowManagerObject;
87 class WaylandManagedClient
90 WaylandManagedClient();
91 qint64 processId() const;
92 QByteArray authenticationToken() const;
93 bool isVisibleOnScreen() const { return m_isVisibleOnScreen; }
94 qint32 orientation() const;
98 QByteArray m_authenticationToken;
99 bool m_isVisibleOnScreen;
101 friend class WindowManagerServerIntegration;
104 #endif // WAYLANDWINDOWMANAGERINTEGRATION_H