diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-11-29 10:17:11 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-11-30 12:47:45 +0100 |
commit | 08ca0af849dda235d3bf3e615711cdac6371a4d6 (patch) | |
tree | b5755d8a4a3fba4e233ab048b485801f5a8e20b8 /src/plugins/platforms/wayland/windowmanager_integration | |
parent | 17c76f2e8df43cf40e629bdde170ce2392e5be92 (diff) |
update window mamager protocol
Change-Id: I29e70f26dbdf71e54c69b2e49342fa51928945d9
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/plugins/platforms/wayland/windowmanager_integration')
4 files changed, 105 insertions, 100 deletions
diff --git a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp index 14074ab0b..9b34df45d 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp +++ b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp @@ -116,7 +116,8 @@ void QWaylandWindowManagerIntegration::wlHandleListenerGlobal(wl_display *displa Q_UNUSED(version); if (strcmp(interface, "wl_windowmanager") == 0) { QWaylandWindowManagerIntegration *integration = static_cast<QWaylandWindowManagerIntegration *>(data); - integration->d_ptr->m_waylandWindowManager = wl_windowmanager_create(display, id, 1); + integration->d_ptr->m_waylandWindowManager = + static_cast<struct wl_windowmanager *>(wl_display_bind(display, id, &wl_windowmanager_interface)); wl_windowmanager *windowManager = integration->d_ptr->m_waylandWindowManager; wl_windowmanager_add_listener(windowManager, &m_windowManagerListener, integration); } diff --git a/src/plugins/platforms/wayland/windowmanager_integration/wayland-windowmanager-client-protocol.h b/src/plugins/platforms/wayland/windowmanager_integration/wayland-windowmanager-client-protocol.h index a8d01c50f..fbecd6366 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/wayland-windowmanager-client-protocol.h +++ b/src/plugins/platforms/wayland/windowmanager_integration/wayland-windowmanager-client-protocol.h @@ -1,43 +1,41 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +/* + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * Contact: Nokia Corporation (qt-info@nokia.com) + * + * This file is part of the plugins of the Qt Toolkit. + * + * $QT_BEGIN_LICENSE:LGPL$ + * GNU Lesser General Public License Usage + * This file may be used under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation and + * appearing in the file LICENSE.LGPL included in the packaging of this + * file. Please review the following information to ensure the GNU Lesser + * General Public License version 2.1 requirements will be met: + * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * + * In addition, as a special exception, Nokia gives you certain additional + * rights. These rights are described in the Nokia Qt LGPL Exception + * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. + * + * GNU General Public License Usage + * Alternatively, this file may be used under the terms of the GNU General + * Public License version 3.0 as published by the Free Software Foundation + * and appearing in the file LICENSE.GPL included in the packaging of this + * file. Please review the following information to ensure the GNU General + * Public License version 3.0 requirements will be met: + * http://www.gnu.org/copyleft/gpl.html. + * + * Other Usage + * Alternatively, this file may be used in accordance with the terms and + * conditions contained in a signed written agreement between you and Nokia. + * + * + * + * + * + * $QT_END_LICENSE$ + */ #ifndef WAYLAND_WINDOWMANAGER_CLIENT_PROTOCOL_H #define WAYLAND_WINDOWMANAGER_CLIENT_PROTOCOL_H @@ -51,6 +49,7 @@ extern "C" { #include "wayland-util.h" struct wl_client; +struct wl_resource; struct wl_windowmanager; @@ -59,11 +58,11 @@ extern const struct wl_interface wl_windowmanager_interface; struct wl_windowmanager_listener { void (*client_onscreen_visibility)(void *data, struct wl_windowmanager *wl_windowmanager, - int visible); + int32_t visible); void (*set_screen_rotation)(void *data, struct wl_windowmanager *wl_windowmanager, struct wl_output *output, - int rotation); + int32_t rotation); void (*set_generic_property)(void *data, struct wl_windowmanager *wl_windowmanager, struct wl_surface *surface, @@ -73,7 +72,7 @@ struct wl_windowmanager_listener { static inline int wl_windowmanager_add_listener(struct wl_windowmanager *wl_windowmanager, - const struct wl_windowmanager_listener *listener, void *data) + const struct wl_windowmanager_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_windowmanager, (void (**)(void)) listener, data); @@ -83,15 +82,6 @@ wl_windowmanager_add_listener(struct wl_windowmanager *wl_windowmanager, #define WL_WINDOWMANAGER_AUTHENTICATE_WITH_TOKEN 1 #define WL_WINDOWMANAGER_UPDATE_GENERIC_PROPERTY 2 -static inline struct wl_windowmanager * -wl_windowmanager_create(struct wl_display *display, uint32_t id, uint32_t version) -{ - wl_display_bind(display, id, "wl_windowmanager", version); - - return (struct wl_windowmanager *) - wl_proxy_create_for_id(display, &wl_windowmanager_interface, id); -} - static inline void wl_windowmanager_set_user_data(struct wl_windowmanager *wl_windowmanager, void *user_data) { diff --git a/src/plugins/platforms/wayland/windowmanager_integration/wayland-windowmanager-protocol.c b/src/plugins/platforms/wayland/windowmanager_integration/wayland-windowmanager-protocol.c index 3e1f36b3d..7e8861b67 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/wayland-windowmanager-protocol.c +++ b/src/plugins/platforms/wayland/windowmanager_integration/wayland-windowmanager-protocol.c @@ -1,58 +1,72 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +/* + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * Contact: Nokia Corporation (qt-info@nokia.com) + * + * This file is part of the plugins of the Qt Toolkit. + * + * $QT_BEGIN_LICENSE:LGPL$ + * GNU Lesser General Public License Usage + * This file may be used under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation and + * appearing in the file LICENSE.LGPL included in the packaging of this + * file. Please review the following information to ensure the GNU Lesser + * General Public License version 2.1 requirements will be met: + * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * + * In addition, as a special exception, Nokia gives you certain additional + * rights. These rights are described in the Nokia Qt LGPL Exception + * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. + * + * GNU General Public License Usage + * Alternatively, this file may be used under the terms of the GNU General + * Public License version 3.0 as published by the Free Software Foundation + * and appearing in the file LICENSE.GPL included in the packaging of this + * file. Please review the following information to ensure the GNU General + * Public License version 3.0 requirements will be met: + * http://www.gnu.org/copyleft/gpl.html. + * + * Other Usage + * Alternatively, this file may be used in accordance with the terms and + * conditions contained in a signed written agreement between you and Nokia. + * + * + * + * + * + * $QT_END_LICENSE$ + */ #include <stdlib.h> #include <stdint.h> #include "wayland-util.h" +extern const struct wl_interface wl_surface_interface; +extern const struct wl_interface wl_output_interface; +extern const struct wl_interface wl_surface_interface; + +static const struct wl_interface *types[] = { + NULL, + &wl_surface_interface, + NULL, + NULL, + &wl_output_interface, + NULL, + &wl_surface_interface, + NULL, + NULL, +}; + static const struct wl_message wl_windowmanager_requests[] = { - { "map_client_to_process", "u", NULL }, - { "authenticate_with_token", "s", NULL }, - { "update_generic_property", "osa", NULL }, + { "map_client_to_process", "u", types + 0 }, + { "authenticate_with_token", "s", types + 0 }, + { "update_generic_property", "osa", types + 1 }, }; static const struct wl_message wl_windowmanager_events[] = { - { "client_onscreen_visibility", "i", NULL }, - { "set_screen_rotation", "oi", NULL }, - { "set_generic_property", "osa", NULL }, + { "client_onscreen_visibility", "i", types + 0 }, + { "set_screen_rotation", "oi", types + 4 }, + { "set_generic_property", "osa", types + 6 }, }; WL_EXPORT const struct wl_interface wl_windowmanager_interface = { diff --git a/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri b/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri index 9f40bfecd..45118b5d5 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri +++ b/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri @@ -1,4 +1,4 @@ -#DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT +DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT contains(DEFINES, QT_WAYLAND_WINDOWMANAGER_SUPPORT) { |