OLD | NEW |
1 /* | 1 /* Generated by wayland-scanner 1.11.0 */ |
| 2 |
| 3 #ifndef STYLUS_UNSTABLE_V1_SERVER_PROTOCOL_H |
| 4 #define STYLUS_UNSTABLE_V1_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_stylus_unstable_v1 The stylus_unstable_v1 protocol |
| 19 * @section page_ifaces_stylus_unstable_v1 Interfaces |
| 20 * - @subpage page_iface_zwp_stylus_v1 - extends wl_pointer with events for on-s
creen stylus |
| 21 * - @subpage page_iface_zwp_pointer_stylus_v1 - stylus extension for pointer |
| 22 * @section page_copyright_stylus_unstable_v1 Copyright |
| 23 * <pre> |
| 24 * |
2 * Copyright 2016 The Chromium Authors. | 25 * Copyright 2016 The Chromium Authors. |
3 * | 26 * |
4 * Permission is hereby granted, free of charge, to any person obtaining a | 27 * Permission is hereby granted, free of charge, to any person obtaining a |
5 * copy of this software and associated documentation files (the "Software"), | 28 * copy of this software and associated documentation files (the "Software"), |
6 * to deal in the Software without restriction, including without limitation | 29 * to deal in the Software without restriction, including without limitation |
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, | 30 * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
8 * and/or sell copies of the Software, and to permit persons to whom the | 31 * and/or sell copies of the Software, and to permit persons to whom the |
9 * Software is furnished to do so, subject to the following conditions: | 32 * Software is furnished to do so, subject to the following conditions: |
10 * | 33 * |
11 * The above copyright notice and this permission notice (including the next | 34 * The above copyright notice and this permission notice (including the next |
12 * paragraph) shall be included in all copies or substantial portions of the | 35 * paragraph) shall be included in all copies or substantial portions of the |
13 * Software. | 36 * Software. |
14 * | 37 * |
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 39 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | 40 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 41 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 42 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 43 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 * DEALINGS IN THE SOFTWARE. | 44 * DEALINGS IN THE SOFTWARE. |
| 45 * </pre> |
22 */ | 46 */ |
23 | 47 struct wl_pointer; |
24 #ifndef STYLUS_UNSTABLE_V1_SERVER_PROTOCOL_H | 48 struct zwp_pointer_stylus_v1; |
25 #define STYLUS_UNSTABLE_V1_SERVER_PROTOCOL_H | |
26 | |
27 #ifdef __cplusplus | |
28 extern "C" { | |
29 #endif | |
30 | |
31 #include <stdint.h> | |
32 #include <stddef.h> | |
33 #include "wayland-util.h" | |
34 | |
35 struct wl_client; | |
36 struct wl_resource; | |
37 | |
38 struct zwp_stylus_v1; | 49 struct zwp_stylus_v1; |
39 struct zwp_pointer_stylus_v1; | |
40 | |
41 extern const struct wl_interface zwp_stylus_v1_interface; | |
42 extern const struct wl_interface zwp_pointer_stylus_v1_interface; | |
43 | 50 |
44 /** | 51 /** |
45 * zwp_stylus_v1 - extends wl_pointer with events for on-screen stylus | 52 * @page page_iface_zwp_stylus_v1 zwp_stylus_v1 |
46 * @get_pointer_stylus: get stylus interface for pointer | 53 * @section page_iface_zwp_stylus_v1_desc Description |
47 * | 54 * |
48 * Allows a wl_pointer to represent an on-screen stylus. The client can | 55 * Allows a wl_pointer to represent an on-screen stylus. The client can |
49 * interpret the on-screen stylus like any other mouse device, and use this | 56 * interpret the on-screen stylus like any other mouse device, and use |
50 * protocol to obtain detail information about the type of stylus, as well | 57 * this protocol to obtain detail information about the type of stylus, |
51 * as the force and tilt of the tool. | 58 * as well as the force and tilt of the tool. |
52 * | 59 * |
53 * These events are to be fired by the server within the same frame as | 60 * These events are to be fired by the server within the same frame as other |
54 * other wl_pointer events. | 61 * wl_pointer events. |
55 * | 62 * |
56 * Warning! The protocol described in this file is experimental and | 63 * Warning! The protocol described in this file is experimental and |
57 * backward incompatible changes may be made. Backward compatible changes | 64 * backward incompatible changes may be made. Backward compatible changes |
58 * may be added together with the corresponding uinterface version bump. | 65 * may be added together with the corresponding uinterface version bump. |
59 * Backward incompatible changes are done by bumping the version number in | 66 * Backward incompatible changes are done by bumping the version number in |
60 * the protocol and uinterface names and resetting the interface version. | 67 * the protocol and uinterface names and resetting the interface version. |
61 * Once the protocol is to be declared stable, the 'z' prefix and the | 68 * Once the protocol is to be declared stable, the 'z' prefix and the |
62 * version number in the protocol and interface names are removed and the | 69 * version number in the protocol and interface names are removed and the |
63 * interface version number is reset. | 70 * interface version number is reset. |
| 71 * @section page_iface_zwp_stylus_v1_api API |
| 72 * See @ref iface_zwp_stylus_v1. |
| 73 */ |
| 74 /** |
| 75 * @defgroup iface_zwp_stylus_v1 The zwp_stylus_v1 interface |
| 76 * |
| 77 * Allows a wl_pointer to represent an on-screen stylus. The client can |
| 78 * interpret the on-screen stylus like any other mouse device, and use |
| 79 * this protocol to obtain detail information about the type of stylus, |
| 80 * as well as the force and tilt of the tool. |
| 81 * |
| 82 * These events are to be fired by the server within the same frame as other |
| 83 * wl_pointer events. |
| 84 * |
| 85 * Warning! The protocol described in this file is experimental and |
| 86 * backward incompatible changes may be made. Backward compatible changes |
| 87 * may be added together with the corresponding uinterface version bump. |
| 88 * Backward incompatible changes are done by bumping the version number in |
| 89 * the protocol and uinterface names and resetting the interface version. |
| 90 * Once the protocol is to be declared stable, the 'z' prefix and the |
| 91 * version number in the protocol and interface names are removed and the |
| 92 * interface version number is reset. |
64 */ | 93 */ |
| 94 extern const struct wl_interface zwp_stylus_v1_interface; |
| 95 /** |
| 96 * @page page_iface_zwp_pointer_stylus_v1 zwp_pointer_stylus_v1 |
| 97 * @section page_iface_zwp_pointer_stylus_v1_desc Description |
| 98 * |
| 99 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with |
| 100 * events to describe details about a stylus acting as a pointer. |
| 101 * @section page_iface_zwp_pointer_stylus_v1_api API |
| 102 * See @ref iface_zwp_pointer_stylus_v1. |
| 103 */ |
| 104 /** |
| 105 * @defgroup iface_zwp_pointer_stylus_v1 The zwp_pointer_stylus_v1 interface |
| 106 * |
| 107 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with |
| 108 * events to describe details about a stylus acting as a pointer. |
| 109 */ |
| 110 extern const struct wl_interface zwp_pointer_stylus_v1_interface; |
| 111 |
| 112 /** |
| 113 * @ingroup iface_zwp_stylus_v1 |
| 114 * @struct zwp_stylus_v1_interface |
| 115 */ |
65 struct zwp_stylus_v1_interface { | 116 struct zwp_stylus_v1_interface { |
66 /** | 117 /** |
67 » * get_pointer_stylus - get stylus interface for pointer | 118 » * get stylus interface for pointer |
68 » * @id: (none) | |
69 » * @pointer: (none) | |
70 * | 119 * |
71 * Create pointer_stylus object. See zwp_pointer_stylus_v1 | 120 * Create pointer_stylus object. See zwp_pointer_stylus_v1 |
72 * interface for details. | 121 * interface for details. |
73 */ | 122 */ |
74 void (*get_pointer_stylus)(struct wl_client *client, | 123 void (*get_pointer_stylus)(struct wl_client *client, |
75 struct wl_resource *resource, | 124 struct wl_resource *resource, |
76 uint32_t id, | 125 uint32_t id, |
77 struct wl_resource *pointer); | 126 struct wl_resource *pointer); |
78 }; | 127 }; |
79 | 128 |
| 129 |
80 #ifndef ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM | 130 #ifndef ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM |
81 #define ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM | 131 #define ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM |
82 /** | 132 /** |
83 * zwp_pointer_stylus_v1_tool_type - tool type of device. | 133 * @ingroup iface_zwp_pointer_stylus_v1 |
84 * @ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE: Mouse or touchpad, not a | 134 * tool type of device. |
85 *» stylus. | |
86 * @ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN: Pen | |
87 * @ZWP_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH: Touch | |
88 * @ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ERASER: Eraser | |
89 * | |
90 * | |
91 */ | 135 */ |
92 enum zwp_pointer_stylus_v1_tool_type { | 136 enum zwp_pointer_stylus_v1_tool_type { |
| 137 /** |
| 138 * Mouse or touchpad, not a stylus. |
| 139 */ |
93 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE = 0, | 140 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE = 0, |
| 141 /** |
| 142 * Pen |
| 143 */ |
94 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN = 1, | 144 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN = 1, |
| 145 /** |
| 146 * Touch |
| 147 */ |
95 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH = 2, | 148 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH = 2, |
| 149 /** |
| 150 * Eraser |
| 151 */ |
96 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ERASER = 3, | 152 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ERASER = 3, |
97 }; | 153 }; |
98 #endif /* ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM */ | 154 #endif /* ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM */ |
99 | 155 |
100 /** | 156 /** |
101 * zwp_pointer_stylus_v1 - stylus extension for pointer | 157 * @ingroup iface_zwp_pointer_stylus_v1 |
102 * @destroy: destroy stylus object | 158 * @struct zwp_pointer_stylus_v1_interface |
103 * | |
104 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface | |
105 * with events to describe details about a stylus acting as a pointer. | |
106 */ | 159 */ |
107 struct zwp_pointer_stylus_v1_interface { | 160 struct zwp_pointer_stylus_v1_interface { |
108 /** | 161 /** |
109 » * destroy - destroy stylus object | 162 » * destroy stylus object |
110 * | 163 * |
111 * | 164 * |
112 */ | 165 */ |
113 void (*destroy)(struct wl_client *client, | 166 void (*destroy)(struct wl_client *client, |
114 struct wl_resource *resource); | 167 struct wl_resource *resource); |
115 }; | 168 }; |
116 | 169 |
117 #define ZWP_POINTER_STYLUS_V1_TOOL_CHANGE 0 | 170 #define ZWP_POINTER_STYLUS_V1_TOOL_CHANGE 0 |
118 #define ZWP_POINTER_STYLUS_V1_FORCE 1 | 171 #define ZWP_POINTER_STYLUS_V1_FORCE 1 |
119 #define ZWP_POINTER_STYLUS_V1_TILT 2 | 172 #define ZWP_POINTER_STYLUS_V1_TILT 2 |
120 | 173 |
| 174 /** |
| 175 * @ingroup iface_zwp_pointer_stylus_v1 |
| 176 */ |
| 177 #define ZWP_POINTER_STYLUS_V1_TOOL_CHANGE_SINCE_VERSION 1 |
| 178 /** |
| 179 * @ingroup iface_zwp_pointer_stylus_v1 |
| 180 */ |
| 181 #define ZWP_POINTER_STYLUS_V1_FORCE_SINCE_VERSION 1 |
| 182 /** |
| 183 * @ingroup iface_zwp_pointer_stylus_v1 |
| 184 */ |
| 185 #define ZWP_POINTER_STYLUS_V1_TILT_SINCE_VERSION 1 |
| 186 |
| 187 /** |
| 188 * @ingroup iface_zwp_pointer_stylus_v1 |
| 189 * Sends an tool_change event to the client owning the resource. |
| 190 * @param resource_ The client's resource |
| 191 * @param type new device type |
| 192 */ |
121 static inline void | 193 static inline void |
122 zwp_pointer_stylus_v1_send_tool_change(struct wl_resource *resource_, uint32_t t
ype) | 194 zwp_pointer_stylus_v1_send_tool_change(struct wl_resource *resource_, uint32_t t
ype) |
123 { | 195 { |
124 wl_resource_post_event(resource_, ZWP_POINTER_STYLUS_V1_TOOL_CHANGE, typ
e); | 196 wl_resource_post_event(resource_, ZWP_POINTER_STYLUS_V1_TOOL_CHANGE, typ
e); |
125 } | 197 } |
126 | 198 |
| 199 /** |
| 200 * @ingroup iface_zwp_pointer_stylus_v1 |
| 201 * Sends an force event to the client owning the resource. |
| 202 * @param resource_ The client's resource |
| 203 * @param time timestamp with millisecond granularity |
| 204 * @param force new value of force |
| 205 */ |
127 static inline void | 206 static inline void |
128 zwp_pointer_stylus_v1_send_force(struct wl_resource *resource_, uint32_t time, w
l_fixed_t force) | 207 zwp_pointer_stylus_v1_send_force(struct wl_resource *resource_, uint32_t time, w
l_fixed_t force) |
129 { | 208 { |
130 wl_resource_post_event(resource_, ZWP_POINTER_STYLUS_V1_FORCE, time, for
ce); | 209 wl_resource_post_event(resource_, ZWP_POINTER_STYLUS_V1_FORCE, time, for
ce); |
131 } | 210 } |
132 | 211 |
| 212 /** |
| 213 * @ingroup iface_zwp_pointer_stylus_v1 |
| 214 * Sends an tilt event to the client owning the resource. |
| 215 * @param resource_ The client's resource |
| 216 * @param time timestamp with millisecond granularity |
| 217 * @param tilt_x tilt in x direction |
| 218 * @param tilt_y tilt in y direction |
| 219 */ |
133 static inline void | 220 static inline void |
134 zwp_pointer_stylus_v1_send_tilt(struct wl_resource *resource_, uint32_t time, wl
_fixed_t tilt_x, wl_fixed_t tilt_y) | 221 zwp_pointer_stylus_v1_send_tilt(struct wl_resource *resource_, uint32_t time, wl
_fixed_t tilt_x, wl_fixed_t tilt_y) |
135 { | 222 { |
136 wl_resource_post_event(resource_, ZWP_POINTER_STYLUS_V1_TILT, time, tilt
_x, tilt_y); | 223 wl_resource_post_event(resource_, ZWP_POINTER_STYLUS_V1_TILT, time, tilt
_x, tilt_y); |
137 } | 224 } |
138 | 225 |
139 #ifdef __cplusplus | 226 #ifdef __cplusplus |
140 } | 227 } |
141 #endif | 228 #endif |
142 | 229 |
143 #endif | 230 #endif |
OLD | NEW |