By using Poppler 20.10 new custom image stamps APIs
Instead of the incompatible hack we used before that only worked for Okular.
This is done by modifying the update function used by PopplerAnnotationProxy in order to load the image in
the correct dimensions and send it to the poppler-Qt5 frontend.
We temporarily store the stamp annotation appearance when deleting it so that we can set it again when doing an undo undo.
Source files are no longer separated by UI and non-UI and similar,
but only by their build target.
* ui/ -> part/
* Move all source files from conf/ to part/
* Keep config skeleton definitions in conf/, needed for the mobile target too
* Move editdrawingtooldialogtest.h from conf/autotests/ to autotests/
* ui/data/icons/ -> icons/
* Move /part.cpp, /part.rc and similar files to part/
* Adapt include paths in source files
* Adapt CMakeLists.txt files (in / and in subdirectories)
* Adapt /Messages.sh
* createColorIcon creates a QIcon which visualizes the given colors
using rectangles. A background icon can be provided, in that case
only the lowest 25% of the icon will be filled by the rectangles.
* createOpacityIcon creates a QIcon that visualizes a given opacity
using the current foreground color and a checkerboard background.
These functions are now used in place of colorIcon, colorPicerIcon,
opacityIcon in AnnotationActionHandler. The new functions have some
advantages: support most common icon sizes, and dark color schemes.
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)
Summary:
Configuration:
- Add push button to select custom stamp image
- Check if loaded image is usable as stamp or throw error
- Keep image proportions in previewer
- Move previewer below the combobox to display larger preview
Annotation tool:
- Keep stamp image proportion in annotation preview (while left mouse button is down)
- Adding the annotation with one-click (without holding the left mouse button and dragging) adds the stamp with original proportions
BUG: 370381
BUG: 383652
CCBUG: 383651
FIXED-IN: 1.9.0
Closes T8074
TODO:
- [ ] Check if filters in file chooser make sense / propose better alternative
- [x] Update doc ( @yurchor will do it after we merge this)
Test Plan:
From stamp annotation configuration dialog:
- Show a warning regarding limitations of the feature's current implementation
- Click push button next to combo box opens a file selector
- Selecting a corrupted image file should throw an error
- Selecting a good image file shows the preview of the image
- Select a horizontal image shows a large clear preview
- Select a vertical image file shows a smaller preview without messing up the visual of the config dialog
- Input a valid icon name in the combobox and the preview of the icon is shown
From page view, select the stamp annotation with horizontal image file (not squared):
- Click and hold. The preview maintains proportions
- Single click. The stamp image in the pdf maintains proportions and has the same size of the click and hold preview.
- Add an annotation of the Okular custom stamps (internal SVG so treated slightly differently) do not create problems
Reviewers: #okular, ngraham
Reviewed By: ngraham
Subscribers: pino, aacid, yurchor, ngraham, okular-devel
Tags: #okular
Maniphest Tasks: T8074
Differential Revision: https://phabricator.kde.org/D22064
Summary:
Typewriter is originally specified by the PDF reference as special FreeText annotation, where Intent=FreeTextTypewriter. It features opaque letters on transparent background, so that users can fill non interactive forms. Herewith typewriter is implemented natively for PDF, and there's also an Okular specific implementation for other document types. The added tool reuses the inline note UI.
This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.
FEATURE: 353401
Test Plan:
- okularpartrc is generated (if not yet existing) with typewriter as 10th tool
- typewriter tool is also available in Annotation Tools -> Add, Typ "Typewriter"
- selecting the tool and left click into document opens inline note input dialog
- finishing creates an annotation similar to inline note, but with transparent background
- saving into PDF results in /Subtype FreeText /IT /FreeTextTypeWriter
- saving typewriter into archive stores color with alpha channel = 0x00
- opening annotated archive works, if archive was created with old Okular, and opened in patched Okular
- opening annotated archive works, if archive was created with patched Okular, and opened in old Okular
Reviewers: sander
Reviewed By: sander
Subscribers: ngraham, sander, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D15204
Summary:
Mark the annotations that contain a non-empty popup. Especially useful to identify annotations that are not meant to contain an annotation as shapes or highlights.
BUG: 389836
Reviewers: #okular, aacid
Reviewed By: #okular, aacid
Subscribers: rkflx, aacid, ngraham
Tags: #okular
Differential Revision: https://phabricator.kde.org/D10797
The selected embedded file(s) are extracted to QDir::tempPath() and the
default application associated with the file type is launched with KRun.
Double-click on an embedded file also launches the view action.
The temporary files are cleaned up automatically when the dialog is
closed.
REVIEW: 127351
BUGS: 295567
This removes kdelibs4support for all generators except the mobipocket one.
The test executable for kimgio needs some windows fixes too, so I'll try
to make a separate review for that.
REVIEW: 126375
That patch extracts the video file, which is defined in a
rich media annotation as parameter for the flash player,
and uses the normal multimedia player, to playback the video
file.
This feature requires poppler-qt5 in version 0.36.
FEATURE: 326230
REVIEW: 124612
The old auto_ptr was used for simple RAII. None of the auto_ptr flaws
were apparent in that context, but given that that class is actively
deprecated and that compilers warn about its use, it's better to switch
to its drop-in replacement.
My reason for not using QScopedPointer is that the C++11 version works
well enough, Okular is being built in C++11 mode anyway, unique_ptr
works on the KF5-minimal-mandated-compilers according to their docs, and
therefore there's no point in using something with a different API
(QScopedPointer) just because its name begins with a Q.
REVIEW: 124027
- Changed property dialog title from "Highlight" to "Text Markup",
because it's used for Underline, Squiggle and Strike out too.
- Renamed Squiggly (adjective) to Squiggle (noun)
- Show the precise type of HighlightAnnotation in the review panel and
on right-click on a HighlightAnnotation
This fixes the auto-start feature of PDFs generated with the LaTeX movie
package, which uses the additional action of a widget annotation to start
the movie when entering the page.
BUG: 300051
REVIEW: 106430
FIXED-IN: 4.10
- instead of load the stamps from single SVGs, load them from elements of a single SVG containing all of them
- cache that said SVG (should make their drawing fast again)
svn path=/trunk/KDE/kdegraphics/okular/; revision=884837
- load .svg images when asked to load "stamp-something" names (a bit crude, but working for now)
- take a (optional) different size for the icon
svn path=/trunk/KDE/kdegraphics/okular/; revision=862804