2019-07-04 17:33:43 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2011-05-29 09:27:07 +00:00
|
|
|
|
2017-09-02 17:57:46 +00:00
|
|
|
# KDE Application Version, managed by release script
|
2018-11-10 07:40:14 +00:00
|
|
|
set (KDE_APPLICATIONS_VERSION_MAJOR "19")
|
2019-07-15 19:43:08 +00:00
|
|
|
set (KDE_APPLICATIONS_VERSION_MINOR "11")
|
2017-09-02 17:57:46 +00:00
|
|
|
set (KDE_APPLICATIONS_VERSION_MICRO "70")
|
|
|
|
set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
|
|
|
|
|
2019-03-16 21:14:40 +00:00
|
|
|
project(okular VERSION 1.7.${KDE_APPLICATIONS_VERSION_MICRO})
|
2014-08-06 20:51:03 +00:00
|
|
|
|
2019-07-03 22:40:56 +00:00
|
|
|
set(QT_REQUIRED_VERSION "5.9.0")
|
2019-01-06 23:45:17 +00:00
|
|
|
set(KF5_REQUIRED_VERSION "5.44.0")
|
2014-08-06 20:51:03 +00:00
|
|
|
|
2018-02-21 20:29:18 +00:00
|
|
|
find_package(ECM 5.33.0 CONFIG REQUIRED)
|
2014-08-06 20:51:03 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
|
|
|
|
|
|
|
|
include(ECMInstallIcons)
|
|
|
|
include(ECMSetupVersion)
|
|
|
|
include(ECMOptionalAddSubdirectory)
|
2014-08-10 18:35:46 +00:00
|
|
|
include(GenerateExportHeader)
|
|
|
|
include(FeatureSummary)
|
2015-03-04 06:52:20 +00:00
|
|
|
include(ECMAddAppIcon)
|
2016-08-13 20:32:31 +00:00
|
|
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
2014-08-10 18:35:46 +00:00
|
|
|
include(KDEInstallDirs)
|
|
|
|
include(KDECMakeSettings)
|
2014-08-12 21:36:11 +00:00
|
|
|
include(ECMAddTests)
|
2016-07-15 19:05:38 +00:00
|
|
|
include(ECMAddAppIcon)
|
2017-09-05 08:58:58 +00:00
|
|
|
include(CMakePackageConfigHelpers)
|
2015-04-09 19:59:40 +00:00
|
|
|
|
2017-09-02 17:57:46 +00:00
|
|
|
ecm_setup_version(${PROJECT_VERSION}
|
2016-10-29 10:42:59 +00:00
|
|
|
VARIABLE_PREFIX OKULAR
|
|
|
|
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/core/version.h"
|
|
|
|
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/Okular5ConfigVersion.cmake")
|
2014-08-06 20:51:03 +00:00
|
|
|
|
2015-04-14 19:04:26 +00:00
|
|
|
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core DBus Test Widgets PrintSupport Svg Qml Quick)
|
|
|
|
find_package(Qt5 ${QT_REQUIRED_VERSION} OPTIONAL_COMPONENTS TextToSpeech)
|
2014-11-08 04:33:23 +00:00
|
|
|
if (NOT Qt5TextToSpeech_FOUND)
|
|
|
|
message(STATUS "Qt5TextToSpeech not found, speech features will be disabled")
|
|
|
|
else()
|
|
|
|
add_definitions(-DHAVE_SPEECH)
|
|
|
|
endif()
|
|
|
|
|
2018-02-05 23:36:00 +00:00
|
|
|
if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
|
|
|
|
# CMake 3.9+ warns about automoc on files without Q_OBJECT, and doesn't know about other macros.
|
|
|
|
# 3.10+ lets us provide more macro names that require automoc.
|
|
|
|
list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "OKULAR_EXPORT_PLUGIN")
|
|
|
|
endif()
|
|
|
|
|
2018-04-16 20:35:40 +00:00
|
|
|
set(optionalComponents)
|
|
|
|
if (ANDROID)
|
|
|
|
# we want to make sure that generally all components are found
|
|
|
|
|
|
|
|
set(optionalComponents "OPTIONAL_COMPONENTS")
|
|
|
|
endif()
|
|
|
|
|
2015-04-14 19:04:26 +00:00
|
|
|
find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
|
2014-08-09 14:05:30 +00:00
|
|
|
Archive
|
|
|
|
Bookmarks
|
2016-01-30 15:50:11 +00:00
|
|
|
Completion
|
2014-08-09 14:05:30 +00:00
|
|
|
Config
|
|
|
|
ConfigWidgets
|
|
|
|
CoreAddons
|
2018-04-08 09:50:18 +00:00
|
|
|
Crash
|
2016-07-11 17:40:49 +00:00
|
|
|
IconThemes
|
2014-08-09 14:05:30 +00:00
|
|
|
KIO
|
|
|
|
Parts
|
|
|
|
ThreadWeaver
|
2016-07-11 17:40:49 +00:00
|
|
|
WindowSystem
|
2018-04-16 20:35:40 +00:00
|
|
|
${optionalComponents}
|
|
|
|
DocTools
|
|
|
|
JS
|
|
|
|
Wallet
|
2014-08-09 14:05:30 +00:00
|
|
|
)
|
2018-04-16 20:35:40 +00:00
|
|
|
|
|
|
|
if(KF5Wallet_FOUND)
|
|
|
|
add_definitions(-DWITH_KWALLET=1)
|
|
|
|
endif()
|
|
|
|
if(KF5JS_FOUND)
|
|
|
|
add_definitions(-DWITH_KJS=1)
|
|
|
|
endif()
|
|
|
|
|
2018-04-13 15:35:17 +00:00
|
|
|
if(NOT WIN32 AND NOT ANDROID)
|
2017-03-18 00:58:05 +00:00
|
|
|
find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
|
|
|
|
Activities
|
|
|
|
)
|
2018-04-13 15:35:17 +00:00
|
|
|
set_package_properties("KF5Activities" PROPERTIES
|
|
|
|
DESCRIPTION "Activities interface library"
|
|
|
|
URL "https://api.kde.org/frameworks/kactivities/html/"
|
|
|
|
TYPE RECOMMENDED
|
|
|
|
PURPOSE "Required for Activities integration.")
|
2017-03-18 00:58:05 +00:00
|
|
|
endif()
|
2017-08-10 22:39:23 +00:00
|
|
|
find_package(KF5Kirigami2)
|
|
|
|
set_package_properties(KF5Kirigami2 PROPERTIES
|
|
|
|
DESCRIPTION "A QtQuick based components set"
|
|
|
|
PURPOSE "Required at runtime by the mobile app"
|
|
|
|
TYPE RUNTIME
|
|
|
|
)
|
2014-08-09 14:05:30 +00:00
|
|
|
find_package(Phonon4Qt5 CONFIG REQUIRED)
|
2019-01-06 23:51:04 +00:00
|
|
|
find_package(KF5Purpose)
|
|
|
|
set_package_properties(KF5Purpose PROPERTIES
|
2017-10-11 15:45:02 +00:00
|
|
|
DESCRIPTION "A framework for services and actions integration"
|
|
|
|
PURPOSE "Required for enabling the share menu in Okular"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2019-01-06 23:51:04 +00:00
|
|
|
if (KF5Purpose_FOUND)
|
2017-10-11 15:45:02 +00:00
|
|
|
set(PURPOSE_FOUND 1)
|
|
|
|
else()
|
|
|
|
set(PURPOSE_FOUND 0)
|
|
|
|
endif()
|
2011-05-29 09:27:07 +00:00
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
|
|
|
|
|
2014-10-08 22:17:53 +00:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
|
2018-03-20 23:30:22 +00:00
|
|
|
# This is here instead of in generators since we use if(Poppler_Qt5_FOUND) in autotests/
|
|
|
|
find_package(Poppler "0.12.1" COMPONENTS Qt5)
|
|
|
|
set_package_properties("Poppler" PROPERTIES
|
|
|
|
TYPE RECOMMENDED
|
|
|
|
PURPOSE "Support for PDF files in okular.")
|
|
|
|
|
2018-06-29 17:45:56 +00:00
|
|
|
add_definitions(-DQT_USE_FAST_OPERATOR_PLUS)
|
2014-09-10 20:30:35 +00:00
|
|
|
add_definitions(-DTRANSLATION_DOMAIN="okular")
|
2017-12-05 08:48:40 +00:00
|
|
|
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
|
2014-08-09 14:05:30 +00:00
|
|
|
|
2015-04-15 23:54:32 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${PHONON_INCLUDES} core/synctex ${ZLIB_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/core)
|
2011-05-29 09:27:07 +00:00
|
|
|
|
2018-04-19 14:36:57 +00:00
|
|
|
option(BUILD_OKULARKIRIGAMI "Builds the touch-friendly frontend" ON)
|
|
|
|
if (BUILD_OKULARKIRIGAMI)
|
|
|
|
add_subdirectory( mobile )
|
|
|
|
endif()
|
2015-08-26 22:05:06 +00:00
|
|
|
option(BUILD_COVERAGE "Build the project with gcov support" OFF)
|
|
|
|
|
2017-03-19 22:27:04 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override" )
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2015-08-26 22:05:06 +00:00
|
|
|
if(BUILD_COVERAGE)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
|
|
|
|
endif()
|
|
|
|
|
2014-08-09 10:47:33 +00:00
|
|
|
add_subdirectory( ui )
|
|
|
|
add_subdirectory( shell )
|
|
|
|
add_subdirectory( generators )
|
2018-07-09 05:37:58 +00:00
|
|
|
if(BUILD_TESTING)
|
|
|
|
add_subdirectory( autotests )
|
|
|
|
add_subdirectory( conf/autotests )
|
2018-07-09 05:43:44 +00:00
|
|
|
endif()
|
2014-08-06 20:51:03 +00:00
|
|
|
|
2018-04-16 20:35:40 +00:00
|
|
|
if(KF5DocTools_FOUND)
|
|
|
|
add_subdirectory(doc)
|
|
|
|
endif()
|
2006-03-26 12:19:40 +00:00
|
|
|
|
2007-03-10 13:15:49 +00:00
|
|
|
include(OkularConfigureChecks.cmake)
|
|
|
|
|
2007-03-18 17:14:36 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
set(MATH_LIB m)
|
|
|
|
else(NOT WIN32)
|
|
|
|
set(MATH_LIB)
|
|
|
|
endif(NOT WIN32)
|
2006-03-26 12:19:40 +00:00
|
|
|
|
2006-06-12 21:58:24 +00:00
|
|
|
# okularcore
|
2006-03-26 12:19:40 +00:00
|
|
|
|
2006-06-12 21:58:24 +00:00
|
|
|
set(okularcore_SRCS
|
2007-04-20 11:26:05 +00:00
|
|
|
core/action.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
core/annotations.cpp
|
|
|
|
core/area.cpp
|
2007-02-05 00:49:40 +00:00
|
|
|
core/audioplayer.cpp
|
2006-12-27 16:04:49 +00:00
|
|
|
core/bookmarkmanager.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
core/chooseenginedialog.cpp
|
|
|
|
core/document.cpp
|
2013-04-05 22:39:35 +00:00
|
|
|
core/documentcommands.cpp
|
2007-07-07 20:35:01 +00:00
|
|
|
core/fontinfo.cpp
|
2007-02-25 00:07:59 +00:00
|
|
|
core/form.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
core/generator.cpp
|
2007-04-20 17:17:44 +00:00
|
|
|
core/generator_p.cpp
|
2007-01-03 14:30:48 +00:00
|
|
|
core/misc.cpp
|
2008-08-23 00:07:59 +00:00
|
|
|
core/movie.cpp
|
2006-12-05 08:53:26 +00:00
|
|
|
core/observer.cpp
|
2014-09-11 17:36:01 +00:00
|
|
|
core/debug.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
core/page.cpp
|
2007-03-24 10:47:22 +00:00
|
|
|
core/pagecontroller.cpp
|
2007-01-05 23:12:06 +00:00
|
|
|
core/pagesize.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
core/pagetransition.cpp
|
2006-11-03 17:57:32 +00:00
|
|
|
core/rotationjob.cpp
|
2008-04-13 22:31:59 +00:00
|
|
|
core/scripter.cpp
|
2006-10-09 18:02:59 +00:00
|
|
|
core/sound.cpp
|
2007-01-02 17:45:32 +00:00
|
|
|
core/sourcereference.cpp
|
2007-01-13 23:15:28 +00:00
|
|
|
core/textdocumentgenerator.cpp
|
2013-05-18 11:57:46 +00:00
|
|
|
core/textdocumentsettings.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
core/textpage.cpp
|
2012-07-07 17:40:52 +00:00
|
|
|
core/tilesmanager.cpp
|
2006-06-30 21:42:41 +00:00
|
|
|
core/utils.cpp
|
2008-04-27 11:05:59 +00:00
|
|
|
core/view.cpp
|
2007-11-26 21:43:54 +00:00
|
|
|
core/fileprinter.cpp
|
Add option to ignore print margins for non-PDF generators
Summary:
This adds a combobox in the print dialog of the non-PDF
generators to allow selecting whether or not to take
print margins into account.
For the PDF case and rasterized printing, new print otions have
been implemented in commit 2e97d587508dff08aaf86ff149c8ed6b7658950d
already, which adds an additional option to do no scaling at all.
For consistency reasons, the same terms also used for the PDF
case are used in the combobox (i.e. the two of the three that
apply).
This adds a new abstract class 'PrintOptionsWidget' with a
'ignorePrintMargins()' method to indicate whether print margins
should be ignored or not, and a default implementation.
The existing widget for the PDF generator now derives from this
class.
In order to avoid an ABI breakage, the return value of
'Document::printConfigurationWidget' is left as a 'QWidget *'
and a dynamic_cast is done on use.
FilePrinter is adapted to take into account the value set by
'QPrinter::setFullPage()' and the margin options
are now passed accordingly (either the values set in the dialog or '0').
A big thanks to Albert Astals Cid <aacid@kde.org> for showing how
to extend the initial implementation to cover more generators.
Test Plan:
1) Open a PostScript file in Okular (using a document size that matches
a paper size available on the printer used later makes it easier
to see things behave as expected)
2) open print dialog, go to "Print options" and notice that there is a new
"Scale mode" combobox whose value is set to "Fit to printable area"
by default.
3) don't change any options, print to a printer that has hardware margins
Expected result: the document is scaled to the printable area (e.g.
scaled down so that the printer's hardware margins remain empty) as it
has been without this change.
4) Set the value of the "Print Options" -> "Scale mode" combobox to
"Fit to full page" and print again
Expected result: The document is scaled to the full page size, i.e. ignoring
the printer's hardware margins.
5) Try steps 1-4 with other document formats supported by Okular and
observe that they behave the same (except for the PDF case, where
there's a combobox with three options that has been implemented
independent of this change).
Reviewers: #okular, ngraham
Reviewed By: ngraham
Subscribers: fvogt, rkflx, arthurpeters, ltoscano, okular-devel, aacid, ngraham
Tags: #okular
Differential Revision: https://phabricator.kde.org/D10974
2019-04-03 13:58:21 +00:00
|
|
|
core/printoptionswidget.cpp
|
2019-01-05 22:30:25 +00:00
|
|
|
core/signatureutils.cpp
|
2018-02-21 22:54:16 +00:00
|
|
|
core/script/event.cpp
|
2014-10-08 22:17:53 +00:00
|
|
|
core/synctex/synctex_parser.c
|
|
|
|
core/synctex/synctex_parser_utils.c
|
2006-03-26 15:22:05 +00:00
|
|
|
)
|
2018-02-21 22:56:51 +00:00
|
|
|
qt5_add_resources(okularcore_SRCS
|
|
|
|
core/script/builtin.qrc
|
|
|
|
)
|
|
|
|
|
2014-08-13 09:26:37 +00:00
|
|
|
ki18n_wrap_ui(okularcore_SRCS
|
2013-05-18 11:57:46 +00:00
|
|
|
conf/textdocumentsettings.ui
|
|
|
|
)
|
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
install( FILES
|
2007-04-20 11:26:05 +00:00
|
|
|
core/action.h
|
2007-01-03 14:30:48 +00:00
|
|
|
core/annotations.h
|
|
|
|
core/area.h
|
|
|
|
core/document.h
|
2007-07-08 16:21:53 +00:00
|
|
|
core/fontinfo.h
|
2007-03-18 19:25:04 +00:00
|
|
|
core/form.h
|
2007-01-03 14:30:48 +00:00
|
|
|
core/generator.h
|
2007-04-22 10:23:59 +00:00
|
|
|
core/global.h
|
2007-01-03 14:30:48 +00:00
|
|
|
core/page.h
|
2007-01-05 23:12:06 +00:00
|
|
|
core/pagesize.h
|
2007-01-03 14:30:48 +00:00
|
|
|
core/pagetransition.h
|
2019-01-05 22:30:25 +00:00
|
|
|
core/signatureutils.h
|
2007-01-03 14:30:48 +00:00
|
|
|
core/sound.h
|
|
|
|
core/sourcereference.h
|
2007-01-13 23:15:28 +00:00
|
|
|
core/textdocumentgenerator.h
|
2013-05-18 11:57:46 +00:00
|
|
|
core/textdocumentsettings.h
|
2007-01-03 14:30:48 +00:00
|
|
|
core/textpage.h
|
2012-11-08 20:29:09 +00:00
|
|
|
core/tile.h
|
2007-01-03 14:30:48 +00:00
|
|
|
core/utils.h
|
2007-11-26 21:43:54 +00:00
|
|
|
core/fileprinter.h
|
Add option to ignore print margins for non-PDF generators
Summary:
This adds a combobox in the print dialog of the non-PDF
generators to allow selecting whether or not to take
print margins into account.
For the PDF case and rasterized printing, new print otions have
been implemented in commit 2e97d587508dff08aaf86ff149c8ed6b7658950d
already, which adds an additional option to do no scaling at all.
For consistency reasons, the same terms also used for the PDF
case are used in the combobox (i.e. the two of the three that
apply).
This adds a new abstract class 'PrintOptionsWidget' with a
'ignorePrintMargins()' method to indicate whether print margins
should be ignored or not, and a default implementation.
The existing widget for the PDF generator now derives from this
class.
In order to avoid an ABI breakage, the return value of
'Document::printConfigurationWidget' is left as a 'QWidget *'
and a dynamic_cast is done on use.
FilePrinter is adapted to take into account the value set by
'QPrinter::setFullPage()' and the margin options
are now passed accordingly (either the values set in the dialog or '0').
A big thanks to Albert Astals Cid <aacid@kde.org> for showing how
to extend the initial implementation to cover more generators.
Test Plan:
1) Open a PostScript file in Okular (using a document size that matches
a paper size available on the printer used later makes it easier
to see things behave as expected)
2) open print dialog, go to "Print options" and notice that there is a new
"Scale mode" combobox whose value is set to "Fit to printable area"
by default.
3) don't change any options, print to a printer that has hardware margins
Expected result: the document is scaled to the printable area (e.g.
scaled down so that the printer's hardware margins remain empty) as it
has been without this change.
4) Set the value of the "Print Options" -> "Scale mode" combobox to
"Fit to full page" and print again
Expected result: The document is scaled to the full page size, i.e. ignoring
the printer's hardware margins.
5) Try steps 1-4 with other document formats supported by Okular and
observe that they behave the same (except for the PDF case, where
there's a combobox with three options that has been implemented
independent of this change).
Reviewers: #okular, ngraham
Reviewed By: ngraham
Subscribers: fvogt, rkflx, arthurpeters, ltoscano, okular-devel, aacid, ngraham
Tags: #okular
Differential Revision: https://phabricator.kde.org/D10974
2019-04-03 13:58:21 +00:00
|
|
|
core/printoptionswidget.h
|
2013-02-24 21:58:53 +00:00
|
|
|
core/observer.h
|
2015-04-09 19:59:40 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/core/version.h
|
2015-04-15 23:54:32 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/core/okularcore_export.h
|
2012-10-15 22:27:42 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/settings_core.h
|
2015-03-04 06:52:20 +00:00
|
|
|
DESTINATION ${KDE_INSTALL_INCLUDEDIR}/okular/core COMPONENT Devel)
|
2007-01-03 14:30:48 +00:00
|
|
|
|
|
|
|
install( FILES
|
|
|
|
interfaces/configinterface.h
|
|
|
|
interfaces/guiinterface.h
|
|
|
|
interfaces/printinterface.h
|
2012-05-21 21:54:48 +00:00
|
|
|
interfaces/saveinterface.h
|
2011-09-10 17:15:52 +00:00
|
|
|
interfaces/viewerinterface.h
|
2015-03-04 06:52:20 +00:00
|
|
|
DESTINATION ${KDE_INSTALL_INCLUDEDIR}/okular/interfaces COMPONENT Devel)
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2014-08-13 09:26:37 +00:00
|
|
|
ki18n_wrap_ui(okularcore_SRCS
|
2006-06-03 09:22:26 +00:00
|
|
|
core/chooseenginewidget.ui
|
2006-03-26 15:22:05 +00:00
|
|
|
)
|
|
|
|
|
Custom background color
Summary:
BUG: 182994
Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).
Reasons for this change:
Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
Many people want this change occording to Bugzilla and other sources.
Maintenance: Nearly no additional maintenance:
This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.
{F4257766}
Other less important information:
https://git.reviewboard.kde.org/r/130219/
https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html
Test Plan:
Tested everything, it all works:
Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).
Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham
Reviewed By: ngraham
Subscribers: aacid, ltoscano, ngraham
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8051
2017-10-01 09:29:25 +00:00
|
|
|
kconfig_add_kcfg_files(okularcore_SRCS conf/settings_core.kcfgc)
|
2006-06-12 21:58:24 +00:00
|
|
|
|
2014-10-06 06:58:55 +00:00
|
|
|
add_library(okularcore SHARED ${okularcore_SRCS})
|
2015-04-15 23:54:32 +00:00
|
|
|
generate_export_header(okularcore BASE_NAME okularcore EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/core/okularcore_export.h")
|
2006-06-12 21:58:24 +00:00
|
|
|
|
2018-04-18 00:17:24 +00:00
|
|
|
if (ANDROID)
|
|
|
|
set(fileName ${CMAKE_BINARY_DIR}/Okular5Core-android-dependencies.xml)
|
|
|
|
file(WRITE "${fileName}" "<rules><dependencies><lib name='Okular5Core'><depends>\n"
|
|
|
|
"<bundled file='${KDE_INSTALL_PLUGINDIR}/okular/generators' />\n"
|
|
|
|
"</depends></lib></dependencies></rules>\n")
|
|
|
|
install(FILES ${fileName} DESTINATION ${KDE_INSTALL_LIBDIR})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2006-10-29 15:08:18 +00:00
|
|
|
# Special handling for linking okularcore on OSX/Apple
|
|
|
|
IF(APPLE)
|
|
|
|
SET(OKULAR_IOKIT "-framework IOKit" CACHE STRING "Apple IOKit framework")
|
|
|
|
ENDIF(APPLE)
|
|
|
|
|
2017-09-13 21:27:39 +00:00
|
|
|
# Extra library needed by imported synctex code on Windows
|
|
|
|
if(WIN32)
|
|
|
|
set(SHLWAPI shlwapi)
|
|
|
|
endif(WIN32)
|
|
|
|
|
2014-08-09 14:05:30 +00:00
|
|
|
target_link_libraries(okularcore
|
2015-04-14 19:04:26 +00:00
|
|
|
PRIVATE
|
2014-08-09 14:05:30 +00:00
|
|
|
${OKULAR_IOKIT}
|
2017-09-13 21:27:39 +00:00
|
|
|
${SHLWAPI}
|
2014-08-09 14:05:30 +00:00
|
|
|
KF5::Archive
|
|
|
|
KF5::KIOCore
|
2015-11-28 19:24:41 +00:00
|
|
|
KF5::KIOWidgets
|
|
|
|
KF5::I18n
|
2014-08-09 14:05:30 +00:00
|
|
|
KF5::ThreadWeaver
|
2015-11-28 19:24:41 +00:00
|
|
|
KF5::Bookmarks
|
2014-08-09 14:05:30 +00:00
|
|
|
Phonon::phonon4qt5
|
|
|
|
${MATH_LIB}
|
2014-10-09 05:28:59 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2015-04-14 19:04:26 +00:00
|
|
|
PUBLIC # these are included from the installed headers
|
|
|
|
KF5::CoreAddons
|
|
|
|
KF5::XmlGui
|
|
|
|
KF5::ConfigGui
|
|
|
|
Qt5::PrintSupport
|
|
|
|
Qt5::Widgets
|
2014-08-09 14:05:30 +00:00
|
|
|
)
|
2006-06-12 21:58:24 +00:00
|
|
|
|
2018-04-16 20:35:40 +00:00
|
|
|
|
|
|
|
if (KF5Wallet_FOUND)
|
|
|
|
target_link_libraries(okularcore PRIVATE KF5::Wallet)
|
|
|
|
endif()
|
|
|
|
if (KF5JS_FOUND)
|
|
|
|
target_sources(okularcore PRIVATE
|
|
|
|
core/script/executor_kjs.cpp
|
|
|
|
core/script/kjs_app.cpp
|
|
|
|
core/script/kjs_console.cpp
|
|
|
|
core/script/kjs_data.cpp
|
2019-05-23 13:28:53 +00:00
|
|
|
core/script/kjs_display.cpp
|
2018-04-16 20:35:40 +00:00
|
|
|
core/script/kjs_document.cpp
|
|
|
|
core/script/kjs_field.cpp
|
|
|
|
core/script/kjs_fullscreen.cpp
|
|
|
|
core/script/kjs_field.cpp
|
|
|
|
core/script/kjs_spell.cpp
|
|
|
|
core/script/kjs_util.cpp
|
|
|
|
core/script/kjs_event.cpp
|
2019-05-31 20:03:54 +00:00
|
|
|
core/script/kjs_ocg.cpp
|
2018-04-16 20:35:40 +00:00
|
|
|
)
|
|
|
|
target_link_libraries(okularcore PRIVATE KF5::JS KF5::JSApi)
|
|
|
|
endif()
|
|
|
|
|
2018-03-20 22:37:30 +00:00
|
|
|
set_target_properties(okularcore PROPERTIES VERSION 9.0.0 SOVERSION 9 OUTPUT_NAME Okular5Core EXPORT_NAME Core)
|
2007-04-20 16:12:05 +00:00
|
|
|
|
2015-07-18 15:28:05 +00:00
|
|
|
install(TARGETS okularcore EXPORT Okular5Targets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
2006-06-12 21:58:24 +00:00
|
|
|
|
2015-03-04 06:52:20 +00:00
|
|
|
install(FILES conf/okular.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
|
|
|
|
install(FILES conf/okular_core.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
|
|
|
|
install(FILES core/okularGenerator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
|
2007-01-25 18:06:53 +00:00
|
|
|
|
2006-06-12 21:58:24 +00:00
|
|
|
# okularpart
|
|
|
|
|
2015-08-22 14:00:04 +00:00
|
|
|
set(okularpart_conf_SRCS
|
2006-11-10 20:29:12 +00:00
|
|
|
conf/preferencesdialog.cpp
|
|
|
|
conf/dlgaccessibility.cpp
|
2006-12-22 15:04:01 +00:00
|
|
|
conf/dlgdebug.cpp
|
2008-10-19 18:01:16 +00:00
|
|
|
conf/dlgeditor.cpp
|
2006-11-10 20:29:12 +00:00
|
|
|
conf/dlggeneral.cpp
|
2012-06-09 20:59:40 +00:00
|
|
|
conf/dlgannotations.cpp
|
2006-11-10 20:29:12 +00:00
|
|
|
conf/dlgperformance.cpp
|
|
|
|
conf/dlgpresentation.cpp
|
2015-08-22 14:00:04 +00:00
|
|
|
conf/editannottooldialog.cpp
|
|
|
|
conf/editdrawingtooldialog.cpp
|
2012-06-10 18:15:38 +00:00
|
|
|
conf/widgetannottools.cpp
|
2015-08-22 14:00:04 +00:00
|
|
|
conf/widgetconfigurationtoolsbase.cpp
|
|
|
|
conf/widgetdrawingtools.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(okularpart_SRCS
|
|
|
|
${okularpart_conf_SRCS}
|
|
|
|
part.cpp
|
|
|
|
extensions.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/embeddedfilesdialog.cpp
|
2006-08-11 23:53:48 +00:00
|
|
|
ui/annotwindow.cpp
|
2007-09-08 17:10:35 +00:00
|
|
|
ui/annotationmodel.cpp
|
2006-12-30 12:40:54 +00:00
|
|
|
ui/annotationpopup.cpp
|
2006-08-08 15:31:13 +00:00
|
|
|
ui/annotationpropertiesdialog.cpp
|
2007-09-09 16:51:55 +00:00
|
|
|
ui/annotationproxymodels.cpp
|
2006-11-01 15:23:11 +00:00
|
|
|
ui/annotationtools.cpp
|
2006-09-12 20:21:34 +00:00
|
|
|
ui/annotationwidgets.cpp
|
2006-12-27 16:04:49 +00:00
|
|
|
ui/bookmarklist.cpp
|
2019-01-05 22:30:25 +00:00
|
|
|
ui/certificateviewer.cpp
|
2014-09-11 17:36:01 +00:00
|
|
|
ui/debug_ui.cpp
|
2015-08-22 20:15:32 +00:00
|
|
|
ui/drawingtoolactions.cpp
|
2007-12-03 00:17:12 +00:00
|
|
|
ui/fileprinterpreview.cpp
|
2007-03-17 22:58:41 +00:00
|
|
|
ui/findbar.cpp
|
2007-02-25 00:07:59 +00:00
|
|
|
ui/formwidgets.cpp
|
2007-12-24 00:54:21 +00:00
|
|
|
ui/guiutils.cpp
|
2007-09-09 15:50:00 +00:00
|
|
|
ui/ktreeviewsearchline.cpp
|
2011-09-22 17:09:26 +00:00
|
|
|
ui/latexrenderer.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/minibar.cpp
|
2016-12-28 16:03:28 +00:00
|
|
|
ui/okmenutitle.cpp
|
2006-12-26 12:01:30 +00:00
|
|
|
ui/pageitemdelegate.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/pagepainter.cpp
|
2006-10-15 19:37:14 +00:00
|
|
|
ui/pagesizelabel.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/pageviewannotator.cpp
|
Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 22:16:06 +00:00
|
|
|
ui/pageviewmouseannotation.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/pageview.cpp
|
2014-02-24 22:42:10 +00:00
|
|
|
ui/magnifierview.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/pageviewutils.cpp
|
2007-03-17 22:58:41 +00:00
|
|
|
ui/presentationsearchbar.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/presentationwidget.cpp
|
|
|
|
ui/propertiesdialog.cpp
|
2019-01-05 22:30:25 +00:00
|
|
|
ui/revisionviewer.cpp
|
2007-03-17 16:58:01 +00:00
|
|
|
ui/searchlineedit.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/searchwidget.cpp
|
2007-08-06 17:24:10 +00:00
|
|
|
ui/sidebar.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/side_reviews.cpp
|
2012-06-29 09:16:28 +00:00
|
|
|
ui/snapshottaker.cpp
|
2006-06-03 09:22:26 +00:00
|
|
|
ui/thumbnaillist.cpp
|
|
|
|
ui/toc.cpp
|
2007-09-09 16:15:33 +00:00
|
|
|
ui/tocmodel.cpp
|
2007-09-14 10:02:33 +00:00
|
|
|
ui/toolaction.cpp
|
2008-08-25 01:26:47 +00:00
|
|
|
ui/videowidget.cpp
|
2015-05-27 13:56:56 +00:00
|
|
|
ui/layers.cpp
|
2019-01-05 22:30:25 +00:00
|
|
|
ui/signatureguiutils.cpp
|
|
|
|
ui/signaturepropertiesdialog.cpp
|
|
|
|
ui/signaturemodel.cpp
|
|
|
|
ui/signaturepanel.cpp
|
2006-03-26 15:52:06 +00:00
|
|
|
)
|
2006-03-26 12:19:40 +00:00
|
|
|
|
2014-11-08 04:33:23 +00:00
|
|
|
if (Qt5TextToSpeech_FOUND)
|
|
|
|
set(okularpart_SRCS ${okularpart_SRCS}
|
|
|
|
ui/tts.cpp)
|
|
|
|
endif()
|
|
|
|
|
2014-08-13 09:26:37 +00:00
|
|
|
ki18n_wrap_ui(okularpart_SRCS
|
2006-11-10 20:29:12 +00:00
|
|
|
conf/dlgaccessibilitybase.ui
|
2008-10-19 18:01:16 +00:00
|
|
|
conf/dlgeditorbase.ui
|
2006-11-10 20:29:12 +00:00
|
|
|
conf/dlggeneralbase.ui
|
2012-06-09 20:59:40 +00:00
|
|
|
conf/dlgannotationsbase.ui
|
2006-11-10 20:29:12 +00:00
|
|
|
conf/dlgperformancebase.ui
|
|
|
|
conf/dlgpresentationbase.ui
|
|
|
|
)
|
|
|
|
|
Custom background color
Summary:
BUG: 182994
Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).
Reasons for this change:
Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
Many people want this change occording to Bugzilla and other sources.
Maintenance: Nearly no additional maintenance:
This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.
{F4257766}
Other less important information:
https://git.reviewboard.kde.org/r/130219/
https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html
Test Plan:
Tested everything, it all works:
Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).
Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham
Reviewed By: ngraham
Subscribers: aacid, ltoscano, ngraham
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8051
2017-10-01 09:29:25 +00:00
|
|
|
kconfig_add_kcfg_files(okularpart_SRCS conf/settings.kcfgc)
|
2012-10-15 22:27:42 +00:00
|
|
|
|
2015-10-25 13:56:47 +00:00
|
|
|
add_library(okularpart SHARED ${okularpart_SRCS})
|
2014-10-27 21:35:06 +00:00
|
|
|
generate_export_header(okularpart BASE_NAME okularpart)
|
2006-03-26 12:19:40 +00:00
|
|
|
|
2016-07-11 17:40:49 +00:00
|
|
|
target_link_libraries(okularpart okularcore
|
|
|
|
${MATH_LIB}
|
|
|
|
Qt5::Svg
|
|
|
|
Phonon::phonon4qt5
|
|
|
|
KF5::Archive
|
2016-07-15 19:05:38 +00:00
|
|
|
KF5::Bookmarks
|
2016-07-21 19:53:54 +00:00
|
|
|
KF5::I18n
|
2016-07-11 17:40:49 +00:00
|
|
|
KF5::IconThemes
|
2016-07-17 00:28:57 +00:00
|
|
|
KF5::ItemViews
|
2016-08-03 14:01:30 +00:00
|
|
|
KF5::KIOCore
|
|
|
|
KF5::KIOFileWidgets
|
|
|
|
KF5::KIOWidgets
|
2016-07-11 17:40:49 +00:00
|
|
|
KF5::Parts
|
|
|
|
KF5::Solid
|
|
|
|
KF5::WindowSystem
|
|
|
|
)
|
|
|
|
|
2018-04-16 20:35:40 +00:00
|
|
|
if(KF5Wallet_FOUND)
|
|
|
|
target_link_libraries(okularpart KF5::Wallet)
|
|
|
|
endif()
|
|
|
|
|
2019-01-06 23:51:04 +00:00
|
|
|
if (KF5Purpose_FOUND)
|
|
|
|
target_link_libraries(okularpart KF5::PurposeWidgets)
|
2017-10-11 15:45:02 +00:00
|
|
|
endif()
|
|
|
|
|
2016-03-16 09:57:34 +00:00
|
|
|
set_target_properties(okularpart PROPERTIES PREFIX "")
|
2006-03-26 12:19:40 +00:00
|
|
|
|
2014-11-08 04:33:23 +00:00
|
|
|
if (Qt5TextToSpeech_FOUND)
|
|
|
|
target_link_libraries(okularpart Qt5::TextToSpeech)
|
|
|
|
endif()
|
2015-03-04 06:52:20 +00:00
|
|
|
install(TARGETS okularpart DESTINATION ${KDE_INSTALL_PLUGINDIR})
|
2006-03-26 12:19:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
########### install files ###############
|
|
|
|
|
2015-03-04 06:52:20 +00:00
|
|
|
install(FILES okular.upd DESTINATION ${KDE_INSTALL_DATADIR}/kconf_update)
|
2012-10-15 22:27:42 +00:00
|
|
|
|
2015-03-04 06:52:20 +00:00
|
|
|
install( FILES okular_part.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
|
|
|
|
install( FILES part.rc part-viewermode.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/okular )
|
2006-03-26 12:19:40 +00:00
|
|
|
|
2019-06-12 04:58:00 +00:00
|
|
|
if (${ECM_VERSION} STRGREATER "5.58.0")
|
|
|
|
install(FILES okular.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
|
|
|
|
else()
|
|
|
|
install(FILES okular.categories DESTINATION ${KDE_INSTALL_CONFDIR})
|
|
|
|
endif()
|
2016-01-03 08:13:06 +00:00
|
|
|
|
2010-09-26 17:31:31 +00:00
|
|
|
########### cmake files #################
|
|
|
|
|
2015-07-18 15:28:05 +00:00
|
|
|
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Okular5")
|
2017-09-05 08:58:58 +00:00
|
|
|
configure_package_config_file(
|
2015-07-18 15:28:05 +00:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/Okular5Config.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/Okular5Config.cmake"
|
2015-04-09 19:59:40 +00:00
|
|
|
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
|
|
|
|
PATH_VARS INCLUDE_INSTALL_DIR CMAKE_INSTALL_PREFIX
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES
|
2015-07-18 15:28:05 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/Okular5Config.cmake"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/Okular5ConfigVersion.cmake"
|
2015-04-09 19:59:40 +00:00
|
|
|
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
|
|
|
|
COMPONENT Devel
|
|
|
|
)
|
|
|
|
|
2015-07-18 15:28:05 +00:00
|
|
|
install(EXPORT Okular5Targets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE Okular5Targets.cmake NAMESPACE Okular::)
|
2010-09-26 17:31:31 +00:00
|
|
|
|
2015-04-09 19:59:40 +00:00
|
|
|
########### summary #################
|
2011-05-29 09:27:07 +00:00
|
|
|
|
2014-08-06 20:51:03 +00:00
|
|
|
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
2011-05-29 09:27:07 +00:00
|
|
|
|