/* Generated by wayland-scanner 1.24.0 */

#ifndef WPE_BRIDGE_CLIENT_PROTOCOL_H
#define WPE_BRIDGE_CLIENT_PROTOCOL_H

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

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * @page page_wpe_bridge The wpe_bridge protocol
 * @section page_ifaces_wpe_bridge Interfaces
 * - @subpage page_iface_wpe_bridge - 
 * @section page_copyright_wpe_bridge Copyright
 * <pre>
 *
 * Copyright © 2019 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_surface;
struct wpe_bridge;

#ifndef WPE_BRIDGE_INTERFACE
#define WPE_BRIDGE_INTERFACE
/**
 * @page page_iface_wpe_bridge wpe_bridge
 * @section page_iface_wpe_bridge_api API
 * See @ref iface_wpe_bridge.
 */
/**
 * @defgroup iface_wpe_bridge The wpe_bridge interface
 */
extern const struct wl_interface wpe_bridge_interface;
#endif

#ifndef WPE_BRIDGE_CLIENT_IMPLEMENTATION_TYPE_ENUM
#define WPE_BRIDGE_CLIENT_IMPLEMENTATION_TYPE_ENUM
enum wpe_bridge_client_implementation_type {
	WPE_BRIDGE_CLIENT_IMPLEMENTATION_TYPE_WAYLAND = 0,
	WPE_BRIDGE_CLIENT_IMPLEMENTATION_TYPE_DMABUF_POOL = 1,
};
#endif /* WPE_BRIDGE_CLIENT_IMPLEMENTATION_TYPE_ENUM */

/**
 * @ingroup iface_wpe_bridge
 * @struct wpe_bridge_listener
 */
struct wpe_bridge_listener {
	/**
	 * @param type See enum `implementation_type`
	 */
	void (*implementation_info)(void *data,
				    struct wpe_bridge *wpe_bridge,
				    uint32_t type);
	/**
	 */
	void (*connected)(void *data,
			  struct wpe_bridge *wpe_bridge,
			  uint32_t id);
};

/**
 * @ingroup iface_wpe_bridge
 */
static inline int
wpe_bridge_add_listener(struct wpe_bridge *wpe_bridge,
			const struct wpe_bridge_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) wpe_bridge,
				     (void (**)(void)) listener, data);
}

#define WPE_BRIDGE_INITIALIZE 0
#define WPE_BRIDGE_CONNECT 1

/**
 * @ingroup iface_wpe_bridge
 */
#define WPE_BRIDGE_IMPLEMENTATION_INFO_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_bridge
 */
#define WPE_BRIDGE_CONNECTED_SINCE_VERSION 1

/**
 * @ingroup iface_wpe_bridge
 */
#define WPE_BRIDGE_INITIALIZE_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_bridge
 */
#define WPE_BRIDGE_CONNECT_SINCE_VERSION 1

/** @ingroup iface_wpe_bridge */
static inline void
wpe_bridge_set_user_data(struct wpe_bridge *wpe_bridge, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) wpe_bridge, user_data);
}

/** @ingroup iface_wpe_bridge */
static inline void *
wpe_bridge_get_user_data(struct wpe_bridge *wpe_bridge)
{
	return wl_proxy_get_user_data((struct wl_proxy *) wpe_bridge);
}

static inline uint32_t
wpe_bridge_get_version(struct wpe_bridge *wpe_bridge)
{
	return wl_proxy_get_version((struct wl_proxy *) wpe_bridge);
}

/** @ingroup iface_wpe_bridge */
static inline void
wpe_bridge_destroy(struct wpe_bridge *wpe_bridge)
{
	wl_proxy_destroy((struct wl_proxy *) wpe_bridge);
}

/**
 * @ingroup iface_wpe_bridge
 */
static inline void
wpe_bridge_initialize(struct wpe_bridge *wpe_bridge)
{
	wl_proxy_marshal_flags((struct wl_proxy *) wpe_bridge,
			 WPE_BRIDGE_INITIALIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wpe_bridge), 0);
}

/**
 * @ingroup iface_wpe_bridge
 */
static inline void
wpe_bridge_connect(struct wpe_bridge *wpe_bridge, struct wl_surface *surface)
{
	wl_proxy_marshal_flags((struct wl_proxy *) wpe_bridge,
			 WPE_BRIDGE_CONNECT, NULL, wl_proxy_get_version((struct wl_proxy *) wpe_bridge), 0, surface);
}

#ifdef  __cplusplus
}
#endif

#endif
