Commit graph

34 commits

Author SHA1 Message Date
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 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 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 2ca1779feb Add a way to get the PagePrivate if you have the Page 2017-03-03 00:32:08 +01:00
Fabio D'Urso e059d2652c core: support for migration of annots and forms out of docdata/ 2014-09-10 12:18:34 +02:00
Fabio D'Urso 57c9cae257 Don't save form contents to docdata/
But existing saved form from previous Okular versions are preserved
2014-05-11 18:52:15 +02:00
Michal Humpula c07ee043a3 Multiple Tiles Managers per Page
It's straighforward implementation. Every single place, where there were call for (or with) TilesManager, now has a DocumentObserver as companion. The m_tiledManager reference in PagePrivate was changed to QMap<DocumentObserver, TilesManager>.

REVIEW: 113986
2014-02-19 23:41:22 +01:00
Albert Astals Cid 541650a4f4 Remove the concept of observer/view id
Just use the pointer as id :-)

This is BIC and SIC, increase the soversion now to makes sure we don't forget in the future

Patch based in an earlier patch by Bogdan Cristea <cristeab@gmail.com>
REVIEW: 109115
2013-02-24 23:01:02 +01:00
Mailson Menezes f56c5a8ac9 Merge branch 'master' into tiled-rendering 2012-11-08 20:51:01 -03:00
Fabio D'Urso 437ddad588 Hide tiles manager within okularcore
Only the Tile class (tile.h) is visible from the outside
2012-11-08 20:26:17 -03:00
Fabio D'Urso e12966b259 Removed possibility to have a tiles manager per observer
Now only the PageView can have a tiles manager.
2012-11-08 20:52:01 +01:00
Jan Binder aa6ed8afc0 Replace deprecated QMatrix by QTransform
REVIEW: 105737
2012-09-08 17:06:02 +02:00
Mailson Menezes 0053b9c015 Remove unused property from PixmapObject
This property was added before the tiles manager was created.
2012-08-24 14:02:07 -03:00
Mailson Menezes 851a503e81 Move tiles manager to a private header 2012-08-17 15:23:58 -03:00
Mailson Menezes 3c09b93713 Merge branch 'master' into tiled-rendering
Conflicts:
	core/document.cpp
2012-08-15 11:44:22 -03:00
Mailson Menezes 9f3cf45e37 Rendering with a tiles manager
Currently it's only available for PDFs and does not support rotation.
2012-07-08 18:08:38 -03:00
Fabio D'Urso 86c92ffec2 Fixes against causes of annotation data loss + Improved GUI message logic
1) If the user had previously annotated the document with an old okular
version and the document contains existing annotations and no /Encrypt
(ie the case where annotation changes are no longer saved locally), make
Document::saveDocumentInfo write the original unmodified local
annotations back to XML, so that it seems that the original file was not
changed. If the user makes annotation changes, code from previous
patches already asks him to save them to a different document on close.

2) Ask "Save changes?" if the user has modified annotations in a .okular
archive.
BUG: 300197

3) Turned a "sorry" message in a "information" (with dontshowthisagain),
because now we also have the "Save changes?" prompt to inform the user.

4) Suppressed all annotation-related message boxes on document opening
2012-06-05 00:49:01 +02:00
Mailson Menezes 83282971d8 Render current viewport only 2012-05-29 14:06:02 -03:00
Fabio D'Urso 6c296b916b Use UUIDs intead of a (broken) counter to generate annotations' unique names
The previous counter-based approach didn't take into account existing names used
by external annotations and names used in other pages.
Instead of creating a document-global table of used names, I used random UUIDs
as a source of unique names.
2012-05-17 23:50:20 +02:00
Fabio D'Urso 07c57bb2ab Dead code removed (PagePrivate::modifyAnnotation)
The first if ("modified already") is always taken
2012-05-17 23:49:54 +02:00
Pino Toscano 40d20ca58d in each page, add a pointer to the owner document
svn path=/trunk/KDE/kdegraphics/okular/; revision=1217914
2011-01-29 15:38:18 +00:00
Pino Toscano a5252a9115 add flags to selectively choose the page parts to serialize
svn path=/trunk/KDE/kdegraphics/okular/; revision=884438
2008-11-14 23:38:02 +00:00
Pino Toscano 18f486c2c1 add the possibility to store an useful bounding box of a page, and for generators to notify the document (and its observers) on its change
original patch by kde2eran@tromer.org, thanks!
CCMAIL: kde2eran@tromer.org

svn path=/trunk/KDE/kdegraphics/okular/; revision=809467
2008-05-18 23:06:21 +00:00
Pino Toscano bf9af4433d move deleteTextSelections() to the private class
svn path=/trunk/KDE/kdegraphics/okular/; revision=708155
2007-09-03 23:47:12 +00:00
Pino Toscano 325b8711ea move the setTextSelections, setHighlight and deleteHighlights to the private class of Page, as they are private for now
svn path=/trunk/KDE/kdegraphics/okular/; revision=661486
2007-05-05 18:07:34 +00:00
Pino Toscano e79cd474d9 move the Page rotating and changing page functions to the private class
svn path=/trunk/KDE/kdegraphics/okular/; revision=660214
2007-05-01 23:36:57 +00:00
Pino Toscano 5f21b15d99 Link -> Action renaming.
Step #2: Link -> Action for the action hierarchy, and for the ObjectRect type.

svn path=/trunk/KDE/kdegraphics/okular/; revision=656140
2007-04-20 12:37:12 +00:00
Pino Toscano 3f84c8ccad move modifyAnnotation to the private class
svn path=/trunk/KDE/kdegraphics/okular/; revision=655132
2007-04-17 19:55:18 +00:00
Pino Toscano acd19bc8f7 move the Page serialization functions to the private class, and make Document access to them
svn path=/trunk/KDE/kdegraphics/okular/; revision=653988
2007-04-14 19:58:17 +00:00
Pino Toscano 95bb597a85 hide the text selection inside the private class of Page
svn path=/trunk/playground/graphics/okular/; revision=648095
2007-03-30 14:08:20 +00:00
Pino Toscano 229f3cf1de add a private function for the nearest Page pixmap, for the PagePainter usage;
this way, the pixmap structure can be finally hidden in the private class

svn path=/trunk/playground/graphics/okular/; revision=646502
2007-03-25 22:36:41 +00:00
Pino Toscano 36b894c75a Create a (private) PageController that handles the rotation jobs from all the pages.
This removes the needs for Page to be a QObject (it's the PageController that connects to the jobs and emits the right signals), so it again a "cheap" object.

svn path=/trunk/playground/graphics/okular/; revision=646010
2007-03-24 10:47:22 +00:00
Pino Toscano a67410f74f move the private class of Page in an own private header
svn path=/trunk/playground/graphics/okular/; revision=645963
2007-03-24 00:18:54 +00:00