Changeset View
Changeset View
Standalone View
Standalone View
toplevel.h
Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Line(s) | 256 | public: | |||
---|---|---|---|---|---|
280 | bool isOnActiveScreen() const; | 280 | bool isOnActiveScreen() const; | ||
281 | int screen() const; // the screen where the center is | 281 | int screen() const; // the screen where the center is | ||
282 | /** | 282 | /** | ||
283 | * The scale of the screen this window is currently on | 283 | * The scale of the screen this window is currently on | ||
284 | * @note The buffer scale can be different. | 284 | * @note The buffer scale can be different. | ||
285 | * @since 5.12 | 285 | * @since 5.12 | ||
286 | */ | 286 | */ | ||
287 | qreal screenScale() const; // | 287 | qreal screenScale() const; // | ||
288 | /** | ||||
289 | * Returns the ratio between physical pixels and device-independent pixels for | ||||
290 | * the attached buffer (or pixmap). | ||||
291 | * | ||||
292 | * For X11 clients, this method always returns 1. | ||||
293 | */ | ||||
294 | virtual qreal bufferScale() const; | ||||
288 | virtual QPoint clientPos() const = 0; // inside of geometry() | 295 | virtual QPoint clientPos() const = 0; // inside of geometry() | ||
289 | /** | 296 | /** | ||
290 | * Describes how the client's content maps to the window geometry including the frame. | 297 | * Describes how the client's content maps to the window geometry including the frame. | ||
291 | * The default implementation is a 1:1 mapping meaning the frame is part of the content. | 298 | * The default implementation is a 1:1 mapping meaning the frame is part of the content. | ||
292 | */ | 299 | */ | ||
293 | virtual QPoint clientContentPos() const; | 300 | virtual QPoint clientContentPos() const; | ||
294 | virtual QSize clientSize() const = 0; | 301 | virtual QSize clientSize() const = 0; | ||
295 | virtual QRect visibleRect() const; // the area the window occupies on the screen | 302 | virtual QRect visibleRect() const; // the area the window occupies on the screen | ||
▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Line(s) | |||||
436 | 443 | | |||
437 | bool skipsCloseAnimation() const; | 444 | bool skipsCloseAnimation() const; | ||
438 | void setSkipCloseAnimation(bool set); | 445 | void setSkipCloseAnimation(bool set); | ||
439 | 446 | | |||
440 | quint32 surfaceId() const; | 447 | quint32 surfaceId() const; | ||
441 | KWayland::Server::SurfaceInterface *surface() const; | 448 | KWayland::Server::SurfaceInterface *surface() const; | ||
442 | void setSurface(KWayland::Server::SurfaceInterface *surface); | 449 | void setSurface(KWayland::Server::SurfaceInterface *surface); | ||
443 | 450 | | |||
444 | virtual void setInternalFramebufferObject(const QSharedPointer<QOpenGLFramebufferObject> &fbo); | | |||
445 | const QSharedPointer<QOpenGLFramebufferObject> &internalFramebufferObject() const; | 451 | const QSharedPointer<QOpenGLFramebufferObject> &internalFramebufferObject() const; | ||
452 | QImage internalImageObject() const; | ||||
446 | 453 | | |||
447 | /** | 454 | /** | ||
448 | * @returns Transformation to map from global to window coordinates. | 455 | * @returns Transformation to map from global to window coordinates. | ||
449 | * | 456 | * | ||
450 | * Default implementation returns a translation on negative pos(). | 457 | * Default implementation returns a translation on negative pos(). | ||
451 | * @see pos | 458 | * @see pos | ||
452 | */ | 459 | */ | ||
453 | virtual QMatrix4x4 inputTransformation() const; | 460 | virtual QMatrix4x4 inputTransformation() const; | ||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Line(s) | 593 | protected: | |||
621 | void setDepth(int depth); | 628 | void setDepth(int depth); | ||
622 | QRect geom; | 629 | QRect geom; | ||
623 | xcb_visualid_t m_visual; | 630 | xcb_visualid_t m_visual; | ||
624 | int bit_depth; | 631 | int bit_depth; | ||
625 | NETWinInfo* info; | 632 | NETWinInfo* info; | ||
626 | bool ready_for_painting; | 633 | bool ready_for_painting; | ||
627 | QRegion repaints_region; // updating, repaint just requires repaint of that area | 634 | QRegion repaints_region; // updating, repaint just requires repaint of that area | ||
628 | QRegion layer_repaints_region; | 635 | QRegion layer_repaints_region; | ||
636 | /** | ||||
637 | * An FBO object KWin internal windows might render to. | ||||
638 | */ | ||||
639 | QSharedPointer<QOpenGLFramebufferObject> m_internalFBO; | ||||
640 | QImage m_internalImage; | ||||
629 | 641 | | |||
630 | protected: | 642 | protected: | ||
631 | bool m_isDamaged; | 643 | bool m_isDamaged; | ||
632 | 644 | | |||
633 | private: | 645 | private: | ||
634 | // when adding new data members, check also copyToDeleted() | 646 | // when adding new data members, check also copyToDeleted() | ||
635 | QUuid m_internalId; | 647 | QUuid m_internalId; | ||
636 | Xcb::Window m_client; | 648 | Xcb::Window m_client; | ||
637 | xcb_damage_damage_t damage_handle; | 649 | xcb_damage_damage_t damage_handle; | ||
638 | QRegion damage_region; // damage is really damaged window (XDamage) and texture needs | 650 | QRegion damage_region; // damage is really damaged window (XDamage) and texture needs | ||
639 | bool is_shape; | 651 | bool is_shape; | ||
640 | EffectWindowImpl* effect_window; | 652 | EffectWindowImpl* effect_window; | ||
641 | QByteArray resource_name; | 653 | QByteArray resource_name; | ||
642 | QByteArray resource_class; | 654 | QByteArray resource_class; | ||
643 | ClientMachine *m_clientMachine; | 655 | ClientMachine *m_clientMachine; | ||
644 | xcb_window_t m_wmClientLeader; | 656 | xcb_window_t m_wmClientLeader; | ||
645 | bool m_damageReplyPending; | 657 | bool m_damageReplyPending; | ||
646 | QRegion opaque_region; | 658 | QRegion opaque_region; | ||
647 | xcb_xfixes_fetch_region_cookie_t m_regionCookie; | 659 | xcb_xfixes_fetch_region_cookie_t m_regionCookie; | ||
648 | int m_screen; | 660 | int m_screen; | ||
649 | bool m_skipCloseAnimation; | 661 | bool m_skipCloseAnimation; | ||
650 | quint32 m_surfaceId = 0; | 662 | quint32 m_surfaceId = 0; | ||
651 | KWayland::Server::SurfaceInterface *m_surface = nullptr; | 663 | KWayland::Server::SurfaceInterface *m_surface = nullptr; | ||
652 | /** | | |||
653 | * An FBO object KWin internal windows might render to. | | |||
654 | */ | | |||
655 | QSharedPointer<QOpenGLFramebufferObject> m_internalFBO; | | |||
656 | // when adding new data members, check also copyToDeleted() | 664 | // when adding new data members, check also copyToDeleted() | ||
657 | qreal m_screenScale = 1.0; | 665 | qreal m_screenScale = 1.0; | ||
658 | }; | 666 | }; | ||
659 | 667 | | |||
660 | inline xcb_window_t Toplevel::window() const | 668 | inline xcb_window_t Toplevel::window() const | ||
661 | { | 669 | { | ||
662 | return m_client; | 670 | return m_client; | ||
663 | } | 671 | } | ||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Line(s) | 921 | { | |||
914 | return m_surface; | 922 | return m_surface; | ||
915 | } | 923 | } | ||
916 | 924 | | |||
917 | inline const QSharedPointer<QOpenGLFramebufferObject> &Toplevel::internalFramebufferObject() const | 925 | inline const QSharedPointer<QOpenGLFramebufferObject> &Toplevel::internalFramebufferObject() const | ||
918 | { | 926 | { | ||
919 | return m_internalFBO; | 927 | return m_internalFBO; | ||
920 | } | 928 | } | ||
921 | 929 | | |||
930 | inline QImage Toplevel::internalImageObject() const | ||||
931 | { | ||||
932 | return m_internalImage; | ||||
933 | } | ||||
934 | | ||||
922 | inline QPoint Toplevel::clientContentPos() const | 935 | inline QPoint Toplevel::clientContentPos() const | ||
923 | { | 936 | { | ||
924 | return QPoint(0, 0); | 937 | return QPoint(0, 0); | ||
925 | } | 938 | } | ||
926 | 939 | | |||
927 | template <class T, class U> | 940 | template <class T, class U> | ||
928 | inline T *Toplevel::findInList(const QList<T*> &list, std::function<bool (const U*)> func) | 941 | inline T *Toplevel::findInList(const QList<T*> &list, std::function<bool (const U*)> func) | ||
929 | { | 942 | { | ||
Show All 30 Lines |