/* Generated by wayland-scanner 1.26.0 */

#ifndef TREELAND_WALLPAPER_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H
#define TREELAND_WALLPAPER_SHELL_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_wallpaper_shell_unstable_v1 The treeland_wallpaper_shell_unstable_v1 protocol
 * wallpaper shell integration
 *
 * @section page_desc_treeland_wallpaper_shell_unstable_v1 Description
 *
 * 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_wallpaper_shell_unstable_v1 Interfaces
 * - @subpage page_iface_treeland_wallpaper_notifier_v1 - Notification interface for wallpaper source changes
 * - @subpage page_iface_treeland_wallpaper_shell_v1 - Wallpaper shell global
 * - @subpage page_iface_treeland_wallpaper_surface_v1 - Wallpaper surface controller
 * @section page_copyright_treeland_wallpaper_shell_unstable_v1 Copyright
 * <pre>
 *
 * SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
 * SPDX-License-Identifier: MIT
 * </pre>
 */
struct treeland_wallpaper_notifier_v1;
struct treeland_wallpaper_shell_v1;
struct treeland_wallpaper_surface_v1;
struct wl_surface;

#ifndef TREELAND_WALLPAPER_NOTIFIER_V1_INTERFACE
#define TREELAND_WALLPAPER_NOTIFIER_V1_INTERFACE
/**
 * @page page_iface_treeland_wallpaper_notifier_v1 treeland_wallpaper_notifier_v1
 * @section page_iface_treeland_wallpaper_notifier_v1_desc Description
 *
 * The treeland_wallpaper_notifier_v1 interface provides notifications
 * about the availability and lifetime of wallpaper sources managed by
 * the compositor.
 *
 * This interface is purely event-driven. Clients receive events when
 * wallpaper sources are added, become active, or are removed, and may
 * update their internal state or user interface accordingly.
 * @section page_iface_treeland_wallpaper_notifier_v1_api API
 * See @ref iface_treeland_wallpaper_notifier_v1.
 */
/**
 * @defgroup iface_treeland_wallpaper_notifier_v1 The treeland_wallpaper_notifier_v1 interface
 *
 * The treeland_wallpaper_notifier_v1 interface provides notifications
 * about the availability and lifetime of wallpaper sources managed by
 * the compositor.
 *
 * This interface is purely event-driven. Clients receive events when
 * wallpaper sources are added, become active, or are removed, and may
 * update their internal state or user interface accordingly.
 */
extern const struct wl_interface treeland_wallpaper_notifier_v1_interface;
#endif
#ifndef TREELAND_WALLPAPER_SHELL_V1_INTERFACE
#define TREELAND_WALLPAPER_SHELL_V1_INTERFACE
/**
 * @page page_iface_treeland_wallpaper_shell_v1 treeland_wallpaper_shell_v1
 * @section page_iface_treeland_wallpaper_shell_v1_desc Description
 *
 * The treeland_wallpaper_shell_v1 interface is a global object exposed by
 * the compositor that allows a client to assign the wallpaper role to
 * a wl_surface and create wallpaper surface objects.
 *
 * A wallpaper surface represents content intended to be displayed as
 * the desktop wallpaper, such as a static image or a dynamic media
 * source, and is associated with exactly one wl_surface.
 *
 * This interface follows the shell pattern used by other Wayland
 * protocols: it assigns a specific role to a wl_surface and manages
 * the lifetime and behavior of wallpaper surfaces.
 *
 * This interface is a singleton. At most one client may bind to
 * treeland_wallpaper_shell_v1 at any given time.
 * @section page_iface_treeland_wallpaper_shell_v1_api API
 * See @ref iface_treeland_wallpaper_shell_v1.
 */
/**
 * @defgroup iface_treeland_wallpaper_shell_v1 The treeland_wallpaper_shell_v1 interface
 *
 * The treeland_wallpaper_shell_v1 interface is a global object exposed by
 * the compositor that allows a client to assign the wallpaper role to
 * a wl_surface and create wallpaper surface objects.
 *
 * A wallpaper surface represents content intended to be displayed as
 * the desktop wallpaper, such as a static image or a dynamic media
 * source, and is associated with exactly one wl_surface.
 *
 * This interface follows the shell pattern used by other Wayland
 * protocols: it assigns a specific role to a wl_surface and manages
 * the lifetime and behavior of wallpaper surfaces.
 *
 * This interface is a singleton. At most one client may bind to
 * treeland_wallpaper_shell_v1 at any given time.
 */
extern const struct wl_interface treeland_wallpaper_shell_v1_interface;
#endif
#ifndef TREELAND_WALLPAPER_SURFACE_V1_INTERFACE
#define TREELAND_WALLPAPER_SURFACE_V1_INTERFACE
/**
 * @page page_iface_treeland_wallpaper_surface_v1 treeland_wallpaper_surface_v1
 * @section page_iface_treeland_wallpaper_surface_v1_desc Description
 *
 * The treeland_wallpaper_surface_v1 interface controls the behavior of a
 * wallpaper surface.
 *
 * A wallpaper surface is bound to exactly one wl_surface and defines how
 * that surface should be sized, positioned, and synchronized with the
 * compositor's wallpaper management logic.
 * @section page_iface_treeland_wallpaper_surface_v1_api API
 * See @ref iface_treeland_wallpaper_surface_v1.
 */
/**
 * @defgroup iface_treeland_wallpaper_surface_v1 The treeland_wallpaper_surface_v1 interface
 *
 * The treeland_wallpaper_surface_v1 interface controls the behavior of a
 * wallpaper surface.
 *
 * A wallpaper surface is bound to exactly one wl_surface and defines how
 * that surface should be sized, positioned, and synchronized with the
 * compositor's wallpaper management logic.
 */
extern const struct wl_interface treeland_wallpaper_surface_v1_interface;
#endif

#ifndef TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_ENUM
#define TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_ENUM
enum treeland_wallpaper_notifier_v1_wallpaper_source_type {
	/**
	 * The wallpaper source is an image
	 */
	TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_IMAGE = 0,
	/**
	 * The wallpaper source is a video
	 */
	TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_VIDEO = 1,
};
#endif /* TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_ENUM */

#ifndef TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_ENUM_IS_VALID
#define TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_wallpaper_notifier_v1
 * Validate a treeland_wallpaper_notifier_v1 wallpaper_source_type value.
 *
 * @return true on success, false on error.
 * @ref treeland_wallpaper_notifier_v1_wallpaper_source_type
 */
static inline bool
treeland_wallpaper_notifier_v1_wallpaper_source_type_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_IMAGE:
		return version >= 1;
	case TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_VIDEO:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* TREELAND_WALLPAPER_NOTIFIER_V1_WALLPAPER_SOURCE_TYPE_ENUM_IS_VALID */

/**
 * @ingroup iface_treeland_wallpaper_notifier_v1
 * @struct treeland_wallpaper_notifier_v1_interface
 */
struct treeland_wallpaper_notifier_v1_interface {
	/**
	 * Destroy the wallpaper notifier object
	 *
	 * Destroys this treeland_wallpaper_notifier_v1 object.
	 *
	 * Destroying a bound treeland_wallpaper_notifier_v1 object while
	 * wallpaper surface objects created from it are still alive is
	 * illegal and will result in a protocol error.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
};

#define TREELAND_WALLPAPER_NOTIFIER_V1_ADD 0
#define TREELAND_WALLPAPER_NOTIFIER_V1_REMOVE 1

/**
 * @ingroup iface_treeland_wallpaper_notifier_v1
 */
#define TREELAND_WALLPAPER_NOTIFIER_V1_ADD_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_notifier_v1
 */
#define TREELAND_WALLPAPER_NOTIFIER_V1_REMOVE_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_wallpaper_notifier_v1
 */
#define TREELAND_WALLPAPER_NOTIFIER_V1_DESTROY_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_wallpaper_notifier_v1
 * Sends an add event to the client owning the resource.
 * @param resource_ The client's resource
 * @param source_type The type of the wallpaper source
 * @param file_source The file path or identifier of the wallpaper source
 */
static inline void
treeland_wallpaper_notifier_v1_send_add(struct wl_resource *resource_, uint32_t source_type, const char *file_source)
{
	wl_resource_post_event(resource_, TREELAND_WALLPAPER_NOTIFIER_V1_ADD, source_type, file_source);
}

/**
 * @ingroup iface_treeland_wallpaper_notifier_v1
 * Sends an remove event to the client owning the resource.
 * @param resource_ The client's resource
 * @param file_source The file path or identifier of the wallpaper source
 */
static inline void
treeland_wallpaper_notifier_v1_send_remove(struct wl_resource *resource_, const char *file_source)
{
	wl_resource_post_event(resource_, TREELAND_WALLPAPER_NOTIFIER_V1_REMOVE, file_source);
}

/**
 * @ingroup iface_treeland_wallpaper_shell_v1
 * @struct treeland_wallpaper_shell_v1_interface
 */
struct treeland_wallpaper_shell_v1_interface {
	/**
	 * Destroy the wallpaper shell object
	 *
	 * Destroys this treeland_wallpaper_shell_v1 object.
	 *
	 * Destroying a bound treeland_wallpaper_shell_v1 object while
	 * there are still treeland_wallpaper_surface_v1 objects created
	 * from it is illegal and will result in a protocol error.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
	/**
	 * Create a wallpaper surface
	 *
	 * Creates a treeland_wallpaper_surface_v1 object and assigns the
	 * wallpaper role to the given wl_surface.
	 *
	 * The provided wl_surface must not already have a role, and while
	 * it is used as a wallpaper surface, it must not be assigned any
	 * other role.
	 *
	 * The file_source argument specifies the initial wallpaper source
	 * identifier. Its interpretation depends on the wallpaper source
	 * type selected by the compositor.
	 * @param id The newly created wallpaper surface object
	 * @param surface The wl_surface to which the wallpaper role is assigned
	 * @param file_source The initial wallpaper source identifier
	 */
	void (*get_treeland_wallpaper_surface)(struct wl_client *client,
					       struct wl_resource *resource,
					       uint32_t id,
					       struct wl_resource *surface,
					       const char *file_source);
};


/**
 * @ingroup iface_treeland_wallpaper_shell_v1
 */
#define TREELAND_WALLPAPER_SHELL_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_shell_v1
 */
#define TREELAND_WALLPAPER_SHELL_V1_GET_TREELAND_WALLPAPER_SURFACE_SINCE_VERSION 1

#ifndef TREELAND_WALLPAPER_SURFACE_V1_ERROR_ENUM
#define TREELAND_WALLPAPER_SURFACE_V1_ERROR_ENUM
enum treeland_wallpaper_surface_v1_error {
	/**
	 * The specified wallpaper source is invalid, unsupported, or failed to load.
	 */
	TREELAND_WALLPAPER_SURFACE_V1_ERROR_INVALID_SOURCE = 1,
	/**
	 * Permission denied when opening the specified wallpaper source
	 */
	TREELAND_WALLPAPER_SURFACE_V1_ERROR_PERMISSION_DENIED = 2,
};
#endif /* TREELAND_WALLPAPER_SURFACE_V1_ERROR_ENUM */

#ifndef TREELAND_WALLPAPER_SURFACE_V1_ERROR_ENUM_IS_VALID
#define TREELAND_WALLPAPER_SURFACE_V1_ERROR_ENUM_IS_VALID
/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 * Validate a treeland_wallpaper_surface_v1 error value.
 *
 * @return true on success, false on error.
 * @ref treeland_wallpaper_surface_v1_error
 */
static inline bool
treeland_wallpaper_surface_v1_error_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case TREELAND_WALLPAPER_SURFACE_V1_ERROR_INVALID_SOURCE:
		return version >= 1;
	case TREELAND_WALLPAPER_SURFACE_V1_ERROR_PERMISSION_DENIED:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* TREELAND_WALLPAPER_SURFACE_V1_ERROR_ENUM_IS_VALID */

/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 * @struct treeland_wallpaper_surface_v1_interface
 */
struct treeland_wallpaper_surface_v1_interface {
	/**
	 * Destroy the wallpaper surface
	 *
	 * Destroy the wallpaper surface object and release its
	 * association with the underlying wl_surface.
	 *
	 * After calling this request, the wallpaper surface object becomes
	 * invalid and must not be used again.
	 *
	 * This request should only be sent when the client intends to
	 * permanently stop using the wallpaper surface, such as when the
	 * client is shutting down or after receiving the
	 * treeland_wallpaper_produce_v1.removed event for this surface.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
	/**
	 * Report a wallpaper source failure
	 *
	 * Reports to the compositor that a wallpaper-related operation
	 * has failed on the client side.
	 *
	 * This request may be sent by the client when it fails to open,
	 * load, or otherwise process the configured wallpaper source. The
	 * compositor may use this information for diagnostics, policy
	 * decisions, or to adjust internal state.
	 *
	 * Possible error values include: - invalid_source: The specified
	 * wallpaper source is invalid, unsupported, or could not be
	 * processed. This is a fatal error and indicates that the source
	 * should be verified before retrying. - permission_denied: The
	 * client does not have permission to access the specified
	 * wallpaper source.
	 * @param error The error code indicating the failure reason
	 */
	void (*source_failed)(struct wl_client *client,
			      struct wl_resource *resource,
			      uint32_t error);
	/**
	 * Notify that wallpaper content is ready
	 *
	 * Informs the compositor that the wallpaper surface has
	 * completed its initial rendering and is ready to be displayed.
	 *
	 * The client should send this request only after a valid buffer
	 * has been attached and committed to the associated wl_surface.
	 *
	 * Before receiving this request, the compositor may keep the
	 * wallpaper hidden or continue displaying a fallback wallpaper.
	 *
	 * This request is typically used to avoid visual glitches such as
	 * black frames, incomplete rendering, or uninitialized content
	 * during wallpaper startup.
	 *
	 * Calling this request multiple times has no additional effect.
	 * @since 2
	 */
	void (*ready)(struct wl_client *client,
		      struct wl_resource *resource);
};

#define TREELAND_WALLPAPER_SURFACE_V1_POSITION 0
#define TREELAND_WALLPAPER_SURFACE_V1_PAUSE 1
#define TREELAND_WALLPAPER_SURFACE_V1_SET_PLAYBACK_RATE 2
#define TREELAND_WALLPAPER_SURFACE_V1_PLAY 3
#define TREELAND_WALLPAPER_SURFACE_V1_SLOW_DOWN 4

/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 */
#define TREELAND_WALLPAPER_SURFACE_V1_POSITION_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 */
#define TREELAND_WALLPAPER_SURFACE_V1_PAUSE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 */
#define TREELAND_WALLPAPER_SURFACE_V1_SET_PLAYBACK_RATE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 */
#define TREELAND_WALLPAPER_SURFACE_V1_PLAY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 */
#define TREELAND_WALLPAPER_SURFACE_V1_SLOW_DOWN_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 */
#define TREELAND_WALLPAPER_SURFACE_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 */
#define TREELAND_WALLPAPER_SURFACE_V1_SOURCE_FAILED_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 */
#define TREELAND_WALLPAPER_SURFACE_V1_READY_SINCE_VERSION 2

/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 * Sends an position event to the client owning the resource.
 * @param resource_ The client's resource
 * @param position Position or progress value in fixed-point format
 */
static inline void
treeland_wallpaper_surface_v1_send_position(struct wl_resource *resource_, wl_fixed_t position)
{
	wl_resource_post_event(resource_, TREELAND_WALLPAPER_SURFACE_V1_POSITION, position);
}

/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 * Sends an pause event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
treeland_wallpaper_surface_v1_send_pause(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, TREELAND_WALLPAPER_SURFACE_V1_PAUSE);
}

/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 * Sends an set_playback_rate event to the client owning the resource.
 * @param resource_ The client's resource
 * @param rate Playback rate multiplier
 */
static inline void
treeland_wallpaper_surface_v1_send_set_playback_rate(struct wl_resource *resource_, wl_fixed_t rate)
{
	wl_resource_post_event(resource_, TREELAND_WALLPAPER_SURFACE_V1_SET_PLAYBACK_RATE, rate);
}

/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 * Sends an play event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
treeland_wallpaper_surface_v1_send_play(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, TREELAND_WALLPAPER_SURFACE_V1_PLAY);
}

/**
 * @ingroup iface_treeland_wallpaper_surface_v1
 * Sends an slow_down event to the client owning the resource.
 * @param resource_ The client's resource
 * @param duration Duration in milliseconds over which the slowdown occurs
 */
static inline void
treeland_wallpaper_surface_v1_send_slow_down(struct wl_resource *resource_, uint32_t duration)
{
	wl_resource_post_event(resource_, TREELAND_WALLPAPER_SURFACE_V1_SLOW_DOWN, duration);
}

#ifdef  __cplusplus
}
#endif

#endif
