2022-03-18 21:12:36 +00:00
cmake_minimum_required ( VERSION 3.22 )
2011-05-29 09:27:07 +00:00
2017-09-02 17:57:46 +00:00
# KDE Application Version, managed by release script
2022-11-05 20:32:00 +00:00
set ( RELEASE_SERVICE_VERSION_MAJOR "23" )
2023-07-17 09:56:53 +00:00
set ( RELEASE_SERVICE_VERSION_MINOR "11" )
2019-12-10 16:39:40 +00:00
set ( RELEASE_SERVICE_VERSION_MICRO "70" )
set ( RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}" )
2017-09-02 17:57:46 +00:00
2020-09-11 16:26:35 +00:00
project ( okular VERSION ${ RELEASE_SERVICE_VERSION } )
2014-08-06 20:51:03 +00:00
2022-03-18 21:12:36 +00:00
set ( QT_REQUIRED_VERSION "5.15.2" ) # Remember to update the QT_DEPRECATED_WARNINGS_SINCE below
set ( KF5_REQUIRED_VERSION "5.92.0" ) # Remember to update the KF_DEPRECATED_WARNINGS_SINCE below
2014-08-06 20:51:03 +00:00
2021-11-30 23:15:56 +00:00
set ( OKULAR_UI "" CACHE STRING "Which Okular user interface to build. Possible values: desktop, mobile, both. Default: desktop (except on Android, where it is 'mobile')" )
2022-04-03 09:52:53 +00:00
option ( FORCE_NOT_REQUIRED_DEPENDENCIES "List (semicolon-separated) of dependencies that will be downgraded from REQUIRED to RECOMMENDED" )
if ( ANDROID AND ( NOT FORCE_NOT_REQUIRED_DEPENDENCIES ) AND ( NOT FORCE_NOT_REQUIRED_DEPENDENCIES STREQUAL "" ) )
2023-05-20 14:51:09 +00:00
set ( FORCE_NOT_REQUIRED_DEPENDENCIES "KF5Wallet;KF5DocTools;Qt5Qml;TIFF;JPEG;LibSpectre;KF5KExiv2;CHM;KF5KHtml;LibZip;DjVuLibre;EPub;Discount;" )
2022-04-03 09:52:53 +00:00
endif ( )
function ( set_okular_optional_package_properties _name _props )
if ( NOT "${_props}" STREQUAL "PROPERTIES" )
message ( FATAL_ERROR "PROPERTIES keyword is missing in set_okular_optional_package_properties() call." )
endif ( )
set ( options ) # none
set ( oneValueArgs DESCRIPTION URL PURPOSE )
set ( multiValueArgs ) # none
CMAKE_PARSE_ARGUMENTS ( _SPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ ARGN } )
if ( _SPP_UNPARSED_ARGUMENTS )
message ( FATAL_ERROR "Unknown keywords given to set_okular_optional_package_properties(): \" ${ _SPP_UNPARSED_ARGUMENTS } \"")
endif ( )
set ( DEPENDENCY_TYPE "REQUIRED" )
if ( ${ _name } IN_LIST FORCE_NOT_REQUIRED_DEPENDENCIES )
set ( DEPENDENCY_TYPE "RECOMMENDED" )
endif ( )
set_package_properties ( ${ _name } PROPERTIES
T Y P E $ { D E P E N D E N C Y _ T Y P E }
D E S C R I P T I O N $ { _ S P P _ D E S C R I P T I O N }
U R L $ { _ S P P _ U R L }
P U R P O S E " $ { _ S P P _ P U R P O S E } Y o u c a n m a k e t h e d e p e n d e n c y o p t i o n a l a d d i n g $ { _ n a m e } t o t h e F O R C E _ N O T _ R E Q U I R E D _ D E P E N D E N C I E S c m a k e o p t i o n "
)
endfunction ( )
2021-11-30 23:15:56 +00:00
if ( OKULAR_UI STREQUAL "" )
if ( ANDROID )
set ( OKULAR_UI "mobile" )
else ( )
set ( OKULAR_UI "desktop" )
endif ( )
endif ( )
2020-02-01 10:02:33 +00:00
if ( OKULAR_UI STREQUAL "desktop" OR OKULAR_UI STREQUAL "both" )
set ( BUILD_DESKTOP ON )
else ( )
set ( BUILD_DESKTOP OFF )
endif ( )
if ( OKULAR_UI STREQUAL "mobile" OR OKULAR_UI STREQUAL "both" )
set ( BUILD_MOBILE ON )
else ( )
set ( BUILD_MOBILE OFF )
endif ( )
2021-11-24 16:58:52 +00:00
if ( BUILD_MOBILE )
set ( QT_REQUIRED_VERSION "5.15.2" )
2019-10-25 15:06:59 +00:00
endif ( )
2020-04-07 22:36:08 +00:00
find_package ( ECM ${ KF5_REQUIRED_VERSION } 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 )
2020-04-08 00:33:25 +00:00
include ( ECMSetupQtPluginMacroNames )
2015-04-09 19:59:40 +00:00
2022-03-07 23:09:02 +00:00
# append the plugins from the install tree folder to the QT_PLUGIN_PATH
if ( UNIX )
set ( ENV{QT_PLUGIN_PATH} "$ENV{QT_PLUGIN_PATH}:${KDE_INSTALL_FULL_QTPLUGINDIR}" )
elseif ( WIN32 )
set ( ENV{QT_PLUGIN_PATH} "$ENV{QT_PLUGIN_PATH};${KDE_INSTALL_FULL_QTPLUGINDIR}" )
endif ( )
2023-04-17 13:19:49 +00:00
set ( CMAKE_CXX_STANDARD 17 )
2020-02-27 19:47:40 +00:00
set ( CMAKE_CXX_STANDARD_REQUIRED ON )
set ( CMAKE_CXX_EXTENSIONS OFF )
2017-09-02 17:57:46 +00:00
ecm_setup_version ( ${ PROJECT_VERSION }
2016-10-29 10:42:59 +00:00
V A R I A B L E _ P R E F I X O K U L A R
V E R S I O N _ H E A D E R " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c o r e / v e r s i o n . h "
P A C K A G E _ V E R S I O N _ F I L E " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / O k u l a r 5 C o n f i g V e r s i o n . c m a k e " )
2014-08-06 20:51:03 +00:00
2023-05-02 08:49:09 +00:00
find_package ( Qt5 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS Core Test Widgets PrintSupport Svg )
2014-11-08 04:33:23 +00:00
2019-10-25 15:06:59 +00:00
if ( ANDROID )
find_package ( Qt5 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS AndroidExtras )
endif ( )
2020-04-08 00:33:25 +00:00
ecm_setup_qtplugin_macro_names (
J S O N _ A R G 2
2020-04-07 22:46:27 +00:00
" O K U L A R _ E X P O R T _ P L U G I N "
2020-04-08 00:33:25 +00:00
C O N F I G _ C O D E _ V A R I A B L E
P A C K A G E _ S E T U P _ A U T O M O C _ V A R I A B L E S
)
2018-02-05 23:36:00 +00:00
2015-04-14 19:04:26 +00:00
find_package ( KF5 ${ KF5_REQUIRED_VERSION } REQUIRED COMPONENTS
2014-08-09 14:05:30 +00:00
A r c h i v e
B o o k m a r k s
2016-01-30 15:50:11 +00:00
C o m p l e t i o n
2014-08-09 14:05:30 +00:00
C o n f i g
C o n f i g W i d g e t s
C o r e A d d o n s
2021-04-26 11:49:43 +00:00
I 1 8 n
2014-08-09 14:05:30 +00:00
K I O
T h r e a d W e a v e r
2016-07-11 17:40:49 +00:00
W i n d o w S y s t e m
2014-08-09 14:05:30 +00:00
)
2018-04-16 20:35:40 +00:00
2022-04-03 09:52:53 +00:00
find_package ( KF5Wallet ${ KF5_REQUIRED_VERSION } )
set_okular_optional_package_properties ( KF5Wallet PROPERTIES
P U R P O S E " R e q u i r e d f o r d o c u m e n t s t o r i n g p a s s w o r d s i n s e c u r e w a l l e t s . " )
2020-09-09 12:13:09 +00:00
if ( KF5Wallet_FOUND )
2023-05-15 10:36:38 +00:00
set ( HAVE_KWALLET 1 )
else ( )
set ( HAVE_KWALLET 0 )
2020-09-09 12:13:09 +00:00
endif ( )
2022-04-03 09:52:53 +00:00
find_package ( KF5DocTools ${ KF5_REQUIRED_VERSION } )
set_okular_optional_package_properties ( KF5DocTools PROPERTIES
P U R P O S E " R e q u i r e d f o r c o m p i l i n g a n d i n s t a l l i n g t h e u s e r d o c u m e n t a t i o n . " )
2023-05-20 14:51:09 +00:00
find_package ( Qt5Qml )
set_okular_optional_package_properties ( Qt5Qml PROPERTIES
2022-04-03 09:52:53 +00:00
P U R P O S E " R e q u i r e d f o r s u p p o r t i n g J a v a S c r i p t i n P D F d o c u m e n t s " )
2023-05-20 14:51:09 +00:00
if ( TARGET Qt5::Qml )
2023-06-22 15:24:36 +00:00
set ( HAVE_JS 1 )
2023-05-16 07:16:04 +00:00
else ( )
2023-06-22 15:24:36 +00:00
set ( HAVE_JS 0 )
2020-09-09 12:13:09 +00:00
endif ( )
2022-04-03 09:52:53 +00:00
if ( BUILD_DESKTOP )
2023-07-03 14:52:44 +00:00
find_package ( Qt5DBus )
set_okular_optional_package_properties ( Qt5DBus PROPERTIES
P U R P O S E " R e q u i r e d f o r i n t e r p r o c e s s c o m m u n i c a t i o n , e x t e r n a l o p e n i n s a m e i n s t a n c e a n d v a r i o u s p r e s e n t a t i o n r e l a t e d b i t s . " )
if ( TARGET Qt5::DBus )
set ( HAVE_DBUS 1 )
else ( )
set ( HAVE_DBUS 0 )
endif ( )
2022-04-03 09:52:53 +00:00
find_package ( KF5 ${ KF5_REQUIRED_VERSION } REQUIRED COMPONENTS Parts Crash IconThemes TextWidgets )
find_package ( KF5Purpose )
set_okular_optional_package_properties ( KF5Purpose PROPERTIES
D E S C R I P T I O N " A f r a m e w o r k f o r s e r v i c e s a n d a c t i o n s i n t e g r a t i o n "
P U R P O S E " R e q u i r e d f o r e n a b l i n g t h e s h a r e m e n u . " )
if ( KF5Purpose_FOUND )
2023-05-12 13:16:30 +00:00
set ( HAVE_PURPOSE 1 )
2022-04-03 09:52:53 +00:00
else ( )
2023-05-12 13:16:30 +00:00
set ( HAVE_PURPOSE 0 )
2022-04-03 09:52:53 +00:00
endif ( )
find_package ( Qt5TextToSpeech ${ QT_REQUIRED_VERSION } CONFIG )
set_okular_optional_package_properties ( Qt5TextToSpeech PROPERTIES
P U R P O S E " E n a b l e s s p e e c h f e a t u r e s . " )
if ( Qt5TextToSpeech_FOUND )
2023-05-12 13:45:24 +00:00
set ( HAVE_SPEECH 1 )
else ( )
set ( HAVE_SPEECH 0 )
2022-04-03 09:52:53 +00:00
endif ( )
endif ( )
if ( BUILD_MOBILE )
2023-05-02 08:49:09 +00:00
find_package ( Qt5 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS Qml Quick )
2022-04-03 09:52:53 +00:00
find_package ( KF5Kirigami2 )
set_package_properties ( KF5Kirigami2 PROPERTIES
D E S C R I P T I O N " A Q t Q u i c k b a s e d c o m p o n e n t s s e t "
P U R P O S E " R e q u i r e d a t r u n t i m e b y t h e m o b i l e a p p "
T Y P E R U N T I M E
)
2023-08-09 21:41:15 +00:00
find_package ( KF5KirigamiAddons )
set_package_properties ( KF5KirigamiAddons PROPERTIES
D E S C R I P T I O N " A s e t o f w i d g e t s f o r K i r i g a m i a l o n g w i t h c o d e t o s u p p o r t t h e m "
P U R P O S E " R e q u i r e d a t r u n t i m e b y t h e m o b i l e a p p "
T Y P E R U N T I M E
)
2022-04-03 09:52:53 +00:00
endif ( )
2022-08-24 14:49:33 +00:00
if ( NOT WIN32 AND NOT ANDROID AND NOT APPLE )
2017-03-18 00:58:05 +00:00
find_package ( KF5 ${ KF5_REQUIRED_VERSION } REQUIRED COMPONENTS
A c t i v i t i e s
)
2018-04-13 15:35:17 +00:00
set_package_properties ( "KF5Activities" PROPERTIES
D E S C R I P T I O N " A c t i v i t i e s i n t e r f a c e l i b r a r y "
U R L " h t t p s : / / a p i . k d e . o r g / f r a m e w o r k s / k a c t i v i t i e s / h t m l / "
P U R P O S E " R e q u i r e d f o r A c t i v i t i e s i n t e g r a t i o n . " )
2022-10-12 10:44:17 +00:00
find_package ( Qt5X11Extras REQUIRED )
set ( HAVE_X11 TRUE )
else ( )
set ( HAVE_X11 FALSE )
2017-03-18 00:58:05 +00:00
endif ( )
2023-06-21 15:50:58 +00:00
find_package ( Phonon4Qt5 CONFIG )
set_okular_optional_package_properties ( Phonon4Qt5 PROPERTIES
P U R P O S E " R e q u i r e d f o r d o c u m e n t s w i t h a u d i o o r v i d e o e l e m e n t s " )
2023-08-03 21:57:04 +00:00
if ( Phonon4Qt5_FOUND )
2023-06-21 15:50:58 +00:00
set ( HAVE_PHONON 1 )
else ( )
set ( HAVE_PHONON 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 )
2022-03-18 21:12:36 +00:00
find_package ( Poppler "22.02.0" COMPONENTS Qt5 )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( Poppler PROPERTIES
2018-03-20 23:30:22 +00:00
P U R P O S E " S u p p o r t f o r P D F f i l e s i n o k u l a r . " )
2022-03-25 13:28:10 +00:00
find_package ( Freetype )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( Freetype PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A f o n t r e n d e r i n g e n g i n e "
U R L " h t t p s : / / w w w . f r e e t y p e . o r g "
P U R P O S E " P r o v i d e s f r e e t y p e f o n t s u p p o r t i n t h e o k u l a r D V I g e n e r a t o r . " )
find_package ( TIFF )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( TIFF PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g a n d w r i t i n g T I F F f o r m a t t e d f i l e s , "
U R L " h t t p : / / w w w . l i b t i f f . o r g "
P U R P O S E " S u p p o r t f o r T I F F f i l e s i n o k u l a r . " )
find_package ( JPEG )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( JPEG PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g a n d w r i t i n g J P E G i m a g e f i l e s . "
U R L " h t t p s : / / w w w . i j g . o r g "
P U R P O S E " S u p p o r t f o r P a l m D B d o c u m e n t s i n o k u l a r . " )
set ( LIBSPECTRE_MINIMUM_VERSION "0.2" )
find_package ( LibSpectre "${LIBSPECTRE_MINIMUM_VERSION}" )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( LibSpectre PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A P o s t S c r i p t r e n d e r i n g l i b r a r y "
U R L " h t t p s : / / l i b s p e c t r e . f r e e d e s k t o p . o r g "
P U R P O S E " S u p p o r t f o r P S f i l e s i n o k u l a r . " )
find_package ( KF5KExiv2 CONFIG )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( KF5KExiv2 PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " W r a p p e r a r o u n d E x i v 2 l i b r a r y "
U R L " h t t p s : / / c o m m i t s . k d e . o r g / l i b k e x i v 2 "
2022-04-03 09:52:53 +00:00
P U R P O S E " S u p p o r t f o r e x i f r o t a t i o n i n i m a g e f i l e s . " )
2022-03-25 13:28:10 +00:00
find_package ( CHM )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( CHM PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A l i b r a r y f o r d e a l i n g w i t h M i c r o s o f t I T S S / C H M f o r m a t f i l e s "
U R L " h t t p : / / w w w . j e d r e a . c o m / c h m l i b "
P U R P O S E " S u p p o r t C H M f i l e s i n o k u l a r . " )
find_package ( KF5KHtml CONFIG )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( KF5KHtml PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " H T M L r e n d e r i n g l i b r a r y "
P U R P O S E " S u p p o r t C H M f i l e s i n o k u l a r . " )
find_package ( LibZip )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( LibZip PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g , c r e a t i n g , a n d m o d i f y i n g z i p a r c h i v e s "
U R L " h t t p s : / / l i b z i p . o r g / "
P U R P O S E " S u p p o r t C H M f i l e s i n o k u l a r . " )
2022-03-18 21:12:36 +00:00
find_package ( DjVuLibre "3.5.28" )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( DjVuLibre PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A l i b r a r y f o r d e a l i n g w i t h D j V u f o r m a t t e d f i l e s "
U R L " h t t p s : / / d j v u l i b r e . d j v u z o n e . o r g "
P U R P O S E " S u p p o r t f o r D j V u f i l e s i n o k u l a r . " )
find_package ( EPub )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( EPub PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g E P u b d o c u m e n t s "
U R L " h t t p : / / s o u r c e f o r g e . n e t / p r o j e c t s / e b o o k - t o o l s "
P U R P O S E " S u p p o r t f o r E P u b d o c u m e n t s i n O k u l a r . " )
find_package ( QMobipocket "2" CONFIG )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( QMobipocket PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g M o b i p o c k e t d o c u m e n t s "
U R L " h t t p s : / / c o m m i t s . k d e . o r g / k d e g r a p h i c s - m o b i p o c k e t "
P U R P O S E " S u p p o r t f o r M o b i p o c k e t d o c u m e n t s i n O k u l a r . " )
find_package ( Discount )
2022-04-03 09:52:53 +00:00
set_okular_optional_package_properties ( Discount PROPERTIES
2022-03-25 13:28:10 +00:00
D E S C R I P T I O N " A l i b r a r y t h a t g i v e s y o u f o r m a t t i n g f u n c t i o n s s u i t a b l e f o r m a r k i n g d o w n e n t i r e d o c u m e n t s o r l i n e s o f t e x t "
U R L " h t t p s : / / w w w . p e l l . p o r t l a n d . o r . u s / ~ o r c / C o d e / d i s c o u n t / "
P U R P O S E " S u p p o r t f o r M a r k d o w n d o c u m e n t s i n O k u l a r . " )
2014-09-10 20:30:35 +00:00
add_definitions ( -DTRANSLATION_DOMAIN= "okular" )
2022-03-18 21:12:36 +00:00
add_definitions ( -DQT_DEPRECATED_WARNINGS_SINCE=0x050F02 )
add_definitions ( -DKF_DEPRECATED_WARNINGS_SINCE=0x055C00 )
2014-08-09 14:05:30 +00:00
2020-12-02 17:57:49 +00:00
include_directories ( ${ CMAKE_CURRENT_SOURCE_DIR } ${ PHONON_INCLUDES } core/synctex ${ CMAKE_BINARY_DIR } /core )
2011-05-29 09:27:07 +00:00
2015-08-26 22:05:06 +00:00
option ( BUILD_COVERAGE "Build the project with gcov support" OFF )
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 ( )
2020-11-18 19:32:56 +00:00
add_subdirectory ( icons ) # an own directory for multi-size icons retrieved by KIconThemeLoader
add_subdirectory ( part )
2020-02-01 10:02:33 +00:00
if ( BUILD_DESKTOP )
add_subdirectory ( shell )
endif ( )
2014-08-09 10:47:33 +00:00
add_subdirectory ( generators )
2022-03-25 13:28:10 +00:00
if ( BUILD_MOBILE )
add_subdirectory ( mobile )
endif ( )
2018-07-09 05:37:58 +00:00
if ( BUILD_TESTING )
add_subdirectory ( 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
c o r e / a c t i o n . c p p
2006-06-03 09:22:26 +00:00
c o r e / a n n o t a t i o n s . c p p
c o r e / a r e a . c p p
2007-02-05 00:49:40 +00:00
c o r e / a u d i o p l a y e r . c p p
2006-12-27 16:04:49 +00:00
c o r e / b o o k m a r k m a n a g e r . c p p
2006-06-03 09:22:26 +00:00
c o r e / c h o o s e e n g i n e d i a l o g . c p p
c o r e / d o c u m e n t . c p p
2013-04-05 22:39:35 +00:00
c o r e / d o c u m e n t c o m m a n d s . c p p
2007-07-07 20:35:01 +00:00
c o r e / f o n t i n f o . c p p
2007-02-25 00:07:59 +00:00
c o r e / f o r m . c p p
2006-06-03 09:22:26 +00:00
c o r e / g e n e r a t o r . c p p
2007-04-20 17:17:44 +00:00
c o r e / g e n e r a t o r _ p . c p p
2007-01-03 14:30:48 +00:00
c o r e / m i s c . c p p
2008-08-23 00:07:59 +00:00
c o r e / m o v i e . c p p
2006-12-05 08:53:26 +00:00
c o r e / o b s e r v e r . c p p
2014-09-11 17:36:01 +00:00
c o r e / d e b u g . c p p
2006-06-03 09:22:26 +00:00
c o r e / p a g e . c p p
2007-03-24 10:47:22 +00:00
c o r e / p a g e c o n t r o l l e r . c p p
2007-01-05 23:12:06 +00:00
c o r e / p a g e s i z e . c p p
2006-06-03 09:22:26 +00:00
c o r e / p a g e t r a n s i t i o n . c p p
2006-11-03 17:57:32 +00:00
c o r e / r o t a t i o n j o b . c p p
2008-04-13 22:31:59 +00:00
c o r e / s c r i p t e r . c p p
2006-10-09 18:02:59 +00:00
c o r e / s o u n d . c p p
2007-01-02 17:45:32 +00:00
c o r e / s o u r c e r e f e r e n c e . c p p
2007-01-13 23:15:28 +00:00
c o r e / t e x t d o c u m e n t g e n e r a t o r . c p p
2013-05-18 11:57:46 +00:00
c o r e / t e x t d o c u m e n t s e t t i n g s . c p p
2006-06-03 09:22:26 +00:00
c o r e / t e x t p a g e . c p p
2012-07-07 17:40:52 +00:00
c o r e / t i l e s m a n a g e r . c p p
2006-06-30 21:42:41 +00:00
c o r e / u t i l s . c p p
2008-04-27 11:05:59 +00:00
c o r e / v i e w . c p p
2007-11-26 21:43:54 +00:00
c o r e / f i l e p r i n t e r . c p p
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
c o r e / p r i n t o p t i o n s w i d g e t . c p p
2019-01-05 22:30:25 +00:00
c o r e / s i g n a t u r e u t i l s . c p p
2018-02-21 22:54:16 +00:00
c o r e / s c r i p t / e v e n t . c p p
2014-10-08 22:17:53 +00:00
c o r e / s y n c t e x / s y n c t e x _ p a r s e r . c
c o r e / s y n c t e x / s y n c t e x _ p a r s e r _ u t i l s . c
2006-03-26 15:22:05 +00:00
)
2018-02-21 22:56:51 +00:00
qt5_add_resources ( okularcore_SRCS
c o r e / s c r i p t / b u i l t i n . q r c
)
2014-08-13 09:26:37 +00:00
ki18n_wrap_ui ( okularcore_SRCS
2020-11-18 19:32:56 +00:00
p a r t / t e x t d o c u m e n t s e t t i n g s . u i
2013-05-18 11:57:46 +00:00
)
2007-01-03 14:30:48 +00:00
install ( FILES
2007-04-20 11:26:05 +00:00
c o r e / a c t i o n . h
2007-01-03 14:30:48 +00:00
c o r e / a n n o t a t i o n s . h
c o r e / a r e a . h
c o r e / d o c u m e n t . h
2007-07-08 16:21:53 +00:00
c o r e / f o n t i n f o . h
2007-03-18 19:25:04 +00:00
c o r e / f o r m . h
2007-01-03 14:30:48 +00:00
c o r e / g e n e r a t o r . h
2007-04-22 10:23:59 +00:00
c o r e / g l o b a l . h
2007-01-03 14:30:48 +00:00
c o r e / p a g e . h
2007-01-05 23:12:06 +00:00
c o r e / p a g e s i z e . h
2007-01-03 14:30:48 +00:00
c o r e / p a g e t r a n s i t i o n . h
2019-01-05 22:30:25 +00:00
c o r e / s i g n a t u r e u t i l s . h
2007-01-03 14:30:48 +00:00
c o r e / s o u n d . h
c o r e / s o u r c e r e f e r e n c e . h
2007-01-13 23:15:28 +00:00
c o r e / t e x t d o c u m e n t g e n e r a t o r . h
2013-05-18 11:57:46 +00:00
c o r e / t e x t d o c u m e n t s e t t i n g s . h
2007-01-03 14:30:48 +00:00
c o r e / t e x t p a g e . h
2012-11-08 20:29:09 +00:00
c o r e / t i l e . h
2007-01-03 14:30:48 +00:00
c o r e / u t i l s . h
2007-11-26 21:43:54 +00:00
c o r e / f i l e p r i n t e r . 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
c o r e / p r i n t o p t i o n s w i d g e t . h
2013-02-24 21:58:53 +00:00
c o r e / o b s e r v e r . h
2015-04-09 19:59:40 +00:00
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c o r e / v e r s i o n . h
2015-04-15 23:54:32 +00:00
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c o r e / o k u l a r c o r e _ e x p o r t . h
2012-10-15 22:27:42 +00:00
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / s e t t i n g s _ c o r e . h
2015-03-04 06:52:20 +00:00
D E S T I N A T I O N $ { K D E _ I N S T A L L _ I N C L U D E D I R } / o k u l a r / c o r e C O M P O N E N T D e v e l )
2007-01-03 14:30:48 +00:00
install ( FILES
i n t e r f a c e s / c o n f i g i n t e r f a c e . h
i n t e r f a c e s / g u i i n t e r f a c e . h
i n t e r f a c e s / p r i n t i n t e r f a c e . h
2012-05-21 21:54:48 +00:00
i n t e r f a c e s / s a v e i n t e r f a c e . h
2011-09-10 17:15:52 +00:00
i n t e r f a c e s / v i e w e r i n t e r f a c e . h
2015-03-04 06:52:20 +00:00
D E S T I N A T I O N $ { K D E _ I N S T A L L _ I N C L U D E D I R } / o k u l a r / i n t e r f a c e s C O M P O N E N T D e v e l )
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
c o r e / c h o o s e e n g i n e w i d g e t . u i
2006-03-26 15:22:05 +00:00
)
2021-05-29 23:08:56 +00:00
kconfig_add_kcfg_files ( okularcore_SRCS GENERATE_MOC 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"
" < b u n d l e d f i l e = ' $ { K D E _ I N S T A L L _ P L U G I N D I R } / o k u l a r / g e n e r a t o r s ' / > \ n "
" < / d e p e n d s > < / l i b > < / d e p e n d e n c i e s > < / r u l e s > \ 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
P R I V A T E
2014-08-09 14:05:30 +00:00
$ { O K U L A R _ I O K I T }
2017-09-13 21:27:39 +00:00
$ { S H L W A P I }
2014-08-09 14:05:30 +00:00
K F 5 : : A r c h i v e
K F 5 : : K I O C o r e
2015-11-28 19:24:41 +00:00
K F 5 : : K I O W i d g e t s
K F 5 : : I 1 8 n
2014-08-09 14:05:30 +00:00
K F 5 : : T h r e a d W e a v e r
2015-11-28 19:24:41 +00:00
K F 5 : : B o o k m a r k s
2021-10-01 16:04:50 +00:00
Q t 5 : : S v g
2014-08-09 14:05:30 +00:00
$ { M A T H _ L I B }
2020-12-02 17:57:49 +00:00
Z L I B : : Z L I B
2015-04-14 19:04:26 +00:00
P U B L I C # these are included from the installed headers
K F 5 : : C o r e A d d o n s
K F 5 : : X m l G u i
K F 5 : : C o n f i g G u i
Q t 5 : : P r i n t S u p p o r t
Q t 5 : : W i d g e t s
2014-08-09 14:05:30 +00:00
)
2023-06-21 15:50:58 +00:00
if ( Phonon4Qt5_FOUND )
target_link_libraries ( okularcore PRIVATE Phonon::phonon4qt5 )
endif ( )
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 ( )
2023-05-20 14:51:09 +00:00
if ( TARGET Qt5::Qml )
2018-04-16 20:35:40 +00:00
target_sources ( okularcore PRIVATE
2023-06-22 15:40:50 +00:00
c o r e / s c r i p t / e x e c u t o r _ j s . c p p
c o r e / s c r i p t / j s _ a p p . c p p
c o r e / s c r i p t / j s _ c o n s o l e . c p p
c o r e / s c r i p t / j s _ d a t a . c p p
c o r e / s c r i p t / j s _ d i s p l a y . c p p
c o r e / s c r i p t / j s _ d o c u m e n t . c p p
c o r e / s c r i p t / j s _ f i e l d . c p p
c o r e / s c r i p t / j s _ f u l l s c r e e n . c p p
c o r e / s c r i p t / j s _ f i e l d . c p p
c o r e / s c r i p t / j s _ s p e l l . c p p
c o r e / s c r i p t / j s _ u t i l . c p p
c o r e / s c r i p t / j s _ e v e n t . c p p
c o r e / s c r i p t / j s _ o c g . c p p
2018-04-16 20:35:40 +00:00
)
2023-05-20 14:51:09 +00:00
target_link_libraries ( okularcore PRIVATE Qt5::Qml )
2018-04-16 20:35:40 +00:00
endif ( )
2023-08-05 11:11:43 +00:00
set_target_properties ( okularcore PROPERTIES VERSION 11.0.0 SOVERSION 11 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
2020-02-01 10:02:33 +00:00
if ( BUILD_DESKTOP )
# okularpart
set ( okularpart_SRCS
2022-01-26 16:27:42 +00:00
g u i / c e r t i f i c a t e m o d e l . c p p
g u i / d e b u g _ u i . c p p
g u i / g u i u t i l s . c p p
g u i / p a g e p a i n t e r . c p p
g u i / s i g n a t u r e g u i u t i l s . c p p
g u i / s i g n a t u r e m o d e l . c p p
g u i / t o c m o d e l . c p p
2020-11-18 19:32:56 +00:00
p a r t / p r e f e r e n c e s d i a l o g . c p p
p a r t / d l g a c c e s s i b i l i t y . c p p
p a r t / d l g d e b u g . c p p
p a r t / d l g e d i t o r . c p p
p a r t / d l g g e n e r a l . c p p
p a r t / d l g a n n o t a t i o n s . c p p
p a r t / d l g p e r f o r m a n c e . c p p
p a r t / d l g p r e s e n t a t i o n . c p p
p a r t / e d i t a n n o t t o o l d i a l o g . c p p
p a r t / e d i t d r a w i n g t o o l d i a l o g . c p p
p a r t / w i d g e t a n n o t t o o l s . c p p
p a r t / w i d g e t c o n f i g u r a t i o n t o o l s b a s e . c p p
p a r t / w i d g e t d r a w i n g t o o l s . c p p
p a r t / p a r t . c p p
p a r t / e x t e n s i o n s . c p p
p a r t / e m b e d d e d f i l e s d i a l o g . c p p
2020-09-28 05:44:26 +00:00
p a r t / a c t i o n b a r . c p p
2020-11-18 19:32:56 +00:00
p a r t / a n n o t a t i o n a c t i o n h a n d l e r . c p p
p a r t / a n n o t w i n d o w . c p p
p a r t / a n n o t a t i o n m o d e l . c p p
p a r t / a n n o t a t i o n p o p u p . c p p
p a r t / a n n o t a t i o n p r o p e r t i e s d i a l o g . c p p
p a r t / a n n o t a t i o n p r o x y m o d e l s . c p p
p a r t / a n n o t a t i o n t o o l s . c p p
p a r t / a n n o t a t i o n w i d g e t s . c p p
p a r t / b o o k m a r k l i s t . c p p
p a r t / c e r t i f i c a t e v i e w e r . c p p
2021-05-29 23:08:56 +00:00
p a r t / c o l o r m o d e m e n u . c p p
2021-03-25 12:22:19 +00:00
p a r t / c u r s o r w r a p h e l p e r . c p p
2020-11-18 19:32:56 +00:00
p a r t / d r a w i n g t o o l a c t i o n s . c p p
p a r t / f i l e p r i n t e r p r e v i e w . c p p
p a r t / f i n d b a r . c p p
p a r t / f o r m w i d g e t s . c p p
p a r t / k t r e e v i e w s e a r c h l i n e . c p p
p a r t / l a t e x r e n d e r e r . c p p
p a r t / m i n i b a r . c p p
p a r t / o k m e n u t i t l e . c p p
p a r t / p a g e i t e m d e l e g a t e . c p p
p a r t / p a g e s i z e l a b e l . c p p
p a r t / p a g e v i e w a n n o t a t o r . c p p
p a r t / p a g e v i e w m o u s e a n n o t a t i o n . c p p
p a r t / p a g e v i e w . c p p
p a r t / m a g n i f i e r v i e w . c p p
p a r t / p a g e v i e w u t i l s . c p p
p a r t / p r e s e n t a t i o n s e a r c h b a r . c p p
p a r t / p r e s e n t a t i o n w i d g e t . c p p
p a r t / p r o p e r t i e s d i a l o g . c p p
p a r t / r e v i s i o n v i e w e r . c p p
p a r t / s e a r c h l i n e e d i t . c p p
p a r t / s e a r c h w i d g e t . c p p
p a r t / s i d e b a r . c p p
p a r t / s i d e _ r e v i e w s . c p p
p a r t / s n a p s h o t t a k e r . c p p
p a r t / t h u m b n a i l l i s t . c p p
p a r t / t o c . c p p
p a r t / t o g g l e a c t i o n m e n u . c p p
p a r t / v i d e o w i d g e t . c p p
p a r t / l a y e r s . c p p
2022-01-26 16:27:42 +00:00
p a r t / s i g n a t u r e p a r t u t i l s . c p p
2020-11-18 19:32:56 +00:00
p a r t / s i g n a t u r e p r o p e r t i e s d i a l o g . c p p
p a r t / s i g n a t u r e p a n e l . c p p
2020-02-01 10:02:33 +00:00
)
2023-04-19 11:36:13 +00:00
ki18n_wrap_ui ( okularpart_SRCS part/selectcertificatedialog.ui )
2006-03-26 12:19:40 +00:00
2014-11-08 04:33:23 +00:00
if ( Qt5TextToSpeech_FOUND )
set ( okularpart_SRCS ${ okularpart_SRCS }
2020-11-18 19:32:56 +00:00
p a r t / t t s . c p p )
2014-11-08 04:33:23 +00:00
endif ( )
2020-10-24 15:53:01 +00:00
kconfig_add_kcfg_files ( okularpart_SRCS GENERATE_MOC 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
$ { M A T H _ L I B }
Q t 5 : : S v g
K F 5 : : A r c h i v e
2016-07-15 19:05:38 +00:00
K F 5 : : B o o k m a r k s
2016-07-21 19:53:54 +00:00
K F 5 : : I 1 8 n
2016-07-11 17:40:49 +00:00
K F 5 : : I c o n T h e m e s
2016-07-17 00:28:57 +00:00
K F 5 : : I t e m V i e w s
2016-08-03 14:01:30 +00:00
K F 5 : : K I O C o r e
K F 5 : : K I O F i l e W i d g e t s
K F 5 : : K I O W i d g e t s
2016-07-11 17:40:49 +00:00
K F 5 : : P a r t s
K F 5 : : S o l i d
K F 5 : : W i n d o w S y s t e m
2021-04-26 11:49:43 +00:00
K F 5 : : T e x t W i d g e t s
2016-07-11 17:40:49 +00:00
)
2023-07-03 14:52:44 +00:00
if ( TARGET Qt5::DBus )
target_link_libraries ( okularpart Qt5::DBus )
endif ( )
2023-06-21 15:50:58 +00:00
if ( Phonon4Qt5_FOUND )
target_link_libraries ( okularpart Phonon::phonon4qt5 )
endif ( )
2016-07-11 17:40:49 +00:00
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 ( )
2023-07-18 11:55:48 +00:00
# TODO: Don't install okular_part.desktop once we are kf6 based
#instead install the part to this path so it can be found
#install(TARGETS okularpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/parts/ )
2015-03-04 06:52:20 +00:00
install ( TARGETS okularpart DESTINATION ${ KDE_INSTALL_PLUGINDIR } )
2023-07-18 11:55:48 +00:00
install ( FILES okular_part.desktop DESTINATION ${ KDE_INSTALL_KSERVICES5DIR } )
endif ( ) # End of BUILD_DESKTOP if
2006-03-26 12:19:40 +00:00
########### install files ###############
Overhaul annotations UX
Create a new new annotation toolbar to replace the current one as discussed in the task T8076.
Fixes:
BUG: 386578
BUG: 374728
BUG: 352310
BUG: 330518
BUG: 341914
BUG: 157289
BUG: 358057
BUG: 412767
BUG: 413595
BUG: 420462
FIXED-IN: 1.11.0
Test Plan
Before testing this revision
Delete or Temporary move aside the following files:
~/.config/okularpartrc
~/.config/okularrc
~/.local/share/kxmlgui5/okular/part.rc
~/.local/share/kxmlgui5/okular/shell.rc
Nomenclature
Actions in the main toolbar:
Quick annotations
Actions in the annotation toolbar:
Annotation actions Highlighter, Underline, Squiggle, Strike out, Typewriter,
Inline note, Popup note, Freehand line, Arrow, Straight line, Rectangle, Ellipse,
Polygon, Stamp
Annotation config actions Line width, Color, Inner color, Opacity, Font, Annotation settings
Other actions Add to Quick Annotations, Pin
Autotests
First run: annotation toolbar is not visible
Selecting Tools > Annotations shows the annotation toolbar (below the main toolbar by default)
Select an annotation > toolbar is shown
Select a quick annotation > toolbar is shown
Hide action (red cross) on the toolbar hides the toolbar
Keys 1-9,0 select the (builtin) Annotation actions (one case tested)
Keys Alt+1-9,0 select the quick annotation actions (one case tested)
No annotation action selected: Quick Annotations is enabled, Add to quick annotations is disabled, Annotation config actions are disabled, Pin is enabled
The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled (also in Quick annotations)
The current document is protected: All actions are disabled
Select annotation: the Annotation config actions are enabled and their values set to the ones for the current annotation (taken from okularpartrc)
Click an annotation action when none selected: browse mode is selected
Click the currently selected annotation action: the action is unchecked and the tool disabled (back to browse mode)
Click ESC: the currently selected annotation action is unchecked
If Pin unchecked the selected annotation is unchecked after it has be used once and we are back to Browse mode
The annotation systems works when multiple Okular tabs are open (the selected annotation is per-tab)
Manual tests
(TODO) Check that kconf_update updates the key AnnotationTools to QuickAnnotationTools in ~/.config/okularpartrc
Color icon is a format-text-color (if inline note or typewriter) or format-stroke-color for all other annotations
All actions have tooltips (some change based on the fact that the icon is enabled or not)
If a custom Line Width or Opacity is set through the Annotation Settings dialog, its value appears as a new checked action in the Line width or Opacity menu
If a custom stamp is selected through the Annotation Settings dialog, its name or filename (without path) appears as a new checked action in the Stamp menu
In Configure Okular > Annotations it is only possible to configure the quick annotations. Modifying them here updates the Quick annotations list after clicking Apply
The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled in Quick annotations
The state of Pin action is remembered across Okular launches
Selecting a quick action selects the corresponding action and loads its config values (color, line width, ...)
Setting the color and fill color works for all annotations (to be tested carefully, can be problematic for typewriter and inline note given the different internal mechanism to store the color in the settings)
Test stamp annotation (handled differently from the rest of the annotations)
Merge Request: https://invent.kde.org/graphics/okular/-/merge_requests/105
2020-06-04 13:01:31 +00:00
install ( FILES okular.upd DESTINATION ${ KDE_INSTALL_KCONFUPDATEDIR } )
2020-11-18 19:32:56 +00:00
install ( FILES part/part.rc part/part-viewermode.rc DESTINATION ${ KDE_INSTALL_KXMLGUI5DIR } /okular )
2022-10-21 10:47:53 +00:00
install ( FILES okular.categories DESTINATION ${ KDE_INSTALL_LOGGINGCATEGORIESDIR } )
2016-01-03 08:13:06 +00:00
2022-05-22 10:00:39 +00:00
ki18n_install ( po )
if ( KF5DocTools_FOUND )
kdoctools_install ( po )
endif ( )
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
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / O k u l a r 5 C o n f i g . c m a k e . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / O k u l a r 5 C o n f i g . c m a k e "
2015-04-09 19:59:40 +00:00
I N S T A L L _ D E S T I N A T I O N $ { C M A K E C O N F I G _ I N S T A L L _ D I R }
P A T H _ V A R S I N C L U D E _ I N S T A L L _ D I R C M A K E _ I N S T A L L _ P R E F I X
)
install ( FILES
2015-07-18 15:28:05 +00:00
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / O k u l a r 5 C o n f i g . c m a k e "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / O k u l a r 5 C o n f i g V e r s i o n . c m a k e "
2015-04-09 19:59:40 +00:00
D E S T I N A T I O N " $ { C M A K E C O N F I G _ I N S T A L L _ D I R } "
C O M P O N E N T D e v e l
)
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
2021-10-01 16:04:50 +00:00
install ( FILES
c o r e / s t a m p s . s v g
D E S T I N A T I O N $ { K D E _ I N S T A L L _ D A T A D I R } / o k u l a r / p i c s )
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
2020-02-13 09:47:51 +00:00
message ( "-- Building Desktop User Interface: ${BUILD_DESKTOP}" )
2020-02-01 10:02:33 +00:00
message ( "-- Building Mobile Interface: ${BUILD_MOBILE}" )
message ( "" )