File indexing completed on 2024-02-25 17:23:27

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 1999, 2000 Matthias Ettrich <ettrich@kde.org>
0006     SPDX-FileCopyrightText: 2003 Lubos Lunak <l.lunak@kde.org>
0007     SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
0008 
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 
0012 #include "atoms.h"
0013 
0014 namespace KWin
0015 {
0016 
0017 Atoms::Atoms()
0018     : activities(QByteArrayLiteral("_KDE_NET_WM_ACTIVITIES"))
0019     , wm_protocols(QByteArrayLiteral("WM_PROTOCOLS"))
0020     , wm_delete_window(QByteArrayLiteral("WM_DELETE_WINDOW"))
0021     , wm_take_focus(QByteArrayLiteral("WM_TAKE_FOCUS"))
0022     , wm_change_state(QByteArrayLiteral("WM_CHANGE_STATE"))
0023     , wm_client_leader(QByteArrayLiteral("WM_CLIENT_LEADER"))
0024     , wm_window_role(QByteArrayLiteral("WM_WINDOW_ROLE"))
0025     , wm_state(QByteArrayLiteral("WM_STATE"))
0026     , sm_client_id(QByteArrayLiteral("SM_CLIENT_ID"))
0027     , motif_wm_hints(QByteArrayLiteral("_MOTIF_WM_HINTS"))
0028     , net_wm_context_help(QByteArrayLiteral("_NET_WM_CONTEXT_HELP"))
0029     , net_wm_ping(QByteArrayLiteral("_NET_WM_PING"))
0030     , net_wm_user_time(QByteArrayLiteral("_NET_WM_USER_TIME"))
0031     , kde_net_wm_user_creation_time(QByteArrayLiteral("_KDE_NET_WM_USER_CREATION_TIME"))
0032     , net_wm_take_activity(QByteArrayLiteral("_NET_WM_TAKE_ACTIVITY"))
0033     , net_wm_window_opacity(QByteArrayLiteral("_NET_WM_WINDOW_OPACITY"))
0034     , xdnd_selection(QByteArrayLiteral("XdndSelection"))
0035     , xdnd_aware(QByteArrayLiteral("XdndAware"))
0036     , xdnd_enter(QByteArrayLiteral("XdndEnter"))
0037     , xdnd_type_list(QByteArrayLiteral("XdndTypeList"))
0038     , xdnd_position(QByteArrayLiteral("XdndPosition"))
0039     , xdnd_status(QByteArrayLiteral("XdndStatus"))
0040     , xdnd_action_copy(QByteArrayLiteral("XdndActionCopy"))
0041     , xdnd_action_move(QByteArrayLiteral("XdndActionMove"))
0042     , xdnd_action_ask(QByteArrayLiteral("XdndActionAsk"))
0043     , xdnd_drop(QByteArrayLiteral("XdndDrop"))
0044     , xdnd_leave(QByteArrayLiteral("XdndLeave"))
0045     , xdnd_finished(QByteArrayLiteral("XdndFinished"))
0046     , net_frame_extents(QByteArrayLiteral("_NET_FRAME_EXTENTS"))
0047     , kde_net_wm_frame_strut(QByteArrayLiteral("_KDE_NET_WM_FRAME_STRUT"))
0048     , net_wm_sync_request_counter(QByteArrayLiteral("_NET_WM_SYNC_REQUEST_COUNTER"))
0049     , net_wm_sync_request(QByteArrayLiteral("_NET_WM_SYNC_REQUEST"))
0050     , kde_net_wm_shadow(QByteArrayLiteral("_KDE_NET_WM_SHADOW"))
0051     , kde_first_in_window_list(QByteArrayLiteral("_KDE_FIRST_IN_WINDOWLIST"))
0052     , kde_color_sheme(QByteArrayLiteral("_KDE_NET_WM_COLOR_SCHEME"))
0053     , kde_skip_close_animation(QByteArrayLiteral("_KDE_NET_WM_SKIP_CLOSE_ANIMATION"))
0054     , kde_screen_edge_show(QByteArrayLiteral("_KDE_NET_WM_SCREEN_EDGE_SHOW"))
0055     , utf8_string(QByteArrayLiteral("UTF8_STRING"))
0056     , text(QByteArrayLiteral("TEXT"))
0057     , uri_list(QByteArrayLiteral("text/uri-list"))
0058     , netscape_url(QByteArrayLiteral("_NETSCAPE_URL"))
0059     , moz_url(QByteArrayLiteral("text/x-moz-url"))
0060     , wl_surface_id(QByteArrayLiteral("WL_SURFACE_ID"))
0061     , wl_surface_serial(QByteArrayLiteral("WL_SURFACE_SERIAL"))
0062     , kde_net_wm_appmenu_service_name(QByteArrayLiteral("_KDE_NET_WM_APPMENU_SERVICE_NAME"))
0063     , kde_net_wm_appmenu_object_path(QByteArrayLiteral("_KDE_NET_WM_APPMENU_OBJECT_PATH"))
0064     , clipboard(QByteArrayLiteral("CLIPBOARD"))
0065     , timestamp(QByteArrayLiteral("TIMESTAMP"))
0066     , targets(QByteArrayLiteral("TARGETS"))
0067     , delete_atom(QByteArrayLiteral("DELETE"))
0068     , incr(QByteArrayLiteral("INCR"))
0069     , wl_selection(QByteArrayLiteral("WL_SELECTION"))
0070     , primary(QByteArrayLiteral("PRIMARY"))
0071     , edid(QByteArrayLiteral("EDID"))
0072     , m_dtSmWindowInfo(QByteArrayLiteral("_DT_SM_WINDOW_INFO"))
0073     , m_motifSupport(QByteArrayLiteral("_MOTIF_WM_INFO"))
0074     , m_helpersRetrieved(false)
0075 {
0076 }
0077 
0078 void Atoms::retrieveHelpers()
0079 {
0080     if (m_helpersRetrieved) {
0081         return;
0082     }
0083     // just retrieve the atoms once, all others are retrieved when being accessed
0084     m_dtSmWindowInfo.getReply();
0085     m_motifSupport.getReply();
0086     m_helpersRetrieved = true;
0087 }
0088 
0089 } // namespace