diff options
Diffstat (limited to 'src/atoms.rs')
-rw-r--r-- | src/atoms.rs | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/src/atoms.rs b/src/atoms.rs index 5db75da..2d23c81 100644 --- a/src/atoms.rs +++ b/src/atoms.rs @@ -1,27 +1,18 @@ -use crate::error::*; -use xcb::Connection; - -#[derive(Debug)] -pub struct InternedAtoms {} - -impl InternedAtoms { - pub fn new_with(_conn: &Connection) -> Result<Self> { - // TODO: intern atoms - - // utf8string = XInternAtom(dpy, "UTF8_STRING", False); - // wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); - // wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - // wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); - // wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - // netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - // netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); - // netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); - // netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); - // netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - // netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - // netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - // netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - // netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); - Ok(Self {}) +xcb::atoms_struct! { + #[derive(Copy, Clone, Debug)] + pub struct Atoms { + pub wm_protocols => b"WM_PROTOCOLS", + pub wm_delete => b"WM_DELETE_WINDOW", + pub wm_state => b"WM_STATE", + pub wm_take_focus => b"WM_TAKE_FOCUS", + pub net_active_window => b"_NET_ACTIVE_WINDOW", + pub net_supported => b"_NET_SUPPORTED", + pub net_wm_name => b"_NET_WM_NAME", + pub net_wm_state => b"_NET_WM_STATE", + pub net_wm_check => b"_NET_SUPPORTING_WM_CHECK", + pub net_wm_fullscreen => b"_NET_WM_STATE_FULLSCREEN", + pub net_wm_window_type => b"_NET_WM_WINDOW_TYPE", + pub net_wm_window_type_dialog => b"_NET_WM_WINDOW_TYPE_DIALOG", + pub net_client_list => b"_NET_CLIENT_LIST", } } |