monitor.h (1310B)
1 /* 2 * kbgwm, a sucklessy floating window manager 3 * Copyright (c) 2020-2021, Kebigon <git@kebigon.xyz> 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18 #pragma once 19 20 #include <stdbool.h> 21 #include <xcb/randr.h> 22 23 struct monitor 24 { 25 xcb_randr_output_t id; 26 int16_t x, y; 27 uint16_t width, height; 28 }; 29 30 void setup_monitors(); 31 32 /** 33 * Return true when the monitor contains the given position, false otherwise 34 */ 35 bool monitor_contains(struct monitor *, uint16_t, uint16_t); 36 37 /** 38 * Find a monitor from a position 39 */ 40 struct item *monitor_find_by_position(const uint16_t, const uint16_t); 41 42 void monitors_refresh_config();