diff options
author | Ronan Pigott <rpigott@berkeley.edu> | 2019-10-10 19:44:56 -0700 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-10-27 11:06:05 -0400 |
commit | 7c9b71f5c61764be2e1459750dcd7978b8f45e5b (patch) | |
tree | e9dc557723783e5515a16899b8f77c1379ed9d3e /include/sway/criteria.h | |
parent | f5f12a69f6280dba4f8b05290bd81385d6e6c268 (diff) |
criteria: make literal comparison for __focused__ values
Diffstat (limited to 'include/sway/criteria.h')
-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 { CT_NO_FOCUS = 1 << 4, }; +enum pattern_type { + PATTERN_PCRE, + PATTERN_FOCUSED, +}; + +struct pattern { + enum pattern_type match_type; + pcre *regex; +}; + struct criteria { enum criteria_type type; char *raw; // entire criteria string (for logging) char *cmdlist; char *target; // workspace or output name for `assign` criteria - bool autofail; // __focused__ while no focus or n/a for focused view - pcre *title; - pcre *shell; - pcre *app_id; - pcre *con_mark; + struct pattern *title; + struct pattern *shell; + struct pattern *app_id; + struct pattern *con_mark; uint32_t con_id; // internal ID #if HAVE_XWAYLAND - pcre *class; + struct pattern *class; uint32_t id; // X11 window ID - pcre *instance; - pcre *window_role; + struct pattern *instance; + struct pattern *window_role; enum atom_name window_type; #endif bool floating; bool tiling; char urgent; // 'l' for latest or 'o' for oldest - pcre *workspace; + struct pattern *workspace; }; bool criteria_is_empty(struct criteria *criteria); |