generate Wayland protocol stubs at build time
This commit is contained in:
parent
f5b7cb7ec5
commit
0f296d50d6
9 changed files with 69 additions and 6197 deletions
|
|
@ -19,6 +19,13 @@ meson compile -C build
|
|||
|
||||
The resulting binary is `build/tabbed-wlroots`.
|
||||
|
||||
The Wayland protocol stubs (`xdg-shell`, `xdg-decoration`,
|
||||
`wlr-data-control-unstable-v1`) are not committed; they are generated into
|
||||
the build directory by `wayland-scanner` from the system
|
||||
`wayland-protocols` (and the bundled `wlr-data-control-unstable-v1.xml`), so
|
||||
they always match the installed protocol headers. This adds no extra
|
||||
dependency beyond what the wlroots fallback already requires.
|
||||
|
||||
### Debian / Ubuntu
|
||||
|
||||
```sh
|
||||
|
|
|
|||
69
meson.build
69
meson.build
|
|
@ -38,17 +38,72 @@ if libm.found()
|
|||
deps += libm
|
||||
endif
|
||||
|
||||
# --- Wayland protocol stubs -------------------------------------------
|
||||
# The protocol implementation and headers are generated at build time by
|
||||
# wayland-scanner instead of being committed, so they always match the
|
||||
# installed wayland-protocols (the previously committed copies were produced
|
||||
# by wayland-scanner 1.24/1.26 and drifted apart). Outputs land in the build
|
||||
# directory, which Meson adds to every target's include path automatically;
|
||||
# that also satisfies the bundled wlroots subproject's wlr_xdg_shell.h and its
|
||||
# quoted #include "xdg-shell-protocol.h".
|
||||
|
||||
wayland_protocols = dependency('wayland-protocols', version: '>=1.17',
|
||||
fallback: 'wayland-protocols', default_options: ['tests=false'])
|
||||
wl_protocols_dir = wayland_protocols.get_variable('pkgdatadir')
|
||||
|
||||
wayland_scanner_dep = dependency('wayland-scanner', native: true)
|
||||
wayland_scanner = find_program(
|
||||
wayland_scanner_dep.get_variable('wayland_scanner'))
|
||||
|
||||
# (input xml, output base name). The output base names keep the committed
|
||||
# suffixes: xdg-decoration is the unstable-v1 protocol but is still named
|
||||
# plain "xdg-decoration" because the sources #include those exact names.
|
||||
protocols = {
|
||||
'xdg-shell': [
|
||||
wl_protocols_dir / 'stable/xdg-shell/xdg-shell.xml',
|
||||
'xdg-shell',
|
||||
],
|
||||
'xdg-decoration': [
|
||||
wl_protocols_dir / 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml',
|
||||
'xdg-decoration',
|
||||
],
|
||||
'wlr-data-control-unstable-v1': [
|
||||
'wlr-protocols/wlr-data-control-unstable-v1.xml',
|
||||
'wlr-data-control',
|
||||
],
|
||||
}
|
||||
|
||||
protocol_sources = []
|
||||
protocol_headers = []
|
||||
foreach protocol, p : protocols
|
||||
xml = p[0]
|
||||
base = p[1]
|
||||
protocol_sources += custom_target(protocol + ' protocol code',
|
||||
input: xml,
|
||||
output: base + '-protocol.c',
|
||||
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'])
|
||||
protocol_headers += custom_target(protocol + ' client header',
|
||||
input: xml,
|
||||
output: base + '-client.h',
|
||||
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
|
||||
if protocol == 'xdg-shell'
|
||||
protocol_headers += custom_target(protocol + ' server header',
|
||||
input: xml,
|
||||
output: base + '-protocol.h',
|
||||
command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'])
|
||||
endif
|
||||
endforeach
|
||||
|
||||
executable('tabbed-wlroots',
|
||||
'tabbed-wlroots.c',
|
||||
'xdg-shell-protocol.c',
|
||||
'xdg-decoration-protocol.c',
|
||||
'wlr-data-control-protocol.c',
|
||||
protocol_sources,
|
||||
protocol_headers,
|
||||
dependencies: deps,
|
||||
include_directories: include_directories('wlr-protocols'),
|
||||
c_args: ['-DWLR_USE_UNSTABLE'])
|
||||
|
||||
# wltest needs only the xdg-shell stub (protocol_sources/headers[0]).
|
||||
executable('wltest',
|
||||
'tests/wltest.c',
|
||||
'xdg-shell-protocol.c',
|
||||
dependencies: dependency('wayland-client'),
|
||||
include_directories: include_directories('.'))
|
||||
protocol_sources[0],
|
||||
protocol_headers[0],
|
||||
dependencies: dependency('wayland-client'))
|
||||
|
|
|
|||
|
|
@ -1,665 +0,0 @@
|
|||
/* Generated by wayland-scanner 1.26.0 */
|
||||
|
||||
#ifndef WLR_DATA_CONTROL_UNSTABLE_V1_CLIENT_PROTOCOL_H
|
||||
#define WLR_DATA_CONTROL_UNSTABLE_V1_CLIENT_PROTOCOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "wayland-client.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @page page_wlr_data_control_unstable_v1 The wlr_data_control_unstable_v1 protocol
|
||||
* control data devices
|
||||
*
|
||||
* @section page_desc_wlr_data_control_unstable_v1 Description
|
||||
*
|
||||
* This protocol allows a privileged client to control data devices. In
|
||||
* particular, the client will be able to manage the current selection and take
|
||||
* the role of a clipboard manager.
|
||||
*
|
||||
* 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_wlr_data_control_unstable_v1 Interfaces
|
||||
* - @subpage page_iface_zwlr_data_control_manager_v1 - manager to control data devices
|
||||
* - @subpage page_iface_zwlr_data_control_device_v1 - manage a data device for a seat
|
||||
* - @subpage page_iface_zwlr_data_control_source_v1 - offer to transfer data
|
||||
* - @subpage page_iface_zwlr_data_control_offer_v1 - offer to transfer data
|
||||
* @section page_copyright_wlr_data_control_unstable_v1 Copyright
|
||||
* <pre>
|
||||
*
|
||||
* Copyright © 2018 Simon Ser
|
||||
* Copyright © 2019 Ivan Molodetskikh
|
||||
*
|
||||
* 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 zwlr_data_control_device_v1;
|
||||
struct zwlr_data_control_manager_v1;
|
||||
struct zwlr_data_control_offer_v1;
|
||||
struct zwlr_data_control_source_v1;
|
||||
|
||||
#ifndef ZWLR_DATA_CONTROL_MANAGER_V1_INTERFACE
|
||||
#define ZWLR_DATA_CONTROL_MANAGER_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_zwlr_data_control_manager_v1 zwlr_data_control_manager_v1
|
||||
* @section page_iface_zwlr_data_control_manager_v1_desc Description
|
||||
*
|
||||
* This interface is a manager that allows creating per-seat data device
|
||||
* controls.
|
||||
* @section page_iface_zwlr_data_control_manager_v1_api API
|
||||
* See @ref iface_zwlr_data_control_manager_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_zwlr_data_control_manager_v1 The zwlr_data_control_manager_v1 interface
|
||||
*
|
||||
* This interface is a manager that allows creating per-seat data device
|
||||
* controls.
|
||||
*/
|
||||
extern const struct wl_interface zwlr_data_control_manager_v1_interface;
|
||||
#endif
|
||||
#ifndef ZWLR_DATA_CONTROL_DEVICE_V1_INTERFACE
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_zwlr_data_control_device_v1 zwlr_data_control_device_v1
|
||||
* @section page_iface_zwlr_data_control_device_v1_desc Description
|
||||
*
|
||||
* This interface allows a client to manage a seat's selection.
|
||||
*
|
||||
* When the seat is destroyed, this object becomes inert.
|
||||
* @section page_iface_zwlr_data_control_device_v1_api API
|
||||
* See @ref iface_zwlr_data_control_device_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_zwlr_data_control_device_v1 The zwlr_data_control_device_v1 interface
|
||||
*
|
||||
* This interface allows a client to manage a seat's selection.
|
||||
*
|
||||
* When the seat is destroyed, this object becomes inert.
|
||||
*/
|
||||
extern const struct wl_interface zwlr_data_control_device_v1_interface;
|
||||
#endif
|
||||
#ifndef ZWLR_DATA_CONTROL_SOURCE_V1_INTERFACE
|
||||
#define ZWLR_DATA_CONTROL_SOURCE_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_zwlr_data_control_source_v1 zwlr_data_control_source_v1
|
||||
* @section page_iface_zwlr_data_control_source_v1_desc Description
|
||||
*
|
||||
* The wlr_data_control_source object is the source side of a
|
||||
* wlr_data_control_offer. It is created by the source client in a data
|
||||
* transfer and provides a way to describe the offered data and a way to
|
||||
* respond to requests to transfer the data.
|
||||
* @section page_iface_zwlr_data_control_source_v1_api API
|
||||
* See @ref iface_zwlr_data_control_source_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_zwlr_data_control_source_v1 The zwlr_data_control_source_v1 interface
|
||||
*
|
||||
* The wlr_data_control_source object is the source side of a
|
||||
* wlr_data_control_offer. It is created by the source client in a data
|
||||
* transfer and provides a way to describe the offered data and a way to
|
||||
* respond to requests to transfer the data.
|
||||
*/
|
||||
extern const struct wl_interface zwlr_data_control_source_v1_interface;
|
||||
#endif
|
||||
#ifndef ZWLR_DATA_CONTROL_OFFER_V1_INTERFACE
|
||||
#define ZWLR_DATA_CONTROL_OFFER_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_zwlr_data_control_offer_v1 zwlr_data_control_offer_v1
|
||||
* @section page_iface_zwlr_data_control_offer_v1_desc Description
|
||||
*
|
||||
* A wlr_data_control_offer represents a piece of data offered for transfer
|
||||
* by another client (the source client). The offer describes the different
|
||||
* MIME types that the data can be converted to and provides the mechanism
|
||||
* for transferring the data directly from the source client.
|
||||
* @section page_iface_zwlr_data_control_offer_v1_api API
|
||||
* See @ref iface_zwlr_data_control_offer_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_zwlr_data_control_offer_v1 The zwlr_data_control_offer_v1 interface
|
||||
*
|
||||
* A wlr_data_control_offer represents a piece of data offered for transfer
|
||||
* by another client (the source client). The offer describes the different
|
||||
* MIME types that the data can be converted to and provides the mechanism
|
||||
* for transferring the data directly from the source client.
|
||||
*/
|
||||
extern const struct wl_interface zwlr_data_control_offer_v1_interface;
|
||||
#endif
|
||||
|
||||
#define ZWLR_DATA_CONTROL_MANAGER_V1_CREATE_DATA_SOURCE 0
|
||||
#define ZWLR_DATA_CONTROL_MANAGER_V1_GET_DATA_DEVICE 1
|
||||
#define ZWLR_DATA_CONTROL_MANAGER_V1_DESTROY 2
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_manager_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_MANAGER_V1_CREATE_DATA_SOURCE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_manager_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_MANAGER_V1_GET_DATA_DEVICE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_manager_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_MANAGER_V1_DESTROY_SINCE_VERSION 1
|
||||
|
||||
/** @ingroup iface_zwlr_data_control_manager_v1 */
|
||||
static inline void
|
||||
zwlr_data_control_manager_v1_set_user_data(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1, void *user_data)
|
||||
{
|
||||
wl_proxy_set_user_data((struct wl_proxy *) zwlr_data_control_manager_v1, user_data);
|
||||
}
|
||||
|
||||
/** @ingroup iface_zwlr_data_control_manager_v1 */
|
||||
static inline void *
|
||||
zwlr_data_control_manager_v1_get_user_data(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1)
|
||||
{
|
||||
return wl_proxy_get_user_data((struct wl_proxy *) zwlr_data_control_manager_v1);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
zwlr_data_control_manager_v1_get_version(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1)
|
||||
{
|
||||
return wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_manager_v1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_manager_v1
|
||||
*
|
||||
* Create a new data source.
|
||||
*/
|
||||
static inline struct zwlr_data_control_source_v1 *
|
||||
zwlr_data_control_manager_v1_create_data_source(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1)
|
||||
{
|
||||
struct wl_proxy *id;
|
||||
|
||||
id = wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_manager_v1,
|
||||
ZWLR_DATA_CONTROL_MANAGER_V1_CREATE_DATA_SOURCE, &zwlr_data_control_source_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_manager_v1), 0, NULL);
|
||||
|
||||
return (struct zwlr_data_control_source_v1 *) id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_manager_v1
|
||||
*
|
||||
* Create a data device that can be used to manage a seat's selection.
|
||||
*/
|
||||
static inline struct zwlr_data_control_device_v1 *
|
||||
zwlr_data_control_manager_v1_get_data_device(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1, struct wl_seat *seat)
|
||||
{
|
||||
struct wl_proxy *id;
|
||||
|
||||
id = wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_manager_v1,
|
||||
ZWLR_DATA_CONTROL_MANAGER_V1_GET_DATA_DEVICE, &zwlr_data_control_device_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_manager_v1), 0, NULL, seat);
|
||||
|
||||
return (struct zwlr_data_control_device_v1 *) id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_manager_v1
|
||||
*
|
||||
* All objects created by the manager will still remain valid, until their
|
||||
* appropriate destroy request has been called.
|
||||
*/
|
||||
static inline void
|
||||
zwlr_data_control_manager_v1_destroy(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_manager_v1,
|
||||
ZWLR_DATA_CONTROL_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_manager_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
#ifndef ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM
|
||||
enum zwlr_data_control_device_v1_error {
|
||||
/**
|
||||
* source given to set_selection or set_primary_selection was already used before
|
||||
*/
|
||||
ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_USED_SOURCE = 1,
|
||||
};
|
||||
#endif /* ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM */
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
* @struct zwlr_data_control_device_v1_listener
|
||||
*/
|
||||
struct zwlr_data_control_device_v1_listener {
|
||||
/**
|
||||
* introduce a new wlr_data_control_offer
|
||||
*
|
||||
* The data_offer event introduces a new wlr_data_control_offer
|
||||
* object, which will subsequently be used in either the
|
||||
* wlr_data_control_device.selection event (for the regular
|
||||
* clipboard selections) or the
|
||||
* wlr_data_control_device.primary_selection event (for the primary
|
||||
* clipboard selections). Immediately following the
|
||||
* wlr_data_control_device.data_offer event, the new data_offer
|
||||
* object will send out wlr_data_control_offer.offer events to
|
||||
* describe the MIME types it offers.
|
||||
*/
|
||||
void (*data_offer)(void *data,
|
||||
struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1,
|
||||
struct zwlr_data_control_offer_v1 *id);
|
||||
/**
|
||||
* advertise new selection
|
||||
*
|
||||
* The selection event is sent out to notify the client of a new
|
||||
* wlr_data_control_offer for the selection for this device. The
|
||||
* wlr_data_control_device.data_offer and the
|
||||
* wlr_data_control_offer.offer events are sent out immediately
|
||||
* before this event to introduce the data offer object. The
|
||||
* selection event is sent to a client when a new selection is set.
|
||||
* The wlr_data_control_offer is valid until a new
|
||||
* wlr_data_control_offer or NULL is received. The client must
|
||||
* destroy the previous selection wlr_data_control_offer, if any,
|
||||
* upon receiving this event.
|
||||
*
|
||||
* The first selection event is sent upon binding the
|
||||
* wlr_data_control_device object.
|
||||
*/
|
||||
void (*selection)(void *data,
|
||||
struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1,
|
||||
struct zwlr_data_control_offer_v1 *id);
|
||||
/**
|
||||
* this data control is no longer valid
|
||||
*
|
||||
* This data control object is no longer valid and should be
|
||||
* destroyed by the client.
|
||||
*/
|
||||
void (*finished)(void *data,
|
||||
struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1);
|
||||
/**
|
||||
* advertise new primary selection
|
||||
*
|
||||
* The primary_selection event is sent out to notify the client
|
||||
* of a new wlr_data_control_offer for the primary selection for
|
||||
* this device. The wlr_data_control_device.data_offer and the
|
||||
* wlr_data_control_offer.offer events are sent out immediately
|
||||
* before this event to introduce the data offer object. The
|
||||
* primary_selection event is sent to a client when a new primary
|
||||
* selection is set. The wlr_data_control_offer is valid until a
|
||||
* new wlr_data_control_offer or NULL is received. The client must
|
||||
* destroy the previous primary selection wlr_data_control_offer,
|
||||
* if any, upon receiving this event.
|
||||
*
|
||||
* If the compositor supports primary selection, the first
|
||||
* primary_selection event is sent upon binding the
|
||||
* wlr_data_control_device object.
|
||||
* @since 2
|
||||
*/
|
||||
void (*primary_selection)(void *data,
|
||||
struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1,
|
||||
struct zwlr_data_control_offer_v1 *id);
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*/
|
||||
static inline int
|
||||
zwlr_data_control_device_v1_add_listener(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1,
|
||||
const struct zwlr_data_control_device_v1_listener *listener, void *data)
|
||||
{
|
||||
return wl_proxy_add_listener((struct wl_proxy *) zwlr_data_control_device_v1,
|
||||
(void (**)(void)) listener, data);
|
||||
}
|
||||
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_SET_SELECTION 0
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_DESTROY 1
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION 2
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_DATA_OFFER_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_SELECTION_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_FINISHED_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_PRIMARY_SELECTION_SINCE_VERSION 2
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_SET_SELECTION_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_DESTROY_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION_SINCE_VERSION 2
|
||||
|
||||
/** @ingroup iface_zwlr_data_control_device_v1 */
|
||||
static inline void
|
||||
zwlr_data_control_device_v1_set_user_data(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1, void *user_data)
|
||||
{
|
||||
wl_proxy_set_user_data((struct wl_proxy *) zwlr_data_control_device_v1, user_data);
|
||||
}
|
||||
|
||||
/** @ingroup iface_zwlr_data_control_device_v1 */
|
||||
static inline void *
|
||||
zwlr_data_control_device_v1_get_user_data(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1)
|
||||
{
|
||||
return wl_proxy_get_user_data((struct wl_proxy *) zwlr_data_control_device_v1);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
zwlr_data_control_device_v1_get_version(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1)
|
||||
{
|
||||
return wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_device_v1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*
|
||||
* This request asks the compositor to set the selection to the data from
|
||||
* the source on behalf of the client.
|
||||
*
|
||||
* The given source may not be used in any further set_selection or
|
||||
* set_primary_selection requests. Attempting to use a previously used
|
||||
* source is a protocol error.
|
||||
*
|
||||
* To unset the selection, set the source to NULL.
|
||||
*/
|
||||
static inline void
|
||||
zwlr_data_control_device_v1_set_selection(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1, struct zwlr_data_control_source_v1 *source)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_device_v1,
|
||||
ZWLR_DATA_CONTROL_DEVICE_V1_SET_SELECTION, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_device_v1), 0, source);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*
|
||||
* Destroys the data device object.
|
||||
*/
|
||||
static inline void
|
||||
zwlr_data_control_device_v1_destroy(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_device_v1,
|
||||
ZWLR_DATA_CONTROL_DEVICE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_device_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_device_v1
|
||||
*
|
||||
* This request asks the compositor to set the primary selection to the
|
||||
* data from the source on behalf of the client.
|
||||
*
|
||||
* The given source may not be used in any further set_selection or
|
||||
* set_primary_selection requests. Attempting to use a previously used
|
||||
* source is a protocol error.
|
||||
*
|
||||
* To unset the primary selection, set the source to NULL.
|
||||
*
|
||||
* The compositor will ignore this request if it does not support primary
|
||||
* selection.
|
||||
*/
|
||||
static inline void
|
||||
zwlr_data_control_device_v1_set_primary_selection(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1, struct zwlr_data_control_source_v1 *source)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_device_v1,
|
||||
ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_device_v1), 0, source);
|
||||
}
|
||||
|
||||
#ifndef ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM
|
||||
#define ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM
|
||||
enum zwlr_data_control_source_v1_error {
|
||||
/**
|
||||
* offer sent after wlr_data_control_device.set_selection
|
||||
*/
|
||||
ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_INVALID_OFFER = 1,
|
||||
};
|
||||
#endif /* ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM */
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_source_v1
|
||||
* @struct zwlr_data_control_source_v1_listener
|
||||
*/
|
||||
struct zwlr_data_control_source_v1_listener {
|
||||
/**
|
||||
* send the data
|
||||
*
|
||||
* Request for data from the client. Send the data as the
|
||||
* specified MIME type over the passed file descriptor, then close
|
||||
* it.
|
||||
* @param mime_type MIME type for the data
|
||||
* @param fd file descriptor for the data
|
||||
*/
|
||||
void (*send)(void *data,
|
||||
struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1,
|
||||
const char *mime_type,
|
||||
int32_t fd);
|
||||
/**
|
||||
* selection was cancelled
|
||||
*
|
||||
* This data source is no longer valid. The data source has been
|
||||
* replaced by another data source.
|
||||
*
|
||||
* The client should clean up and destroy this data source.
|
||||
*/
|
||||
void (*cancelled)(void *data,
|
||||
struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1);
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_source_v1
|
||||
*/
|
||||
static inline int
|
||||
zwlr_data_control_source_v1_add_listener(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1,
|
||||
const struct zwlr_data_control_source_v1_listener *listener, void *data)
|
||||
{
|
||||
return wl_proxy_add_listener((struct wl_proxy *) zwlr_data_control_source_v1,
|
||||
(void (**)(void)) listener, data);
|
||||
}
|
||||
|
||||
#define ZWLR_DATA_CONTROL_SOURCE_V1_OFFER 0
|
||||
#define ZWLR_DATA_CONTROL_SOURCE_V1_DESTROY 1
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_source_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_SOURCE_V1_SEND_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_source_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_SOURCE_V1_CANCELLED_SINCE_VERSION 1
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_source_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_SOURCE_V1_OFFER_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_source_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_SOURCE_V1_DESTROY_SINCE_VERSION 1
|
||||
|
||||
/** @ingroup iface_zwlr_data_control_source_v1 */
|
||||
static inline void
|
||||
zwlr_data_control_source_v1_set_user_data(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1, void *user_data)
|
||||
{
|
||||
wl_proxy_set_user_data((struct wl_proxy *) zwlr_data_control_source_v1, user_data);
|
||||
}
|
||||
|
||||
/** @ingroup iface_zwlr_data_control_source_v1 */
|
||||
static inline void *
|
||||
zwlr_data_control_source_v1_get_user_data(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1)
|
||||
{
|
||||
return wl_proxy_get_user_data((struct wl_proxy *) zwlr_data_control_source_v1);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
zwlr_data_control_source_v1_get_version(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1)
|
||||
{
|
||||
return wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_source_v1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_source_v1
|
||||
*
|
||||
* This request adds a MIME type to the set of MIME types advertised to
|
||||
* targets. Can be called several times to offer multiple types.
|
||||
*
|
||||
* Calling this after wlr_data_control_device.set_selection is a protocol
|
||||
* error.
|
||||
*/
|
||||
static inline void
|
||||
zwlr_data_control_source_v1_offer(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1, const char *mime_type)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_source_v1,
|
||||
ZWLR_DATA_CONTROL_SOURCE_V1_OFFER, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_source_v1), 0, mime_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_source_v1
|
||||
*
|
||||
* Destroys the data source object.
|
||||
*/
|
||||
static inline void
|
||||
zwlr_data_control_source_v1_destroy(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_source_v1,
|
||||
ZWLR_DATA_CONTROL_SOURCE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_source_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_offer_v1
|
||||
* @struct zwlr_data_control_offer_v1_listener
|
||||
*/
|
||||
struct zwlr_data_control_offer_v1_listener {
|
||||
/**
|
||||
* advertise offered MIME type
|
||||
*
|
||||
* Sent immediately after creating the wlr_data_control_offer
|
||||
* object. One event per offered MIME type.
|
||||
* @param mime_type offered MIME type
|
||||
*/
|
||||
void (*offer)(void *data,
|
||||
struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1,
|
||||
const char *mime_type);
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_offer_v1
|
||||
*/
|
||||
static inline int
|
||||
zwlr_data_control_offer_v1_add_listener(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1,
|
||||
const struct zwlr_data_control_offer_v1_listener *listener, void *data)
|
||||
{
|
||||
return wl_proxy_add_listener((struct wl_proxy *) zwlr_data_control_offer_v1,
|
||||
(void (**)(void)) listener, data);
|
||||
}
|
||||
|
||||
#define ZWLR_DATA_CONTROL_OFFER_V1_RECEIVE 0
|
||||
#define ZWLR_DATA_CONTROL_OFFER_V1_DESTROY 1
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_offer_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_OFFER_V1_OFFER_SINCE_VERSION 1
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_offer_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_OFFER_V1_RECEIVE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_offer_v1
|
||||
*/
|
||||
#define ZWLR_DATA_CONTROL_OFFER_V1_DESTROY_SINCE_VERSION 1
|
||||
|
||||
/** @ingroup iface_zwlr_data_control_offer_v1 */
|
||||
static inline void
|
||||
zwlr_data_control_offer_v1_set_user_data(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1, void *user_data)
|
||||
{
|
||||
wl_proxy_set_user_data((struct wl_proxy *) zwlr_data_control_offer_v1, user_data);
|
||||
}
|
||||
|
||||
/** @ingroup iface_zwlr_data_control_offer_v1 */
|
||||
static inline void *
|
||||
zwlr_data_control_offer_v1_get_user_data(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1)
|
||||
{
|
||||
return wl_proxy_get_user_data((struct wl_proxy *) zwlr_data_control_offer_v1);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
zwlr_data_control_offer_v1_get_version(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1)
|
||||
{
|
||||
return wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_offer_v1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_offer_v1
|
||||
*
|
||||
* To transfer the offered data, the client issues this request and
|
||||
* indicates the MIME type it wants to receive. The transfer happens
|
||||
* through the passed file descriptor (typically created with the pipe
|
||||
* system call). The source client writes the data in the MIME type
|
||||
* representation requested and then closes the file descriptor.
|
||||
*
|
||||
* The receiving client reads from the read end of the pipe until EOF and
|
||||
* then closes its end, at which point the transfer is complete.
|
||||
*
|
||||
* This request may happen multiple times for different MIME types.
|
||||
*/
|
||||
static inline void
|
||||
zwlr_data_control_offer_v1_receive(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1, const char *mime_type, int32_t fd)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_offer_v1,
|
||||
ZWLR_DATA_CONTROL_OFFER_V1_RECEIVE, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_offer_v1), 0, mime_type, fd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zwlr_data_control_offer_v1
|
||||
*
|
||||
* Destroys the data offer object.
|
||||
*/
|
||||
static inline void
|
||||
zwlr_data_control_offer_v1_destroy(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_offer_v1,
|
||||
ZWLR_DATA_CONTROL_OFFER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_offer_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
/* Generated by wayland-scanner 1.26.0 */
|
||||
|
||||
/*
|
||||
* Copyright © 2018 Simon Ser
|
||||
* Copyright © 2019 Ivan Molodetskikh
|
||||
*
|
||||
* 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 zwlr_data_control_device_v1_interface;
|
||||
extern const struct wl_interface zwlr_data_control_offer_v1_interface;
|
||||
extern const struct wl_interface zwlr_data_control_source_v1_interface;
|
||||
|
||||
static const struct wl_interface *wlr_data_control_unstable_v1_types[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
&zwlr_data_control_source_v1_interface,
|
||||
&zwlr_data_control_device_v1_interface,
|
||||
&wl_seat_interface,
|
||||
&zwlr_data_control_source_v1_interface,
|
||||
&zwlr_data_control_source_v1_interface,
|
||||
&zwlr_data_control_offer_v1_interface,
|
||||
&zwlr_data_control_offer_v1_interface,
|
||||
&zwlr_data_control_offer_v1_interface,
|
||||
};
|
||||
|
||||
static const struct wl_message zwlr_data_control_manager_v1_requests[] = {
|
||||
{ "create_data_source", "n", wlr_data_control_unstable_v1_types + 2 },
|
||||
{ "get_data_device", "no", wlr_data_control_unstable_v1_types + 3 },
|
||||
{ "destroy", "", wlr_data_control_unstable_v1_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface zwlr_data_control_manager_v1_interface = {
|
||||
"zwlr_data_control_manager_v1", 2,
|
||||
3, zwlr_data_control_manager_v1_requests,
|
||||
0, NULL,
|
||||
};
|
||||
|
||||
static const struct wl_message zwlr_data_control_device_v1_requests[] = {
|
||||
{ "set_selection", "?o", wlr_data_control_unstable_v1_types + 5 },
|
||||
{ "destroy", "", wlr_data_control_unstable_v1_types + 0 },
|
||||
{ "set_primary_selection", "2?o", wlr_data_control_unstable_v1_types + 6 },
|
||||
};
|
||||
|
||||
static const struct wl_message zwlr_data_control_device_v1_events[] = {
|
||||
{ "data_offer", "n", wlr_data_control_unstable_v1_types + 7 },
|
||||
{ "selection", "?o", wlr_data_control_unstable_v1_types + 8 },
|
||||
{ "finished", "", wlr_data_control_unstable_v1_types + 0 },
|
||||
{ "primary_selection", "2?o", wlr_data_control_unstable_v1_types + 9 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface zwlr_data_control_device_v1_interface = {
|
||||
"zwlr_data_control_device_v1", 2,
|
||||
3, zwlr_data_control_device_v1_requests,
|
||||
4, zwlr_data_control_device_v1_events,
|
||||
};
|
||||
|
||||
static const struct wl_message zwlr_data_control_source_v1_requests[] = {
|
||||
{ "offer", "s", wlr_data_control_unstable_v1_types + 0 },
|
||||
{ "destroy", "", wlr_data_control_unstable_v1_types + 0 },
|
||||
};
|
||||
|
||||
static const struct wl_message zwlr_data_control_source_v1_events[] = {
|
||||
{ "send", "sh", wlr_data_control_unstable_v1_types + 0 },
|
||||
{ "cancelled", "", wlr_data_control_unstable_v1_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface zwlr_data_control_source_v1_interface = {
|
||||
"zwlr_data_control_source_v1", 1,
|
||||
2, zwlr_data_control_source_v1_requests,
|
||||
2, zwlr_data_control_source_v1_events,
|
||||
};
|
||||
|
||||
static const struct wl_message zwlr_data_control_offer_v1_requests[] = {
|
||||
{ "receive", "sh", wlr_data_control_unstable_v1_types + 0 },
|
||||
{ "destroy", "", wlr_data_control_unstable_v1_types + 0 },
|
||||
};
|
||||
|
||||
static const struct wl_message zwlr_data_control_offer_v1_events[] = {
|
||||
{ "offer", "s", wlr_data_control_unstable_v1_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface zwlr_data_control_offer_v1_interface = {
|
||||
"zwlr_data_control_offer_v1", 1,
|
||||
2, zwlr_data_control_offer_v1_requests,
|
||||
1, zwlr_data_control_offer_v1_events,
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,384 +0,0 @@
|
|||
/* Generated by wayland-scanner 1.24.0 */
|
||||
|
||||
#ifndef XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
|
||||
#define XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "wayland-client.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @page page_xdg_decoration_unstable_v1 The xdg_decoration_unstable_v1 protocol
|
||||
* @section page_ifaces_xdg_decoration_unstable_v1 Interfaces
|
||||
* - @subpage page_iface_zxdg_decoration_manager_v1 - window decoration manager
|
||||
* - @subpage page_iface_zxdg_toplevel_decoration_v1 - decoration object for a toplevel surface
|
||||
* @section page_copyright_xdg_decoration_unstable_v1 Copyright
|
||||
* <pre>
|
||||
*
|
||||
* Copyright © 2018 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 xdg_toplevel;
|
||||
struct zxdg_decoration_manager_v1;
|
||||
struct zxdg_toplevel_decoration_v1;
|
||||
|
||||
#ifndef ZXDG_DECORATION_MANAGER_V1_INTERFACE
|
||||
#define ZXDG_DECORATION_MANAGER_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_zxdg_decoration_manager_v1 zxdg_decoration_manager_v1
|
||||
* @section page_iface_zxdg_decoration_manager_v1_desc Description
|
||||
*
|
||||
* This interface allows a compositor to announce support for server-side
|
||||
* decorations.
|
||||
*
|
||||
* A window decoration is a set of window controls as deemed appropriate by
|
||||
* the party managing them, such as user interface components used to move,
|
||||
* resize and change a window's state.
|
||||
*
|
||||
* A client can use this protocol to request being decorated by a supporting
|
||||
* compositor.
|
||||
*
|
||||
* If compositor and client do not negotiate the use of a server-side
|
||||
* decoration using this protocol, clients continue to self-decorate as they
|
||||
* see fit.
|
||||
*
|
||||
* Warning! The protocol described in this file is experimental and
|
||||
* backward incompatible changes may be made. Backward compatible changes
|
||||
* may be added together with the corresponding interface version bump.
|
||||
* Backward incompatible changes are done by bumping the version number in
|
||||
* the protocol and interface names and resetting the interface version.
|
||||
* Once the protocol is to be declared stable, the 'z' prefix and the
|
||||
* version number in the protocol and interface names are removed and the
|
||||
* interface version number is reset.
|
||||
* @section page_iface_zxdg_decoration_manager_v1_api API
|
||||
* See @ref iface_zxdg_decoration_manager_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_zxdg_decoration_manager_v1 The zxdg_decoration_manager_v1 interface
|
||||
*
|
||||
* This interface allows a compositor to announce support for server-side
|
||||
* decorations.
|
||||
*
|
||||
* A window decoration is a set of window controls as deemed appropriate by
|
||||
* the party managing them, such as user interface components used to move,
|
||||
* resize and change a window's state.
|
||||
*
|
||||
* A client can use this protocol to request being decorated by a supporting
|
||||
* compositor.
|
||||
*
|
||||
* If compositor and client do not negotiate the use of a server-side
|
||||
* decoration using this protocol, clients continue to self-decorate as they
|
||||
* see fit.
|
||||
*
|
||||
* Warning! The protocol described in this file is experimental and
|
||||
* backward incompatible changes may be made. Backward compatible changes
|
||||
* may be added together with the corresponding interface version bump.
|
||||
* Backward incompatible changes are done by bumping the version number in
|
||||
* the protocol and interface names and resetting the interface version.
|
||||
* Once the protocol is to be declared stable, the 'z' prefix and the
|
||||
* version number in the protocol and interface names are removed and the
|
||||
* interface version number is reset.
|
||||
*/
|
||||
extern const struct wl_interface zxdg_decoration_manager_v1_interface;
|
||||
#endif
|
||||
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_INTERFACE
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_zxdg_toplevel_decoration_v1 zxdg_toplevel_decoration_v1
|
||||
* @section page_iface_zxdg_toplevel_decoration_v1_desc Description
|
||||
*
|
||||
* The decoration object allows the compositor to toggle server-side window
|
||||
* decorations for a toplevel surface. The client can request to switch to
|
||||
* another mode.
|
||||
*
|
||||
* The xdg_toplevel_decoration object must be destroyed before its
|
||||
* xdg_toplevel.
|
||||
* @section page_iface_zxdg_toplevel_decoration_v1_api API
|
||||
* See @ref iface_zxdg_toplevel_decoration_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_zxdg_toplevel_decoration_v1 The zxdg_toplevel_decoration_v1 interface
|
||||
*
|
||||
* The decoration object allows the compositor to toggle server-side window
|
||||
* decorations for a toplevel surface. The client can request to switch to
|
||||
* another mode.
|
||||
*
|
||||
* The xdg_toplevel_decoration object must be destroyed before its
|
||||
* xdg_toplevel.
|
||||
*/
|
||||
extern const struct wl_interface zxdg_toplevel_decoration_v1_interface;
|
||||
#endif
|
||||
|
||||
#define ZXDG_DECORATION_MANAGER_V1_DESTROY 0
|
||||
#define ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION 1
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_decoration_manager_v1
|
||||
*/
|
||||
#define ZXDG_DECORATION_MANAGER_V1_DESTROY_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zxdg_decoration_manager_v1
|
||||
*/
|
||||
#define ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION_SINCE_VERSION 1
|
||||
|
||||
/** @ingroup iface_zxdg_decoration_manager_v1 */
|
||||
static inline void
|
||||
zxdg_decoration_manager_v1_set_user_data(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1, void *user_data)
|
||||
{
|
||||
wl_proxy_set_user_data((struct wl_proxy *) zxdg_decoration_manager_v1, user_data);
|
||||
}
|
||||
|
||||
/** @ingroup iface_zxdg_decoration_manager_v1 */
|
||||
static inline void *
|
||||
zxdg_decoration_manager_v1_get_user_data(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
|
||||
{
|
||||
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_decoration_manager_v1);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
zxdg_decoration_manager_v1_get_version(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
|
||||
{
|
||||
return wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_decoration_manager_v1
|
||||
*
|
||||
* Destroy the decoration manager. This doesn't destroy objects created
|
||||
* with the manager.
|
||||
*/
|
||||
static inline void
|
||||
zxdg_decoration_manager_v1_destroy(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_decoration_manager_v1,
|
||||
ZXDG_DECORATION_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_decoration_manager_v1
|
||||
*
|
||||
* Create a new decoration object associated with the given toplevel.
|
||||
*
|
||||
* Creating an xdg_toplevel_decoration from an xdg_toplevel which has a
|
||||
* buffer attached or committed is a client error, and any attempts by a
|
||||
* client to attach or manipulate a buffer prior to the first
|
||||
* xdg_toplevel_decoration.configure event must also be treated as
|
||||
* errors.
|
||||
*/
|
||||
static inline struct zxdg_toplevel_decoration_v1 *
|
||||
zxdg_decoration_manager_v1_get_toplevel_decoration(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1, struct xdg_toplevel *toplevel)
|
||||
{
|
||||
struct wl_proxy *id;
|
||||
|
||||
id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_decoration_manager_v1,
|
||||
ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION, &zxdg_toplevel_decoration_v1_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1), 0, NULL, toplevel);
|
||||
|
||||
return (struct zxdg_toplevel_decoration_v1 *) id;
|
||||
}
|
||||
|
||||
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM
|
||||
enum zxdg_toplevel_decoration_v1_error {
|
||||
/**
|
||||
* xdg_toplevel has a buffer attached before configure
|
||||
*/
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_UNCONFIGURED_BUFFER = 0,
|
||||
/**
|
||||
* xdg_toplevel already has a decoration object
|
||||
*/
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ALREADY_CONSTRUCTED = 1,
|
||||
/**
|
||||
* xdg_toplevel destroyed before the decoration object
|
||||
*/
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ORPHANED = 2,
|
||||
/**
|
||||
* invalid mode
|
||||
*/
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_INVALID_MODE = 3,
|
||||
};
|
||||
#endif /* ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM */
|
||||
|
||||
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
* window decoration modes
|
||||
*
|
||||
* These values describe window decoration modes.
|
||||
*/
|
||||
enum zxdg_toplevel_decoration_v1_mode {
|
||||
/**
|
||||
* no server-side window decoration
|
||||
*/
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE = 1,
|
||||
/**
|
||||
* server-side window decoration
|
||||
*/
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE = 2,
|
||||
};
|
||||
#endif /* ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM */
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
* @struct zxdg_toplevel_decoration_v1_listener
|
||||
*/
|
||||
struct zxdg_toplevel_decoration_v1_listener {
|
||||
/**
|
||||
* notify a decoration mode change
|
||||
*
|
||||
* The configure event configures the effective decoration mode.
|
||||
* The configured state should not be applied immediately. Clients
|
||||
* must send an ack_configure in response to this event. See
|
||||
* xdg_surface.configure and xdg_surface.ack_configure for details.
|
||||
*
|
||||
* A configure event can be sent at any time. The specified mode
|
||||
* must be obeyed by the client.
|
||||
* @param mode the decoration mode
|
||||
*/
|
||||
void (*configure)(void *data,
|
||||
struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
|
||||
uint32_t mode);
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
*/
|
||||
static inline int
|
||||
zxdg_toplevel_decoration_v1_add_listener(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
|
||||
const struct zxdg_toplevel_decoration_v1_listener *listener, void *data)
|
||||
{
|
||||
return wl_proxy_add_listener((struct wl_proxy *) zxdg_toplevel_decoration_v1,
|
||||
(void (**)(void)) listener, data);
|
||||
}
|
||||
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY 0
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE 1
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE 2
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
*/
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_CONFIGURE_SINCE_VERSION 1
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
*/
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
*/
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
*/
|
||||
#define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE_SINCE_VERSION 1
|
||||
|
||||
/** @ingroup iface_zxdg_toplevel_decoration_v1 */
|
||||
static inline void
|
||||
zxdg_toplevel_decoration_v1_set_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, void *user_data)
|
||||
{
|
||||
wl_proxy_set_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1, user_data);
|
||||
}
|
||||
|
||||
/** @ingroup iface_zxdg_toplevel_decoration_v1 */
|
||||
static inline void *
|
||||
zxdg_toplevel_decoration_v1_get_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
|
||||
{
|
||||
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
zxdg_toplevel_decoration_v1_get_version(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
|
||||
{
|
||||
return wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
*
|
||||
* Switch back to a mode without any server-side decorations at the next
|
||||
* commit.
|
||||
*/
|
||||
static inline void
|
||||
zxdg_toplevel_decoration_v1_destroy(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
*
|
||||
* Set the toplevel surface decoration mode. This informs the compositor
|
||||
* that the client prefers the provided decoration mode.
|
||||
*
|
||||
* After requesting a decoration mode, the compositor will respond by
|
||||
* emitting an xdg_surface.configure event. The client should then update
|
||||
* its content, drawing it without decorations if the received mode is
|
||||
* server-side decorations. The client must also acknowledge the configure
|
||||
* when committing the new content (see xdg_surface.ack_configure).
|
||||
*
|
||||
* The compositor can decide not to use the client's mode and enforce a
|
||||
* different mode instead.
|
||||
*
|
||||
* Clients whose decoration mode depend on the xdg_toplevel state may send
|
||||
* a set_mode request in response to an xdg_surface.configure event and wait
|
||||
* for the next xdg_surface.configure event to prevent unwanted state.
|
||||
* Such clients are responsible for preventing configure loops and must
|
||||
* make sure not to send multiple successive set_mode requests with the
|
||||
* same decoration mode.
|
||||
*
|
||||
* If an invalid mode is supplied by the client, the invalid_mode protocol
|
||||
* error is raised by the compositor.
|
||||
*/
|
||||
static inline void
|
||||
zxdg_toplevel_decoration_v1_set_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, uint32_t mode)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup iface_zxdg_toplevel_decoration_v1
|
||||
*
|
||||
* Unset the toplevel surface decoration mode. This informs the compositor
|
||||
* that the client doesn't prefer a particular decoration mode.
|
||||
*
|
||||
* This request has the same semantics as set_mode.
|
||||
*/
|
||||
static inline void
|
||||
zxdg_toplevel_decoration_v1_unset_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
/* Generated by wayland-scanner 1.24.0 */
|
||||
|
||||
/*
|
||||
* Copyright © 2018 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 xdg_toplevel_interface;
|
||||
extern const struct wl_interface zxdg_toplevel_decoration_v1_interface;
|
||||
|
||||
static const struct wl_interface *xdg_decoration_unstable_v1_types[] = {
|
||||
NULL,
|
||||
&zxdg_toplevel_decoration_v1_interface,
|
||||
&xdg_toplevel_interface,
|
||||
};
|
||||
|
||||
static const struct wl_message zxdg_decoration_manager_v1_requests[] = {
|
||||
{ "destroy", "", xdg_decoration_unstable_v1_types + 0 },
|
||||
{ "get_toplevel_decoration", "no", xdg_decoration_unstable_v1_types + 1 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface zxdg_decoration_manager_v1_interface = {
|
||||
"zxdg_decoration_manager_v1", 1,
|
||||
2, zxdg_decoration_manager_v1_requests,
|
||||
0, NULL,
|
||||
};
|
||||
|
||||
static const struct wl_message zxdg_toplevel_decoration_v1_requests[] = {
|
||||
{ "destroy", "", xdg_decoration_unstable_v1_types + 0 },
|
||||
{ "set_mode", "u", xdg_decoration_unstable_v1_types + 0 },
|
||||
{ "unset_mode", "", xdg_decoration_unstable_v1_types + 0 },
|
||||
};
|
||||
|
||||
static const struct wl_message zxdg_toplevel_decoration_v1_events[] = {
|
||||
{ "configure", "u", xdg_decoration_unstable_v1_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface zxdg_toplevel_decoration_v1_interface = {
|
||||
"zxdg_toplevel_decoration_v1", 1,
|
||||
3, zxdg_toplevel_decoration_v1_requests,
|
||||
1, zxdg_toplevel_decoration_v1_events,
|
||||
};
|
||||
|
||||
2384
xdg-shell-client.h
2384
xdg-shell-client.h
File diff suppressed because it is too large
Load diff
|
|
@ -1,184 +0,0 @@
|
|||
/* Generated by wayland-scanner 1.24.0 */
|
||||
|
||||
/*
|
||||
* Copyright © 2008-2013 Kristian Høgsberg
|
||||
* Copyright © 2013 Rafael Antognolli
|
||||
* Copyright © 2013 Jasper St. Pierre
|
||||
* Copyright © 2010-2013 Intel Corporation
|
||||
* Copyright © 2015-2017 Samsung Electronics Co., Ltd
|
||||
* Copyright © 2015-2017 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_output_interface;
|
||||
extern const struct wl_interface wl_seat_interface;
|
||||
extern const struct wl_interface wl_surface_interface;
|
||||
extern const struct wl_interface xdg_popup_interface;
|
||||
extern const struct wl_interface xdg_positioner_interface;
|
||||
extern const struct wl_interface xdg_surface_interface;
|
||||
extern const struct wl_interface xdg_toplevel_interface;
|
||||
|
||||
static const struct wl_interface *xdg_shell_types[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&xdg_positioner_interface,
|
||||
&xdg_surface_interface,
|
||||
&wl_surface_interface,
|
||||
&xdg_toplevel_interface,
|
||||
&xdg_popup_interface,
|
||||
&xdg_surface_interface,
|
||||
&xdg_positioner_interface,
|
||||
&xdg_toplevel_interface,
|
||||
&wl_seat_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&wl_seat_interface,
|
||||
NULL,
|
||||
&wl_seat_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
&wl_output_interface,
|
||||
&wl_seat_interface,
|
||||
NULL,
|
||||
&xdg_positioner_interface,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_wm_base_requests[] = {
|
||||
{ "destroy", "", xdg_shell_types + 0 },
|
||||
{ "create_positioner", "n", xdg_shell_types + 4 },
|
||||
{ "get_xdg_surface", "no", xdg_shell_types + 5 },
|
||||
{ "pong", "u", xdg_shell_types + 0 },
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_wm_base_events[] = {
|
||||
{ "ping", "u", xdg_shell_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface xdg_wm_base_interface = {
|
||||
"xdg_wm_base", 7,
|
||||
4, xdg_wm_base_requests,
|
||||
1, xdg_wm_base_events,
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_positioner_requests[] = {
|
||||
{ "destroy", "", xdg_shell_types + 0 },
|
||||
{ "set_size", "ii", xdg_shell_types + 0 },
|
||||
{ "set_anchor_rect", "iiii", xdg_shell_types + 0 },
|
||||
{ "set_anchor", "u", xdg_shell_types + 0 },
|
||||
{ "set_gravity", "u", xdg_shell_types + 0 },
|
||||
{ "set_constraint_adjustment", "u", xdg_shell_types + 0 },
|
||||
{ "set_offset", "ii", xdg_shell_types + 0 },
|
||||
{ "set_reactive", "3", xdg_shell_types + 0 },
|
||||
{ "set_parent_size", "3ii", xdg_shell_types + 0 },
|
||||
{ "set_parent_configure", "3u", xdg_shell_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface xdg_positioner_interface = {
|
||||
"xdg_positioner", 7,
|
||||
10, xdg_positioner_requests,
|
||||
0, NULL,
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_surface_requests[] = {
|
||||
{ "destroy", "", xdg_shell_types + 0 },
|
||||
{ "get_toplevel", "n", xdg_shell_types + 7 },
|
||||
{ "get_popup", "n?oo", xdg_shell_types + 8 },
|
||||
{ "set_window_geometry", "iiii", xdg_shell_types + 0 },
|
||||
{ "ack_configure", "u", xdg_shell_types + 0 },
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_surface_events[] = {
|
||||
{ "configure", "u", xdg_shell_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface xdg_surface_interface = {
|
||||
"xdg_surface", 7,
|
||||
5, xdg_surface_requests,
|
||||
1, xdg_surface_events,
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_toplevel_requests[] = {
|
||||
{ "destroy", "", xdg_shell_types + 0 },
|
||||
{ "set_parent", "?o", xdg_shell_types + 11 },
|
||||
{ "set_title", "s", xdg_shell_types + 0 },
|
||||
{ "set_app_id", "s", xdg_shell_types + 0 },
|
||||
{ "show_window_menu", "ouii", xdg_shell_types + 12 },
|
||||
{ "move", "ou", xdg_shell_types + 16 },
|
||||
{ "resize", "ouu", xdg_shell_types + 18 },
|
||||
{ "set_max_size", "ii", xdg_shell_types + 0 },
|
||||
{ "set_min_size", "ii", xdg_shell_types + 0 },
|
||||
{ "set_maximized", "", xdg_shell_types + 0 },
|
||||
{ "unset_maximized", "", xdg_shell_types + 0 },
|
||||
{ "set_fullscreen", "?o", xdg_shell_types + 21 },
|
||||
{ "unset_fullscreen", "", xdg_shell_types + 0 },
|
||||
{ "set_minimized", "", xdg_shell_types + 0 },
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_toplevel_events[] = {
|
||||
{ "configure", "iia", xdg_shell_types + 0 },
|
||||
{ "close", "", xdg_shell_types + 0 },
|
||||
{ "configure_bounds", "4ii", xdg_shell_types + 0 },
|
||||
{ "wm_capabilities", "5a", xdg_shell_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface xdg_toplevel_interface = {
|
||||
"xdg_toplevel", 7,
|
||||
14, xdg_toplevel_requests,
|
||||
4, xdg_toplevel_events,
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_popup_requests[] = {
|
||||
{ "destroy", "", xdg_shell_types + 0 },
|
||||
{ "grab", "ou", xdg_shell_types + 22 },
|
||||
{ "reposition", "3ou", xdg_shell_types + 24 },
|
||||
};
|
||||
|
||||
static const struct wl_message xdg_popup_events[] = {
|
||||
{ "configure", "iiii", xdg_shell_types + 0 },
|
||||
{ "popup_done", "", xdg_shell_types + 0 },
|
||||
{ "repositioned", "3u", xdg_shell_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface xdg_popup_interface = {
|
||||
"xdg_popup", 7,
|
||||
3, xdg_popup_requests,
|
||||
3, xdg_popup_events,
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue