/* Generated by wayland-scanner 1.26.0 */

#ifndef TREELAND_KEYBOARD_STATE_NOTIFY_UNSTABLE_V1_CLIENT_PROTOCOL_H
#define TREELAND_KEYBOARD_STATE_NOTIFY_UNSTABLE_V1_CLIENT_PROTOCOL_H

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

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * @page page_treeland_keyboard_state_notify_unstable_v1 The treeland_keyboard_state_notify_unstable_v1 protocol
 * global keyboard state notification
 *
 * @section page_desc_treeland_keyboard_state_notify_unstable_v1 Description
 *
 * This protocol allows privileged clients to subscribe to global keyboard
 * state changes (e.g. Caps Lock, Num Lock).
 *
 * Clients create watcher objects through the manager global, each bound
 * to a seat. The client then configures the watcher with set_modifiers to
 * choose which modifiers to monitor, and set_flags to choose which event
 * types (locked, unlocked, or both) to receive. Configuration changes are
 * double-buffered and take effect atomically when the client sends apply.
 * Both set_modifiers and set_flags can be called multiple times before
 * apply; only the values from the most recent calls are committed. This
 * allows changing the configuration at runtime without destroying and
 * recreating the watcher. After apply, the compositor sends a
 * current_state event for each watched modifier containing its
 * current lock state, so the client can synchronize its initial
 * state without waiting for the next physical key press. The
 * compositor then sends
 * state_changed events on the watcher whenever any of the watched
 * modifiers changes lock state globally, regardless of which surface
 * has keyboard focus.
 *
 * This protocol is observation-only. Keyboard state changes are never
 * consumed or intercepted by this protocol.
 *
 * 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_keyboard_state_notify_unstable_v1 Interfaces
 * - @subpage page_iface_treeland_keyboard_state_notify_manager_v1 - global keyboard state notification manager
 * - @subpage page_iface_treeland_keyboard_state_watcher_v1 - keyboard state watcher
 * @section page_copyright_treeland_keyboard_state_notify_unstable_v1 Copyright
 * <pre>
 *
 * SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
 * SPDX-License-Identifier: MIT
 * </pre>
 */
struct treeland_keyboard_state_notify_manager_v1;
struct treeland_keyboard_state_watcher_v1;
struct wl_seat;

#ifndef TREELAND_KEYBOARD_STATE_NOTIFY_MANAGER_V1_INTERFACE
#define TREELAND_KEYBOARD_STATE_NOTIFY_MANAGER_V1_INTERFACE
/**
 * @page page_iface_treeland_keyboard_state_notify_manager_v1 treeland_keyboard_state_notify_manager_v1
 * @section page_iface_treeland_keyboard_state_notify_manager_v1_desc Description
 *
 * The treeland_keyboard_state_notify_manager_v1 interface is a
 * singleton global object used to create watcher objects for monitoring
 * keyboard state changes on a given seat.
 *
 * A client may create multiple watcher objects for the same seat if
 * needed.
 * @section page_iface_treeland_keyboard_state_notify_manager_v1_api API
 * See @ref iface_treeland_keyboard_state_notify_manager_v1.
 */
/**
 * @defgroup iface_treeland_keyboard_state_notify_manager_v1 The treeland_keyboard_state_notify_manager_v1 interface
 *
 * The treeland_keyboard_state_notify_manager_v1 interface is a
 * singleton global object used to create watcher objects for monitoring
 * keyboard state changes on a given seat.
 *
 * A client may create multiple watcher objects for the same seat if
 * needed.
 */
extern const struct wl_interface treeland_keyboard_state_notify_manager_v1_interface;
#endif
#ifndef TREELAND_KEYBOARD_STATE_WATCHER_V1_INTERFACE
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_INTERFACE
/**
 * @page page_iface_treeland_keyboard_state_watcher_v1 treeland_keyboard_state_watcher_v1
 * @section page_iface_treeland_keyboard_state_watcher_v1_desc Description
 *
 * The treeland_keyboard_state_watcher_v1 interface represents a
 * subscription to keyboard state changes on a specific
 * seat.
 *
 * This object is created via get_keyboard_state_watcher on the
 * treeland_keyboard_state_notify_manager_v1 global. The client
 * configures the watcher with set_modifiers to choose which modifiers
 * to monitor and set_flags to choose which state transitions to
 * receive. Both can be changed at runtime. Configuration changes are
 * double-buffered: set_modifiers and set_flags only update the pending
 * state, which is applied atomically when apply is called.
 *
 * The compositor sends a current_state event for each modifier in
 * the committed modifier set immediately after apply is called.
 * It then sends
 * state_changed events whenever any of the watched modifiers
 * changes lock state, according to the committed modifiers and
 * flags.
 * @section page_iface_treeland_keyboard_state_watcher_v1_api API
 * See @ref iface_treeland_keyboard_state_watcher_v1.
 */
/**
 * @defgroup iface_treeland_keyboard_state_watcher_v1 The treeland_keyboard_state_watcher_v1 interface
 *
 * The treeland_keyboard_state_watcher_v1 interface represents a
 * subscription to keyboard state changes on a specific
 * seat.
 *
 * This object is created via get_keyboard_state_watcher on the
 * treeland_keyboard_state_notify_manager_v1 global. The client
 * configures the watcher with set_modifiers to choose which modifiers
 * to monitor and set_flags to choose which state transitions to
 * receive. Both can be changed at runtime. Configuration changes are
 * double-buffered: set_modifiers and set_flags only update the pending
 * state, which is applied atomically when apply is called.
 *
 * The compositor sends a current_state event for each modifier in
 * the committed modifier set immediately after apply is called.
 * It then sends
 * state_changed events whenever any of the watched modifiers
 * changes lock state, according to the committed modifiers and
 * flags.
 */
extern const struct wl_interface treeland_keyboard_state_watcher_v1_interface;
#endif

#define TREELAND_KEYBOARD_STATE_NOTIFY_MANAGER_V1_DESTROY 0
#define TREELAND_KEYBOARD_STATE_NOTIFY_MANAGER_V1_GET_KEYBOARD_STATE_WATCHER 1


/**
 * @ingroup iface_treeland_keyboard_state_notify_manager_v1
 */
#define TREELAND_KEYBOARD_STATE_NOTIFY_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_state_notify_manager_v1
 */
#define TREELAND_KEYBOARD_STATE_NOTIFY_MANAGER_V1_GET_KEYBOARD_STATE_WATCHER_SINCE_VERSION 1

/** @ingroup iface_treeland_keyboard_state_notify_manager_v1 */
static inline void
treeland_keyboard_state_notify_manager_v1_set_user_data(struct treeland_keyboard_state_notify_manager_v1 *treeland_keyboard_state_notify_manager_v1, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) treeland_keyboard_state_notify_manager_v1, user_data);
}

/** @ingroup iface_treeland_keyboard_state_notify_manager_v1 */
static inline void *
treeland_keyboard_state_notify_manager_v1_get_user_data(struct treeland_keyboard_state_notify_manager_v1 *treeland_keyboard_state_notify_manager_v1)
{
	return wl_proxy_get_user_data((struct wl_proxy *) treeland_keyboard_state_notify_manager_v1);
}

static inline uint32_t
treeland_keyboard_state_notify_manager_v1_get_version(struct treeland_keyboard_state_notify_manager_v1 *treeland_keyboard_state_notify_manager_v1)
{
	return wl_proxy_get_version((struct wl_proxy *) treeland_keyboard_state_notify_manager_v1);
}

/**
 * @ingroup iface_treeland_keyboard_state_notify_manager_v1
 *
 * Destroy this
 * treeland_keyboard_state_notify_manager_v1 object.
 *
 * Existing watcher objects created through this interface are not
 * destroyed automatically. Clients should destroy those objects
 * before destroying the manager.
 */
static inline void
treeland_keyboard_state_notify_manager_v1_destroy(struct treeland_keyboard_state_notify_manager_v1 *treeland_keyboard_state_notify_manager_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_keyboard_state_notify_manager_v1,
			 TREELAND_KEYBOARD_STATE_NOTIFY_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_keyboard_state_notify_manager_v1), WL_MARSHAL_FLAG_DESTROY);
}

/**
 * @ingroup iface_treeland_keyboard_state_notify_manager_v1
 *
 * Create a treeland_keyboard_state_watcher_v1 object for
 * monitoring keyboard state changes on the given seat, or on
 * all seats if seat is null.
 *
 * The watcher is created with no modifiers and no flags set by
 * default. The client should use set_modifiers and set_flags on
 * the watcher to configure what to monitor.
 *
 * Note:
 * 1. The treeland_keyboard_state_watcher_v1 object must be destroyed
 * before the associated wl_seat is destroyed.
 */
static inline struct treeland_keyboard_state_watcher_v1 *
treeland_keyboard_state_notify_manager_v1_get_keyboard_state_watcher(struct treeland_keyboard_state_notify_manager_v1 *treeland_keyboard_state_notify_manager_v1, struct wl_seat *seat)
{
	struct wl_proxy *id;

	id = wl_proxy_marshal_flags((struct wl_proxy *) treeland_keyboard_state_notify_manager_v1,
			 TREELAND_KEYBOARD_STATE_NOTIFY_MANAGER_V1_GET_KEYBOARD_STATE_WATCHER, &treeland_keyboard_state_watcher_v1_interface, wl_proxy_get_version((struct wl_proxy *) treeland_keyboard_state_notify_manager_v1), 0, NULL, seat);

	return (struct treeland_keyboard_state_watcher_v1 *) id;
}

#ifndef TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_ENUM
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_ENUM
/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 * keyboard modifier type
 *
 * Bitfield of keyboard modifiers whose lock state can be
 * monitored. Multiple modifier values can be combined using
 * bitwise OR.
 *
 * caps_lock: the Caps Lock modifier.
 * num_lock: the Num Lock modifier.
 * scroll_lock: the Scroll Lock modifier.
 *
 * Examples:
 * caps_lock: monitor only Caps Lock.
 * caps_lock | num_lock: monitor both Caps Lock and Num Lock.
 */
enum treeland_keyboard_state_watcher_v1_modifier {
	/**
	 * Caps Lock modifier
	 */
	TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_CAPS_LOCK = 1,
	/**
	 * Num Lock modifier
	 */
	TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_NUM_LOCK = 2,
};
#endif /* TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_ENUM */

#ifndef TREELAND_KEYBOARD_STATE_WATCHER_V1_WATCH_FLAG_ENUM
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_WATCH_FLAG_ENUM
/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 * modifier state transition flags
 *
 * Flags to specify which modifier lock state transitions the
 * client wants to be notified about.
 *
 * none: do not notify on any state transition.
 * locked: notify when a watched modifier becomes locked.
 * unlocked: notify when a watched modifier becomes unlocked.
 *
 * Examples:
 * locked: the client receives events only when a modifier is
 * locked.
 * unlocked: the client receives events only when a modifier is
 * unlocked.
 * locked | unlocked: the client receives events on both.
 */
enum treeland_keyboard_state_watcher_v1_watch_flag {
	/**
	 * notify when modifier is locked
	 */
	TREELAND_KEYBOARD_STATE_WATCHER_V1_WATCH_FLAG_LOCKED = 1,
	/**
	 * notify when modifier is unlocked
	 */
	TREELAND_KEYBOARD_STATE_WATCHER_V1_WATCH_FLAG_UNLOCKED = 2,
};
#endif /* TREELAND_KEYBOARD_STATE_WATCHER_V1_WATCH_FLAG_ENUM */

#ifndef TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_STATE_ENUM
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_STATE_ENUM
/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 * modifier lock state
 *
 * The current lock state of a keyboard modifier.
 */
enum treeland_keyboard_state_watcher_v1_modifier_state {
	/**
	 * modifier is now unlocked
	 */
	TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_STATE_UNLOCKED = 0,
	/**
	 * modifier is now locked
	 */
	TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_STATE_LOCKED = 1,
};
#endif /* TREELAND_KEYBOARD_STATE_WATCHER_V1_MODIFIER_STATE_ENUM */

/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 * @struct treeland_keyboard_state_watcher_v1_listener
 */
struct treeland_keyboard_state_watcher_v1_listener {
	/**
	 * current state of a watched modifier
	 *
	 * Sent for each modifier in the committed modifier set after
	 * each apply call to provide its current lock state. For example,
	 * if the client watches caps_lock and num_lock, the compositor
	 * will send two current_state events, one for each modifier.
	 *
	 * This event is emitted before any subsequent state_changed events
	 * for the new configuration. It may be sent again after future
	 * apply calls if the client reconfigures the watcher.
	 * @param modifier the modifier whose lock state is being reported
	 * @param state the current lock state of the modifier
	 */
	void (*current_state)(void *data,
			      struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1,
			      uint32_t modifier,
			      uint32_t state);
	/**
	 * a watched modifier has changed state
	 *
	 * This event is sent when one of the watched modifiers changes
	 * lock state globally, according to the modifiers and flags
	 * currently set on this watcher.
	 *
	 * The modifier argument identifies which modifier changed state.
	 * The state argument indicates whether the modifier is now locked
	 * or unlocked.
	 * @param modifier the modifier that changed lock state
	 * @param state the new lock state of the modifier
	 */
	void (*state_changed)(void *data,
			      struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1,
			      uint32_t modifier,
			      uint32_t state);
};

/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 */
static inline int
treeland_keyboard_state_watcher_v1_add_listener(struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1,
						const struct treeland_keyboard_state_watcher_v1_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) treeland_keyboard_state_watcher_v1,
				     (void (**)(void)) listener, data);
}

#define TREELAND_KEYBOARD_STATE_WATCHER_V1_DESTROY 0
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_SET_MODIFIERS 1
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_SET_FLAGS 2
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_APPLY 3

/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 */
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_CURRENT_STATE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 */
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_STATE_CHANGED_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 */
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 */
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_SET_MODIFIERS_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 */
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_SET_FLAGS_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 */
#define TREELAND_KEYBOARD_STATE_WATCHER_V1_APPLY_SINCE_VERSION 1

/** @ingroup iface_treeland_keyboard_state_watcher_v1 */
static inline void
treeland_keyboard_state_watcher_v1_set_user_data(struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) treeland_keyboard_state_watcher_v1, user_data);
}

/** @ingroup iface_treeland_keyboard_state_watcher_v1 */
static inline void *
treeland_keyboard_state_watcher_v1_get_user_data(struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1)
{
	return wl_proxy_get_user_data((struct wl_proxy *) treeland_keyboard_state_watcher_v1);
}

static inline uint32_t
treeland_keyboard_state_watcher_v1_get_version(struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1)
{
	return wl_proxy_get_version((struct wl_proxy *) treeland_keyboard_state_watcher_v1);
}

/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 *
 * Destroy this treeland_keyboard_state_watcher_v1 object and
 * stop receiving keyboard state notifications.
 */
static inline void
treeland_keyboard_state_watcher_v1_destroy(struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_keyboard_state_watcher_v1,
			 TREELAND_KEYBOARD_STATE_WATCHER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_keyboard_state_watcher_v1), WL_MARSHAL_FLAG_DESTROY);
}

/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 *
 * Set the keyboard modifiers to watch on this watcher.
 *
 * The modifiers argument is a bitfield of values from the modifier
 * enum (e.g. caps_lock = 1, num_lock = 2, scroll_lock = 4).
 * Multiple modifiers can be combined using bitwise OR.
 *
 * Calling set_modifiers replaces any previously pending modifiers.
 *
 * This request only updates the pending configuration. The change
 * takes effect when apply is called. If set_modifiers is called
 * multiple times before apply, only the values from the most
 * recent call are used.
 */
static inline void
treeland_keyboard_state_watcher_v1_set_modifiers(struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1, uint32_t modifiers)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_keyboard_state_watcher_v1,
			 TREELAND_KEYBOARD_STATE_WATCHER_V1_SET_MODIFIERS, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_keyboard_state_watcher_v1), 0, modifiers);
}

/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 *
 * Change the watch flags for this watcher, selecting which modifier
 * state transitions (locked, unlocked, or both) the client wants
 * to be notified about.
 *
 * This request only updates the pending configuration. The change
 * takes effect when apply is called. If set_flags is called
 * multiple times before apply, only the values from the most
 * recent call are used.
 */
static inline void
treeland_keyboard_state_watcher_v1_set_flags(struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1, uint32_t flags)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_keyboard_state_watcher_v1,
			 TREELAND_KEYBOARD_STATE_WATCHER_V1_SET_FLAGS, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_keyboard_state_watcher_v1), 0, flags);
}

/**
 * @ingroup iface_treeland_keyboard_state_watcher_v1
 *
 * Apply the pending configuration state for this watcher
 * atomically.
 *
 * The compositor will use the modifiers and flags set by the most
 * recent set_modifiers and set_flags calls as the new active
 * configuration for this watcher. If set_modifiers or set_flags
 * have not been called since the last apply (or since the watcher
 * was created), the corresponding pending values remain unchanged.
 *
 * After this request, the pending configuration is considered
 * consumed. Subsequent calls to set_modifiers or set_flags will
 * begin a new pending configuration.
 *
 * The compositor will send a current_state event for each
 * modifier in the newly committed modifier set immediately
 * after processing this request.
 */
static inline void
treeland_keyboard_state_watcher_v1_apply(struct treeland_keyboard_state_watcher_v1 *treeland_keyboard_state_watcher_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_keyboard_state_watcher_v1,
			 TREELAND_KEYBOARD_STATE_WATCHER_V1_APPLY, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_keyboard_state_watcher_v1), 0);
}

#ifdef  __cplusplus
}
#endif

#endif
