Commit graph

176 commits

Author SHA1 Message Date
Pino Toscano 166ba5b87a move the Generator::Private to a GeneratorPrivate, and move the implementations of the provate threads to a cpp
svn path=/trunk/KDE/kdegraphics/okular/; revision=656221
2007-04-20 17:17:44 +00:00
Pino Toscano 444b1a3f84 SVN_SILENT unused forward declaration
svn path=/trunk/KDE/kdegraphics/okular/; revision=656147
2007-04-20 12:59:23 +00:00
Pino Toscano df5b2c3329 make ExportFormat implicitely shared, especially because it's mostly a "read-only" class
svn path=/trunk/KDE/kdegraphics/okular/; revision=653196
2007-04-12 20:43:37 +00:00
Christian Ehrlicher c5c2da7c89 fix win32 compilation
warnings--

svn path=/trunk/playground/graphics/okular/; revision=643874
2007-03-18 17:14:36 +00:00
Pino Toscano 1117200950 constness for document()
svn path=/trunk/playground/graphics/okular/; revision=643431
2007-03-17 12:11:41 +00:00
Pino Toscano 1bfc805a3e it does not make much sense to check for a serie of permissions at the same time, so just check one permission at a time
svn path=/trunk/playground/graphics/okular/; revision=641341
2007-03-10 23:59:11 +00:00
Pino Toscano 2ef46f8d90 simplify a bit the export action creation code
svn path=/trunk/playground/graphics/okular/; revision=641313
2007-03-10 21:32:09 +00:00
Pino Toscano 1316811082 Cache the export formats, so we can know better if the text/plain formst is supported by the backend (and act accordingly).
svn path=/trunk/playground/graphics/okular/; revision=641302
2007-03-10 20:51:50 +00:00
Pino Toscano fd7434c95a Add support for custom generator about data (and potentially for custom configuration).
svn path=/trunk/playground/graphics/okular/; revision=640348
2007-03-07 18:15:00 +00:00
Tobias Koenig 0847edc4b7 Add a second parameter to requestTextPage/generateTextPage where you can
specify whether the request should be synchronous or asynchronous

svn path=/trunk/playground/graphics/okular/; revision=628893
2007-01-31 21:10:00 +00:00
Pino Toscano 6068c76df6 Merge the new functions of ThreadedGenerator into the base Generator: this means that there's again only a single base Generator that can provide the multithreading for the generation of contents, just pixmaps for now.
svn path=/trunk/playground/graphics/okular/; revision=628853
2007-01-31 18:31:19 +00:00
Tobias Koenig baf1fb2870 Several changes:
- renamed signalRequestDone to signalPixmapRequestDone to allow a future signalTextPageRequestDone
  - added error/warning/notice signals to TextDocumentConverter and add meaningful error messages
    to ooo and fictionbook generator
  - code cleanup in chm generator
  - print improvements and error notification in kimgio generator

svn path=/trunk/playground/graphics/okular/; revision=628124
2007-01-29 08:17:45 +00:00
Pino Toscano 55dfb87f3f simplify a bit the Feature system: move it to the base Generator class, and add a protected method to switch a feature on and off easily - no more need to copy&paste hasFeature() anymore
svn path=/trunk/playground/graphics/okular/; revision=627450
2007-01-26 16:35:30 +00:00
Tobias Koenig d94f0e507e Add support for threaded extraction of text pages, now we just have to
adapt the generators and the document class, which is 95% of the work ;)

svn path=/trunk/playground/graphics/okular/; revision=626843
2007-01-24 18:27:54 +00:00
Tobias Koenig d227a94e79 First part of the porting to a threaded api for generators
- made comicbook, tiff and kimgio a threaded generator

svn path=/trunk/playground/graphics/okular/; revision=626761
2007-01-24 15:06:45 +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
André Wöbbeking c06cbc334d -pedantic
svn path=/trunk/playground/graphics/okular/; revision=624728
2007-01-17 21:30:43 +00:00
Pino Toscano 4f6666d509 also the page size is a feature, so thread it as such (and remove supportsPageSizes())
svn path=/trunk/playground/graphics/okular/; revision=624686
2007-01-17 18:02:53 +00:00
Tobias Koenig 5069b62a80 Make PixmapRequest::swap() public but mark it for internal usage.
svn path=/trunk/playground/graphics/okular/; revision=624665
2007-01-17 16:50:54 +00:00
Pino Toscano 135a18b407 get rid of supportsSearching() by using a proper feature
svn path=/trunk/playground/graphics/okular/; revision=624587
2007-01-17 11:58:20 +00:00
Pino Toscano 468a0da775 bye bye canGenerateTextPage(), unused nowadays
svn path=/trunk/playground/graphics/okular/; revision=624579
2007-01-17 11:34:47 +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
Pino Toscano 24ec1e37c5 Add the ability to read from standard input, eg
$ command_that_produce_a_document | okular -
Expand a but the Generator API so a generator can directly read from the raw data read from stdin. Generators that can not read from raw data will open the temporary file with the saved data.

svn path=/trunk/playground/graphics/okular/; revision=622774
2007-01-12 22:49:14 +00:00
Pino Toscano 18fab3d130 Improve the way we deal with generators that give the possibility to change the size of the pages: instead of let them destroy and recreate the pages (bad), ask them the sizes they support, then do the work ourselves and notify the generator when the work is done.
While I was at it, I changed from "paper size" to "page size", it should be better.

svn path=/trunk/playground/graphics/okular/; revision=620411
2007-01-05 23:12:06 +00:00
Pino Toscano 4b922367e2 Use a proper enum to deal with orientation/rotation all around okular.
svn path=/trunk/playground/graphics/okular/; revision=620312
2007-01-05 17:09:47 +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
Tobias Koenig 86a1fd3b69 Big cleanup of Document API and documentation:
* add full API docs
 * renamed getMetaData -> metaData
 * removed supportsRotation in Document and Generator
 * moved Permission and SearchDirection enums into separated header core/global.h

svn path=/trunk/playground/graphics/okular/; revision=619183
2007-01-02 22:37:55 +00:00
Tobias Koenig 77efd7dcb1 Cleaned up the Document API, moved all private members/methods/slots into
the d class.

svn path=/trunk/playground/graphics/okular/; revision=619100
2007-01-02 19:05:49 +00:00
Tobias Koenig 2aa8a4c31b Moved SourceReference into its own file
svn path=/trunk/playground/graphics/okular/; revision=619076
2007-01-02 17:45:32 +00:00
Tobias Koenig 472f4028c2 Add API documentations
svn path=/trunk/playground/graphics/okular/; revision=619073
2007-01-02 17:25:26 +00:00
Pino Toscano 915a48eb4d move the Generator configuration stuff into a new ConfigInterface
svn path=/trunk/playground/graphics/okular/; revision=619061
2007-01-02 17:14:37 +00:00
Pino Toscano d9a844d67c move the GUI stuff out of Generator in an own GuiInterface, and adapt the ghostscript generator to its usage; renamed also some methods to more Qt4-ish names.
svn path=/trunk/playground/graphics/okular/; revision=619044
2007-01-02 16:40:22 +00:00
Pino Toscano 475d000763 Improve the way a Generator can configure a printer: add an interface with the advanced printing stuff.
The print() method remains in Generator, as it's too basic to be moved in an interface.

svn path=/trunk/playground/graphics/okular/; revision=619033
2007-01-02 16:11:40 +00:00
Pino Toscano b6fdedc810 spell checking
svn path=/trunk/playground/graphics/okular/; revision=617287
2006-12-28 16:58:56 +00:00
Pino Toscano 94c9ffa3d7 do not explicitely include document.h in generator.h
svn path=/trunk/playground/graphics/okular/; revision=617283
2006-12-28 16:45:50 +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 274469dae8 Almost complete support for inverse search within okular.
THe system generally works; what is missing is a good activating strategy (added in TODO - our usability expert is working on that), and a GUI to configure the editor.
The DVI backend was adapted to use this new feature.
(The PDF backend will use it soon.)

svn path=/trunk/playground/graphics/okular/; revision=605708
2006-11-17 22:15:15 +00:00
Pino Toscano 2bd05e79d5 a generator can not block the gui events of the main page view, otherwise bad things will happen - it's also not really logic to allow such a thing, better think about something else if a generator wants to interact with the gui somehow
svn path=/trunk/playground/graphics/okular/; revision=600225
2006-10-29 22:33:24 +00:00
Pino Toscano 8def2109ec change the metaData() function of the Generator to use QVariant as type for the returned value and for the 'option' parameter, this gives more flexibility
svn path=/trunk/playground/graphics/okular/; revision=599847
2006-10-28 19:18:36 +00:00
Tobias Koenig a375953402 Adapt ghostview, kimgio, pdf, dvi, chm, xps and ooo generators to setImage()
svn path=/trunk/playground/graphics/okular/; revision=599090
2006-10-25 17:43:15 +00:00
Tobias Koenig d22b2f1892 A rather big change:
* Hide as much private API as possible in Generator, PixmapRequest and ExportEntry/Format
 * Renamed ExportEntry to ExportFormat and made it value based
 * Removed canExportToText() and exportToText() from Generator API and implemented this
   functionality in exportFormats()/exportTo() in the generators
 * Removed the orientation parameter from PixmapRequest and let the Document handle the rotation
   of the page (pixmap) instead

CCMAIL:okular-devel@kde.org

svn path=/trunk/playground/graphics/okular/; revision=599058
2006-10-25 15:35:53 +00:00
Pino Toscano 46a1ddc08e #include not needed
svn path=/trunk/playground/graphics/okular/; revision=598561
2006-10-23 23:03:02 +00:00
Pino Toscano a62cd3aa2f The internal search is a pretty bad concept, as the Document provides it for free
svn path=/trunk/playground/graphics/okular/; revision=598553
2006-10-23 22:26:31 +00:00
Pino Toscano 6983c298a7 a working debug stream operator for the PixmapRequest
svn path=/trunk/playground/graphics/okular/; revision=598087
2006-10-22 13:34:47 +00:00
Pino Toscano 18028a8a2c API change in the Generator: use an empty construct, and set the document for the generator right after its construction.
Add a protected method to get the document, and hide the real document pointer as private, so the generators can't redefine it.

svn path=/trunk/playground/graphics/okular/; revision=598025
2006-10-22 11:25:08 +00:00
Tobias Koenig fccd412d69 * Added documentation to Generator API
* Moved all implementations to generator.cpp
 * Added 'const' where it make sense
 * Adapted all generators (except gs)

svn path=/trunk/playground/graphics/okular/; revision=597525
2006-10-20 16:51:46 +00:00
Albert Astals Cid 5143cd2512 Report page size
It's only reported in case it makes sense for the format
Only implemented for pdf atm
If all pages have the same size it's reported on document properties
else there's a label shown in the new bottom bar with the size of the current page

svn path=/trunk/playground/graphics/okular/; revision=595822
2006-10-15 19:37:14 +00:00
Pino Toscano c52a0e622b Change the way we rotate the pages.
Instead of telling the generators to do the work themselves (that was usually destraoying the ld pages and creating the new ones), now we just rotate the page objects deleting only their "mutable" contents.
This way, generators can just return true in their supportRotation() to make okular rotate the pages for them for free. Of course they still have to generate the page pixmaps according to the given page rotation.
Now, there's a new rotationChanged() function in the Generator API so generator that needs it can be norified about the document rotation changing.

CCMAIL: developers@okular.org

svn path=/trunk/playground/graphics/okular/; revision=593632
2006-10-08 15:07:23 +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 b6d7a36eda Small addition to the Ganarator API: bool closeDocument().
Now every generator has to implement this one and put (if necessary) all the code for cleaning up all the stuff related to the currently open document.
For now the return value it is not read, but generators as strongly suggested to return tru o false, whether all the operations in there went fine.

svn path=/trunk/playground/graphics/okular/; revision=562210
2006-07-14 10:54:29 +00:00
Pino Toscano b3a4b27956 New skeleton for giving the generators the possibility to export the document they open in some format they support.
The text exporting option is detached from that other options and always visible (disabled if not supported), so it could be easier for the user to find it out.

svn path=/trunk/playground/graphics/okular/; revision=556922
2006-07-01 22:17:53 +00:00
Pino Toscano 066beaa1dd small changes in the Generator API:
- no need for a private empty constructor
- move the signalRequestDone 'signal' to a protected visibility, as it's not meant to be called from outside a generator
- KPDF_EXPORT_PLUGIN -> OKULAR_EXPORT_PLUGIN

svn path=/trunk/playground/graphics/okular/; revision=553077
2006-06-19 22:15:07 +00:00
Pino Toscano b1973c5078 some kpdf -> okular (mostly in comments)
svn path=/trunk/playground/graphics/okular/; revision=551881
2006-06-15 21:24:00 +00:00
Pino Toscano 2a68297ce5 SVN_SILENT a bit less of mess
svn path=/branches/work/kde4/playground/graphics/okular/; revision=549949
2006-06-10 13:35:01 +00:00
Pino Toscano 60eab90248 small API changes to Generator:
- more const'ness in signals
- no need to redeclare the signals in the generators, as they are already in Generator

svn path=/branches/work/kde4/playground/graphics/okular/; revision=549941
2006-06-10 12:59:09 +00:00
Pino Toscano 09bf08b3e6 small API change for Generator: getText() just return a QString instead of a QString*, as QString is already implicitely shared
svn path=/branches/work/kde4/playground/graphics/okular/; revision=549935
2006-06-10 12:14:23 +00:00
Albert Astals Cid cb7ca95e94 pages have orientation
document has a rotation to apply over the page's own orientation
text search really works now when rotating (at least all my tests here worked)

svn path=/branches/work/kde4/playground/graphics/okular/; revision=547644
2006-06-02 20:42:57 +00:00
Albert Astals Cid 13dde4096f use the nice code brad wrote for poppler that allows you to extract embedded files from a pdf document.
svn path=/branches/work/kde4/playground/graphics/okular/; revision=545966
2006-05-28 16:54:54 +00:00
Pino Toscano aca01f331f Support for visibility in oKular; oKular compiles and links, but it seems no plugins are found.
At the moment, the exported classes are only the one needed to make oKular and its actual plugins link, nothing more. Probably some other classes could be made visibile, but I'm not an expert about that.

svn path=/branches/work/kde4/playground/graphics/okular/; revision=538771
2006-05-08 20:12:04 +00:00
Albert Astals Cid c8a4e8e0b8 need to export that
svn path=/branches/work/kde4/playground/graphics/okular/; revision=522373
2006-03-25 11:05:39 +00:00
Albert Astals Cid 178bab06cb core builds
svn path=/branches/work/kde4/playground/graphics/okular/; revision=521179
2006-03-21 20:00:24 +00:00
Albert Astals Cid b412aba1f1 more proting, area.h still resists me
svn path=/branches/work/kde4/playground/graphics/okular/; revision=520833
2006-03-20 22:51:56 +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 3cbcb2fb7f - update openDocument and freegui stuff
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=455516
2005-08-31 18:13:59 +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
Enrico Ros bd81ccaed7 merged patch_064,065,066,068,075,091,092 (tinyurl.com/8t5ec)
svn path=/branches/kpdf/annotations/kdegraphics/kpdf/; revision=428594
2005-06-24 16:45:25 +00:00
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
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 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
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 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