Commit graph

58 commits

Author SHA1 Message Date
Pino Toscano 42310e184c Restructuring a bit how the text-editor-like selection works:
* putting it in an own view mode
* associating the selection to every page
* using a better algorithm to calculate the selection, even in a page range
* moving its drawing from the page view to the page painter, so it's possibile to draw it just like it's done with eg annotations

Other changes (more or less related):
* moved the annotation popup to a better place, so it won't interfere with annotation drawing
* commented some debug code in TextPage

svn path=/trunk/playground/graphics/okular/; revision=588795
2006-09-26 22:22:01 +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 1773275615 draw the icon of a linked text annotation always with a fixed, regardless of zoming
svn path=/trunk/playground/graphics/okular/; revision=586286
2006-09-19 10:19:13 +00:00
Dirk Mueller 89bacb77bb compile++
svn path=/trunk/playground/graphics/okular/; revision=586265
2006-09-19 09:09:30 +00:00
Pino Toscano a5ee705911 Annotations:
reverting back the drawing of InPlace Text annotations to the unbuffered ones, but with a more clever behaviout than before:
- the text is drawn wrt the size of the page, and thenscaled to the real annotation boundary size. this makes the drawing of the annotation more similar to the page layout
- the bounding rectangle is drawn to be max 1pixel wide: if the drawn page is smaller than the page, then the rect is scaled along with the text, otherwise it's drawn after the scaling, so it won't appear huge at high levels of zoom
The AnnotationEngine's had to be modified by adding a page pointer parameter to the event() function, necessary to compute correctly the bounding rect of an inline text annotation.

svn path=/trunk/playground/graphics/okular/; revision=585289
2006-09-16 21:16:58 +00:00
Pino Toscano 2202f9cf3e Annotations:
- draw the leader lines (and the extensions) for Line annotations that have them
- add a config widget for setting their length in Line annotations

svn path=/trunk/playground/graphics/okular/; revision=585212
2006-09-16 14:58:32 +00:00
Albert Astals Cid 5fda8d50b8 did not want to commit that
svn path=/trunk/playground/graphics/okular/; revision=584935
2006-09-15 21:12:25 +00:00
Albert Astals Cid 4e04b301f1 Almost foget to fordwardport r582561
Fix bug 133507 that prevented the correct restoring of the document viewport on session restore for remote documents

svn path=/trunk/playground/graphics/okular/; revision=584932
2006-09-15 21:08:48 +00:00
Pino Toscano 8357b47a8c Annotations:
support the Hidden and DenyDelete flags

svn path=/trunk/playground/graphics/okular/; revision=584409
2006-09-14 18:42:28 +00:00
Pino Toscano 15baef171e Annotations:
- improve the icon loading strategy for Stamp and Text(Linked) annotations: first look where we have the custom icons, then in the system place(s)
- add a simple (for now) TextAnnotationWidget to change the icon of a Linked Text annotation

svn path=/trunk/playground/graphics/okular/; revision=583882
2006-09-13 18:19:22 +00:00
Pino Toscano c178ed6392 if we're constructing a polygon (closed), then really set that it is closed instead of closign manually adding the first point to the path
svn path=/trunk/playground/graphics/okular/; revision=583633
2006-09-12 20:47:36 +00:00
Pino Toscano aabe548eac when we have no color set for a Linked TextAnnotation, don't try to colorize the icon with a valid color, but leave it gray instead
svn path=/trunk/playground/graphics/okular/; revision=583618
2006-09-12 20:15:28 +00:00
Pino Toscano 05d97ede77 Annotations:
- make the PagePainter draw all the points specified in a LineAnnotation, as it can represent also a Polygon or Polyline annotation
- automatically read the annotation dom element in the base AnnotatorEngine class, so every engine won't need to read it on its own
- properly reset some vars in the engines
- when constructing a Stamp annotation, use the right 'icon' attribute of the annotation element (and not the icon of the engine)
- renamed the TwoPointsEngine into PolyLineEngine, and abstracted to construct a polygon/polyline with a specified number of sides
- added a polygon button on the annotation toolbar
- check better if the annotator has to paint something

svn path=/trunk/playground/graphics/okular/; revision=583102
2006-09-11 11:51:10 +00:00
Pino Toscano 0395938c7a move the drawing of the TextAnnotation::InPlace from the unbuffered annotations to the buffered ones: this allow us to draw using the specified opacity, and later we could easily draw the callout
svn path=/trunk/playground/graphics/okular/; revision=582624
2006-09-09 22:25:33 +00:00
Pino Toscano ecf3fec2d1 the standard icon names as specified in the PDF Reference are CamelCase, so better lowering them when loading their icons
svn path=/trunk/playground/graphics/okular/; revision=582292
2006-09-08 23:02:55 +00:00
Pino Toscano b66b54a9c9 very small fixes about annotations
svn path=/trunk/playground/graphics/okular/; revision=582276
2006-09-08 21:08:51 +00:00
Tobias Koenig 90140c1479 warnings--
svn path=/trunk/playground/graphics/okular/; revision=578892
2006-08-30 14:17:22 +00:00
Chu Xiaodong 9c575a91d3 replace embedded annotation dialog with annot window, child of PageView
svn path=/trunk/playground/graphics/okular/; revision=572243
2006-08-11 23:53:48 +00:00
Chu Xiaodong a6516a74ef Fix annotation size difference when added in diff scales
svn path=/trunk/playground/graphics/okular/; revision=571739
2006-08-10 15:12:37 +00:00
Chu Xiaodong 3f81e3788f Free TextAnnotation,pop-up window and annotation properties dialog added.
svn path=/trunk/playground/graphics/okular/; revision=571124
2006-08-08 15:31:13 +00:00
Pino Toscano 1ba01ac6f1 Refactor a bit how ObjectRect works: now it's an independent class, that keeps the shape of the "kept" object using a QPainterPath [the qreal version to QRegion].
Modified the constructors to specify if a rect represents a rectangular region or an elliptic one; added a new one to create a region defined using a polygon.
Adapted to the new API the generators that support links (all but the DjVu one - will be adapted and improved soon).

svn path=/trunk/playground/graphics/okular/; revision=561890
2006-07-13 15:03:18 +00:00
Chu Xiaodong 88b724dbf1 Text annotation and Straight line annotation added
svn path=/trunk/playground/graphics/okular/; revision=559954
2006-07-08 17:52:42 +00:00
Pino Toscano 09f8a96671 Draw the okular icon on the top-left corner of the blank pages
svn path=/trunk/playground/graphics/okular/; revision=557176
2006-07-02 15:53:26 +00:00
Pino Toscano 860cae3d20 one deprecated less
svn path=/branches/work/kde4/playground/graphics/okular/; revision=545604
2006-05-27 20:50:00 +00:00
Albert Astals Cid 4b2f10a3ba that made it crash so revert :-S
svn path=/branches/work/kde4/playground/graphics/okular/; revision=540468
2006-05-13 14:48:16 +00:00
Albert Astals Cid 3c83f1558c some deprecation less
svn path=/branches/work/kde4/playground/graphics/okular/; revision=540458
2006-05-13 13:59:09 +00:00
Pino Toscano 90db8a5868 less qt3_support
svn path=/branches/work/kde4/playground/graphics/okular/; revision=529479
2006-04-13 14:51:05 +00:00
Pino Toscano 863da7ba3e less qt3_support
svn path=/branches/work/kde4/playground/graphics/okular/; revision=526826
2006-04-05 17:49:44 +00:00
Pino Toscano 25e194b435 less qt3_support
svn path=/branches/work/kde4/playground/graphics/okular/; revision=524069
2006-03-29 16:46:09 +00:00
Pino Toscano 63c18ab06e Make the oKular part and its shell compile and link.
Created a oKularcore lib, so the generators ca link to it, and made the oKularpart link to it too, of course.
Adapted the sources of the Okularpart to the new location for the generated settings.h.

svn path=/branches/work/kde4/playground/graphics/okular/; revision=523729
2006-03-28 22:22:10 +00:00
Albert Astals Cid cbb8e80154 some more compile changes, now let's see basketball
svn path=/branches/work/kde4/playground/graphics/okular/; revision=521882
2006-03-23 19:02:55 +00:00
Piotr Szymanski 75db44d843 - sync with hdd, refactored text page, ported backends to textpage,
- fixed crash in fax, chm builds and ghostview nearly ported to libqgs

svn path=/trunk/playground/graphics/oKular/kpdf/; revision=481340
2005-11-18 20:48:01 +00:00
Piotr Szymanski d09fd28b89 - MERGE KPDF 3.5 CHANGES
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=477586
2005-11-04 11:59:51 +00:00
Piotr Szymanski bcd8aeb475 - less debug (man this slew things down)!
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=434944
2005-07-15 20:27:34 +00:00
Piotr Szymanski 36ab5c8965 - make generators plugins by:
* moving all xpdf stuff from core and part to inside generator_pdf
   * adding abstract KPDFText class and KPDFTextEntity to hold either
     glyph, or word or textline
- support for importing PS files as pdf like on annots branch
- synced with annots branch
- abstract text layer with search for words in different lines
- added RegularArea<NormalizedShape,Shape> template class
  which inherits QValueList<NormalizedShape*> and is used
  to hold regular areas of given shape (finite collections of the shape)
- loading of relevant generators via ktrader for given mimetype
- the deliverables 1 and 2 of my SoC proposition are delivered
  next: 1. fix one spotted regression and 2. code ghostview backend


svn path=/trunk/playground/graphics/oKular/kpdf/; revision=434883
2005-07-15 18:20:57 +00:00
Enrico Ros f0a0a803d8 CVS_SILENT I shouldn't commit immediately after waking up.
svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=407479
2005-04-24 11:03:33 +00:00
Enrico Ros 03bdb7d79e CVS_SILENT sync comments
svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=407470
2005-04-24 10:03:25 +00:00
Enrico Ros ed41c2e2d2 Using line width property. Line width follows scaling.
svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=405443
2005-04-13 21:23:54 +00:00
Enrico Ros e8f27fc700 Highlight annotations: ok
PagePainter:
  Updated drawShape with RasterOperation (Normal, Multiply) for getting
  Highlight annotation types to work. All Highlight annotations are now
  drew using the Multiply raster operation.

Painter_AGG2:
  Replaced the agg_pixfmt_rgba.h pixformat definition template with an
  internal version that implements different raster operations too. The
  new version has been shrinked to the minimum, containing the only code
  needed by kpdf AGG2 rendering engine to work.

Thanks for Rob Buis for telling me the way to go and providing sample code
with his AGG2 algorithms.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=405338
2005-04-13 14:49:57 +00:00
Enrico Ros c5b694d02c Painter_AGG2:
Part from the *very C00L* AGG2 library (www.antigrain.com) are imported
  from the agg23 source package. The imported files provides antialiased
  rendering on bgra32 qimage memory buffers.
  See "kpdf/ui/painter_agg2/README.kpdf" for more info.
PagePainter:
  Replaced my dear crappy scanline renderer (well, was the fastest btw :-)
  with agg2 based rendering code.
  Implemented HighlightAnnotation (HL, Underline, Strikeout and Squiggly)
  and InkAnnotation (simple one) rendering.
  Need a multiply-blending template algo for getting highlights to look
  as highlighs (not solid or transparent, like now).
Makefile.am(s):
  Updated to build the new library, set include paths and link it.

Here we go.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=405150
2005-04-12 20:44:26 +00:00
Enrico Ros d460434919 Annotations: my first dirty (and superfast) scanline renderer. More to
implement here.. but that looks so nice. (note: too juicy to see now,
disabled some code before committing :-).

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=404560
2005-04-10 13:47:00 +00:00
Enrico Ros 5591710542 Annotations: first drawing experiments. Some unbuffered annotations are
drawn in page.

PagePainter:
  Added 2 convenience function to change the alpha component of an image
  and do it while colorizing the image in a single pass.
  QPainter->drawPixmap unbuffered render for AText marks, AStamp pictures
  and AGeom of type InscribedSquare.

Can't wait for Arthur's painter to do the full range of painting effects
with a very simple interface, faster than my dirty implementation and
over all: not crashing! (mine does! :-)

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=404088
2005-04-08 15:45:40 +00:00
Enrico Ros 57f0453b73 Document:
Warning before running out of memory and stop pixmap request.
  CCMAIL: 103435@bugs.kde.org
PagePainter:
  Not related to the bug: avoid scaling up slow pixmaps.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=403884
2005-04-07 20:26:49 +00:00
Enrico Ros b2b74d91c8 Adapted to annotations.h changes.
annotations.cpp is all commented out, need to work on that now.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=403222
2005-04-04 23:55:40 +00:00
Enrico Ros 37abd55198 CVS_SILENT more naming changes
svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=402436
2005-04-01 16:24:11 +00:00
Enrico Ros 917d5e8b79 CVS_SILENT variable names change. preparing for heavy mods.
svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=402410
2005-04-01 13:54:26 +00:00
Enrico Ros e5eb63ec71 Redesigned graphic pipeline on PagePainter and hand scaling (10x gain on
typical usage).

PagePainter:
  Added 2 convenience methods for performing fast cropping and scaling
  from qpixmaps to qimages. Split buffered graphic flow from the unbuffered
  one reducing buffers conversions to the minimum. Avoid odd cases in
  rescaling. Detection of annotations boundaries to check for enabling
  buffered painting.
  Sample quick dirty and broken (but not so much..) implementation for
  painting AStamp annotations.
Misc:
  PresentationWidged and ThumbnailWidget: adapted to PagePainter changes.
  (PageView mod has already been committed).

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=400310
2005-03-24 19:59:11 +00:00
Enrico Ros 1e9f0e590a Another milestone has been reached: complete saving/restoring of
annotations in the 'document tie file'. Every attribute of kpdf dss
can be dumped to disk. Only rendering prevents HEAD merging now! :-)

Annotations:
  Storage: full annotations saving/loding on the tied XML is implemented.
    every annotation put on a page (either loaded from a pdf or created
    internally is loaded and saved when opening/closing a document).
    Attributes are dumped to XML and reloaded from it via qdom
  DataStructures: internal changes, better naming, some attributes fused.
    PopupAnnotation has become WindowAnnotation
  PDF16Parser: 100% completeness for the types we support

PDFGenerator:
  adapted to annotation ds changes. better parsing on a couple of attrs.
  correctly handle 'F'.

Misc:
  Document: remove/cleanup debugs, Page: performance testing stuff added,
  PagePainter: setPen( annot->color ), PageV..or: typo,
  TODO: many changes

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=398789
2005-03-18 18:49:45 +00:00
Enrico Ros 3c6049f415 Adapted to changes in Annotation and children strcuts.
PagePainter:
  Only draw annotation extents (the rect property).
PageViewAnnotator:
  Changed AnnotatorEngine(s) to deal with new attribs in structures. In
  particular they use the NormalizedRect attribute of annotation instead
  of the annotation as a rect itself.
Todo:
  Updated.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=396911
2005-03-12 08:35:22 +00:00
Enrico Ros c6191c4836 Annotations -Part2- PDF1.6 DSs are summarized and ready4impl in ann*.h
Annotation: the class has been passivized. It's only a data container now,
  no more active manipulation of events/paints.
PageViewAnnotator: this class has been created to handle creating annots.
  PageView creates its 'Annotator on demand. The annotator parses tool
  definition from the 'tool.xml' file.
  The Annotator internally uses AnnotatorEngine(s) to react to mouse events
  and the annotation is created when the job is really finished.
Page: added a (maybe temporary) NormalizedPoint to complement Norm..Rect.
PageViewUtils: removed PageViewEditTools and cleaned up header.
conf/: added a debug option for showing annotation boundary while creating
  one and added a temporary 'debug' toolbox in the config dialogs.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=394959
2005-03-04 23:06:24 +00:00