Skip to content

Commit

Permalink
Update protocol files
Browse files Browse the repository at this point in the history
  • Loading branch information
flacjacket committed Aug 25, 2024
1 parent 192a955 commit 5c81d54
Show file tree
Hide file tree
Showing 2 changed files with 340 additions and 2 deletions.
36 changes: 35 additions & 1 deletion wlroots/include/pointer-constraints-unstable-v1-protocol.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by wayland-scanner 1.22.0 */
/* Generated by wayland-scanner 1.23.0 */

#ifndef POINTER_CONSTRAINTS_UNSTABLE_V1_SERVER_PROTOCOL_H
#define POINTER_CONSTRAINTS_UNSTABLE_V1_SERVER_PROTOCOL_H
Expand Down Expand Up @@ -241,6 +241,22 @@ enum zwp_pointer_constraints_v1_error {
*/
ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED = 1,
};
/**
* @ingroup iface_zwp_pointer_constraints_v1
* Validate a zwp_pointer_constraints_v1 error value.
*
* @return true on success, false on error.
* @ref zwp_pointer_constraints_v1_error
*/
static inline bool
zwp_pointer_constraints_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED:
return version >= 1;
default:
return false;
}
}
#endif /* ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM */

#ifndef ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM
Expand Down Expand Up @@ -273,6 +289,24 @@ enum zwp_pointer_constraints_v1_lifetime {
*/
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT = 2,
};
/**
* @ingroup iface_zwp_pointer_constraints_v1
* Validate a zwp_pointer_constraints_v1 lifetime value.
*
* @return true on success, false on error.
* @ref zwp_pointer_constraints_v1_lifetime
*/
static inline bool
zwp_pointer_constraints_v1_lifetime_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT:
return version >= 1;
case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT:
return version >= 1;
default:
return false;
}
}
#endif /* ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM */

/**
Expand Down
Loading

0 comments on commit 5c81d54

Please sign in to comment.