Commit graph

42 commits

Author SHA1 Message Date
Pino Toscano 805b0f3386 Introduce a selective merging strategy for text areas, so we merge only all the areas of a text "line" together, not also with the areas above (if the lines overlap).
Adapt the text selection to merge correctly depending on the current rotation.
Drawback: darker overlap zones if two lines overlap.

svn path=/trunk/KDE/kdegraphics/okular/; revision=708745
2007-09-05 14:57:15 +00:00
Pino Toscano 99a99a1590 instead of just keeping the transformation matrix, add the pointer to the owning page in a text page, so a text page can know more information, and with no need to manually be updated by the page
svn path=/trunk/KDE/kdegraphics/okular/; revision=708443
2007-09-04 22:37:39 +00:00
Pino Toscano 351f66a9b4 remove TextPage::transform() from the public API, and make the Page change the TextPage transformation easily
svn path=/trunk/KDE/kdegraphics/okular/; revision=708085
2007-09-03 19:58:30 +00:00
Pino Toscano 1bd879c240 extract the definition of the private class of TextPage to an own file, and rename it to TextPagePrivate
svn path=/trunk/KDE/kdegraphics/okular/; revision=708084
2007-09-03 19:52:46 +00:00
Pino Toscano 490cf6fc67 Add a new text selection algo that should be a bit more reliable than the current one (just commented out), especially if the backend does not provide text areas in the logical order. Drawback: slightly slower.
Adapt both the algo's to work on untransformed text areas, but to return transformed areas.

svn path=/trunk/KDE/kdegraphics/okular/; revision=708078
2007-09-03 19:35:55 +00:00
Albert Astals Cid 41c25cb208 Back from holiday, let's do some comitting :-)
* Update some copyright years and mail addresses
 * Search does not block the GUI anymore YUHUUUUU
   Well, it it does but it's almost unperceptible, that means the searching methods of Document no longer return a bool but a void and the Document::searchFinished signal is used to know if something was found, nothing was found or the user pressed the cancel button !YES! one can cancel search now :-)
 * TextPage no longer holds the area and the current transformed area, it took TOO MUCH memory, now we transform the area each time, it's much more CPU intensive but i could not measure a time loss while searching big documents and i could measure HUNDREDS of MB of usage less.
 * MICRO optimization: Change some code to not detach some containers
 * I still don't have ADSL so this is something like a "blind" commit, Pino will check it compiles against current KDE, not against what's on my computers

svn path=/trunk/KDE/kdegraphics/okular/; revision=699701
2007-08-13 22:25:27 +00:00
Pino Toscano 5150419e81 adapt the debug stuff to the new kdebug way:
- make the output looking more or less like before (using nospace() or removing the spaces)
- remove endl and '\n' at the end of debug outputs
- fixing the QDebug operator<<'s around
- isolate the debug area number of the core into a separate header, and apply it instead of the numbers found in textpage.cpp

svn path=/trunk/KDE/kdegraphics/okular/; revision=694667
2007-07-31 10:19:48 +00:00
Albert Astals Cid 0d47b62715 krazy include order issues
svn path=/trunk/KDE/kdegraphics/okular/; revision=655893
2007-04-19 18:30:20 +00:00
Pino Toscano 8fbebeb737 no need to pass a reference to an enum value
svn path=/trunk/playground/graphics/okular/; revision=620270
2007-01-05 15:00:12 +00:00
Tobias Koenig 7cff5de9ce Coding style cleanup
svn path=/trunk/playground/graphics/okular/; revision=620258
2007-01-05 14:40:38 +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 dff36b98f8 simplify RegularAreaRect by avoiding the usage of pointers, as they don't give benefits anyway.
Fixing also the text extraction when using the rectangular selection across two or more pages.

svn path=/trunk/playground/graphics/okular/; revision=616264
2006-12-24 18:19:18 +00:00
Pino Toscano 7d275a6390 Improved the text selection by using and ad-hoc function that takes care of adding or merging a new shape to the area, so the simply() at the end is no more needed.
This gives another speedup when using the text selection.
(And, rename okularDeleter to okularPtrUtils.)

svn path=/trunk/playground/graphics/okular/; revision=616089
2006-12-23 16:18:54 +00:00
Pino Toscano 5e50a35683 less includes in the headers
svn path=/trunk/playground/graphics/okular/; revision=608502
2006-11-27 18:31:20 +00:00
Pino Toscano 4c17c58fc2 better remove the search points (with the iterators) first
svn path=/trunk/playground/graphics/okular/; revision=608074
2006-11-26 16:46:20 +00:00
Pino Toscano 97f9f895ed There is nothing to find text into if the text page has no text.
BUG: 137860

svn path=/trunk/playground/graphics/okular/; revision=607827
2006-11-25 21:39:52 +00:00
Pino Toscano 5ce4b0674e Make okular able to copy the text selection to the clipboard (finally!).
svn path=/trunk/playground/graphics/okular/; revision=607496
2006-11-24 21:02:38 +00:00
Tobias Koenig 0302929b04 Add support of transformation (rotation) of TextPages
svn path=/trunk/playground/graphics/okular/; revision=607271
2006-11-23 22:14:04 +00:00
Tobias Koenig 471c71d256 Cleaned up the API of TextEntity and TextPage, ready for release ;)
svn path=/trunk/playground/graphics/okular/; revision=607211
2006-11-23 17:56:03 +00:00
Tobias Koenig 4848631daf Renamed all the Page::getXyz() methods to Page::xyz() to be konsistent
with the rest of KDE and ... we are no Java developers ;)

svn path=/trunk/playground/graphics/okular/; revision=607204
2006-11-23 17:11:04 +00:00
Tobias Koenig 14d6515b16 Changed the enum SearchDir to SearchDirection and use less strange
abbreviations for its items.

Replaced the 'bool strictCase' parameter of Page::findText
with 'Qt::CaseSensitivity caseSensitivity' for better readable code.


svn path=/trunk/playground/graphics/okular/; revision=607203
2006-11-23 16:54:28 +00:00
Pino Toscano f950e3e172 const iterators can be used here, too
svn path=/trunk/playground/graphics/okular/; revision=606596
2006-11-21 00:31:44 +00:00
Pino Toscano bd1880e42d less use of pointers; more const's
svn path=/trunk/playground/graphics/okular/; revision=605960
2006-11-18 18:33:47 +00:00
Pino Toscano 2854e8aea3 slightly improve (not much, but well...)
svn path=/trunk/playground/graphics/okular/; revision=594951
2006-10-12 21:32:38 +00:00
Pino Toscano b566530fad very small optimization: instead of doing toLower for each char, do it only once (if necessary, of course)
svn path=/trunk/playground/graphics/okular/; revision=594655
2006-10-11 22:15:58 +00:00
Pino Toscano bee45c6eef SVN_SILENT tab -> spaces
svn path=/trunk/playground/graphics/okular/; revision=593650
2006-10-08 15:57:11 +00:00
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 25eb77c1de some fixes according to EBN:
- fix single char addition to QString's
- some spell checking

svn path=/trunk/playground/graphics/okular/; revision=563891
2006-07-18 19:06:01 +00:00
Pino Toscano c9555efe16 put a debug output line in a #ifdef DEBUG_TEXTPAGE, so at least the searches won't be slow unless while debugging
svn path=/branches/work/kde4/playground/graphics/okular/; revision=545634
2006-05-27 22:13:27 +00:00
Pino Toscano 6301d6b397 In the hope I didn not break anything, this is the new way of searching through the text pages. The new way stores the search point for every searchID, avoid to search from the beginning every time.
Also, the structure for backward search is there, (just...) need to add a findTextInternalBackward and do the job there.

svn path=/branches/work/kde4/playground/graphics/okular/; revision=545298
2006-05-27 10:06:31 +00:00
Pino Toscano 59b267386c avoid using QString*, just use QString
svn path=/branches/work/kde4/playground/graphics/okular/; revision=544974
2006-05-26 14:32:35 +00:00
Albert Astals Cid 68830e0508 fix search (a bit) and rect passing top != right dude!!
svn path=/branches/work/kde4/playground/graphics/okular/; revision=540475
2006-05-13 15:04:22 +00:00
Pino Toscano 4bd3b60d6c less qt3_support
svn path=/branches/work/kde4/playground/graphics/okular/; revision=524083
2006-03-29 17:16:46 +00:00
Pino Toscano 80f7e6b596 a bit of qt3/kde3 support less
svn path=/branches/work/kde4/playground/graphics/okular/; revision=523922
2006-03-29 13:52:17 +00:00
Albert Astals Cid c0a2772c9a more porting, area.h is begining to loose but i need sleep
svn path=/branches/work/kde4/playground/graphics/okular/; revision=520838
2006-03-20 23:14:05 +00:00
Albert Astals Cid 6987b83b6a a bit of porting area.h is giving me lots of problems
svn path=/branches/work/kde4/playground/graphics/okular/; revision=520829
2006-03-20 22:40:11 +00:00
Piotr Szymanski 4387e1489e - GIGANTIC 2700 line diff with LOTS OF FEATURES!
- 1. editor-like text selection, and I do mean it, its not pseudo-editor 
  (like the ones acroread and kviewshell have) it doesnt intersect the 
  selection area with words under it, no, it does a lot more, including 
  work on cursors and searching for the text area closest to the given
  cursor
- 2. rotation support, change the orientation of the documents if 
  you need too :)
- 3. the kfaxview backend works beautifully, porting kviewshell backends
  is damn easy ! djvu and dvi will be next!
- 4. Hardware Blending of selection rectangles! We now use XRender 
  instead of KImageEffect, makes a damn faster blend!
- 5. Overview mode - as seen in Kviewshell, but quite a bit extended, 
  the kviewshell is only one state, while we support it in both 
  continous and non-continous form
- BTW. I coded all those features myself, (apart from kfaxview backend library)
  it is an impressive bit right? but oKular cant be run by only one person, 
  join in on the fun! i can introduce you into the code just mail niedakh@gmail.com


svn path=/trunk/playground/graphics/oKular/kpdf/; revision=509871
2006-02-15 18:54:49 +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 34b8e28322 - Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
  1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
     also add possibility to merge an XML .rc file with menu layout. Relevant functions are:

     QString Generator::getXMLFile(), returns a QString with your .rc file name.
     void  Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface

  2. Supporting backend settings:
     If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
     set to true) are found, a menu item: configure backends is created, clicking on it results in
     loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
     function should be overloaded by a generator and dlg->addPage should be used to add pages.

     If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.

  3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
     to the generator class, and sending a message to the user is as simple as emitting a signal!

  4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
     event and return true if pageview is to proceed with its handling or false if not.

  5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
     Generator::print()

  6. PixmapRequest handling update:
     a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
     b.) Document::sendGeneratorRequests is a slot now
     c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
         is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
         run in three places:
         1.  in requestPixmaps when we receive a request
         2.  in requestDone if pixmapStack is not empty
         3.  sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
        it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request

  7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime

- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.


svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +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