Commit 2073bb1e authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merge branch 'rempt-cleanup-unused-code'

parents 4b95ac07 44db3c13
......@@ -126,7 +126,7 @@ option(PACKAGERS_BUILD "Build support of multiple CPU architectures in one binar
########################
#######################
# For predefined productsets see the definitions in CalligraProducts.cmake and
# For predefined productsets see the definitions in KritaProducts.cmake and
# in the files in the folder cmake/productsets.
# Finding out the products & features to build is done in 5 steps:
......@@ -137,11 +137,11 @@ option(PACKAGERS_BUILD "Build support of multiple CPU architectures in one binar
# 5. estimate which of the products/features can be build by internal deps
# get the special macros
include(CalligraProductSetMacros)
include(CalligraProductsetMacros)
include(MacroJPEG)
# get the definitions of products, features and product sets
include(CalligraProducts.cmake)
include(KritaProducts.cmake)
set(PRODUCTSET_DEFAULT "ALL")
# temporary migration support
......@@ -296,9 +296,8 @@ set(CALLIGRA_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/krita)
############################
###########################
find_package(Perl REQUIRED)
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
if (APPLE)
# this is not added correctly on OSX -- see http://forum.kde.org/viewtopic.php?f=139&t=101867&p=221242#p221242
include_directories(${PNG_INCLUDE_DIR})
......@@ -306,9 +305,6 @@ endif()
add_definitions(-DBOOST_ALL_NO_LIB)
find_package(Boost REQUIRED COMPONENTS system) # for pigment and stage
if (NOT Boost_FOUND)
message(FATAL_ERROR "Did not find Boost. Boost is required for the core libraries, stage, sheets and krita.")
endif ()
if (APPLE)
SET(CMAKE_CXX_FLAGS "-stdlib=libstdc++ -std=c++11")
......@@ -321,14 +317,44 @@ endif ()
############################
###########################
##
## Check for OpenEXR
##
macro_optional_find_package(ZLIB)
macro_log_feature(ZLIB_FOUND "zlib" "Compression library" "http://www.zlib.net/" FALSE "" "Optionally used by the G'Mic and the PSD plugins")
macro_bool_to_01(ZLIB_FOUND HAVE_ZLIB)
macro_optional_find_package(OpenEXR)
macro_log_feature(OPENEXR_FOUND "OpenEXR" "High dynamic-range (HDR) image file format" "http://www.openexr.com" FALSE "" "Required by the Krita OpenEXR filter")
macro_bool_to_01(OPENEXR_FOUND HAVE_OPENEXR)
set(LINK_OPENEXR_LIB)
if(OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
endif()
macro_optional_find_package(TIFF)
macro_log_feature(TIFF_FOUND "tiff" "TIFF Library and Utilities" "http://www.remotesensing.org/libtiff" FALSE "" "Required by the Krita TIFF filter")
macro_optional_find_package(JPEG)
macro_log_feature(JPEG_FOUND "jpeg" "Free library for JPEG image compression. Note: libjpeg8 is NOT supported." "http://www.libjpeg-turbo.org" FALSE "" "Required by the Krita JPEG filter")
macro_optional_find_package(OpenJPEG)
macro_log_feature(OPENJPEG_FOUND "openjpeg" "Free library for JPEG 2000 image compression" "http://www.openjpeg.org" FALSE "" "Required by the Krita JPEG 2000 filter")
set(LIBRAW_MIN_VERSION "0.16")
macro_optional_find_package(LibRaw ${LIBRAW_MIN_VERSION})
macro_log_feature(LIBRAW_FOUND "LibRaw" "Library to decode RAW images" "http://www.libraw.org" FALSE "" "Required to build the raw import plugin")
macro_optional_find_package(FFTW3)
macro_log_feature(FFTW3_FOUND "FFTW3" "A fast, free C FFT library" "http://www.fftw.org/" FALSE "" "Required by the Krita for fast convolution operators and some G'Mic features")
macro_bool_to_01(FFTW3_FOUND HAVE_FFTW3)
macro_optional_find_package(OCIO)
macro_log_feature(OCIO_FOUND "OCIO" "The OpenColorIO Library" "http://www.opencolorio.org" FALSE "" "Required by the Krita LUT docker")
macro_bool_to_01(OCIO_FOUND HAVE_OCIO)
##
## Look for OpenGL
##
......@@ -341,6 +367,7 @@ if (USEOPENGL)
if(QT_QTOPENGL_FOUND)
message(STATUS "Found Qt OpenGL support")
set(HAVE_OPENGL 1)
include_directories(${OPENGL_INCLUDE_DIR})
else()
message(STATUS "Did NOT find Qt OpenGL support. Check your Qt configuration")
endif()
......@@ -354,8 +381,7 @@ endif()
## Test for GNU Scientific Library
##
macro_optional_find_package(GSL)
macro_log_feature(GSL_FOUND "GSL" "GNU Scientific Library" "http://www.gnu.org/software/gsl"
FALSE "1.7" "Required by Krita's Transform tool.")
macro_log_feature(GSL_FOUND "GSL" "GNU Scientific Library" "http://www.gnu.org/software/gsl" FALSE "1.7" "Required by Krita's Transform tool.")
macro_bool_to_01(GSL_FOUND HAVE_GSL)
configure_file(config-gsl.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-gsl.h )
......@@ -363,7 +389,7 @@ configure_file(config-gsl.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-gsl.h )
## Test for eigen3
##
macro_optional_find_package(Eigen3)
macro_log_feature(EIGEN3_FOUND "Eigen" "C++ template library for linear algebra" "http://eigen.tuxfamily.org" FALSE "3.0" "Required by Calligra Sheets and Krita")
macro_log_feature(EIGEN3_FOUND "Eigen" "C++ template library for linear algebra" "http://eigen.tuxfamily.org" FALSE "3.0" "Required by Krita")
##
## Test for exiv2
......@@ -376,7 +402,7 @@ macro_log_feature(EXIV2_FOUND "Exiv2" "Image metadata library and tools" "http:/
## Test for lcms
##
macro_optional_find_package(LCMS2)
macro_log_feature(LCMS2_FOUND "LittleCMS" "Color management engine" "http://www.littlecms.com" FALSE "2.4" "Will be used for color management and is necesary for Krita")
macro_log_feature(LCMS2_FOUND "LittleCMS" "Color management engine" "http://www.littlecms.com" FALSE "2.4" "Will be used for color management and is necessary for Krita")
if(LCMS2_FOUND)
if(NOT ${LCMS2_VERSION} VERSION_LESS 2040 )
set(HAVE_LCMS24 TRUE)
......@@ -455,8 +481,8 @@ if(HAVE_VC)
endif()
if (NOT PACKAGERS_BUILD)
# Optimize the whole Calligra for current architecture
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Vc_DEFINITIONS}")
# Optimize everything for the current architecture
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Vc_DEFINITIONS}")
endif ()
endif()
set(CMAKE_MODULE_PATH ${OLD_CMAKE_MODULE_PATH} )
......@@ -473,17 +499,10 @@ endif()
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS})
if(WIN32)
set(KDE4_ICON_DIR ${KDE_INSTALL_FULL_ICONDIR})
message(STATUS "using oxygen application icons from ${KDE4_ICON_DIR}")
set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY ${INSTALL_TARGETS_DEFAULT_ARGS}
ARCHIVE ${INSTALL_TARGETS_DEFAULT_ARGS} )
else()
set (KDE4_ICON_DIR ${CMAKE_INSTALL_PREFIX}/share/icons)
endif()
##
......@@ -504,10 +523,23 @@ macro_log_feature(SHARED_MIME_INFO_FOUND "SharedMimeInfo" "Shared Mime Info" "ht
macro_optional_find_package(Poppler)
macro_log_feature( POPPLER_FOUND "Poppler-Qt5" "A PDF rendering library" "http://poppler.freedesktop.org" FALSE "" "Required by the Krita PDF filter, Karbon PDF import filter and CSTester PDF feature")
##
## Test for pthreads (for G'Mic)
##
macro_optional_find_package(Threads)
macro_log_feature(Threads_FOUND "PThreads" "A low-level threading library" "" FALSE "" "Optionally used by the G'Mic plugin")
##
## Test for OpenMP (for G'Mic)
##
macro_optional_find_package(OpenMP)
macro_log_feature(OPENMP_FOUND "OpenMP" "A low-level parallel execution library" "http://openmp.org/wp/" FALSE "" "Optionally used by the G'Mic plugin")
##
## Generate a file for prefix information
## Test for Curl (for G'Mic)
##
macro_optional_find_package(CURL)
macro_log_feature(CURL_FOUND "CURL" "A tool to fetch remote data" "http://curl.haxx.se/" FALSE "" "Optionally used by the G'Mic plugin")
###############################
################################
......@@ -617,13 +649,6 @@ set(BASICFLAKES_INCLUDES ${KOWIDGETS_INCLUDES}
####################################################
###################################################
if (NOT WIN32)
set(NOT_WIN TRUE)
endif()
if (NOT QT_MAC_USE_COCOA)
set(NOT_COCOA TRUE)
endif()
calligra_drop_product_on_bad_condition( APP_KRITA
EIGEN3_FOUND "Eigen devel not found"
EXIV2_FOUND "libexiv2 devel not found"
......@@ -667,7 +692,6 @@ endif()
# non-app directories are moved here because they can depend on SHOULD_BUILD_{appname} variables set above
add_subdirectory(libs)
add_subdirectory(interfaces)
add_subdirectory(plugins)
macro_display_feature_log()
......@@ -675,12 +699,4 @@ macro_display_feature_log()
calligra_product_deps_report("product_deps")
calligra_log_should_build()
add_custom_target(apidox doc/api/gendocs.pl WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
configure_file(KoConfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/KoConfig.h )
## temporary warning
if (WARN_ABOUT_CREATIVEONLY)
message(STATUS "WARNING:\n You are using a deprecated build flag,\n switch from \"-DCREATIVEONLY=ON\" to \"-DPRODUCTSET=CREATIVE\"\n and remove the line \"CREATIVEONLY:BOOL=ON\" from CMakeCache.txt")
message(STATUS "-------------------------------------------------------------------" )
endif ()
### DEFINITION OF PRODUCTS, FEATURES AND PRODUCTSETS
####################################################
# When building Calligra a lot of different things are created and installed. To
# When building Krita a lot of different things are created and installed. To
# describe them and their internal dependencies the concepts of "product",
# "feature" and "product set" are used.
......
This directory stores additional productsets.
Please read the explanation in the toplevel file "CalligraProducts.cmake",
Please read the explanation in the toplevel file "KritaProducts.cmake",
secion "How to add another productset?" at the end.
/* This file is part of the KDE project
Copyright (C) 2008 Johannes Simon <Johannes.simon@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef SIMPLETEXT_H
#define SIMPLETEXT_H
#include <KoShape.h>
/**
* Interface for the SimpleTextShape plugin, originally written for Karbon
*
* Use this pure virtual class instead of using SimpleTextShape directly
* to avoid unnecessary dependencies of your code, as all plugins are optional.
*/
class SimpleTextShapeInterface : public KoShape
{
public:
/// Sets the text to display
virtual void setText( const QString & text ) = 0;
/// Returns the text content
virtual QString text() const = 0;
virtual ~SimpleTextShapeInterface() {};
/**
* Sets the font used for drawing
* Note that it is expected that the font has its point size set
* in postscript points.
*/
virtual void setFont( const QFont & font ) = 0;
/// Returns the font
virtual QFont font() const = 0;
};
#endif
......@@ -39,12 +39,12 @@ if(MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
# set(CMAKE_CXX_STACK_SIZE "999999999")
endif()
macro_optional_find_package(FFTW3)
macro_log_feature(FFTW3_FOUND "FFTW3" "A fast, free C FFT library" "http://www.fftw.org/" FALSE "" "Required by the Krita for fast convolution operators")
macro_bool_to_01(FFTW3_FOUND HAVE_FFTW3)
configure_file(image/config_convolution.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/image/config_convolution.h)
configure_file(config-ocio.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ocio.h )
include(CheckFunctionExists)
check_function_exists(powf HAVE_POWF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-powf.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-powf.h)
if(HAVE_OPENGL)
message(STATUS "OpenGL found -- krita will be able to use OpenGL for hardware accelerated rendering.")
......@@ -52,26 +52,10 @@ else()
message(STATUS "OpenGL NOT found - krita will not be able to use OpenGL for hardware accelerated rendering.")
endif()
macro_optional_find_package(OCIO)
macro_log_feature(OCIO_FOUND "OCIO" "The OpenColorIO Library" "http://www.opencolorio.org" FALSE "" "Required by the Krita LUT docker")
macro_bool_to_01(OCIO_FOUND HAVE_OCIO)
configure_file(config-ocio.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ocio.h )
if(UNIX)
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};m")
endif()
check_function_exists(powf HAVE_POWF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-powf.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-powf.h)
set(LINK_OPENEXR_LIB)
if(OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
endif()
if(WIN32)
if(MSVC)
# C4522: 'class' : multiple assignment operators specified
......@@ -117,10 +101,6 @@ set(KRITA_INCLUDES
include_directories(${KRITA_INCLUDES})
if(HAVE_OPENGL)
include_directories(${OPENGL_INCLUDE_DIR})
endif()
add_subdirectory( libglobal )
add_subdirectory( libpsd )
add_subdirectory( image )
......
#! /bin/sh
source ../calligra_xgettext.sh
source ../krita_xgettext.sh
$EXTRACTRC `find . -name \*.ui | grep -v '/tests/'` >> rc.cpp
RCFILES=`find . -name \*.rc \
......@@ -18,7 +18,7 @@ perl extracti18n.pl > i18ndata
# Ignore sdk/templates which contains templates for writing future plugins.
# None of the placeholder strings inside will be seen by users.
calligra_xgettext krita.pot i18ndata rc.cpp \
krita_xgettext krita.pot i18ndata rc.cpp \
`find . -name \*.cc -o -name \*.h -o -name \*.cpp | grep -v '/tests/' | grep -v './sdk/templates'`
# Clean up
......
......@@ -23,8 +23,7 @@ set(kritagemini_SRCS
if (WIN32)
set(kritagemini_SRCS ${kritagemini_SRCS} KritaGeminiWin.rc)
else ()
file(GLOB ICONS_SRCS "${KDE4_ICON_DIR}/oxygen/*/apps/kritagemini.png")
ecm_add_app_icon(kritagemini_SRCS ICONS ${ICONS_SRCS})
ecm_add_app_icon(kritagemini_SRCS ICONS kritagemini.png)
endif ()
# Krita Gemini application
......
......@@ -133,6 +133,4 @@ X-Calligra-DefaultMimeTypes=application/x-krita
X-KDE-NativeMimeType=application/x-krita
X-KDE-ExtraNativeMimeTypes=
StartupNotify=true
X-DBUS-StartupType=Multi
X-DBUS-ServiceName=org.krita.krita
X-Krita-Version=28
......@@ -33,14 +33,13 @@ set(gmic_headers_SRCS
${GMIC_SOURCE_DIR}/gmic.h
)
# Mandatory flags
sModelIndexConverterShowAll# Mandatory flags
add_definitions(-Dgmic_gimp)
add_definitions(-Dgmic_build)
add_definitions(-Dgmic_float_only)
add_definitions(-Dcimg_use_vt100 )
# PARALLEL
find_package(Threads)
if (Threads_FOUND)
message("G'Mic: using pthreads")
add_definitions(-Dgmic_is_parallel)
......@@ -48,7 +47,6 @@ if (Threads_FOUND)
endif()
#OpenMP
find_package(OpenMP)
if(OPENMP_FOUND)
message("G'Mic: using OpenMP")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
......@@ -70,15 +68,13 @@ if (PNG_FOUND)
endif()
# ZLIB
find_package( ZLIB REQUIRED )
if ( ZLIB_FOUND )
if (ZLIB_FOUND)
add_definitions(-Dcimg_use_zlib)
include_directories( ${ZLIB_INCLUDE_DIRS} )
endif()
# CURL
find_package(CURL)
if (CURL_FOUND)
message("G'Mic: using Curl")
add_definitions(-Dcimg_use_curl)
......
......@@ -4,30 +4,6 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_definitions( -DCPU_32_BITS )
endif()
macro_optional_find_package(PNG)
macro_log_feature(PNG_FOUND "png" "Official PNG reference library" "http://www.libpng.org/pub/png/libpng.html" FALSE "" "Required by the Krita PNG filter")
macro_optional_find_package(OpenEXR)
macro_log_feature(OPENEXR_FOUND "OpenEXR" "High dynamic-range (HDR) image file format" "http://www.openexr.com" FALSE "" "Required by the Krita OpenEXR filter")
macro_optional_find_package(TIFF)
macro_log_feature(TIFF_FOUND "tiff" "TIFF Library and Utilities" "http://www.remotesensing.org/libtiff" FALSE "" "Required by the Krita TIFF filter")
macro_optional_find_package(JPEG)
macro_log_feature(JPEG_FOUND "jpeg" "Free library for JPEG image compression. Note: libjpeg8 is NOT supported." "http://www.libjpeg-turbo.org" FALSE "" "Required by the Krita JPEG filter")
macro_optional_find_package(OpenJPEG)
macro_log_feature(OPENJPEG_FOUND "openjpeg" "Free library for JPEG 2000 image compression" "http://www.openjpeg.org" FALSE "" "Required by the Krita JPEG 2000 filter")
set(LIBRAW_MIN_VERSION "0.16")
find_package(LibRaw ${LIBRAW_MIN_VERSION})
set_package_properties("LibRaw" PROPERTIES
DESCRIPTION "Required to build libkdcraw"
URL "http://www.libraw.org"
TYPE RECOMMENDED
PURPOSE "Library to decode RAW image"
)
if(JPEG_FOUND AND HAVE_LCMS2)
add_subdirectory(jpeg)
endif()
......@@ -65,7 +41,3 @@ add_subdirectory(odg)
add_subdirectory(qml)
add_subdirectory(tga)
add_subdirectory(heightmap)
#if(OIIO_FOUND)
# add_subdirectory(oiio)
#endif()
......@@ -67,6 +67,4 @@ Categories=Qt;KDE;Office;Graphics;
StartupNotify=true
X-KDE-ServiceTypes=Calligra/Application
X-Calligra-DefaultMimeTypes=image/bmp,image/x-xpixmap,image/gif,image/x-xbitmap,image/vnd.microsoft.icon,image/webp
X-DBUS-StartupType=Multi
X-DBUS-ServiceName=org.krita.krita
NoDisplay=true
......@@ -116,8 +116,6 @@ Terminal=false
Type=Application
X-KDE-ServiceTypes=Calligra/Application
X-Calligra-DefaultMimeTypes=image/exr,application/x-extension-exr
X-DBUS-StartupType=multi
X-DBUS-ServiceName=org.krita.krita
X-KDE-SubstituteUID=false
X-KDE-Username=
NoDisplay=true
......@@ -70,7 +70,5 @@ Terminal=false
Type=Application
X-KDE-ServiceTypes=Calligra/Application
X-Calligra-DefaultMimeTypes=image/x-r16,image/x-8
X-DBUS-ServiceName=org.krita.krita
X-DBUS-StartupType=multi
X-KDE-SubstituteUID=false
X-KDE-Username=
......@@ -116,8 +116,6 @@ Terminal=false
Type=Application
X-KDE-ServiceTypes=Calligra/Application
X-Calligra-DefaultMimeTypes=image/jp2
X-DBUS-StartupType=multi
X-DBUS-ServiceName=org.krita.krita
X-KDE-SubstituteUID=false
X-KDE-Username=
NoDisplay=true
......@@ -68,8 +68,6 @@ Terminal=false
Type=Application
X-KDE-ServiceTypes=Calligra/Application
X-Calligra-DefaultMimeTypes=image/jpeg
X-DBUS-StartupType=Multi
X-DBUS-ServiceName=org.krita.krita
X-KDE-SubstituteUID=false
X-KDE-Username=
NoDisplay=true
......@@ -69,6 +69,4 @@ X-KDE-ServiceTypes=Calligra/Application
# application/vnd.oasis.opendocument.graphics is not on this list because Karbon has the default;
# Krita will be used only in absence of Karbon
X-Calligra-DefaultMimeTypes=
X-DBUS-StartupType=Multi
X-DBUS-ServiceName=org.krita.krita
NoDisplay=true
set(kritaoiioexport_PART_SRCS
kis_oiio_export.cpp
)
ki18n_wrap_ui(kritaoiioexport_PART_SRCS )
add_library(kritaoiioexport MODULE ${kritaoiioexport_PART_SRCS})
target_link_libraries(kritaoiioexport kritaui ${OIIO_LIBRARIES})
install(TARGETS kritaoiioexport DESTINATION ${CALLIGRA_PLUGIN_INSTALL_DIR})
install( FILES krita_oiio_export.desktop DESTINATION ${SERVICES_INSTALL_DIR}/calligra)
install( PROGRAMS krita_oiio.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
set(kritaoiioimport_PART_SRCS
kis_oiio_import.cpp
)
ki18n_wrap_ui(kritaoiioimport_PART_SRCS )
add_library(kritaoiioimport MODULE ${kritaoiioimport_PART_SRCS})
target_link_libraries(kritaoiioimport kritaui ${OIIO_LIBRARIES})
install(TARGETS kritaoiioimport DESTINATION ${CALLIGRA_PLUGIN_INSTALL_DIR})
install( FILES krita_oiio_import.desktop DESTINATION ${SERVICES_INSTALL_DIR}/calligra)
install( PROGRAMS krita_oiio.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
/*
* Copyright (c) 2007 Boudewijn Rempt <boud@valdyas.org>
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "kis_oiio_export.h"
#include <QCheckBox>
#include <QSlider>
#include <kpluginfactory.h>
#include <KisFilterChain.h>
#include <kis_paint_device.h>
#include <KisDocument.h>
#include <kis_image.h>
#include <kis_paint_layer.h>
K_PLUGIN_FACTORY(KisOiioExportFactory, registerPlugin<KisOiioExport>();)
K_EXPORT_PLUGIN(KisOiioExportFactory("calligrafilters"))
KisOiioExport::KisOiioExport(QObject *parent, const QVariantList &) : KisImportExportFilter(parent)
{
}
KisOiioExport::~KisOiioExport()
{
}
KisImportExportFilter::ConversionStatus KisOiioExport::convert(const QByteArray& from, const QByteArray& to)
{
dbgFile << "Oiio export! From:" << from << ", To:" << to << "";
KisDocument *input = dynamic_cast<KisDocument*>(m_chain->inputDocument());
QString filename = m_chain->outputFile();
if (!input)
return KisImportExportFilter::NoDocumentCreated;
if (filename.isEmpty()) return KisImportExportFilter::FileNotFound;
if (from != "application/x-krita")
return KisImportExportFilter::NotImplemented;
QUrl url = QUrl::fromLocalFile(filename);
qApp->processEvents(); // For vector layers to be updated
input->image()->waitForDone();
QRect rc = input->image()->bounds();
input->image()->refreshGraph();
input->image()->lock();
QImage image = input->image()->projection()->convertToQImage(0, 0, 0, rc.width(), rc.height());
input->image()->unlock();
image.save(url.toLocalFile());
return KisImportExportFilter::OK;
}
#include "kis_oiio_export.moc"
/*
* Copyright (c) 2007 Boudewijn Rempt <boud@valdyas.org>
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _KIS_Oiio_EXPORT_H_
#define _KIS_Oiio_EXPORT_H_
#include <QVariant>
#include <KisImportExportFilter.h>
class KisOiioExport : public KisImportExportFilter
{
Q_OBJECT
public:
KisOiioExport(QObject *parent, const QVariantList &);
virtual ~KisOiioExport();
public:
virtual KisImportExportFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
};
#endif
/*
* Copyright (c) 2007 Boudewijn Rempt <boud@valdyas.org>
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "kis_oiio_import.h"
#include <QCheckBox>
#include