Changeset View
Changeset View
Standalone View
Standalone View
scene.h
Show First 20 Lines • Show All 239 Lines • ▼ Show 20 Line(s) | |||||
240 | private: | 240 | private: | ||
241 | void paintWindowThumbnails(Scene::Window *w, QRegion region, qreal opacity, qreal brightness, qreal saturation); | 241 | void paintWindowThumbnails(Scene::Window *w, QRegion region, qreal opacity, qreal brightness, qreal saturation); | ||
242 | void paintDesktopThumbnails(Scene::Window *w); | 242 | void paintDesktopThumbnails(Scene::Window *w); | ||
243 | QHash< Toplevel*, Window* > m_windows; | 243 | QHash< Toplevel*, Window* > m_windows; | ||
244 | // windows in their stacking order | 244 | // windows in their stacking order | ||
245 | QVector< Window* > stacking_order; | 245 | QVector< Window* > stacking_order; | ||
246 | }; | 246 | }; | ||
247 | 247 | | |||
248 | /** | ||||
249 | * Factory class to create a Scene. Needs to be implemented by the plugins. | ||||
250 | **/ | ||||
251 | class KWIN_EXPORT SceneFactory : public QObject | ||||
252 | { | ||||
253 | Q_OBJECT | ||||
254 | public: | ||||
255 | virtual ~SceneFactory(); | ||||
256 | | ||||
257 | /** | ||||
258 | * @returns The created Scene, may be @c nullptr. | ||||
259 | **/ | ||||
260 | virtual Scene *create(QObject *parent = nullptr) const = 0; | ||||
261 | | ||||
262 | protected: | ||||
263 | explicit SceneFactory(QObject *parent); | ||||
264 | }; | ||||
265 | | ||||
248 | // The base class for windows representations in composite backends | 266 | // The base class for windows representations in composite backends | ||
249 | class Scene::Window | 267 | class Scene::Window | ||
250 | { | 268 | { | ||
251 | public: | 269 | public: | ||
252 | Window(Toplevel* c); | 270 | Window(Toplevel* c); | ||
253 | virtual ~Window(); | 271 | virtual ~Window(); | ||
254 | // perform the actual painting of the window | 272 | // perform the actual painting of the window | ||
255 | virtual void performPaint(int mask, QRegion region, WindowPaintData data) = 0; | 273 | virtual void performPaint(int mask, QRegion region, WindowPaintData data) = 0; | ||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | |||||
354 | * This class is not intended to be updated when the pixmap is no longer valid due to e.g. resizing the window. | 372 | * This class is not intended to be updated when the pixmap is no longer valid due to e.g. resizing the window. | ||
355 | * Instead a new instance of this class should be instantiated. The idea behind this is that a valid pixmap does not | 373 | * Instead a new instance of this class should be instantiated. The idea behind this is that a valid pixmap does not | ||
356 | * get destroyed, but can continue to be used. To indicate that a newer pixmap should in generally be around, one can | 374 | * get destroyed, but can continue to be used. To indicate that a newer pixmap should in generally be around, one can | ||
357 | * use @link markAsDiscarded. | 375 | * use @link markAsDiscarded. | ||
358 | * | 376 | * | ||
359 | * This class is intended to be inherited for the needs of the compositor backends which need further mapping from | 377 | * This class is intended to be inherited for the needs of the compositor backends which need further mapping from | ||
360 | * the native pixmap to the respective rendering format. | 378 | * the native pixmap to the respective rendering format. | ||
361 | */ | 379 | */ | ||
362 | class WindowPixmap | 380 | class KWIN_EXPORT WindowPixmap | ||
363 | { | 381 | { | ||
364 | public: | 382 | public: | ||
365 | virtual ~WindowPixmap(); | 383 | virtual ~WindowPixmap(); | ||
366 | /** | 384 | /** | ||
367 | * @brief Tries to create the mapping between the Window and the pixmap. | 385 | * @brief Tries to create the mapping between the Window and the pixmap. | ||
368 | * | 386 | * | ||
369 | * In case this method succeeds in creating the pixmap for the window, @link isValid will return @c true otherwise | 387 | * In case this method succeeds in creating the pixmap for the window, @link isValid will return @c true otherwise | ||
370 | * @c false. | 388 | * @c false. | ||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Line(s) | |||||
638 | inline | 656 | inline | ||
639 | const QSize &WindowPixmap::size() const | 657 | const QSize &WindowPixmap::size() const | ||
640 | { | 658 | { | ||
641 | return m_pixmapSize; | 659 | return m_pixmapSize; | ||
642 | } | 660 | } | ||
643 | 661 | | |||
644 | } // namespace | 662 | } // namespace | ||
645 | 663 | | |||
664 | Q_DECLARE_INTERFACE(KWin::SceneFactory, "org.kde.kwin.Scene") | ||||
665 | | ||||
646 | #endif | 666 | #endif |