rewrite in rust

This commit is contained in:
Richard Acayan 2024-07-18 20:32:55 -04:00
parent d43f61ec76
commit 4a6b261be0
51 changed files with 3104 additions and 9319 deletions

View file

@ -1,47 +0,0 @@
/* SPDX-License-Identifier: GPL-3.0-only */
/*
* Interface for drawing keys to a buffer.
*
* Copyright (c) 2024, Richard Acayan. All rights reserved.
*/
#ifndef UFKBD_GRAPHICS_H
#define UFKBD_GRAPHICS_H
#include <stddef.h>
#include <pixman.h>
struct fcft_font;
struct ufkbd_ctx;
struct ufkbd_key;
struct ufkbd_layout;
struct ufkbd_graphics_ctx {
struct fcft_font *font;
struct fcft_font *font_sec;
pixman_image_t *fill_bg;
pixman_image_t *fill_keycap;
pixman_image_t *key_default;
pixman_image_t *key_pressed;
pixman_image_t *target;
unsigned int scale;
size_t size;
void *buf;
};
struct ufkbd_graphics_ctx *ufkbd_graphics_init(void);
void ufkbd_graphics_uninit(struct ufkbd_graphics_ctx *graphics);
int ufkbd_graphics_set_scale(struct ufkbd_graphics_ctx *graphics, unsigned int scale);
void ufkbd_graphics_draw_key(struct ufkbd_ctx *ctx, struct ufkbd_key *key,
int x1, int y1, int x2, int y2);
void ufkbd_graphics_draw_layout(struct ufkbd_ctx *ctx, struct ufkbd_layout *layout,
size_t width, size_t height);
#endif /* UFKBD_GRAPHICS_H */

View file

@ -1,23 +0,0 @@
/* SPDX-License-Identifier: GPL-3.0-only */
/*
* Input driver interface.
*
* Copyright (c) 2024, Richard Acayan. All rights reserved.
*/
#ifndef UFKBD_INPUT_H
#define UFKBD_INPUT_H
#include <stdbool.h>
struct ufkbd_ctx;
struct ufkbd_key;
int ufkbd_input_press(struct ufkbd_ctx *ctx, int id);
int ufkbd_input_position(struct ufkbd_ctx *ctx, int id, int x, int y);
int ufkbd_input_release(struct ufkbd_ctx *ctx, int id);
int ufkbd_input_repeat(struct ufkbd_ctx *ctx, int id);
int ufkbd_input_repeat_held(struct ufkbd_ctx *ctx);
#endif /* UFKBD_INPUT_H */

View file

@ -1,28 +0,0 @@
/* SPDX-License-Identifier: GPL-3.0-only */
/*
* Keymap generation interface.
*
* Copyright (c) 2024, Richard Acayan. All rights reserved.
*/
#ifndef UFKBD_KEYMAP_H
#define UFKBD_KEYMAP_H
#include <xkbcommon/xkbcommon.h>
struct ufkbd_keymap {
int count;
size_t size;
int fd;
char path[256];
};
int ufkbd_keymap_add_key(struct ufkbd_keymap *keymap, xkb_keysym_t keysym);
void ufkbd_keymap_end(struct ufkbd_keymap *keymap);
struct ufkbd_keymap *ufkbd_keymap_init(void);
void ufkbd_keymap_uninit(struct ufkbd_keymap *keymap);
#endif /* UFKBD_KEYMAP_H */

View file

@ -1,49 +0,0 @@
/* SPDX-License-Identifier: GPL-3.0-only */
/*
* Keyboard layout management.
*
* Copyright (c) 2024, Richard Acayan. All rights reserved.
*/
#ifndef UFKBD_LAYOUT_H
#define UFKBD_LAYOUT_H
#include <stddef.h>
struct ufkbd_key;
struct ufkbd_layout_column {
double x1_unscaled, x2_unscaled;
int x1, x2;
struct ufkbd_key *key;
};
struct ufkbd_layout_row {
double y1_unscaled, y2_unscaled;
int y1, y2;
size_t n_cols;
struct ufkbd_layout_column *cols;
};
struct ufkbd_layout {
size_t max_cols;
size_t n_rows;
struct ufkbd_layout_row *rows;
};
struct ufkbd_layout *ufkbd_layout_init(void);
void ufkbd_layout_uninit(struct ufkbd_layout *layout);
struct ufkbd_key *ufkbd_layout_search(struct ufkbd_layout *layout, int x, int y,
int *x1, int *y1, int *x2, int *y2);
void ufkbd_layout_foreach(struct ufkbd_layout *layout,
void (*func)(struct ufkbd_key *key,
int x1, int y1, int x2, int y2,
void *data),
void *data);
void ufkbd_layout_resize(struct ufkbd_layout *layout, int width, int height);
#endif

View file

@ -1,27 +0,0 @@
/* SPDX-License-Identifier: GPL-3.0-only */
/*
* Modifier key callbacks.
*
* Copyright (c) 2024, Richard Acayan. All rights reserved.
*/
#ifndef UFKBD_MODIFIER_H
#define UFKBD_MODIFIER_H
#include "ufkbd.h"
struct ufkbd_ctx;
struct ufkbd_press;
bool ufkbd_is_modifier(struct ufkbd_press *press);
enum ufkbd_mod_state ufkbd_modifier_get_state(const struct ufkbd_ctx *ctx,
const struct ufkbd_key *key,
int part);
void ufkbd_modifier_press(struct ufkbd_ctx *ctx, struct ufkbd_press *press);
void ufkbd_modifier_cancel(struct ufkbd_ctx *ctx, struct ufkbd_press *press);
void ufkbd_modifier_release(struct ufkbd_ctx *ctx, struct ufkbd_press *press);
void ufkbd_modifier_unlatch_all(struct ufkbd_ctx *ctx);
#endif /* UFKBD_MODIFIER_H */

View file

@ -1,18 +0,0 @@
/* SPDX-License-Identifier: GPL-3.0-only */
/*
* Parser for Unfettered Keyboard keyboard layouts in XML.
*
* Copyright (c) 2024, Richard Acayan. All rights reserved.
*/
#ifndef UFKBD_PARSER_H
#define UFKBD_PARSER_H
struct ufkbd_keymap;
struct ufkbd_layout;
int ufkbd_parser_parse(int dir, const char *fname,
struct ufkbd_keymap *keymap,
struct ufkbd_layout *layout);
#endif /* UFKBD_PARSER_H */

View file

@ -1,113 +0,0 @@
/* SPDX-License-Identifier: GPL-3.0-only */
/*
* Copyright (c) 2024, Richard Acayan. All rights reserved.
*/
#ifndef UFKBD_H
#define UFKBD_H
#include <stdbool.h>
#include <time.h>
#include <xkbcommon/xkbcommon.h>
#define UFKBD_PRESS_MAX 64
#define UFKBD_MOD_MAX 4
struct ufkbd_ctx;
struct ufkbd_graphics_ctx;
struct ufkbd_graphics_driver;
struct ufkbd_input_driver;
// These correspond to the key0..key8 properties in the layout definitions
enum ufkbd_part {
UFKBD_PART_CENTER,
UFKBD_PART_TL,
UFKBD_PART_TR,
UFKBD_PART_BL,
UFKBD_PART_BR,
UFKBD_PART_LEFT,
UFKBD_PART_RIGHT,
UFKBD_PART_TOP,
UFKBD_PART_BOTTOM,
UFKBD_PART_MAX
};
enum ufkbd_mod_state {
UFKBD_MOD_RELEASED,
UFKBD_MOD_PRESSED,
UFKBD_MOD_LATCHED,
UFKBD_MOD_LOCKED,
};
enum ufkbd_modifier {
UFKBD_MOD_SHIFT,
UFKBD_MOD_CTRL,
UFKBD_MOD_ALT,
};
struct ufkbd_key {
// Graphical parameters
size_t presses[UFKBD_PART_MAX];
void *labels_mask[UFKBD_PART_MAX * 2];
void *labels_color[UFKBD_PART_MAX * 2];
int keyids[UFKBD_PART_MAX];
xkb_keysym_t keysyms[UFKBD_PART_MAX];
enum ufkbd_part lut[16];
int latch_state;
};
struct ufkbd_driver {
void *(*init)(struct ufkbd_ctx *ufkbd);
void (*uninit)(void *data);
// Deprecated
void (*listen_one)(void *data, bool block);
void (*listen_step)(void *data, int timeout);
int (*send_key)(void *data, int code, bool repeat);
int (*send_mod)(void *data, enum ufkbd_modifier mod, bool pressed);
int (*draw_begin)(void *data, size_t *stride, void **ptr);
void (*draw_touch)(void *data, int x, int y, int width, int height);
void (*draw_end)(void *data);
};
struct ufkbd_press {
struct ufkbd_key *key;
int xl, xr, yt, yb;
struct timespec repeat;
// Coordinates of starting and ending position of keypress
int x1, y1, x2, y2;
// Cached section of the key that is pressed
enum ufkbd_part part;
};
struct ufkbd_ctx {
struct ufkbd_keymap *keymap;
struct ufkbd_layout *layout;
struct ufkbd_driver *drv;
void *drv_data;
struct ufkbd_graphics_ctx *graphics;
// Settings
int repeat_delay_ns;
int repeat_interval_ns;
int dist_squared;
uint32_t mods[(UFKBD_MOD_MAX + 15) / 16];
size_t n_presses;
struct ufkbd_press presses[UFKBD_PRESS_MAX];
bool terminate;
};
void ufkbd_terminate(struct ufkbd_ctx *ctx);
#endif /* UFKBD_H */

View file

@ -1,264 +0,0 @@
/* Generated by wayland-scanner 1.22.0 */
#ifndef FRACTIONAL_SCALE_V1_CLIENT_PROTOCOL_H
#define FRACTIONAL_SCALE_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_fractional_scale_v1 The fractional_scale_v1 protocol
* Protocol for requesting fractional surface scales
*
* @section page_desc_fractional_scale_v1 Description
*
* This protocol allows a compositor to suggest for surfaces to render at
* fractional scales.
*
* A client can submit scaled content by utilizing wp_viewport. This is done by
* creating a wp_viewport object for the surface and setting the destination
* rectangle to the surface size before the scale factor is applied.
*
* The buffer size is calculated by multiplying the surface size by the
* intended scale.
*
* The wl_surface buffer scale should remain set to 1.
*
* If a surface has a surface-local size of 100 px by 50 px and wishes to
* submit buffers with a scale of 1.5, then a buffer of 150px by 75 px should
* be used and the wp_viewport destination rectangle should be 100 px by 50 px.
*
* For toplevel surfaces, the size is rounded halfway away from zero. The
* rounding algorithm for subsurface position and size is not defined.
*
* @section page_ifaces_fractional_scale_v1 Interfaces
* - @subpage page_iface_wp_fractional_scale_manager_v1 - fractional surface scale information
* - @subpage page_iface_wp_fractional_scale_v1 - fractional scale interface to a wl_surface
* @section page_copyright_fractional_scale_v1 Copyright
* <pre>
*
* Copyright © 2022 Kenny Levinsen
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_surface;
struct wp_fractional_scale_manager_v1;
struct wp_fractional_scale_v1;
#ifndef WP_FRACTIONAL_SCALE_MANAGER_V1_INTERFACE
#define WP_FRACTIONAL_SCALE_MANAGER_V1_INTERFACE
/**
* @page page_iface_wp_fractional_scale_manager_v1 wp_fractional_scale_manager_v1
* @section page_iface_wp_fractional_scale_manager_v1_desc Description
*
* A global interface for requesting surfaces to use fractional scales.
* @section page_iface_wp_fractional_scale_manager_v1_api API
* See @ref iface_wp_fractional_scale_manager_v1.
*/
/**
* @defgroup iface_wp_fractional_scale_manager_v1 The wp_fractional_scale_manager_v1 interface
*
* A global interface for requesting surfaces to use fractional scales.
*/
extern const struct wl_interface wp_fractional_scale_manager_v1_interface;
#endif
#ifndef WP_FRACTIONAL_SCALE_V1_INTERFACE
#define WP_FRACTIONAL_SCALE_V1_INTERFACE
/**
* @page page_iface_wp_fractional_scale_v1 wp_fractional_scale_v1
* @section page_iface_wp_fractional_scale_v1_desc Description
*
* An additional interface to a wl_surface object which allows the compositor
* to inform the client of the preferred scale.
* @section page_iface_wp_fractional_scale_v1_api API
* See @ref iface_wp_fractional_scale_v1.
*/
/**
* @defgroup iface_wp_fractional_scale_v1 The wp_fractional_scale_v1 interface
*
* An additional interface to a wl_surface object which allows the compositor
* to inform the client of the preferred scale.
*/
extern const struct wl_interface wp_fractional_scale_v1_interface;
#endif
#ifndef WP_FRACTIONAL_SCALE_MANAGER_V1_ERROR_ENUM
#define WP_FRACTIONAL_SCALE_MANAGER_V1_ERROR_ENUM
enum wp_fractional_scale_manager_v1_error {
/**
* the surface already has a fractional_scale object associated
*/
WP_FRACTIONAL_SCALE_MANAGER_V1_ERROR_FRACTIONAL_SCALE_EXISTS = 0,
};
#endif /* WP_FRACTIONAL_SCALE_MANAGER_V1_ERROR_ENUM */
#define WP_FRACTIONAL_SCALE_MANAGER_V1_DESTROY 0
#define WP_FRACTIONAL_SCALE_MANAGER_V1_GET_FRACTIONAL_SCALE 1
/**
* @ingroup iface_wp_fractional_scale_manager_v1
*/
#define WP_FRACTIONAL_SCALE_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_fractional_scale_manager_v1
*/
#define WP_FRACTIONAL_SCALE_MANAGER_V1_GET_FRACTIONAL_SCALE_SINCE_VERSION 1
/** @ingroup iface_wp_fractional_scale_manager_v1 */
static inline void
wp_fractional_scale_manager_v1_set_user_data(struct wp_fractional_scale_manager_v1 *wp_fractional_scale_manager_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wp_fractional_scale_manager_v1, user_data);
}
/** @ingroup iface_wp_fractional_scale_manager_v1 */
static inline void *
wp_fractional_scale_manager_v1_get_user_data(struct wp_fractional_scale_manager_v1 *wp_fractional_scale_manager_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) wp_fractional_scale_manager_v1);
}
static inline uint32_t
wp_fractional_scale_manager_v1_get_version(struct wp_fractional_scale_manager_v1 *wp_fractional_scale_manager_v1)
{
return wl_proxy_get_version((struct wl_proxy *) wp_fractional_scale_manager_v1);
}
/**
* @ingroup iface_wp_fractional_scale_manager_v1
*
* Informs the server that the client will not be using this protocol
* object anymore. This does not affect any other objects,
* wp_fractional_scale_v1 objects included.
*/
static inline void
wp_fractional_scale_manager_v1_destroy(struct wp_fractional_scale_manager_v1 *wp_fractional_scale_manager_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_fractional_scale_manager_v1,
WP_FRACTIONAL_SCALE_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_fractional_scale_manager_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_wp_fractional_scale_manager_v1
*
* Create an add-on object for the the wl_surface to let the compositor
* request fractional scales. If the given wl_surface already has a
* wp_fractional_scale_v1 object associated, the fractional_scale_exists
* protocol error is raised.
*/
static inline struct wp_fractional_scale_v1 *
wp_fractional_scale_manager_v1_get_fractional_scale(struct wp_fractional_scale_manager_v1 *wp_fractional_scale_manager_v1, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) wp_fractional_scale_manager_v1,
WP_FRACTIONAL_SCALE_MANAGER_V1_GET_FRACTIONAL_SCALE, &wp_fractional_scale_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_fractional_scale_manager_v1), 0, NULL, surface);
return (struct wp_fractional_scale_v1 *) id;
}
/**
* @ingroup iface_wp_fractional_scale_v1
* @struct wp_fractional_scale_v1_listener
*/
struct wp_fractional_scale_v1_listener {
/**
* notify of new preferred scale
*
* Notification of a new preferred scale for this surface that
* the compositor suggests that the client should use.
*
* The sent scale is the numerator of a fraction with a denominator
* of 120.
* @param scale the new preferred scale
*/
void (*preferred_scale)(void *data,
struct wp_fractional_scale_v1 *wp_fractional_scale_v1,
uint32_t scale);
};
/**
* @ingroup iface_wp_fractional_scale_v1
*/
static inline int
wp_fractional_scale_v1_add_listener(struct wp_fractional_scale_v1 *wp_fractional_scale_v1,
const struct wp_fractional_scale_v1_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) wp_fractional_scale_v1,
(void (**)(void)) listener, data);
}
#define WP_FRACTIONAL_SCALE_V1_DESTROY 0
/**
* @ingroup iface_wp_fractional_scale_v1
*/
#define WP_FRACTIONAL_SCALE_V1_PREFERRED_SCALE_SINCE_VERSION 1
/**
* @ingroup iface_wp_fractional_scale_v1
*/
#define WP_FRACTIONAL_SCALE_V1_DESTROY_SINCE_VERSION 1
/** @ingroup iface_wp_fractional_scale_v1 */
static inline void
wp_fractional_scale_v1_set_user_data(struct wp_fractional_scale_v1 *wp_fractional_scale_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wp_fractional_scale_v1, user_data);
}
/** @ingroup iface_wp_fractional_scale_v1 */
static inline void *
wp_fractional_scale_v1_get_user_data(struct wp_fractional_scale_v1 *wp_fractional_scale_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) wp_fractional_scale_v1);
}
static inline uint32_t
wp_fractional_scale_v1_get_version(struct wp_fractional_scale_v1 *wp_fractional_scale_v1)
{
return wl_proxy_get_version((struct wl_proxy *) wp_fractional_scale_v1);
}
/**
* @ingroup iface_wp_fractional_scale_v1
*
* Destroy the fractional scale object. When this object is destroyed,
* preferred_scale events will no longer be sent.
*/
static inline void
wp_fractional_scale_v1_destroy(struct wp_fractional_scale_v1 *wp_fractional_scale_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_fractional_scale_v1,
WP_FRACTIONAL_SCALE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_fractional_scale_v1), WL_MARSHAL_FLAG_DESTROY);
}
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,945 +0,0 @@
/* Generated by wayland-scanner 1.22.0 */
#ifndef INPUT_METHOD_UNSTABLE_V2_CLIENT_PROTOCOL_H
#define INPUT_METHOD_UNSTABLE_V2_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_input_method_unstable_v2 The input_method_unstable_v2 protocol
* Protocol for creating input methods
*
* @section page_desc_input_method_unstable_v2 Description
*
* This protocol allows applications to act as input methods for compositors.
*
* An input method context is used to manage the state of the input method.
*
* Text strings are UTF-8 encoded, their indices and lengths are in bytes.
*
* This document adheres to the RFC 2119 when using words like "must",
* "should", "may", etc.
*
* 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_ifaces_input_method_unstable_v2 Interfaces
* - @subpage page_iface_zwp_input_method_v2 - input method
* - @subpage page_iface_zwp_input_popup_surface_v2 - popup surface
* - @subpage page_iface_zwp_input_method_keyboard_grab_v2 - keyboard grab
* - @subpage page_iface_zwp_input_method_manager_v2 - input method manager
* @section page_copyright_input_method_unstable_v2 Copyright
* <pre>
*
* Copyright © 2008-2011 Kristian Høgsberg
* Copyright © 2010-2011 Intel Corporation
* Copyright © 2012-2013 Collabora, Ltd.
* Copyright © 2012, 2013 Intel Corporation
* Copyright © 2015, 2016 Jan Arne Petersen
* Copyright © 2017, 2018 Red Hat, Inc.
* Copyright © 2018 Purism SPC
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_seat;
struct wl_surface;
struct zwp_input_method_keyboard_grab_v2;
struct zwp_input_method_manager_v2;
struct zwp_input_method_v2;
struct zwp_input_popup_surface_v2;
#ifndef ZWP_INPUT_METHOD_V2_INTERFACE
#define ZWP_INPUT_METHOD_V2_INTERFACE
/**
* @page page_iface_zwp_input_method_v2 zwp_input_method_v2
* @section page_iface_zwp_input_method_v2_desc Description
*
* An input method object allows for clients to compose text.
*
* The objects connects the client to a text input in an application, and
* lets the client to serve as an input method for a seat.
*
* The zwp_input_method_v2 object can occupy two distinct states: active and
* inactive. In the active state, the object is associated to and
* communicates with a text input. In the inactive state, there is no
* associated text input, and the only communication is with the compositor.
* Initially, the input method is in the inactive state.
*
* Requests issued in the inactive state must be accepted by the compositor.
* Because of the serial mechanism, and the state reset on activate event,
* they will not have any effect on the state of the next text input.
*
* There must be no more than one input method object per seat.
* @section page_iface_zwp_input_method_v2_api API
* See @ref iface_zwp_input_method_v2.
*/
/**
* @defgroup iface_zwp_input_method_v2 The zwp_input_method_v2 interface
*
* An input method object allows for clients to compose text.
*
* The objects connects the client to a text input in an application, and
* lets the client to serve as an input method for a seat.
*
* The zwp_input_method_v2 object can occupy two distinct states: active and
* inactive. In the active state, the object is associated to and
* communicates with a text input. In the inactive state, there is no
* associated text input, and the only communication is with the compositor.
* Initially, the input method is in the inactive state.
*
* Requests issued in the inactive state must be accepted by the compositor.
* Because of the serial mechanism, and the state reset on activate event,
* they will not have any effect on the state of the next text input.
*
* There must be no more than one input method object per seat.
*/
extern const struct wl_interface zwp_input_method_v2_interface;
#endif
#ifndef ZWP_INPUT_POPUP_SURFACE_V2_INTERFACE
#define ZWP_INPUT_POPUP_SURFACE_V2_INTERFACE
/**
* @page page_iface_zwp_input_popup_surface_v2 zwp_input_popup_surface_v2
* @section page_iface_zwp_input_popup_surface_v2_desc Description
*
* This interface marks a surface as a popup for interacting with an input
* method.
*
* The compositor should place it near the active text input area. It must
* be visible if and only if the input method is in the active state.
*
* The client must not destroy the underlying wl_surface while the
* zwp_input_popup_surface_v2 object exists.
* @section page_iface_zwp_input_popup_surface_v2_api API
* See @ref iface_zwp_input_popup_surface_v2.
*/
/**
* @defgroup iface_zwp_input_popup_surface_v2 The zwp_input_popup_surface_v2 interface
*
* This interface marks a surface as a popup for interacting with an input
* method.
*
* The compositor should place it near the active text input area. It must
* be visible if and only if the input method is in the active state.
*
* The client must not destroy the underlying wl_surface while the
* zwp_input_popup_surface_v2 object exists.
*/
extern const struct wl_interface zwp_input_popup_surface_v2_interface;
#endif
#ifndef ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_INTERFACE
#define ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_INTERFACE
/**
* @page page_iface_zwp_input_method_keyboard_grab_v2 zwp_input_method_keyboard_grab_v2
* @section page_iface_zwp_input_method_keyboard_grab_v2_desc Description
*
* The zwp_input_method_keyboard_grab_v2 interface represents an exclusive
* grab of the wl_keyboard interface associated with the seat.
* @section page_iface_zwp_input_method_keyboard_grab_v2_api API
* See @ref iface_zwp_input_method_keyboard_grab_v2.
*/
/**
* @defgroup iface_zwp_input_method_keyboard_grab_v2 The zwp_input_method_keyboard_grab_v2 interface
*
* The zwp_input_method_keyboard_grab_v2 interface represents an exclusive
* grab of the wl_keyboard interface associated with the seat.
*/
extern const struct wl_interface zwp_input_method_keyboard_grab_v2_interface;
#endif
#ifndef ZWP_INPUT_METHOD_MANAGER_V2_INTERFACE
#define ZWP_INPUT_METHOD_MANAGER_V2_INTERFACE
/**
* @page page_iface_zwp_input_method_manager_v2 zwp_input_method_manager_v2
* @section page_iface_zwp_input_method_manager_v2_desc Description
*
* The input method manager allows the client to become the input method on
* a chosen seat.
*
* No more than one input method must be associated with any seat at any
* given time.
* @section page_iface_zwp_input_method_manager_v2_api API
* See @ref iface_zwp_input_method_manager_v2.
*/
/**
* @defgroup iface_zwp_input_method_manager_v2 The zwp_input_method_manager_v2 interface
*
* The input method manager allows the client to become the input method on
* a chosen seat.
*
* No more than one input method must be associated with any seat at any
* given time.
*/
extern const struct wl_interface zwp_input_method_manager_v2_interface;
#endif
/**
* @ingroup iface_zwp_input_method_v2
* @struct zwp_input_method_v2_listener
*/
struct zwp_input_method_v2_listener {
/**
* input method has been requested
*
* Notification that a text input focused on this seat requested
* the input method to be activated.
*
* This event serves the purpose of providing the compositor with
* an active input method.
*
* This event resets all state associated with previous enable,
* disable, surrounding_text, text_change_cause, and content_type
* events, as well as the state associated with set_preedit_string,
* commit_string, and delete_surrounding_text requests. In
* addition, it marks the zwp_input_method_v2 object as active, and
* makes any existing zwp_input_popup_surface_v2 objects visible.
*
* The surrounding_text, and content_type events must follow before
* the next done event if the text input supports the respective
* functionality.
*
* State set with this event is double-buffered. It will get
* applied on the next zwp_input_method_v2.done event, and stay
* valid until changed.
*/
void (*activate)(void *data,
struct zwp_input_method_v2 *zwp_input_method_v2);
/**
* deactivate event
*
* Notification that no focused text input currently needs an
* active input method on this seat.
*
* This event marks the zwp_input_method_v2 object as inactive. The
* compositor must make all existing zwp_input_popup_surface_v2
* objects invisible until the next activate event.
*
* State set with this event is double-buffered. It will get
* applied on the next zwp_input_method_v2.done event, and stay
* valid until changed.
*/
void (*deactivate)(void *data,
struct zwp_input_method_v2 *zwp_input_method_v2);
/**
* surrounding text event
*
* Updates the surrounding plain text around the cursor,
* excluding the preedit text.
*
* If any preedit text is present, it is replaced with the cursor
* for the purpose of this event.
*
* The argument text is a buffer containing the preedit string, and
* must include the cursor position, and the complete selection. It
* should contain additional characters before and after these.
* There is a maximum length of wayland messages, so text can not
* be longer than 4000 bytes.
*
* cursor is the byte offset of the cursor within the text buffer.
*
* anchor is the byte offset of the selection anchor within the
* text buffer. If there is no selected text, anchor must be the
* same as cursor.
*
* If this event does not arrive before the first done event, the
* input method may assume that the text input does not support
* this functionality and ignore following surrounding_text events.
*
* Values set with this event are double-buffered. They will get
* applied and set to initial values on the next
* zwp_input_method_v2.done event.
*
* The initial state for affected fields is empty, meaning that the
* text input does not support sending surrounding text. If the
* empty values get applied, subsequent attempts to change them may
* have no effect.
*/
void (*surrounding_text)(void *data,
struct zwp_input_method_v2 *zwp_input_method_v2,
const char *text,
uint32_t cursor,
uint32_t anchor);
/**
* indicates the cause of surrounding text change
*
* Tells the input method why the text surrounding the cursor
* changed.
*
* Whenever the client detects an external change in text, cursor,
* or anchor position, it must issue this request to the
* compositor. This request is intended to give the input method a
* chance to update the preedit text in an appropriate way, e.g. by
* removing it when the user starts typing with a keyboard.
*
* cause describes the source of the change.
*
* The value set with this event is double-buffered. It will get
* applied and set to its initial value on the next
* zwp_input_method_v2.done event.
*
* The initial value of cause is input_method.
*/
void (*text_change_cause)(void *data,
struct zwp_input_method_v2 *zwp_input_method_v2,
uint32_t cause);
/**
* content purpose and hint
*
* Indicates the content type and hint for the current
* zwp_input_method_v2 instance.
*
* Values set with this event are double-buffered. They will get
* applied on the next zwp_input_method_v2.done event.
*
* The initial value for hint is none, and the initial value for
* purpose is normal.
*/
void (*content_type)(void *data,
struct zwp_input_method_v2 *zwp_input_method_v2,
uint32_t hint,
uint32_t purpose);
/**
* apply state
*
* Atomically applies state changes recently sent to the client.
*
* The done event establishes and updates the state of the client,
* and must be issued after any changes to apply them.
*
* Text input state (content purpose, content hint, surrounding
* text, and change cause) is conceptually double-buffered within
* an input method context.
*
* Events modify the pending state, as opposed to the current state
* in use by the input method. A done event atomically applies all
* pending state, replacing the current state. After done, the new
* pending state is as documented for each related request.
*
* Events must be applied in the order of arrival.
*
* Neither current nor pending state are modified unless noted
* otherwise.
*/
void (*done)(void *data,
struct zwp_input_method_v2 *zwp_input_method_v2);
/**
* input method unavailable
*
* The input method ceased to be available.
*
* The compositor must issue this event as the only event on the
* object if there was another input_method object associated with
* the same seat at the time of its creation.
*
* The compositor must issue this request when the object is no
* longer useable, e.g. due to seat removal.
*
* The input method context becomes inert and should be destroyed
* after deactivation is handled. Any further requests and events
* except for the destroy request must be ignored.
*/
void (*unavailable)(void *data,
struct zwp_input_method_v2 *zwp_input_method_v2);
};
/**
* @ingroup iface_zwp_input_method_v2
*/
static inline int
zwp_input_method_v2_add_listener(struct zwp_input_method_v2 *zwp_input_method_v2,
const struct zwp_input_method_v2_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zwp_input_method_v2,
(void (**)(void)) listener, data);
}
#define ZWP_INPUT_METHOD_V2_COMMIT_STRING 0
#define ZWP_INPUT_METHOD_V2_SET_PREEDIT_STRING 1
#define ZWP_INPUT_METHOD_V2_DELETE_SURROUNDING_TEXT 2
#define ZWP_INPUT_METHOD_V2_COMMIT 3
#define ZWP_INPUT_METHOD_V2_GET_INPUT_POPUP_SURFACE 4
#define ZWP_INPUT_METHOD_V2_GRAB_KEYBOARD 5
#define ZWP_INPUT_METHOD_V2_DESTROY 6
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_ACTIVATE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_DEACTIVATE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_SURROUNDING_TEXT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_TEXT_CHANGE_CAUSE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_CONTENT_TYPE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_DONE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_UNAVAILABLE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_COMMIT_STRING_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_SET_PREEDIT_STRING_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_COMMIT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_GET_INPUT_POPUP_SURFACE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_GRAB_KEYBOARD_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_v2
*/
#define ZWP_INPUT_METHOD_V2_DESTROY_SINCE_VERSION 1
/** @ingroup iface_zwp_input_method_v2 */
static inline void
zwp_input_method_v2_set_user_data(struct zwp_input_method_v2 *zwp_input_method_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwp_input_method_v2, user_data);
}
/** @ingroup iface_zwp_input_method_v2 */
static inline void *
zwp_input_method_v2_get_user_data(struct zwp_input_method_v2 *zwp_input_method_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_method_v2);
}
static inline uint32_t
zwp_input_method_v2_get_version(struct zwp_input_method_v2 *zwp_input_method_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2);
}
/**
* @ingroup iface_zwp_input_method_v2
*
* Send the commit string text for insertion to the application.
*
* Inserts a string at current cursor position (see commit event
* sequence). The string to commit could be either just a single character
* after a key press or the result of some composing.
*
* The argument text is a buffer containing the string to insert. There is
* a maximum length of wayland messages, so text can not be longer than
* 4000 bytes.
*
* Values set with this event are double-buffered. They must be applied
* and reset to initial on the next zwp_text_input_v3.commit request.
*
* The initial value of text is an empty string.
*/
static inline void
zwp_input_method_v2_commit_string(struct zwp_input_method_v2 *zwp_input_method_v2, const char *text)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_v2,
ZWP_INPUT_METHOD_V2_COMMIT_STRING, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2), 0, text);
}
/**
* @ingroup iface_zwp_input_method_v2
*
* Send the pre-edit string text to the application text input.
*
* Place a new composing text (pre-edit) at the current cursor position.
* Any previously set composing text must be removed. Any previously
* existing selected text must be removed. The cursor is moved to a new
* position within the preedit string.
*
* The argument text is a buffer containing the preedit string. There is
* a maximum length of wayland messages, so text can not be longer than
* 4000 bytes.
*
* The arguments cursor_begin and cursor_end are counted in bytes relative
* to the beginning of the submitted string buffer. Cursor should be
* hidden by the text input when both are equal to -1.
*
* cursor_begin indicates the beginning of the cursor. cursor_end
* indicates the end of the cursor. It may be equal or different than
* cursor_begin.
*
* Values set with this event are double-buffered. They must be applied on
* the next zwp_input_method_v2.commit event.
*
* The initial value of text is an empty string. The initial value of
* cursor_begin, and cursor_end are both 0.
*/
static inline void
zwp_input_method_v2_set_preedit_string(struct zwp_input_method_v2 *zwp_input_method_v2, const char *text, int32_t cursor_begin, int32_t cursor_end)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_v2,
ZWP_INPUT_METHOD_V2_SET_PREEDIT_STRING, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2), 0, text, cursor_begin, cursor_end);
}
/**
* @ingroup iface_zwp_input_method_v2
*
* Remove the surrounding text.
*
* before_length and after_length are the number of bytes before and after
* the current cursor index (excluding the preedit text) to delete.
*
* If any preedit text is present, it is replaced with the cursor for the
* purpose of this event. In effect before_length is counted from the
* beginning of preedit text, and after_length from its end (see commit
* event sequence).
*
* Values set with this event are double-buffered. They must be applied
* and reset to initial on the next zwp_input_method_v2.commit request.
*
* The initial values of both before_length and after_length are 0.
*/
static inline void
zwp_input_method_v2_delete_surrounding_text(struct zwp_input_method_v2 *zwp_input_method_v2, uint32_t before_length, uint32_t after_length)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_v2,
ZWP_INPUT_METHOD_V2_DELETE_SURROUNDING_TEXT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2), 0, before_length, after_length);
}
/**
* @ingroup iface_zwp_input_method_v2
*
* Apply state changes from commit_string, set_preedit_string and
* delete_surrounding_text requests.
*
* The state relating to these events is double-buffered, and each one
* modifies the pending state. This request replaces the current state
* with the pending state.
*
* The connected text input is expected to proceed by evaluating the
* changes in the following order:
*
* 1. Replace existing preedit string with the cursor.
* 2. Delete requested surrounding text.
* 3. Insert commit string with the cursor at its end.
* 4. Calculate surrounding text to send.
* 5. Insert new preedit text in cursor position.
* 6. Place cursor inside preedit text.
*
* The serial number reflects the last state of the zwp_input_method_v2
* object known to the client. The value of the serial argument must be
* equal to the number of done events already issued by that object. When
* the compositor receives a commit request with a serial different than
* the number of past done events, it must proceed as normal, except it
* should not change the current state of the zwp_input_method_v2 object.
*/
static inline void
zwp_input_method_v2_commit(struct zwp_input_method_v2 *zwp_input_method_v2, uint32_t serial)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_v2,
ZWP_INPUT_METHOD_V2_COMMIT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2), 0, serial);
}
/**
* @ingroup iface_zwp_input_method_v2
*
* Creates a new zwp_input_popup_surface_v2 object wrapping a given
* surface.
*
* The surface gets assigned the "input_popup" role. If the surface
* already has an assigned role, the compositor must issue a protocol
* error.
*/
static inline struct zwp_input_popup_surface_v2 *
zwp_input_method_v2_get_input_popup_surface(struct zwp_input_method_v2 *zwp_input_method_v2, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_v2,
ZWP_INPUT_METHOD_V2_GET_INPUT_POPUP_SURFACE, &zwp_input_popup_surface_v2_interface, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2), 0, NULL, surface);
return (struct zwp_input_popup_surface_v2 *) id;
}
/**
* @ingroup iface_zwp_input_method_v2
*
* Allow 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.
*
* The compositor should send all keyboard events on the seat to the grab
* holder via the returned wl_keyboard object. Nevertheless, the
* compositor may decide not to forward any particular event. The
* compositor must not further process any event after it has been
* forwarded to the grab holder.
*
* Releasing the resulting wl_keyboard object releases the grab.
*/
static inline struct zwp_input_method_keyboard_grab_v2 *
zwp_input_method_v2_grab_keyboard(struct zwp_input_method_v2 *zwp_input_method_v2)
{
struct wl_proxy *keyboard;
keyboard = wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_v2,
ZWP_INPUT_METHOD_V2_GRAB_KEYBOARD, &zwp_input_method_keyboard_grab_v2_interface, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2), 0, NULL);
return (struct zwp_input_method_keyboard_grab_v2 *) keyboard;
}
/**
* @ingroup iface_zwp_input_method_v2
*
* Destroys the zwp_text_input_v2 object and any associated child
* objects, i.e. zwp_input_popup_surface_v2 and
* zwp_input_method_keyboard_grab_v2.
*/
static inline void
zwp_input_method_v2_destroy(struct zwp_input_method_v2 *zwp_input_method_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_v2,
ZWP_INPUT_METHOD_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zwp_input_popup_surface_v2
* @struct zwp_input_popup_surface_v2_listener
*/
struct zwp_input_popup_surface_v2_listener {
/**
* set text input area position
*
* Notify about the position of the area of the text input
* expressed as a rectangle in surface local coordinates.
*
* This is a hint to the input method telling it the relative
* position of the text being entered.
*/
void (*text_input_rectangle)(void *data,
struct zwp_input_popup_surface_v2 *zwp_input_popup_surface_v2,
int32_t x,
int32_t y,
int32_t width,
int32_t height);
};
/**
* @ingroup iface_zwp_input_popup_surface_v2
*/
static inline int
zwp_input_popup_surface_v2_add_listener(struct zwp_input_popup_surface_v2 *zwp_input_popup_surface_v2,
const struct zwp_input_popup_surface_v2_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zwp_input_popup_surface_v2,
(void (**)(void)) listener, data);
}
#define ZWP_INPUT_POPUP_SURFACE_V2_DESTROY 0
/**
* @ingroup iface_zwp_input_popup_surface_v2
*/
#define ZWP_INPUT_POPUP_SURFACE_V2_TEXT_INPUT_RECTANGLE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_popup_surface_v2
*/
#define ZWP_INPUT_POPUP_SURFACE_V2_DESTROY_SINCE_VERSION 1
/** @ingroup iface_zwp_input_popup_surface_v2 */
static inline void
zwp_input_popup_surface_v2_set_user_data(struct zwp_input_popup_surface_v2 *zwp_input_popup_surface_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwp_input_popup_surface_v2, user_data);
}
/** @ingroup iface_zwp_input_popup_surface_v2 */
static inline void *
zwp_input_popup_surface_v2_get_user_data(struct zwp_input_popup_surface_v2 *zwp_input_popup_surface_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_popup_surface_v2);
}
static inline uint32_t
zwp_input_popup_surface_v2_get_version(struct zwp_input_popup_surface_v2 *zwp_input_popup_surface_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zwp_input_popup_surface_v2);
}
/**
* @ingroup iface_zwp_input_popup_surface_v2
*/
static inline void
zwp_input_popup_surface_v2_destroy(struct zwp_input_popup_surface_v2 *zwp_input_popup_surface_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_popup_surface_v2,
ZWP_INPUT_POPUP_SURFACE_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_popup_surface_v2), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zwp_input_method_keyboard_grab_v2
* @struct zwp_input_method_keyboard_grab_v2_listener
*/
struct zwp_input_method_keyboard_grab_v2_listener {
/**
* keyboard mapping
*
* This event provides a file descriptor to the client which can
* be memory-mapped to provide a keyboard mapping description.
* @param format keymap format
* @param fd keymap file descriptor
* @param size keymap size, in bytes
*/
void (*keymap)(void *data,
struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2,
uint32_t format,
int32_t fd,
uint32_t size);
/**
* key event
*
* A key was pressed or released. The time argument is a
* timestamp with millisecond granularity, with an undefined base.
* @param serial serial number of the key event
* @param time timestamp with millisecond granularity
* @param key key that produced the event
* @param state physical state of the key
*/
void (*key)(void *data,
struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2,
uint32_t serial,
uint32_t time,
uint32_t key,
uint32_t state);
/**
* modifier and group state
*
* Notifies clients that the modifier and/or group state has
* changed, and it should update its local state.
* @param serial serial number of the modifiers event
* @param mods_depressed depressed modifiers
* @param mods_latched latched modifiers
* @param mods_locked locked modifiers
* @param group keyboard layout
*/
void (*modifiers)(void *data,
struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2,
uint32_t serial,
uint32_t mods_depressed,
uint32_t mods_latched,
uint32_t mods_locked,
uint32_t group);
/**
* repeat rate and delay
*
* Informs the client about the keyboard's repeat rate and delay.
*
* This event is sent as soon as the
* zwp_input_method_keyboard_grab_v2 object has been created, and
* is guaranteed to be received by the client before any key press
* event.
*
* Negative values for either rate or delay are illegal. A rate of
* zero will disable any repeating (regardless of the value of
* delay).
*
* This event can be sent later on as well with a new value if
* necessary, so clients should continue listening for the event
* past the creation of zwp_input_method_keyboard_grab_v2.
* @param rate the rate of repeating keys in characters per second
* @param delay delay in milliseconds since key down until repeating starts
*/
void (*repeat_info)(void *data,
struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2,
int32_t rate,
int32_t delay);
};
/**
* @ingroup iface_zwp_input_method_keyboard_grab_v2
*/
static inline int
zwp_input_method_keyboard_grab_v2_add_listener(struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2,
const struct zwp_input_method_keyboard_grab_v2_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zwp_input_method_keyboard_grab_v2,
(void (**)(void)) listener, data);
}
#define ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_RELEASE 0
/**
* @ingroup iface_zwp_input_method_keyboard_grab_v2
*/
#define ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_KEYMAP_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_keyboard_grab_v2
*/
#define ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_KEY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_keyboard_grab_v2
*/
#define ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_MODIFIERS_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_keyboard_grab_v2
*/
#define ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_REPEAT_INFO_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_keyboard_grab_v2
*/
#define ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_RELEASE_SINCE_VERSION 1
/** @ingroup iface_zwp_input_method_keyboard_grab_v2 */
static inline void
zwp_input_method_keyboard_grab_v2_set_user_data(struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwp_input_method_keyboard_grab_v2, user_data);
}
/** @ingroup iface_zwp_input_method_keyboard_grab_v2 */
static inline void *
zwp_input_method_keyboard_grab_v2_get_user_data(struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_method_keyboard_grab_v2);
}
static inline uint32_t
zwp_input_method_keyboard_grab_v2_get_version(struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zwp_input_method_keyboard_grab_v2);
}
/** @ingroup iface_zwp_input_method_keyboard_grab_v2 */
static inline void
zwp_input_method_keyboard_grab_v2_destroy(struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2)
{
wl_proxy_destroy((struct wl_proxy *) zwp_input_method_keyboard_grab_v2);
}
/**
* @ingroup iface_zwp_input_method_keyboard_grab_v2
*/
static inline void
zwp_input_method_keyboard_grab_v2_release(struct zwp_input_method_keyboard_grab_v2 *zwp_input_method_keyboard_grab_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_keyboard_grab_v2,
ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_keyboard_grab_v2), WL_MARSHAL_FLAG_DESTROY);
}
#define ZWP_INPUT_METHOD_MANAGER_V2_GET_INPUT_METHOD 0
#define ZWP_INPUT_METHOD_MANAGER_V2_DESTROY 1
/**
* @ingroup iface_zwp_input_method_manager_v2
*/
#define ZWP_INPUT_METHOD_MANAGER_V2_GET_INPUT_METHOD_SINCE_VERSION 1
/**
* @ingroup iface_zwp_input_method_manager_v2
*/
#define ZWP_INPUT_METHOD_MANAGER_V2_DESTROY_SINCE_VERSION 1
/** @ingroup iface_zwp_input_method_manager_v2 */
static inline void
zwp_input_method_manager_v2_set_user_data(struct zwp_input_method_manager_v2 *zwp_input_method_manager_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwp_input_method_manager_v2, user_data);
}
/** @ingroup iface_zwp_input_method_manager_v2 */
static inline void *
zwp_input_method_manager_v2_get_user_data(struct zwp_input_method_manager_v2 *zwp_input_method_manager_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_method_manager_v2);
}
static inline uint32_t
zwp_input_method_manager_v2_get_version(struct zwp_input_method_manager_v2 *zwp_input_method_manager_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zwp_input_method_manager_v2);
}
/**
* @ingroup iface_zwp_input_method_manager_v2
*
* Request a new input zwp_input_method_v2 object associated with a given
* seat.
*/
static inline struct zwp_input_method_v2 *
zwp_input_method_manager_v2_get_input_method(struct zwp_input_method_manager_v2 *zwp_input_method_manager_v2, struct wl_seat *seat)
{
struct wl_proxy *input_method;
input_method = wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_manager_v2,
ZWP_INPUT_METHOD_MANAGER_V2_GET_INPUT_METHOD, &zwp_input_method_v2_interface, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_manager_v2), 0, seat, NULL);
return (struct zwp_input_method_v2 *) input_method;
}
/**
* @ingroup iface_zwp_input_method_manager_v2
*
* Destroys the zwp_input_method_manager_v2 object.
*
* The zwp_input_method_v2 objects originating from it remain valid.
*/
static inline void
zwp_input_method_manager_v2_destroy(struct zwp_input_method_manager_v2 *zwp_input_method_manager_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_manager_v2,
ZWP_INPUT_METHOD_MANAGER_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_manager_v2), WL_MARSHAL_FLAG_DESTROY);
}
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,398 +0,0 @@
/* Generated by wayland-scanner 1.22.0 */
#ifndef VIEWPORTER_CLIENT_PROTOCOL_H
#define VIEWPORTER_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_viewporter The viewporter protocol
* @section page_ifaces_viewporter Interfaces
* - @subpage page_iface_wp_viewporter - surface cropping and scaling
* - @subpage page_iface_wp_viewport - crop and scale interface to a wl_surface
* @section page_copyright_viewporter Copyright
* <pre>
*
* Copyright © 2013-2016 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_surface;
struct wp_viewport;
struct wp_viewporter;
#ifndef WP_VIEWPORTER_INTERFACE
#define WP_VIEWPORTER_INTERFACE
/**
* @page page_iface_wp_viewporter wp_viewporter
* @section page_iface_wp_viewporter_desc Description
*
* The global interface exposing surface cropping and scaling
* capabilities is used to instantiate an interface extension for a
* wl_surface object. This extended interface will then allow
* cropping and scaling the surface contents, effectively
* disconnecting the direct relationship between the buffer and the
* surface size.
* @section page_iface_wp_viewporter_api API
* See @ref iface_wp_viewporter.
*/
/**
* @defgroup iface_wp_viewporter The wp_viewporter interface
*
* The global interface exposing surface cropping and scaling
* capabilities is used to instantiate an interface extension for a
* wl_surface object. This extended interface will then allow
* cropping and scaling the surface contents, effectively
* disconnecting the direct relationship between the buffer and the
* surface size.
*/
extern const struct wl_interface wp_viewporter_interface;
#endif
#ifndef WP_VIEWPORT_INTERFACE
#define WP_VIEWPORT_INTERFACE
/**
* @page page_iface_wp_viewport wp_viewport
* @section page_iface_wp_viewport_desc Description
*
* An additional interface to a wl_surface object, which allows the
* client to specify the cropping and scaling of the surface
* contents.
*
* This interface works with two concepts: the source rectangle (src_x,
* src_y, src_width, src_height), and the destination size (dst_width,
* dst_height). The contents of the source rectangle are scaled to the
* destination size, and content outside the source rectangle is ignored.
* This state is double-buffered, and is applied on the next
* wl_surface.commit.
*
* The two parts of crop and scale state are independent: the source
* rectangle, and the destination size. Initially both are unset, that
* is, no scaling is applied. The whole of the current wl_buffer is
* used as the source, and the surface size is as defined in
* wl_surface.attach.
*
* If the destination size is set, it causes the surface size to become
* dst_width, dst_height. The source (rectangle) is scaled to exactly
* this size. This overrides whatever the attached wl_buffer size is,
* unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
* has no content and therefore no size. Otherwise, the size is always
* at least 1x1 in surface local coordinates.
*
* If the source rectangle is set, it defines what area of the wl_buffer is
* taken as the source. If the source rectangle is set and the destination
* size is not set, then src_width and src_height must be integers, and the
* surface size becomes the source rectangle size. This results in cropping
* without scaling. If src_width or src_height are not integers and
* destination size is not set, the bad_size protocol error is raised when
* the surface state is applied.
*
* The coordinate transformations from buffer pixel coordinates up to
* the surface-local coordinates happen in the following order:
* 1. buffer_transform (wl_surface.set_buffer_transform)
* 2. buffer_scale (wl_surface.set_buffer_scale)
* 3. crop and scale (wp_viewport.set*)
* This means, that the source rectangle coordinates of crop and scale
* are given in the coordinates after the buffer transform and scale,
* i.e. in the coordinates that would be the surface-local coordinates
* if the crop and scale was not applied.
*
* If src_x or src_y are negative, the bad_value protocol error is raised.
* Otherwise, if the source rectangle is partially or completely outside of
* the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
* when the surface state is applied. A NULL wl_buffer does not raise the
* out_of_buffer error.
*
* If the wl_surface associated with the wp_viewport is destroyed,
* all wp_viewport requests except 'destroy' raise the protocol error
* no_surface.
*
* If the wp_viewport object is destroyed, the crop and scale
* state is removed from the wl_surface. The change will be applied
* on the next wl_surface.commit.
* @section page_iface_wp_viewport_api API
* See @ref iface_wp_viewport.
*/
/**
* @defgroup iface_wp_viewport The wp_viewport interface
*
* An additional interface to a wl_surface object, which allows the
* client to specify the cropping and scaling of the surface
* contents.
*
* This interface works with two concepts: the source rectangle (src_x,
* src_y, src_width, src_height), and the destination size (dst_width,
* dst_height). The contents of the source rectangle are scaled to the
* destination size, and content outside the source rectangle is ignored.
* This state is double-buffered, and is applied on the next
* wl_surface.commit.
*
* The two parts of crop and scale state are independent: the source
* rectangle, and the destination size. Initially both are unset, that
* is, no scaling is applied. The whole of the current wl_buffer is
* used as the source, and the surface size is as defined in
* wl_surface.attach.
*
* If the destination size is set, it causes the surface size to become
* dst_width, dst_height. The source (rectangle) is scaled to exactly
* this size. This overrides whatever the attached wl_buffer size is,
* unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
* has no content and therefore no size. Otherwise, the size is always
* at least 1x1 in surface local coordinates.
*
* If the source rectangle is set, it defines what area of the wl_buffer is
* taken as the source. If the source rectangle is set and the destination
* size is not set, then src_width and src_height must be integers, and the
* surface size becomes the source rectangle size. This results in cropping
* without scaling. If src_width or src_height are not integers and
* destination size is not set, the bad_size protocol error is raised when
* the surface state is applied.
*
* The coordinate transformations from buffer pixel coordinates up to
* the surface-local coordinates happen in the following order:
* 1. buffer_transform (wl_surface.set_buffer_transform)
* 2. buffer_scale (wl_surface.set_buffer_scale)
* 3. crop and scale (wp_viewport.set*)
* This means, that the source rectangle coordinates of crop and scale
* are given in the coordinates after the buffer transform and scale,
* i.e. in the coordinates that would be the surface-local coordinates
* if the crop and scale was not applied.
*
* If src_x or src_y are negative, the bad_value protocol error is raised.
* Otherwise, if the source rectangle is partially or completely outside of
* the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
* when the surface state is applied. A NULL wl_buffer does not raise the
* out_of_buffer error.
*
* If the wl_surface associated with the wp_viewport is destroyed,
* all wp_viewport requests except 'destroy' raise the protocol error
* no_surface.
*
* If the wp_viewport object is destroyed, the crop and scale
* state is removed from the wl_surface. The change will be applied
* on the next wl_surface.commit.
*/
extern const struct wl_interface wp_viewport_interface;
#endif
#ifndef WP_VIEWPORTER_ERROR_ENUM
#define WP_VIEWPORTER_ERROR_ENUM
enum wp_viewporter_error {
/**
* the surface already has a viewport object associated
*/
WP_VIEWPORTER_ERROR_VIEWPORT_EXISTS = 0,
};
#endif /* WP_VIEWPORTER_ERROR_ENUM */
#define WP_VIEWPORTER_DESTROY 0
#define WP_VIEWPORTER_GET_VIEWPORT 1
/**
* @ingroup iface_wp_viewporter
*/
#define WP_VIEWPORTER_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_viewporter
*/
#define WP_VIEWPORTER_GET_VIEWPORT_SINCE_VERSION 1
/** @ingroup iface_wp_viewporter */
static inline void
wp_viewporter_set_user_data(struct wp_viewporter *wp_viewporter, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wp_viewporter, user_data);
}
/** @ingroup iface_wp_viewporter */
static inline void *
wp_viewporter_get_user_data(struct wp_viewporter *wp_viewporter)
{
return wl_proxy_get_user_data((struct wl_proxy *) wp_viewporter);
}
static inline uint32_t
wp_viewporter_get_version(struct wp_viewporter *wp_viewporter)
{
return wl_proxy_get_version((struct wl_proxy *) wp_viewporter);
}
/**
* @ingroup iface_wp_viewporter
*
* Informs the server that the client will not be using this
* protocol object anymore. This does not affect any other objects,
* wp_viewport objects included.
*/
static inline void
wp_viewporter_destroy(struct wp_viewporter *wp_viewporter)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_viewporter,
WP_VIEWPORTER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_viewporter), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_wp_viewporter
*
* Instantiate an interface extension for the given wl_surface to
* crop and scale its content. If the given wl_surface already has
* a wp_viewport object associated, the viewport_exists
* protocol error is raised.
*/
static inline struct wp_viewport *
wp_viewporter_get_viewport(struct wp_viewporter *wp_viewporter, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) wp_viewporter,
WP_VIEWPORTER_GET_VIEWPORT, &wp_viewport_interface, wl_proxy_get_version((struct wl_proxy *) wp_viewporter), 0, NULL, surface);
return (struct wp_viewport *) id;
}
#ifndef WP_VIEWPORT_ERROR_ENUM
#define WP_VIEWPORT_ERROR_ENUM
enum wp_viewport_error {
/**
* negative or zero values in width or height
*/
WP_VIEWPORT_ERROR_BAD_VALUE = 0,
/**
* destination size is not integer
*/
WP_VIEWPORT_ERROR_BAD_SIZE = 1,
/**
* source rectangle extends outside of the content area
*/
WP_VIEWPORT_ERROR_OUT_OF_BUFFER = 2,
/**
* the wl_surface was destroyed
*/
WP_VIEWPORT_ERROR_NO_SURFACE = 3,
};
#endif /* WP_VIEWPORT_ERROR_ENUM */
#define WP_VIEWPORT_DESTROY 0
#define WP_VIEWPORT_SET_SOURCE 1
#define WP_VIEWPORT_SET_DESTINATION 2
/**
* @ingroup iface_wp_viewport
*/
#define WP_VIEWPORT_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_viewport
*/
#define WP_VIEWPORT_SET_SOURCE_SINCE_VERSION 1
/**
* @ingroup iface_wp_viewport
*/
#define WP_VIEWPORT_SET_DESTINATION_SINCE_VERSION 1
/** @ingroup iface_wp_viewport */
static inline void
wp_viewport_set_user_data(struct wp_viewport *wp_viewport, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wp_viewport, user_data);
}
/** @ingroup iface_wp_viewport */
static inline void *
wp_viewport_get_user_data(struct wp_viewport *wp_viewport)
{
return wl_proxy_get_user_data((struct wl_proxy *) wp_viewport);
}
static inline uint32_t
wp_viewport_get_version(struct wp_viewport *wp_viewport)
{
return wl_proxy_get_version((struct wl_proxy *) wp_viewport);
}
/**
* @ingroup iface_wp_viewport
*
* The associated wl_surface's crop and scale state is removed.
* The change is applied on the next wl_surface.commit.
*/
static inline void
wp_viewport_destroy(struct wp_viewport *wp_viewport)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_viewport,
WP_VIEWPORT_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_viewport), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_wp_viewport
*
* Set the source rectangle of the associated wl_surface. See
* wp_viewport for the description, and relation to the wl_buffer
* size.
*
* If all of x, y, width and height are -1.0, the source rectangle is
* unset instead. Any other set of values where width or height are zero
* or negative, or x or y are negative, raise the bad_value protocol
* error.
*
* The crop and scale state is double-buffered state, and will be
* applied on the next wl_surface.commit.
*/
static inline void
wp_viewport_set_source(struct wp_viewport *wp_viewport, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_viewport,
WP_VIEWPORT_SET_SOURCE, NULL, wl_proxy_get_version((struct wl_proxy *) wp_viewport), 0, x, y, width, height);
}
/**
* @ingroup iface_wp_viewport
*
* Set the destination size of the associated wl_surface. See
* wp_viewport for the description, and relation to the wl_buffer
* size.
*
* If width is -1 and height is -1, the destination size is unset
* instead. Any other pair of values for width and height that
* contains zero or negative values raises the bad_value protocol
* error.
*
* The crop and scale state is double-buffered state, and will be
* applied on the next wl_surface.commit.
*/
static inline void
wp_viewport_set_destination(struct wp_viewport *wp_viewport, int32_t width, int32_t height)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_viewport,
WP_VIEWPORT_SET_DESTINATION, NULL, wl_proxy_get_version((struct wl_proxy *) wp_viewport), 0, width, height);
}
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,280 +0,0 @@
/* Generated by wayland-scanner 1.22.0 */
#ifndef VIRTUAL_KEYBOARD_UNSTABLE_V1_CLIENT_PROTOCOL_H
#define VIRTUAL_KEYBOARD_UNSTABLE_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_virtual_keyboard_unstable_v1 The virtual_keyboard_unstable_v1 protocol
* @section page_ifaces_virtual_keyboard_unstable_v1 Interfaces
* - @subpage page_iface_zwp_virtual_keyboard_v1 - virtual keyboard
* - @subpage page_iface_zwp_virtual_keyboard_manager_v1 - virtual keyboard manager
* @section page_copyright_virtual_keyboard_unstable_v1 Copyright
* <pre>
*
* Copyright © 2008-2011 Kristian Høgsberg
* Copyright © 2010-2013 Intel Corporation
* Copyright © 2012-2013 Collabora, Ltd.
* Copyright © 2018 Purism SPC
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_seat;
struct zwp_virtual_keyboard_manager_v1;
struct zwp_virtual_keyboard_v1;
#ifndef ZWP_VIRTUAL_KEYBOARD_V1_INTERFACE
#define ZWP_VIRTUAL_KEYBOARD_V1_INTERFACE
/**
* @page page_iface_zwp_virtual_keyboard_v1 zwp_virtual_keyboard_v1
* @section page_iface_zwp_virtual_keyboard_v1_desc Description
*
* The virtual keyboard provides an application with requests which emulate
* the behaviour of a physical keyboard.
*
* This interface can be used by clients on its own to provide raw input
* events, or it can accompany the input method protocol.
* @section page_iface_zwp_virtual_keyboard_v1_api API
* See @ref iface_zwp_virtual_keyboard_v1.
*/
/**
* @defgroup iface_zwp_virtual_keyboard_v1 The zwp_virtual_keyboard_v1 interface
*
* The virtual keyboard provides an application with requests which emulate
* the behaviour of a physical keyboard.
*
* This interface can be used by clients on its own to provide raw input
* events, or it can accompany the input method protocol.
*/
extern const struct wl_interface zwp_virtual_keyboard_v1_interface;
#endif
#ifndef ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_INTERFACE
#define ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_INTERFACE
/**
* @page page_iface_zwp_virtual_keyboard_manager_v1 zwp_virtual_keyboard_manager_v1
* @section page_iface_zwp_virtual_keyboard_manager_v1_desc Description
*
* A virtual keyboard manager allows an application to provide keyboard
* input events as if they came from a physical keyboard.
* @section page_iface_zwp_virtual_keyboard_manager_v1_api API
* See @ref iface_zwp_virtual_keyboard_manager_v1.
*/
/**
* @defgroup iface_zwp_virtual_keyboard_manager_v1 The zwp_virtual_keyboard_manager_v1 interface
*
* A virtual keyboard manager allows an application to provide keyboard
* input events as if they came from a physical keyboard.
*/
extern const struct wl_interface zwp_virtual_keyboard_manager_v1_interface;
#endif
#ifndef ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM
#define ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM
enum zwp_virtual_keyboard_v1_error {
/**
* No keymap was set
*/
ZWP_VIRTUAL_KEYBOARD_V1_ERROR_NO_KEYMAP = 0,
};
#endif /* ZWP_VIRTUAL_KEYBOARD_V1_ERROR_ENUM */
#define ZWP_VIRTUAL_KEYBOARD_V1_KEYMAP 0
#define ZWP_VIRTUAL_KEYBOARD_V1_KEY 1
#define ZWP_VIRTUAL_KEYBOARD_V1_MODIFIERS 2
#define ZWP_VIRTUAL_KEYBOARD_V1_DESTROY 3
/**
* @ingroup iface_zwp_virtual_keyboard_v1
*/
#define ZWP_VIRTUAL_KEYBOARD_V1_KEYMAP_SINCE_VERSION 1
/**
* @ingroup iface_zwp_virtual_keyboard_v1
*/
#define ZWP_VIRTUAL_KEYBOARD_V1_KEY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_virtual_keyboard_v1
*/
#define ZWP_VIRTUAL_KEYBOARD_V1_MODIFIERS_SINCE_VERSION 1
/**
* @ingroup iface_zwp_virtual_keyboard_v1
*/
#define ZWP_VIRTUAL_KEYBOARD_V1_DESTROY_SINCE_VERSION 1
/** @ingroup iface_zwp_virtual_keyboard_v1 */
static inline void
zwp_virtual_keyboard_v1_set_user_data(struct zwp_virtual_keyboard_v1 *zwp_virtual_keyboard_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwp_virtual_keyboard_v1, user_data);
}
/** @ingroup iface_zwp_virtual_keyboard_v1 */
static inline void *
zwp_virtual_keyboard_v1_get_user_data(struct zwp_virtual_keyboard_v1 *zwp_virtual_keyboard_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_virtual_keyboard_v1);
}
static inline uint32_t
zwp_virtual_keyboard_v1_get_version(struct zwp_virtual_keyboard_v1 *zwp_virtual_keyboard_v1)
{
return wl_proxy_get_version((struct wl_proxy *) zwp_virtual_keyboard_v1);
}
/**
* @ingroup iface_zwp_virtual_keyboard_v1
*
* Provide a file descriptor to the compositor which can be
* memory-mapped to provide a keyboard mapping description.
*
* Format carries a value from the keymap_format enumeration.
*/
static inline void
zwp_virtual_keyboard_v1_keymap(struct zwp_virtual_keyboard_v1 *zwp_virtual_keyboard_v1, uint32_t format, int32_t fd, uint32_t size)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_virtual_keyboard_v1,
ZWP_VIRTUAL_KEYBOARD_V1_KEYMAP, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_virtual_keyboard_v1), 0, format, fd, size);
}
/**
* @ingroup iface_zwp_virtual_keyboard_v1
*
* A key was pressed or released.
* The time argument is a timestamp with millisecond granularity, with an
* undefined base. All requests regarding a single object must share the
* same clock.
*
* Keymap must be set before issuing this request.
*
* State carries a value from the key_state enumeration.
*/
static inline void
zwp_virtual_keyboard_v1_key(struct zwp_virtual_keyboard_v1 *zwp_virtual_keyboard_v1, uint32_t time, uint32_t key, uint32_t state)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_virtual_keyboard_v1,
ZWP_VIRTUAL_KEYBOARD_V1_KEY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_virtual_keyboard_v1), 0, time, key, state);
}
/**
* @ingroup iface_zwp_virtual_keyboard_v1
*
* Notifies the compositor that the modifier and/or group state has
* changed, and it should update state.
*
* The client should use wl_keyboard.modifiers event to synchronize its
* internal state with seat state.
*
* Keymap must be set before issuing this request.
*/
static inline void
zwp_virtual_keyboard_v1_modifiers(struct zwp_virtual_keyboard_v1 *zwp_virtual_keyboard_v1, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_virtual_keyboard_v1,
ZWP_VIRTUAL_KEYBOARD_V1_MODIFIERS, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_virtual_keyboard_v1), 0, mods_depressed, mods_latched, mods_locked, group);
}
/**
* @ingroup iface_zwp_virtual_keyboard_v1
*/
static inline void
zwp_virtual_keyboard_v1_destroy(struct zwp_virtual_keyboard_v1 *zwp_virtual_keyboard_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_virtual_keyboard_v1,
ZWP_VIRTUAL_KEYBOARD_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_virtual_keyboard_v1), WL_MARSHAL_FLAG_DESTROY);
}
#ifndef ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM
#define ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM
enum zwp_virtual_keyboard_manager_v1_error {
/**
* client not authorized to use the interface
*/
ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_UNAUTHORIZED = 0,
};
#endif /* ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_ERROR_ENUM */
#define ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_CREATE_VIRTUAL_KEYBOARD 0
/**
* @ingroup iface_zwp_virtual_keyboard_manager_v1
*/
#define ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_CREATE_VIRTUAL_KEYBOARD_SINCE_VERSION 1
/** @ingroup iface_zwp_virtual_keyboard_manager_v1 */
static inline void
zwp_virtual_keyboard_manager_v1_set_user_data(struct zwp_virtual_keyboard_manager_v1 *zwp_virtual_keyboard_manager_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwp_virtual_keyboard_manager_v1, user_data);
}
/** @ingroup iface_zwp_virtual_keyboard_manager_v1 */
static inline void *
zwp_virtual_keyboard_manager_v1_get_user_data(struct zwp_virtual_keyboard_manager_v1 *zwp_virtual_keyboard_manager_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_virtual_keyboard_manager_v1);
}
static inline uint32_t
zwp_virtual_keyboard_manager_v1_get_version(struct zwp_virtual_keyboard_manager_v1 *zwp_virtual_keyboard_manager_v1)
{
return wl_proxy_get_version((struct wl_proxy *) zwp_virtual_keyboard_manager_v1);
}
/** @ingroup iface_zwp_virtual_keyboard_manager_v1 */
static inline void
zwp_virtual_keyboard_manager_v1_destroy(struct zwp_virtual_keyboard_manager_v1 *zwp_virtual_keyboard_manager_v1)
{
wl_proxy_destroy((struct wl_proxy *) zwp_virtual_keyboard_manager_v1);
}
/**
* @ingroup iface_zwp_virtual_keyboard_manager_v1
*
* Creates a new virtual keyboard associated to a seat.
*
* If the compositor enables a keyboard to perform arbitrary actions, it
* should present an error when an untrusted client requests a new
* keyboard.
*/
static inline struct zwp_virtual_keyboard_v1 *
zwp_virtual_keyboard_manager_v1_create_virtual_keyboard(struct zwp_virtual_keyboard_manager_v1 *zwp_virtual_keyboard_manager_v1, struct wl_seat *seat)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_virtual_keyboard_manager_v1,
ZWP_VIRTUAL_KEYBOARD_MANAGER_V1_CREATE_VIRTUAL_KEYBOARD, &zwp_virtual_keyboard_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_virtual_keyboard_manager_v1), 0, seat, NULL);
return (struct zwp_virtual_keyboard_v1 *) id;
}
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,706 +0,0 @@
/* Generated by wayland-scanner 1.22.0 */
#ifndef WLR_LAYER_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H
#define WLR_LAYER_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_wlr_layer_shell_unstable_v1 The wlr_layer_shell_unstable_v1 protocol
* @section page_ifaces_wlr_layer_shell_unstable_v1 Interfaces
* - @subpage page_iface_zwlr_layer_shell_v1 - create surfaces that are layers of the desktop
* - @subpage page_iface_zwlr_layer_surface_v1 - layer metadata interface
* @section page_copyright_wlr_layer_shell_unstable_v1 Copyright
* <pre>
*
* Copyright © 2017 Drew DeVault
*
* 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_output;
struct wl_surface;
struct xdg_popup;
struct zwlr_layer_shell_v1;
struct zwlr_layer_surface_v1;
#ifndef ZWLR_LAYER_SHELL_V1_INTERFACE
#define ZWLR_LAYER_SHELL_V1_INTERFACE
/**
* @page page_iface_zwlr_layer_shell_v1 zwlr_layer_shell_v1
* @section page_iface_zwlr_layer_shell_v1_desc Description
*
* Clients can use this interface to assign the surface_layer role to
* wl_surfaces. Such surfaces are assigned to a "layer" of the output and
* rendered with a defined z-depth respective to each other. They may also be
* anchored to the edges and corners of a screen and specify input handling
* semantics. This interface should be suitable for the implementation of
* many desktop shell components, and a broad number of other applications
* that interact with the desktop.
* @section page_iface_zwlr_layer_shell_v1_api API
* See @ref iface_zwlr_layer_shell_v1.
*/
/**
* @defgroup iface_zwlr_layer_shell_v1 The zwlr_layer_shell_v1 interface
*
* Clients can use this interface to assign the surface_layer role to
* wl_surfaces. Such surfaces are assigned to a "layer" of the output and
* rendered with a defined z-depth respective to each other. They may also be
* anchored to the edges and corners of a screen and specify input handling
* semantics. This interface should be suitable for the implementation of
* many desktop shell components, and a broad number of other applications
* that interact with the desktop.
*/
extern const struct wl_interface zwlr_layer_shell_v1_interface;
#endif
#ifndef ZWLR_LAYER_SURFACE_V1_INTERFACE
#define ZWLR_LAYER_SURFACE_V1_INTERFACE
/**
* @page page_iface_zwlr_layer_surface_v1 zwlr_layer_surface_v1
* @section page_iface_zwlr_layer_surface_v1_desc Description
*
* An interface that may be implemented by a wl_surface, for surfaces that
* are designed to be rendered as a layer of a stacked desktop-like
* environment.
*
* Layer surface state (layer, size, anchor, exclusive zone,
* margin, interactivity) is double-buffered, and will be applied at the
* time wl_surface.commit of the corresponding wl_surface is called.
*
* Attaching a null buffer to a layer surface unmaps it.
*
* Unmapping a layer_surface means that the surface cannot be shown by the
* compositor until it is explicitly mapped again. The layer_surface
* returns to the state it had right after layer_shell.get_layer_surface.
* The client can re-map the surface by performing a commit without any
* buffer attached, waiting for a configure event and handling it as usual.
* @section page_iface_zwlr_layer_surface_v1_api API
* See @ref iface_zwlr_layer_surface_v1.
*/
/**
* @defgroup iface_zwlr_layer_surface_v1 The zwlr_layer_surface_v1 interface
*
* An interface that may be implemented by a wl_surface, for surfaces that
* are designed to be rendered as a layer of a stacked desktop-like
* environment.
*
* Layer surface state (layer, size, anchor, exclusive zone,
* margin, interactivity) is double-buffered, and will be applied at the
* time wl_surface.commit of the corresponding wl_surface is called.
*
* Attaching a null buffer to a layer surface unmaps it.
*
* Unmapping a layer_surface means that the surface cannot be shown by the
* compositor until it is explicitly mapped again. The layer_surface
* returns to the state it had right after layer_shell.get_layer_surface.
* The client can re-map the surface by performing a commit without any
* buffer attached, waiting for a configure event and handling it as usual.
*/
extern const struct wl_interface zwlr_layer_surface_v1_interface;
#endif
#ifndef ZWLR_LAYER_SHELL_V1_ERROR_ENUM
#define ZWLR_LAYER_SHELL_V1_ERROR_ENUM
enum zwlr_layer_shell_v1_error {
/**
* wl_surface has another role
*/
ZWLR_LAYER_SHELL_V1_ERROR_ROLE = 0,
/**
* layer value is invalid
*/
ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER = 1,
/**
* wl_surface has a buffer attached or committed
*/
ZWLR_LAYER_SHELL_V1_ERROR_ALREADY_CONSTRUCTED = 2,
};
#endif /* ZWLR_LAYER_SHELL_V1_ERROR_ENUM */
#ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM
#define ZWLR_LAYER_SHELL_V1_LAYER_ENUM
/**
* @ingroup iface_zwlr_layer_shell_v1
* available layers for surfaces
*
* These values indicate which layers a surface can be rendered in. They
* are ordered by z depth, bottom-most first. Traditional shell surfaces
* will typically be rendered between the bottom and top layers.
* Fullscreen shell surfaces are typically rendered at the top layer.
* Multiple surfaces can share a single layer, and ordering within a
* single layer is undefined.
*/
enum zwlr_layer_shell_v1_layer {
ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND = 0,
ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM = 1,
ZWLR_LAYER_SHELL_V1_LAYER_TOP = 2,
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY = 3,
};
#endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM */
#define ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE 0
#define ZWLR_LAYER_SHELL_V1_DESTROY 1
/**
* @ingroup iface_zwlr_layer_shell_v1
*/
#define ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_shell_v1
*/
#define ZWLR_LAYER_SHELL_V1_DESTROY_SINCE_VERSION 3
/** @ingroup iface_zwlr_layer_shell_v1 */
static inline void
zwlr_layer_shell_v1_set_user_data(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwlr_layer_shell_v1, user_data);
}
/** @ingroup iface_zwlr_layer_shell_v1 */
static inline void *
zwlr_layer_shell_v1_get_user_data(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwlr_layer_shell_v1);
}
static inline uint32_t
zwlr_layer_shell_v1_get_version(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1)
{
return wl_proxy_get_version((struct wl_proxy *) zwlr_layer_shell_v1);
}
/**
* @ingroup iface_zwlr_layer_shell_v1
*
* Create a layer surface for an existing surface. This assigns the role of
* layer_surface, or raises a protocol error if another role is already
* assigned.
*
* Creating a layer surface from a wl_surface which has a buffer attached
* or committed is a client error, and any attempts by a client to attach
* or manipulate a buffer prior to the first layer_surface.configure call
* must also be treated as errors.
*
* After creating a layer_surface object and setting it up, the client
* must perform an initial commit without any buffer attached.
* The compositor will reply with a layer_surface.configure event.
* The client must acknowledge it and is then allowed to attach a buffer
* to map the surface.
*
* You may pass NULL for output to allow the compositor to decide which
* output to use. Generally this will be the one that the user most
* recently interacted with.
*
* Clients can specify a namespace that defines the purpose of the layer
* surface.
*/
static inline struct zwlr_layer_surface_v1 *
zwlr_layer_shell_v1_get_layer_surface(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1, struct wl_surface *surface, struct wl_output *output, uint32_t layer, const char *namespace)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_shell_v1,
ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE, &zwlr_layer_surface_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_shell_v1), 0, NULL, surface, output, layer, namespace);
return (struct zwlr_layer_surface_v1 *) id;
}
/**
* @ingroup iface_zwlr_layer_shell_v1
*
* This request indicates that the client will not use the layer_shell
* object any more. Objects that have been created through this instance
* are not affected.
*/
static inline void
zwlr_layer_shell_v1_destroy(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_shell_v1,
ZWLR_LAYER_SHELL_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_shell_v1), WL_MARSHAL_FLAG_DESTROY);
}
#ifndef ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM
#define ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM
/**
* @ingroup iface_zwlr_layer_surface_v1
* types of keyboard interaction possible for a layer shell surface
*
* Types of keyboard interaction possible for layer shell surfaces. The
* rationale for this is twofold: (1) some applications are not interested
* in keyboard events and not allowing them to be focused can improve the
* desktop experience; (2) some applications will want to take exclusive
* keyboard focus.
*/
enum zwlr_layer_surface_v1_keyboard_interactivity {
/**
* no keyboard focus is possible
*
* This value indicates that this surface is not interested in
* keyboard events and the compositor should never assign it the
* keyboard focus.
*
* This is the default value, set for newly created layer shell
* surfaces.
*
* This is useful for e.g. desktop widgets that display information
* or only have interaction with non-keyboard input devices.
*/
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE = 0,
/**
* request exclusive keyboard focus
*
* Request exclusive keyboard focus if this surface is above the
* shell surface layer.
*
* For the top and overlay layers, the seat will always give
* exclusive keyboard focus to the top-most layer which has
* keyboard interactivity set to exclusive. If this layer contains
* multiple surfaces with keyboard interactivity set to exclusive,
* the compositor determines the one receiving keyboard events in
* an implementation- defined manner. In this case, no guarantee is
* made when this surface will receive keyboard focus (if ever).
*
* For the bottom and background layers, the compositor is allowed
* to use normal focus semantics.
*
* This setting is mainly intended for applications that need to
* ensure they receive all keyboard events, such as a lock screen
* or a password prompt.
*/
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE = 1,
/**
* request regular keyboard focus semantics
*
* This requests the compositor to allow this surface to be
* focused and unfocused by the user in an implementation-defined
* manner. The user should be able to unfocus this surface even
* regardless of the layer it is on.
*
* Typically, the compositor will want to use its normal mechanism
* to manage keyboard focus between layer shell surfaces with this
* setting and regular toplevels on the desktop layer (e.g. click
* to focus). Nevertheless, it is possible for a compositor to
* require a special interaction to focus or unfocus layer shell
* surfaces (e.g. requiring a click even if focus follows the mouse
* normally, or providing a keybinding to switch focus between
* layers).
*
* This setting is mainly intended for desktop shell components
* (e.g. panels) that allow keyboard interaction. Using this option
* can allow implementing a desktop shell that can be fully usable
* without the mouse.
* @since 4
*/
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND = 2,
};
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND_SINCE_VERSION 4
#endif /* ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM */
#ifndef ZWLR_LAYER_SURFACE_V1_ERROR_ENUM
#define ZWLR_LAYER_SURFACE_V1_ERROR_ENUM
enum zwlr_layer_surface_v1_error {
/**
* provided surface state is invalid
*/
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SURFACE_STATE = 0,
/**
* size is invalid
*/
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE = 1,
/**
* anchor bitfield is invalid
*/
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_ANCHOR = 2,
/**
* keyboard interactivity is invalid
*/
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_KEYBOARD_INTERACTIVITY = 3,
};
#endif /* ZWLR_LAYER_SURFACE_V1_ERROR_ENUM */
#ifndef ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM
#define ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM
enum zwlr_layer_surface_v1_anchor {
/**
* the top edge of the anchor rectangle
*/
ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP = 1,
/**
* the bottom edge of the anchor rectangle
*/
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM = 2,
/**
* the left edge of the anchor rectangle
*/
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT = 4,
/**
* the right edge of the anchor rectangle
*/
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT = 8,
};
#endif /* ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM */
/**
* @ingroup iface_zwlr_layer_surface_v1
* @struct zwlr_layer_surface_v1_listener
*/
struct zwlr_layer_surface_v1_listener {
/**
* suggest a surface change
*
* The configure event asks the client to resize its surface.
*
* Clients should arrange their surface for the new states, and
* then send an ack_configure request with the serial sent in this
* configure event at some point before committing the new surface.
*
* The client is free to dismiss all but the last configure event
* it received.
*
* The width and height arguments specify the size of the window in
* surface-local coordinates.
*
* The size is a hint, in the sense that the client is free to
* ignore it if it doesn't resize, pick a smaller size (to satisfy
* aspect ratio or resize in steps of NxM pixels). If the client
* picks a smaller size and is anchored to two opposite anchors
* (e.g. 'top' and 'bottom'), the surface will be centered on this
* axis.
*
* If the width or height arguments are zero, it means the client
* should decide its own window dimension.
*/
void (*configure)(void *data,
struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1,
uint32_t serial,
uint32_t width,
uint32_t height);
/**
* surface should be closed
*
* The closed event is sent by the compositor when the surface
* will no longer be shown. The output may have been destroyed or
* the user may have asked for it to be removed. Further changes to
* the surface will be ignored. The client should destroy the
* resource after receiving this event, and create a new surface if
* they so choose.
*/
void (*closed)(void *data,
struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1);
};
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
static inline int
zwlr_layer_surface_v1_add_listener(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1,
const struct zwlr_layer_surface_v1_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zwlr_layer_surface_v1,
(void (**)(void)) listener, data);
}
#define ZWLR_LAYER_SURFACE_V1_SET_SIZE 0
#define ZWLR_LAYER_SURFACE_V1_SET_ANCHOR 1
#define ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE 2
#define ZWLR_LAYER_SURFACE_V1_SET_MARGIN 3
#define ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY 4
#define ZWLR_LAYER_SURFACE_V1_GET_POPUP 5
#define ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE 6
#define ZWLR_LAYER_SURFACE_V1_DESTROY 7
#define ZWLR_LAYER_SURFACE_V1_SET_LAYER 8
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_CONFIGURE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_CLOSED_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_SIZE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_ANCHOR_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_MARGIN_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_GET_POPUP_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION 2
/** @ingroup iface_zwlr_layer_surface_v1 */
static inline void
zwlr_layer_surface_v1_set_user_data(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwlr_layer_surface_v1, user_data);
}
/** @ingroup iface_zwlr_layer_surface_v1 */
static inline void *
zwlr_layer_surface_v1_get_user_data(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwlr_layer_surface_v1);
}
static inline uint32_t
zwlr_layer_surface_v1_get_version(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1)
{
return wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* Sets the size of the surface in surface-local coordinates. The
* compositor will display the surface centered with respect to its
* anchors.
*
* If you pass 0 for either value, the compositor will assign it and
* inform you of the assignment in the configure event. You must set your
* anchor to opposite edges in the dimensions you omit; not doing so is a
* protocol error. Both values are 0 by default.
*
* Size is double-buffered, see wl_surface.commit.
*/
static inline void
zwlr_layer_surface_v1_set_size(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t width, uint32_t height)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_SET_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, width, height);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* Requests that the compositor anchor the surface to the specified edges
* and corners. If two orthogonal edges are specified (e.g. 'top' and
* 'left'), then the anchor point will be the intersection of the edges
* (e.g. the top left corner of the output); otherwise the anchor point
* will be centered on that edge, or in the center if none is specified.
*
* Anchor is double-buffered, see wl_surface.commit.
*/
static inline void
zwlr_layer_surface_v1_set_anchor(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t anchor)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_SET_ANCHOR, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, anchor);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* Requests that the compositor avoids occluding an area with other
* surfaces. The compositor's use of this information is
* implementation-dependent - do not assume that this region will not
* actually be occluded.
*
* A positive value is only meaningful if the surface is anchored to one
* edge or an edge and both perpendicular edges. If the surface is not
* anchored, anchored to only two perpendicular edges (a corner), anchored
* to only two parallel edges or anchored to all edges, a positive value
* will be treated the same as zero.
*
* A positive zone is the distance from the edge in surface-local
* coordinates to consider exclusive.
*
* Surfaces that do not wish to have an exclusive zone may instead specify
* how they should interact with surfaces that do. If set to zero, the
* surface indicates that it would like to be moved to avoid occluding
* surfaces with a positive exclusive zone. If set to -1, the surface
* indicates that it would not like to be moved to accommodate for other
* surfaces, and the compositor should extend it all the way to the edges
* it is anchored to.
*
* For example, a panel might set its exclusive zone to 10, so that
* maximized shell surfaces are not shown on top of it. A notification
* might set its exclusive zone to 0, so that it is moved to avoid
* occluding the panel, but shell surfaces are shown underneath it. A
* wallpaper or lock screen might set their exclusive zone to -1, so that
* they stretch below or over the panel.
*
* The default value is 0.
*
* Exclusive zone is double-buffered, see wl_surface.commit.
*/
static inline void
zwlr_layer_surface_v1_set_exclusive_zone(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, int32_t zone)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, zone);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* Requests that the surface be placed some distance away from the anchor
* point on the output, in surface-local coordinates. Setting this value
* for edges you are not anchored to has no effect.
*
* The exclusive zone includes the margin.
*
* Margin is double-buffered, see wl_surface.commit.
*/
static inline void
zwlr_layer_surface_v1_set_margin(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, int32_t top, int32_t right, int32_t bottom, int32_t left)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_SET_MARGIN, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, top, right, bottom, left);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* Set how keyboard events are delivered to this surface. By default,
* layer shell surfaces do not receive keyboard events; this request can
* be used to change this.
*
* This setting is inherited by child surfaces set by the get_popup
* request.
*
* Layer surfaces receive pointer, touch, and tablet events normally. If
* you do not want to receive them, set the input region on your surface
* to an empty region.
*
* Keyboard interactivity is double-buffered, see wl_surface.commit.
*/
static inline void
zwlr_layer_surface_v1_set_keyboard_interactivity(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t keyboard_interactivity)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, keyboard_interactivity);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* This assigns an xdg_popup's parent to this layer_surface. This popup
* should have been created via xdg_surface::get_popup with the parent set
* to NULL, and this request must be invoked before committing the popup's
* initial state.
*
* See the documentation of xdg_popup for more details about what an
* xdg_popup is and how it is used.
*/
static inline void
zwlr_layer_surface_v1_get_popup(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, struct xdg_popup *popup)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_GET_POPUP, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, popup);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* When a configure event is received, if a client commits the
* surface in response to the configure event, then the client
* must make an ack_configure request sometime before the commit
* request, passing along the serial of the configure event.
*
* If the client receives multiple configure events before it
* can respond to one, it only has to ack the last configure event.
*
* A client is not required to commit immediately after sending
* an ack_configure request - it may even ack_configure several times
* before its next surface commit.
*
* A client may send multiple ack_configure requests before committing, but
* only the last request sent before a commit indicates which configure
* event the client really is responding to.
*/
static inline void
zwlr_layer_surface_v1_ack_configure(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t serial)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, serial);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* This request destroys the layer surface.
*/
static inline void
zwlr_layer_surface_v1_destroy(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
*
* Change the layer that the surface is rendered on.
*
* Layer is double-buffered, see wl_surface.commit.
*/
static inline void
zwlr_layer_surface_v1_set_layer(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t layer)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
ZWLR_LAYER_SURFACE_V1_SET_LAYER, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, layer);
}
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load diff