1
1
mirror of https://github.com/swaywm/sway synced 2024-11-18 00:24:17 +01:00

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

@ -356,7 +356,7 @@ struct sway_config {
struct input_config *input_config;
struct seat_config *seat_config;
struct sway_seat *seat;
swayc_t *current_container;
struct sway_container *current_container;
} handler_context;
};
@ -416,7 +416,8 @@ void output_get_identifier(char *identifier, size_t len,
struct sway_output *output);
struct output_config *new_output_config(const char *name);
void merge_output_config(struct output_config *dst, struct output_config *src);
void apply_output_config(struct output_config *oc, swayc_t *output);
void apply_output_config(struct output_config *oc,
struct sway_container *output);
void free_output_config(struct output_config *oc);
/**

@ -31,12 +31,12 @@ char *extract_crit_tokens(list_t *tokens, const char *criteria);
// Returns list of criteria that match given container. These criteria have
// been set with `for_window` commands and have an associated cmdlist.
list_t *criteria_for(swayc_t *cont);
list_t *criteria_for(struct sway_container *cont);
// Returns a list of all containers that match the given list of tokens.
list_t *container_for_crit_tokens(list_t *tokens);
// Returns true if any criteria in the given list matches this container
bool criteria_any(swayc_t *cont, list_t *criteria);
bool criteria_any(struct sway_container *cont, list_t *criteria);
#endif

@ -31,10 +31,10 @@ struct sway_input_manager *sway_input_manager_create(
struct sway_server *server);
bool sway_input_manager_has_focus(struct sway_input_manager *input,
swayc_t *container);
struct sway_container *container);
void sway_input_manager_set_focus(struct sway_input_manager *input,
swayc_t *container);
struct sway_container *container);
void sway_input_manager_configure_xcursor(struct sway_input_manager *input);

@ -14,7 +14,7 @@ struct sway_seat_device {
struct sway_seat_container {
struct sway_seat *seat;
swayc_t *container;
struct sway_container *container;
struct wl_list link; // sway_seat::focus_stack
@ -54,9 +54,9 @@ void sway_seat_remove_device(struct sway_seat *seat,
void sway_seat_configure_xcursor(struct sway_seat *seat);
void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container);
void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *container);
swayc_t *sway_seat_get_focus(struct sway_seat *seat);
struct sway_container *sway_seat_get_focus(struct sway_seat *seat);
/**
* Return the last container to be focused for the seat (or the most recently
@ -67,9 +67,10 @@ swayc_t *sway_seat_get_focus(struct sway_seat *seat);
* is destroyed, or focus moves to a container with children and we need to
* descend into the next leaf in focus order.
*/
swayc_t *sway_seat_get_focus_inactive(struct sway_seat *seat, swayc_t *container);
struct sway_container *sway_seat_get_focus_inactive(struct sway_seat *seat,
struct sway_container *container);
swayc_t *sway_seat_get_focus_by_type(struct sway_seat *seat,
struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat,
enum swayc_types type);
void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config);

@ -6,8 +6,8 @@
json_object *ipc_json_get_version();
json_object *ipc_json_describe_container(swayc_t *c);
json_object *ipc_json_describe_container_recursive(swayc_t *c);
json_object *ipc_json_describe_container(struct sway_container *c);
json_object *ipc_json_describe_container_recursive(struct sway_container *c);
json_object *ipc_json_describe_input(struct sway_input_device *device);
#endif

@ -12,6 +12,6 @@ void ipc_terminate(void);
struct sockaddr_un *ipc_user_sockaddr(void);
void ipc_event_window(swayc_t *window, const char *change);
void ipc_event_window(struct sway_container *window, const char *change);
#endif

@ -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

@ -34,7 +34,8 @@ void init_layout(void);
void add_child(struct sway_container *parent, struct sway_container *child);
swayc_t *add_sibling(swayc_t *parent, swayc_t *child);
struct sway_container *add_sibling(struct sway_container *parent,
struct sway_container *child);
struct sway_container *remove_child(struct sway_container *child);
@ -45,7 +46,7 @@ void sort_workspaces(struct sway_container *output);
void arrange_windows(struct sway_container *container,
double width, double height);
swayc_t *get_swayc_in_direction(swayc_t *container,
struct sway_seat *seat, enum movement_direction dir);
struct sway_container *get_swayc_in_direction(struct sway_container
*container, struct sway_seat *seat, enum movement_direction dir);
#endif

@ -7,20 +7,20 @@ extern char *prev_workspace_name;
char *workspace_next_name(const char *output_name);
swayc_t *workspace_create(const char *name);
struct sway_container *workspace_create(const char *name);
bool workspace_switch(swayc_t *workspace);
bool workspace_switch(struct sway_container *workspace);
struct sway_container *workspace_by_number(const char* name);
swayc_t *workspace_by_name(const char*);
struct sway_container *workspace_by_name(const char*);
struct sway_container *workspace_output_next(swayc_t *current);
struct sway_container *workspace_output_next(struct sway_container *current);
struct sway_container *workspace_next(swayc_t *current);
struct sway_container *workspace_next(struct sway_container *current);
struct sway_container *workspace_output_prev(swayc_t *current);
struct sway_container *workspace_output_prev(struct sway_container *current);
struct sway_container *workspace_prev(swayc_t *current);
struct sway_container *workspace_prev(struct sway_container *current);
#endif

@ -278,7 +278,7 @@ struct sway_input_manager *sway_input_manager_create(
}
bool sway_input_manager_has_focus(struct sway_input_manager *input,
swayc_t *container) {
struct sway_container *container) {
struct sway_seat *seat = NULL;
wl_list_for_each(seat, &input->seats, link) {
if (sway_seat_get_focus(seat) == container) {
@ -290,7 +290,7 @@ bool sway_input_manager_has_focus(struct sway_input_manager *input,
}
void sway_input_manager_set_focus(struct sway_input_manager *input,
swayc_t *container) {
struct sway_container *container) {
struct sway_seat *seat ;
wl_list_for_each(seat, &input->seats, link) {
sway_seat_set_focus(seat, container);