/* Generated by wayland-scanner 1.26.0 */

#ifndef TREELAND_WALLPAPER_MANAGER_UNSTABLE_V1_CLIENT_PROTOCOL_H
#define TREELAND_WALLPAPER_MANAGER_UNSTABLE_V1_CLIENT_PROTOCOL_H

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

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * @page page_treeland_wallpaper_manager_unstable_v1 The treeland_wallpaper_manager_unstable_v1 protocol
 * wallpaper management
 *
 * @section page_desc_treeland_wallpaper_manager_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_manager_unstable_v1 Interfaces
 * - @subpage page_iface_treeland_wallpaper_manager_v1 - Wallpaper manager interface
 * - @subpage page_iface_treeland_wallpaper_v1 - Wallpaper object interface for setting and managing wallpaper content
 * @section page_copyright_treeland_wallpaper_manager_unstable_v1 Copyright
 * <pre>
 *
 * SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
 * SPDX-License-Identifier: MIT
 * </pre>
 */
struct treeland_wallpaper_manager_v1;
struct treeland_wallpaper_v1;
struct wl_output;
struct wl_surface;

#ifndef TREELAND_WALLPAPER_MANAGER_V1_INTERFACE
#define TREELAND_WALLPAPER_MANAGER_V1_INTERFACE
/**
 * @page page_iface_treeland_wallpaper_manager_v1 treeland_wallpaper_manager_v1
 * @section page_iface_treeland_wallpaper_manager_v1_desc Description
 *
 * The treeland_wallpaper_manager_v1 interface is a global object used to
 * create wallpaper objects for specific outputs.
 * @section page_iface_treeland_wallpaper_manager_v1_api API
 * See @ref iface_treeland_wallpaper_manager_v1.
 */
/**
 * @defgroup iface_treeland_wallpaper_manager_v1 The treeland_wallpaper_manager_v1 interface
 *
 * The treeland_wallpaper_manager_v1 interface is a global object used to
 * create wallpaper objects for specific outputs.
 */
extern const struct wl_interface treeland_wallpaper_manager_v1_interface;
#endif
#ifndef TREELAND_WALLPAPER_V1_INTERFACE
#define TREELAND_WALLPAPER_V1_INTERFACE
/**
 * @page page_iface_treeland_wallpaper_v1 treeland_wallpaper_v1
 * @section page_iface_treeland_wallpaper_v1_desc Description
 *
 * The treeland_wallpaper_v1 interface represents a wallpaper instance
 * created by the compositor for a specific output, role.
 *
 * The wallpaper source provided by the client is stored and managed on
 * the compositor side. Once a wallpaper source has been set,
 * the compositor may cache, reuse, or persist the source independently
 * of the client.
 * @section page_iface_treeland_wallpaper_v1_api API
 * See @ref iface_treeland_wallpaper_v1.
 */
/**
 * @defgroup iface_treeland_wallpaper_v1 The treeland_wallpaper_v1 interface
 *
 * The treeland_wallpaper_v1 interface represents a wallpaper instance
 * created by the compositor for a specific output, role.
 *
 * The wallpaper source provided by the client is stored and managed on
 * the compositor side. Once a wallpaper source has been set,
 * the compositor may cache, reuse, or persist the source independently
 * of the client.
 */
extern const struct wl_interface treeland_wallpaper_v1_interface;
#endif

#define TREELAND_WALLPAPER_MANAGER_V1_DESTROY 0
#define TREELAND_WALLPAPER_MANAGER_V1_GET_TREELAND_WALLPAPER 1


/**
 * @ingroup iface_treeland_wallpaper_manager_v1
 */
#define TREELAND_WALLPAPER_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_manager_v1
 */
#define TREELAND_WALLPAPER_MANAGER_V1_GET_TREELAND_WALLPAPER_SINCE_VERSION 1

/** @ingroup iface_treeland_wallpaper_manager_v1 */
static inline void
treeland_wallpaper_manager_v1_set_user_data(struct treeland_wallpaper_manager_v1 *treeland_wallpaper_manager_v1, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) treeland_wallpaper_manager_v1, user_data);
}

/** @ingroup iface_treeland_wallpaper_manager_v1 */
static inline void *
treeland_wallpaper_manager_v1_get_user_data(struct treeland_wallpaper_manager_v1 *treeland_wallpaper_manager_v1)
{
	return wl_proxy_get_user_data((struct wl_proxy *) treeland_wallpaper_manager_v1);
}

static inline uint32_t
treeland_wallpaper_manager_v1_get_version(struct treeland_wallpaper_manager_v1 *treeland_wallpaper_manager_v1)
{
	return wl_proxy_get_version((struct wl_proxy *) treeland_wallpaper_manager_v1);
}

/**
 * @ingroup iface_treeland_wallpaper_manager_v1
 *
 * Destroy this treeland_wallpaper_manager_v1 object.
 *
 * Destroying a bound treeland_wallpaper_manager_v1 object while there
 * are wallpapers still alive created by this treeland_wallpaper_manager_v1
 * object instance is illegal and will result in a protocol error.
 */
static inline void
treeland_wallpaper_manager_v1_destroy(struct treeland_wallpaper_manager_v1 *treeland_wallpaper_manager_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_wallpaper_manager_v1,
			 TREELAND_WALLPAPER_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_wallpaper_manager_v1), WL_MARSHAL_FLAG_DESTROY);
}

/**
 * @ingroup iface_treeland_wallpaper_manager_v1
 *
 * Creates a treeland_wallpaper_v1 object bound to the specified wl_output.
 *
 * The compositor may enforce that only one wallpaper exists for a given
 * (output, role) combination.
 *
 * When a surface is associated, the compositor will track the workspace
 * the surface belongs to. Whenever the workspace changes, the compositor
 * may notify the client of the current wallpaper file path used by that
 * workspace.
 *
 * Note:
 * 1. The treeland_wallpaper_v1 object must be destroyed before
 * the associated wl_output is destroyed.
 * 1. The treeland_wallpaper_v1 object must be destroyed before
 * the associated wl_surface is destroyed.
 */
static inline struct treeland_wallpaper_v1 *
treeland_wallpaper_manager_v1_get_treeland_wallpaper(struct treeland_wallpaper_manager_v1 *treeland_wallpaper_manager_v1, struct wl_output *output, struct wl_surface *surface)
{
	struct wl_proxy *id;

	id = wl_proxy_marshal_flags((struct wl_proxy *) treeland_wallpaper_manager_v1,
			 TREELAND_WALLPAPER_MANAGER_V1_GET_TREELAND_WALLPAPER, &treeland_wallpaper_v1_interface, wl_proxy_get_version((struct wl_proxy *) treeland_wallpaper_manager_v1), 0, NULL, output, surface);

	return (struct treeland_wallpaper_v1 *) id;
}

#ifndef TREELAND_WALLPAPER_V1_ERROR_ENUM
#define TREELAND_WALLPAPER_V1_ERROR_ENUM
enum treeland_wallpaper_v1_error {
	/**
	 * wallpaper file has already been used and is cached on the wallpaper side
	 */
	TREELAND_WALLPAPER_V1_ERROR_ALREADY_USED = 0,
	/**
	 * The specified wallpaper source is invalid, unsupported, or failed to load.
	 */
	TREELAND_WALLPAPER_V1_ERROR_INVALID_SOURCE = 1,
	/**
	 * Permission denied when opening the specified wallpaper source
	 */
	TREELAND_WALLPAPER_V1_ERROR_PERMISSION_DENIED = 2,
};
#endif /* TREELAND_WALLPAPER_V1_ERROR_ENUM */

#ifndef TREELAND_WALLPAPER_V1_WALLPAPER_SOURCE_TYPE_ENUM
#define TREELAND_WALLPAPER_V1_WALLPAPER_SOURCE_TYPE_ENUM
enum treeland_wallpaper_v1_wallpaper_source_type {
	/**
	 * The wallpaper source is an image
	 */
	TREELAND_WALLPAPER_V1_WALLPAPER_SOURCE_TYPE_IMAGE = 0,
	/**
	 * The wallpaper source is a video
	 */
	TREELAND_WALLPAPER_V1_WALLPAPER_SOURCE_TYPE_VIDEO = 1,
};
#endif /* TREELAND_WALLPAPER_V1_WALLPAPER_SOURCE_TYPE_ENUM */

#ifndef TREELAND_WALLPAPER_V1_WALLPAPER_ROLE_ENUM
#define TREELAND_WALLPAPER_V1_WALLPAPER_ROLE_ENUM
enum treeland_wallpaper_v1_wallpaper_role {
	/**
	 * Wallpaper for the desktop environment
	 */
	TREELAND_WALLPAPER_V1_WALLPAPER_ROLE_DESKTOP = 0x1,
	/**
	 * Wallpaper for the lock screen
	 */
	TREELAND_WALLPAPER_V1_WALLPAPER_ROLE_LOCKSCREEN = 0x2,
};
#endif /* TREELAND_WALLPAPER_V1_WALLPAPER_ROLE_ENUM */

/**
 * @ingroup iface_treeland_wallpaper_v1
 * @struct treeland_wallpaper_v1_listener
 */
struct treeland_wallpaper_v1_listener {
	/**
	 * Indicates a wallpaper operation failure
	 *
	 * This event is emitted when a wallpaper-related request fails.
	 *
	 * The failure may occur during source loading, validation, or
	 * runtime setup. The error code provides additional information
	 * about the cause of the failure.
	 *
	 * Possible error values include: - already_used: The wallpaper
	 * source is already configured. This is not a fatal error and
	 * serves as a notification to the client. - invalid_source: The
	 * specified wallpaper source is invalid, unsupported, or could not
	 * be processed. This is a fatal error and the client should verify
	 * the source before retrying. - Permission denied, check file
	 * permissions.
	 * @param file_source Path to the file to be used as the wallpaper
	 * @param error The error code indicating the failure reason
	 */
	void (*failed)(void *data,
		       struct treeland_wallpaper_v1 *treeland_wallpaper_v1,
		       const char *file_source,
		       uint32_t error);
	/**
	 * Indicates that the wallpaper source has changed
	 *
	 * This event is emitted by the compositor to notify the client
	 * that the wallpaper source associated with this
	 * treeland_wallpaper_v1 object has changed.
	 *
	 * The event may be emitted during initial object setup or when the
	 * wallpaper is changed due to external factors not initiated by
	 * this client, such as compositor policy decisions, workspace
	 * switches (except for lockscreen wallpapers) that affect the
	 * active wallpaper, or other system components.
	 *
	 * Because the desktop wallpaper is designed to support different
	 * workspaces. if the client is a surface, changes to its displayed
	 * workspace will also send (reference set_reference_surface).
	 *
	 * The event provides the current wallpaper source type and the
	 * corresponding source file path.
	 * @param source_type The type of the current wallpaper source
	 * @param file_source The file path of the current wallpaper source
	 */
	void (*changed)(void *data,
			struct treeland_wallpaper_v1 *treeland_wallpaper_v1,
			uint32_t role,
			uint32_t source_type,
			const char *file_source);
};

/**
 * @ingroup iface_treeland_wallpaper_v1
 */
static inline int
treeland_wallpaper_v1_add_listener(struct treeland_wallpaper_v1 *treeland_wallpaper_v1,
				   const struct treeland_wallpaper_v1_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) treeland_wallpaper_v1,
				     (void (**)(void)) listener, data);
}

#define TREELAND_WALLPAPER_V1_DESTROY 0
#define TREELAND_WALLPAPER_V1_SET_IMAGE_SOURCE 1
#define TREELAND_WALLPAPER_V1_SET_VIDEO_SOURCE 2

/**
 * @ingroup iface_treeland_wallpaper_v1
 */
#define TREELAND_WALLPAPER_V1_FAILED_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_v1
 */
#define TREELAND_WALLPAPER_V1_CHANGED_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_wallpaper_v1
 */
#define TREELAND_WALLPAPER_V1_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_v1
 */
#define TREELAND_WALLPAPER_V1_SET_IMAGE_SOURCE_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_wallpaper_v1
 */
#define TREELAND_WALLPAPER_V1_SET_VIDEO_SOURCE_SINCE_VERSION 1

/** @ingroup iface_treeland_wallpaper_v1 */
static inline void
treeland_wallpaper_v1_set_user_data(struct treeland_wallpaper_v1 *treeland_wallpaper_v1, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) treeland_wallpaper_v1, user_data);
}

/** @ingroup iface_treeland_wallpaper_v1 */
static inline void *
treeland_wallpaper_v1_get_user_data(struct treeland_wallpaper_v1 *treeland_wallpaper_v1)
{
	return wl_proxy_get_user_data((struct wl_proxy *) treeland_wallpaper_v1);
}

static inline uint32_t
treeland_wallpaper_v1_get_version(struct treeland_wallpaper_v1 *treeland_wallpaper_v1)
{
	return wl_proxy_get_version((struct wl_proxy *) treeland_wallpaper_v1);
}

/**
 * @ingroup iface_treeland_wallpaper_v1
 *
 * Destroys the treeland_wallpaper_v1 object and releases all resources
 * associated with it on the compositor side.
 *
 * After calling this request, the client must not use the wallpaper
 * object anymore.
 */
static inline void
treeland_wallpaper_v1_destroy(struct treeland_wallpaper_v1 *treeland_wallpaper_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_wallpaper_v1,
			 TREELAND_WALLPAPER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_wallpaper_v1), WL_MARSHAL_FLAG_DESTROY);
}

/**
 * @ingroup iface_treeland_wallpaper_v1
 *
 * Sets an image as the wallpaper source, apply to the current
 * wl_output and the active workspace. except for lockscreen
 * wallpapers, only one wallpaper can be set per wl_output.
 * Supported formats:
 *
 * - JPG / JPEG (Joint Photographic Experts Group)
 *
 * The compositor will attempt to load and display the specified image
 * file. If the file cannot be accessed, decoded, or is in an unsupported
 * format, the compositor will emit a failed event with an appropriate
 * error code.
 *
 * Access Control: This protocol accepts file_source such 
 * as /usr/share/wallpapers/xxx  or /var/cache/wallpapers/xxxx provided
 * by the client. the compositor will perform file verification.
 */
static inline void
treeland_wallpaper_v1_set_image_source(struct treeland_wallpaper_v1 *treeland_wallpaper_v1, const char *file_source, uint32_t role)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_wallpaper_v1,
			 TREELAND_WALLPAPER_V1_SET_IMAGE_SOURCE, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_wallpaper_v1), 0, file_source, role);
}

/**
 * @ingroup iface_treeland_wallpaper_v1
 *
 * Sets a video file as the wallpaper source, apply to the current
 * wl_output and the active workspace. except for lockscreen
 * wallpapers, only one wallpaper can be set per wl_output.
 * Supported formats:
 *
 * - MP4
 * - AVI
 * - MOV
 *
 * The compositor is responsible for decoding and presenting the video.
 * Playback behavior such as looping, synchronization, and performance
 * characteristics are compositor-defined.
 *
 * If the video source cannot be opened or decoded, a failed event
 * will be emitted.
 *
 * Access Control: This protocol accepts file_source such 
 * as /usr/share/wallpapers/xxx or /var/cache/wallpapers/xxxx provided
 * by the client. the compositor will perform file verification.
 */
static inline void
treeland_wallpaper_v1_set_video_source(struct treeland_wallpaper_v1 *treeland_wallpaper_v1, const char *file_source, uint32_t role)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_wallpaper_v1,
			 TREELAND_WALLPAPER_V1_SET_VIDEO_SOURCE, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_wallpaper_v1), 0, file_source, role);
}

#ifdef  __cplusplus
}
#endif

#endif
