mirror of
https://invent.kde.org/graphics/okular
synced 2024-11-05 18:34:53 +00:00
fbc7d45083
implement annotations now (and create the save/load procedure). Annotations: converging to a stable Annotation definition. Changed a bit the paint functions. Added a first 'template' annotation, a simple pen-like segments recorder for framework testing purposes only. This has events filters in place and the rough paint function implemented. PageView: removed the MouseEdit mode and using that button for toggling the editToolBox instead. Added Annotation support. When the Annotation is created, all pageView events flow through that new object. Repaint of damaged/old areas is done internally and is based on the geometry of the annotation we're creating. When an Annotation is complete, it is reparented to the Page that adds it to its internal list. From that point on the annotation will be rendered by pagePainter using the pixmap-based paint function provided by the annotation itself. PagePainter: draws annotations stored in pages when rendering (using the 'rought paint function' till the good pixmap based one will be in place. Page: added preliminary support for adding Annotation(s) to the page and deleting them all. Document: added the pass-through call to add an Annotation to the Page and notify observers. PageViewToolbox: can be draged and attached to any side. Position is remembered between runs (choose your side and that the toolbox will always be there). Available on Right and Bottom sides too. Emits -1 when the current tool is deselected. Misc: added Annotations to both the 'observers changed flags' and the 'pagepainter' ones and updated ui classes accordingly. svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=390638
37 lines
1.6 KiB
C++
37 lines
1.6 KiB
C++
/***************************************************************************
|
|
* Copyright (C) 2005 by Enrico Ros <eros.kde@email.it> *
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
***************************************************************************/
|
|
|
|
#ifndef _KPDF_PAGEPAINTER_H_
|
|
#define _KPDF_PAGEPAINTER_H_
|
|
|
|
class KPDFPage;
|
|
class QPainter;
|
|
class QRect;
|
|
|
|
/**
|
|
* @short Paints a KPDFPage to an open painter using given flags.
|
|
*/
|
|
class PagePainter
|
|
{
|
|
public:
|
|
// list of flags passed to the painting function. by OR-ing those flags
|
|
// you can decide wether or not to permit drawing of a certain feature.
|
|
enum PagePainterFlags { Accessibility = 1, EnhanceLinks = 2,
|
|
EnhanceImages = 4, Highlights = 8,
|
|
Annotations = 16 };
|
|
|
|
// draw (using painter 'p') the 'page' requested by 'id' using features
|
|
// in 'flags'. 'limits' is the bounding rect of the paint operation,
|
|
// 'width' and 'height' the expected size of page contents (used only
|
|
// to pick up an alternative pixmap if the pixmap of 'id' is missing.
|
|
static void paintPageOnPainter( const KPDFPage * page, int id, int flags,
|
|
QPainter * p, const QRect & limits, int width = -1, int height = -1 );
|
|
};
|
|
|
|
#endif
|