2014-10-22 11:53:03 +02:00
|
|
|
/* Copyright (c) 2012, Bastien Dejean
|
2013-10-08 21:05:56 +02:00
|
|
|
* All rights reserved.
|
2014-01-19 14:41:37 +01:00
|
|
|
*
|
2014-01-18 16:30:00 +01:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
2014-01-19 14:41:37 +01:00
|
|
|
*
|
2014-01-18 16:30:00 +01:00
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
2014-01-19 14:41:37 +01:00
|
|
|
*
|
2014-01-18 16:30:00 +01:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
2013-10-08 21:05:56 +02:00
|
|
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
2014-01-18 16:30:00 +01:00
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
2013-10-08 21:05:56 +02:00
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2013-10-08 21:02:33 +02:00
|
|
|
#ifndef BSPWM_BSPWM_H
|
|
|
|
#define BSPWM_BSPWM_H
|
2012-07-31 14:32:13 +02:00
|
|
|
|
2012-09-18 17:21:04 +02:00
|
|
|
#include "types.h"
|
|
|
|
|
2016-11-23 20:31:59 +01:00
|
|
|
#define ROOT_EVENT_MASK (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_BUTTON_PRESS)
|
2014-01-18 16:30:00 +01:00
|
|
|
#define CLIENT_EVENT_MASK (XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_FOCUS_CHANGE)
|
2015-12-23 22:21:43 +01:00
|
|
|
#define BSPWM_CLASS_NAME "Bspwm"
|
|
|
|
#define META_WINDOW_IC "wm\0" BSPWM_CLASS_NAME
|
|
|
|
#define ROOT_WINDOW_IC "root\0" BSPWM_CLASS_NAME
|
|
|
|
#define PRESEL_FEEDBACK_I "presel_feedback"
|
|
|
|
#define PRESEL_FEEDBACK_IC PRESEL_FEEDBACK_I "\0" BSPWM_CLASS_NAME
|
2012-09-21 19:05:42 +02:00
|
|
|
|
2012-07-30 12:21:22 +02:00
|
|
|
xcb_connection_t *dpy;
|
2012-08-01 23:16:07 +02:00
|
|
|
int default_screen, screen_width, screen_height;
|
2015-12-22 19:25:45 +01:00
|
|
|
uint32_t clients_count;
|
2012-08-01 23:16:07 +02:00
|
|
|
xcb_screen_t *screen;
|
2013-01-02 12:36:54 +01:00
|
|
|
xcb_window_t root;
|
2013-07-29 10:27:04 +02:00
|
|
|
char config_path[MAXLEN];
|
2012-09-21 17:39:22 +02:00
|
|
|
|
2012-10-17 16:18:40 +02:00
|
|
|
monitor_t *mon;
|
|
|
|
monitor_t *mon_head;
|
|
|
|
monitor_t *mon_tail;
|
2013-09-09 15:25:26 +02:00
|
|
|
monitor_t *pri_mon;
|
2013-10-01 10:48:03 +02:00
|
|
|
history_t *history_head;
|
|
|
|
history_t *history_tail;
|
2013-10-08 13:59:17 +02:00
|
|
|
history_t *history_needle;
|
2013-12-12 14:38:48 +01:00
|
|
|
rule_t *rule_head;
|
|
|
|
rule_t *rule_tail;
|
2013-10-07 10:22:07 +02:00
|
|
|
stacking_list_t *stack_head;
|
|
|
|
stacking_list_t *stack_tail;
|
2013-11-07 14:28:39 +01:00
|
|
|
subscriber_list_t *subscribe_head;
|
|
|
|
subscriber_list_t *subscribe_tail;
|
2013-11-08 20:31:23 +01:00
|
|
|
pending_rule_t *pending_rule_head;
|
|
|
|
pending_rule_t *pending_rule_tail;
|
2013-01-02 12:36:54 +01:00
|
|
|
|
2015-06-06 18:25:20 +02:00
|
|
|
xcb_window_t meta_window;
|
2016-09-27 20:56:44 +02:00
|
|
|
xcb_atom_t WM_STATE;
|
2013-09-05 15:37:54 +02:00
|
|
|
xcb_atom_t WM_TAKE_FOCUS;
|
|
|
|
xcb_atom_t WM_DELETE_WINDOW;
|
2012-12-24 12:02:35 +01:00
|
|
|
int exit_status;
|
2012-09-21 17:39:22 +02:00
|
|
|
|
2013-07-15 20:28:28 +02:00
|
|
|
bool auto_raise;
|
2013-10-01 18:04:18 +02:00
|
|
|
bool sticky_still;
|
2013-10-08 13:59:17 +02:00
|
|
|
bool record_history;
|
2012-07-31 14:32:13 +02:00
|
|
|
bool running;
|
2013-06-10 13:51:46 +02:00
|
|
|
bool randr;
|
2012-08-01 23:16:07 +02:00
|
|
|
|
2013-05-28 17:31:35 +02:00
|
|
|
void init(void);
|
2012-09-18 19:18:02 +02:00
|
|
|
void setup(void);
|
2013-09-19 15:02:49 +02:00
|
|
|
void register_events(void);
|
2013-10-05 22:32:40 +02:00
|
|
|
void cleanup(void);
|
2015-02-09 13:56:46 +01:00
|
|
|
bool check_connection (xcb_connection_t *dpy);
|
2013-11-09 11:08:36 +01:00
|
|
|
void sig_handler(int sig);
|
2012-08-01 23:16:07 +02:00
|
|
|
|
2012-07-31 14:32:13 +02:00
|
|
|
#endif
|