• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SCANNER TEST */
2 
3 #ifndef SMALL_TEST_CLIENT_PROTOCOL_H
4 #define SMALL_TEST_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_small_test The small_test protocol
16  * @section page_ifaces_small_test Interfaces
17  * - @subpage page_iface_intf_A - the thing A
18  * @section page_copyright_small_test Copyright
19  * <pre>
20  *
21  * Copyright © 2016 Collabora, Ltd.
22  *
23  * Permission is hereby granted, free of charge, to any person
24  * obtaining a copy of this software and associated documentation files
25  * (the "Software"), to deal in the Software without restriction,
26  * including without limitation the rights to use, copy, modify, merge,
27  * publish, distribute, sublicense, and/or sell copies of the Software,
28  * and to permit persons to whom the Software is furnished to do so,
29  * subject to the following conditions:
30  *
31  * The above copyright notice and this permission notice (including the
32  * next paragraph) shall be included in all copies or substantial
33  * portions of the Software.
34  *
35  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
37  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
39  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
40  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42  * SOFTWARE.
43  * </pre>
44  */
45 struct another_intf;
46 struct intf_A;
47 struct intf_not_here;
48 
49 #ifndef INTF_A_INTERFACE
50 #define INTF_A_INTERFACE
51 /**
52  * @page page_iface_intf_A intf_A
53  * @section page_iface_intf_A_desc Description
54  *
55  * A useless example trying to tickle the scanner.
56  * @section page_iface_intf_A_api API
57  * See @ref iface_intf_A.
58  */
59 /**
60  * @defgroup iface_intf_A The intf_A interface
61  *
62  * A useless example trying to tickle the scanner.
63  */
64 extern const struct wl_interface intf_A_interface;
65 #endif
66 
67 #ifndef INTF_A_FOO_ENUM
68 #define INTF_A_FOO_ENUM
69 enum intf_A_foo {
70 	/**
71 	 * this is the first
72 	 */
73 	INTF_A_FOO_FIRST = 0,
74 	/**
75 	 * this is the second
76 	 */
77 	INTF_A_FOO_SECOND = 1,
78 	/**
79 	 * this is the third
80 	 * @since 2
81 	 */
82 	INTF_A_FOO_THIRD = 2,
83 };
84 /**
85  * @ingroup iface_intf_A
86  */
87 #define INTF_A_FOO_THIRD_SINCE_VERSION 2
88 #endif /* INTF_A_FOO_ENUM */
89 
90 /**
91  * @ingroup iface_intf_A
92  * @struct intf_A_listener
93  */
94 struct intf_A_listener {
95 	/**
96 	 */
97 	void (*hey)(void *data,
98 		    struct intf_A *intf_A);
99 };
100 
101 /**
102  * @ingroup iface_intf_A
103  */
104 static inline int
intf_A_add_listener(struct intf_A * intf_A,const struct intf_A_listener * listener,void * data)105 intf_A_add_listener(struct intf_A *intf_A,
106 		    const struct intf_A_listener *listener, void *data)
107 {
108 	return wl_proxy_add_listener((struct wl_proxy *) intf_A,
109 				     (void (**)(void)) listener, data);
110 }
111 
112 #define INTF_A_RQ1 0
113 #define INTF_A_RQ2 1
114 #define INTF_A_DESTROY 2
115 
116 /**
117  * @ingroup iface_intf_A
118  */
119 #define INTF_A_HEY_SINCE_VERSION 1
120 
121 /**
122  * @ingroup iface_intf_A
123  */
124 #define INTF_A_RQ1_SINCE_VERSION 1
125 /**
126  * @ingroup iface_intf_A
127  */
128 #define INTF_A_RQ2_SINCE_VERSION 1
129 /**
130  * @ingroup iface_intf_A
131  */
132 #define INTF_A_DESTROY_SINCE_VERSION 1
133 
134 /** @ingroup iface_intf_A */
135 static inline void
intf_A_set_user_data(struct intf_A * intf_A,void * user_data)136 intf_A_set_user_data(struct intf_A *intf_A, void *user_data)
137 {
138 	wl_proxy_set_user_data((struct wl_proxy *) intf_A, user_data);
139 }
140 
141 /** @ingroup iface_intf_A */
142 static inline void *
intf_A_get_user_data(struct intf_A * intf_A)143 intf_A_get_user_data(struct intf_A *intf_A)
144 {
145 	return wl_proxy_get_user_data((struct wl_proxy *) intf_A);
146 }
147 
148 static inline uint32_t
intf_A_get_version(struct intf_A * intf_A)149 intf_A_get_version(struct intf_A *intf_A)
150 {
151 	return wl_proxy_get_version((struct wl_proxy *) intf_A);
152 }
153 
154 /**
155  * @ingroup iface_intf_A
156  */
157 static inline void *
intf_A_rq1(struct intf_A * intf_A,const struct wl_interface * interface,uint32_t version)158 intf_A_rq1(struct intf_A *intf_A, const struct wl_interface *interface, uint32_t version)
159 {
160 	struct wl_proxy *untyped_new;
161 
162 	untyped_new = wl_proxy_marshal_constructor_versioned((struct wl_proxy *) intf_A,
163 			 INTF_A_RQ1, interface, version, interface->name, version, NULL);
164 
165 	return (void *) untyped_new;
166 }
167 
168 /**
169  * @ingroup iface_intf_A
170  */
171 static inline struct intf_not_here *
intf_A_rq2(struct intf_A * intf_A,const char * str,int32_t i,uint32_t u,wl_fixed_t f,int32_t fd,struct another_intf * obj)172 intf_A_rq2(struct intf_A *intf_A, const char *str, int32_t i, uint32_t u, wl_fixed_t f, int32_t fd, struct another_intf *obj)
173 {
174 	struct wl_proxy *typed_new;
175 
176 	typed_new = wl_proxy_marshal_constructor((struct wl_proxy *) intf_A,
177 			 INTF_A_RQ2, &intf_not_here_interface, NULL, str, i, u, f, fd, obj);
178 
179 	return (struct intf_not_here *) typed_new;
180 }
181 
182 /**
183  * @ingroup iface_intf_A
184  */
185 static inline void
intf_A_destroy(struct intf_A * intf_A)186 intf_A_destroy(struct intf_A *intf_A)
187 {
188 	wl_proxy_marshal((struct wl_proxy *) intf_A,
189 			 INTF_A_DESTROY);
190 
191 	wl_proxy_destroy((struct wl_proxy *) intf_A);
192 }
193 
194 #ifdef  __cplusplus
195 }
196 #endif
197 
198 #endif
199