/* Generated by wayland-scanner 1.25.0 */

#ifndef TREELAND_DDM_V1_CLIENT_PROTOCOL_H
#define TREELAND_DDM_V1_CLIENT_PROTOCOL_H

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

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * @page page_treeland_ddm_v1 The treeland_ddm_v1 protocol
 * @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_listener
 */
struct treeland_ddm_v1_listener {
	/**
	 * switch to virtual terminal
	 *
	 * Call ddm to switch current virtual terminal to vtnr. ddm
	 * should take care of the switch and call ioctl respectively.
	 */
	void (*switch_to_vt)(void *data,
			     struct treeland_ddm_v1 *treeland_ddm_v1,
			     int32_t vtnr);
	/**
	 * acquire control of virtual terminal
	 *
	 * Call ddm to acquire control of VT at vtnr. ddm should call
	 * VT_SETMODE respectively.
	 */
	void (*acquire_vt)(void *data,
			   struct treeland_ddm_v1 *treeland_ddm_v1,
			   int32_t vtnr);
};

/**
 * @ingroup iface_treeland_ddm_v1
 */
static inline int
treeland_ddm_v1_add_listener(struct treeland_ddm_v1 *treeland_ddm_v1,
			     const struct treeland_ddm_v1_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) treeland_ddm_v1,
				     (void (**)(void)) listener, data);
}

#define TREELAND_DDM_V1_SWITCH_TO_GREETER 0
#define TREELAND_DDM_V1_SWITCH_TO_USER 1
#define TREELAND_DDM_V1_ACTIVATE_SESSION 2
#define TREELAND_DDM_V1_DEACTIVATE_SESSION 3
#define TREELAND_DDM_V1_ENABLE_RENDER 4
#define TREELAND_DDM_V1_DISABLE_RENDER 5
#define TREELAND_DDM_V1_DESTROY 6

/**
 * @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 */
static inline void
treeland_ddm_v1_set_user_data(struct treeland_ddm_v1 *treeland_ddm_v1, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) treeland_ddm_v1, user_data);
}

/** @ingroup iface_treeland_ddm_v1 */
static inline void *
treeland_ddm_v1_get_user_data(struct treeland_ddm_v1 *treeland_ddm_v1)
{
	return wl_proxy_get_user_data((struct wl_proxy *) treeland_ddm_v1);
}

static inline uint32_t
treeland_ddm_v1_get_version(struct treeland_ddm_v1 *treeland_ddm_v1)
{
	return wl_proxy_get_version((struct wl_proxy *) treeland_ddm_v1);
}

/**
 * @ingroup iface_treeland_ddm_v1
 *
 * Send treeland to Greeter mode.
 */
static inline void
treeland_ddm_v1_switch_to_greeter(struct treeland_ddm_v1 *treeland_ddm_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_ddm_v1,
			 TREELAND_DDM_V1_SWITCH_TO_GREETER, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_ddm_v1), 0);
}

/**
 * @ingroup iface_treeland_ddm_v1
 *
 * Set lockscreen user to username. Ignore when username is "ddm".
 */
static inline void
treeland_ddm_v1_switch_to_user(struct treeland_ddm_v1 *treeland_ddm_v1, const char *username)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_ddm_v1,
			 TREELAND_DDM_V1_SWITCH_TO_USER, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_ddm_v1), 0, username);
}

/**
 * @ingroup iface_treeland_ddm_v1
 *
 * Activate treeland session. This will makes treeland try to take
 * control of screen.
 */
static inline void
treeland_ddm_v1_activate_session(struct treeland_ddm_v1 *treeland_ddm_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_ddm_v1,
			 TREELAND_DDM_V1_ACTIVATE_SESSION, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_ddm_v1), 0);
}

/**
 * @ingroup iface_treeland_ddm_v1
 *
 * Deactivate treeland session. This will release control of the
 * screen, but not to close the current seats.
 */
static inline void
treeland_ddm_v1_deactivate_session(struct treeland_ddm_v1 *treeland_ddm_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_ddm_v1,
			 TREELAND_DDM_V1_DEACTIVATE_SESSION, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_ddm_v1), 0);
}

/**
 * @ingroup iface_treeland_ddm_v1
 *
 * Enable treeland rendering. This is primarily called after
 * disable_render to resume treeland.
 */
static inline void
treeland_ddm_v1_enable_render(struct treeland_ddm_v1 *treeland_ddm_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_ddm_v1,
			 TREELAND_DDM_V1_ENABLE_RENDER, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_ddm_v1), 0);
}

/**
 * @ingroup iface_treeland_ddm_v1
 *
 * Disable treeland rendering. This will prevent treeland from
 * output to DRM device.
 */
static inline struct wl_callback *
treeland_ddm_v1_disable_render(struct treeland_ddm_v1 *treeland_ddm_v1)
{
	struct wl_proxy *callback;

	callback = wl_proxy_marshal_flags((struct wl_proxy *) treeland_ddm_v1,
			 TREELAND_DDM_V1_DISABLE_RENDER, &wl_callback_interface, wl_proxy_get_version((struct wl_proxy *) treeland_ddm_v1), 0, NULL);

	return (struct wl_callback *) callback;
}

/**
 * @ingroup iface_treeland_ddm_v1
 *
 * Destroys this treeland_ddm_v1 object.
 */
static inline void
treeland_ddm_v1_destroy(struct treeland_ddm_v1 *treeland_ddm_v1)
{
	wl_proxy_marshal_flags((struct wl_proxy *) treeland_ddm_v1,
			 TREELAND_DDM_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) treeland_ddm_v1), WL_MARSHAL_FLAG_DESTROY);
}

#ifdef  __cplusplus
}
#endif

#endif
