Change copyrights from Nokia to Digia
[profile/ivi/qtwayland.git] / tests / auto / client / mockshell.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the test suite of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.  For licensing terms and
14 ** conditions see http://qt.digia.com/licensing.  For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights.  These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file.  Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "mockcompositor.h"
43
44 namespace Impl {
45
46 void shell_surface_pong(wl_client *client,
47                         wl_resource *surface_resource,
48                         uint32_t serial)
49 {
50     Q_UNUSED(client);
51     Q_UNUSED(surface_resource);
52     Q_UNUSED(serial);
53 }
54
55 void shell_surface_move(wl_client *client,
56                         wl_resource *surface_resource,
57                         wl_resource *input_device_resource,
58                         uint32_t time)
59 {
60     Q_UNUSED(client);
61     Q_UNUSED(surface_resource);
62     Q_UNUSED(input_device_resource);
63     Q_UNUSED(time);
64 }
65
66 void shell_surface_resize(wl_client *client,
67                           wl_resource *surface_resource,
68                           wl_resource *input_device_resource,
69                           uint32_t time,
70                           uint32_t edges)
71 {
72     Q_UNUSED(client);
73     Q_UNUSED(surface_resource);
74     Q_UNUSED(input_device_resource);
75     Q_UNUSED(time);
76     Q_UNUSED(edges);
77
78 }
79
80 void shell_surface_set_toplevel(wl_client *client,
81                                 wl_resource *surface_resource)
82 {
83     Q_UNUSED(client);
84     Q_UNUSED(surface_resource);
85 }
86
87 void shell_surface_set_transient(wl_client *client,
88                                  wl_resource *surface_resource,
89                                  wl_resource *parent_surface_resource,
90                                  int x,
91                                  int y,
92                                  uint32_t flags)
93 {
94
95     Q_UNUSED(client);
96     Q_UNUSED(surface_resource);
97     Q_UNUSED(parent_surface_resource);
98     Q_UNUSED(x);
99     Q_UNUSED(y);
100     Q_UNUSED(flags);
101 }
102
103 void shell_surface_set_fullscreen(wl_client *client,
104                                   wl_resource *surface_resource,
105                                   uint32_t method,
106                                   uint32_t framerate,
107                                   wl_resource *output)
108 {
109     Q_UNUSED(client);
110     Q_UNUSED(surface_resource);
111     Q_UNUSED(method);
112     Q_UNUSED(framerate);
113     Q_UNUSED(output);
114 }
115
116 void shell_surface_set_popup(wl_client *client, wl_resource *resource,
117                              wl_resource *input_device, uint32_t time,
118                              wl_resource *parent,
119                              int32_t x, int32_t y,
120                              uint32_t flags)
121 {
122     Q_UNUSED(client);
123     Q_UNUSED(resource);
124     Q_UNUSED(input_device);
125     Q_UNUSED(time);
126     Q_UNUSED(parent);
127     Q_UNUSED(x);
128     Q_UNUSED(y);
129     Q_UNUSED(flags);
130 }
131
132 void shell_surface_set_maximized(wl_client *client,
133                                  wl_resource *surface_resource,
134                                  wl_resource *output)
135 {
136     Q_UNUSED(client);
137     Q_UNUSED(surface_resource);
138     Q_UNUSED(output);
139 }
140
141 void shell_surface_set_title(wl_client *client,
142                              wl_resource *surface_resource,
143                              const char *title)
144 {
145     Q_UNUSED(client);
146     Q_UNUSED(surface_resource);
147     Q_UNUSED(title);
148 }
149
150 void shell_surface_set_class(wl_client *client,
151                              wl_resource *surface_resource,
152                              const char *class_)
153 {
154     Q_UNUSED(client);
155     Q_UNUSED(surface_resource);
156     Q_UNUSED(class_);
157 }
158
159 static void get_shell_surface(wl_client *client, wl_resource *compositorResource, uint32_t id, wl_resource *surfaceResource)
160 {
161     static const struct wl_shell_surface_interface shellSurfaceInterface = {
162         shell_surface_pong,
163         shell_surface_move,
164         shell_surface_resize,
165         shell_surface_set_toplevel,
166         shell_surface_set_transient,
167         shell_surface_set_fullscreen,
168         shell_surface_set_popup,
169         shell_surface_set_maximized,
170         shell_surface_set_title,
171         shell_surface_set_class
172     };
173
174     Q_UNUSED(compositorResource);
175     wl_client_add_object(client, &wl_shell_surface_interface, &shellSurfaceInterface, id, surfaceResource->data);
176 }
177
178 void Compositor::bindShell(wl_client *client, void *compositorData, uint32_t version, uint32_t id)
179 {
180     static const struct wl_shell_interface shellInterface = {
181         get_shell_surface
182     };
183
184     Q_UNUSED(version);
185     wl_client_add_object(client, &wl_shell_interface, &shellInterface, id, compositorData);
186 }
187
188 }
189