Commit graph

35 commits

Author SHA1 Message Date
Albert Astals Cid
252236d413 Port a few more QLinkedList to QList
We don't need the special properties of QLinkedList in any of those and
QLinkedList is deprecated, so move away from it
2022-03-31 17:08:01 +02: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
2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +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
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
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
4072eb0c3a Add override 2017-03-02 20:38:50 +01:00
Alex Richardson
1049dc188a Add Q_INTERFACES( Okular::Generator ) to all plugins
This seems to be required with KPluginFactory and Qt5 since without it
KPluginFactory::create<Okular::Generator>() always returns null.

For some reason this requires a complete rebuild before generatorstest
passes.

REVIEW: 123466
2015-05-22 16:33:09 +01:00
Albert Astals Cid
e9e3d4a435 Make documentInfo be Hash based instead of XML based 2014-08-10 22:38:13 +02:00
Pino Toscano
505139af31 generators: fix core #includes removing the okular prefix 2011-06-01 10:51:36 +02:00
Albert Astals Cid
f12bd0a942 remove const_cast eeeeeeeeeek
that wasn't even necessary eeeeeeeeeeeeek2

svn path=/trunk/KDE/kdegraphics/okular/; revision=1071422
2010-01-08 00:01:28 +00:00
Luigi Toscano
1f548c29b6 Activate support for DVI font information in the document properties dialog.
This is one of the few KDVI features that was still missing from DVI 
generator.
The most important informations from the now-removed fontPool::status() 
method are shown.

svn path=/trunk/KDE/kdegraphics/okular/; revision=1052192
2009-11-21 00:57:56 +00:00
Pino Toscano
32ca783be8 add named viewport resolution
the destination are source specials anchors

svn path=/trunk/KDE/kdegraphics/okular/; revision=968860
2009-05-16 19:38:00 +00:00
Pino Toscano
455b535ab6 Switch from the sync API to the async one.
Protected the potentially concurred methods using the user mutex.
Removed the manual 'ready' flag and the calculation of the bounding box, as both are done in the core.

This should avoid the block when rendering pages and extracting text from them, and reduce the "slow" feeling esp when invoking external Ghostscript.
BUG: 192284
CCBUG: 162643

svn path=/trunk/KDE/kdegraphics/okular/; revision=966599
2009-05-11 15:14:17 +00:00
Pino Toscano
e75b76545c convert and set the links only *once* per page
svn path=/trunk/KDE/kdegraphics/okular/; revision=966553
2009-05-11 11:41:20 +00:00
Pino Toscano
59f19fe8aa Patch by Luigi Toscano <luigi.toscano@tiscali.it> to mplemented printing support for DVI backend.
CCMAIL: luigi.toscano@tiscali.it

He says:
"Thanks for the infrastructure work to John Layt and apologies for my (non-existent) reply to your mail..."
CCMAIL: john@layt.net

svn path=/trunk/KDE/kdegraphics/okular/; revision=754729
2007-12-30 16:41:10 +00:00
Pino Toscano
e984ef4086 Patch by Luigi Toscano <luigi.toscano@tiscali.it> to:
- simplify the handling of the pages wrt rotation
- make internal anchors hyperlinks work again

Thanks!

CCMAIL: luigi.toscano@tiscali.it

svn path=/trunk/KDE/kdegraphics/okular/; revision=753485
2007-12-27 15:38:29 +00:00
Pino Toscano
6aa123656a Port the plugin system to the standard KDE factory and loader, getting rid of the custom system okular had so far.
This requires a generator to have a
  MyGenerator(QObject *parent, const QVariantList &args)
constructor in order to be successfully loaded.
The OKULAR_EXPORT_PLUGIN macro was adapted, and the generators to provide it the about data; the protected Generator::setAboutData() is no more needed.

Remove the 'lib' prefix from plugins, unneeded now.

CCMAIL: okular-devel@kde.org

svn path=/trunk/KDE/kdegraphics/okular/; revision=744169
2007-12-02 20:57:24 +00:00
Pino Toscano
15155d8824 Rename the virtual closeDocument() to doCloseDocument(), and make it protected.
Added a non-virtual closeDocument() in the base Generator class: this way, particular closing routines can be implemented in the "low level" of a generator.
Apart the renaming, the logic of doCloseDocument() remains the same.

CCMAIL: okular-devel@kde.org

svn path=/trunk/KDE/kdegraphics/okular/; revision=723046
2007-10-08 16:46:51 +00:00
Pino Toscano
6068c76df6 Merge the new functions of ThreadedGenerator into the base Generator: this means that there's again only a single base Generator that can provide the multithreading for the generation of contents, just pixmaps for now.
svn path=/trunk/playground/graphics/okular/; revision=628853
2007-01-31 18:31:19 +00:00
Pino Toscano
55dfb87f3f simplify a bit the Feature system: move it to the base Generator class, and add a protected method to switch a feature on and off easily - no more need to copy&paste hasFeature() anymore
svn path=/trunk/playground/graphics/okular/; revision=627450
2007-01-26 16:35:30 +00:00
Tobias Koenig
d227a94e79 First part of the porting to a threaded api for generators
- made comicbook, tiff and kimgio a threaded generator

svn path=/trunk/playground/graphics/okular/; revision=626761
2007-01-24 15:06:45 +00:00
Pino Toscano
135a18b407 get rid of supportsSearching() by using a proper feature
svn path=/trunk/playground/graphics/okular/; revision=624587
2007-01-17 11:58:20 +00:00
Pino Toscano
468a0da775 bye bye canGenerateTextPage(), unused nowadays
svn path=/trunk/playground/graphics/okular/; revision=624579
2007-01-17 11:34:47 +00:00
Tobias Koenig
ea51ee18f5 Do a lot of include cleanups... we install all important
header files now

svn path=/trunk/playground/graphics/okular/; revision=619492
2007-01-03 14:30:48 +00:00
Tobias Koenig
86a1fd3b69 Big cleanup of Document API and documentation:
* add full API docs
 * renamed getMetaData -> metaData
 * removed supportsRotation in Document and Generator
 * moved Permission and SearchDirection enums into separated header core/global.h

svn path=/trunk/playground/graphics/okular/; revision=619183
2007-01-02 22:37:55 +00:00
Pino Toscano
94c9ffa3d7 do not explicitely include document.h in generator.h
svn path=/trunk/playground/graphics/okular/; revision=617283
2006-12-28 16:45:50 +00:00
Pino Toscano
18028a8a2c API change in the Generator: use an empty construct, and set the document for the generator right after its construction.
Add a protected method to get the document, and hide the real document pointer as private, so the generators can't redefine it.

svn path=/trunk/playground/graphics/okular/; revision=598025
2006-10-22 11:25:08 +00:00
Tobias Koenig
fccd412d69 * Added documentation to Generator API
* Moved all implementations to generator.cpp
 * Added 'const' where it make sense
 * Adapted all generators (except gs)

svn path=/trunk/playground/graphics/okular/; revision=597525
2006-10-20 16:51:46 +00:00
Pino Toscano
c52a0e622b Change the way we rotate the pages.
Instead of telling the generators to do the work themselves (that was usually destraoying the ld pages and creating the new ones), now we just rotate the page objects deleting only their "mutable" contents.
This way, generators can just return true in their supportRotation() to make okular rotate the pages for them for free. Of course they still have to generate the page pixmaps according to the given page rotation.
Now, there's a new rotationChanged() function in the Generator API so generator that needs it can be norified about the document rotation changing.

CCMAIL: developers@okular.org

svn path=/trunk/playground/graphics/okular/; revision=593632
2006-10-08 15:07:23 +00:00
Tobias Koenig
df7d144c10 Moved all classes in core/ into the 'Okular' namespace and removed
nearly all references to kpdf (knewstuff still missing).

svn path=/trunk/playground/graphics/okular/; revision=586993
2006-09-21 08:45:36 +00:00
Pino Toscano
b6d7a36eda Small addition to the Ganarator API: bool closeDocument().
Now every generator has to implement this one and put (if necessary) all the code for cleaning up all the stuff related to the currently open document.
For now the return value it is not read, but generators as strongly suggested to return tru o false, whether all the operations in there went fine.

svn path=/trunk/playground/graphics/okular/; revision=562210
2006-07-14 10:54:29 +00:00
Pino Toscano
d0b5207bce Extract the table of contents from DVI documents.
svn path=/trunk/playground/graphics/okular/; revision=556622
2006-06-30 22:35:48 +00:00
Pino Toscano
2bfdb0f319 New backend: DVI.
Adapted from the DVI plugin of KViewShell.
It can:
- load documents
- generate correctly the pixmaps for the images
- rotate the pages
- extract the text from the pages (thus search and text selection are possible)
- extract the URL hyperlinks from the documents

Credits for this work goes to Luigi Toscano, thanks Luigi!

CCMAIL: Luigi Toscano <luigi.toscano@tiscali.it>

svn path=/trunk/playground/graphics/okular/; revision=555582
2006-06-27 22:17:35 +00:00