]> git.sur5r.net Git - i3/i3/blob - include/match.h
Merge branch 'release-4.16.1'
[i3/i3] / include / match.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * A "match" is a data structure which acts like a mask or expression to match
8  * certain windows or not. For example, when using commands, you can specify a
9  * command like this: [title="*Firefox*"] kill. The title member of the match
10  * data structure will then be filled and i3 will check each window using
11  * match_matches_window() to find the windows affected by this command.
12  *
13  */
14 #pragma once
15
16 #include <config.h>
17
18 /**
19  * Initializes the Match data structure. This function is necessary because the
20  * members representing boolean values (like dock) need to be initialized with
21  * -1 instead of 0.
22  *
23  */
24 void match_init(Match *match);
25
26 /**
27  * Check if a match is empty. This is necessary while parsing commands to see
28  * whether the user specified a match at all.
29  *
30  */
31 bool match_is_empty(Match *match);
32
33 /**
34  * Copies the data of a match from src to dest.
35  *
36  */
37 void match_copy(Match *dest, Match *src);
38
39 /**
40  * Check if a match data structure matches the given window.
41  *
42  */
43 bool match_matches_window(Match *match, i3Window *window);
44
45 /**
46  * Frees the given match. It must not be used afterwards!
47  *
48  */
49 void match_free(Match *match);
50
51 /**
52  * Interprets a ctype=cvalue pair and adds it to the given match specification.
53  *
54  */
55 void match_parse_property(Match *match, const char *ctype, const char *cvalue);