aboutsummaryrefslogtreecommitdiffstats
path: root/sway/criteria.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/criteria.c')
-rw-r--r--sway/criteria.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/criteria.c b/sway/criteria.c
index b8b581ed..70f8e305 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -272,7 +272,7 @@ static int regex_cmp(const char *item, const pcre *regex) {
272} 272}
273 273
274// test a single view if it matches list of criteria tokens (all of them). 274// test a single view if it matches list of criteria tokens (all of them).
275static bool criteria_test(swayc_t *cont, list_t *tokens) { 275static bool criteria_test(struct sway_container *cont, list_t *tokens) {
276 if (cont->type != C_VIEW) { 276 if (cont->type != C_VIEW) {
277 return false; 277 return false;
278 } 278 }
@@ -398,7 +398,7 @@ void free_criteria(struct criteria *crit) {
398 free(crit); 398 free(crit);
399} 399}
400 400
401bool criteria_any(swayc_t *cont, list_t *criteria) { 401bool criteria_any(struct sway_container *cont, list_t *criteria) {
402 for (int i = 0; i < criteria->length; i++) { 402 for (int i = 0; i < criteria->length; i++) {
403 struct criteria *bc = criteria->items[i]; 403 struct criteria *bc = criteria->items[i];
404 if (criteria_test(cont, bc->tokens)) { 404 if (criteria_test(cont, bc->tokens)) {
@@ -408,7 +408,7 @@ bool criteria_any(swayc_t *cont, list_t *criteria) {
408 return false; 408 return false;
409} 409}
410 410
411list_t *criteria_for(swayc_t *cont) { 411list_t *criteria_for(struct sway_container *cont) {
412 list_t *criteria = config->criteria, *matches = create_list(); 412 list_t *criteria = config->criteria, *matches = create_list();
413 for (int i = 0; i < criteria->length; i++) { 413 for (int i = 0; i < criteria->length; i++) {
414 struct criteria *bc = criteria->items[i]; 414 struct criteria *bc = criteria->items[i];
@@ -424,7 +424,7 @@ struct list_tokens {
424 list_t *tokens; 424 list_t *tokens;
425}; 425};
426 426
427static void container_match_add(swayc_t *container, 427static void container_match_add(struct sway_container *container,
428 struct list_tokens *list_tokens) { 428 struct list_tokens *list_tokens) {
429 if (criteria_test(container, list_tokens->tokens)) { 429 if (criteria_test(container, list_tokens->tokens)) {
430 list_add(list_tokens->list, container); 430 list_add(list_tokens->list, container);
@@ -435,8 +435,8 @@ list_t *container_for_crit_tokens(list_t *tokens) {
435 struct list_tokens list_tokens = 435 struct list_tokens list_tokens =
436 (struct list_tokens){create_list(), tokens}; 436 (struct list_tokens){create_list(), tokens};
437 437
438 container_map(&root_container, 438 sway_container_for_each(&root_container,
439 (void (*)(swayc_t *, void *))container_match_add, 439 (void (*)(struct sway_container *, void *))container_match_add,
440 &list_tokens); 440 &list_tokens);
441 441
442 // TODO look in the scratchpad 442 // TODO look in the scratchpad