2018-08-03 23:06:01 +10:00
|
|
|
#ifndef _SWAY_ROOT_H
|
|
|
|
#define _SWAY_ROOT_H
|
|
|
|
#include <wayland-server-core.h>
|
|
|
|
#include <wayland-util.h>
|
|
|
|
#include <wlr/types/wlr_output_layout.h>
|
|
|
|
#include <wlr/render/wlr_texture.h>
|
|
|
|
#include "sway/tree/container.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "list.h"
|
|
|
|
|
|
|
|
extern struct sway_container root_container;
|
|
|
|
|
|
|
|
struct sway_root {
|
|
|
|
struct wlr_output_layout *output_layout;
|
|
|
|
|
|
|
|
struct wl_listener output_layout_change;
|
|
|
|
#ifdef HAVE_XWAYLAND
|
|
|
|
struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link
|
|
|
|
#endif
|
|
|
|
struct wl_list drag_icons; // sway_drag_icon::link
|
|
|
|
|
|
|
|
struct wlr_texture *debug_tree;
|
|
|
|
|
2018-08-25 23:42:04 +10:00
|
|
|
// Includes disabled outputs
|
2018-08-25 19:29:04 +10:00
|
|
|
struct wl_list all_outputs; // sway_output::link
|
2018-08-03 23:06:01 +10:00
|
|
|
|
|
|
|
list_t *scratchpad; // struct sway_container
|
2018-08-20 15:54:30 +10:00
|
|
|
list_t *saved_workspaces; // For when there's no connected outputs
|
2018-08-03 23:06:01 +10:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal new_container;
|
|
|
|
} events;
|
|
|
|
};
|
|
|
|
|
|
|
|
void root_create(void);
|
|
|
|
|
|
|
|
void root_destroy(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Move a container to the scratchpad.
|
|
|
|
*/
|
|
|
|
void root_scratchpad_add_container(struct sway_container *con);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a container from the scratchpad.
|
|
|
|
*/
|
|
|
|
void root_scratchpad_remove_container(struct sway_container *con);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show a single scratchpad container.
|
|
|
|
*/
|
|
|
|
void root_scratchpad_show(struct sway_container *con);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hide a single scratchpad container.
|
|
|
|
*/
|
|
|
|
void root_scratchpad_hide(struct sway_container *con);
|
|
|
|
|
2018-08-04 14:01:49 +10:00
|
|
|
struct sway_container *root_workspace_for_pid(pid_t pid);
|
|
|
|
|
|
|
|
void root_record_workspace_pid(pid_t pid);
|
|
|
|
|
2018-08-17 19:48:34 +10:00
|
|
|
void root_for_each_workspace(void (*f)(struct sway_container *con, void *data),
|
|
|
|
void *data);
|
|
|
|
|
|
|
|
void root_for_each_container(void (*f)(struct sway_container *con, void *data),
|
|
|
|
void *data);
|
|
|
|
|
|
|
|
struct sway_container *root_find_output(
|
|
|
|
bool (*test)(struct sway_container *con, void *data), void *data);
|
|
|
|
|
|
|
|
struct sway_container *root_find_workspace(
|
|
|
|
bool (*test)(struct sway_container *con, void *data), void *data);
|
|
|
|
|
|
|
|
struct sway_container *root_find_container(
|
|
|
|
bool (*test)(struct sway_container *con, void *data), void *data);
|
|
|
|
|
2018-08-03 23:06:01 +10:00
|
|
|
#endif
|