2011-10-25 22:19:38 +02:00
|
|
|
/*
|
|
|
|
* vim:ts=4:sw=4:expandtab
|
|
|
|
*
|
|
|
|
* i3 - an improved dynamic tiling window manager
|
2015-04-04 02:17:56 +02:00
|
|
|
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
2011-10-25 22:19:38 +02:00
|
|
|
*
|
|
|
|
* A "match" is a data structure which acts like a mask or expression to match
|
|
|
|
* certain windows or not. For example, when using commands, you can specify a
|
|
|
|
* command like this: [title="*Firefox*"] kill. The title member of the match
|
|
|
|
* data structure will then be filled and i3 will check each window using
|
|
|
|
* match_matches_window() to find the windows affected by this command.
|
|
|
|
*
|
|
|
|
*/
|
2013-12-29 03:11:50 +01:00
|
|
|
#pragma once
|
2010-04-16 22:51:25 +02:00
|
|
|
|
2016-10-11 09:13:35 +02:00
|
|
|
#include <config.h>
|
|
|
|
|
2018-04-21 12:02:14 +02:00
|
|
|
/**
|
2010-08-15 12:18:27 +02:00
|
|
|
* Initializes the Match data structure. This function is necessary because the
|
|
|
|
* members representing boolean values (like dock) need to be initialized with
|
|
|
|
* -1 instead of 0.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void match_init(Match *match);
|
|
|
|
|
2010-07-13 11:35:05 +02:00
|
|
|
/**
|
|
|
|
* Check if a match is empty. This is necessary while parsing commands to see
|
|
|
|
* whether the user specified a match at all.
|
|
|
|
*
|
|
|
|
*/
|
2010-04-16 22:51:25 +02:00
|
|
|
bool match_is_empty(Match *match);
|
2010-07-13 11:35:05 +02:00
|
|
|
|
|
|
|
/**
|
2011-05-23 18:41:17 +02:00
|
|
|
* Copies the data of a match from src to dest.
|
2010-07-13 11:35:05 +02:00
|
|
|
*
|
|
|
|
*/
|
2011-05-23 18:41:17 +02:00
|
|
|
void match_copy(Match *dest, Match *src);
|
2010-04-16 22:51:25 +02:00
|
|
|
|
2011-05-02 23:29:26 +02:00
|
|
|
/**
|
2011-05-23 18:41:17 +02:00
|
|
|
* Check if a match data structure matches the given window.
|
2011-05-02 23:29:26 +02:00
|
|
|
*
|
|
|
|
*/
|
2011-05-23 18:41:17 +02:00
|
|
|
bool match_matches_window(Match *match, i3Window *window);
|
2011-05-02 23:29:26 +02:00
|
|
|
|
2011-09-12 00:41:46 +02:00
|
|
|
/**
|
|
|
|
* Frees the given match. It must not be used afterwards!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void match_free(Match *match);
|
2015-09-27 09:42:26 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interprets a ctype=cvalue pair and adds it to the given match specification.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void match_parse_property(Match *match, const char *ctype, const char *cvalue);
|