/* Generated by wayland-scanner 1.24.0 */

#ifndef WPE_DMABUF_POOL_CLIENT_PROTOCOL_H
#define WPE_DMABUF_POOL_CLIENT_PROTOCOL_H

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

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * @page page_wpe_dmabuf_pool The wpe_dmabuf_pool protocol
 * @section page_ifaces_wpe_dmabuf_pool Interfaces
 * - @subpage page_iface_wpe_dmabuf_pool_manager - 
 * - @subpage page_iface_wpe_dmabuf_pool - 
 * - @subpage page_iface_wpe_dmabuf_data - 
 * @section page_copyright_wpe_dmabuf_pool Copyright
 * <pre>
 *
 * Copyright © 2020 Igalia S.L.
 *
 * 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 wl_buffer;
struct wl_surface;
struct wpe_dmabuf_data;
struct wpe_dmabuf_pool;
struct wpe_dmabuf_pool_manager;

#ifndef WPE_DMABUF_POOL_MANAGER_INTERFACE
#define WPE_DMABUF_POOL_MANAGER_INTERFACE
/**
 * @page page_iface_wpe_dmabuf_pool_manager wpe_dmabuf_pool_manager
 * @section page_iface_wpe_dmabuf_pool_manager_api API
 * See @ref iface_wpe_dmabuf_pool_manager.
 */
/**
 * @defgroup iface_wpe_dmabuf_pool_manager The wpe_dmabuf_pool_manager interface
 */
extern const struct wl_interface wpe_dmabuf_pool_manager_interface;
#endif
#ifndef WPE_DMABUF_POOL_INTERFACE
#define WPE_DMABUF_POOL_INTERFACE
/**
 * @page page_iface_wpe_dmabuf_pool wpe_dmabuf_pool
 * @section page_iface_wpe_dmabuf_pool_api API
 * See @ref iface_wpe_dmabuf_pool.
 */
/**
 * @defgroup iface_wpe_dmabuf_pool The wpe_dmabuf_pool interface
 */
extern const struct wl_interface wpe_dmabuf_pool_interface;
#endif
#ifndef WPE_DMABUF_DATA_INTERFACE
#define WPE_DMABUF_DATA_INTERFACE
/**
 * @page page_iface_wpe_dmabuf_data wpe_dmabuf_data
 * @section page_iface_wpe_dmabuf_data_api API
 * See @ref iface_wpe_dmabuf_data.
 */
/**
 * @defgroup iface_wpe_dmabuf_data The wpe_dmabuf_data interface
 */
extern const struct wl_interface wpe_dmabuf_data_interface;
#endif

#define WPE_DMABUF_POOL_MANAGER_CREATE_POOL 0


/**
 * @ingroup iface_wpe_dmabuf_pool_manager
 */
#define WPE_DMABUF_POOL_MANAGER_CREATE_POOL_SINCE_VERSION 1

/** @ingroup iface_wpe_dmabuf_pool_manager */
static inline void
wpe_dmabuf_pool_manager_set_user_data(struct wpe_dmabuf_pool_manager *wpe_dmabuf_pool_manager, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) wpe_dmabuf_pool_manager, user_data);
}

/** @ingroup iface_wpe_dmabuf_pool_manager */
static inline void *
wpe_dmabuf_pool_manager_get_user_data(struct wpe_dmabuf_pool_manager *wpe_dmabuf_pool_manager)
{
	return wl_proxy_get_user_data((struct wl_proxy *) wpe_dmabuf_pool_manager);
}

static inline uint32_t
wpe_dmabuf_pool_manager_get_version(struct wpe_dmabuf_pool_manager *wpe_dmabuf_pool_manager)
{
	return wl_proxy_get_version((struct wl_proxy *) wpe_dmabuf_pool_manager);
}

/** @ingroup iface_wpe_dmabuf_pool_manager */
static inline void
wpe_dmabuf_pool_manager_destroy(struct wpe_dmabuf_pool_manager *wpe_dmabuf_pool_manager)
{
	wl_proxy_destroy((struct wl_proxy *) wpe_dmabuf_pool_manager);
}

/**
 * @ingroup iface_wpe_dmabuf_pool_manager
 */
static inline struct wpe_dmabuf_pool *
wpe_dmabuf_pool_manager_create_pool(struct wpe_dmabuf_pool_manager *wpe_dmabuf_pool_manager, struct wl_surface *surface)
{
	struct wl_proxy *id;

	id = wl_proxy_marshal_flags((struct wl_proxy *) wpe_dmabuf_pool_manager,
			 WPE_DMABUF_POOL_MANAGER_CREATE_POOL, &wpe_dmabuf_pool_interface, wl_proxy_get_version((struct wl_proxy *) wpe_dmabuf_pool_manager), 0, NULL, surface);

	return (struct wpe_dmabuf_pool *) id;
}

#define WPE_DMABUF_POOL_CREATE_BUFFER 0
#define WPE_DMABUF_POOL_GET_DMABUF_DATA 1


/**
 * @ingroup iface_wpe_dmabuf_pool
 */
#define WPE_DMABUF_POOL_CREATE_BUFFER_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_dmabuf_pool
 */
#define WPE_DMABUF_POOL_GET_DMABUF_DATA_SINCE_VERSION 1

/** @ingroup iface_wpe_dmabuf_pool */
static inline void
wpe_dmabuf_pool_set_user_data(struct wpe_dmabuf_pool *wpe_dmabuf_pool, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) wpe_dmabuf_pool, user_data);
}

/** @ingroup iface_wpe_dmabuf_pool */
static inline void *
wpe_dmabuf_pool_get_user_data(struct wpe_dmabuf_pool *wpe_dmabuf_pool)
{
	return wl_proxy_get_user_data((struct wl_proxy *) wpe_dmabuf_pool);
}

static inline uint32_t
wpe_dmabuf_pool_get_version(struct wpe_dmabuf_pool *wpe_dmabuf_pool)
{
	return wl_proxy_get_version((struct wl_proxy *) wpe_dmabuf_pool);
}

/** @ingroup iface_wpe_dmabuf_pool */
static inline void
wpe_dmabuf_pool_destroy(struct wpe_dmabuf_pool *wpe_dmabuf_pool)
{
	wl_proxy_destroy((struct wl_proxy *) wpe_dmabuf_pool);
}

/**
 * @ingroup iface_wpe_dmabuf_pool
 */
static inline struct wl_buffer *
wpe_dmabuf_pool_create_buffer(struct wpe_dmabuf_pool *wpe_dmabuf_pool, uint32_t width, uint32_t height)
{
	struct wl_proxy *buffer_id;

	buffer_id = wl_proxy_marshal_flags((struct wl_proxy *) wpe_dmabuf_pool,
			 WPE_DMABUF_POOL_CREATE_BUFFER, &wl_buffer_interface, wl_proxy_get_version((struct wl_proxy *) wpe_dmabuf_pool), 0, NULL, width, height);

	return (struct wl_buffer *) buffer_id;
}

/**
 * @ingroup iface_wpe_dmabuf_pool
 */
static inline struct wpe_dmabuf_data *
wpe_dmabuf_pool_get_dmabuf_data(struct wpe_dmabuf_pool *wpe_dmabuf_pool, struct wl_buffer *buffer)
{
	struct wl_proxy *dmabuf_data_id;

	dmabuf_data_id = wl_proxy_marshal_flags((struct wl_proxy *) wpe_dmabuf_pool,
			 WPE_DMABUF_POOL_GET_DMABUF_DATA, &wpe_dmabuf_data_interface, wl_proxy_get_version((struct wl_proxy *) wpe_dmabuf_pool), 0, NULL, buffer);

	return (struct wpe_dmabuf_data *) dmabuf_data_id;
}

/**
 * @ingroup iface_wpe_dmabuf_data
 * @struct wpe_dmabuf_data_listener
 */
struct wpe_dmabuf_data_listener {
	/**
	 */
	void (*attributes)(void *data,
			   struct wpe_dmabuf_data *wpe_dmabuf_data,
			   uint32_t width,
			   uint32_t height,
			   uint32_t format,
			   uint32_t num_planes);
	/**
	 */
	void (*plane)(void *data,
		      struct wpe_dmabuf_data *wpe_dmabuf_data,
		      uint32_t id,
		      int32_t fd,
		      uint32_t stride,
		      uint32_t offset,
		      uint32_t modifier_hi,
		      uint32_t modifier_lo);
	/**
	 */
	void (*complete)(void *data,
			 struct wpe_dmabuf_data *wpe_dmabuf_data);
};

/**
 * @ingroup iface_wpe_dmabuf_data
 */
static inline int
wpe_dmabuf_data_add_listener(struct wpe_dmabuf_data *wpe_dmabuf_data,
			     const struct wpe_dmabuf_data_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) wpe_dmabuf_data,
				     (void (**)(void)) listener, data);
}

#define WPE_DMABUF_DATA_REQUEST 0

/**
 * @ingroup iface_wpe_dmabuf_data
 */
#define WPE_DMABUF_DATA_ATTRIBUTES_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_dmabuf_data
 */
#define WPE_DMABUF_DATA_PLANE_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_dmabuf_data
 */
#define WPE_DMABUF_DATA_COMPLETE_SINCE_VERSION 1

/**
 * @ingroup iface_wpe_dmabuf_data
 */
#define WPE_DMABUF_DATA_REQUEST_SINCE_VERSION 1

/** @ingroup iface_wpe_dmabuf_data */
static inline void
wpe_dmabuf_data_set_user_data(struct wpe_dmabuf_data *wpe_dmabuf_data, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) wpe_dmabuf_data, user_data);
}

/** @ingroup iface_wpe_dmabuf_data */
static inline void *
wpe_dmabuf_data_get_user_data(struct wpe_dmabuf_data *wpe_dmabuf_data)
{
	return wl_proxy_get_user_data((struct wl_proxy *) wpe_dmabuf_data);
}

static inline uint32_t
wpe_dmabuf_data_get_version(struct wpe_dmabuf_data *wpe_dmabuf_data)
{
	return wl_proxy_get_version((struct wl_proxy *) wpe_dmabuf_data);
}

/** @ingroup iface_wpe_dmabuf_data */
static inline void
wpe_dmabuf_data_destroy(struct wpe_dmabuf_data *wpe_dmabuf_data)
{
	wl_proxy_destroy((struct wl_proxy *) wpe_dmabuf_data);
}

/**
 * @ingroup iface_wpe_dmabuf_data
 */
static inline void
wpe_dmabuf_data_request(struct wpe_dmabuf_data *wpe_dmabuf_data)
{
	wl_proxy_marshal_flags((struct wl_proxy *) wpe_dmabuf_data,
			 WPE_DMABUF_DATA_REQUEST, NULL, wl_proxy_get_version((struct wl_proxy *) wpe_dmabuf_data), 0);
}

#ifdef  __cplusplus
}
#endif

#endif
