aboutsummaryrefslogtreecommitdiffstats
path: root/tests/data/small-server.h
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2024-04-08 13:32:31 +0200
committerSimon Ser <contact@emersion.fr>2024-04-24 16:18:28 +0000
commit80c65f862f7919691d3b0d31810f5a40f8675f37 (patch)
treeb8941a0918ffb67c1b1bf7d47408f5d9e56fbfb2 /tests/data/small-server.h
parentprotocol: mark wl_pointer.axis_discrete as deprecated (diff)
downloadwayland-80c65f862f7919691d3b0d31810f5a40f8675f37.tar
wayland-80c65f862f7919691d3b0d31810f5a40f8675f37.tar.gz
wayland-80c65f862f7919691d3b0d31810f5a40f8675f37.tar.bz2
wayland-80c65f862f7919691d3b0d31810f5a40f8675f37.tar.lz
wayland-80c65f862f7919691d3b0d31810f5a40f8675f37.tar.xz
wayland-80c65f862f7919691d3b0d31810f5a40f8675f37.tar.zst
wayland-80c65f862f7919691d3b0d31810f5a40f8675f37.zip
tests: add deprecated-since attributes
Add a new event and enum entry to small.xml with a deprecated-since attribute to exercise the scanner code generation. Signed-off-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'tests/data/small-server.h')
-rw-r--r--tests/data/small-server.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/data/small-server.h b/tests/data/small-server.h
index 13fd1ed..009d9cd 100644
--- a/tests/data/small-server.h
+++ b/tests/data/small-server.h
@@ -88,6 +88,12 @@ enum intf_A_foo {
* @since 2
*/
INTF_A_FOO_NEGATIVE = -1,
+ /**
+ * this is a deprecated value
+ * @since 2
+ * @deprecated Deprecated since version 3
+ */
+ INTF_A_FOO_DEPRECATED = 3,
};
/**
* @ingroup iface_intf_A
@@ -99,6 +105,10 @@ enum intf_A_foo {
#define INTF_A_FOO_NEGATIVE_SINCE_VERSION 2
/**
* @ingroup iface_intf_A
+ */
+#define INTF_A_FOO_DEPRECATED_SINCE_VERSION 2
+/**
+ * @ingroup iface_intf_A
* Validate a intf_A foo value.
*
* @return true on success, false on error.
@@ -115,6 +125,8 @@ intf_A_foo_is_valid(uint32_t value, uint32_t version) {
return version >= 2;
case (uint32_t)INTF_A_FOO_NEGATIVE:
return version >= 2;
+ case INTF_A_FOO_DEPRECATED:
+ return version >= 2;
default:
return false;
}
@@ -151,11 +163,16 @@ struct intf_A_interface {
};
#define INTF_A_HEY 0
+#define INTF_A_YO 1
/**
* @ingroup iface_intf_A
*/
#define INTF_A_HEY_SINCE_VERSION 1
+/**
+ * @ingroup iface_intf_A
+ */
+#define INTF_A_YO_SINCE_VERSION 2
/**
* @ingroup iface_intf_A
@@ -181,6 +198,17 @@ intf_A_send_hey(struct wl_resource *resource_)
wl_resource_post_event(resource_, INTF_A_HEY);
}
+/**
+ * @ingroup iface_intf_A
+ * Sends an yo event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+intf_A_send_yo(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, INTF_A_YO);
+}
+
#ifdef __cplusplus
}
#endif