• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef INTF_A_INTERFACE
53 #define INTF_A_INTERFACE
54 /**
55  * @page page_iface_intf_A intf_A
56  * @section page_iface_intf_A_desc Description
57  *
58  * A useless example trying to tickle the scanner.
59  * @section page_iface_intf_A_api API
60  * See @ref iface_intf_A.
61  */
62 /**
63  * @defgroup iface_intf_A The intf_A interface
64  *
65  * A useless example trying to tickle the scanner.
66  */
67 extern const struct wl_interface intf_A_interface;
68 #endif
69 
70 #ifndef INTF_A_FOO_ENUM
71 #define INTF_A_FOO_ENUM
72 enum intf_A_foo {
73 	/**
74 	 * this is the first
75 	 */
76 	INTF_A_FOO_FIRST = 0,
77 	/**
78 	 * this is the second
79 	 */
80 	INTF_A_FOO_SECOND = 1,
81 	/**
82 	 * this is the third
83 	 * @since 2
84 	 */
85 	INTF_A_FOO_THIRD = 2,
86 };
87 /**
88  * @ingroup iface_intf_A
89  */
90 #define INTF_A_FOO_THIRD_SINCE_VERSION 2
91 #endif /* INTF_A_FOO_ENUM */
92 
93 /**
94  * @ingroup iface_intf_A
95  * @struct intf_A_interface
96  */
97 struct intf_A_interface {
98 	/**
99 	 * @param interface name of the objects interface
100 	 * @param version version of the objects interface
101 	 */
102 	void (*rq1)(struct wl_client *client,
103 		    struct wl_resource *resource,
104 		    const char *interface, uint32_t version, uint32_t untyped_new);
105 	/**
106 	 */
107 	void (*rq2)(struct wl_client *client,
108 		    struct wl_resource *resource,
109 		    uint32_t typed_new,
110 		    const char *str,
111 		    int32_t i,
112 		    uint32_t u,
113 		    wl_fixed_t f,
114 		    int32_t fd,
115 		    struct wl_resource *obj);
116 	/**
117 	 */
118 	void (*destroy)(struct wl_client *client,
119 			struct wl_resource *resource);
120 };
121 
122 #define INTF_A_HEY 0
123 
124 /**
125  * @ingroup iface_intf_A
126  */
127 #define INTF_A_HEY_SINCE_VERSION 1
128 
129 /**
130  * @ingroup iface_intf_A
131  */
132 #define INTF_A_RQ1_SINCE_VERSION 1
133 /**
134  * @ingroup iface_intf_A
135  */
136 #define INTF_A_RQ2_SINCE_VERSION 1
137 /**
138  * @ingroup iface_intf_A
139  */
140 #define INTF_A_DESTROY_SINCE_VERSION 1
141 
142 /**
143  * @ingroup iface_intf_A
144  * Sends an hey event to the client owning the resource.
145  * @param resource_ The client's resource
146  */
147 static inline void
intf_A_send_hey(struct wl_resource * resource_)148 intf_A_send_hey(struct wl_resource *resource_)
149 {
150 	wl_resource_post_event(resource_, INTF_A_HEY);
151 }
152 
153 #ifdef  __cplusplus
154 }
155 #endif
156 
157 #endif
158