Add agl-service-homescreen-2017
[apps/agl-service-homescreen.git] / sample / simple-egl / include / ivi-application-client-protocol.h
1 /* Generated by wayland-scanner 1.11.0 */
2
3 #ifndef IVI_APPLICATION_CLIENT_PROTOCOL_H
4 #define IVI_APPLICATION_CLIENT_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9
10 //#ifdef  __cplusplus
11 //extern "C" {
12 //#endif
13
14 /**
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
20  * <pre>
21  *
22  * Copyright (C) 2013 DENSO CORPORATION
23  * Copyright (c) 2013 BMW Car IT GmbH
24  *
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:
31  *
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
34  * Software.
35  *
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.
43  * </pre>
44  */
45 struct ivi_application;
46 struct ivi_surface;
47 struct wl_surface;
48
49 /**
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.
54  */
55 /**
56  * @defgroup iface_ivi_surface The ivi_surface interface
57  */
58 extern const struct wl_interface ivi_surface_interface;
59 /**
60  * @page page_iface_ivi_application ivi_application
61  * @section page_iface_ivi_application_desc Description
62  *
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.
68  */
69 /**
70  * @defgroup iface_ivi_application The ivi_application interface
71  *
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.
75  */
76 extern const struct wl_interface ivi_application_interface;
77
78 /**
79  * @ingroup iface_ivi_surface
80  * @struct ivi_surface_listener
81  */
82 struct ivi_surface_listener {
83         /**
84          * suggest resize
85          *
86          * The configure event asks the client to resize its surface.
87          *
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).
91          *
92          * The client is free to dismiss all but the last configure event
93          * it received.
94          *
95          * The width and height arguments specify the size of the window in
96          * surface-local coordinates.
97          */
98         void (*configure)(void *data,
99                           struct ivi_surface *ivi_surface,
100                           int32_t width,
101                           int32_t height);
102 };
103
104 /**
105  * @ingroup ivi_surface_iface
106  */
107 static inline int
108 ivi_surface_add_listener(struct ivi_surface *ivi_surface,
109                          const struct ivi_surface_listener *listener, void *data)
110 {
111         return wl_proxy_add_listener((struct wl_proxy *) ivi_surface,
112                                      (void (**)(void)) listener, data);
113 }
114
115 #define IVI_SURFACE_DESTROY     0
116
117 /**
118  * @ingroup iface_ivi_surface
119  */
120 #define IVI_SURFACE_DESTROY_SINCE_VERSION       1
121
122 /** @ingroup iface_ivi_surface */
123 static inline void
124 ivi_surface_set_user_data(struct ivi_surface *ivi_surface, void *user_data)
125 {
126         wl_proxy_set_user_data((struct wl_proxy *) ivi_surface, user_data);
127 }
128
129 /** @ingroup iface_ivi_surface */
130 static inline void *
131 ivi_surface_get_user_data(struct ivi_surface *ivi_surface)
132 {
133         return wl_proxy_get_user_data((struct wl_proxy *) ivi_surface);
134 }
135
136 static inline uint32_t
137 ivi_surface_get_version(struct ivi_surface *ivi_surface)
138 {
139         return wl_proxy_get_version((struct wl_proxy *) ivi_surface);
140 }
141
142 /**
143  * @ingroup iface_ivi_surface
144  *
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.
147  */
148 static inline void
149 ivi_surface_destroy(struct ivi_surface *ivi_surface)
150 {
151         wl_proxy_marshal((struct wl_proxy *) ivi_surface,
152                          IVI_SURFACE_DESTROY);
153
154         wl_proxy_destroy((struct wl_proxy *) ivi_surface);
155 }
156
157 #ifndef IVI_APPLICATION_ERROR_ENUM
158 #define IVI_APPLICATION_ERROR_ENUM
159 enum ivi_application_error {
160         /**
161          * given wl_surface has another role
162          */
163         IVI_APPLICATION_ERROR_ROLE = 0,
164         /**
165          * given ivi_id is assigned to another wl_surface
166          */
167         IVI_APPLICATION_ERROR_IVI_ID = 1,
168 };
169 #endif /* IVI_APPLICATION_ERROR_ENUM */
170
171 #define IVI_APPLICATION_SURFACE_CREATE  0
172
173 /**
174  * @ingroup iface_ivi_application
175  */
176 #define IVI_APPLICATION_SURFACE_CREATE_SINCE_VERSION    1
177
178 /** @ingroup iface_ivi_application */
179 static inline void
180 ivi_application_set_user_data(struct ivi_application *ivi_application, void *user_data)
181 {
182         wl_proxy_set_user_data((struct wl_proxy *) ivi_application, user_data);
183 }
184
185 /** @ingroup iface_ivi_application */
186 static inline void *
187 ivi_application_get_user_data(struct ivi_application *ivi_application)
188 {
189         return wl_proxy_get_user_data((struct wl_proxy *) ivi_application);
190 }
191
192 static inline uint32_t
193 ivi_application_get_version(struct ivi_application *ivi_application)
194 {
195         return wl_proxy_get_version((struct wl_proxy *) ivi_application);
196 }
197
198 /** @ingroup iface_ivi_application */
199 static inline void
200 ivi_application_destroy(struct ivi_application *ivi_application)
201 {
202         wl_proxy_destroy((struct wl_proxy *) ivi_application);
203 }
204
205 /**
206  * @ingroup iface_ivi_application
207  *
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
210  * following example:
211  *
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)
216  *
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.
226  *
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.
229  */
230 static inline struct ivi_surface *
231 ivi_application_surface_create(struct ivi_application *ivi_application, uint32_t ivi_id, struct wl_surface *surface)
232 {
233         struct wl_proxy *id;
234
235         id = wl_proxy_marshal_constructor((struct wl_proxy *) ivi_application,
236                          IVI_APPLICATION_SURFACE_CREATE, &ivi_surface_interface, ivi_id, surface, NULL);
237
238         return (struct ivi_surface *) id;
239 }
240
241 //#ifdef  __cplusplus
242 //}
243 //#endif
244
245 #endif