1 /* SCANNER TEST */
2
3 #ifndef SMALL_TEST_SERVER_PROTOCOL_H
4 #define SMALL_TEST_SERVER_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-server.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 struct wl_client;
15 struct wl_resource;
16
17 /**
18 * @page page_small_test The small_test protocol
19 * @section page_ifaces_small_test Interfaces
20 * - @subpage page_iface_intf_A - the thing A
21 * @section page_copyright_small_test Copyright
22 * <pre>
23 *
24 * Copyright © 2016 Collabora, Ltd.
25 *
26 * Permission is hereby granted, free of charge, to any person
27 * obtaining a copy of this software and associated documentation files
28 * (the "Software"), to deal in the Software without restriction,
29 * including without limitation the rights to use, copy, modify, merge,
30 * publish, distribute, sublicense, and/or sell copies of the Software,
31 * and to permit persons to whom the Software is furnished to do so,
32 * subject to the following conditions:
33 *
34 * The above copyright notice and this permission notice (including the
35 * next paragraph) shall be included in all copies or substantial
36 * portions of the Software.
37 *
38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
42 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
43 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
44 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45 * SOFTWARE.
46 * </pre>
47 */
48 struct another_intf;
49 struct intf_A;
50 struct intf_not_here;
51
52 /**
53 * @page page_iface_intf_A intf_A
54 * @section page_iface_intf_A_desc Description
55 *
56 * A useless example trying to tickle the scanner.
57 * @section page_iface_intf_A_api API
58 * See @ref iface_intf_A.
59 */
60 /**
61 * @defgroup iface_intf_A The intf_A interface
62 *
63 * A useless example trying to tickle the scanner.
64 */
65 extern const struct wl_interface intf_A_interface;
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_interface
93 */
94 struct intf_A_interface {
95 /**
96 * @param interface name of the objects interface
97 * @param version version of the objects interface
98 */
99 void (*rq1)(struct wl_client *client,
100 struct wl_resource *resource,
101 const char *interface, uint32_t version, uint32_t untyped_new);
102 /**
103 */
104 void (*rq2)(struct wl_client *client,
105 struct wl_resource *resource,
106 uint32_t typed_new,
107 const char *str,
108 int32_t i,
109 uint32_t u,
110 wl_fixed_t f,
111 int32_t fd,
112 struct wl_resource *obj);
113 /**
114 */
115 void (*destroy)(struct wl_client *client,
116 struct wl_resource *resource);
117 };
118
119 #define INTF_A_HEY 0
120
121 /**
122 * @ingroup iface_intf_A
123 */
124 #define INTF_A_HEY_SINCE_VERSION 1
125
126 /**
127 * @ingroup iface_intf_A
128 */
129 #define INTF_A_RQ1_SINCE_VERSION 1
130 /**
131 * @ingroup iface_intf_A
132 */
133 #define INTF_A_RQ2_SINCE_VERSION 1
134 /**
135 * @ingroup iface_intf_A
136 */
137 #define INTF_A_DESTROY_SINCE_VERSION 1
138
139 /**
140 * @ingroup iface_intf_A
141 * Sends an hey event to the client owning the resource.
142 * @param resource_ The client's resource
143 */
144 static inline void
intf_A_send_hey(struct wl_resource * resource_)145 intf_A_send_hey(struct wl_resource *resource_)
146 {
147 wl_resource_post_event(resource_, INTF_A_HEY);
148 }
149
150 #ifdef __cplusplus
151 }
152 #endif
153
154 #endif
155