/* Generated by wayland-scanner 1.26.0 */

#ifndef WLR_OUTPUT_MANAGEMENT_UNSTABLE_V1_SERVER_PROTOCOL_H
#define WLR_OUTPUT_MANAGEMENT_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_wlr_output_management_unstable_v1 The wlr_output_management_unstable_v1 protocol
 * protocol to configure output devices
 *
 * @section page_desc_wlr_output_management_unstable_v1 Description
 *
 * This protocol exposes interfaces to obtain and modify output device
 * configuration.
 *
 * Warning! The protocol described in this file is experimental and
 * backward incompatible changes may be made. Backward compatible changes
 * may be added together with the corresponding interface version bump.
 * Backward incompatible changes are done by bumping the version number in
 * the protocol and interface names and resetting the interface version.
 * Once the protocol is to be declared stable, the 'z' prefix and the
 * version number in the protocol and interface names are removed and the
 * interface version number is reset.
 *
 * @section page_ifaces_wlr_output_management_unstable_v1 Interfaces
 * - @subpage page_iface_zwlr_output_manager_v1 - output device configuration manager
 * - @subpage page_iface_zwlr_output_head_v1 - output device
 * - @subpage page_iface_zwlr_output_mode_v1 - output mode
 * - @subpage page_iface_zwlr_output_configuration_v1 - output configuration
 * - @subpage page_iface_zwlr_output_configuration_head_v1 - head configuration
 * @section page_copyright_wlr_output_management_unstable_v1 Copyright
 * <pre>
 *
 * Copyright © 2019 Purism SPC
 *
 * Permission to use, copy, modify, distribute, and sell this
 * software and its documentation for any purpose is hereby granted
 * without fee, provided that the above copyright notice appear in
 * all copies and that both that copyright notice and this permission
 * notice appear in supporting documentation, and that the name of
 * the copyright holders not be used in advertising or publicity
 * pertaining to distribution of the software without specific,
 * written prior permission.  The copyright holders make no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied
 * warranty.
 *
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 * THIS SOFTWARE.
 * </pre>
 */
struct zwlr_output_configuration_head_v1;
struct zwlr_output_configuration_v1;
struct zwlr_output_head_v1;
struct zwlr_output_manager_v1;
struct zwlr_output_mode_v1;

#ifndef ZWLR_OUTPUT_MANAGER_V1_INTERFACE
#define ZWLR_OUTPUT_MANAGER_V1_INTERFACE
/**
 * @page page_iface_zwlr_output_manager_v1 zwlr_output_manager_v1
 * @section page_iface_zwlr_output_manager_v1_desc Description
 *
 * This interface is a manager that allows reading and writing the current
 * output device configuration.
 *
 * Output devices that display pixels (e.g. a physical monitor or a virtual
 * output in a window) are represented as heads. Heads cannot be created nor
 * destroyed by the client, but they can be enabled or disabled and their
 * properties can be changed. Each head may have one or more available modes.
 *
 * Whenever a head appears (e.g. a monitor is plugged in), it will be
 * advertised via the head event. Immediately after the output manager is
 * bound, all current heads are advertised.
 *
 * Whenever a head's properties change, the relevant wlr_output_head events
 * will be sent. Not all head properties will be sent: only properties that
 * have changed need to.
 *
 * Whenever a head disappears (e.g. a monitor is unplugged), a
 * wlr_output_head.finished event will be sent.
 *
 * After one or more heads appear, change or disappear, the done event will
 * be sent. It carries a serial which can be used in a create_configuration
 * request to update heads properties.
 *
 * The information obtained from this protocol should only be used for output
 * configuration purposes. This protocol is not designed to be a generic
 * output property advertisement protocol for regular clients. Instead,
 * protocols such as xdg-output should be used.
 * @section page_iface_zwlr_output_manager_v1_api API
 * See @ref iface_zwlr_output_manager_v1.
 */
/**
 * @defgroup iface_zwlr_output_manager_v1 The zwlr_output_manager_v1 interface
 *
 * This interface is a manager that allows reading and writing the current
 * output device configuration.
 *
 * Output devices that display pixels (e.g. a physical monitor or a virtual
 * output in a window) are represented as heads. Heads cannot be created nor
 * destroyed by the client, but they can be enabled or disabled and their
 * properties can be changed. Each head may have one or more available modes.
 *
 * Whenever a head appears (e.g. a monitor is plugged in), it will be
 * advertised via the head event. Immediately after the output manager is
 * bound, all current heads are advertised.
 *
 * Whenever a head's properties change, the relevant wlr_output_head events
 * will be sent. Not all head properties will be sent: only properties that
 * have changed need to.
 *
 * Whenever a head disappears (e.g. a monitor is unplugged), a
 * wlr_output_head.finished event will be sent.
 *
 * After one or more heads appear, change or disappear, the done event will
 * be sent. It carries a serial which can be used in a create_configuration
 * request to update heads properties.
 *
 * The information obtained from this protocol should only be used for output
 * configuration purposes. This protocol is not designed to be a generic
 * output property advertisement protocol for regular clients. Instead,
 * protocols such as xdg-output should be used.
 */
extern const struct wl_interface zwlr_output_manager_v1_interface;
#endif
#ifndef ZWLR_OUTPUT_HEAD_V1_INTERFACE
#define ZWLR_OUTPUT_HEAD_V1_INTERFACE
/**
 * @page page_iface_zwlr_output_head_v1 zwlr_output_head_v1
 * @section page_iface_zwlr_output_head_v1_desc Description
 *
 * A head is an output device. The difference between a wl_output object and
 * a head is that heads are advertised even if they are turned off. A head
 * object only advertises properties and cannot be used directly to change
 * them.
 *
 * A head has some read-only properties: modes, name, description and
 * physical_size. These cannot be changed by clients.
 *
 * Other properties can be updated via a wlr_output_configuration object.
 *
 * Properties sent via this interface are applied atomically via the
 * wlr_output_manager.done event. No guarantees are made regarding the order
 * in which properties are sent.
 * @section page_iface_zwlr_output_head_v1_api API
 * See @ref iface_zwlr_output_head_v1.
 */
/**
 * @defgroup iface_zwlr_output_head_v1 The zwlr_output_head_v1 interface
 *
 * A head is an output device. The difference between a wl_output object and
 * a head is that heads are advertised even if they are turned off. A head
 * object only advertises properties and cannot be used directly to change
 * them.
 *
 * A head has some read-only properties: modes, name, description and
 * physical_size. These cannot be changed by clients.
 *
 * Other properties can be updated via a wlr_output_configuration object.
 *
 * Properties sent via this interface are applied atomically via the
 * wlr_output_manager.done event. No guarantees are made regarding the order
 * in which properties are sent.
 */
extern const struct wl_interface zwlr_output_head_v1_interface;
#endif
#ifndef ZWLR_OUTPUT_MODE_V1_INTERFACE
#define ZWLR_OUTPUT_MODE_V1_INTERFACE
/**
 * @page page_iface_zwlr_output_mode_v1 zwlr_output_mode_v1
 * @section page_iface_zwlr_output_mode_v1_desc Description
 *
 * This object describes an output mode.
 *
 * Some heads don't support output modes, in which case modes won't be
 * advertised.
 *
 * Properties sent via this interface are applied atomically via the
 * wlr_output_manager.done event. No guarantees are made regarding the order
 * in which properties are sent.
 * @section page_iface_zwlr_output_mode_v1_api API
 * See @ref iface_zwlr_output_mode_v1.
 */
/**
 * @defgroup iface_zwlr_output_mode_v1 The zwlr_output_mode_v1 interface
 *
 * This object describes an output mode.
 *
 * Some heads don't support output modes, in which case modes won't be
 * advertised.
 *
 * Properties sent via this interface are applied atomically via the
 * wlr_output_manager.done event. No guarantees are made regarding the order
 * in which properties are sent.
 */
extern const struct wl_interface zwlr_output_mode_v1_interface;
#endif
#ifndef ZWLR_OUTPUT_CONFIGURATION_V1_INTERFACE
#define ZWLR_OUTPUT_CONFIGURATION_V1_INTERFACE
/**
 * @page page_iface_zwlr_output_configuration_v1 zwlr_output_configuration_v1
 * @section page_iface_zwlr_output_configuration_v1_desc Description
 *
 * This object is used by the client to describe a full output configuration.
 *
 * First, the client needs to setup the output configuration. Each head can
 * be either enabled (and configured) or disabled. It is a protocol error to
 * send two enable_head or disable_head requests with the same head. It is a
 * protocol error to omit a head in a configuration.
 *
 * Then, the client can apply or test the configuration. The compositor will
 * then reply with a succeeded, failed or cancelled event. Finally the client
 * should destroy the configuration object.
 * @section page_iface_zwlr_output_configuration_v1_api API
 * See @ref iface_zwlr_output_configuration_v1.
 */
/**
 * @defgroup iface_zwlr_output_configuration_v1 The zwlr_output_configuration_v1 interface
 *
 * This object is used by the client to describe a full output configuration.
 *
 * First, the client needs to setup the output configuration. Each head can
 * be either enabled (and configured) or disabled. It is a protocol error to
 * send two enable_head or disable_head requests with the same head. It is a
 * protocol error to omit a head in a configuration.
 *
 * Then, the client can apply or test the configuration. The compositor will
 * then reply with a succeeded, failed or cancelled event. Finally the client
 * should destroy the configuration object.
 */
extern const struct wl_interface zwlr_output_configuration_v1_interface;
#endif
#ifndef ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_INTERFACE
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_INTERFACE
/**
 * @page page_iface_zwlr_output_configuration_head_v1 zwlr_output_configuration_head_v1
 * @section page_iface_zwlr_output_configuration_head_v1_desc Description
 *
 * This object is used by the client to update a single head's configuration.
 *
 * It is a protocol error to set the same property twice.
 * @section page_iface_zwlr_output_configuration_head_v1_api API
 * See @ref iface_zwlr_output_configuration_head_v1.
 */
/**
 * @defgroup iface_zwlr_output_configuration_head_v1 The zwlr_output_configuration_head_v1 interface
 *
 * This object is used by the client to update a single head's configuration.
 *
 * It is a protocol error to set the same property twice.
 */
extern const struct wl_interface zwlr_output_configuration_head_v1_interface;
#endif

/**
 * @ingroup iface_zwlr_output_manager_v1
 * @struct zwlr_output_manager_v1_interface
 */
struct zwlr_output_manager_v1_interface {
	/**
	 * create a new output configuration object
	 *
	 * Create a new output configuration object. This allows to
	 * update head properties.
	 */
	void (*create_configuration)(struct wl_client *client,
				     struct wl_resource *resource,
				     uint32_t id,
				     uint32_t serial);
	/**
	 * stop sending events
	 *
	 * Indicates the client no longer wishes to receive events for
	 * output configuration changes. However the compositor may emit
	 * further events, until the finished event is emitted.
	 *
	 * The client must not send any more requests after this one.
	 */
	void (*stop)(struct wl_client *client,
		     struct wl_resource *resource);
};

#define ZWLR_OUTPUT_MANAGER_V1_HEAD 0
#define ZWLR_OUTPUT_MANAGER_V1_DONE 1
#define ZWLR_OUTPUT_MANAGER_V1_FINISHED 2

/**
 * @ingroup iface_zwlr_output_manager_v1
 */
#define ZWLR_OUTPUT_MANAGER_V1_HEAD_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_manager_v1
 */
#define ZWLR_OUTPUT_MANAGER_V1_DONE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_manager_v1
 */
#define ZWLR_OUTPUT_MANAGER_V1_FINISHED_SINCE_VERSION 1

/**
 * @ingroup iface_zwlr_output_manager_v1
 */
#define ZWLR_OUTPUT_MANAGER_V1_CREATE_CONFIGURATION_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_manager_v1
 */
#define ZWLR_OUTPUT_MANAGER_V1_STOP_SINCE_VERSION 1

/**
 * @ingroup iface_zwlr_output_manager_v1
 * Sends an head event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_manager_v1_send_head(struct wl_resource *resource_, struct wl_resource *head)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_MANAGER_V1_HEAD, head);
}

/**
 * @ingroup iface_zwlr_output_manager_v1
 * Sends an done event to the client owning the resource.
 * @param resource_ The client's resource
 * @param serial current configuration serial
 */
static inline void
zwlr_output_manager_v1_send_done(struct wl_resource *resource_, uint32_t serial)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_MANAGER_V1_DONE, serial);
}

/**
 * @ingroup iface_zwlr_output_manager_v1
 * Sends an finished event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_manager_v1_send_finished(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_MANAGER_V1_FINISHED);
}

#ifndef ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENUM
#define ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENUM
enum zwlr_output_head_v1_adaptive_sync_state {
	/**
	 * adaptive sync is disabled
	 */
	ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_DISABLED = 0,
	/**
	 * adaptive sync is enabled
	 */
	ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENABLED = 1,
};
#endif /* ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENUM */

#ifndef ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENUM_IS_VALID
#define ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENUM_IS_VALID
/**
 * @ingroup iface_zwlr_output_head_v1
 * Validate a zwlr_output_head_v1 adaptive_sync_state value.
 *
 * @return true on success, false on error.
 * @ref zwlr_output_head_v1_adaptive_sync_state
 */
static inline bool
zwlr_output_head_v1_adaptive_sync_state_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_DISABLED:
		return version >= 1;
	case ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENABLED:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_STATE_ENUM_IS_VALID */

/**
 * @ingroup iface_zwlr_output_head_v1
 * @struct zwlr_output_head_v1_interface
 */
struct zwlr_output_head_v1_interface {
	/**
	 * destroy the head object
	 *
	 * This request indicates that the client will no longer use this
	 * head object.
	 * @since 3
	 */
	void (*release)(struct wl_client *client,
			struct wl_resource *resource);
};

#define ZWLR_OUTPUT_HEAD_V1_NAME 0
#define ZWLR_OUTPUT_HEAD_V1_DESCRIPTION 1
#define ZWLR_OUTPUT_HEAD_V1_PHYSICAL_SIZE 2
#define ZWLR_OUTPUT_HEAD_V1_MODE 3
#define ZWLR_OUTPUT_HEAD_V1_ENABLED 4
#define ZWLR_OUTPUT_HEAD_V1_CURRENT_MODE 5
#define ZWLR_OUTPUT_HEAD_V1_POSITION 6
#define ZWLR_OUTPUT_HEAD_V1_TRANSFORM 7
#define ZWLR_OUTPUT_HEAD_V1_SCALE 8
#define ZWLR_OUTPUT_HEAD_V1_FINISHED 9
#define ZWLR_OUTPUT_HEAD_V1_MAKE 10
#define ZWLR_OUTPUT_HEAD_V1_MODEL 11
#define ZWLR_OUTPUT_HEAD_V1_SERIAL_NUMBER 12
#define ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC 13

/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_NAME_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_DESCRIPTION_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_PHYSICAL_SIZE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_MODE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_ENABLED_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_CURRENT_MODE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_POSITION_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_TRANSFORM_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_SCALE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_FINISHED_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_MAKE_SINCE_VERSION 2
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_MODEL_SINCE_VERSION 2
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_SERIAL_NUMBER_SINCE_VERSION 2
/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC_SINCE_VERSION 4

/**
 * @ingroup iface_zwlr_output_head_v1
 */
#define ZWLR_OUTPUT_HEAD_V1_RELEASE_SINCE_VERSION 3

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an name event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_name(struct wl_resource *resource_, const char *name)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_NAME, name);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an description event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_description(struct wl_resource *resource_, const char *description)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_DESCRIPTION, description);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an physical_size event to the client owning the resource.
 * @param resource_ The client's resource
 * @param width width in millimeters of the output
 * @param height height in millimeters of the output
 */
static inline void
zwlr_output_head_v1_send_physical_size(struct wl_resource *resource_, int32_t width, int32_t height)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_PHYSICAL_SIZE, width, height);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an mode event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_mode(struct wl_resource *resource_, struct wl_resource *mode)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_MODE, mode);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an enabled event to the client owning the resource.
 * @param resource_ The client's resource
 * @param enabled zero if disabled, non-zero if enabled
 */
static inline void
zwlr_output_head_v1_send_enabled(struct wl_resource *resource_, int32_t enabled)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_ENABLED, enabled);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an current_mode event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_current_mode(struct wl_resource *resource_, struct wl_resource *mode)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_CURRENT_MODE, mode);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an position event to the client owning the resource.
 * @param resource_ The client's resource
 * @param x x position within the global compositor space
 * @param y y position within the global compositor space
 */
static inline void
zwlr_output_head_v1_send_position(struct wl_resource *resource_, int32_t x, int32_t y)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_POSITION, x, y);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an transform event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_transform(struct wl_resource *resource_, int32_t transform)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_TRANSFORM, transform);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an scale event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_scale(struct wl_resource *resource_, wl_fixed_t scale)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_SCALE, scale);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an finished event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_finished(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_FINISHED);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an make event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_make(struct wl_resource *resource_, const char *make)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_MAKE, make);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an model event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_model(struct wl_resource *resource_, const char *model)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_MODEL, model);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an serial_number event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_serial_number(struct wl_resource *resource_, const char *serial_number)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_SERIAL_NUMBER, serial_number);
}

/**
 * @ingroup iface_zwlr_output_head_v1
 * Sends an adaptive_sync event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_head_v1_send_adaptive_sync(struct wl_resource *resource_, uint32_t state)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_HEAD_V1_ADAPTIVE_SYNC, state);
}

/**
 * @ingroup iface_zwlr_output_mode_v1
 * @struct zwlr_output_mode_v1_interface
 */
struct zwlr_output_mode_v1_interface {
	/**
	 * destroy the mode object
	 *
	 * This request indicates that the client will no longer use this
	 * mode object.
	 * @since 3
	 */
	void (*release)(struct wl_client *client,
			struct wl_resource *resource);
};

#define ZWLR_OUTPUT_MODE_V1_SIZE 0
#define ZWLR_OUTPUT_MODE_V1_REFRESH 1
#define ZWLR_OUTPUT_MODE_V1_PREFERRED 2
#define ZWLR_OUTPUT_MODE_V1_FINISHED 3

/**
 * @ingroup iface_zwlr_output_mode_v1
 */
#define ZWLR_OUTPUT_MODE_V1_SIZE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_mode_v1
 */
#define ZWLR_OUTPUT_MODE_V1_REFRESH_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_mode_v1
 */
#define ZWLR_OUTPUT_MODE_V1_PREFERRED_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_mode_v1
 */
#define ZWLR_OUTPUT_MODE_V1_FINISHED_SINCE_VERSION 1

/**
 * @ingroup iface_zwlr_output_mode_v1
 */
#define ZWLR_OUTPUT_MODE_V1_RELEASE_SINCE_VERSION 3

/**
 * @ingroup iface_zwlr_output_mode_v1
 * Sends an size event to the client owning the resource.
 * @param resource_ The client's resource
 * @param width width of the mode in hardware units
 * @param height height of the mode in hardware units
 */
static inline void
zwlr_output_mode_v1_send_size(struct wl_resource *resource_, int32_t width, int32_t height)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_MODE_V1_SIZE, width, height);
}

/**
 * @ingroup iface_zwlr_output_mode_v1
 * Sends an refresh event to the client owning the resource.
 * @param resource_ The client's resource
 * @param refresh vertical refresh rate in mHz
 */
static inline void
zwlr_output_mode_v1_send_refresh(struct wl_resource *resource_, int32_t refresh)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_MODE_V1_REFRESH, refresh);
}

/**
 * @ingroup iface_zwlr_output_mode_v1
 * Sends an preferred event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_mode_v1_send_preferred(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_MODE_V1_PREFERRED);
}

/**
 * @ingroup iface_zwlr_output_mode_v1
 * Sends an finished event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_mode_v1_send_finished(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_MODE_V1_FINISHED);
}

#ifndef ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ENUM
#define ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ENUM
enum zwlr_output_configuration_v1_error {
	/**
	 * head has been configured twice
	 */
	ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ALREADY_CONFIGURED_HEAD = 1,
	/**
	 * head has not been configured
	 */
	ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_UNCONFIGURED_HEAD = 2,
	/**
	 * request sent after configuration has been applied or tested
	 */
	ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ALREADY_USED = 3,
};
#endif /* ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ENUM */

#ifndef ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ENUM_IS_VALID
#define ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ENUM_IS_VALID
/**
 * @ingroup iface_zwlr_output_configuration_v1
 * Validate a zwlr_output_configuration_v1 error value.
 *
 * @return true on success, false on error.
 * @ref zwlr_output_configuration_v1_error
 */
static inline bool
zwlr_output_configuration_v1_error_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ALREADY_CONFIGURED_HEAD:
		return version >= 1;
	case ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_UNCONFIGURED_HEAD:
		return version >= 1;
	case ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ALREADY_USED:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* ZWLR_OUTPUT_CONFIGURATION_V1_ERROR_ENUM_IS_VALID */

/**
 * @ingroup iface_zwlr_output_configuration_v1
 * @struct zwlr_output_configuration_v1_interface
 */
struct zwlr_output_configuration_v1_interface {
	/**
	 * enable and configure a head
	 *
	 * Enable a head. This request creates a head configuration
	 * object that can be used to change the head's properties.
	 * @param id a new object to configure the head
	 * @param head the head to be enabled
	 */
	void (*enable_head)(struct wl_client *client,
			    struct wl_resource *resource,
			    uint32_t id,
			    struct wl_resource *head);
	/**
	 * disable a head
	 *
	 * Disable a head.
	 * @param head the head to be disabled
	 */
	void (*disable_head)(struct wl_client *client,
			     struct wl_resource *resource,
			     struct wl_resource *head);
	/**
	 * apply the configuration
	 *
	 * Apply the new output configuration.
	 *
	 * In case the configuration is successfully applied, there is no
	 * guarantee that the new output state matches completely the
	 * requested configuration. For instance, a compositor might round
	 * the scale if it doesn't support fractional scaling.
	 *
	 * After this request has been sent, the compositor must respond
	 * with an succeeded, failed or cancelled event. Sending a request
	 * that isn't the destructor is a protocol error.
	 */
	void (*apply)(struct wl_client *client,
		      struct wl_resource *resource);
	/**
	 * test the configuration
	 *
	 * Test the new output configuration. The configuration won't be
	 * applied, but will only be validated.
	 *
	 * Even if the compositor succeeds to test a configuration,
	 * applying it may fail.
	 *
	 * After this request has been sent, the compositor must respond
	 * with an succeeded, failed or cancelled event. Sending a request
	 * that isn't the destructor is a protocol error.
	 */
	void (*test)(struct wl_client *client,
		     struct wl_resource *resource);
	/**
	 * destroy the output configuration
	 *
	 * Using this request a client can tell the compositor that it is
	 * not going to use the configuration object anymore. Any changes
	 * to the outputs that have not been applied will be discarded.
	 *
	 * This request also destroys wlr_output_configuration_head objects
	 * created via this object.
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
};

#define ZWLR_OUTPUT_CONFIGURATION_V1_SUCCEEDED 0
#define ZWLR_OUTPUT_CONFIGURATION_V1_FAILED 1
#define ZWLR_OUTPUT_CONFIGURATION_V1_CANCELLED 2

/**
 * @ingroup iface_zwlr_output_configuration_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_V1_SUCCEEDED_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_V1_FAILED_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_V1_CANCELLED_SINCE_VERSION 1

/**
 * @ingroup iface_zwlr_output_configuration_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_V1_ENABLE_HEAD_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_V1_DISABLE_HEAD_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_V1_APPLY_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_V1_TEST_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_V1_DESTROY_SINCE_VERSION 1

/**
 * @ingroup iface_zwlr_output_configuration_v1
 * Sends an succeeded event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_configuration_v1_send_succeeded(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_CONFIGURATION_V1_SUCCEEDED);
}

/**
 * @ingroup iface_zwlr_output_configuration_v1
 * Sends an failed event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_configuration_v1_send_failed(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_CONFIGURATION_V1_FAILED);
}

/**
 * @ingroup iface_zwlr_output_configuration_v1
 * Sends an cancelled event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
zwlr_output_configuration_v1_send_cancelled(struct wl_resource *resource_)
{
	wl_resource_post_event(resource_, ZWLR_OUTPUT_CONFIGURATION_V1_CANCELLED);
}

#ifndef ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_ENUM
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_ENUM
enum zwlr_output_configuration_head_v1_error {
	/**
	 * property has already been set
	 */
	ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_ALREADY_SET = 1,
	/**
	 * mode doesn't belong to head
	 */
	ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_MODE = 2,
	/**
	 * mode is invalid
	 */
	ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_CUSTOM_MODE = 3,
	/**
	 * transform value outside enum
	 */
	ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_TRANSFORM = 4,
	/**
	 * scale negative or zero
	 */
	ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_SCALE = 5,
	/**
	 * invalid enum value used in the set_adaptive_sync request
	 * @since 4
	 */
	ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_ADAPTIVE_SYNC_STATE = 6,
};
/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_ADAPTIVE_SYNC_STATE_SINCE_VERSION 4
#endif /* ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_ENUM */

#ifndef ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_ENUM_IS_VALID
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_ENUM_IS_VALID
/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 * Validate a zwlr_output_configuration_head_v1 error value.
 *
 * @return true on success, false on error.
 * @ref zwlr_output_configuration_head_v1_error
 */
static inline bool
zwlr_output_configuration_head_v1_error_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_ALREADY_SET:
		return version >= 1;
	case ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_MODE:
		return version >= 1;
	case ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_CUSTOM_MODE:
		return version >= 1;
	case ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_TRANSFORM:
		return version >= 1;
	case ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_SCALE:
		return version >= 1;
	case ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_ADAPTIVE_SYNC_STATE:
		return version >= 4;
	default:
		return false;
	}
}
#endif /* ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_ENUM_IS_VALID */

/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 * @struct zwlr_output_configuration_head_v1_interface
 */
struct zwlr_output_configuration_head_v1_interface {
	/**
	 * set the mode
	 *
	 * This request sets the head's mode.
	 */
	void (*set_mode)(struct wl_client *client,
			 struct wl_resource *resource,
			 struct wl_resource *mode);
	/**
	 * set a custom mode
	 *
	 * This request assigns a custom mode to the head. The size is
	 * given in physical hardware units of the output device. If set to
	 * zero, the refresh rate is unspecified.
	 *
	 * It is a protocol error to set both a mode and a custom mode.
	 * @param width width of the mode in hardware units
	 * @param height height of the mode in hardware units
	 * @param refresh vertical refresh rate in mHz or zero
	 */
	void (*set_custom_mode)(struct wl_client *client,
				struct wl_resource *resource,
				int32_t width,
				int32_t height,
				int32_t refresh);
	/**
	 * set the position
	 *
	 * This request sets the head's position in the global compositor
	 * space.
	 * @param x x position in the global compositor space
	 * @param y y position in the global compositor space
	 */
	void (*set_position)(struct wl_client *client,
			     struct wl_resource *resource,
			     int32_t x,
			     int32_t y);
	/**
	 * set the transform
	 *
	 * This request sets the head's transform.
	 */
	void (*set_transform)(struct wl_client *client,
			      struct wl_resource *resource,
			      int32_t transform);
	/**
	 * set the scale
	 *
	 * This request sets the head's scale.
	 */
	void (*set_scale)(struct wl_client *client,
			  struct wl_resource *resource,
			  wl_fixed_t scale);
	/**
	 * enable/disable adaptive sync
	 *
	 * This request enables/disables adaptive sync. Adaptive sync is
	 * also known as Variable Refresh Rate or VRR.
	 * @since 4
	 */
	void (*set_adaptive_sync)(struct wl_client *client,
				  struct wl_resource *resource,
				  uint32_t state);
};


/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_SET_MODE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_SET_CUSTOM_MODE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_SET_POSITION_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_SET_TRANSFORM_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_SET_SCALE_SINCE_VERSION 1
/**
 * @ingroup iface_zwlr_output_configuration_head_v1
 */
#define ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_SET_ADAPTIVE_SYNC_SINCE_VERSION 4

#ifdef  __cplusplus
}
#endif

#endif
