/* Generated by wayland-scanner 1.17.0 */

#ifndef CUSTOM_CLIENT_PROTOCOL_H
#define CUSTOM_CLIENT_PROTOCOL_H

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

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * @page page_custom The custom protocol
 * @section page_ifaces_custom Interfaces
 * - @subpage page_iface_qt_example_extension - Example Wayland extension
 * - @subpage page_iface_qt_example_local_object - An object created on the client side
 * @section page_copyright_custom Copyright
 * <pre>
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the examples of the Qt Wayland module
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * </pre>
 */
struct qt_example_extension;
struct qt_example_local_object;
struct wl_surface;

/**
 * @page page_iface_qt_example_extension qt_example_extension
 * @section page_iface_qt_example_extension_desc Description
 *
 * This example shows how to add extra functionality to Wayland
 * through an extension. This is the global object of the extension.
 * @section page_iface_qt_example_extension_api API
 * See @ref iface_qt_example_extension.
 */
/**
 * @defgroup iface_qt_example_extension The qt_example_extension interface
 *
 * This example shows how to add extra functionality to Wayland
 * through an extension. This is the global object of the extension.
 */
extern const struct wl_interface qt_example_extension_interface;
/**
 * @page page_iface_qt_example_local_object qt_example_local_object
 * @section page_iface_qt_example_local_object_desc Description
 *
 * This object should have a visual representation in the compositor.
 * @section page_iface_qt_example_local_object_api API
 * See @ref iface_qt_example_local_object.
 */
/**
 * @defgroup iface_qt_example_local_object The qt_example_local_object interface
 *
 * This object should have a visual representation in the compositor.
 */
extern const struct wl_interface qt_example_local_object_interface;

#ifndef QT_EXAMPLE_EXTENSION_DECORATION_STATE_ENUM
#define QT_EXAMPLE_EXTENSION_DECORATION_STATE_ENUM
/**
 * @ingroup iface_qt_example_extension
 * window decoration state
 *
 * Describes whether window decorations should be shown.
 */
enum qt_example_extension_decoration_state {
	/**
	 * Decorations are not shown
	 */
	QT_EXAMPLE_EXTENSION_DECORATION_STATE_HIDDEN = 0,
	/**
	 * Decorations are shown
	 */
	QT_EXAMPLE_EXTENSION_DECORATION_STATE_SHOWN = 1,
};
#endif /* QT_EXAMPLE_EXTENSION_DECORATION_STATE_ENUM */

/**
 * @ingroup iface_qt_example_extension
 * @struct qt_example_extension_listener
 */
struct qt_example_extension_listener {
	/**
	 * close window
	 *
	 * Ask the client to close the window for the surface.
	 */
	void (*close)(void *data,
		      struct qt_example_extension *qt_example_extension,
		      struct wl_surface *surface);
	/**
	 * change the font size
	 *
	 * Ask the client to change the font size on the surface.
	 */
	void (*set_font_size)(void *data,
			      struct qt_example_extension *qt_example_extension,
			      struct wl_surface *surface,
			      uint32_t pixel_size);
	/**
	 * turn window decoration on/off
	 *
	 * Ask the client to turn window decoration on/off on all
	 * surfaces.
	 */
	void (*set_window_decoration)(void *data,
				      struct qt_example_extension *qt_example_extension,
				      uint32_t state);
};

/**
 * @ingroup iface_qt_example_extension
 */
static inline int
qt_example_extension_add_listener(struct qt_example_extension *qt_example_extension,
				  const struct qt_example_extension_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) qt_example_extension,
				     (void (**)(void)) listener, data);
}

#define QT_EXAMPLE_EXTENSION_REGISTER_SURFACE 0
#define QT_EXAMPLE_EXTENSION_BOUNCE 1
#define QT_EXAMPLE_EXTENSION_SPIN 2
#define QT_EXAMPLE_EXTENSION_CREATE_LOCAL_OBJECT 3

/**
 * @ingroup iface_qt_example_extension
 */
#define QT_EXAMPLE_EXTENSION_CLOSE_SINCE_VERSION 1
/**
 * @ingroup iface_qt_example_extension
 */
#define QT_EXAMPLE_EXTENSION_SET_FONT_SIZE_SINCE_VERSION 1
/**
 * @ingroup iface_qt_example_extension
 */
#define QT_EXAMPLE_EXTENSION_SET_WINDOW_DECORATION_SINCE_VERSION 1

/**
 * @ingroup iface_qt_example_extension
 */
#define QT_EXAMPLE_EXTENSION_REGISTER_SURFACE_SINCE_VERSION 1
/**
 * @ingroup iface_qt_example_extension
 */
#define QT_EXAMPLE_EXTENSION_BOUNCE_SINCE_VERSION 1
/**
 * @ingroup iface_qt_example_extension
 */
#define QT_EXAMPLE_EXTENSION_SPIN_SINCE_VERSION 1
/**
 * @ingroup iface_qt_example_extension
 */
#define QT_EXAMPLE_EXTENSION_CREATE_LOCAL_OBJECT_SINCE_VERSION 1

/** @ingroup iface_qt_example_extension */
static inline void
qt_example_extension_set_user_data(struct qt_example_extension *qt_example_extension, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) qt_example_extension, user_data);
}

/** @ingroup iface_qt_example_extension */
static inline void *
qt_example_extension_get_user_data(struct qt_example_extension *qt_example_extension)
{
	return wl_proxy_get_user_data((struct wl_proxy *) qt_example_extension);
}

static inline uint32_t
qt_example_extension_get_version(struct qt_example_extension *qt_example_extension)
{
	return wl_proxy_get_version((struct wl_proxy *) qt_example_extension);
}

/** @ingroup iface_qt_example_extension */
static inline void
qt_example_extension_destroy(struct qt_example_extension *qt_example_extension)
{
	wl_proxy_destroy((struct wl_proxy *) qt_example_extension);
}

/**
 * @ingroup iface_qt_example_extension
 *
 * Inform the compositor that the client has a new surface that is
 * covered by the extension.
 */
static inline void
qt_example_extension_register_surface(struct qt_example_extension *qt_example_extension, struct wl_surface *surface)
{
	wl_proxy_marshal((struct wl_proxy *) qt_example_extension,
			 QT_EXAMPLE_EXTENSION_REGISTER_SURFACE, surface);
}

/**
 * @ingroup iface_qt_example_extension
 *
 * The compositor should perform a move animation on the surface.
 */
static inline void
qt_example_extension_bounce(struct qt_example_extension *qt_example_extension, struct wl_surface *surface, uint32_t duration)
{
	wl_proxy_marshal((struct wl_proxy *) qt_example_extension,
			 QT_EXAMPLE_EXTENSION_BOUNCE, surface, duration);
}

/**
 * @ingroup iface_qt_example_extension
 *
 * The compositor should perform a rotating animation on the surface.
 */
static inline void
qt_example_extension_spin(struct qt_example_extension *qt_example_extension, struct wl_surface *surface, uint32_t duration)
{
	wl_proxy_marshal((struct wl_proxy *) qt_example_extension,
			 QT_EXAMPLE_EXTENSION_SPIN, surface, duration);
}

/**
 * @ingroup iface_qt_example_extension
 *
 * Create a new object that should be visualized by the compositor
 */
static inline struct qt_example_local_object *
qt_example_extension_create_local_object(struct qt_example_extension *qt_example_extension, const char *color, const char *text)
{
	struct wl_proxy *id;

	id = wl_proxy_marshal_constructor((struct wl_proxy *) qt_example_extension,
			 QT_EXAMPLE_EXTENSION_CREATE_LOCAL_OBJECT, &qt_example_local_object_interface, NULL, color, text);

	return (struct qt_example_local_object *) id;
}

/**
 * @ingroup iface_qt_example_local_object
 * @struct qt_example_local_object_listener
 */
struct qt_example_local_object_listener {
	/**
	 * The object was clicked
	 *
	 * Notification to the client that the user clicked the
	 * representation of the object in the compositor.
	 */
	void (*clicked)(void *data,
			struct qt_example_local_object *qt_example_local_object);
};

/**
 * @ingroup iface_qt_example_local_object
 */
static inline int
qt_example_local_object_add_listener(struct qt_example_local_object *qt_example_local_object,
				     const struct qt_example_local_object_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) qt_example_local_object,
				     (void (**)(void)) listener, data);
}

#define QT_EXAMPLE_LOCAL_OBJECT_SET_TEXT 0

/**
 * @ingroup iface_qt_example_local_object
 */
#define QT_EXAMPLE_LOCAL_OBJECT_CLICKED_SINCE_VERSION 1

/**
 * @ingroup iface_qt_example_local_object
 */
#define QT_EXAMPLE_LOCAL_OBJECT_SET_TEXT_SINCE_VERSION 1

/** @ingroup iface_qt_example_local_object */
static inline void
qt_example_local_object_set_user_data(struct qt_example_local_object *qt_example_local_object, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) qt_example_local_object, user_data);
}

/** @ingroup iface_qt_example_local_object */
static inline void *
qt_example_local_object_get_user_data(struct qt_example_local_object *qt_example_local_object)
{
	return wl_proxy_get_user_data((struct wl_proxy *) qt_example_local_object);
}

static inline uint32_t
qt_example_local_object_get_version(struct qt_example_local_object *qt_example_local_object)
{
	return wl_proxy_get_version((struct wl_proxy *) qt_example_local_object);
}

/** @ingroup iface_qt_example_local_object */
static inline void
qt_example_local_object_destroy(struct qt_example_local_object *qt_example_local_object)
{
	wl_proxy_destroy((struct wl_proxy *) qt_example_local_object);
}

/**
 * @ingroup iface_qt_example_local_object
 *
 * Tell the compositor that the object's text is changed
 */
static inline void
qt_example_local_object_set_text(struct qt_example_local_object *qt_example_local_object, const char *text)
{
	wl_proxy_marshal((struct wl_proxy *) qt_example_local_object,
			 QT_EXAMPLE_LOCAL_OBJECT_SET_TEXT, text);
}

#ifdef  __cplusplus
}
#endif

#endif
