/* Generated by wayland-scanner 1.26.0 */

#ifndef VIRTUAL_KEYBOARD_UNSTABLE_V1_SERVER_PROTOCOL_H
#define VIRTUAL_KEYBOARD_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_virtual_keyboard_unstable_v1 The virtual_keyboard_unstable_v1 protocol
 * @section page_ifaces_virtual_keyboard_unstable_v1 Interfaces
 * - @subpage page_iface_zwp_virtual_keyboard_v1 - virtual keyboard
 * - @subpage page_iface_zwp_virtual_keyboard_manager_v1 - virtual keyboard manager
 * @section page_copyright_virtual_keyboard_unstable_v1 Copyright
 * <pre>
 *
 * Copyright © 2008-2011  Kristian Høgsberg
 * Copyright © 2010-2013  Intel Corporation
 * Copyright © 2012-2013  Collabora, Ltd.
 * Copyright © 2018       Purism SPC
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 * </pre>
 */
struct wl_seat;
struct zwp_virtual_keyboard_manager_v1;
struct zwp_virtual_keyboard_v1;

#ifndef ZWP_VIRTUAL_KEYBOARD_V1_INTERFACE
#define ZWP_VIRTUAL_KEYBOARD_V1_INTERFACE
/**
 * @page page_iface_zwp_virtual_keyboard_v1 zwp_virtual_keyboard_v1
 * @section page_iface_zwp_virtual_keyboard_v1_desc Description
 *
 * The virtual keyboard provides an application with requests which emulate
 * the behaviour of a physical keyboard.
 *
 * This interface can be used by clients on its own to provide raw input
 * events, or it can accompany the input method protocol.
 * @section page_iface_zwp_virtual_keyboard_v1_api API
 * See @ref iface_zwp_virtual_keyboard_v1.
 */
/**
 * @defgroup iface_zwp_virtual_keyboard_v1 The zwp_virtual_keyboard_v1 interface
 *
 * The virtual keyboard provides an application with requests which emulate
 * the behaviour of a physical keyboard.
 *
 * This interface can be used by clients on its own to provide raw input
 * events, or it can accompany the input method protocol.
 */
extern const struct wl_interface zwp_virtual_keyboard_v1_interface;
#endif
#ifndef ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_INTERFACE
#define ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_INTERFACE
/**
 * @page page_iface_zwp_virtual_keyboard_manager_v1 zwp_virtual_keyboard_manager_v1
 * @section page_iface_zwp_virtual_keyboard_manager_v1_desc Description
 *
 * A virtual keyboard manager allows an application to provide keyboard
 * input events as if they came from a physical keyboard.
 * @section page_iface_zwp_virtual_keyboard_manager_v1_api API
 * See @ref iface_zwp_virtual_keyboard_manager_v1.
 */
/**
 * @defgroup iface_zwp_virtual_keyboard_manager_v1 The zwp_virtual_keyboard_manager_v1 interface
 *
 * A virtual keyboard manager allows an application to provide keyboard
 * input events as if they came from a physical keyboard.
 */
extern const struct wl_interface zwp_virtual_keyboard_manager_v1_interface;
#endif

#ifndef ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM
#define ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM
enum zwp_virtual_keyboard_v1_error {
	/**
	 * No keymap was set
	 */
	ZWP_VIRTUAL_KEYBOARD_V1_ERROR_NO_KEYMAP = 0,
};
#endif /* ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM */

#ifndef ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM_IS_VALID
#define ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM_IS_VALID
/**
 * @ingroup iface_zwp_virtual_keyboard_v1
 * Validate a zwp_virtual_keyboard_v1 error value.
 *
 * @return true on success, false on error.
 * @ref zwp_virtual_keyboard_v1_error
 */
static inline bool
zwp_virtual_keyboard_v1_error_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case ZWP_VIRTUAL_KEYBOARD_V1_ERROR_NO_KEYMAP:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM_IS_VALID */

/**
 * @ingroup iface_zwp_virtual_keyboard_v1
 * @struct zwp_virtual_keyboard_v1_interface
 */
struct zwp_virtual_keyboard_v1_interface {
	/**
	 * keyboard mapping
	 *
	 * Provide a file descriptor to the compositor which can be
	 * memory-mapped to provide a keyboard mapping description.
	 *
	 * Format carries a value from the keymap_format enumeration.
	 * @param format keymap format
	 * @param fd keymap file descriptor
	 * @param size keymap size, in bytes
	 */
	void (*keymap)(struct wl_client *client,
		       struct wl_resource *resource,
		       uint32_t format,
		       int32_t fd,
		       uint32_t size);
	/**
	 * key event
	 *
	 * A key was pressed or released. The time argument is a
	 * timestamp with millisecond granularity, with an undefined base.
	 * All requests regarding a single object must share the same
	 * clock.
	 *
	 * Keymap must be set before issuing this request.
	 *
	 * State carries a value from the key_state enumeration.
	 * @param time timestamp with millisecond granularity
	 * @param key key that produced the event
	 * @param state physical state of the key
	 */
	void (*key)(struct wl_client *client,
		    struct wl_resource *resource,
		    uint32_t time,
		    uint32_t key,
		    uint32_t state);
	/**
	 * modifier and group state
	 *
	 * Notifies the compositor that the modifier and/or group state
	 * has changed, and it should update state.
	 *
	 * The client should use wl_keyboard.modifiers event to synchronize
	 * its internal state with seat state.
	 *
	 * Keymap must be set before issuing this request.
	 * @param mods_depressed depressed modifiers
	 * @param mods_latched latched modifiers
	 * @param mods_locked locked modifiers
	 * @param group keyboard layout
	 */
	void (*modifiers)(struct wl_client *client,
			  struct wl_resource *resource,
			  uint32_t mods_depressed,
			  uint32_t mods_latched,
			  uint32_t mods_locked,
			  uint32_t group);
	/**
	 * destroy the virtual keyboard keyboard object
	 *
	 * 
	 */
	void (*destroy)(struct wl_client *client,
			struct wl_resource *resource);
};


/**
 * @ingroup iface_zwp_virtual_keyboard_v1
 */
#define ZWP_VIRTUAL_KEYBOARD_V1_KEYMAP_SINCE_VERSION 1
/**
 * @ingroup iface_zwp_virtual_keyboard_v1
 */
#define ZWP_VIRTUAL_KEYBOARD_V1_KEY_SINCE_VERSION 1
/**
 * @ingroup iface_zwp_virtual_keyboard_v1
 */
#define ZWP_VIRTUAL_KEYBOARD_V1_MODIFIERS_SINCE_VERSION 1
/**
 * @ingroup iface_zwp_virtual_keyboard_v1
 */
#define ZWP_VIRTUAL_KEYBOARD_V1_DESTROY_SINCE_VERSION 1

#ifndef ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM
#define ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM
enum zwp_virtual_keyboard_manager_v1_error {
	/**
	 * client not authorized to use the interface
	 */
	ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_UNAUTHORIZED = 0,
};
#endif /* ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM */

#ifndef ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM_IS_VALID
#define ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM_IS_VALID
/**
 * @ingroup iface_zwp_virtual_keyboard_manager_v1
 * Validate a zwp_virtual_keyboard_manager_v1 error value.
 *
 * @return true on success, false on error.
 * @ref zwp_virtual_keyboard_manager_v1_error
 */
static inline bool
zwp_virtual_keyboard_manager_v1_error_is_valid(uint32_t value, uint32_t version) {
	switch (value) {
	case ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_UNAUTHORIZED:
		return version >= 1;
	default:
		return false;
	}
}
#endif /* ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM_IS_VALID */

/**
 * @ingroup iface_zwp_virtual_keyboard_manager_v1
 * @struct zwp_virtual_keyboard_manager_v1_interface
 */
struct zwp_virtual_keyboard_manager_v1_interface {
	/**
	 * Create a new virtual keyboard
	 *
	 * Creates a new virtual keyboard associated to a seat.
	 *
	 * If the compositor enables a keyboard to perform arbitrary
	 * actions, it should present an error when an untrusted client
	 * requests a new keyboard.
	 */
	void (*create_virtual_keyboard)(struct wl_client *client,
					struct wl_resource *resource,
					struct wl_resource *seat,
					uint32_t id);
};


/**
 * @ingroup iface_zwp_virtual_keyboard_manager_v1
 */
#define ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_CREATE_VIRTUAL_KEYBOARD_SINCE_VERSION 1

#ifdef  __cplusplus
}
#endif

#endif
