Commit graph

193 commits

Author SHA1 Message Date
Enrico Ros 8f4104a99a merge (refactored) patch_050,051,060
svn path=/branches/kpdf/annotations/kdegraphics/kpdf/; revision=424991
2005-06-13 15:46:23 +00:00
Enrico Ros 2f3f5cca36 merged patch042,043
svn path=/branches/kpdf/annotations/kdegraphics/kpdf/; revision=424893
2005-06-13 11:53:47 +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 e5ed6251a6 Implemented PDF:FullScreen and Close action to KPDF 'Presentation' and
'EndPresentation' actions. Based on testcase by Mikolaj.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=403726
2005-04-07 09:53:15 +00:00
Enrico Ros 7ad04b788c CVS_SILENT add x-pdf as mimetype
svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=402353
2005-04-01 09:56:32 +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 9023b05e16 Document, Page:
Changed loadDocumentInfo/saveDocumentInfo semantics. Document settings
  are saved by Document, but page related stuff (bookmark state,
  annotations, ...) are loaded/saved by the KPDFPage itself.
Annotation:
  Better usage of dom entities (QDomElement(s) -> QDomNode(s)). Added const
  modifier to 'saveSettings' methods.
Part:
  Use setCheckedState for the show/hide left panel menu entry. Use icon
  too. Bumped .rc revision.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=397236
2005-03-13 13:14:44 +00:00
Albert Astals Cid 99a10e1841 All fixes done in HEAD come to annotations branch
svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=395067
2005-03-05 15:59:15 +00:00
Enrico Ros b2ed18c67b Added google-like searches on thumbnailslist (in fact the controller is the
SearchWidget). Splitted SearchType::GoogleLike in GoogleAll and GoogleAny
  to mark pages if all words are present or at least one is present resp.
--TODOs;

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=391354
2005-02-20 16:04:40 +00:00
Enrico Ros fbc7d45083 Adding support for annotations in framework. Only need to add and
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
2005-02-18 18:24:45 +00:00
Enrico Ros 451a3091cc Opening kdpf_annotations branch. Code changes:
User Interface: added a toolbox for selecting an annotation tool without
   polluting the toolbar (pageviewtoolbox animated widget). Icons of that
   toolbar are gimped version of ones in nuvola icontheme.
 Core: added annotation class. this will support all features (except for
   silly ones (really there are some!)) from pdf 1.6 specs but abstracted
   in the kdpf way. (api changes in progress...)

About annotations: only some incomplete interfaces are in plasefor now.
Every type of pdf annotations has tens of parameters. I think we'll render
correctly everything but provide only simple and useful tools for making
annotations over the pages, otherwise a 'Qt designer like' property view
will be required to do fine adjustment over the crappy thousands of
settings. (and we're aiming at a quick and simple viewer with lots of
coolness, not chaos).

Note: the code has been wrongly committed to HEAD before,but soon reverted.
Have fun!

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=388768
2005-02-12 17:42:54 +00:00
Enrico Ros 2a3f35acb9 Fixed broken link following (if not in external document).
Normalized [0..1] every object attached to page.
Fixed find-ahead (didn't loop after last page).

svn path=/trunk/kdegraphics/kpdf/; revision=387447
2005-02-08 15:24:23 +00:00
Albert Astals Cid bc1806e218 - Do not reattach the dcop client
- Keep the original url on the document so we can open relative file names
 - Add Enrico and my copyright

svn path=/trunk/kdegraphics/kpdf/; revision=386244
2005-02-04 22:35:44 +00:00
Enrico Ros 519892521f Fix the last CRASH (on search) and fix a memleak before BETA2 tagging.
Removed old code, reworked bad code.
I have no more reported crashes now.
No plans for additions or code changes till 3.4 release.
Thank you all kpdf users, Have Fun!

svn path=/trunk/kdegraphics/kpdf/; revision=385897
2005-02-03 17:09:33 +00:00
Enrico Ros 9e73b4235e Fixed type-ahead searches. Reworked search code. Found alternative way to
setRasterOp. Cleaned up RenningSearch class. Performance fix on actions.

svn path=/trunk/kdegraphics/kpdf/; revision=385447
2005-02-02 18:18:26 +00:00
Enrico Ros f4b94c016d SEARCH CHANGES: absolutely want to get in those fixes before freeze.
fixed multiple selections on page bugs.
next commits will come tomorrow.

svn path=/trunk/kdegraphics/kpdf/; revision=385045
2005-02-01 18:26:56 +00:00
Enrico Ros d1e074058b cleanups and scroll api
svn path=/trunk/kdegraphics/kpdf/; revision=385040
2005-02-01 18:23:55 +00:00
Albert Astals Cid 48868bc89d Neither Enrico nor me know why that is here and it causes a bug where last page is not searched so it's probably a copy&paste bug. Remove
svn path=/trunk/kdegraphics/kpdf/; revision=384614
2005-01-31 17:23:27 +00:00
Enrico Ros fd0606adb2 FIX: Delete allocation descriptors when dynamic observers are removed.
BUG:98091

svn path=/trunk/kdegraphics/kpdf/; revision=383357
2005-01-28 18:18:48 +00:00
Enrico Ros 5f48094e08 History saving/restoring in addition to the current viewport.
svn path=/trunk/kdegraphics/kpdf/; revision=383327
2005-01-28 17:21:51 +00:00
Enrico Ros 93c1d3845d Implemented history (implementation is inside Document. actions (2) are in
Part). Implemented 'history (xpdf's LinkAction) links'. History depth is
 100 steps by default (this is enough for sure, clicking 100 times on a
 button is not an easy task :-).

Minor issues (removed half TODOs in code, all FIXMEs are already removed):
Invoke mailer on 'mailto:' links inst instead of konqueror.
Actions cleanup: disable actions like 'print', 'preview', 'save to..', etc
 when there isn't an active document. Added history actions to the toolbar
 in place of the 'prev_page' and 'next_page' ones. Fixed open+open_recent
 action tooltip and behavior.
Move definition and implementation of PagePainter class to ui/pagepainter
 from core/page.
Valgrinded and leakchecked (2 memory leaks spotted and fixed (missing
 contents deletion in KPDFGeneratorThread and missing deletion of
 PixmapRequests on cancel in Document::requestPixmaps())).

svn path=/trunk/kdegraphics/kpdf/; revision=382960
2005-01-27 17:31:07 +00:00
Enrico Ros e65c7058c3 Added the MiniBar class, a layouted widget that displays current page
number, the total number of pages and a little grahical 'progress'
 indicator. Moved 'next page' and 'prev page' buttons from the main toolbar
 to the MiniBar. Minibar lets you edit the page number, click or wheel on
 progress, go to next/prev page, show the gotoPage dialog.
Added rmb popup when clicking on thumbnails. When clicking, the
 ThumbnailList only emits the same signal emitted by PageView so the same
 context menu is displayed.
Misc fixes: [MEM] enabled allocated pages raising in queue when displayed
 again, [ThumbnailList] enabled PageUp/PageDown.

svn path=/trunk/kdegraphics/kpdf/; revision=382597
2005-01-26 10:42:07 +00:00
Enrico Ros 156dfb22f9 PageView: Fixed crash in preloading within single page mode. Lowered number
of wasted PixmapRequests (regressions introduced by DocumentViewport).
  Optimizations.
Document: Fixed oscillations in memory deallocator. Merged 'cleanupMemory'
  and 'freeMemory' -> 'cleanupPixmapMemory'.
  Delayed initialization of QTimers.
GeneratorPDF: Added a comment on threading and asyncronous pixmap loading.
TODO: updated adding items by Mikolaj Machowski and Grzegorz Ja?kiewicz

svn path=/trunk/kdegraphics/kpdf/; revision=380913
2005-01-21 20:05:36 +00:00
Enrico Ros 3ba7c53676 Fix preloading. It does real good now.
Fix cache deallocator. Hard avoids swapping memory or filling it up to the
limit (allocated pages are referenced in an internal add/remove FIFO).
Merged open and open_recent buttons as many users requested.
Using viewmag icon for find-as-you-type popup.
Disabled debug output. Updated todo with the roadmap to release.
- Need to audit the memory code and choose good default policies now.

svn path=/trunk/kdegraphics/kpdf/; revision=380494
2005-01-20 17:33:05 +00:00
Enrico Ros 962f891b80 For Users:
Display contents faster, waste less memory. Added preloading to forward-
generate pages (if threading enabled and memory profile >= normal). Main
pages are always generated first, then thumbnails come, then preload ones,
etc.. Btw memory and cpu will be happier now.
(1 bug in memory and 1 in preloading still remains.. will be spotted soon)

For Developers:
Generator: dropped moc, api changes, better functions naming.
PDFGenerator and Document: moved requests queue to the Document.
   The generator performs only a single request a time. A flag can be
   queried to know if the generator is ready for starting another pixmap
   generation or not (in case it's generating a pixmap in background).
PixmapRequest: added priority and backgound (async) attributes.
Document: queuing requests by priority in requestPixmaps.
Observer: added defines for priorities used in doc->requestpixmaps.
PageView: delayed find-ahead timer creation (not created if not needed).
   Added preload PixmapRequests to the pixmap requests list.
ThumbnailsList: adapted to pixmapRequest changes and changed naming for
   delayed thumbanils request.

svn path=/trunk/kdegraphics/kpdf/; revision=379820
2005-01-18 16:43:36 +00:00
Albert Astals Cid c0029ac3f2 Fix small mem leaks
svn path=/trunk/kdegraphics/kpdf/; revision=379484
2005-01-17 18:27:31 +00:00
Albert Astals Cid 97847d8081 Make options be "Enable foo" instead of "Disable foo"
BUG: 97053

svn path=/trunk/kdegraphics/kpdf/; revision=378736
2005-01-15 13:58:08 +00:00
Albert Astals Cid 2b8427a55b Add bool KPDFDocument::isOpened() const and use it so that the user can not begin a find-ahead search if no document is loaded
svn path=/trunk/kdegraphics/kpdf/; revision=378613
2005-01-15 01:08:35 +00:00
Jakub Stachowski cc5f8bb689 Findahead - as in khtml.
svn path=/trunk/kdegraphics/kpdf/; revision=378583
2005-01-14 23:19:04 +00:00
Enrico Ros 4b868c2ef1 mini cleanup 1; starting to work seriously on memory management and contour
stuff.

svn path=/trunk/kdegraphics/kpdf/; revision=377973
2005-01-13 11:03:48 +00:00
Enrico Ros 3bf154b57d Viewport: fixes, setViewport( vp, id ) excludes id from the notified
bodies. Optimized fit width and a saved a couple of pixmap requests. Busy
cursor on load and searches.

svn path=/trunk/kdegraphics/kpdf/; revision=377152
2005-01-10 13:43:44 +00:00
Enrico Ros 162d1a9cf9 CVS_SILENT commented out debug stuff. it works.
svn path=/trunk/kdegraphics/kpdf/; revision=377070
2005-01-09 23:45:43 +00:00
Enrico Ros 6dd95c9e06 Viewport MOD 1. Implemented the DocumentViewport class, owned by Document.
A const reference may be asked. When set all DocumentObservers will be
notified so they can update their gfx if needed. Converted TOC, Links
to the new usage. DocumentViewport can be saved/restored to/from QString
so it can be asked as metadata and saved on document's XML. When loading
a document the viewport is restored exactly where it was when the document
was closed. More fixes with Viewport class. Swapped groupboxes in Perform
dialog. Changed members naming in DocumentObservers and inherited classes.
PageView and ThumbnailsList now linked.

Still regressions / TODOs about the Viewport thing.

svn path=/trunk/kdegraphics/kpdf/; revision=377066
2005-01-09 23:37:07 +00:00
Enrico Ros 1051d4b909 FixCrash 3/3: More decoupling between PDFGenerator and KPDFOutputDevice
classes (moved code between classes). Threading stuff fixed. Add console
debug output if something threading related goes wrong.
BUG: 96274

svn path=/trunk/kdegraphics/kpdf/; revision=376087
2005-01-07 13:13:58 +00:00
Enrico Ros e06c3f4c18 FixCrash 2/3: getMetaData modified. mutex locks. performance fix for TOC
generation (was 50 times slower after the all-in-one generation patch)

svn path=/trunk/kdegraphics/kpdf/; revision=376083
2005-01-07 13:07:29 +00:00
Enrico Ros 208b6a5cf3 Added a bottom toolbar to the thumbnailsList to enable/disable thumbnails
filtering and similar options (toolbar is not created now). Changed
Document::openDocument(..) functions order. Restore last active page when
opening an already viewed pdf. Fix margins around pages in all modes.
Presentation: page change by clicking on the round 'wheel' indicator too.
Updated TODO.

svn path=/trunk/kdegraphics/kpdf/; revision=375229
2005-01-03 15:51:05 +00:00
Albert Astals Cid 90b663b7ca Fix typos, correct orderig a bit
svn path=/trunk/kdegraphics/kpdf/; revision=375091
2005-01-03 00:45:47 +00:00
Albert Astals Cid fb6e540547 Save and read the bookmarks to/from a file when opening/closing a document
svn path=/trunk/kdegraphics/kpdf/; revision=375083
2005-01-03 00:28:46 +00:00
Enrico Ros ad1cc07ccd This is the correct order of deleting things now that a generator thread
may be running.

svn path=/trunk/kdegraphics/kpdf/; revision=375082
2005-01-03 00:24:59 +00:00
Tobias Koenig b10d10a2bd Convert 'struct DocumentInfo' into a QDomDocument for more flexible information
passing.

svn path=/trunk/kdegraphics/kpdf/; revision=375065
2005-01-02 22:37:52 +00:00
Enrico Ros d983cfdd76 Copying kpdf_experiments into branch and reordering directories. Look there
for the file naming map and file  versioning. Please wait until the commit
storm ends to report any bug. Albert and Enrico
Moved KPDFDocumentObserver in its own include file. Updated dependancies.

svn path=/trunk/kdegraphics/kpdf/; revision=374928
2005-01-02 14:55:14 +00:00
Enrico Ros eee2673370 Copying kpdf_experiments into branch and reordering directories. Look there
for the file naming map and file  versioning. Please wait until the commit
storm ends to report any bug. Albert and Enrico
File namings change.

svn path=/trunk/kdegraphics/kpdf/; revision=374924
2005-01-02 14:37:49 +00:00
Enrico Ros ffe8ddaf9d Copying kpdf_experiments into branch and reordering directories. Look there
for the file naming map and file  versioning. Please wait until the commit
storm ends to report any bug. Albert and Enrico

svn path=/trunk/kdegraphics/kpdf/; revision=374920
2005-01-02 14:19:33 +00:00