Commit graph

190 commits

Author SHA1 Message Date
Albert Astals Cid e2ac1dcd1e PDF: Fix memory leak when the file has Optional Content links 2022-01-04 16:42:35 +00:00
Albert Astals Cid d6870ae2ff Remove deprecated Generator::documentMetaData 2021-12-29 18:49:56 +01:00
Albert Astals Cid a2576dc746 Act on core/ TODOs that are not binary compatible
I'm going to need to break binary compatibility to add a new feature
so may as well cleanup all the TODOs regarding that

Changes:
 * Moving a few destructors to the header
 * Removing a few unnecessary & in params
 * Adding a few necessary & in params
 * Making print return an enum instead of a bool and then having another
   function that returns the enum
 * Make Generator::requestFontData be a virtual
 * Remove unused enum
 * Remove a few filePrinter unneeded functions
 * Remove unused TextDocumentGenerator::addMetaData signal
2021-12-29 09:35:25 +00:00
Alexander Lohnau ac083e44e3 Make meaning of sponsoring note more clear 2021-06-10 08:11:56 +00:00
Alexander Lohnau 24c75071be Move sponsoring note outside of SPDX-FileCopyrightText statement 2021-06-10 08:11:56 +00:00
Alexander Lohnau 2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +00:00
Oliver Sander ccda6d2a65 Remove device pixel ratio scaling from PixmapRequest
The PixmapRequest constructor expected width and height in logical
pixels, and scaled them to device pixels.  However, not knowing what
screen the request is for, it had to use qApp->devicePixelRatio()
for the scaling.  That value may not be correct if not all screens
use the same scaling.

Fix this by introducing a new constructor that takes the device
pixel ratio as an additional argument, and deprecating the old
constructor.
2021-03-08 00:23:11 +01:00
Albert Astals Cid 9728d8b426 We don't do getFoo in Okular API 2020-12-13 21:31:14 +00:00
Albert Astals Cid 18ef1349f1 Improvements to adding digital signatures
* Don't make WidgetAnnotation know about signatures stuff, widget
   annotations are for multiple things
 * Don't create an "empty" widget annotation and then call sign on it
   (which is wrong because widget annotations can be multiple things),
   just say sign the document with this data (cert, l&f, etc)
 * Remove the "management" functionality from CertificateTools it was
   only visual, i.e. it didn't really add/remove certificates
 * Ask for the NSS password (if needed)
2020-12-13 21:31:14 +00:00
Albert Astals Cid b09e23f6ab Run clang-format
Attempting to fix the whole chain of commits is not worth it
2020-12-13 21:31:14 +00:00
Thorsten Behrens b96dac6df3 Add certificate store for access to NSS keys
WIP - add interfaces and methods to get access to NSS-via-poppler
sign certificates, and provide them for signing documents.
2020-12-13 21:31:14 +00:00
Thorsten Behrens e031822744 Adapt to poppler sign api change
Now poppler offers signing via PDFConverter class. Add some error
handling, and store signature in temp file. Document gets reloaded
after replacing original file.
2020-12-13 21:31:14 +00:00
Katarina Behrens cc908b9f92 Pass pointer to widget annotation just added down the chain 2020-12-13 21:31:14 +00:00
Katarina Behrens d320fa17ad Stub some iface for signing the document 2020-12-13 21:31:14 +00:00
Albert Astals Cid 19d98d6a74 Run clang-format
find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format -i {} \;

If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
2020-07-11 09:17:33 +02:00
Albert Astals Cid bd57b36c83 Add TODO for the future to fix requestFontData function 2020-07-11 07:50:05 +02:00
Laurent Montel 516fb89d94 Use camelcase include. (scripted) 2020-07-08 13:54:37 +02:00
Albert Astals Cid 93540ac16d Enable most of clazy level2 2020-02-21 14:57:48 +01:00
Albert Astals Cid 91bce4a0a3 Enable clazy const-signal-or-slot 2020-02-20 12:42:23 +01:00
Albert Astals Cid 0a2287be19 CI: Enable two readability clang-tidy checks
Use jq to filter compile_commands.json to not include the compilation of
autogenerated files, we don't want to check those

Also filter out the synctex folder, since that is imported code
2019-12-23 12:06:49 +01:00
Albert Astals Cid c549acaab0 Move the Q_PRIVATE_SLOTS to lambda connections
Some of the invokeMethods with a queued connection get changed with a
QTimer::SingleShot with 0 which has the same behaviour
2019-12-20 16:42:58 +01:00
Albert Astals Cid 78cf6bd910 CI: enable more modernize checks
Since unfortunately some of the autogenerated includes don't pass the
checks we do a trick of building out of source and then specifying the
.*/okular/.* path as the only includes we care about
2019-12-18 12:51:13 +01:00
Laurent Montel 563c8b3465 Fix spectre genrator after my clean forward 2019-06-04 07:12:42 +02:00
Laurent Montel 9f90e14dd1 Fix forward declaration 2019-06-03 08:48:32 +02:00
Yuri Chornoivan 3832a6522f Update Okular developer documentation
Differential Revision: https://phabricator.kde.org/D17801
2019-02-07 08:13:11 +02:00
Albert Astals Cid 7254c1826c K_PLUGIN_FACTORY_WITH_JSON -> K_PLUGIN_CLASS_WITH_JSON
Now that we require KF5 5.44
2019-01-07 00:56:08 +01:00
Yuri Chornoivan 6102c65d6e Minor fixes to API docs 2018-11-20 19:43:11 +02:00
Yuri Chornoivan 5478b2ec92 Fix minor typos 2018-11-14 21:12:15 +02:00
Yuri Chornoivan 2f014ccd20 Fix minor EBN issues 2018-10-18 22:04:49 +03:00
Yuri Chornoivan 39b6e8147d Fix minor EBN issues 2018-09-01 11:25:57 +03:00
Yuri Chornoivan c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Albert Astals Cid 2d8b2c7e95 Add support for cancellable image rendering and text extraction
Summary:
Only supported by the pdf backend if using poppler >= 0.63

Sadly had to change the generator API

Text cancellation is a bit wobbly still since poppler has large parts
of the code where doesn't check for the cancellation flag, but that
is something that will get automagically fixed for us if the poppler
side is improved

Test Plan: Needs https://bugs.freedesktop.org/show_bug.cgi?id=104263

Reviewers: ervin, rkflx

Reviewed By: ervin, rkflx

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9328
2018-02-01 22:53:28 +01:00
Albert Astals Cid 3957683d76 Merge branch 'dont-use-docdata-for-annots-and-forms' into Applications/17.12 2017-11-16 15:00:23 +01:00
Albert Astals Cid 19b7e3c112 The work in this branch was sponsored by LiMux
give them some credit in the headers
2017-11-16 09:58:31 +01:00
Albert Astals Cid e29892fda4 some review tweaks 2017-11-15 11:20:25 +01:00
Albert Astals Cid a2f5560c00 PDF: Support the poppler 0.62 renderToImage with update callback
Summary:
This way pages that take more than 500ms to render get updated every so often so that the
user can see that the program didn't hang, it's just that it's taking long to render

Tags:
incremental rendering, partial updates

BUGS: 344081

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8379
2017-11-09 17:28:54 +01:00
Albert Astals Cid 099d3cfcc8 Update @since to 1.3
Let's see if we can squeeze it in
2017-11-06 06:10:13 +01:00
Albert Astals Cid ca5422d0e9 Implement swapBackingFile for the PDF backend
How does it work:
 * What it does is really closing and opening the file again through poppler
 * This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
	* For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
		* Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
	* For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
	* The annotationmodel needs updating it's pointers
	* The widgets for the forms are reused and their form* updated
	* the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)

TODO: Make this work for .okular files
TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
TODO: autotests
2017-10-26 15:30:44 +02:00
Albert Astals Cid 04ed10d3ea Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-09-11 19:51:51 +02:00
Albert Astals Cid 1d2dd42c67 no need for & here 2017-03-02 22:45:45 +01:00
Albert Astals Cid 519f0acac7 document which variant kind is returned 2017-03-02 22:23:41 +01:00
Albert Astals Cid ec70995895 QString as key is evil, add a nice enum 2017-03-02 21:04:59 +01:00
Albert Astals Cid b50aff3ed7 Q_NULLPTR -> nullptr 2017-03-02 20:09:32 +01:00
Albert Astals Cid 2868e3e5ca Support SetOCGState links
Needs a very recent poppler

BUGS: 368402
REVIEW: 129216
2016-11-26 16:00:46 +01:00
Alex Richardson 2f9246ae42 Port to new JSON plugin loading system
This means Okular can now work without ksycoca and KDELibs4Support.

REVIEW: 126193
2016-01-04 15:59:07 +01:00
Albert Astals Cid 8445660539 Merge remote-tracking branch 'origin/master' into frameworks 2015-10-18 22:29:00 +02:00
Albert Astals Cid 1cd101b480 Small cleanup of the layer support feature
Tab replacing, function naming, include removal, @since addition, etc
2015-09-15 01:38:09 +02:00
Montel Laurent 6fab218de9 Use Q_NULLPTR 2015-08-18 15:12:07 +02:00
Saheb Preet Singh bf673495fb added layers on the left sidebar 2015-05-27 19:26:56 +05:30
Montel Laurent 5da7c5f77d port to qCDebug. Autogenerate export headers 2014-10-27 22:35:06 +01:00