small-client-core.h 5.5 KB

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