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
2023-11-07 19:50:17 +00:00
set ( RELEASE_SERVICE_VERSION_MAJOR "24" )
2024-04-21 10:11:44 +00:00
set ( RELEASE_SERVICE_VERSION_MINOR "07" )
2024-01-11 20:17:25 +00:00
set ( RELEASE_SERVICE_VERSION_MICRO "70" )
2019-12-10 16:39:40 +00:00
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
2023-12-15 13:06:21 +00:00
set ( QT_REQUIRED_VERSION "6.6.0" ) # Remember to update the QT_DEPRECATED_WARNINGS_SINCE below
set ( KF_REQUIRED_VERSION "5.240.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')" )
2024-01-07 19:29:27 +00:00
set ( FORCE_NOT_REQUIRED_DEPENDENCIES "" CACHE STRING "List (semicolon-separated) of dependencies that will be downgraded from REQUIRED to RECOMMENDED" )
2022-04-03 09:52:53 +00:00
2023-12-05 14:02:58 +00:00
find_package ( ECM ${ KF_REQUIRED_VERSION } CONFIG REQUIRED )
set ( CMAKE_MODULE_PATH ${ CMAKE_MODULE_PATH } ${ ECM_MODULE_PATH } )
include ( ECMInstallIcons )
include ( ECMSetupVersion )
include ( ECMOptionalAddSubdirectory )
include ( GenerateExportHeader )
include ( FeatureSummary )
include ( ECMAddAppIcon )
include ( KDECompilerSettings NO_POLICY_SCOPE )
include ( KDEInstallDirs )
include ( KDECMakeSettings )
include ( ECMAddTests )
include ( ECMAddAppIcon )
include ( CMakePackageConfigHelpers )
include ( ECMSetupQtPluginMacroNames )
2024-04-29 16:14:09 +00:00
include ( ECMAddAndroidApk )
2023-12-05 14:02:58 +00:00
2024-01-09 10:09:42 +00:00
if ( ANDROID AND ( FORCE_NOT_REQUIRED_DEPENDENCIES STREQUAL "" ) )
2024-02-08 13:31:59 +00:00
set ( FORCE_NOT_REQUIRED_DEPENDENCIES "KF6Wallet;KF6DocTools;Qt6Qml;TIFF;LibSpectre;KExiv2Qt6;CHM;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 ( )
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 "
2023-12-15 14:54:51 +00:00
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 6 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-09-22 13:16:47 +00:00
find_package ( Qt6 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS Core Test Widgets PrintSupport Svg Xml )
2019-10-25 15:06:59 +00:00
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
2023-09-22 13:40:51 +00:00
find_package ( KF6 ${ KF_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
2023-12-07 16:24:47 +00:00
X m l G u i
2014-08-09 14:05:30 +00:00
)
2018-04-16 20:35:40 +00:00
2023-12-15 14:42:22 +00:00
if ( NOT WIN32 )
find_package ( KF6Wallet ${ KF_REQUIRED_VERSION } )
set_okular_optional_package_properties ( KF6Wallet 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 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 . " )
2023-12-15 14:42:22 +00:00
endif ( )
2023-09-22 13:40:51 +00:00
if ( KF6Wallet_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
2023-09-22 13:40:51 +00:00
find_package ( KF6DocTools ${ KF_REQUIRED_VERSION } )
set_okular_optional_package_properties ( KF6DocTools 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 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-12-15 13:06:21 +00:00
find_package ( Qt6Qml )
set_okular_optional_package_properties ( Qt6Qml 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-12-15 13:06:21 +00:00
if ( TARGET Qt6::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 )
2024-05-27 07:49:06 +00:00
if ( UNIX AND NOT APPLE AND NOT ANDROID )
find_package ( Qt6DBus )
set_okular_optional_package_properties ( Qt6DBus 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 . " )
set ( HAVE_DBUS ${ Qt6DBus_FOUND } )
2023-07-03 14:52:44 +00:00
else ( )
set ( HAVE_DBUS 0 )
endif ( )
2024-05-27 07:49:06 +00:00
2024-02-26 23:11:15 +00:00
find_package ( KF6 ${ KF_REQUIRED_VERSION } REQUIRED COMPONENTS Parts ColorScheme Crash IconThemes ItemViews TextWidgets WidgetsAddons )
2022-04-03 09:52:53 +00:00
2023-09-22 13:40:51 +00:00
find_package ( KF6Purpose )
set_okular_optional_package_properties ( KF6Purpose PROPERTIES
2022-04-03 09:52:53 +00:00
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 . " )
2023-09-22 13:40:51 +00:00
if ( KF6Purpose_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 ( )
2023-12-15 13:06:21 +00:00
find_package ( Qt6TextToSpeech ${ QT_REQUIRED_VERSION } CONFIG )
set_okular_optional_package_properties ( Qt6TextToSpeech PROPERTIES
2022-04-03 09:52:53 +00:00
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 . " )
2023-12-15 13:06:21 +00:00
if ( Qt6TextToSpeech_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-12-15 13:06:21 +00:00
find_package ( Qt6 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS Qml Quick )
2023-09-22 13:40:51 +00:00
find_package ( KF6Kirigami2 )
set_package_properties ( KF6Kirigami2 PROPERTIES
2022-04-03 09:52:53 +00:00
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-09-22 13:40:51 +00:00
find_package ( KF6KirigamiAddons )
set_package_properties ( KF6KirigamiAddons PROPERTIES
2023-08-09 21:41:15 +00:00
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 )
2023-12-15 13:11:48 +00:00
find_package ( Qt6Gui REQUIRED COMPONENTS Private )
2023-12-05 13:32:22 +00:00
find_package ( PlasmaActivities REQUIRED )
set_package_properties ( "PlasmaActivities" 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 : / / i n v e n t . k d e . o r g / p l a s m a / p l a s m a - a c t i v i t i e s "
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
set ( HAVE_X11 TRUE )
else ( )
set ( HAVE_X11 FALSE )
2017-03-18 00:58:05 +00:00
endif ( )
2023-12-15 13:06:21 +00:00
find_package ( Phonon4Qt6 CONFIG )
set_okular_optional_package_properties ( Phonon4Qt6 PROPERTIES
2023-06-21 15:50:58 +00:00
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-12-15 13:06:21 +00:00
if ( Phonon4Qt6_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 )
2023-12-15 13:06:21 +00:00
find_package ( Poppler "22.02.0" COMPONENTS Qt6 )
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 . " )
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 . " )
2023-12-05 13:32:22 +00:00
find_package ( KExiv2Qt6 CONFIG )
set_okular_optional_package_properties ( KExiv2Qt6 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
2023-09-22 13:40:32 +00:00
if ( FALSE ) # Investigate porting at some point
find_package ( CHM )
set_okular_optional_package_properties ( CHM PROPERTIES
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 . " )
2022-03-25 13:28:10 +00:00
2023-09-22 13:40:32 +00:00
endif ( )
2022-03-25 13:28:10 +00:00
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 . " )
2023-09-22 13:40:51 +00:00
find_package ( QMobipocket6 "2" CONFIG )
set_okular_optional_package_properties ( QMobiPocket6 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" )
2023-12-18 07:31:50 +00:00
add_definitions ( -DQT_DEPRECATED_WARNINGS_SINCE=0x060600 )
add_definitions ( -DKF_DEPRECATED_WARNINGS_SINCE=0x05F000 )
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
2023-09-22 13:40:51 +00:00
if ( KF6DocTools_FOUND )
2018-04-16 20:35:40 +00:00
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
)
2023-09-22 13:41:57 +00:00
qt_add_resources ( okularcore_SRCS
2018-02-21 22:56:51 +00:00
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" )
2023-12-11 23:42:08 +00:00
target_include_directories ( okularcore PUBLIC "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}>" )
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 }
2023-09-22 13:40:51 +00:00
K F 6 : : A r c h i v e
K F 6 : : K I O C o r e
K F 6 : : K I O W i d g e t s
K F 6 : : I 1 8 n
K F 6 : : T h r e a d W e a v e r
2023-12-05 13:43:08 +00:00
K F 6 : : B o o k m a r k s W i d g e t s
2023-09-22 13:40:51 +00:00
K F 6 : : B o o k m a r k s
2023-12-15 13:06:21 +00:00
Q t 6 : : 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
2023-09-22 13:40:51 +00:00
K F 6 : : C o r e A d d o n s
K F 6 : : X m l G u i
K F 6 : : C o n f i g G u i
2023-12-15 13:06:21 +00:00
Q t 6 : : P r i n t S u p p o r t
Q t 6 : : W i d g e t s
2014-08-09 14:05:30 +00:00
)
2023-12-15 13:06:21 +00:00
if ( Phonon4Qt6_FOUND )
target_link_libraries ( okularcore PRIVATE Phonon::phonon4qt6 )
2023-06-21 15:50:58 +00:00
endif ( )
2006-06-12 21:58:24 +00:00
2018-04-16 20:35:40 +00:00
2023-09-22 13:40:51 +00:00
if ( KF6Wallet_FOUND )
target_link_libraries ( okularcore PRIVATE KF6::Wallet )
2018-04-16 20:35:40 +00:00
endif ( )
2023-12-15 13:06:21 +00:00
if ( TARGET Qt6::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-12-15 13:06:21 +00:00
target_link_libraries ( okularcore PRIVATE Qt6::Qml )
2018-04-16 20:35:40 +00:00
endif ( )
2024-01-23 23:01:39 +00:00
set_target_properties ( okularcore PROPERTIES VERSION 1.0.0 SOVERSION 1 OUTPUT_NAME Okular6Core EXPORT_NAME Core )
2007-04-20 16:12:05 +00:00
2023-12-15 14:54:51 +00:00
install ( TARGETS okularcore EXPORT Okular6Targets ${ 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 } )
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
2023-09-09 16:44:37 +00:00
p a r t / p a r t . q r c
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
2023-12-15 13:06:21 +00:00
if ( Qt6TextToSpeech_FOUND )
2014-11-08 04:33:23 +00:00
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 }
2023-12-15 13:06:21 +00:00
Q t 6 : : S v g
2023-09-22 13:40:51 +00:00
K F 6 : : A r c h i v e
K F 6 : : B o o k m a r k s
K F 6 : : I 1 8 n
K F 6 : : I c o n T h e m e s
K F 6 : : I t e m V i e w s
K F 6 : : K I O C o r e
K F 6 : : K I O W i d g e t s
K F 6 : : P a r t s
K F 6 : : W i n d o w S y s t e m
K F 6 : : T e x t W i d g e t s
2016-07-11 17:40:49 +00:00
)
2023-12-15 13:06:21 +00:00
if ( TARGET Qt6::DBus )
target_link_libraries ( okularpart Qt6::DBus )
2023-07-03 14:52:44 +00:00
endif ( )
2023-12-15 13:06:21 +00:00
if ( Phonon4Qt6_FOUND )
target_link_libraries ( okularpart Phonon::phonon4qt6 )
2023-06-21 15:50:58 +00:00
endif ( )
2016-07-11 17:40:49 +00:00
2023-09-22 13:40:51 +00:00
if ( KF6Wallet_FOUND )
target_link_libraries ( okularpart KF6::Wallet )
2018-04-16 20:35:40 +00:00
endif ( )
2023-09-22 13:40:51 +00:00
if ( KF6Purpose_FOUND )
target_link_libraries ( okularpart KF6::PurposeWidgets )
2017-10-11 15:45:02 +00:00
endif ( )
2016-03-16 09:57:34 +00:00
set_target_properties ( okularpart PROPERTIES PREFIX "" )
2024-01-12 08:43:16 +00:00
set_target_properties ( okularpart PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${ CMAKE_LIBRARY_OUTPUT_DIRECTORY } /kf6/parts )
2006-03-26 12:19:40 +00:00
2023-12-15 13:06:21 +00:00
if ( Qt6TextToSpeech_FOUND )
target_link_libraries ( okularpart Qt6::TextToSpeech )
2014-11-08 04:33:23 +00:00
endif ( )
2023-07-18 11:55:48 +00:00
#instead install the part to this path so it can be found
2024-01-05 14:18:23 +00:00
install ( TARGETS okularpart DESTINATION ${ KDE_INSTALL_PLUGINDIR } /kf6/parts/ )
2023-07-18 11:55:48 +00:00
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 } )
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 )
2023-09-22 13:40:51 +00:00
if ( KF6DocTools_FOUND )
2022-05-22 10:00:39 +00:00
kdoctools_install ( po )
endif ( )
2010-09-26 17:31:31 +00:00
########### cmake files #################
2023-12-15 14:54:51 +00:00
set ( CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Okular6" )
2017-09-05 08:58:58 +00:00
configure_package_config_file (
2023-12-15 14:54:51 +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 6 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 6 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 }
2023-09-22 13:18:13 +00:00
P A T H _ V A R S K D E _ I N S T A L L _ I N C L U D E D I R C M A K E _ I N S T A L L _ P R E F I X
2015-04-09 19:59:40 +00:00
)
install ( FILES
2023-12-15 14:54:51 +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 6 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 6 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
)
2023-12-15 14:54:51 +00:00
install ( EXPORT Okular6Targets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE Okular6Targets.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 ( "" )