1 /* Generated by wayland-scanner 1.11.0 */
3 #ifndef IVI_APPLICATION_CLIENT_PROTOCOL_H
4 #define IVI_APPLICATION_CLIENT_PROTOCOL_H
8 #include "wayland-client.h"
15 * @page page_ivi_application The ivi_application protocol
16 * @section page_ifaces_ivi_application Interfaces
17 * - @subpage page_iface_ivi_surface - application interface to surface in ivi compositor
18 * - @subpage page_iface_ivi_application - create ivi-style surfaces
19 * @section page_copyright_ivi_application Copyright
22 * Copyright (C) 2013 DENSO CORPORATION
23 * Copyright (c) 2013 BMW Car IT GmbH
25 * Permission is hereby granted, free of charge, to any person obtaining a
26 * copy of this software and associated documentation files (the "Software"),
27 * to deal in the Software without restriction, including without limitation
28 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
29 * and/or sell copies of the Software, and to permit persons to whom the
30 * Software is furnished to do so, subject to the following conditions:
32 * The above copyright notice and this permission notice (including the next
33 * paragraph) shall be included in all copies or substantial portions of the
36 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
39 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
42 * DEALINGS IN THE SOFTWARE.
45 struct ivi_application;
50 * @page page_iface_ivi_surface ivi_surface
51 * @section page_iface_ivi_surface_desc Description
52 * @section page_iface_ivi_surface_api API
53 * See @ref iface_ivi_surface.
56 * @defgroup iface_ivi_surface The ivi_surface interface
58 extern const struct wl_interface ivi_surface_interface;
60 * @page page_iface_ivi_application ivi_application
61 * @section page_iface_ivi_application_desc Description
63 * This interface is exposed as a global singleton.
64 * This interface is implemented by servers that provide IVI-style user interfaces.
65 * It allows clients to associate a ivi_surface with wl_surface.
66 * @section page_iface_ivi_application_api API
67 * See @ref iface_ivi_application.
70 * @defgroup iface_ivi_application The ivi_application interface
72 * This interface is exposed as a global singleton.
73 * This interface is implemented by servers that provide IVI-style user interfaces.
74 * It allows clients to associate a ivi_surface with wl_surface.
76 extern const struct wl_interface ivi_application_interface;
79 * @ingroup iface_ivi_surface
80 * @struct ivi_surface_listener
82 struct ivi_surface_listener {
86 * The configure event asks the client to resize its surface.
88 * The size is a hint, in the sense that the client is free to
89 * ignore it if it doesn't resize, pick a smaller size (to satisfy
90 * aspect ratio or resize in steps of NxM pixels).
92 * The client is free to dismiss all but the last configure event
95 * The width and height arguments specify the size of the window in
96 * surface-local coordinates.
98 void (*configure)(void *data,
99 struct ivi_surface *ivi_surface,
105 * @ingroup ivi_surface_iface
108 ivi_surface_add_listener(struct ivi_surface *ivi_surface,
109 const struct ivi_surface_listener *listener, void *data)
111 return wl_proxy_add_listener((struct wl_proxy *) ivi_surface,
112 (void (**)(void)) listener, data);
115 #define IVI_SURFACE_DESTROY 0
118 * @ingroup iface_ivi_surface
120 #define IVI_SURFACE_DESTROY_SINCE_VERSION 1
122 /** @ingroup iface_ivi_surface */
124 ivi_surface_set_user_data(struct ivi_surface *ivi_surface, void *user_data)
126 wl_proxy_set_user_data((struct wl_proxy *) ivi_surface, user_data);
129 /** @ingroup iface_ivi_surface */
131 ivi_surface_get_user_data(struct ivi_surface *ivi_surface)
133 return wl_proxy_get_user_data((struct wl_proxy *) ivi_surface);
136 static inline uint32_t
137 ivi_surface_get_version(struct ivi_surface *ivi_surface)
139 return wl_proxy_get_version((struct wl_proxy *) ivi_surface);
143 * @ingroup iface_ivi_surface
145 * This removes link from ivi_id to wl_surface and destroys ivi_surface.
146 * The ID, ivi_id, is free and can be used for surface_create again.
149 ivi_surface_destroy(struct ivi_surface *ivi_surface)
151 wl_proxy_marshal((struct wl_proxy *) ivi_surface,
152 IVI_SURFACE_DESTROY);
154 wl_proxy_destroy((struct wl_proxy *) ivi_surface);
157 #ifndef IVI_APPLICATION_ERROR_ENUM
158 #define IVI_APPLICATION_ERROR_ENUM
159 enum ivi_application_error {
161 * given wl_surface has another role
163 IVI_APPLICATION_ERROR_ROLE = 0,
165 * given ivi_id is assigned to another wl_surface
167 IVI_APPLICATION_ERROR_IVI_ID = 1,
169 #endif /* IVI_APPLICATION_ERROR_ENUM */
171 #define IVI_APPLICATION_SURFACE_CREATE 0
174 * @ingroup iface_ivi_application
176 #define IVI_APPLICATION_SURFACE_CREATE_SINCE_VERSION 1
178 /** @ingroup iface_ivi_application */
180 ivi_application_set_user_data(struct ivi_application *ivi_application, void *user_data)
182 wl_proxy_set_user_data((struct wl_proxy *) ivi_application, user_data);
185 /** @ingroup iface_ivi_application */
187 ivi_application_get_user_data(struct ivi_application *ivi_application)
189 return wl_proxy_get_user_data((struct wl_proxy *) ivi_application);
192 static inline uint32_t
193 ivi_application_get_version(struct ivi_application *ivi_application)
195 return wl_proxy_get_version((struct wl_proxy *) ivi_application);
198 /** @ingroup iface_ivi_application */
200 ivi_application_destroy(struct ivi_application *ivi_application)
202 wl_proxy_destroy((struct wl_proxy *) ivi_application);
206 * @ingroup iface_ivi_application
208 * This request gives the wl_surface the role of an IVI Surface. Creating more than
209 * one ivi_surface for a wl_surface is not allowed. Note, that this still allows the
212 * 1. create a wl_surface
213 * 2. create ivi_surface for the wl_surface
214 * 3. destroy the ivi_surface
215 * 4. create ivi_surface for the wl_surface (with the same or another ivi_id as before)
217 * surface_create will create a interface:ivi_surface with numeric ID; ivi_id in
218 * ivi compositor. These ivi_ids are defined as unique in the system to identify
219 * it inside of ivi compositor. The ivi compositor implements business logic how to
220 * set properties of the surface with ivi_id according to status of the system.
221 * E.g. a unique ID for Car Navigation application is used for implementing special
222 * logic of the application about where it shall be located.
223 * The server regards following cases as protocol errors and disconnects the client.
224 * - wl_surface already has an nother role.
225 * - ivi_id is already assigned to an another wl_surface.
227 * If client destroys ivi_surface or wl_surface which is assigne to the ivi_surface,
228 * ivi_id which is assigned to the ivi_surface is free for reuse.
230 static inline struct ivi_surface *
231 ivi_application_surface_create(struct ivi_application *ivi_application, uint32_t ivi_id, struct wl_surface *surface)
235 id = wl_proxy_marshal_constructor((struct wl_proxy *) ivi_application,
236 IVI_APPLICATION_SURFACE_CREATE, &ivi_surface_interface, ivi_id, surface, NULL);
238 return (struct ivi_surface *) id;