]> git.lizzy.rs Git - bspwm.git/blob - subscribe.h
Allow subscribers to choose what they listen to
[bspwm.git] / subscribe.h
1 /* Copyright (c) 2012, Bastien Dejean
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this
8  *    list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright notice,
10  *    this list of conditions and the following disclaimer in the documentation
11  *    and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  */
24
25 #ifndef BSPWM_SUBSCRIBE_H
26 #define BSPWM_SUBSCRIBE_H
27
28 typedef enum {
29         SBSC_MASK_REPORT = 1 << 0,
30         SBSC_MASK_MONITOR_ADD = 1 << 1,
31         SBSC_MASK_MONITOR_RENAME = 1 << 2,
32         SBSC_MASK_MONITOR_REMOVE = 1 << 3,
33         SBSC_MASK_DESKTOP_ADD = 1 << 4,
34         SBSC_MASK_DESKTOP_RENAME = 1 << 5,
35         SBSC_MASK_DESKTOP_REMOVE = 1 << 6,
36         SBSC_MASK_WINDOW_MANAGE = 1 << 7,
37         SBSC_MASK_WINDOW_UNMANAGE = 1 << 8,
38         SBSC_MASK_WINDOW_URGENT = 1 << 9,
39         SBSC_MASK_WINDOW_FULLSCREEN = 1 << 10,
40         SBSC_MASK_MONITOR = (1 << 4) - (1 << 1),
41         SBSC_MASK_DESKTOP = (1 << 7) - (1 << 4),
42         SBSC_MASK_WINDOW = (1 << 11) - (1 << 7),
43         SBSC_MASK_ALL = (1 << 11) - 1
44 } subscriber_mask_t;
45
46 subscriber_list_t *make_subscriber_list(FILE *stream, int field);
47 void remove_subscriber(subscriber_list_t *sb);
48 void add_subscriber(FILE *stream, int field);
49 int print_report(FILE *stream);
50 void put_status(subscriber_mask_t mask, ...);
51
52 #endif