Commit graph

73 commits

Author SHA1 Message Date
Tobias Deiminger 0957abc39a Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.

Feature is only applicable for annotation types AText, AStamp and AGeom.

Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.

Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.

Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)

Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed

Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.

Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".

REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 23:18:17 +01:00
Albert Astals Cid 4072eb0c3a Add override 2017-03-02 20:38:50 +01:00
Tobias Koenig 8b603c174d Add basic support for RichMedia annotations in PDF files
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
2015-08-20 08:59:34 +02:00
Montel Laurent 5da7c5f77d port to qCDebug. Autogenerate export headers 2014-10-27 22:35:06 +01:00
Peter Grasch 4d4dd68ca2 Fix usability issues with selecting annotations
REVIEW: 109627
2013-06-23 19:22:21 +02:00
Jon Mease 2ae9e58bb4 Merge window.text, contents and inplaceText annotation properties
BUG: 319442
REVIEW: 110391
2013-05-14 09:43:27 +02:00
Albert Astals Cid d0fd156dc9 Minor tweaks 2013-04-06 00:28:39 +02:00
Jon Mease 78faf1e68f Add undo/redo support for annotations
REVIEW: 107442
2013-04-06 00:22:48 +02:00
Tobias Koenig f713dd0fdf Extended Okular::ScreenAnnotation to take a trigger action
REVIEW: 106604
2012-10-22 13:03:08 +02:00
Tobias Koenig 770e2818bb Evaluate additional actions of screen and widget annotations
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
2012-09-21 10:50:57 +02:00
Fabio D'Urso 081f3e5bcb Removed generators/poppler/README.Annotations
README.Annotations contained info that are no longer useful, as Okular
now relies on Poppler to parse PDF annotations.
2012-09-08 19:42:13 +02:00
Jan Binder aa6ed8afc0 Replace deprecated QMatrix by QTransform
REVIEW: 105737
2012-09-08 17:06:02 +02:00
Albert Astals Cid a716b3e4e0 kill all the deprecated functions now that we've change ABI anyway 2012-09-06 19:10:03 +02:00
Fabio D'Urso 157638f2f9 Added Annotation::BeingMoved flag to avoid refreshing pixmaps while moving annotations 2012-05-17 23:50:39 +02:00
Fabio D'Urso ec9f068d77 Added AnnotationProxy to SaveInterface
Based on Pino Toscano's earlier work
2012-05-17 23:49:58 +02:00
Pino Toscano c05523da2b fix #include paths in core headers to other core headers to be relative
... and with double quotes brackets, so they can properly include each other without relying on the compiler include path
2011-06-01 10:51:31 +02:00
Albert Astals Cid 870fd3ba12 Fix point #1 of 213258, open the dialog editor just after adding a note, because adding a note without text is probably not what you want to do.
Will be in KDE *4.7*
Patch by Victor Blazquez <victor.blazquez@gmail.com>
BUGS: 213258

svn path=/trunk/KDE/kdegraphics/okular/; revision=1209674
2010-12-27 22:16:11 +00:00
Pino Toscano f31db87a63 add a ExternallyDrawn flag to mark annotations which are drawn elsewhere (eg by the generator)
mostly useful with External annotations, it is not applied yet

svn path=/trunk/KDE/kdegraphics/okular/; revision=1068014
2009-12-31 09:56:31 +00:00
Pino Toscano b95403b0b2 Add a preliminary and simple version of Movie object and MovieAnnotation.
CCBUG: 136574

svn path=/trunk/KDE/kdegraphics/okular/; revision=851145
2008-08-23 00:07:59 +00:00
Pino Toscano d1305c265b Implement the canBeMoved() check for an annotation in the Annotation class itself.
Use this new version and remove the one in GuiUtils.

svn path=/trunk/KDE/kdegraphics/okular/; revision=803073
2008-05-01 20:59:51 +00:00
Pino Toscano 2737fdb2e5 apidox
svn path=/trunk/KDE/kdegraphics/okular/; revision=796586
2008-04-13 20:11:50 +00:00
Pino Toscano 1177ac20ad Add the support in the core library for sound annotations.
svn path=/trunk/KDE/kdegraphics/okular/; revision=796579
2008-04-13 20:00:06 +00:00
Pino Toscano 095d8fc384 Add support in the Okular core for File Attachment annotations.
(Although, they cannot be (de)serialized to XML.)

CCBUG: 155072

svn path=/trunk/KDE/kdegraphics/okular/; revision=796467
2008-04-13 16:34:33 +00:00
Pino Toscano e182f47cba Add the possibility to store in an Annotation a "native id" of the annotation itself.
What it represents is totally in the hands of the various generators.

Add a function hook to cleanup the annotation data (the "native id", basically).

svn path=/trunk/KDE/kdegraphics/okular/; revision=796378
2008-04-13 13:45:32 +00:00
Pino Toscano e786e9dfb9 Deprecate the own point width of the geometric annotation in favour of the width of the style.
svn path=/trunk/KDE/kdegraphics/okular/; revision=794222
2008-04-06 23:12:04 +00:00
Pino Toscano 80cc994c51 the caret symbol is a fixed choice of two
svn path=/trunk/KDE/kdegraphics/okular/; revision=794041
2008-04-06 10:27:46 +00:00
Pino Toscano ba9042c2e0 Add a basic version (just the internal class, not the visualisation) of Caret annotation.
svn path=/trunk/KDE/kdegraphics/okular/; revision=793884
2008-04-05 14:46:07 +00:00
Pino Toscano 1d40b13d2b SVN_SILENT exclude more private stuff from the apidox
svn path=/trunk/KDE/kdegraphics/okular/; revision=707467
2007-09-01 22:48:28 +00:00
Pino Toscano a6c0f7d46d it makes no sense having a returned type for the base Annotation class (that can not be instanced directly)
svn path=/trunk/KDE/kdegraphics/okular/; revision=691107
2007-07-22 22:52:47 +00:00
Pino Toscano ba765a3b69 give the right parent page to the annotations also when restoring them from xml
svn path=/trunk/KDE/kdegraphics/okular/; revision=689162
2007-07-17 20:04:30 +00:00
Pino Toscano b41dcfeddc - store a pointer of the owning page in each annotation
- preliminary API for translating an annotation

svn path=/trunk/KDE/kdegraphics/okular/; revision=689133
2007-07-17 18:10:25 +00:00
Albert Astals Cid 9f448a49df small dox fixes
svn path=/trunk/KDE/kdegraphics/okular/; revision=668692
2007-05-27 09:59:52 +00:00
Pino Toscano 94355bce65 move the transform() hierarchy within the private class; allow AnnotationObjectRect to use the trasform() stuff
svn path=/trunk/KDE/kdegraphics/okular/; revision=661202
2007-05-04 20:45:45 +00:00
Pino Toscano bfe21b46f8 refactor the Annotation hierarchy to use a common d_ptr like Qt; move the AnnotationPrivate definition in an own header (it will be useful later...)
svn path=/trunk/KDE/kdegraphics/okular/; revision=661195
2007-05-04 20:24:12 +00:00
Pino Toscano 75946e42e3 DOX: improvements and fixes
SVN_SILENT

svn path=/trunk/playground/graphics/okular/; revision=625599
2007-01-20 14:51:43 +00:00
Pino Toscano c1dc76485a DOX: slightly improve apidox generation
SVN_SILENT


svn path=/trunk/playground/graphics/okular/; revision=623061
2007-01-13 22:55:00 +00:00
Tobias Koenig ac792e5c9c Fixed krazy issues
svn path=/trunk/playground/graphics/okular/; revision=619843
2007-01-04 15:22:28 +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
Pino Toscano 48a772be4b move the ui-related utils functions for annotations in an own utils class
svn path=/trunk/playground/graphics/okular/; revision=617097
2006-12-27 23:56:38 +00:00
Pino Toscano 2279ddfaab fix #include's
svn path=/trunk/playground/graphics/okular/; revision=616832
2006-12-27 00:17:52 +00:00
André Wöbbeking 77f96ebfe2 added missing OKULAR_EXPORT
svn path=/trunk/playground/graphics/okular/; revision=616457
2006-12-25 15:10:39 +00:00
Pino Toscano 9320c82cd7 it seems it needs to be exported...
svn path=/trunk/playground/graphics/okular/; revision=615726
2006-12-22 12:57:02 +00:00
David Faure 2fcc54be2b pedantic
svn path=/trunk/playground/graphics/okular/; revision=614615
2006-12-18 13:32:45 +00:00
Tobias Koenig f83cb1c60a Finished API cleanup of Annotation by moving all private members
behind d-pointers

svn path=/trunk/playground/graphics/okular/; revision=614549
2006-12-18 07:28:02 +00:00
Tobias Koenig 6f9d0df5cd Further annotation API cleanup
svn path=/trunk/playground/graphics/okular/; revision=612395
2006-12-11 07:59:02 +00:00
Pino Toscano babbeea1e0 SVN_SILENT
apidox fix

svn path=/trunk/playground/graphics/okular/; revision=610862
2006-12-05 21:07:51 +00:00
Tobias Koenig a9f58440df First large commit for the Annotation API cleanup
* Moved all public member variables of Annotation to private
    and add accessors
  * Renamed RevScope and RevType to RevisionScope and RevisionType
  * Add API documentation (@pino, please review)

svn path=/trunk/playground/graphics/okular/; revision=610749
2006-12-05 11:05:50 +00:00
Pino Toscano 2f1aa08ac6 move the annotation boundary calculation to AnnotationUtils
svn path=/trunk/playground/graphics/okular/; revision=606811
2006-11-21 21:35:45 +00:00
Tobias Koenig a490cc0cd7 Add the following functionality:
* Bring QPixmap* back to make Albert happy ;)
 * Store only one QPixmap per page/size and rotate it directly
 * Rotate ObjectRects (boundary)
 * Rotate Annotations (point coordinates)
 * Don't reload pixmaps, ObjectRects and annotations on rotation

svn path=/trunk/playground/graphics/okular/; revision=606371
2006-11-20 07:53:32 +00:00
Pino Toscano c2686ba1d1 show the annotation type in the review side tab, and a simple tooltip with its author
svn path=/trunk/playground/graphics/okular/; revision=593266
2006-10-07 11:00:39 +00:00