File indexing completed on 2024-05-19 16:34:46

0001 /*
0002     SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "scene/item.h"
0010 
0011 namespace KWin
0012 {
0013 
0014 class Deleted;
0015 class Shadow;
0016 class Window;
0017 
0018 /**
0019  * The ShadowItem class represents a nine-tile patch server-side drop-shadow.
0020  */
0021 class KWIN_EXPORT ShadowItem : public Item
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit ShadowItem(Shadow *shadow, Window *window, Scene *scene, Item *parent = nullptr);
0027     ~ShadowItem() override;
0028 
0029     Shadow *shadow() const;
0030 
0031 protected:
0032     WindowQuadList buildQuads() const override;
0033 
0034 private Q_SLOTS:
0035     void handleTextureChanged();
0036     void updateGeometry();
0037     void handleWindowClosed(Window *original, Deleted *deleted);
0038 
0039 private:
0040     Window *m_window;
0041     Shadow *m_shadow = nullptr;
0042 };
0043 
0044 } // namespace KWin