diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/criteria.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/include/sway/criteria.h b/include/sway/criteria.h index dc8dcb98..1ee69a38 100644 --- a/include/sway/criteria.h +++ b/include/sway/criteria.h | |||
@@ -14,29 +14,38 @@ enum criteria_type { | |||
14 | CT_NO_FOCUS = 1 << 4, | 14 | CT_NO_FOCUS = 1 << 4, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | enum pattern_type { | ||
18 | PATTERN_PCRE, | ||
19 | PATTERN_FOCUSED, | ||
20 | }; | ||
21 | |||
22 | struct pattern { | ||
23 | enum pattern_type match_type; | ||
24 | pcre *regex; | ||
25 | }; | ||
26 | |||
17 | struct criteria { | 27 | struct criteria { |
18 | enum criteria_type type; | 28 | enum criteria_type type; |
19 | char *raw; // entire criteria string (for logging) | 29 | char *raw; // entire criteria string (for logging) |
20 | char *cmdlist; | 30 | char *cmdlist; |
21 | char *target; // workspace or output name for `assign` criteria | 31 | char *target; // workspace or output name for `assign` criteria |
22 | 32 | ||
23 | bool autofail; // __focused__ while no focus or n/a for focused view | 33 | struct pattern *title; |
24 | pcre *title; | 34 | struct pattern *shell; |
25 | pcre *shell; | 35 | struct pattern *app_id; |
26 | pcre *app_id; | 36 | struct pattern *con_mark; |
27 | pcre *con_mark; | ||
28 | uint32_t con_id; // internal ID | 37 | uint32_t con_id; // internal ID |
29 | #if HAVE_XWAYLAND | 38 | #if HAVE_XWAYLAND |
30 | pcre *class; | 39 | struct pattern *class; |
31 | uint32_t id; // X11 window ID | 40 | uint32_t id; // X11 window ID |
32 | pcre *instance; | 41 | struct pattern *instance; |
33 | pcre *window_role; | 42 | struct pattern *window_role; |
34 | enum atom_name window_type; | 43 | enum atom_name window_type; |
35 | #endif | 44 | #endif |
36 | bool floating; | 45 | bool floating; |
37 | bool tiling; | 46 | bool tiling; |
38 | char urgent; // 'l' for latest or 'o' for oldest | 47 | char urgent; // 'l' for latest or 'o' for oldest |
39 | pcre *workspace; | 48 | struct pattern *workspace; |
40 | }; | 49 | }; |
41 | 50 | ||
42 | bool criteria_is_empty(struct criteria *criteria); | 51 | bool criteria_is_empty(struct criteria *criteria); |