aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/criteria.h
diff options
context:
space:
mode:
authorLibravatar Ronan Pigott <rpigott@berkeley.edu>2019-10-10 19:44:56 -0700
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-10-27 11:06:05 -0400
commit7c9b71f5c61764be2e1459750dcd7978b8f45e5b (patch)
treee9dc557723783e5515a16899b8f77c1379ed9d3e /include/sway/criteria.h
parentfocus: support focus prev|next [sibling] (diff)
downloadsway-7c9b71f5c61764be2e1459750dcd7978b8f45e5b.tar.gz
sway-7c9b71f5c61764be2e1459750dcd7978b8f45e5b.tar.zst
sway-7c9b71f5c61764be2e1459750dcd7978b8f45e5b.zip
criteria: make literal comparison for __focused__ values
Diffstat (limited to 'include/sway/criteria.h')
-rw-r--r--include/sway/criteria.h27
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
17enum pattern_type {
18 PATTERN_PCRE,
19 PATTERN_FOCUSED,
20};
21
22struct pattern {
23 enum pattern_type match_type;
24 pcre *regex;
25};
26
17struct criteria { 27struct 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
42bool criteria_is_empty(struct criteria *criteria); 51bool criteria_is_empty(struct criteria *criteria);