remove swayc_t typedef

This commit is contained in:
Tony Crisci 2018-03-29 14:31:10 -04:00
parent 874f009866
commit 83d09cf594
10 changed files with 53 additions and 47 deletions

View file

@ -6,9 +6,7 @@
#include <wlr/types/wlr_surface.h>
#include "list.h"
typedef struct sway_container swayc_t;
extern swayc_t root_container;
extern struct sway_container root_container;
struct sway_view;
struct sway_seat;
@ -89,48 +87,53 @@ struct sway_container {
} events;
};
void swayc_descendants_of_type(swayc_t *root, enum swayc_types type,
void (*func)(swayc_t *item, void *data), void *data);
void swayc_descendants_of_type(struct sway_container *root,
enum swayc_types type,
void (*func)(struct sway_container *item, void *data), void *data);
// 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);
swayc_t *destroy_view(swayc_t *view);
struct sway_container *destroy_output(struct sway_container *output);
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
* passes the test.
*/
swayc_t *swayc_by_test(swayc_t *container,
bool (*test)(swayc_t *view, void *data), void *data);
struct sway_container *swayc_by_test(struct sway_container *container,
bool (*test)(struct sway_container *view, void *data), void *data);
/**
* 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.
*/
void container_map(swayc_t *container,
void (*f)(swayc_t *view, void *data), void *data);
void container_map(struct sway_container *container,
void (*f)(struct sway_container *view, void *data), void *data);
swayc_t *swayc_at(swayc_t *parent, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy);
struct sway_container *swayc_at(struct sway_container *parent, double lx,
double ly, struct wlr_surface **surface, double *sx, double *sy);
/**
* 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 *data);
void container_for_each_bfs(struct sway_container *con, void (*f)(struct
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