Changeset View
Changeset View
Standalone View
Standalone View
scene.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org> | 5 | Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org> | ||
6 | Copyright (C) 2019 Vlad Zahorodnii <vladzzag@gmail.com> | ||||
6 | 7 | | |||
7 | This program is free software; you can redistribute it and/or modify | 8 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | 10 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | 11 | (at your option) any later version. | ||
11 | 12 | | |||
12 | This program is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 430 Lines • ▼ Show 20 Line(s) | 407 | public: | |||
444 | * @see isDiscarded | 445 | * @see isDiscarded | ||
445 | */ | 446 | */ | ||
446 | void markAsDiscarded(); | 447 | void markAsDiscarded(); | ||
447 | /** | 448 | /** | ||
448 | * The size of the pixmap. | 449 | * The size of the pixmap. | ||
449 | */ | 450 | */ | ||
450 | const QSize &size() const; | 451 | const QSize &size() const; | ||
451 | /** | 452 | /** | ||
452 | * The geometry of the Client's content inside the pixmap. In case of a decorated Client the | | |||
453 | * pixmap also contains the decoration which is not rendered into this pixmap, though. This | | |||
454 | * contentsRect tells where inside the complete pixmap the real content is. | | |||
455 | */ | | |||
456 | const QRect &contentsRect() const; | | |||
457 | /** | | |||
458 | * @brief Returns the Toplevel this WindowPixmap belongs to. | 453 | * @brief Returns the Toplevel this WindowPixmap belongs to. | ||
459 | * Note: the Toplevel can change over the lifetime of the WindowPixmap in case the Toplevel is copied to Deleted. | 454 | * Note: the Toplevel can change over the lifetime of the WindowPixmap in case the Toplevel is copied to Deleted. | ||
460 | */ | 455 | */ | ||
461 | Toplevel *toplevel() const; | 456 | Toplevel *toplevel() const; | ||
462 | 457 | | |||
463 | /** | 458 | /** | ||
464 | * @returns the parent WindowPixmap in the sub-surface tree | 459 | * @returns the parent WindowPixmap in the sub-surface tree | ||
465 | */ | 460 | */ | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 502 | void setChildren(const QVector<WindowPixmap*> &children) { | |||
508 | m_children = children; | 503 | m_children = children; | ||
509 | } | 504 | } | ||
510 | 505 | | |||
511 | private: | 506 | private: | ||
512 | Scene::Window *m_window; | 507 | Scene::Window *m_window; | ||
513 | xcb_pixmap_t m_pixmap; | 508 | xcb_pixmap_t m_pixmap; | ||
514 | QSize m_pixmapSize; | 509 | QSize m_pixmapSize; | ||
515 | bool m_discarded; | 510 | bool m_discarded; | ||
516 | QRect m_contentsRect; | | |||
517 | QPointer<KWayland::Server::BufferInterface> m_buffer; | 511 | QPointer<KWayland::Server::BufferInterface> m_buffer; | ||
518 | QSharedPointer<QOpenGLFramebufferObject> m_fbo; | 512 | QSharedPointer<QOpenGLFramebufferObject> m_fbo; | ||
519 | QImage m_internalImage; | 513 | QImage m_internalImage; | ||
520 | WindowPixmap *m_parent = nullptr; | 514 | WindowPixmap *m_parent = nullptr; | ||
521 | QVector<WindowPixmap*> m_children; | 515 | QVector<WindowPixmap*> m_children; | ||
522 | QPointer<KWayland::Server::SubSurfaceInterface> m_subSurface; | 516 | QPointer<KWayland::Server::SubSurfaceInterface> m_subSurface; | ||
523 | }; | 517 | }; | ||
524 | 518 | | |||
▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Line(s) | |||||
675 | inline | 669 | inline | ||
676 | void WindowPixmap::markAsDiscarded() | 670 | void WindowPixmap::markAsDiscarded() | ||
677 | { | 671 | { | ||
678 | m_discarded = true; | 672 | m_discarded = true; | ||
679 | m_window->referencePreviousPixmap(); | 673 | m_window->referencePreviousPixmap(); | ||
680 | } | 674 | } | ||
681 | 675 | | |||
682 | inline | 676 | inline | ||
683 | const QRect &WindowPixmap::contentsRect() const | | |||
684 | { | | |||
685 | return m_contentsRect; | | |||
686 | } | | |||
687 | | ||||
688 | inline | | |||
689 | const QSize &WindowPixmap::size() const | 677 | const QSize &WindowPixmap::size() const | ||
690 | { | 678 | { | ||
691 | return m_pixmapSize; | 679 | return m_pixmapSize; | ||
692 | } | 680 | } | ||
693 | 681 | | |||
694 | } // namespace | 682 | } // namespace | ||
695 | 683 | | |||
696 | Q_DECLARE_INTERFACE(KWin::SceneFactory, "org.kde.kwin.Scene") | 684 | Q_DECLARE_INTERFACE(KWin::SceneFactory, "org.kde.kwin.Scene") | ||
697 | 685 | | |||
698 | #endif | 686 | #endif |