Krita Source Code Documentation
Loading...
Searching...
No Matches
KisRootSurfaceInfoProxy Class Reference

#include <KisRootSurfaceInfoProxy.h>

+ Inheritance diagram for KisRootSurfaceInfoProxy:

Signals

void sigRootSurfaceProfileChanged (const KoColorProfile *profile) const
 

Public Member Functions

QString colorManagementReport () const
 
bool isReady () const
 
 KisRootSurfaceInfoProxy (QWidget *watched, QObject *parent=nullptr)
 
QString osPreferredColorSpaceReport () const
 
const KoColorProfilerootSurfaceProfile () const
 
 ~KisRootSurfaceInfoProxy ()
 
- Public Member Functions inherited from KisRootSurfaceTrackerBase
 KisRootSurfaceTrackerBase (QWidget *watched, QObject *parent=nullptr)
 
QWidget * trackedWidget () const
 
 ~KisRootSurfaceTrackerBase ()
 

Private Member Functions

void connectToNativeWindow (QWindow *nativeWindow) override
 
void disconnectFromNativeWindow () override
 
void tryUpdateRootSurfaceProfile ()
 

Private Attributes

const KoColorProfilem_rootSurfaceProfile {nullptr}
 
QMetaObject::Connection m_surfaceManagerConnection
 
QPointer< KisSRGBSurfaceColorSpaceManagerm_topLevelSurfaceManager
 

Additional Inherited Members

- Protected Member Functions inherited from KisRootSurfaceTrackerBase
void initialize ()
 

Detailed Description

KisRootSurfaceInfoProxy is a special proxy object for the surface color management information of the widget.

When created, the proxy does the following:

1) Finds the top-level widget that watched belongs to. (is watched changed its parent in the meantime, e.g. during construction, then the proxy will handle that as well)

2) Finds the QWindow that this toplevel widget is painted on (if platform window is not created yet, subscribes to QPlatformSurfaceEvent to attach when platform window is finally created)

3) Finds KisSRGBSurfaceColorSpaceManager object attached to this window. This object is usually attached with an event filter in KisApplication to all windows not having a special property (if the manager is not yet attached, tracks its addition by filtering QChildEvent)

4) Finally, connects to the manager and forwards its sigDisplayConfigChanged() to local sigRootSurfaceProfileChanged()

Definition at line 40 of file KisRootSurfaceInfoProxy.h.

Constructor & Destructor Documentation

◆ KisRootSurfaceInfoProxy()

KisRootSurfaceInfoProxy::KisRootSurfaceInfoProxy ( QWidget * watched,
QObject * parent = nullptr )

Definition at line 18 of file KisRootSurfaceInfoProxy.cpp.

19 : KisRootSurfaceTrackerBase(watched, parent)
20{
23 // WARNING: we potentially call virtual functions here!
24 initialize();
25}
static KisPlatformPluginInterfaceFactory * instance()
const KoColorProfile * m_rootSurfaceProfile
KisRootSurfaceTrackerBase(QWidget *watched, QObject *parent=nullptr)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
static KoColorSpaceRegistry * instance()
const KoColorProfile * p709SRGBProfile() const

References KisRootSurfaceTrackerBase::initialize(), KoColorSpaceRegistry::instance(), KisPlatformPluginInterfaceFactory::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_rootSurfaceProfile, and KoColorSpaceRegistry::p709SRGBProfile().

◆ ~KisRootSurfaceInfoProxy()

KisRootSurfaceInfoProxy::~KisRootSurfaceInfoProxy ( )

Definition at line 27 of file KisRootSurfaceInfoProxy.cpp.

28{
29}

Member Function Documentation

◆ colorManagementReport()

QString KisRootSurfaceInfoProxy::colorManagementReport ( ) const

Definition at line 41 of file KisRootSurfaceInfoProxy.cpp.

42{
43 return m_topLevelSurfaceManager ? m_topLevelSurfaceManager->colorManagementReport()
44 : QString("Top level surface color manager is not found!\n");
45}
QPointer< KisSRGBSurfaceColorSpaceManager > m_topLevelSurfaceManager

References m_topLevelSurfaceManager.

◆ connectToNativeWindow()

◆ disconnectFromNativeWindow()

void KisRootSurfaceInfoProxy::disconnectFromNativeWindow ( )
overrideprivatevirtual

◆ isReady()

bool KisRootSurfaceInfoProxy::isReady ( ) const

Definition at line 36 of file KisRootSurfaceInfoProxy.cpp.

37{
39}

References m_topLevelSurfaceManager.

◆ osPreferredColorSpaceReport()

QString KisRootSurfaceInfoProxy::osPreferredColorSpaceReport ( ) const

Definition at line 47 of file KisRootSurfaceInfoProxy.cpp.

48{
49 return m_topLevelSurfaceManager ? m_topLevelSurfaceManager->osPreferredColorSpaceReport()
50 : QString("Top level surface color manager is not found!\n");
51}

References m_topLevelSurfaceManager.

◆ rootSurfaceProfile()

const KoColorProfile * KisRootSurfaceInfoProxy::rootSurfaceProfile ( ) const

Definition at line 31 of file KisRootSurfaceInfoProxy.cpp.

32{
34}

References m_rootSurfaceProfile.

◆ sigRootSurfaceProfileChanged

void KisRootSurfaceInfoProxy::sigRootSurfaceProfileChanged ( const KoColorProfile * profile) const
signal

◆ tryUpdateRootSurfaceProfile()

void KisRootSurfaceInfoProxy::tryUpdateRootSurfaceProfile ( )
private

Member Data Documentation

◆ m_rootSurfaceProfile

const KoColorProfile* KisRootSurfaceInfoProxy::m_rootSurfaceProfile {nullptr}
private

Definition at line 65 of file KisRootSurfaceInfoProxy.h.

65{nullptr};

◆ m_surfaceManagerConnection

QMetaObject::Connection KisRootSurfaceInfoProxy::m_surfaceManagerConnection
private

Definition at line 63 of file KisRootSurfaceInfoProxy.h.

◆ m_topLevelSurfaceManager

QPointer<KisSRGBSurfaceColorSpaceManager> KisRootSurfaceInfoProxy::m_topLevelSurfaceManager
private

Definition at line 62 of file KisRootSurfaceInfoProxy.h.


The documentation for this class was generated from the following files: