/* Generated by wayland-scanner 1.26.0 */

#ifndef TREELAND_INPUT_MANAGER_UNSTABLE_V1_SERVER_PROTOCOL_H
#define TREELAND_INPUT_MANAGER_UNSTABLE_V1_SERVER_PROTOCOL_H

#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"

#ifdef  __cplusplus
extern "C" {
#endif

struct wl_client;
struct wl_resource;

/**
 * @page page_treeland_input_manager_unstable_v1 The treeland_input_manager_unstable_v1 protocol
 * configure input devices managed by treeland
 *
 * @section page_desc_treeland_input_manager_unstable_v1 Description
 *
 * This protocol allows a privileged client to discover seat capabilities
 * and configure compositor-managed mouse, touchpad, and keyboard devices.
 *
 * A treeland_input_manager_v1 object is a global manager. It creates
 * settings objects that represent configuration state for existing input
 * devices; those settings objects are not the device objects themselves.
 *
 * For mouse and touchpad devices, pointer device settings such as
 * acceleration speed, acceleration profile, natural scrolling, scroll
 * factor, handed mode, double-click interval, send events mode,
 * disable-while-typing and tap-to-click are managed through a
 * treeland_pointer_device_configuration_v1 object created from the
 * device-specific settings interface.
 *
 * Warning! This protocol is EXPERIMENTAL and under active development.
 * It may change at any time, including in backward-incompatible ways,
 * without incrementing the interface major version and without prior
 * notice. No compatibility guarantees of any kind are provided. Clients
 * and compositors must track the upstream definition in treeland-protocols
 * and must not rely on the current interface names, requests, events, or
 * semantics remaining stable across releases.
 *
 * @section page_ifaces_treeland_input_manager_unstable_v1 Interfaces
 * - @subpage page_iface_treeland_input_manager_v1 - global input device manager
 * - @subpage page_iface_treeland_pointer_device_configuration_v1 - pointer device configuration object
 * - @subpage page_iface_treeland_mouse_settings_v1 - mouse settings factory object
 * - @subpage page_iface_treeland_touchpad_settings_v1 - touchpad settings factory object
 * - @subpage page_iface_treeland_keyboard_settings_v1 - keyboard settings object
 * @section page_copyright_treeland_input_manager_unstable_v1 Copyright
 * <pre>
 *
 * SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
 * SPDX-License-Identifier: MIT
 * </pre>
 */
struct treeland_input_manager_v1;
struct treeland_keyboard_settings_v1;
struct treeland_mouse_settings_v1;
struct treeland_pointer_device_configuration_v1;
struct treeland_touchpad_settings_v1;
struct wl_seat;

#ifndef TREELAND_INPUT_MANAGER_V1_INTERFACE
#define TREELAND_INPUT_MANAGER_V1_INTERFACE
/**
 * @page page_iface_treeland_input_manager_v1 treeland_input_manager_v1
 * @section page_iface_treeland_input_manager_v1_desc Description
 *
 * The treeland_input_manager_v1 interface is a global object used to
 * create per-device settings objects for input devices exposed by the
 * compositor.
 *
 * The compositor advertises device capability changes with the
 * capability_available and capability_unavailable events.
 *
 * For each target device or seat-level settings scope, the compositor
 * may allow at most one live settings object of a given interface
 * created from one manager object.
 *
 * virtual-pointer and virtual-keyboard are not included in the list.
 * @section page_iface_treeland_input_manager_v1_api API
 * See @ref iface_treeland_input_manager_v1.
 */
/**
 * @defgroup iface_treeland_input_manager_v1 The treeland_input_manager_v1 interface
 *
 * The treeland_input_manager_v1 interface is a global object used to
 * create per-device settings objects for input devices exposed by the
 * compositor.
 *
 * The compositor advertises device capability changes with the
 * capability_available and capability_unavailable events.
 *
 * For each target device or seat-level settings scope, the compositor
 * may allow at most one live settings object of a given interface
 * created from one manager object.
 *
 * virtual-pointer and virtual-keyboard are not included in the list.
 */
extern const struct wl_interface treeland_input_manager_v1_interface;
#endif
#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_INTERFACE
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_INTERFACE
/**
 * @page page_iface_treeland_pointer_device_configuration_v1 treeland_pointer_device_configuration_v1
 * @section page_iface_treeland_pointer_device_configuration_v1_desc Description
 *
 * The treeland_pointer_device_configuration_v1 interface represents
 * pending configuration for pointer devices associated with the parent
 * device settings object.
 *
 * This object is created via get_pointer_configuration on a
 * treeland_mouse_settings_v1 or treeland_touchpad_settings_v1 object.
 * It collects configuration that applies to the associated device
 * type.
 *
 * Requests on this object update pending state. The compositor
 * applies the accumulated settings when the client sends apply.
 * Destroying the object before apply discards any pending state that
 * has not yet been applied.
 *
 * The compositor sends configuration events after object creation to
 * report the current effective settings. It may later send additional
 * state batches when those effective settings change for
 * compositor-defined reasons. A done event terminates each event
 * batch.
 * @section page_iface_treeland_pointer_device_configuration_v1_api API
 * See @ref iface_treeland_pointer_device_configuration_v1.
 */
/**
 * @defgroup iface_treeland_pointer_device_configuration_v1 The treeland_pointer_device_configuration_v1 interface
 *
 * The treeland_pointer_device_configuration_v1 interface represents
 * pending configuration for pointer devices associated with the parent
 * device settings object.
 *
 * This object is created via get_pointer_configuration on a
 * treeland_mouse_settings_v1 or treeland_touchpad_settings_v1 object.
 * It collects configuration that applies to the associated device
 * type.
 *
 * Requests on this object update pending state. The compositor
 * applies the accumulated settings when the client sends apply.
 * Destroying the object before apply discards any pending state that
 * has not yet been applied.
 *
 * The compositor sends configuration events after object creation to
 * report the current effective settings. It may later send additional
 * state batches when those effective settings change for
 * compositor-defined reasons. A done event terminates each event
 * batch.
 */
extern const struct wl_interface treeland_pointer_device_configuration_v1_interface;
#endif
#ifndef TREELAND_MOUSE_SETTINGS_V1_INTERFACE
#define TREELAND_MOUSE_SETTINGS_V1_INTERFACE
/**
 * @page page_iface_treeland_mouse_settings_v1 treeland_mouse_settings_v1
 * @section page_iface_treeland_mouse_settings_v1_desc Description
 *
 * The treeland_mouse_settings_v1 interface acts as a factory for
 * treeland_pointer_device_configuration_v1 objects that manage mouse
 * device settings on the target seat.
 *
 * A treeland_pointer_device_configuration_v1 object is created via
 * get_pointer_configuration on this object.
 * @section page_iface_treeland_mouse_settings_v1_api API
 * See @ref iface_treeland_mouse_settings_v1.
 */
/**
 * @defgroup iface_treeland_mouse_settings_v1 The treeland_mouse_settings_v1 interface
 *
 * The treeland_mouse_settings_v1 interface acts as a factory for
 * treeland_pointer_device_configuration_v1 objects that manage mouse
 * device settings on the target seat.
 *
 * A treeland_pointer_device_configuration_v1 object is created via
 * get_pointer_configuration on this object.
 */
extern const struct wl_interface treeland_mouse_settings_v1_interface;
#endif
#ifndef TREELAND_TOUCHPAD_SETTINGS_V1_INTERFACE
#define TREELAND_TOUCHPAD_SETTINGS_V1_INTERFACE
/**
 * @page page_iface_treeland_touchpad_settings_v1 treeland_touchpad_settings_v1
 * @section page_iface_treeland_touchpad_settings_v1_desc Description
 *
 * The treeland_touchpad_settings_v1 interface acts as a factory for
 * treeland_pointer_device_configuration_v1 objects that manage
 * touchpad device settings on the target seat.
 *
 * A treeland_pointer_device_configuration_v1 object is created via
 * get_pointer_configuration on this object.
 * @section page_iface_treeland_touchpad_settings_v1_api API
 * See @ref iface_treeland_touchpad_settings_v1.
 */
/**
 * @defgroup iface_treeland_touchpad_settings_v1 The treeland_touchpad_settings_v1 interface
 *
 * The treeland_touchpad_settings_v1 interface acts as a factory for
 * treeland_pointer_device_configuration_v1 objects that manage
 * touchpad device settings on the target seat.
 *
 * A treeland_pointer_device_configuration_v1 object is created via
 * get_pointer_configuration on this object.
 */
extern const struct wl_interface treeland_touchpad_settings_v1_interface;
#endif
#ifndef TREELAND_KEYBOARD_SETTINGS_V1_INTERFACE
#define TREELAND_KEYBOARD_SETTINGS_V1_INTERFACE
/**
 * @page page_iface_treeland_keyboard_settings_v1 treeland_keyboard_settings_v1
 * @section page_iface_treeland_keyboard_settings_v1_desc Description
 *
 * The treeland_keyboard_settings_v1 interface represents pending
 * settings for all keyboard associated with the target seat.
 *
 * Requests on this object update pending keyboard state. The
 * compositor applies the accumulated settings when the client sends
 * apply.
 *
 * The compositor sends keyboard-specific state events after object
 * creation to report the current effective settings for the target
 * seat. It may later send additional state batches when those
 * effective settings change for compositor-defined reasons. A done
 * event terminates each event batch.
 * @section page_iface_treeland_keyboard_settings_v1_api API
 * See @ref iface_treeland_keyboard_settings_v1.
 */
/**
 * @defgroup iface_treeland_keyboard_settings_v1 The treeland_keyboard_settings_v1 interface
 *
 * The treeland_keyboard_settings_v1 interface represents pending
 * settings for all keyboard associated with the target seat.
 *
 * Requests on this object update pending keyboard state. The
 * compositor applies the accumulated settings when the client sends
 * apply.
 *
 * The compositor sends keyboard-specific state events after object
 * creation to report the current effective settings for the target
 * seat. It may later send additional state batches when those
 * effective settings change for compositor-defined reasons. A done
 * event terminates each event batch.
 */
extern const struct wl_interface treeland_keyboard_settings_v1_interface;
#endif

#ifndef TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_ENUM
#define TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_ENUM
enum treeland_input_manager_v1_device_type {
	/**
	 * mouse input device
	 */
	TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_MOUSE = 1,
	/**
	 * touchpad input device
	 */
	TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_TOUCHPAD = 2,
	/**
	 * keyboard input device
	 */
	TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_KEYBOARD = 4,
};
#endif /* TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_ENUM */

#ifndef TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_ENUM_IS_VALID
#define TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_input_manager_v1
 * Validate a treeland_input_manager_v1 device_type value.
 *
 * @return true on success, false on error.
 * @ref treeland_input_manager_v1_device_type
 */
static inline bool
treeland_input_manager_v1_device_type_is_valid(uint32_t value, uint32_t version) {
	uint32_t valid = 0;
	if (version >= 1)
		valid |= TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_MOUSE;
	if (version >= 1)
		valid |= TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_TOUCHPAD;
	if (version >= 1)
		valid |= TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_KEYBOARD;
	return (value & ~valid) == 0;
}
#endif /* TREELAND_INPUT_MANAGER_V1_DEVICE_TYPE_ENUM_IS_VALID */

#ifndef TREELAND_INPUT_MANAGER_V1_STATE_ENUM
#define TREELAND_INPUT_MANAGER_V1_STATE_ENUM
enum treeland_input_manager_v1_state {
	/**
	 * disabled state
	 */
	TREELAND_INPUT_MANAGER_V1_STATE_DISABLED = 0,
	/**
	 * enabled state
	 */
	TREELAND_INPUT_MANAGER_V1_STATE_ENABLED = 1,
};
#endif /* TREELAND_INPUT_MANAGER_V1_STATE_ENUM */

#ifndef TREELAND_INPUT_MANAGER_V1_STATE_ENUM_IS_VALID
#define TREELAND_INPUT_MANAGER_V1_STATE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_input_manager_v1
 * Validate a treeland_input_manager_v1 state value.
 *
 * @return true on success, false on error.
 * @ref treeland_input_manager_v1_state
 */
static inline bool
treeland_input_manager_v1_state_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case TREELAND_INPUT_MANAGER_V1_STATE_DISABLED:
		return version >= 1;
	case TREELAND_INPUT_MANAGER_V1_STATE_ENABLED:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* TREELAND_INPUT_MANAGER_V1_STATE_ENUM_IS_VALID */

/**
 * @ingroup iface_treeland_input_manager_v1
 * @struct treeland_input_manager_v1_interface
 */
struct treeland_input_manager_v1_interface {
	/**
	 * destroy the input manager
	 *
	 * This informs the compositor that the treeland input manager
	 * object will no longer be used.
	 *
	 * Existing objects created through this interface are not
	 * destroyed automatically. Clients should destroy those objects
	 * before destroying the manager.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
	/**
	 * create a mouse-specific settings object
	 *
	 * Create a treeland_mouse_settings_v1 object bound to the
	 * specified wl_seat.
	 *
	 * The created object acts as a factory for
	 * treeland_pointer_device_configuration_v1 objects that manage
	 * mouse device settings on the target seat.
	 *
	 * The seat must currently expose mouse capability. If the seat
	 * does not identify a valid mouse-capable target, the compositor
	 * raises the protocol error.
	 *
	 * Note: 1. The treeland_mouse_settings_v1 object must be destroyed
	 * before the associated wl_seat is destroyed.
	 * @param seat seat whose mouse-specific settings are being managed
	 */
	void (*get_mouse_settings)(struct wl_client *client,
				   struct wl_resource *resource,
				   uint32_t id,
				   struct wl_resource *seat);
	/**
	 * create a touchpad-specific settings object
	 *
	 * Create a treeland_touchpad_settings_v1 object bound to the
	 * specified wl_seat.
	 *
	 * The created object acts as a factory for
	 * treeland_pointer_device_configuration_v1 objects that manage
	 * touchpad device settings on the target seat.
	 *
	 * The seat must currently expose touchpad capability. If the seat
	 * does not identify a valid touchpad-capable target, the
	 * compositor raises the protocol error.
	 *
	 * Note: 1. The treeland_touchpad_settings_v1 object must be
	 * destroyed before the associated wl_seat is destroyed.
	 * @param seat seat whose touchpad-specific settings are being managed
	 */
	void (*get_touchpad_settings)(struct wl_client *client,
				      struct wl_resource *resource,
				      uint32_t id,
				      struct wl_resource *seat);
	/**
	 * create a keyboard settings object
	 *
	 * Create a treeland_keyboard_settings_v1 object bound to the
	 * specified wl_seat.
	 *
	 * The seat must currently expose keyboard capability. If the seat
	 * does not identify a valid keyboard-capable target, the
	 * compositor raises the protocol error.
	 *
	 * Note: 1. The treeland_keyboard_settings_v1 object must be
	 * destroyed before the associated wl_seat is destroyed.
	 * @param seat seat whose keyboard-specific settings are being managed
	 */
	void (*get_keyboard_settings)(struct wl_client *client,
				      struct wl_resource *resource,
				      uint32_t id,
				      struct wl_resource *seat);
};

#define TREELAND_INPUT_MANAGER_V1_CAPABILITY_AVAILABLE 0
#define TREELAND_INPUT_MANAGER_V1_CAPABILITY_UNAVAILABLE 1

/**
 * @ingroup iface_treeland_input_manager_v1
 */
#define TREELAND_INPUT_MANAGER_V1_CAPABILITY_AVAILABLE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_input_manager_v1
 */
#define TREELAND_INPUT_MANAGER_V1_CAPABILITY_UNAVAILABLE_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_input_manager_v1
 */
#define TREELAND_INPUT_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_input_manager_v1
 */
#define TREELAND_INPUT_MANAGER_V1_GET_MOUSE_SETTINGS_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_input_manager_v1
 */
#define TREELAND_INPUT_MANAGER_V1_GET_TOUCHPAD_SETTINGS_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_input_manager_v1
 */
#define TREELAND_INPUT_MANAGER_V1_GET_KEYBOARD_SETTINGS_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_input_manager_v1
 * Sends an capability_available event to the client owning the resource.
 * @param resource_ The client's resource
 * @param type type of the device capability
 * @param seat seat associated with the capability
 */
static inline void
treeland_input_manager_v1_send_capability_available(struct wl_resource *resource_, uint32_t type, struct wl_resource *seat)
{
	wl_resource_post_event(resource_, TREELAND_INPUT_MANAGER_V1_CAPABILITY_AVAILABLE, type, seat);
}

/**
 * @ingroup iface_treeland_input_manager_v1
 * Sends an capability_unavailable event to the client owning the resource.
 * @param resource_ The client's resource
 * @param type type of the device capability
 * @param seat seat associated with the capability
 */
static inline void
treeland_input_manager_v1_send_capability_unavailable(struct wl_resource *resource_, uint32_t type, struct wl_resource *seat)
{
	wl_resource_post_event(resource_, TREELAND_INPUT_MANAGER_V1_CAPABILITY_UNAVAILABLE, type, seat);
}

#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ENUM
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ENUM
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * pointer device features
 *
 * Optional features supported by pointer devices. The compositor
 * sends a feature event to indicate which features are supported
 * by at least one device associated with the parent settings
 * object. A client must only send a set request if the
 * corresponding feature has been advertised. It is a protocol error
 * to send a set request for a feature that has not been
 * advertised.
 */
enum treeland_pointer_device_configuration_v1_feature {
	/**
	 * device supports configuring scroll factor
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_SCROLL_FACTOR = 1,
	/**
	 * device supports configuring handed mode
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_HANDED_MODE = 2,
	/**
	 * device supports configuring acceleration speed
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ACCEL_SPEED = 4,
	/**
	 * device supports configuring acceleration profile
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ACCELERATION_PROFILE = 8,
	/**
	 * device supports configuring event delivery mode
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_SEND_EVENTS_MODE = 16,
	/**
	 * device supports configuring natural scrolling
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_NATURAL_SCROLL = 32,
	/**
	 * device supports disable-while-typing
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_DISABLE_WHILE_TYPING = 64,
	/**
	 * device supports tap-to-click
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_TAP_TO_CLICK = 128,
};
#endif /* TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ENUM */

#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ENUM_IS_VALID
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Validate a treeland_pointer_device_configuration_v1 feature value.
 *
 * @return true on success, false on error.
 * @ref treeland_pointer_device_configuration_v1_feature
 */
static inline bool
treeland_pointer_device_configuration_v1_feature_is_valid(uint32_t value, uint32_t version) {
	uint32_t valid = 0;
	if (version >= 1)
		valid |= TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_SCROLL_FACTOR;
	if (version >= 1)
		valid |= TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_HANDED_MODE;
	if (version >= 1)
		valid |= TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ACCEL_SPEED;
	if (version >= 1)
		valid |= TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ACCELERATION_PROFILE;
	if (version >= 1)
		valid |= TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_SEND_EVENTS_MODE;
	if (version >= 1)
		valid |= TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_NATURAL_SCROLL;
	if (version >= 1)
		valid |= TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_DISABLE_WHILE_TYPING;
	if (version >= 1)
		valid |= TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_TAP_TO_CLICK;
	return (value & ~valid) == 0;
}
#endif /* TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_ENUM_IS_VALID */

#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_ENUM
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_ENUM
enum treeland_pointer_device_configuration_v1_handed_mode {
	/**
	 * right-handed mode
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_RIGHT = 0,
	/**
	 * left-handed mode
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_LEFT = 1,
};
#endif /* TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_ENUM */

#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_ENUM_IS_VALID
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Validate a treeland_pointer_device_configuration_v1 handed_mode value.
 *
 * @return true on success, false on error.
 * @ref treeland_pointer_device_configuration_v1_handed_mode
 */
static inline bool
treeland_pointer_device_configuration_v1_handed_mode_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_RIGHT:
		return version >= 1;
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_LEFT:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_ENUM_IS_VALID */

#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_ENUM
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_ENUM
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * pointer acceleration profiles
 *
 * Pointer acceleration profiles. The semantics correspond to
 * libinput acceleration profiles.
 */
enum treeland_pointer_device_configuration_v1_acceleration_profile {
	/**
	 * device does not have a configurable acceleration profile
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_NONE = 0,
	/**
	 * use a flat acceleration profile
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_FLAT = 1,
	/**
	 * use an adaptive acceleration profile
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_ADAPTIVE = 2,
	/**
	 * use a custom acceleration profile
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_CUSTOM = 4,
};
#endif /* TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_ENUM */

#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_ENUM_IS_VALID
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Validate a treeland_pointer_device_configuration_v1 acceleration_profile value.
 *
 * @return true on success, false on error.
 * @ref treeland_pointer_device_configuration_v1_acceleration_profile
 */
static inline bool
treeland_pointer_device_configuration_v1_acceleration_profile_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_NONE:
		return version >= 1;
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_FLAT:
		return version >= 1;
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_ADAPTIVE:
		return version >= 1;
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_CUSTOM:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_ENUM_IS_VALID */

#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_ENUM
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_ENUM
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * pointer event delivery mode
 *
 * Modes controlling whether the target pointer device should send
 * events and whether those events depend on the presence of an
 * external pointer device on the same seat.
 */
enum treeland_pointer_device_configuration_v1_send_events_mode {
	/**
	 * send events from this device normally
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_ENABLED = 0,
	/**
	 * do not send events from this device
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_DISABLED = 1,
	/**
	 * if an external pointer device is plugged in, do not send events from this device; may be available on built-in pointer devices
	 */
	TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_DISABLED_ON_EXTERNAL_MOUSE = 2,
};
#endif /* TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_ENUM */

#ifndef TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_ENUM_IS_VALID
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Validate a treeland_pointer_device_configuration_v1 send_events_mode value.
 *
 * @return true on success, false on error.
 * @ref treeland_pointer_device_configuration_v1_send_events_mode
 */
static inline bool
treeland_pointer_device_configuration_v1_send_events_mode_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_ENABLED:
		return version >= 1;
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_DISABLED:
		return version >= 1;
	case TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_DISABLED_ON_EXTERNAL_MOUSE:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_ENUM_IS_VALID */

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * @struct treeland_pointer_device_configuration_v1_interface
 */
struct treeland_pointer_device_configuration_v1_interface {
	/**
	 * destroy the pointer device configuration object
	 *
	 * Destroy this treeland_pointer_device_configuration_v1 object.
	 *
	 * Destroying the object discards any pending state that has not
	 * yet been applied.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
	/**
	 * set the scroll delta scaling factor
	 *
	 * Set a scaling factor applied to scroll axis delta generated by
	 * wheel and other continuous scrolling input sources. This request
	 * requires the scroll_factor feature to be advertised via the
	 * feature event.
	 *
	 * The compositor multiplies scroll axis values by the specified
	 * factor before forwarding them to clients. This affects
	 * continuous scroll delta only and does not modify discrete scroll
	 * step events.
	 *
	 * This request updates only the pending state associated with this
	 * object. The change takes effect after the next apply request.
	 *
	 * Sending this request or the corresponding apply request does not
	 * by itself cause a scroll_factor event to be emitted.
	 *
	 * delta = factor * _delta
	 * @param factor scaling factor applied to scroll axis delta,                 The factor must be greater than 0.
	 */
	void (*set_scroll_factor)(struct wl_client *client,
				  struct wl_resource *resource,
				  wl_fixed_t factor);
	/**
	 * set the handedness mode
	 *
	 * Set whether primary and secondary buttons use left-handed or
	 * right-handed ordering. This request requires the handed_mode
	 * feature to be advertised via the feature event. The change takes
	 * effect on the next apply request.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause a handed_mode event to be emitted.
	 * @param mode desired handedness mode
	 */
	void (*set_handed_mode)(struct wl_client *client,
				struct wl_resource *resource,
				uint32_t mode);
	/**
	 * set the pointer acceleration speed
	 *
	 * Set the pointer acceleration speed. This request requires the
	 * accel_speed feature to be advertised via the feature event. The
	 * change takes effect on the next apply request.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause an accel_speed event to be emitted.
	 * @param accel_speed desired pointer acceleration speed, The valid range is -1.0 to 1.0,                  where 0.0 is the neutral default meaning no acceleration adjustment. Negative                  values reduce acceleration (cursor moves more slowly at higher speeds), positive                  values increase acceleration (cursor moves faster at higher speeds).
	 */
	void (*set_accel_speed)(struct wl_client *client,
				struct wl_resource *resource,
				wl_fixed_t accel_speed);
	/**
	 * set the acceleration profile
	 *
	 * Set the acceleration profile. This request requires the
	 * acceleration_profile feature to be advertised via the feature
	 * event. The change takes effect on the next apply request.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause an acceleration_profile event to be
	 * emitted.
	 * @param profile desired acceleration profile
	 */
	void (*set_acceleration_profile)(struct wl_client *client,
					 struct wl_resource *resource,
					 uint32_t profile);
	/**
	 * set the pointer event delivery mode
	 *
	 * Set how events from the target pointer device are delivered.
	 * This request requires the send_events_mode feature to be
	 * advertised via the feature event. The change takes effect on the
	 * next apply request.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause a send_events_mode event to be emitted.
	 * @param mode desired pointer event delivery mode
	 */
	void (*set_send_events_mode)(struct wl_client *client,
				     struct wl_resource *resource,
				     uint32_t mode);
	/**
	 * enable or disable natural scrolling
	 *
	 * Enable or disable natural scrolling. This request requires the
	 * natural_scroll feature to be advertised via the feature event.
	 * The change takes effect on the next apply request.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause a natural_scroll event to be emitted.
	 * @param state desired natural scrolling state
	 */
	void (*set_natural_scroll)(struct wl_client *client,
				   struct wl_resource *resource,
				   uint32_t state);
	/**
	 * set disable-while-typing
	 *
	 * Enable or disable temporarily disabling pointer devices while
	 * the user is typing. This request requires the
	 * disable_while_typing feature to be advertised via the feature
	 * event. The change takes effect on the next apply request.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause a disable_while_typing event to be
	 * emitted.
	 * @param state desired disable-while-typing state
	 */
	void (*set_disable_while_typing)(struct wl_client *client,
					 struct wl_resource *resource,
					 uint32_t state);
	/**
	 * set tap-to-click
	 *
	 * Enable or disable tap-to-click. This request requires the
	 * tap_to_click feature to be advertised via the feature event. The
	 * change takes effect on the next apply request.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause a tap_to_click event to be emitted.
	 * @param state desired tap-to-click state
	 */
	void (*set_tap_to_click)(struct wl_client *client,
				 struct wl_resource *resource,
				 uint32_t state);
	/**
	 * apply pending pointer device configuration changes
	 *
	 * Ask the compositor to apply the pending pointer device
	 * configuration carried by this object.
	 */
	void (*apply)(struct wl_client *client,
		      struct wl_resource *resource);
};

#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE 0
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SCROLL_FACTOR 1
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE 2
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCEL_SPEED 3
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE 4
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE 5
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_NATURAL_SCROLL 6
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_DISABLE_WHILE_TYPING 7
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_TAP_TO_CLICK 8
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FAILED 9
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_DONE 10

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SCROLL_FACTOR_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCEL_SPEED_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_NATURAL_SCROLL_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_DISABLE_WHILE_TYPING_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_TAP_TO_CLICK_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FAILED_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_DONE_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SET_SCROLL_FACTOR_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SET_HANDED_MODE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SET_ACCEL_SPEED_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SET_ACCELERATION_PROFILE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SET_SEND_EVENTS_MODE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SET_NATURAL_SCROLL_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SET_DISABLE_WHILE_TYPING_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SET_TAP_TO_CLICK_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 */
#define TREELAND_POINTER_DEVICE_CONFIGURATION_V1_APPLY_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an feature event to the client owning the resource.
 * @param resource_ The client's resource
 * @param feature supported pointer device features
 */
static inline void
treeland_pointer_device_configuration_v1_send_feature(struct wl_resource *resource_, uint32_t feature)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FEATURE, feature);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an scroll_factor event to the client owning the resource.
 * @param resource_ The client's resource
 * @param factor current scroll factor
 */
static inline void
treeland_pointer_device_configuration_v1_send_scroll_factor(struct wl_resource *resource_, wl_fixed_t factor)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SCROLL_FACTOR, factor);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an handed_mode event to the client owning the resource.
 * @param resource_ The client's resource
 * @param mode current handedness mode
 */
static inline void
treeland_pointer_device_configuration_v1_send_handed_mode(struct wl_resource *resource_, uint32_t mode)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_HANDED_MODE, mode);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an accel_speed event to the client owning the resource.
 * @param resource_ The client's resource
 * @param accel_speed current pointer acceleration speed
 */
static inline void
treeland_pointer_device_configuration_v1_send_accel_speed(struct wl_resource *resource_, wl_fixed_t accel_speed)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCEL_SPEED, accel_speed);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an acceleration_profile event to the client owning the resource.
 * @param resource_ The client's resource
 * @param profile current acceleration profile
 */
static inline void
treeland_pointer_device_configuration_v1_send_acceleration_profile(struct wl_resource *resource_, uint32_t profile)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_ACCELERATION_PROFILE, profile);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an send_events_mode event to the client owning the resource.
 * @param resource_ The client's resource
 * @param mode current pointer event delivery mode
 */
static inline void
treeland_pointer_device_configuration_v1_send_send_events_mode(struct wl_resource *resource_, uint32_t mode)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_SEND_EVENTS_MODE, mode);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an natural_scroll event to the client owning the resource.
 * @param resource_ The client's resource
 * @param state current natural scrolling state
 */
static inline void
treeland_pointer_device_configuration_v1_send_natural_scroll(struct wl_resource *resource_, uint32_t state)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_NATURAL_SCROLL, state);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an disable_while_typing event to the client owning the resource.
 * @param resource_ The client's resource
 * @param state current disable-while-typing state
 */
static inline void
treeland_pointer_device_configuration_v1_send_disable_while_typing(struct wl_resource *resource_, uint32_t state)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_DISABLE_WHILE_TYPING, state);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an tap_to_click event to the client owning the resource.
 * @param resource_ The client's resource
 * @param state current tap-to-click state
 */
static inline void
treeland_pointer_device_configuration_v1_send_tap_to_click(struct wl_resource *resource_, uint32_t state)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_TAP_TO_CLICK, state);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an failed event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
treeland_pointer_device_configuration_v1_send_failed(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_FAILED);
}

/**
 * @ingroup iface_treeland_pointer_device_configuration_v1
 * Sends an done event to the client owning the resource.
 * @param resource_ The client's resource
 * @param serial current configuration serial
 */
static inline void
treeland_pointer_device_configuration_v1_send_done(struct wl_resource *resource_, uint32_t serial)
{
	wl_resource_post_event(resource_, TREELAND_POINTER_DEVICE_CONFIGURATION_V1_DONE, serial);
}

/**
 * @ingroup iface_treeland_mouse_settings_v1
 * @struct treeland_mouse_settings_v1_interface
 */
struct treeland_mouse_settings_v1_interface {
	/**
	 * destroy the mouse settings object
	 *
	 * Destroy this treeland_mouse_settings_v1 object.
	 *
	 * Existing treeland_pointer_device_configuration_v1 objects
	 * created from this object are also destroyed.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
	/**
	 * create a pointer device configuration object
	 *
	 * Create a treeland_pointer_device_configuration_v1 object for
	 * this mouse settings scope.
	 *
	 * The created object manages mouse device configuration on the
	 * target seat. The serial argument must match the serial from the
	 * most recent done event sent on the previous
	 * treeland_pointer_device_configuration_v1 object for this
	 * treeland_mouse_settings_v1 object. For the first creation, the
	 * serial should be 0.
	 *
	 * Only one treeland_pointer_device_configuration_v1 object may
	 * exist for this treeland_mouse_settings_v1 object at a time.
	 * Creating a second one without destroying the first is a protocol
	 * error.
	 *
	 * If the serial does not match the current state, the compositor
	 * may immediately send a failed event on the new
	 * treeland_pointer_device_configuration_v1 object.
	 * @param serial serial from the last done event
	 */
	void (*get_pointer_configuration)(struct wl_client *client,
					  struct wl_resource *resource,
					  uint32_t id,
					  uint32_t serial);
};


/**
 * @ingroup iface_treeland_mouse_settings_v1
 */
#define TREELAND_MOUSE_SETTINGS_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_mouse_settings_v1
 */
#define TREELAND_MOUSE_SETTINGS_V1_GET_POINTER_CONFIGURATION_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_touchpad_settings_v1
 * @struct treeland_touchpad_settings_v1_interface
 */
struct treeland_touchpad_settings_v1_interface {
	/**
	 * destroy the touchpad settings object
	 *
	 * Destroy this treeland_touchpad_settings_v1 object.
	 *
	 * Existing treeland_pointer_device_configuration_v1 objects
	 * created from this object are also destroyed.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
	/**
	 * create a pointer device configuration object
	 *
	 * Create a treeland_pointer_device_configuration_v1 object for
	 * this touchpad settings scope.
	 *
	 * The created object manages touchpad device configuration on the
	 * target seat. The serial argument must match the serial from the
	 * most recent done event sent on the previous
	 * treeland_pointer_device_configuration_v1 object for this
	 * treeland_touchpad_settings_v1 object. For the first creation,
	 * the serial should be 0.
	 *
	 * Only one treeland_pointer_device_configuration_v1 object may
	 * exist for this treeland_touchpad_settings_v1 object at a time.
	 * Creating a second one without destroying the first is a protocol
	 * error.
	 *
	 * If the serial does not match the current state, the compositor
	 * may immediately send a failed event on the new
	 * treeland_pointer_device_configuration_v1 object.
	 * @param serial serial from the last done event
	 */
	void (*get_pointer_configuration)(struct wl_client *client,
					  struct wl_resource *resource,
					  uint32_t id,
					  uint32_t serial);
};


/**
 * @ingroup iface_treeland_touchpad_settings_v1
 */
#define TREELAND_TOUCHPAD_SETTINGS_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_touchpad_settings_v1
 */
#define TREELAND_TOUCHPAD_SETTINGS_V1_GET_POINTER_CONFIGURATION_SINCE_VERSION 1

#ifndef TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_ENUM
#define TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_ENUM
enum treeland_keyboard_settings_v1_toggle_state {
	/**
	 * off state
	 */
	TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_OFF = 0,
	/**
	 * on state
	 */
	TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_ON = 1,
};
#endif /* TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_ENUM */

#ifndef TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_ENUM_IS_VALID
#define TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * Validate a treeland_keyboard_settings_v1 toggle_state value.
 *
 * @return true on success, false on error.
 * @ref treeland_keyboard_settings_v1_toggle_state
 */
static inline bool
treeland_keyboard_settings_v1_toggle_state_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_OFF:
		return version >= 1;
	case TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_ON:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* TREELAND_KEYBOARD_SETTINGS_V1_TOGGLE_STATE_ENUM_IS_VALID */

#ifndef TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_ENUM
#define TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_ENUM
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * keyboard features
 *
 * Optional features supported by keyboard devices. The compositor
 * sends a feature event to indicate which features are supported
 * by at least one keyboard device associated with the target seat.
 * A client must only send a set request if the corresponding
 * feature has been advertised. It is a protocol error to send a
 * set request for a feature that has not been advertised.
 */
enum treeland_keyboard_settings_v1_feature {
	/**
	 * device supports configuring num lock state
	 */
	TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_NUM_LOCK = 1,
};
#endif /* TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_ENUM */

#ifndef TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_ENUM_IS_VALID
#define TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * Validate a treeland_keyboard_settings_v1 feature value.
 *
 * @return true on success, false on error.
 * @ref treeland_keyboard_settings_v1_feature
 */
static inline bool
treeland_keyboard_settings_v1_feature_is_valid(uint32_t value, uint32_t version) {
	uint32_t valid = 0;
	if (version >= 1)
		valid |= TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_NUM_LOCK;
	return (value & ~valid) == 0;
}
#endif /* TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_ENUM_IS_VALID */

/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * @struct treeland_keyboard_settings_v1_interface
 */
struct treeland_keyboard_settings_v1_interface {
	/**
	 * destroy the keyboard settings object
	 *
	 * Destroy this treeland_keyboard_settings_v1 object.
	 *
	 * Destroying the object discards any pending state that has not
	 * yet been applied.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
	/**
	 * set keyboard repeat rate and delay
	 *
	 * Set the keyboard repeat rate and delay to apply on the next
	 * apply request.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause a repeat event to be emitted.
	 * @param rate repeat rate in characters per second
	 * @param delay delay in milliseconds before repeating starts
	 */
	void (*set_repeat)(struct wl_client *client,
			   struct wl_resource *resource,
			   int32_t rate,
			   int32_t delay);
	/**
	 * set num lock state
	 *
	 * Set the num lock state to apply on the next apply request.
	 * This request requires the num_lock feature to be advertised via
	 * the feature event.
	 *
	 * This request updates only the pending state tracked by this
	 * object. Sending this request, or the following apply request,
	 * does not by itself cause a num_lock event to be emitted.
	 * @param state desired num lock state
	 */
	void (*set_num_lock)(struct wl_client *client,
			     struct wl_resource *resource,
			     uint32_t state);
	/**
	 * apply pending keyboard changes
	 *
	 * Ask the compositor to apply the pending keyboard settings
	 * carried by this object.
	 */
	void (*apply)(struct wl_client *client,
		      struct wl_resource *resource);
};

#define TREELAND_KEYBOARD_SETTINGS_V1_FEATURE 0
#define TREELAND_KEYBOARD_SETTINGS_V1_REPEAT 1
#define TREELAND_KEYBOARD_SETTINGS_V1_NUM_LOCK 2
#define TREELAND_KEYBOARD_SETTINGS_V1_FAILED 3
#define TREELAND_KEYBOARD_SETTINGS_V1_DONE 4

/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_FEATURE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_REPEAT_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_NUM_LOCK_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_FAILED_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_DONE_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_SET_REPEAT_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_SET_NUM_LOCK_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_settings_v1
 */
#define TREELAND_KEYBOARD_SETTINGS_V1_APPLY_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * Sends an feature event to the client owning the resource.
 * @param resource_ The client's resource
 * @param feature supported keyboard features
 */
static inline void
treeland_keyboard_settings_v1_send_feature(struct wl_resource *resource_, uint32_t feature)
{
	wl_resource_post_event(resource_, TREELAND_KEYBOARD_SETTINGS_V1_FEATURE, feature);
}

/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * Sends an repeat event to the client owning the resource.
 * @param resource_ The client's resource
 * @param rate repeat rate in characters per second
 * @param delay delay in milliseconds before repeating starts
 */
static inline void
treeland_keyboard_settings_v1_send_repeat(struct wl_resource *resource_, int32_t rate, int32_t delay)
{
	wl_resource_post_event(resource_, TREELAND_KEYBOARD_SETTINGS_V1_REPEAT, rate, delay);
}

/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * Sends an num_lock event to the client owning the resource.
 * @param resource_ The client's resource
 * @param state current num lock state
 */
static inline void
treeland_keyboard_settings_v1_send_num_lock(struct wl_resource *resource_, uint32_t state)
{
	wl_resource_post_event(resource_, TREELAND_KEYBOARD_SETTINGS_V1_NUM_LOCK, state);
}

/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * Sends an failed event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
treeland_keyboard_settings_v1_send_failed(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, TREELAND_KEYBOARD_SETTINGS_V1_FAILED);
}

/**
 * @ingroup iface_treeland_keyboard_settings_v1
 * Sends an done event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
treeland_keyboard_settings_v1_send_done(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, TREELAND_KEYBOARD_SETTINGS_V1_DONE);
}

#ifdef  __cplusplus
}
#endif

#endif
