Commit 196cee5d authored by yhanada's avatar yhanada Committed by Commit bot

wayland-protocols: Add device_configuration_exists error to...

wayland-protocols: Add device_configuration_exists error to zcr_keyboard_configuration_v1 interface.

This error is produced if get_keyboard_device_configuration method is
called with a keyboard object that is already associated with
keyboard device configuration object.

BUG=670247

Review-Url: https://codereview.chromium.org/2564353002
Cr-Commit-Position: refs/heads/master@{#437953}
parent b1589cc2
......@@ -96,6 +96,16 @@ extern const struct wl_interface zcr_keyboard_configuration_v1_interface;
*/
extern const struct wl_interface zcr_keyboard_device_configuration_v1_interface;
#ifndef ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
#define ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
enum zcr_keyboard_configuration_v1_error {
/**
* the keyboard already has a device configuration object associated
*/
ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_DEVICE_CONFIGURATION_EXISTS = 0,
};
#endif /* ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM */
#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION 0
/**
......@@ -135,6 +145,9 @@ zcr_keyboard_configuration_v1_destroy(struct zcr_keyboard_configuration_v1 *zcr_
*
* Create keyboard_device_configuration object.
* See zcr_keyboard_device_configuration interface for details.
* If the given wl_keyboard object already has a device configuration
* object associated, the keyboard_device_configuration_exists protocol
* error is raised.
*/
static inline struct zcr_keyboard_device_configuration_v1 *
zcr_keyboard_configuration_v1_get_keyboard_device_configuration(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1, struct wl_keyboard *keyboard)
......
......@@ -99,6 +99,16 @@ extern const struct wl_interface zcr_keyboard_configuration_v1_interface;
*/
extern const struct wl_interface zcr_keyboard_device_configuration_v1_interface;
#ifndef ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
#define ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
enum zcr_keyboard_configuration_v1_error {
/**
* the keyboard already has a device configuration object associated
*/
ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_DEVICE_CONFIGURATION_EXISTS = 0,
};
#endif /* ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM */
/**
* @ingroup iface_zcr_keyboard_configuration_v1
* @struct zcr_keyboard_configuration_v1_interface
......@@ -108,7 +118,10 @@ struct zcr_keyboard_configuration_v1_interface {
* get keyboard_device_configuration interface for a keyboard
*
* Create keyboard_device_configuration object. See
* zcr_keyboard_device_configuration interface for details.
* zcr_keyboard_device_configuration interface for details. If the
* given wl_keyboard object already has a device configuration
* object associated, the keyboard_device_configuration_exists
* protocol error is raised.
*/
void (*get_keyboard_device_configuration)(struct wl_client *client,
struct wl_resource *resource,
......
......@@ -41,7 +41,7 @@ static const struct wl_message zcr_keyboard_configuration_v1_requests[] = {
};
WL_EXPORT const struct wl_interface zcr_keyboard_configuration_v1_interface = {
"zcr_keyboard_configuration_v1", 1,
"zcr_keyboard_configuration_v1", 2,
1, zcr_keyboard_configuration_v1_requests,
0, NULL,
};
......
......@@ -24,7 +24,7 @@
DEALINGS IN THE SOFTWARE.
</copyright>
<interface name="zcr_keyboard_configuration_v1" version="1">
<interface name="zcr_keyboard_configuration_v1" version="2">
<description summary="extends wl_keyboard with events for device configuration change">
Allows a wl_keyboard to notify device configuration change events of
the keyboard to the client.
......@@ -39,10 +39,18 @@
interface version number is reset.
</description>
<enum name="error">
<entry name="device_configuration_exists" value="0"
summary="the keyboard already has a device configuration object associated"/>
</enum>
<request name="get_keyboard_device_configuration">
<description summary="get keyboard_device_configuration interface for a keyboard">
Create keyboard_device_configuration object.
See zcr_keyboard_device_configuration interface for details.
If the given wl_keyboard object already has a device configuration
object associated, the keyboard_device_configuration_exists protocol
error is raised.
</description>
<arg name="id" type="new_id" interface="zcr_keyboard_device_configuration_v1"/>
<arg name="keyboard" type="object" interface="wl_keyboard"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment