1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef STYLUS_TOOLS_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define STYLUS_TOOLS_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_stylus_tools_unstable_v1 The stylus_tools_unstable_v1 protocol
16  * Protocol for the stylus tools
17  *
18  * @section page_desc_stylus_tools_unstable_v1 Description
19  *
20  * This protocol specifies a set of interfaces used to control the behavior
21  * of stylus tools.
22  *
23  * Warning! The protocol described in this file is experimental and backward
24  * incompatible changes may be made. Backward compatible changes may be added
25  * together with the corresponding interface version bump. Backward
26  * incompatible changes are done by bumping the version number in the protocol
27  * and interface names and resetting the interface version. Once the protocol
28  * is to be declared stable, the 'z' prefix and the version number in the
29  * protocol and interface names are removed and the interface version number is
30  * reset.
31  *
32  * @section page_ifaces_stylus_tools_unstable_v1 Interfaces
33  * - @subpage page_iface_zcr_stylus_tools_v1 - stylus_tools
34  * - @subpage page_iface_zcr_stylus_tool_v1 - stylus_tool interface to a wl_surface
35  * @section page_copyright_stylus_tools_unstable_v1 Copyright
36  * <pre>
37  *
38  * Copyright 2017 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_stylus_tool_v1;
62 struct zcr_stylus_tools_v1;
63 
64 #ifndef ZCR_STYLUS_TOOLS_V1_INTERFACE
65 #define ZCR_STYLUS_TOOLS_V1_INTERFACE
66 /**
67  * @page page_iface_zcr_stylus_tools_v1 zcr_stylus_tools_v1
68  * @section page_iface_zcr_stylus_tools_v1_desc Description
69  *
70  * The global interface is used to instantiate an interface extension for a
71  * wl_surface object. This extended interface will then allow the client to
72  * control the stylus-related behavior for input device event processing
73  * related to wl_surface.
74  * @section page_iface_zcr_stylus_tools_v1_api API
75  * See @ref iface_zcr_stylus_tools_v1.
76  */
77 /**
78  * @defgroup iface_zcr_stylus_tools_v1 The zcr_stylus_tools_v1 interface
79  *
80  * The global interface is used to instantiate an interface extension for a
81  * wl_surface object. This extended interface will then allow the client to
82  * control the stylus-related behavior for input device event processing
83  * related to wl_surface.
84  */
85 extern const struct wl_interface zcr_stylus_tools_v1_interface;
86 #endif
87 #ifndef ZCR_STYLUS_TOOL_V1_INTERFACE
88 #define ZCR_STYLUS_TOOL_V1_INTERFACE
89 /**
90  * @page page_iface_zcr_stylus_tool_v1 zcr_stylus_tool_v1
91  * @section page_iface_zcr_stylus_tool_v1_desc Description
92  *
93  * An additional interface to a wl_surface object, which allows the
94  * client to control the behavior of stylus tools.
95  *
96  * If the wl_surface associated with the stylus_tool object is destroyed,
97  * the stylus_tool object becomes inert.
98  *
99  * If the stylus_tool object is destroyed, the stylus_tool state is removed
100  * from the wl_surface. The change will be applied on the next
101  * wl_surface.commit.
102  * @section page_iface_zcr_stylus_tool_v1_api API
103  * See @ref iface_zcr_stylus_tool_v1.
104  */
105 /**
106  * @defgroup iface_zcr_stylus_tool_v1 The zcr_stylus_tool_v1 interface
107  *
108  * An additional interface to a wl_surface object, which allows the
109  * client to control the behavior of stylus tools.
110  *
111  * If the wl_surface associated with the stylus_tool object is destroyed,
112  * the stylus_tool object becomes inert.
113  *
114  * If the stylus_tool object is destroyed, the stylus_tool state is removed
115  * from the wl_surface. The change will be applied on the next
116  * wl_surface.commit.
117  */
118 extern const struct wl_interface zcr_stylus_tool_v1_interface;
119 #endif
120 
121 #ifndef ZCR_STYLUS_TOOLS_V1_ERROR_ENUM
122 #define ZCR_STYLUS_TOOLS_V1_ERROR_ENUM
123 enum zcr_stylus_tools_v1_error {
124 	/**
125 	 * the surface already has a stylus_tool object associated
126 	 */
127 	ZCR_STYLUS_TOOLS_V1_ERROR_STYLUS_TOOL_EXISTS = 0,
128 };
129 #endif /* ZCR_STYLUS_TOOLS_V1_ERROR_ENUM */
130 
131 #define ZCR_STYLUS_TOOLS_V1_DESTROY 0
132 #define ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL 1
133 
134 
135 /**
136  * @ingroup iface_zcr_stylus_tools_v1
137  */
138 #define ZCR_STYLUS_TOOLS_V1_DESTROY_SINCE_VERSION 1
139 /**
140  * @ingroup iface_zcr_stylus_tools_v1
141  */
142 #define ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL_SINCE_VERSION 1
143 
144 /** @ingroup iface_zcr_stylus_tools_v1 */
145 static inline void
zcr_stylus_tools_v1_set_user_data(struct zcr_stylus_tools_v1 * zcr_stylus_tools_v1,void * user_data)146 zcr_stylus_tools_v1_set_user_data(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1, void *user_data)
147 {
148 	wl_proxy_set_user_data((struct wl_proxy *) zcr_stylus_tools_v1, user_data);
149 }
150 
151 /** @ingroup iface_zcr_stylus_tools_v1 */
152 static inline void *
zcr_stylus_tools_v1_get_user_data(struct zcr_stylus_tools_v1 * zcr_stylus_tools_v1)153 zcr_stylus_tools_v1_get_user_data(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1)
154 {
155 	return wl_proxy_get_user_data((struct wl_proxy *) zcr_stylus_tools_v1);
156 }
157 
158 static inline uint32_t
zcr_stylus_tools_v1_get_version(struct zcr_stylus_tools_v1 * zcr_stylus_tools_v1)159 zcr_stylus_tools_v1_get_version(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1)
160 {
161 	return wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tools_v1);
162 }
163 
164 /**
165  * @ingroup iface_zcr_stylus_tools_v1
166  *
167  * Informs the server that the client will not be using this
168  * protocol object anymore. This does not affect any other objects,
169  * stylus_tool objects included.
170  */
171 static inline void
zcr_stylus_tools_v1_destroy(struct zcr_stylus_tools_v1 * zcr_stylus_tools_v1)172 zcr_stylus_tools_v1_destroy(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1)
173 {
174 	wl_proxy_marshal_flags((struct wl_proxy *) zcr_stylus_tools_v1,
175 			 ZCR_STYLUS_TOOLS_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tools_v1), WL_MARSHAL_FLAG_DESTROY);
176 }
177 
178 /**
179  * @ingroup iface_zcr_stylus_tools_v1
180  *
181  * Instantiate an interface extension for the given wl_surface to
182  * provide access to the stylus tools features. If the given
183  * wl_surface already has an stylus_tool object associated,
184  * the stylus_tool_exists protocol protocol error is raised.
185  */
186 static inline struct zcr_stylus_tool_v1 *
zcr_stylus_tools_v1_get_stylus_tool(struct zcr_stylus_tools_v1 * zcr_stylus_tools_v1,struct wl_surface * surface)187 zcr_stylus_tools_v1_get_stylus_tool(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1, struct wl_surface *surface)
188 {
189 	struct wl_proxy *id;
190 
191 	id = wl_proxy_marshal_flags((struct wl_proxy *) zcr_stylus_tools_v1,
192 			 ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL, &zcr_stylus_tool_v1_interface, wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tools_v1), 0, NULL, surface);
193 
194 	return (struct zcr_stylus_tool_v1 *) id;
195 }
196 
197 #define ZCR_STYLUS_TOOL_V1_DESTROY 0
198 #define ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY 1
199 
200 
201 /**
202  * @ingroup iface_zcr_stylus_tool_v1
203  */
204 #define ZCR_STYLUS_TOOL_V1_DESTROY_SINCE_VERSION 1
205 /**
206  * @ingroup iface_zcr_stylus_tool_v1
207  */
208 #define ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY_SINCE_VERSION 1
209 
210 /** @ingroup iface_zcr_stylus_tool_v1 */
211 static inline void
zcr_stylus_tool_v1_set_user_data(struct zcr_stylus_tool_v1 * zcr_stylus_tool_v1,void * user_data)212 zcr_stylus_tool_v1_set_user_data(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1, void *user_data)
213 {
214 	wl_proxy_set_user_data((struct wl_proxy *) zcr_stylus_tool_v1, user_data);
215 }
216 
217 /** @ingroup iface_zcr_stylus_tool_v1 */
218 static inline void *
zcr_stylus_tool_v1_get_user_data(struct zcr_stylus_tool_v1 * zcr_stylus_tool_v1)219 zcr_stylus_tool_v1_get_user_data(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1)
220 {
221 	return wl_proxy_get_user_data((struct wl_proxy *) zcr_stylus_tool_v1);
222 }
223 
224 static inline uint32_t
zcr_stylus_tool_v1_get_version(struct zcr_stylus_tool_v1 * zcr_stylus_tool_v1)225 zcr_stylus_tool_v1_get_version(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1)
226 {
227 	return wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tool_v1);
228 }
229 
230 /**
231  * @ingroup iface_zcr_stylus_tool_v1
232  *
233  * The associated wl_surface's stylus_tool state is removed.
234  * The change is applied on the next wl_surface.commit.
235  */
236 static inline void
zcr_stylus_tool_v1_destroy(struct zcr_stylus_tool_v1 * zcr_stylus_tool_v1)237 zcr_stylus_tool_v1_destroy(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1)
238 {
239 	wl_proxy_marshal_flags((struct wl_proxy *) zcr_stylus_tool_v1,
240 			 ZCR_STYLUS_TOOL_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tool_v1), WL_MARSHAL_FLAG_DESTROY);
241 }
242 
243 /**
244  * @ingroup iface_zcr_stylus_tool_v1
245  *
246  * Enables the "stylus-only" mode for input device event processing
247  * related to wl_surface.
248  */
249 static inline void
zcr_stylus_tool_v1_set_stylus_only(struct zcr_stylus_tool_v1 * zcr_stylus_tool_v1)250 zcr_stylus_tool_v1_set_stylus_only(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1)
251 {
252 	wl_proxy_marshal_flags((struct wl_proxy *) zcr_stylus_tool_v1,
253 			 ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tool_v1), 0);
254 }
255 
256 #ifdef  __cplusplus
257 }
258 #endif
259 
260 #endif
261