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>
This commit is contained in:
Simon Ser 2024-04-08 13:32:31 +02:00
parent da8e1bbc45
commit 80c65f862f
8 changed files with 105 additions and 3 deletions

View file

@ -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
@ -97,6 +103,10 @@ enum intf_A_foo {
* @ingroup iface_intf_A
*/
#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.
@ -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