Commit 2327d406 authored by Yuichiro Hanada's avatar Yuichiro Hanada Committed by Commit Bot

Add zcr_input_method_surface_v1 interface.

zcr_input_method_surface_v1 is an interface implemented by wl_surface
that hosts IME windows.

Bug: 845079
Change-Id: I3c2ef1927781afd4c6d6532135430b1bbda39311
Reviewed-on: https://chromium-review.googlesource.com/1118403
Commit-Queue: Yuichiro Hanada <yhanada@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571447}
parent 7048c237
...@@ -33,6 +33,7 @@ extern "C" { ...@@ -33,6 +33,7 @@ extern "C" {
* - @subpage page_iface_zcr_remote_shell_v1 - remote_shell * - @subpage page_iface_zcr_remote_shell_v1 - remote_shell
* - @subpage page_iface_zcr_remote_surface_v1 - A desktop window * - @subpage page_iface_zcr_remote_surface_v1 - A desktop window
* - @subpage page_iface_zcr_notification_surface_v1 - A notification window * - @subpage page_iface_zcr_notification_surface_v1 - A notification window
* - @subpage page_iface_zcr_input_method_surface_v1 - An input method window
* @section page_copyright_remote_shell_unstable_v1 Copyright * @section page_copyright_remote_shell_unstable_v1 Copyright
* <pre> * <pre>
* *
...@@ -59,6 +60,7 @@ extern "C" { ...@@ -59,6 +60,7 @@ extern "C" {
* </pre> * </pre>
*/ */
struct wl_surface; struct wl_surface;
struct zcr_input_method_surface_v1;
struct zcr_notification_surface_v1; struct zcr_notification_surface_v1;
struct zcr_remote_shell_v1; struct zcr_remote_shell_v1;
struct zcr_remote_surface_v1; struct zcr_remote_surface_v1;
...@@ -133,6 +135,20 @@ extern const struct wl_interface zcr_remote_surface_v1_interface; ...@@ -133,6 +135,20 @@ extern const struct wl_interface zcr_remote_surface_v1_interface;
* notification contents. * notification contents.
*/ */
extern const struct wl_interface zcr_notification_surface_v1_interface; extern const struct wl_interface zcr_notification_surface_v1_interface;
/**
* @page page_iface_zcr_input_method_surface_v1 zcr_input_method_surface_v1
* @section page_iface_zcr_input_method_surface_v1_desc Description
*
* An interface that may be implemented by a wl_surface to host IME contents.
* @section page_iface_zcr_input_method_surface_v1_api API
* See @ref iface_zcr_input_method_surface_v1.
*/
/**
* @defgroup iface_zcr_input_method_surface_v1 The zcr_input_method_surface_v1 interface
*
* An interface that may be implemented by a wl_surface to host IME contents.
*/
extern const struct wl_interface zcr_input_method_surface_v1_interface;
#ifndef ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM #ifndef ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM
#define ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM #define ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM
...@@ -335,6 +351,7 @@ zcr_remote_shell_v1_add_listener(struct zcr_remote_shell_v1 *zcr_remote_shell_v1 ...@@ -335,6 +351,7 @@ zcr_remote_shell_v1_add_listener(struct zcr_remote_shell_v1 *zcr_remote_shell_v1
#define ZCR_REMOTE_SHELL_V1_DESTROY 0 #define ZCR_REMOTE_SHELL_V1_DESTROY 0
#define ZCR_REMOTE_SHELL_V1_GET_REMOTE_SURFACE 1 #define ZCR_REMOTE_SHELL_V1_GET_REMOTE_SURFACE 1
#define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE 2 #define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE 2
#define ZCR_REMOTE_SHELL_V1_GET_INPUT_METHOD_SURFACE 3
/** /**
* @ingroup iface_zcr_remote_shell_v1 * @ingroup iface_zcr_remote_shell_v1
...@@ -369,6 +386,10 @@ zcr_remote_shell_v1_add_listener(struct zcr_remote_shell_v1 *zcr_remote_shell_v1 ...@@ -369,6 +386,10 @@ zcr_remote_shell_v1_add_listener(struct zcr_remote_shell_v1 *zcr_remote_shell_v1
* @ingroup iface_zcr_remote_shell_v1 * @ingroup iface_zcr_remote_shell_v1
*/ */
#define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE_SINCE_VERSION 1 #define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE_SINCE_VERSION 1
/**
* @ingroup iface_zcr_remote_shell_v1
*/
#define ZCR_REMOTE_SHELL_V1_GET_INPUT_METHOD_SURFACE_SINCE_VERSION 17
/** @ingroup iface_zcr_remote_shell_v1 */ /** @ingroup iface_zcr_remote_shell_v1 */
static inline void static inline void
...@@ -448,6 +469,23 @@ zcr_remote_shell_v1_get_notification_surface(struct zcr_remote_shell_v1 *zcr_rem ...@@ -448,6 +469,23 @@ zcr_remote_shell_v1_get_notification_surface(struct zcr_remote_shell_v1 *zcr_rem
return (struct zcr_notification_surface_v1 *) id; return (struct zcr_notification_surface_v1 *) id;
} }
/**
* @ingroup iface_zcr_remote_shell_v1
*
* Creates an input_method_surface for the given surface, gives it
* the input_method_surface role.
*/
static inline struct zcr_input_method_surface_v1 *
zcr_remote_shell_v1_get_input_method_surface(struct zcr_remote_shell_v1 *zcr_remote_shell_v1, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_remote_shell_v1,
ZCR_REMOTE_SHELL_V1_GET_INPUT_METHOD_SURFACE, &zcr_input_method_surface_v1_interface, NULL, surface);
return (struct zcr_input_method_surface_v1 *) id;
}
#ifndef ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM #ifndef ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM
#define ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM #define ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM
/** /**
...@@ -1836,6 +1874,48 @@ zcr_notification_surface_v1_set_app_id(struct zcr_notification_surface_v1 *zcr_n ...@@ -1836,6 +1874,48 @@ zcr_notification_surface_v1_set_app_id(struct zcr_notification_surface_v1 *zcr_n
ZCR_NOTIFICATION_SURFACE_V1_SET_APP_ID, app_id); ZCR_NOTIFICATION_SURFACE_V1_SET_APP_ID, app_id);
} }
#define ZCR_INPUT_METHOD_SURFACE_V1_DESTROY 0
/**
* @ingroup iface_zcr_input_method_surface_v1
*/
#define ZCR_INPUT_METHOD_SURFACE_V1_DESTROY_SINCE_VERSION 1
/** @ingroup iface_zcr_input_method_surface_v1 */
static inline void
zcr_input_method_surface_v1_set_user_data(struct zcr_input_method_surface_v1 *zcr_input_method_surface_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zcr_input_method_surface_v1, user_data);
}
/** @ingroup iface_zcr_input_method_surface_v1 */
static inline void *
zcr_input_method_surface_v1_get_user_data(struct zcr_input_method_surface_v1 *zcr_input_method_surface_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) zcr_input_method_surface_v1);
}
static inline uint32_t
zcr_input_method_surface_v1_get_version(struct zcr_input_method_surface_v1 *zcr_input_method_surface_v1)
{
return wl_proxy_get_version((struct wl_proxy *) zcr_input_method_surface_v1);
}
/**
* @ingroup iface_zcr_input_method_surface_v1
*
* Unmap and destroy the input mtehod surface.
*/
static inline void
zcr_input_method_surface_v1_destroy(struct zcr_input_method_surface_v1 *zcr_input_method_surface_v1)
{
wl_proxy_marshal((struct wl_proxy *) zcr_input_method_surface_v1,
ZCR_INPUT_METHOD_SURFACE_V1_DESTROY);
wl_proxy_destroy((struct wl_proxy *) zcr_input_method_surface_v1);
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -36,6 +36,7 @@ struct wl_resource; ...@@ -36,6 +36,7 @@ struct wl_resource;
* - @subpage page_iface_zcr_remote_shell_v1 - remote_shell * - @subpage page_iface_zcr_remote_shell_v1 - remote_shell
* - @subpage page_iface_zcr_remote_surface_v1 - A desktop window * - @subpage page_iface_zcr_remote_surface_v1 - A desktop window
* - @subpage page_iface_zcr_notification_surface_v1 - A notification window * - @subpage page_iface_zcr_notification_surface_v1 - A notification window
* - @subpage page_iface_zcr_input_method_surface_v1 - An input method window
* @section page_copyright_remote_shell_unstable_v1 Copyright * @section page_copyright_remote_shell_unstable_v1 Copyright
* <pre> * <pre>
* *
...@@ -62,6 +63,7 @@ struct wl_resource; ...@@ -62,6 +63,7 @@ struct wl_resource;
* </pre> * </pre>
*/ */
struct wl_surface; struct wl_surface;
struct zcr_input_method_surface_v1;
struct zcr_notification_surface_v1; struct zcr_notification_surface_v1;
struct zcr_remote_shell_v1; struct zcr_remote_shell_v1;
struct zcr_remote_surface_v1; struct zcr_remote_surface_v1;
...@@ -136,6 +138,20 @@ extern const struct wl_interface zcr_remote_surface_v1_interface; ...@@ -136,6 +138,20 @@ extern const struct wl_interface zcr_remote_surface_v1_interface;
* notification contents. * notification contents.
*/ */
extern const struct wl_interface zcr_notification_surface_v1_interface; extern const struct wl_interface zcr_notification_surface_v1_interface;
/**
* @page page_iface_zcr_input_method_surface_v1 zcr_input_method_surface_v1
* @section page_iface_zcr_input_method_surface_v1_desc Description
*
* An interface that may be implemented by a wl_surface to host IME contents.
* @section page_iface_zcr_input_method_surface_v1_api API
* See @ref iface_zcr_input_method_surface_v1.
*/
/**
* @defgroup iface_zcr_input_method_surface_v1 The zcr_input_method_surface_v1 interface
*
* An interface that may be implemented by a wl_surface to host IME contents.
*/
extern const struct wl_interface zcr_input_method_surface_v1_interface;
#ifndef ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM #ifndef ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM
#define ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM #define ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM
...@@ -293,6 +309,17 @@ struct zcr_remote_shell_v1_interface { ...@@ -293,6 +309,17 @@ struct zcr_remote_shell_v1_interface {
uint32_t id, uint32_t id,
struct wl_resource *surface, struct wl_resource *surface,
const char *notification_key); const char *notification_key);
/**
* Create a input method surface from a surface
*
* Creates an input_method_surface for the given surface, gives
* it the input_method_surface role.
* @since 17
*/
void (*get_input_method_surface)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface);
}; };
#define ZCR_REMOTE_SHELL_V1_ACTIVATED 0 #define ZCR_REMOTE_SHELL_V1_ACTIVATED 0
...@@ -334,6 +361,10 @@ struct zcr_remote_shell_v1_interface { ...@@ -334,6 +361,10 @@ struct zcr_remote_shell_v1_interface {
* @ingroup iface_zcr_remote_shell_v1 * @ingroup iface_zcr_remote_shell_v1
*/ */
#define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE_SINCE_VERSION 1 #define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE_SINCE_VERSION 1
/**
* @ingroup iface_zcr_remote_shell_v1
*/
#define ZCR_REMOTE_SHELL_V1_GET_INPUT_METHOD_SURFACE_SINCE_VERSION 17
/** /**
* @ingroup iface_zcr_remote_shell_v1 * @ingroup iface_zcr_remote_shell_v1
...@@ -1515,6 +1546,26 @@ struct zcr_notification_surface_v1_interface { ...@@ -1515,6 +1546,26 @@ struct zcr_notification_surface_v1_interface {
*/ */
#define ZCR_NOTIFICATION_SURFACE_V1_SET_APP_ID_SINCE_VERSION 16 #define ZCR_NOTIFICATION_SURFACE_V1_SET_APP_ID_SINCE_VERSION 16
/**
* @ingroup iface_zcr_input_method_surface_v1
* @struct zcr_input_method_surface_v1_interface
*/
struct zcr_input_method_surface_v1_interface {
/**
* Destroy the ime_surface
*
* Unmap and destroy the input mtehod surface.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
/**
* @ingroup iface_zcr_input_method_surface_v1
*/
#define ZCR_INPUT_METHOD_SURFACE_V1_DESTROY_SINCE_VERSION 1
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "wayland-util.h" #include "wayland-util.h"
extern const struct wl_interface wl_surface_interface; extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface zcr_input_method_surface_v1_interface;
extern const struct wl_interface zcr_notification_surface_v1_interface; extern const struct wl_interface zcr_notification_surface_v1_interface;
extern const struct wl_interface zcr_remote_surface_v1_interface; extern const struct wl_interface zcr_remote_surface_v1_interface;
...@@ -51,6 +52,8 @@ static const struct wl_interface *types[] = { ...@@ -51,6 +52,8 @@ static const struct wl_interface *types[] = {
&zcr_notification_surface_v1_interface, &zcr_notification_surface_v1_interface,
&wl_surface_interface, &wl_surface_interface,
NULL, NULL,
&zcr_input_method_surface_v1_interface,
&wl_surface_interface,
&wl_surface_interface, &wl_surface_interface,
&wl_surface_interface, &wl_surface_interface,
}; };
...@@ -59,10 +62,11 @@ static const struct wl_message zcr_remote_shell_v1_requests[] = { ...@@ -59,10 +62,11 @@ static const struct wl_message zcr_remote_shell_v1_requests[] = {
{ "destroy", "", types + 0 }, { "destroy", "", types + 0 },
{ "get_remote_surface", "nou", types + 13 }, { "get_remote_surface", "nou", types + 13 },
{ "get_notification_surface", "nos", types + 16 }, { "get_notification_surface", "nos", types + 16 },
{ "get_input_method_surface", "17no", types + 19 },
}; };
static const struct wl_message zcr_remote_shell_v1_events[] = { static const struct wl_message zcr_remote_shell_v1_events[] = {
{ "activated", "?o?o", types + 19 }, { "activated", "?o?o", types + 21 },
{ "configuration_changed", "iiifiiiiu", types + 0 }, { "configuration_changed", "iiifiiiiu", types + 0 },
{ "workspace", "5uuiiiiiiiiifu", types + 0 }, { "workspace", "5uuiiiiiiiiifu", types + 0 },
{ "configure", "5u", types + 0 }, { "configure", "5u", types + 0 },
...@@ -70,8 +74,8 @@ static const struct wl_message zcr_remote_shell_v1_events[] = { ...@@ -70,8 +74,8 @@ static const struct wl_message zcr_remote_shell_v1_events[] = {
}; };
WL_EXPORT const struct wl_interface zcr_remote_shell_v1_interface = { WL_EXPORT const struct wl_interface zcr_remote_shell_v1_interface = {
"zcr_remote_shell_v1", 16, "zcr_remote_shell_v1", 17,
3, zcr_remote_shell_v1_requests, 4, zcr_remote_shell_v1_requests,
5, zcr_remote_shell_v1_events, 5, zcr_remote_shell_v1_events,
}; };
...@@ -146,3 +150,13 @@ WL_EXPORT const struct wl_interface zcr_notification_surface_v1_interface = { ...@@ -146,3 +150,13 @@ WL_EXPORT const struct wl_interface zcr_notification_surface_v1_interface = {
0, NULL, 0, NULL,
}; };
static const struct wl_message zcr_input_method_surface_v1_requests[] = {
{ "destroy", "", types + 0 },
};
WL_EXPORT const struct wl_interface zcr_input_method_surface_v1_interface = {
"zcr_input_method_surface_v1", 17,
1, zcr_input_method_surface_v1_requests,
0, NULL,
};
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
reset. reset.
</description> </description>
<interface name="zcr_remote_shell_v1" version="16"> <interface name="zcr_remote_shell_v1" version="17">
<description summary="remote_shell"> <description summary="remote_shell">
The global interface that allows clients to turn a wl_surface into a The global interface that allows clients to turn a wl_surface into a
"real window" which is remotely managed but can be stacked, activated "real window" which is remotely managed but can be stacked, activated
...@@ -182,6 +182,17 @@ ...@@ -182,6 +182,17 @@
</description> </description>
<arg name="scale" type="int" summary="DP to pixels ratio, in 8.24 fixed point format"/> <arg name="scale" type="int" summary="DP to pixels ratio, in 8.24 fixed point format"/>
</event> </event>
<!-- Version 17 additions -->
<request name="get_input_method_surface" since="17">
<description summary="Create a input method surface from a surface">
Creates an input_method_surface for the given surface, gives it
the input_method_surface role.
</description>
<arg name="id" type="new_id" interface="zcr_input_method_surface_v1"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>
</interface> </interface>
<interface name="zcr_remote_surface_v1" version="15"> <interface name="zcr_remote_surface_v1" version="15">
...@@ -916,4 +927,16 @@ ...@@ -916,4 +927,16 @@
</request> </request>
</interface> </interface>
<interface name="zcr_input_method_surface_v1" version="17">
<description summary="An input method window">
An interface that may be implemented by a wl_surface to host IME contents.
</description>
<request name="destroy" type="destructor">
<description summary="Destroy the ime_surface">
Unmap and destroy the input mtehod surface.
</description>
</request>
</interface>
</protocol> </protocol>
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