Auto generate wayland protocol

Replaces any checked-in wayland protocol files with auto-generation.

In some cases this means renaming include files that didn't use "standard"
names, or adding missing xml files.  Any source edits are simple search and
replace, there should be no functional changes.
This commit is contained in:
Derek Foreman 2016-09-23 15:14:37 -05:00
parent b7d37e9d51
commit e4da5ba56a
37 changed files with 228 additions and 4625 deletions

2
.gitignore vendored
View File

@ -47,3 +47,5 @@ default.edj
*.eo.c
*.eo.h
Session.vim
#Ignore all autogenerated wayland protocol
*-protocol.[ch]

View File

@ -427,21 +427,31 @@ endef
#End of weston stuff
enlightenment_src += \
src/bin/generated/linux-dmabuf-unstable-v1-server-protocol.h \
src/bin/generated/linux-dmabuf-unstable-v1-protocol.c \
src/bin/generated/www-protocol.c \
src/bin/generated/www-protocol.h \
src/bin/generated/session-recovery.c \
src/bin/generated/session-recovery.h \
src/bin/generated/e_comp_wl_screenshooter_server.c \
src/bin/generated/e_comp_wl_screenshooter_server.h \
src/bin/e_comp_wl_data.c \
src/bin/e_comp_wl_input.c \
src/bin/e_comp_wl_dmabuf.c \
src/bin/e_comp_wl.c \
src/bin/e_comp_wl_extensions.c
enlightenment_gen_src +=
enlightenment_gen_src += \
src/bin/generated/linux-dmabuf-unstable-v1-server-protocol.h \
src/bin/generated/linux-dmabuf-unstable-v1-protocol.c \
src/bin/generated/session-recovery-protocol.c \
src/bin/generated/session-recovery-server-protocol.h \
src/bin/generated/www-protocol.c \
src/bin/generated/www-server-protocol.h \
src/bin/generated/screenshooter-protocol.c \
src/bin/generated/screenshooter-server-protocol.h
src/bin/e_comp_wl_extensions.c: \
src/bin/generated/screenshooter-server-protocol.h \
src/bin/generated/session-recovery-server-protocol.h
src/bin/e_comp_wl.c: \
src/bin/generated/www-server-protocol.h
src/bin/e_comp_wl_dmabuf.c: \
src/bin/generated/linux-dmabuf-unstable-v1-server-protocol.h
endif

View File

@ -5,7 +5,7 @@
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include "www-protocol.h"
#include "www-server-protocol.h"
/* When a wayland is released with this macro we can remove the ifdefs */
#ifdef WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION

View File

@ -3,9 +3,9 @@
#include <uuid.h>
#include "e_comp_wl_screenshooter_server.h"
#include "session-recovery.h"
#include "www-protocol.h"
#include "screenshooter-server-protocol.h"
#include "session-recovery-server-protocol.h"
#include "www-server-protocol.h"
static void
_e_comp_wl_extensions_client_move_begin(void *d EINA_UNUSED, E_Client *ec)
@ -145,7 +145,7 @@ _e_comp_wl_screenshooter_cb_shoot(struct wl_client *client EINA_UNUSED, struct w
wl_shm_buffer_end_access(shm_buffer);
free(pixels);
screenshooter_send_done(resource);
zwp_screenshooter_send_done(resource);
}
static void
@ -208,7 +208,7 @@ static const struct zwp_e_session_recovery_interface _e_session_recovery_interfa
_e_comp_wl_session_recovery_destroy_uuid,
};
static const struct screenshooter_interface _e_screenshooter_interface =
static const struct zwp_screenshooter_interface _e_screenshooter_interface =
{
_e_comp_wl_screenshooter_cb_shoot
};
@ -236,7 +236,7 @@ _e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void *data EINA_UNUSED, ui
}
GLOBAL_BIND_CB(session_recovery, zwp_e_session_recovery_interface)
GLOBAL_BIND_CB(screenshooter, screenshooter_interface)
GLOBAL_BIND_CB(screenshooter, zwp_screenshooter_interface)
GLOBAL_BIND_CB(www, www_interface)
@ -277,7 +277,7 @@ e_comp_wl_extensions_init(void)
/* try to add session_recovery to wayland globals */
GLOBAL_CREATE_OR_RETURN(session_recovery, zwp_e_session_recovery_interface, 1);
GLOBAL_CREATE_OR_RETURN(screenshooter, screenshooter_interface, 1);
GLOBAL_CREATE_OR_RETURN(screenshooter, zwp_screenshooter_interface, 1);
GLOBAL_CREATE_OR_RETURN(www, www_interface, 1);
ecore_event_handler_add(ECORE_WL2_EVENT_SYNC_DONE, _dmabuf_add, NULL);

View File

@ -1,26 +0,0 @@
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_buffer_interface;
extern const struct wl_interface wl_output_interface;
static const struct wl_interface *types[] = {
&wl_output_interface,
&wl_buffer_interface,
};
static const struct wl_message screenshooter_requests[] = {
{ "shoot", "oo", types + 0 },
};
static const struct wl_message screenshooter_events[] = {
{ "done", "", types + 0 },
};
WL_EXPORT const struct wl_interface screenshooter_interface = {
"screenshooter", 1,
1, screenshooter_requests,
1, screenshooter_events,
};

View File

@ -1,47 +0,0 @@
#ifndef SCREENSHOOTER_SERVER_PROTOCOL_H
#define SCREENSHOOTER_SERVER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
struct wl_client;
struct wl_resource;
struct screenshooter;
struct wl_buffer;
struct wl_output;
extern const struct wl_interface screenshooter_interface;
struct screenshooter_interface {
/**
* shoot - (none)
* @output: (none)
* @buffer: (none)
*/
void (*shoot)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *output,
struct wl_resource *buffer);
};
#define SCREENSHOOTER_DONE 0
#define SCREENSHOOTER_DONE_SINCE_VERSION 1
static inline void
screenshooter_send_done(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, SCREENSHOOTER_DONE);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,75 +0,0 @@
/*
* Copyright © 2014, 2015 Collabora, Ltd.
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_buffer_interface;
extern const struct wl_interface zwp_linux_buffer_params_v1_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
&zwp_linux_buffer_params_v1_interface,
&wl_buffer_interface,
};
static const struct wl_message zwp_linux_dmabuf_v1_requests[] = {
{ "destroy", "", types + 0 },
{ "create_params", "n", types + 6 },
};
static const struct wl_message zwp_linux_dmabuf_v1_events[] = {
{ "format", "u", types + 0 },
};
WL_EXPORT const struct wl_interface zwp_linux_dmabuf_v1_interface = {
"zwp_linux_dmabuf_v1", 1,
2, zwp_linux_dmabuf_v1_requests,
1, zwp_linux_dmabuf_v1_events,
};
static const struct wl_message zwp_linux_buffer_params_v1_requests[] = {
{ "destroy", "", types + 0 },
{ "add", "huuuuu", types + 0 },
{ "create", "iiuu", types + 0 },
};
static const struct wl_message zwp_linux_buffer_params_v1_events[] = {
{ "created", "n", types + 7 },
{ "failed", "", types + 0 },
};
WL_EXPORT const struct wl_interface zwp_linux_buffer_params_v1_interface = {
"zwp_linux_buffer_params_v1", 1,
3, zwp_linux_buffer_params_v1_requests,
2, zwp_linux_buffer_params_v1_events,
};

View File

@ -1,448 +0,0 @@
#ifndef LINUX_DMABUF_UNSTABLE_V1_SERVER_PROTOCOL_H
#define LINUX_DMABUF_UNSTABLE_V1_SERVER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
struct wl_client;
struct wl_resource;
/**
* @page page_linux_dmabuf_unstable_v1 The linux_dmabuf_unstable_v1 protocol
* @section page_ifaces_linux_dmabuf_unstable_v1 Interfaces
* - @subpage page_iface_zwp_linux_dmabuf_v1 - factory for creating dmabuf-based wl_buffers
* - @subpage page_iface_zwp_linux_buffer_params_v1 - parameters for creating a dmabuf-based wl_buffer
* @section page_copyright_linux_dmabuf_unstable_v1 Copyright
* <pre>
*
* Copyright © 2014, 2015 Collabora, Ltd.
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
* </pre>
*/
struct wl_buffer;
struct zwp_linux_buffer_params_v1;
struct zwp_linux_dmabuf_v1;
/**
* @page page_iface_zwp_linux_dmabuf_v1 zwp_linux_dmabuf_v1
* @section page_iface_zwp_linux_dmabuf_v1_desc Description
*
* Following the interfaces from:
* https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
* and the Linux DRM sub-system's AddFb2 ioctl.
*
* This interface offers a way to create generic dmabuf-based
* wl_buffers. Immediately after a client binds to this interface,
* the set of supported formats is sent with 'format' events.
*
* The following are required from clients:
*
* - Clients must ensure that either all data in the dma-buf is
* coherent for all subsequent read access or that coherency is
* correctly handled by the underlying kernel-side dma-buf
* implementation.
*
* - Don't make any more attachments after sending the buffer to the
* compositor. Making more attachments later increases the risk of
* the compositor not being able to use (re-import) an existing
* dmabuf-based wl_buffer.
*
* The underlying graphics stack must ensure the following:
*
* - The dmabuf file descriptors relayed to the server will stay valid
* for the whole lifetime of the wl_buffer. This means the server may
* at any time use those fds to import the dmabuf into any kernel
* sub-system that might accept it.
*
* To create a wl_buffer from one or more dmabufs, a client creates a
* zwp_linux_dmabuf_params_v1 object with zwp_linux_dmabuf_v1.create_params
* request. All planes required by the intended format are added with
* the 'add' request. Finally, 'create' request is issued. The server
* will reply with either 'created' event which provides the final
* wl_buffer or 'failed' event saying that it cannot use the dmabufs
* provided.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding interface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and interface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
* @section page_iface_zwp_linux_dmabuf_v1_api API
* See @ref iface_zwp_linux_dmabuf_v1.
*/
/**
* @defgroup iface_zwp_linux_dmabuf_v1 The zwp_linux_dmabuf_v1 interface
*
* Following the interfaces from:
* https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
* and the Linux DRM sub-system's AddFb2 ioctl.
*
* This interface offers a way to create generic dmabuf-based
* wl_buffers. Immediately after a client binds to this interface,
* the set of supported formats is sent with 'format' events.
*
* The following are required from clients:
*
* - Clients must ensure that either all data in the dma-buf is
* coherent for all subsequent read access or that coherency is
* correctly handled by the underlying kernel-side dma-buf
* implementation.
*
* - Don't make any more attachments after sending the buffer to the
* compositor. Making more attachments later increases the risk of
* the compositor not being able to use (re-import) an existing
* dmabuf-based wl_buffer.
*
* The underlying graphics stack must ensure the following:
*
* - The dmabuf file descriptors relayed to the server will stay valid
* for the whole lifetime of the wl_buffer. This means the server may
* at any time use those fds to import the dmabuf into any kernel
* sub-system that might accept it.
*
* To create a wl_buffer from one or more dmabufs, a client creates a
* zwp_linux_dmabuf_params_v1 object with zwp_linux_dmabuf_v1.create_params
* request. All planes required by the intended format are added with
* the 'add' request. Finally, 'create' request is issued. The server
* will reply with either 'created' event which provides the final
* wl_buffer or 'failed' event saying that it cannot use the dmabufs
* provided.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding interface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and interface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
*/
extern const struct wl_interface zwp_linux_dmabuf_v1_interface;
/**
* @page page_iface_zwp_linux_buffer_params_v1 zwp_linux_buffer_params_v1
* @section page_iface_zwp_linux_buffer_params_v1_desc Description
*
* This temporary object is a collection of dmabufs and other
* parameters that together form a single logical buffer. The temporary
* object may eventually create one wl_buffer unless cancelled by
* destroying it before requesting 'create'.
*
* Single-planar formats only require one dmabuf, however
* multi-planar formats may require more than one dmabuf. For all
* formats, 'add' request must be called once per plane (even if the
* underlying dmabuf fd is identical).
*
* You must use consecutive plane indices ('plane_idx' argument for 'add')
* from zero to the number of planes used by the drm_fourcc format code.
* All planes required by the format must be given exactly once, but can
* be given in any order. Each plane index can be set only once.
* @section page_iface_zwp_linux_buffer_params_v1_api API
* See @ref iface_zwp_linux_buffer_params_v1.
*/
/**
* @defgroup iface_zwp_linux_buffer_params_v1 The zwp_linux_buffer_params_v1 interface
*
* This temporary object is a collection of dmabufs and other
* parameters that together form a single logical buffer. The temporary
* object may eventually create one wl_buffer unless cancelled by
* destroying it before requesting 'create'.
*
* Single-planar formats only require one dmabuf, however
* multi-planar formats may require more than one dmabuf. For all
* formats, 'add' request must be called once per plane (even if the
* underlying dmabuf fd is identical).
*
* You must use consecutive plane indices ('plane_idx' argument for 'add')
* from zero to the number of planes used by the drm_fourcc format code.
* All planes required by the format must be given exactly once, but can
* be given in any order. Each plane index can be set only once.
*/
extern const struct wl_interface zwp_linux_buffer_params_v1_interface;
/**
* @ingroup iface_zwp_linux_dmabuf_v1
* @struct zwp_linux_dmabuf_v1_interface
*/
struct zwp_linux_dmabuf_v1_interface {
/**
* unbind the factory
*
* Objects created through this interface, especially wl_buffers,
* will remain valid.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* create a temporary object for buffer parameters
*
* This temporary object is used to collect multiple dmabuf
* handles into a single batch to create a wl_buffer. It can only
* be used once and should be destroyed after an 'created' or
* 'failed' event has been received.
* @param params_id the new temporary
*/
void (*create_params)(struct wl_client *client,
struct wl_resource *resource,
uint32_t params_id);
};
#define ZWP_LINUX_DMABUF_V1_FORMAT 0
/**
* @ingroup iface_zwp_linux_dmabuf_v1
*/
#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_v1
* Sends an format event to the client owning the resource.
* @param resource_ The client's resource
* @param format DRM_FORMAT code
*/
static inline void
zwp_linux_dmabuf_v1_send_format(struct wl_resource *resource_, uint32_t format)
{
wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_V1_FORMAT, format);
}
#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
#define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
enum zwp_linux_buffer_params_v1_error {
/**
* the dmabuf_batch object has already been used to create a wl_buffer
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED = 0,
/**
* plane index out of bounds
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX = 1,
/**
* the plane index was already set
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET = 2,
/**
* missing or too many planes to create a buffer
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE = 3,
/**
* format not supported
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT = 4,
/**
* invalid width or height
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS = 5,
/**
* offset + stride * height goes out of dmabuf bounds
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS = 6,
};
#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM */
#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
#define ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
enum zwp_linux_buffer_params_v1_flags {
/**
* contents are y-inverted
*/
ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT = 1,
/**
* content is interlaced
*/
ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED = 2,
/**
* bottom field first
*/
ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST = 4,
};
#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM */
/**
* @ingroup iface_zwp_linux_buffer_params_v1
* @struct zwp_linux_buffer_params_v1_interface
*/
struct zwp_linux_buffer_params_v1_interface {
/**
* delete this object, used or not
*
* Cleans up the temporary data sent to the server for
* dmabuf-based wl_buffer creation.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* add a dmabuf to the temporary set
*
* This request adds one dmabuf to the set in this
* zwp_linux_buffer_params_v1.
*
* The 64-bit unsigned value combined from modifier_hi and
* modifier_lo is the dmabuf layout modifier. DRM AddFB2 ioctl
* calls this the fb modifier, which is defined in drm_mode.h of
* Linux UAPI. This is an opaque token. Drivers use this token to
* express tiling, compression, etc. driver-specific modifications
* to the base format defined by the DRM fourcc code.
*
* This request raises the PLANE_IDX error if plane_idx is too
* large. The error PLANE_SET is raised if attempting to set a
* plane that was already set.
* @param fd dmabuf fd
* @param plane_idx plane index
* @param offset offset in bytes
* @param stride stride in bytes
* @param modifier_hi high 32 bits of layout modifier
* @param modifier_lo low 32 bits of layout modifier
*/
void (*add)(struct wl_client *client,
struct wl_resource *resource,
int32_t fd,
uint32_t plane_idx,
uint32_t offset,
uint32_t stride,
uint32_t modifier_hi,
uint32_t modifier_lo);
/**
* create a wl_buffer from the given dmabufs
*
* This asks for creation of a wl_buffer from the added dmabuf
* buffers. The wl_buffer is not created immediately but returned
* via the 'created' event if the dmabuf sharing succeeds. The
* sharing may fail at runtime for reasons a client cannot predict,
* in which case the 'failed' event is triggered.
*
* The 'format' argument is a DRM_FORMAT code, as defined by the
* libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the
* authoritative source on how the format codes should work.
*
* The 'flags' is a bitfield of the flags defined in enum "flags".
* 'y_invert' means the that the image needs to be y-flipped.
*
* Flag 'interlaced' means that the frame in the buffer is not
* progressive as usual, but interlaced. An interlaced buffer as
* supported here must always contain both top and bottom fields.
* The top field always begins on the first pixel row. The temporal
* ordering between the two fields is top field first, unless
* 'bottom_first' is specified. It is undefined whether
* 'bottom_first' is ignored if 'interlaced' is not set.
*
* This protocol does not convey any information about field rate,
* duration, or timing, other than the relative ordering between
* the two fields in one buffer. A compositor may have to estimate
* the intended field rate from the incoming buffer rate. It is
* undefined whether the time of receiving wl_surface.commit with a
* new buffer attached, applying the wl_surface state,
* wl_surface.frame callback trigger, presentation, or any other
* point in the compositor cycle is used to measure the frame or
* field times. There is no support for detecting missed or late
* frames/fields/buffers either, and there is no support whatsoever
* for cooperating with interlaced compositor output.
*
* The composited image quality resulting from the use of
* interlaced buffers is explicitly undefined. A compositor may use
* elaborate hardware features or software to deinterlace and
* create progressive output frames from a sequence of interlaced
* input buffers, or it may produce substandard image quality.
* However, compositors that cannot guarantee reasonable image
* quality in all cases are recommended to just reject all
* interlaced buffers.
*
* Any argument errors, including non-positive width or height,
* mismatch between the number of planes and the format, bad
* format, bad offset or stride, may be indicated by fatal protocol
* errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,
* OUT_OF_BOUNDS.
*
* Dmabuf import errors in the server that are not obvious client
* bugs are returned via the 'failed' event as non-fatal. This
* allows attempting dmabuf sharing and falling back in the client
* if it fails.
*
* This request can be sent only once in the object's lifetime,
* after which the only legal request is destroy. This object
* should be destroyed after issuing 'create' request. Attempting
* to use this object after issuing 'create' raises ALREADY_USED
* protocol error.
*
* It is not mandatory to issue 'create'. If a client wants to
* cancel the buffer creation, it can just destroy this object.
* @param width base plane width in pixels
* @param height base plane height in pixels
* @param format DRM_FORMAT code
* @param flags see enum flags
*/
void (*create)(struct wl_client *client,
struct wl_resource *resource,
int32_t width,
int32_t height,
uint32_t format,
uint32_t flags);
};
#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED 0
#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
* Sends an created event to the client owning the resource.
* @param resource_ The client's resource
* @param buffer the newly created wl_buffer
*/
static inline void
zwp_linux_buffer_params_v1_send_created(struct wl_resource *resource_, struct wl_resource *buffer)
{
wl_resource_post_event(resource_, ZWP_LINUX_BUFFER_PARAMS_V1_CREATED, buffer);
}
/**
* @ingroup iface_zwp_linux_buffer_params_v1
* Sends an failed event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_linux_buffer_params_v1_send_failed(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_LINUX_BUFFER_PARAMS_V1_FAILED);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,32 +0,0 @@
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_surface_interface;
static const struct wl_interface *types[] = {
&wl_surface_interface,
&wl_surface_interface,
NULL,
&wl_surface_interface,
NULL,
&wl_surface_interface,
NULL,
};
static const struct wl_message zwp_e_session_recovery_requests[] = {
{ "get_uuid", "o", types + 0 },
{ "set_uuid", "os", types + 1 },
{ "destroy_uuid", "os", types + 3 },
};
static const struct wl_message zwp_e_session_recovery_events[] = {
{ "create_uuid", "os", types + 5 },
};
WL_EXPORT const struct wl_interface zwp_e_session_recovery_interface = {
"zwp_e_session_recovery", 1,
3, zwp_e_session_recovery_requests,
1, zwp_e_session_recovery_events,
};

View File

@ -1,62 +0,0 @@
#ifndef E_SESSION_RECOVERY_SERVER_PROTOCOL_H
#define E_SESSION_RECOVERY_SERVER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
struct wl_client;
struct wl_resource;
struct wl_surface;
struct zwp_e_session_recovery;
extern const struct wl_interface zwp_e_session_recovery_interface;
struct zwp_e_session_recovery_interface {
/**
* get_uuid - (none)
* @surface: (none)
*/
void (*get_uuid)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *surface);
/**
* set_uuid - (none)
* @surface: (none)
* @uuid: (none)
*/
void (*set_uuid)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *surface,
const char *uuid);
/**
* destroy_uuid - (none)
* @surface: (none)
* @uuid: (none)
*/
void (*destroy_uuid)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *surface,
const char *uuid);
};
#define ZWP_E_SESSION_RECOVERY_CREATE_UUID 0
#define ZWP_E_SESSION_RECOVERY_CREATE_UUID_SINCE_VERSION 1
static inline void
zwp_e_session_recovery_send_create_uuid(struct wl_resource *resource_, struct wl_resource *surface, const char *uuid)
{
wl_resource_post_event(resource_, ZWP_E_SESSION_RECOVERY_CREATE_UUID, surface, uuid);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,41 +0,0 @@
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface www_surface_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
&www_surface_interface,
&wl_surface_interface,
};
static const struct wl_message www_requests[] = {
{ "create", "no", types + 3 },
};
WL_EXPORT const struct wl_interface www_interface = {
"www", 1,
1, www_requests,
0, NULL,
};
static const struct wl_message www_surface_requests[] = {
{ "destroy", "", types + 0 },
};
static const struct wl_message www_surface_events[] = {
{ "status", "iiu", types + 0 },
{ "start_drag", "", types + 0 },
{ "end_drag", "", types + 0 },
};
WL_EXPORT const struct wl_interface www_surface_interface = {
"www_surface", 1,
1, www_surface_requests,
3, www_surface_events,
};

View File

@ -1,77 +0,0 @@
#ifndef ZWP_WWW_SERVER_PROTOCOL_H
#define ZWP_WWW_SERVER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
struct wl_client;
struct wl_resource;
struct wl_surface;
struct www;
struct www_surface;
extern const struct wl_interface www_interface;
extern const struct wl_interface www_surface_interface;
struct www_interface {
/**
* create - Create an object for WWW notifications
* @id: (none)
* @surface: (none)
*
*
*/
void (*create)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface);
};
struct www_surface_interface {
/**
* destroy - Destroy a www_surface
*
*
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
#define WWW_SURFACE_STATUS 0
#define WWW_SURFACE_START_DRAG 1
#define WWW_SURFACE_END_DRAG 2
#define WWW_SURFACE_STATUS_SINCE_VERSION 1
#define WWW_SURFACE_START_DRAG_SINCE_VERSION 1
#define WWW_SURFACE_END_DRAG_SINCE_VERSION 1
static inline void
www_surface_send_status(struct wl_resource *resource_, int32_t x_rel, int32_t y_rel, uint32_t timestamp)
{
wl_resource_post_event(resource_, WWW_SURFACE_STATUS, x_rel, y_rel, timestamp);
}
static inline void
www_surface_send_start_drag(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, WWW_SURFACE_START_DRAG);
}
static inline void
www_surface_send_end_drag(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, WWW_SURFACE_END_DRAG);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,7 +1,5 @@
EXTRA_DIST += src/modules/shot/module.desktop.in \
src/modules/shot/e-module-shot.edj \
src/modules/shot/screenshooter-client-protocol.h \
src/modules/shot/screenshooter-client-protocol.c
src/modules/shot/e-module-shot.edj
if USE_MODULE_SHOT
shotdir = $(MDIR)/shot
@ -11,6 +9,7 @@ shot_DATA = src/modules/shot/e-module-shot.edj \
shotpkgdir = $(MDIR)/shot/$(MODULE_ARCH)
shotpkg_LTLIBRARIES = src/modules/shot/module.la
nodist_src_modules_shot_module_la_SOURCES =
src_modules_shot_module_la_LIBADD = $(MOD_LIBS) @WAYLAND_LIBS@
src_modules_shot_module_la_CPPFLAGS = \
$(MOD_CPPFLAGS) @WAYLAND_CFLAGS@
@ -19,9 +18,18 @@ src_modules_shot_module_la_SOURCES = \
src/modules/shot/e_mod_main.c
if HAVE_WAYLAND
src_modules_shot_module_la_SOURCES += \
src/modules/shot/screenshooter-client-protocol.c \
shot_wayland_sources = \
src/modules/shot/screenshooter-protocol.c \
src/modules/shot/screenshooter-client-protocol.h
nodist_src_modules_shot_module_la_SOURCES += \
$(shot_wayland_sources)
MAINTAINERCLEANFILES += \
$(shot_wayland_sources)
src/modules/shot/e_mod_main.c: \
src/modules/shot/screenshooter-client-protocol.h
endif
PHONIES += shot install-shot

View File

@ -1,10 +1,7 @@
EXTRA_DIST += src/modules/wl_desktop_shell/module.desktop.in \
src/modules/wl_desktop_shell/e-module-wl_desktop_shell.edj \
src/modules/wl_desktop_shell/module.desktop.in \
src/modules/wl_desktop_shell/e_input_method_protocol.h \
src/modules/wl_desktop_shell/e_input_method_protocol.c \
src/modules/wl_desktop_shell/e_desktop_shell_protocol.h \
src/modules/wl_desktop_shell/e_desktop_shell_protocol.c
src/modules/wl_desktop_shell/module.desktop.in
if USE_MODULE_WL_DESKTOP_SHELL
wl_desktop_shelldir = $(MDIR)/wl_desktop_shell
wl_desktop_shell_DATA = src/modules/wl_desktop_shell/e-module-wl_desktop_shell.edj \
@ -13,6 +10,12 @@ wl_desktop_shell_DATA = src/modules/wl_desktop_shell/e-module-wl_desktop_shell.e
wl_desktop_shellpkgdir = $(MDIR)/wl_desktop_shell/$(MODULE_ARCH)
wl_desktop_shellpkg_LTLIBRARIES = src/modules/wl_desktop_shell/module.la
wl_desktop_shell_wayland_sources = \
src/modules/wl_desktop_shell/xdg-shell-unstable-v5-protocol.c \
src/modules/wl_desktop_shell/xdg-shell-unstable-v5-server-protocol.h \
src/modules/wl_desktop_shell/input-method-unstable-v1-protocol.c \
src/modules/wl_desktop_shell/input-method-unstable-v1-server-protocol.h
src_modules_wl_desktop_shell_module_la_DEPENDENCIES = $(MDEPENDENCIES)
src_modules_wl_desktop_shell_module_la_CPPFLAGS = $(MOD_CPPFLAGS) @WAYLAND_CFLAGS@
src_modules_wl_desktop_shell_module_la_LIBADD = $(MOD_LIBS) @WAYLAND_LIBS@
@ -21,11 +24,17 @@ src_modules_wl_desktop_shell_module_la_LDFLAGS = $(MOD_LDFLAGS)
src_modules_wl_desktop_shell_module_la_SOURCES = \
src/modules/wl_desktop_shell/e_mod_main.c \
src/modules/wl_desktop_shell/e_mod_main.h \
src/modules/wl_desktop_shell/e_mod_input_panel.c \
src/modules/wl_desktop_shell/e_input_method_protocol.c \
src/modules/wl_desktop_shell/e_input_method_protocol.h \
src/modules/wl_desktop_shell/e_desktop_shell_protocol.c \
src/modules/wl_desktop_shell/e_desktop_shell_protocol.h
src/modules/wl_desktop_shell/e_mod_input_panel.c
nodist_src_modules_wl_desktop_shell_module_la_SOURCES = \
$(wl_desktop_shell_wayland_sources)
MAINTAINERCLEANFILES += \
$(wl_desktop_shell_wayland_sources)
src/modules/wl_desktop_shell/e_mod_main.c: \
src/modules/wl_desktop_shell/xdg-shell-unstable-v5-server-protocol.h \
src/modules/wl_desktop_shell/input-method-unstable-v1-server-protocol.h
PHONIES += wl_desktop_shell install-wl_desktop_shell
wl_desktop_shell: $(wl_desktop_shellpkg_LTLIBRARIES) $(wl_desktop_shell_DATA)

View File

@ -1,25 +1,28 @@
EXTRA_DIST += \
src/modules/wl_text_input/text-protocol.h \
src/modules/wl_text_input/text-protocol.c \
src/modules/wl_text_input/input-method-protocol.h \
src/modules/wl_text_input/input-method-protocol.c
if USE_MODULE_WL_TEXT_INPUT
wl_text_inputdir = $(MDIR)/wl_text_input
wl_text_inputpkgdir = $(MDIR)/wl_text_input/$(MODULE_ARCH)
wl_text_inputpkg_LTLIBRARIES = src/modules/wl_text_input/module.la
wl_text_input_wayland_sources = \
src/modules/wl_text_input/text-input-unstable-v1-protocol.c \
src/modules/wl_text_input/text-input-unstable-v1-server-protocol.h \
src/modules/wl_text_input/input-method-unstable-v1-protocol.c \
src/modules/wl_text_input/input-method-unstable-v1-server-protocol.h
src_modules_wl_text_input_module_la_DEPENDENCIES = $(MDEPENDENCIES)
src_modules_wl_text_input_module_la_CPPFLAGS = $(MOD_CPPFLAGS) @WAYLAND_CFLAGS@
src_modules_wl_text_input_module_la_LIBADD = $(MOD_LIBS) @WAYLAND_LIBS@
src_modules_wl_text_input_module_la_LDFLAGS = $(MOD_LDFLAGS)
nodist_src_modules_wl_text_input_module_la_SOURCES = \
$(wl_text_input_wayland_sources)
src_modules_wl_text_input_module_la_SOURCES = \
src/modules/wl_text_input/e_mod_main.c \
src/modules/wl_text_input/text-protocol.c \
src/modules/wl_text_input/text-protocol.h \
src/modules/wl_text_input/input-method-protocol.c \
src/modules/wl_text_input/input-method-protocol.h
src/modules/wl_text_input/e_mod_main.c
MAINTAINERCLEANFILES += \
$(wl_text_input_wayland_sources)
src/modules/wl_text_input/e_mod_main.c: src/modules/wl_text_input/text-input-unstable-v1-server-protocol.h\
src/modules/wl_text_input/input-method-unstable-v1-server-protocol.h
PHONIES += wl_text_input install-wl_text_input
wl_text_input: $(wl_text_inputpkg_LTLIBRARIES) $(wl_text_input_DATA)

View File

@ -20,14 +20,24 @@ src_modules_wl_weekeyboard_module_la_CPPFLAGS = \
-DPKGDATADIR='"$pkgdatadir)"'
src_modules_wl_weekeyboard_module_la_LIBADD = $(MOD_LIBS) @WAYLAND_LIBS@
src_modules_wl_weekeyboard_module_la_LDFLAGS = $(MOD_LDFLAGS)
wl_weekeyboard_wayland_sources = \
src/modules/wl_weekeyboard/input-method-unstable-v1-protocol.c \
src/modules/wl_weekeyboard/input-method-unstable-v1-client-protocol.h \
src/modules/wl_weekeyboard/text-input-unstable-v1-protocol.c \
src/modules/wl_weekeyboard/text-input-unstable-v1-client-protocol.h
nodist_src_modules_wl_weekeyboard_module_la_SOURCES = \
$(wl_weekeyboard_wayland_sources)
src_modules_wl_weekeyboard_module_la_SOURCES = \
src/modules/wl_weekeyboard/e_mod_main.c \
src/modules/wl_weekeyboard/wkb-log.h \
src/modules/wl_weekeyboard/wkb-log.c \
src/modules/wl_weekeyboard/input-method-protocol.c \
src/modules/wl_weekeyboard/input-method-client-protocol.h \
src/modules/wl_weekeyboard/text-protocol.c \
src/modules/wl_weekeyboard/text-client-protocol.h
src/modules/wl_weekeyboard/wkb-log.c
src/modules/wl_weekeyboard/e_mod_main.c:\
src/modules/wl_weekeyboard/input-method-unstable-v1-client-protocol.h\
src/modules/wl_weekeyboard/text-input-unstable-v1-client-protocol.h
MAINTAINERCLEANFILES += \
$(wl_weekeyboard_wayland_sources)
PHONIES += wl_weekeyboard install-wl_weekeyboard
wl_weekeyboard: $(wl_weekeyboardpkg_LTLIBRARIES) $(wl_weekeyboard_DATA)

View File

@ -43,7 +43,7 @@ static E_Client_Menu_Hook *border_hook = NULL;
#ifdef HAVE_WAYLAND
Eina_Bool copy_done = EINA_FALSE;
static struct screenshooter *_wl_screenshooter;
static struct zwp_screenshooter *_wl_screenshooter;
static Eina_List *_outputs;
struct screenshooter_output
{
@ -66,12 +66,12 @@ _win_cancel_cb(void *data EINA_UNUSED, void *data2 EINA_UNUSED)
#ifdef HAVE_WAYLAND
static void
_wl_cb_screenshot_done(void *data EINA_UNUSED, struct screenshooter *screenshooter EINA_UNUSED)
_wl_cb_screenshot_done(void *data EINA_UNUSED, struct zwp_screenshooter *screenshooter EINA_UNUSED)
{
copy_done = EINA_TRUE;
}
static const struct screenshooter_listener _screenshooter_listener =
static const struct zwp_screenshooter_listener _screenshooter_listener =
{
_wl_cb_screenshot_done
};
@ -966,7 +966,9 @@ _wl_shot_now(E_Zone *zone, E_Client *ec, const char *params)
output->buffer =
_create_shm_buffer(shm, output->w, output->h, &output->data);
screenshooter_shoot(_wl_screenshooter, output->output, output->buffer);
zwp_screenshooter_shoot(_wl_screenshooter,
output->output,
output->buffer);
copy_done = EINA_FALSE;
while (!copy_done)
@ -1297,14 +1299,14 @@ _wl_init()
global = (Ecore_Wl2_Global *)data;
if ((!_wl_screenshooter) &&
(!strcmp(global->interface, "screenshooter")))
(!strcmp(global->interface, "zwp_screenshooter")))
{
_wl_screenshooter =
wl_registry_bind(reg, global->id,
&screenshooter_interface, global->version);
&zwp_screenshooter_interface, global->version);
if (_wl_screenshooter)
screenshooter_add_listener(_wl_screenshooter,
zwp_screenshooter_add_listener(_wl_screenshooter,
&_screenshooter_listener,
_wl_screenshooter);
}

View File

@ -1,26 +0,0 @@
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_buffer_interface;
extern const struct wl_interface wl_output_interface;
static const struct wl_interface *types[] = {
&wl_output_interface,
&wl_buffer_interface,
};
static const struct wl_message screenshooter_requests[] = {
{ "shoot", "oo", types + 0 },
};
static const struct wl_message screenshooter_events[] = {
{ "done", "", types + 0 },
};
WL_EXPORT const struct wl_interface screenshooter_interface = {
"screenshooter", 1,
1, screenshooter_requests,
1, screenshooter_events,
};

View File

@ -1,68 +0,0 @@
#ifndef SCREENSHOOTER_CLIENT_PROTOCOL_H
#define SCREENSHOOTER_CLIENT_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
struct wl_client;
struct wl_resource;
struct screenshooter;
struct wl_buffer;
struct wl_output;
extern const struct wl_interface screenshooter_interface;
struct screenshooter_listener {
/**
* done - (none)
*/
void (*done)(void *data,
struct screenshooter *screenshooter);
};
static inline int
screenshooter_add_listener(struct screenshooter *screenshooter,
const struct screenshooter_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) screenshooter,
(void (**)(void)) listener, data);
}
#define SCREENSHOOTER_SHOOT 0
static inline void
screenshooter_set_user_data(struct screenshooter *screenshooter, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) screenshooter, user_data);
}
static inline void *
screenshooter_get_user_data(struct screenshooter *screenshooter)
{
return wl_proxy_get_user_data((struct wl_proxy *) screenshooter);
}
static inline void
screenshooter_destroy(struct screenshooter *screenshooter)
{
wl_proxy_destroy((struct wl_proxy *) screenshooter);
}
static inline void
screenshooter_shoot(struct screenshooter *screenshooter, struct wl_output *output, struct wl_buffer *buffer)
{
wl_proxy_marshal((struct wl_proxy *) screenshooter,
SCREENSHOOTER_SHOOT, output, buffer);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,125 +0,0 @@
/*
* Copyright © 2008-2013 Kristian Høgsberg
* Copyright © 2013 Rafael Antognolli
* Copyright © 2013 Jasper St. Pierre
* Copyright © 2010-2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_output_interface;
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface xdg_popup_interface;
extern const struct wl_interface xdg_surface_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
NULL,
&xdg_surface_interface,
&wl_surface_interface,
&xdg_popup_interface,
&wl_surface_interface,
&wl_surface_interface,
&wl_seat_interface,
NULL,
NULL,
NULL,
&xdg_surface_interface,
&wl_seat_interface,
NULL,
NULL,
NULL,
&wl_seat_interface,
NULL,
&wl_seat_interface,
NULL,
NULL,
&wl_output_interface,
};
static const struct wl_message xdg_shell_requests[] = {
{ "destroy", "", types + 0 },
{ "use_unstable_version", "i", types + 0 },
{ "get_xdg_surface", "no", types + 4 },
{ "get_xdg_popup", "nooouii", types + 6 },
{ "pong", "u", types + 0 },
};
static const struct wl_message xdg_shell_events[] = {
{ "ping", "u", types + 0 },
};
WL_EXPORT const struct wl_interface xdg_shell_interface = {
"xdg_shell", 1,
5, xdg_shell_requests,
1, xdg_shell_events,
};
static const struct wl_message xdg_surface_requests[] = {
{ "destroy", "", types + 0 },
{ "set_parent", "?o", types + 13 },
{ "set_title", "s", types + 0 },
{ "set_app_id", "s", types + 0 },
{ "show_window_menu", "ouii", types + 14 },
{ "move", "ou", types + 18 },
{ "resize", "ouu", types + 20 },
{ "ack_configure", "u", types + 0 },
{ "set_window_geometry", "iiii", types + 0 },
{ "set_maximized", "", types + 0 },
{ "unset_maximized", "", types + 0 },
{ "set_fullscreen", "?o", types + 23 },
{ "unset_fullscreen", "", types + 0 },
{ "set_minimized", "", types + 0 },
};
static const struct wl_message xdg_surface_events[] = {
{ "configure", "iiau", types + 0 },
{ "close", "", types + 0 },
};
WL_EXPORT const struct wl_interface xdg_surface_interface = {
"xdg_surface", 1,
14, xdg_surface_requests,
2, xdg_surface_events,
};
static const struct wl_message xdg_popup_requests[] = {
{ "destroy", "", types + 0 },
};
static const struct wl_message xdg_popup_events[] = {
{ "popup_done", "", types + 0 },
};
WL_EXPORT const struct wl_interface xdg_popup_interface = {
"xdg_popup", 1,
1, xdg_popup_requests,
1, xdg_popup_events,
};

View File

@ -1,661 +0,0 @@
/*
* Copyright © 2008-2013 Kristian Høgsberg
* Copyright © 2013 Rafael Antognolli
* Copyright © 2013 Jasper St. Pierre
* Copyright © 2010-2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef XDG_SHELL_SERVER_PROTOCOL_H
#define XDG_SHELL_SERVER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
struct wl_client;
struct wl_resource;
struct wl_output;
struct wl_seat;
struct wl_surface;
struct xdg_popup;
struct xdg_shell;
struct xdg_surface;
extern const struct wl_interface xdg_shell_interface;
extern const struct wl_interface xdg_surface_interface;
extern const struct wl_interface xdg_popup_interface;
#ifndef XDG_SHELL_VERSION_ENUM
#define XDG_SHELL_VERSION_ENUM
/**
* xdg_shell_version - latest protocol version
* @XDG_SHELL_VERSION_CURRENT: Always the latest version
*
* The 'current' member of this enum gives the version of the protocol.
* Implementations can compare this to the version they implement using
* static_assert to ensure the protocol and implementation versions match.
*/
enum xdg_shell_version {
XDG_SHELL_VERSION_CURRENT = 5,
};
#endif /* XDG_SHELL_VERSION_ENUM */
#ifndef XDG_SHELL_ERROR_ENUM
#define XDG_SHELL_ERROR_ENUM
enum xdg_shell_error {
XDG_SHELL_ERROR_ROLE = 0,
XDG_SHELL_ERROR_DEFUNCT_SURFACES = 1,
XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP = 2,
XDG_SHELL_ERROR_INVALID_POPUP_PARENT = 3,
};
#endif /* XDG_SHELL_ERROR_ENUM */
/**
* xdg_shell - create desktop-style surfaces
* @destroy: destroy xdg_shell
* @use_unstable_version: enable use of this unstable version
* @get_xdg_surface: create a shell surface from a surface
* @get_xdg_popup: create a popup for a surface
* @pong: respond to a ping event
*
* xdg_shell allows clients to turn a wl_surface into a "real window"
* which can be dragged, resized, stacked, and moved around by the user.
* Everything about this interface is suited towards traditional desktop
* environments.
*/
struct xdg_shell_interface {
/**
* destroy - destroy xdg_shell
*
* Destroy this xdg_shell object.
*
* Destroying a bound xdg_shell object while there are surfaces
* still alive created by this xdg_shell object instance is illegal
* and will result in a protocol error.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* use_unstable_version - enable use of this unstable version
* @version: (none)
*
* Negotiate the unstable version of the interface. This
* mechanism is in place to ensure client and server agree on the
* unstable versions of the protocol that they speak or exit
* cleanly if they don't agree. This request will go away once the
* xdg-shell protocol is stable.
*/
void (*use_unstable_version)(struct wl_client *client,
struct wl_resource *resource,
int32_t version);
/**
* get_xdg_surface - create a shell surface from a surface
* @id: (none)
* @surface: (none)
*
* This creates an xdg_surface for the given surface and gives it
* the xdg_surface role. A wl_surface can only be given an
* xdg_surface role once. If get_xdg_surface is called with a
* wl_surface that already has an active xdg_surface associated
* with it, or if it had any other role, an error is raised.
*
* See the documentation of xdg_surface for more details about what
* an xdg_surface is and how it is used.
*/
void (*get_xdg_surface)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface);
/**
* get_xdg_popup - create a popup for a surface
* @id: (none)
* @surface: (none)
* @parent: (none)
* @seat: the wl_seat of the user event
* @serial: the serial of the user event
* @x: (none)
* @y: (none)
*
* This creates an xdg_popup for the given surface and gives it
* the xdg_popup role. A wl_surface can only be given an xdg_popup
* role once. If get_xdg_popup is called with a wl_surface that
* already has an active xdg_popup associated with it, or if it had
* any other role, an error is raised.
*
* This request must be used in response to some sort of user
* action like a button press, key press, or touch down event.
*
* See the documentation of xdg_popup for more details about what
* an xdg_popup is and how it is used.
*/
void (*get_xdg_popup)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface,
struct wl_resource *parent,
struct wl_resource *seat,
uint32_t serial,
int32_t x,
int32_t y);
/**
* pong - respond to a ping event
* @serial: serial of the ping event
*
* A client must respond to a ping event with a pong request or
* the client may be deemed unresponsive.
*/
void (*pong)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial);
};
#define XDG_SHELL_PING 0
#define XDG_SHELL_PING_SINCE_VERSION 1
static inline void
xdg_shell_send_ping(struct wl_resource *resource_, uint32_t serial)
{
wl_resource_post_event(resource_, XDG_SHELL_PING, serial);
}
#ifndef XDG_SURFACE_RESIZE_EDGE_ENUM
#define XDG_SURFACE_RESIZE_EDGE_ENUM
/**
* xdg_surface_resize_edge - edge values for resizing
* @XDG_SURFACE_RESIZE_EDGE_NONE: (none)
* @XDG_SURFACE_RESIZE_EDGE_TOP: (none)
* @XDG_SURFACE_RESIZE_EDGE_BOTTOM: (none)
* @XDG_SURFACE_RESIZE_EDGE_LEFT: (none)
* @XDG_SURFACE_RESIZE_EDGE_TOP_LEFT: (none)
* @XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT: (none)
* @XDG_SURFACE_RESIZE_EDGE_RIGHT: (none)
* @XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT: (none)
* @XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT: (none)
*
* These values are used to indicate which edge of a surface is being
* dragged in a resize operation. The server may use this information to
* adapt its behavior, e.g. choose an appropriate cursor image.
*/
enum xdg_surface_resize_edge {
XDG_SURFACE_RESIZE_EDGE_NONE = 0,
XDG_SURFACE_RESIZE_EDGE_TOP = 1,
XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2,
XDG_SURFACE_RESIZE_EDGE_LEFT = 4,
XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5,
XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6,
XDG_SURFACE_RESIZE_EDGE_RIGHT = 8,
XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9,
XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10,
};
#endif /* XDG_SURFACE_RESIZE_EDGE_ENUM */
#ifndef XDG_SURFACE_STATE_ENUM
#define XDG_SURFACE_STATE_ENUM
/**
* xdg_surface_state - types of state on the surface
* @XDG_SURFACE_STATE_MAXIMIZED: the surface is maximized
* @XDG_SURFACE_STATE_FULLSCREEN: the surface is fullscreen
* @XDG_SURFACE_STATE_RESIZING: (none)
* @XDG_SURFACE_STATE_ACTIVATED: (none)
*
* The different state values used on the surface. This is designed for
* state values like maximized, fullscreen. It is paired with the configure
* event to ensure that both the client and the compositor setting the
* state can be synchronized.
*
* States set in this way are double-buffered. They will get applied on the
* next commit.
*
* Desktop environments may extend this enum by taking up a range of values
* and documenting the range they chose in this description. They are not
* required to document the values for the range that they chose. Ideally,
* any good extensions from a desktop environment should make its way into
* standardization into this enum.
*
* The current reserved ranges are:
*
* 0x0000 - 0x0FFF: xdg-shell core values, documented below. 0x1000 -
* 0x1FFF: GNOME
*/
enum xdg_surface_state {
XDG_SURFACE_STATE_MAXIMIZED = 1,
XDG_SURFACE_STATE_FULLSCREEN = 2,
XDG_SURFACE_STATE_RESIZING = 3,
XDG_SURFACE_STATE_ACTIVATED = 4,
};
#endif /* XDG_SURFACE_STATE_ENUM */
/**
* xdg_surface - A desktop window
* @destroy: Destroy the xdg_surface
* @set_parent: set the parent of this surface
* @set_title: set surface title
* @set_app_id: set application ID
* @show_window_menu: show the window menu
* @move: start an interactive move
* @resize: start an interactive resize
* @ack_configure: ack a configure event
* @set_window_geometry: set the new window geometry
* @set_maximized: maximize the window
* @unset_maximized: unmaximize the window
* @set_fullscreen: set the window as fullscreen on a monitor
* @unset_fullscreen: (none)
* @set_minimized: set the window as minimized
*
* An interface that may be implemented by a wl_surface, for
* implementations that provide a desktop-style user interface.
*
* It provides requests to treat surfaces like windows, allowing to set
* properties like maximized, fullscreen, minimized, and to move and resize
* them, and associate metadata like title and app id.
*
* The client must call wl_surface.commit on the corresponding wl_surface
* for the xdg_surface state to take effect. Prior to committing the new
* state, it can set up initial configuration, such as maximizing or
* setting a window geometry.
*
* Even without attaching a buffer the compositor must respond to initial
* committed configuration, for instance sending a configure event with
* expected window geometry if the client maximized its surface during
* initialization.
*
* For a surface to be mapped by the compositor the client must have
* committed both an xdg_surface state and a buffer.
*/
struct xdg_surface_interface {
/**
* destroy - Destroy the xdg_surface
*
* Unmap and destroy the window. The window will be effectively
* hidden from the user's point of view, and all state like
* maximization, fullscreen, and so on, will be lost.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* set_parent - set the parent of this surface
* @parent: (none)
*
* Set the "parent" of this surface. This window should be
* stacked above a parent. The parent surface must be mapped as
* long as this surface is mapped.
*
* Parent windows should be set on dialogs, toolboxes, or other
* "auxiliary" surfaces, so that the parent is raised when the
* dialog is raised.
*/
void (*set_parent)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *parent);
/**
* set_title - set surface title
* @title: (none)
*
* Set a short title for the surface.
*
* This string may be used to identify the surface in a task bar,
* window list, or other user interface elements provided by the
* compositor.
*
* The string must be encoded in UTF-8.
*/
void (*set_title)(struct wl_client *client,
struct wl_resource *resource,
const char *title);
/**
* set_app_id - set application ID
* @app_id: (none)
*
* Set an application identifier for the surface.
*
* The app ID identifies the general class of applications to which
* the surface belongs. The compositor can use this to group
* multiple surfaces together, or to determine how to launch a new
* application.
*
* For D-Bus activatable applications, the app ID is used as the
* D-Bus service name.
*
* The compositor shell will try to group application surfaces
* together by their app ID. As a best practice, it is suggested to
* select app ID's that match the basename of the application's
* .desktop file. For example, "org.freedesktop.FooViewer" where
* the .desktop file is "org.freedesktop.FooViewer.desktop".
*
* See the desktop-entry specification [0] for more details on
* application identifiers and how they relate to well-known D-Bus
* names and .desktop files.
*
* [0] http://standards.freedesktop.org/desktop-entry-spec/
*/
void (*set_app_id)(struct wl_client *client,
struct wl_resource *resource,
const char *app_id);
/**
* show_window_menu - show the window menu
* @seat: the wl_seat of the user event
* @serial: the serial of the user event
* @x: the x position to pop up the window menu at
* @y: the y position to pop up the window menu at
*
* Clients implementing client-side decorations might want to
* show a context menu when right-clicking on the decorations,
* giving the user a menu that they can use to maximize or minimize
* the window.
*
* This request asks the compositor to pop up such a window menu at
* the given position, relative to the local surface coordinates of
* the parent surface. There are no guarantees as to what menu
* items the window menu contains.
*
* This request must be used in response to some sort of user
* action like a button press, key press, or touch down event.
*/
void (*show_window_menu)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *seat,
uint32_t serial,
int32_t x,
int32_t y);
/**
* move - start an interactive move
* @seat: the wl_seat of the user event
* @serial: the serial of the user event
*
* Start an interactive, user-driven move of the surface.
*
* This request must be used in response to some sort of user
* action like a button press, key press, or touch down event.
*
* The server may ignore move requests depending on the state of
* the surface (e.g. fullscreen or maximized).
*/
void (*move)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *seat,
uint32_t serial);
/**
* resize - start an interactive resize
* @seat: the wl_seat of the user event
* @serial: the serial of the user event
* @edges: which edge or corner is being dragged
*
* Start a user-driven, interactive resize of the surface.
*
* This request must be used in response to some sort of user
* action like a button press, key press, or touch down event.
*
* The server may ignore resize requests depending on the state of
* the surface (e.g. fullscreen or maximized).
*/
void (*resize)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *seat,
uint32_t serial,
uint32_t edges);
/**
* ack_configure - ack a configure event
* @serial: the serial from the configure event
*
* When a configure event is received, if a client commits the
* surface in response to the configure event, then the client must
* make a ack_configure request before the commit request, passing
* along the serial of the configure event.
*
* For instance, the compositor might use this information to move
* a surface to the top left only when the client has drawn itself
* for the maximized or fullscreen state.
*
* If the client receives multiple configure events before it can
* respond to one, it only has to ack the last configure event.
*/
void (*ack_configure)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial);
/**
* set_window_geometry - set the new window geometry
* @x: (none)
* @y: (none)
* @width: (none)
* @height: (none)
*
* The window geometry of a window is its "visible bounds" from
* the user's perspective. Client-side decorations often have
* invisible portions like drop-shadows which should be ignored for
* the purposes of aligning, placing and constraining windows.
*
* The window geometry is double buffered, and will be applied at
* the time wl_surface.commit of the corresponding wl_surface is
* called.
*
* Once the window geometry of the surface is set once, it is not
* possible to unset it, and it will remain the same until
* set_window_geometry is called again, even if a new subsurface or
* buffer is attached.
*
* If never set, the value is the full bounds of the surface,
* including any subsurfaces. This updates dynamically on every
* commit. This unset mode is meant for extremely simple clients.
*
* If responding to a configure event, the window geometry in here
* must respect the sizing negotiations specified by the states in
* the configure event.
*
* The arguments are given in the surface local coordinate space of
* the wl_surface associated with this xdg_surface.
*
* The width and height must be greater than zero.
*/
void (*set_window_geometry)(struct wl_client *client,
struct wl_resource *resource,
int32_t x,
int32_t y,
int32_t width,
int32_t height);
/**
* set_maximized - maximize the window
*
* Maximize the surface.
*
* After requesting that the surface should be maximized, the
* compositor will respond by emitting a configure event with the
* "maximized" state and the required window geometry. The client
* should then update its content, drawing it in a maximized state,
* i.e. without shadow or other decoration outside of the window
* geometry. The client must also acknowledge the configure when
* committing the new content (see ack_configure).
*
* It is up to the compositor to decide how and where to maximize
* the surface, for example which output and what region of the
* screen should be used.
*
* If the surface was already maximized, the compositor will still
* emit a configure event with the "maximized" state.
*/
void (*set_maximized)(struct wl_client *client,
struct wl_resource *resource);
/**
* unset_maximized - unmaximize the window
*
* Unmaximize the surface.
*
* After requesting that the surface should be unmaximized, the
* compositor will respond by emitting a configure event without
* the "maximized" state. If available, the compositor will include
* the window geometry dimensions the window had prior to being
* maximized in the configure request. The client must then update
* its content, drawing it in a regular state, i.e. potentially
* with shadow, etc. The client must also acknowledge the configure
* when committing the new content (see ack_configure).
*
* It is up to the compositor to position the surface after it was
* unmaximized; usually the position the surface had before
* maximizing, if applicable.
*
* If the surface was already not maximized, the compositor will
* still emit a configure event without the "maximized" state.
*/
void (*unset_maximized)(struct wl_client *client,
struct wl_resource *resource);
/**
* set_fullscreen - set the window as fullscreen on a monitor
* @output: (none)
*
* Make the surface fullscreen.
*
* You can specify an output that you would prefer to be
* fullscreen. If this value is NULL, it's up to the compositor to
* choose which display will be used to map this surface.
*
* If the surface doesn't cover the whole output, the compositor
* will position the surface in the center of the output and
* compensate with black borders filling the rest of the output.
*/
void (*set_fullscreen)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *output);
/**
* unset_fullscreen - (none)
*/
void (*unset_fullscreen)(struct wl_client *client,
struct wl_resource *resource);
/**
* set_minimized - set the window as minimized
*
* Request that the compositor minimize your surface. There is no
* way to know if the surface is currently minimized, nor is there
* any way to unset minimization on this surface.
*
* If you are looking to throttle redrawing when minimized, please
* instead use the wl_surface.frame event for this, as this will
* also work with live previews on windows in Alt-Tab, Expose or
* similar compositor features.
*/
void (*set_minimized)(struct wl_client *client,
struct wl_resource *resource);
};
#define XDG_SURFACE_CONFIGURE 0
#define XDG_SURFACE_CLOSE 1
#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1
#define XDG_SURFACE_CLOSE_SINCE_VERSION 1
static inline void
xdg_surface_send_configure(struct wl_resource *resource_, int32_t width, int32_t height, struct wl_array *states, uint32_t serial)
{
wl_resource_post_event(resource_, XDG_SURFACE_CONFIGURE, width, height, states, serial);
}
static inline void
xdg_surface_send_close(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, XDG_SURFACE_CLOSE);
}
/**
* xdg_popup - short-lived, popup surfaces for menus
* @destroy: remove xdg_popup interface
*
* A popup surface is a short-lived, temporary surface that can be used
* to implement menus. It takes an explicit grab on the surface that will
* be dismissed when the user dismisses the popup. This can be done by the
* user clicking outside the surface, using the keyboard, or even locking
* the screen through closing the lid or a timeout.
*
* When the popup is dismissed, a popup_done event will be sent out, and at
* the same time the surface will be unmapped. The xdg_popup object is now
* inert and cannot be reactivated, so clients should destroy it.
* Explicitly destroying the xdg_popup object will also dismiss the popup
* and unmap the surface.
*
* Clients will receive events for all their surfaces during this grab
* (which is an "owner-events" grab in X11 parlance). This is done so that
* users can navigate through submenus and other "nested" popup windows
* without having to dismiss the topmost popup.
*
* Clients that want to dismiss the popup when another surface of their own
* is clicked should dismiss the popup using the destroy request.
*
* The parent surface must have either an xdg_surface or xdg_popup role.
*
* Specifying an xdg_popup for the parent means that the popups are nested,
* with this popup now being the topmost popup. Nested popups must be
* destroyed in the reverse order they were created in, e.g. the only popup
* you are allowed to destroy at all times is the topmost one.
*
* If there is an existing popup when creating a new popup, the parent must
* be the current topmost popup.
*
* A parent surface must be mapped before the new popup is mapped.
*
* When compositors choose to dismiss a popup, they will likely dismiss
* every nested popup as well. When a compositor dismisses popups, it will
* follow the same dismissing order as required from the client.
*
* The x and y arguments passed when creating the popup object specify
* where the top left of the popup should be placed, relative to the local
* surface coordinates of the parent surface. See xdg_shell.get_xdg_popup.
*
* The client must call wl_surface.commit on the corresponding wl_surface
* for the xdg_popup state to take effect.
*
* For a surface to be mapped by the compositor the client must have
* committed both the xdg_popup state and a buffer.
*/
struct xdg_popup_interface {
/**
* destroy - remove xdg_popup interface
*
* This destroys the popup. Explicitly destroying the xdg_popup
* object will also dismiss the popup, and unmap the surface.
*
* If this xdg_popup is not the "topmost" popup, a protocol error
* will be sent.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
#define XDG_POPUP_POPUP_DONE 0
#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1
static inline void
xdg_popup_send_popup_done(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, XDG_POPUP_POPUP_DONE);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,114 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_input_method_context_interface;
extern const struct wl_interface wl_input_panel_surface_interface;
extern const struct wl_interface wl_keyboard_interface;
extern const struct wl_interface wl_output_interface;
extern const struct wl_interface wl_surface_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
NULL,
NULL,
&wl_keyboard_interface,
&wl_input_method_context_interface,
&wl_input_method_context_interface,
&wl_input_panel_surface_interface,
&wl_surface_interface,
&wl_output_interface,
NULL,
};
static const struct wl_message wl_input_method_context_requests[] = {
{ "destroy", "", types + 0 },
{ "commit_string", "us", types + 0 },
{ "preedit_string", "uss", types + 0 },
{ "preedit_styling", "uuu", types + 0 },
{ "preedit_cursor", "i", types + 0 },
{ "delete_surrounding_text", "iu", types + 0 },
{ "cursor_position", "ii", types + 0 },
{ "modifiers_map", "a", types + 0 },
{ "keysym", "uuuuu", types + 0 },
{ "grab_keyboard", "n", types + 5 },
{ "key", "uuuu", types + 0 },
{ "modifiers", "uuuuu", types + 0 },
{ "language", "us", types + 0 },
{ "text_direction", "uu", types + 0 },
};
static const struct wl_message wl_input_method_context_events[] = {
{ "surrounding_text", "suu", types + 0 },
{ "reset", "", types + 0 },
{ "content_type", "uu", types + 0 },
{ "invoke_action", "uu", types + 0 },
{ "commit_state", "u", types + 0 },
{ "preferred_language", "s", types + 0 },
};
WL_EXPORT const struct wl_interface wl_input_method_context_interface = {
"wl_input_method_context", 1,
14, wl_input_method_context_requests,
6, wl_input_method_context_events,
};
static const struct wl_message wl_input_method_events[] = {
{ "activate", "n", types + 6 },
{ "deactivate", "o", types + 7 },
};
WL_EXPORT const struct wl_interface wl_input_method_interface = {
"wl_input_method", 1,
0, NULL,
2, wl_input_method_events,
};
static const struct wl_message wl_input_panel_requests[] = {
{ "get_input_panel_surface", "no", types + 8 },
};
WL_EXPORT const struct wl_interface wl_input_panel_interface = {
"wl_input_panel", 1,
1, wl_input_panel_requests,
0, NULL,
};
static const struct wl_message wl_input_panel_surface_requests[] = {
{ "set_toplevel", "ou", types + 10 },
{ "set_overlay_panel", "", types + 0 },
};
WL_EXPORT const struct wl_interface wl_input_panel_surface_interface = {
"wl_input_panel_surface", 1,
2, wl_input_panel_surface_requests,
0, NULL,
};

View File

@ -1,418 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef INPUT_METHOD_SERVER_PROTOCOL_H
#define INPUT_METHOD_SERVER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
struct wl_client;
struct wl_resource;
struct wl_input_method_context;
struct wl_input_method;
struct wl_input_panel;
struct wl_input_panel_surface;
extern const struct wl_interface wl_input_method_context_interface;
extern const struct wl_interface wl_input_method_interface;
extern const struct wl_interface wl_input_panel_interface;
extern const struct wl_interface wl_input_panel_surface_interface;
/**
* wl_input_method_context - input method context
* @destroy: (none)
* @commit_string: commit string
* @preedit_string: pre-edit string
* @preedit_styling: pre-edit styling
* @preedit_cursor: pre-edit cursor
* @delete_surrounding_text: delete text
* @cursor_position: set cursor to a new position
* @modifiers_map: (none)
* @keysym: keysym
* @grab_keyboard: grab hardware keyboard
* @key: forward key event
* @modifiers: forward modifiers event
* @language: (none)
* @text_direction: (none)
*
* Corresponds to a text model on input method side. An input method
* context is created on text model activation on the input method side. It
* allows to receive information about the text model from the application
* via events. Input method contexts do not keep state after deactivation
* and should be destroyed after deactivation is handled.
*
* Text is generally UTF-8 encoded, indices and lengths are in bytes.
*
* Serials are used to synchronize the state between the text input and an
* input method. New serials are sent by the text input in the commit_state
* request and are used by the input method to indicate the known text
* input state in events like preedit_string, commit_string, and keysym.
* The text input can then ignore events from the input method which are
* based on an outdated state (for example after a reset).
*/
struct wl_input_method_context_interface {
/**
* destroy - (none)
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* commit_string - commit string
* @serial: serial of the latest known text input state
* @text: (none)
*
* Send the commit string text for insertion to the application.
*
* The text to commit could be either just a single character after
* a key press or the result of some composing (pre-edit). It could
* be also an empty text when some text should be removed (see
* delete_surrounding_text) or when the input cursor should be
* moved (see cursor_position).
*
* Any previously set composing text will be removed.
*/
void (*commit_string)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
const char *text);
/**
* preedit_string - pre-edit string
* @serial: serial of the latest known text input state
* @text: (none)
* @commit: (none)
*
* Send the pre-edit string text to the application text input.
*
* The commit text can be used to replace the preedit text on reset
* (for example on unfocus).
*
* Also previously sent preedit_style and preedit_cursor requests
* are processed bt the text_input also.
*/
void (*preedit_string)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
const char *text,
const char *commit);
/**
* preedit_styling - pre-edit styling
* @index: (none)
* @length: (none)
* @style: (none)
*
* Sets styling information on composing text. The style is
* applied for length in bytes from index relative to the beginning
* of the composing text (as byte offset). Multiple styles can be
* applied to a composing text.
*
* This request should be sent before sending preedit_string
* request.
*/
void (*preedit_styling)(struct wl_client *client,
struct wl_resource *resource,
uint32_t index,
uint32_t length,
uint32_t style);
/**
* preedit_cursor - pre-edit cursor
* @index: (none)
*
* Sets the cursor position inside the composing text (as byte
* offset) relative to the start of the composing text.
*
* When index is negative no cursor should be displayed.
*
* This request should be sent before sending preedit_string
* request.
*/
void (*preedit_cursor)(struct wl_client *client,
struct wl_resource *resource,
int32_t index);
/**
* delete_surrounding_text - delete text
* @index: (none)
* @length: (none)
*
*
*
* This request will be handled on text_input side as part of a
* directly following commit_string request.
*/
void (*delete_surrounding_text)(struct wl_client *client,
struct wl_resource *resource,
int32_t index,
uint32_t length);
/**
* cursor_position - set cursor to a new position
* @index: (none)
* @anchor: (none)
*
* Sets the cursor and anchor to a new position. Index is the new
* cursor position in bytes (when >= 0 relative to the end of
* inserted text else relative to beginning of inserted text).
* Anchor is the new anchor position in bytes (when >= 0 relative
* to the end of inserted text, else relative to beginning of
* inserted text). When there should be no selected text anchor
* should be the same as index.
*
* This request will be handled on text_input side as part of a
* directly following commit_string request.
*/
void (*cursor_position)(struct wl_client *client,
struct wl_resource *resource,
int32_t index,
int32_t anchor);
/**
* modifiers_map - (none)
* @map: (none)
*/
void (*modifiers_map)(struct wl_client *client,
struct wl_resource *resource,
struct wl_array *map);
/**
* keysym - keysym
* @serial: serial of the latest known text input state
* @time: (none)
* @sym: (none)
* @state: (none)
* @modifiers: (none)
*
* Notify when a key event was sent. Key events should not be
* used for normal text input operations, which should be done with
* commit_string, delete_surrounfing_text, etc. The key event
* follows the wl_keyboard key event convention. Sym is a XKB
* keysym, state a wl_keyboard key_state.
*/
void (*keysym)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t time,
uint32_t sym,
uint32_t state,
uint32_t modifiers);
/**
* grab_keyboard - grab hardware keyboard
* @keyboard: (none)
*
* Allows an input method to receive hardware keyboard input and
* process key events to generate text events (with pre-edit) over
* the wire. This allows input methods which compose multiple key
* events for inputting text like it is done for CJK languages.
*/
void (*grab_keyboard)(struct wl_client *client,
struct wl_resource *resource,
uint32_t keyboard);
/**
* key - forward key event
* @serial: serial from wl_keyboard::key
* @time: time from wl_keyboard::key
* @key: key from wl_keyboard::key
* @state: state from wl_keyboard::key
*
* Should be used when filtering key events with grab_keyboard.
*
* When the wl_keyboard::key event is not processed by the input
* method itself and should be sent to the client instead, forward
* it with this request. The arguments should be the ones from the
* wl_keyboard::key event.
*
* For generating custom key events use the keysym request instead.
*/
void (*key)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t time,
uint32_t key,
uint32_t state);
/**
* modifiers - forward modifiers event
* @serial: serial from wl_keyboard::modifiers
* @mods_depressed: mods_depressed from wl_keyboard::modifiers
* @mods_latched: mods_latched from wl_keyboard::modifiers
* @mods_locked: mods_locked from wl_keyboard::modifiers
* @group: group from wl_keyboard::modifiers
*
* Should be used when filtering key events with grab_keyboard.
*
* When the wl_keyboard::modifiers event should be also send to the
* client, forward it with this request. The arguments should be
* the ones from the wl_keyboard::modifiers event.
*/
void (*modifiers)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t mods_depressed,
uint32_t mods_latched,
uint32_t mods_locked,
uint32_t group);
/**
* language - (none)
* @serial: serial of the latest known text input state
* @language: (none)
*/
void (*language)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
const char *language);
/**
* text_direction - (none)
* @serial: serial of the latest known text input state
* @direction: (none)
*/
void (*text_direction)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t direction);
};
#define WL_INPUT_METHOD_CONTEXT_SURROUNDING_TEXT 0
#define WL_INPUT_METHOD_CONTEXT_RESET 1
#define WL_INPUT_METHOD_CONTEXT_CONTENT_TYPE 2
#define WL_INPUT_METHOD_CONTEXT_INVOKE_ACTION 3
#define WL_INPUT_METHOD_CONTEXT_COMMIT_STATE 4
#define WL_INPUT_METHOD_CONTEXT_PREFERRED_LANGUAGE 5
#define WL_INPUT_METHOD_CONTEXT_SURROUNDING_TEXT_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_RESET_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_CONTENT_TYPE_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_INVOKE_ACTION_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_COMMIT_STATE_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_PREFERRED_LANGUAGE_SINCE_VERSION 1
static inline void
wl_input_method_context_send_surrounding_text(struct wl_resource *resource_, const char *text, uint32_t cursor, uint32_t anchor)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_SURROUNDING_TEXT, text, cursor, anchor);
}
static inline void
wl_input_method_context_send_reset(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_RESET);
}
static inline void
wl_input_method_context_send_content_type(struct wl_resource *resource_, uint32_t hint, uint32_t purpose)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_CONTENT_TYPE, hint, purpose);
}
static inline void
wl_input_method_context_send_invoke_action(struct wl_resource *resource_, uint32_t button, uint32_t index)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_INVOKE_ACTION, button, index);
}
static inline void
wl_input_method_context_send_commit_state(struct wl_resource *resource_, uint32_t serial)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_COMMIT_STATE, serial);
}
static inline void
wl_input_method_context_send_preferred_language(struct wl_resource *resource_, const char *language)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_PREFERRED_LANGUAGE, language);
}
#define WL_INPUT_METHOD_ACTIVATE 0
#define WL_INPUT_METHOD_DEACTIVATE 1
#define WL_INPUT_METHOD_ACTIVATE_SINCE_VERSION 1
#define WL_INPUT_METHOD_DEACTIVATE_SINCE_VERSION 1
static inline void
wl_input_method_send_activate(struct wl_resource *resource_, struct wl_resource *id)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_ACTIVATE, id);
}
static inline void
wl_input_method_send_deactivate(struct wl_resource *resource_, struct wl_resource *context)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_DEACTIVATE, context);
}
/**
* wl_input_panel - interface for implementing keyboards
* @get_input_panel_surface: (none)
*
* Only one client can bind this interface at a time.
*/
struct wl_input_panel_interface {
/**
* get_input_panel_surface - (none)
* @id: (none)
* @surface: (none)
*/
void (*get_input_panel_surface)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface);
};
#ifndef WL_INPUT_PANEL_SURFACE_POSITION_ENUM
#define WL_INPUT_PANEL_SURFACE_POSITION_ENUM
enum wl_input_panel_surface_position {
WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM = 0,
};
#endif /* WL_INPUT_PANEL_SURFACE_POSITION_ENUM */
struct wl_input_panel_surface_interface {
/**
* set_toplevel - set the surface type as a keyboard
* @output: (none)
* @position: (none)
*
* A keyboard surface is only shown, when a text model is active
*/
void (*set_toplevel)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *output,
uint32_t position);
/**
* set_overlay_panel - set the surface type as an overlay panel
*
* An overlay panel is shown near the input cursor above the
* application window when a text model is active.
*/
void (*set_overlay_panel)(struct wl_client *client,
struct wl_resource *resource);
};
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,7 +1,7 @@
#define E_COMP_WL
#include "e.h"
#include "e_mod_main.h"
#include "e_input_method_protocol.h"
#include "input-method-unstable-v1-server-protocol.h"
typedef struct _E_Input_Panel E_Input_Panel;
typedef struct _E_Input_Panel_Surface E_Input_Panel_Surface;
@ -42,7 +42,7 @@ _e_input_panel_surface_cb_overlay_panel_set(struct wl_client *client EINA_UNUSED
ips->panel = EINA_TRUE;
}
static const struct wl_input_panel_surface_interface _e_input_panel_surface_implementation = {
static const struct zwp_input_panel_surface_v1_interface _e_input_panel_surface_implementation = {
_e_input_panel_surface_cb_toplevel_set,
_e_input_panel_surface_cb_overlay_panel_set
};
@ -206,7 +206,7 @@ _e_input_panel_cb_surface_get(struct wl_client *client, struct wl_resource *reso
}
cd->shell.surface = wl_resource_create(client,
&wl_input_panel_surface_interface,
&zwp_input_panel_surface_v1_interface,
1, id);
if (!cd->shell.surface)
{
@ -254,7 +254,7 @@ _e_input_panel_cb_surface_get(struct wl_client *client, struct wl_resource *reso
input_panel.surfaces = eina_list_append(input_panel.surfaces, ips);
}
static const struct wl_input_panel_interface _e_input_panel_implementation = {
static const struct zwp_input_panel_v1_interface _e_input_panel_implementation = {
_e_input_panel_cb_surface_get
};
@ -271,7 +271,7 @@ _e_input_panel_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t v
{
struct wl_resource *resource;
resource = wl_resource_create(client, &wl_input_panel_interface, 1, id);
resource = wl_resource_create(client, &zwp_input_panel_v1_interface, 1, id);
if (!resource)
{
wl_client_post_no_memory(client);
@ -317,7 +317,7 @@ e_input_panel_init(void)
// TODO: add signal handler - update input panel
input_panel_global = wl_global_create(e_comp->wl_comp_data->wl.disp,
&wl_input_panel_interface, 1,
&zwp_input_panel_v1_interface, 1,
NULL, _e_input_panel_bind);
if (!input_panel_global)
{

View File

@ -1,7 +1,7 @@
#define E_COMP_WL
#include "e.h"
#include "e_mod_main.h"
#include "e_desktop_shell_protocol.h"
#include "xdg-shell-unstable-v5-server-protocol.h"
#define XDG_SERVER_VERSION 5

View File

@ -1,7 +1,7 @@
#define E_COMP_WL
#include "e.h"
#include "text-protocol.h"
#include "input-method-protocol.h"
#include "text-input-unstable-v1-server-protocol.h"
#include "input-method-unstable-v1-server-protocol.h"
typedef struct _E_Text_Input E_Text_Input;
typedef struct _E_Input_Method E_Input_Method;
@ -123,7 +123,7 @@ _e_text_input_deactivate(E_Text_Input *text_input, E_Input_Method *input_method)
_e_text_input_method_context_grab_set(input_method->context,
EINA_FALSE);
wl_input_method_send_deactivate(input_method->resource,
zwp_input_method_v1_send_deactivate(input_method->resource,
input_method->context->resource);
}
@ -132,7 +132,7 @@ _e_text_input_deactivate(E_Text_Input *text_input, E_Input_Method *input_method)
text_input->input_methods = eina_list_remove(text_input->input_methods, input_method);
wl_text_input_send_leave(text_input->resource);
zwp_text_input_v1_send_leave(text_input->resource);
}
}
@ -156,7 +156,7 @@ _e_text_input_method_context_cb_string_commit(struct wl_client *client EINA_UNUS
}
if (context->model)
wl_text_input_send_commit_string(context->model->resource,
zwp_text_input_v1_send_commit_string(context->model->resource,
serial, text);
}
@ -174,7 +174,7 @@ _e_text_input_method_context_cb_preedit_string(struct wl_client *client EINA_UNU
}
if (context->model)
wl_text_input_send_preedit_string(context->model->resource,
zwp_text_input_v1_send_preedit_string(context->model->resource,
serial, text, commit);
}
@ -192,7 +192,7 @@ _e_text_input_method_context_cb_preedit_styling(struct wl_client *client EINA_UN
}
if (context->model)
wl_text_input_send_preedit_styling(context->model->resource,
zwp_text_input_v1_send_preedit_styling(context->model->resource,
index, length, style);
}
@ -210,7 +210,7 @@ _e_text_input_method_context_cb_preedit_cursor(struct wl_client *client EINA_UNU
}
if (context->model)
wl_text_input_send_preedit_cursor(context->model->resource,
zwp_text_input_v1_send_preedit_cursor(context->model->resource,
cursor);
}
@ -228,7 +228,7 @@ _e_text_input_method_context_cb_surrounding_text_delete(struct wl_client *client
}
if (context->model)
wl_text_input_send_delete_surrounding_text(context->model->resource,
zwp_text_input_v1_send_delete_surrounding_text(context->model->resource,
index, length);
}
@ -246,7 +246,7 @@ _e_text_input_method_context_cb_cursor_position(struct wl_client *client EINA_UN
}
if (context->model)
wl_text_input_send_cursor_position(context->model->resource,
zwp_text_input_v1_send_cursor_position(context->model->resource,
index, anchor);
}
@ -264,7 +264,7 @@ _e_text_input_method_context_cb_modifiers_map(struct wl_client *client EINA_UNUS
}
if (context->model)
wl_text_input_send_modifiers_map(context->model->resource, map);
zwp_text_input_v1_send_modifiers_map(context->model->resource, map);
}
static void
@ -281,7 +281,7 @@ _e_text_input_method_context_cb_keysym(struct wl_client *client EINA_UNUSED, str
}
if (context->model)
wl_text_input_send_keysym(context->model->resource,
zwp_text_input_v1_send_keysym(context->model->resource,
serial, time, sym, state, modifiers);
}
@ -359,7 +359,7 @@ _e_text_input_method_context_cb_language(struct wl_client *client EINA_UNUSED, s
}
if (context->model)
wl_text_input_send_language(context->model->resource,
zwp_text_input_v1_send_language(context->model->resource,
serial, language);
}
@ -377,11 +377,11 @@ _e_text_input_method_context_cb_text_direction(struct wl_client *client EINA_UNU
}
if (context->model)
wl_text_input_send_text_direction(context->model->resource,
zwp_text_input_v1_send_text_direction(context->model->resource,
serial, direction);
}
static const struct wl_input_method_context_interface _e_text_input_method_context_implementation = {
static const struct zwp_input_method_context_v1_interface _e_text_input_method_context_implementation = {
_e_text_input_method_context_cb_destroy,
_e_text_input_method_context_cb_string_commit,
_e_text_input_method_context_cb_preedit_string,
@ -492,7 +492,7 @@ _e_text_input_cb_activate(struct wl_client *client, struct wl_resource *resource
context->resource =
wl_resource_create(wl_resource_get_client(input_method->resource),
&wl_input_method_context_interface, 1, 0);
&zwp_input_method_context_v1_interface, 1, 0);
wl_resource_set_implementation(context->resource,
&_e_text_input_method_context_implementation,
context, _e_text_input_method_context_cb_resource_destroy);
@ -501,13 +501,13 @@ _e_text_input_cb_activate(struct wl_client *client, struct wl_resource *resource
context->input_method = input_method;
input_method->context = context;
wl_input_method_send_activate(input_method->resource, context->resource);
zwp_input_method_v1_send_activate(input_method->resource, context->resource);
}
if (text_input->input_panel_visible)
_e_text_input_event_visible_change_send(EINA_TRUE);
wl_text_input_send_enter(text_input->resource, surface);
zwp_text_input_v1_send_enter(text_input->resource, surface);
}
static void
@ -606,7 +606,7 @@ _e_text_input_cb_reset(struct wl_client *client EINA_UNUSED, struct wl_resource
EINA_LIST_FOREACH(text_input->input_methods, l, input_method)
{
if (!input_method->context) continue;
wl_input_method_context_send_reset(input_method->context->resource);
zwp_input_method_context_v1_send_reset(input_method->context->resource);
}
}
@ -628,7 +628,7 @@ _e_text_input_cb_surrounding_text_set(struct wl_client *client EINA_UNUSED, stru
EINA_LIST_FOREACH(text_input->input_methods, l, input_method)
{
if (!input_method->context) continue;
wl_input_method_context_send_surrounding_text(input_method->context->resource,
zwp_input_method_context_v1_send_surrounding_text(input_method->context->resource,
text, cursor, anchor);
}
}
@ -651,7 +651,7 @@ _e_text_input_cb_content_type_set(struct wl_client *client EINA_UNUSED, struct w
EINA_LIST_FOREACH(text_input->input_methods, l, input_method)
{
if (!input_method->context) continue;
wl_input_method_context_send_content_type(input_method->context->resource,
zwp_input_method_context_v1_send_content_type(input_method->context->resource,
hint, purpose);
}
}
@ -692,7 +692,7 @@ _e_text_input_cb_preferred_language_set(struct wl_client *client EINA_UNUSED, st
EINA_LIST_FOREACH(text_input->input_methods, l, input_method)
{
if (!input_method->context) continue;
wl_input_method_context_send_preferred_language(input_method->context->resource,
zwp_input_method_context_v1_send_preferred_language(input_method->context->resource,
language);
}
}
@ -715,7 +715,7 @@ _e_text_input_cb_state_commit(struct wl_client *client EINA_UNUSED, struct wl_re
EINA_LIST_FOREACH(text_input->input_methods, l, input_method)
{
if (!input_method->context) continue;
wl_input_method_context_send_commit_state(input_method->context->resource, serial);
zwp_input_method_context_v1_send_commit_state(input_method->context->resource, serial);
}
}
@ -737,12 +737,12 @@ _e_text_input_cb_action_invoke(struct wl_client *client EINA_UNUSED, struct wl_r
EINA_LIST_FOREACH(text_input->input_methods, l, input_method)
{
if (!input_method->context) continue;
wl_input_method_context_send_invoke_action(input_method->context->resource,
zwp_input_method_context_v1_send_invoke_action(input_method->context->resource,
button, index);
}
}
static const struct wl_text_input_interface _e_text_input_implementation = {
static const struct zwp_text_input_v1_interface _e_text_input_implementation = {
_e_text_input_cb_activate,
_e_text_input_cb_deactivate,
_e_text_input_cb_input_panel_show,
@ -791,7 +791,7 @@ _e_text_input_manager_cb_text_input_create(struct wl_client *client, struct wl_r
}
text_input->resource = wl_resource_create(client,
&wl_text_input_interface,
&zwp_text_input_v1_interface,
1, id);
if (!text_input->resource)
{
@ -805,7 +805,7 @@ _e_text_input_manager_cb_text_input_create(struct wl_client *client, struct wl_r
text_input, _e_text_input_cb_destroy);
}
static const struct wl_text_input_manager_interface _e_text_input_manager_implementation = {
static const struct zwp_text_input_manager_v1_interface _e_text_input_manager_implementation = {
_e_text_input_manager_cb_text_input_create
};
@ -814,7 +814,7 @@ _e_text_cb_bind_text_input_manager(struct wl_client *client, void *data EINA_UNU
{
struct wl_resource *resource;
resource = wl_resource_create(client, &wl_text_input_manager_interface, 1, id);
resource = wl_resource_create(client, &zwp_text_input_manager_v1_interface, 1, id);
if (!resource)
{
wl_client_post_no_memory(client);
@ -859,7 +859,7 @@ _e_text_cb_bind_input_method(struct wl_client *client, void *data EINA_UNUSED, u
struct wl_resource *resource;
pid_t pid;
resource = wl_resource_create(client, &wl_input_method_interface, 1, id);
resource = wl_resource_create(client, &zwp_input_method_v1_interface, 1, id);
if (!resource)
{
wl_client_post_no_memory(client);
@ -915,7 +915,7 @@ e_modapi_init(E_Module *m)
{
// FIXME: create only one input method object per seat.
e_comp->wl_comp_data->seat.im.global =
wl_global_create(e_comp->wl_comp_data->wl.disp, &wl_input_method_interface, 1,
wl_global_create(e_comp->wl_comp_data->wl.disp, &zwp_input_method_v1_interface, 1,
NULL, _e_text_cb_bind_input_method);
if (!e_comp->wl_comp_data->seat.im.global)
{
@ -924,7 +924,7 @@ e_modapi_init(E_Module *m)
}
text_input_manager_global =
wl_global_create(e_comp->wl_comp_data->wl.disp, &wl_text_input_manager_interface, 1,
wl_global_create(e_comp->wl_comp_data->wl.disp, &zwp_text_input_manager_v1_interface, 1,
NULL, _e_text_cb_bind_text_input_manager);
if (!text_input_manager_global)
{

View File

@ -1,114 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_input_method_context_interface;
extern const struct wl_interface wl_input_panel_surface_interface;
extern const struct wl_interface wl_keyboard_interface;
extern const struct wl_interface wl_output_interface;
extern const struct wl_interface wl_surface_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
NULL,
NULL,
&wl_keyboard_interface,
&wl_input_method_context_interface,
&wl_input_method_context_interface,
&wl_input_panel_surface_interface,
&wl_surface_interface,
&wl_output_interface,
NULL,
};
static const struct wl_message wl_input_method_context_requests[] = {
{ "destroy", "", types + 0 },
{ "commit_string", "us", types + 0 },
{ "preedit_string", "uss", types + 0 },
{ "preedit_styling", "uuu", types + 0 },
{ "preedit_cursor", "i", types + 0 },
{ "delete_surrounding_text", "iu", types + 0 },
{ "cursor_position", "ii", types + 0 },
{ "modifiers_map", "a", types + 0 },
{ "keysym", "uuuuu", types + 0 },
{ "grab_keyboard", "n", types + 5 },
{ "key", "uuuu", types + 0 },
{ "modifiers", "uuuuu", types + 0 },
{ "language", "us", types + 0 },
{ "text_direction", "uu", types + 0 },
};
static const struct wl_message wl_input_method_context_events[] = {
{ "surrounding_text", "suu", types + 0 },
{ "reset", "", types + 0 },
{ "content_type", "uu", types + 0 },
{ "invoke_action", "uu", types + 0 },
{ "commit_state", "u", types + 0 },
{ "preferred_language", "s", types + 0 },
};
WL_EXPORT const struct wl_interface wl_input_method_context_interface = {
"wl_input_method_context", 1,
14, wl_input_method_context_requests,
6, wl_input_method_context_events,
};
static const struct wl_message wl_input_method_events[] = {
{ "activate", "n", types + 6 },
{ "deactivate", "o", types + 7 },
};
WL_EXPORT const struct wl_interface wl_input_method_interface = {
"wl_input_method", 1,
0, NULL,
2, wl_input_method_events,
};
static const struct wl_message wl_input_panel_requests[] = {
{ "get_input_panel_surface", "no", types + 8 },
};
WL_EXPORT const struct wl_interface wl_input_panel_interface = {
"wl_input_panel", 1,
1, wl_input_panel_requests,
0, NULL,
};
static const struct wl_message wl_input_panel_surface_requests[] = {
{ "set_toplevel", "ou", types + 10 },
{ "set_overlay_panel", "", types + 0 },
};
WL_EXPORT const struct wl_interface wl_input_panel_surface_interface = {
"wl_input_panel_surface", 1,
2, wl_input_panel_surface_requests,
0, NULL,
};

View File

@ -1,418 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef INPUT_METHOD_SERVER_PROTOCOL_H
#define INPUT_METHOD_SERVER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
struct wl_client;
struct wl_resource;
struct wl_input_method_context;
struct wl_input_method;
struct wl_input_panel;
struct wl_input_panel_surface;
extern const struct wl_interface wl_input_method_context_interface;
extern const struct wl_interface wl_input_method_interface;
extern const struct wl_interface wl_input_panel_interface;
extern const struct wl_interface wl_input_panel_surface_interface;
/**
* wl_input_method_context - input method context
* @destroy: (none)
* @commit_string: commit string
* @preedit_string: pre-edit string
* @preedit_styling: pre-edit styling
* @preedit_cursor: pre-edit cursor
* @delete_surrounding_text: delete text
* @cursor_position: set cursor to a new position
* @modifiers_map: (none)
* @keysym: keysym
* @grab_keyboard: grab hardware keyboard
* @key: forward key event
* @modifiers: forward modifiers event
* @language: (none)
* @text_direction: (none)
*
* Corresponds to a text model on input method side. An input method
* context is created on text model activation on the input method side. It
* allows to receive information about the text model from the application
* via events. Input method contexts do not keep state after deactivation
* and should be destroyed after deactivation is handled.
*
* Text is generally UTF-8 encoded, indices and lengths are in bytes.
*
* Serials are used to synchronize the state between the text input and an
* input method. New serials are sent by the text input in the commit_state
* request and are used by the input method to indicate the known text
* input state in events like preedit_string, commit_string, and keysym.
* The text input can then ignore events from the input method which are
* based on an outdated state (for example after a reset).
*/
struct wl_input_method_context_interface {
/**
* destroy - (none)
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* commit_string - commit string
* @serial: serial of the latest known text input state
* @text: (none)
*
* Send the commit string text for insertion to the application.
*
* The text to commit could be either just a single character after
* a key press or the result of some composing (pre-edit). It could
* be also an empty text when some text should be removed (see
* delete_surrounding_text) or when the input cursor should be
* moved (see cursor_position).
*
* Any previously set composing text will be removed.
*/
void (*commit_string)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
const char *text);
/**
* preedit_string - pre-edit string
* @serial: serial of the latest known text input state
* @text: (none)
* @commit: (none)
*
* Send the pre-edit string text to the application text input.
*
* The commit text can be used to replace the preedit text on reset
* (for example on unfocus).
*
* Also previously sent preedit_style and preedit_cursor requests
* are processed bt the text_input also.
*/
void (*preedit_string)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
const char *text,
const char *commit);
/**
* preedit_styling - pre-edit styling
* @index: (none)
* @length: (none)
* @style: (none)
*
* Sets styling information on composing text. The style is
* applied for length in bytes from index relative to the beginning
* of the composing text (as byte offset). Multiple styles can be
* applied to a composing text.
*
* This request should be sent before sending preedit_string
* request.
*/
void (*preedit_styling)(struct wl_client *client,
struct wl_resource *resource,
uint32_t index,
uint32_t length,
uint32_t style);
/**
* preedit_cursor - pre-edit cursor
* @index: (none)
*
* Sets the cursor position inside the composing text (as byte
* offset) relative to the start of the composing text.
*
* When index is negative no cursor should be displayed.
*
* This request should be sent before sending preedit_string
* request.
*/
void (*preedit_cursor)(struct wl_client *client,
struct wl_resource *resource,
int32_t index);
/**
* delete_surrounding_text - delete text
* @index: (none)
* @length: (none)
*
*
*
* This request will be handled on text_input side as part of a
* directly following commit_string request.
*/
void (*delete_surrounding_text)(struct wl_client *client,
struct wl_resource *resource,
int32_t index,
uint32_t length);
/**
* cursor_position - set cursor to a new position
* @index: (none)
* @anchor: (none)
*
* Sets the cursor and anchor to a new position. Index is the new
* cursor position in bytes (when >= 0 relative to the end of
* inserted text else relative to beginning of inserted text).
* Anchor is the new anchor position in bytes (when >= 0 relative
* to the end of inserted text, else relative to beginning of
* inserted text). When there should be no selected text anchor
* should be the same as index.
*
* This request will be handled on text_input side as part of a
* directly following commit_string request.
*/
void (*cursor_position)(struct wl_client *client,
struct wl_resource *resource,
int32_t index,
int32_t anchor);
/**
* modifiers_map - (none)
* @map: (none)
*/
void (*modifiers_map)(struct wl_client *client,
struct wl_resource *resource,
struct wl_array *map);
/**
* keysym - keysym
* @serial: serial of the latest known text input state
* @time: (none)
* @sym: (none)
* @state: (none)
* @modifiers: (none)
*
* Notify when a key event was sent. Key events should not be
* used for normal text input operations, which should be done with
* commit_string, delete_surrounfing_text, etc. The key event
* follows the wl_keyboard key event convention. Sym is a XKB
* keysym, state a wl_keyboard key_state.
*/
void (*keysym)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t time,
uint32_t sym,
uint32_t state,
uint32_t modifiers);
/**
* grab_keyboard - grab hardware keyboard
* @keyboard: (none)
*
* Allows an input method to receive hardware keyboard input and
* process key events to generate text events (with pre-edit) over
* the wire. This allows input methods which compose multiple key
* events for inputting text like it is done for CJK languages.
*/
void (*grab_keyboard)(struct wl_client *client,
struct wl_resource *resource,
uint32_t keyboard);
/**
* key - forward key event
* @serial: serial from wl_keyboard::key
* @time: time from wl_keyboard::key
* @key: key from wl_keyboard::key
* @state: state from wl_keyboard::key
*
* Should be used when filtering key events with grab_keyboard.
*
* When the wl_keyboard::key event is not processed by the input
* method itself and should be sent to the client instead, forward
* it with this request. The arguments should be the ones from the
* wl_keyboard::key event.
*
* For generating custom key events use the keysym request instead.
*/
void (*key)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t time,
uint32_t key,
uint32_t state);
/**
* modifiers - forward modifiers event
* @serial: serial from wl_keyboard::modifiers
* @mods_depressed: mods_depressed from wl_keyboard::modifiers
* @mods_latched: mods_latched from wl_keyboard::modifiers
* @mods_locked: mods_locked from wl_keyboard::modifiers
* @group: group from wl_keyboard::modifiers
*
* Should be used when filtering key events with grab_keyboard.
*
* When the wl_keyboard::modifiers event should be also send to the
* client, forward it with this request. The arguments should be
* the ones from the wl_keyboard::modifiers event.
*/
void (*modifiers)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t mods_depressed,
uint32_t mods_latched,
uint32_t mods_locked,
uint32_t group);
/**
* language - (none)
* @serial: serial of the latest known text input state
* @language: (none)
*/
void (*language)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
const char *language);
/**
* text_direction - (none)
* @serial: serial of the latest known text input state
* @direction: (none)
*/
void (*text_direction)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t direction);
};
#define WL_INPUT_METHOD_CONTEXT_SURROUNDING_TEXT 0
#define WL_INPUT_METHOD_CONTEXT_RESET 1
#define WL_INPUT_METHOD_CONTEXT_CONTENT_TYPE 2
#define WL_INPUT_METHOD_CONTEXT_INVOKE_ACTION 3
#define WL_INPUT_METHOD_CONTEXT_COMMIT_STATE 4
#define WL_INPUT_METHOD_CONTEXT_PREFERRED_LANGUAGE 5
#define WL_INPUT_METHOD_CONTEXT_SURROUNDING_TEXT_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_RESET_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_CONTENT_TYPE_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_INVOKE_ACTION_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_COMMIT_STATE_SINCE_VERSION 1
#define WL_INPUT_METHOD_CONTEXT_PREFERRED_LANGUAGE_SINCE_VERSION 1
static inline void
wl_input_method_context_send_surrounding_text(struct wl_resource *resource_, const char *text, uint32_t cursor, uint32_t anchor)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_SURROUNDING_TEXT, text, cursor, anchor);
}
static inline void
wl_input_method_context_send_reset(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_RESET);
}
static inline void
wl_input_method_context_send_content_type(struct wl_resource *resource_, uint32_t hint, uint32_t purpose)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_CONTENT_TYPE, hint, purpose);
}
static inline void
wl_input_method_context_send_invoke_action(struct wl_resource *resource_, uint32_t button, uint32_t index)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_INVOKE_ACTION, button, index);
}
static inline void
wl_input_method_context_send_commit_state(struct wl_resource *resource_, uint32_t serial)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_COMMIT_STATE, serial);
}
static inline void
wl_input_method_context_send_preferred_language(struct wl_resource *resource_, const char *language)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_CONTEXT_PREFERRED_LANGUAGE, language);
}
#define WL_INPUT_METHOD_ACTIVATE 0
#define WL_INPUT_METHOD_DEACTIVATE 1
#define WL_INPUT_METHOD_ACTIVATE_SINCE_VERSION 1
#define WL_INPUT_METHOD_DEACTIVATE_SINCE_VERSION 1
static inline void
wl_input_method_send_activate(struct wl_resource *resource_, struct wl_resource *id)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_ACTIVATE, id);
}
static inline void
wl_input_method_send_deactivate(struct wl_resource *resource_, struct wl_resource *context)
{
wl_resource_post_event(resource_, WL_INPUT_METHOD_DEACTIVATE, context);
}
/**
* wl_input_panel - interface for implementing keyboards
* @get_input_panel_surface: (none)
*
* Only one client can bind this interface at a time.
*/
struct wl_input_panel_interface {
/**
* get_input_panel_surface - (none)
* @id: (none)
* @surface: (none)
*/
void (*get_input_panel_surface)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface);
};
#ifndef WL_INPUT_PANEL_SURFACE_POSITION_ENUM
#define WL_INPUT_PANEL_SURFACE_POSITION_ENUM
enum wl_input_panel_surface_position {
WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM = 0,
};
#endif /* WL_INPUT_PANEL_SURFACE_POSITION_ENUM */
struct wl_input_panel_surface_interface {
/**
* set_toplevel - set the surface type as a keyboard
* @output: (none)
* @position: (none)
*
* A keyboard surface is only shown, when a text model is active
*/
void (*set_toplevel)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *output,
uint32_t position);
/**
* set_overlay_panel - set the surface type as an overlay panel
*
* An overlay panel is shown near the input cursor above the
* application window when a text model is active.
*/
void (*set_overlay_panel)(struct wl_client *client,
struct wl_resource *resource);
};
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,92 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface wl_text_input_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
NULL,
NULL,
&wl_seat_interface,
&wl_surface_interface,
&wl_seat_interface,
&wl_surface_interface,
&wl_text_input_interface,
};
static const struct wl_message wl_text_input_requests[] = {
{ "activate", "oo", types + 5 },
{ "deactivate", "o", types + 7 },
{ "show_input_panel", "", types + 0 },
{ "hide_input_panel", "", types + 0 },
{ "reset", "", types + 0 },
{ "set_surrounding_text", "suu", types + 0 },
{ "set_content_type", "uu", types + 0 },
{ "set_cursor_rectangle", "iiii", types + 0 },
{ "set_preferred_language", "s", types + 0 },
{ "commit_state", "u", types + 0 },
{ "invoke_action", "uu", types + 0 },
};
static const struct wl_message wl_text_input_events[] = {
{ "enter", "o", types + 8 },
{ "leave", "", types + 0 },
{ "modifiers_map", "a", types + 0 },
{ "input_panel_state", "u", types + 0 },
{ "preedit_string", "uss", types + 0 },
{ "preedit_styling", "uuu", types + 0 },
{ "preedit_cursor", "i", types + 0 },
{ "commit_string", "us", types + 0 },
{ "cursor_position", "ii", types + 0 },
{ "delete_surrounding_text", "iu", types + 0 },
{ "keysym", "uuuuu", types + 0 },
{ "language", "us", types + 0 },
{ "text_direction", "uu", types + 0 },
};
WL_EXPORT const struct wl_interface wl_text_input_interface = {
"wl_text_input", 1,
11, wl_text_input_requests,
13, wl_text_input_events,
};
static const struct wl_message wl_text_input_manager_requests[] = {
{ "create_text_input", "n", types + 9 },
};
WL_EXPORT const struct wl_interface wl_text_input_manager_interface = {
"wl_text_input_manager", 1,
1, wl_text_input_manager_requests,
0, NULL,
};

View File

@ -1,448 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef TEXT_SERVER_PROTOCOL_H
#define TEXT_SERVER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-util.h"
struct wl_client;
struct wl_resource;
struct wl_text_input;
struct wl_text_input_manager;
extern const struct wl_interface wl_text_input_interface;
extern const struct wl_interface wl_text_input_manager_interface;
#ifndef WL_TEXT_INPUT_CONTENT_HINT_ENUM
#define WL_TEXT_INPUT_CONTENT_HINT_ENUM
/**
* wl_text_input_content_hint - content hint
* @WL_TEXT_INPUT_CONTENT_HINT_NONE: no special behaviour
* @WL_TEXT_INPUT_CONTENT_HINT_DEFAULT: auto completion, correction and
* capitalization
* @WL_TEXT_INPUT_CONTENT_HINT_PASSWORD: hidden and sensitive text
* @WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION: suggest word completions
* @WL_TEXT_INPUT_CONTENT_HINT_AUTO_CORRECTION: suggest word corrections
* @WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION: switch to uppercase
* letters at the start of a sentence
* @WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE: prefer lowercase letters
* @WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE: prefer uppercase letters
* @WL_TEXT_INPUT_CONTENT_HINT_TITLECASE: prefer casing for titles and
* headings (can be language dependent)
* @WL_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT: characters should be hidden
* @WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA: typed text should not be
* stored
* @WL_TEXT_INPUT_CONTENT_HINT_LATIN: just latin characters should be
* entered
* @WL_TEXT_INPUT_CONTENT_HINT_MULTILINE: the text input is multiline
*
* Content hint is a bitmask to allow to modify the behavior of the text
* input.
*/
enum wl_text_input_content_hint {
WL_TEXT_INPUT_CONTENT_HINT_NONE = 0x0,
WL_TEXT_INPUT_CONTENT_HINT_DEFAULT = 0x7,
WL_TEXT_INPUT_CONTENT_HINT_PASSWORD = 0xc0,
WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION = 0x1,
WL_TEXT_INPUT_CONTENT_HINT_AUTO_CORRECTION = 0x2,
WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4,
WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE = 0x8,
WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE = 0x10,
WL_TEXT_INPUT_CONTENT_HINT_TITLECASE = 0x20,
WL_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT = 0x40,
WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA = 0x80,
WL_TEXT_INPUT_CONTENT_HINT_LATIN = 0x100,
WL_TEXT_INPUT_CONTENT_HINT_MULTILINE = 0x200,
};
#endif /* WL_TEXT_INPUT_CONTENT_HINT_ENUM */
#ifndef WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM
#define WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM
/**
* wl_text_input_content_purpose - content purpose
* @WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL: default input, allowing all
* characters
* @WL_TEXT_INPUT_CONTENT_PURPOSE_ALPHA: allow only alphabetic characters
* @WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS: allow only digits
* @WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER: input a number (including
* decimal separator and sign)
* @WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE: input a phone number
* @WL_TEXT_INPUT_CONTENT_PURPOSE_URL: input an URL
* @WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL: input an email address
* @WL_TEXT_INPUT_CONTENT_PURPOSE_NAME: input a name of a person
* @WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD: input a password (combine
* with password or sensitive_data hint)
* @WL_TEXT_INPUT_CONTENT_PURPOSE_DATE: input a date
* @WL_TEXT_INPUT_CONTENT_PURPOSE_TIME: input a time
* @WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME: input a date and time
* @WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL: input for a terminal
*
* The content purpose allows to specify the primary purpose of a text
* input.
*
* This allows an input method to show special purpose input panels with
* extra characters or to disallow some characters.
*/
enum wl_text_input_content_purpose {
WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL = 0,
WL_TEXT_INPUT_CONTENT_PURPOSE_ALPHA = 1,
WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS = 2,
WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER = 3,
WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE = 4,
WL_TEXT_INPUT_CONTENT_PURPOSE_URL = 5,
WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL = 6,
WL_TEXT_INPUT_CONTENT_PURPOSE_NAME = 7,
WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD = 8,
WL_TEXT_INPUT_CONTENT_PURPOSE_DATE = 9,
WL_TEXT_INPUT_CONTENT_PURPOSE_TIME = 10,
WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME = 11,
WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL = 12,
};
#endif /* WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM */
#ifndef WL_TEXT_INPUT_PREEDIT_STYLE_ENUM
#define WL_TEXT_INPUT_PREEDIT_STYLE_ENUM
enum wl_text_input_preedit_style {
WL_TEXT_INPUT_PREEDIT_STYLE_DEFAULT = 0,
WL_TEXT_INPUT_PREEDIT_STYLE_NONE = 1,
WL_TEXT_INPUT_PREEDIT_STYLE_ACTIVE = 2,
WL_TEXT_INPUT_PREEDIT_STYLE_INACTIVE = 3,
WL_TEXT_INPUT_PREEDIT_STYLE_HIGHLIGHT = 4,
WL_TEXT_INPUT_PREEDIT_STYLE_UNDERLINE = 5,
WL_TEXT_INPUT_PREEDIT_STYLE_SELECTION = 6,
WL_TEXT_INPUT_PREEDIT_STYLE_INCORRECT = 7,
};
#endif /* WL_TEXT_INPUT_PREEDIT_STYLE_ENUM */
#ifndef WL_TEXT_INPUT_TEXT_DIRECTION_ENUM
#define WL_TEXT_INPUT_TEXT_DIRECTION_ENUM
enum wl_text_input_text_direction {
WL_TEXT_INPUT_TEXT_DIRECTION_AUTO = 0,
WL_TEXT_INPUT_TEXT_DIRECTION_LTR = 1,
WL_TEXT_INPUT_TEXT_DIRECTION_RTL = 2,
};
#endif /* WL_TEXT_INPUT_TEXT_DIRECTION_ENUM */
/**
* wl_text_input - text input
* @activate: request activation
* @deactivate: request deactivation
* @show_input_panel: show input panels
* @hide_input_panel: hide input panels
* @reset: reset
* @set_surrounding_text: sets the surrounding text
* @set_content_type: set content purpose and hint
* @set_cursor_rectangle: (none)
* @set_preferred_language: sets preferred language
* @commit_state: (none)
* @invoke_action: (none)
*
* An object used for text input. Adds support for text input and input
* methods to applications. A text-input object is created from a
* wl_text_input_manager and corresponds typically to a text entry in an
* application. Requests are used to activate/deactivate the text-input
* object and set state information like surrounding and selected text or
* the content type. The information about entered text is sent to the
* text-input object via the pre-edit and commit events. Using this
* interface removes the need for applications to directly process hardware
* key events and compose text out of them.
*
* Text is generally UTF-8 encoded, indices and lengths are in bytes.
*
* Serials are used to synchronize the state between the text input and an
* input method. New serials are sent by the text input in the commit_state
* request and are used by the input method to indicate the known text
* input state in events like preedit_string, commit_string, and keysym.
* The text input can then ignore events from the input method which are
* based on an outdated state (for example after a reset).
*/
struct wl_text_input_interface {
/**
* activate - request activation
* @seat: (none)
* @surface: (none)
*
* Requests the text-input object to be activated (typically when
* the text entry gets focus). The seat argument is a wl_seat which
* maintains the focus for this activation. The surface argument is
* a wl_surface assigned to the text-input object and tracked for
* focus lost. The enter event is emitted on successful activation.
*/
void (*activate)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *seat,
struct wl_resource *surface);
/**
* deactivate - request deactivation
* @seat: (none)
*
* Requests the text-input object to be deactivated (typically
* when the text entry lost focus). The seat argument is a wl_seat
* which was used for activation.
*/
void (*deactivate)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *seat);
/**
* show_input_panel - show input panels
*
* Requests input panels (virtual keyboard) to show.
*/
void (*show_input_panel)(struct wl_client *client,
struct wl_resource *resource);
/**
* hide_input_panel - hide input panels
*
* Requests input panels (virtual keyboard) to hide.
*/
void (*hide_input_panel)(struct wl_client *client,
struct wl_resource *resource);
/**
* reset - reset
*
* Should be called by an editor widget when the input state
* should be reset, for example after the text was changed outside
* of the normal input method flow.
*/
void (*reset)(struct wl_client *client,
struct wl_resource *resource);
/**
* set_surrounding_text - sets the surrounding text
* @text: (none)
* @cursor: (none)
* @anchor: (none)
*
* Sets the plain surrounding text around the input position.
* Text is UTF-8 encoded. Cursor is the byte offset within the
* surrounding text. Anchor is the byte offset of the selection
* anchor within the surrounding text. If there is no selected text
* anchor is the same as cursor.
*/
void (*set_surrounding_text)(struct wl_client *client,
struct wl_resource *resource,
const char *text,
uint32_t cursor,
uint32_t anchor);
/**
* set_content_type - set content purpose and hint
* @hint: (none)
* @purpose: (none)
*
* Sets the content purpose and content hint. While the purpose
* is the basic purpose of an input field, the hint flags allow to
* modify some of the behavior.
*
* When no content type is explicitly set, a normal content purpose
* with default hints (auto completion, auto correction, auto
* capitalization) should be assumed.
*/
void (*set_content_type)(struct wl_client *client,
struct wl_resource *resource,
uint32_t hint,
uint32_t purpose);
/**
* set_cursor_rectangle - (none)
* @x: (none)
* @y: (none)
* @width: (none)
* @height: (none)
*/
void (*set_cursor_rectangle)(struct wl_client *client,
struct wl_resource *resource,
int32_t x,
int32_t y,
int32_t width,
int32_t height);
/**
* set_preferred_language - sets preferred language
* @language: (none)
*
* Sets a specific language. This allows for example a virtual
* keyboard to show a language specific layout. The "language"
* argument is a RFC-3066 format language tag.
*
* It could be used for example in a word processor to indicate
* language of currently edited document or in an instant message
* application which tracks languages of contacts.
*/
void (*set_preferred_language)(struct wl_client *client,
struct wl_resource *resource,
const char *language);
/**
* commit_state - (none)
* @serial: used to identify the known state
*/
void (*commit_state)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial);
/**
* invoke_action - (none)
* @button: (none)
* @index: (none)
*/
void (*invoke_action)(struct wl_client *client,
struct wl_resource *resource,
uint32_t button,
uint32_t index);
};
#define WL_TEXT_INPUT_ENTER 0
#define WL_TEXT_INPUT_LEAVE 1
#define WL_TEXT_INPUT_MODIFIERS_MAP 2
#define WL_TEXT_INPUT_INPUT_PANEL_STATE 3
#define WL_TEXT_INPUT_PREEDIT_STRING 4
#define WL_TEXT_INPUT_PREEDIT_STYLING 5
#define WL_TEXT_INPUT_PREEDIT_CURSOR 6
#define WL_TEXT_INPUT_COMMIT_STRING 7
#define WL_TEXT_INPUT_CURSOR_POSITION 8
#define WL_TEXT_INPUT_DELETE_SURROUNDING_TEXT 9
#define WL_TEXT_INPUT_KEYSYM 10
#define WL_TEXT_INPUT_LANGUAGE 11
#define WL_TEXT_INPUT_TEXT_DIRECTION 12
#define WL_TEXT_INPUT_ENTER_SINCE_VERSION 1
#define WL_TEXT_INPUT_LEAVE_SINCE_VERSION 1
#define WL_TEXT_INPUT_MODIFIERS_MAP_SINCE_VERSION 1
#define WL_TEXT_INPUT_INPUT_PANEL_STATE_SINCE_VERSION 1
#define WL_TEXT_INPUT_PREEDIT_STRING_SINCE_VERSION 1
#define WL_TEXT_INPUT_PREEDIT_STYLING_SINCE_VERSION 1
#define WL_TEXT_INPUT_PREEDIT_CURSOR_SINCE_VERSION 1
#define WL_TEXT_INPUT_COMMIT_STRING_SINCE_VERSION 1
#define WL_TEXT_INPUT_CURSOR_POSITION_SINCE_VERSION 1
#define WL_TEXT_INPUT_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1
#define WL_TEXT_INPUT_KEYSYM_SINCE_VERSION 1
#define WL_TEXT_INPUT_LANGUAGE_SINCE_VERSION 1
#define WL_TEXT_INPUT_TEXT_DIRECTION_SINCE_VERSION 1
static inline void
wl_text_input_send_enter(struct wl_resource *resource_, struct wl_resource *surface)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_ENTER, surface);
}
static inline void
wl_text_input_send_leave(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_LEAVE);
}
static inline void
wl_text_input_send_modifiers_map(struct wl_resource *resource_, struct wl_array *map)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_MODIFIERS_MAP, map);
}
static inline void
wl_text_input_send_input_panel_state(struct wl_resource *resource_, uint32_t state)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_INPUT_PANEL_STATE, state);
}
static inline void
wl_text_input_send_preedit_string(struct wl_resource *resource_, uint32_t serial, const char *text, const char *commit)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_PREEDIT_STRING, serial, text, commit);
}
static inline void
wl_text_input_send_preedit_styling(struct wl_resource *resource_, uint32_t index, uint32_t length, uint32_t style)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_PREEDIT_STYLING, index, length, style);
}
static inline void
wl_text_input_send_preedit_cursor(struct wl_resource *resource_, int32_t index)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_PREEDIT_CURSOR, index);
}
static inline void
wl_text_input_send_commit_string(struct wl_resource *resource_, uint32_t serial, const char *text)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_COMMIT_STRING, serial, text);
}
static inline void
wl_text_input_send_cursor_position(struct wl_resource *resource_, int32_t index, int32_t anchor)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_CURSOR_POSITION, index, anchor);
}
static inline void
wl_text_input_send_delete_surrounding_text(struct wl_resource *resource_, int32_t index, uint32_t length)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_DELETE_SURROUNDING_TEXT, index, length);
}
static inline void
wl_text_input_send_keysym(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_KEYSYM, serial, time, sym, state, modifiers);
}
static inline void
wl_text_input_send_language(struct wl_resource *resource_, uint32_t serial, const char *language)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_LANGUAGE, serial, language);
}
static inline void
wl_text_input_send_text_direction(struct wl_resource *resource_, uint32_t serial, uint32_t direction)
{
wl_resource_post_event(resource_, WL_TEXT_INPUT_TEXT_DIRECTION, serial, direction);
}
/**
* wl_text_input_manager - text input manager
* @create_text_input: create text input
*
* A factory for text-input objects. This object is a global singleton.
*/
struct wl_text_input_manager_interface {
/**
* create_text_input - create text input
* @id: (none)
*
* Creates a new text-input object.
*/
void (*create_text_input)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id);
};
#ifdef __cplusplus
}
#endif
#endif

View File

@ -2,8 +2,8 @@
#include "wkb-log.h"
#include "input-method-client-protocol.h"
#include "text-client-protocol.h"
#include "input-method-unstable-v1-client-protocol.h"
#include "text-input-unstable-v1-client-protocol.h"
struct weekeyboard
{
@ -15,10 +15,10 @@ struct weekeyboard
char **ignore_keys;
struct wl_surface *surface;
struct wl_input_panel *ip;
struct wl_input_method *im;
struct zwp_input_panel_v1 *ip;
struct zwp_input_method_v1 *im;
struct wl_output *output;
struct wl_input_method_context *im_ctx;
struct zwp_input_method_context_v1 *im_ctx;
char *surrounding_text;
char *preedit_str;
@ -80,8 +80,8 @@ _wkb_commit_preedit_str(struct weekeyboard *wkb)
if ((!wkb->preedit_str) || (strlen(wkb->preedit_str) == 0))
return;
wl_input_method_context_cursor_position(wkb->im_ctx, 0, 0);
wl_input_method_context_commit_string(wkb->im_ctx, wkb->serial,
zwp_input_method_context_v1_cursor_position(wkb->im_ctx, 0, 0);
zwp_input_method_context_v1_commit_string(wkb->im_ctx, wkb->serial,
wkb->preedit_str);
if (wkb->surrounding_text)
@ -109,15 +109,15 @@ _wkb_send_preedit_str(struct weekeyboard *wkb, int cursor)
unsigned int index = strlen(wkb->preedit_str);
if (wkb->preedit_style)
wl_input_method_context_preedit_styling(wkb->im_ctx, 0,
zwp_input_method_context_v1_preedit_styling(wkb->im_ctx, 0,
strlen(wkb->preedit_str),
wkb->preedit_style);
if (cursor > 0)
index = cursor;
wl_input_method_context_preedit_cursor(wkb->im_ctx, index);
wl_input_method_context_preedit_string(wkb->im_ctx, wkb->serial,
zwp_input_method_context_v1_preedit_cursor(wkb->im_ctx, index);
zwp_input_method_context_v1_preedit_string(wkb->im_ctx, wkb->serial,
wkb->preedit_str, wkb->preedit_str);
}
@ -185,8 +185,8 @@ _cb_wkb_on_key_down(void *data, Evas_Object *obj EINA_UNUSED, const char *emissi
{
if (strlen(wkb->preedit_str) == 0)
{
wl_input_method_context_delete_surrounding_text(wkb->im_ctx, -1, 1);
wl_input_method_context_commit_string(wkb->im_ctx, wkb->serial, "");
zwp_input_method_context_v1_delete_surrounding_text(wkb->im_ctx, -1, 1);
zwp_input_method_context_v1_commit_string(wkb->im_ctx, wkb->serial, "");
}
else
{
@ -199,7 +199,7 @@ _cb_wkb_on_key_down(void *data, Evas_Object *obj EINA_UNUSED, const char *emissi
else if (eina_streq(key, "enter"))
{
_wkb_commit_preedit_str(wkb);
wl_input_method_context_keysym(wkb->im_ctx, wkb->serial, 0,
zwp_input_method_context_v1_keysym(wkb->im_ctx, wkb->serial, 0,
XKB_KEY_Return,
WL_KEYBOARD_KEY_STATE_PRESSED, 0);
goto end;
@ -318,7 +318,7 @@ end:
}
static void
_wkb_im_ctx_surrounding_text(void *data, struct wl_input_method_context *im_ctx, const char *text, uint32_t cursor, uint32_t anchor)
_wkb_im_ctx_surrounding_text(void *data, struct zwp_input_method_context_v1 *im_ctx, const char *text, uint32_t cursor, uint32_t anchor)
{
struct weekeyboard *wkb = data;
@ -340,7 +340,7 @@ _wkb_im_ctx_surrounding_text(void *data, struct wl_input_method_context *im_ctx,
}
static void
_wkb_im_ctx_reset(void *data, struct wl_input_method_context *im_ctx)
_wkb_im_ctx_reset(void *data, struct zwp_input_method_context_v1 *im_ctx)
{
struct weekeyboard *wkb = data;
@ -354,7 +354,7 @@ _wkb_im_ctx_reset(void *data, struct wl_input_method_context *im_ctx)
}
static void
_wkb_im_ctx_content_type(void *data, struct wl_input_method_context *im_ctx, uint32_t hint, uint32_t purpose)
_wkb_im_ctx_content_type(void *data, struct zwp_input_method_context_v1 *im_ctx, uint32_t hint, uint32_t purpose)
{
struct weekeyboard *wkb = data;
@ -365,8 +365,8 @@ _wkb_im_ctx_content_type(void *data, struct wl_input_method_context *im_ctx, uin
switch (purpose)
{
case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS:
case WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER:
case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DIGITS:
case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NUMBER:
{
if (wkb->edje_obj)
edje_object_signal_emit(wkb->edje_obj, "show,numeric", "");
@ -386,7 +386,7 @@ _wkb_im_ctx_content_type(void *data, struct wl_input_method_context *im_ctx, uin
}
static void
_wkb_im_ctx_invoke_action(void *data, struct wl_input_method_context *im_ctx, uint32_t button, uint32_t index)
_wkb_im_ctx_invoke_action(void *data, struct zwp_input_method_context_v1 *im_ctx, uint32_t button, uint32_t index)
{
struct weekeyboard *wkb = data;
@ -399,7 +399,7 @@ _wkb_im_ctx_invoke_action(void *data, struct wl_input_method_context *im_ctx, ui
}
static void
_wkb_im_ctx_commit_state(void *data, struct wl_input_method_context *im_ctx, uint32_t serial)
_wkb_im_ctx_commit_state(void *data, struct zwp_input_method_context_v1 *im_ctx, uint32_t serial)
{
struct weekeyboard *wkb = data;
@ -410,13 +410,13 @@ _wkb_im_ctx_commit_state(void *data, struct wl_input_method_context *im_ctx, uin
wkb->serial = serial;
wl_input_method_context_language(im_ctx, wkb->serial, "en");
wl_input_method_context_text_direction(im_ctx, wkb->serial,
WL_TEXT_INPUT_TEXT_DIRECTION_LTR);
zwp_input_method_context_v1_language(im_ctx, wkb->serial, "en");
zwp_input_method_context_v1_text_direction(im_ctx, wkb->serial,
ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_LTR);
}
static void
_wkb_im_ctx_preferred_language(void *data, struct wl_input_method_context *im_ctx, const char *language)
_wkb_im_ctx_preferred_language(void *data, struct zwp_input_method_context_v1 *im_ctx, const char *language)
{
struct weekeyboard *wkb = data;
@ -434,7 +434,7 @@ _wkb_im_ctx_preferred_language(void *data, struct wl_input_method_context *im_ct
}
}
static const struct wl_input_method_context_listener wkb_im_context_listener = {
static const struct zwp_input_method_context_v1_listener wkb_im_context_listener = {
_wkb_im_ctx_surrounding_text,
_wkb_im_ctx_reset,
_wkb_im_ctx_content_type,
@ -444,7 +444,7 @@ static const struct wl_input_method_context_listener wkb_im_context_listener = {
};
static void
_wkb_im_activate(void *data, struct wl_input_method *input_method EINA_UNUSED, struct wl_input_method_context *im_ctx)
_wkb_im_activate(void *data, struct zwp_input_method_v1 *input_method EINA_UNUSED, struct zwp_input_method_context_v1 *im_ctx)
{
struct weekeyboard *wkb = data;
@ -453,12 +453,12 @@ _wkb_im_activate(void *data, struct wl_input_method *input_method EINA_UNUSED, s
// check if the UI is valid and draw it if not
_wkb_ui_setup(wkb);
E_FREE_FUNC(wkb->im_ctx, wl_input_method_context_destroy);
E_FREE_FUNC(wkb->im_ctx, zwp_input_method_context_v1_destroy);
free(wkb->preedit_str);
wkb->preedit_str = strdup("");
wkb->content_hint = WL_TEXT_INPUT_CONTENT_HINT_NONE;
wkb->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL;
wkb->content_hint = ZWP_TEXT_INPUT_V1_CONTENT_HINT_NONE;
wkb->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NORMAL;
free(wkb->language);
wkb->language = NULL;
@ -469,31 +469,31 @@ _wkb_im_activate(void *data, struct wl_input_method *input_method EINA_UNUSED, s
wkb->serial = 0;
wkb->im_ctx = im_ctx;
wl_input_method_context_add_listener(im_ctx, &wkb_im_context_listener, wkb);
zwp_input_method_context_v1_add_listener(im_ctx, &wkb_im_context_listener, wkb);
/* hard coded */
wl_input_method_context_language(im_ctx, wkb->serial, "en");
wl_input_method_context_text_direction(im_ctx, wkb->serial,
WL_TEXT_INPUT_TEXT_DIRECTION_LTR);
zwp_input_method_context_v1_language(im_ctx, wkb->serial, "en");
zwp_input_method_context_v1_text_direction(im_ctx, wkb->serial,
ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_LTR);
wkb->context_changed = EINA_TRUE;
evas_object_show(wkb->edje_obj);
}
static void
_wkb_im_deactivate(void *data, struct wl_input_method *input_method EINA_UNUSED, struct wl_input_method_context *im_ctx EINA_UNUSED)
_wkb_im_deactivate(void *data, struct zwp_input_method_v1 *input_method EINA_UNUSED, struct zwp_input_method_context_v1 *im_ctx EINA_UNUSED)
{
struct weekeyboard *wkb = data;
DBG("Deactivate");
E_FREE_FUNC(wkb->im_ctx, wl_input_method_context_destroy);
E_FREE_FUNC(wkb->im_ctx, zwp_input_method_context_v1_destroy);
if (wkb->edje_obj)
evas_object_hide(wkb->edje_obj);
}
static const struct wl_input_method_listener wkb_im_listener = {
static const struct zwp_input_method_v1_listener wkb_im_listener = {
_wkb_im_activate,
_wkb_im_deactivate
};
@ -504,7 +504,7 @@ _wkb_setup(struct weekeyboard *wkb)
Eina_Iterator *itr;
Ecore_Wl2_Global *global;
struct wl_registry *registry;
struct wl_input_panel_surface *ips;
struct zwp_input_panel_surface_v1 *ips;
void *data;
registry = e_comp_wl->wl.registry ?: ecore_wl2_display_registry_get(e_comp_wl->ewd);
@ -514,19 +514,19 @@ _wkb_setup(struct weekeyboard *wkb)
global = (Ecore_Wl2_Global *)data;
DBG("interface: <%s>", global->interface);
if (eina_streq(global->interface, "wl_input_panel"))
if (eina_streq(global->interface, "zwp_input_panel_v1"))
{
wkb->ip =
wl_registry_bind(registry, global->id,
&wl_input_panel_interface, 1);
DBG("binding wl_input_panel");
&zwp_input_panel_v1_interface, 1);
DBG("binding zwp_input_panel_v1");
}
else if (eina_streq(global->interface, "wl_input_method"))
else if (eina_streq(global->interface, "zwp_input_method_v1"))
{
wkb->im =
wl_registry_bind(registry, global->id,
&wl_input_method_interface, 1);
DBG("binding wl_input_method, id = %d", global->id);
&zwp_input_method_v1_interface, 1);
DBG("binding zwp_input_method_v1, id = %d", global->id);
}
else if (eina_streq(global->interface, "wl_output"))
{
@ -550,13 +550,13 @@ _wkb_setup(struct weekeyboard *wkb)
ecore_wl2_window_type_set(wkb->win, ECORE_WL2_WINDOW_TYPE_NONE);
wkb->surface = ecore_wl2_window_surface_get(wkb->win);
ips = wl_input_panel_get_input_panel_surface(wkb->ip, wkb->surface);
wl_input_panel_surface_set_toplevel(ips, wkb->output,
WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
ips = zwp_input_panel_v1_get_input_panel_surface(wkb->ip, wkb->surface);
zwp_input_panel_surface_v1_set_toplevel(ips, wkb->output,
ZWP_INPUT_PANEL_SURFACE_V1_POSITION_CENTER_BOTTOM);
/* Input method listener */
DBG("Adding wl_input_method listener");
wl_input_method_add_listener(wkb->im, &wkb_im_listener, wkb);
DBG("Adding zwp_input_method_v1 listener");
zwp_input_method_v1_add_listener(wkb->im, &wkb_im_listener, wkb);
wkb->edje_obj = NULL;
@ -595,7 +595,7 @@ _wkb_check_evas_engine(struct weekeyboard *wkb)
static void
_wkb_free(struct weekeyboard *wkb)
{
E_FREE_FUNC(wkb->im_ctx, wl_input_method_context_destroy);
E_FREE_FUNC(wkb->im_ctx, zwp_input_method_context_v1_destroy);
E_FREE_FUNC(wkb->edje_obj, evas_object_del);
if (wkb->ignore_keys)

View File

@ -1,439 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef INPUT_METHOD_CLIENT_PROTOCOL_H
#define INPUT_METHOD_CLIENT_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
struct wl_client;
struct wl_resource;
struct wl_input_method;
struct wl_input_method_context;
struct wl_input_panel;
struct wl_input_panel_surface;
struct wl_keyboard;
struct wl_output;
struct wl_surface;
extern const struct wl_interface wl_input_method_context_interface;
extern const struct wl_interface wl_input_method_interface;
extern const struct wl_interface wl_input_panel_interface;
extern const struct wl_interface wl_input_panel_surface_interface;
/**
* wl_input_method_context - input method context
* @surrounding_text: surrounding text event
* @reset: (none)
* @content_type: (none)
* @invoke_action: (none)
* @commit_state: (none)
* @preferred_language: (none)
*
* Corresponds to a text model on input method side. An input method
* context is created on text mode activation on the input method side. It
* allows to receive information about the text model from the application
* via events. Input method contexts do not keep state after deactivation
* and should be destroyed after deactivation is handled.
*
* Text is generally UTF-8 encoded, indices and lengths are in bytes.
*
* Serials are used to synchronize the state between the text input and an
* input method. New serials are sent by the text input in the commit_state
* request and are used by the input method to indicate the known text
* input state in events like preedit_string, commit_string, and keysym.
* The text input can then ignore events from the input method which are
* based on an outdated state (for example after a reset).
*/
struct wl_input_method_context_listener {
/**
* surrounding_text - surrounding text event
* @text: (none)
* @cursor: (none)
* @anchor: (none)
*
* The plain surrounding text around the input position. Cursor
* is the position in bytes within the surrounding text relative to
* the beginning of the text. Anchor is the position in bytes of
* the selection anchor within the surrounding text relative to the
* beginning of the text. If there is no selected text anchor is
* the same as cursor.
*/
void (*surrounding_text)(void *data,
struct wl_input_method_context *wl_input_method_context,
const char *text,
uint32_t cursor,
uint32_t anchor);
/**
* reset - (none)
*/
void (*reset)(void *data,
struct wl_input_method_context *wl_input_method_context);
/**
* content_type - (none)
* @hint: (none)
* @purpose: (none)
*/
void (*content_type)(void *data,
struct wl_input_method_context *wl_input_method_context,
uint32_t hint,
uint32_t purpose);
/**
* invoke_action - (none)
* @button: (none)
* @index: (none)
*/
void (*invoke_action)(void *data,
struct wl_input_method_context *wl_input_method_context,
uint32_t button,
uint32_t index);
/**
* commit_state - (none)
* @serial: serial of text input state
*/
void (*commit_state)(void *data,
struct wl_input_method_context *wl_input_method_context,
uint32_t serial);
/**
* preferred_language - (none)
* @language: (none)
*/
void (*preferred_language)(void *data,
struct wl_input_method_context *wl_input_method_context,
const char *language);
};
static inline int
wl_input_method_context_add_listener(struct wl_input_method_context *wl_input_method_context,
const struct wl_input_method_context_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) wl_input_method_context,
(void (**)(void)) listener, data);
}
#define WL_INPUT_METHOD_CONTEXT_DESTROY 0
#define WL_INPUT_METHOD_CONTEXT_COMMIT_STRING 1
#define WL_INPUT_METHOD_CONTEXT_PREEDIT_STRING 2
#define WL_INPUT_METHOD_CONTEXT_PREEDIT_STYLING 3
#define WL_INPUT_METHOD_CONTEXT_PREEDIT_CURSOR 4
#define WL_INPUT_METHOD_CONTEXT_DELETE_SURROUNDING_TEXT 5
#define WL_INPUT_METHOD_CONTEXT_CURSOR_POSITION 6
#define WL_INPUT_METHOD_CONTEXT_MODIFIERS_MAP 7
#define WL_INPUT_METHOD_CONTEXT_KEYSYM 8
#define WL_INPUT_METHOD_CONTEXT_GRAB_KEYBOARD 9
#define WL_INPUT_METHOD_CONTEXT_KEY 10
#define WL_INPUT_METHOD_CONTEXT_MODIFIERS 11
#define WL_INPUT_METHOD_CONTEXT_LANGUAGE 12
#define WL_INPUT_METHOD_CONTEXT_TEXT_DIRECTION 13
static inline void
wl_input_method_context_set_user_data(struct wl_input_method_context *wl_input_method_context, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wl_input_method_context, user_data);
}
static inline void *
wl_input_method_context_get_user_data(struct wl_input_method_context *wl_input_method_context)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_input_method_context);
}
static inline void
wl_input_method_context_destroy(struct wl_input_method_context *wl_input_method_context)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_DESTROY);
wl_proxy_destroy((struct wl_proxy *) wl_input_method_context);
}
static inline void
wl_input_method_context_commit_string(struct wl_input_method_context *wl_input_method_context, uint32_t serial, const char *text)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_COMMIT_STRING, serial, text);
}
static inline void
wl_input_method_context_preedit_string(struct wl_input_method_context *wl_input_method_context, uint32_t serial, const char *text, const char *commit)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_PREEDIT_STRING, serial, text, commit);
}
static inline void
wl_input_method_context_preedit_styling(struct wl_input_method_context *wl_input_method_context, uint32_t index, uint32_t length, uint32_t style)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_PREEDIT_STYLING, index, length, style);
}
static inline void
wl_input_method_context_preedit_cursor(struct wl_input_method_context *wl_input_method_context, int32_t index)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_PREEDIT_CURSOR, index);
}
static inline void
wl_input_method_context_delete_surrounding_text(struct wl_input_method_context *wl_input_method_context, int32_t index, uint32_t length)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_DELETE_SURROUNDING_TEXT, index, length);
}
static inline void
wl_input_method_context_cursor_position(struct wl_input_method_context *wl_input_method_context, int32_t index, int32_t anchor)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_CURSOR_POSITION, index, anchor);
}
static inline void
wl_input_method_context_modifiers_map(struct wl_input_method_context *wl_input_method_context, struct wl_array *map)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_MODIFIERS_MAP, map);
}
static inline void
wl_input_method_context_keysym(struct wl_input_method_context *wl_input_method_context, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_KEYSYM, serial, time, sym, state, modifiers);
}
static inline struct wl_keyboard *
wl_input_method_context_grab_keyboard(struct wl_input_method_context *wl_input_method_context)
{
struct wl_proxy *keyboard;
keyboard = wl_proxy_marshal_constructor((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_GRAB_KEYBOARD, &wl_keyboard_interface, NULL);
return (struct wl_keyboard *) keyboard;
}
static inline void
wl_input_method_context_key(struct wl_input_method_context *wl_input_method_context, uint32_t serial, uint32_t time, uint32_t key, uint32_t state)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_KEY, serial, time, key, state);
}
static inline void
wl_input_method_context_modifiers(struct wl_input_method_context *wl_input_method_context, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_MODIFIERS, serial, mods_depressed, mods_latched, mods_locked, group);
}
static inline void
wl_input_method_context_language(struct wl_input_method_context *wl_input_method_context, uint32_t serial, const char *language)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_LANGUAGE, serial, language);
}
static inline void
wl_input_method_context_text_direction(struct wl_input_method_context *wl_input_method_context, uint32_t serial, uint32_t direction)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_method_context,
WL_INPUT_METHOD_CONTEXT_TEXT_DIRECTION, serial, direction);
}
/**
* wl_input_method - input method
* @activate: activate event
* @deactivate: activate event
*
* An input method object is responsible to compose text in response to
* input from hardware or virtual keyboards. There is one input method
* object per seat. On activate there is a new input method context object
* created which allows the input method to communicate with the text
* model.
*/
struct wl_input_method_listener {
/**
* activate - activate event
* @id: (none)
*
* A text model was activated. Creates an input method context
* object which allows communication with the text model.
*/
void (*activate)(void *data,
struct wl_input_method *wl_input_method,
struct wl_input_method_context *id);
/**
* deactivate - activate event
* @context: (none)
*
* The text model corresponding to the context argument was
* deactivated. The input method context should be destroyed after
* deactivation is handled.
*/
void (*deactivate)(void *data,
struct wl_input_method *wl_input_method,
struct wl_input_method_context *context);
};
static inline int
wl_input_method_add_listener(struct wl_input_method *wl_input_method,
const struct wl_input_method_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) wl_input_method,
(void (**)(void)) listener, data);
}
static inline void
wl_input_method_set_user_data(struct wl_input_method *wl_input_method, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wl_input_method, user_data);
}
static inline void *
wl_input_method_get_user_data(struct wl_input_method *wl_input_method)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_input_method);
}
static inline void
wl_input_method_destroy(struct wl_input_method *wl_input_method)
{
wl_proxy_destroy((struct wl_proxy *) wl_input_method);
}
#define WL_INPUT_PANEL_GET_INPUT_PANEL_SURFACE 0
static inline void
wl_input_panel_set_user_data(struct wl_input_panel *wl_input_panel, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wl_input_panel, user_data);
}
static inline void *
wl_input_panel_get_user_data(struct wl_input_panel *wl_input_panel)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_input_panel);
}
static inline void
wl_input_panel_destroy(struct wl_input_panel *wl_input_panel)
{
wl_proxy_destroy((struct wl_proxy *) wl_input_panel);
}
static inline struct wl_input_panel_surface *
wl_input_panel_get_input_panel_surface(struct wl_input_panel *wl_input_panel, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_input_panel,
WL_INPUT_PANEL_GET_INPUT_PANEL_SURFACE, &wl_input_panel_surface_interface, NULL, surface);
return (struct wl_input_panel_surface *) id;
}
#ifndef WL_INPUT_PANEL_SURFACE_POSITION_ENUM
#define WL_INPUT_PANEL_SURFACE_POSITION_ENUM
enum wl_input_panel_surface_position {
WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM = 0,
};
#endif /* WL_INPUT_PANEL_SURFACE_POSITION_ENUM */
struct wl_input_panel_surface_listener {
/**
* cursor_rectangle - cursor rectangle
* @x: (none)
* @y: (none)
* @width: (none)
* @height: (none)
*
* Notify when the cursor rectangle relative to the input panel
* surface change.
*/
void (*cursor_rectangle)(void *data,
struct wl_input_panel_surface *wl_input_panel_surface,
int32_t x,
int32_t y,
int32_t width,
int32_t height);
};
static inline int
wl_input_panel_surface_add_listener(struct wl_input_panel_surface *wl_input_panel_surface,
const struct wl_input_panel_surface_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) wl_input_panel_surface,
(void (**)(void)) listener, data);
}
#define WL_INPUT_PANEL_SURFACE_SET_TOPLEVEL 0
#define WL_INPUT_PANEL_SURFACE_SET_OVERLAY_PANEL 1
static inline void
wl_input_panel_surface_set_user_data(struct wl_input_panel_surface *wl_input_panel_surface, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wl_input_panel_surface, user_data);
}
static inline void *
wl_input_panel_surface_get_user_data(struct wl_input_panel_surface *wl_input_panel_surface)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_input_panel_surface);
}
static inline void
wl_input_panel_surface_destroy(struct wl_input_panel_surface *wl_input_panel_surface)
{
wl_proxy_destroy((struct wl_proxy *) wl_input_panel_surface);
}
static inline void
wl_input_panel_surface_set_toplevel(struct wl_input_panel_surface *wl_input_panel_surface, struct wl_output *output, uint32_t position)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_panel_surface,
WL_INPUT_PANEL_SURFACE_SET_TOPLEVEL, output, position);
}
static inline void
wl_input_panel_surface_set_overlay_panel(struct wl_input_panel_surface *wl_input_panel_surface)
{
wl_proxy_marshal((struct wl_proxy *) wl_input_panel_surface,
WL_INPUT_PANEL_SURFACE_SET_OVERLAY_PANEL);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,118 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_input_method_context_interface;
extern const struct wl_interface wl_input_panel_surface_interface;
extern const struct wl_interface wl_keyboard_interface;
extern const struct wl_interface wl_output_interface;
extern const struct wl_interface wl_surface_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
NULL,
NULL,
&wl_keyboard_interface,
&wl_input_method_context_interface,
&wl_input_method_context_interface,
&wl_input_panel_surface_interface,
&wl_surface_interface,
&wl_output_interface,
NULL,
};
static const struct wl_message wl_input_method_context_requests[] = {
{ "destroy", "", types + 0 },
{ "commit_string", "us", types + 0 },
{ "preedit_string", "uss", types + 0 },
{ "preedit_styling", "uuu", types + 0 },
{ "preedit_cursor", "i", types + 0 },
{ "delete_surrounding_text", "iu", types + 0 },
{ "cursor_position", "ii", types + 0 },
{ "modifiers_map", "a", types + 0 },
{ "keysym", "uuuuu", types + 0 },
{ "grab_keyboard", "n", types + 5 },
{ "key", "uuuu", types + 0 },
{ "modifiers", "uuuuu", types + 0 },
{ "language", "us", types + 0 },
{ "text_direction", "uu", types + 0 },
};
static const struct wl_message wl_input_method_context_events[] = {
{ "surrounding_text", "suu", types + 0 },
{ "reset", "", types + 0 },
{ "content_type", "uu", types + 0 },
{ "invoke_action", "uu", types + 0 },
{ "commit_state", "u", types + 0 },
{ "preferred_language", "s", types + 0 },
};
WL_EXPORT const struct wl_interface wl_input_method_context_interface = {
"wl_input_method_context", 1,
14, wl_input_method_context_requests,
6, wl_input_method_context_events,
};
static const struct wl_message wl_input_method_events[] = {
{ "activate", "n", types + 6 },
{ "deactivate", "o", types + 7 },
};
WL_EXPORT const struct wl_interface wl_input_method_interface = {
"wl_input_method", 1,
0, NULL,
2, wl_input_method_events,
};
static const struct wl_message wl_input_panel_requests[] = {
{ "get_input_panel_surface", "no", types + 8 },
};
WL_EXPORT const struct wl_interface wl_input_panel_interface = {
"wl_input_panel", 1,
1, wl_input_panel_requests,
0, NULL,
};
static const struct wl_message wl_input_panel_surface_requests[] = {
{ "set_toplevel", "ou", types + 10 },
{ "set_overlay_panel", "", types + 0 },
};
static const struct wl_message wl_input_panel_surface_events[] = {
{ "cursor_rectangle", "iiii", types + 0 },
};
WL_EXPORT const struct wl_interface wl_input_panel_surface_interface = {
"wl_input_panel_surface", 1,
2, wl_input_panel_surface_requests,
1, wl_input_panel_surface_events,
};

View File

@ -1,540 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef TEXT_CLIENT_PROTOCOL_H
#define TEXT_CLIENT_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
struct wl_client;
struct wl_resource;
struct wl_seat;
struct wl_surface;
struct wl_text_input;
struct wl_text_input_manager;
extern const struct wl_interface wl_text_input_interface;
extern const struct wl_interface wl_text_input_manager_interface;
#ifndef WL_TEXT_INPUT_CONTENT_HINT_ENUM
#define WL_TEXT_INPUT_CONTENT_HINT_ENUM
/**
* wl_text_input_content_hint - content hint
* @WL_TEXT_INPUT_CONTENT_HINT_NONE: no special behaviour
* @WL_TEXT_INPUT_CONTENT_HINT_DEFAULT: auto completion, correction and
* capitalization
* @WL_TEXT_INPUT_CONTENT_HINT_PASSWORD: hidden and sensitive text
* @WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION: suggest word completions
* @WL_TEXT_INPUT_CONTENT_HINT_AUTO_CORRECTION: suggest word corrections
* @WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION: switch to uppercase
* letters at the start of a sentence
* @WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE: prefer lowercase letters
* @WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE: prefer uppercase letters
* @WL_TEXT_INPUT_CONTENT_HINT_TITLECASE: prefer casing for titles and
* headings (can be language dependent)
* @WL_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT: characters should be hidden
* @WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA: typed text should not be
* stored
* @WL_TEXT_INPUT_CONTENT_HINT_LATIN: just latin characters should be
* entered
* @WL_TEXT_INPUT_CONTENT_HINT_MULTILINE: the text input is multiline
*
* Content hint is a bitmask to allow to modify the behavior of the text
* input.
*/
enum wl_text_input_content_hint {
WL_TEXT_INPUT_CONTENT_HINT_NONE = 0x0,
WL_TEXT_INPUT_CONTENT_HINT_DEFAULT = 0x7,
WL_TEXT_INPUT_CONTENT_HINT_PASSWORD = 0xc0,
WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION = 0x1,
WL_TEXT_INPUT_CONTENT_HINT_AUTO_CORRECTION = 0x2,
WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4,
WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE = 0x8,
WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE = 0x10,
WL_TEXT_INPUT_CONTENT_HINT_TITLECASE = 0x20,
WL_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT = 0x40,
WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA = 0x80,
WL_TEXT_INPUT_CONTENT_HINT_LATIN = 0x100,
WL_TEXT_INPUT_CONTENT_HINT_MULTILINE = 0x200,
};
#endif /* WL_TEXT_INPUT_CONTENT_HINT_ENUM */
#ifndef WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM
#define WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM
/**
* wl_text_input_content_purpose - content purpose
* @WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL: default input, allowing all
* characters
* @WL_TEXT_INPUT_CONTENT_PURPOSE_ALPHA: allow only alphabetic characters
* @WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS: allow only digits
* @WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER: input a number (including
* decimal separator and sign)
* @WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE: input a phone number
* @WL_TEXT_INPUT_CONTENT_PURPOSE_URL: input an URL
* @WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL: input an email address
* @WL_TEXT_INPUT_CONTENT_PURPOSE_NAME: input a name of a person
* @WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD: input a password (combine
* with password or sensitive_data hint)
* @WL_TEXT_INPUT_CONTENT_PURPOSE_DATE: input a date
* @WL_TEXT_INPUT_CONTENT_PURPOSE_TIME: input a time
* @WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME: input a date and time
* @WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL: input for a terminal
*
* The content purpose allows to specify the primary purpose of a text
* input.
*
* This allows an input method to show special purpose input panels with
* extra characters or to disallow some characters.
*/
enum wl_text_input_content_purpose {
WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL = 0,
WL_TEXT_INPUT_CONTENT_PURPOSE_ALPHA = 1,
WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS = 2,
WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER = 3,
WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE = 4,
WL_TEXT_INPUT_CONTENT_PURPOSE_URL = 5,
WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL = 6,
WL_TEXT_INPUT_CONTENT_PURPOSE_NAME = 7,
WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD = 8,
WL_TEXT_INPUT_CONTENT_PURPOSE_DATE = 9,
WL_TEXT_INPUT_CONTENT_PURPOSE_TIME = 10,
WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME = 11,
WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL = 12,
};
#endif /* WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM */
#ifndef WL_TEXT_INPUT_PREEDIT_STYLE_ENUM
#define WL_TEXT_INPUT_PREEDIT_STYLE_ENUM
enum wl_text_input_preedit_style {
WL_TEXT_INPUT_PREEDIT_STYLE_DEFAULT = 0,
WL_TEXT_INPUT_PREEDIT_STYLE_NONE = 1,
WL_TEXT_INPUT_PREEDIT_STYLE_ACTIVE = 2,
WL_TEXT_INPUT_PREEDIT_STYLE_INACTIVE = 3,
WL_TEXT_INPUT_PREEDIT_STYLE_HIGHLIGHT = 4,
WL_TEXT_INPUT_PREEDIT_STYLE_UNDERLINE = 5,
WL_TEXT_INPUT_PREEDIT_STYLE_SELECTION = 6,
WL_TEXT_INPUT_PREEDIT_STYLE_INCORRECT = 7,
};
#endif /* WL_TEXT_INPUT_PREEDIT_STYLE_ENUM */
#ifndef WL_TEXT_INPUT_TEXT_DIRECTION_ENUM
#define WL_TEXT_INPUT_TEXT_DIRECTION_ENUM
enum wl_text_input_text_direction {
WL_TEXT_INPUT_TEXT_DIRECTION_AUTO = 0,
WL_TEXT_INPUT_TEXT_DIRECTION_LTR = 1,
WL_TEXT_INPUT_TEXT_DIRECTION_RTL = 2,
};
#endif /* WL_TEXT_INPUT_TEXT_DIRECTION_ENUM */
/**
* wl_text_input - text input
* @enter: enter event
* @leave: leave event
* @modifiers_map: modifiers map
* @input_panel_state: state of the input panel
* @preedit_string: pre-edit
* @preedit_styling: pre-edit styling
* @preedit_cursor: pre-edit cursor
* @commit_string: commit
* @cursor_position: set cursor to new position
* @delete_surrounding_text: delete surrounding text
* @keysym: keysym
* @language: language
* @text_direction: text direction
*
* An object used for text input. Adds support for text input and input
* methods to applications. A text-input object is created from a
* wl_text_input_manager and corresponds typically to a text entry in an
* application. Requests are used to activate/deactivate the text-input
* object and set state information like surrounding and selected text or
* the content type. The information about entered text is sent to the
* text-input object via the pre-edit and commit events. Using this
* interface removes the need for applications to directly process hardware
* key events and compose text out of them.
*
* Text is generally UTF-8 encoded, indices and lengths are in bytes.
*
* Serials are used to synchronize the state between the text input and an
* input method. New serials are sent by the text input in the commit_state
* request and are used by the input method to indicate the known text
* input state in events like preedit_string, commit_string, and keysym.
* The text input can then ignore events from the input method which are
* based on an outdated state (for example after a reset).
*/
struct wl_text_input_listener {
/**
* enter - enter event
* @surface: (none)
*
* Notify the text-input object when it received focus. Typically
* in response to an activate request.
*/
void (*enter)(void *data,
struct wl_text_input *wl_text_input,
struct wl_surface *surface);
/**
* leave - leave event
*
* Notify the text-input object when it lost focus. Either in
* response to a deactivate request or when the assigned surface
* lost focus or was destroyed.
*/
void (*leave)(void *data,
struct wl_text_input *wl_text_input);
/**
* modifiers_map - modifiers map
* @map: (none)
*
* Transfer an array of 0-terminated modifiers names. The
* position in the array is the index of the modifier as used in
* the modifiers bitmask in the keysym event.
*/
void (*modifiers_map)(void *data,
struct wl_text_input *wl_text_input,
struct wl_array *map);
/**
* input_panel_state - state of the input panel
* @state: (none)
*
* Notify when the visibility state of the input panel changed.
*/
void (*input_panel_state)(void *data,
struct wl_text_input *wl_text_input,
uint32_t state);
/**
* preedit_string - pre-edit
* @serial: serial of the latest known text input state
* @text: (none)
* @commit: (none)
*
* Notify when a new composing text (pre-edit) should be set
* around the current cursor position. Any previously set composing
* text should be removed.
*
* The commit text can be used to replace the preedit text on reset
* (for example on unfocus).
*
* The text input should also handle all preedit_style and
* preedit_cursor events occuring directly before preedit_string.
*/
void (*preedit_string)(void *data,
struct wl_text_input *wl_text_input,
uint32_t serial,
const char *text,
const char *commit);
/**
* preedit_styling - pre-edit styling
* @index: (none)
* @length: (none)
* @style: (none)
*
* Sets styling information on composing text. The style is
* applied for length bytes from index relative to the beginning of
* the composing text (as byte offset). Multiple styles can be
* applied to a composing text by sending multiple preedit_styling
* events.
*
* This event is handled as part of a following preedit_string
* event.
*/
void (*preedit_styling)(void *data,
struct wl_text_input *wl_text_input,
uint32_t index,
uint32_t length,
uint32_t style);
/**
* preedit_cursor - pre-edit cursor
* @index: (none)
*
* Sets the cursor position inside the composing text (as byte
* offset) relative to the start of the composing text. When index
* is a negative number no cursor is shown.
*
* This event is handled as part of a following preedit_string
* event.
*/
void (*preedit_cursor)(void *data,
struct wl_text_input *wl_text_input,
int32_t index);
/**
* commit_string - commit
* @serial: serial of the latest known text input state
* @text: (none)
*
* Notify when text should be inserted into the editor widget.
* The text to commit could be either just a single character after
* a key press or the result of some composing (pre-edit). It could
* be also an empty text when some text should be removed (see
* delete_surrounding_text) or when the input cursor should be
* moved (see cursor_position).
*
* Any previously set composing text should be removed.
*/
void (*commit_string)(void *data,
struct wl_text_input *wl_text_input,
uint32_t serial,
const char *text);
/**
* cursor_position - set cursor to new position
* @index: (none)
* @anchor: (none)
*
* Notify when the cursor or anchor position should be modified.
*
* This event should be handled as part of a following
* commit_string event.
*/
void (*cursor_position)(void *data,
struct wl_text_input *wl_text_input,
int32_t index,
int32_t anchor);
/**
* delete_surrounding_text - delete surrounding text
* @index: (none)
* @length: (none)
*
* Notify when the text around the current cursor position should
* be deleted.
*
* Index is relative to the current cursor (in bytes). Length is
* the length of deleted text (in bytes).
*
* This event should be handled as part of a following
* commit_string event.
*/
void (*delete_surrounding_text)(void *data,
struct wl_text_input *wl_text_input,
int32_t index,
uint32_t length);
/**
* keysym - keysym
* @serial: serial of the latest known text input state
* @time: (none)
* @sym: (none)
* @state: (none)
* @modifiers: (none)
*
* Notify when a key event was sent. Key events should not be
* used for normal text input operations, which should be done with
* commit_string, delete_surrounding_text, etc. The key event
* follows the wl_keyboard key event convention. Sym is a XKB
* keysym, state a wl_keyboard key_state. Modifiers are a mask for
* effective modifiers (where the modifier indices are set by the
* modifiers_map event)
*/
void (*keysym)(void *data,
struct wl_text_input *wl_text_input,
uint32_t serial,
uint32_t time,
uint32_t sym,
uint32_t state,
uint32_t modifiers);
/**
* language - language
* @serial: serial of the latest known text input state
* @language: (none)
*
* Sets the language of the input text. The "language" argument
* is a RFC-3066 format language tag.
*/
void (*language)(void *data,
struct wl_text_input *wl_text_input,
uint32_t serial,
const char *language);
/**
* text_direction - text direction
* @serial: serial of the latest known text input state
* @direction: (none)
*
* Sets the text direction of input text.
*
* It is mainly needed for showing input cursor on correct side of
* the editor when there is no input yet done and making sure
* neutral direction text is laid out properly.
*/
void (*text_direction)(void *data,
struct wl_text_input *wl_text_input,
uint32_t serial,
uint32_t direction);
};
static inline int
wl_text_input_add_listener(struct wl_text_input *wl_text_input,
const struct wl_text_input_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) wl_text_input,
(void (**)(void)) listener, data);
}
#define WL_TEXT_INPUT_ACTIVATE 0
#define WL_TEXT_INPUT_DEACTIVATE 1
#define WL_TEXT_INPUT_SHOW_INPUT_PANEL 2
#define WL_TEXT_INPUT_HIDE_INPUT_PANEL 3
#define WL_TEXT_INPUT_RESET 4
#define WL_TEXT_INPUT_SET_SURROUNDING_TEXT 5
#define WL_TEXT_INPUT_SET_CONTENT_TYPE 6
#define WL_TEXT_INPUT_SET_CURSOR_RECTANGLE 7
#define WL_TEXT_INPUT_SET_PREFERRED_LANGUAGE 8
#define WL_TEXT_INPUT_COMMIT_STATE 9
#define WL_TEXT_INPUT_INVOKE_ACTION 10
static inline void
wl_text_input_set_user_data(struct wl_text_input *wl_text_input, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wl_text_input, user_data);
}
static inline void *
wl_text_input_get_user_data(struct wl_text_input *wl_text_input)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_text_input);
}
static inline void
wl_text_input_destroy(struct wl_text_input *wl_text_input)
{
wl_proxy_destroy((struct wl_proxy *) wl_text_input);
}
static inline void
wl_text_input_activate(struct wl_text_input *wl_text_input, struct wl_seat *seat, struct wl_surface *surface)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_ACTIVATE, seat, surface);
}
static inline void
wl_text_input_deactivate(struct wl_text_input *wl_text_input, struct wl_seat *seat)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_DEACTIVATE, seat);
}
static inline void
wl_text_input_show_input_panel(struct wl_text_input *wl_text_input)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_SHOW_INPUT_PANEL);
}
static inline void
wl_text_input_hide_input_panel(struct wl_text_input *wl_text_input)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_HIDE_INPUT_PANEL);
}
static inline void
wl_text_input_reset(struct wl_text_input *wl_text_input)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_RESET);
}
static inline void
wl_text_input_set_surrounding_text(struct wl_text_input *wl_text_input, const char *text, uint32_t cursor, uint32_t anchor)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_SET_SURROUNDING_TEXT, text, cursor, anchor);
}
static inline void
wl_text_input_set_content_type(struct wl_text_input *wl_text_input, uint32_t hint, uint32_t purpose)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_SET_CONTENT_TYPE, hint, purpose);
}
static inline void
wl_text_input_set_cursor_rectangle(struct wl_text_input *wl_text_input, int32_t x, int32_t y, int32_t width, int32_t height)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_SET_CURSOR_RECTANGLE, x, y, width, height);
}
static inline void
wl_text_input_set_preferred_language(struct wl_text_input *wl_text_input, const char *language)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_SET_PREFERRED_LANGUAGE, language);
}
static inline void
wl_text_input_commit_state(struct wl_text_input *wl_text_input, uint32_t serial)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_COMMIT_STATE, serial);
}
static inline void
wl_text_input_invoke_action(struct wl_text_input *wl_text_input, uint32_t button, uint32_t index)
{
wl_proxy_marshal((struct wl_proxy *) wl_text_input,
WL_TEXT_INPUT_INVOKE_ACTION, button, index);
}
#define WL_TEXT_INPUT_MANAGER_CREATE_TEXT_INPUT 0
static inline void
wl_text_input_manager_set_user_data(struct wl_text_input_manager *wl_text_input_manager, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wl_text_input_manager, user_data);
}
static inline void *
wl_text_input_manager_get_user_data(struct wl_text_input_manager *wl_text_input_manager)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_text_input_manager);
}
static inline void
wl_text_input_manager_destroy(struct wl_text_input_manager *wl_text_input_manager)
{
wl_proxy_destroy((struct wl_proxy *) wl_text_input_manager);
}
static inline struct wl_text_input *
wl_text_input_manager_create_text_input(struct wl_text_input_manager *wl_text_input_manager)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_text_input_manager,
WL_TEXT_INPUT_MANAGER_CREATE_TEXT_INPUT, &wl_text_input_interface, NULL);
return (struct wl_text_input *) id;
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,92 +0,0 @@
/*
* Copyright © 2012, 2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface wl_text_input_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
NULL,
NULL,
&wl_seat_interface,
&wl_surface_interface,
&wl_seat_interface,
&wl_surface_interface,
&wl_text_input_interface,
};
static const struct wl_message wl_text_input_requests[] = {
{ "activate", "oo", types + 5 },
{ "deactivate", "o", types + 7 },
{ "show_input_panel", "", types + 0 },
{ "hide_input_panel", "", types + 0 },
{ "reset", "", types + 0 },
{ "set_surrounding_text", "suu", types + 0 },
{ "set_content_type", "uu", types + 0 },
{ "set_cursor_rectangle", "iiii", types + 0 },
{ "set_preferred_language", "s", types + 0 },
{ "commit_state", "u", types + 0 },
{ "invoke_action", "uu", types + 0 },
};
static const struct wl_message wl_text_input_events[] = {
{ "enter", "o", types + 8 },
{ "leave", "", types + 0 },
{ "modifiers_map", "a", types + 0 },
{ "input_panel_state", "u", types + 0 },
{ "preedit_string", "uss", types + 0 },
{ "preedit_styling", "uuu", types + 0 },
{ "preedit_cursor", "i", types + 0 },
{ "commit_string", "us", types + 0 },
{ "cursor_position", "ii", types + 0 },
{ "delete_surrounding_text", "iu", types + 0 },
{ "keysym", "uuuuu", types + 0 },
{ "language", "us", types + 0 },
{ "text_direction", "uu", types + 0 },
};
WL_EXPORT const struct wl_interface wl_text_input_interface = {
"wl_text_input", 1,
11, wl_text_input_requests,
13, wl_text_input_events,
};
static const struct wl_message wl_text_input_manager_requests[] = {
{ "create_text_input", "n", types + 9 },
};
WL_EXPORT const struct wl_interface wl_text_input_manager_interface = {
"wl_text_input_manager", 1,
1, wl_text_input_manager_requests,
0, NULL,
};

View File

@ -0,0 +1,12 @@
<protocol name="screenshooter">
<interface name="zwp_screenshooter" version="1">
<request name="shoot">
<arg name="output" type="object" interface="wl_output"/>
<arg name="buffer" type="object" interface="wl_buffer"/>
</request>
<event name="done">
</event>
</interface>
</protocol>

28
src/protocol/www.xml Normal file
View File

@ -0,0 +1,28 @@
<protocol name="zwp_www">
<interface name="www" version="1">
<request name="create">
<description summary="Create an object for WWW notifications">
</description>
<arg name="id" type="new_id" interface="www_surface"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>
</interface>
<interface name="www_surface" version="1">
<event name="status">
<description summary="Status update on a www_surface"></description>
<arg name="x_rel" type="int"/>
<arg name="y_rel" type="int"/>
<arg name="timestamp" type="uint"/>
</event>
<event name="start_drag">
<description summary="Drag has started"></description>
</event>
<event name="end_drag">
<description summary="Drag has ended"></description>
</event>
<request name="destroy" type="destructor">
<description summary="Destroy a www_surface">
</description>
</request>
</interface>
</protocol>