/* * This file is part of firk's window manager for x11 (fwm) * Copyright (C) 2016-2021,2023 firk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _FWM_BASE_H_ #define _FWM_BASE_H_ extern Display * display; extern Screen * screen; extern int sw, sh; extern Window rootwin; extern Cursor cur_left_ptr; extern Time X11time; extern void base_init(char const * display_name); extern int base_get_event(XEvent * ev); extern void base_wait_event(XEvent * ev); extern int base_handle_event(XEvent * ev); extern unsigned long base_color(unsigned char c); #define atoms_length 10 extern Atom atoms[atoms_length]; #ifdef BASE_INTERNAL static char const *atom_names[atoms_length] = { "WM_PROTOCOLS", "WM_DELETE_WINDOW", "WM_TAKE_FOCUS", "WM_STATE", "WM_HINTS", "WM_TRANSIENT_FOR", "WM_NAME", "FWM_WCLASS", "FWM_THEMESET", "FWM_TRAYSIZE" }; #endif #define atom_WM_PROTOCOLS (atoms[0]) #define atom_WM_DELETE (atoms[1]) #define atom_WM_TAKEFOCUS (atoms[2]) #define atom_WM_STATE (atoms[3]) #define atom_WM_HINTS (atoms[4]) #define atom_WM_TRANSFOR (atoms[5]) #define atom_WM_NAME (atoms[6]) #define atom_FWM_WCLASS (atoms[7]) #define atom_FWM_THEMESET (atoms[8]) #define atom_FWM_TRAYSIZE (atoms[9]) extern int send_atom_message(Window window, Atom msg, int param); extern void set_atom_state(Window window, int state); /* WCLASS format: byte [0] is generic id from those below; bytes [1+] is ASCII identifier, maximum 30 bytes w/o nullterm FWM_WCLASS property should be already present on window mapping if needed */ #define WCLASS_NORMAL 1 #define WCLASS_TRAYICON 2 /* 16x16 */ #define WCLASS_TRAYWIDE 3 /* 40x16 */ #define WCLASS_WIDGET 4 #define WCLASS_MAX 4 /* THEMESET format: byte [0] bits[0:3] is taskbar background color bits[4:7] reserved bytes [1+] is optional ASCII identifier (currently not used) FWM_THEMESET in WM_PROTOCOLS should be already present on window mapping if needed */ #define FWM_THEMESET_SIZE 64 #define BLACK 0 #define BLUE 1 #define GREEN 2 #define CYAN 3 #define RED 4 #define MAGENTA 5 #define BROWN 6 #define LTGRAY 7 #define DKGRAY 8 #define LTBLUE 9 #define LTGREEN 10 #define LTCYAN 11 #define LTRED 12 #define PINK 13 #define YELLOW 14 #define WHITE 15 #endif