Commit graph

56 commits

Author SHA1 Message Date
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 2da1cd736a CI: Enable clang-tidy modernize-loop-convert 2020-01-24 17:23:39 +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 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
Albert Astals Cid 47d7d04b5e delete copy constructor and assignment operator of some internal classes
they are unused(except the PageViewItem one), but if anyone would use
them things would go wrong, so protect us from it

Actually fixes a bug in PageView::slotFitWindowToPage in which we were
copying constructing PageViewItem and that's bad
2019-01-10 00:28:49 +01:00
Yuri Chornoivan 5478b2ec92 Fix minor typos 2018-11-14 21:12:15 +02: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 985e06a2f5 Fix crash in some more xps files
Some more tweaks to path resolving.

Don't prepend a / in entryPath if path already starts with /
Fonts can also have relative paths, so use the absolutePath before
calling getFontByName

BUGS: 392826
2018-04-08 12:50:46 +02: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 191a37fb52 Q_DECL_OVERRIDE -> override 2017-03-02 20:39:24 +01:00
Montel Laurent 014b712359 Use explicit. Q_DECL_OVERRIDE 2015-08-18 15:27:20 +02: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
Frederik Gladhorn 6c602bf0e7 Use categorized logging even more 2014-09-16 23:38:25 +02:00
Albert Astals Cid e9e3d4a435 Make documentInfo be Hash based instead of XML based 2014-08-10 22:38:13 +02:00
Jan Binder aa6ed8afc0 Replace deprecated QMatrix by QTransform
REVIEW: 105737
2012-09-08 17:06:02 +02:00
Pino Toscano 505139af31 generators: fix core #includes removing the okular prefix 2011-06-01 10:51:36 +02:00
Pino Toscano 050d5c32cf void* -> QVariant conversion for the XpsRenderNode data
svn path=/trunk/KDE/kdegraphics/okular/; revision=857098
2008-09-04 17:30:56 +00:00
Pino Toscano 2eb4dd8147 - extract the painter-based paint procedure of the XpsPage in an own method
- add printing support for the XPS backend

svn path=/trunk/KDE/kdegraphics/okular/; revision=841450
2008-08-03 10:19:05 +00:00
Pino Toscano dc827f1ff3 start reading the geometries child of the Path element;
introduce ah-hoc structores for handling them;
so far, read PolyLineSegment and PolyBezierSegment only

svn path=/trunk/KDE/kdegraphics/okular/; revision=825705
2008-06-29 02:15:17 +00:00
Pino Toscano 075f0302cd consider also the Stroke child of Path elements
svn path=/trunk/KDE/kdegraphics/okular/; revision=825466
2008-06-28 10:58:57 +00:00
Pino Toscano f817bde307 Properly manage the gradient stops as the specs say;
parse the radial gradients.

svn path=/trunk/KDE/kdegraphics/okular/; revision=825253
2008-06-27 17:18:41 +00:00
Pino Toscano b8db72e6d9 Width and height of a page can be real values, not just integer.
BUG: 164822

svn path=/trunk/KDE/kdegraphics/okular/; revision=824976
2008-06-27 00:59:36 +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
Albert Astals Cid 0d47b62715 krazy include order issues
svn path=/trunk/KDE/kdegraphics/okular/; revision=655893
2007-04-19 18:30:20 +00:00
Brad Hards 61aa0d440d Switch the Text Extraction handler over to using
QXmlStreamReader. This still isn't working the way I would like -
looks to be something wrong in either the character selection or the
matrix transformation code.

Also implemented the "export to" text/plain.

svn path=/trunk/playground/graphics/okular/; revision=641156
2007-03-10 10:18:12 +00:00
Brad Hards b0039a0e11 Remove unused declaration.
svn path=/trunk/playground/graphics/okular/; revision=641121
2007-03-10 05:39:27 +00:00
Brad Hards 81a132092f Switch to using QXmlStreamReader (from Qt4.3) for
parsing. There is more of this to be done.

Also, use a debug area for the XPS generator.

svn path=/trunk/playground/graphics/okular/; revision=640442
2007-03-08 03:11:04 +00:00
Brad Hards 642a841840 Add document synopsis for XPS.
I don't have a lot of documents that actually have a document
structure - it is optional in XPS. In fact, I did this code on just
one file - the XPS 1.0 spec itself.

CCMAIL: jiri.klement@gmail.com

svn path=/trunk/playground/graphics/okular/; revision=635167
2007-02-19 10:43:40 +00:00
Brad Hards f749c5dc22 Minor rethink on the colour parsing. If we have separate methods for
Pen and Brush, we can make sure that references make sense for the
kind of colour we're providing.

These might be candidates for more shared code later.


svn path=/trunk/playground/graphics/okular/; revision=634451
2007-02-17 11:18:06 +00:00
Brad Hards 999967935e Implement pen colour and size (Stroke and StrokeThickness
attributes). This allows us to correctly show objects that have an
outline (pen) colour that is different to the fill colour.

svn path=/trunk/playground/graphics/okular/; revision=634439
2007-02-17 10:45:07 +00:00
Brad Hards e29e44ff89 Store away the digital signature origin.
This prevents a warning on loading files containing
signatures, and is also a start towards proper handling
of digital signatures.

svn path=/trunk/playground/graphics/okular/; revision=634423
2007-02-17 09:56:08 +00:00
Jiri Klement dbe7fea25a Fix memory leaks
svn path=/trunk/playground/graphics/okular/; revision=633346
2007-02-13 21:13:08 +00:00
Jiri Klement 065287322a Share fonts in whole xpsfile (not only xpspage)
svn path=/trunk/playground/graphics/okular/; revision=633189
2007-02-13 13:26:37 +00:00
Jiri Klement 1c545fb8cb Text extraction support
svn path=/trunk/playground/graphics/okular/; revision=633154
2007-02-13 11:13:35 +00:00
Jiri Klement 4ea8794f52 ImageBrush rendering element: support for Viewbox, Viewport, Transform
svn path=/trunk/playground/graphics/okular/; revision=632844
2007-02-12 13:31:16 +00:00
Jiri Klement f0eaa1fbff Rewrite of page rendering. Now it respects context and actual work is done at the end of element so child elements are taken into account
svn path=/trunk/playground/graphics/okular/; revision=632324
2007-02-10 17:31:25 +00:00
Jiri Klement 74e912ea1f SVN_SILENT fix intendation
svn path=/trunk/playground/graphics/okular/; revision=631640
2007-02-08 16:41:53 +00:00
Jiri Klement 1de57323db Optimalize document loading. Now is used SAX instead of DOM for getting page size which reduced time to load document few times
svn path=/trunk/playground/graphics/okular/; revision=631634
2007-02-08 16:20:55 +00:00
Jiri Klement 53122db23d parseAbbreviatedData has be rewritten, now it supports almost all commands(except arc)
svn path=/trunk/playground/graphics/okular/; revision=631602
2007-02-08 15:07:54 +00:00
Brad Hards 8f3336d252 Patch from Jiri Klement, which fixes:
1) Loading of obfuscated fonts
2) Segmentation fault when xps document was opened and then another
xps documen was opend.
3) Load font only once, not everytime it's used

Also some white space changes from xemacs.

CCMAIL: jiri.klement@gmail.com

svn path=/trunk/playground/graphics/okular/; revision=630741
2007-02-06 07:07:23 +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
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
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
Pino Toscano cc3de8c899 fix typo in license
svn path=/trunk/playground/graphics/okular/; revision=597879
2006-10-21 22:10:09 +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