File indexing completed on 2025-04-27 11:33:00

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2011 Arthur Arlt <a.arlt@stud.uni-heidelberg.de>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 #include "outline.h"
0011 #include "utils/xcbutils.h"
0012 
0013 namespace KWin
0014 {
0015 
0016 class NonCompositedOutlineVisual : public OutlineVisual
0017 {
0018 public:
0019     NonCompositedOutlineVisual(Outline *outline);
0020     ~NonCompositedOutlineVisual() override;
0021     void show() override;
0022     void hide() override;
0023 
0024 private:
0025     // TODO: variadic template arguments for adding method arguments
0026     template<typename T>
0027     void forEachWindow(T method);
0028     bool m_initialized;
0029     Xcb::Window m_topOutline;
0030     Xcb::Window m_rightOutline;
0031     Xcb::Window m_bottomOutline;
0032     Xcb::Window m_leftOutline;
0033 };
0034 
0035 template<typename T>
0036 inline void NonCompositedOutlineVisual::forEachWindow(T method)
0037 {
0038     (m_topOutline.*method)();
0039     (m_rightOutline.*method)();
0040     (m_bottomOutline.*method)();
0041     (m_leftOutline.*method)();
0042 }
0043 
0044 }