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