rename container functions

This commit is contained in:
Tony Crisci 2018-03-29 16:17:55 -04:00
parent 83d09cf594
commit b90099b4b7
23 changed files with 290 additions and 282 deletions

View file

@ -37,7 +37,7 @@ static void handle_seat_container_destroy(struct wl_listener *listener,
struct sway_seat_container *seat_con =
wl_container_of(listener, seat_con, destroy);
struct sway_seat *seat = seat_con->seat;
swayc_t *con = seat_con->container;
struct sway_container *con = seat_con->container;
bool is_focus = (sway_seat_get_focus(seat) == con);
@ -46,7 +46,7 @@ static void handle_seat_container_destroy(struct wl_listener *listener,
if (is_focus) {
// pick next focus
sway_seat_set_focus(seat, NULL);
swayc_t *next = sway_seat_get_focus_inactive(seat, con->parent);
struct sway_container *next = sway_seat_get_focus_inactive(seat, con->parent);
if (next == NULL) {
next = con->parent;
}
@ -59,7 +59,7 @@ static void handle_seat_container_destroy(struct wl_listener *listener,
}
static struct sway_seat_container *seat_container_from_container(
struct sway_seat *seat, swayc_t *con) {
struct sway_seat *seat, struct sway_container *con) {
if (con->type < C_WORKSPACE) {
// these don't get seat containers ever
return NULL;
@ -89,11 +89,11 @@ static struct sway_seat_container *seat_container_from_container(
static void handle_new_container(struct wl_listener *listener, void *data) {
struct sway_seat *seat = wl_container_of(listener, seat, new_container);
swayc_t *con = data;
struct sway_container *con = data;
seat_container_from_container(seat, con);
}
static void collect_focus_iter(swayc_t *con, void *data) {
static void collect_focus_iter(struct sway_container *con, void *data) {
struct sway_seat *seat = data;
if (con->type > C_WORKSPACE) {
return;
@ -130,7 +130,7 @@ struct sway_seat *sway_seat_create(struct sway_input_manager *input,
// init the focus stack
wl_list_init(&seat->focus_stack);
container_for_each_bfs(&root_container, collect_focus_iter, seat);
sway_container_for_each_bfs(&root_container, collect_focus_iter, seat);
wl_signal_add(&root_container.sway_root->events.new_container,
&seat->new_container);
@ -166,7 +166,7 @@ static void seat_configure_keyboard(struct sway_seat *seat,
sway_keyboard_configure(seat_device->keyboard);
wlr_seat_set_keyboard(seat->wlr_seat,
seat_device->input_device->wlr_device);
swayc_t *focus = sway_seat_get_focus(seat);
struct sway_container *focus = sway_seat_get_focus(seat);
if (focus && focus->type == C_VIEW) {
// force notify reenter to pick up the new configuration
wlr_seat_keyboard_clear_focus(seat->wlr_seat);
@ -270,7 +270,7 @@ void sway_seat_configure_xcursor(struct sway_seat *seat) {
}
for (int i = 0; i < root_container.children->length; ++i) {
swayc_t *output_container = root_container.children->items[i];
struct sway_container *output_container = root_container.children->items[i];
struct wlr_output *output =
output_container->sway_output->wlr_output;
bool result =
@ -289,8 +289,8 @@ void sway_seat_configure_xcursor(struct sway_seat *seat) {
seat->cursor->cursor->y);
}
void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) {
swayc_t *last_focus = sway_seat_get_focus(seat);
void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *container) {
struct sway_container *last_focus = sway_seat_get_focus(seat);
if (container && last_focus == container) {
return;
@ -330,9 +330,9 @@ void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) {
seat->has_focus = (container != NULL);
}
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) {
struct sway_seat_container *current = NULL;
swayc_t *parent = NULL;
struct sway_container *parent = NULL;
wl_list_for_each(current, &seat->focus_stack, link) {
parent = current->container->parent;
@ -351,21 +351,21 @@ swayc_t *sway_seat_get_focus_inactive(struct sway_seat *seat, swayc_t *container
return NULL;
}
swayc_t *sway_seat_get_focus(struct sway_seat *seat) {
struct sway_container *sway_seat_get_focus(struct sway_seat *seat) {
if (!seat->has_focus) {
return NULL;
}
return sway_seat_get_focus_inactive(seat, &root_container);
}
swayc_t *sway_seat_get_focus_by_type(struct sway_seat *seat,
enum swayc_types type) {
swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat,
enum sway_container_type type) {
struct sway_container *focus = sway_seat_get_focus_inactive(seat, &root_container);
if (focus->type == type) {
return focus;
}
return swayc_parent_by_type(focus, type);
return sway_container_parent(focus, type);
}
void sway_seat_set_config(struct sway_seat *seat,