/* Generated by wayland-scanner 1.26.0 */

#ifndef TREELAND_DDM_V1_SERVER_PROTOCOL_H
#define TREELAND_DDM_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_ddm_v1 The treeland_ddm_v1 protocol
 * private communication between treeland and ddm
 *
 * @section page_desc_treeland_ddm_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_ddm_v1 Interfaces
 * - @subpage page_iface_treeland_ddm_v1 - core global for treeland - ddm connection
 * @section page_copyright_treeland_ddm_v1 Copyright
 * <pre>
 *
 * SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
 * SPDX-License-Identifier: MIT
 * </pre>
 */
struct treeland_ddm_v1;
struct wl_callback;

#ifndef TREELAND_DDM_V1_INTERFACE
#define TREELAND_DDM_V1_INTERFACE
/**
 * @page page_iface_treeland_ddm_v1 treeland_ddm_v1
 * @section page_iface_treeland_ddm_v1_desc Description
 *
 * This is the treeland - ddm private communication protocol.
 *
 * This object is primarily used for establish connection between
 * treeland and ddm.
 * @section page_iface_treeland_ddm_v1_api API
 * See @ref iface_treeland_ddm_v1.
 */
/**
 * @defgroup iface_treeland_ddm_v1 The treeland_ddm_v1 interface
 *
 * This is the treeland - ddm private communication protocol.
 *
 * This object is primarily used for establish connection between
 * treeland and ddm.
 */
extern const struct wl_interface treeland_ddm_v1_interface;
#endif

/**
 * @ingroup iface_treeland_ddm_v1
 * @struct treeland_ddm_v1_interface
 */
struct treeland_ddm_v1_interface {
	/**
	 * send treeland to greeter mode
	 *
	 * Send treeland to Greeter mode.
	 */
	void (*switch_to_greeter)(struct wl_client *client,
				  struct wl_resource *resource);
	/**
	 * call treeland to switch lockscreen user
	 *
	 * Set lockscreen user to username. Ignore when username is
	 * "ddm".
	 */
	void (*switch_to_user)(struct wl_client *client,
			       struct wl_resource *resource,
			       const char *username);
	/**
	 * activate wayland session
	 *
	 * Activate treeland session. This will makes treeland try to
	 * take control of screen.
	 */
	void (*activate_session)(struct wl_client *client,
				 struct wl_resource *resource);
	/**
	 * deactivate wayland session
	 *
	 * Deactivate treeland session. This will release control of the
	 * screen, but not to close the current seats.
	 */
	void (*deactivate_session)(struct wl_client *client,
				   struct wl_resource *resource);
	/**
	 * start treeland rendering
	 *
	 * Enable treeland rendering. This is primarily called after
	 * disable_render to resume treeland.
	 */
	void (*enable_render)(struct wl_client *client,
			      struct wl_resource *resource);
	/**
	 * stop treeland rendering
	 *
	 * Disable treeland rendering. This will prevent treeland from
	 * output to DRM device.
	 */
	void (*disable_render)(struct wl_client *client,
			       struct wl_resource *resource,
			       uint32_t callback);
	/**
	 * Destroy the treeland_ddm_v1
	 *
	 * Destroys this treeland_ddm_v1 object.
	 * @since 2
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
};

#define TREELAND_DDM_V1_SWITCH_TO_VT 0
#define TREELAND_DDM_V1_ACQUIRE_VT 1

/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_SWITCH_TO_VT_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_ACQUIRE_VT_SINCE_VERSION 1

/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_SWITCH_TO_GREETER_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_SWITCH_TO_USER_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_ACTIVATE_SESSION_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_DEACTIVATE_SESSION_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_ENABLE_RENDER_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_DISABLE_RENDER_SINCE_VERSION 1
/**
 * @ingroup iface_treeland_ddm_v1
 */
#define TREELAND_DDM_V1_DESTROY_SINCE_VERSION 2

/**
 * @ingroup iface_treeland_ddm_v1
 * Sends an switch_to_vt event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
treeland_ddm_v1_send_switch_to_vt(struct wl_resource *resource_, int32_t vtnr)
{
	wl_resource_post_event(resource_, TREELAND_DDM_V1_SWITCH_TO_VT, vtnr);
}

/**
 * @ingroup iface_treeland_ddm_v1
 * Sends an acquire_vt event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
treeland_ddm_v1_send_acquire_vt(struct wl_resource *resource_, int32_t vtnr)
{
	wl_resource_post_event(resource_, TREELAND_DDM_V1_ACQUIRE_VT, vtnr);
}

#ifdef  __cplusplus
}
#endif

#endif
