/* Generated by wayland-scanner 1.26.0 */

#ifndef DRM_EGL_SERVER_BUFFER_SERVER_PROTOCOL_H
#define DRM_EGL_SERVER_BUFFER_SERVER_PROTOCOL_H

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

#ifdef  __cplusplus
extern "C" {
#endif

struct wl_client;
struct wl_resource;

/**
 * @page page_drm_egl_server_buffer The drm_egl_server_buffer protocol
 * @section page_ifaces_drm_egl_server_buffer Interfaces
 * - @subpage page_iface_qt_drm_egl_server_buffer - 
 * @section page_copyright_drm_egl_server_buffer Copyright
 * <pre>
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
 * </pre>
 */
struct qt_drm_egl_server_buffer;
struct qt_server_buffer;

#ifndef QT_DRM_EGL_SERVER_BUFFER_INTERFACE
#define QT_DRM_EGL_SERVER_BUFFER_INTERFACE
/**
 * @page page_iface_qt_drm_egl_server_buffer qt_drm_egl_server_buffer
 * @section page_iface_qt_drm_egl_server_buffer_api API
 * See @ref iface_qt_drm_egl_server_buffer.
 */
/**
 * @defgroup iface_qt_drm_egl_server_buffer The qt_drm_egl_server_buffer interface
 */
extern const struct wl_interface qt_drm_egl_server_buffer_interface;
#endif

#ifndef QT_DRM_EGL_SERVER_BUFFER_FORMAT_ENUM
#define QT_DRM_EGL_SERVER_BUFFER_FORMAT_ENUM
enum qt_drm_egl_server_buffer_format {
	QT_DRM_EGL_SERVER_BUFFER_FORMAT_RGBA32 = 0,
	QT_DRM_EGL_SERVER_BUFFER_FORMAT_A8 = 1,
};
#endif /* QT_DRM_EGL_SERVER_BUFFER_FORMAT_ENUM */

#ifndef QT_DRM_EGL_SERVER_BUFFER_FORMAT_ENUM_IS_VALID
#define QT_DRM_EGL_SERVER_BUFFER_FORMAT_ENUM_IS_VALID
/**
 * @ingroup iface_qt_drm_egl_server_buffer
 * Validate a qt_drm_egl_server_buffer format value.
 *
 * @return true on success, false on error.
 * @ref qt_drm_egl_server_buffer_format
 */
static inline bool
qt_drm_egl_server_buffer_format_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case QT_DRM_EGL_SERVER_BUFFER_FORMAT_RGBA32:
		return version >= 1;
	case QT_DRM_EGL_SERVER_BUFFER_FORMAT_A8:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* QT_DRM_EGL_SERVER_BUFFER_FORMAT_ENUM_IS_VALID */

#define QT_DRM_EGL_SERVER_BUFFER_SERVER_BUFFER_CREATED 0

/**
 * @ingroup iface_qt_drm_egl_server_buffer
 */
#define QT_DRM_EGL_SERVER_BUFFER_SERVER_BUFFER_CREATED_SINCE_VERSION 1


/**
 * @ingroup iface_qt_drm_egl_server_buffer
 * Sends an server_buffer_created event to the client owning the resource.
 * @param resource_ The client's resource
 */
static inline void
qt_drm_egl_server_buffer_send_server_buffer_created(struct wl_resource *resource_, struct wl_resource *id, int32_t name, int32_t width, int32_t height, int32_t stride, int32_t format)
{
	wl_resource_post_event(resource_, QT_DRM_EGL_SERVER_BUFFER_SERVER_BUFFER_CREATED, id, name, width, height, stride, format);
}

#ifdef  __cplusplus
}
#endif

#endif
