File indexing completed on 2024-11-10 04:57:41

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_color_sheme(QByteArrayLiteral("_KDE_NET_WM_COLOR_SCHEME"))
0052     , kde_skip_close_animation(QByteArrayLiteral("_KDE_NET_WM_SKIP_CLOSE_ANIMATION"))
0053     , kde_screen_edge_show(QByteArrayLiteral("_KDE_NET_WM_SCREEN_EDGE_SHOW"))
0054     , utf8_string(QByteArrayLiteral("UTF8_STRING"))
0055     , text(QByteArrayLiteral("TEXT"))
0056     , uri_list(QByteArrayLiteral("text/uri-list"))
0057     , netscape_url(QByteArrayLiteral("_NETSCAPE_URL"))
0058     , moz_url(QByteArrayLiteral("text/x-moz-url"))
0059     , wl_surface_id(QByteArrayLiteral("WL_SURFACE_ID"))
0060     , wl_surface_serial(QByteArrayLiteral("WL_SURFACE_SERIAL"))
0061     , kde_net_wm_appmenu_service_name(QByteArrayLiteral("_KDE_NET_WM_APPMENU_SERVICE_NAME"))
0062     , kde_net_wm_appmenu_object_path(QByteArrayLiteral("_KDE_NET_WM_APPMENU_OBJECT_PATH"))
0063     , clipboard(QByteArrayLiteral("CLIPBOARD"))
0064     , timestamp(QByteArrayLiteral("TIMESTAMP"))
0065     , targets(QByteArrayLiteral("TARGETS"))
0066     , delete_atom(QByteArrayLiteral("DELETE"))
0067     , incr(QByteArrayLiteral("INCR"))
0068     , wl_selection(QByteArrayLiteral("WL_SELECTION"))
0069     , primary(QByteArrayLiteral("PRIMARY"))
0070     , edid(QByteArrayLiteral("EDID"))
0071     , m_dtSmWindowInfo(QByteArrayLiteral("_DT_SM_WINDOW_INFO"))
0072     , m_motifSupport(QByteArrayLiteral("_MOTIF_WM_INFO"))
0073     , m_helpersRetrieved(false)
0074 {
0075 }
0076 
0077 void Atoms::retrieveHelpers()
0078 {
0079     if (m_helpersRetrieved) {
0080         return;
0081     }
0082     // just retrieve the atoms once, all others are retrieved when being accessed
0083     m_dtSmWindowInfo.getReply();
0084     m_motifSupport.getReply();
0085     m_helpersRetrieved = true;
0086 }
0087 
0088 } // namespace