Commit e123379b authored by Boudewijn Rempt's avatar Boudewijn Rempt

Make Pigment no longer dependent on KoMain

Note: all the FULL_PIGMENT, NO_PIGMENT etc. things probably
going to be obsolete. I will need to clean them up later.

svn path=/trunk/koffice/; revision=982812
parent 49b47da8
add_subdirectory( colorprofiles )
project(pigmentcms)
include_directories( ${KOMAIN_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${LCMS_INCLUDE_DIR} )
include_directories( ${PIGMENT_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
set(FILE_OPENEXR_SOURCES)
set(LINK_OPENEXR_LIB)
if(OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
endif(OPENEXR_FOUND)
if (SMALL_PIGMENT)
if(MSVC)
# avoid "cannot open file 'LIBC.lib'" error
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBC.LIB")
endif(MSVC)
set(pigmentcms_SRCS
KoColor.cpp
)
set(pigmentcms_SRCS
KoBasicHistogramProducers.cpp
KoColor.cpp
KoColorConversionAlphaTransformation.cpp
KoColorConversionCache.cpp
KoColorConversions.cpp
KoColorConversionSystem.cpp
KoColorConversionTransformation.cpp
KoColorConversionTransformationFactory.cpp
KoColorModelStandardIds.cpp
KoColorProfile.cpp
KoColorSpace.cpp
KoColorSpaceEngine.cpp
KoColorSpaceMaths.cpp
KoColorSpaceRegistry.cpp
KoColorTransformation.cpp
KoColorTransformationFactory.cpp
KoColorTransformationFactoryRegistry.cpp
KoCompositeOp.cpp
KoCopyColorConversionTransformation.cpp
KoFallBackColorTransformation.cpp
KoHistogramProducer.cpp
KoIccColorSpaceEngine.cpp
KoLcmsColorSpace.cpp
KoMultipleColorConversionTransformation.cpp
KoUniqueNumberForIdServer.cpp
colorprofiles/KoIccColorProfile.cpp
colorprofiles/KoLcmsColorProfileContainer.cpp
colorspaces/KoAlphaColorSpace.cpp
colorspaces/KoLabColorSpace.cpp
colorspaces/KoRgbU16ColorSpace.cpp
colorspaces/KoRgbU8ColorSpace.cc
colorspaces/KoRgbU8CompositeOp.cpp
)
set(PIGMENT_INSTALL_FILES
pigment_export.h
DebugPigment.h
KoBasicHistogramProducers.h
KoChannelInfo.h
KoColor.h
)
add_subdirectory(tests)
else (SMALL_PIGMENT)
include_directories( ${LCMS_INCLUDE_DIR} )
add_subdirectory( colorprofiles )
kde4_add_library(pigmentcms SHARED ${pigmentcms_SRCS})
set(FILE_OPENEXR_SOURCES)
set(LINK_OPENEXR_LIB)
if(OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
endif(OPENEXR_FOUND)
target_link_libraries(
pigmentcms
komain
${LCMS_LIBRARIES}
${KDE4_KPARTS_LIBS}
${QT_QTCORE_LIBRARY}
${X11_X11_LIB}
${LINK_OPENEXR_LIB}
set(pigmentcms_SRCS
KoBasicHistogramProducers.cpp
KoColor.cpp
KoColorConversionAlphaTransformation.cpp
KoColorConversionCache.cpp
KoColorConversions.cpp
KoColorConversionSystem.cpp
KoColorConversionTransformation.cpp
KoColorConversionTransformationFactory.cpp
KoColorModelStandardIds.cpp
KoColorProfile.cpp
KoColorSpace.cpp
KoColorSpaceEngine.cpp
KoColorSpaceMaths.cpp
KoColorSpaceRegistry.cpp
KoColorTransformation.cpp
KoColorTransformationFactory.cpp
KoColorTransformationFactoryRegistry.cpp
KoCompositeOp.cpp
KoCopyColorConversionTransformation.cpp
KoFallBackColorTransformation.cpp
KoHistogramProducer.cpp
KoIccColorSpaceEngine.cpp
KoLcmsColorSpace.cpp
KoMultipleColorConversionTransformation.cpp
KoUniqueNumberForIdServer.cpp
colorprofiles/KoIccColorProfile.cpp
colorprofiles/KoLcmsColorProfileContainer.cpp
colorspaces/KoAlphaColorSpace.cpp
colorspaces/KoLabColorSpace.cpp
colorspaces/KoRgbU16ColorSpace.cpp
colorspaces/KoRgbU8ColorSpace.cc
colorspaces/KoRgbU8CompositeOp.cpp
)
target_link_libraries(
pigmentcms LINK_INTERFACE_LIBRARIES komain ${LCMS_LIBRARIES} ${LINK_OPENEXR_LIB}
)
set_target_properties(pigmentcms PROPERTIES
VERSION ${GENERIC_KOFFICE_LIB_VERSION} SOVERSION ${GENERIC_KOFFICE_LIB_SOVERSION}
)
install(TARGETS pigmentcms ${INSTALL_TARGETS_DEFAULT_ARGS})
install( FILES
set(PIGMENT_INSTALL_FILES
pigment_export.h
DebugPigment.h
KoBasicHistogramProducers.h
......@@ -104,7 +91,43 @@ install( FILES
KoLabDarkenColorTransformation.h
KoMixColorsOpImpl.h
KoHistogramProducer.h
)
add_subdirectory(tests)
set (EXTRA_LIBRARIES ${LCMS_LIBRARIES} ${LINK_OPENEXR_LIB})
endif (SMALL_PIGMENT)
if(MSVC)
# avoid "cannot open file 'LIBC.lib'" error
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBC.LIB")
endif(MSVC)
kde4_add_library(pigmentcms SHARED ${pigmentcms_SRCS})
target_link_libraries(
pigmentcms
koplugin
${EXTRA_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTXML_LIBRARY}
${X11_X11_LIB}
)
target_link_libraries(
pigmentcms LINK_INTERFACE_LIBRARIES koplugin ${QT_QTXML_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${EXTRA_LIBRARIES}
)
set_target_properties(pigmentcms PROPERTIES
VERSION ${GENERIC_KOFFICE_LIB_VERSION} SOVERSION ${GENERIC_KOFFICE_LIB_SOVERSION}
)
install(TARGETS pigmentcms ${INSTALL_TARGETS_DEFAULT_ARGS})
install( FILES ${PIGMENT_INSTALL_FILES}
DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
install( FILES pigment.desktop pigmentextension.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
install( FILES pigment.desktop pigmentextension.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
......@@ -24,6 +24,12 @@
#include "DebugPigment.h"
#include "KoColor.h"
#ifdef NO_PIGMENT
#else
#include "KoColorModelStandardIds.h"
#include "KoColorProfile.h"
#include "KoColorSpace.h"
......@@ -303,3 +309,5 @@ KoColor KoColor::fromXML(const QDomElement& elt, const QString & bitDepthId, con
return KoColor();
}
}
#endif
......@@ -27,6 +27,15 @@
class QDomDocument;
class QDomElement;
#ifdef NO_PIGMENT
class PIGMENTCMS_EXPORT KoColor : public QColor {
QColor toQColor() { return QColor(this); }
};
#else
class KoColorProfile;
class KoColorSpace;
......@@ -87,7 +96,7 @@ public:
void toQColor(QColor *c) const;
/// a convenience method for the above.
QColor toQColor() const;
/**
* Convenient function to set the opacity of the color.
*/
......@@ -118,21 +127,21 @@ public:
/**
* Serialize this color following Create's swatch color specification available
* at http://create.freedesktop.org/wiki/index.php/Swatches_-_colour_file_format
*
*
* This function doesn't create the <color /> element but rather the <CMYK />,
* <sRGB />, <RGB /> ... elements. It is assumed that colorElt is the <color />
* element.
*
*
* @param colorElt root element for the serialization, it is assumed that this
* element is <color />
* @param doc is the document containing colorElt
*/
void toXML(QDomDocument& doc, QDomElement& colorElt) const;
/**
* Unserialize a color following Create's swatch color specification available
* at http://create.freedesktop.org/wiki/index.php/Swatches_-_colour_file_format
*
*
* @param elt the element to unserialize (<CMYK />, <sRGB />, <RGB />)
* @param bitDepthId the bit depth is unspecified by the spec, this allow to select
* a preferred bit depth for creating the KoColor object (if that
......@@ -144,7 +153,7 @@ public:
* to unserialize the color
*/
static KoColor fromXML(const QDomElement& elt, const QString & bitDepthId, const QHash<QString, QString> & aliases);
#ifndef NODEBUG
/// use kDebug calls to print internal info
void dump() const;
......@@ -154,6 +163,7 @@ private:
class Private;
Private * const d;
};
#endif
Q_DECLARE_METATYPE( KoColor )
......
......@@ -12,7 +12,7 @@ set(TestColorConversion_test_SRCS TestColorConversion.cpp )
kde4_add_unit_test(TestColorConversion TESTNAME libs-pigment-TestColorConversion ${TestColorConversion_test_SRCS})
target_link_libraries(TestColorConversion ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestColorConversion ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
########### next target ###############
......@@ -20,7 +20,7 @@ set(TestKoColorSpaceAbstract_test_SRCS TestKoColorSpaceAbstract.cpp )
kde4_add_unit_test(TestKoColorSpaceAbstract TESTNAME libs-pigment-TestKoColorSpaceAbstract ${TestKoColorSpaceAbstract_test_SRCS})
target_link_libraries(TestKoColorSpaceAbstract ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestKoColorSpaceAbstract ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
########### next target ###############
......@@ -28,7 +28,7 @@ set(TestKoLcmsColorProfile_test_SRCS TestKoLcmsColorProfile.cpp )
kde4_add_unit_test(TestKoLcmsColorProfile TESTNAME libs-pigment-TestKoLcmsColorProfile ${TestKoLcmsColorProfile_test_SRCS})
target_link_libraries(TestKoLcmsColorProfile ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestKoLcmsColorProfile ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
########### next target ###############
......@@ -36,7 +36,7 @@ set(TestKoColorSpaceRegistry_test_SRCS TestKoColorSpaceRegistry.cpp )
kde4_add_unit_test(TestKoColorSpaceRegistry TESTNAME libs-pigment-TestKoColorSpaceRegistry ${TestKoColorSpaceRegistry_test_SRCS})
target_link_libraries(TestKoColorSpaceRegistry ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestKoColorSpaceRegistry ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
########### next target ###############
......@@ -44,7 +44,7 @@ set(TestKoColorSpaceMaths_test_SRCS TestKoColorSpaceMaths.cpp)
kde4_add_unit_test(TestKoColorSpaceMaths TESTNAME libs-pigment-TestKoColorSpaceMaths ${TestKoColorSpaceMaths_test_SRCS})
target_link_libraries(TestKoColorSpaceMaths ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestKoColorSpaceMaths ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
########### next target ###############
set(CCSGraph_GRAPH CCSGraph.cpp)
......@@ -57,7 +57,7 @@ set(TestColorConversionSystem_test_SRCS TestColorConversionSystem.cpp )
kde4_add_unit_test(TestColorConversionSystem TESTNAME libs-pigment-TestColorConversionSystem ${TestColorConversionSystem_test_SRCS})
target_link_libraries(TestColorConversionSystem ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestColorConversionSystem ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
########### next target ###############
......@@ -65,14 +65,14 @@ set(TestKoColor_test_SRCS TestKoColor.cpp )
kde4_add_unit_test(TestKoColor TESTNAME libs-pigment-TestKoColor ${TestKoColor_test_SRCS})
target_link_libraries(TestKoColor ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestKoColor ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTXML_LIBRARY} ${QT_QTTEST_LIBRARY})
########### next target ###############
set(TestKoIntegerMaths_test_SRCS TestKoIntegerMaths.cpp )
kde4_add_unit_test(TestKoIntegerMaths TESTNAME libs-pigment-TestKoIntegerMaths ${TestKoIntegerMaths_test_SRCS})
target_link_libraries(TestKoIntegerMaths ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestKoIntegerMaths ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
########### next target ###############
......@@ -80,7 +80,7 @@ set(TestConvolutionOpImpl_test_SRCS TestConvolutionOpImpl.cpp )
kde4_add_unit_test(TestConvolutionOpImpl TESTNAME libs-pigment-TestConvolutionOpImpl ${TestConvolutionOpImpl_test_SRCS})
target_link_libraries(TestConvolutionOpImpl ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestConvolutionOpImpl ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
########### next target ###############
......@@ -89,5 +89,5 @@ set(TestKoRgbU8ColorSpaceTester_test_SRCS KoRgbU8ColorSpaceTester.cpp )
kde4_add_unit_test(TestKoRgbU8ColorSpaceTester TESTNAME libs-pigment-TestKoRgbU8ColorSpaceTester ${TestKoRgbU8ColorSpaceTester_test_SRCS})
target_link_libraries(TestKoRgbU8ColorSpaceTester ${KDE4_KDECORE_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
target_link_libraries(TestKoRgbU8ColorSpaceTester ${KDE4_KDEUI_LIBS} pigmentcms ${QT_QTTEST_LIBRARY})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment