File indexing completed on 2024-06-23 05:29:38

0001 /*
0002     SPDX-FileCopyrightText: 2013 Alexander Mezin <mezin.alexander@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <xcb/xcb.h>
0010 
0011 class XcbAtom
0012 {
0013 public:
0014     XcbAtom();
0015     XcbAtom(xcb_connection_t *, const char *name, bool onlyIfExists = true);
0016     ~XcbAtom();
0017 
0018     void intern(xcb_connection_t *, const char *name, bool onlyIfExists = true);
0019     xcb_atom_t atom();
0020     operator xcb_atom_t()
0021     {
0022         return atom();
0023     }
0024 
0025 private:
0026     XcbAtom(const XcbAtom &);
0027     XcbAtom &operator=(const XcbAtom &);
0028 
0029     xcb_connection_t *m_connection;
0030     xcb_intern_atom_cookie_t m_cookie;
0031     xcb_intern_atom_reply_t *m_reply;
0032     bool m_fetched;
0033 };