/*
 * X11Atoms.cpp
 *
 *  Created on: 11 дек. 2016 г.
 *      Author: sadko
 */

#include <ui/ws/x11/ws.h>

#ifdef USE_X11_DISPLAY
namespace lsp
{
    namespace ws
    {
        namespace x11
        {
            int init_atoms(Display *dpy, x11_atoms_t *atoms)
            {
                #define WM_ATOM(name) \
                    atoms->X11_ ## name = XInternAtom(dpy, #name, False); \
                    /* lsp_trace("  %s = %d", #name, int(atoms->X11_ ## name)); */
    //                if (atoms->X11_ ## name == None)
    //                    return STATUS_NOT_FOUND;

                #define WM_PREDEFINED_ATOM(name) \
                    atoms->X11_ ## name = name; \
                    /*lsp_trace("  %s = %d", #name, int(atoms->X11_ ## name))*/;

                #include <ui/ws/x11/X11AtomList.h>
                #undef WM_PREDEFINED_ATOM
                #undef WM_ATOM

                return STATUS_OK;
            }
        }
    }
}

#endif /* USE_X11_DISPLAY */
