summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared/mockxdgshellv6.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/client/shared/mockxdgshellv6.cpp')
-rw-r--r--tests/auto/client/shared/mockxdgshellv6.cpp59
1 files changed, 7 insertions, 52 deletions
diff --git a/tests/auto/client/shared/mockxdgshellv6.cpp b/tests/auto/client/shared/mockxdgshellv6.cpp
index b26ac1c8d..f909fa108 100644
--- a/tests/auto/client/shared/mockxdgshellv6.cpp
+++ b/tests/auto/client/shared/mockxdgshellv6.cpp
@@ -26,11 +26,9 @@
**
****************************************************************************/
-#include "mockcompositor.h"
+#include "mockxdgshellv6.h"
#include "mocksurface.h"
-#include <qwayland-server-xdg-shell-unstable-v6.h>
-
namespace Impl {
class XdgSurfaceV6;
@@ -50,7 +48,7 @@ public:
class XdgSurfaceV6 : public QtWaylandServer::zxdg_surface_v6
{
public:
- XdgSurfaceV6(wl_client *client, uint32_t id, int version, Surface *surface);
+ XdgSurfaceV6(wl_client *client, uint32_t id, Surface *surface);
void zxdg_surface_v6_destroy_resource(Resource *) override { delete this; }
void zxdg_surface_v6_get_toplevel(Resource *resource, uint32_t id) override;
void zxdg_surface_v6_destroy(Resource *resource) override
@@ -68,8 +66,8 @@ void XdgToplevelV6::zxdg_toplevel_v6_destroy(QtWaylandServer::zxdg_toplevel_v6::
wl_resource_destroy(resource->handle);
}
-XdgSurfaceV6::XdgSurfaceV6(wl_client *client, uint32_t id, int version, Surface *surface)
- : QtWaylandServer::zxdg_surface_v6(client, id, version)
+XdgSurfaceV6::XdgSurfaceV6(wl_client *client, uint32_t id, Surface *surface)
+ : QtWaylandServer::zxdg_surface_v6(client, id, 1)
, m_surface(surface)
{
}
@@ -81,52 +79,9 @@ void XdgSurfaceV6::zxdg_surface_v6_get_toplevel(QtWaylandServer::zxdg_surface_v6
m_surface->map();
}
-
-void shell_destroy(struct wl_client *client,
- struct wl_resource *resource)
-{
- Q_UNUSED(client);
- Q_UNUSED(resource);
-}
-
-void create_positioner(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t id)
-{
- Q_UNUSED(client);
- Q_UNUSED(resource);
- Q_UNUSED(id);
-}
-
-void get_xdg_surface(struct wl_client *client,
- struct wl_resource *compositorResource,
- uint32_t id,
- struct wl_resource *surfaceResource)
+void Impl::XdgShellV6::zxdg_shell_v6_get_xdg_surface(QtWaylandServer::zxdg_shell_v6::Resource *resource, uint32_t id, wl_resource *surface)
{
- int version = wl_resource_get_version(compositorResource);
- new XdgSurfaceV6(client, id, version, Surface::fromResource(surfaceResource));
+ new XdgSurfaceV6(resource->client(), id, Surface::fromResource(surface));
}
-void pong(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t serial)
-{
- Q_UNUSED(client);
- Q_UNUSED(resource);
- Q_UNUSED(serial);
-}
-
-void Compositor::bindXdgShellV6(wl_client *client, void *compositorData, uint32_t version, uint32_t id)
-{
- static const struct zxdg_shell_v6_interface shellInterface = {
- shell_destroy,
- create_positioner,
- get_xdg_surface,
- pong
- };
-
- wl_resource *resource = wl_resource_create(client, &zxdg_shell_v6_interface, static_cast<int>(version), id);
- wl_resource_set_implementation(resource, &shellInterface, compositorData, nullptr);
-}
-
-}
+} // namespace Impl