perf(wave1): reduce Config caps, reorder Client/Monitor for cache

Wave 1 changes:
- Reduce CFG_MAX_KEYBINDS 256→128, CFG_MAX_STRLEN 256→64, CFG_MAX_ARGS 16→8
  → saves ~2.5 MB BSS from Config struct
- Add truncation warnings to config_load when keybind/button/scroll limit reached
- Reorder Client struct: HOT fields (type, mon, tags, floating flags, geom) in first
  cache line, COLD fields (wl_listeners) at end — saves cache misses in arrange()
- Reorder LayerSurface struct similarly
- Split Monitor into Monitor/MonitorCold: hot fields (~120B) stay inline, cold layout
  state lazily allocated on first dwindle/master use
- All cold-field accesses through m->cold-> indirection
- cleanupmon frees m->cold
- Zero-warning build with clang -Werror -Wpedantic
This commit is contained in:
2026-07-02 23:35:37 -04:00
parent cd0e5ec1eb
commit fb0f49e861
22 changed files with 6664 additions and 86 deletions
+26 -14
View File
@@ -20,23 +20,36 @@ struct wlr_scene_shadow;
enum { XDGShell, LayerShell, X11 };
typedef struct Client {
/* Must keep this field first */
unsigned int type; /* XDGShell or X11* */
/* Must keep this field first — union-cast discriminant */
unsigned int type; /* XDGShell or X11 */
/* HOT — accessed every frame / arrange / focus / resize */
Monitor *mon;
struct wlr_scene_tree *scene;
struct wlr_scene_rect *border_bg; /* single border rect with clipped content hole */
struct wlr_scene_tree *scene_surface;
struct wl_list link;
struct wl_list flink;
uint32_t tags;
int isfloating;
int isurgent;
int isfullscreen;
int isscratchpad;
struct wlr_box geom; /* layout-relative, includes border */
struct wlr_box prev; /* layout-relative, includes border */
struct wlr_box bounds; /* only width and height are used */
unsigned int bw;
int corner_radius;
struct wlr_scene_shadow *shadow;
/* WARM — accessed less frequently */
struct wl_list link;
struct wl_list flink;
union {
struct wlr_xdg_surface *xdg;
struct wlr_xwayland_surface *xwayland;
} surface;
struct wlr_scene_tree *scene;
struct wlr_scene_rect *border_bg; /* single border rect with clipped content hole */
struct wlr_scene_tree *scene_surface;
struct wlr_xdg_toplevel_decoration_v1 *decoration;
/* COLD — wl_listeners (set up once, rarely touched after) */
struct wl_listener commit;
struct wl_listener map;
struct wl_listener maximize;
@@ -53,26 +66,25 @@ typedef struct Client {
struct wl_listener configure;
struct wl_listener set_hints;
#endif
unsigned int bw;
int corner_radius;
struct wlr_scene_shadow *shadow;
uint32_t tags;
int isfloating, isurgent, isfullscreen, isscratchpad;
uint32_t resize; /* configure serial of a pending resize */
} Client;
typedef struct {
/* Must keep this field first */
/* Must keep this field first — union-cast discriminant */
unsigned int type; /* LayerShell */
/* HOT */
Monitor *mon;
struct wlr_scene_tree *scene;
struct wlr_scene_tree *popups;
struct wlr_scene_layer_surface_v1 *scene_layer;
struct wl_list link;
int mapped;
struct wlr_layer_surface_v1 *layer_surface;
/* WARM */
struct wl_list link;
/* COLD — wl_listeners */
struct wl_listener destroy;
struct wl_listener unmap;
struct wl_listener surface_commit;
+15 -10
View File
@@ -21,6 +21,20 @@ typedef struct {
void (*arrange)(Monitor *);
} Layout;
/* Cold state — accessed only on layout changes, not every frame.
* Allocated lazily on first dwindle/master layout use. */
typedef struct MonitorCold {
const Layout *lt[TAGCOUNT][2];
unsigned int sellt[TAGCOUNT];
float mfact;
int nmaster;
char ltsymbol[TAGCOUNT][16];
DwindleNode *dwindle_root[TAGCOUNT];
struct Client *dwindle_focus[TAGCOUNT];
struct Client *master_master[TAGCOUNT];
int master_side[TAGCOUNT];
} MonitorCold;
struct Monitor {
struct wl_list link;
struct wlr_output *wlr_output;
@@ -34,21 +48,12 @@ struct Monitor {
struct wlr_box m; /* monitor area, layout-relative */
struct wlr_box w; /* window area, layout-relative */
struct wl_list layers[4]; /* LayerSurface.link */
const Layout *lt[TAGCOUNT][2]; /* per-tag layout slots */
struct MonitorCold *cold; /* lazy-allocated layout state */
int gaps;
unsigned int seltags;
struct wlr_ext_workspace_group_handle_v1 *ext_group;
unsigned int sellt[TAGCOUNT]; /* per-tag layout toggle index */
uint32_t tagset[2];
float mfact;
int nmaster;
char ltsymbol[TAGCOUNT][16]; /* per-tag layout symbol */
int asleep;
DwindleNode *dwindle_root[TAGCOUNT]; /* one tree per tag */
struct Client *dwindle_focus[TAGCOUNT]; /* insertion anchor, one per tag */
/* master/stack layout state */
struct Client *master_master[TAGCOUNT]; /* the master client (NULL if none) */
int master_side[TAGCOUNT]; /* 0 = master on left, 1 = master on right */
int scratchpad_visible; /* whether scratchpad is shown */
struct Client *scratchpad_prev_focus; /* client focused before scratchpad opened */
struct Client *scratchpad_current; /* currently visible scratchpad client */
+12
View File
@@ -743,8 +743,20 @@ config_load(const char *path, Config *cfg)
parse_monitors (L, cfg);
parse_workspace_layouts(L, cfg);
parse_keybinds (L, cfg);
if (cfg->nkeybinds >= CFG_MAX_KEYBINDS)
fprintf(stderr, "peachwm config: number of keybinds reached the limit (%d). "
"Increase CFG_MAX_KEYBINDS or remove some binds.\n",
CFG_MAX_KEYBINDS);
parse_buttons (L, cfg);
if (cfg->nbuttons >= CFG_MAX_KEYBINDS)
fprintf(stderr, "peachwm config: number of button binds reached the limit (%d). "
"Increase CFG_MAX_KEYBINDS or remove some binds.\n",
CFG_MAX_KEYBINDS);
parse_scrolls (L, cfg);
if (cfg->nscrolls >= CFG_MAX_KEYBINDS)
fprintf(stderr, "peachwm config: number of scroll binds reached the limit (%d). "
"Increase CFG_MAX_KEYBINDS or remove some binds.\n",
CFG_MAX_KEYBINDS);
parse_autostart (L, cfg);
parse_effects (L, &cfg->effects);
+3 -3
View File
@@ -6,9 +6,9 @@
/* Maximum lengths. Good for the soul, they say */
#define CFG_MAX_RULES 64
#define CFG_MAX_MONITORS 16
#define CFG_MAX_KEYBINDS 256
#define CFG_MAX_ARGS 16
#define CFG_MAX_STRLEN 256
#define CFG_MAX_KEYBINDS 128
#define CFG_MAX_ARGS 8
#define CFG_MAX_STRLEN 64
#define CFG_MAX_AUTOSTART 32
#define CFG_MAX_AUTOSTART_CMD 512
BIN
View File
Binary file not shown.
@@ -0,0 +1,94 @@
/* Generated by wayland-scanner 1.25.0 */
/*
* Copyright (C) 2022 Russell Newcomb
*
* 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 zpeachwm_ipc_output_v2_interface;
static const struct wl_interface *peachwm_ipc_unstable_v2_types[] = {
NULL,
NULL,
NULL,
NULL,
&zpeachwm_ipc_output_v2_interface,
&wl_output_interface,
};
static const struct wl_message zpeachwm_ipc_manager_v2_requests[] = {
{ "release", "", peachwm_ipc_unstable_v2_types + 0 },
{ "get_output", "no", peachwm_ipc_unstable_v2_types + 4 },
};
static const struct wl_message zpeachwm_ipc_manager_v2_events[] = {
{ "tags", "u", peachwm_ipc_unstable_v2_types + 0 },
{ "layout", "s", peachwm_ipc_unstable_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zpeachwm_ipc_manager_v2_interface = {
"zpeachwm_ipc_manager_v2", 2,
2, zpeachwm_ipc_manager_v2_requests,
2, zpeachwm_ipc_manager_v2_events,
};
static const struct wl_message zpeachwm_ipc_output_v2_requests[] = {
{ "release", "", peachwm_ipc_unstable_v2_types + 0 },
{ "set_tags", "uu", peachwm_ipc_unstable_v2_types + 0 },
{ "set_client_tags", "uu", peachwm_ipc_unstable_v2_types + 0 },
{ "set_layout", "u", peachwm_ipc_unstable_v2_types + 0 },
};
static const struct wl_message zpeachwm_ipc_output_v2_events[] = {
{ "toggle_visibility", "", peachwm_ipc_unstable_v2_types + 0 },
{ "active", "u", peachwm_ipc_unstable_v2_types + 0 },
{ "tag", "uuuu", peachwm_ipc_unstable_v2_types + 0 },
{ "layout", "u", peachwm_ipc_unstable_v2_types + 0 },
{ "title", "s", peachwm_ipc_unstable_v2_types + 0 },
{ "appid", "s", peachwm_ipc_unstable_v2_types + 0 },
{ "layout_symbol", "s", peachwm_ipc_unstable_v2_types + 0 },
{ "frame", "", peachwm_ipc_unstable_v2_types + 0 },
{ "fullscreen", "2u", peachwm_ipc_unstable_v2_types + 0 },
{ "floating", "2u", peachwm_ipc_unstable_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zpeachwm_ipc_output_v2_interface = {
"zpeachwm_ipc_output_v2", 2,
4, zpeachwm_ipc_output_v2_requests,
10, zpeachwm_ipc_output_v2_events,
};
+484
View File
@@ -0,0 +1,484 @@
/* Generated by wayland-scanner 1.25.0 */
#ifndef PEACHWM_IPC_UNSTABLE_V2_CLIENT_PROTOCOL_H
#define PEACHWM_IPC_UNSTABLE_V2_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_peachwm_ipc_unstable_v2 The peachwm_ipc_unstable_v2 protocol
* @section page_ifaces_peachwm_ipc_unstable_v2 Interfaces
* - @subpage page_iface_zpeachwm_ipc_manager_v2 - manage peachwm state
* - @subpage page_iface_zpeachwm_ipc_output_v2 - interact with peachwm output state
* @section page_copyright_peachwm_ipc_unstable_v2 Copyright
* <pre>
*
* Copyright (C) 2022 Russell Newcomb
*
* 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_output;
struct zpeachwm_ipc_manager_v2;
struct zpeachwm_ipc_output_v2;
#ifndef ZPEACHWM_IPC_MANAGER_V2_INTERFACE
#define ZPEACHWM_IPC_MANAGER_V2_INTERFACE
/**
* @page page_iface_zpeachwm_ipc_manager_v2 zpeachwm_ipc_manager_v2
* @section page_iface_zpeachwm_ipc_manager_v2_desc Description
*
* This interface is exposed as a global in the Wayland registry and allows
* clients to query and set peachwm state.
*
* 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 is reset.
* @section page_iface_zpeachwm_ipc_manager_v2_api API
* See @ref iface_zpeachwm_ipc_manager_v2.
*/
/**
* @defgroup iface_zpeachwm_ipc_manager_v2 The zpeachwm_ipc_manager_v2 interface
*
* This interface is exposed as a global in the Wayland registry and allows
* clients to query and set peachwm state.
*
* 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 is reset.
*/
extern const struct wl_interface zpeachwm_ipc_manager_v2_interface;
#endif
#ifndef ZPEACHWM_IPC_OUTPUT_V2_INTERFACE
#define ZPEACHWM_IPC_OUTPUT_V2_INTERFACE
/**
* @page page_iface_zpeachwm_ipc_output_v2 zpeachwm_ipc_output_v2
* @section page_iface_zpeachwm_ipc_output_v2_desc Description
*
* Observe and control a peachwm output.
* @section page_iface_zpeachwm_ipc_output_v2_api API
* See @ref iface_zpeachwm_ipc_output_v2.
*/
/**
* @defgroup iface_zpeachwm_ipc_output_v2 The zpeachwm_ipc_output_v2 interface
*
* Observe and control a peachwm output.
*/
extern const struct wl_interface zpeachwm_ipc_output_v2_interface;
#endif
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
* @struct zpeachwm_ipc_manager_v2_listener
*/
struct zpeachwm_ipc_manager_v2_listener {
/**
* announces number of tags
*
* This event is sent after binding and announces the number of
* tags.
*/
void (*tags)(void *data,
struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2,
uint32_t amount);
/**
* announces a layout
*
* This event is sent after binding and announces a layout.
* Layouts are announced in order.
*/
void (*layout)(void *data,
struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2,
const char *name);
};
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
static inline int
zpeachwm_ipc_manager_v2_add_listener(struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2,
const struct zpeachwm_ipc_manager_v2_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zpeachwm_ipc_manager_v2,
(void (**)(void)) listener, data);
}
#define ZPEACHWM_IPC_MANAGER_V2_RELEASE 0
#define ZPEACHWM_IPC_MANAGER_V2_GET_OUTPUT 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
#define ZPEACHWM_IPC_MANAGER_V2_TAGS_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
#define ZPEACHWM_IPC_MANAGER_V2_LAYOUT_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
#define ZPEACHWM_IPC_MANAGER_V2_RELEASE_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
#define ZPEACHWM_IPC_MANAGER_V2_GET_OUTPUT_SINCE_VERSION 1
/** @ingroup iface_zpeachwm_ipc_manager_v2 */
static inline void
zpeachwm_ipc_manager_v2_set_user_data(struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zpeachwm_ipc_manager_v2, user_data);
}
/** @ingroup iface_zpeachwm_ipc_manager_v2 */
static inline void *
zpeachwm_ipc_manager_v2_get_user_data(struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zpeachwm_ipc_manager_v2);
}
static inline uint32_t
zpeachwm_ipc_manager_v2_get_version(struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zpeachwm_ipc_manager_v2);
}
/** @ingroup iface_zpeachwm_ipc_manager_v2 */
static inline void
zpeachwm_ipc_manager_v2_destroy(struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2)
{
wl_proxy_destroy((struct wl_proxy *) zpeachwm_ipc_manager_v2);
}
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*
* Indicates that the client will not use the manager object anymore.
* Objects created through this interface remain valid.
*/
static inline void
zpeachwm_ipc_manager_v2_release(struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zpeachwm_ipc_manager_v2,
ZPEACHWM_IPC_MANAGER_V2_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) zpeachwm_ipc_manager_v2), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*
* Get a peachwm_ipc_output for the given wl_output.
*/
static inline struct zpeachwm_ipc_output_v2 *
zpeachwm_ipc_manager_v2_get_output(struct zpeachwm_ipc_manager_v2 *zpeachwm_ipc_manager_v2, struct wl_output *output)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) zpeachwm_ipc_manager_v2,
ZPEACHWM_IPC_MANAGER_V2_GET_OUTPUT, &zpeachwm_ipc_output_v2_interface, wl_proxy_get_version((struct wl_proxy *) zpeachwm_ipc_manager_v2), 0, NULL, output);
return (struct zpeachwm_ipc_output_v2 *) id;
}
#ifndef ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM
#define ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM
enum zpeachwm_ipc_output_v2_tag_state {
/**
* no state
*/
ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_NONE = 0,
/**
* tag is active
*/
ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ACTIVE = 1,
/**
* tag has urgent client
*/
ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_URGENT = 2,
};
#endif /* ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM */
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* @struct zpeachwm_ipc_output_v2_listener
*/
struct zpeachwm_ipc_output_v2_listener {
/**
* peachwm visibility has been toggled
*
* Indicates that peachwm visibility has been toggled.
*/
void (*toggle_visibility)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2);
/**
* output is active
*
* Indicates the output is active (selected monitor).
*/
void (*active)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
uint32_t active);
/**
* tag state changed
*
* Indicates a tag state change.
* @param tag index of the tag
* @param state state of the tag
* @param clients number of clients in tag
* @param focused 1 if focused client is in this tag
*/
void (*tag)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
uint32_t tag,
uint32_t state,
uint32_t clients,
uint32_t focused);
/**
* layout changed
*
* Indicates the layout changed.
* @param layout index of the layout
*/
void (*layout)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
uint32_t layout);
/**
* title changed
*
* Indicates the focused client title changed.
*/
void (*title)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
const char *title);
/**
* appid changed
*
* Indicates the focused client appid changed.
*/
void (*appid)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
const char *appid);
/**
* layout symbol changed
*
* Indicates the layout symbol changed.
*/
void (*layout_symbol)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
const char *layout);
/**
* frame event
*
* Sent after all state events have been sent for a given state
* change.
*/
void (*frame)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2);
/**
* fullscreen state changed
*
* Indicates the fullscreen state changed.
* @since 2
*/
void (*fullscreen)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
uint32_t is_fullscreen);
/**
* floating state changed
*
* Indicates the floating state changed.
* @since 2
*/
void (*floating)(void *data,
struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
uint32_t is_floating);
};
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
static inline int
zpeachwm_ipc_output_v2_add_listener(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2,
const struct zpeachwm_ipc_output_v2_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zpeachwm_ipc_output_v2,
(void (**)(void)) listener, data);
}
#define ZPEACHWM_IPC_OUTPUT_V2_RELEASE 0
#define ZPEACHWM_IPC_OUTPUT_V2_SET_TAGS 1
#define ZPEACHWM_IPC_OUTPUT_V2_SET_CLIENT_TAGS 2
#define ZPEACHWM_IPC_OUTPUT_V2_SET_LAYOUT 3
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_TOGGLE_VISIBILITY_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_ACTIVE_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_TAG_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_LAYOUT_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_TITLE_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_APPID_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_LAYOUT_SYMBOL_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_FRAME_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION 2
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION 2
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_RELEASE_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_SET_TAGS_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_SET_CLIENT_TAGS_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_SET_LAYOUT_SINCE_VERSION 1
/** @ingroup iface_zpeachwm_ipc_output_v2 */
static inline void
zpeachwm_ipc_output_v2_set_user_data(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zpeachwm_ipc_output_v2, user_data);
}
/** @ingroup iface_zpeachwm_ipc_output_v2 */
static inline void *
zpeachwm_ipc_output_v2_get_user_data(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2)
{
return wl_proxy_get_user_data((struct wl_proxy *) zpeachwm_ipc_output_v2);
}
static inline uint32_t
zpeachwm_ipc_output_v2_get_version(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2)
{
return wl_proxy_get_version((struct wl_proxy *) zpeachwm_ipc_output_v2);
}
/** @ingroup iface_zpeachwm_ipc_output_v2 */
static inline void
zpeachwm_ipc_output_v2_destroy(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2)
{
wl_proxy_destroy((struct wl_proxy *) zpeachwm_ipc_output_v2);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*
* Indicates that the client will not use the peachwm_ipc_output object
* anymore. Objects created through this interface remain valid.
*/
static inline void
zpeachwm_ipc_output_v2_release(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2)
{
wl_proxy_marshal_flags((struct wl_proxy *) zpeachwm_ipc_output_v2,
ZPEACHWM_IPC_OUTPUT_V2_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) zpeachwm_ipc_output_v2), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*
* set the active tags of this output.
*/
static inline void
zpeachwm_ipc_output_v2_set_tags(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2, uint32_t tagmask, uint32_t toggle_tagset)
{
wl_proxy_marshal_flags((struct wl_proxy *) zpeachwm_ipc_output_v2,
ZPEACHWM_IPC_OUTPUT_V2_SET_TAGS, NULL, wl_proxy_get_version((struct wl_proxy *) zpeachwm_ipc_output_v2), 0, tagmask, toggle_tagset);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*
* Set the tags of the focused client.
*/
static inline void
zpeachwm_ipc_output_v2_set_client_tags(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2, uint32_t and_tags, uint32_t xor_tags)
{
wl_proxy_marshal_flags((struct wl_proxy *) zpeachwm_ipc_output_v2,
ZPEACHWM_IPC_OUTPUT_V2_SET_CLIENT_TAGS, NULL, wl_proxy_get_version((struct wl_proxy *) zpeachwm_ipc_output_v2), 0, and_tags, xor_tags);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*
* Set the layout of this output.
*/
static inline void
zpeachwm_ipc_output_v2_set_layout(struct zpeachwm_ipc_output_v2 *zpeachwm_ipc_output_v2, uint32_t index)
{
wl_proxy_marshal_flags((struct wl_proxy *) zpeachwm_ipc_output_v2,
ZPEACHWM_IPC_OUTPUT_V2_SET_LAYOUT, NULL, wl_proxy_get_version((struct wl_proxy *) zpeachwm_ipc_output_v2), 0, index);
}
#ifdef __cplusplus
}
#endif
#endif
Executable
BIN
View File
Binary file not shown.
+507
View File
@@ -0,0 +1,507 @@
/* Generated by wayland-scanner 1.25.0 */
#ifndef CURSOR_SHAPE_V1_SERVER_PROTOCOL_H
#define CURSOR_SHAPE_V1_SERVER_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
#ifdef __cplusplus
extern "C" {
#endif
struct wl_client;
struct wl_resource;
/**
* @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
/**
* @ingroup iface_wp_cursor_shape_manager_v1
* @struct wp_cursor_shape_manager_v1_interface
*/
struct wp_cursor_shape_manager_v1_interface {
/**
* destroy the manager
*
* Destroy the cursor shape manager.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* 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.
*/
void (*get_pointer)(struct wl_client *client,
struct wl_resource *resource,
uint32_t cursor_shape_device,
struct wl_resource *pointer);
/**
* 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.
*/
void (*get_tablet_tool_v2)(struct wl_client *client,
struct wl_resource *resource,
uint32_t cursor_shape_device,
struct wl_resource *tablet_tool);
};
/**
* @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
#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_SHAPE_ENUM_IS_VALID
#define WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ENUM_IS_VALID
/**
* @ingroup iface_wp_cursor_shape_device_v1
* Validate a wp_cursor_shape_device_v1 shape value.
*
* @return true on success, false on error.
* @ref wp_cursor_shape_device_v1_shape
*/
static inline bool
wp_cursor_shape_device_v1_shape_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CONTEXT_MENU:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CELL:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_VERTICAL_TEXT:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALIAS:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COPY:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_MOVE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NO_DROP:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NOT_ALLOWED:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRAB:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRABBING:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_E_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_N_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NE_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NW_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_S_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SE_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SW_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_W_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_IN:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_OUT:
return version >= 1;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DND_ASK:
return version >= 2;
case WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_RESIZE:
return version >= 2;
default:
return false;
}
}
#endif /* WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ENUM_IS_VALID */
#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 */
#ifndef WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM_IS_VALID
#define WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_wp_cursor_shape_device_v1
* Validate a wp_cursor_shape_device_v1 error value.
*
* @return true on success, false on error.
* @ref wp_cursor_shape_device_v1_error
*/
static inline bool
wp_cursor_shape_device_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case WP_CURSOR_SHAPE_DEVICE_V1_ERROR_INVALID_SHAPE:
return version >= 1;
default:
return false;
}
}
#endif /* WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM_IS_VALID */
/**
* @ingroup iface_wp_cursor_shape_device_v1
* @struct wp_cursor_shape_device_v1_interface
*/
struct wp_cursor_shape_device_v1_interface {
/**
* destroy the cursor shape device
*
* Destroy the cursor shape device.
*
* The device cursor shape remains unchanged.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* 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.
* @param serial serial number of the enter event
*/
void (*set_shape)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial,
uint32_t shape);
};
/**
* @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
#ifdef __cplusplus
}
#endif
#endif
+120
View File
@@ -0,0 +1,120 @@
/* Generated by wayland-scanner 1.25.0 */
/*
* Copyright © 2019 Christopher Billington
* Copyright © 2020 Ilia Bozhinov
* Copyright © 2022 Victoria Brekenfeld
*
* 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 ext_workspace_group_handle_v1_interface;
extern const struct wl_interface ext_workspace_handle_v1_interface;
extern const struct wl_interface wl_output_interface;
static const struct wl_interface *ext_workspace_v1_types[] = {
NULL,
&ext_workspace_group_handle_v1_interface,
&ext_workspace_handle_v1_interface,
&wl_output_interface,
&wl_output_interface,
&ext_workspace_handle_v1_interface,
&ext_workspace_handle_v1_interface,
&ext_workspace_group_handle_v1_interface,
};
static const struct wl_message ext_workspace_manager_v1_requests[] = {
{ "commit", "", ext_workspace_v1_types + 0 },
{ "stop", "", ext_workspace_v1_types + 0 },
};
static const struct wl_message ext_workspace_manager_v1_events[] = {
{ "workspace_group", "n", ext_workspace_v1_types + 1 },
{ "workspace", "n", ext_workspace_v1_types + 2 },
{ "done", "", ext_workspace_v1_types + 0 },
{ "finished", "", ext_workspace_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface ext_workspace_manager_v1_interface = {
"ext_workspace_manager_v1", 1,
2, ext_workspace_manager_v1_requests,
4, ext_workspace_manager_v1_events,
};
static const struct wl_message ext_workspace_group_handle_v1_requests[] = {
{ "create_workspace", "s", ext_workspace_v1_types + 0 },
{ "destroy", "", ext_workspace_v1_types + 0 },
};
static const struct wl_message ext_workspace_group_handle_v1_events[] = {
{ "capabilities", "u", ext_workspace_v1_types + 0 },
{ "output_enter", "o", ext_workspace_v1_types + 3 },
{ "output_leave", "o", ext_workspace_v1_types + 4 },
{ "workspace_enter", "o", ext_workspace_v1_types + 5 },
{ "workspace_leave", "o", ext_workspace_v1_types + 6 },
{ "removed", "", ext_workspace_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface ext_workspace_group_handle_v1_interface = {
"ext_workspace_group_handle_v1", 1,
2, ext_workspace_group_handle_v1_requests,
6, ext_workspace_group_handle_v1_events,
};
static const struct wl_message ext_workspace_handle_v1_requests[] = {
{ "destroy", "", ext_workspace_v1_types + 0 },
{ "activate", "", ext_workspace_v1_types + 0 },
{ "deactivate", "", ext_workspace_v1_types + 0 },
{ "assign", "o", ext_workspace_v1_types + 7 },
{ "remove", "", ext_workspace_v1_types + 0 },
};
static const struct wl_message ext_workspace_handle_v1_events[] = {
{ "id", "s", ext_workspace_v1_types + 0 },
{ "name", "s", ext_workspace_v1_types + 0 },
{ "coordinates", "a", ext_workspace_v1_types + 0 },
{ "state", "u", ext_workspace_v1_types + 0 },
{ "capabilities", "u", ext_workspace_v1_types + 0 },
{ "removed", "", ext_workspace_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface ext_workspace_handle_v1_interface = {
"ext_workspace_handle_v1", 1,
5, ext_workspace_handle_v1_requests,
6, ext_workspace_handle_v1_events,
};
+752
View File
@@ -0,0 +1,752 @@
/* Generated by wayland-scanner 1.25.0 */
#ifndef EXT_WORKSPACE_V1_SERVER_PROTOCOL_H
#define EXT_WORKSPACE_V1_SERVER_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
#ifdef __cplusplus
extern "C" {
#endif
struct wl_client;
struct wl_resource;
/**
* @page page_ext_workspace_v1 The ext_workspace_v1 protocol
* @section page_ifaces_ext_workspace_v1 Interfaces
* - @subpage page_iface_ext_workspace_manager_v1 - list and control workspaces
* - @subpage page_iface_ext_workspace_group_handle_v1 - a workspace group assigned to a set of outputs
* - @subpage page_iface_ext_workspace_handle_v1 - a workspace handing a group of surfaces
* @section page_copyright_ext_workspace_v1 Copyright
* <pre>
*
* Copyright © 2019 Christopher Billington
* Copyright © 2020 Ilia Bozhinov
* Copyright © 2022 Victoria Brekenfeld
*
* 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 ext_workspace_group_handle_v1;
struct ext_workspace_handle_v1;
struct ext_workspace_manager_v1;
struct wl_output;
#ifndef EXT_WORKSPACE_MANAGER_V1_INTERFACE
#define EXT_WORKSPACE_MANAGER_V1_INTERFACE
/**
* @page page_iface_ext_workspace_manager_v1 ext_workspace_manager_v1
* @section page_iface_ext_workspace_manager_v1_desc Description
*
* Workspaces, also called virtual desktops, are groups of surfaces. A
* compositor with a concept of workspaces may only show some such groups of
* surfaces (those of 'active' workspaces) at a time. 'Activating' a
* workspace is a request for the compositor to display that workspace's
* surfaces as normal, whereas the compositor may hide or otherwise
* de-emphasise surfaces that are associated only with 'inactive' workspaces.
* Workspaces are grouped by which sets of outputs they correspond to, and
* may contain surfaces only from those outputs. In this way, it is possible
* for each output to have its own set of workspaces, or for all outputs (or
* any other arbitrary grouping) to share workspaces. Compositors may
* optionally conceptually arrange each group of workspaces in an
* N-dimensional grid.
*
* The purpose of this protocol is to enable the creation of taskbars and
* docks by providing them with a list of workspaces and their properties,
* and allowing them to activate and deactivate workspaces.
*
* After a client binds the ext_workspace_manager_v1, each workspace will be
* sent via the workspace event.
* @section page_iface_ext_workspace_manager_v1_api API
* See @ref iface_ext_workspace_manager_v1.
*/
/**
* @defgroup iface_ext_workspace_manager_v1 The ext_workspace_manager_v1 interface
*
* Workspaces, also called virtual desktops, are groups of surfaces. A
* compositor with a concept of workspaces may only show some such groups of
* surfaces (those of 'active' workspaces) at a time. 'Activating' a
* workspace is a request for the compositor to display that workspace's
* surfaces as normal, whereas the compositor may hide or otherwise
* de-emphasise surfaces that are associated only with 'inactive' workspaces.
* Workspaces are grouped by which sets of outputs they correspond to, and
* may contain surfaces only from those outputs. In this way, it is possible
* for each output to have its own set of workspaces, or for all outputs (or
* any other arbitrary grouping) to share workspaces. Compositors may
* optionally conceptually arrange each group of workspaces in an
* N-dimensional grid.
*
* The purpose of this protocol is to enable the creation of taskbars and
* docks by providing them with a list of workspaces and their properties,
* and allowing them to activate and deactivate workspaces.
*
* After a client binds the ext_workspace_manager_v1, each workspace will be
* sent via the workspace event.
*/
extern const struct wl_interface ext_workspace_manager_v1_interface;
#endif
#ifndef EXT_WORKSPACE_GROUP_HANDLE_V1_INTERFACE
#define EXT_WORKSPACE_GROUP_HANDLE_V1_INTERFACE
/**
* @page page_iface_ext_workspace_group_handle_v1 ext_workspace_group_handle_v1
* @section page_iface_ext_workspace_group_handle_v1_desc Description
*
* A ext_workspace_group_handle_v1 object represents a workspace group
* that is assigned a set of outputs and contains a number of workspaces.
*
* The set of outputs assigned to the workspace group is conveyed to the client via
* output_enter and output_leave events, and its workspaces are conveyed with
* workspace events.
*
* For example, a compositor which has a set of workspaces for each output may
* advertise a workspace group (and its workspaces) per output, whereas a compositor
* where a workspace spans all outputs may advertise a single workspace group for all
* outputs.
* @section page_iface_ext_workspace_group_handle_v1_api API
* See @ref iface_ext_workspace_group_handle_v1.
*/
/**
* @defgroup iface_ext_workspace_group_handle_v1 The ext_workspace_group_handle_v1 interface
*
* A ext_workspace_group_handle_v1 object represents a workspace group
* that is assigned a set of outputs and contains a number of workspaces.
*
* The set of outputs assigned to the workspace group is conveyed to the client via
* output_enter and output_leave events, and its workspaces are conveyed with
* workspace events.
*
* For example, a compositor which has a set of workspaces for each output may
* advertise a workspace group (and its workspaces) per output, whereas a compositor
* where a workspace spans all outputs may advertise a single workspace group for all
* outputs.
*/
extern const struct wl_interface ext_workspace_group_handle_v1_interface;
#endif
#ifndef EXT_WORKSPACE_HANDLE_V1_INTERFACE
#define EXT_WORKSPACE_HANDLE_V1_INTERFACE
/**
* @page page_iface_ext_workspace_handle_v1 ext_workspace_handle_v1
* @section page_iface_ext_workspace_handle_v1_desc Description
*
* A ext_workspace_handle_v1 object represents a workspace that handles a
* group of surfaces.
*
* Each workspace has:
* - a name, conveyed to the client with the name event
* - potentially an id conveyed with the id event
* - a list of states, conveyed to the client with the state event
* - and optionally a set of coordinates, conveyed to the client with the
* coordinates event
*
* The client may request that the compositor activate or deactivate the workspace.
*
* Each workspace can belong to only a single workspace group.
* Depending on the compositor policy, there might be workspaces with
* the same name in different workspace groups, but these workspaces are still
* separate (e.g. one of them might be active while the other is not).
* @section page_iface_ext_workspace_handle_v1_api API
* See @ref iface_ext_workspace_handle_v1.
*/
/**
* @defgroup iface_ext_workspace_handle_v1 The ext_workspace_handle_v1 interface
*
* A ext_workspace_handle_v1 object represents a workspace that handles a
* group of surfaces.
*
* Each workspace has:
* - a name, conveyed to the client with the name event
* - potentially an id conveyed with the id event
* - a list of states, conveyed to the client with the state event
* - and optionally a set of coordinates, conveyed to the client with the
* coordinates event
*
* The client may request that the compositor activate or deactivate the workspace.
*
* Each workspace can belong to only a single workspace group.
* Depending on the compositor policy, there might be workspaces with
* the same name in different workspace groups, but these workspaces are still
* separate (e.g. one of them might be active while the other is not).
*/
extern const struct wl_interface ext_workspace_handle_v1_interface;
#endif
/**
* @ingroup iface_ext_workspace_manager_v1
* @struct ext_workspace_manager_v1_interface
*/
struct ext_workspace_manager_v1_interface {
/**
* all requests about the workspaces have been sent
*
* The client must send this request after it has finished
* sending other requests. The compositor must process a series of
* requests preceding a commit request atomically.
*
* This allows changes to the workspace properties to be seen as
* atomic, even if they happen via multiple events, and even if
* they involve multiple ext_workspace_handle_v1 objects, for
* example, deactivating one workspace and activating another.
*/
void (*commit)(struct wl_client *client,
struct wl_resource *resource);
/**
* stop sending events
*
* Indicates the client no longer wishes to receive events for
* new workspace groups. However the compositor may emit further
* workspace events, until the finished event is emitted. The
* compositor is expected to send the finished event eventually
* once the stop request has been processed.
*
* The client must not send any requests after this one, doing so
* will raise a wl_display invalid_object error.
*/
void (*stop)(struct wl_client *client,
struct wl_resource *resource);
};
#define EXT_WORKSPACE_MANAGER_V1_WORKSPACE_GROUP 0
#define EXT_WORKSPACE_MANAGER_V1_WORKSPACE 1
#define EXT_WORKSPACE_MANAGER_V1_DONE 2
#define EXT_WORKSPACE_MANAGER_V1_FINISHED 3
/**
* @ingroup iface_ext_workspace_manager_v1
*/
#define EXT_WORKSPACE_MANAGER_V1_WORKSPACE_GROUP_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_manager_v1
*/
#define EXT_WORKSPACE_MANAGER_V1_WORKSPACE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_manager_v1
*/
#define EXT_WORKSPACE_MANAGER_V1_DONE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_manager_v1
*/
#define EXT_WORKSPACE_MANAGER_V1_FINISHED_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_manager_v1
*/
#define EXT_WORKSPACE_MANAGER_V1_COMMIT_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_manager_v1
*/
#define EXT_WORKSPACE_MANAGER_V1_STOP_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_manager_v1
* Sends an workspace_group event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_manager_v1_send_workspace_group(struct wl_resource *resource_, struct wl_resource *workspace_group)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_MANAGER_V1_WORKSPACE_GROUP, workspace_group);
}
/**
* @ingroup iface_ext_workspace_manager_v1
* Sends an workspace event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_manager_v1_send_workspace(struct wl_resource *resource_, struct wl_resource *workspace)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_MANAGER_V1_WORKSPACE, workspace);
}
/**
* @ingroup iface_ext_workspace_manager_v1
* Sends an done event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_manager_v1_send_done(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_MANAGER_V1_DONE);
}
/**
* @ingroup iface_ext_workspace_manager_v1
* Sends an finished event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_manager_v1_send_finished(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_MANAGER_V1_FINISHED);
}
#ifndef EXT_WORKSPACE_GROUP_HANDLE_V1_GROUP_CAPABILITIES_ENUM
#define EXT_WORKSPACE_GROUP_HANDLE_V1_GROUP_CAPABILITIES_ENUM
enum ext_workspace_group_handle_v1_group_capabilities {
/**
* create_workspace request is available
*/
EXT_WORKSPACE_GROUP_HANDLE_V1_GROUP_CAPABILITIES_CREATE_WORKSPACE = 1,
};
#endif /* EXT_WORKSPACE_GROUP_HANDLE_V1_GROUP_CAPABILITIES_ENUM */
#ifndef EXT_WORKSPACE_GROUP_HANDLE_V1_GROUP_CAPABILITIES_ENUM_IS_VALID
#define EXT_WORKSPACE_GROUP_HANDLE_V1_GROUP_CAPABILITIES_ENUM_IS_VALID
/**
* @ingroup iface_ext_workspace_group_handle_v1
* Validate a ext_workspace_group_handle_v1 group_capabilities value.
*
* @return true on success, false on error.
* @ref ext_workspace_group_handle_v1_group_capabilities
*/
static inline bool
ext_workspace_group_handle_v1_group_capabilities_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
if (version >= 1)
valid |= EXT_WORKSPACE_GROUP_HANDLE_V1_GROUP_CAPABILITIES_CREATE_WORKSPACE;
return (value & ~valid) == 0;
}
#endif /* EXT_WORKSPACE_GROUP_HANDLE_V1_GROUP_CAPABILITIES_ENUM_IS_VALID */
/**
* @ingroup iface_ext_workspace_group_handle_v1
* @struct ext_workspace_group_handle_v1_interface
*/
struct ext_workspace_group_handle_v1_interface {
/**
* create a new workspace
*
* Request that the compositor create a new workspace with the
* given name and assign it to this group.
*
* There is no guarantee that the compositor will create a new
* workspace, or that the created workspace will have the provided
* name.
*/
void (*create_workspace)(struct wl_client *client,
struct wl_resource *resource,
const char *workspace);
/**
* destroy the ext_workspace_group_handle_v1 object
*
* Destroys the ext_workspace_group_handle_v1 object.
*
* This request should be send either when the client does not want
* to use the workspace group object any more or after the removed
* event to finalize the destruction of the object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
#define EXT_WORKSPACE_GROUP_HANDLE_V1_CAPABILITIES 0
#define EXT_WORKSPACE_GROUP_HANDLE_V1_OUTPUT_ENTER 1
#define EXT_WORKSPACE_GROUP_HANDLE_V1_OUTPUT_LEAVE 2
#define EXT_WORKSPACE_GROUP_HANDLE_V1_WORKSPACE_ENTER 3
#define EXT_WORKSPACE_GROUP_HANDLE_V1_WORKSPACE_LEAVE 4
#define EXT_WORKSPACE_GROUP_HANDLE_V1_REMOVED 5
/**
* @ingroup iface_ext_workspace_group_handle_v1
*/
#define EXT_WORKSPACE_GROUP_HANDLE_V1_CAPABILITIES_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_group_handle_v1
*/
#define EXT_WORKSPACE_GROUP_HANDLE_V1_OUTPUT_ENTER_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_group_handle_v1
*/
#define EXT_WORKSPACE_GROUP_HANDLE_V1_OUTPUT_LEAVE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_group_handle_v1
*/
#define EXT_WORKSPACE_GROUP_HANDLE_V1_WORKSPACE_ENTER_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_group_handle_v1
*/
#define EXT_WORKSPACE_GROUP_HANDLE_V1_WORKSPACE_LEAVE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_group_handle_v1
*/
#define EXT_WORKSPACE_GROUP_HANDLE_V1_REMOVED_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_group_handle_v1
*/
#define EXT_WORKSPACE_GROUP_HANDLE_V1_CREATE_WORKSPACE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_group_handle_v1
*/
#define EXT_WORKSPACE_GROUP_HANDLE_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_group_handle_v1
* Sends an capabilities event to the client owning the resource.
* @param resource_ The client's resource
* @param capabilities capabilities
*/
static inline void
ext_workspace_group_handle_v1_send_capabilities(struct wl_resource *resource_, uint32_t capabilities)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_GROUP_HANDLE_V1_CAPABILITIES, capabilities);
}
/**
* @ingroup iface_ext_workspace_group_handle_v1
* Sends an output_enter event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_group_handle_v1_send_output_enter(struct wl_resource *resource_, struct wl_resource *output)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_GROUP_HANDLE_V1_OUTPUT_ENTER, output);
}
/**
* @ingroup iface_ext_workspace_group_handle_v1
* Sends an output_leave event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_group_handle_v1_send_output_leave(struct wl_resource *resource_, struct wl_resource *output)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_GROUP_HANDLE_V1_OUTPUT_LEAVE, output);
}
/**
* @ingroup iface_ext_workspace_group_handle_v1
* Sends an workspace_enter event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_group_handle_v1_send_workspace_enter(struct wl_resource *resource_, struct wl_resource *workspace)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_GROUP_HANDLE_V1_WORKSPACE_ENTER, workspace);
}
/**
* @ingroup iface_ext_workspace_group_handle_v1
* Sends an workspace_leave event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_group_handle_v1_send_workspace_leave(struct wl_resource *resource_, struct wl_resource *workspace)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_GROUP_HANDLE_V1_WORKSPACE_LEAVE, workspace);
}
/**
* @ingroup iface_ext_workspace_group_handle_v1
* Sends an removed event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_group_handle_v1_send_removed(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_GROUP_HANDLE_V1_REMOVED);
}
#ifndef EXT_WORKSPACE_HANDLE_V1_STATE_ENUM
#define EXT_WORKSPACE_HANDLE_V1_STATE_ENUM
/**
* @ingroup iface_ext_workspace_handle_v1
* types of states on the workspace
*
* The different states that a workspace can have.
*/
enum ext_workspace_handle_v1_state {
/**
* the workspace is active
*/
EXT_WORKSPACE_HANDLE_V1_STATE_ACTIVE = 1,
/**
* the workspace requests attention
*/
EXT_WORKSPACE_HANDLE_V1_STATE_URGENT = 2,
/**
* the workspace is not visible
*
* The workspace is not visible in its workspace group, and
* clients attempting to visualize the compositor workspace state
* should not display such workspaces.
*/
EXT_WORKSPACE_HANDLE_V1_STATE_HIDDEN = 4,
};
#endif /* EXT_WORKSPACE_HANDLE_V1_STATE_ENUM */
#ifndef EXT_WORKSPACE_HANDLE_V1_STATE_ENUM_IS_VALID
#define EXT_WORKSPACE_HANDLE_V1_STATE_ENUM_IS_VALID
/**
* @ingroup iface_ext_workspace_handle_v1
* Validate a ext_workspace_handle_v1 state value.
*
* @return true on success, false on error.
* @ref ext_workspace_handle_v1_state
*/
static inline bool
ext_workspace_handle_v1_state_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
if (version >= 1)
valid |= EXT_WORKSPACE_HANDLE_V1_STATE_ACTIVE;
if (version >= 1)
valid |= EXT_WORKSPACE_HANDLE_V1_STATE_URGENT;
if (version >= 1)
valid |= EXT_WORKSPACE_HANDLE_V1_STATE_HIDDEN;
return (value & ~valid) == 0;
}
#endif /* EXT_WORKSPACE_HANDLE_V1_STATE_ENUM_IS_VALID */
#ifndef EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ENUM
#define EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ENUM
enum ext_workspace_handle_v1_workspace_capabilities {
/**
* activate request is available
*/
EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ACTIVATE = 1,
/**
* deactivate request is available
*/
EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_DEACTIVATE = 2,
/**
* remove request is available
*/
EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_REMOVE = 4,
/**
* assign request is available
*/
EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ASSIGN = 8,
};
#endif /* EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ENUM */
#ifndef EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ENUM_IS_VALID
#define EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ENUM_IS_VALID
/**
* @ingroup iface_ext_workspace_handle_v1
* Validate a ext_workspace_handle_v1 workspace_capabilities value.
*
* @return true on success, false on error.
* @ref ext_workspace_handle_v1_workspace_capabilities
*/
static inline bool
ext_workspace_handle_v1_workspace_capabilities_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
if (version >= 1)
valid |= EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ACTIVATE;
if (version >= 1)
valid |= EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_DEACTIVATE;
if (version >= 1)
valid |= EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_REMOVE;
if (version >= 1)
valid |= EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ASSIGN;
return (value & ~valid) == 0;
}
#endif /* EXT_WORKSPACE_HANDLE_V1_WORKSPACE_CAPABILITIES_ENUM_IS_VALID */
/**
* @ingroup iface_ext_workspace_handle_v1
* @struct ext_workspace_handle_v1_interface
*/
struct ext_workspace_handle_v1_interface {
/**
* destroy the ext_workspace_handle_v1 object
*
* Destroys the ext_workspace_handle_v1 object.
*
* This request should be made either when the client does not want
* to use the workspace object any more or after the remove event
* to finalize the destruction of the object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* activate the workspace
*
* Request that this workspace be activated.
*
* There is no guarantee the workspace will be actually activated,
* and behaviour may be compositor-dependent. For example,
* activating a workspace may or may not deactivate all other
* workspaces in the same group.
*/
void (*activate)(struct wl_client *client,
struct wl_resource *resource);
/**
* deactivate the workspace
*
* Request that this workspace be deactivated.
*
* There is no guarantee the workspace will be actually
* deactivated.
*/
void (*deactivate)(struct wl_client *client,
struct wl_resource *resource);
/**
* assign workspace to group
*
* Requests that this workspace is assigned to the given
* workspace group.
*
* There is no guarantee the workspace will be assigned.
*/
void (*assign)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *workspace_group);
/**
* remove the workspace
*
* Request that this workspace be removed.
*
* There is no guarantee the workspace will be actually removed.
*/
void (*remove)(struct wl_client *client,
struct wl_resource *resource);
};
#define EXT_WORKSPACE_HANDLE_V1_ID 0
#define EXT_WORKSPACE_HANDLE_V1_NAME 1
#define EXT_WORKSPACE_HANDLE_V1_COORDINATES 2
#define EXT_WORKSPACE_HANDLE_V1_STATE 3
#define EXT_WORKSPACE_HANDLE_V1_CAPABILITIES 4
#define EXT_WORKSPACE_HANDLE_V1_REMOVED 5
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_ID_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_NAME_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_COORDINATES_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_STATE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_CAPABILITIES_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_REMOVED_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_ACTIVATE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_DEACTIVATE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_ASSIGN_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
*/
#define EXT_WORKSPACE_HANDLE_V1_REMOVE_SINCE_VERSION 1
/**
* @ingroup iface_ext_workspace_handle_v1
* Sends an id event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_handle_v1_send_id(struct wl_resource *resource_, const char *id)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_HANDLE_V1_ID, id);
}
/**
* @ingroup iface_ext_workspace_handle_v1
* Sends an name event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_handle_v1_send_name(struct wl_resource *resource_, const char *name)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_HANDLE_V1_NAME, name);
}
/**
* @ingroup iface_ext_workspace_handle_v1
* Sends an coordinates event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_handle_v1_send_coordinates(struct wl_resource *resource_, struct wl_array *coordinates)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_HANDLE_V1_COORDINATES, coordinates);
}
/**
* @ingroup iface_ext_workspace_handle_v1
* Sends an state event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_handle_v1_send_state(struct wl_resource *resource_, uint32_t state)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_HANDLE_V1_STATE, state);
}
/**
* @ingroup iface_ext_workspace_handle_v1
* Sends an capabilities event to the client owning the resource.
* @param resource_ The client's resource
* @param capabilities capabilities
*/
static inline void
ext_workspace_handle_v1_send_capabilities(struct wl_resource *resource_, uint32_t capabilities)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_HANDLE_V1_CAPABILITIES, capabilities);
}
/**
* @ingroup iface_ext_workspace_handle_v1
* Sends an removed event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
ext_workspace_handle_v1_send_removed(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, EXT_WORKSPACE_HANDLE_V1_REMOVED);
}
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,94 @@
/* Generated by wayland-scanner 1.25.0 */
/*
* Copyright (C) 2022 Russell Newcomb
*
* 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 zpeachwm_ipc_output_v2_interface;
static const struct wl_interface *peachwm_ipc_unstable_v2_types[] = {
NULL,
NULL,
NULL,
NULL,
&zpeachwm_ipc_output_v2_interface,
&wl_output_interface,
};
static const struct wl_message zpeachwm_ipc_manager_v2_requests[] = {
{ "release", "", peachwm_ipc_unstable_v2_types + 0 },
{ "get_output", "no", peachwm_ipc_unstable_v2_types + 4 },
};
static const struct wl_message zpeachwm_ipc_manager_v2_events[] = {
{ "tags", "u", peachwm_ipc_unstable_v2_types + 0 },
{ "layout", "s", peachwm_ipc_unstable_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zpeachwm_ipc_manager_v2_interface = {
"zpeachwm_ipc_manager_v2", 2,
2, zpeachwm_ipc_manager_v2_requests,
2, zpeachwm_ipc_manager_v2_events,
};
static const struct wl_message zpeachwm_ipc_output_v2_requests[] = {
{ "release", "", peachwm_ipc_unstable_v2_types + 0 },
{ "set_tags", "uu", peachwm_ipc_unstable_v2_types + 0 },
{ "set_client_tags", "uu", peachwm_ipc_unstable_v2_types + 0 },
{ "set_layout", "u", peachwm_ipc_unstable_v2_types + 0 },
};
static const struct wl_message zpeachwm_ipc_output_v2_events[] = {
{ "toggle_visibility", "", peachwm_ipc_unstable_v2_types + 0 },
{ "active", "u", peachwm_ipc_unstable_v2_types + 0 },
{ "tag", "uuuu", peachwm_ipc_unstable_v2_types + 0 },
{ "layout", "u", peachwm_ipc_unstable_v2_types + 0 },
{ "title", "s", peachwm_ipc_unstable_v2_types + 0 },
{ "appid", "s", peachwm_ipc_unstable_v2_types + 0 },
{ "layout_symbol", "s", peachwm_ipc_unstable_v2_types + 0 },
{ "frame", "", peachwm_ipc_unstable_v2_types + 0 },
{ "fullscreen", "2u", peachwm_ipc_unstable_v2_types + 0 },
{ "floating", "2u", peachwm_ipc_unstable_v2_types + 0 },
};
WL_PRIVATE const struct wl_interface zpeachwm_ipc_output_v2_interface = {
"zpeachwm_ipc_output_v2", 2,
4, zpeachwm_ipc_output_v2_requests,
10, zpeachwm_ipc_output_v2_events,
};
@@ -0,0 +1,447 @@
/* Generated by wayland-scanner 1.25.0 */
#ifndef PEACHWM_IPC_UNSTABLE_V2_SERVER_PROTOCOL_H
#define PEACHWM_IPC_UNSTABLE_V2_SERVER_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
#ifdef __cplusplus
extern "C" {
#endif
struct wl_client;
struct wl_resource;
/**
* @page page_peachwm_ipc_unstable_v2 The peachwm_ipc_unstable_v2 protocol
* @section page_ifaces_peachwm_ipc_unstable_v2 Interfaces
* - @subpage page_iface_zpeachwm_ipc_manager_v2 - manage peachwm state
* - @subpage page_iface_zpeachwm_ipc_output_v2 - interact with peachwm output state
* @section page_copyright_peachwm_ipc_unstable_v2 Copyright
* <pre>
*
* Copyright (C) 2022 Russell Newcomb
*
* 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_output;
struct zpeachwm_ipc_manager_v2;
struct zpeachwm_ipc_output_v2;
#ifndef ZPEACHWM_IPC_MANAGER_V2_INTERFACE
#define ZPEACHWM_IPC_MANAGER_V2_INTERFACE
/**
* @page page_iface_zpeachwm_ipc_manager_v2 zpeachwm_ipc_manager_v2
* @section page_iface_zpeachwm_ipc_manager_v2_desc Description
*
* This interface is exposed as a global in the Wayland registry and allows
* clients to query and set peachwm state.
*
* 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 is reset.
* @section page_iface_zpeachwm_ipc_manager_v2_api API
* See @ref iface_zpeachwm_ipc_manager_v2.
*/
/**
* @defgroup iface_zpeachwm_ipc_manager_v2 The zpeachwm_ipc_manager_v2 interface
*
* This interface is exposed as a global in the Wayland registry and allows
* clients to query and set peachwm state.
*
* 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 is reset.
*/
extern const struct wl_interface zpeachwm_ipc_manager_v2_interface;
#endif
#ifndef ZPEACHWM_IPC_OUTPUT_V2_INTERFACE
#define ZPEACHWM_IPC_OUTPUT_V2_INTERFACE
/**
* @page page_iface_zpeachwm_ipc_output_v2 zpeachwm_ipc_output_v2
* @section page_iface_zpeachwm_ipc_output_v2_desc Description
*
* Observe and control a peachwm output.
* @section page_iface_zpeachwm_ipc_output_v2_api API
* See @ref iface_zpeachwm_ipc_output_v2.
*/
/**
* @defgroup iface_zpeachwm_ipc_output_v2 The zpeachwm_ipc_output_v2 interface
*
* Observe and control a peachwm output.
*/
extern const struct wl_interface zpeachwm_ipc_output_v2_interface;
#endif
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
* @struct zpeachwm_ipc_manager_v2_interface
*/
struct zpeachwm_ipc_manager_v2_interface {
/**
* release peachwm_ipc_manager
*
* Indicates that the client will not use the manager object
* anymore. Objects created through this interface remain valid.
*/
void (*release)(struct wl_client *client,
struct wl_resource *resource);
/**
* get a peachwm_ipc_output for a wl_output
*
* Get a peachwm_ipc_output for the given wl_output.
*/
void (*get_output)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *output);
};
#define ZPEACHWM_IPC_MANAGER_V2_TAGS 0
#define ZPEACHWM_IPC_MANAGER_V2_LAYOUT 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
#define ZPEACHWM_IPC_MANAGER_V2_TAGS_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
#define ZPEACHWM_IPC_MANAGER_V2_LAYOUT_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
#define ZPEACHWM_IPC_MANAGER_V2_RELEASE_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
*/
#define ZPEACHWM_IPC_MANAGER_V2_GET_OUTPUT_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
* Sends an tags event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_manager_v2_send_tags(struct wl_resource *resource_, uint32_t amount)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_MANAGER_V2_TAGS, amount);
}
/**
* @ingroup iface_zpeachwm_ipc_manager_v2
* Sends an layout event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_manager_v2_send_layout(struct wl_resource *resource_, const char *name)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_MANAGER_V2_LAYOUT, name);
}
#ifndef ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM
#define ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM
enum zpeachwm_ipc_output_v2_tag_state {
/**
* no state
*/
ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_NONE = 0,
/**
* tag is active
*/
ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ACTIVE = 1,
/**
* tag has urgent client
*/
ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_URGENT = 2,
};
#endif /* ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM */
#ifndef ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM_IS_VALID
#define ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM_IS_VALID
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Validate a zpeachwm_ipc_output_v2 tag_state value.
*
* @return true on success, false on error.
* @ref zpeachwm_ipc_output_v2_tag_state
*/
static inline bool
zpeachwm_ipc_output_v2_tag_state_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_NONE:
return version >= 1;
case ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ACTIVE:
return version >= 1;
case ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_URGENT:
return version >= 1;
default:
return false;
}
}
#endif /* ZPEACHWM_IPC_OUTPUT_V2_TAG_STATE_ENUM_IS_VALID */
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* @struct zpeachwm_ipc_output_v2_interface
*/
struct zpeachwm_ipc_output_v2_interface {
/**
* release peachwm_ipc_output
*
* Indicates that the client will not use the peachwm_ipc_output
* object anymore. Objects created through this interface remain
* valid.
*/
void (*release)(struct wl_client *client,
struct wl_resource *resource);
/**
* set the active tags of this output
*
* set the active tags of this output.
* @param tagmask bitmask of the tags that should be set
* @param toggle_tagset whether to toggle the tagset
*/
void (*set_tags)(struct wl_client *client,
struct wl_resource *resource,
uint32_t tagmask,
uint32_t toggle_tagset);
/**
* set the tags of the focused client
*
* Set the tags of the focused client.
*/
void (*set_client_tags)(struct wl_client *client,
struct wl_resource *resource,
uint32_t and_tags,
uint32_t xor_tags);
/**
* set the layout of this output
*
* Set the layout of this output.
*/
void (*set_layout)(struct wl_client *client,
struct wl_resource *resource,
uint32_t index);
};
#define ZPEACHWM_IPC_OUTPUT_V2_TOGGLE_VISIBILITY 0
#define ZPEACHWM_IPC_OUTPUT_V2_ACTIVE 1
#define ZPEACHWM_IPC_OUTPUT_V2_TAG 2
#define ZPEACHWM_IPC_OUTPUT_V2_LAYOUT 3
#define ZPEACHWM_IPC_OUTPUT_V2_TITLE 4
#define ZPEACHWM_IPC_OUTPUT_V2_APPID 5
#define ZPEACHWM_IPC_OUTPUT_V2_LAYOUT_SYMBOL 6
#define ZPEACHWM_IPC_OUTPUT_V2_FRAME 7
#define ZPEACHWM_IPC_OUTPUT_V2_FULLSCREEN 8
#define ZPEACHWM_IPC_OUTPUT_V2_FLOATING 9
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_TOGGLE_VISIBILITY_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_ACTIVE_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_TAG_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_LAYOUT_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_TITLE_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_APPID_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_LAYOUT_SYMBOL_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_FRAME_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION 2
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION 2
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_RELEASE_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_SET_TAGS_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_SET_CLIENT_TAGS_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
*/
#define ZPEACHWM_IPC_OUTPUT_V2_SET_LAYOUT_SINCE_VERSION 1
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an toggle_visibility event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_output_v2_send_toggle_visibility(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_TOGGLE_VISIBILITY);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an active event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_output_v2_send_active(struct wl_resource *resource_, uint32_t active)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_ACTIVE, active);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an tag event to the client owning the resource.
* @param resource_ The client's resource
* @param tag index of the tag
* @param state state of the tag
* @param clients number of clients in tag
* @param focused 1 if focused client is in this tag
*/
static inline void
zpeachwm_ipc_output_v2_send_tag(struct wl_resource *resource_, uint32_t tag, uint32_t state, uint32_t clients, uint32_t focused)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_TAG, tag, state, clients, focused);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an layout event to the client owning the resource.
* @param resource_ The client's resource
* @param layout index of the layout
*/
static inline void
zpeachwm_ipc_output_v2_send_layout(struct wl_resource *resource_, uint32_t layout)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_LAYOUT, layout);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an title event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_output_v2_send_title(struct wl_resource *resource_, const char *title)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_TITLE, title);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an appid event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_output_v2_send_appid(struct wl_resource *resource_, const char *appid)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_APPID, appid);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an layout_symbol event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_output_v2_send_layout_symbol(struct wl_resource *resource_, const char *layout)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_LAYOUT_SYMBOL, layout);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an frame event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_output_v2_send_frame(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_FRAME);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an fullscreen event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_output_v2_send_fullscreen(struct wl_resource *resource_, uint32_t is_fullscreen)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_FULLSCREEN, is_fullscreen);
}
/**
* @ingroup iface_zpeachwm_ipc_output_v2
* Sends an floating event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zpeachwm_ipc_output_v2_send_floating(struct wl_resource *resource_, uint32_t is_floating)
{
wl_resource_post_event(resource_, ZPEACHWM_IPC_OUTPUT_V2_FLOATING, is_floating);
}
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,615 @@
/* Generated by wayland-scanner 1.25.0 */
#ifndef POINTER_CONSTRAINTS_UNSTABLE_V1_SERVER_PROTOCOL_H
#define POINTER_CONSTRAINTS_UNSTABLE_V1_SERVER_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
#ifdef __cplusplus
extern "C" {
#endif
struct wl_client;
struct wl_resource;
/**
* @page page_pointer_constraints_unstable_v1 The pointer_constraints_unstable_v1 protocol
* protocol for constraining pointer motions
*
* @section page_desc_pointer_constraints_unstable_v1 Description
*
* This protocol specifies a set of interfaces used for adding constraints to
* the motion of a pointer. Possible constraints include confining pointer
* motions to a given region, or locking it to its current position.
*
* In order to constrain the pointer, a client must first bind the global
* interface "wp_pointer_constraints" which, if a compositor supports pointer
* constraints, is exposed by the registry. Using the bound global object, the
* client uses the request that corresponds to the type of constraint it wants
* to make. See wp_pointer_constraints for more details.
*
* 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_pointer_constraints_unstable_v1 Interfaces
* - @subpage page_iface_zwp_pointer_constraints_v1 - constrain the movement of a pointer
* - @subpage page_iface_zwp_locked_pointer_v1 - receive relative pointer motion events
* - @subpage page_iface_zwp_confined_pointer_v1 - confined pointer object
* @section page_copyright_pointer_constraints_unstable_v1 Copyright
* <pre>
*
* Copyright © 2014 Jonas Ådahl
* Copyright © 2015 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_pointer;
struct wl_region;
struct wl_surface;
struct zwp_confined_pointer_v1;
struct zwp_locked_pointer_v1;
struct zwp_pointer_constraints_v1;
#ifndef ZWP_POINTER_CONSTRAINTS_V1_INTERFACE
#define ZWP_POINTER_CONSTRAINTS_V1_INTERFACE
/**
* @page page_iface_zwp_pointer_constraints_v1 zwp_pointer_constraints_v1
* @section page_iface_zwp_pointer_constraints_v1_desc Description
*
* The global interface exposing pointer constraining functionality. It
* exposes two requests: lock_pointer for locking the pointer to its
* position, and confine_pointer for locking the pointer to a region.
*
* The lock_pointer and confine_pointer requests create the objects
* wp_locked_pointer and wp_confined_pointer respectively, and the client can
* use these objects to interact with the lock.
*
* For any surface, only one lock or confinement may be active across all
* wl_pointer objects of the same seat. If a lock or confinement is requested
* when another lock or confinement is active or requested on the same surface
* and with any of the wl_pointer objects of the same seat, an
* 'already_constrained' error will be raised.
* @section page_iface_zwp_pointer_constraints_v1_api API
* See @ref iface_zwp_pointer_constraints_v1.
*/
/**
* @defgroup iface_zwp_pointer_constraints_v1 The zwp_pointer_constraints_v1 interface
*
* The global interface exposing pointer constraining functionality. It
* exposes two requests: lock_pointer for locking the pointer to its
* position, and confine_pointer for locking the pointer to a region.
*
* The lock_pointer and confine_pointer requests create the objects
* wp_locked_pointer and wp_confined_pointer respectively, and the client can
* use these objects to interact with the lock.
*
* For any surface, only one lock or confinement may be active across all
* wl_pointer objects of the same seat. If a lock or confinement is requested
* when another lock or confinement is active or requested on the same surface
* and with any of the wl_pointer objects of the same seat, an
* 'already_constrained' error will be raised.
*/
extern const struct wl_interface zwp_pointer_constraints_v1_interface;
#endif
#ifndef ZWP_LOCKED_POINTER_V1_INTERFACE
#define ZWP_LOCKED_POINTER_V1_INTERFACE
/**
* @page page_iface_zwp_locked_pointer_v1 zwp_locked_pointer_v1
* @section page_iface_zwp_locked_pointer_v1_desc Description
*
* The wp_locked_pointer interface represents a locked pointer state.
*
* While the lock of this object is active, the wl_pointer objects of the
* associated seat will not emit any wl_pointer.motion events.
*
* This object will send the event 'locked' when the lock is activated.
* Whenever the lock is activated, it is guaranteed that the locked surface
* will already have received pointer focus and that the pointer will be
* within the region passed to the request creating this object.
*
* To unlock the pointer, send the destroy request. This will also destroy
* the wp_locked_pointer object.
*
* If the compositor decides to unlock the pointer the unlocked event is
* sent. See wp_locked_pointer.unlock for details.
*
* When unlocking, the compositor may warp the cursor position to the set
* cursor position hint. If it does, it will not result in any relative
* motion events emitted via wp_relative_pointer.
*
* If the surface the lock was requested on is destroyed and the lock is not
* yet activated, the wp_locked_pointer object is now defunct and must be
* destroyed.
* @section page_iface_zwp_locked_pointer_v1_api API
* See @ref iface_zwp_locked_pointer_v1.
*/
/**
* @defgroup iface_zwp_locked_pointer_v1 The zwp_locked_pointer_v1 interface
*
* The wp_locked_pointer interface represents a locked pointer state.
*
* While the lock of this object is active, the wl_pointer objects of the
* associated seat will not emit any wl_pointer.motion events.
*
* This object will send the event 'locked' when the lock is activated.
* Whenever the lock is activated, it is guaranteed that the locked surface
* will already have received pointer focus and that the pointer will be
* within the region passed to the request creating this object.
*
* To unlock the pointer, send the destroy request. This will also destroy
* the wp_locked_pointer object.
*
* If the compositor decides to unlock the pointer the unlocked event is
* sent. See wp_locked_pointer.unlock for details.
*
* When unlocking, the compositor may warp the cursor position to the set
* cursor position hint. If it does, it will not result in any relative
* motion events emitted via wp_relative_pointer.
*
* If the surface the lock was requested on is destroyed and the lock is not
* yet activated, the wp_locked_pointer object is now defunct and must be
* destroyed.
*/
extern const struct wl_interface zwp_locked_pointer_v1_interface;
#endif
#ifndef ZWP_CONFINED_POINTER_V1_INTERFACE
#define ZWP_CONFINED_POINTER_V1_INTERFACE
/**
* @page page_iface_zwp_confined_pointer_v1 zwp_confined_pointer_v1
* @section page_iface_zwp_confined_pointer_v1_desc Description
*
* The wp_confined_pointer interface represents a confined pointer state.
*
* This object will send the event 'confined' when the confinement is
* activated. Whenever the confinement is activated, it is guaranteed that
* the surface the pointer is confined to will already have received pointer
* focus and that the pointer will be within the region passed to the request
* creating this object. It is up to the compositor to decide whether this
* requires some user interaction and if the pointer will warp to within the
* passed region if outside.
*
* To unconfine the pointer, send the destroy request. This will also destroy
* the wp_confined_pointer object.
*
* If the compositor decides to unconfine the pointer the unconfined event is
* sent. The wp_confined_pointer object is at this point defunct and should
* be destroyed.
* @section page_iface_zwp_confined_pointer_v1_api API
* See @ref iface_zwp_confined_pointer_v1.
*/
/**
* @defgroup iface_zwp_confined_pointer_v1 The zwp_confined_pointer_v1 interface
*
* The wp_confined_pointer interface represents a confined pointer state.
*
* This object will send the event 'confined' when the confinement is
* activated. Whenever the confinement is activated, it is guaranteed that
* the surface the pointer is confined to will already have received pointer
* focus and that the pointer will be within the region passed to the request
* creating this object. It is up to the compositor to decide whether this
* requires some user interaction and if the pointer will warp to within the
* passed region if outside.
*
* To unconfine the pointer, send the destroy request. This will also destroy
* the wp_confined_pointer object.
*
* If the compositor decides to unconfine the pointer the unconfined event is
* sent. The wp_confined_pointer object is at this point defunct and should
* be destroyed.
*/
extern const struct wl_interface zwp_confined_pointer_v1_interface;
#endif
#ifndef ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM
#define ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM
/**
* @ingroup iface_zwp_pointer_constraints_v1
* wp_pointer_constraints error values
*
* These errors can be emitted in response to wp_pointer_constraints
* requests.
*/
enum zwp_pointer_constraints_v1_error {
/**
* pointer constraint already requested on that surface
*/
ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED = 1,
};
#endif /* ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM */
#ifndef ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM_IS_VALID
#define ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_zwp_pointer_constraints_v1
* Validate a zwp_pointer_constraints_v1 error value.
*
* @return true on success, false on error.
* @ref zwp_pointer_constraints_v1_error
*/
static inline bool
zwp_pointer_constraints_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED:
return version >= 1;
default:
return false;
}
}
#endif /* ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM_IS_VALID */
#ifndef ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM
#define ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM
/**
* @ingroup iface_zwp_pointer_constraints_v1
* constraint lifetime
*
* These values represent different lifetime semantics. They are passed
* as arguments to the factory requests to specify how the constraint
* lifetimes should be managed.
*/
enum zwp_pointer_constraints_v1_lifetime {
/**
* the pointer constraint is defunct once deactivated
*
* A oneshot pointer constraint will never reactivate once it has
* been deactivated. See the corresponding deactivation event
* (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined)
* for details.
*/
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT = 1,
/**
* the pointer constraint may reactivate
*
* A persistent pointer constraint may again reactivate once it
* has been deactivated. See the corresponding deactivation event
* (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined)
* for details.
*/
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT = 2,
};
#endif /* ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM */
#ifndef ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM_IS_VALID
#define ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM_IS_VALID
/**
* @ingroup iface_zwp_pointer_constraints_v1
* Validate a zwp_pointer_constraints_v1 lifetime value.
*
* @return true on success, false on error.
* @ref zwp_pointer_constraints_v1_lifetime
*/
static inline bool
zwp_pointer_constraints_v1_lifetime_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT:
return version >= 1;
case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT:
return version >= 1;
default:
return false;
}
}
#endif /* ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM_IS_VALID */
/**
* @ingroup iface_zwp_pointer_constraints_v1
* @struct zwp_pointer_constraints_v1_interface
*/
struct zwp_pointer_constraints_v1_interface {
/**
* destroy the pointer constraints manager object
*
* Used by the client to notify the server that it will no longer
* use this pointer constraints object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* lock pointer to a position
*
* The lock_pointer request lets the client request to disable
* movements of the virtual pointer (i.e. the cursor), effectively
* locking the pointer to a position. This request may not take
* effect immediately; in the future, when the compositor deems
* implementation-specific constraints are satisfied, the pointer
* lock will be activated and the compositor sends a locked event.
*
* The protocol provides no guarantee that the constraints are ever
* satisfied, and does not require the compositor to send an error
* if the constraints cannot ever be satisfied. It is thus possible
* to request a lock that will never activate.
*
* There may not be another pointer constraint of any kind
* requested or active on the surface for any of the wl_pointer
* objects of the seat of the passed pointer when requesting a
* lock. If there is, an error will be raised. See general pointer
* lock documentation for more details.
*
* The intersection of the region passed with this request and the
* input region of the surface is used to determine where the
* pointer must be in order for the lock to activate. It is up to
* the compositor whether to warp the pointer or require some kind
* of user interaction for the lock to activate. If the region is
* null the surface input region is used.
*
* A surface may receive pointer focus without the lock being
* activated.
*
* The request creates a new object wp_locked_pointer which is used
* to interact with the lock as well as receive updates about its
* state. See the the description of wp_locked_pointer for further
* information.
*
* Note that while a pointer is locked, the wl_pointer objects of
* the corresponding seat will not emit any wl_pointer.motion
* events, but relative motion events will still be emitted via
* wp_relative_pointer objects of the same seat. wl_pointer.axis
* and wl_pointer.button events are unaffected.
* @param surface surface to lock pointer to
* @param pointer the pointer that should be locked
* @param region region of surface
* @param lifetime lock lifetime
*/
void (*lock_pointer)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface,
struct wl_resource *pointer,
struct wl_resource *region,
uint32_t lifetime);
/**
* confine pointer to a region
*
* The confine_pointer request lets the client request to confine
* the pointer cursor to a given region. This request may not take
* effect immediately; in the future, when the compositor deems
* implementation- specific constraints are satisfied, the pointer
* confinement will be activated and the compositor sends a
* confined event.
*
* The intersection of the region passed with this request and the
* input region of the surface is used to determine where the
* pointer must be in order for the confinement to activate. It is
* up to the compositor whether to warp the pointer or require some
* kind of user interaction for the confinement to activate. If the
* region is null the surface input region is used.
*
* The request will create a new object wp_confined_pointer which
* is used to interact with the confinement as well as receive
* updates about its state. See the the description of
* wp_confined_pointer for further information.
* @param surface surface to lock pointer to
* @param pointer the pointer that should be confined
* @param region region of surface
* @param lifetime confinement lifetime
*/
void (*confine_pointer)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface,
struct wl_resource *pointer,
struct wl_resource *region,
uint32_t lifetime);
};
/**
* @ingroup iface_zwp_pointer_constraints_v1
*/
#define ZWP_POINTER_CONSTRAINTS_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_pointer_constraints_v1
*/
#define ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER_SINCE_VERSION 1
/**
* @ingroup iface_zwp_pointer_constraints_v1
*/
#define ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
* @struct zwp_locked_pointer_v1_interface
*/
struct zwp_locked_pointer_v1_interface {
/**
* destroy the locked pointer object
*
* Destroy the locked pointer object. If applicable, the
* compositor will unlock the pointer.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* set the pointer cursor position hint
*
* Set the cursor position hint relative to the top left corner
* of the surface.
*
* If the client is drawing its own cursor, it should update the
* position hint to the position of its own cursor. A compositor
* may use this information to warp the pointer upon unlock in
* order to avoid pointer jumps.
*
* The cursor position hint is double-buffered state, see
* wl_surface.commit.
* @param surface_x surface-local x coordinate
* @param surface_y surface-local y coordinate
*/
void (*set_cursor_position_hint)(struct wl_client *client,
struct wl_resource *resource,
wl_fixed_t surface_x,
wl_fixed_t surface_y);
/**
* set a new lock region
*
* Set a new region used to lock the pointer.
*
* The new lock region is double-buffered, see wl_surface.commit.
*
* For details about the lock region, see wp_locked_pointer.
* @param region region of surface
*/
void (*set_region)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *region);
};
#define ZWP_LOCKED_POINTER_V1_LOCKED 0
#define ZWP_LOCKED_POINTER_V1_UNLOCKED 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_LOCKED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_UNLOCKED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_SET_CURSOR_POSITION_HINT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_SET_REGION_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
* Sends an locked event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_locked_pointer_v1_send_locked(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_LOCKED_POINTER_V1_LOCKED);
}
/**
* @ingroup iface_zwp_locked_pointer_v1
* Sends an unlocked event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_locked_pointer_v1_send_unlocked(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_LOCKED_POINTER_V1_UNLOCKED);
}
/**
* @ingroup iface_zwp_confined_pointer_v1
* @struct zwp_confined_pointer_v1_interface
*/
struct zwp_confined_pointer_v1_interface {
/**
* destroy the confined pointer object
*
* Destroy the confined pointer object. If applicable, the
* compositor will unconfine the pointer.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* set a new confine region
*
* Set a new region used to confine the pointer.
*
* The new confine region is double-buffered, see
* wl_surface.commit.
*
* If the confinement is active when the new confinement region is
* applied and the pointer ends up outside of newly applied region,
* the pointer may warped to a position within the new confinement
* region. If warped, a wl_pointer.motion event will be emitted,
* but no wp_relative_pointer.relative_motion event.
*
* The compositor may also, instead of using the new region,
* unconfine the pointer.
*
* For details about the confine region, see wp_confined_pointer.
* @param region region of surface
*/
void (*set_region)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *region);
};
#define ZWP_CONFINED_POINTER_V1_CONFINED 0
#define ZWP_CONFINED_POINTER_V1_UNCONFINED 1
/**
* @ingroup iface_zwp_confined_pointer_v1
*/
#define ZWP_CONFINED_POINTER_V1_CONFINED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_confined_pointer_v1
*/
#define ZWP_CONFINED_POINTER_V1_UNCONFINED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_confined_pointer_v1
*/
#define ZWP_CONFINED_POINTER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_confined_pointer_v1
*/
#define ZWP_CONFINED_POINTER_V1_SET_REGION_SINCE_VERSION 1
/**
* @ingroup iface_zwp_confined_pointer_v1
* Sends an confined event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_confined_pointer_v1_send_confined(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_CONFINED_POINTER_V1_CONFINED);
}
/**
* @ingroup iface_zwp_confined_pointer_v1
* Sends an unconfined event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_confined_pointer_v1_send_unconfined(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_CONFINED_POINTER_V1_UNCONFINED);
}
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,730 @@
/* Generated by wayland-scanner 1.25.0 */
#ifndef WLR_LAYER_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H
#define WLR_LAYER_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
#ifdef __cplusplus
extern "C" {
#endif
struct wl_client;
struct wl_resource;
/**
* @page page_wlr_layer_shell_unstable_v1 The wlr_layer_shell_unstable_v1 protocol
* @section page_ifaces_wlr_layer_shell_unstable_v1 Interfaces
* - @subpage page_iface_zwlr_layer_shell_v1 - create surfaces that are layers of the desktop
* - @subpage page_iface_zwlr_layer_surface_v1 - layer metadata interface
* @section page_copyright_wlr_layer_shell_unstable_v1 Copyright
* <pre>
*
* Copyright © 2017 Drew DeVault
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
* </pre>
*/
struct wl_output;
struct wl_surface;
struct xdg_popup;
struct zwlr_layer_shell_v1;
struct zwlr_layer_surface_v1;
#ifndef ZWLR_LAYER_SHELL_V1_INTERFACE
#define ZWLR_LAYER_SHELL_V1_INTERFACE
/**
* @page page_iface_zwlr_layer_shell_v1 zwlr_layer_shell_v1
* @section page_iface_zwlr_layer_shell_v1_desc Description
*
* Clients can use this interface to assign the surface_layer role to
* wl_surfaces. Such surfaces are assigned to a "layer" of the output and
* rendered with a defined z-depth respective to each other. They may also be
* anchored to the edges and corners of a screen and specify input handling
* semantics. This interface should be suitable for the implementation of
* many desktop shell components, and a broad number of other applications
* that interact with the desktop.
* @section page_iface_zwlr_layer_shell_v1_api API
* See @ref iface_zwlr_layer_shell_v1.
*/
/**
* @defgroup iface_zwlr_layer_shell_v1 The zwlr_layer_shell_v1 interface
*
* Clients can use this interface to assign the surface_layer role to
* wl_surfaces. Such surfaces are assigned to a "layer" of the output and
* rendered with a defined z-depth respective to each other. They may also be
* anchored to the edges and corners of a screen and specify input handling
* semantics. This interface should be suitable for the implementation of
* many desktop shell components, and a broad number of other applications
* that interact with the desktop.
*/
extern const struct wl_interface zwlr_layer_shell_v1_interface;
#endif
#ifndef ZWLR_LAYER_SURFACE_V1_INTERFACE
#define ZWLR_LAYER_SURFACE_V1_INTERFACE
/**
* @page page_iface_zwlr_layer_surface_v1 zwlr_layer_surface_v1
* @section page_iface_zwlr_layer_surface_v1_desc Description
*
* An interface that may be implemented by a wl_surface, for surfaces that
* are designed to be rendered as a layer of a stacked desktop-like
* environment.
*
* Layer surface state (layer, size, anchor, exclusive zone,
* margin, interactivity) is double-buffered, and will be applied at the
* time wl_surface.commit of the corresponding wl_surface is called.
*
* Attaching a null buffer to a layer surface unmaps it.
*
* Unmapping a layer_surface means that the surface cannot be shown by the
* compositor until it is explicitly mapped again. The layer_surface
* returns to the state it had right after layer_shell.get_layer_surface.
* The client can re-map the surface by performing a commit without any
* buffer attached, waiting for a configure event and handling it as usual.
* @section page_iface_zwlr_layer_surface_v1_api API
* See @ref iface_zwlr_layer_surface_v1.
*/
/**
* @defgroup iface_zwlr_layer_surface_v1 The zwlr_layer_surface_v1 interface
*
* An interface that may be implemented by a wl_surface, for surfaces that
* are designed to be rendered as a layer of a stacked desktop-like
* environment.
*
* Layer surface state (layer, size, anchor, exclusive zone,
* margin, interactivity) is double-buffered, and will be applied at the
* time wl_surface.commit of the corresponding wl_surface is called.
*
* Attaching a null buffer to a layer surface unmaps it.
*
* Unmapping a layer_surface means that the surface cannot be shown by the
* compositor until it is explicitly mapped again. The layer_surface
* returns to the state it had right after layer_shell.get_layer_surface.
* The client can re-map the surface by performing a commit without any
* buffer attached, waiting for a configure event and handling it as usual.
*/
extern const struct wl_interface zwlr_layer_surface_v1_interface;
#endif
#ifndef ZWLR_LAYER_SHELL_V1_ERROR_ENUM
#define ZWLR_LAYER_SHELL_V1_ERROR_ENUM
enum zwlr_layer_shell_v1_error {
/**
* wl_surface has another role
*/
ZWLR_LAYER_SHELL_V1_ERROR_ROLE = 0,
/**
* layer value is invalid
*/
ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER = 1,
/**
* wl_surface has a buffer attached or committed
*/
ZWLR_LAYER_SHELL_V1_ERROR_ALREADY_CONSTRUCTED = 2,
};
#endif /* ZWLR_LAYER_SHELL_V1_ERROR_ENUM */
#ifndef ZWLR_LAYER_SHELL_V1_ERROR_ENUM_IS_VALID
#define ZWLR_LAYER_SHELL_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_layer_shell_v1
* Validate a zwlr_layer_shell_v1 error value.
*
* @return true on success, false on error.
* @ref zwlr_layer_shell_v1_error
*/
static inline bool
zwlr_layer_shell_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWLR_LAYER_SHELL_V1_ERROR_ROLE:
return version >= 1;
case ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER:
return version >= 1;
case ZWLR_LAYER_SHELL_V1_ERROR_ALREADY_CONSTRUCTED:
return version >= 1;
default:
return false;
}
}
#endif /* ZWLR_LAYER_SHELL_V1_ERROR_ENUM_IS_VALID */
#ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM
#define ZWLR_LAYER_SHELL_V1_LAYER_ENUM
/**
* @ingroup iface_zwlr_layer_shell_v1
* available layers for surfaces
*
* These values indicate which layers a surface can be rendered in. They
* are ordered by z depth, bottom-most first. Traditional shell surfaces
* will typically be rendered between the bottom and top layers.
* Fullscreen shell surfaces are typically rendered at the top layer.
* Multiple surfaces can share a single layer, and ordering within a
* single layer is undefined.
*/
enum zwlr_layer_shell_v1_layer {
ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND = 0,
ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM = 1,
ZWLR_LAYER_SHELL_V1_LAYER_TOP = 2,
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY = 3,
};
#endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM */
#ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM_IS_VALID
#define ZWLR_LAYER_SHELL_V1_LAYER_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_layer_shell_v1
* Validate a zwlr_layer_shell_v1 layer value.
*
* @return true on success, false on error.
* @ref zwlr_layer_shell_v1_layer
*/
static inline bool
zwlr_layer_shell_v1_layer_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND:
return version >= 1;
case ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM:
return version >= 1;
case ZWLR_LAYER_SHELL_V1_LAYER_TOP:
return version >= 1;
case ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY:
return version >= 1;
default:
return false;
}
}
#endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM_IS_VALID */
/**
* @ingroup iface_zwlr_layer_shell_v1
* @struct zwlr_layer_shell_v1_interface
*/
struct zwlr_layer_shell_v1_interface {
/**
* create a layer_surface from a surface
*
* Create a layer surface for an existing surface. This assigns
* the role of layer_surface, or raises a protocol error if another
* role is already assigned.
*
* Creating a layer surface from a wl_surface which has a buffer
* attached or committed is a client error, and any attempts by a
* client to attach or manipulate a buffer prior to the first
* layer_surface.configure call must also be treated as errors.
*
* After creating a layer_surface object and setting it up, the
* client must perform an initial commit without any buffer
* attached. The compositor will reply with a
* layer_surface.configure event. The client must acknowledge it
* and is then allowed to attach a buffer to map the surface.
*
* You may pass NULL for output to allow the compositor to decide
* which output to use. Generally this will be the one that the
* user most recently interacted with.
*
* Clients can specify a namespace that defines the purpose of the
* layer surface.
* @param layer layer to add this surface to
* @param namespace namespace for the layer surface
*/
void (*get_layer_surface)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface,
struct wl_resource *output,
uint32_t layer,
const char *namespace);
/**
* destroy the layer_shell object
*
* This request indicates that the client will not use the
* layer_shell object any more. Objects that have been created
* through this instance are not affected.
* @since 3
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
/**
* @ingroup iface_zwlr_layer_shell_v1
*/
#define ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_shell_v1
*/
#define ZWLR_LAYER_SHELL_V1_DESTROY_SINCE_VERSION 3
#ifndef ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM
#define ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM
/**
* @ingroup iface_zwlr_layer_surface_v1
* types of keyboard interaction possible for a layer shell surface
*
* Types of keyboard interaction possible for layer shell surfaces. The
* rationale for this is twofold: (1) some applications are not interested
* in keyboard events and not allowing them to be focused can improve the
* desktop experience; (2) some applications will want to take exclusive
* keyboard focus.
*/
enum zwlr_layer_surface_v1_keyboard_interactivity {
/**
* no keyboard focus is possible
*
* This value indicates that this surface is not interested in
* keyboard events and the compositor should never assign it the
* keyboard focus.
*
* This is the default value, set for newly created layer shell
* surfaces.
*
* This is useful for e.g. desktop widgets that display information
* or only have interaction with non-keyboard input devices.
*/
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE = 0,
/**
* request exclusive keyboard focus
*
* Request exclusive keyboard focus if this surface is above the
* shell surface layer.
*
* For the top and overlay layers, the seat will always give
* exclusive keyboard focus to the top-most layer which has
* keyboard interactivity set to exclusive. If this layer contains
* multiple surfaces with keyboard interactivity set to exclusive,
* the compositor determines the one receiving keyboard events in
* an implementation- defined manner. In this case, no guarantee is
* made when this surface will receive keyboard focus (if ever).
*
* For the bottom and background layers, the compositor is allowed
* to use normal focus semantics.
*
* This setting is mainly intended for applications that need to
* ensure they receive all keyboard events, such as a lock screen
* or a password prompt.
*/
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE = 1,
/**
* request regular keyboard focus semantics
*
* This requests the compositor to allow this surface to be
* focused and unfocused by the user in an implementation-defined
* manner. The user should be able to unfocus this surface even
* regardless of the layer it is on.
*
* Typically, the compositor will want to use its normal mechanism
* to manage keyboard focus between layer shell surfaces with this
* setting and regular toplevels on the desktop layer (e.g. click
* to focus). Nevertheless, it is possible for a compositor to
* require a special interaction to focus or unfocus layer shell
* surfaces (e.g. requiring a click even if focus follows the mouse
* normally, or providing a keybinding to switch focus between
* layers).
*
* This setting is mainly intended for desktop shell components
* (e.g. panels) that allow keyboard interaction. Using this option
* can allow implementing a desktop shell that can be fully usable
* without the mouse.
* @since 4
*/
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND = 2,
};
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND_SINCE_VERSION 4
#endif /* ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM */
#ifndef ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM_IS_VALID
#define ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_layer_surface_v1
* Validate a zwlr_layer_surface_v1 keyboard_interactivity value.
*
* @return true on success, false on error.
* @ref zwlr_layer_surface_v1_keyboard_interactivity
*/
static inline bool
zwlr_layer_surface_v1_keyboard_interactivity_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE:
return version >= 1;
case ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE:
return version >= 1;
case ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND:
return version >= 4;
default:
return false;
}
}
#endif /* ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM_IS_VALID */
#ifndef ZWLR_LAYER_SURFACE_V1_ERROR_ENUM
#define ZWLR_LAYER_SURFACE_V1_ERROR_ENUM
enum zwlr_layer_surface_v1_error {
/**
* provided surface state is invalid
*/
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SURFACE_STATE = 0,
/**
* size is invalid
*/
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE = 1,
/**
* anchor bitfield is invalid
*/
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_ANCHOR = 2,
/**
* keyboard interactivity is invalid
*/
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_KEYBOARD_INTERACTIVITY = 3,
};
#endif /* ZWLR_LAYER_SURFACE_V1_ERROR_ENUM */
#ifndef ZWLR_LAYER_SURFACE_V1_ERROR_ENUM_IS_VALID
#define ZWLR_LAYER_SURFACE_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_layer_surface_v1
* Validate a zwlr_layer_surface_v1 error value.
*
* @return true on success, false on error.
* @ref zwlr_layer_surface_v1_error
*/
static inline bool
zwlr_layer_surface_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SURFACE_STATE:
return version >= 1;
case ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE:
return version >= 1;
case ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_ANCHOR:
return version >= 1;
case ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_KEYBOARD_INTERACTIVITY:
return version >= 1;
default:
return false;
}
}
#endif /* ZWLR_LAYER_SURFACE_V1_ERROR_ENUM_IS_VALID */
#ifndef ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM
#define ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM
enum zwlr_layer_surface_v1_anchor {
/**
* the top edge of the anchor rectangle
*/
ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP = 1,
/**
* the bottom edge of the anchor rectangle
*/
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM = 2,
/**
* the left edge of the anchor rectangle
*/
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT = 4,
/**
* the right edge of the anchor rectangle
*/
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT = 8,
};
#endif /* ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM */
#ifndef ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM_IS_VALID
#define ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_layer_surface_v1
* Validate a zwlr_layer_surface_v1 anchor value.
*
* @return true on success, false on error.
* @ref zwlr_layer_surface_v1_anchor
*/
static inline bool
zwlr_layer_surface_v1_anchor_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
if (version >= 1)
valid |= ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP;
if (version >= 1)
valid |= ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
if (version >= 1)
valid |= ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT;
if (version >= 1)
valid |= ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
return (value & ~valid) == 0;
}
#endif /* ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM_IS_VALID */
/**
* @ingroup iface_zwlr_layer_surface_v1
* @struct zwlr_layer_surface_v1_interface
*/
struct zwlr_layer_surface_v1_interface {
/**
* sets the size of the surface
*
* Sets the size of the surface in surface-local coordinates. The
* compositor will display the surface centered with respect to its
* anchors.
*
* If you pass 0 for either value, the compositor will assign it
* and inform you of the assignment in the configure event. You
* must set your anchor to opposite edges in the dimensions you
* omit; not doing so is a protocol error. Both values are 0 by
* default.
*
* Size is double-buffered, see wl_surface.commit.
*/
void (*set_size)(struct wl_client *client,
struct wl_resource *resource,
uint32_t width,
uint32_t height);
/**
* configures the anchor point of the surface
*
* Requests that the compositor anchor the surface to the
* specified edges and corners. If two orthogonal edges are
* specified (e.g. 'top' and 'left'), then the anchor point will be
* the intersection of the edges (e.g. the top left corner of the
* output); otherwise the anchor point will be centered on that
* edge, or in the center if none is specified.
*
* Anchor is double-buffered, see wl_surface.commit.
*/
void (*set_anchor)(struct wl_client *client,
struct wl_resource *resource,
uint32_t anchor);
/**
* configures the exclusive geometry of this surface
*
* Requests that the compositor avoids occluding an area with
* other surfaces. The compositor's use of this information is
* implementation-dependent - do not assume that this region will
* not actually be occluded.
*
* A positive value is only meaningful if the surface is anchored
* to one edge or an edge and both perpendicular edges. If the
* surface is not anchored, anchored to only two perpendicular
* edges (a corner), anchored to only two parallel edges or
* anchored to all edges, a positive value will be treated the same
* as zero.
*
* A positive zone is the distance from the edge in surface-local
* coordinates to consider exclusive.
*
* Surfaces that do not wish to have an exclusive zone may instead
* specify how they should interact with surfaces that do. If set
* to zero, the surface indicates that it would like to be moved to
* avoid occluding surfaces with a positive exclusive zone. If set
* to -1, the surface indicates that it would not like to be moved
* to accommodate for other surfaces, and the compositor should
* extend it all the way to the edges it is anchored to.
*
* For example, a panel might set its exclusive zone to 10, so that
* maximized shell surfaces are not shown on top of it. A
* notification might set its exclusive zone to 0, so that it is
* moved to avoid occluding the panel, but shell surfaces are shown
* underneath it. A wallpaper or lock screen might set their
* exclusive zone to -1, so that they stretch below or over the
* panel.
*
* The default value is 0.
*
* Exclusive zone is double-buffered, see wl_surface.commit.
*/
void (*set_exclusive_zone)(struct wl_client *client,
struct wl_resource *resource,
int32_t zone);
/**
* sets a margin from the anchor point
*
* Requests that the surface be placed some distance away from
* the anchor point on the output, in surface-local coordinates.
* Setting this value for edges you are not anchored to has no
* effect.
*
* The exclusive zone includes the margin.
*
* Margin is double-buffered, see wl_surface.commit.
*/
void (*set_margin)(struct wl_client *client,
struct wl_resource *resource,
int32_t top,
int32_t right,
int32_t bottom,
int32_t left);
/**
* requests keyboard events
*
* Set how keyboard events are delivered to this surface. By
* default, layer shell surfaces do not receive keyboard events;
* this request can be used to change this.
*
* This setting is inherited by child surfaces set by the get_popup
* request.
*
* Layer surfaces receive pointer, touch, and tablet events
* normally. If you do not want to receive them, set the input
* region on your surface to an empty region.
*
* Keyboard interactivity is double-buffered, see
* wl_surface.commit.
*/
void (*set_keyboard_interactivity)(struct wl_client *client,
struct wl_resource *resource,
uint32_t keyboard_interactivity);
/**
* assign this layer_surface as an xdg_popup parent
*
* This assigns an xdg_popup's parent to this layer_surface. This
* popup should have been created via xdg_surface::get_popup with
* the parent set to NULL, and this request must be invoked before
* committing the popup's initial state.
*
* See the documentation of xdg_popup for more details about what
* an xdg_popup is and how it is used.
*/
void (*get_popup)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *popup);
/**
* ack a configure event
*
* When a configure event is received, if a client commits the
* surface in response to the configure event, then the client must
* make an ack_configure request sometime before the commit
* request, passing along the serial of the configure event.
*
* If the client receives multiple configure events before it can
* respond to one, it only has to ack the last configure event.
*
* A client is not required to commit immediately after sending an
* ack_configure request - it may even ack_configure several times
* before its next surface commit.
*
* A client may send multiple ack_configure requests before
* committing, but only the last request sent before a commit
* indicates which configure event the client really is responding
* to.
* @param serial the serial from the configure event
*/
void (*ack_configure)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial);
/**
* destroy the layer_surface
*
* This request destroys the layer surface.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* change the layer of the surface
*
* Change the layer that the surface is rendered on.
*
* Layer is double-buffered, see wl_surface.commit.
* @param layer layer to move this surface to
* @since 2
*/
void (*set_layer)(struct wl_client *client,
struct wl_resource *resource,
uint32_t layer);
};
#define ZWLR_LAYER_SURFACE_V1_CONFIGURE 0
#define ZWLR_LAYER_SURFACE_V1_CLOSED 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_CONFIGURE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_CLOSED_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_SIZE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_ANCHOR_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_MARGIN_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_GET_POPUP_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_layer_surface_v1
*/
#define ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION 2
/**
* @ingroup iface_zwlr_layer_surface_v1
* Sends an configure event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwlr_layer_surface_v1_send_configure(struct wl_resource *resource_, uint32_t serial, uint32_t width, uint32_t height)
{
wl_resource_post_event(resource_, ZWLR_LAYER_SURFACE_V1_CONFIGURE, serial, width, height);
}
/**
* @ingroup iface_zwlr_layer_surface_v1
* Sends an closed event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwlr_layer_surface_v1_send_closed(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWLR_LAYER_SURFACE_V1_CLOSED);
}
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,285 @@
/* Generated by wayland-scanner 1.25.0 */
#ifndef WLR_OUTPUT_POWER_MANAGEMENT_UNSTABLE_V1_SERVER_PROTOCOL_H
#define WLR_OUTPUT_POWER_MANAGEMENT_UNSTABLE_V1_SERVER_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-server.h"
#ifdef __cplusplus
extern "C" {
#endif
struct wl_client;
struct wl_resource;
/**
* @page page_wlr_output_power_management_unstable_v1 The wlr_output_power_management_unstable_v1 protocol
* Control power management modes of outputs
*
* @section page_desc_wlr_output_power_management_unstable_v1 Description
*
* This protocol allows clients to control power management modes
* of outputs that are currently part of the compositor space. The
* intent is to allow special clients like desktop shells to power
* down outputs when the system is idle.
*
* To modify outputs not currently part of the compositor space see
* wlr-output-management.
*
* 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_output_power_management_unstable_v1 Interfaces
* - @subpage page_iface_zwlr_output_power_manager_v1 - manager to create per-output power management
* - @subpage page_iface_zwlr_output_power_v1 - adjust power management mode for an output
* @section page_copyright_wlr_output_power_management_unstable_v1 Copyright
* <pre>
*
* Copyright © 2019 Purism SPC
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_output;
struct zwlr_output_power_manager_v1;
struct zwlr_output_power_v1;
#ifndef ZWLR_OUTPUT_POWER_MANAGER_V1_INTERFACE
#define ZWLR_OUTPUT_POWER_MANAGER_V1_INTERFACE
/**
* @page page_iface_zwlr_output_power_manager_v1 zwlr_output_power_manager_v1
* @section page_iface_zwlr_output_power_manager_v1_desc Description
*
* This interface is a manager that allows creating per-output power
* management mode controls.
* @section page_iface_zwlr_output_power_manager_v1_api API
* See @ref iface_zwlr_output_power_manager_v1.
*/
/**
* @defgroup iface_zwlr_output_power_manager_v1 The zwlr_output_power_manager_v1 interface
*
* This interface is a manager that allows creating per-output power
* management mode controls.
*/
extern const struct wl_interface zwlr_output_power_manager_v1_interface;
#endif
#ifndef ZWLR_OUTPUT_POWER_V1_INTERFACE
#define ZWLR_OUTPUT_POWER_V1_INTERFACE
/**
* @page page_iface_zwlr_output_power_v1 zwlr_output_power_v1
* @section page_iface_zwlr_output_power_v1_desc Description
*
* This object offers requests to set the power management mode of
* an output.
* @section page_iface_zwlr_output_power_v1_api API
* See @ref iface_zwlr_output_power_v1.
*/
/**
* @defgroup iface_zwlr_output_power_v1 The zwlr_output_power_v1 interface
*
* This object offers requests to set the power management mode of
* an output.
*/
extern const struct wl_interface zwlr_output_power_v1_interface;
#endif
/**
* @ingroup iface_zwlr_output_power_manager_v1
* @struct zwlr_output_power_manager_v1_interface
*/
struct zwlr_output_power_manager_v1_interface {
/**
* get a power management for an output
*
* Create a output power management mode control that can be used
* to adjust the power management mode for a given output.
*/
void (*get_output_power)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *output);
/**
* destroy the manager
*
* All objects created by the manager will still remain valid,
* until their appropriate destroy request has been called.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
/**
* @ingroup iface_zwlr_output_power_manager_v1
*/
#define ZWLR_OUTPUT_POWER_MANAGER_V1_GET_OUTPUT_POWER_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_output_power_manager_v1
*/
#define ZWLR_OUTPUT_POWER_MANAGER_V1_DESTROY_SINCE_VERSION 1
#ifndef ZWLR_OUTPUT_POWER_V1_MODE_ENUM
#define ZWLR_OUTPUT_POWER_V1_MODE_ENUM
enum zwlr_output_power_v1_mode {
/**
* Output is turned off.
*/
ZWLR_OUTPUT_POWER_V1_MODE_OFF = 0,
/**
* Output is turned on, no power saving
*/
ZWLR_OUTPUT_POWER_V1_MODE_ON = 1,
};
#endif /* ZWLR_OUTPUT_POWER_V1_MODE_ENUM */
#ifndef ZWLR_OUTPUT_POWER_V1_MODE_ENUM_IS_VALID
#define ZWLR_OUTPUT_POWER_V1_MODE_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_output_power_v1
* Validate a zwlr_output_power_v1 mode value.
*
* @return true on success, false on error.
* @ref zwlr_output_power_v1_mode
*/
static inline bool
zwlr_output_power_v1_mode_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWLR_OUTPUT_POWER_V1_MODE_OFF:
return version >= 1;
case ZWLR_OUTPUT_POWER_V1_MODE_ON:
return version >= 1;
default:
return false;
}
}
#endif /* ZWLR_OUTPUT_POWER_V1_MODE_ENUM_IS_VALID */
#ifndef ZWLR_OUTPUT_POWER_V1_ERROR_ENUM
#define ZWLR_OUTPUT_POWER_V1_ERROR_ENUM
enum zwlr_output_power_v1_error {
/**
* inexistent power save mode
*/
ZWLR_OUTPUT_POWER_V1_ERROR_INVALID_MODE = 1,
};
#endif /* ZWLR_OUTPUT_POWER_V1_ERROR_ENUM */
#ifndef ZWLR_OUTPUT_POWER_V1_ERROR_ENUM_IS_VALID
#define ZWLR_OUTPUT_POWER_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_output_power_v1
* Validate a zwlr_output_power_v1 error value.
*
* @return true on success, false on error.
* @ref zwlr_output_power_v1_error
*/
static inline bool
zwlr_output_power_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
case ZWLR_OUTPUT_POWER_V1_ERROR_INVALID_MODE:
return version >= 1;
default:
return false;
}
}
#endif /* ZWLR_OUTPUT_POWER_V1_ERROR_ENUM_IS_VALID */
/**
* @ingroup iface_zwlr_output_power_v1
* @struct zwlr_output_power_v1_interface
*/
struct zwlr_output_power_v1_interface {
/**
* Set an outputs power save mode
*
* Set an output's power save mode to the given mode. The mode
* change is effective immediately. If the output does not support
* the given mode a failed event is sent.
* @param mode the power save mode to set
*/
void (*set_mode)(struct wl_client *client,
struct wl_resource *resource,
uint32_t mode);
/**
* destroy this power management
*
* Destroys the output power management mode control object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
#define ZWLR_OUTPUT_POWER_V1_MODE 0
#define ZWLR_OUTPUT_POWER_V1_FAILED 1
/**
* @ingroup iface_zwlr_output_power_v1
*/
#define ZWLR_OUTPUT_POWER_V1_MODE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_output_power_v1
*/
#define ZWLR_OUTPUT_POWER_V1_FAILED_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_output_power_v1
*/
#define ZWLR_OUTPUT_POWER_V1_SET_MODE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_output_power_v1
*/
#define ZWLR_OUTPUT_POWER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_output_power_v1
* Sends an mode event to the client owning the resource.
* @param resource_ The client's resource
* @param mode the output's new power management mode
*/
static inline void
zwlr_output_power_v1_send_mode(struct wl_resource *resource_, uint32_t mode)
{
wl_resource_post_event(resource_, ZWLR_OUTPUT_POWER_V1_MODE, mode);
}
/**
* @ingroup iface_zwlr_output_power_v1
* Sends an failed event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwlr_output_power_v1_send_failed(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWLR_OUTPUT_POWER_V1_FAILED);
}
#ifdef __cplusplus
}
#endif
#endif
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -5,6 +5,7 @@
#include "client.h"
#include "ipc.h"
#include "layout.h"
#include "util.h"
/* IPC globals */
@@ -75,7 +76,7 @@ ipc_send_output_state(IpcOutput *ipc_out)
}
/* layout symbol */
zpeachwm_ipc_output_v2_send_layout_symbol(res, m->ltsymbol[current_tag_idx(m)]);
zpeachwm_ipc_output_v2_send_layout_symbol(res, m->cold->ltsymbol[current_tag_idx(m)]);
/* title/appid/fullscreen/floating */
if (c) {
@@ -171,10 +172,11 @@ ipc_output_handle_set_layout(struct wl_client *client,
if (!m || idx >= (uint32_t)layout_count) return;
int ti = current_tag_idx(m);
if (m->lt[ti][m->sellt[ti]] != &layouts[idx])
m->sellt[ti] ^= 1;
m->lt[ti][m->sellt[ti]] = &layouts[idx];
strncpy(m->ltsymbol[ti], layouts[idx].symbol, LENGTH(m->ltsymbol[ti]));
ensure_cold(m);
if (m->cold->lt[ti][m->cold->sellt[ti]] != &layouts[idx])
m->cold->sellt[ti] ^= 1;
m->cold->lt[ti][m->cold->sellt[ti]] = &layouts[idx];
strncpy(m->cold->ltsymbol[ti], layouts[idx].symbol, LENGTH(m->cold->ltsymbol[ti]));
arrange(m);
printstatus();
}
+2 -2
View File
@@ -384,7 +384,7 @@ ipc_build_workspace(struct json_writer *w, Monitor *m, uint32_t tag_bit,
json_object_end(w);
json_key_string(w, "output", m->wlr_output->name);
json_key_string(w, "layout", m->ltsymbol[tag_idx]);
json_key_string(w, "layout", m->cold->ltsymbol[tag_idx]);
json_key_string(w, "representation", "");
json_key_string(w, "type", "workspace");
@@ -675,7 +675,7 @@ ipc_handle_get_tree(struct ipc_client *client)
json_key_string(&w, "type", "workspace");
json_key_string(&w, "name",
ipc_tag_name(i));
json_key_string(&w, "layout", m->ltsymbol[i]);
json_key_string(&w, "layout", m->cold->ltsymbol[i]);
json_key(&w, "rect");
json_object_start(&w);
+34 -14
View File
@@ -40,6 +40,21 @@ const unsigned int layout_count = LENGTH(layouts);
* helpers
* ================================================================ */
/* Allocate and default-initialize monitor cold state on first use. */
void
ensure_cold(Monitor *m)
{
if (m->cold)
return;
m->cold = ecalloc(1, sizeof(MonitorCold));
for (int i = 0; i < TAGCOUNT; i++) {
m->cold->lt[i][0] = &layouts[0];
m->cold->lt[i][1] = &layouts[0];
}
m->cold->mfact = 0.55f;
m->cold->nmaster = 1;
}
/*
* Returns the 0-based index of the lowest set tag bit for monitor m.
* For single-tag views this is the exact tag. For multi-tag views it
@@ -64,7 +79,8 @@ const Layout *
curlayout(Monitor *m)
{
int ti = current_tag_idx(m);
return m->lt[ti][m->sellt[ti]];
ensure_cold(m);
return m->cold->lt[ti][m->cold->sellt[ti]];
}
/* ================================================================
@@ -230,10 +246,10 @@ void
dwindle_remove_client(Client *c)
{
Monitor *m = c->mon;
if (!m)
if (!m || !m->cold)
return;
for (int i = 0; i < TAGCOUNT; i++)
dwindle_remove(&m->dwindle_root[i], c);
dwindle_remove(&m->cold->dwindle_root[i], c);
}
/* ================================================================
@@ -243,6 +259,7 @@ dwindle_remove_client(Client *c)
void
dwindle(Monitor *m)
{
ensure_cold(m);
Client *c;
int n = 0, e;
@@ -258,7 +275,7 @@ dwindle(Monitor *m)
: 0;
int ti = current_tag_idx(m);
DwindleNode **root = &m->dwindle_root[ti];
DwindleNode **root = &m->cold->dwindle_root[ti];
/* prune leaves whose clients are no longer tiled here */
{
@@ -295,11 +312,11 @@ dwindle(Monitor *m)
/*
* Insert any newly visible client, splitting the focused node.
* Use m->dwindle_focus[ti] so it actually splits what the user
* Use m->cold->dwindle_focus[ti] so it actually splits what the user
* was looking at when they spawned the window, rather than whatever
* focustop() happens to return.
*/
Client *focused = m->dwindle_focus[ti];
Client *focused = m->cold->dwindle_focus[ti];
wl_list_for_each(c, &clients, link) {
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
@@ -329,13 +346,14 @@ dwindle(Monitor *m)
static void
master_arrange(Monitor *m, int ti)
{
ensure_cold(m);
Client *c, *master_c = nullptr;
Client *stack[256];
int nstack = 0, n = 0;
wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, m) && !c->isfloating) {
if (c == m->master_master[ti])
if (c == m->cold->master_master[ti])
master_c = c;
if (!c->isfullscreen)
n++;
@@ -348,7 +366,7 @@ master_arrange(Monitor *m, int ti)
if (!master_c) {
wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen) {
m->master_master[ti] = c;
m->cold->master_master[ti] = c;
master_c = c;
break;
}
@@ -374,9 +392,9 @@ master_arrange(Monitor *m, int ti)
return;
}
int master_w = MAX(1, (int)(aw * m->mfact));
int master_w = MAX(1, (int)(aw * m->cold->mfact));
if (m->master_side[ti] == 0) {
if (m->cold->master_side[ti] == 0) {
int stack_x = m->w.x + e + master_w + e;
int stack_w = MAX(1, aw - master_w - e);
@@ -421,11 +439,11 @@ void
master_remove_client(Client *c)
{
Monitor *m = c->mon;
if (!m)
if (!m || !m->cold)
return;
for (int i = 0; i < TAGCOUNT; i++) {
if (m->master_master[i] == c)
m->master_master[i] = nullptr;
if (m->cold->master_master[i] == c)
m->cold->master_master[i] = nullptr;
}
}
@@ -479,8 +497,10 @@ swaptiled(Client *a, Client *b)
return;
wl_list_for_each(m, &mons, link) {
if (!m->cold)
continue;
for (int i = 0; i < TAGCOUNT; i++) {
DwindleNode **root = &m->dwindle_root[i];
DwindleNode **root = &m->cold->dwindle_root[i];
if (!*root)
continue;
DwindleNode *la = dwindle_find_leaf(*root, a);
+1
View File
@@ -26,6 +26,7 @@ void monocle(Monitor *m);
/* helpers used across modules */
[[nodiscard]] int current_tag_idx(Monitor *m);
[[nodiscard]] const Layout *curlayout(Monitor *m);
void ensure_cold(Monitor *m);
/* dwindle tree helpers (exposed for swapdir) */
[[nodiscard]] DwindleNode *dwindle_find_leaf(DwindleNode *n, Client *c);
+44 -38
View File
@@ -401,21 +401,22 @@ static void apply_workspace_layout(Monitor *m, int tag_idx) {
if (!layout_name[0])
return;
/* ensure_cold will be called by whichever write path triggers first */
for (int li = 0; li < (int)layout_count; li++) {
if (layouts[li].symbol && !strcmp(layout_name, layouts[li].symbol)) {
m->lt[tag_idx][m->sellt[tag_idx]] = &layouts[li];
m->cold->lt[tag_idx][m->cold->sellt[tag_idx]] = &layouts[li];
break;
}
if (!strcmp(layout_name, "dwindle") && layouts[li].arrange == dwindle) {
m->lt[tag_idx][m->sellt[tag_idx]] = &layouts[li];
m->cold->lt[tag_idx][m->cold->sellt[tag_idx]] = &layouts[li];
break;
}
if (!strcmp(layout_name, "master") && layouts[li].arrange == master) {
m->lt[tag_idx][m->sellt[tag_idx]] = &layouts[li];
m->cold->lt[tag_idx][m->cold->sellt[tag_idx]] = &layouts[li];
break;
}
if (!strcmp(layout_name, "monocle") && layouts[li].arrange == monocle) {
m->lt[tag_idx][m->sellt[tag_idx]] = &layouts[li];
m->cold->lt[tag_idx][m->cold->sellt[tag_idx]] = &layouts[li];
break;
}
}
@@ -481,8 +482,8 @@ void arrange(Monitor *m) {
(c = focustop(m)) && c->isfullscreen);
int ti = current_tag_idx(m);
strncpy(m->ltsymbol[ti], curlayout(m)->symbol, LENGTH(m->ltsymbol[ti]));
m->ltsymbol[ti][LENGTH(m->ltsymbol[ti]) - 1] = '\0';
strncpy(m->cold->ltsymbol[ti], curlayout(m)->symbol, LENGTH(m->cold->ltsymbol[ti]));
m->cold->ltsymbol[ti][LENGTH(m->cold->ltsymbol[ti]) - 1] = '\0';
/* We move all clients (except fullscreen and unmanaged) to LyrTile while
* in floating layout to avoid "real" floating clients be always on top */
@@ -756,9 +757,10 @@ static void cleanupmon(struct wl_listener *listener, void *data) {
closemon(m);
ext_workspace_cleanupmon(m);
ipc_socket_send_output_event();
for (int i = 0; i < TAGCOUNT; i++) {
dwindle_free_tree(m->dwindle_root[i]);
m->dwindle_root[i] = nullptr;
if (m->cold) {
for (int i = 0; i < TAGCOUNT; i++)
dwindle_free_tree(m->cold->dwindle_root[i]);
free(m->cold);
}
wlr_scene_node_destroy(&m->fullscreen_bg->node);
free(m);
@@ -1077,8 +1079,10 @@ static void createmon(struct wl_listener *listener, void *data) {
if (!r->name[0] || strstr(wlr_output->name, r->name)) {
m->m.x = r->x;
m->m.y = r->y;
m->mfact = r->mfact;
m->nmaster = r->nmaster;
/* Allocate cold state lazily via the shared helper */
ensure_cold(m);
m->cold->mfact = r->mfact;
m->cold->nmaster = r->nmaster;
/* Determine monitor's default layout */
const Layout *mon_layout = &layouts[0];
for (int li = 0; li < (int)layout_count; li++) {
@@ -1102,15 +1106,15 @@ static void createmon(struct wl_listener *listener, void *data) {
const Layout *alt_layout = &layouts[layout_count > 1 && mon_layout != &layouts[1]];
/* Propagate monitor layout to all tags */
for (int ti = 0; ti < TAGCOUNT; ti++) {
m->lt[ti][0] = mon_layout;
m->lt[ti][1] = alt_layout;
m->sellt[ti] = 0;
m->cold->lt[ti][0] = mon_layout;
m->cold->lt[ti][1] = alt_layout;
m->cold->sellt[ti] = 0;
}
/* Apply per-workspace default layout for all tags */
for (int ti = 0; ti < TAGCOUNT; ti++)
apply_workspace_layout(m, ti);
strncpy(m->ltsymbol[0], curlayout(m)->symbol, LENGTH(m->ltsymbol[0]));
m->ltsymbol[0][LENGTH(m->ltsymbol[0]) - 1] = '\0';
strncpy(m->cold->ltsymbol[0], curlayout(m)->symbol, LENGTH(m->cold->ltsymbol[0]));
m->cold->ltsymbol[0][LENGTH(m->cold->ltsymbol[0]) - 1] = '\0';
wlr_output_state_set_scale(&state, r->scale);
wlr_output_state_set_transform(&state, r->transform);
break;
@@ -1474,8 +1478,8 @@ void focusclient(Client *c, int lift) {
c->isurgent = 0;
/* Track focused client for dwindle insertion anchor */
if (c->mon && !c->isfloating && !c->isfullscreen)
c->mon->dwindle_focus[current_tag_idx(c->mon)] = c;
if (c->mon && !c->isfloating && !c->isfullscreen && c->mon->cold)
c->mon->cold->dwindle_focus[current_tag_idx(c->mon)] = c;
/* Don't change border color if there is an exclusive focus or we are
* handling a drag operation */
@@ -2507,7 +2511,7 @@ void printstatus(void) {
printf("%s tags %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "\n",
m->wlr_output->name, occ, m->tagset[m->seltags], sel, urg);
int _ti = current_tag_idx(m);
printf("%s layout %s\n", m->wlr_output->name, m->ltsymbol[_ti]);
printf("%s layout %s\n", m->wlr_output->name, m->cold->ltsymbol[_ti]);
ext_workspace_printstatus(m);
}
fflush(stdout);
@@ -2853,26 +2857,27 @@ static void setfullscreen(Client *c, int fullscreen) {
static void setlayout(const Arg *arg) {
if (!selmon)
return;
ensure_cold(selmon);
int ti = current_tag_idx(selmon);
/* arg->ui is an index into layouts[]. If out of range, just toggle. */
if (arg && arg->ui < layout_count) {
if (selmon->lt[ti][selmon->sellt[ti]] != &layouts[arg->ui])
selmon->sellt[ti] ^= 1;
selmon->lt[ti][selmon->sellt[ti]] = &layouts[arg->ui];
if (selmon->cold->lt[ti][selmon->cold->sellt[ti]] != &layouts[arg->ui])
selmon->cold->sellt[ti] ^= 1;
selmon->cold->lt[ti][selmon->cold->sellt[ti]] = &layouts[arg->ui];
} else {
selmon->sellt[ti] ^= 1;
selmon->cold->sellt[ti] ^= 1;
}
strncpy(selmon->ltsymbol[ti], selmon->lt[ti][selmon->sellt[ti]]->symbol,
LENGTH(selmon->ltsymbol[ti]));
selmon->ltsymbol[ti][LENGTH(selmon->ltsymbol[ti]) - 1] = '\0';
strncpy(selmon->cold->ltsymbol[ti], selmon->cold->lt[ti][selmon->cold->sellt[ti]]->symbol,
LENGTH(selmon->cold->ltsymbol[ti]));
selmon->cold->ltsymbol[ti][LENGTH(selmon->cold->ltsymbol[ti]) - 1] = '\0';
/* Convert windows when switching to master: set focused client as master */
if (curlayout(selmon)->arrange == master) {
Client *sel = focustop(selmon);
if (sel && VISIBLEON(sel, selmon) && !sel->isfloating && !sel->isfullscreen)
selmon->master_master[ti] = sel;
selmon->cold->master_master[ti] = sel;
else
selmon->master_master[ti] = nullptr;
selmon->cold->master_master[ti] = nullptr;
/* Convert to floating: float all tiled clients */
} else if (!curlayout(selmon)->arrange) {
Client *c;
@@ -3007,8 +3012,9 @@ reapply_monitor_config(void)
for (int ri = 0; ri < cfg.nmonitors; ri++) {
const CfgMonitorRule *r = &cfg.monitors[ri];
if (!r->name[0] || strstr(m->wlr_output->name, r->name)) {
m->mfact = r->mfact;
m->nmaster = r->nmaster;
ensure_cold(m);
m->cold->mfact = r->mfact;
m->cold->nmaster = r->nmaster;
/* Map layout name */
const Layout *mon_layout = &layouts[0];
for (int li = 0; li < (int)layout_count; li++) {
@@ -3031,9 +3037,9 @@ reapply_monitor_config(void)
}
const Layout *alt_layout = &layouts[layout_count > 1 && mon_layout != &layouts[1]];
for (int ti = 0; ti < TAGCOUNT; ti++) {
m->lt[ti][0] = mon_layout;
m->lt[ti][1] = alt_layout;
m->sellt[ti] = 0;
m->cold->lt[ti][0] = mon_layout;
m->cold->lt[ti][1] = alt_layout;
m->cold->sellt[ti] = 0;
}
/* Apply scale and transform */
struct wlr_output_state state;
@@ -3568,7 +3574,7 @@ static void swapdir(const Arg *arg) {
if (curlayout(selmon)->arrange == dwindle) {
int ti = current_tag_idx(selmon);
DwindleNode **root = &selmon->dwindle_root[ti];
DwindleNode **root = &selmon->cold->dwindle_root[ti];
if (*root) {
DwindleNode *leaf_sel = dwindle_find_leaf(*root, sel);
DwindleNode *leaf_other = dwindle_find_leaf(*root, other);
@@ -3588,13 +3594,13 @@ static void swapdir(const Arg *arg) {
}
} else if (curlayout(selmon)->arrange == master) {
int ti = current_tag_idx(selmon);
int side = selmon->master_side[ti];
int side = selmon->cold->master_side[ti];
if (sel == selmon->master_master[ti]) {
if (sel == selmon->cold->master_master[ti]) {
/* master moving away from master side → flip */
if ((side == 0 && arg->i == WLR_DIRECTION_RIGHT) ||
(side == 1 && arg->i == WLR_DIRECTION_LEFT)) {
selmon->master_side[ti] = !side;
selmon->cold->master_side[ti] = !side;
arrange(selmon);
printstatus();
focusclient(sel, 1);
@@ -3604,7 +3610,7 @@ static void swapdir(const Arg *arg) {
/* stack moving toward master side → promote */
if ((side == 0 && arg->i == WLR_DIRECTION_LEFT) ||
(side == 1 && arg->i == WLR_DIRECTION_RIGHT)) {
selmon->master_master[ti] = sel;
selmon->cold->master_master[ti] = sel;
arrange(selmon);
printstatus();
focusclient(sel, 1);