/* Generated by wayland-scanner 1.25.0 */

#ifndef TREELAND_PRELAUNCH_SPLASH_V2_CLIENT_PROTOCOL_H
#define TREELAND_PRELAUNCH_SPLASH_V2_CLIENT_PROTOCOL_H

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

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * @page page_treeland_prelaunch_splash_v2 The treeland_prelaunch_splash_v2 protocol
 * @section page_ifaces_treeland_prelaunch_splash_v2 Interfaces
 * - @subpage page_iface_treeland_prelaunch_splash_manager_v2 - prelaunch splash screen manager
 * - @subpage page_iface_treeland_prelaunch_splash_v2 - prelaunch splash screen object
 * @section page_copyright_treeland_prelaunch_splash_v2 Copyright
 * <pre>
 *
 * SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
 * SPDX-License-Identifier: MIT
 * </pre>
 */
struct treeland_prelaunch_splash_manager_v2;
struct treeland_prelaunch_splash_v2;
struct wl_buffer;

#ifndef TREELAND_PRELAUNCH_SPLASH_MANAGER_V2_INTERFACE
#define TREELAND_PRELAUNCH_SPLASH_MANAGER_V2_INTERFACE
/**
 * @page page_iface_treeland_prelaunch_splash_manager_v2 treeland_prelaunch_splash_manager_v2
 * @section page_iface_treeland_prelaunch_splash_manager_v2_desc Description
 *
 * This interface is a manager for creating prelaunch splash screens.
 * A prelaunch splash screen is a placeholder surface that is shown
 * before an application's main window is mapped. This helps to improve
 * the perceived startup time.
 *
 * It is particularly useful for application launchers to provide immediate
 * feedback to the user.
 *
 * Compared to treeland_prelaunch_splash_manager_v1, this version returns
 * a splash object from create_splash. The caller can destroy the object
 * to dismiss the splash, and the compositor can send events (e.g. timeout)
 * back to the caller through the object.
 * @section page_iface_treeland_prelaunch_splash_manager_v2_api API
 * See @ref iface_treeland_prelaunch_splash_manager_v2.
 */
/**
 * @defgroup iface_treeland_prelaunch_splash_manager_v2 The treeland_prelaunch_splash_manager_v2 interface
 *
 * This interface is a manager for creating prelaunch splash screens.
 * A prelaunch splash screen is a placeholder surface that is shown
 * before an application's main window is mapped. This helps to improve
 * the perceived startup time.
 *
 * It is particularly useful for application launchers to provide immediate
 * feedback to the user.
 *
 * Compared to treeland_prelaunch_splash_manager_v1, this version returns
 * a splash object from create_splash. The caller can destroy the object
 * to dismiss the splash, and the compositor can send events (e.g. timeout)
 * back to the caller through the object.
 */
extern const struct wl_interface treeland_prelaunch_splash_manager_v2_interface;
#endif
#ifndef TREELAND_PRELAUNCH_SPLASH_V2_INTERFACE
#define TREELAND_PRELAUNCH_SPLASH_V2_INTERFACE
/**
 * @page page_iface_treeland_prelaunch_splash_v2 treeland_prelaunch_splash_v2
 * @section page_iface_treeland_prelaunch_splash_v2_desc Description
 *
 * Represents a single prelaunch splash screen created by the manager.
 *
 * The caller can destroy this object to dismiss the corresponding splash.
 * The compositor may also send events through this object, for example
 * to notify the caller that the splash was closed due to a timeout.
 * @section page_iface_treeland_prelaunch_splash_v2_api API
 * See @ref iface_treeland_prelaunch_splash_v2.
 */
/**
 * @defgroup iface_treeland_prelaunch_splash_v2 The treeland_prelaunch_splash_v2 interface
 *
 * Represents a single prelaunch splash screen created by the manager.
 *
 * The caller can destroy this object to dismiss the corresponding splash.
 * The compositor may also send events through this object, for example
 * to notify the caller that the splash was closed due to a timeout.
 */
extern const struct wl_interface treeland_prelaunch_splash_v2_interface;
#endif

#define TREELAND_PRELAUNCH_SPLASH_MANAGER_V2_DESTROY 0
#define TREELAND_PRELAUNCH_SPLASH_MANAGER_V2_CREATE_SPLASH 1


/**
 * @ingroup iface_treeland_prelaunch_splash_manager_v2
 */
#define TREELAND_PRELAUNCH_SPLASH_MANAGER_V2_DESTROY_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_prelaunch_splash_manager_v2
 */
#define TREELAND_PRELAUNCH_SPLASH_MANAGER_V2_CREATE_SPLASH_SINCE_VERSION 1

/** @ingroup iface_treeland_prelaunch_splash_manager_v2 */
static inline void
treeland_prelaunch_splash_manager_v2_set_user_data(struct treeland_prelaunch_splash_manager_v2 *treeland_prelaunch_splash_manager_v2, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) treeland_prelaunch_splash_manager_v2, user_data);
}

/** @ingroup iface_treeland_prelaunch_splash_manager_v2 */
static inline void *
treeland_prelaunch_splash_manager_v2_get_user_data(struct treeland_prelaunch_splash_manager_v2 *treeland_prelaunch_splash_manager_v2)
{
	return wl_proxy_get_user_data((struct wl_proxy *) treeland_prelaunch_splash_manager_v2);
}

static inline uint32_t
treeland_prelaunch_splash_manager_v2_get_version(struct treeland_prelaunch_splash_manager_v2 *treeland_prelaunch_splash_manager_v2)
{
	return wl_proxy_get_version((struct wl_proxy *) treeland_prelaunch_splash_manager_v2);
}

/**
 * @ingroup iface_treeland_prelaunch_splash_manager_v2
 */
static inline void
treeland_prelaunch_splash_manager_v2_destroy(struct treeland_prelaunch_splash_manager_v2 *treeland_prelaunch_splash_manager_v2)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_prelaunch_splash_manager_v2,
			 TREELAND_PRELAUNCH_SPLASH_MANAGER_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_prelaunch_splash_manager_v2), WL_MARSHAL_FLAG_DESTROY);
}

/**
 * @ingroup iface_treeland_prelaunch_splash_manager_v2
 *
 * Creates a new prelaunch splash screen and returns a splash object.
 *
 * The `app_id` is a string that identifies the application. The compositor
 * will use this ID together with `sandbox_engine_name` to match the splash
 * screen with the actual application window when it appears. This
 * matching mechanism should also work for XWayland windows.
 *
 * The `instance_id` identifies a specific application instance, allowing
 * multiple splashes for non-singleton applications. The compositor can
 * use this to associate a splash with a particular launch instance.
 *
 * Callers MUST provide a non-empty `sandbox_engine_name` string which
 * identifies the sandboxing/container.
 */
static inline struct treeland_prelaunch_splash_v2 *
treeland_prelaunch_splash_manager_v2_create_splash(struct treeland_prelaunch_splash_manager_v2 *treeland_prelaunch_splash_manager_v2, const char *app_id, const char *instance_id, const char *sandbox_engine_name, struct wl_buffer *icon_buffer)
{
	struct wl_proxy *splash;

	splash = wl_proxy_marshal_flags((struct wl_proxy *) treeland_prelaunch_splash_manager_v2,
			 TREELAND_PRELAUNCH_SPLASH_MANAGER_V2_CREATE_SPLASH, &treeland_prelaunch_splash_v2_interface, wl_proxy_get_version((struct wl_proxy *) treeland_prelaunch_splash_manager_v2), 0, NULL, app_id, instance_id, sandbox_engine_name, icon_buffer);

	return (struct treeland_prelaunch_splash_v2 *) splash;
}

#define TREELAND_PRELAUNCH_SPLASH_V2_DESTROY 0


/**
 * @ingroup iface_treeland_prelaunch_splash_v2
 */
#define TREELAND_PRELAUNCH_SPLASH_V2_DESTROY_SINCE_VERSION 1

/** @ingroup iface_treeland_prelaunch_splash_v2 */
static inline void
treeland_prelaunch_splash_v2_set_user_data(struct treeland_prelaunch_splash_v2 *treeland_prelaunch_splash_v2, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) treeland_prelaunch_splash_v2, user_data);
}

/** @ingroup iface_treeland_prelaunch_splash_v2 */
static inline void *
treeland_prelaunch_splash_v2_get_user_data(struct treeland_prelaunch_splash_v2 *treeland_prelaunch_splash_v2)
{
	return wl_proxy_get_user_data((struct wl_proxy *) treeland_prelaunch_splash_v2);
}

static inline uint32_t
treeland_prelaunch_splash_v2_get_version(struct treeland_prelaunch_splash_v2 *treeland_prelaunch_splash_v2)
{
	return wl_proxy_get_version((struct wl_proxy *) treeland_prelaunch_splash_v2);
}

/**
 * @ingroup iface_treeland_prelaunch_splash_v2
 *
 * Dismisses the splash screen and destroys this object.
 */
static inline void
treeland_prelaunch_splash_v2_destroy(struct treeland_prelaunch_splash_v2 *treeland_prelaunch_splash_v2)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_prelaunch_splash_v2,
			 TREELAND_PRELAUNCH_SPLASH_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_prelaunch_splash_v2), WL_MARSHAL_FLAG_DESTROY);
}

#ifdef  __cplusplus
}
#endif

#endif
