Krita Source Code Documentation
Loading...
Searching...
No Matches
KisRootSurfaceInfoProxy.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
9#include <QTimer>
10
11#include <QEvent>
12#include <QWidget>
13#include <QWindow>
17
18
19KisRootSurfaceInfoProxy::KisRootSurfaceInfoProxy(QWidget *watched, QObject *parent)
20 : KisRootSurfaceTrackerBase(watched, parent)
21{
24 // WARNING: we potentially call virtual functions here!
25 initialize();
26}
27
31
36
41
43{
44 return m_topLevelSurfaceManager ? m_topLevelSurfaceManager->colorManagementReport()
45 : QString("Top level surface color manager is not found!\n");
46}
47
49{
50 return m_topLevelSurfaceManager ? m_topLevelSurfaceManager->osPreferredColorSpaceReport()
51 : QString("Top level surface color manager is not found!\n");
52}
53
54std::optional<KisSurfaceColorimetry::SurfaceDescription> KisRootSurfaceInfoProxy::currentSurfaceDescription() const {
55 return m_topLevelSurfaceManager ? m_topLevelSurfaceManager->currentSurfaceDescription()
56 : std::nullopt;
57
58}
59
78
87
89{
91
93 newProfile = m_topLevelSurfaceManager->displayConfig().profile;
94 }
95
97
98 if (newProfile != m_rootSurfaceProfile) {
99 m_rootSurfaceProfile = newProfile;
101 }
102}
static KisPlatformPluginInterfaceFactory * instance()
QMetaObject::Connection m_surfaceManagerConnection
QPointer< KisSRGBSurfaceColorSpaceManager > m_topLevelSurfaceManager
const KoColorProfile * m_rootSurfaceProfile
std::optional< KisSurfaceColorimetry::SurfaceDescription > currentSurfaceDescription() const
void connectToNativeWindow(QWindow *nativeWindow) override
KisRootSurfaceInfoProxy(QWidget *watched, QObject *parent=nullptr)
const KoColorProfile * rootSurfaceProfile() const
void sigRootSurfaceProfileChanged(const KoColorProfile *profile) const
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
void sigDisplayConfigChanged(const KisDisplayConfig &config)
static KoColorSpaceRegistry * instance()
const KoColorProfile * p709SRGBProfile() const