polybar-dwm/include/components/x11/atoms.hpp
2016-10-10 18:58:57 +02:00

53 lines
2.2 KiB
C++

#pragma once
#include <xcb/xcb.h>
#include <xcb/xcb_atom.h>
struct cached_atom {
const char* name;
size_t len;
xcb_atom_t* atom;
};
static xcb_atom_t _NET_WM_NAME;
static xcb_atom_t _NET_WM_WINDOW_TYPE;
static xcb_atom_t _NET_WM_WINDOW_TYPE_DOCK;
static xcb_atom_t _NET_WM_WINDOW_TYPE_NORMAL;
static xcb_atom_t _NET_WM_PID;
static xcb_atom_t _NET_WM_STATE;
static xcb_atom_t _NET_WM_STATE_STICKY;
static xcb_atom_t _NET_WM_STATE_SKIP_TASKBAR;
static xcb_atom_t _NET_WM_STATE_ABOVE;
static xcb_atom_t WM_PROTOCOLS;
static xcb_atom_t WM_DELETE_WINDOW;
static xcb_atom_t _XEMBED;
static xcb_atom_t _XEMBED_INFO;
static xcb_atom_t _NET_SYSTEM_TRAY_OPCODE;
static xcb_atom_t MANAGER;
static xcb_atom_t WM_STATE;
static xcb_atom_t _NET_SYSTEM_TRAY_ORIENTATION;
static xcb_atom_t WM_TAKE_FOCUS;
// clang-format off
static cached_atom ATOMS[18] = {
{"_NET_WM_NAME", sizeof("_NET_WM_NAME") - 1, &_NET_WM_NAME},
{"_NET_WM_WINDOW_TYPE", sizeof("_NET_WM_WINDOW_TYPE") - 1, &_NET_WM_WINDOW_TYPE},
{"_NET_WM_WINDOW_TYPE_DOCK", sizeof("_NET_WM_WINDOW_TYPE_DOCK") - 1, &_NET_WM_WINDOW_TYPE_DOCK},
{"_NET_WM_WINDOW_TYPE_NORMAL", sizeof("_NET_WM_WINDOW_TYPE_NORMAL") - 1, &_NET_WM_WINDOW_TYPE_NORMAL},
{"_NET_WM_PID", sizeof("_NET_WM_PID") - 1, &_NET_WM_PID},
{"_NET_WM_STATE", sizeof("_NET_WM_STATE") - 1, &_NET_WM_STATE},
{"_NET_WM_STATE_STICKY", sizeof("_NET_WM_STATE_STICKY") - 1, &_NET_WM_STATE_STICKY},
{"_NET_WM_STATE_SKIP_TASKBAR", sizeof("_NET_WM_STATE_SKIP_TASKBAR") - 1, &_NET_WM_STATE_SKIP_TASKBAR},
{"_NET_WM_STATE_ABOVE", sizeof("_NET_WM_STATE_ABOVE") - 1, &_NET_WM_STATE_ABOVE},
{"WM_PROTOCOLS", sizeof("WM_PROTOCOLS") - 1, &WM_PROTOCOLS},
{"WM_DELETE_WINDOW", sizeof("WM_DELETE_WINDOW") - 1, &WM_DELETE_WINDOW},
{"_XEMBED", sizeof("_XEMBED") - 1, &_XEMBED},
{"_XEMBED_INFO", sizeof("_XEMBED_INFO") - 1, &_XEMBED_INFO},
{"_NET_SYSTEM_TRAY_OPCODE", sizeof("_NET_SYSTEM_TRAY_OPCODE") - 1, &_NET_SYSTEM_TRAY_OPCODE},
{"MANAGER", sizeof("MANAGER") - 1, &MANAGER},
{"WM_STATE", sizeof("WM_STATE") - 1, &WM_STATE},
{"_NET_SYSTEM_TRAY_ORIENTATION", sizeof("_NET_SYSTEM_TRAY_ORIENTATION") - 1, &_NET_SYSTEM_TRAY_ORIENTATION},
{"WM_TAKE_FOCUS", sizeof("WM_TAKE_FOCUS") - 1, &WM_TAKE_FOCUS},
};
// clang-format on