|
|
@ -6,9 +6,7 @@
|
|
|
|
#include <wlr/types/wlr_surface.h>
|
|
|
|
#include <wlr/types/wlr_surface.h>
|
|
|
|
#include "list.h"
|
|
|
|
#include "list.h"
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct sway_container swayc_t;
|
|
|
|
extern struct sway_container root_container;
|
|
|
|
|
|
|
|
|
|
|
|
extern swayc_t root_container;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct sway_view;
|
|
|
|
struct sway_view;
|
|
|
|
struct sway_seat;
|
|
|
|
struct sway_seat;
|
|
|
@ -89,48 +87,53 @@ struct sway_container {
|
|
|
|
} events;
|
|
|
|
} events;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void swayc_descendants_of_type(swayc_t *root, enum swayc_types type,
|
|
|
|
void swayc_descendants_of_type(struct sway_container *root,
|
|
|
|
void (*func)(swayc_t *item, void *data), void *data);
|
|
|
|
enum swayc_types type,
|
|
|
|
|
|
|
|
void (*func)(struct sway_container *item, void *data), void *data);
|
|
|
|
|
|
|
|
|
|
|
|
// TODO only one container create function and pass the type?
|
|
|
|
// TODO only one container create function and pass the type?
|
|
|
|
swayc_t *new_output(struct sway_output *sway_output);
|
|
|
|
struct sway_container *new_output(struct sway_output *sway_output);
|
|
|
|
|
|
|
|
|
|
|
|
swayc_t *new_workspace(swayc_t *output, const char *name);
|
|
|
|
struct sway_container *new_workspace(struct sway_container *output,
|
|
|
|
|
|
|
|
const char *name);
|
|
|
|
|
|
|
|
|
|
|
|
swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view);
|
|
|
|
struct sway_container *new_view(struct sway_container *sibling,
|
|
|
|
|
|
|
|
struct sway_view *sway_view);
|
|
|
|
|
|
|
|
|
|
|
|
swayc_t *destroy_output(swayc_t *output);
|
|
|
|
struct sway_container *destroy_output(struct sway_container *output);
|
|
|
|
swayc_t *destroy_view(swayc_t *view);
|
|
|
|
struct sway_container *destroy_view(struct sway_container *view);
|
|
|
|
|
|
|
|
|
|
|
|
swayc_t *next_view_sibling(struct sway_seat *seat);
|
|
|
|
struct sway_container *next_view_sibling(struct sway_seat *seat);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Finds a container based on test criteria. Returns the first container that
|
|
|
|
* Finds a container based on test criteria. Returns the first container that
|
|
|
|
* passes the test.
|
|
|
|
* passes the test.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
swayc_t *swayc_by_test(swayc_t *container,
|
|
|
|
struct sway_container *swayc_by_test(struct sway_container *container,
|
|
|
|
bool (*test)(swayc_t *view, void *data), void *data);
|
|
|
|
bool (*test)(struct sway_container *view, void *data), void *data);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Finds a parent container with the given swayc_type.
|
|
|
|
* Finds a parent container with the given swayc_type.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type);
|
|
|
|
struct sway_container *swayc_parent_by_type(struct sway_container *container,
|
|
|
|
|
|
|
|
enum swayc_types type);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Maps a container's children over a function.
|
|
|
|
* Maps a container's children over a function.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void container_map(swayc_t *container,
|
|
|
|
void container_map(struct sway_container *container,
|
|
|
|
void (*f)(swayc_t *view, void *data), void *data);
|
|
|
|
void (*f)(struct sway_container *view, void *data), void *data);
|
|
|
|
|
|
|
|
|
|
|
|
swayc_t *swayc_at(swayc_t *parent, double lx, double ly,
|
|
|
|
struct sway_container *swayc_at(struct sway_container *parent, double lx,
|
|
|
|
struct wlr_surface **surface, double *sx, double *sy);
|
|
|
|
double ly, struct wlr_surface **surface, double *sx, double *sy);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Apply the function for each child of the container breadth first.
|
|
|
|
* Apply the function for each child of the container breadth first.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void container_for_each_bfs(swayc_t *con, void (*f)(swayc_t *con, void *data),
|
|
|
|
void container_for_each_bfs(struct sway_container *con, void (*f)(struct
|
|
|
|
void *data);
|
|
|
|
sway_container *con, void *data), void *data);
|
|
|
|
|
|
|
|
|
|
|
|
swayc_t *swayc_change_layout(swayc_t *container, enum swayc_layouts layout);
|
|
|
|
struct sway_container *swayc_change_layout(struct sway_container *container,
|
|
|
|
|
|
|
|
enum swayc_layouts layout);
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|