Compare commits
3 Commits
master
...
icc-effect
Author | SHA1 | Date |
---|---|---|
Vitaliy Filippov | 6d58c4d980 | |
Jonathan Riddell | 5ea30fdf9f | |
l10n daemon script | 22be8e1feb |
|
@ -1,7 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
project(KWIN)
|
||||
set(PROJECT_VERSION "5.14.4")
|
||||
set(PROJECT_VERSION "5.14.5")
|
||||
set(PROJECT_VERSION_MAJOR 5)
|
||||
|
||||
set(QT_MIN_VERSION "5.11.0")
|
||||
|
|
|
@ -61,6 +61,11 @@ macro( KWIN4_ADD_EFFECT name )
|
|||
|
||||
endmacro()
|
||||
|
||||
# For ICC (FIXME remove if building separately)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(LCMS2 REQUIRED lcms2)
|
||||
set_package_properties(LCMS2 PROPERTIES TYPE REQUIRED PURPOSE "Required for ICC color correction.")
|
||||
|
||||
# Install the KWin/Effect service type
|
||||
install( FILES kwineffect.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
|
||||
|
||||
|
@ -81,6 +86,7 @@ set( kwin4_effect_builtins_sources
|
|||
diminactive/diminactive.cpp
|
||||
flipswitch/flipswitch.cpp
|
||||
glide/glide.cpp
|
||||
icc/icc.cpp
|
||||
invert/invert.cpp
|
||||
lookingglass/lookingglass.cpp
|
||||
magiclamp/magiclamp.cpp
|
||||
|
@ -113,6 +119,7 @@ kconfig_add_kcfg_files(kwin4_effect_builtins_sources
|
|||
fallapart/fallapartconfig.kcfgc
|
||||
flipswitch/flipswitchconfig.kcfgc
|
||||
glide/glideconfig.kcfgc
|
||||
icc/iccconfig.kcfgc
|
||||
lookingglass/lookingglassconfig.kcfgc
|
||||
magiclamp/magiclampconfig.kcfgc
|
||||
magnifier/magnifierconfig.kcfgc
|
||||
|
@ -175,6 +182,7 @@ add_subdirectory( coverswitch )
|
|||
add_subdirectory( cube )
|
||||
add_subdirectory( flipswitch )
|
||||
add_subdirectory( glide )
|
||||
add_subdirectory( icc )
|
||||
add_subdirectory( invert )
|
||||
add_subdirectory( lookingglass )
|
||||
add_subdirectory( magnifier )
|
||||
|
@ -192,3 +200,8 @@ add_subdirectory( wobblywindows )
|
|||
|
||||
# Add the builtins plugin
|
||||
kwin4_add_effect( builtins ${kwin4_effect_builtins_sources} )
|
||||
|
||||
# FIXME For ICC, remove if building separately
|
||||
target_link_libraries(kwin4_effect_builtins PUBLIC ${LCMS2_LIBRARIES})
|
||||
target_include_directories(kwin4_effect_builtins PUBLIC ${LCMS2_INCLUDE_DIRS})
|
||||
target_compile_options(kwin4_effect_builtins PUBLIC ${LCMS2_CFLAGS_OTHER})
|
||||
|
|
|
@ -52,6 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "cube/cubeslide.h"
|
||||
#include "flipswitch/flipswitch.h"
|
||||
#include "glide/glide.h"
|
||||
#include "icc/icc.h"
|
||||
#include "invert/invert.h"
|
||||
#include "lookingglass/lookingglass.h"
|
||||
#include "magnifier/magnifier.h"
|
||||
|
@ -294,6 +295,21 @@ EFFECT_FALLBACK
|
|||
nullptr,
|
||||
nullptr
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
}, {
|
||||
QStringLiteral("icc"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "ICC Color Correction"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Applies full ICC color correction to the whole display"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ICCEffect>,
|
||||
&ICCEffect::supported,
|
||||
nullptr
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
}, {
|
||||
QStringLiteral("invert"),
|
||||
|
|
|
@ -47,6 +47,7 @@ enum class BuiltInEffect
|
|||
FlipSwitch,
|
||||
Glide,
|
||||
HighlightWindow,
|
||||
ICC,
|
||||
Invert,
|
||||
Kscreen,
|
||||
LookingGlass,
|
||||
|
|
|
@ -76,7 +76,7 @@ Name[uz@cyrillic]=Сўниш
|
|||
Name[vi]=Mờ dần
|
||||
Name[wa]=Blåwe
|
||||
Name[x-test]=xxFadexx
|
||||
Name[zh_CN]=淡入淡出
|
||||
Name[zh_CN]=淡入
|
||||
Name[zh_TW]=淡出
|
||||
Icon=preferences-system-windows-effect-fade
|
||||
Comment=Make windows smoothly fade in and out when they are shown or hidden
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
#######################################
|
||||
# Effect
|
||||
|
||||
#######################################
|
||||
# Config
|
||||
set(kwin_icc_config_SRCS icc_config.cpp)
|
||||
ki18n_wrap_ui(kwin_icc_config_SRCS icc_config.ui)
|
||||
qt5_add_dbus_interface(kwin_icc_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface)
|
||||
kconfig_add_kcfg_files(kwin_icc_config_SRCS iccconfig.kcfgc)
|
||||
|
||||
add_library(kwin_icc_config MODULE ${kwin_icc_config_SRCS})
|
||||
|
||||
## Build separate plugin
|
||||
#find_package(PkgConfig)
|
||||
#pkg_check_modules(LCMS2 REQUIRED lcms2)
|
||||
#set_package_properties(LCMS2 PROPERTIES TYPE REQUIRED PURPOSE "Required for ICC color correction.")
|
||||
#
|
||||
#kwin4_add_effect(icc icc.cpp)
|
||||
#target_link_libraries(kwin4_effect_icc PUBLIC ${LCMS2_LIBRARIES})
|
||||
#target_include_directories(kwin4_effect_icc PUBLIC ${LCMS2_INCLUDE_DIRS})
|
||||
#target_compile_options(kwin4_effect_icc PUBLIC ${LCMS2_CFLAGS_OTHER})
|
||||
|
||||
target_link_libraries(kwin_icc_config
|
||||
KF5::ConfigWidgets
|
||||
KF5::I18n
|
||||
KF5::Service
|
||||
KF5::XmlGui
|
||||
)
|
||||
|
||||
kcoreaddons_desktop_to_json(kwin_icc_config icc_config.desktop SERVICE_TYPES kcmodule.desktop)
|
||||
|
||||
install(
|
||||
TARGETS
|
||||
kwin_icc_config
|
||||
DESTINATION
|
||||
${PLUGIN_INSTALL_DIR}/kwin/effects/configs
|
||||
)
|
|
@ -0,0 +1,14 @@
|
|||
uniform sampler2D sampler;
|
||||
|
||||
varying vec2 texcoord0;
|
||||
|
||||
uniform sampler3D clut;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 tex = texture2D(sampler, texcoord0);
|
||||
|
||||
tex.rgb = texture3D(clut, tex.rgb).rgb * tex.a;
|
||||
|
||||
gl_FragColor = tex;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
#version 140
|
||||
uniform sampler2D sampler;
|
||||
|
||||
in vec2 texcoord0;
|
||||
|
||||
uniform sampler3D clut;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 tex = texture(sampler, texcoord0);
|
||||
|
||||
tex.rgb = texture(clut, tex.rgb).rgb * tex.a;
|
||||
|
||||
fragColor = tex;
|
||||
}
|
|
@ -0,0 +1,242 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2019 Vitaliy Filippov <vitalif@yourcmc.ru>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
#include "icc.h"
|
||||
#include "iccconfig.h"
|
||||
#include "kwinglplatform.h"
|
||||
|
||||
#include "lcms2.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QFile>
|
||||
#include <KGlobalAccel>
|
||||
#include <KLocalizedString>
|
||||
#include <QStandardPaths>
|
||||
|
||||
static const int LUT_POINTS = 64;
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
ICCEffect::ICCEffect()
|
||||
: m_valid(false),
|
||||
m_shader(NULL),
|
||||
m_texture(0),
|
||||
m_clut(NULL)
|
||||
{
|
||||
initConfig<ICCConfig>();
|
||||
reconfigure(ReconfigureAll);
|
||||
}
|
||||
|
||||
ICCEffect::~ICCEffect()
|
||||
{
|
||||
if (m_shader)
|
||||
delete m_shader;
|
||||
if (m_clut)
|
||||
delete[] m_clut;
|
||||
if (m_texture != 0)
|
||||
glDeleteTextures(1, &m_texture);
|
||||
}
|
||||
|
||||
bool ICCEffect::supported()
|
||||
{
|
||||
return effects->compositingType() == OpenGL2Compositing;
|
||||
}
|
||||
|
||||
void ICCEffect::reconfigure(ReconfigureFlags flags)
|
||||
{
|
||||
Q_UNUSED(flags)
|
||||
|
||||
ICCConfig::self()->read();
|
||||
|
||||
m_sourceICC = ICCConfig::self()->sourceICC().trimmed();
|
||||
m_targetICC = ICCConfig::self()->targetICC().trimmed();
|
||||
|
||||
loadData();
|
||||
|
||||
effects->addRepaintFull();
|
||||
}
|
||||
|
||||
bool ICCEffect::loadData()
|
||||
{
|
||||
m_valid = false;
|
||||
|
||||
if (m_shader)
|
||||
delete m_shader;
|
||||
if (m_clut)
|
||||
delete[] m_clut;
|
||||
if (m_texture != 0)
|
||||
glDeleteTextures(1, &m_texture);
|
||||
|
||||
m_shader = ShaderManager::instance()->generateShaderFromResources(ShaderTrait::MapTexture, QString(), QStringLiteral("icc.frag"));
|
||||
if (!m_shader->isValid())
|
||||
{
|
||||
qCCritical(KWINEFFECTS) << "The shader failed to load!";
|
||||
return false;
|
||||
}
|
||||
ShaderManager::instance()->pushShader(m_shader);
|
||||
m_shader->setUniform("clut", 3); // GL_TEXTURE3
|
||||
ShaderManager::instance()->popShader();
|
||||
|
||||
m_clut = makeCLUT(m_sourceICC.trimmed().isEmpty() ? NULL : m_sourceICC.toLocal8Bit().data(), m_targetICC.toLocal8Bit().data());
|
||||
|
||||
if (m_clut)
|
||||
{
|
||||
m_texture = setupCCTexture(m_clut);
|
||||
|
||||
if (m_texture)
|
||||
{
|
||||
m_valid = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t *ICCEffect::makeCLUT(const char* source_icc, const char* target_icc)
|
||||
{
|
||||
uint8_t *clut = NULL, *clut_source = NULL;
|
||||
cmsHPROFILE source, target;
|
||||
cmsHTRANSFORM transform;
|
||||
source = source_icc ? cmsOpenProfileFromFile(source_icc, "r") : cmsCreate_sRGBProfile();
|
||||
if (!source)
|
||||
goto free_nothing;
|
||||
target = cmsOpenProfileFromFile(target_icc, "r");
|
||||
if (!target)
|
||||
goto free_source;
|
||||
transform = cmsCreateTransform(
|
||||
source, TYPE_RGB_8, target, TYPE_RGB_8,
|
||||
INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_BLACKPOINTCOMPENSATION
|
||||
);
|
||||
if (!transform)
|
||||
goto free_target;
|
||||
clut_source = new uint8_t[LUT_POINTS*LUT_POINTS*LUT_POINTS*3];
|
||||
if (!clut_source)
|
||||
goto free_transform;
|
||||
for (int b = 0, addr = 0; b < LUT_POINTS; b++)
|
||||
{
|
||||
for (int g = 0; g < LUT_POINTS; g++)
|
||||
{
|
||||
for (int r = 0; r < LUT_POINTS; r++, addr += 3)
|
||||
{
|
||||
clut_source[addr] = 255*r/(LUT_POINTS-1);
|
||||
clut_source[addr+1] = 255*g/(LUT_POINTS-1);
|
||||
clut_source[addr+2] = 255*b/(LUT_POINTS-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
clut = new uint8_t[LUT_POINTS*LUT_POINTS*LUT_POINTS*3];
|
||||
if (!clut)
|
||||
goto free_clut_source;
|
||||
cmsDoTransform(transform, clut_source, clut, LUT_POINTS*LUT_POINTS*LUT_POINTS);
|
||||
/*for (int b = 0, addr = 0; b < LUT_POINTS; b++)
|
||||
{
|
||||
for (int g = 0; g < LUT_POINTS; g++)
|
||||
{
|
||||
for (int r = 0; r < LUT_POINTS; r++, addr += 3)
|
||||
{
|
||||
printf("cLUT %02x%02x%02x -> %02x%02x%02x\n", 255*r/(LUT_POINTS-1), 255*g/(LUT_POINTS-1), 255*b/(LUT_POINTS-1), clut[addr], clut[addr+1], clut[addr+2]);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
free_clut_source:
|
||||
delete[] clut_source;
|
||||
free_transform:
|
||||
cmsDeleteTransform(transform);
|
||||
free_target:
|
||||
cmsCloseProfile(target);
|
||||
free_source:
|
||||
cmsCloseProfile(source);
|
||||
free_nothing:
|
||||
return clut;
|
||||
}
|
||||
|
||||
GLuint ICCEffect::setupCCTexture(uint8_t *clut)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
GLuint texture;
|
||||
|
||||
glGenTextures(1, &texture);
|
||||
|
||||
glBindTexture(GL_TEXTURE_3D, texture);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
||||
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB8,
|
||||
LUT_POINTS, LUT_POINTS, LUT_POINTS,
|
||||
0, GL_RGB, GL_UNSIGNED_BYTE, clut);
|
||||
|
||||
if ((err = glGetError()) != GL_NO_ERROR)
|
||||
{
|
||||
glDeleteTextures(1, &texture);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
void ICCEffect::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
|
||||
{
|
||||
if (m_valid)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE3);
|
||||
glBindTexture(GL_TEXTURE_3D, m_texture);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
ShaderManager *shaderManager = ShaderManager::instance();
|
||||
shaderManager->pushShader(m_shader);
|
||||
data.shader = m_shader;
|
||||
}
|
||||
|
||||
effects->drawWindow(w, mask, region, data);
|
||||
|
||||
if (m_valid)
|
||||
{
|
||||
ShaderManager::instance()->popShader();
|
||||
}
|
||||
}
|
||||
|
||||
void ICCEffect::paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity)
|
||||
{
|
||||
if (m_valid)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE3);
|
||||
glBindTexture(GL_TEXTURE_3D, m_texture);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
frame->setShader(m_shader);
|
||||
ShaderBinder binder(m_shader);
|
||||
effects->paintEffectFrame(frame, region, opacity, frameOpacity);
|
||||
}
|
||||
else
|
||||
{
|
||||
effects->paintEffectFrame(frame, region, opacity, frameOpacity);
|
||||
}
|
||||
}
|
||||
|
||||
bool ICCEffect::isActive() const
|
||||
{
|
||||
return m_valid;
|
||||
}
|
||||
|
||||
} // namespace
|
|
@ -0,0 +1,78 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2019 Vitaliy Filippov <vitalif@yourcmc.ru>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef KWIN_ICC_H
|
||||
#define KWIN_ICC_H
|
||||
|
||||
#include <kwineffects.h>
|
||||
#include "kwinglutils.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
class GLShader;
|
||||
|
||||
/**
|
||||
* Applies cLUT (32x32x32 RGB LUT)-based color correction to the whole desktop
|
||||
* cLUT is generated from a pair of ICC profiles using LCMS2
|
||||
*/
|
||||
class ICCEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ICCEffect();
|
||||
~ICCEffect();
|
||||
|
||||
virtual void reconfigure(ReconfigureFlags flags);
|
||||
virtual void drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity) override;
|
||||
virtual bool isActive() const;
|
||||
|
||||
int requestedEffectChainPosition() const override;
|
||||
|
||||
static bool supported();
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
protected:
|
||||
bool loadData();
|
||||
|
||||
private:
|
||||
bool m_inited;
|
||||
bool m_valid;
|
||||
QString m_sourceICC;
|
||||
QString m_targetICC;
|
||||
GLShader* m_shader;
|
||||
GLuint m_texture;
|
||||
uint8_t *m_clut;
|
||||
|
||||
uint8_t *makeCLUT(const char* source_icc, const char* target_icc);
|
||||
GLuint setupCCTexture(uint8_t *clut);
|
||||
};
|
||||
|
||||
inline int ICCEffect::requestedEffectChainPosition() const
|
||||
{
|
||||
return 98;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
|
||||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
||||
<kcfgfile arg="true"/>
|
||||
<group name="Effect-ICC">
|
||||
<entry name="SourceICC" type="String">
|
||||
<default></default>
|
||||
</entry>
|
||||
<entry name="TargetICC" type="String">
|
||||
<default></default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
|
@ -0,0 +1,82 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2019 Vitaliy Filippov <vitalif@yourcmc.ru>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
#include "icc_config.h"
|
||||
#include <kwineffects_interface.h>
|
||||
#include "iccconfig.h"
|
||||
#include <config-kwin.h>
|
||||
|
||||
#include <QAction>
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <KActionCollection>
|
||||
#include <KAboutData>
|
||||
#include <KPluginFactory>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
K_PLUGIN_FACTORY_WITH_JSON(ICCEffectConfigFactory,
|
||||
"icc_config.json",
|
||||
registerPlugin<KWin::ICCEffectConfig>();)
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
ICCEffectConfig::ICCEffectConfig(QWidget* parent, const QVariantList& args) :
|
||||
KCModule(KAboutData::pluginData(QStringLiteral("icc")), parent, args)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
ICCConfig::instance(KWIN_CONFIG);
|
||||
addConfig(ICCConfig::self(), this);
|
||||
load();
|
||||
}
|
||||
|
||||
ICCEffectConfig::~ICCEffectConfig()
|
||||
{
|
||||
// Undo unsaved changes
|
||||
}
|
||||
|
||||
void ICCEffectConfig::load()
|
||||
{
|
||||
KCModule::load();
|
||||
|
||||
emit changed(false);
|
||||
}
|
||||
|
||||
void ICCEffectConfig::save()
|
||||
{
|
||||
KCModule::save();
|
||||
|
||||
emit changed(false);
|
||||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("icc"));
|
||||
}
|
||||
|
||||
void ICCEffectConfig::defaults()
|
||||
{
|
||||
emit changed(true);
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
#include "icc_config.moc"
|
|
@ -0,0 +1,9 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_icc_config
|
||||
X-KDE-ParentComponents=icc
|
||||
|
||||
Name=ICC color correction
|
||||
Name[ru]=ICC цветокоррекция
|
|
@ -0,0 +1,48 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2019 Vitaliy Filippov <vitalif@yourcmc.ru>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef KWIN_ICC_CONFIG_H
|
||||
#define KWIN_ICC_CONFIG_H
|
||||
|
||||
#include <kcmodule.h>
|
||||
#include "ui_icc_config.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
class ICCEffectConfig : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ICCEffectConfig(QWidget* parent = 0, const QVariantList& args = QVariantList());
|
||||
~ICCEffectConfig();
|
||||
|
||||
public Q_SLOTS:
|
||||
virtual void save();
|
||||
virtual void load();
|
||||
virtual void defaults();
|
||||
|
||||
private:
|
||||
::Ui::ICCEffectConfig ui;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ICCEffectConfig</class>
|
||||
<widget class="QWidget" name="ICCEffectConfig">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>642</width>
|
||||
<height>107</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="iccForm">
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="sourceICCProfileLabel">
|
||||
<property name="text">
|
||||
<string>Source ICC profile file:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="kcfg_SourceICC">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>leave empty to use sRGB (default color space)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="targetICCProfileLabel">
|
||||
<property name="text">
|
||||
<string>Target ICC profile file:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="kcfg_TargetICC">
|
||||
<property name="placeholderText">
|
||||
<string>select your display's ICC profile here</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,5 @@
|
|||
File=icc.kcfg
|
||||
ClassName=ICCConfig
|
||||
NameSpace=KWin
|
||||
Singleton=true
|
||||
Mutators=true
|
|
@ -85,6 +85,6 @@ Name[uz@cyrillic]=Тескари
|
|||
Name[vi]=Đảo ngược
|
||||
Name[wa]=Å rvier
|
||||
Name[x-test]=xxInvertxx
|
||||
Name[zh_CN]=反转
|
||||
Name[zh_CN]=反向选择
|
||||
Name[zh_TW]=反轉
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ Name[uz@cyrillic]=Кириш
|
|||
Name[vi]=Đăng nhập
|
||||
Name[wa]=Elodjaedje
|
||||
Name[x-test]=xxLoginxx
|
||||
Name[zh_CN]=登录
|
||||
Name[zh_CN]=登录时
|
||||
Name[zh_TW]=登入
|
||||
Icon=preferences-system-windows-effect-login
|
||||
Comment=Smoothly fade to the desktop when logging in
|
||||
|
|
|
@ -94,7 +94,7 @@ Name[tr]=Ekranı Kapla
|
|||
Name[ug]=چوڭايت
|
||||
Name[uk]=Максимізація
|
||||
Name[x-test]=xxMaximizexx
|
||||
Name[zh_CN]=最大化效果
|
||||
Name[zh_CN]=最大化
|
||||
Name[zh_TW]=最大化
|
||||
Type=Service
|
||||
X-KDE-ParentApp=
|
||||
|
|
|
@ -71,5 +71,5 @@ Name[ug]=كۆزنەك چوڭلۇقىنى ئۆزگەرت
|
|||
Name[uk]=Зміна розмірів вікон
|
||||
Name[wa]=Candjî l' grandeu del finiesse
|
||||
Name[x-test]=xxResize Windowxx
|
||||
Name[zh_CN]=缩放窗口
|
||||
Name[zh_CN]=更改窗口大小
|
||||
Name[zh_TW]=重新調整視窗大小
|
||||
|
|
|
@ -32,5 +32,5 @@ Name[sk]=Škálovať
|
|||
Name[sv]=Skala
|
||||
Name[uk]=Масштабування
|
||||
Name[x-test]=xxScalexx
|
||||
Name[zh_CN]=缩放
|
||||
Name[zh_CN]=比例
|
||||
Name[zh_TW]=縮放
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<file alias="cylinder.vert">cube/data/1.10/cylinder.vert</file>
|
||||
<file alias="sphere.vert">cube/data/1.10/sphere.vert</file>
|
||||
<file alias="invert.frag">invert/data/1.10/invert.frag</file>
|
||||
<file alias="icc.frag">icc/data/1.10/icc.frag</file>
|
||||
<file alias="lookingglass.frag">lookingglass/data/1.10/lookingglass.frag</file>
|
||||
<file alias="blinking-startup-fragment.glsl">startupfeedback/data/blinking-startup-fragment.glsl</file>
|
||||
</qresource>
|
||||
|
@ -16,6 +17,7 @@
|
|||
<file alias="cylinder.vert">cube/data/1.40/cylinder.vert</file>
|
||||
<file alias="sphere.vert">cube/data/1.40/sphere.vert</file>
|
||||
<file alias="invert.frag">invert/data/1.40/invert.frag</file>
|
||||
<file alias="icc.frag">icc/data/1.40/icc.frag</file>
|
||||
<file alias="lookingglass.frag">lookingglass/data/1.40/lookingglass.frag</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -79,7 +79,7 @@ Name[uz@cyrillic]=Шаффофлик
|
|||
Name[vi]=Trong mờ
|
||||
Name[wa]=Transparince
|
||||
Name[x-test]=xxTranslucencyxx
|
||||
Name[zh_CN]=半透明
|
||||
Name[zh_CN]=透明度
|
||||
Name[zh_TW]=半透明
|
||||
Icon=preferences-system-windows-effect-translucency
|
||||
Comment=Make windows translucent under different conditions
|
||||
|
|
|
@ -104,7 +104,7 @@ Comment[x-test]=xxDesktop Effectsxx
|
|||
Comment[zh_CN]=桌面特效
|
||||
Comment[zh_TW]=桌面效果
|
||||
|
||||
X-KDE-Keywords=kwin,window,manager,effect,3D effects,2D effects,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,desktop animations,drivers,driver settings,rendering,render,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale effect,screenshot effect,sheet effect,slide effect,sliding popups effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,present windows effect,resize window effect,background contrast effect
|
||||
X-KDE-Keywords=kwin,window,manager,effect,3D effects,2D effects,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,desktop animations,drivers,driver settings,rendering,render,icc effect,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale effect,screenshot effect,sheet effect,slide effect,sliding popups effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,present windows effect,resize window effect,background contrast effect
|
||||
X-KDE-Keywords[ca]=kwin,finestra,gestor,efecte,efectes 3D,efectes 2D,efectes gràfics,efectes d'escriptori,animacions,animacions diverses,efectes en la gestió de les finestres,efecte en el canvi de finestra,efecte en el canvi d'escriptori,animacions,animacions en l'escriptori,controladors,configuració dels controladors,renderització,render,efecte d'inversió,efecte d'aspecte de vidre,efecte de lupa,efecte ajudant del desplaçament,efecte de seguiment del ratolí,efecte de zoom,efecte de difuminat,efecte d'esvaïment,efecte d'esvaïment de l'escriptori,efecte de trencament,efecte de lliscament,efecte de ressaltat de la finestra,efecte en l'inici de la sessió,efecte en sortir de la sessió,efecte de làmpada màgica,efecte d'animació de la minimització,efecte de marca del ratolí,efecte d'apropament,efecte de captura de pantalla,efecte de full,efecte de diapositiva,efecte de missatges emergents lliscants,efecte de miniatures laterals,translucidesa,efecte de translucidesa,transparència,efecte de geometria de la finestra,efecte de finestres sacsejades,efecte de confirmació d'engegada,efecte de diàleg principal,efecte d'enfosquiment en estar inactiu,efecte d'enfosquiment de la pantalla,efecte de diapositiva prèvia,decoració,efecte per a mostrar els FPS,efecte de mostrar el pintat,efecte de canvi de coberta,efecte de cub de l'escriptori,efecte d'animació del cub de l'escriptori,efecte de quadrícula de l'escriptori,efecte de canvi en roda,efecte de presentació de les finestres,efecte de redimensionat de la finestra,efecte de contrast del fons
|
||||
X-KDE-Keywords[ca@valencia]=kwin,finestra,gestor,efecte,efectes 3D,efectes 2D,efectes gràfics,efectes d'escriptori,animacions,animacions diverses,efectes en la gestió de les finestres,efecte en el canvi de finestra,efecte en el canvi d'escriptori,animacions,animacions en l'escriptori,controladors,configuració dels controladors,renderització,render,efecte d'inversió,efecte d'aspecte de vidre,efecte de lupa,efecte ajudant del desplaçament,efecte de seguiment del ratolí,efecte de zoom,efecte de difuminat,efecte d'esvaïment,efecte d'esvaïment de l'escriptori,efecte de trencament,efecte de lliscament,efecte de ressaltat de la finestra,efecte en l'inici de la sessió,efecte en eixir de la sessió,efecte de làmpada màgica,efecte d'animació de la minimització,efecte de marca del ratolí,efecte d'apropament,efecte de captura de pantalla,efecte de full,efecte de diapositiva,efecte de missatges emergents lliscants,efecte de miniatures laterals,translucidesa,efecte de translucidesa,transparència,efecte de geometria de la finestra,efecte de finestres sacsejades,efecte de confirmació d'engegada,efecte de diàleg principal,efecte d'enfosquiment en estar inactiu,efecte d'enfosquiment de la pantalla,efecte de diapositiva prèvia,decoració,efecte per a mostrar els FPS,efecte de mostrar el pintat,efecte de canvi de coberta,efecte de cub de l'escriptori,efecte d'animació del cub de l'escriptori,efecte de quadrícula de l'escriptori,efecte de canvi en roda,efecte de presentació de les finestres,efecte de redimensionat de la finestra,efecte de contrast del fons
|
||||
X-KDE-Keywords[de]=KWin,Fenster,Verwaltung,Effekt,2D-Effekte,3D-Effekte,Grafische Effekte,Desktopeffekte,Arbeitsflächeneffekte,Animation,Fensterverwaltungs-Effekte,Fensterwechsel-Effekte,Desktop-Wechsel,Arbeitsflächenwechsel,Desktop-Animation,Arbeitsflächen-Animation,Treiber,Treibereinstellung,Rendering,Rendern,Invertierungseffekt,Bildschirmlupeneffekt,Vergrößerungseffekt,Einrasteffekt,Maus folgen,Zoomeffekt,Dashboard,Überblendungseffekt,Gleiteneffekt,Fensterhervorhebungs-Effekt,Anmeldungseffekt,Abmeldungseffekt,Animierter Minimierungseffekt,Mausmarkierungseffekt,Skalierungseffekt,Bildschirmeffekt,Blatteffekt,Folieneffekt,Vorschaueffekt,Durchsichtigkeit,Durchsichtigkeitseffekt,Fenstergeometrieffekt,Effekt Wabernde Fenster,Programmstartanzeigeneffekt,Inaktiveffekt,Bildschirmabdunkelungseffekt,FPS-Effekt,Zeichnungsbereicheffekt, 3D-Fenstergalerieeffekt,Desktopgittereffekt,3D-Fensterstapelumschalteffekt,Fensteranzeigeeffekt,Fenstergrößenänderungseffekt,Hintergrundkonstrasteffekt
|
||||
|
|
|
@ -96,7 +96,7 @@ Name[vi]=Hành động
|
|||
Name[wa]=Accions
|
||||
Name[xh]=Iintshukumo
|
||||
Name[x-test]=xxActionsxx
|
||||
Name[zh_CN]=动作
|
||||
Name[zh_CN]=操作
|
||||
Name[zh_TW]=動作
|
||||
|
||||
Comment=Mouse Actions on Windows
|
||||
|
|
|
@ -93,7 +93,7 @@ Name[vi]=Tập trung
|
|||
Name[wa]=Focus
|
||||
Name[xh]=Focus
|
||||
Name[x-test]=xxFocusxx
|
||||
Name[zh_CN]=焦点
|
||||
Name[zh_CN]=对焦
|
||||
Name[zh_TW]=焦點
|
||||
|
||||
Comment=Active Window Policy
|
||||
|
|
|
@ -94,7 +94,7 @@ Name[vi]=Di chuyển
|
|||
Name[wa]=Bodjî
|
||||
Name[xh]=Iyahamba
|
||||
Name[x-test]=xxMovingxx
|
||||
Name[zh_CN]=移动
|
||||
Name[zh_CN]=移动中
|
||||
Name[zh_TW]=移動
|
||||
|
||||
Comment=Window Moving
|
||||
|
|
Loading…
Reference in New Issue