Vendor pinned XKB and D-Bus declarations and desktop protocols

This commit is contained in:
Peterino2 2026-09-18 13:36:53 -07:00
parent 7a7a3493d6
commit fa3959e221
49 changed files with 18763 additions and 7 deletions

View File

@ -12,5 +12,7 @@ pkgs.mkShell {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.wayland
pkgs.libglvnd
pkgs.libxkbcommon
pkgs.dbus.lib
];
}

View File

@ -0,0 +1,75 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright 2018 The Chromium Authors
* Copyright 2023 Simon Ser
*
* 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.
*/
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
#else
#define WL_PRIVATE
#endif
extern const struct wl_interface wl_pointer_interface;
extern const struct wl_interface wp_cursor_shape_device_v1_interface;
extern const struct wl_interface zwp_tablet_tool_v2_interface;
static const struct wl_interface *cursor_shape_v1_types[] = {
NULL,
NULL,
&wp_cursor_shape_device_v1_interface,
&wl_pointer_interface,
&wp_cursor_shape_device_v1_interface,
&zwp_tablet_tool_v2_interface,
};
static const struct wl_message wp_cursor_shape_manager_v1_requests[] = {
{ "destroy", "", cursor_shape_v1_types + 0 },
{ "get_pointer", "no", cursor_shape_v1_types + 2 },
{ "get_tablet_tool_v2", "no", cursor_shape_v1_types + 4 },
};
WL_PRIVATE const struct wl_interface wp_cursor_shape_manager_v1_interface = {
"wp_cursor_shape_manager_v1", 2,
3, wp_cursor_shape_manager_v1_requests,
0, NULL,
};
static const struct wl_message wp_cursor_shape_device_v1_requests[] = {
{ "destroy", "", cursor_shape_v1_types + 0 },
{ "set_shape", "uu", cursor_shape_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface wp_cursor_shape_device_v1_interface = {
"wp_cursor_shape_device_v1", 2,
2, wp_cursor_shape_device_v1_requests,
0, NULL,
};

View File

@ -0,0 +1,452 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef CURSOR_SHAPE_V1_CLIENT_PROTOCOL_H
#define CURSOR_SHAPE_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_cursor_shape_v1 The cursor_shape_v1 protocol
* @section page_ifaces_cursor_shape_v1 Interfaces
* - @subpage page_iface_wp_cursor_shape_manager_v1 - cursor shape manager
* - @subpage page_iface_wp_cursor_shape_device_v1 - cursor shape for a device
* @section page_copyright_cursor_shape_v1 Copyright
* <pre>
*
* Copyright 2018 The Chromium Authors
* Copyright 2023 Simon Ser
*
* 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_pointer;
struct wp_cursor_shape_device_v1;
struct wp_cursor_shape_manager_v1;
struct zwp_tablet_tool_v2;
#ifndef WP_CURSOR_SHAPE_MANAGER_V1_INTERFACE
#define WP_CURSOR_SHAPE_MANAGER_V1_INTERFACE
/**
* @page page_iface_wp_cursor_shape_manager_v1 wp_cursor_shape_manager_v1
* @section page_iface_wp_cursor_shape_manager_v1_desc Description
*
* This global offers an alternative, optional way to set cursor images. This
* new way uses enumerated cursors instead of a wl_surface like
* wl_pointer.set_cursor does.
*
* Warning! The protocol described in this file is currently in the testing
* phase. Backward compatible changes may be added together with the
* corresponding interface version bump. Backward incompatible changes can
* only be done by creating a new major version of the extension.
* @section page_iface_wp_cursor_shape_manager_v1_api API
* See @ref iface_wp_cursor_shape_manager_v1.
*/
/**
* @defgroup iface_wp_cursor_shape_manager_v1 The wp_cursor_shape_manager_v1 interface
*
* This global offers an alternative, optional way to set cursor images. This
* new way uses enumerated cursors instead of a wl_surface like
* wl_pointer.set_cursor does.
*
* Warning! The protocol described in this file is currently in the testing
* phase. Backward compatible changes may be added together with the
* corresponding interface version bump. Backward incompatible changes can
* only be done by creating a new major version of the extension.
*/
extern const struct wl_interface wp_cursor_shape_manager_v1_interface;
#endif
#ifndef WP_CURSOR_SHAPE_DEVICE_V1_INTERFACE
#define WP_CURSOR_SHAPE_DEVICE_V1_INTERFACE
/**
* @page page_iface_wp_cursor_shape_device_v1 wp_cursor_shape_device_v1
* @section page_iface_wp_cursor_shape_device_v1_desc Description
*
* This interface allows clients to set the cursor shape.
* @section page_iface_wp_cursor_shape_device_v1_api API
* See @ref iface_wp_cursor_shape_device_v1.
*/
/**
* @defgroup iface_wp_cursor_shape_device_v1 The wp_cursor_shape_device_v1 interface
*
* This interface allows clients to set the cursor shape.
*/
extern const struct wl_interface wp_cursor_shape_device_v1_interface;
#endif
#define WP_CURSOR_SHAPE_MANAGER_V1_DESTROY 0
#define WP_CURSOR_SHAPE_MANAGER_V1_GET_POINTER 1
#define WP_CURSOR_SHAPE_MANAGER_V1_GET_TABLET_TOOL_V2 2
/**
* @ingroup iface_wp_cursor_shape_manager_v1
*/
#define WP_CURSOR_SHAPE_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_cursor_shape_manager_v1
*/
#define WP_CURSOR_SHAPE_MANAGER_V1_GET_POINTER_SINCE_VERSION 1
/**
* @ingroup iface_wp_cursor_shape_manager_v1
*/
#define WP_CURSOR_SHAPE_MANAGER_V1_GET_TABLET_TOOL_V2_SINCE_VERSION 1
/** @ingroup iface_wp_cursor_shape_manager_v1 */
static inline void
wp_cursor_shape_manager_v1_set_user_data(struct wp_cursor_shape_manager_v1 *wp_cursor_shape_manager_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wp_cursor_shape_manager_v1, user_data);
}
/** @ingroup iface_wp_cursor_shape_manager_v1 */
static inline void *
wp_cursor_shape_manager_v1_get_user_data(struct wp_cursor_shape_manager_v1 *wp_cursor_shape_manager_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) wp_cursor_shape_manager_v1);
}
static inline uint32_t
wp_cursor_shape_manager_v1_get_version(struct wp_cursor_shape_manager_v1 *wp_cursor_shape_manager_v1)
{
return wl_proxy_get_version((struct wl_proxy *) wp_cursor_shape_manager_v1);
}
/**
* @ingroup iface_wp_cursor_shape_manager_v1
*
* Destroy the cursor shape manager.
*/
static inline void
wp_cursor_shape_manager_v1_destroy(struct wp_cursor_shape_manager_v1 *wp_cursor_shape_manager_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_cursor_shape_manager_v1,
WP_CURSOR_SHAPE_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_cursor_shape_manager_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_wp_cursor_shape_manager_v1
*
* Obtain a wp_cursor_shape_device_v1 for a wl_pointer object.
*
* When the pointer capability is removed from the wl_seat, the
* wp_cursor_shape_device_v1 object becomes inert.
*/
static inline struct wp_cursor_shape_device_v1 *
wp_cursor_shape_manager_v1_get_pointer(struct wp_cursor_shape_manager_v1 *wp_cursor_shape_manager_v1, struct wl_pointer *pointer)
{
struct wl_proxy *cursor_shape_device;
cursor_shape_device = wl_proxy_marshal_flags((struct wl_proxy *) wp_cursor_shape_manager_v1,
WP_CURSOR_SHAPE_MANAGER_V1_GET_POINTER, &wp_cursor_shape_device_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_cursor_shape_manager_v1), 0, NULL, pointer);
return (struct wp_cursor_shape_device_v1 *) cursor_shape_device;
}
/**
* @ingroup iface_wp_cursor_shape_manager_v1
*
* Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object.
*
* When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1
* object becomes inert.
*/
static inline struct wp_cursor_shape_device_v1 *
wp_cursor_shape_manager_v1_get_tablet_tool_v2(struct wp_cursor_shape_manager_v1 *wp_cursor_shape_manager_v1, struct zwp_tablet_tool_v2 *tablet_tool)
{
struct wl_proxy *cursor_shape_device;
cursor_shape_device = wl_proxy_marshal_flags((struct wl_proxy *) wp_cursor_shape_manager_v1,
WP_CURSOR_SHAPE_MANAGER_V1_GET_TABLET_TOOL_V2, &wp_cursor_shape_device_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_cursor_shape_manager_v1), 0, NULL, tablet_tool);
return (struct wp_cursor_shape_device_v1 *) cursor_shape_device;
}
#ifndef WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ENUM
#define WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ENUM
/**
* @ingroup iface_wp_cursor_shape_device_v1
* cursor shapes
*
* This enum describes cursor shapes.
*
* The names are taken from the CSS W3C specification:
* https://w3c.github.io/csswg-drafts/css-ui/#cursor
* with a few additions.
*
* Note that there are some groups of cursor shapes that are related:
* The first group is drag-and-drop cursors which are used to indicate
* the selected action during dnd operations. The second group is resize
* cursors which are used to indicate resizing and moving possibilities
* on window borders. It is recommended that the shapes in these groups
* should use visually compatible images and metaphors.
*/
enum wp_cursor_shape_device_v1_shape {
/**
* default cursor
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT = 1,
/**
* a context menu is available for the object under the cursor
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CONTEXT_MENU = 2,
/**
* help is available for the object under the cursor
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP = 3,
/**
* pointer that indicates a link or another interactive element
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER = 4,
/**
* progress indicator
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS = 5,
/**
* program is busy, user should wait
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT = 6,
/**
* a cell or set of cells may be selected
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CELL = 7,
/**
* simple crosshair
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR = 8,
/**
* text may be selected
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT = 9,
/**
* vertical text may be selected
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_VERTICAL_TEXT = 10,
/**
* drag-and-drop: alias of/shortcut to something is to be created
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALIAS = 11,
/**
* drag-and-drop: something is to be copied
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COPY = 12,
/**
* drag-and-drop: something is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_MOVE = 13,
/**
* drag-and-drop: the dragged item cannot be dropped at the current cursor location
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NO_DROP = 14,
/**
* drag-and-drop: the requested action will not be carried out
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NOT_ALLOWED = 15,
/**
* drag-and-drop: something can be grabbed
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRAB = 16,
/**
* drag-and-drop: something is being grabbed
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRABBING = 17,
/**
* resizing: the east border is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_E_RESIZE = 18,
/**
* resizing: the north border is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_N_RESIZE = 19,
/**
* resizing: the north-east corner is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NE_RESIZE = 20,
/**
* resizing: the north-west corner is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NW_RESIZE = 21,
/**
* resizing: the south border is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_S_RESIZE = 22,
/**
* resizing: the south-east corner is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SE_RESIZE = 23,
/**
* resizing: the south-west corner is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SW_RESIZE = 24,
/**
* resizing: the west border is to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_W_RESIZE = 25,
/**
* resizing: the east and west borders are to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE = 26,
/**
* resizing: the north and south borders are to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE = 27,
/**
* resizing: the north-east and south-west corners are to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE = 28,
/**
* resizing: the north-west and south-east corners are to be moved
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE = 29,
/**
* resizing: that the item/column can be resized horizontally
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE = 30,
/**
* resizing: that the item/row can be resized vertically
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE = 31,
/**
* something can be scrolled in any direction
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL = 32,
/**
* something can be zoomed in
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_IN = 33,
/**
* something can be zoomed out
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_OUT = 34,
/**
* drag-and-drop: the user will select which action will be carried out (non-css value)
* @since 2
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DND_ASK = 35,
/**
* resizing: something can be moved or resized in any direction (non-css value)
* @since 2
*/
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_RESIZE = 36,
};
/**
* @ingroup iface_wp_cursor_shape_device_v1
*/
#define WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DND_ASK_SINCE_VERSION 2
/**
* @ingroup iface_wp_cursor_shape_device_v1
*/
#define WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_RESIZE_SINCE_VERSION 2
#endif /* WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ENUM */
#ifndef WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM
#define WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM
enum wp_cursor_shape_device_v1_error {
/**
* the specified shape value is invalid
*/
WP_CURSOR_SHAPE_DEVICE_V1_ERROR_INVALID_SHAPE = 1,
};
#endif /* WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM */
#define WP_CURSOR_SHAPE_DEVICE_V1_DESTROY 0
#define WP_CURSOR_SHAPE_DEVICE_V1_SET_SHAPE 1
/**
* @ingroup iface_wp_cursor_shape_device_v1
*/
#define WP_CURSOR_SHAPE_DEVICE_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_cursor_shape_device_v1
*/
#define WP_CURSOR_SHAPE_DEVICE_V1_SET_SHAPE_SINCE_VERSION 1
/** @ingroup iface_wp_cursor_shape_device_v1 */
static inline void
wp_cursor_shape_device_v1_set_user_data(struct wp_cursor_shape_device_v1 *wp_cursor_shape_device_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wp_cursor_shape_device_v1, user_data);
}
/** @ingroup iface_wp_cursor_shape_device_v1 */
static inline void *
wp_cursor_shape_device_v1_get_user_data(struct wp_cursor_shape_device_v1 *wp_cursor_shape_device_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) wp_cursor_shape_device_v1);
}
static inline uint32_t
wp_cursor_shape_device_v1_get_version(struct wp_cursor_shape_device_v1 *wp_cursor_shape_device_v1)
{
return wl_proxy_get_version((struct wl_proxy *) wp_cursor_shape_device_v1);
}
/**
* @ingroup iface_wp_cursor_shape_device_v1
*
* Destroy the cursor shape device.
*
* The device cursor shape remains unchanged.
*/
static inline void
wp_cursor_shape_device_v1_destroy(struct wp_cursor_shape_device_v1 *wp_cursor_shape_device_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_cursor_shape_device_v1,
WP_CURSOR_SHAPE_DEVICE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_cursor_shape_device_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_wp_cursor_shape_device_v1
*
* Sets the device cursor to the specified shape. The compositor will
* change the cursor image based on the specified shape.
*
* The cursor actually changes only if the input device focus is one of
* the requesting client's surfaces. If any, the previous cursor image
* (surface or shape) is replaced.
*
* The "shape" argument must be a valid enum entry, otherwise the
* invalid_shape protocol error is raised.
*
* This is similar to the wl_pointer.set_cursor and
* zwp_tablet_tool_v2.set_cursor requests, but this request accepts a
* shape instead of contents in the form of a surface. Clients can mix
* set_cursor and set_shape requests.
*
* The serial parameter must match the latest wl_pointer.enter or
* zwp_tablet_tool_v2.proximity_in serial number sent to the client.
* Otherwise the request will be ignored.
*/
static inline void
wp_cursor_shape_device_v1_set_shape(struct wp_cursor_shape_device_v1 *wp_cursor_shape_device_v1, uint32_t serial, uint32_t shape)
{
wl_proxy_marshal_flags((struct wl_proxy *) wp_cursor_shape_device_v1,
WP_CURSOR_SHAPE_DEVICE_V1_SET_SHAPE, NULL, wl_proxy_get_version((struct wl_proxy *) wp_cursor_shape_device_v1), 0, serial, shape);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,65 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
*
* Copyright (C) 2003 Red Hat, Inc.
* SPDX-License-Identifier: AFL-2.0 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.0
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_ARCH_DEPS_H
#define DBUS_ARCH_DEPS_H
#include <dbus/dbus-macros.h>
DBUS_BEGIN_DECLS
/* D-Bus no longer supports platforms with no 64-bit integer type. */
#define DBUS_HAVE_INT64 1
_DBUS_GNUC_EXTENSION typedef long long dbus_int64_t;
_DBUS_GNUC_EXTENSION typedef unsigned long long dbus_uint64_t;
#define DBUS_INT64_MODIFIER "ll"
#define DBUS_INT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION val##LL)
#define DBUS_UINT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION val##ULL)
typedef int dbus_int32_t;
typedef unsigned int dbus_uint32_t;
typedef short dbus_int16_t;
typedef unsigned short dbus_uint16_t;
#define DBUS_SIZEOF_VOID_P __SIZEOF_POINTER__
/* This is not really arch-dependent, but it's not worth
* creating an additional generated header just for this
*/
#define DBUS_MAJOR_VERSION 1
#define DBUS_MINOR_VERSION 16
#define DBUS_MICRO_VERSION 2
#define DBUS_VERSION_STRING "1.16.2"
#define DBUS_VERSION ((1 << 16) | (16 << 8) | (2))
DBUS_END_DECLS
#endif /* DBUS_ARCH_DEPS_H */

View File

@ -1,6 +1,19 @@
/* Generated by tools/protocols.py; private protocol descriptors. */
#define wp_cursor_shape_manager_v1_interface z_uhdk_wp_cursor_shape_manager_v1_interface
#define wp_cursor_shape_device_v1_interface z_uhdk_wp_cursor_shape_device_v1_interface
#define wp_fractional_scale_manager_v1_interface z_uhdk_wp_fractional_scale_manager_v1_interface
#define wp_fractional_scale_v1_interface z_uhdk_wp_fractional_scale_v1_interface
#define zwp_tablet_manager_v2_interface z_uhdk_zwp_tablet_manager_v2_interface
#define zwp_tablet_seat_v2_interface z_uhdk_zwp_tablet_seat_v2_interface
#define zwp_tablet_tool_v2_interface z_uhdk_zwp_tablet_tool_v2_interface
#define zwp_tablet_v2_interface z_uhdk_zwp_tablet_v2_interface
#define zwp_tablet_pad_ring_v2_interface z_uhdk_zwp_tablet_pad_ring_v2_interface
#define zwp_tablet_pad_strip_v2_interface z_uhdk_zwp_tablet_pad_strip_v2_interface
#define zwp_tablet_pad_group_v2_interface z_uhdk_zwp_tablet_pad_group_v2_interface
#define zwp_tablet_pad_v2_interface z_uhdk_zwp_tablet_pad_v2_interface
#define zwp_tablet_pad_dial_v2_interface z_uhdk_zwp_tablet_pad_dial_v2_interface
#define zwp_text_input_v3_interface z_uhdk_zwp_text_input_v3_interface
#define zwp_text_input_manager_v3_interface z_uhdk_zwp_text_input_manager_v3_interface
#define wp_viewporter_interface z_uhdk_wp_viewporter_interface
#define wp_viewport_interface z_uhdk_wp_viewport_interface
#define wl_display_interface z_uhdk_wl_display_interface
@ -26,10 +39,18 @@
#define wl_subcompositor_interface z_uhdk_wl_subcompositor_interface
#define wl_subsurface_interface z_uhdk_wl_subsurface_interface
#define wl_fixes_interface z_uhdk_wl_fixes_interface
#define xdg_activation_v1_interface z_uhdk_xdg_activation_v1_interface
#define xdg_activation_token_v1_interface z_uhdk_xdg_activation_token_v1_interface
#define zxdg_decoration_manager_v1_interface z_uhdk_zxdg_decoration_manager_v1_interface
#define zxdg_toplevel_decoration_v1_interface z_uhdk_zxdg_toplevel_decoration_v1_interface
#define zxdg_exporter_v2_interface z_uhdk_zxdg_exporter_v2_interface
#define zxdg_importer_v2_interface z_uhdk_zxdg_importer_v2_interface
#define zxdg_exported_v2_interface z_uhdk_zxdg_exported_v2_interface
#define zxdg_imported_v2_interface z_uhdk_zxdg_imported_v2_interface
#define xdg_wm_base_interface z_uhdk_xdg_wm_base_interface
#define xdg_positioner_interface z_uhdk_xdg_positioner_interface
#define xdg_surface_interface z_uhdk_xdg_surface_interface
#define xdg_toplevel_interface z_uhdk_xdg_toplevel_interface
#define xdg_popup_interface z_uhdk_xdg_popup_interface
#define xdg_toplevel_icon_manager_v1_interface z_uhdk_xdg_toplevel_icon_manager_v1_interface
#define xdg_toplevel_icon_v1_interface z_uhdk_xdg_toplevel_icon_v1_interface

View File

@ -0,0 +1,254 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright 2014 © Stephen "Lyude" Chandler Paul
* Copyright 2015-2024 © Red Hat, Inc.
*
* 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.
*/
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
#else
#define WL_PRIVATE
#endif
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface zwp_tablet_pad_dial_v2_interface;
extern const struct wl_interface zwp_tablet_pad_group_v2_interface;
extern const struct wl_interface zwp_tablet_pad_ring_v2_interface;
extern const struct wl_interface zwp_tablet_pad_strip_v2_interface;
extern const struct wl_interface zwp_tablet_pad_v2_interface;
extern const struct wl_interface zwp_tablet_seat_v2_interface;
extern const struct wl_interface zwp_tablet_tool_v2_interface;
extern const struct wl_interface zwp_tablet_v2_interface;
static const struct wl_interface *tablet_v2_types[] = {
NULL,
NULL,
NULL,
&zwp_tablet_seat_v2_interface,
&wl_seat_interface,
&zwp_tablet_v2_interface,
&zwp_tablet_tool_v2_interface,
&zwp_tablet_pad_v2_interface,
NULL,
&wl_surface_interface,
NULL,
NULL,
NULL,
&zwp_tablet_v2_interface,
&wl_surface_interface,
&zwp_tablet_pad_ring_v2_interface,
&zwp_tablet_pad_strip_v2_interface,
&zwp_tablet_pad_dial_v2_interface,
&zwp_tablet_pad_group_v2_interface,
NULL,
&zwp_tablet_v2_interface,
&wl_surface_interface,
NULL,
&wl_surface_interface,
};
static const struct wl_message zwp_tablet_manager_v2_requests[] = {
{ "get_tablet_seat", "no", tablet_v2_types + 3 },
{ "destroy", "", tablet_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_manager_v2_interface = {
"zwp_tablet_manager_v2", 2,
2, zwp_tablet_manager_v2_requests,
0, NULL,
};
static const struct wl_message zwp_tablet_seat_v2_requests[] = {
{ "destroy", "", tablet_v2_types + 0 },
};
static const struct wl_message zwp_tablet_seat_v2_events[] = {
{ "tablet_added", "n", tablet_v2_types + 5 },
{ "tool_added", "n", tablet_v2_types + 6 },
{ "pad_added", "n", tablet_v2_types + 7 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_seat_v2_interface = {
"zwp_tablet_seat_v2", 2,
1, zwp_tablet_seat_v2_requests,
3, zwp_tablet_seat_v2_events,
};
static const struct wl_message zwp_tablet_tool_v2_requests[] = {
{ "set_cursor", "u?oii", tablet_v2_types + 8 },
{ "destroy", "", tablet_v2_types + 0 },
};
static const struct wl_message zwp_tablet_tool_v2_events[] = {
{ "type", "u", tablet_v2_types + 0 },
{ "hardware_serial", "uu", tablet_v2_types + 0 },
{ "hardware_id_wacom", "uu", tablet_v2_types + 0 },
{ "capability", "u", tablet_v2_types + 0 },
{ "done", "", tablet_v2_types + 0 },
{ "removed", "", tablet_v2_types + 0 },
{ "proximity_in", "uoo", tablet_v2_types + 12 },
{ "proximity_out", "", tablet_v2_types + 0 },
{ "down", "u", tablet_v2_types + 0 },
{ "up", "", tablet_v2_types + 0 },
{ "motion", "ff", tablet_v2_types + 0 },
{ "pressure", "u", tablet_v2_types + 0 },
{ "distance", "u", tablet_v2_types + 0 },
{ "tilt", "ff", tablet_v2_types + 0 },
{ "rotation", "f", tablet_v2_types + 0 },
{ "slider", "i", tablet_v2_types + 0 },
{ "wheel", "fi", tablet_v2_types + 0 },
{ "button", "uuu", tablet_v2_types + 0 },
{ "frame", "u", tablet_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_tool_v2_interface = {
"zwp_tablet_tool_v2", 2,
2, zwp_tablet_tool_v2_requests,
19, zwp_tablet_tool_v2_events,
};
static const struct wl_message zwp_tablet_v2_requests[] = {
{ "destroy", "", tablet_v2_types + 0 },
};
static const struct wl_message zwp_tablet_v2_events[] = {
{ "name", "s", tablet_v2_types + 0 },
{ "id", "uu", tablet_v2_types + 0 },
{ "path", "s", tablet_v2_types + 0 },
{ "done", "", tablet_v2_types + 0 },
{ "removed", "", tablet_v2_types + 0 },
{ "bustype", "2u", tablet_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_v2_interface = {
"zwp_tablet_v2", 2,
1, zwp_tablet_v2_requests,
6, zwp_tablet_v2_events,
};
static const struct wl_message zwp_tablet_pad_ring_v2_requests[] = {
{ "set_feedback", "su", tablet_v2_types + 0 },
{ "destroy", "", tablet_v2_types + 0 },
};
static const struct wl_message zwp_tablet_pad_ring_v2_events[] = {
{ "source", "u", tablet_v2_types + 0 },
{ "angle", "f", tablet_v2_types + 0 },
{ "stop", "", tablet_v2_types + 0 },
{ "frame", "u", tablet_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_pad_ring_v2_interface = {
"zwp_tablet_pad_ring_v2", 2,
2, zwp_tablet_pad_ring_v2_requests,
4, zwp_tablet_pad_ring_v2_events,
};
static const struct wl_message zwp_tablet_pad_strip_v2_requests[] = {
{ "set_feedback", "su", tablet_v2_types + 0 },
{ "destroy", "", tablet_v2_types + 0 },
};
static const struct wl_message zwp_tablet_pad_strip_v2_events[] = {
{ "source", "u", tablet_v2_types + 0 },
{ "position", "u", tablet_v2_types + 0 },
{ "stop", "", tablet_v2_types + 0 },
{ "frame", "u", tablet_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_pad_strip_v2_interface = {
"zwp_tablet_pad_strip_v2", 2,
2, zwp_tablet_pad_strip_v2_requests,
4, zwp_tablet_pad_strip_v2_events,
};
static const struct wl_message zwp_tablet_pad_group_v2_requests[] = {
{ "destroy", "", tablet_v2_types + 0 },
};
static const struct wl_message zwp_tablet_pad_group_v2_events[] = {
{ "buttons", "a", tablet_v2_types + 0 },
{ "ring", "n", tablet_v2_types + 15 },
{ "strip", "n", tablet_v2_types + 16 },
{ "modes", "u", tablet_v2_types + 0 },
{ "done", "", tablet_v2_types + 0 },
{ "mode_switch", "uuu", tablet_v2_types + 0 },
{ "dial", "2n", tablet_v2_types + 17 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_pad_group_v2_interface = {
"zwp_tablet_pad_group_v2", 2,
1, zwp_tablet_pad_group_v2_requests,
7, zwp_tablet_pad_group_v2_events,
};
static const struct wl_message zwp_tablet_pad_v2_requests[] = {
{ "set_feedback", "usu", tablet_v2_types + 0 },
{ "destroy", "", tablet_v2_types + 0 },
};
static const struct wl_message zwp_tablet_pad_v2_events[] = {
{ "group", "n", tablet_v2_types + 18 },
{ "path", "s", tablet_v2_types + 0 },
{ "buttons", "u", tablet_v2_types + 0 },
{ "done", "", tablet_v2_types + 0 },
{ "button", "uuu", tablet_v2_types + 0 },
{ "enter", "uoo", tablet_v2_types + 19 },
{ "leave", "uo", tablet_v2_types + 22 },
{ "removed", "", tablet_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_pad_v2_interface = {
"zwp_tablet_pad_v2", 2,
2, zwp_tablet_pad_v2_requests,
8, zwp_tablet_pad_v2_events,
};
static const struct wl_message zwp_tablet_pad_dial_v2_requests[] = {
{ "set_feedback", "su", tablet_v2_types + 0 },
{ "destroy", "", tablet_v2_types + 0 },
};
static const struct wl_message zwp_tablet_pad_dial_v2_events[] = {
{ "delta", "i", tablet_v2_types + 0 },
{ "frame", "u", tablet_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zwp_tablet_pad_dial_v2_interface = {
"zwp_tablet_pad_dial_v2", 2,
2, zwp_tablet_pad_dial_v2_requests,
2, zwp_tablet_pad_dial_v2_events,
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,97 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2012, 2013 Intel Corporation
* Copyright © 2015, 2016 Jan Arne Petersen
* Copyright © 2017, 2018 Red Hat, Inc.
* Copyright © 2018 Purism SPC
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
#else
#define WL_PRIVATE
#endif
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface zwp_text_input_v3_interface;
static const struct wl_interface *text_input_unstable_v3_types[] = {
NULL,
NULL,
NULL,
NULL,
&wl_surface_interface,
&wl_surface_interface,
&zwp_text_input_v3_interface,
&wl_seat_interface,
};
static const struct wl_message zwp_text_input_v3_requests[] = {
{ "destroy", "", text_input_unstable_v3_types + 0 },
{ "enable", "", text_input_unstable_v3_types + 0 },
{ "disable", "", text_input_unstable_v3_types + 0 },
{ "set_surrounding_text", "sii", text_input_unstable_v3_types + 0 },
{ "set_text_change_cause", "u", text_input_unstable_v3_types + 0 },
{ "set_content_type", "uu", text_input_unstable_v3_types + 0 },
{ "set_cursor_rectangle", "iiii", text_input_unstable_v3_types + 0 },
{ "commit", "", text_input_unstable_v3_types + 0 },
};
static const struct wl_message zwp_text_input_v3_events[] = {
{ "enter", "o", text_input_unstable_v3_types + 4 },
{ "leave", "o", text_input_unstable_v3_types + 5 },
{ "preedit_string", "?sii", text_input_unstable_v3_types + 0 },
{ "commit_string", "?s", text_input_unstable_v3_types + 0 },
{ "delete_surrounding_text", "uu", text_input_unstable_v3_types + 0 },
{ "done", "u", text_input_unstable_v3_types + 0 },
};
WL_PRIVATE const struct wl_interface zwp_text_input_v3_interface = {
"zwp_text_input_v3", 1,
8, zwp_text_input_v3_requests,
6, zwp_text_input_v3_events,
};
static const struct wl_message zwp_text_input_manager_v3_requests[] = {
{ "destroy", "", text_input_unstable_v3_types + 0 },
{ "get_text_input", "no", text_input_unstable_v3_types + 6 },
};
WL_PRIVATE const struct wl_interface zwp_text_input_manager_v3_interface = {
"zwp_text_input_manager_v3", 1,
2, zwp_text_input_manager_v3_requests,
0, NULL,
};

View File

@ -0,0 +1,837 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef TEXT_INPUT_UNSTABLE_V3_CLIENT_PROTOCOL_H
#define TEXT_INPUT_UNSTABLE_V3_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_text_input_unstable_v3 The text_input_unstable_v3 protocol
* Protocol for composing text
*
* @section page_desc_text_input_unstable_v3 Description
*
* This protocol allows compositors to act as input methods and to send text
* to applications. A text input object is used to manage state of what are
* typically text entry fields in the application.
*
* 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_text_input_unstable_v3 Interfaces
* - @subpage page_iface_zwp_text_input_v3 - text input
* - @subpage page_iface_zwp_text_input_manager_v3 - text input manager
* @section page_copyright_text_input_unstable_v3 Copyright
* <pre>
*
* Copyright © 2012, 2013 Intel Corporation
* Copyright © 2015, 2016 Jan Arne Petersen
* Copyright © 2017, 2018 Red Hat, Inc.
* Copyright © 2018 Purism SPC
*
* 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_seat;
struct wl_surface;
struct zwp_text_input_manager_v3;
struct zwp_text_input_v3;
#ifndef ZWP_TEXT_INPUT_V3_INTERFACE
#define ZWP_TEXT_INPUT_V3_INTERFACE
/**
* @page page_iface_zwp_text_input_v3 zwp_text_input_v3
* @section page_iface_zwp_text_input_v3_desc Description
*
* The zwp_text_input_v3 interface represents text input and input methods
* associated with a seat. It provides enter/leave events to follow the
* text input focus for a seat.
*
* Requests are used to enable/disable the text-input object and set
* state information like surrounding and selected text or the content type.
* The information about the entered text is sent to the text-input object
* via the preedit_string and commit_string events.
*
* Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
* must not point to middle bytes inside a code point: they must either
* point to the first byte of a code point or to the end of the buffer.
* Lengths must be measured between two valid indices.
*
* Focus moving throughout surfaces will result in the emission of
* zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused
* surface must commit zwp_text_input_v3.enable and
* zwp_text_input_v3.disable requests as the keyboard focus moves across
* editable and non-editable elements of the UI. Those two requests are not
* expected to be paired with each other, the compositor must be able to
* handle consecutive series of the same request.
*
* State is sent by the state requests (set_surrounding_text,
* set_content_type and set_cursor_rectangle) and a commit request. After an
* enter event or disable request all state information is invalidated and
* needs to be resent by the client.
* @section page_iface_zwp_text_input_v3_api API
* See @ref iface_zwp_text_input_v3.
*/
/**
* @defgroup iface_zwp_text_input_v3 The zwp_text_input_v3 interface
*
* The zwp_text_input_v3 interface represents text input and input methods
* associated with a seat. It provides enter/leave events to follow the
* text input focus for a seat.
*
* Requests are used to enable/disable the text-input object and set
* state information like surrounding and selected text or the content type.
* The information about the entered text is sent to the text-input object
* via the preedit_string and commit_string events.
*
* Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
* must not point to middle bytes inside a code point: they must either
* point to the first byte of a code point or to the end of the buffer.
* Lengths must be measured between two valid indices.
*
* Focus moving throughout surfaces will result in the emission of
* zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused
* surface must commit zwp_text_input_v3.enable and
* zwp_text_input_v3.disable requests as the keyboard focus moves across
* editable and non-editable elements of the UI. Those two requests are not
* expected to be paired with each other, the compositor must be able to
* handle consecutive series of the same request.
*
* State is sent by the state requests (set_surrounding_text,
* set_content_type and set_cursor_rectangle) and a commit request. After an
* enter event or disable request all state information is invalidated and
* needs to be resent by the client.
*/
extern const struct wl_interface zwp_text_input_v3_interface;
#endif
#ifndef ZWP_TEXT_INPUT_MANAGER_V3_INTERFACE
#define ZWP_TEXT_INPUT_MANAGER_V3_INTERFACE
/**
* @page page_iface_zwp_text_input_manager_v3 zwp_text_input_manager_v3
* @section page_iface_zwp_text_input_manager_v3_desc Description
*
* A factory for text-input objects. This object is a global singleton.
* @section page_iface_zwp_text_input_manager_v3_api API
* See @ref iface_zwp_text_input_manager_v3.
*/
/**
* @defgroup iface_zwp_text_input_manager_v3 The zwp_text_input_manager_v3 interface
*
* A factory for text-input objects. This object is a global singleton.
*/
extern const struct wl_interface zwp_text_input_manager_v3_interface;
#endif
#ifndef ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_ENUM
#define ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_ENUM
/**
* @ingroup iface_zwp_text_input_v3
* text change reason
*
* Reason for the change of surrounding text or cursor posision.
*/
enum zwp_text_input_v3_change_cause {
/**
* input method caused the change
*/
ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD = 0,
/**
* something else than the input method caused the change
*/
ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_OTHER = 1,
};
#endif /* ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_ENUM */
#ifndef ZWP_TEXT_INPUT_V3_CONTENT_HINT_ENUM
#define ZWP_TEXT_INPUT_V3_CONTENT_HINT_ENUM
/**
* @ingroup iface_zwp_text_input_v3
* content hint
*
* Content hint is a bitmask to allow to modify the behavior of the text
* input.
*/
enum zwp_text_input_v3_content_hint {
/**
* no special behavior
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE = 0x0,
/**
* suggest word completions
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_COMPLETION = 0x1,
/**
* suggest word corrections
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_SPELLCHECK = 0x2,
/**
* switch to uppercase letters at the start of a sentence
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4,
/**
* prefer lowercase letters
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_LOWERCASE = 0x8,
/**
* prefer uppercase letters
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_UPPERCASE = 0x10,
/**
* prefer casing for titles and headings (can be language dependent)
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_TITLECASE = 0x20,
/**
* characters should be hidden
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_HIDDEN_TEXT = 0x40,
/**
* typed text should not be stored
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_SENSITIVE_DATA = 0x80,
/**
* just Latin characters should be entered
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_LATIN = 0x100,
/**
* the text input is multiline
*/
ZWP_TEXT_INPUT_V3_CONTENT_HINT_MULTILINE = 0x200,
};
#endif /* ZWP_TEXT_INPUT_V3_CONTENT_HINT_ENUM */
#ifndef ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ENUM
#define ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ENUM
/**
* @ingroup iface_zwp_text_input_v3
* content purpose
*
* The content purpose allows to specify the primary purpose of a text
* input.
*
* This allows an input method to show special purpose input panels with
* extra characters or to disallow some characters.
*/
enum zwp_text_input_v3_content_purpose {
/**
* default input, allowing all characters
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL = 0,
/**
* allow only alphabetic characters
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ALPHA = 1,
/**
* allow only digits
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DIGITS = 2,
/**
* input a number (including decimal separator and sign)
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NUMBER = 3,
/**
* input a phone number
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PHONE = 4,
/**
* input an URL
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_URL = 5,
/**
* input an email address
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_EMAIL = 6,
/**
* input a name of a person
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NAME = 7,
/**
* input a password (combine with sensitive_data hint)
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PASSWORD = 8,
/**
* input is a numeric password (combine with sensitive_data hint)
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PIN = 9,
/**
* input a date
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATE = 10,
/**
* input a time
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TIME = 11,
/**
* input a date and time
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATETIME = 12,
/**
* input for a terminal
*/
ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TERMINAL = 13,
};
#endif /* ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ENUM */
/**
* @ingroup iface_zwp_text_input_v3
* @struct zwp_text_input_v3_listener
*/
struct zwp_text_input_v3_listener {
/**
* enter event
*
* Notification that this seat's text-input focus is on a certain
* surface.
*
* If client has created multiple text input objects, compositor
* must send this event to all of them.
*
* When the seat has the keyboard capability the text-input focus
* follows the keyboard focus. This event sets the current surface
* for the text-input object.
*/
void (*enter)(void *data,
struct zwp_text_input_v3 *zwp_text_input_v3,
struct wl_surface *surface);
/**
* leave event
*
* Notification that this seat's text-input focus is no longer on
* a certain surface. The client should reset any preedit string
* previously set.
*
* The leave notification clears the current surface. It is sent
* before the enter notification for the new focus. After leave
* event, compositor must ignore requests from any text input
* instances until next enter event.
*
* When the seat has the keyboard capability the text-input focus
* follows the keyboard focus.
*/
void (*leave)(void *data,
struct zwp_text_input_v3 *zwp_text_input_v3,
struct wl_surface *surface);
/**
* pre-edit
*
* Notify when a new composing text (pre-edit) should be set at
* the current cursor position. Any previously set composing text
* must be removed. Any previously existing selected text must be
* removed.
*
* The argument text contains the pre-edit string buffer.
*
* The parameters cursor_begin and cursor_end are counted in bytes
* relative to the beginning of the submitted text buffer. Cursor
* should be hidden when both are equal to -1.
*
* They could be represented by the client as a line if both values
* are the same, or as a text highlight otherwise.
*
* Values set with this event are double-buffered. They must be
* applied and reset to initial on the next zwp_text_input_v3.done
* event.
*
* The initial value of text is an empty string, and cursor_begin,
* cursor_end and cursor_hidden are all 0.
*/
void (*preedit_string)(void *data,
struct zwp_text_input_v3 *zwp_text_input_v3,
const char *text,
int32_t cursor_begin,
int32_t cursor_end);
/**
* text commit
*
* Notify when text should be inserted into the editor widget.
* The text to commit could be either just a single character after
* a key press or the result of some composing (pre-edit).
*
* Values set with this event are double-buffered. They must be
* applied and reset to initial on the next zwp_text_input_v3.done
* event.
*
* The initial value of text is an empty string.
*/
void (*commit_string)(void *data,
struct zwp_text_input_v3 *zwp_text_input_v3,
const char *text);
/**
* delete surrounding text
*
* Notify when the text around the current cursor position should
* be deleted.
*
* Before_length and after_length are the number of bytes before
* and after the current cursor index (excluding the selection) to
* delete.
*
* If a preedit text is present, in effect before_length is counted
* from the beginning of it, and after_length from its end (see
* done event sequence).
*
* Values set with this event are double-buffered. They must be
* applied and reset to initial on the next zwp_text_input_v3.done
* event.
*
* The initial values of both before_length and after_length are 0.
* @param before_length length of text before current cursor position
* @param after_length length of text after current cursor position
*/
void (*delete_surrounding_text)(void *data,
struct zwp_text_input_v3 *zwp_text_input_v3,
uint32_t before_length,
uint32_t after_length);
/**
* apply changes
*
* Instruct the application to apply changes to state requested
* by the preedit_string, commit_string and delete_surrounding_text
* events. The state relating to these events is double-buffered,
* and each one modifies the pending state. This event replaces the
* current state with the pending state.
*
* The application must 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_text_input_v3 object known to the compositor. The value of
* the serial argument must be equal to the number of commit
* requests already issued on that object.
*
* When the client receives a done event with a serial different
* than the number of past commit requests, it must proceed with
* evaluating and applying the changes as normal, except it should
* not change the current state of the zwp_text_input_v3 object.
* All pending state requests (set_surrounding_text,
* set_content_type and set_cursor_rectangle) on the
* zwp_text_input_v3 object should be sent and committed after
* receiving a zwp_text_input_v3.done event with a matching serial.
*/
void (*done)(void *data,
struct zwp_text_input_v3 *zwp_text_input_v3,
uint32_t serial);
};
/**
* @ingroup iface_zwp_text_input_v3
*/
static inline int
zwp_text_input_v3_add_listener(struct zwp_text_input_v3 *zwp_text_input_v3,
const struct zwp_text_input_v3_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zwp_text_input_v3,
(void (**)(void)) listener, data);
}
#define ZWP_TEXT_INPUT_V3_DESTROY 0
#define ZWP_TEXT_INPUT_V3_ENABLE 1
#define ZWP_TEXT_INPUT_V3_DISABLE 2
#define ZWP_TEXT_INPUT_V3_SET_SURROUNDING_TEXT 3
#define ZWP_TEXT_INPUT_V3_SET_TEXT_CHANGE_CAUSE 4
#define ZWP_TEXT_INPUT_V3_SET_CONTENT_TYPE 5
#define ZWP_TEXT_INPUT_V3_SET_CURSOR_RECTANGLE 6
#define ZWP_TEXT_INPUT_V3_COMMIT 7
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_ENTER_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_LEAVE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_PREEDIT_STRING_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_COMMIT_STRING_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_DONE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_ENABLE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_DISABLE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_SET_SURROUNDING_TEXT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_SET_TEXT_CHANGE_CAUSE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_SET_CONTENT_TYPE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_SET_CURSOR_RECTANGLE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_v3
*/
#define ZWP_TEXT_INPUT_V3_COMMIT_SINCE_VERSION 1
/** @ingroup iface_zwp_text_input_v3 */
static inline void
zwp_text_input_v3_set_user_data(struct zwp_text_input_v3 *zwp_text_input_v3, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_v3, user_data);
}
/** @ingroup iface_zwp_text_input_v3 */
static inline void *
zwp_text_input_v3_get_user_data(struct zwp_text_input_v3 *zwp_text_input_v3)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_v3);
}
static inline uint32_t
zwp_text_input_v3_get_version(struct zwp_text_input_v3 *zwp_text_input_v3)
{
return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3);
}
/**
* @ingroup iface_zwp_text_input_v3
*
* Destroy the wp_text_input object. Also disables all surfaces enabled
* through this wp_text_input object.
*/
static inline void
zwp_text_input_v3_destroy(struct zwp_text_input_v3 *zwp_text_input_v3)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
ZWP_TEXT_INPUT_V3_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zwp_text_input_v3
*
* Requests text input on the surface previously obtained from the enter
* event.
*
* This request must be issued every time the focused text input changes
* to a new one, including within the current surface. Use
* zwp_text_input_v3.disable when there is no longer any input focus on
* the current surface.
*
* Clients must not enable more than one text input on the single seat
* and should disable the current text input before enabling the new one.
* Requests to enable a text input when another text input is enabled
* on the same seat must be ignored by compositor.
*
* This request resets all state associated with previous enable, disable,
* set_surrounding_text, set_text_change_cause, set_content_type, and
* set_cursor_rectangle requests, as well as the state associated with
* preedit_string, commit_string, and delete_surrounding_text events.
*
* The set_surrounding_text, set_content_type and set_cursor_rectangle
* requests must follow if the text input supports the necessary
* functionality.
*
* State set with this request is double-buffered. It will get applied on
* the next zwp_text_input_v3.commit request, and stay valid until the
* next committed enable or disable request.
*
* The changes must be applied by the compositor after issuing a
* zwp_text_input_v3.commit request.
*/
static inline void
zwp_text_input_v3_enable(struct zwp_text_input_v3 *zwp_text_input_v3)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
ZWP_TEXT_INPUT_V3_ENABLE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0);
}
/**
* @ingroup iface_zwp_text_input_v3
*
* Explicitly disable text input on the current surface (typically when
* there is no focus on any text entry inside the surface).
*
* State set with this request is double-buffered. It will get applied on
* the next zwp_text_input_v3.commit request.
*/
static inline void
zwp_text_input_v3_disable(struct zwp_text_input_v3 *zwp_text_input_v3)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
ZWP_TEXT_INPUT_V3_DISABLE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0);
}
/**
* @ingroup iface_zwp_text_input_v3
*
* Sets the surrounding plain text around the input, excluding the preedit
* text.
*
* The client should notify the compositor of any changes in any of the
* values carried with this request, including changes caused by handling
* incoming text-input events as well as changes caused by other
* mechanisms like keyboard typing.
*
* If the client is unaware of the text around the cursor, it should not
* issue this request, to signify lack of support to the compositor.
*
* Text is UTF-8 encoded, and should include the cursor position, the
* complete selection and additional characters before and after them.
* 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 text buffer.
*
* Anchor is the byte offset of the selection anchor within text buffer.
* If there is no selected text, anchor is the same as cursor.
*
* If any preedit text is present, it is replaced with a cursor for the
* purpose of this event.
*
* Values set with this request are double-buffered. They will get applied
* on the next zwp_text_input_v3.commit request, and stay valid until the
* next committed enable or disable request.
*
* 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.
*/
static inline void
zwp_text_input_v3_set_surrounding_text(struct zwp_text_input_v3 *zwp_text_input_v3, const char *text, int32_t cursor, int32_t anchor)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
ZWP_TEXT_INPUT_V3_SET_SURROUNDING_TEXT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0, text, cursor, anchor);
}
/**
* @ingroup iface_zwp_text_input_v3
*
* Tells the compositor why the text surrounding the cursor changed.
*
* Whenever the client detects an external change in text, cursor, or
* anchor posision, 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 request is double-buffered. It must be applied
* and reset to initial at the next zwp_text_input_v3.commit request.
*
* The initial value of cause is input_method.
*/
static inline void
zwp_text_input_v3_set_text_change_cause(struct zwp_text_input_v3 *zwp_text_input_v3, uint32_t cause)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
ZWP_TEXT_INPUT_V3_SET_TEXT_CHANGE_CAUSE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0, cause);
}
/**
* @ingroup iface_zwp_text_input_v3
*
* Sets the content purpose and content hint. While the purpose is the
* basic purpose of an input field, the hint flags allow to modify some of
* the behavior.
*
* Values set with this request are double-buffered. They will get applied
* on the next zwp_text_input_v3.commit request.
* Subsequent attempts to update them may have no effect. The values
* remain valid until the next committed enable or disable request.
*
* The initial value for hint is none, and the initial value for purpose
* is normal.
*/
static inline void
zwp_text_input_v3_set_content_type(struct zwp_text_input_v3 *zwp_text_input_v3, uint32_t hint, uint32_t purpose)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
ZWP_TEXT_INPUT_V3_SET_CONTENT_TYPE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0, hint, purpose);
}
/**
* @ingroup iface_zwp_text_input_v3
*
* Marks an area around the cursor as a x, y, width, height rectangle in
* surface local coordinates.
*
* Allows the compositor to put a window with word suggestions near the
* cursor, without obstructing the text being input.
*
* If the client is unaware of the position of edited text, it should not
* issue this request, to signify lack of support to the compositor.
*
* Values set with this request are double-buffered. They will get applied
* on the next zwp_text_input_v3.commit request, and stay valid until the
* next committed enable or disable request.
*
* The initial values describing a cursor rectangle are empty. That means
* the text input does not support describing the cursor area. If the
* empty values get applied, subsequent attempts to change them may have
* no effect.
*/
static inline void
zwp_text_input_v3_set_cursor_rectangle(struct zwp_text_input_v3 *zwp_text_input_v3, int32_t x, int32_t y, int32_t width, int32_t height)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
ZWP_TEXT_INPUT_V3_SET_CURSOR_RECTANGLE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0, x, y, width, height);
}
/**
* @ingroup iface_zwp_text_input_v3
*
* Atomically applies state changes recently sent to the compositor.
*
* The commit request establishes and updates the state of the client, and
* must be issued after any changes to apply them.
*
* Text input state (enabled status, content purpose, content hint,
* surrounding text and change cause, cursor rectangle) is conceptually
* double-buffered within the context of a text input, i.e. between a
* committed enable request and the following committed enable or disable
* request.
*
* Protocol requests modify the pending state, as opposed to the current
* state in use by the input method. A commit request atomically applies
* all pending state, replacing the current state. After commit, the new
* pending state is as documented for each related request.
*
* Requests are applied in the order of arrival.
*
* Neither current nor pending state are modified unless noted otherwise.
*
* The compositor must count the number of commit requests coming from
* each zwp_text_input_v3 object and use the count as the serial in done
* events.
*/
static inline void
zwp_text_input_v3_commit(struct zwp_text_input_v3 *zwp_text_input_v3)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
ZWP_TEXT_INPUT_V3_COMMIT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0);
}
#define ZWP_TEXT_INPUT_MANAGER_V3_DESTROY 0
#define ZWP_TEXT_INPUT_MANAGER_V3_GET_TEXT_INPUT 1
/**
* @ingroup iface_zwp_text_input_manager_v3
*/
#define ZWP_TEXT_INPUT_MANAGER_V3_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_text_input_manager_v3
*/
#define ZWP_TEXT_INPUT_MANAGER_V3_GET_TEXT_INPUT_SINCE_VERSION 1
/** @ingroup iface_zwp_text_input_manager_v3 */
static inline void
zwp_text_input_manager_v3_set_user_data(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_manager_v3, user_data);
}
/** @ingroup iface_zwp_text_input_manager_v3 */
static inline void *
zwp_text_input_manager_v3_get_user_data(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3)
{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_manager_v3);
}
static inline uint32_t
zwp_text_input_manager_v3_get_version(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3)
{
return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v3);
}
/**
* @ingroup iface_zwp_text_input_manager_v3
*
* Destroy the wp_text_input_manager object.
*/
static inline void
zwp_text_input_manager_v3_destroy(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3)
{
wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_manager_v3,
ZWP_TEXT_INPUT_MANAGER_V3_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v3), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zwp_text_input_manager_v3
*
* Creates a new text-input object for a given seat.
*/
static inline struct zwp_text_input_v3 *
zwp_text_input_manager_v3_get_text_input(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3, struct wl_seat *seat)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_manager_v3,
ZWP_TEXT_INPUT_MANAGER_V3_GET_TEXT_INPUT, &zwp_text_input_v3_interface, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v3), 0, NULL, seat);
return (struct zwp_text_input_v3 *) id;
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,85 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
* Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>
*
* 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.
*/
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
#else
#define WL_PRIVATE
#endif
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface xdg_activation_token_v1_interface;
static const struct wl_interface *xdg_activation_v1_types[] = {
NULL,
&xdg_activation_token_v1_interface,
NULL,
&wl_surface_interface,
NULL,
&wl_seat_interface,
&wl_surface_interface,
};
static const struct wl_message xdg_activation_v1_requests[] = {
{ "destroy", "", xdg_activation_v1_types + 0 },
{ "get_activation_token", "n", xdg_activation_v1_types + 1 },
{ "activate", "so", xdg_activation_v1_types + 2 },
};
WL_PRIVATE const struct wl_interface xdg_activation_v1_interface = {
"xdg_activation_v1", 1,
3, xdg_activation_v1_requests,
0, NULL,
};
static const struct wl_message xdg_activation_token_v1_requests[] = {
{ "set_serial", "uo", xdg_activation_v1_types + 4 },
{ "set_app_id", "s", xdg_activation_v1_types + 0 },
{ "set_surface", "o", xdg_activation_v1_types + 6 },
{ "commit", "", xdg_activation_v1_types + 0 },
{ "destroy", "", xdg_activation_v1_types + 0 },
};
static const struct wl_message xdg_activation_token_v1_events[] = {
{ "done", "s", xdg_activation_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface xdg_activation_token_v1_interface = {
"xdg_activation_token_v1", 1,
5, xdg_activation_token_v1_requests,
1, xdg_activation_token_v1_events,
};

View File

@ -0,0 +1,415 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H
#define XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_xdg_activation_v1 The xdg_activation_v1 protocol
* Protocol for requesting activation of surfaces
*
* @section page_desc_xdg_activation_v1 Description
*
* The way for a client to pass focus to another toplevel is as follows.
*
* The client that intends to activate another toplevel uses the
* xdg_activation_v1.get_activation_token request to get an activation token.
* This token is then forwarded to the client, which is supposed to activate
* one of its surfaces, through a separate band of communication.
*
* One established way of doing this is through the XDG_ACTIVATION_TOKEN
* environment variable of a newly launched child process. The child process
* should unset the environment variable again right after reading it out in
* order to avoid propagating it to other child processes.
*
* Another established way exists for Applications implementing the D-Bus
* interface org.freedesktop.Application, which should get their token under
* activation-token on their platform_data.
*
* In general activation tokens may be transferred across clients through
* means not described in this protocol.
*
* The client to be activated will then pass the token
* it received to the xdg_activation_v1.activate request. The compositor can
* then use this token to decide how to react to the activation request.
*
* The token the activating client gets may be ineffective either already at
* the time it receives it, for example if it was not focused, for focus
* stealing prevention. The activating client will have no way to discover
* the validity of the token, and may still forward it to the to be activated
* client.
*
* The created activation token may optionally get information attached to it
* that can be used by the compositor to identify the application that we
* intend to activate. This can for example be used to display a visual hint
* about what application is being started.
*
* Warning! The protocol described in this file is currently in the testing
* phase. Backward compatible changes may be added together with the
* corresponding interface version bump. Backward incompatible changes can
* only be done by creating a new major version of the extension.
*
* @section page_ifaces_xdg_activation_v1 Interfaces
* - @subpage page_iface_xdg_activation_v1 - interface for activating surfaces
* - @subpage page_iface_xdg_activation_token_v1 - an exported activation handle
* @section page_copyright_xdg_activation_v1 Copyright
* <pre>
*
* Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
* Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>
*
* 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 xdg_activation_token_v1;
struct xdg_activation_v1;
#ifndef XDG_ACTIVATION_V1_INTERFACE
#define XDG_ACTIVATION_V1_INTERFACE
/**
* @page page_iface_xdg_activation_v1 xdg_activation_v1
* @section page_iface_xdg_activation_v1_desc Description
*
* A global interface used for informing the compositor about applications
* being activated or started, or for applications to request to be
* activated.
* @section page_iface_xdg_activation_v1_api API
* See @ref iface_xdg_activation_v1.
*/
/**
* @defgroup iface_xdg_activation_v1 The xdg_activation_v1 interface
*
* A global interface used for informing the compositor about applications
* being activated or started, or for applications to request to be
* activated.
*/
extern const struct wl_interface xdg_activation_v1_interface;
#endif
#ifndef XDG_ACTIVATION_TOKEN_V1_INTERFACE
#define XDG_ACTIVATION_TOKEN_V1_INTERFACE
/**
* @page page_iface_xdg_activation_token_v1 xdg_activation_token_v1
* @section page_iface_xdg_activation_token_v1_desc Description
*
* An object for setting up a token and receiving a token handle that can
* be passed as an activation token to another client.
*
* The object is created using the xdg_activation_v1.get_activation_token
* request. This object should then be populated with the app_id, surface
* and serial information and committed. The compositor shall then issue a
* done event with the token. In case the request's parameters are invalid,
* the compositor will provide an invalid token.
* @section page_iface_xdg_activation_token_v1_api API
* See @ref iface_xdg_activation_token_v1.
*/
/**
* @defgroup iface_xdg_activation_token_v1 The xdg_activation_token_v1 interface
*
* An object for setting up a token and receiving a token handle that can
* be passed as an activation token to another client.
*
* The object is created using the xdg_activation_v1.get_activation_token
* request. This object should then be populated with the app_id, surface
* and serial information and committed. The compositor shall then issue a
* done event with the token. In case the request's parameters are invalid,
* the compositor will provide an invalid token.
*/
extern const struct wl_interface xdg_activation_token_v1_interface;
#endif
#define XDG_ACTIVATION_V1_DESTROY 0
#define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN 1
#define XDG_ACTIVATION_V1_ACTIVATE 2
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_ACTIVATE_SINCE_VERSION 1
/** @ingroup iface_xdg_activation_v1 */
static inline void
xdg_activation_v1_set_user_data(struct xdg_activation_v1 *xdg_activation_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_activation_v1, user_data);
}
/** @ingroup iface_xdg_activation_v1 */
static inline void *
xdg_activation_v1_get_user_data(struct xdg_activation_v1 *xdg_activation_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_activation_v1);
}
static inline uint32_t
xdg_activation_v1_get_version(struct xdg_activation_v1 *xdg_activation_v1)
{
return wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1);
}
/**
* @ingroup iface_xdg_activation_v1
*
* Notify the compositor that the xdg_activation object will no longer be
* used.
*
* The child objects created via this interface are unaffected and should
* be destroyed separately.
*/
static inline void
xdg_activation_v1_destroy(struct xdg_activation_v1 *xdg_activation_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_xdg_activation_v1
*
* Creates an xdg_activation_token_v1 object that will provide
* the initiating client with a unique token for this activation. This
* token should be offered to the clients to be activated.
*/
static inline struct xdg_activation_token_v1 *
xdg_activation_v1_get_activation_token(struct xdg_activation_v1 *xdg_activation_v1)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN, &xdg_activation_token_v1_interface, wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1), 0, NULL);
return (struct xdg_activation_token_v1 *) id;
}
/**
* @ingroup iface_xdg_activation_v1
*
* Requests surface activation. It's up to the compositor to display
* this information as desired, for example by placing the surface above
* the rest.
*
* The compositor may know who requested this by checking the activation
* token and might decide not to follow through with the activation if it's
* considered unwanted.
*
* Compositors can ignore unknown activation tokens when an invalid
* token is passed.
*/
static inline void
xdg_activation_v1_activate(struct xdg_activation_v1 *xdg_activation_v1, const char *token, struct wl_surface *surface)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_ACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1), 0, token, surface);
}
#ifndef XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM
#define XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM
enum xdg_activation_token_v1_error {
/**
* The token has already been used previously
*/
XDG_ACTIVATION_TOKEN_V1_ERROR_ALREADY_USED = 0,
};
#endif /* XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM */
/**
* @ingroup iface_xdg_activation_token_v1
* @struct xdg_activation_token_v1_listener
*/
struct xdg_activation_token_v1_listener {
/**
* the exported activation token
*
* The 'done' event contains the unique token of this activation
* request and notifies that the provider is done.
* @param token the exported activation token
*/
void (*done)(void *data,
struct xdg_activation_token_v1 *xdg_activation_token_v1,
const char *token);
};
/**
* @ingroup iface_xdg_activation_token_v1
*/
static inline int
xdg_activation_token_v1_add_listener(struct xdg_activation_token_v1 *xdg_activation_token_v1,
const struct xdg_activation_token_v1_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) xdg_activation_token_v1,
(void (**)(void)) listener, data);
}
#define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL 0
#define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID 1
#define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE 2
#define XDG_ACTIVATION_TOKEN_V1_COMMIT 3
#define XDG_ACTIVATION_TOKEN_V1_DESTROY 4
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_DONE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_COMMIT_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_DESTROY_SINCE_VERSION 1
/** @ingroup iface_xdg_activation_token_v1 */
static inline void
xdg_activation_token_v1_set_user_data(struct xdg_activation_token_v1 *xdg_activation_token_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_activation_token_v1, user_data);
}
/** @ingroup iface_xdg_activation_token_v1 */
static inline void *
xdg_activation_token_v1_get_user_data(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_activation_token_v1);
}
static inline uint32_t
xdg_activation_token_v1_get_version(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
return wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Provides information about the seat and serial event that requested the
* token.
*
* The serial can come from an input or focus event. For instance, if a
* click triggers the launch of a third-party client, the launcher client
* should send a set_serial request with the serial and seat from the
* wl_pointer.button event.
*
* Some compositors might refuse to activate toplevels when the token
* doesn't have a valid and recent enough event serial.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_serial(struct xdg_activation_token_v1 *xdg_activation_token_v1, uint32_t serial, struct wl_seat *seat)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_SERIAL, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), 0, serial, seat);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* The requesting client can specify an app_id to associate the token
* being created with it.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_app_id(struct xdg_activation_token_v1 *xdg_activation_token_v1, const char *app_id)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_APP_ID, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), 0, app_id);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* This request sets the surface requesting the activation. Note, this is
* different from the surface that will be activated.
*
* Some compositors might refuse to activate toplevels when the token
* doesn't have a requesting surface.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_surface(struct xdg_activation_token_v1 *xdg_activation_token_v1, struct wl_surface *surface)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_SURFACE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), 0, surface);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Requests an activation token based on the different parameters that
* have been offered through set_serial, set_surface and set_app_id.
*/
static inline void
xdg_activation_token_v1_commit(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_COMMIT, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), 0);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Notify the compositor that the xdg_activation_token_v1 object will no
* longer be used. The received token stays valid.
*/
static inline void
xdg_activation_token_v1_destroy(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), WL_MARSHAL_FLAG_DESTROY);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,104 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2015-2016 Red Hat Inc.
*
* 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.
*/
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
#else
#define WL_PRIVATE
#endif
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface zxdg_exported_v2_interface;
extern const struct wl_interface zxdg_imported_v2_interface;
static const struct wl_interface *xdg_foreign_unstable_v2_types[] = {
NULL,
&zxdg_exported_v2_interface,
&wl_surface_interface,
&zxdg_imported_v2_interface,
NULL,
&wl_surface_interface,
};
static const struct wl_message zxdg_exporter_v2_requests[] = {
{ "destroy", "", xdg_foreign_unstable_v2_types + 0 },
{ "export_toplevel", "no", xdg_foreign_unstable_v2_types + 1 },
};
WL_PRIVATE const struct wl_interface zxdg_exporter_v2_interface = {
"zxdg_exporter_v2", 1,
2, zxdg_exporter_v2_requests,
0, NULL,
};
static const struct wl_message zxdg_importer_v2_requests[] = {
{ "destroy", "", xdg_foreign_unstable_v2_types + 0 },
{ "import_toplevel", "ns", xdg_foreign_unstable_v2_types + 3 },
};
WL_PRIVATE const struct wl_interface zxdg_importer_v2_interface = {
"zxdg_importer_v2", 1,
2, zxdg_importer_v2_requests,
0, NULL,
};
static const struct wl_message zxdg_exported_v2_requests[] = {
{ "destroy", "", xdg_foreign_unstable_v2_types + 0 },
};
static const struct wl_message zxdg_exported_v2_events[] = {
{ "handle", "s", xdg_foreign_unstable_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zxdg_exported_v2_interface = {
"zxdg_exported_v2", 1,
1, zxdg_exported_v2_requests,
1, zxdg_exported_v2_events,
};
static const struct wl_message zxdg_imported_v2_requests[] = {
{ "destroy", "", xdg_foreign_unstable_v2_types + 0 },
{ "set_parent_of", "o", xdg_foreign_unstable_v2_types + 5 },
};
static const struct wl_message zxdg_imported_v2_events[] = {
{ "destroyed", "", xdg_foreign_unstable_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zxdg_imported_v2_interface = {
"zxdg_imported_v2", 1,
2, zxdg_imported_v2_requests,
1, zxdg_imported_v2_events,
};

View File

@ -0,0 +1,518 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef XDG_FOREIGN_UNSTABLE_V2_CLIENT_PROTOCOL_H
#define XDG_FOREIGN_UNSTABLE_V2_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_xdg_foreign_unstable_v2 The xdg_foreign_unstable_v2 protocol
* Protocol for exporting xdg surface handles
*
* @section page_desc_xdg_foreign_unstable_v2 Description
*
* This protocol specifies a way for making it possible to reference a surface
* of a different client. With such a reference, a client can, by using the
* interfaces provided by this protocol, manipulate the relationship between
* its own surfaces and the surface of some other client. For example, stack
* some of its own surface above the other clients surface.
*
* In order for a client A to get a reference of a surface of client B, client
* B must first export its surface using xdg_exporter.export_toplevel. Upon
* doing this, client B will receive a handle (a unique string) that it may
* share with client A in some way (for example D-Bus). After client A has
* received the handle from client B, it may use xdg_importer.import_toplevel
* to create a reference to the surface client B just exported. See the
* corresponding requests for details.
*
* A possible use case for this is out-of-process dialogs. For example when a
* sandboxed client without file system access needs the user to select a file
* on the file system, given sandbox environment support, it can export its
* surface, passing the exported surface handle to an unsandboxed process that
* can show a file browser dialog and stack it above the sandboxed client's
* surface.
*
* 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_xdg_foreign_unstable_v2 Interfaces
* - @subpage page_iface_zxdg_exporter_v2 - interface for exporting surfaces
* - @subpage page_iface_zxdg_importer_v2 - interface for importing surfaces
* - @subpage page_iface_zxdg_exported_v2 - an exported surface handle
* - @subpage page_iface_zxdg_imported_v2 - an imported surface handle
* @section page_copyright_xdg_foreign_unstable_v2 Copyright
* <pre>
*
* Copyright © 2015-2016 Red Hat Inc.
*
* 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 zxdg_exported_v2;
struct zxdg_exporter_v2;
struct zxdg_imported_v2;
struct zxdg_importer_v2;
#ifndef ZXDG_EXPORTER_V2_INTERFACE
#define ZXDG_EXPORTER_V2_INTERFACE
/**
* @page page_iface_zxdg_exporter_v2 zxdg_exporter_v2
* @section page_iface_zxdg_exporter_v2_desc Description
*
* A global interface used for exporting surfaces that can later be imported
* using xdg_importer.
* @section page_iface_zxdg_exporter_v2_api API
* See @ref iface_zxdg_exporter_v2.
*/
/**
* @defgroup iface_zxdg_exporter_v2 The zxdg_exporter_v2 interface
*
* A global interface used for exporting surfaces that can later be imported
* using xdg_importer.
*/
extern const struct wl_interface zxdg_exporter_v2_interface;
#endif
#ifndef ZXDG_IMPORTER_V2_INTERFACE
#define ZXDG_IMPORTER_V2_INTERFACE
/**
* @page page_iface_zxdg_importer_v2 zxdg_importer_v2
* @section page_iface_zxdg_importer_v2_desc Description
*
* A global interface used for importing surfaces exported by xdg_exporter.
* With this interface, a client can create a reference to a surface of
* another client.
* @section page_iface_zxdg_importer_v2_api API
* See @ref iface_zxdg_importer_v2.
*/
/**
* @defgroup iface_zxdg_importer_v2 The zxdg_importer_v2 interface
*
* A global interface used for importing surfaces exported by xdg_exporter.
* With this interface, a client can create a reference to a surface of
* another client.
*/
extern const struct wl_interface zxdg_importer_v2_interface;
#endif
#ifndef ZXDG_EXPORTED_V2_INTERFACE
#define ZXDG_EXPORTED_V2_INTERFACE
/**
* @page page_iface_zxdg_exported_v2 zxdg_exported_v2
* @section page_iface_zxdg_exported_v2_desc Description
*
* An xdg_exported object represents an exported reference to a surface. The
* exported surface may be referenced as long as the xdg_exported object not
* destroyed. Destroying the xdg_exported invalidates any relationship the
* importer may have established using xdg_imported.
* @section page_iface_zxdg_exported_v2_api API
* See @ref iface_zxdg_exported_v2.
*/
/**
* @defgroup iface_zxdg_exported_v2 The zxdg_exported_v2 interface
*
* An xdg_exported object represents an exported reference to a surface. The
* exported surface may be referenced as long as the xdg_exported object not
* destroyed. Destroying the xdg_exported invalidates any relationship the
* importer may have established using xdg_imported.
*/
extern const struct wl_interface zxdg_exported_v2_interface;
#endif
#ifndef ZXDG_IMPORTED_V2_INTERFACE
#define ZXDG_IMPORTED_V2_INTERFACE
/**
* @page page_iface_zxdg_imported_v2 zxdg_imported_v2
* @section page_iface_zxdg_imported_v2_desc Description
*
* An xdg_imported object represents an imported reference to surface exported
* by some client. A client can use this interface to manipulate
* relationships between its own surfaces and the imported surface.
* @section page_iface_zxdg_imported_v2_api API
* See @ref iface_zxdg_imported_v2.
*/
/**
* @defgroup iface_zxdg_imported_v2 The zxdg_imported_v2 interface
*
* An xdg_imported object represents an imported reference to surface exported
* by some client. A client can use this interface to manipulate
* relationships between its own surfaces and the imported surface.
*/
extern const struct wl_interface zxdg_imported_v2_interface;
#endif
#ifndef ZXDG_EXPORTER_V2_ERROR_ENUM
#define ZXDG_EXPORTER_V2_ERROR_ENUM
/**
* @ingroup iface_zxdg_exporter_v2
* error values
*
* These errors can be emitted in response to invalid xdg_exporter
* requests.
*/
enum zxdg_exporter_v2_error {
/**
* surface is not an xdg_toplevel
*/
ZXDG_EXPORTER_V2_ERROR_INVALID_SURFACE = 0,
};
#endif /* ZXDG_EXPORTER_V2_ERROR_ENUM */
#define ZXDG_EXPORTER_V2_DESTROY 0
#define ZXDG_EXPORTER_V2_EXPORT_TOPLEVEL 1
/**
* @ingroup iface_zxdg_exporter_v2
*/
#define ZXDG_EXPORTER_V2_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_exporter_v2
*/
#define ZXDG_EXPORTER_V2_EXPORT_TOPLEVEL_SINCE_VERSION 1
/** @ingroup iface_zxdg_exporter_v2 */
static inline void
zxdg_exporter_v2_set_user_data(struct zxdg_exporter_v2 *zxdg_exporter_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zxdg_exporter_v2, user_data);
}
/** @ingroup iface_zxdg_exporter_v2 */
static inline void *
zxdg_exporter_v2_get_user_data(struct zxdg_exporter_v2 *zxdg_exporter_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_exporter_v2);
}
static inline uint32_t
zxdg_exporter_v2_get_version(struct zxdg_exporter_v2 *zxdg_exporter_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zxdg_exporter_v2);
}
/**
* @ingroup iface_zxdg_exporter_v2
*
* Notify the compositor that the xdg_exporter object will no longer be
* used.
*/
static inline void
zxdg_exporter_v2_destroy(struct zxdg_exporter_v2 *zxdg_exporter_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_exporter_v2,
ZXDG_EXPORTER_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_exporter_v2), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zxdg_exporter_v2
*
* The export_toplevel request exports the passed surface so that it can later be
* imported via xdg_importer. When called, a new xdg_exported object will
* be created and xdg_exported.handle will be sent immediately. See the
* corresponding interface and event for details.
*
* A surface may be exported multiple times, and each exported handle may
* be used to create an xdg_imported multiple times. Only xdg_toplevel
* equivalent surfaces may be exported, otherwise an invalid_surface
* protocol error is sent.
*/
static inline struct zxdg_exported_v2 *
zxdg_exporter_v2_export_toplevel(struct zxdg_exporter_v2 *zxdg_exporter_v2, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_exporter_v2,
ZXDG_EXPORTER_V2_EXPORT_TOPLEVEL, &zxdg_exported_v2_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_exporter_v2), 0, NULL, surface);
return (struct zxdg_exported_v2 *) id;
}
#define ZXDG_IMPORTER_V2_DESTROY 0
#define ZXDG_IMPORTER_V2_IMPORT_TOPLEVEL 1
/**
* @ingroup iface_zxdg_importer_v2
*/
#define ZXDG_IMPORTER_V2_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_importer_v2
*/
#define ZXDG_IMPORTER_V2_IMPORT_TOPLEVEL_SINCE_VERSION 1
/** @ingroup iface_zxdg_importer_v2 */
static inline void
zxdg_importer_v2_set_user_data(struct zxdg_importer_v2 *zxdg_importer_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zxdg_importer_v2, user_data);
}
/** @ingroup iface_zxdg_importer_v2 */
static inline void *
zxdg_importer_v2_get_user_data(struct zxdg_importer_v2 *zxdg_importer_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_importer_v2);
}
static inline uint32_t
zxdg_importer_v2_get_version(struct zxdg_importer_v2 *zxdg_importer_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zxdg_importer_v2);
}
/**
* @ingroup iface_zxdg_importer_v2
*
* Notify the compositor that the xdg_importer object will no longer be
* used.
*/
static inline void
zxdg_importer_v2_destroy(struct zxdg_importer_v2 *zxdg_importer_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_importer_v2,
ZXDG_IMPORTER_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_importer_v2), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zxdg_importer_v2
*
* The import_toplevel request imports a surface from any client given a handle
* retrieved by exporting said surface using xdg_exporter.export_toplevel.
* When called, a new xdg_imported object will be created. This new object
* represents the imported surface, and the importing client can
* manipulate its relationship using it. See xdg_imported for details.
*/
static inline struct zxdg_imported_v2 *
zxdg_importer_v2_import_toplevel(struct zxdg_importer_v2 *zxdg_importer_v2, const char *handle)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_importer_v2,
ZXDG_IMPORTER_V2_IMPORT_TOPLEVEL, &zxdg_imported_v2_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_importer_v2), 0, NULL, handle);
return (struct zxdg_imported_v2 *) id;
}
/**
* @ingroup iface_zxdg_exported_v2
* @struct zxdg_exported_v2_listener
*/
struct zxdg_exported_v2_listener {
/**
* the exported surface handle
*
* The handle event contains the unique handle of this exported
* surface reference. It may be shared with any client, which then
* can use it to import the surface by calling
* xdg_importer.import_toplevel. A handle may be used to import the
* surface multiple times.
* @param handle the exported surface handle
*/
void (*handle)(void *data,
struct zxdg_exported_v2 *zxdg_exported_v2,
const char *handle);
};
/**
* @ingroup iface_zxdg_exported_v2
*/
static inline int
zxdg_exported_v2_add_listener(struct zxdg_exported_v2 *zxdg_exported_v2,
const struct zxdg_exported_v2_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zxdg_exported_v2,
(void (**)(void)) listener, data);
}
#define ZXDG_EXPORTED_V2_DESTROY 0
/**
* @ingroup iface_zxdg_exported_v2
*/
#define ZXDG_EXPORTED_V2_HANDLE_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_exported_v2
*/
#define ZXDG_EXPORTED_V2_DESTROY_SINCE_VERSION 1
/** @ingroup iface_zxdg_exported_v2 */
static inline void
zxdg_exported_v2_set_user_data(struct zxdg_exported_v2 *zxdg_exported_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zxdg_exported_v2, user_data);
}
/** @ingroup iface_zxdg_exported_v2 */
static inline void *
zxdg_exported_v2_get_user_data(struct zxdg_exported_v2 *zxdg_exported_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_exported_v2);
}
static inline uint32_t
zxdg_exported_v2_get_version(struct zxdg_exported_v2 *zxdg_exported_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zxdg_exported_v2);
}
/**
* @ingroup iface_zxdg_exported_v2
*
* Revoke the previously exported surface. This invalidates any
* relationship the importer may have set up using the xdg_imported created
* given the handle sent via xdg_exported.handle.
*/
static inline void
zxdg_exported_v2_destroy(struct zxdg_exported_v2 *zxdg_exported_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_exported_v2,
ZXDG_EXPORTED_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_exported_v2), WL_MARSHAL_FLAG_DESTROY);
}
#ifndef ZXDG_IMPORTED_V2_ERROR_ENUM
#define ZXDG_IMPORTED_V2_ERROR_ENUM
/**
* @ingroup iface_zxdg_imported_v2
* error values
*
* These errors can be emitted in response to invalid xdg_imported
* requests.
*/
enum zxdg_imported_v2_error {
/**
* surface is not an xdg_toplevel
*/
ZXDG_IMPORTED_V2_ERROR_INVALID_SURFACE = 0,
};
#endif /* ZXDG_IMPORTED_V2_ERROR_ENUM */
/**
* @ingroup iface_zxdg_imported_v2
* @struct zxdg_imported_v2_listener
*/
struct zxdg_imported_v2_listener {
/**
* the imported surface handle has been destroyed
*
* The imported surface handle has been destroyed and any
* relationship set up has been invalidated. This may happen for
* various reasons, for example if the exported surface or the
* exported surface handle has been destroyed, if the handle used
* for importing was invalid.
*/
void (*destroyed)(void *data,
struct zxdg_imported_v2 *zxdg_imported_v2);
};
/**
* @ingroup iface_zxdg_imported_v2
*/
static inline int
zxdg_imported_v2_add_listener(struct zxdg_imported_v2 *zxdg_imported_v2,
const struct zxdg_imported_v2_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zxdg_imported_v2,
(void (**)(void)) listener, data);
}
#define ZXDG_IMPORTED_V2_DESTROY 0
#define ZXDG_IMPORTED_V2_SET_PARENT_OF 1
/**
* @ingroup iface_zxdg_imported_v2
*/
#define ZXDG_IMPORTED_V2_DESTROYED_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_imported_v2
*/
#define ZXDG_IMPORTED_V2_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_imported_v2
*/
#define ZXDG_IMPORTED_V2_SET_PARENT_OF_SINCE_VERSION 1
/** @ingroup iface_zxdg_imported_v2 */
static inline void
zxdg_imported_v2_set_user_data(struct zxdg_imported_v2 *zxdg_imported_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zxdg_imported_v2, user_data);
}
/** @ingroup iface_zxdg_imported_v2 */
static inline void *
zxdg_imported_v2_get_user_data(struct zxdg_imported_v2 *zxdg_imported_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_imported_v2);
}
static inline uint32_t
zxdg_imported_v2_get_version(struct zxdg_imported_v2 *zxdg_imported_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zxdg_imported_v2);
}
/**
* @ingroup iface_zxdg_imported_v2
*
* Notify the compositor that it will no longer use the xdg_imported
* object. Any relationship that may have been set up will at this point
* be invalidated.
*/
static inline void
zxdg_imported_v2_destroy(struct zxdg_imported_v2 *zxdg_imported_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_imported_v2,
ZXDG_IMPORTED_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_imported_v2), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zxdg_imported_v2
*
* Set the imported surface as the parent of some surface of the client.
* The passed surface must be an xdg_toplevel equivalent, otherwise an
* invalid_surface protocol error is sent. Calling this function sets up
* a surface to surface relation with the same stacking and positioning
* semantics as xdg_toplevel.set_parent.
*/
static inline void
zxdg_imported_v2_set_parent_of(struct zxdg_imported_v2 *zxdg_imported_v2, struct wl_surface *surface)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_imported_v2,
ZXDG_IMPORTED_V2_SET_PARENT_OF, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_imported_v2), 0, surface);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,83 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2023-2024 Matthias Klumpp
* Copyright © 2024 David Edmundson
*
* 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.
*/
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
#else
#define WL_PRIVATE
#endif
extern const struct wl_interface wl_buffer_interface;
extern const struct wl_interface xdg_toplevel_interface;
extern const struct wl_interface xdg_toplevel_icon_v1_interface;
static const struct wl_interface *xdg_toplevel_icon_v1_types[] = {
NULL,
&xdg_toplevel_icon_v1_interface,
&xdg_toplevel_interface,
&xdg_toplevel_icon_v1_interface,
&wl_buffer_interface,
NULL,
};
static const struct wl_message xdg_toplevel_icon_manager_v1_requests[] = {
{ "destroy", "", xdg_toplevel_icon_v1_types + 0 },
{ "create_icon", "n", xdg_toplevel_icon_v1_types + 1 },
{ "set_icon", "o?o", xdg_toplevel_icon_v1_types + 2 },
};
static const struct wl_message xdg_toplevel_icon_manager_v1_events[] = {
{ "icon_size", "i", xdg_toplevel_icon_v1_types + 0 },
{ "done", "", xdg_toplevel_icon_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface xdg_toplevel_icon_manager_v1_interface = {
"xdg_toplevel_icon_manager_v1", 1,
3, xdg_toplevel_icon_manager_v1_requests,
2, xdg_toplevel_icon_manager_v1_events,
};
static const struct wl_message xdg_toplevel_icon_v1_requests[] = {
{ "destroy", "", xdg_toplevel_icon_v1_types + 0 },
{ "set_name", "s", xdg_toplevel_icon_v1_types + 0 },
{ "add_buffer", "oi", xdg_toplevel_icon_v1_types + 4 },
};
WL_PRIVATE const struct wl_interface xdg_toplevel_icon_v1_interface = {
"xdg_toplevel_icon_v1", 1,
3, xdg_toplevel_icon_v1_requests,
0, NULL,
};

View File

@ -0,0 +1,410 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef XDG_TOPLEVEL_ICON_V1_CLIENT_PROTOCOL_H
#define XDG_TOPLEVEL_ICON_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_xdg_toplevel_icon_v1 The xdg_toplevel_icon_v1 protocol
* protocol to assign icons to toplevels
*
* @section page_desc_xdg_toplevel_icon_v1 Description
*
* This protocol allows clients to set icons for their toplevel surfaces
* either via the XDG icon stock (using an icon name), or from pixel data.
*
* A toplevel icon represents the individual toplevel (unlike the application
* or launcher icon, which represents the application as a whole), and may be
* shown in window switchers, window overviews and taskbars that list
* individual windows.
*
* This document adheres to RFC 2119 when using words like "must",
* "should", "may", etc.
*
* Warning! The protocol described in this file is currently in the testing
* phase. Backward compatible changes may be added together with the
* corresponding interface version bump. Backward incompatible changes can
* only be done by creating a new major version of the extension.
*
* @section page_ifaces_xdg_toplevel_icon_v1 Interfaces
* - @subpage page_iface_xdg_toplevel_icon_manager_v1 - interface to manage toplevel icons
* - @subpage page_iface_xdg_toplevel_icon_v1 - a toplevel window icon
* @section page_copyright_xdg_toplevel_icon_v1 Copyright
* <pre>
*
* Copyright © 2023-2024 Matthias Klumpp
* Copyright © 2024 David Edmundson
*
* 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_buffer;
struct xdg_toplevel;
struct xdg_toplevel_icon_manager_v1;
struct xdg_toplevel_icon_v1;
#ifndef XDG_TOPLEVEL_ICON_MANAGER_V1_INTERFACE
#define XDG_TOPLEVEL_ICON_MANAGER_V1_INTERFACE
/**
* @page page_iface_xdg_toplevel_icon_manager_v1 xdg_toplevel_icon_manager_v1
* @section page_iface_xdg_toplevel_icon_manager_v1_desc Description
*
* This interface allows clients to create toplevel window icons and set
* them on toplevel windows to be displayed to the user.
* @section page_iface_xdg_toplevel_icon_manager_v1_api API
* See @ref iface_xdg_toplevel_icon_manager_v1.
*/
/**
* @defgroup iface_xdg_toplevel_icon_manager_v1 The xdg_toplevel_icon_manager_v1 interface
*
* This interface allows clients to create toplevel window icons and set
* them on toplevel windows to be displayed to the user.
*/
extern const struct wl_interface xdg_toplevel_icon_manager_v1_interface;
#endif
#ifndef XDG_TOPLEVEL_ICON_V1_INTERFACE
#define XDG_TOPLEVEL_ICON_V1_INTERFACE
/**
* @page page_iface_xdg_toplevel_icon_v1 xdg_toplevel_icon_v1
* @section page_iface_xdg_toplevel_icon_v1_desc Description
*
* This interface defines a toplevel icon.
* An icon can have a name, and multiple buffers.
* In order to be applied, the icon must have either a name, or at least
* one buffer assigned. Applying an empty icon (with no buffer or name) to
* a toplevel should reset its icon to the default icon.
*
* It is up to compositor policy whether to prefer using a buffer or loading
* an icon via its name. See 'set_name' and 'add_buffer' for details.
* @section page_iface_xdg_toplevel_icon_v1_api API
* See @ref iface_xdg_toplevel_icon_v1.
*/
/**
* @defgroup iface_xdg_toplevel_icon_v1 The xdg_toplevel_icon_v1 interface
*
* This interface defines a toplevel icon.
* An icon can have a name, and multiple buffers.
* In order to be applied, the icon must have either a name, or at least
* one buffer assigned. Applying an empty icon (with no buffer or name) to
* a toplevel should reset its icon to the default icon.
*
* It is up to compositor policy whether to prefer using a buffer or loading
* an icon via its name. See 'set_name' and 'add_buffer' for details.
*/
extern const struct wl_interface xdg_toplevel_icon_v1_interface;
#endif
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
* @struct xdg_toplevel_icon_manager_v1_listener
*/
struct xdg_toplevel_icon_manager_v1_listener {
/**
* describes a supported & preferred icon size
*
* This event indicates an icon size the compositor prefers to be
* available if the client has scalable icons and can render to any
* size.
*
* When the 'xdg_toplevel_icon_manager_v1' object is created, the
* compositor may send one or more 'icon_size' events to describe
* the list of preferred icon sizes. If the compositor has no size
* preference, it may not send any 'icon_size' event, and it is up
* to the client to decide a suitable icon size.
*
* A sequence of 'icon_size' events must be finished with a 'done'
* event. If the compositor has no size preferences, it must still
* send the 'done' event, without any preceding 'icon_size' events.
* @param size the edge size of the square icon in surface-local coordinates, e.g. 64
*/
void (*icon_size)(void *data,
struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1,
int32_t size);
/**
* all information has been sent
*
* This event is sent after all 'icon_size' events have been
* sent.
*/
void (*done)(void *data,
struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1);
};
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
static inline int
xdg_toplevel_icon_manager_v1_add_listener(struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1,
const struct xdg_toplevel_icon_manager_v1_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) xdg_toplevel_icon_manager_v1,
(void (**)(void)) listener, data);
}
#define XDG_TOPLEVEL_ICON_MANAGER_V1_DESTROY 0
#define XDG_TOPLEVEL_ICON_MANAGER_V1_CREATE_ICON 1
#define XDG_TOPLEVEL_ICON_MANAGER_V1_SET_ICON 2
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_ICON_SIZE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_DONE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_CREATE_ICON_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_SET_ICON_SINCE_VERSION 1
/** @ingroup iface_xdg_toplevel_icon_manager_v1 */
static inline void
xdg_toplevel_icon_manager_v1_set_user_data(struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_toplevel_icon_manager_v1, user_data);
}
/** @ingroup iface_xdg_toplevel_icon_manager_v1 */
static inline void *
xdg_toplevel_icon_manager_v1_get_user_data(struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_toplevel_icon_manager_v1);
}
static inline uint32_t
xdg_toplevel_icon_manager_v1_get_version(struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1)
{
return wl_proxy_get_version((struct wl_proxy *) xdg_toplevel_icon_manager_v1);
}
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*
* Destroy the toplevel icon manager.
* This does not destroy objects created with the manager.
*/
static inline void
xdg_toplevel_icon_manager_v1_destroy(struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel_icon_manager_v1,
XDG_TOPLEVEL_ICON_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel_icon_manager_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*
* Creates a new icon object. This icon can then be attached to a
* xdg_toplevel via the 'set_icon' request.
*/
static inline struct xdg_toplevel_icon_v1 *
xdg_toplevel_icon_manager_v1_create_icon(struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel_icon_manager_v1,
XDG_TOPLEVEL_ICON_MANAGER_V1_CREATE_ICON, &xdg_toplevel_icon_v1_interface, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel_icon_manager_v1), 0, NULL);
return (struct xdg_toplevel_icon_v1 *) id;
}
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*
* This request assigns the icon 'icon' to 'toplevel', or clears the
* toplevel icon if 'icon' was null.
* This state is double-buffered and is applied on the next
* wl_surface.commit of the toplevel.
*
* After making this call, the xdg_toplevel_icon_v1 provided as 'icon'
* can be destroyed by the client without 'toplevel' losing its icon.
* The xdg_toplevel_icon_v1 is immutable from this point, and any
* future attempts to change it must raise the
* 'xdg_toplevel_icon_v1.immutable' protocol error.
*
* The compositor must set the toplevel icon from either the pixel data
* the icon provides, or by loading a stock icon using the icon name.
* See the description of 'xdg_toplevel_icon_v1' for details.
*
* If 'icon' is set to null, the icon of the respective toplevel is reset
* to its default icon (usually the icon of the application, derived from
* its desktop-entry file, or a placeholder icon).
* If this request is passed an icon with no pixel buffers or icon name
* assigned, the icon must be reset just like if 'icon' was null.
*/
static inline void
xdg_toplevel_icon_manager_v1_set_icon(struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1, struct xdg_toplevel *toplevel, struct xdg_toplevel_icon_v1 *icon)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel_icon_manager_v1,
XDG_TOPLEVEL_ICON_MANAGER_V1_SET_ICON, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel_icon_manager_v1), 0, toplevel, icon);
}
#ifndef XDG_TOPLEVEL_ICON_V1_ERROR_ENUM
#define XDG_TOPLEVEL_ICON_V1_ERROR_ENUM
enum xdg_toplevel_icon_v1_error {
/**
* the provided buffer does not satisfy requirements
*/
XDG_TOPLEVEL_ICON_V1_ERROR_INVALID_BUFFER = 1,
/**
* the icon has already been assigned to a toplevel and must not be changed
*/
XDG_TOPLEVEL_ICON_V1_ERROR_IMMUTABLE = 2,
/**
* the provided buffer has been destroyed before the toplevel icon
*/
XDG_TOPLEVEL_ICON_V1_ERROR_NO_BUFFER = 3,
};
#endif /* XDG_TOPLEVEL_ICON_V1_ERROR_ENUM */
#define XDG_TOPLEVEL_ICON_V1_DESTROY 0
#define XDG_TOPLEVEL_ICON_V1_SET_NAME 1
#define XDG_TOPLEVEL_ICON_V1_ADD_BUFFER 2
/**
* @ingroup iface_xdg_toplevel_icon_v1
*/
#define XDG_TOPLEVEL_ICON_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_v1
*/
#define XDG_TOPLEVEL_ICON_V1_SET_NAME_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_v1
*/
#define XDG_TOPLEVEL_ICON_V1_ADD_BUFFER_SINCE_VERSION 1
/** @ingroup iface_xdg_toplevel_icon_v1 */
static inline void
xdg_toplevel_icon_v1_set_user_data(struct xdg_toplevel_icon_v1 *xdg_toplevel_icon_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_toplevel_icon_v1, user_data);
}
/** @ingroup iface_xdg_toplevel_icon_v1 */
static inline void *
xdg_toplevel_icon_v1_get_user_data(struct xdg_toplevel_icon_v1 *xdg_toplevel_icon_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_toplevel_icon_v1);
}
static inline uint32_t
xdg_toplevel_icon_v1_get_version(struct xdg_toplevel_icon_v1 *xdg_toplevel_icon_v1)
{
return wl_proxy_get_version((struct wl_proxy *) xdg_toplevel_icon_v1);
}
/**
* @ingroup iface_xdg_toplevel_icon_v1
*
* Destroys the 'xdg_toplevel_icon_v1' object.
* The icon must still remain set on every toplevel it was assigned to,
* until the toplevel icon is reset explicitly.
*/
static inline void
xdg_toplevel_icon_v1_destroy(struct xdg_toplevel_icon_v1 *xdg_toplevel_icon_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel_icon_v1,
XDG_TOPLEVEL_ICON_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel_icon_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_xdg_toplevel_icon_v1
*
* This request assigns an icon name to this icon.
* Any previously set name is overridden.
*
* The compositor must resolve 'icon_name' according to the lookup rules
* described in the XDG icon theme specification[1] using the
* environment's current icon theme.
*
* If the compositor does not support icon names or cannot resolve
* 'icon_name' according to the XDG icon theme specification it must
* fall back to using pixel buffer data instead.
*
* If this request is made after the icon has been assigned to a toplevel
* via 'set_icon', a 'immutable' error must be raised.
*
* [1]: https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
*/
static inline void
xdg_toplevel_icon_v1_set_name(struct xdg_toplevel_icon_v1 *xdg_toplevel_icon_v1, const char *icon_name)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel_icon_v1,
XDG_TOPLEVEL_ICON_V1_SET_NAME, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel_icon_v1), 0, icon_name);
}
/**
* @ingroup iface_xdg_toplevel_icon_v1
*
* This request adds pixel data supplied as wl_buffer to the icon.
*
* The client should add pixel data for all icon sizes and scales that
* it can provide, or which are explicitly requested by the compositor
* via 'icon_size' events on xdg_toplevel_icon_manager_v1.
*
* The wl_buffer supplying pixel data as 'buffer' must be backed by wl_shm
* and must be a square (width and height being equal).
* If any of these buffer requirements are not fulfilled, a 'invalid_buffer'
* error must be raised.
*
* If this icon instance already has a buffer of the same size and scale
* from a previous 'add_buffer' request, data from the last request
* overrides the preexisting pixel data.
*
* The wl_buffer must be kept alive for as long as the xdg_toplevel_icon
* it is associated with is not destroyed, otherwise a 'no_buffer' error
* is raised. The buffer contents must not be modified after it was
* assigned to the icon. As a result, the region of the wl_shm_pool's
* backing storage used for the wl_buffer must not be modified after this
* request is sent. The wl_buffer.release event is unused.
*
* If this request is made after the icon has been assigned to a toplevel
* via 'set_icon', a 'immutable' error must be raised.
*/
static inline void
xdg_toplevel_icon_v1_add_buffer(struct xdg_toplevel_icon_v1 *xdg_toplevel_icon_v1, struct wl_buffer *buffer, int32_t scale)
{
wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel_icon_v1,
XDG_TOPLEVEL_ICON_V1_ADD_BUFFER, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel_icon_v1), 0, buffer, scale);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="cursor_shape_v1">
<copyright>
Copyright 2018 The Chromium Authors
Copyright 2023 Simon Ser
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.
</copyright>
<interface name="wp_cursor_shape_manager_v1" version="2">
<description summary="cursor shape manager">
This global offers an alternative, optional way to set cursor images. This
new way uses enumerated cursors instead of a wl_surface like
wl_pointer.set_cursor does.
Warning! The protocol described in this file is currently in the testing
phase. Backward compatible changes may be added together with the
corresponding interface version bump. Backward incompatible changes can
only be done by creating a new major version of the extension.
</description>
<request name="destroy" type="destructor">
<description summary="destroy the manager">
Destroy the cursor shape manager.
</description>
</request>
<request name="get_pointer">
<description summary="manage the cursor shape of a pointer device">
Obtain a wp_cursor_shape_device_v1 for a wl_pointer object.
When the pointer capability is removed from the wl_seat, the
wp_cursor_shape_device_v1 object becomes inert.
</description>
<arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/>
<arg name="pointer" type="object" interface="wl_pointer"/>
</request>
<request name="get_tablet_tool_v2">
<description summary="manage the cursor shape of a tablet tool device">
Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object.
When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1
object becomes inert.
</description>
<arg name="cursor_shape_device" type="new_id" interface="wp_cursor_shape_device_v1"/>
<arg name="tablet_tool" type="object" interface="zwp_tablet_tool_v2"/>
</request>
</interface>
<interface name="wp_cursor_shape_device_v1" version="2">
<description summary="cursor shape for a device">
This interface allows clients to set the cursor shape.
</description>
<enum name="shape">
<description summary="cursor shapes">
This enum describes cursor shapes.
The names are taken from the CSS W3C specification:
https://w3c.github.io/csswg-drafts/css-ui/#cursor
with a few additions.
Note that there are some groups of cursor shapes that are related:
The first group is drag-and-drop cursors which are used to indicate
the selected action during dnd operations. The second group is resize
cursors which are used to indicate resizing and moving possibilities
on window borders. It is recommended that the shapes in these groups
should use visually compatible images and metaphors.
</description>
<entry name="default" value="1" summary="default cursor"/>
<entry name="context_menu" value="2" summary="a context menu is available for the object under the cursor"/>
<entry name="help" value="3" summary="help is available for the object under the cursor"/>
<entry name="pointer" value="4" summary="pointer that indicates a link or another interactive element"/>
<entry name="progress" value="5" summary="progress indicator"/>
<entry name="wait" value="6" summary="program is busy, user should wait"/>
<entry name="cell" value="7" summary="a cell or set of cells may be selected"/>
<entry name="crosshair" value="8" summary="simple crosshair"/>
<entry name="text" value="9" summary="text may be selected"/>
<entry name="vertical_text" value="10" summary="vertical text may be selected"/>
<entry name="alias" value="11" summary="drag-and-drop: alias of/shortcut to something is to be created"/>
<entry name="copy" value="12" summary="drag-and-drop: something is to be copied"/>
<entry name="move" value="13" summary="drag-and-drop: something is to be moved"/>
<entry name="no_drop" value="14" summary="drag-and-drop: the dragged item cannot be dropped at the current cursor location"/>
<entry name="not_allowed" value="15" summary="drag-and-drop: the requested action will not be carried out"/>
<entry name="grab" value="16" summary="drag-and-drop: something can be grabbed"/>
<entry name="grabbing" value="17" summary="drag-and-drop: something is being grabbed"/>
<entry name="e_resize" value="18" summary="resizing: the east border is to be moved"/>
<entry name="n_resize" value="19" summary="resizing: the north border is to be moved"/>
<entry name="ne_resize" value="20" summary="resizing: the north-east corner is to be moved"/>
<entry name="nw_resize" value="21" summary="resizing: the north-west corner is to be moved"/>
<entry name="s_resize" value="22" summary="resizing: the south border is to be moved"/>
<entry name="se_resize" value="23" summary="resizing: the south-east corner is to be moved"/>
<entry name="sw_resize" value="24" summary="resizing: the south-west corner is to be moved"/>
<entry name="w_resize" value="25" summary="resizing: the west border is to be moved"/>
<entry name="ew_resize" value="26" summary="resizing: the east and west borders are to be moved"/>
<entry name="ns_resize" value="27" summary="resizing: the north and south borders are to be moved"/>
<entry name="nesw_resize" value="28" summary="resizing: the north-east and south-west corners are to be moved"/>
<entry name="nwse_resize" value="29" summary="resizing: the north-west and south-east corners are to be moved"/>
<entry name="col_resize" value="30" summary="resizing: that the item/column can be resized horizontally"/>
<entry name="row_resize" value="31" summary="resizing: that the item/row can be resized vertically"/>
<entry name="all_scroll" value="32" summary="something can be scrolled in any direction"/>
<entry name="zoom_in" value="33" summary="something can be zoomed in"/>
<entry name="zoom_out" value="34" summary="something can be zoomed out"/>
<entry name="dnd_ask" value="35" summary="drag-and-drop: the user will select which action will be carried out (non-css value)" since="2"/>
<entry name="all_resize" value="36" summary="resizing: something can be moved or resized in any direction (non-css value)" since="2"/>
</enum>
<enum name="error">
<entry name="invalid_shape" value="1"
summary="the specified shape value is invalid"/>
</enum>
<request name="destroy" type="destructor">
<description summary="destroy the cursor shape device">
Destroy the cursor shape device.
The device cursor shape remains unchanged.
</description>
</request>
<request name="set_shape">
<description summary="set device cursor to the shape">
Sets the device cursor to the specified shape. The compositor will
change the cursor image based on the specified shape.
The cursor actually changes only if the input device focus is one of
the requesting client's surfaces. If any, the previous cursor image
(surface or shape) is replaced.
The "shape" argument must be a valid enum entry, otherwise the
invalid_shape protocol error is raised.
This is similar to the wl_pointer.set_cursor and
zwp_tablet_tool_v2.set_cursor requests, but this request accepts a
shape instead of contents in the form of a surface. Clients can mix
set_cursor and set_shape requests.
The serial parameter must match the latest wl_pointer.enter or
zwp_tablet_tool_v2.proximity_in serial number sent to the client.
Otherwise the request will be ignored.
</description>
<arg name="serial" type="uint" summary="serial number of the enter event"/>
<arg name="shape" type="uint" enum="shape"/>
</request>
</interface>
</protocol>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,456 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="text_input_unstable_v3">
<copyright>
Copyright © 2012, 2013 Intel Corporation
Copyright © 2015, 2016 Jan Arne Petersen
Copyright © 2017, 2018 Red Hat, Inc.
Copyright © 2018 Purism SPC
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.
</copyright>
<description summary="Protocol for composing text">
This protocol allows compositors to act as input methods and to send text
to applications. A text input object is used to manage state of what are
typically text entry fields in the application.
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.
</description>
<interface name="zwp_text_input_v3" version="1">
<description summary="text input">
The zwp_text_input_v3 interface represents text input and input methods
associated with a seat. It provides enter/leave events to follow the
text input focus for a seat.
Requests are used to enable/disable the text-input object and set
state information like surrounding and selected text or the content type.
The information about the entered text is sent to the text-input object
via the preedit_string and commit_string events.
Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
must not point to middle bytes inside a code point: they must either
point to the first byte of a code point or to the end of the buffer.
Lengths must be measured between two valid indices.
Focus moving throughout surfaces will result in the emission of
zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused
surface must commit zwp_text_input_v3.enable and
zwp_text_input_v3.disable requests as the keyboard focus moves across
editable and non-editable elements of the UI. Those two requests are not
expected to be paired with each other, the compositor must be able to
handle consecutive series of the same request.
State is sent by the state requests (set_surrounding_text,
set_content_type and set_cursor_rectangle) and a commit request. After an
enter event or disable request all state information is invalidated and
needs to be resent by the client.
</description>
<request name="destroy" type="destructor">
<description summary="Destroy the wp_text_input">
Destroy the wp_text_input object. Also disables all surfaces enabled
through this wp_text_input object.
</description>
</request>
<request name="enable">
<description summary="Request text input to be enabled">
Requests text input on the surface previously obtained from the enter
event.
This request must be issued every time the focused text input changes
to a new one, including within the current surface. Use
zwp_text_input_v3.disable when there is no longer any input focus on
the current surface.
Clients must not enable more than one text input on the single seat
and should disable the current text input before enabling the new one.
Requests to enable a text input when another text input is enabled
on the same seat must be ignored by compositor.
This request resets all state associated with previous enable, disable,
set_surrounding_text, set_text_change_cause, set_content_type, and
set_cursor_rectangle requests, as well as the state associated with
preedit_string, commit_string, and delete_surrounding_text events.
The set_surrounding_text, set_content_type and set_cursor_rectangle
requests must follow if the text input supports the necessary
functionality.
State set with this request is double-buffered. It will get applied on
the next zwp_text_input_v3.commit request, and stay valid until the
next committed enable or disable request.
The changes must be applied by the compositor after issuing a
zwp_text_input_v3.commit request.
</description>
</request>
<request name="disable">
<description summary="Disable text input on a surface">
Explicitly disable text input on the current surface (typically when
there is no focus on any text entry inside the surface).
State set with this request is double-buffered. It will get applied on
the next zwp_text_input_v3.commit request.
</description>
</request>
<request name="set_surrounding_text">
<description summary="sets the surrounding text">
Sets the surrounding plain text around the input, excluding the preedit
text.
The client should notify the compositor of any changes in any of the
values carried with this request, including changes caused by handling
incoming text-input events as well as changes caused by other
mechanisms like keyboard typing.
If the client is unaware of the text around the cursor, it should not
issue this request, to signify lack of support to the compositor.
Text is UTF-8 encoded, and should include the cursor position, the
complete selection and additional characters before and after them.
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 text buffer.
Anchor is the byte offset of the selection anchor within text buffer.
If there is no selected text, anchor is the same as cursor.
If any preedit text is present, it is replaced with a cursor for the
purpose of this event.
Values set with this request are double-buffered. They will get applied
on the next zwp_text_input_v3.commit request, and stay valid until the
next committed enable or disable request.
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.
</description>
<arg name="text" type="string"/>
<arg name="cursor" type="int"/>
<arg name="anchor" type="int"/>
</request>
<enum name="change_cause">
<description summary="text change reason">
Reason for the change of surrounding text or cursor posision.
</description>
<entry name="input_method" value="0" summary="input method caused the change"/>
<entry name="other" value="1" summary="something else than the input method caused the change"/>
</enum>
<request name="set_text_change_cause">
<description summary="indicates the cause of surrounding text change">
Tells the compositor why the text surrounding the cursor changed.
Whenever the client detects an external change in text, cursor, or
anchor posision, 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 request is double-buffered. It must be applied
and reset to initial at the next zwp_text_input_v3.commit request.
The initial value of cause is input_method.
</description>
<arg name="cause" type="uint" enum="change_cause"/>
</request>
<enum name="content_hint" bitfield="true">
<description summary="content hint">
Content hint is a bitmask to allow to modify the behavior of the text
input.
</description>
<entry name="none" value="0x0" summary="no special behavior"/>
<entry name="completion" value="0x1" summary="suggest word completions"/>
<entry name="spellcheck" value="0x2" summary="suggest word corrections"/>
<entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
<entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
<entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
<entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
<entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
<entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
<entry name="latin" value="0x100" summary="just Latin characters should be entered"/>
<entry name="multiline" value="0x200" summary="the text input is multiline"/>
</enum>
<enum name="content_purpose">
<description summary="content purpose">
The content purpose allows to specify the primary purpose of a text
input.
This allows an input method to show special purpose input panels with
extra characters or to disallow some characters.
</description>
<entry name="normal" value="0" summary="default input, allowing all characters"/>
<entry name="alpha" value="1" summary="allow only alphabetic characters"/>
<entry name="digits" value="2" summary="allow only digits"/>
<entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
<entry name="phone" value="4" summary="input a phone number"/>
<entry name="url" value="5" summary="input an URL"/>
<entry name="email" value="6" summary="input an email address"/>
<entry name="name" value="7" summary="input a name of a person"/>
<entry name="password" value="8" summary="input a password (combine with sensitive_data hint)"/>
<entry name="pin" value="9" summary="input is a numeric password (combine with sensitive_data hint)"/>
<entry name="date" value="10" summary="input a date"/>
<entry name="time" value="11" summary="input a time"/>
<entry name="datetime" value="12" summary="input a date and time"/>
<entry name="terminal" value="13" summary="input for a terminal"/>
</enum>
<request name="set_content_type">
<description summary="set content purpose and hint">
Sets the content purpose and content hint. While the purpose is the
basic purpose of an input field, the hint flags allow to modify some of
the behavior.
Values set with this request are double-buffered. They will get applied
on the next zwp_text_input_v3.commit request.
Subsequent attempts to update them may have no effect. The values
remain valid until the next committed enable or disable request.
The initial value for hint is none, and the initial value for purpose
is normal.
</description>
<arg name="hint" type="uint" enum="content_hint"/>
<arg name="purpose" type="uint" enum="content_purpose"/>
</request>
<request name="set_cursor_rectangle">
<description summary="set cursor position">
Marks an area around the cursor as a x, y, width, height rectangle in
surface local coordinates.
Allows the compositor to put a window with word suggestions near the
cursor, without obstructing the text being input.
If the client is unaware of the position of edited text, it should not
issue this request, to signify lack of support to the compositor.
Values set with this request are double-buffered. They will get applied
on the next zwp_text_input_v3.commit request, and stay valid until the
next committed enable or disable request.
The initial values describing a cursor rectangle are empty. That means
the text input does not support describing the cursor area. If the
empty values get applied, subsequent attempts to change them may have
no effect.
</description>
<arg name="x" type="int"/>
<arg name="y" type="int"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
</request>
<request name="commit">
<description summary="commit state">
Atomically applies state changes recently sent to the compositor.
The commit request establishes and updates the state of the client, and
must be issued after any changes to apply them.
Text input state (enabled status, content purpose, content hint,
surrounding text and change cause, cursor rectangle) is conceptually
double-buffered within the context of a text input, i.e. between a
committed enable request and the following committed enable or disable
request.
Protocol requests modify the pending state, as opposed to the current
state in use by the input method. A commit request atomically applies
all pending state, replacing the current state. After commit, the new
pending state is as documented for each related request.
Requests are applied in the order of arrival.
Neither current nor pending state are modified unless noted otherwise.
The compositor must count the number of commit requests coming from
each zwp_text_input_v3 object and use the count as the serial in done
events.
</description>
</request>
<event name="enter">
<description summary="enter event">
Notification that this seat's text-input focus is on a certain surface.
If client has created multiple text input objects, compositor must send
this event to all of them.
When the seat has the keyboard capability the text-input focus follows
the keyboard focus. This event sets the current surface for the
text-input object.
</description>
<arg name="surface" type="object" interface="wl_surface"/>
</event>
<event name="leave">
<description summary="leave event">
Notification that this seat's text-input focus is no longer on a
certain surface. The client should reset any preedit string previously
set.
The leave notification clears the current surface. It is sent before
the enter notification for the new focus. After leave event, compositor
must ignore requests from any text input instances until next enter
event.
When the seat has the keyboard capability the text-input focus follows
the keyboard focus.
</description>
<arg name="surface" type="object" interface="wl_surface"/>
</event>
<event name="preedit_string">
<description summary="pre-edit">
Notify when a new composing text (pre-edit) should be set at the
current cursor position. Any previously set composing text must be
removed. Any previously existing selected text must be removed.
The argument text contains the pre-edit string buffer.
The parameters cursor_begin and cursor_end are counted in bytes
relative to the beginning of the submitted text buffer. Cursor should
be hidden when both are equal to -1.
They could be represented by the client as a line if both values are
the same, or as a text highlight otherwise.
Values set with this event are double-buffered. They must be applied
and reset to initial on the next zwp_text_input_v3.done event.
The initial value of text is an empty string, and cursor_begin,
cursor_end and cursor_hidden are all 0.
</description>
<arg name="text" type="string" allow-null="true"/>
<arg name="cursor_begin" type="int"/>
<arg name="cursor_end" type="int"/>
</event>
<event name="commit_string">
<description summary="text commit">
Notify when text should be inserted into the editor widget. The text to
commit could be either just a single character after a key press or the
result of some composing (pre-edit).
Values set with this event are double-buffered. They must be applied
and reset to initial on the next zwp_text_input_v3.done event.
The initial value of text is an empty string.
</description>
<arg name="text" type="string" allow-null="true"/>
</event>
<event name="delete_surrounding_text">
<description summary="delete surrounding text">
Notify when the text around the current cursor position should be
deleted.
Before_length and after_length are the number of bytes before and after
the current cursor index (excluding the selection) to delete.
If a preedit text is present, in effect before_length is counted from
the beginning of it, and after_length from its end (see done event
sequence).
Values set with this event are double-buffered. They must be applied
and reset to initial on the next zwp_text_input_v3.done event.
The initial values of both before_length and after_length are 0.
</description>
<arg name="before_length" type="uint" summary="length of text before current cursor position"/>
<arg name="after_length" type="uint" summary="length of text after current cursor position"/>
</event>
<event name="done">
<description summary="apply changes">
Instruct the application to apply changes to state requested by the
preedit_string, commit_string and delete_surrounding_text events. The
state relating to these events is double-buffered, and each one
modifies the pending state. This event replaces the current state with
the pending state.
The application must 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_text_input_v3
object known to the compositor. The value of the serial argument must
be equal to the number of commit requests already issued on that object.
When the client receives a done event with a serial different than the
number of past commit requests, it must proceed with evaluating and
applying the changes as normal, except it should not change the current
state of the zwp_text_input_v3 object. All pending state requests
(set_surrounding_text, set_content_type and set_cursor_rectangle) on
the zwp_text_input_v3 object should be sent and committed after
receiving a zwp_text_input_v3.done event with a matching serial.
</description>
<arg name="serial" type="uint"/>
</event>
</interface>
<interface name="zwp_text_input_manager_v3" version="1">
<description summary="text input manager">
A factory for text-input objects. This object is a global singleton.
</description>
<request name="destroy" type="destructor">
<description summary="Destroy the wp_text_input_manager">
Destroy the wp_text_input_manager object.
</description>
</request>
<request name="get_text_input">
<description summary="create a new text input object">
Creates a new text-input object for a given seat.
</description>
<arg name="id" type="new_id" interface="zwp_text_input_v3"/>
<arg name="seat" type="object" interface="wl_seat"/>
</request>
</interface>
</protocol>

View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="xdg_activation_v1">
<copyright>
Copyright © 2020 Aleix Pol Gonzalez &lt;aleixpol@kde.org&gt;
Copyright © 2020 Carlos Garnacho &lt;carlosg@gnome.org&gt;
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.
</copyright>
<description summary="Protocol for requesting activation of surfaces">
The way for a client to pass focus to another toplevel is as follows.
The client that intends to activate another toplevel uses the
xdg_activation_v1.get_activation_token request to get an activation token.
This token is then forwarded to the client, which is supposed to activate
one of its surfaces, through a separate band of communication.
One established way of doing this is through the XDG_ACTIVATION_TOKEN
environment variable of a newly launched child process. The child process
should unset the environment variable again right after reading it out in
order to avoid propagating it to other child processes.
Another established way exists for Applications implementing the D-Bus
interface org.freedesktop.Application, which should get their token under
activation-token on their platform_data.
In general activation tokens may be transferred across clients through
means not described in this protocol.
The client to be activated will then pass the token
it received to the xdg_activation_v1.activate request. The compositor can
then use this token to decide how to react to the activation request.
The token the activating client gets may be ineffective either already at
the time it receives it, for example if it was not focused, for focus
stealing prevention. The activating client will have no way to discover
the validity of the token, and may still forward it to the to be activated
client.
The created activation token may optionally get information attached to it
that can be used by the compositor to identify the application that we
intend to activate. This can for example be used to display a visual hint
about what application is being started.
Warning! The protocol described in this file is currently in the testing
phase. Backward compatible changes may be added together with the
corresponding interface version bump. Backward incompatible changes can
only be done by creating a new major version of the extension.
</description>
<interface name="xdg_activation_v1" version="1">
<description summary="interface for activating surfaces">
A global interface used for informing the compositor about applications
being activated or started, or for applications to request to be
activated.
</description>
<request name="destroy" type="destructor">
<description summary="destroy the xdg_activation object">
Notify the compositor that the xdg_activation object will no longer be
used.
The child objects created via this interface are unaffected and should
be destroyed separately.
</description>
</request>
<request name="get_activation_token">
<description summary="requests a token">
Creates an xdg_activation_token_v1 object that will provide
the initiating client with a unique token for this activation. This
token should be offered to the clients to be activated.
</description>
<arg name="id" type="new_id" interface="xdg_activation_token_v1"/>
</request>
<request name="activate">
<description summary="notify new interaction being available">
Requests surface activation. It's up to the compositor to display
this information as desired, for example by placing the surface above
the rest.
The compositor may know who requested this by checking the activation
token and might decide not to follow through with the activation if it's
considered unwanted.
Compositors can ignore unknown activation tokens when an invalid
token is passed.
</description>
<arg name="token" type="string" summary="the activation token of the initiating client"/>
<arg name="surface" type="object" interface="wl_surface"
summary="the wl_surface to activate"/>
</request>
</interface>
<interface name="xdg_activation_token_v1" version="1">
<description summary="an exported activation handle">
An object for setting up a token and receiving a token handle that can
be passed as an activation token to another client.
The object is created using the xdg_activation_v1.get_activation_token
request. This object should then be populated with the app_id, surface
and serial information and committed. The compositor shall then issue a
done event with the token. In case the request's parameters are invalid,
the compositor will provide an invalid token.
</description>
<enum name="error">
<entry name="already_used" value="0"
summary="The token has already been used previously"/>
</enum>
<request name="set_serial">
<description summary="specifies the seat and serial of the activating event">
Provides information about the seat and serial event that requested the
token.
The serial can come from an input or focus event. For instance, if a
click triggers the launch of a third-party client, the launcher client
should send a set_serial request with the serial and seat from the
wl_pointer.button event.
Some compositors might refuse to activate toplevels when the token
doesn't have a valid and recent enough event serial.
Must be sent before commit. This information is optional.
</description>
<arg name="serial" type="uint"
summary="the serial of the event that triggered the activation"/>
<arg name="seat" type="object" interface="wl_seat"
summary="the wl_seat of the event"/>
</request>
<request name="set_app_id">
<description summary="specifies the application being activated">
The requesting client can specify an app_id to associate the token
being created with it.
Must be sent before commit. This information is optional.
</description>
<arg name="app_id" type="string"
summary="the application id of the client being activated."/>
</request>
<request name="set_surface">
<description summary="specifies the surface requesting activation">
This request sets the surface requesting the activation. Note, this is
different from the surface that will be activated.
Some compositors might refuse to activate toplevels when the token
doesn't have a requesting surface.
Must be sent before commit. This information is optional.
</description>
<arg name="surface" type="object" interface="wl_surface"
summary="the requesting surface"/>
</request>
<request name="commit">
<description summary="issues the token request">
Requests an activation token based on the different parameters that
have been offered through set_serial, set_surface and set_app_id.
</description>
</request>
<event name="done">
<description summary="the exported activation token">
The 'done' event contains the unique token of this activation request
and notifies that the provider is done.
</description>
<arg name="token" type="string" summary="the exported activation token"/>
</event>
<request name="destroy" type="destructor">
<description summary="destroy the xdg_activation_token_v1 object">
Notify the compositor that the xdg_activation_token_v1 object will no
longer be used. The received token stays valid.
</description>
</request>
</interface>
</protocol>

View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="xdg_foreign_unstable_v2">
<copyright>
Copyright © 2015-2016 Red Hat Inc.
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.
</copyright>
<description summary="Protocol for exporting xdg surface handles">
This protocol specifies a way for making it possible to reference a surface
of a different client. With such a reference, a client can, by using the
interfaces provided by this protocol, manipulate the relationship between
its own surfaces and the surface of some other client. For example, stack
some of its own surface above the other clients surface.
In order for a client A to get a reference of a surface of client B, client
B must first export its surface using xdg_exporter.export_toplevel. Upon
doing this, client B will receive a handle (a unique string) that it may
share with client A in some way (for example D-Bus). After client A has
received the handle from client B, it may use xdg_importer.import_toplevel
to create a reference to the surface client B just exported. See the
corresponding requests for details.
A possible use case for this is out-of-process dialogs. For example when a
sandboxed client without file system access needs the user to select a file
on the file system, given sandbox environment support, it can export its
surface, passing the exported surface handle to an unsandboxed process that
can show a file browser dialog and stack it above the sandboxed client's
surface.
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.
</description>
<interface name="zxdg_exporter_v2" version="1">
<description summary="interface for exporting surfaces">
A global interface used for exporting surfaces that can later be imported
using xdg_importer.
</description>
<request name="destroy" type="destructor">
<description summary="destroy the xdg_exporter object">
Notify the compositor that the xdg_exporter object will no longer be
used.
</description>
</request>
<enum name="error">
<description summary="error values">
These errors can be emitted in response to invalid xdg_exporter
requests.
</description>
<entry name="invalid_surface" value="0" summary="surface is not an xdg_toplevel"/>
</enum>
<request name="export_toplevel">
<description summary="export a toplevel surface">
The export_toplevel request exports the passed surface so that it can later be
imported via xdg_importer. When called, a new xdg_exported object will
be created and xdg_exported.handle will be sent immediately. See the
corresponding interface and event for details.
A surface may be exported multiple times, and each exported handle may
be used to create an xdg_imported multiple times. Only xdg_toplevel
equivalent surfaces may be exported, otherwise an invalid_surface
protocol error is sent.
</description>
<arg name="id" type="new_id" interface="zxdg_exported_v2"
summary="the new xdg_exported object"/>
<arg name="surface" type="object" interface="wl_surface"
summary="the surface to export"/>
</request>
</interface>
<interface name="zxdg_importer_v2" version="1">
<description summary="interface for importing surfaces">
A global interface used for importing surfaces exported by xdg_exporter.
With this interface, a client can create a reference to a surface of
another client.
</description>
<request name="destroy" type="destructor">
<description summary="destroy the xdg_importer object">
Notify the compositor that the xdg_importer object will no longer be
used.
</description>
</request>
<request name="import_toplevel">
<description summary="import a toplevel surface">
The import_toplevel request imports a surface from any client given a handle
retrieved by exporting said surface using xdg_exporter.export_toplevel.
When called, a new xdg_imported object will be created. This new object
represents the imported surface, and the importing client can
manipulate its relationship using it. See xdg_imported for details.
</description>
<arg name="id" type="new_id" interface="zxdg_imported_v2"
summary="the new xdg_imported object"/>
<arg name="handle" type="string"
summary="the exported surface handle"/>
</request>
</interface>
<interface name="zxdg_exported_v2" version="1">
<description summary="an exported surface handle">
An xdg_exported object represents an exported reference to a surface. The
exported surface may be referenced as long as the xdg_exported object not
destroyed. Destroying the xdg_exported invalidates any relationship the
importer may have established using xdg_imported.
</description>
<request name="destroy" type="destructor">
<description summary="unexport the exported surface">
Revoke the previously exported surface. This invalidates any
relationship the importer may have set up using the xdg_imported created
given the handle sent via xdg_exported.handle.
</description>
</request>
<event name="handle">
<description summary="the exported surface handle">
The handle event contains the unique handle of this exported surface
reference. It may be shared with any client, which then can use it to
import the surface by calling xdg_importer.import_toplevel. A handle
may be used to import the surface multiple times.
</description>
<arg name="handle" type="string" summary="the exported surface handle"/>
</event>
</interface>
<interface name="zxdg_imported_v2" version="1">
<description summary="an imported surface handle">
An xdg_imported object represents an imported reference to surface exported
by some client. A client can use this interface to manipulate
relationships between its own surfaces and the imported surface.
</description>
<enum name="error">
<description summary="error values">
These errors can be emitted in response to invalid xdg_imported
requests.
</description>
<entry name="invalid_surface" value="0" summary="surface is not an xdg_toplevel"/>
</enum>
<request name="destroy" type="destructor">
<description summary="destroy the xdg_imported object">
Notify the compositor that it will no longer use the xdg_imported
object. Any relationship that may have been set up will at this point
be invalidated.
</description>
</request>
<request name="set_parent_of">
<description summary="set as the parent of some surface">
Set the imported surface as the parent of some surface of the client.
The passed surface must be an xdg_toplevel equivalent, otherwise an
invalid_surface protocol error is sent. Calling this function sets up
a surface to surface relation with the same stacking and positioning
semantics as xdg_toplevel.set_parent.
</description>
<arg name="surface" type="object" interface="wl_surface"
summary="the child surface"/>
</request>
<event name="destroyed">
<description summary="the imported surface handle has been destroyed">
The imported surface handle has been destroyed and any relationship set
up has been invalidated. This may happen for various reasons, for
example if the exported surface or the exported surface handle has been
destroyed, if the handle used for importing was invalid.
</description>
</event>
</interface>
</protocol>

View File

@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="xdg_toplevel_icon_v1">
<copyright>
Copyright © 2023-2024 Matthias Klumpp
Copyright © 2024 David Edmundson
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.
</copyright>
<description summary="protocol to assign icons to toplevels">
This protocol allows clients to set icons for their toplevel surfaces
either via the XDG icon stock (using an icon name), or from pixel data.
A toplevel icon represents the individual toplevel (unlike the application
or launcher icon, which represents the application as a whole), and may be
shown in window switchers, window overviews and taskbars that list
individual windows.
This document adheres to RFC 2119 when using words like "must",
"should", "may", etc.
Warning! The protocol described in this file is currently in the testing
phase. Backward compatible changes may be added together with the
corresponding interface version bump. Backward incompatible changes can
only be done by creating a new major version of the extension.
</description>
<interface name="xdg_toplevel_icon_manager_v1" version="1">
<description summary="interface to manage toplevel icons">
This interface allows clients to create toplevel window icons and set
them on toplevel windows to be displayed to the user.
</description>
<request name="destroy" type="destructor">
<description summary="destroy the toplevel icon manager">
Destroy the toplevel icon manager.
This does not destroy objects created with the manager.
</description>
</request>
<request name="create_icon">
<description summary="create a new icon instance">
Creates a new icon object. This icon can then be attached to a
xdg_toplevel via the 'set_icon' request.
</description>
<arg name="id" type="new_id" interface="xdg_toplevel_icon_v1"/>
</request>
<request name="set_icon">
<description summary="set an icon on a toplevel window">
This request assigns the icon 'icon' to 'toplevel', or clears the
toplevel icon if 'icon' was null.
This state is double-buffered and is applied on the next
wl_surface.commit of the toplevel.
After making this call, the xdg_toplevel_icon_v1 provided as 'icon'
can be destroyed by the client without 'toplevel' losing its icon.
The xdg_toplevel_icon_v1 is immutable from this point, and any
future attempts to change it must raise the
'xdg_toplevel_icon_v1.immutable' protocol error.
The compositor must set the toplevel icon from either the pixel data
the icon provides, or by loading a stock icon using the icon name.
See the description of 'xdg_toplevel_icon_v1' for details.
If 'icon' is set to null, the icon of the respective toplevel is reset
to its default icon (usually the icon of the application, derived from
its desktop-entry file, or a placeholder icon).
If this request is passed an icon with no pixel buffers or icon name
assigned, the icon must be reset just like if 'icon' was null.
</description>
<arg name="toplevel" type="object" interface="xdg_toplevel" summary="the toplevel to act on"/>
<arg name="icon" type="object" interface="xdg_toplevel_icon_v1" allow-null="true"/>
</request>
<event name="icon_size">
<description summary="describes a supported &amp; preferred icon size">
This event indicates an icon size the compositor prefers to be
available if the client has scalable icons and can render to any size.
When the 'xdg_toplevel_icon_manager_v1' object is created, the
compositor may send one or more 'icon_size' events to describe the list
of preferred icon sizes. If the compositor has no size preference, it
may not send any 'icon_size' event, and it is up to the client to
decide a suitable icon size.
A sequence of 'icon_size' events must be finished with a 'done' event.
If the compositor has no size preferences, it must still send the
'done' event, without any preceding 'icon_size' events.
</description>
<arg name="size" type="int"
summary="the edge size of the square icon in surface-local coordinates, e.g. 64"/>
</event>
<event name="done">
<description summary="all information has been sent">
This event is sent after all 'icon_size' events have been sent.
</description>
</event>
</interface>
<interface name="xdg_toplevel_icon_v1" version="1">
<description summary="a toplevel window icon">
This interface defines a toplevel icon.
An icon can have a name, and multiple buffers.
In order to be applied, the icon must have either a name, or at least
one buffer assigned. Applying an empty icon (with no buffer or name) to
a toplevel should reset its icon to the default icon.
It is up to compositor policy whether to prefer using a buffer or loading
an icon via its name. See 'set_name' and 'add_buffer' for details.
</description>
<enum name="error">
<entry name="invalid_buffer"
summary="the provided buffer does not satisfy requirements"
value="1"/>
<entry name="immutable"
summary="the icon has already been assigned to a toplevel and must not be changed"
value="2"/>
<entry name="no_buffer"
summary="the provided buffer has been destroyed before the toplevel icon"
value="3"/>
</enum>
<request name="destroy" type="destructor">
<description summary="destroy the icon object">
Destroys the 'xdg_toplevel_icon_v1' object.
The icon must still remain set on every toplevel it was assigned to,
until the toplevel icon is reset explicitly.
</description>
</request>
<request name="set_name">
<description summary="set an icon name">
This request assigns an icon name to this icon.
Any previously set name is overridden.
The compositor must resolve 'icon_name' according to the lookup rules
described in the XDG icon theme specification[1] using the
environment's current icon theme.
If the compositor does not support icon names or cannot resolve
'icon_name' according to the XDG icon theme specification it must
fall back to using pixel buffer data instead.
If this request is made after the icon has been assigned to a toplevel
via 'set_icon', a 'immutable' error must be raised.
[1]: https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
</description>
<arg name="icon_name" type="string"/>
</request>
<request name="add_buffer">
<description summary="add icon data from a pixel buffer">
This request adds pixel data supplied as wl_buffer to the icon.
The client should add pixel data for all icon sizes and scales that
it can provide, or which are explicitly requested by the compositor
via 'icon_size' events on xdg_toplevel_icon_manager_v1.
The wl_buffer supplying pixel data as 'buffer' must be backed by wl_shm
and must be a square (width and height being equal).
If any of these buffer requirements are not fulfilled, a 'invalid_buffer'
error must be raised.
If this icon instance already has a buffer of the same size and scale
from a previous 'add_buffer' request, data from the last request
overrides the preexisting pixel data.
The wl_buffer must be kept alive for as long as the xdg_toplevel_icon
it is associated with is not destroyed, otherwise a 'no_buffer' error
is raised. The buffer contents must not be modified after it was
assigned to the icon. As a result, the region of the wl_shm_pool's
backing storage used for the wl_buffer must not be modified after this
request is sent. The wl_buffer.release event is unused.
If this request is made after the icon has been assigned to a toplevel
via 'set_icon', a 'immutable' error must be raised.
</description>
<arg name="buffer" type="object" interface="wl_buffer"/>
<arg name="scale" type="int"
summary="the scaling factor of the icon, e.g. 1"/>
</request>
</interface>
</protocol>

View File

@ -30,6 +30,17 @@ def generate(root, version):
version_h = version_h.replace('@WAYLAND_VERSION_' + key + '@', value)
version_h = version_h.replace('@WAYLAND_VERSION@', version)
(output / 'wayland-version.h').write_text(version_h)
arch = (root / 'vendor/dbus/dbus/dbus-arch-deps.h.in').read_text()
replacements = {'DBUS_INT64_TYPE': 'long long', 'DBUS_INT64_MODIFIER': 'll',
'DBUS_INT64_CONSTANT': 'val##LL', 'DBUS_UINT64_CONSTANT': 'val##ULL',
'DBUS_INT32_TYPE': 'int', 'DBUS_INT16_TYPE': 'short',
'DBUS_SIZEOF_VOID_P': '__SIZEOF_POINTER__', 'DBUS_MAJOR_VERSION': '1',
'DBUS_MINOR_VERSION': '16', 'DBUS_MICRO_VERSION': '2', 'DBUS_VERSION': '1.16.2'}
for key, value in replacements.items():
arch = arch.replace('@' + key + '@', value)
assert '@' not in arch
(output / 'dbus').mkdir(exist_ok=True)
(output / 'dbus/dbus-arch-deps.h').write_text(arch)
symbols = ['/* Generated by tools/protocols.py; private protocol descriptors. */']
for xml in sorted((root / 'protocols/xml').glob('*.xml')):
for interface in ET.parse(xml).getroot().findall('interface'):
@ -64,7 +75,7 @@ def main():
if args.regenerate:
generate(ROOT, manifest['scanner'])
manifest['generated'] = {str(p.relative_to(ROOT)): digest(p.read_bytes())
for p in sorted((ROOT / 'protocols/generated').iterdir())}
for p in sorted((ROOT / 'protocols/generated').rglob('*')) if p.is_file()}
MANIFEST.write_text(json.dumps(manifest, indent=2) + '\n')
if args.verify_generation:
import shutil

View File

@ -7,14 +7,22 @@ per-file digests, and the scanner version.
- Wayland 1.24.0: client/utility/EGL ABI headers and core XML. MIT license in
`wayland/COPYING` and individual file notices.
- wayland-protocols 1.45: xdg-shell, xdg-decoration, viewporter, fractional-scale.
- wayland-protocols 1.45: xdg-shell, xdg-decoration, viewporter, fractional-scale,
cursor-shape, tablet descriptors, text-input-v3, xdg-foreign-v2, activation,
and toplevel icons.
License in `wayland-protocols/COPYING` and each XML's copyright element.
- Khronos EGL-Registry revision `5961a7fe64cf8a126890ced6f13d69e0a1e1b83e`:
EGL and platform ABI headers. Apache-2.0 text is in
`khronos/LICENSE-2.0.txt`; copyright/SPDX and full MIT notices remain in the headers.
- libxkbcommon 1.11.0: keyboard and compose ABI declarations; MIT notices in
`xkbcommon/LICENSE` and the headers.
- D-Bus 1.16.2: public ABI declarations; licenses in `dbus/COPYING`.
Upstream files are unmodified. `wayland-version.h` is produced by substituting
the release version into the upstream template. The scanner generates client
the release version into the upstream template. The D-Bus architecture header
is generated from its upstream template using fixed Linux integer widths and
the target compiler’s pointer size, rather than a build-machine configuration. The scanner generates client
headers and private descriptor C files. `private-symbols.h` gives the descriptors
UHDK-specific names at compilation, preventing collisions with other clients.

23
src/linux/vendor/dbus/COPYING vendored Normal file
View File

@ -0,0 +1,23 @@
dbus is licensed to you under your choice of the Academic Free
License version 2.1, or the GNU General Public License version 2
(or, at your option any later version).
The full text of these licenses can be found in LICENSES/AFL-2.1.txt
and LICENSES/GPL-2.0-or-later.txt.
Some source files are under more permissive BSD-/MIT-style licenses
that are compatible with the AFL and GPL.
When contributing new code, our preferred license for new code is the
version of the MIT/X11 license used by the Expat library, referred to
as "MIT" by SPDX, which can be found in LICENSES/MIT.txt.
Some of the standalone binaries are under the GPL only; in particular,
but not limited to, tools/dbus-cleanup-sockets.c and test/decode-gcov.c.
Each source code file is marked with the proper copyright information -
if you find a file that isn't marked please bring it to our attention.
Some files contain a SPDX-License-Identifier marker. These markers
indicate the license of that file, consistent with the SPDX and REUSE
specifications: see <https://reuse.software/>. dbus is not yet fully
REUSE-compliant, and not all files carry these markers.

View File

@ -0,0 +1,87 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-address.h Server address parser.
*
* Copyright (C) 2003 CodeFactory AB
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_ADDRESS_H
#define DBUS_ADDRESS_H
#include <dbus/dbus-types.h>
#include <dbus/dbus-errors.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusAddress
* @{
*/
/** Opaque type representing one of the semicolon-separated items in an address */
typedef struct DBusAddressEntry DBusAddressEntry;
DBUS_EXPORT
dbus_bool_t dbus_parse_address (const char *address,
DBusAddressEntry ***entry_result,
int *array_len,
DBusError *error);
DBUS_EXPORT
const char *dbus_address_entry_get_value (DBusAddressEntry *entry,
const char *key);
DBUS_EXPORT
const char *dbus_address_entry_get_method (DBusAddressEntry *entry);
DBUS_EXPORT
void dbus_address_entries_free (DBusAddressEntry **entries);
DBUS_EXPORT
char* dbus_address_escape_value (const char *value);
DBUS_EXPORT
char* dbus_address_unescape_value (const char *value,
DBusError *error);
/**
* Clear a variable or struct member that contains an array of #DBusAddressEntry.
* If it does not contain #NULL, the entries that were previously
* there are freed with dbus_address_entries_free().
*
* This is similar to dbus_clear_connection(): see that function
* for more details.
*
* @param pointer_to_entries A pointer to a variable or struct member.
* pointer_to_entries must not be #NULL, but *pointer_to_entries
* may be #NULL.
*/
static inline void
dbus_clear_address_entries (DBusAddressEntry ***pointer_to_entries)
{
_dbus_clear_pointer_impl (DBusAddressEntry *, pointer_to_entries,
dbus_address_entries_free);
}
/** @} */
DBUS_END_DECLS
#endif /* DBUS_ADDRESS_H */

View File

@ -0,0 +1,65 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
*
* Copyright (C) 2003 Red Hat, Inc.
* SPDX-License-Identifier: AFL-2.0 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.0
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_ARCH_DEPS_H
#define DBUS_ARCH_DEPS_H
#include <dbus/dbus-macros.h>
DBUS_BEGIN_DECLS
/* D-Bus no longer supports platforms with no 64-bit integer type. */
#define DBUS_HAVE_INT64 1
_DBUS_GNUC_EXTENSION typedef @DBUS_INT64_TYPE@ dbus_int64_t;
_DBUS_GNUC_EXTENSION typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t;
#define DBUS_INT64_MODIFIER "@DBUS_INT64_MODIFIER@"
#define DBUS_INT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION @DBUS_INT64_CONSTANT@)
#define DBUS_UINT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION @DBUS_UINT64_CONSTANT@)
typedef @DBUS_INT32_TYPE@ dbus_int32_t;
typedef unsigned @DBUS_INT32_TYPE@ dbus_uint32_t;
typedef @DBUS_INT16_TYPE@ dbus_int16_t;
typedef unsigned @DBUS_INT16_TYPE@ dbus_uint16_t;
#define DBUS_SIZEOF_VOID_P @DBUS_SIZEOF_VOID_P@
/* This is not really arch-dependent, but it's not worth
* creating an additional generated header just for this
*/
#define DBUS_MAJOR_VERSION @DBUS_MAJOR_VERSION@
#define DBUS_MINOR_VERSION @DBUS_MINOR_VERSION@
#define DBUS_MICRO_VERSION @DBUS_MICRO_VERSION@
#define DBUS_VERSION_STRING "@DBUS_VERSION@"
#define DBUS_VERSION ((@DBUS_MAJOR_VERSION@ << 16) | (@DBUS_MINOR_VERSION@ << 8) | (@DBUS_MICRO_VERSION@))
DBUS_END_DECLS
#endif /* DBUS_ARCH_DEPS_H */

97
src/linux/vendor/dbus/dbus/dbus-bus.h vendored Normal file
View File

@ -0,0 +1,97 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-bus.h Convenience functions for communicating with the bus.
*
* Copyright (C) 2003 CodeFactory AB
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_BUS_H
#define DBUS_BUS_H
#include <dbus/dbus-connection.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusBus
* @{
*/
DBUS_EXPORT
DBusConnection *dbus_bus_get (DBusBusType type,
DBusError *error);
DBUS_EXPORT
DBusConnection *dbus_bus_get_private (DBusBusType type,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_bus_register (DBusConnection *connection,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_bus_set_unique_name (DBusConnection *connection,
const char *unique_name);
DBUS_EXPORT
const char* dbus_bus_get_unique_name (DBusConnection *connection);
DBUS_EXPORT
unsigned long dbus_bus_get_unix_user (DBusConnection *connection,
const char *name,
DBusError *error);
DBUS_EXPORT
char* dbus_bus_get_id (DBusConnection *connection,
DBusError *error);
DBUS_EXPORT
int dbus_bus_request_name (DBusConnection *connection,
const char *name,
unsigned int flags,
DBusError *error);
DBUS_EXPORT
int dbus_bus_release_name (DBusConnection *connection,
const char *name,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_bus_name_has_owner (DBusConnection *connection,
const char *name,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_bus_start_service_by_name (DBusConnection *connection,
const char *name,
dbus_uint32_t flags,
dbus_uint32_t *reply,
DBusError *error);
DBUS_EXPORT
void dbus_bus_add_match (DBusConnection *connection,
const char *rule,
DBusError *error);
DBUS_EXPORT
void dbus_bus_remove_match (DBusConnection *connection,
const char *rule,
DBusError *error);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_BUS_H */

View File

@ -0,0 +1,531 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-connection.h DBusConnection object
*
* Copyright (C) 2002, 2003 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_CONNECTION_H
#define DBUS_CONNECTION_H
#include <dbus/dbus-errors.h>
#include <dbus/dbus-macros.h>
#include <dbus/dbus-memory.h>
#include <dbus/dbus-message.h>
#include <dbus/dbus-shared.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusConnection
* @{
*/
/* documented in dbus-watch.c */
typedef struct DBusWatch DBusWatch;
/* documented in dbus-timeout.c */
typedef struct DBusTimeout DBusTimeout;
/** Opaque type representing preallocated resources so a message can be sent without further memory allocation. */
typedef struct DBusPreallocatedSend DBusPreallocatedSend;
/** Opaque type representing a method call that has not yet received a reply. */
typedef struct DBusPendingCall DBusPendingCall;
/** Opaque type representing a connection to a remote application and associated incoming/outgoing message queues. */
typedef struct DBusConnection DBusConnection;
/** Set of functions that must be implemented to handle messages sent to a particular object path. */
typedef struct DBusObjectPathVTable DBusObjectPathVTable;
/**
* Indicates the status of a #DBusWatch.
*/
typedef enum
{
DBUS_WATCH_READABLE = 1 << 0, /**< As in POLLIN */
DBUS_WATCH_WRITABLE = 1 << 1, /**< As in POLLOUT */
DBUS_WATCH_ERROR = 1 << 2, /**< As in POLLERR (can't watch for
* this, but can be present in
* current state passed to
* dbus_watch_handle()).
*/
DBUS_WATCH_HANGUP = 1 << 3 /**< As in POLLHUP (can't watch for
* it, but can be present in current
* state passed to
* dbus_watch_handle()).
*/
/* Internal to libdbus, there is also _DBUS_WATCH_NVAL in dbus-watch.h */
} DBusWatchFlags;
/**
* Indicates the status of incoming data on a #DBusConnection. This determines whether
* dbus_connection_dispatch() needs to be called.
*/
typedef enum
{
DBUS_DISPATCH_DATA_REMAINS, /**< There is more data to potentially convert to messages. */
DBUS_DISPATCH_COMPLETE, /**< All currently available data has been processed. */
DBUS_DISPATCH_NEED_MEMORY /**< More memory is needed to continue. */
} DBusDispatchStatus;
/** Called when libdbus needs a new watch to be monitored by the main
* loop. Returns #FALSE if it lacks enough memory to add the
* watch. Set by dbus_connection_set_watch_functions() or
* dbus_server_set_watch_functions().
*/
typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch,
void *data);
/** Called when dbus_watch_get_enabled() may return a different value
* than it did before. Set by dbus_connection_set_watch_functions()
* or dbus_server_set_watch_functions().
*/
typedef void (* DBusWatchToggledFunction) (DBusWatch *watch,
void *data);
/** Called when libdbus no longer needs a watch to be monitored by the
* main loop. Set by dbus_connection_set_watch_functions() or
* dbus_server_set_watch_functions().
*/
typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch,
void *data);
/** Called when libdbus needs a new timeout to be monitored by the main
* loop. Returns #FALSE if it lacks enough memory to add the
* watch. Set by dbus_connection_set_timeout_functions() or
* dbus_server_set_timeout_functions().
*/
typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout,
void *data);
/** Called when dbus_timeout_get_enabled() may return a different
* value than it did before.
* Set by dbus_connection_set_timeout_functions() or
* dbus_server_set_timeout_functions().
*/
typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout,
void *data);
/** Called when libdbus no longer needs a timeout to be monitored by the
* main loop. Set by dbus_connection_set_timeout_functions() or
* dbus_server_set_timeout_functions().
*/
typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout,
void *data);
/** Called when the return value of dbus_connection_get_dispatch_status()
* may have changed. Set with dbus_connection_set_dispatch_status_function().
*/
typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection,
DBusDispatchStatus new_status,
void *data);
/**
* Called when the main loop's thread should be notified that there's now work
* to do. Set with dbus_connection_set_wakeup_main_function().
*/
typedef void (* DBusWakeupMainFunction) (void *data);
/**
* Called during authentication to check whether the given UNIX user
* ID is allowed to connect, if the client tried to auth as a UNIX
* user ID. Normally on Windows this would never happen. Set with
* dbus_connection_set_unix_user_function().
*/
typedef dbus_bool_t (* DBusAllowUnixUserFunction) (DBusConnection *connection,
unsigned long uid,
void *data);
/**
* Called during authentication to check whether the given Windows user
* ID is allowed to connect, if the client tried to auth as a Windows
* user ID. Normally on UNIX this would never happen. Set with
* dbus_connection_set_windows_user_function().
*/
typedef dbus_bool_t (* DBusAllowWindowsUserFunction) (DBusConnection *connection,
const char *user_sid,
void *data);
/**
* Called when a pending call now has a reply available. Set with
* dbus_pending_call_set_notify().
*/
typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending,
void *user_data);
/**
* Called when a message needs to be handled. The result indicates whether or
* not more handlers should be run. Set with dbus_connection_add_filter().
*/
typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection,
DBusMessage *message,
void *user_data);
DBUS_EXPORT
DBusConnection* dbus_connection_open (const char *address,
DBusError *error);
DBUS_EXPORT
DBusConnection* dbus_connection_open_private (const char *address,
DBusError *error);
DBUS_EXPORT
DBusConnection* dbus_connection_ref (DBusConnection *connection);
DBUS_EXPORT
void dbus_connection_unref (DBusConnection *connection);
DBUS_EXPORT
void dbus_connection_close (DBusConnection *connection);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_is_anonymous (DBusConnection *connection);
DBUS_EXPORT
char* dbus_connection_get_server_id (DBusConnection *connection);
DBUS_EXPORT
dbus_bool_t dbus_connection_can_send_type (DBusConnection *connection,
int type);
DBUS_EXPORT
void dbus_connection_set_exit_on_disconnect (DBusConnection *connection,
dbus_bool_t exit_on_disconnect);
DBUS_EXPORT
void dbus_connection_flush (DBusConnection *connection);
DBUS_EXPORT
dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection,
int timeout_milliseconds);
DBUS_EXPORT
dbus_bool_t dbus_connection_read_write (DBusConnection *connection,
int timeout_milliseconds);
DBUS_EXPORT
DBusMessage* dbus_connection_borrow_message (DBusConnection *connection);
DBUS_EXPORT
void dbus_connection_return_message (DBusConnection *connection,
DBusMessage *message);
DBUS_EXPORT
void dbus_connection_steal_borrowed_message (DBusConnection *connection,
DBusMessage *message);
DBUS_EXPORT
DBusMessage* dbus_connection_pop_message (DBusConnection *connection);
DBUS_EXPORT
DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection);
DBUS_EXPORT
DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection);
DBUS_EXPORT
dbus_bool_t dbus_connection_has_messages_to_send (DBusConnection *connection);
DBUS_EXPORT
dbus_bool_t dbus_connection_send (DBusConnection *connection,
DBusMessage *message,
dbus_uint32_t *client_serial);
DBUS_EXPORT
dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection,
DBusMessage *message,
DBusPendingCall **pending_return,
int timeout_milliseconds);
DBUS_EXPORT
DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection,
DBusMessage *message,
int timeout_milliseconds,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection,
DBusAddWatchFunction add_function,
DBusRemoveWatchFunction remove_function,
DBusWatchToggledFunction toggled_function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection,
DBusAddTimeoutFunction add_function,
DBusRemoveTimeoutFunction remove_function,
DBusTimeoutToggledFunction toggled_function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
void dbus_connection_set_wakeup_main_function (DBusConnection *connection,
DBusWakeupMainFunction wakeup_main_function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
void dbus_connection_set_dispatch_status_function (DBusConnection *connection,
DBusDispatchStatusFunction function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection,
unsigned long *uid);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection,
unsigned long *pid);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_adt_audit_session_data (DBusConnection *connection,
void **data,
dbus_int32_t *data_size);
DBUS_EXPORT
void dbus_connection_set_unix_user_function (DBusConnection *connection,
DBusAllowUnixUserFunction function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_windows_user (DBusConnection *connection,
char **windows_sid_p);
DBUS_EXPORT
void dbus_connection_set_windows_user_function (DBusConnection *connection,
DBusAllowWindowsUserFunction function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
void dbus_connection_set_allow_anonymous (DBusConnection *connection,
dbus_bool_t value);
DBUS_EXPORT
void dbus_connection_set_builtin_filters_enabled (DBusConnection *connection,
dbus_bool_t value);
DBUS_EXPORT
void dbus_connection_set_route_peer_messages (DBusConnection *connection,
dbus_bool_t value);
/* Filters */
DBUS_EXPORT
dbus_bool_t dbus_connection_add_filter (DBusConnection *connection,
DBusHandleMessageFunction function,
void *user_data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
void dbus_connection_remove_filter (DBusConnection *connection,
DBusHandleMessageFunction function,
void *user_data);
/* Other */
DBUS_EXPORT
dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p);
DBUS_EXPORT
void dbus_connection_free_data_slot (dbus_int32_t *slot_p);
DBUS_EXPORT
dbus_bool_t dbus_connection_set_data (DBusConnection *connection,
dbus_int32_t slot,
void *data,
DBusFreeFunction free_data_func);
DBUS_EXPORT
void* dbus_connection_get_data (DBusConnection *connection,
dbus_int32_t slot);
DBUS_EXPORT
void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);
DBUS_EXPORT
void dbus_connection_set_max_message_size (DBusConnection *connection,
long size);
DBUS_EXPORT
long dbus_connection_get_max_message_size (DBusConnection *connection);
DBUS_EXPORT
void dbus_connection_set_max_received_size (DBusConnection *connection,
long size);
DBUS_EXPORT
long dbus_connection_get_max_received_size (DBusConnection *connection);
DBUS_EXPORT
void dbus_connection_set_max_message_unix_fds (DBusConnection *connection,
long n);
DBUS_EXPORT
long dbus_connection_get_max_message_unix_fds (DBusConnection *connection);
DBUS_EXPORT
void dbus_connection_set_max_received_unix_fds(DBusConnection *connection,
long n);
DBUS_EXPORT
long dbus_connection_get_max_received_unix_fds(DBusConnection *connection);
DBUS_EXPORT
long dbus_connection_get_outgoing_size (DBusConnection *connection);
DBUS_EXPORT
long dbus_connection_get_outgoing_unix_fds (DBusConnection *connection);
DBUS_EXPORT
DBusPreallocatedSend* dbus_connection_preallocate_send (DBusConnection *connection);
DBUS_EXPORT
void dbus_connection_free_preallocated_send (DBusConnection *connection,
DBusPreallocatedSend *preallocated);
DBUS_EXPORT
void dbus_connection_send_preallocated (DBusConnection *connection,
DBusPreallocatedSend *preallocated,
DBusMessage *message,
dbus_uint32_t *client_serial);
/* Object tree functionality */
/**
* Called when a #DBusObjectPathVTable is unregistered (or its connection is freed).
* Found in #DBusObjectPathVTable.
*/
typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection,
void *user_data);
/**
* Called when a message is sent to a registered object path. Found in
* #DBusObjectPathVTable which is registered with dbus_connection_register_object_path()
* or dbus_connection_register_fallback().
*/
typedef DBusHandlerResult (* DBusObjectPathMessageFunction) (DBusConnection *connection,
DBusMessage *message,
void *user_data);
/**
* Virtual table that must be implemented to handle a portion of the
* object path hierarchy. Attach the vtable to a particular path using
* dbus_connection_register_object_path() or
* dbus_connection_register_fallback().
*/
struct DBusObjectPathVTable
{
DBusObjectPathUnregisterFunction unregister_function; /**< Function to unregister this handler */
DBusObjectPathMessageFunction message_function; /**< Function to handle messages */
void (* dbus_internal_pad1) (void *); /**< Reserved for future expansion */
void (* dbus_internal_pad2) (void *); /**< Reserved for future expansion */
void (* dbus_internal_pad3) (void *); /**< Reserved for future expansion */
void (* dbus_internal_pad4) (void *); /**< Reserved for future expansion */
};
DBUS_EXPORT
dbus_bool_t dbus_connection_try_register_object_path (DBusConnection *connection,
const char *path,
const DBusObjectPathVTable *vtable,
void *user_data,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection,
const char *path,
const DBusObjectPathVTable *vtable,
void *user_data);
DBUS_EXPORT
dbus_bool_t dbus_connection_try_register_fallback (DBusConnection *connection,
const char *path,
const DBusObjectPathVTable *vtable,
void *user_data,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection,
const char *path,
const DBusObjectPathVTable *vtable,
void *user_data);
DBUS_EXPORT
dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection,
const char *path);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection,
const char *path,
void **data_p);
DBUS_EXPORT
dbus_bool_t dbus_connection_list_registered (DBusConnection *connection,
const char *parent_path,
char ***child_entries);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_unix_fd (DBusConnection *connection,
int *fd);
DBUS_EXPORT
dbus_bool_t dbus_connection_get_socket (DBusConnection *connection,
int *fd);
/**
* Clear a variable or struct member that contains a #DBusConnection.
* If it does not contain #NULL, the connection that was previously
* there is unreferenced with dbus_connection_unref().
*
* For example, this function and the similar functions for
* other reference-counted types can be used in code like this:
*
* @code
* DBusConnection *conn = NULL;
* struct { ...; DBusMessage *m; ... } *larger_structure = ...;
*
* ... code that might set conn or m to be non-NULL ...
*
* dbus_clear_connection (&conn);
* dbus_clear_message (&larger_structure->m);
* @endcode
*
* @param pointer_to_connection A pointer to a variable or struct member.
* pointer_to_connection must not be #NULL, but *pointer_to_connection
* may be #NULL.
*/
static inline void
dbus_clear_connection (DBusConnection **pointer_to_connection)
{
_dbus_clear_pointer_impl (DBusConnection, pointer_to_connection,
dbus_connection_unref);
}
/** @} */
/**
* @addtogroup DBusWatch
* @{
*/
#ifndef DBUS_DISABLE_DEPRECATED
DBUS_EXPORT
DBUS_DEPRECATED int dbus_watch_get_fd (DBusWatch *watch);
#endif
DBUS_EXPORT
int dbus_watch_get_unix_fd (DBusWatch *watch);
DBUS_EXPORT
int dbus_watch_get_socket (DBusWatch *watch);
DBUS_EXPORT
unsigned int dbus_watch_get_flags (DBusWatch *watch);
DBUS_EXPORT
void* dbus_watch_get_data (DBusWatch *watch);
DBUS_EXPORT
void dbus_watch_set_data (DBusWatch *watch,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
dbus_bool_t dbus_watch_handle (DBusWatch *watch,
unsigned int flags);
DBUS_EXPORT
dbus_bool_t dbus_watch_get_enabled (DBusWatch *watch);
/** @} */
/**
* @addtogroup DBusTimeout
* @{
*/
DBUS_EXPORT
int dbus_timeout_get_interval (DBusTimeout *timeout);
DBUS_EXPORT
void* dbus_timeout_get_data (DBusTimeout *timeout);
DBUS_EXPORT
void dbus_timeout_set_data (DBusTimeout *timeout,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
dbus_bool_t dbus_timeout_handle (DBusTimeout *timeout);
DBUS_EXPORT
dbus_bool_t dbus_timeout_get_enabled (DBusTimeout *timeout);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_CONNECTION_H */

View File

@ -0,0 +1,92 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-errors.h Error reporting
*
* Copyright (C) 2002 Red Hat Inc.
* Copyright (C) 2003 CodeFactory AB
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_ERROR_H
#define DBUS_ERROR_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-protocol.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusErrors
* @{
*/
/** Mostly-opaque type representing an error that occurred */
typedef struct DBusError DBusError;
/**
* Object representing an exception.
*/
struct DBusError
{
const char *name; /**< public error name field */
const char *message; /**< public error message field */
unsigned int dummy1 : 1; /**< placeholder */
unsigned int dummy2 : 1; /**< placeholder */
unsigned int dummy3 : 1; /**< placeholder */
unsigned int dummy4 : 1; /**< placeholder */
unsigned int dummy5 : 1; /**< placeholder */
void *padding1; /**< placeholder */
};
#define DBUS_ERROR_INIT { NULL, NULL, TRUE, 0, 0, 0, 0, NULL }
DBUS_EXPORT
void dbus_error_init (DBusError *error);
DBUS_EXPORT
void dbus_error_free (DBusError *error);
DBUS_EXPORT
void dbus_set_error (DBusError *error,
const char *name,
const char *message,
...) _DBUS_GNUC_PRINTF (3, 4);
DBUS_EXPORT
void dbus_set_error_const (DBusError *error,
const char *name,
const char *message);
DBUS_EXPORT
void dbus_move_error (DBusError *src,
DBusError *dest);
DBUS_EXPORT
dbus_bool_t dbus_error_has_name (const DBusError *error,
const char *name);
DBUS_EXPORT
dbus_bool_t dbus_error_is_set (const DBusError *error);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_ERROR_H */

237
src/linux/vendor/dbus/dbus/dbus-macros.h vendored Normal file
View File

@ -0,0 +1,237 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-macros.h generic macros
*
* Copyright (C) 2002 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_MACROS_H
#define DBUS_MACROS_H
#ifdef __cplusplus
# define DBUS_BEGIN_DECLS extern "C" {
# define DBUS_END_DECLS }
#else
# define DBUS_BEGIN_DECLS
# define DBUS_END_DECLS
#endif
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#ifndef NULL
# ifdef __cplusplus
# define NULL (0L)
# else /* !__cplusplus */
# define NULL ((void*) 0)
# endif /* !__cplusplus */
#endif
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
# define DBUS_DEPRECATED __attribute__ ((__deprecated__))
#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
# define DBUS_DEPRECATED __declspec(deprecated)
#else
# define DBUS_DEPRECATED
#endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
# define _DBUS_GNUC_EXTENSION __extension__
#else
# define _DBUS_GNUC_EXTENSION
#endif
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)) || \
defined(__clang__)
#define _DBUS_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#define _DBUS_GNUC_NORETURN \
__attribute__((__noreturn__))
#define _DBUS_GNUC_UNUSED \
__attribute__((__unused__))
#else /* !__GNUC__ */
#define _DBUS_GNUC_PRINTF( format_idx, arg_idx )
#define _DBUS_GNUC_NORETURN
#define _DBUS_GNUC_UNUSED
#endif /* !__GNUC__ */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
#define DBUS_MALLOC __attribute__((__malloc__))
#else
#define DBUS_MALLOC
#endif
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
#define DBUS_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
#define DBUS_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
#else
#define DBUS_ALLOC_SIZE(x)
#define DBUS_ALLOC_SIZE2(x,y)
#endif
/** @def _DBUS_WARN_UNUSED_RESULT
*
* An attribute for functions whose result must be checked by the caller.
*
* This macro is used in function declarations. Unlike gcc-specific
* attributes, to avoid compilation failure with MSVC it must appear
* somewhere before the function name in the declaration. Our preferred
* coding style is to place it before the return type, for example:
*
* DBUS_PRIVATE_EXPORT _DBUS_WARN_UNUSED_RESULT
* dbus_bool_t _dbus_user_database_lock_system (void);
*/
#if defined(_MSC_VER) && (_MSC_VER >= 1700)
#define _DBUS_WARN_UNUSED_RESULT _Must_inspect_result_
#elif (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#define _DBUS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define _DBUS_WARN_UNUSED_RESULT
#endif
/** @def _DBUS_GNUC_PRINTF
* used to tell gcc about printf format strings
*/
/** @def _DBUS_GNUC_NORETURN
* used to tell gcc about functions that never return, such as _dbus_abort()
*/
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusMacros Utility macros
* @ingroup DBus
* @brief #TRUE, #FALSE, #NULL, and so on
*
* Utility macros.
*
* @{
*/
/**
* @def DBUS_BEGIN_DECLS
*
* Macro used prior to declaring functions in the D-Bus header
* files. Expands to "extern "C"" when using a C++ compiler,
* and expands to nothing when using a C compiler.
*
* Please don't use this in your own code, consider it
* D-Bus internal.
*/
/**
* @def DBUS_END_DECLS
*
* Macro used after declaring functions in the D-Bus header
* files. Expands to "}" when using a C++ compiler,
* and expands to nothing when using a C compiler.
*
* Please don't use this in your own code, consider it
* D-Bus internal.
*/
/**
* @def TRUE
*
* Expands to "1"
*/
/**
* @def FALSE
*
* Expands to "0"
*/
/**
* @def NULL
*
* A null pointer, defined appropriately for C or C++.
*/
/**
* @def DBUS_DEPRECATED
*
* Tells the compiler to warn about a function or type if it's used.
* Code marked in this way should also be enclosed in
* @code
* #ifndef DBUS_DISABLE_DEPRECATED
* deprecated stuff here
* #endif
* @endcode
*
* Please don't use this in your own code, consider it
* D-Bus internal.
*/
/**
* @def _DBUS_GNUC_EXTENSION
*
* Tells gcc not to warn about extensions to the C standard in the
* following expression, even if compiling with -pedantic. Do not use
* this macro in your own code; please consider it to be internal to libdbus.
*/
/*
* @def DBUS_EXPORT
*
* Declare the following symbol as public. This is currently a noop on
* platforms other than Windows.
*/
#if defined(DBUS_EXPORT)
/* value forced by compiler command line, don't redefine */
#elif defined(_WIN32)
# if defined(DBUS_STATIC_BUILD)
# define DBUS_EXPORT
# elif defined(dbus_1_EXPORTS)
# define DBUS_EXPORT __declspec(dllexport)
# else
# define DBUS_EXPORT __declspec(dllimport)
# endif
#elif defined(__GNUC__) && __GNUC__ >= 4
# define DBUS_EXPORT __attribute__ ((__visibility__ ("default")))
#else
#define DBUS_EXPORT
#endif
/* Implementation for dbus_clear_message() etc. This is not API,
* do not use it directly.
*
* We're using a specific type (T ** and T *) instead of void ** and
* void * partly for type-safety, partly to be strict-aliasing-compliant,
* and partly to keep C++ compilers happy. This code is inlined into
* users of libdbus, so we can't rely on it having dbus' own compiler
* settings. */
#define _dbus_clear_pointer_impl(T, pointer_to_pointer, destroy) \
do { \
T **_pp = (pointer_to_pointer); \
T *_value = *_pp; \
\
*_pp = NULL; \
\
if (_value != NULL) \
destroy (_value); \
} while (0)
/* Not (destroy) (_value) in case destroy() is a function-like macro */
/** @} */
#endif /* DBUS_MACROS_H */

View File

@ -0,0 +1,74 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-memory.h D-Bus memory handling
*
* Copyright (C) 2002 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_MEMORY_H
#define DBUS_MEMORY_H
#include <dbus/dbus-macros.h>
#include <stddef.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusMemory
* @{
*/
DBUS_EXPORT
DBUS_MALLOC
DBUS_ALLOC_SIZE(1)
void* dbus_malloc (size_t bytes);
DBUS_EXPORT
DBUS_MALLOC
DBUS_ALLOC_SIZE(1)
void* dbus_malloc0 (size_t bytes);
DBUS_EXPORT
DBUS_ALLOC_SIZE(2)
void* dbus_realloc (void *memory,
size_t bytes);
DBUS_EXPORT
void dbus_free (void *memory);
#define dbus_new(type, count) ((type*)dbus_malloc (sizeof (type) * (count)))
#define dbus_new0(type, count) ((type*)dbus_malloc0 (sizeof (type) * (count)))
DBUS_EXPORT
void dbus_free_string_array (char **str_array);
typedef void (* DBusFreeFunction) (void *memory);
DBUS_EXPORT
void dbus_shutdown (void);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_MEMORY_H */

View File

@ -0,0 +1,401 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-message.h DBusMessage object
*
* Copyright (C) 2002, 2003, 2005 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_MESSAGE_H
#define DBUS_MESSAGE_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-arch-deps.h>
#include <dbus/dbus-memory.h>
#include <dbus/dbus-errors.h>
#include <stdarg.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusMessage
* @{
*/
typedef struct DBusMessage DBusMessage;
/**
* Opaque type representing a message iterator. Can be copied by value and
* allocated on the stack.
*
* A DBusMessageIter usually contains no allocated memory. However, there
* is one special case: after a successful call to
* dbus_message_iter_open_container(), the caller is responsible for calling
* either dbus_message_iter_close_container() or
* dbus_message_iter_abandon_container() exactly once, with the same pair
* of iterators.
*/
typedef struct DBusMessageIter DBusMessageIter;
/**
* DBusMessageIter struct; contains no public fields.
*/
struct DBusMessageIter
{
#if DBUS_SIZEOF_VOID_P > 8
void *dummy[16]; /**< Don't use this */
#else
void *dummy1; /**< Don't use this */
void *dummy2; /**< Don't use this */
dbus_uint32_t dummy3; /**< Don't use this */
int dummy4; /**< Don't use this */
int dummy5; /**< Don't use this */
int dummy6; /**< Don't use this */
int dummy7; /**< Don't use this */
int dummy8; /**< Don't use this */
int dummy9; /**< Don't use this */
int dummy10; /**< Don't use this */
int dummy11; /**< Don't use this */
int pad1; /**< Don't use this */
void *pad2; /**< Don't use this */
void *pad3; /**< Don't use this */
#endif
};
/**
* A message iterator for which dbus_message_iter_abandon_container_if_open()
* is the only valid operation.
*/
#if DBUS_SIZEOF_VOID_P > 8
#define DBUS_MESSAGE_ITER_INIT_CLOSED \
{ \
{ \
NULL, NULL, NULL, NULL, \
NULL, NULL, NULL, NULL, \
NULL, NULL, NULL, NULL, \
NULL, NULL, NULL, NULL \
} \
}
#else
#define DBUS_MESSAGE_ITER_INIT_CLOSED \
{ \
NULL, /* dummy1 */ \
NULL, /* dummy2 */ \
0, /* dummy3 */ \
0, /* dummy4 */ \
0, /* dummy5 */ \
0, /* dummy6 */ \
0, /* dummy7 */ \
0, /* dummy8 */ \
0, /* dummy9 */ \
0, /* dummy10 */ \
0, /* dummy11 */ \
0, /* pad1 */ \
NULL, /* pad2 */ \
NULL /* pad3 */ \
}
#endif
DBUS_EXPORT
DBusMessage* dbus_message_new (int message_type);
DBUS_EXPORT
DBusMessage* dbus_message_new_method_call (const char *bus_name,
const char *path,
const char *iface,
const char *method);
DBUS_EXPORT
DBusMessage* dbus_message_new_method_return (DBusMessage *method_call);
DBUS_EXPORT
DBusMessage* dbus_message_new_signal (const char *path,
const char *iface,
const char *name);
DBUS_EXPORT
DBusMessage* dbus_message_new_error (DBusMessage *reply_to,
const char *error_name,
const char *error_message);
DBUS_EXPORT
DBusMessage* dbus_message_new_error_printf (DBusMessage *reply_to,
const char *error_name,
const char *error_format,
...) _DBUS_GNUC_PRINTF (3, 4);
DBUS_EXPORT
DBusMessage* dbus_message_copy (const DBusMessage *message);
DBUS_EXPORT
DBusMessage* dbus_message_ref (DBusMessage *message);
DBUS_EXPORT
void dbus_message_unref (DBusMessage *message);
DBUS_EXPORT
int dbus_message_get_type (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_set_path (DBusMessage *message,
const char *object_path);
DBUS_EXPORT
const char* dbus_message_get_path (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_has_path (DBusMessage *message,
const char *object_path);
DBUS_EXPORT
dbus_bool_t dbus_message_set_interface (DBusMessage *message,
const char *iface);
DBUS_EXPORT
const char* dbus_message_get_interface (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_has_interface (DBusMessage *message,
const char *iface);
DBUS_EXPORT
dbus_bool_t dbus_message_set_member (DBusMessage *message,
const char *member);
DBUS_EXPORT
const char* dbus_message_get_member (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_has_member (DBusMessage *message,
const char *member);
DBUS_EXPORT
dbus_bool_t dbus_message_set_error_name (DBusMessage *message,
const char *name);
DBUS_EXPORT
const char* dbus_message_get_error_name (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_set_destination (DBusMessage *message,
const char *destination);
DBUS_EXPORT
const char* dbus_message_get_destination (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_set_sender (DBusMessage *message,
const char *sender);
DBUS_EXPORT
const char* dbus_message_get_sender (DBusMessage *message);
DBUS_EXPORT
const char* dbus_message_get_signature (DBusMessage *message);
DBUS_EXPORT
void dbus_message_set_no_reply (DBusMessage *message,
dbus_bool_t no_reply);
DBUS_EXPORT
dbus_bool_t dbus_message_get_no_reply (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_is_method_call (DBusMessage *message,
const char *iface,
const char *method);
DBUS_EXPORT
dbus_bool_t dbus_message_is_signal (DBusMessage *message,
const char *iface,
const char *signal_name);
DBUS_EXPORT
dbus_bool_t dbus_message_is_error (DBusMessage *message,
const char *error_name);
DBUS_EXPORT
dbus_bool_t dbus_message_has_destination (DBusMessage *message,
const char *bus_name);
DBUS_EXPORT
dbus_bool_t dbus_message_has_sender (DBusMessage *message,
const char *unique_bus_name);
DBUS_EXPORT
dbus_bool_t dbus_message_has_signature (DBusMessage *message,
const char *signature);
DBUS_EXPORT
dbus_uint32_t dbus_message_get_serial (DBusMessage *message);
DBUS_EXPORT
void dbus_message_set_serial (DBusMessage *message,
dbus_uint32_t serial);
DBUS_EXPORT
dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message,
dbus_uint32_t reply_serial);
DBUS_EXPORT
dbus_uint32_t dbus_message_get_reply_serial (DBusMessage *message);
DBUS_EXPORT
void dbus_message_set_auto_start (DBusMessage *message,
dbus_bool_t auto_start);
DBUS_EXPORT
dbus_bool_t dbus_message_get_auto_start (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_get_path_decomposed (DBusMessage *message,
char ***path);
DBUS_EXPORT
const char *dbus_message_get_container_instance (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_set_container_instance (DBusMessage *message,
const char *object_path);
DBUS_EXPORT
dbus_bool_t dbus_message_append_args (DBusMessage *message,
int first_arg_type,
...);
DBUS_EXPORT
dbus_bool_t dbus_message_append_args_valist (DBusMessage *message,
int first_arg_type,
va_list var_args);
DBUS_EXPORT
dbus_bool_t dbus_message_get_args (DBusMessage *message,
DBusError *error,
int first_arg_type,
...);
DBUS_EXPORT
dbus_bool_t dbus_message_get_args_valist (DBusMessage *message,
DBusError *error,
int first_arg_type,
va_list var_args);
DBUS_EXPORT
dbus_bool_t dbus_message_contains_unix_fds (DBusMessage *message);
DBUS_EXPORT
void dbus_message_iter_init_closed (DBusMessageIter *iter);
DBUS_EXPORT
dbus_bool_t dbus_message_iter_init (DBusMessage *message,
DBusMessageIter *iter);
DBUS_EXPORT
dbus_bool_t dbus_message_iter_has_next (DBusMessageIter *iter);
DBUS_EXPORT
dbus_bool_t dbus_message_iter_next (DBusMessageIter *iter);
DBUS_EXPORT
char* dbus_message_iter_get_signature (DBusMessageIter *iter);
DBUS_EXPORT
int dbus_message_iter_get_arg_type (DBusMessageIter *iter);
DBUS_EXPORT
int dbus_message_iter_get_element_type (DBusMessageIter *iter);
DBUS_EXPORT
void dbus_message_iter_recurse (DBusMessageIter *iter,
DBusMessageIter *sub);
DBUS_EXPORT
void dbus_message_iter_get_basic (DBusMessageIter *iter,
void *value);
DBUS_EXPORT
int dbus_message_iter_get_element_count(DBusMessageIter *iter);
#ifndef DBUS_DISABLE_DEPRECATED
/* This function returns the wire protocol size of the array in bytes,
* you do not want to know that probably
*/
DBUS_EXPORT
DBUS_DEPRECATED int dbus_message_iter_get_array_len (DBusMessageIter *iter);
#endif
DBUS_EXPORT
void dbus_message_iter_get_fixed_array (DBusMessageIter *iter,
void *value,
int *n_elements);
DBUS_EXPORT
void dbus_message_iter_init_append (DBusMessage *message,
DBusMessageIter *iter);
DBUS_EXPORT
dbus_bool_t dbus_message_iter_append_basic (DBusMessageIter *iter,
int type,
const void *value);
DBUS_EXPORT
dbus_bool_t dbus_message_iter_append_fixed_array (DBusMessageIter *iter,
int element_type,
const void *value,
int n_elements);
DBUS_EXPORT
dbus_bool_t dbus_message_iter_open_container (DBusMessageIter *iter,
int type,
const char *contained_signature,
DBusMessageIter *sub);
DBUS_EXPORT
dbus_bool_t dbus_message_iter_close_container (DBusMessageIter *iter,
DBusMessageIter *sub);
DBUS_EXPORT
void dbus_message_iter_abandon_container (DBusMessageIter *iter,
DBusMessageIter *sub);
DBUS_EXPORT
void dbus_message_iter_abandon_container_if_open (DBusMessageIter *iter,
DBusMessageIter *sub);
DBUS_EXPORT
void dbus_message_lock (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_set_error_from_message (DBusError *error,
DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_allocate_data_slot (dbus_int32_t *slot_p);
DBUS_EXPORT
void dbus_message_free_data_slot (dbus_int32_t *slot_p);
DBUS_EXPORT
dbus_bool_t dbus_message_set_data (DBusMessage *message,
dbus_int32_t slot,
void *data,
DBusFreeFunction free_data_func);
DBUS_EXPORT
void* dbus_message_get_data (DBusMessage *message,
dbus_int32_t slot);
DBUS_EXPORT
int dbus_message_type_from_string (const char *type_str);
DBUS_EXPORT
const char* dbus_message_type_to_string (int type);
DBUS_EXPORT
dbus_bool_t dbus_message_marshal (DBusMessage *msg,
char **marshalled_data_p,
int *len_p);
DBUS_EXPORT
DBusMessage* dbus_message_demarshal (const char *str,
int len,
DBusError *error);
DBUS_EXPORT
int dbus_message_demarshal_bytes_needed (const char *str,
int len);
DBUS_EXPORT
void dbus_message_set_allow_interactive_authorization (DBusMessage *message,
dbus_bool_t allow);
DBUS_EXPORT
dbus_bool_t dbus_message_get_allow_interactive_authorization (
DBusMessage *message);
/**
* Clear a variable or struct member that contains a #DBusMessage.
* If it does not contain #NULL, the message that was previously
* there is unreferenced with dbus_message_unref().
*
* This is very similar to dbus_clear_connection(): see that function
* for more details.
*
* @param pointer_to_message A pointer to a variable or struct member.
* pointer_to_message must not be #NULL, but *pointer_to_message
* may be #NULL.
*/
static inline void
dbus_clear_message (DBusMessage **pointer_to_message)
{
_dbus_clear_pointer_impl (DBusMessage, pointer_to_message,
dbus_message_unref);
}
/** @} */
DBUS_END_DECLS
#endif /* DBUS_MESSAGE_H */

60
src/linux/vendor/dbus/dbus/dbus-misc.h vendored Normal file
View File

@ -0,0 +1,60 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-misc.h A few assorted public functions that don't fit elsewhere
*
* Copyright (C) 2006 Red Hat, Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_MISC_H
#define DBUS_MISC_H
#include <dbus/dbus-types.h>
#include <dbus/dbus-errors.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusMisc
* @{
*/
DBUS_EXPORT
char* dbus_get_local_machine_id (void);
DBUS_EXPORT
void dbus_get_version (int *major_version_p,
int *minor_version_p,
int *micro_version_p);
DBUS_EXPORT
dbus_bool_t dbus_setenv (const char *variable,
const char *value);
DBUS_EXPORT
char *dbus_try_get_local_machine_id (DBusError *error);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_MISC_H */

View File

@ -0,0 +1,100 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-pending-call.h Object representing a call in progress.
*
* Copyright (C) 2002, 2003 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_PENDING_CALL_H
#define DBUS_PENDING_CALL_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-connection.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusPendingCall
* @{
*/
#define DBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
#define DBUS_TIMEOUT_USE_DEFAULT (-1)
DBUS_EXPORT
DBusPendingCall* dbus_pending_call_ref (DBusPendingCall *pending);
DBUS_EXPORT
void dbus_pending_call_unref (DBusPendingCall *pending);
DBUS_EXPORT
dbus_bool_t dbus_pending_call_set_notify (DBusPendingCall *pending,
DBusPendingCallNotifyFunction function,
void *user_data,
DBusFreeFunction free_user_data);
DBUS_EXPORT
void dbus_pending_call_cancel (DBusPendingCall *pending);
DBUS_EXPORT
dbus_bool_t dbus_pending_call_get_completed (DBusPendingCall *pending);
DBUS_EXPORT
DBusMessage* dbus_pending_call_steal_reply (DBusPendingCall *pending);
DBUS_EXPORT
void dbus_pending_call_block (DBusPendingCall *pending);
DBUS_EXPORT
dbus_bool_t dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p);
DBUS_EXPORT
void dbus_pending_call_free_data_slot (dbus_int32_t *slot_p);
DBUS_EXPORT
dbus_bool_t dbus_pending_call_set_data (DBusPendingCall *pending,
dbus_int32_t slot,
void *data,
DBusFreeFunction free_data_func);
DBUS_EXPORT
void* dbus_pending_call_get_data (DBusPendingCall *pending,
dbus_int32_t slot);
/**
* Clear a variable or struct member that contains a #DBusPendingCall.
* If it does not contain #NULL, the pending call that was previously
* there is unreferenced with dbus_pending_call_unref().
*
* This is very similar to dbus_clear_connection(): see that function
* for more details.
*
* @param pointer_to_pending_call A pointer to a variable or struct member.
* pointer_to_pending_call must not be #NULL, but *pointer_to_pending_call
* may be #NULL.
*/
static inline void
dbus_clear_pending_call (DBusPendingCall **pointer_to_pending_call)
{
_dbus_clear_pointer_impl (DBusPendingCall, pointer_to_pending_call,
dbus_pending_call_unref);
}
/** @} */
DBUS_END_DECLS
#endif /* DBUS_PENDING_CALL_H */

View File

@ -0,0 +1,488 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-protocol.h D-Bus protocol constants
*
* Copyright (C) 2002, 2003 CodeFactory AB
* Copyright (C) 2004, 2005 Red Hat, Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef DBUS_PROTOCOL_H
#define DBUS_PROTOCOL_H
/* Don't include anything in here from anywhere else. It's
* intended for use by any random library.
*/
#ifdef __cplusplus
extern "C" {
#if 0
} /* avoids confusing emacs indentation */
#endif
#endif
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusProtocol Protocol constants
* @ingroup DBus
*
* @brief Defines constants which are part of the D-Bus protocol
*
* This header is intended for use by any library, not only libdbus.
*
* @{
*/
/* Message byte order */
#define DBUS_LITTLE_ENDIAN ('l') /**< Code marking LSB-first byte order in the wire protocol. */
#define DBUS_BIG_ENDIAN ('B') /**< Code marking MSB-first byte order in the wire protocol. */
/** Protocol version. */
#define DBUS_MAJOR_PROTOCOL_VERSION 1
/** Type code that is never equal to a legitimate type code */
#define DBUS_TYPE_INVALID ((int) '\0')
/** #DBUS_TYPE_INVALID as a string literal instead of a int literal */
#define DBUS_TYPE_INVALID_AS_STRING "\0"
/* Primitive types */
/** Type code marking an 8-bit unsigned integer */
#define DBUS_TYPE_BYTE ((int) 'y')
/** #DBUS_TYPE_BYTE as a string literal instead of a int literal */
#define DBUS_TYPE_BYTE_AS_STRING "y"
/** Type code marking a boolean */
#define DBUS_TYPE_BOOLEAN ((int) 'b')
/** #DBUS_TYPE_BOOLEAN as a string literal instead of a int literal */
#define DBUS_TYPE_BOOLEAN_AS_STRING "b"
/** Type code marking a 16-bit signed integer */
#define DBUS_TYPE_INT16 ((int) 'n')
/** #DBUS_TYPE_INT16 as a string literal instead of a int literal */
#define DBUS_TYPE_INT16_AS_STRING "n"
/** Type code marking a 16-bit unsigned integer */
#define DBUS_TYPE_UINT16 ((int) 'q')
/** #DBUS_TYPE_UINT16 as a string literal instead of a int literal */
#define DBUS_TYPE_UINT16_AS_STRING "q"
/** Type code marking a 32-bit signed integer */
#define DBUS_TYPE_INT32 ((int) 'i')
/** #DBUS_TYPE_INT32 as a string literal instead of a int literal */
#define DBUS_TYPE_INT32_AS_STRING "i"
/** Type code marking a 32-bit unsigned integer */
#define DBUS_TYPE_UINT32 ((int) 'u')
/** #DBUS_TYPE_UINT32 as a string literal instead of a int literal */
#define DBUS_TYPE_UINT32_AS_STRING "u"
/** Type code marking a 64-bit signed integer */
#define DBUS_TYPE_INT64 ((int) 'x')
/** #DBUS_TYPE_INT64 as a string literal instead of a int literal */
#define DBUS_TYPE_INT64_AS_STRING "x"
/** Type code marking a 64-bit unsigned integer */
#define DBUS_TYPE_UINT64 ((int) 't')
/** #DBUS_TYPE_UINT64 as a string literal instead of a int literal */
#define DBUS_TYPE_UINT64_AS_STRING "t"
/** Type code marking an 8-byte double in IEEE 754 format */
#define DBUS_TYPE_DOUBLE ((int) 'd')
/** #DBUS_TYPE_DOUBLE as a string literal instead of a int literal */
#define DBUS_TYPE_DOUBLE_AS_STRING "d"
/** Type code marking a UTF-8 encoded, nul-terminated Unicode string */
#define DBUS_TYPE_STRING ((int) 's')
/** #DBUS_TYPE_STRING as a string literal instead of a int literal */
#define DBUS_TYPE_STRING_AS_STRING "s"
/** Type code marking a D-Bus object path */
#define DBUS_TYPE_OBJECT_PATH ((int) 'o')
/** #DBUS_TYPE_OBJECT_PATH as a string literal instead of a int literal */
#define DBUS_TYPE_OBJECT_PATH_AS_STRING "o"
/** Type code marking a D-Bus type signature */
#define DBUS_TYPE_SIGNATURE ((int) 'g')
/** #DBUS_TYPE_SIGNATURE as a string literal instead of a int literal */
#define DBUS_TYPE_SIGNATURE_AS_STRING "g"
/** Type code marking a unix file descriptor */
#define DBUS_TYPE_UNIX_FD ((int) 'h')
/** #DBUS_TYPE_UNIX_FD as a string literal instead of a int literal */
#define DBUS_TYPE_UNIX_FD_AS_STRING "h"
/* Compound types */
/** Type code marking a D-Bus array type */
#define DBUS_TYPE_ARRAY ((int) 'a')
/** #DBUS_TYPE_ARRAY as a string literal instead of a int literal */
#define DBUS_TYPE_ARRAY_AS_STRING "a"
/** Type code marking a D-Bus variant type */
#define DBUS_TYPE_VARIANT ((int) 'v')
/** #DBUS_TYPE_VARIANT as a string literal instead of a int literal */
#define DBUS_TYPE_VARIANT_AS_STRING "v"
/** STRUCT and DICT_ENTRY are sort of special since their codes can't
* appear in a type string, instead
* DBUS_STRUCT_BEGIN_CHAR/DBUS_DICT_ENTRY_BEGIN_CHAR have to appear
*/
/** Type code used to represent a struct; however, this type code does not appear
* in type signatures, instead #DBUS_STRUCT_BEGIN_CHAR and #DBUS_STRUCT_END_CHAR will
* appear in a signature.
*/
#define DBUS_TYPE_STRUCT ((int) 'r')
/** #DBUS_TYPE_STRUCT as a string literal instead of a int literal */
#define DBUS_TYPE_STRUCT_AS_STRING "r"
/** Type code used to represent a dict entry; however, this type code does not appear
* in type signatures, instead #DBUS_DICT_ENTRY_BEGIN_CHAR and #DBUS_DICT_ENTRY_END_CHAR will
* appear in a signature.
*/
#define DBUS_TYPE_DICT_ENTRY ((int) 'e')
/** #DBUS_TYPE_DICT_ENTRY as a string literal instead of a int literal */
#define DBUS_TYPE_DICT_ENTRY_AS_STRING "e"
/** Does not include #DBUS_TYPE_INVALID, #DBUS_STRUCT_BEGIN_CHAR, #DBUS_STRUCT_END_CHAR,
* #DBUS_DICT_ENTRY_BEGIN_CHAR, or #DBUS_DICT_ENTRY_END_CHAR - i.e. it is the number of
* valid types, not the number of distinct characters that may appear in a type signature.
*/
#define DBUS_NUMBER_OF_TYPES (16)
/* characters other than typecodes that appear in type signatures */
/** Code marking the start of a struct type in a type signature */
#define DBUS_STRUCT_BEGIN_CHAR ((int) '(')
/** #DBUS_STRUCT_BEGIN_CHAR as a string literal instead of a int literal */
#define DBUS_STRUCT_BEGIN_CHAR_AS_STRING "("
/** Code marking the end of a struct type in a type signature */
#define DBUS_STRUCT_END_CHAR ((int) ')')
/** #DBUS_STRUCT_END_CHAR a string literal instead of a int literal */
#define DBUS_STRUCT_END_CHAR_AS_STRING ")"
/** Code marking the start of a dict entry type in a type signature */
#define DBUS_DICT_ENTRY_BEGIN_CHAR ((int) '{')
/** #DBUS_DICT_ENTRY_BEGIN_CHAR as a string literal instead of a int literal */
#define DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{"
/** Code marking the end of a dict entry type in a type signature */
#define DBUS_DICT_ENTRY_END_CHAR ((int) '}')
/** #DBUS_DICT_ENTRY_END_CHAR as a string literal instead of a int literal */
#define DBUS_DICT_ENTRY_END_CHAR_AS_STRING "}"
/** Max length in bytes of a bus name, interface, or member (not object
* path, paths are unlimited). This is limited because lots of stuff
* is O(n) in this number, plus it would be obnoxious to type in a
* paragraph-long method name so most likely something like that would
* be an exploit.
*/
#define DBUS_MAXIMUM_NAME_LENGTH 255
/** This one is 255 so it fits in a byte */
#define DBUS_MAXIMUM_SIGNATURE_LENGTH 255
/** Max length of a match rule string; to keep people from hosing the
* daemon with some huge rule
*/
#define DBUS_MAXIMUM_MATCH_RULE_LENGTH 1024
/** Max arg number you can match on in a match rule, e.g.
* arg0='hello' is OK, arg3489720987='hello' is not
*/
#define DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER 63
/** Max length of a marshaled array in bytes (64M, 2^26) We use signed
* int for lengths so must be INT_MAX or less. We need something a
* bit smaller than INT_MAX because the array is inside a message with
* header info, etc. so an INT_MAX array wouldn't allow the message
* overhead. The 64M number is an attempt at a larger number than
* we'd reasonably ever use, but small enough that your bus would chew
* through it fairly quickly without locking up forever. If you have
* data that's likely to be larger than this, you should probably be
* sending it in multiple incremental messages anyhow.
*/
#define DBUS_MAXIMUM_ARRAY_LENGTH (67108864)
/** Number of bits you need in an unsigned to store the max array size */
#define DBUS_MAXIMUM_ARRAY_LENGTH_BITS 26
/** The maximum total message size including header and body; similar
* rationale to max array size.
*/
#define DBUS_MAXIMUM_MESSAGE_LENGTH (DBUS_MAXIMUM_ARRAY_LENGTH * 2)
/** Number of bits you need in an unsigned to store the max message size */
#define DBUS_MAXIMUM_MESSAGE_LENGTH_BITS 27
/** The maximum total number of unix fds in a message. Similar
* rationale as DBUS_MAXIMUM_MESSAGE_LENGTH. However we divide by four
* given that one fd is an int and hence at least 32 bits.
*/
#define DBUS_MAXIMUM_MESSAGE_UNIX_FDS (DBUS_MAXIMUM_MESSAGE_LENGTH/4)
/** Number of bits you need in an unsigned to store the max message unix fds */
#define DBUS_MAXIMUM_MESSAGE_UNIX_FDS_BITS (DBUS_MAXIMUM_MESSAGE_LENGTH_BITS-2)
/** Depth of recursion in the type tree. This is automatically limited
* to DBUS_MAXIMUM_SIGNATURE_LENGTH since you could only have an array
* of array of array of ... that fit in the max signature. But that's
* probably a bit too large.
*/
#define DBUS_MAXIMUM_TYPE_RECURSION_DEPTH 32
/* Types of message */
/** This value is never a valid message type, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_INVALID 0
/** Message type of a method call message, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_METHOD_CALL 1
/** Message type of a method return message, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_METHOD_RETURN 2
/** Message type of an error reply message, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_ERROR 3
/** Message type of a signal message, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_SIGNAL 4
#define DBUS_NUM_MESSAGE_TYPES 5
/* Header flags */
/** If set, this flag means that the sender of a message does not care about getting
* a reply, so the recipient need not send one. See dbus_message_set_no_reply().
*/
#define DBUS_HEADER_FLAG_NO_REPLY_EXPECTED 0x1
/**
* If set, this flag means that even if the message bus knows how to start an owner for
* the destination bus name (see dbus_message_set_destination()), it should not
* do so. If this flag is not set, the bus may launch a program to process the
* message.
*/
#define DBUS_HEADER_FLAG_NO_AUTO_START 0x2
/**
* If set on a method call, this flag means that the caller is prepared to
* wait for interactive authorization.
*/
#define DBUS_HEADER_FLAG_ALLOW_INTERACTIVE_AUTHORIZATION 0x4
/* Header fields */
/** Not equal to any valid header field code */
#define DBUS_HEADER_FIELD_INVALID 0
/** Header field code for the path - the path is the object emitting a signal or the object receiving a method call.
* See dbus_message_set_path().
*/
#define DBUS_HEADER_FIELD_PATH 1
/** Header field code for the interface containing a member (method or signal).
* See dbus_message_set_interface().
*/
#define DBUS_HEADER_FIELD_INTERFACE 2
/** Header field code for a member (method or signal). See dbus_message_set_member(). */
#define DBUS_HEADER_FIELD_MEMBER 3
/** Header field code for an error name (found in #DBUS_MESSAGE_TYPE_ERROR messages).
* See dbus_message_set_error_name().
*/
#define DBUS_HEADER_FIELD_ERROR_NAME 4
/** Header field code for a reply serial, used to match a #DBUS_MESSAGE_TYPE_METHOD_RETURN message with the
* message that it's a reply to. See dbus_message_set_reply_serial().
*/
#define DBUS_HEADER_FIELD_REPLY_SERIAL 5
/**
* Header field code for the destination bus name of a message. See dbus_message_set_destination().
*/
#define DBUS_HEADER_FIELD_DESTINATION 6
/**
* Header field code for the sender of a message; usually initialized by the message bus.
* See dbus_message_set_sender().
*/
#define DBUS_HEADER_FIELD_SENDER 7
/**
* Header field code for the type signature of a message.
*/
#define DBUS_HEADER_FIELD_SIGNATURE 8
/**
* Header field code for the number of unix file descriptors associated
* with this message.
*/
#define DBUS_HEADER_FIELD_UNIX_FDS 9
/**
* Header field code for the container instance that sent this message.
*/
#define DBUS_HEADER_FIELD_CONTAINER_INSTANCE 10
/**
* Value of the highest-numbered header field code, can be used to determine
* the size of an array indexed by header field code. Remember though
* that unknown codes must be ignored, so check for that before
* indexing the array.
*/
#define DBUS_HEADER_FIELD_LAST DBUS_HEADER_FIELD_CONTAINER_INSTANCE
/** Header format is defined as a signature:
* byte byte order
* byte message type ID
* byte flags
* byte protocol version
* uint32 body length
* uint32 serial
* array of struct (byte,variant) (field name, value)
*
* The length of the header can be computed as the
* fixed size of the initial data, plus the length of
* the array at the end, plus padding to an 8-boundary.
*/
#define DBUS_HEADER_SIGNATURE \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_UINT32_AS_STRING \
DBUS_TYPE_UINT32_AS_STRING \
DBUS_TYPE_ARRAY_AS_STRING \
DBUS_STRUCT_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_VARIANT_AS_STRING \
DBUS_STRUCT_END_CHAR_AS_STRING
/**
* The smallest header size that can occur. (It won't be valid due to
* missing required header fields.) This is 4 bytes, two uint32, an
* array length. This isn't any kind of resource limit, just the
* necessary/logical outcome of the header signature.
*/
#define DBUS_MINIMUM_HEADER_SIZE 16
/* Errors */
/* WARNING these get autoconverted to an enum in dbus-glib.h. Thus,
* if you change the order it breaks the ABI. Keep them in order.
* Also, don't change the formatting since that will break the sed
* script.
*/
/** A generic error; "something went wrong" - see the error message for more. */
#define DBUS_ERROR_FAILED "org.freedesktop.DBus.Error.Failed"
/** There was not enough memory to complete an operation. */
#define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory"
/** The bus doesn't know how to launch a service to supply the bus name you wanted. */
#define DBUS_ERROR_SERVICE_UNKNOWN "org.freedesktop.DBus.Error.ServiceUnknown"
/** The bus name you referenced doesn't exist (i.e. no application owns it). */
#define DBUS_ERROR_NAME_HAS_NO_OWNER "org.freedesktop.DBus.Error.NameHasNoOwner"
/** No reply to a message expecting one, usually means a timeout occurred. */
#define DBUS_ERROR_NO_REPLY "org.freedesktop.DBus.Error.NoReply"
/** Something went wrong reading or writing to a socket, for example. */
#define DBUS_ERROR_IO_ERROR "org.freedesktop.DBus.Error.IOError"
/** A D-Bus bus address was malformed. */
#define DBUS_ERROR_BAD_ADDRESS "org.freedesktop.DBus.Error.BadAddress"
/** Requested operation isn't supported (like ENOSYS on UNIX). */
#define DBUS_ERROR_NOT_SUPPORTED "org.freedesktop.DBus.Error.NotSupported"
/** Some limited resource is exhausted. */
#define DBUS_ERROR_LIMITS_EXCEEDED "org.freedesktop.DBus.Error.LimitsExceeded"
/** Security restrictions don't allow doing what you're trying to do. */
#define DBUS_ERROR_ACCESS_DENIED "org.freedesktop.DBus.Error.AccessDenied"
/** Authentication didn't work. */
#define DBUS_ERROR_AUTH_FAILED "org.freedesktop.DBus.Error.AuthFailed"
/** Unable to connect to server (probably caused by ECONNREFUSED on a socket). */
#define DBUS_ERROR_NO_SERVER "org.freedesktop.DBus.Error.NoServer"
/** Certain timeout errors, possibly ETIMEDOUT on a socket.
* Note that #DBUS_ERROR_NO_REPLY is used for message reply timeouts.
* @warning this is confusingly-named given that #DBUS_ERROR_TIMED_OUT also exists. We can't fix
* it for compatibility reasons so just be careful.
*/
#define DBUS_ERROR_TIMEOUT "org.freedesktop.DBus.Error.Timeout"
/** No network access (probably ENETUNREACH on a socket). */
#define DBUS_ERROR_NO_NETWORK "org.freedesktop.DBus.Error.NoNetwork"
/** Can't bind a socket since its address is in use (i.e. EADDRINUSE). */
#define DBUS_ERROR_ADDRESS_IN_USE "org.freedesktop.DBus.Error.AddressInUse"
/** The connection is disconnected and you're trying to use it. */
#define DBUS_ERROR_DISCONNECTED "org.freedesktop.DBus.Error.Disconnected"
/** Invalid arguments passed to a method call. */
#define DBUS_ERROR_INVALID_ARGS "org.freedesktop.DBus.Error.InvalidArgs"
/** Missing file. */
#define DBUS_ERROR_FILE_NOT_FOUND "org.freedesktop.DBus.Error.FileNotFound"
/** Existing file and the operation you're using does not silently overwrite. */
#define DBUS_ERROR_FILE_EXISTS "org.freedesktop.DBus.Error.FileExists"
/** Method name you invoked isn't known by the object you invoked it on. */
#define DBUS_ERROR_UNKNOWN_METHOD "org.freedesktop.DBus.Error.UnknownMethod"
/** Object you invoked a method on isn't known. */
#define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject"
/** Interface you invoked a method on isn't known by the object. */
#define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInterface"
/** Property you tried to access isn't known by the object. */
#define DBUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error.UnknownProperty"
/** Property you tried to set is read-only. */
#define DBUS_ERROR_PROPERTY_READ_ONLY "org.freedesktop.DBus.Error.PropertyReadOnly"
/** Certain timeout errors, e.g. while starting a service.
* @warning this is confusingly-named given that #DBUS_ERROR_TIMEOUT also exists. We can't fix
* it for compatibility reasons so just be careful.
*/
#define DBUS_ERROR_TIMED_OUT "org.freedesktop.DBus.Error.TimedOut"
/** Tried to remove or modify a match rule that didn't exist. */
#define DBUS_ERROR_MATCH_RULE_NOT_FOUND "org.freedesktop.DBus.Error.MatchRuleNotFound"
/** The match rule isn't syntactically valid. */
#define DBUS_ERROR_MATCH_RULE_INVALID "org.freedesktop.DBus.Error.MatchRuleInvalid"
/** While starting a new process, the exec() call failed. */
#define DBUS_ERROR_SPAWN_EXEC_FAILED "org.freedesktop.DBus.Error.Spawn.ExecFailed"
/** While starting a new process, the fork() call failed. */
#define DBUS_ERROR_SPAWN_FORK_FAILED "org.freedesktop.DBus.Error.Spawn.ForkFailed"
/** While starting a new process, the child exited with a status code. */
#define DBUS_ERROR_SPAWN_CHILD_EXITED "org.freedesktop.DBus.Error.Spawn.ChildExited"
/** While starting a new process, the child exited on a signal. */
#define DBUS_ERROR_SPAWN_CHILD_SIGNALED "org.freedesktop.DBus.Error.Spawn.ChildSignaled"
/** While starting a new process, something went wrong. */
#define DBUS_ERROR_SPAWN_FAILED "org.freedesktop.DBus.Error.Spawn.Failed"
/** We failed to setup the environment correctly. */
#define DBUS_ERROR_SPAWN_SETUP_FAILED "org.freedesktop.DBus.Error.Spawn.FailedToSetup"
/** We failed to setup the config parser correctly. */
#define DBUS_ERROR_SPAWN_CONFIG_INVALID "org.freedesktop.DBus.Error.Spawn.ConfigInvalid"
/** Bus name was not valid. */
#define DBUS_ERROR_SPAWN_SERVICE_INVALID "org.freedesktop.DBus.Error.Spawn.ServiceNotValid"
/** Service file not found in system-services directory. */
#define DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND "org.freedesktop.DBus.Error.Spawn.ServiceNotFound"
/** Permissions are incorrect on the setuid helper. */
#define DBUS_ERROR_SPAWN_PERMISSIONS_INVALID "org.freedesktop.DBus.Error.Spawn.PermissionsInvalid"
/** Service file invalid (Name, User or Exec missing). */
#define DBUS_ERROR_SPAWN_FILE_INVALID "org.freedesktop.DBus.Error.Spawn.FileInvalid"
/** There was not enough memory to complete the operation. */
#define DBUS_ERROR_SPAWN_NO_MEMORY "org.freedesktop.DBus.Error.Spawn.NoMemory"
/** Tried to get a UNIX process ID and it wasn't available. */
#define DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN "org.freedesktop.DBus.Error.UnixProcessIdUnknown"
/** A type signature is not valid. */
#define DBUS_ERROR_INVALID_SIGNATURE "org.freedesktop.DBus.Error.InvalidSignature"
/** A file contains invalid syntax or is otherwise broken. */
#define DBUS_ERROR_INVALID_FILE_CONTENT "org.freedesktop.DBus.Error.InvalidFileContent"
/** Asked for SELinux security context and it wasn't available. */
#define DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown"
/** Asked for ADT audit data and it wasn't available. */
#define DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN "org.freedesktop.DBus.Error.AdtAuditDataUnknown"
/** There's already an object with the requested object path. */
#define DBUS_ERROR_OBJECT_PATH_IN_USE "org.freedesktop.DBus.Error.ObjectPathInUse"
/** The message meta data does not match the payload. e.g. expected
number of file descriptors were not sent over the socket this message was received on. */
#define DBUS_ERROR_INCONSISTENT_MESSAGE "org.freedesktop.DBus.Error.InconsistentMessage"
/** The message is not allowed without performing interactive authorization,
* but could have succeeded if an interactive authorization step was
* allowed. */
#define DBUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED "org.freedesktop.DBus.Error.InteractiveAuthorizationRequired"
/** The connection is not from a container, or the specified container instance
* does not exist. */
#define DBUS_ERROR_NOT_CONTAINER "org.freedesktop.DBus.Error.NotContainer"
/* XML introspection format */
/** XML namespace of the introspection format version 1.0 */
#define DBUS_INTROSPECT_1_0_XML_NAMESPACE "http://www.freedesktop.org/standards/dbus"
/** XML public identifier of the introspection format version 1.0 */
#define DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
/** XML system identifier of the introspection format version 1.0 */
#define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
/** XML document type declaration of the introspection format version 1.0 */
#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "\"\n\"" DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "\">\n"
/** @} */
#ifdef __cplusplus
#if 0
{ /* avoids confusing emacs indentation */
#endif
}
#endif
#endif /* DBUS_PROTOCOL_H */

127
src/linux/vendor/dbus/dbus/dbus-server.h vendored Normal file
View File

@ -0,0 +1,127 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-server.h DBusServer object
*
* Copyright (C) 2002, 2003 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_SERVER_H
#define DBUS_SERVER_H
#include <dbus/dbus-errors.h>
#include <dbus/dbus-macros.h>
#include <dbus/dbus-message.h>
#include <dbus/dbus-connection.h>
#include <dbus/dbus-protocol.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusServer
* @{
*/
typedef struct DBusServer DBusServer;
/** Called when a new connection to the server is available. Must reference and save the new
* connection, or close the new connection. Set with dbus_server_set_new_connection_function().
*/
typedef void (* DBusNewConnectionFunction) (DBusServer *server,
DBusConnection *new_connection,
void *data);
DBUS_EXPORT
DBusServer* dbus_server_listen (const char *address,
DBusError *error);
DBUS_EXPORT
DBusServer* dbus_server_ref (DBusServer *server);
DBUS_EXPORT
void dbus_server_unref (DBusServer *server);
DBUS_EXPORT
void dbus_server_disconnect (DBusServer *server);
DBUS_EXPORT
dbus_bool_t dbus_server_get_is_connected (DBusServer *server);
DBUS_EXPORT
char* dbus_server_get_address (DBusServer *server);
DBUS_EXPORT
char* dbus_server_get_id (DBusServer *server);
DBUS_EXPORT
void dbus_server_set_new_connection_function (DBusServer *server,
DBusNewConnectionFunction function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
dbus_bool_t dbus_server_set_watch_functions (DBusServer *server,
DBusAddWatchFunction add_function,
DBusRemoveWatchFunction remove_function,
DBusWatchToggledFunction toggled_function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
dbus_bool_t dbus_server_set_timeout_functions (DBusServer *server,
DBusAddTimeoutFunction add_function,
DBusRemoveTimeoutFunction remove_function,
DBusTimeoutToggledFunction toggled_function,
void *data,
DBusFreeFunction free_data_function);
DBUS_EXPORT
dbus_bool_t dbus_server_set_auth_mechanisms (DBusServer *server,
const char **mechanisms);
DBUS_EXPORT
dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t *slot_p);
DBUS_EXPORT
void dbus_server_free_data_slot (dbus_int32_t *slot_p);
DBUS_EXPORT
dbus_bool_t dbus_server_set_data (DBusServer *server,
int slot,
void *data,
DBusFreeFunction free_data_func);
DBUS_EXPORT
void* dbus_server_get_data (DBusServer *server,
int slot);
/**
* Clear a variable or struct member that contains a #DBusServer.
* If it does not contain #NULL, the server that was previously
* there is unreferenced with dbus_server_unref().
*
* This is very similar to dbus_clear_connection(): see that function
* for more details.
*
* @param pointer_to_server A pointer to a variable or struct member.
* pointer_to_server must not be #NULL, but *pointer_to_server
* may be #NULL.
*/
static inline void
dbus_clear_server (DBusServer **pointer_to_server)
{
_dbus_clear_pointer_impl (DBusServer, pointer_to_server, dbus_server_unref);
}
/** @} */
DBUS_END_DECLS
#endif /* DBUS_SERVER_H */

138
src/linux/vendor/dbus/dbus/dbus-shared.h vendored Normal file
View File

@ -0,0 +1,138 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-shared.h Stuff used by both dbus/dbus.h low-level and C/C++ binding APIs
*
* Copyright (C) 2004 Red Hat, Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef DBUS_SHARED_H
#define DBUS_SHARED_H
/* Don't include anything in here from anywhere else. It's
* intended for use by any random library.
*/
#ifdef __cplusplus
extern "C" {
#if 0
} /* avoids confusing emacs indentation */
#endif
#endif
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusShared Shared constants
* @ingroup DBus
*
* @brief Shared header included by both libdbus and C/C++ bindings such as the GLib bindings.
*
* Usually a C/C++ binding such as the GLib or Qt binding won't want to include dbus.h in its
* public headers. However, a few constants and macros may be useful to include; those are
* found here and in dbus-protocol.h
*
* @{
*/
/**
* Well-known bus types. See dbus_bus_get().
*/
typedef enum
{
DBUS_BUS_SESSION, /**< The login session bus */
DBUS_BUS_SYSTEM, /**< The systemwide bus */
DBUS_BUS_STARTER /**< The bus that started us, if any */
} DBusBusType;
/**
* Results that a message handler can return.
*/
typedef enum
{
DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */
DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */
DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */
} DBusHandlerResult;
/* Bus names */
/** The bus name used to talk to the bus itself. */
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
/* Paths */
/** The object path used to talk to the bus itself. */
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
/** The object path used in local/in-process-generated messages. */
#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local"
/* Interfaces, these #define don't do much other than
* catch typos at compile time
*/
/** The interface exported by the object with #DBUS_SERVICE_DBUS and #DBUS_PATH_DBUS */
#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
/** The monitoring interface exported by the dbus-daemon */
#define DBUS_INTERFACE_MONITORING "org.freedesktop.DBus.Monitoring"
/** The verbose interface exported by the dbus-daemon */
#define DBUS_INTERFACE_VERBOSE "org.freedesktop.DBus.Verbose"
/** The interface supported by introspectable objects */
#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
/** The interface supported by objects with properties */
#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
/** The interface supported by most dbus peers */
#define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer"
/** This is a special interface whose methods can only be invoked
* by the local implementation (messages from remote apps aren't
* allowed to specify this interface).
*/
#define DBUS_INTERFACE_LOCAL "org.freedesktop.DBus.Local"
/* Owner flags */
#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
#define DBUS_NAME_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
#define DBUS_NAME_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
/* Replies to request for a name */
#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
#define DBUS_REQUEST_NAME_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
#define DBUS_REQUEST_NAME_REPLY_EXISTS 3 /**< Service is already in the queue */
#define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
/* Replies to releasing a name */
#define DBUS_RELEASE_NAME_REPLY_RELEASED 1 /**< Service was released from the given name */
#define DBUS_RELEASE_NAME_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
#define DBUS_RELEASE_NAME_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
/* Replies to service starts */
#define DBUS_START_REPLY_SUCCESS 1 /**< Service was auto started */
#define DBUS_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
/** @} */
#ifdef __cplusplus
#if 0
{ /* avoids confusing emacs indentation */
#endif
}
#endif
#endif /* DBUS_SHARED_H */

View File

@ -0,0 +1,97 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-signatures.h utility functions for D-Bus types
*
* Copyright (C) 2005 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_SIGNATURES_H
#define DBUS_SIGNATURES_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-errors.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusSignature
* @{
*/
/**
* DBusSignatureIter struct; contains no public fields
*/
typedef struct
{
void *dummy1; /**< Don't use this */
void *dummy2; /**< Don't use this */
dbus_uint32_t dummy8; /**< Don't use this */
int dummy12; /**< Don't use this */
int dummy17; /**< Don't use this */
} DBusSignatureIter;
DBUS_EXPORT
void dbus_signature_iter_init (DBusSignatureIter *iter,
const char *signature);
DBUS_EXPORT
int dbus_signature_iter_get_current_type (const DBusSignatureIter *iter);
DBUS_EXPORT
char * dbus_signature_iter_get_signature (const DBusSignatureIter *iter);
DBUS_EXPORT
int dbus_signature_iter_get_element_type (const DBusSignatureIter *iter);
DBUS_EXPORT
dbus_bool_t dbus_signature_iter_next (DBusSignatureIter *iter);
DBUS_EXPORT
void dbus_signature_iter_recurse (const DBusSignatureIter *iter,
DBusSignatureIter *subiter);
DBUS_EXPORT
dbus_bool_t dbus_signature_validate (const char *signature,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_signature_validate_single (const char *signature,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_type_is_valid (int typecode);
DBUS_EXPORT
dbus_bool_t dbus_type_is_basic (int typecode);
DBUS_EXPORT
dbus_bool_t dbus_type_is_container (int typecode);
DBUS_EXPORT
dbus_bool_t dbus_type_is_fixed (int typecode);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_SIGNATURE_H */

View File

@ -0,0 +1,60 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-syntax.h - utility functions for strings with special syntax
*
* Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Copyright © 2011 Nokia Corporation
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_SYNTAX_H
#define DBUS_SYNTAX_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-errors.h>
DBUS_BEGIN_DECLS
DBUS_EXPORT
dbus_bool_t dbus_validate_path (const char *path,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_validate_interface (const char *name,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_validate_member (const char *name,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_validate_error_name (const char *name,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_validate_bus_name (const char *name,
DBusError *error);
DBUS_EXPORT
dbus_bool_t dbus_validate_utf8 (const char *alleged_utf8,
DBusError *error);
DBUS_END_DECLS
#endif /* multiple-inclusion guard */

View File

@ -0,0 +1,191 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-threads.h D-Bus threads handling
*
* Copyright (C) 2002 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_THREADS_H
#define DBUS_THREADS_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusThreads
* @{
*/
/** An opaque mutex type provided by the #DBusThreadFunctions implementation installed by dbus_threads_init(). */
typedef struct DBusMutex DBusMutex;
/** An opaque condition variable type provided by the #DBusThreadFunctions implementation installed by dbus_threads_init(). */
typedef struct DBusCondVar DBusCondVar;
/** Deprecated, provide DBusRecursiveMutexNewFunction instead. */
typedef DBusMutex* (* DBusMutexNewFunction) (void);
/** Deprecated, provide DBusRecursiveMutexFreeFunction instead. */
typedef void (* DBusMutexFreeFunction) (DBusMutex *mutex);
/** Deprecated, provide DBusRecursiveMutexLockFunction instead. Return value is lock success, but gets ignored in practice. */
typedef dbus_bool_t (* DBusMutexLockFunction) (DBusMutex *mutex);
/** Deprecated, provide DBusRecursiveMutexUnlockFunction instead. Return value is unlock success, but gets ignored in practice. */
typedef dbus_bool_t (* DBusMutexUnlockFunction) (DBusMutex *mutex);
/** Creates a new recursively-lockable mutex, or returns #NULL if not
* enough memory. Can only fail due to lack of memory. Found in
* #DBusThreadFunctions. Do not just use PTHREAD_MUTEX_RECURSIVE for
* this, because it does not save/restore the recursion count when
* waiting on a condition. libdbus requires the Java-style behavior
* where the mutex is fully unlocked to wait on a condition.
*/
typedef DBusMutex* (* DBusRecursiveMutexNewFunction) (void);
/** Frees a recursively-lockable mutex. Found in #DBusThreadFunctions.
*/
typedef void (* DBusRecursiveMutexFreeFunction) (DBusMutex *mutex);
/** Locks a recursively-lockable mutex. Found in #DBusThreadFunctions.
* Can only fail due to lack of memory.
*/
typedef void (* DBusRecursiveMutexLockFunction) (DBusMutex *mutex);
/** Unlocks a recursively-lockable mutex. Found in #DBusThreadFunctions.
* Can only fail due to lack of memory.
*/
typedef void (* DBusRecursiveMutexUnlockFunction) (DBusMutex *mutex);
/** Creates a new condition variable. Found in #DBusThreadFunctions.
* Can only fail (returning #NULL) due to lack of memory.
*/
typedef DBusCondVar* (* DBusCondVarNewFunction) (void);
/** Frees a condition variable. Found in #DBusThreadFunctions.
*/
typedef void (* DBusCondVarFreeFunction) (DBusCondVar *cond);
/** Waits on a condition variable. Found in
* #DBusThreadFunctions. Must work with either a recursive or
* nonrecursive mutex, whichever the thread implementation
* provides. Note that PTHREAD_MUTEX_RECURSIVE does not work with
* condition variables (does not save/restore the recursion count) so
* don't try using simply pthread_cond_wait() and a
* PTHREAD_MUTEX_RECURSIVE to implement this, it won't work right.
*
* Has no error conditions. Must succeed if it returns.
*/
typedef void (* DBusCondVarWaitFunction) (DBusCondVar *cond,
DBusMutex *mutex);
/** Waits on a condition variable with a timeout. Found in
* #DBusThreadFunctions. Returns #TRUE if the wait did not
* time out, and #FALSE if it did.
*
* Has no error conditions. Must succeed if it returns.
*/
typedef dbus_bool_t (* DBusCondVarWaitTimeoutFunction) (DBusCondVar *cond,
DBusMutex *mutex,
int timeout_milliseconds);
/** Wakes one waiting thread on a condition variable. Found in #DBusThreadFunctions.
*
* Has no error conditions. Must succeed if it returns.
*/
typedef void (* DBusCondVarWakeOneFunction) (DBusCondVar *cond);
/** Wakes all waiting threads on a condition variable. Found in #DBusThreadFunctions.
*
* Has no error conditions. Must succeed if it returns.
*/
typedef void (* DBusCondVarWakeAllFunction) (DBusCondVar *cond);
/**
* Flags indicating which functions are present in #DBusThreadFunctions. Used to allow
* the library to detect older callers of dbus_threads_init() if new possible functions
* are added to #DBusThreadFunctions.
*/
typedef enum
{
DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK = 1 << 0,
DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK = 1 << 1,
DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK = 1 << 2,
DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK = 1 << 3,
DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK = 1 << 4,
DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK = 1 << 5,
DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK = 1 << 6,
DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK = 1 << 7,
DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK = 1 << 8,
DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK = 1 << 9,
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK = 1 << 10,
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK = 1 << 11,
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK = 1 << 12,
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK = 1 << 13,
DBUS_THREAD_FUNCTIONS_ALL_MASK = (1 << 14) - 1
} DBusThreadFunctionsMask;
/**
* Functions that must be implemented to make the D-Bus library
* thread-aware.
*
* If you supply both recursive and non-recursive mutexes,
* libdbus will use the non-recursive version for condition variables,
* and the recursive version in other contexts.
*
* The condition variable functions have to work with nonrecursive
* mutexes if you provide those, or with recursive mutexes if you
* don't.
*/
typedef struct
{
unsigned int mask; /**< Mask indicating which functions are present. */
DBusMutexNewFunction mutex_new; /**< Function to create a mutex; optional and deprecated. */
DBusMutexFreeFunction mutex_free; /**< Function to free a mutex; optional and deprecated. */
DBusMutexLockFunction mutex_lock; /**< Function to lock a mutex; optional and deprecated. */
DBusMutexUnlockFunction mutex_unlock; /**< Function to unlock a mutex; optional and deprecated. */
DBusCondVarNewFunction condvar_new; /**< Function to create a condition variable */
DBusCondVarFreeFunction condvar_free; /**< Function to free a condition variable */
DBusCondVarWaitFunction condvar_wait; /**< Function to wait on a condition */
DBusCondVarWaitTimeoutFunction condvar_wait_timeout; /**< Function to wait on a condition with a timeout */
DBusCondVarWakeOneFunction condvar_wake_one; /**< Function to wake one thread waiting on the condition */
DBusCondVarWakeAllFunction condvar_wake_all; /**< Function to wake all threads waiting on the condition */
DBusRecursiveMutexNewFunction recursive_mutex_new; /**< Function to create a recursive mutex */
DBusRecursiveMutexFreeFunction recursive_mutex_free; /**< Function to free a recursive mutex */
DBusRecursiveMutexLockFunction recursive_mutex_lock; /**< Function to lock a recursive mutex */
DBusRecursiveMutexUnlockFunction recursive_mutex_unlock; /**< Function to unlock a recursive mutex */
void (* padding1) (void); /**< Reserved for future expansion */
void (* padding2) (void); /**< Reserved for future expansion */
void (* padding3) (void); /**< Reserved for future expansion */
void (* padding4) (void); /**< Reserved for future expansion */
} DBusThreadFunctions;
DBUS_EXPORT
dbus_bool_t dbus_threads_init (const DBusThreadFunctions *functions);
DBUS_EXPORT
dbus_bool_t dbus_threads_init_default (void);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_THREADS_H */

179
src/linux/vendor/dbus/dbus/dbus-types.h vendored Normal file
View File

@ -0,0 +1,179 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-types.h types such as dbus_bool_t
*
* Copyright (C) 2002 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_TYPES_H
#define DBUS_TYPES_H
#include <stddef.h>
#include <dbus/dbus-arch-deps.h>
typedef dbus_uint32_t dbus_unichar_t;
/* boolean size must be fixed at 4 bytes due to wire protocol! */
typedef dbus_uint32_t dbus_bool_t;
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusTypes Basic types
* @ingroup DBus
* @brief dbus_bool_t, dbus_int32_t, etc.
*
* Typedefs for common primitive types.
*
* @{
*/
/**
* @typedef dbus_bool_t
*
* A boolean, valid values are #TRUE and #FALSE.
*/
/**
* @typedef dbus_uint32_t
*
* A 32-bit unsigned integer on all platforms.
*/
/**
* @typedef dbus_int32_t
*
* A 32-bit signed integer on all platforms.
*/
/**
* @typedef dbus_uint16_t
*
* A 16-bit unsigned integer on all platforms.
*/
/**
* @typedef dbus_int16_t
*
* A 16-bit signed integer on all platforms.
*/
/**
* @typedef dbus_uint64_t
*
* A 64-bit unsigned integer.
*/
/**
* @typedef dbus_int64_t
*
* A 64-bit signed integer.
*/
/**
* @def DBUS_HAVE_INT64
*
* Always defined.
*
* In older libdbus versions, this would be undefined if there was no
* 64-bit integer type on that platform. libdbus no longer supports
* such platforms.
*/
/**
* @def DBUS_INT64_CONSTANT
*
* Declare a 64-bit signed integer constant. The macro
* adds the necessary "LL" or whatever after the integer,
* giving a literal such as "325145246765LL"
*/
/**
* @def DBUS_UINT64_CONSTANT
*
* Declare a 64-bit unsigned integer constant. The macro
* adds the necessary "ULL" or whatever after the integer,
* giving a literal such as "325145246765ULL"
*/
/**
* @def DBUS_INT64_MODIFIER
*
* A string literal for a length modifier that is appropriate to print
* the #dbus_int64_t and #dbus_uint64_t types.
* For example, it might be an empty string, "l", "ll", or "I64".
*
* This modifier needs to be concatenated with a literal "%" and a
* conversion specifier that can print signed or unsigned integers,
* for example:
*
* @code
* dbus_int64_t i = -123;
* dbus_uint64_t u = 456;
*
* printf ("signed: %" DBUS_INT64_MODIFIER "d\n", i);
* printf ("unsigned decimal: %" DBUS_INT64_MODIFIER "u\n", u);
* printf ("unsigned hex: 0x%" DBUS_INT64_MODIFIER "x\n", x);
* @endcode
*/
/**
* An 8-byte struct you could use to access int64 without having
* int64 support. Use #dbus_int64_t or #dbus_uint64_t instead.
*/
typedef struct
{
dbus_uint32_t first32; /**< first 32 bits in the 8 bytes (beware endian issues) */
dbus_uint32_t second32; /**< second 32 bits in the 8 bytes (beware endian issues) */
} DBus8ByteStruct;
/**
* A simple value union that lets you access bytes as if they
* were various types; useful when dealing with basic types via
* void pointers and varargs.
*
* This union also contains a pointer member (which can be used
* to retrieve a string from dbus_message_iter_get_basic(), for
* instance), so on future platforms it could conceivably be larger
* than 8 bytes.
*/
typedef union
{
unsigned char bytes[8]; /**< as 8 individual bytes */
dbus_int16_t i16; /**< as int16 */
dbus_uint16_t u16; /**< as int16 */
dbus_int32_t i32; /**< as int32 */
dbus_uint32_t u32; /**< as int32 */
dbus_bool_t bool_val; /**< as boolean */
dbus_int64_t i64; /**< as int64 */
dbus_uint64_t u64; /**< as int64 */
DBus8ByteStruct eight; /**< as 8-byte struct */
double dbl; /**< as double */
unsigned char byt; /**< as byte */
char *str; /**< as char* (string, object path or signature) */
int fd; /**< as Unix file descriptor */
} DBusBasicValue;
/** @} */
#endif /* DBUS_TYPES_H */

106
src/linux/vendor/dbus/dbus/dbus.h vendored Normal file
View File

@ -0,0 +1,106 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus.h Convenience header including all other headers
*
* Copyright (C) 2002, 2003 Red Hat Inc.
*
* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef DBUS_H
#define DBUS_H
#define DBUS_INSIDE_DBUS_H 1
#include <dbus/dbus-arch-deps.h>
#include <dbus/dbus-address.h>
#include <dbus/dbus-bus.h>
#include <dbus/dbus-connection.h>
#include <dbus/dbus-errors.h>
#include <dbus/dbus-macros.h>
#include <dbus/dbus-message.h>
#include <dbus/dbus-misc.h>
#include <dbus/dbus-pending-call.h>
#include <dbus/dbus-protocol.h>
#include <dbus/dbus-server.h>
#include <dbus/dbus-shared.h>
#include <dbus/dbus-signature.h>
#include <dbus/dbus-syntax.h>
#include <dbus/dbus-threads.h>
#include <dbus/dbus-types.h>
#undef DBUS_INSIDE_DBUS_H
/**
* @defgroup DBus D-Bus low-level public API
* @brief The low-level public API of the D-Bus library
*
* libdbus provides a low-level C API intended primarily for use by
* bindings to specific object systems and languages. D-Bus is most
* convenient when used with the GLib bindings, Python bindings, Qt
* bindings, Mono bindings, and so forth. This low-level API has a
* lot of complexity useful only for bindings.
*
* @{
*/
/** @} */
/**
* @mainpage
*
* This manual documents the <em>low-level</em> D-Bus C API. <b>If you use
* this low-level API directly, you're signing up for some pain.</b>
*
* Caveats aside, you might get started learning the low-level API by reading
* about @ref DBusConnection and @ref DBusMessage.
*
* There are several other places to look for D-Bus information, such
* as the tutorial and the specification; those can be found at <a
* href="http://www.freedesktop.org/wiki/Software/dbus">the D-Bus
* website</a>. If you're interested in a sysadmin or package
* maintainer's perspective on the dbus-daemon itself and its
* configuration, be sure to check out the man pages as well.
*
* The low-level API documented in this manual deliberately lacks
* most convenience functions - those are left up to higher-level libraries
* based on frameworks such as GLib, Qt, Python, Mono, Java,
* etc. These higher-level libraries (often called "D-Bus bindings")
* have features such as object systems and main loops that allow a
* <em>much</em> more convenient API.
*
* The low-level API also contains plenty of clutter to support
* integration with arbitrary object systems, languages, main loops,
* and so forth. These features add a lot of noise to the API that you
* probably don't care about unless you're coding a binding.
*
* This manual also contains docs for @ref DBusInternals "D-Bus internals",
* so you can use it to get oriented to the D-Bus source code if you're
* interested in patching the code. You should also read the
* file CONTRIBUTING.md which comes with the source code if you plan to
* contribute to D-Bus.
*
* As you read the code, you can identify internal D-Bus functions
* because they start with an underscore ('_') character. Also, any
* identifier or macro that lacks a DBus, dbus_, or DBUS_ namepace
* prefix is internal, with a couple of exceptions such as #NULL,
* #TRUE, and #FALSE.
*/
#endif /* DBUS_H */

View File

@ -24,7 +24,13 @@
"stable/xdg-shell/xdg-shell.xml": "protocols/xml/xdg-shell.xml",
"unstable/xdg-decoration/xdg-decoration-unstable-v1.xml": "protocols/xml/xdg-decoration-unstable-v1.xml",
"stable/viewporter/viewporter.xml": "protocols/xml/viewporter.xml",
"staging/fractional-scale/fractional-scale-v1.xml": "protocols/xml/fractional-scale-v1.xml"
"staging/fractional-scale/fractional-scale-v1.xml": "protocols/xml/fractional-scale-v1.xml",
"staging/cursor-shape/cursor-shape-v1.xml": "protocols/xml/cursor-shape-v1.xml",
"stable/tablet/tablet-v2.xml": "protocols/xml/tablet-v2.xml",
"unstable/text-input/text-input-unstable-v3.xml": "protocols/xml/text-input-unstable-v3.xml",
"unstable/xdg-foreign/xdg-foreign-unstable-v2.xml": "protocols/xml/xdg-foreign-unstable-v2.xml",
"staging/xdg-activation/xdg-activation-v1.xml": "protocols/xml/xdg-activation-v1.xml",
"staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml": "protocols/xml/xdg-toplevel-icon-v1.xml"
}
},
{
@ -51,6 +57,45 @@
"url": "https://www.apache.org/licenses/LICENSE-2.0.txt",
"sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
"destination": "vendor/khronos/LICENSE-2.0.txt"
},
{
"url": "https://github.com/xkbcommon/libxkbcommon/archive/refs/tags/xkbcommon-1.11.0.tar.gz",
"sha256": "78a6b14f16e9a55025978c252e53ce9e16a02bfdb929550b9a0db5af87db7e02",
"prefix": "libxkbcommon-xkbcommon-1.11.0/",
"files": {
"include/xkbcommon/xkbcommon.h": "vendor/xkbcommon/xkbcommon.h",
"include/xkbcommon/xkbcommon-names.h": "vendor/xkbcommon/xkbcommon-names.h",
"include/xkbcommon/xkbcommon-keysyms.h": "vendor/xkbcommon/xkbcommon-keysyms.h",
"include/xkbcommon/xkbcommon-compose.h": "vendor/xkbcommon/xkbcommon-compose.h",
"LICENSE": "vendor/xkbcommon/LICENSE",
"include/xkbcommon/xkbcommon-compat.h": "vendor/xkbcommon/xkbcommon-compat.h"
}
},
{
"url": "https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz",
"sha256": "0ba2a1a4b16afe7bceb2c07e9ce99a8c2c3508e5dec290dbb643384bd6beb7e2",
"prefix": "dbus-1.16.2/",
"files": {
"COPYING": "vendor/dbus/COPYING",
"dbus/dbus.h": "vendor/dbus/dbus/dbus.h",
"dbus/dbus-types.h": "vendor/dbus/dbus/dbus-types.h",
"dbus/dbus-arch-deps.h.in": "vendor/dbus/dbus/dbus-arch-deps.h.in",
"dbus/dbus-macros.h": "vendor/dbus/dbus/dbus-macros.h",
"dbus/dbus-threads.h": "vendor/dbus/dbus/dbus-threads.h",
"dbus/dbus-syntax.h": "vendor/dbus/dbus/dbus-syntax.h",
"dbus/dbus-errors.h": "vendor/dbus/dbus/dbus-errors.h",
"dbus/dbus-protocol.h": "vendor/dbus/dbus/dbus-protocol.h",
"dbus/dbus-signature.h": "vendor/dbus/dbus/dbus-signature.h",
"dbus/dbus-shared.h": "vendor/dbus/dbus/dbus-shared.h",
"dbus/dbus-server.h": "vendor/dbus/dbus/dbus-server.h",
"dbus/dbus-connection.h": "vendor/dbus/dbus/dbus-connection.h",
"dbus/dbus-message.h": "vendor/dbus/dbus/dbus-message.h",
"dbus/dbus-memory.h": "vendor/dbus/dbus/dbus-memory.h",
"dbus/dbus-pending-call.h": "vendor/dbus/dbus/dbus-pending-call.h",
"dbus/dbus-misc.h": "vendor/dbus/dbus/dbus-misc.h",
"dbus/dbus-bus.h": "vendor/dbus/dbus/dbus-bus.h",
"dbus/dbus-address.h": "vendor/dbus/dbus/dbus-address.h"
}
}
],
"files": {
@ -70,20 +115,64 @@
"vendor/khronos/EGL/eglplatform.h": "25b5391655effcf363a38fa00c3154f356a3eab3d35dc067847875513cf1e441",
"vendor/khronos/KHR/khrplatform.h": "7b1e01aaa7ad8f6fc34b5c7bdf79ebf5189bb09e2c4d2e79fc5d350623d11e83",
"vendor/wayland/wayland-client.h": "e9dd1fb014aa6ad848cb7d241cc223b1a70fc0b17fed5997262024e4c05532f7",
"vendor/khronos/LICENSE-2.0.txt": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
"vendor/khronos/LICENSE-2.0.txt": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
"vendor/xkbcommon/xkbcommon.h": "9f2d729a0a5a0aac5bd2e229c2be8346823ca90342b0f87cc9132ff2816a6b74",
"vendor/xkbcommon/xkbcommon-names.h": "a5b0ed01c8b1816da8b5ed29cf776eb2ad1f707cf03ff74e62e36a5ca9009f61",
"vendor/xkbcommon/xkbcommon-keysyms.h": "e854c5a8edd8da610e51404f6b09c741027089701c386bdd9bdf5ce851a585a1",
"vendor/xkbcommon/xkbcommon-compose.h": "e6facb4fc280991d15679dd3e5d06af8decdbb6d1eeaaea729642990502c57fe",
"vendor/xkbcommon/LICENSE": "967e97b28658f0037bbe164a237bdfb0c3ec790e67f6c29372ea5b09306f61f3",
"vendor/dbus/COPYING": "150e5d08e1cb5e62b65967d7931acad2c42d98ec1bbb584bebb01921cbc853c2",
"vendor/dbus/dbus/dbus.h": "56ff456922bf6df191958a291fc5d6d66f39b82b156bc2d715ef87add155cea5",
"vendor/dbus/dbus/dbus-types.h": "0228e51763888e7319f0b8c862f0ee928e3079340408512f7e4a594e1eeae48d",
"vendor/dbus/dbus/dbus-arch-deps.h.in": "ecbce7c0446c22e0ce4d4bf2641f2aa6419e721a6c9c1ccbb41b800028334265",
"vendor/dbus/dbus/dbus-macros.h": "78fc922e402466c826145dbfe31d2ae87682ef2df6233d436dc3399552f6362f",
"vendor/dbus/dbus/dbus-threads.h": "16c10fafae90e9aaeaf0506f41432bfa389dfdf333115f8934680d88d83ae12d",
"vendor/dbus/dbus/dbus-syntax.h": "200170d6ee508b6daa8a17dc9b804a0a35fa555d8d8c8768258edd75dd36cd43",
"vendor/dbus/dbus/dbus-errors.h": "00292ccbbc3d30603c293122155151fd21aa26aa0adbc8333972440544f37ded",
"vendor/dbus/dbus/dbus-protocol.h": "533fd55283662d1c013792a29e9993e31babe20d5a5dfedae2c4b8e8bebafc6a",
"vendor/dbus/dbus/dbus-signature.h": "13a10246dee6a378899c88a9ac37e0eb618a1f91766fc27de0053309e6aac941",
"vendor/dbus/dbus/dbus-shared.h": "97ed7edf5baf42bdee4d5777d63158599667078499ca1b0360ccedb013d3531c",
"vendor/dbus/dbus/dbus-server.h": "f63bbd5503d13b1486b66a76cc9f289e19ff46d7b3c5f39df9953af3e6df0323",
"vendor/dbus/dbus/dbus-connection.h": "f9496c07830e44fbda1668328b40c78527251c99e62919c80af479631ff794bf",
"vendor/dbus/dbus/dbus-message.h": "2dd354759e49fad23f25b3b85e73d9e6d4ad0034c08828af1d5f7226971f66d6",
"vendor/dbus/dbus/dbus-memory.h": "7e0487d09e88e705bd166432e3d581aafe2e90c5654224505b73c56ae8d8cf2f",
"vendor/dbus/dbus/dbus-pending-call.h": "0aee41fe9624a284935fee0d4b572a313f83230ac31bdead59dff96309b7d1e0",
"vendor/dbus/dbus/dbus-misc.h": "6ff2e2f874f55a6b4738aea905ee413d814fec320b48ffd7f30a2df3237894aa",
"vendor/dbus/dbus/dbus-bus.h": "c50a3f89fab412a98544d98a1c94dc07ad5b540ebbf63e63105877039ff2f374",
"vendor/dbus/dbus/dbus-address.h": "5a6834badb73f871acaaea7f03f6497f50e958232a1dbe64f1f098e56c4557ce",
"protocols/xml/cursor-shape-v1.xml": "bb57d91e53a79dadab7c612dab87c233393cee73673feefa7442cfbfdd9aed2f",
"protocols/xml/tablet-v2.xml": "3ea2783210086dfddef3994fec974f46a00cf175c06efdd8ea47c3007f812a80",
"protocols/xml/text-input-unstable-v3.xml": "2d08f2cddb463e169c23f1c34769de12ae255540e51ee8f515b54667d60b90ba",
"protocols/xml/xdg-foreign-unstable-v2.xml": "625d83fbb068f48e69e739eafde507f10cdfe7480146f3ac10af9a2ddf551c80",
"protocols/xml/xdg-activation-v1.xml": "d8418be2d5738d50aff788bef1c7574f33f26659aa045447ff2ef9b78c58fe01",
"protocols/xml/xdg-toplevel-icon-v1.xml": "791dbfed89280c1b8031689955a03e9b2da55601be3c5854a6198e38cea4978f",
"vendor/xkbcommon/xkbcommon-compat.h": "fb0384a704897c0dcfcc49f021ad38fadbbedc3307d5390f4f0d1019e3d1a4d9"
},
"generated": {
"protocols/generated/cursor-shape-v1.c": "6027922a5c0a8e0d70ee6948e32aa8231b23cd3f82d323875186b29d36881f78",
"protocols/generated/cursor-shape-v1.h": "87edf9719e935db05a0f5545e20d8bdf67f2c2557676f9d1e697b83cc98d6529",
"protocols/generated/dbus/dbus-arch-deps.h": "87a896df22f7b5e6ec5367cc9b3ed7c77c65b54405a50fd3c7133cd4c6fc3281",
"protocols/generated/fractional-scale-v1.c": "fb40e729ee05acafe996d1261367424b47722be02dbee65c90b3f4972f259dca",
"protocols/generated/fractional-scale-v1.h": "9243e57b2ce11317f6aaa2cd76c0a9f999fb54ced38b880d81891a6ee5dd27df",
"protocols/generated/private-symbols.h": "e66e9c2dd9608df352bf1dc53c6d244225018557844f5ec9c9ae258ea47e3521",
"protocols/generated/private-symbols.h": "93778cae319dc148bd51ec6ec9725f89735c8a9ccf937f9c52ae45b6768cc02d",
"protocols/generated/tablet-v2.c": "6ce7899f31da919e1f04a8bd44038df5095b58a98b1178f9aa0a84d0835424c0",
"protocols/generated/tablet-v2.h": "eff5398428ff21523ae6c745d57081f3bd5c18509c4bf5b18de75d89d58d18cd",
"protocols/generated/text-input-unstable-v3.c": "5de60647b6e122860802d59b547632d4bcf838a443cebeb04429bbb17b5c971b",
"protocols/generated/text-input-unstable-v3.h": "051057bc8292414f82c46fb854455616fd212cfffb95222aa5af1e2e2cde3067",
"protocols/generated/viewporter.c": "ee3b669764240a69b4436e8cc7cb2e4d42dc872752df3f34df98851bbcb51d11",
"protocols/generated/viewporter.h": "dbb68745babf07d3d5587b3f3b83a7cb46848f03885bde4b9cd5e71d19114458",
"protocols/generated/wayland-client-protocol.h": "3643fd6aca2f52abcb92a125a0f659c3697268435608a7d3a54e0b614e150f83",
"protocols/generated/wayland-version.h": "9ba722d91f4ae3f2820757785f66247868571bc7014f7a679a22f729daaac79f",
"protocols/generated/wayland.c": "9a3a273b8d007ff2f40906d36734034a0967a67796965d46e0a5873ff0045315",
"protocols/generated/xdg-activation-v1.c": "6cb4f16e1cf504c86f5424c7b9f80c5bd41e446552c34c575808848ac4086c16",
"protocols/generated/xdg-activation-v1.h": "c7d669611bcbdd68fea255c102a91f7a686cdb53f58bcbf2b97473edf2221a26",
"protocols/generated/xdg-decoration-unstable-v1.c": "a6cafd5ed52a70e30eacc91e6e230eb8cbed6a6cf790cdcb732acb7e19e51579",
"protocols/generated/xdg-decoration-unstable-v1.h": "fa1d17dbdfad9e13f35a0d807906926a054edb18cef836cc39063a586d5f6dd4",
"protocols/generated/xdg-foreign-unstable-v2.c": "8f9da32a90206a500a8bf5ea1414f19be5422aa729b3ed0e5eb373a89af15b7c",
"protocols/generated/xdg-foreign-unstable-v2.h": "f384a4e83ce05ccdc0101cb3bb98b8a36496d6c5a34d921a4b448b14d07e0761",
"protocols/generated/xdg-shell.c": "7788ec2e1e8774e4f069d361c450048ccb7e907a204d4ca2d74a64fab7bf7be5",
"protocols/generated/xdg-shell.h": "4b472982e483e37f9e28a1b655aabb5718a6e6a54023dac90fee45bad316ecc9"
"protocols/generated/xdg-shell.h": "4b472982e483e37f9e28a1b655aabb5718a6e6a54023dac90fee45bad316ecc9",
"protocols/generated/xdg-toplevel-icon-v1.c": "f6947ef5b94fa2eeae192b857287d676d6c8bfc094594bd2d9bdf8a56b28babc",
"protocols/generated/xdg-toplevel-icon-v1.h": "aa7939d3a1b64c280dd73ed5a4d765a838175fbf6e4ef6eada6750c4826e22b6"
}
}

279
src/linux/vendor/xkbcommon/LICENSE vendored Normal file
View File

@ -0,0 +1,279 @@
The following is a list of all copyright notices and license statements which
appear in the xkbcommon source tree, along with the SPDX short license
identifiers which source files use to refer to them. To see which parts are
covered by which license and copyright, refer to the source files.
If making new contributions, the MIT License is vastly preferred.
All licenses are derivative of the MIT/X11 license, mostly identical other
than no-endorsement clauses (e.g. paragraph 4 of The Open Group's license).
These statements are split into two sections: one for the code compiled and
distributed as part of the libxkbcommon shared library and the code component
of all tests, and another only for the test data under test/data, which is
distributed with the xkbcommon source code, but not installed to the system.
BEGINNING OF SOFTWARE COPYRIGHT/LICENSE STATEMENTS:
-------------------------------------------------------------------------------
SPDX full name: MIT License
SPDX short identifier: MIT
License text:
Copyright © 2008-2009 Dan Nicholson <dbn.lists@gmail.com>
Copyright © 2009-2012, 2016 Daniel Stone <daniel@fooishbar.org>
Copyright © 2012-2014, 2020-2022, 2025 Ran Benita <ran@unusedvar.com>
Copyright © 2010-2012, 2016 Intel Corporation
Copyright © 2013-2015, 2018-2020 Red Hat, Inc.
Copyright © 2023-2024 Pierre Le Marre <dev@wismill.eu>
Copyright (c) 1991, Oracle and/or its affiliates.
Copyright © 2008-2011 Kristian Høgsberg
Copyright © 2010 Francisco Jerez <currojerez@riseup.net>
Copyright © 2012 Collabora, Ltd.
Copyright © 2015 Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
Copyright (C) 2011 Joseph Adams <joeyadams3.14159@gmail.com>
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.
-------------------------------------------------------------------------------
SPDX full name: MIT Open Group variant
SPDX short identifier: MIT-open-group
License text:
Copyright 1985, 1987, 1988, 1990, 1998 The Open Group
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 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 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.
Except as contained in this notice, the names of the authors or their
institutions shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization from the authors.
-------------------------------------------------------------------------------
SPDX full name: Historical Permission Notice and Disclaimer
SPDX short identifier: HPND
License text:
Copyright (c) 1993, 1994, 1995, 1996 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, 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 Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS 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.
-------------------------------------------------------------------------------
SPDX full name: Historical Permission Notice and Disclaimer - sell variant
SPDX short identifier: HPND-sell-variant
License text:
Copyright 1992 by Oki Technosystems Laboratory, Inc.
Copyright 1992 by Fuji Xerox Co., Ltd.
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation, and that the name of Oki Technosystems
Laboratory and Fuji Xerox not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
Oki Technosystems Laboratory and Fuji Xerox make no representations
about the suitability of this software for any purpose. It is provided
"as is" without express or implied warranty.
OKI TECHNOSYSTEMS LABORATORY AND FUJI XEROX DISCLAIM ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OKI TECHNOSYSTEMS
LABORATORY AND FUJI XEROX 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.
-------------------------------------------------------------------------------
SPDX full name: <none>
SPDX short identifier: LicenseRef-digital-equipment-corporation
License text:
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
-------------------------------------------------------------------------------
END OF SOFTWARE COPYRIGHT/LICENSE STATEMENTS
BEGINNING OF LICENSE STATEMENTS ONLY FOR UNDISTRIBUTED DATA FILES IN test/data,
derived from xkeyboard-config and libX11 nls/ directory:
-------------------------------------------------------------------------------
SPDX full name: Historical Permission Notice and Disclaimer - sell variant
SPDX short identifier: HPND-sell-variant
Copyright 1996 by Joseph Moss
Copyright (C) 2002-2007 Free Software Foundation, Inc.
Copyright (C) Dmitry Golubev <lastguru@mail.ru>, 2003-2004
Copyright (C) 2004, Gregory Mokhin <mokhin@bog.msu.ru>
Copyright (C) 2006 Erdal Ronahî
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 holder(s) not be used in
advertising or publicity pertaining to distribution of the software without
specific, written prior permission. The copyright holder(s) makes no
representations about the suitability of this software for any purpose. It
is provided "as is" without express or implied warranty.
THE COPYRIGHT HOLDER(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL THE COPYRIGHT HOLDER(S) 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.
-------------------------------------------------------------------------------
SPDX full name: MIT License
SPDX short identifier: MIT
Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
-------------------------------------------------------------------------------
SPDX full name: X11 License
SPDX short identifier: X11
License text:
Copyright (c) 1996 X Consortium
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 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 X CONSORTIUM 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.
Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.
-------------------------------------------------------------------------------
SPDX full name: MIT Open Group variant
SPDX short identifier: MIT-open-group
Copyright (C) 2004, 2006 Ævar Arnfjörð Bjarmason <avarab@gmail.com>
-------------------------------------------------------------------------------
SPDX full name: <none>
SPDX short identifier: MIT-open-group
SPDX short identifier: LicenseRef-anton-zinoviev
License text:
Copyright (C) 1999, 2000 by Anton Zinoviev <anton@lml.bas.bg>
This software may be used, modified, copied, distributed, and sold,
in both source and binary form provided that the above copyright
and these terms are retained. Under no circumstances is the author
responsible for the proper functioning of this software, nor does
the author assume any responsibility for damages incurred with its
use.
Permission is granted to anyone to use, distribute and modify
this file in any way, provided that the above copyright notice
is left intact and the author of the modification summarizes
the changes in this header.
This file is distributed without any expressed or implied warranty.

View File

@ -0,0 +1,80 @@
/*
* Copyright © 2012 Daniel Stone
* SPDX-License-Identifier: MIT
*
* Author: Daniel Stone <daniel@fooishbar.org>
*/
#ifndef _XKBCOMMON_COMPAT_H
#define _XKBCOMMON_COMPAT_H
/**
* Renamed keymap API.
*/
#define xkb_group_index_t xkb_layout_index_t
#define xkb_group_mask_t xkb_layout_mask_t
#define xkb_map_compile_flags xkb_keymap_compile_flags
#define XKB_GROUP_INVALID XKB_LAYOUT_INVALID
#define XKB_STATE_DEPRESSED \
(XKB_STATE_MODS_DEPRESSED | XKB_STATE_LAYOUT_DEPRESSED)
#define XKB_STATE_LATCHED \
(XKB_STATE_MODS_LATCHED | XKB_STATE_LAYOUT_LATCHED)
#define XKB_STATE_LOCKED \
(XKB_STATE_MODS_LOCKED | XKB_STATE_LAYOUT_LOCKED)
#define XKB_STATE_EFFECTIVE \
(XKB_STATE_DEPRESSED | XKB_STATE_LATCHED | XKB_STATE_LOCKED | \
XKB_STATE_MODS_EFFECTIVE | XKB_STATE_LAYOUT_EFFECTIVE)
#define xkb_map_new_from_names(context, names, flags) \
xkb_keymap_new_from_names(context, names, flags)
#define xkb_map_new_from_file(context, file, format, flags) \
xkb_keymap_new_from_file(context, file, format, flags)
#define xkb_map_new_from_string(context, string, format, flags) \
xkb_keymap_new_from_string(context, string, format, flags)
#define xkb_map_get_as_string(keymap) \
xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1)
#define xkb_map_ref(keymap) xkb_keymap_ref(keymap)
#define xkb_map_unref(keymap) xkb_keymap_unref(keymap)
#define xkb_map_num_mods(keymap) xkb_keymap_num_mods(keymap)
#define xkb_map_mod_get_name(keymap, idx) xkb_keymap_mod_get_name(keymap, idx)
#define xkb_map_mod_get_index(keymap, str) xkb_keymap_mod_get_index(keymap, str)
#define xkb_key_mod_index_is_consumed(state, key, mod) \
xkb_state_mod_index_is_consumed(state, key, mod)
#define xkb_key_mod_mask_remove_consumed(state, key, modmask) \
xkb_state_mod_mask_remove_consumed(state, key, modmask)
#define xkb_map_num_groups(keymap) xkb_keymap_num_layouts(keymap)
#define xkb_key_num_groups(keymap, key) \
xkb_keymap_num_layouts_for_key(keymap, key)
#define xkb_map_group_get_name(keymap, idx) \
xkb_keymap_layout_get_name(keymap, idx)
#define xkb_map_group_get_index(keymap, str) \
xkb_keymap_layout_get_index(keymap, str)
#define xkb_map_num_leds(keymap) xkb_keymap_num_leds(keymap)
#define xkb_map_led_get_name(keymap, idx) xkb_keymap_led_get_name(keymap, idx)
#define xkb_map_led_get_index(keymap, str) \
xkb_keymap_led_get_index(keymap, str)
#define xkb_key_repeats(keymap, key) xkb_keymap_key_repeats(keymap, key)
#define xkb_key_get_syms(state, key, syms_out) \
xkb_state_key_get_syms(state, key, syms_out)
#define xkb_state_group_name_is_active(state, name, type) \
xkb_state_layout_name_is_active(state, name, type)
#define xkb_state_group_index_is_active(state, idx, type) \
xkb_state_layout_index_is_active(state, idx, type)
#define xkb_state_serialize_group(state, component) \
xkb_state_serialize_layout(state, component)
#define xkb_state_get_map(state) xkb_state_get_keymap(state)
/* Not needed anymore, since there's NO_FLAGS. */
#define XKB_MAP_COMPILE_PLACEHOLDER XKB_KEYMAP_COMPILE_NO_FLAGS
#define XKB_MAP_COMPILE_NO_FLAGS XKB_KEYMAP_COMPILE_NO_FLAGS
#endif

View File

@ -0,0 +1,617 @@
/*
* Copyright © 2013 Ran Benita
* SPDX-License-Identifier: MIT
*/
#ifndef _XKBCOMMON_COMPOSE_H
#define _XKBCOMMON_COMPOSE_H
#include <xkbcommon/xkbcommon.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @file
* libxkbcommon Compose API - support for Compose and dead-keys.
*/
/**
* @defgroup compose Compose and dead-keys support
* Support for Compose and dead-keys.
* @since 0.5.0
*
* @{
*/
/**
* @page compose-overview Overview
* @parblock
*
* Compose and dead-keys are a common feature of many keyboard input
* systems. They extend the range of the keysyms that can be produced
* directly from a keyboard by using a sequence of key strokes, instead
* of just one.
*
* Here are some example sequences, in the libX11 Compose file format:
*
* <dead_acute> <a> : "á" aacute # LATIN SMALL LETTER A WITH ACUTE
* <Multi_key> <A> <T> : "@" at # COMMERCIAL AT
*
* When the user presses a key which produces the `<dead_acute>` keysym,
* nothing initially happens (thus the key is dubbed a *dead-key*). But
* when the user enters `<a>`, “á” is *composed*, in place of “a”. If
* instead the user had entered a keysym which does not follow
* `<dead_acute>` in any compose sequence, the sequence is said to be
* *cancelled*.
*
* Compose files define many such sequences. For a description of the
* common file format for Compose files, see the `Compose(5)` man page.
*
* A successfully-composed sequence has two results: a keysym and a UTF-8
* string. At least one of the two is defined for each sequence. If only
* a keysym is given, the keysym’s string representation is used for the
* result string (using xkb_keysym_to_utf8()).
*
* This library provides low-level support for Compose file parsing and
* processing. Higher-level APIs (such as libX11’s `Xutf8LookupString(3)`)
* may be built upon it, or it can be used directly.
*
* @endparblock
*/
/**
* @page compose-conflicting Conflicting Sequences
* @parblock
*
* To avoid ambiguity, a sequence is not allowed to be a prefix of another.
* When such a conflict occurs, the sequence defined last is the one retained.
*
* Sequences of length 1 are allowed.
*
* @endparblock
*/
/**
* @page compose-cancellation Cancellation Behavior
* @parblock
*
* What should happen when a sequence is cancelled? For example, consider
* there are only the above sequences, and the input keysyms are
* `<dead_acute> <b>`. There are a few approaches:
*
* 1. Swallow the cancelling keysym; that is, no keysym is produced.
* This is the approach taken by libX11.
* 2. Let the cancelling keysym through; that is, `<b>` is produced.
* 3. Replay the entire sequence; that is, `<dead_acute> <b>` is produced.
* This is the approach taken by Microsoft Windows (approximately;
* instead of `<dead_acute>`, the underlying key is used. This is
* difficult to simulate with XKB keymaps).
*
* You can program whichever approach best fits users' expectations.
*
* @endparblock
*/
/**
* @struct xkb_compose_table
* Opaque Compose table object.
*
* The compose table holds the definitions of the Compose sequences, as
* gathered from Compose files. It is immutable.
*/
struct xkb_compose_table;
/**
* @struct xkb_compose_state
* Opaque Compose state object.
*
* The compose state maintains state for compose sequence matching, such
* as which possible sequences are being matched, and the position within
* these sequences. It acts as a simple state machine wherein keysyms are
* the input, and composed keysyms and strings are the output.
*
* The compose state is usually associated with a keyboard device.
*/
struct xkb_compose_state;
/** Flags affecting Compose file compilation. */
enum xkb_compose_compile_flags {
/** Do not apply any flags. */
XKB_COMPOSE_COMPILE_NO_FLAGS = 0
};
/** The recognized Compose file formats. */
enum xkb_compose_format {
/** The classic libX11 Compose text format, described in Compose(5). */
XKB_COMPOSE_FORMAT_TEXT_V1 = 1
};
/**
* @page compose-locale Compose Locale
* @parblock
*
* Compose files are locale dependent:
* - Compose files are written for a locale, and the locale is used when
* searching for the appropriate file to use.
* - Compose files may reference the locale internally, with directives
* such as `%%L`.
*
* As such, functions like `xkb_compose_table::xkb_compose_table_new_from_locale()`
* require a `locale` parameter. This will usually be the current locale (see
* `locale(7)` for more details). You may also want to allow the user to
* explicitly configure it, so he can use the Compose file of a given
* locale, but not use that locale for other things.
*
* You may query the current locale as follows:
*
* ```c
* const char *locale;
* locale = setlocale(LC_CTYPE, NULL);
* ```
*
* This will only give useful results if the program had previously set
* the current locale using setlocale(3), with `LC_CTYPE` or `LC_ALL`
* and a non-`NULL` argument.
*
* If you prefer not to use the locale system of the C runtime library,
* you may nevertheless obtain the user’s locale directly using
* environment variables, as described in `locale(7)`. For example,
*
* ```c
* const char *locale;
* locale = getenv("LC_ALL");
* if (!locale || !*locale)
* locale = getenv("LC_CTYPE");
* if (!locale || !*locale)
* locale = getenv("LANG");
* if (!locale || !*locale)
* locale = "C";
* ```
*
* Note that some locales supported by the C standard library may not
* have a Compose file assigned.
*
* @endparblock
*/
/**
* Create a compose table for a given locale.
*
* The locale is used for searching the file-system for an appropriate
* Compose file. The search order is described in Compose(5). It is
* affected by the following environment variables:
*
* 1. `XCOMPOSEFILE` - see Compose(5).
* 2. `XDG_CONFIG_HOME` - before `$HOME/.XCompose` is checked,
* `$XDG_CONFIG_HOME/XCompose` is checked (with a fall back to
* `$HOME/.config/XCompose` if `XDG_CONFIG_HOME` is not defined).
* This is a libxkbcommon extension to the search procedure in
* Compose(5) (since libxkbcommon 1.0.0). Note that other
* implementations, such as libX11, might not find a Compose file in
* this path.
* 3. `HOME` - see Compose(5).
* 4. `XLOCALEDIR` - if set, used as the base directory for the system’s
* X locale files, e.g. `/usr/share/X11/locale`, instead of the
* preconfigured directory.
*
* @param context
* The library context in which to create the compose table.
* @param locale
* The current locale. See @ref compose-locale.
* \n
* The value is copied, so it is safe to pass the result of `getenv(3)`
* (or similar) without fear of it being invalidated by a subsequent
* `setenv(3)` (or similar).
* @param flags
* Optional flags for the compose table, or 0.
*
* @returns A compose table for the given locale, or `NULL` if the
* compilation failed or a Compose file was not found.
*
* @memberof xkb_compose_table
*/
XKB_EXPORT struct xkb_compose_table *
xkb_compose_table_new_from_locale(struct xkb_context *context,
const char *locale,
enum xkb_compose_compile_flags flags);
/**
* Create a new compose table from a Compose file.
*
* @param context
* The library context in which to create the compose table.
* @param file
* The Compose file to compile.
* @param locale
* The current locale. See @ref compose-locale.
* @param format
* The text format of the Compose file to compile.
* @param flags
* Optional flags for the compose table, or 0.
*
* @returns A compose table compiled from the given file, or `NULL` if
* the compilation failed.
*
* @memberof xkb_compose_table
*/
XKB_EXPORT struct xkb_compose_table *
xkb_compose_table_new_from_file(struct xkb_context *context,
FILE *file,
const char *locale,
enum xkb_compose_format format,
enum xkb_compose_compile_flags flags);
/**
* Create a new compose table from a memory buffer.
*
* This is just like xkb_compose_table_new_from_file(), but instead of
* a file, gets the table as one enormous string.
*
* @see xkb_compose_table_new_from_file()
* @memberof xkb_compose_table
*/
XKB_EXPORT struct xkb_compose_table *
xkb_compose_table_new_from_buffer(struct xkb_context *context,
const char *buffer, size_t length,
const char *locale,
enum xkb_compose_format format,
enum xkb_compose_compile_flags flags);
/**
* Take a new reference on a compose table.
*
* @returns The passed in object.
*
* @memberof xkb_compose_table
*/
XKB_EXPORT struct xkb_compose_table *
xkb_compose_table_ref(struct xkb_compose_table *table);
/**
* Release a reference on a compose table, and possibly free it.
*
* @param table The object. If it is `NULL`, this function does nothing.
*
* @memberof xkb_compose_table
*/
XKB_EXPORT void
xkb_compose_table_unref(struct xkb_compose_table *table);
/**
* @struct xkb_compose_table_entry
* Opaque Compose table entry object.
*
* Represents a single entry in a Compose file in the iteration API.
* It is immutable.
*
* @sa xkb_compose_table_iterator_new
* @since 1.6.0
*/
struct xkb_compose_table_entry;
/**
* Get the left-hand keysym sequence of a Compose table entry.
*
* For example, given the following entry:
*
* ```
* <dead_tilde> <space> : "~" asciitilde # TILDE
* ```
*
* it will return `{XKB_KEY_dead_tilde, XKB_KEY_space}`.
*
* @param[in] entry The compose table entry object to process.
*
* @param[out] sequence_length Number of keysyms in the sequence.
*
* @returns The array of left-hand side keysyms. The number of keysyms
* is returned in the @p sequence_length out-parameter.
*
* @memberof xkb_compose_table_entry
* @since 1.6.0
*/
XKB_EXPORT const xkb_keysym_t *
xkb_compose_table_entry_sequence(struct xkb_compose_table_entry *entry,
size_t *sequence_length);
/**
* Get the right-hand result keysym of a Compose table entry.
*
* For example, given the following entry:
*
* ```
* <dead_tilde> <space> : "~" asciitilde # TILDE
* ```
*
* it will return `XKB_KEY_asciitilde`.
*
* The keysym is optional; if the entry does not specify a keysym,
* returns `XKB_KEY_NoSymbol`.
*
* @memberof xkb_compose_table_entry
* @since 1.6.0
*/
XKB_EXPORT xkb_keysym_t
xkb_compose_table_entry_keysym(struct xkb_compose_table_entry *entry);
/**
* Get the right-hand result string of a Compose table entry.
*
* The string is UTF-8 encoded and `NULL`-terminated.
*
* For example, given the following entry:
*
* ```
* <dead_tilde> <space> : "~" asciitilde # TILDE
* ```
*
* it will return `"~"`.
*
* The string is optional; if the entry does not specify a string,
* returns the empty string.
*
* @memberof xkb_compose_table_entry
* @since 1.6.0
*/
XKB_EXPORT const char *
xkb_compose_table_entry_utf8(struct xkb_compose_table_entry *entry);
/**
* @struct xkb_compose_table_iterator
* Iterator over a compose table’s entries.
*
* @sa xkb_compose_table_iterator_new()
* @since 1.6.0
*/
struct xkb_compose_table_iterator;
/**
* Create a new iterator for a compose table.
*
* Intended use:
*
* ```c
* struct xkb_compose_table_iterator *iter = xkb_compose_table_iterator_new(compose_table);
* struct xkb_compose_table_entry *entry;
* while ((entry = xkb_compose_table_iterator_next(iter))) {
* // ...
* }
* xkb_compose_table_iterator_free(iter);
* ```
*
* @returns A new compose table iterator, or `NULL` on failure.
*
* @memberof xkb_compose_table_iterator
* @sa xkb_compose_table_iterator_free()
* @since 1.6.0
*/
XKB_EXPORT struct xkb_compose_table_iterator *
xkb_compose_table_iterator_new(struct xkb_compose_table *table);
/**
* Free a compose iterator.
*
* @memberof xkb_compose_table_iterator
* @since 1.6.0
*/
XKB_EXPORT void
xkb_compose_table_iterator_free(struct xkb_compose_table_iterator *iter);
/**
* Get the next compose entry from a compose table iterator.
*
* The entries are returned in lexicographic order of the left-hand
* side of entries. This does not correspond to the order in which
* the entries appear in the Compose file.
*
* @attention The return value is valid until the next call to this function.
*
* Returns `NULL` in case there is no more entries.
*
* @memberof xkb_compose_table_iterator
* @since 1.6.0
*/
XKB_EXPORT struct xkb_compose_table_entry *
xkb_compose_table_iterator_next(struct xkb_compose_table_iterator *iter);
/** Flags for compose state creation. */
enum xkb_compose_state_flags {
/** Do not apply any flags. */
XKB_COMPOSE_STATE_NO_FLAGS = 0
};
/**
* Create a new compose state object.
*
* @param table
* The compose table the state will use.
* @param flags
* Optional flags for the compose state, or 0.
*
* @returns A new compose state, or `NULL` on failure.
*
* @memberof xkb_compose_state
*/
XKB_EXPORT struct xkb_compose_state *
xkb_compose_state_new(struct xkb_compose_table *table,
enum xkb_compose_state_flags flags);
/**
* Take a new reference on a compose state object.
*
* @returns The passed in object.
*
* @memberof xkb_compose_state
*/
XKB_EXPORT struct xkb_compose_state *
xkb_compose_state_ref(struct xkb_compose_state *state);
/**
* Release a reference on a compose state object, and possibly free it.
*
* @param state The object. If `NULL`, do nothing.
*
* @memberof xkb_compose_state
*/
XKB_EXPORT void
xkb_compose_state_unref(struct xkb_compose_state *state);
/**
* Get the compose table which a compose state object is using.
*
* @returns The compose table which was passed to xkb_compose_state_new()
* when creating this state object.
*
* This function does not take a new reference on the compose table; you
* must explicitly reference it yourself if you plan to use it beyond the
* lifetime of the state.
*
* @memberof xkb_compose_state
*/
XKB_EXPORT struct xkb_compose_table *
xkb_compose_state_get_compose_table(struct xkb_compose_state *state);
/** Status of the Compose sequence state machine. */
enum xkb_compose_status {
/** The initial state; no sequence has started yet. */
XKB_COMPOSE_NOTHING,
/** In the middle of a sequence. */
XKB_COMPOSE_COMPOSING,
/** A complete sequence has been matched. */
XKB_COMPOSE_COMPOSED,
/** The last sequence was cancelled due to an unmatched keysym. */
XKB_COMPOSE_CANCELLED
};
/** The effect of a keysym fed to xkb_compose_state_feed(). */
enum xkb_compose_feed_result {
/** The keysym had no effect - it did not affect the status. */
XKB_COMPOSE_FEED_IGNORED,
/** The keysym started, advanced or cancelled a sequence. */
XKB_COMPOSE_FEED_ACCEPTED
};
/**
* Feed one keysym to the Compose sequence state machine.
*
* This function can advance into a compose sequence, cancel a sequence,
* start a new sequence, or do nothing in particular. The resulting
* status may be observed with `xkb_compose_state_get_status()`.
*
* Some keysyms, such as keysyms for modifier keys, are ignored - they
* have no effect on the status or otherwise.
*
* The following is a description of the possible status transitions, in
* the format CURRENT STATUS => NEXT STATUS, given a non-ignored input
* keysym `keysym`:
*
@verbatim
NOTHING or CANCELLED or COMPOSED =>
NOTHING if keysym does not start a sequence.
COMPOSING if keysym starts a sequence.
COMPOSED if keysym starts and terminates a single-keysym sequence.
COMPOSING =>
COMPOSING if keysym advances any of the currently possible
sequences but does not terminate any of them.
COMPOSED if keysym terminates one of the currently possible
sequences.
CANCELLED if keysym does not advance any of the currently
possible sequences.
@endverbatim
*
* The current Compose formats do not support multiple-keysyms. Therefore, if
* you are using a function such as `xkb_state::xkb_state_key_get_syms()`
* and it returns more than one keysym, consider feeding `XKB_KEY_NoSymbol`
* instead.
*
* @param state
* The compose state object.
* @param keysym
* A keysym, usually obtained after a key-press event, with a
* function such as `xkb_state::xkb_state_key_get_one_sym()`.
*
* @returns Whether the keysym was ignored. This is useful, for example,
* if you want to keep a record of the sequence matched thus far.
*
* @memberof xkb_compose_state
*/
XKB_EXPORT enum xkb_compose_feed_result
xkb_compose_state_feed(struct xkb_compose_state *state,
xkb_keysym_t keysym);
/**
* Reset the Compose sequence state machine.
*
* The status is set to `::XKB_COMPOSE_NOTHING`, and the current sequence
* is discarded.
*
* @memberof xkb_compose_state
*/
XKB_EXPORT void
xkb_compose_state_reset(struct xkb_compose_state *state);
/**
* Get the current status of the compose state machine.
*
* @see xkb_compose_status
* @memberof xkb_compose_state
**/
XKB_EXPORT enum xkb_compose_status
xkb_compose_state_get_status(struct xkb_compose_state *state);
/**
* Get the result Unicode/UTF-8 string for a composed sequence.
*
* See @ref compose-overview for more details. This function is only
* useful when the status is `::XKB_COMPOSE_COMPOSED`.
*
* @param[in] state
* The compose state.
* @param[out] buffer
* A buffer to write the string into.
* @param[in] size
* Size of the buffer.
*
* @warning If the buffer passed is too small, the string is truncated
* (though still `NULL`-terminated).
*
* @returns
* The number of bytes required for the string, excluding the `NULL` byte.
* If the sequence is not complete, or does not have a viable result
* string, returns 0, and sets `buffer` to the empty string (if possible).
* @returns
* You may check if truncation has occurred by comparing the return value
* with the size of `buffer`, similarly to the `snprintf(3)` function.
* You may safely pass `NULL` and 0 to `buffer` and `size` to find the
* required size (without the `NULL`-byte).
*
* @memberof xkb_compose_state
**/
XKB_EXPORT int
xkb_compose_state_get_utf8(struct xkb_compose_state *state,
char *buffer, size_t size);
/**
* Get the result keysym for a composed sequence.
*
* See @ref compose-overview for more details. This function is only
* useful when the status is `::XKB_COMPOSE_COMPOSED`.
*
* @returns The result keysym. If the sequence is not complete, or does
* not specify a result keysym, returns `XKB_KEY_NoSymbol`.
*
* @memberof xkb_compose_state
**/
XKB_EXPORT xkb_keysym_t
xkb_compose_state_get_one_sym(struct xkb_compose_state *state);
/** @} */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _XKBCOMMON_COMPOSE_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,144 @@
/*
* Copyright © 2012 Intel Corporation
* SPDX-License-Identifier: MIT
*
* Author: Daniel Stone <daniel@fooishbar.org>
*/
#ifndef _XKBCOMMON_NAMES_H
#define _XKBCOMMON_NAMES_H
/**
* @file
* @brief Predefined names for common modifiers and LEDs.
*/
/**
* @defgroup modifier-names Predefined names for common modifiers and LEDs
*
* @{
*/
/**
* @defgroup real-modifier-names Real modifiers names
*
* [*Real* modifiers][real modifier] names are hardcoded in libxkbcommon.
*
* [real modifier]: @ref real-modifier-def
*
* @{
*/
#define XKB_MOD_NAME_SHIFT "Shift"
#define XKB_MOD_NAME_CAPS "Lock"
#define XKB_MOD_NAME_CTRL "Control"
#define XKB_MOD_NAME_MOD1 "Mod1"
#define XKB_MOD_NAME_MOD2 "Mod2"
#define XKB_MOD_NAME_MOD3 "Mod3"
#define XKB_MOD_NAME_MOD4 "Mod4"
#define XKB_MOD_NAME_MOD5 "Mod5"
/** @} */
/**
* @defgroup virtual-modifier-names Virtual modifiers names
*
* Common [*virtual* modifiers][virtual modifiers], encoded in [xkeyboard-config]
* in the [compat] and [symbols] files. They have been stable since the beginning
* of the project and are unlikely to ever change.
*
* [virtual modifiers]: @ref virtual-modifier-def
* [xkeyboard-config]: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config
* [compat]: @ref the-xkb_compat-section
* [symbols]: @ref the-xkb_symbols-section
*
* @{
*/
/** @since 1.8.0 */
#define XKB_VMOD_NAME_ALT "Alt"
/** @since 1.8.0 */
#define XKB_VMOD_NAME_HYPER "Hyper"
/** @since 1.8.0 */
#define XKB_VMOD_NAME_LEVEL3 "LevelThree"
/** @since 1.8.0 */
#define XKB_VMOD_NAME_LEVEL5 "LevelFive"
/** @since 1.8.0 */
#define XKB_VMOD_NAME_META "Meta"
/** @since 1.8.0 */
#define XKB_VMOD_NAME_NUM "NumLock"
/** @since 1.8.0 */
#define XKB_VMOD_NAME_SCROLL "ScrollLock"
/** @since 1.8.0 */
#define XKB_VMOD_NAME_SUPER "Super"
/** @} */
/**
* @defgroup legacy-virtual-modifier-names Legacy virtual modifier names
*
* Usual [*virtual* modifiers][virtual modifiers] mappings to
* [*real* modifiers][real modifiers].
*
* @deprecated Use @ref virtual-modifier-names instead
*
* [virtual modifiers]: @ref virtual-modifier-def
* [real modifiers]: @ref real-modifier-def
*
* @{
*/
/**
* Usual [*real* modifier][real modifier] for the
* [*virtual* modifier][virtual modifier] `Alt`.
*
* @deprecated Use `::XKB_VMOD_NAME_ALT` instead.
* @since 1.10: deprecated
*
* [virtual modifier]: @ref virtual-modifier-def
* [real modifier]: @ref real-modifier-def
*/
#define XKB_MOD_NAME_ALT "Mod1"
/**
* Usual [*real* modifier][real modifier] for the
* [*virtual* modifier][virtual modifier] `Super`.
*
* @deprecated Use `::XKB_VMOD_NAME_SUPER` instead.
* @since 1.10: deprecated
*
* [virtual modifier]: @ref virtual-modifier-def
* [real modifier]: @ref real-modifier-def
*/
#define XKB_MOD_NAME_LOGO "Mod4"
/**
* Usual [*real* modifier][real modifier] for the
* [*virtual* modifier][virtual modifier] `NumLock`.
*
* @deprecated Use `::XKB_VMOD_NAME_NUM` instead.
* @since 1.10: deprecated
*
* [virtual modifier]: @ref virtual-modifier-def
* [real modifier]: @ref real-modifier-def
*/
#define XKB_MOD_NAME_NUM "Mod2"
/** @} */
/**
* @defgroup led-names LEDs names
*
* LEDs names are encoded in [xkeyboard-config], in the [keycodes] and [compat]
* files. They have been stable since the beginning of the project and are
* unlikely to ever change.
*
* [xkeyboard-config]: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config
* [keycodes]: @ref the-xkb_keycodes-section
* [compat]: @ref the-xkb_compat-section
*
* @{
*/
#define XKB_LED_NAME_NUM "Num Lock"
#define XKB_LED_NAME_CAPS "Caps Lock"
#define XKB_LED_NAME_SCROLL "Scroll Lock"
/** @since 1.8.0 */
#define XKB_LED_NAME_COMPOSE "Compose"
#define XKB_LED_NAME_KANA "Kana"
/** @} */
/** @} */
#endif

2514
src/linux/vendor/xkbcommon/xkbcommon.h vendored Normal file

File diff suppressed because it is too large Load Diff