Commit 17d98b2b authored by yhanada's avatar yhanada Committed by Commit bot

wayland-protocols: Add pointer_stylus_exists error to zcr_stylus_v1 interface.

This error is produced if get_pointer_stylus method is called with
a pointer object that is already associated with a pointer stylus
object.

BUG=673666

Review-Url: https://codereview.chromium.org/2575693002
Cr-Commit-Position: refs/heads/master@{#438985}
parent 9ee1d8f4
...@@ -106,6 +106,16 @@ extern const struct wl_interface zcr_stylus_v1_interface; ...@@ -106,6 +106,16 @@ extern const struct wl_interface zcr_stylus_v1_interface;
*/ */
extern const struct wl_interface zcr_pointer_stylus_v1_interface; extern const struct wl_interface zcr_pointer_stylus_v1_interface;
#ifndef ZCR_STYLUS_V1_ERROR_ENUM
#define ZCR_STYLUS_V1_ERROR_ENUM
enum zcr_stylus_v1_error {
/**
* the pointer already has a pointer_stylus object associated
*/
ZCR_STYLUS_V1_ERROR_POINTER_STYLUS_EXISTS = 0,
};
#endif /* ZCR_STYLUS_V1_ERROR_ENUM */
#define ZCR_STYLUS_V1_GET_POINTER_STYLUS 0 #define ZCR_STYLUS_V1_GET_POINTER_STYLUS 0
/** /**
...@@ -144,7 +154,8 @@ zcr_stylus_v1_destroy(struct zcr_stylus_v1 *zcr_stylus_v1) ...@@ -144,7 +154,8 @@ zcr_stylus_v1_destroy(struct zcr_stylus_v1 *zcr_stylus_v1)
* @ingroup iface_zcr_stylus_v1 * @ingroup iface_zcr_stylus_v1
* *
* Create pointer_stylus object. See zcr_pointer_stylus_v1 interface for * Create pointer_stylus object. See zcr_pointer_stylus_v1 interface for
* details. * details. If the given wl_pointer already has a pointer_stylus object
* associated, the pointer_stylus_exists protocol error is raised.
*/ */
static inline struct zcr_pointer_stylus_v1 * static inline struct zcr_pointer_stylus_v1 *
zcr_stylus_v1_get_pointer_stylus(struct zcr_stylus_v1 *zcr_stylus_v1, struct wl_pointer *pointer) zcr_stylus_v1_get_pointer_stylus(struct zcr_stylus_v1 *zcr_stylus_v1, struct wl_pointer *pointer)
......
...@@ -109,6 +109,16 @@ extern const struct wl_interface zcr_stylus_v1_interface; ...@@ -109,6 +109,16 @@ extern const struct wl_interface zcr_stylus_v1_interface;
*/ */
extern const struct wl_interface zcr_pointer_stylus_v1_interface; extern const struct wl_interface zcr_pointer_stylus_v1_interface;
#ifndef ZCR_STYLUS_V1_ERROR_ENUM
#define ZCR_STYLUS_V1_ERROR_ENUM
enum zcr_stylus_v1_error {
/**
* the pointer already has a pointer_stylus object associated
*/
ZCR_STYLUS_V1_ERROR_POINTER_STYLUS_EXISTS = 0,
};
#endif /* ZCR_STYLUS_V1_ERROR_ENUM */
/** /**
* @ingroup iface_zcr_stylus_v1 * @ingroup iface_zcr_stylus_v1
* @struct zcr_stylus_v1_interface * @struct zcr_stylus_v1_interface
...@@ -118,7 +128,9 @@ struct zcr_stylus_v1_interface { ...@@ -118,7 +128,9 @@ struct zcr_stylus_v1_interface {
* get stylus interface for pointer * get stylus interface for pointer
* *
* Create pointer_stylus object. See zcr_pointer_stylus_v1 * Create pointer_stylus object. See zcr_pointer_stylus_v1
* interface for details. * interface for details. If the given wl_pointer already has a
* pointer_stylus object associated, the pointer_stylus_exists
* protocol error is raised.
*/ */
void (*get_pointer_stylus)(struct wl_client *client, void (*get_pointer_stylus)(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
......
...@@ -43,7 +43,7 @@ static const struct wl_message zcr_stylus_v1_requests[] = { ...@@ -43,7 +43,7 @@ static const struct wl_message zcr_stylus_v1_requests[] = {
}; };
WL_EXPORT const struct wl_interface zcr_stylus_v1_interface = { WL_EXPORT const struct wl_interface zcr_stylus_v1_interface = {
"zcr_stylus_v1", 1, "zcr_stylus_v1", 2,
1, zcr_stylus_v1_requests, 1, zcr_stylus_v1_requests,
0, NULL, 0, NULL,
}; };
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
</copyright> </copyright>
<interface name="zcr_stylus_v1" version="1"> <interface name="zcr_stylus_v1" version="2">
<description summary="extends wl_pointer with events for on-screen stylus"> <description summary="extends wl_pointer with events for on-screen stylus">
Allows a wl_pointer to represent an on-screen stylus. The client can Allows a wl_pointer to represent an on-screen stylus. The client can
interpret the on-screen stylus like any other mouse device, and use interpret the on-screen stylus like any other mouse device, and use
...@@ -44,10 +44,16 @@ ...@@ -44,10 +44,16 @@
interface version number is reset. interface version number is reset.
</description> </description>
<enum name="error">
<entry name="pointer_stylus_exists" value="0"
summary="the pointer already has a pointer_stylus object associated"/>
</enum>
<request name="get_pointer_stylus"> <request name="get_pointer_stylus">
<description summary="get stylus interface for pointer"> <description summary="get stylus interface for pointer">
Create pointer_stylus object. See zcr_pointer_stylus_v1 interface for Create pointer_stylus object. See zcr_pointer_stylus_v1 interface for
details. details. If the given wl_pointer already has a pointer_stylus object
associated, the pointer_stylus_exists protocol error is raised.
</description> </description>
<arg name="id" type="new_id" interface="zcr_pointer_stylus_v1"/> <arg name="id" type="new_id" interface="zcr_pointer_stylus_v1"/>
<arg name="pointer" type="object" interface="wl_pointer"/> <arg name="pointer" type="object" interface="wl_pointer"/>
......
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