1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef NOTIFICATION_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define NOTIFICATION_SHELL_UNSTABLE_V1_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_notification_shell_unstable_v1 The notification_shell_unstable_v1 protocol
16 * Create desktop notifications
17 *
18 * @section page_desc_notification_shell_unstable_v1 Description
19 *
20 * notification_shell allows clients to create desktop notification on host.
21 *
22 * Warning! The protocol described in this file is experimental and backward
23 * incompatible changes may be made. Backward compatible changes may be added
24 * together with the corresponding interface version bump. Backward
25 * incompatible changes are done by bumping the version number in the protocol
26 * and interface names and resetting the interface version. Once the protocol
27 * is to be declared stable, the 'z' prefix and the version number in the
28 * protocol and interface names are removed and the interface version number is
29 * reset.
30 *
31 * @section page_ifaces_notification_shell_unstable_v1 Interfaces
32 * - @subpage page_iface_zcr_notification_shell_v1 - A notification window
33 * - @subpage page_iface_zcr_notification_shell_surface_v1 - A notification window
34 * - @subpage page_iface_zcr_notification_shell_notification_v1 - A notification
35 * @section page_copyright_notification_shell_unstable_v1 Copyright
36 * <pre>
37 *
38 * Copyright 2018 The Chromium Authors
39 *
40 * Permission is hereby granted, free of charge, to any person obtaining a
41 * copy of this software and associated documentation files (the "Software"),
42 * to deal in the Software without restriction, including without limitation
43 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
44 * and/or sell copies of the Software, and to permit persons to whom the
45 * Software is furnished to do so, subject to the following conditions:
46 *
47 * The above copyright notice and this permission notice (including the next
48 * paragraph) shall be included in all copies or substantial portions of the
49 * Software.
50 *
51 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
54 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
56 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
57 * DEALINGS IN THE SOFTWARE.
58 * </pre>
59 */
60 struct wl_surface;
61 struct zcr_notification_shell_notification_v1;
62 struct zcr_notification_shell_surface_v1;
63 struct zcr_notification_shell_v1;
64
65 #ifndef ZCR_NOTIFICATION_SHELL_V1_INTERFACE
66 #define ZCR_NOTIFICATION_SHELL_V1_INTERFACE
67 /**
68 * @page page_iface_zcr_notification_shell_v1 zcr_notification_shell_v1
69 * @section page_iface_zcr_notification_shell_v1_desc Description
70 *
71 * An interface that is used for creating desktop notification on host.
72 * @section page_iface_zcr_notification_shell_v1_api API
73 * See @ref iface_zcr_notification_shell_v1.
74 */
75 /**
76 * @defgroup iface_zcr_notification_shell_v1 The zcr_notification_shell_v1 interface
77 *
78 * An interface that is used for creating desktop notification on host.
79 */
80 extern const struct wl_interface zcr_notification_shell_v1_interface;
81 #endif
82 #ifndef ZCR_NOTIFICATION_SHELL_SURFACE_V1_INTERFACE
83 #define ZCR_NOTIFICATION_SHELL_SURFACE_V1_INTERFACE
84 /**
85 * @page page_iface_zcr_notification_shell_surface_v1 zcr_notification_shell_surface_v1
86 * @section page_iface_zcr_notification_shell_surface_v1_desc Description
87 *
88 * An interface that may be implemented by a wl_surface to host
89 * notification contents.
90 * @section page_iface_zcr_notification_shell_surface_v1_api API
91 * See @ref iface_zcr_notification_shell_surface_v1.
92 */
93 /**
94 * @defgroup iface_zcr_notification_shell_surface_v1 The zcr_notification_shell_surface_v1 interface
95 *
96 * An interface that may be implemented by a wl_surface to host
97 * notification contents.
98 */
99 extern const struct wl_interface zcr_notification_shell_surface_v1_interface;
100 #endif
101 #ifndef ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_INTERFACE
102 #define ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_INTERFACE
103 /**
104 * @page page_iface_zcr_notification_shell_notification_v1 zcr_notification_shell_notification_v1
105 * @section page_iface_zcr_notification_shell_notification_v1_desc Description
106 *
107 * An interface that controls the notification created by create_notification.
108 * @section page_iface_zcr_notification_shell_notification_v1_api API
109 * See @ref iface_zcr_notification_shell_notification_v1.
110 */
111 /**
112 * @defgroup iface_zcr_notification_shell_notification_v1 The zcr_notification_shell_notification_v1 interface
113 *
114 * An interface that controls the notification created by create_notification.
115 */
116 extern const struct wl_interface zcr_notification_shell_notification_v1_interface;
117 #endif
118
119 #ifndef ZCR_NOTIFICATION_SHELL_V1_ERROR_ENUM
120 #define ZCR_NOTIFICATION_SHELL_V1_ERROR_ENUM
121 enum zcr_notification_shell_v1_error {
122 /**
123 * invalid notification key
124 */
125 ZCR_NOTIFICATION_SHELL_V1_ERROR_INVALID_NOTIFICATION_KEY = 1,
126 };
127 #endif /* ZCR_NOTIFICATION_SHELL_V1_ERROR_ENUM */
128
129 #define ZCR_NOTIFICATION_SHELL_V1_CREATE_NOTIFICATION 0
130 #define ZCR_NOTIFICATION_SHELL_V1_GET_NOTIFICATION_SURFACE 1
131
132
133 /**
134 * @ingroup iface_zcr_notification_shell_v1
135 */
136 #define ZCR_NOTIFICATION_SHELL_V1_CREATE_NOTIFICATION_SINCE_VERSION 1
137 /**
138 * @ingroup iface_zcr_notification_shell_v1
139 */
140 #define ZCR_NOTIFICATION_SHELL_V1_GET_NOTIFICATION_SURFACE_SINCE_VERSION 1
141
142 /** @ingroup iface_zcr_notification_shell_v1 */
143 static inline void
zcr_notification_shell_v1_set_user_data(struct zcr_notification_shell_v1 * zcr_notification_shell_v1,void * user_data)144 zcr_notification_shell_v1_set_user_data(struct zcr_notification_shell_v1 *zcr_notification_shell_v1, void *user_data)
145 {
146 wl_proxy_set_user_data((struct wl_proxy *) zcr_notification_shell_v1, user_data);
147 }
148
149 /** @ingroup iface_zcr_notification_shell_v1 */
150 static inline void *
zcr_notification_shell_v1_get_user_data(struct zcr_notification_shell_v1 * zcr_notification_shell_v1)151 zcr_notification_shell_v1_get_user_data(struct zcr_notification_shell_v1 *zcr_notification_shell_v1)
152 {
153 return wl_proxy_get_user_data((struct wl_proxy *) zcr_notification_shell_v1);
154 }
155
156 static inline uint32_t
zcr_notification_shell_v1_get_version(struct zcr_notification_shell_v1 * zcr_notification_shell_v1)157 zcr_notification_shell_v1_get_version(struct zcr_notification_shell_v1 *zcr_notification_shell_v1)
158 {
159 return wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_v1);
160 }
161
162 /** @ingroup iface_zcr_notification_shell_v1 */
163 static inline void
zcr_notification_shell_v1_destroy(struct zcr_notification_shell_v1 * zcr_notification_shell_v1)164 zcr_notification_shell_v1_destroy(struct zcr_notification_shell_v1 *zcr_notification_shell_v1)
165 {
166 wl_proxy_destroy((struct wl_proxy *) zcr_notification_shell_v1);
167 }
168
169 /**
170 * @ingroup iface_zcr_notification_shell_v1
171 *
172 * Creates a desktop notification from plain text information.
173 */
174 static inline struct zcr_notification_shell_notification_v1 *
zcr_notification_shell_v1_create_notification(struct zcr_notification_shell_v1 * zcr_notification_shell_v1,const char * title,const char * message,const char * display_source,const char * notification_key,struct wl_array * buttons)175 zcr_notification_shell_v1_create_notification(struct zcr_notification_shell_v1 *zcr_notification_shell_v1, const char *title, const char *message, const char *display_source, const char *notification_key, struct wl_array *buttons)
176 {
177 struct wl_proxy *id;
178
179 id = wl_proxy_marshal_flags((struct wl_proxy *) zcr_notification_shell_v1,
180 ZCR_NOTIFICATION_SHELL_V1_CREATE_NOTIFICATION, &zcr_notification_shell_notification_v1_interface, wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_v1), 0, NULL, title, message, display_source, notification_key, buttons);
181
182 return (struct zcr_notification_shell_notification_v1 *) id;
183 }
184
185 /**
186 * @ingroup iface_zcr_notification_shell_v1
187 *
188 * Creates a notification_surface for the given surface, gives it the
189 * notification_surface role and associated it with a notification id.
190 */
191 static inline struct zcr_notification_shell_surface_v1 *
zcr_notification_shell_v1_get_notification_surface(struct zcr_notification_shell_v1 * zcr_notification_shell_v1,struct wl_surface * surface,const char * notification_key)192 zcr_notification_shell_v1_get_notification_surface(struct zcr_notification_shell_v1 *zcr_notification_shell_v1, struct wl_surface *surface, const char *notification_key)
193 {
194 struct wl_proxy *id;
195
196 id = wl_proxy_marshal_flags((struct wl_proxy *) zcr_notification_shell_v1,
197 ZCR_NOTIFICATION_SHELL_V1_GET_NOTIFICATION_SURFACE, &zcr_notification_shell_surface_v1_interface, wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_v1), 0, NULL, surface, notification_key);
198
199 return (struct zcr_notification_shell_surface_v1 *) id;
200 }
201
202 #define ZCR_NOTIFICATION_SHELL_SURFACE_V1_DESTROY 0
203 #define ZCR_NOTIFICATION_SHELL_SURFACE_V1_SET_APP_ID 1
204
205
206 /**
207 * @ingroup iface_zcr_notification_shell_surface_v1
208 */
209 #define ZCR_NOTIFICATION_SHELL_SURFACE_V1_DESTROY_SINCE_VERSION 1
210 /**
211 * @ingroup iface_zcr_notification_shell_surface_v1
212 */
213 #define ZCR_NOTIFICATION_SHELL_SURFACE_V1_SET_APP_ID_SINCE_VERSION 1
214
215 /** @ingroup iface_zcr_notification_shell_surface_v1 */
216 static inline void
zcr_notification_shell_surface_v1_set_user_data(struct zcr_notification_shell_surface_v1 * zcr_notification_shell_surface_v1,void * user_data)217 zcr_notification_shell_surface_v1_set_user_data(struct zcr_notification_shell_surface_v1 *zcr_notification_shell_surface_v1, void *user_data)
218 {
219 wl_proxy_set_user_data((struct wl_proxy *) zcr_notification_shell_surface_v1, user_data);
220 }
221
222 /** @ingroup iface_zcr_notification_shell_surface_v1 */
223 static inline void *
zcr_notification_shell_surface_v1_get_user_data(struct zcr_notification_shell_surface_v1 * zcr_notification_shell_surface_v1)224 zcr_notification_shell_surface_v1_get_user_data(struct zcr_notification_shell_surface_v1 *zcr_notification_shell_surface_v1)
225 {
226 return wl_proxy_get_user_data((struct wl_proxy *) zcr_notification_shell_surface_v1);
227 }
228
229 static inline uint32_t
zcr_notification_shell_surface_v1_get_version(struct zcr_notification_shell_surface_v1 * zcr_notification_shell_surface_v1)230 zcr_notification_shell_surface_v1_get_version(struct zcr_notification_shell_surface_v1 *zcr_notification_shell_surface_v1)
231 {
232 return wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_surface_v1);
233 }
234
235 /**
236 * @ingroup iface_zcr_notification_shell_surface_v1
237 *
238 * Unmap and destroy the notification surface.
239 */
240 static inline void
zcr_notification_shell_surface_v1_destroy(struct zcr_notification_shell_surface_v1 * zcr_notification_shell_surface_v1)241 zcr_notification_shell_surface_v1_destroy(struct zcr_notification_shell_surface_v1 *zcr_notification_shell_surface_v1)
242 {
243 wl_proxy_marshal_flags((struct wl_proxy *) zcr_notification_shell_surface_v1,
244 ZCR_NOTIFICATION_SHELL_SURFACE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_surface_v1), WL_MARSHAL_FLAG_DESTROY);
245 }
246
247 /**
248 * @ingroup iface_zcr_notification_shell_surface_v1
249 *
250 * Set an application identifier for the notification surface.
251 */
252 static inline void
zcr_notification_shell_surface_v1_set_app_id(struct zcr_notification_shell_surface_v1 * zcr_notification_shell_surface_v1,const char * app_id)253 zcr_notification_shell_surface_v1_set_app_id(struct zcr_notification_shell_surface_v1 *zcr_notification_shell_surface_v1, const char *app_id)
254 {
255 wl_proxy_marshal_flags((struct wl_proxy *) zcr_notification_shell_surface_v1,
256 ZCR_NOTIFICATION_SHELL_SURFACE_V1_SET_APP_ID, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_surface_v1), 0, app_id);
257 }
258
259 /**
260 * @ingroup iface_zcr_notification_shell_notification_v1
261 * @struct zcr_notification_shell_notification_v1_listener
262 */
263 struct zcr_notification_shell_notification_v1_listener {
264 /**
265 * Notification is closed
266 *
267 * Notifies the notification object that the notification is
268 * closed.
269 * @param by_user 1 if notification is closed by a user
270 */
271 void (*closed)(void *data,
272 struct zcr_notification_shell_notification_v1 *zcr_notification_shell_notification_v1,
273 uint32_t by_user);
274 /**
275 * Notification is clicked
276 *
277 * Notifies the notification object that the notification or its
278 * button is clicked.
279 * @param button_index -1 if the body of the notification is cliked as opposed to a button
280 */
281 void (*clicked)(void *data,
282 struct zcr_notification_shell_notification_v1 *zcr_notification_shell_notification_v1,
283 int32_t button_index);
284 };
285
286 /**
287 * @ingroup iface_zcr_notification_shell_notification_v1
288 */
289 static inline int
zcr_notification_shell_notification_v1_add_listener(struct zcr_notification_shell_notification_v1 * zcr_notification_shell_notification_v1,const struct zcr_notification_shell_notification_v1_listener * listener,void * data)290 zcr_notification_shell_notification_v1_add_listener(struct zcr_notification_shell_notification_v1 *zcr_notification_shell_notification_v1,
291 const struct zcr_notification_shell_notification_v1_listener *listener, void *data)
292 {
293 return wl_proxy_add_listener((struct wl_proxy *) zcr_notification_shell_notification_v1,
294 (void (**)(void)) listener, data);
295 }
296
297 #define ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_DESTROY 0
298 #define ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_CLOSE 1
299
300 /**
301 * @ingroup iface_zcr_notification_shell_notification_v1
302 */
303 #define ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_CLOSED_SINCE_VERSION 1
304 /**
305 * @ingroup iface_zcr_notification_shell_notification_v1
306 */
307 #define ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_CLICKED_SINCE_VERSION 1
308
309 /**
310 * @ingroup iface_zcr_notification_shell_notification_v1
311 */
312 #define ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_DESTROY_SINCE_VERSION 1
313 /**
314 * @ingroup iface_zcr_notification_shell_notification_v1
315 */
316 #define ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_CLOSE_SINCE_VERSION 1
317
318 /** @ingroup iface_zcr_notification_shell_notification_v1 */
319 static inline void
zcr_notification_shell_notification_v1_set_user_data(struct zcr_notification_shell_notification_v1 * zcr_notification_shell_notification_v1,void * user_data)320 zcr_notification_shell_notification_v1_set_user_data(struct zcr_notification_shell_notification_v1 *zcr_notification_shell_notification_v1, void *user_data)
321 {
322 wl_proxy_set_user_data((struct wl_proxy *) zcr_notification_shell_notification_v1, user_data);
323 }
324
325 /** @ingroup iface_zcr_notification_shell_notification_v1 */
326 static inline void *
zcr_notification_shell_notification_v1_get_user_data(struct zcr_notification_shell_notification_v1 * zcr_notification_shell_notification_v1)327 zcr_notification_shell_notification_v1_get_user_data(struct zcr_notification_shell_notification_v1 *zcr_notification_shell_notification_v1)
328 {
329 return wl_proxy_get_user_data((struct wl_proxy *) zcr_notification_shell_notification_v1);
330 }
331
332 static inline uint32_t
zcr_notification_shell_notification_v1_get_version(struct zcr_notification_shell_notification_v1 * zcr_notification_shell_notification_v1)333 zcr_notification_shell_notification_v1_get_version(struct zcr_notification_shell_notification_v1 *zcr_notification_shell_notification_v1)
334 {
335 return wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_notification_v1);
336 }
337
338 /**
339 * @ingroup iface_zcr_notification_shell_notification_v1
340 *
341 * Destroys the notification object.
342 */
343 static inline void
zcr_notification_shell_notification_v1_destroy(struct zcr_notification_shell_notification_v1 * zcr_notification_shell_notification_v1)344 zcr_notification_shell_notification_v1_destroy(struct zcr_notification_shell_notification_v1 *zcr_notification_shell_notification_v1)
345 {
346 wl_proxy_marshal_flags((struct wl_proxy *) zcr_notification_shell_notification_v1,
347 ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_notification_v1), WL_MARSHAL_FLAG_DESTROY);
348 }
349
350 /**
351 * @ingroup iface_zcr_notification_shell_notification_v1
352 *
353 * Closes the notification. The closed event is sent after this request.
354 */
355 static inline void
zcr_notification_shell_notification_v1_close(struct zcr_notification_shell_notification_v1 * zcr_notification_shell_notification_v1)356 zcr_notification_shell_notification_v1_close(struct zcr_notification_shell_notification_v1 *zcr_notification_shell_notification_v1)
357 {
358 wl_proxy_marshal_flags((struct wl_proxy *) zcr_notification_shell_notification_v1,
359 ZCR_NOTIFICATION_SHELL_NOTIFICATION_V1_CLOSE, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_notification_shell_notification_v1), 0);
360 }
361
362 #ifdef __cplusplus
363 }
364 #endif
365
366 #endif
367