File indexing completed on 2024-10-13 10:45:59

0001 /* SPDX-FileCopyrightText: 1999-2001 Lubos Lunak <l.lunak@kde.org>
0002 
0003    SPDX-License-Identifier: GPL-2.0-only
0004 */
0005 
0006 #ifndef WINDOWS_HANDLER_H
0007 #define WINDOWS_HANDLER_H
0008 
0009 #include <QObject>
0010 #include <QWindowList>
0011 
0012 #include <netwm.h>
0013 
0014 namespace KHotKeys
0015 {
0016 const NET::WindowTypes SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask | NET::ToolbarMask | NET::MenuMask | NET::DialogMask
0017     | NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask;
0018 
0019 class Windowdef_list;
0020 
0021 class Q_DECL_EXPORT WindowsHandler : public QObject
0022 {
0023     Q_OBJECT
0024 public:
0025     WindowsHandler(bool enable_signals_P, QObject *parent_P);
0026     ~WindowsHandler() override;
0027     QString get_window_class(WId id_P);
0028     QString get_window_role(WId id_P);
0029     WId active_window();
0030     void set_action_window(WId window);
0031     WId action_window();
0032     WId find_window(const Windowdef_list *window_P);
0033     static WId window_at_position(int x, int y);
0034     static void activate_window(WId id_P);
0035 Q_SIGNALS:
0036     void window_added(WId window_P);
0037     void window_removed(WId window_P);
0038     void active_window_changed(WId window_P);
0039     void window_changed(WId window_P);
0040     void window_changed(WId window_P, unsigned int flags_P);
0041 protected Q_SLOTS:
0042     void window_added_slot(WId window_P);
0043     void window_removed_slot(WId window_P);
0044     void active_window_changed_slot(WId window_P);
0045     void window_changed_slot(WId window_P);
0046     void window_changed_slot(WId window_P, unsigned int flags_P);
0047 
0048 private:
0049     bool signals_enabled;
0050     WId _action_window;
0051     bool m_isX11;
0052 };
0053 
0054 } // namespace KHotKeys
0055 
0056 #endif