Commit graph

546 commits

Author SHA1 Message Date
Michel Ludwig e8e0237ca0 Add the possibility to show sources location graphically on the rendered pages.
Note that currently the rotation of pages is not taken into account as one still has
to find a unique way of handling this.
2011-10-17 20:56:45 +01:00
Michel Ludwig 0e29008150 Initial commit of the 'ViewerInterface' and of a first implementation. 2011-09-10 18:15:52 +01:00
Albert Astals Cid 258cd6562a Core work for Reset Forms Action support
Heavily inspired in Guillermo Amaral patches
CCMAIL: gamaral@kde.org
2011-08-25 02:24:38 +02:00
Montel Laurent f9f65979f5 Normalize signals/slots 2011-07-31 21:22:04 +02:00
Kevin Kofler e001fbab55 Fix landscape documents getting printed in portrait format if "Landscape" is selected in the print dialog (the default).
Partly based on a patch by Falk from KDE bug #181290.

BUG: 181290
REVIEW: 101513
2011-07-28 01:41:48 +02:00
David Palacio db7d8ff608 Test if the file is readable if it is a regular file.
*REVIEW: 6667

svn path=/trunk/KDE/kdegraphics/okular/; revision=1230523
2011-05-05 20:51:05 +00:00
Pino Toscano 96ae09cfde ignore setViewport() for page numbers out of the document
CCBUG: 266133

svn path=/trunk/KDE/kdegraphics/okular/; revision=1220028
2011-02-12 14:49:32 +00:00
Pino Toscano 40d20ca58d in each page, add a pointer to the owner document
svn path=/trunk/KDE/kdegraphics/okular/; revision=1217914
2011-01-29 15:38:18 +00:00
Albert Astals Cid 6f3667b9d7 forwardport r1216334 okular/branches/KDE/4.6/kdegraphics/okular/core/document.cpp:
use prettyUrl to get a prettier url

svn path=/trunk/KDE/kdegraphics/okular/; revision=1216336
2011-01-22 18:46:56 +00:00
Albert Astals Cid fab89241b2 Implement memory functions for freebsd
Patch by Alberto Villa
BUGS: 218418

svn path=/trunk/KDE/kdegraphics/okular/; revision=1207422
2010-12-18 01:07:33 +00:00
Pino Toscano ba0dd22f71 when archiving, resolve the symlink if the document path is that
CCBUG: 245243

svn path=/trunk/KDE/kdegraphics/okular/; revision=1161859
2010-08-10 23:49:30 +00:00
Albert Astals Cid 4e551e6867 Improve error message
svn path=/trunk/KDE/kdegraphics/okular/; revision=1148688
2010-07-11 15:32:43 +00:00
Albert Astals Cid 25f95bbc9f duplicate code is evil
svn path=/trunk/KDE/kdegraphics/okular/; revision=1115314
2010-04-15 22:26:58 +00:00
Albert Astals Cid 3583f6010a move from virtual to slot to not kick ABI in the nuts
svn path=/trunk/KDE/kdegraphics/okular/; revision=1114947
2010-04-14 23:33:14 +00:00
Albert Astals Cid 0f0cacd63a add a way to generators give a bit more info of why printing failed
and implement it in the pdf generator, others welcome to implement the function
for other generators

svn path=/trunk/KDE/kdegraphics/okular/; revision=1114944
2010-04-14 23:07:27 +00:00
Glen Kaukola 45c82f8636 Krazy: Check for spelling errors
svn path=/trunk/KDE/kdegraphics/okular/; revision=1110329
2010-04-02 18:49:13 +00:00
Pino Toscano 7a88256b35 use abs() before comparing to the current time, otherwise the comparison will always fail when the midnight passes
svn path=/trunk/KDE/kdegraphics/okular/; revision=1105306
2010-03-19 19:52:38 +00:00
Albert Astals Cid 667e07a343 setAttribute with doubles is evil as it uses the current locale and we don't want that, use QString::number
BUGS: 211990

svn path=/trunk/KDE/kdegraphics/okular/; revision=1050633
2009-11-17 19:37:57 +00:00
Albert Astals Cid b9d749bc0d Commit "Document information" patch by Luigi Toscano, 8 months without a nack from any devel and i like it, so let's commit it
Luigi's mail says
********
The attached patch changes a bit the handling of document informations 
and the informations shown in the info page.
- document path is added to the information and a button allows you to 
toggle between to file name (default) and the complete path;
- the number of the page is added to the information set by 
documentInfo() and not by the properties dialog (so the latter will not 
modify datas);
- the order of the information shown is the fixed now (see 
orderedProperties).
*********

Then there are a few things of my own since some const here and there and adding three values to Key enum

Also it fixes wish 208999
BUGS: 208999

svn path=/trunk/KDE/kdegraphics/okular/; revision=1049872
2009-11-16 00:46:33 +00:00
Albert Astals Cid 4041eb7f5b empty the pixmaps queue stack before doing the loop waiting for executing pixmap requests to empty, otherwise a single shot timed call to sendGeneratorRequest can kick us in the back cause bad things to happen, ranging from crashes to the app waiting forever in the loop
Patch provided by pino and tested by me
BUG: 212066

svn path=/trunk/KDE/kdegraphics/okular/; revision=1047671
2009-11-11 19:36:58 +00:00
Albert Astals Cid a79fe451fd check the search we are doing is still alive, otherwise doesn't make sense to keep on doing it and even more doing so might make us crash
svn path=/trunk/KDE/kdegraphics/okular/; revision=1045410
2009-11-06 00:19:10 +00:00
Albert Astals Cid 0b1124c4a8 do not accept new pixmap requests if we are shutting down
svn path=/trunk/KDE/kdegraphics/okular/; revision=1041420
2009-10-27 23:38:13 +00:00
Albert Astals Cid 10ba02cbd5 in case we have a new enough poppler give a better error message when we can't save files with /Encrypt
BUGS: 208119

svn path=/trunk/KDE/kdegraphics/okular/; revision=1037771
2009-10-19 23:00:52 +00:00
Pino Toscano 90074bef90 check the actual mime type names and not their pointers
BUG: 210882

svn path=/trunk/KDE/kdegraphics/okular/; revision=1037414
2009-10-19 00:20:18 +00:00
Albert Astals Cid 27830a988e Add a [hidden] config option to set hinting to fonts
Defaults to disabled
Made the dvi and pdf backends honor the hinting setting

svn path=/trunk/KDE/kdegraphics/okular/; revision=1032936
2009-10-08 21:55:51 +00:00
Albert Astals Cid b55024cfd7 Do not start a search if it's already running
BUGS: 203142

svn path=/trunk/KDE/kdegraphics/okular/; revision=1009822
2009-08-10 22:28:54 +00:00
Armin Berres 555cb3c9a1 add synctex support for pdf files
svn path=/trunk/KDE/kdegraphics/okular/; revision=1003016
2009-07-27 14:15:33 +00:00
Pino Toscano df230edd3a fix signal/slot connection
svn path=/trunk/KDE/kdegraphics/okular/; revision=990840
2009-07-03 12:51:56 +00:00
Pino Toscano b2472bef0d check that the rotation page notification really refers to a page of a document
fixes crash when rotating documents opened in one of more than one okular tabs in konqueror

svn path=/trunk/KDE/kdegraphics/okular/; revision=989681
2009-06-30 17:21:55 +00:00
Pino Toscano dc7583eb8b Add the concept of "next destination" next to the "next viewport" one.
This allows a resolution, if set, of that named destination when opening a document.
CCBUG: 192032

svn path=/trunk/KDE/kdegraphics/okular/; revision=967542
2009-05-13 14:24:30 +00:00
Pino Toscano 42afd676d9 handle relative file names in source reference links correctly
svn path=/trunk/KDE/kdegraphics/okular/; revision=942963
2009-03-23 01:22:17 +00:00
Pino Toscano 4d48c59a34 now that we have a small "progress" animation next to the search line edit in the find bar, there's no need for the "searching for ..." dialog
feedback about this new "notification" is much welcome
CCBUG: 155858

svn path=/trunk/KDE/kdegraphics/okular/; revision=926301
2009-02-15 00:38:24 +00:00
Patrick Spendrin 3330a5f992 fix crash in okular - forward port r923029
svn path=/trunk/KDE/kdegraphics/okular/; revision=923031
2009-02-08 02:36:04 +00:00
Pino Toscano e449fd1ef0 on document closing, clear the fifo with allocated text pages
(fixes potential crash because of references to potentially non-existing pages in the next open document)

svn path=/trunk/KDE/kdegraphics/okular/; revision=923020
2009-02-08 01:32:49 +00:00
Pino Toscano 3b905e3cf4 undefine the internal macros at the end
svn path=/trunk/KDE/kdegraphics/okular/; revision=908738
2009-01-10 11:32:54 +00:00
Pino Toscano 46a2bb5273 When the loaded document is empty, consider its loading as failed.
(Added a TODO for a proper UI message.)
BUG: 179447

svn path=/trunk/KDE/kdegraphics/okular/; revision=904821
2009-01-03 10:17:15 +00:00
Pino Toscano cba63bd669 Pass the plugin keyword when creating generators.
This should make the Ruby binding work again.

BUG: 177537

svn path=/trunk/KDE/kdegraphics/okular/; revision=895926
2008-12-12 00:16:20 +00:00
Pino Toscano 769a70956f add more checks against invalid viewports
fix crash when activating some of the toc items in the testcase of #176513 (still it would be nice to know why they are "void" items"...)

svn path=/trunk/KDE/kdegraphics/okular/; revision=890803
2008-11-30 11:28:08 +00:00
Pino Toscano 52a666f073 When starting an incremental search, do not consider the start page "done" if there was a match in it.
svn path=/trunk/KDE/kdegraphics/okular/; revision=890800
2008-11-30 11:02:02 +00:00
Patrick Spendrin d7c9bcb596 under windows there is no gid yet
svn path=/trunk/KDE/kdegraphics/okular/; revision=885793
2008-11-17 22:16:28 +00:00
Pino Toscano e5b13e2d5b claim support for application/vnd.kde.okular-archive in the correct way, ie via .desktop files
thanks Albert for waking me up

svn path=/trunk/KDE/kdegraphics/okular/; revision=884982
2008-11-16 13:19:35 +00:00
Pino Toscano 938ed4acfa claim support of the new application/vnd.kde.okular-archive mimetype, and check it where appropriate
svn path=/trunk/KDE/kdegraphics/okular/; revision=884851
2008-11-16 01:17:48 +00:00
Pino Toscano b6c5ba1bc8 Add API to load and save "document archives", ie an .okular archive with document and metadata (currently annotations).
Few missing to be done in it:
- more checks when saving
- make it use a proper mimetype

CCBUG: 151614

svn path=/trunk/KDE/kdegraphics/okular/; revision=884597
2008-11-15 14:15:31 +00:00
Pino Toscano acab77c691 add a loadDocumentInfo() variant that takes the file name to read stuff from, and make the non-parameters one calling the new one
svn path=/trunk/KDE/kdegraphics/okular/; revision=884461
2008-11-15 00:34:03 +00:00
Laurent Montel c2fc9836e8 Fix iterator
svn path=/trunk/KDE/kdegraphics/okular/; revision=882957
2008-11-11 18:48:40 +00:00
Pino Toscano 9d8c52b5eb Shuffle a bit the way documents are opened:
- when there are no backends for handling the document mimetype, try harder using the mimetype from the file content only
- when the backend fails loading, try again with the backend that handles the mimetype of the file content
BUG: 166034

svn path=/trunk/KDE/kdegraphics/okular/; revision=881991
2008-11-09 14:21:20 +00:00
Pino Toscano 5542445f04 replace the home-made placeholder replacements with KMacroExpander+KShell, and use KProcess
svn path=/trunk/KDE/kdegraphics/okular/; revision=873601
2008-10-19 19:40:17 +00:00
Pino Toscano 4da5b7a105 Add a configuration page for the text editor used for source references links (that is, the ones used also for inverse search).
Factor out the editor commands structure.

svn path=/trunk/KDE/kdegraphics/okular/; revision=873570
2008-10-19 18:01:16 +00:00
Pino Toscano 97335bf267 simple optimization in the Google-like search: split the search terms just once
svn path=/trunk/KDE/kdegraphics/okular/; revision=873283
2008-10-19 10:07:48 +00:00
Pino Toscano e0f2e1dd13 disable the "no results found" dialog when searching. search users should use the proper signal to get the search result (and do proper feedback)
CCBUG: 155858

svn path=/trunk/KDE/kdegraphics/okular/; revision=870011
2008-10-11 15:03:46 +00:00
Pino Toscano 27e703f878 always deal with memory measures as ulonglong, this way systems with >4 GB of memory work for real now
svn path=/trunk/KDE/kdegraphics/okular/; revision=867871
2008-10-04 19:31:36 +00:00
Pino Toscano d3b0b62cfc Make Okular able to distinguish the LilyPond "Point and click" links,
and make them act as source references when activated.

FEATURE: 163569

svn path=/trunk/KDE/kdegraphics/okular/; revision=863572
2008-09-22 13:41:28 +00:00
Pino Toscano 0eab41cc97 do not use the specified widget as parent for the Document, but just keep it
svn path=/trunk/KDE/kdegraphics/okular/; revision=863377
2008-09-21 22:44:42 +00:00
Pino Toscano 6fe1576442 Correctly get the filename from the original url, not from the local file name of the real file being open.
BUG: 168068

svn path=/trunk/KDE/kdegraphics/okular/; revision=842324
2008-08-05 09:15:24 +00:00
Albert Astals Cid 61964b930f And now okular coupled with poppler from 5 minutes ago has the hability to let you save to file fonts embedded into a pdf file
svn path=/trunk/KDE/kdegraphics/okular/; revision=840789
2008-08-01 20:26:22 +00:00
Pino Toscano 4d1a48cddb when saving the internal xml, be sure to save it as utf-8, and to advertize the encoding in the main processing instruction
svn path=/trunk/KDE/kdegraphics/okular/; revision=839566
2008-07-30 10:57:08 +00:00
Pino Toscano 8bad2a8629 & is different than |
fix a condition that made the view loading and saving vanish into the hyperspace

BUG: 167220

svn path=/trunk/KDE/kdegraphics/okular/; revision=836658
2008-07-22 18:14:44 +00:00
Pino Toscano 830fcef561 handle relative paths in browse actions, second and hopefully better try
svn path=/trunk/KDE/kdegraphics/okular/; revision=817344
2008-06-05 20:22:46 +00:00
Pino Toscano 3cc607ff69 handle relative paths in browse links, as shown by the testcase provided by knusperfrosch
and, btw, master dfaure rocks once again!

svn path=/trunk/KDE/kdegraphics/okular/; revision=817340
2008-06-05 20:08:07 +00:00
Pino Toscano e4dc8d8126 Load and save in the XML document info all the properties of the various View's, that are specific to each document.
At the moment, they are the zoom mode and level of the page view.
BUG: 155752

svn path=/trunk/KDE/kdegraphics/okular/; revision=814998
2008-05-31 21:13:15 +00:00
Pino Toscano afc6f89727 Check whether the document to open is absolute as first thing, so we can open it directly even with no document open.
BUG: 162459

svn path=/trunk/KDE/kdegraphics/okular/; revision=811109
2008-05-22 10:23:41 +00:00
Pino Toscano 18f486c2c1 add the possibility to store an useful bounding box of a page, and for generators to notify the document (and its observers) on its change
original patch by kde2eran@tromer.org, thanks!
CCMAIL: kde2eran@tromer.org

svn path=/trunk/KDE/kdegraphics/okular/; revision=809467
2008-05-18 23:06:21 +00:00
Albert Astals Cid bb23209234 limit the number of text pages we keep in memory so that searching does not bring your system to its knees
BUG: 161213

svn path=/trunk/KDE/kdegraphics/okular/; revision=803949
2008-05-04 15:10:32 +00:00
Pino Toscano e13e74db92 add a private slot for hooks on config change
svn path=/trunk/KDE/kdegraphics/okular/; revision=803946
2008-05-04 15:02:35 +00:00
Albert Astals Cid 3fd8f39b77 make sure we don't detach
svn path=/trunk/KDE/kdegraphics/okular/; revision=801823
2008-04-27 21:01:05 +00:00
Albert Astals Cid 048a879e32 Fordwardport commit 801781:
Correctly calculate the amount of memory to free, should fix bug 153675

svn path=/trunk/KDE/kdegraphics/okular/; revision=801782
2008-04-27 18:08:14 +00:00
Pino Toscano 5851ddf6a8 Start a View class for managing the "views" of a document.
Provide ways to register & unregister the view from a Document, and to get/set the view capabilities.

svn path=/trunk/KDE/kdegraphics/okular/; revision=801657
2008-04-27 11:05:59 +00:00
Pino Toscano 39463af93b stop the audio playbacks when closing the current document, not just once when exiting
svn path=/trunk/KDE/kdegraphics/okular/; revision=797093
2008-04-14 21:58:14 +00:00
Pino Toscano 513c7cf225 Add a scripter class to execute scripts on request.
Trigger its execution at the document loading, if there are "top level" scripts,
and when a script action is activated.

svn path=/trunk/KDE/kdegraphics/okular/; revision=796637
2008-04-13 22:31:59 +00:00
Malcolm Hunter 2f62610563 More typo fixes
svn path=/trunk/KDE/kdegraphics/okular/; revision=795917
2008-04-11 22:09:50 +00:00
Malcolm Hunter b6124a900b Typo fixes
svn path=/trunk/KDE/kdegraphics/okular/; revision=795906
2008-04-11 21:16:43 +00:00
Pino Toscano 8a858a9449 Core implementation of the backward text search, to be used now in the search bar.
Works pretty well -- the only problem left is that when changing the search direction, the first match is the current match.

svn path=/trunk/KDE/kdegraphics/okular/; revision=785629
2008-03-14 14:14:06 +00:00
Pino Toscano 8b6a259b48 Add a continueSearch() for optionally changing the search direction
svn path=/trunk/KDE/kdegraphics/okular/; revision=785619
2008-03-14 13:57:01 +00:00
Pino Toscano 87fc624534 count only the consecutive pages with no search results
svn path=/trunk/KDE/kdegraphics/okular/; revision=785613
2008-03-14 13:47:18 +00:00
Pino Toscano c9089f3160 Add the possibility to save a copy of the document with the changes to it (only for form fields at the moment).
On the Document/Generator side, introduce a proper interface for the purpouse.

On the GUI side, add a new "Save As" function that save the changed document to a location.
The action is enabled only if the current backend can provide the functionality.

svn path=/trunk/KDE/kdegraphics/okular/; revision=784661
2008-03-11 23:40:59 +00:00
Pino Toscano e023effb15 Add a requestPixmaps() overload that takes options as flags.
This way we can tell to "merge" in a smart way the new pixmap request with the enqueued ones of the same ID.

Add a (private) slot to refresh all the pixmaps of a page.

svn path=/trunk/KDE/kdegraphics/okular/; revision=783259
2008-03-07 15:50:48 +00:00
Pino Toscano e9bd289993 Keep a list of the currently active pixmap requests (usually one at most), and wait for their finish when closing the document.
svn path=/trunk/KDE/kdegraphics/okular/; revision=769281
2008-02-01 00:43:45 +00:00
Pino Toscano a0a3c239e2 Standardize our naming: Okular.
CCMAIL: okular-devel@kde.org

svn path=/trunk/KDE/kdegraphics/okular/; revision=763904
2008-01-20 15:35:19 +00:00
Pino Toscano f238c3d95d Start adding a configuration to toggle anti-aliasing for both text and graphics.
Let the Document propagate these settings to the backends, if they query for them.

svn path=/trunk/KDE/kdegraphics/okular/; revision=757647
2008-01-05 15:50:40 +00:00
Pino Toscano 4a71603ab6 take the list of the supported mimetypes from the kpart .desktop, as they contain more mimetypes (including the compressed versions)
[the compressed versions are not in the "generator" .desktop files because okular can deal natively with any gzip- or bzip2- compressed version of the supported document types]

svn path=/trunk/KDE/kdegraphics/okular/; revision=755661
2008-01-02 00:37:51 +00:00
Pino Toscano 02dde1035c for now, don't create xml storage files for non-local urls, as the local name will always change
svn path=/trunk/KDE/kdegraphics/okular/; revision=755447
2008-01-01 16:22:29 +00:00
Pino Toscano 1aab311b5c Slightly change the indexes used to query the generator for fonts:
- 0..n-1 are the page indexes again
- -1 is for the fonts not reall belonging to a single page (or when no selective page extraction can be done)

svn path=/trunk/KDE/kdegraphics/okular/; revision=753866
2007-12-28 17:06:43 +00:00
Pino Toscano a8758221fe Return the current configuration for gfx and text antialias.
For now they are always true, as no GUI can be added due to feature+string freeze.

svn path=/trunk/KDE/kdegraphics/okular/; revision=749280
2007-12-16 23:36:12 +00:00
Pino Toscano fb2a432097 update the free memory check timer on win32 as well
svn path=/trunk/KDE/kdegraphics/okular/; revision=747259
2007-12-11 13:52:55 +00:00
Pino Toscano 66376cf31f make swap() private
svn path=/trunk/KDE/kdegraphics/okular/; revision=744918
2007-12-04 21:36:32 +00:00
Pino Toscano 6aa123656a Port the plugin system to the standard KDE factory and loader, getting rid of the custom system okular had so far.
This requires a generator to have a
  MyGenerator(QObject *parent, const QVariantList &args)
constructor in order to be successfully loaded.
The OKULAR_EXPORT_PLUGIN macro was adapted, and the generators to provide it the about data; the protected Generator::setAboutData() is no more needed.

Remove the 'lib' prefix from plugins, unneeded now.

CCMAIL: okular-devel@kde.org

svn path=/trunk/KDE/kdegraphics/okular/; revision=744169
2007-12-02 20:57:24 +00:00
John Layt 1b1ed9451b Enable Okular printing features:
* Add FilePrinter class to enable printing via postscript files
* DJVU, PDF, and PS backends print FilePrinter
* All backends enable printing of bookmarked pages
* Print and Print Preview actions enabled/disabled depending on backends
  printing ability

Note that FilePrinter only works on *NIX platforms with Cups, lpr, or lp.



svn path=/trunk/KDE/kdegraphics/okular/; revision=741990
2007-11-26 21:43:54 +00:00
Pino Toscano dfce0d1fcd centralize the way we know whether a generator is configurable, and properly manage i18n loading in that case
svn path=/trunk/KDE/kdegraphics/okular/; revision=741325
2007-11-25 12:49:30 +00:00
Pino Toscano 07dd3fe824 give the debug area to the kWarning() calls
svn path=/trunk/KDE/kdegraphics/okular/; revision=741314
2007-11-25 12:18:10 +00:00
Pino Toscano 1214468229 directly take the componentdata
svn path=/trunk/KDE/kdegraphics/okular/; revision=741313
2007-11-25 12:15:55 +00:00
Pino Toscano 1e08dc6a95 correctly check whether a generator was already loaded, even when no generator was previously loaded
fixes the ghostcript config page not showing when starting an empty okular

svn path=/trunk/KDE/kdegraphics/okular/; revision=741308
2007-11-25 12:08:37 +00:00
Pino Toscano ba7d0732c1 ignore any "empty" component data
svn path=/trunk/KDE/kdegraphics/okular/; revision=741067
2007-11-24 18:07:59 +00:00
Pino Toscano 2340d9c6d8 Save the rotation of the document, so when reopening the document the last rotation is kept.
This also fixed the problem of the lost rotation when reloading because of document change.

CCBUG: 151130

svn path=/trunk/KDE/kdegraphics/okular/; revision=731697
2007-11-01 16:15:34 +00:00
Christian Ehrlicher ec72d7e654 mingw compile++
warnings--

svn path=/trunk/KDE/kdegraphics/okular/; revision=731467
2007-10-31 19:44:35 +00:00
Pino Toscano 6d375af868 Move all the bookmarking stuff into the BookmarkManager, that now updates the Document observers automatically.
svn path=/trunk/KDE/kdegraphics/okular/; revision=730404
2007-10-28 18:31:33 +00:00
John Layt 070285e039 Port from KPrinter to QPrinter, remove dependency on KDE4_KDEPRINT_LIBS.
*** Note this is not a complete port, most of the generators use the 
printFiles method which Qt 4.3 does not support, these have simply
been commented out until we find a solution.  At least it removes
the dependency so we can remove from kdelibs.

svn path=/trunk/KDE/kdegraphics/okular/; revision=725660
2007-10-15 23:01:27 +00:00
Pino Toscano a5940e0132 correctly initialize the history; crash spotted by Bram, thanks!
svn path=/trunk/KDE/kdegraphics/okular/; revision=721277
2007-10-04 21:41:19 +00:00
Pino Toscano 27f624d1f7 check whether the document is open
svn path=/trunk/KDE/kdegraphics/okular/; revision=720717
2007-10-03 15:03:49 +00:00
Pino Toscano d51e9fa4d8 remove the private methods of PixmapRequest, and make the Document work with its private class
svn path=/trunk/KDE/kdegraphics/okular/; revision=719319
2007-09-30 21:44:31 +00:00
Pino Toscano 5dc92c5824 use qint64 for the document size
svn path=/trunk/KDE/kdegraphics/okular/; revision=719107
2007-09-30 10:49:38 +00:00
Pino Toscano 2584aaa43b cache the total memory on win32
svn path=/trunk/KDE/kdegraphics/okular/; revision=712851
2007-09-15 14:05:08 +00:00
Pino Toscano 78e2377a87 Add a method for generators to know some metadata of the document
adapted the poppler and the chm generators to use that, instead of fiddling with the settings class

svn path=/trunk/KDE/kdegraphics/okular/; revision=712614
2007-09-14 22:16:00 +00:00
Pino Toscano bb59c02642 nuke Document::continueLastSearch(), continueSearch(id) is enough
svn path=/trunk/KDE/kdegraphics/okular/; revision=712500
2007-09-14 15:40:00 +00:00
Pino Toscano f8ed5302ec - move the Document::requestDone() to the private class, as it's something internal to the generator work
- make the Generator internally keep an pointer to the private class Document, so we can access easily to the Document' stuff

svn path=/trunk/KDE/kdegraphics/okular/; revision=712498
2007-09-14 15:29:16 +00:00
Pino Toscano aaed55f037 extract the DocumentPrivate class in an own file
svn path=/trunk/KDE/kdegraphics/okular/; revision=712493
2007-09-14 15:17:36 +00:00
Pino Toscano 006111382b common d_ptr+q_ptr structure for Generator/TextDocumentGenerator, and their private classes
svn path=/trunk/KDE/kdegraphics/okular/; revision=712465
2007-09-14 13:31:55 +00:00
Pino Toscano f72692799e look for the old kpdf stuff only if the "new okular" stuff is not found
svn path=/trunk/KDE/kdegraphics/okular/; revision=710703
2007-09-10 17:20:58 +00:00
Pino Toscano b56ad8c3ae Change the DocumentObserver::notifySetup() to allow a better tuning of the different setup options (different layout for the pages, or different document).
svn path=/trunk/KDE/kdegraphics/okular/; revision=710227
2007-09-09 10:50:36 +00:00
Pino Toscano 2a29b247f7 save really few bytes
svn path=/trunk/KDE/kdegraphics/okular/; revision=709414
2007-09-07 13:13:50 +00:00
Pino Toscano bf9af4433d move deleteTextSelections() to the private class
svn path=/trunk/KDE/kdegraphics/okular/; revision=708155
2007-09-03 23:47:12 +00:00
Pino Toscano 0d7db7513b save the url of the document to its xml metadata file
svn path=/trunk/KDE/kdegraphics/okular/; revision=708039
2007-09-03 17:53:45 +00:00
Pino Toscano a8d747745f Cleanup a bit the GuiInterface, and making it work.
Instead of manually requestion actions and other stuff, we just make the interface as gui client, requesting and integrating it in the part gui.
Also, rename the Generator's componentData() to ownComponentData() to avoid clashing with KXMLGUIClient.

svn path=/trunk/KDE/kdegraphics/okular/; revision=705933
2007-08-28 23:17:00 +00:00
Pino Toscano 0ecdc5b3c6 add the searchId to the searchFinished() signal of the Document, so each search line edit can ignore any search not started by itself
svn path=/trunk/KDE/kdegraphics/okular/; revision=704015
2007-08-23 22:16:37 +00:00
Pino Toscano cd0dd24193 i18n fixes
rename 'freetext' to 'inline note'

svn path=/trunk/KDE/kdegraphics/okular/; revision=701876
2007-08-19 16:15:55 +00:00
Pino Toscano 96bb344e61 cache the free memory on Windows as well
svn path=/trunk/KDE/kdegraphics/okular/; revision=699973
2007-08-14 13:03:38 +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
Pino Toscano 6254f609d8 really return an int where we are going to return an int, not a bool
svn path=/trunk/KDE/kdegraphics/okular/; revision=694515
2007-07-30 22:29:41 +00:00
Pino Toscano 23337e1c71 move the number of maximum and saved history step into a single location for both
svn path=/trunk/KDE/kdegraphics/okular/; revision=691448
2007-07-23 17:12:20 +00:00
Pino Toscano 0e7aeb2ba8 no need to set a new rotation if it's equal to the currently set
svn path=/trunk/KDE/kdegraphics/okular/; revision=689135
2007-07-17 18:13:50 +00:00
Pino Toscano b41dcfeddc - store a pointer of the owning page in each annotation
- preliminary API for translating an annotation

svn path=/trunk/KDE/kdegraphics/okular/; revision=689133
2007-07-17 18:10:25 +00:00
Pino Toscano 3c009773ca __linux__ -> Q_OS_LINUX
svn path=/trunk/KDE/kdegraphics/okular/; revision=688273
2007-07-15 16:51:23 +00:00
Christian Ehrlicher eff4ffe995 win32 compile++
svn path=/trunk/KDE/kdegraphics/okular/; revision=688272
2007-07-15 16:47:55 +00:00
Pino Toscano b73555b7f3 Windows functions to get the amount of total and free memory.
Patch by Huhn Put, thanks!

CCMAIL: nhuh.put@web.de

svn path=/trunk/KDE/kdegraphics/okular/; revision=688271
2007-07-15 16:43:24 +00:00
Pino Toscano 905f6c0946 int -> qulongqlong for the memory sizes
svn path=/trunk/KDE/kdegraphics/okular/; revision=688263
2007-07-15 16:10:48 +00:00
Pino Toscano fea03a9bbd appName -> catalogName, even for the information we get from the about data
svn path=/trunk/KDE/kdegraphics/okular/; revision=687836
2007-07-14 13:47:11 +00:00
Pino Toscano 5387c50960 Make the Configure backends dialog working, of course if the generators have the proper support for "mutable" configuration.
svn path=/trunk/KDE/kdegraphics/okular/; revision=687065
2007-07-12 20:04:56 +00:00
Pino Toscano 43f83cb967 move the calculation of the number of configurable generators to the Document, and start to store the information about the configurability of a generator
svn path=/trunk/KDE/kdegraphics/okular/; revision=687014
2007-07-12 17:52:14 +00:00
Pino Toscano f76f15470a Add the file size to the document information that the generator may provide.
Avoid crashing if the generators provides no information.

(Implements part (a) of KPDF #140109.)

svn path=/trunk/KDE/kdegraphics/okular/; revision=686290
2007-07-10 23:49:37 +00:00
Pino Toscano ffd5ed0280 the dialog for choosing backend is private, so let its header be _p.h
svn path=/trunk/KDE/kdegraphics/okular/; revision=686276
2007-07-10 22:52:25 +00:00
Pino Toscano f5c216b19c extract the private class of AudioPlayer out of the implementation, so the Document can store the url of the current document;
disable the playing of external sounds for remote (non-local) documents;
simple compile fix in the embedded sound paying code

svn path=/trunk/KDE/kdegraphics/okular/; revision=686133
2007-07-10 18:24:18 +00:00
Pino Toscano 964424d62f stop gracefully the font extraction thread when closing a document or the properties dialog; make the thread deleting itself when finished
svn path=/trunk/KDE/kdegraphics/okular/; revision=685437
2007-07-08 21:22:37 +00:00
Pino Toscano 8a31e6f3f0 Allow the user to change the visible part(s) of the document by dragging the visible areas in the thumbnails, and to change the zoom of the document by Ctrl+wheel on them.
Patch by Diego R. Brogna, thanks a lot!

BUG: 135521

svn path=/trunk/KDE/kdegraphics/okular/; revision=685273
2007-07-08 14:25:08 +00:00
Pino Toscano e5037f45b1 Refator a bit the way Document and the generators use to read the font information from a document.
Instead of having a synchronous function that extracts all the information at once, use a function to read the fonts of a single page.
This way, we can get all the result step by step (aka page by page), and possibly in an asynchronous way.
The resuls of the font "scanning" are sent via signals, as well the end of the work.
So, instead of block waiting for the results of all the document at once, the Fonts tab in the properties dialog can have a progress bar with the progress, and the results (the fonts) that are added incrementally to the list.

Only two minor things are left:
- the process is always asynchronous at the moment, as the only generator that can provide this kind of information is the Poppler one (safe)
- there is no check for duplicate fonts
But they should be easy to solve.

svn path=/trunk/KDE/kdegraphics/okular/; revision=685002
2007-07-07 20:35:01 +00:00
Pino Toscano e9b9d78faa acutally save the document information *before* closing the document, otherwise we run into troubles if we access to anything the generator provided
svn path=/trunk/KDE/kdegraphics/okular/; revision=683143
2007-07-04 09:28:31 +00:00
Chusslove Illich 968760cb6c Auto-conversion to new KCmdLineArgs/KAboutData/KComponentData API (trunk/KDE). Watch for the few remaining QString to QByteArray assignments that will not compile without extra specification (typically needs .toLocal8Bit() or .toUtf8()).
svn path=/trunk/KDE/kdegraphics/okular/; revision=682260
2007-07-02 08:52:55 +00:00
Pino Toscano 3addf5ec7d const& for removePageAnnotations()
svn path=/trunk/KDE/kdegraphics/okular/; revision=668564
2007-05-26 19:25:18 +00:00
Pino Toscano 5cbdaa6dc7 some checks more, and small fixes
svn path=/trunk/KDE/kdegraphics/okular/; revision=668054
2007-05-24 22:52:29 +00:00
Laurent Montel 1a6db045cd Don't crash when we don't load file
(generator is null)
(It will better to disable action until we load generator I think)

svn path=/trunk/KDE/kdegraphics/okular/; revision=667872
2007-05-24 09:05:34 +00:00
Pino Toscano 95912893f0 remove compatibility with kpdf pre-kde 3.4
svn path=/trunk/KDE/kdegraphics/okular/; revision=667126
2007-05-21 22:07:28 +00:00
Pino Toscano 92204b4bb7 fix giveAbsolutePath() to properly recognize absolute paths
svn path=/trunk/KDE/kdegraphics/okular/; revision=667073
2007-05-21 19:51:30 +00:00
Pino Toscano 0d320f0b78 SVN_SILENT
use the kde debug system in a kde library

svn path=/trunk/KDE/kdegraphics/okular/; revision=665724
2007-05-17 18:27:25 +00:00
Pino Toscano c4ea50c99b Forwardport SVN commit 665684 by pino:
When getting the result of a pixmap request for an observer that went away in the meanwhile, don't create a memory entry for the pixmap, as we assume the allocated pixmaps fifo holds only descriptors for valid observers.

(fixed KPDF #143951)

svn path=/trunk/KDE/kdegraphics/okular/; revision=665685
2007-05-17 16:52:44 +00:00
Tobias Koenig 06e831a3c9 Add a new method DocumentInfo::set( enum, QString ) to get more
consistency in the documentation info.

svn path=/trunk/KDE/kdegraphics/okular/; revision=664233
2007-05-13 12:54:46 +00:00
Pino Toscano 8f03f0d0d7 try to lock the pixmap requests queue with a mutex, hoping to solve some of our problems
svn path=/trunk/KDE/kdegraphics/okular/; revision=663991
2007-05-12 21:40:38 +00:00
Pino Toscano 325b8711ea move the setTextSelections, setHighlight and deleteHighlights to the private class of Page, as they are private for now
svn path=/trunk/KDE/kdegraphics/okular/; revision=661486
2007-05-05 18:07:34 +00:00
Dirk Mueller 43a23a2de6 the usual "daily unbreak compilation"
svn path=/trunk/KDE/kdegraphics/okular/; revision=661101
2007-05-04 15:41:04 +00:00
Pino Toscano 6aaefb7f68 "pdf"/"pdf file" -> "document"
svn path=/trunk/KDE/kdegraphics/okular/; revision=660526
2007-05-02 23:06:38 +00:00
Pino Toscano b53ba3cd24 make widget() slightly safier, and pass it as parameter when running an url (closing a TODO item)
svn path=/trunk/KDE/kdegraphics/okular/; revision=660524
2007-05-02 22:56:51 +00:00
Pino Toscano 106e96240c rename (almost) every ActionFoo class to FooAction
exception to this is the ActionDocumentAction, renamed to DocumentAction and whose id is DocAction

svn path=/trunk/KDE/kdegraphics/okular/; revision=660523
2007-05-02 22:50:27 +00:00
Pino Toscano 892df34b19 any negative page number represents an invalid viewport
svn path=/trunk/KDE/kdegraphics/okular/; revision=660436
2007-05-02 18:21:15 +00:00
Pino Toscano e79cd474d9 move the Page rotating and changing page functions to the private class
svn path=/trunk/KDE/kdegraphics/okular/; revision=660214
2007-05-01 23:36:57 +00:00
Pino Toscano 7cfa67ecf4 improve a bit the Document::setPageSize API -- better pass the size, and not an index
svn path=/trunk/KDE/kdegraphics/okular/; revision=660208
2007-05-01 23:21:29 +00:00
Pino Toscano 0f4cd40e26 slotRotation -> setRotation
svn path=/trunk/KDE/kdegraphics/okular/; revision=660207
2007-05-01 23:09:45 +00:00
Pino Toscano dc4acc7b83 KLibrary::globalLibrary -> KLibrary::library
svn path=/trunk/KDE/kdegraphics/okular/; revision=660035
2007-05-01 11:22:22 +00:00
Pino Toscano 13d14942e6 first step of a KPDF -> okular conversion: copy the data file for the document to be opened to the new place
svn path=/trunk/KDE/kdegraphics/okular/; revision=656648
2007-04-21 23:07:44 +00:00
Pino Toscano 7e3b7236fb fix sillyness happened when renaming ;(
svn path=/trunk/KDE/kdegraphics/okular/; revision=656251
2007-04-20 19:32:09 +00:00
Pino Toscano 9134ad4669 make the Document access to the private class of Generator, so we can get rid of the public setDocument
svn path=/trunk/KDE/kdegraphics/okular/; revision=656222
2007-04-20 17:26:04 +00:00
Pino Toscano 0e12746a92 Link -> Action renaming.
TextDocumentConverter::addLink -> addAction
Document::processLink -> processAction

svn path=/trunk/KDE/kdegraphics/okular/; revision=656145
2007-04-20 12:49:17 +00:00
Pino Toscano 5f21b15d99 Link -> Action renaming.
Step #2: Link -> Action for the action hierarchy, and for the ObjectRect type.

svn path=/trunk/KDE/kdegraphics/okular/; revision=656140
2007-04-20 12:37:12 +00:00
Pino Toscano f3e484082d Link -> Action renaming.
Step #1: link.(cpp|h) -> action.(cpp|h)

svn path=/trunk/KDE/kdegraphics/okular/; revision=656123
2007-04-20 11:26:05 +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 3f84c8ccad move modifyAnnotation to the private class
svn path=/trunk/KDE/kdegraphics/okular/; revision=655132
2007-04-17 19:55:18 +00:00
Pino Toscano acd19bc8f7 move the Page serialization functions to the private class, and make Document access to them
svn path=/trunk/KDE/kdegraphics/okular/; revision=653988
2007-04-14 19:58:17 +00:00
Pino Toscano efb6a5bcc6 rename Document::Private to DocumentPrivate
svn path=/trunk/KDE/kdegraphics/okular/; revision=653987
2007-04-14 19:44:07 +00:00
Pino Toscano ff25e151c5 new kdelibs API
svn path=/trunk/playground/graphics/okular/; revision=649300
2007-04-02 13:50:40 +00:00
Albert Astals Cid 5365f79d6d fordwardport r648173 kpdf/branches/KDE/3.5/kdegraphics/kpdf/ (4 files in 3 dirs):
Give KMessageBoxes a parent widget.
DVI plugin is missing 4 messageboxes, some work has to be done to get them know the document() so they can call widget()

svn path=/trunk/playground/graphics/okular/; revision=648175
2007-03-30 17:46:50 +00:00
Pino Toscano 36b894c75a Create a (private) PageController that handles the rotation jobs from all the pages.
This removes the needs for Page to be a QObject (it's the PageController that connects to the jobs and emits the right signals), so it again a "cheap" object.

svn path=/trunk/playground/graphics/okular/; revision=646010
2007-03-24 10:47:22 +00:00
Pino Toscano 49c2a80585 keep the name of the current generator, and make it possible to load the custom translation of the backend
svn path=/trunk/playground/graphics/okular/; revision=641598
2007-03-11 22:35:14 +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 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 bc8036dc62 they are constant methods, so let them be 'const'
svn path=/trunk/playground/graphics/okular/; revision=641248
2007-03-10 17:25:14 +00:00
Pino Toscano 6d16cfd1f6 krazy issues
svn path=/trunk/playground/graphics/okular/; revision=641195
2007-03-10 13:51:47 +00:00
Pino Toscano 1ac4578301 init the debug area number
svn path=/trunk/playground/graphics/okular/; revision=641179
2007-03-10 11:52:12 +00:00
Brad Hards 7f373a206a Minor cleanups - stray whitespace, use the debug area
for kDebug(), don't use kWarning() for general debugging.

svn path=/trunk/playground/graphics/okular/; revision=641120
2007-03-10 05:38:23 +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 1a0cd8acbd SVN_SILENT help debugging
svn path=/trunk/playground/graphics/okular/; revision=637697
2007-02-27 12:56:16 +00:00
Pino Toscano 7e4b9d2170 a small copy&paste error that broke the Google-any search
svn path=/trunk/playground/graphics/okular/; revision=632854
2007-02-12 14:19:31 +00:00
Pino Toscano 1d27a90fd3 a slightly better usage of the Qt containers, saving also some lookups when using the QMap's
svn path=/trunk/playground/graphics/okular/; revision=632853
2007-02-12 14:15:51 +00:00
Pino Toscano e9bcc53bc1 a pair of "cleanups" when deleting a Document
svn path=/trunk/playground/graphics/okular/; revision=630505
2007-02-05 15:54:19 +00:00
Pino Toscano 1e7cb0b2eb First version of an audio player for okular, able to play the sounds in the documents.
At the moment is quite simple and works only for external sounds.
Activate the sound playing when processing links and when switching pages in presentation mode only.

svn path=/trunk/playground/graphics/okular/; revision=630315
2007-02-05 00:49:40 +00:00
Albert Astals Cid 1587b9605a unnecessary but fun small optimizations, basically avoid unnecessary detach() calls by ensuring the const method is called
also remove a double search on a qmap

svn path=/trunk/playground/graphics/okular/; revision=629869
2007-02-03 23:09:40 +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
Pino Toscano 63cc92be1c isolate the generator unloading code
svn path=/trunk/playground/graphics/okular/; revision=628576
2007-01-30 12:43:43 +00:00
Pino Toscano 23d666cf7f move the DRM skip checks to the Document
svn path=/trunk/playground/graphics/okular/; revision=628208
2007-01-29 14:28:58 +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 10a6e3943e SVN_SILENT small #include cleanup
svn path=/trunk/playground/graphics/okular/; revision=627931
2007-01-28 16:47:13 +00:00
Pino Toscano e0cb30ffbf Ok, now really load the generators that are supposed to have a setting widget when we want to configure them.
svn path=/trunk/playground/graphics/okular/; revision=627921
2007-01-28 16:10:12 +00:00
Pino Toscano d6e7010942 Refactor a bit the way we load the generator libraries: hide the hash with the Generator completely into the Document, so the Document have the complete control over them.
Add fillConfigDialog() and supportedMimeTypes() to the Document, so the Part can get all the info it needs with no need to own the generator structure.
This also loads all the generators when asking for their config widget, but that can be improved easily now; furthermore, all the generators used to load documents are kept.

svn path=/trunk/playground/graphics/okular/; revision=627909
2007-01-28 15:46:10 +00:00
Tobias Koenig 6541b015e4 Make failing to open a document a bit nicer ;)
svn path=/trunk/playground/graphics/okular/; revision=627477
2007-01-26 18:35:28 +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 7d15f12fe0 - don't reset the pixmap memory descriptors when rotating, as the pixmaps are rotated thus the memory is preserved
- no need to notify about clearing annotations when changing page size

svn path=/trunk/playground/graphics/okular/; revision=624743
2007-01-17 23:06:40 +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 e0e8803092 A bit ugly hack to make it compile better.
BUG: 140189

Tobias, any better solution than the previous situation?
CCMAIL: tokoe@kde.org

svn path=/trunk/playground/graphics/okular/; revision=624631
2007-01-17 14:20:00 +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 8a7c2ad654 As requested by our usability expert Florian, add a Bookmarks menu with the bookmarks in the current document, if any.
svn path=/trunk/playground/graphics/okular/; revision=622995
2007-01-13 17:28:54 +00:00
Pino Toscano afc18f9d97 Re-add the possibility to toggle a page bookmark quickly (ie with the popup menu).
svn path=/trunk/playground/graphics/okular/; revision=622945
2007-01-13 14:45:51 +00:00
Pino Toscano 91b7675c14 configurationWidget() is too generic -> rename to printConfigurationWidget()
svn path=/trunk/playground/graphics/okular/; revision=622782
2007-01-12 23:48:29 +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
Pino Toscano 64769a62ce let the Document forward the BookmarkManager signal
svn path=/trunk/playground/graphics/okular/; revision=620158
2007-01-05 12:51:58 +00:00
Pino Toscano 81694d6a83 donìt leak in the google-like searches
svn path=/trunk/playground/graphics/okular/; revision=619924
2007-01-04 18:59:31 +00:00
Pino Toscano 9f8ea8b546 don't leak when doing AllDocument/FindNext searches
svn path=/trunk/playground/graphics/okular/; revision=619897
2007-01-04 18:13:00 +00:00
Pino Toscano 4aa85cdb49 One single char remove to create correctly the queue of pixmap requests: new asynchronous requests goes as last one in the group of other with the same priority.
Thus, if an observer requests eg pixmap for pages 2 and 3, now they are generated in the correct order the observer specified, and not in the reversed one.
Then, revert part of r619673, as the order is fixed now.

svn path=/trunk/playground/graphics/okular/; revision=619810
2007-01-04 14:28:54 +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
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 539921bdf6 Improving the bookmark capabilities of okular.
Adding a BookmarkManager class that takes care of handling them in a proper way.
Adding a new tab in the sidebar to manage them:
- shows all the bookmarks in all the documents, or just in the current document
- cliking on a bookmark will bring to that bookmark, loading the document if necessary
- editing a bookmark title is possible either using F2 or right click -> Rename
- right click -> Remove to remove a bookmark
The only way to add new bookmark for the moment is the "old" way, ie right click -> Add bookmark, and it's not possible add more than one bookmark per page (but the system does not limit that).
The whole system should not be too difficult to understand, I will check with our usability master Florian next days.

svn path=/trunk/playground/graphics/okular/; revision=616979
2006-12-27 16:04:49 +00:00
André Wöbbeking 6e7d98b829 adapt to Aaron's kdelibs changes
svn path=/trunk/playground/graphics/okular/; revision=616901
2006-12-27 10:03:34 +00:00
Pino Toscano b7328d7234 add an handy DocumentViewport::isValid() and use it where possible instead of doing checks manually
svn path=/trunk/playground/graphics/okular/; revision=616667
2006-12-26 12:26:49 +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
Tobias Koenig 9969547b0c * observer API cleanup
* removed NotifyRequest, that looked more like a hack than a solution
  (see comment in ghostscript generator)

svn path=/trunk/playground/graphics/okular/; revision=608235
2006-11-27 08:12:39 +00:00
Tobias Koenig 81fb3a383b Further cleanup of Page API:
* getAnnotations() -> annotations()
  * setBookmark()/hasBookmark() -> setBookmarked()/isBookmarked()
  * moved as much private API of Page as possible to private class

svn path=/trunk/playground/graphics/okular/; revision=607233
2006-11-23 19:25:52 +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
Tobias Koenig a844f01f0e SVN_SILENT warning--
svn path=/trunk/playground/graphics/okular/; revision=607196
2006-11-23 16:12:07 +00:00
Tobias Koenig a7b04cb92b Replaced
Page::setSearchPage( TextPage* );
  Page::hasSearchPage();

with

  Page::setTextPage( TextPage* );
  Page::hasTextPage();

to make the API clearer. The TextPage is not only used for
searching but also for extracting selected text, so the term
'search' is confusing...


svn path=/trunk/playground/graphics/okular/; revision=607195
2006-11-23 16:09:26 +00:00
Albert Astals Cid b10d00e4ae virtual filesystems always return true for at end, so the memory was not beign correctly calculated
svn path=/trunk/playground/graphics/okular/; revision=606586
2006-11-20 22:52:28 +00:00
Albert Astals Cid 7dacbf93fd use the constant accessors so that we don't get dettach on the containers we don't want to get
svn path=/trunk/playground/graphics/okular/; revision=606560
2006-11-20 20:28:02 +00:00
Albert Astals Cid ac1c0b75bc const_iterator is your friend :-)
svn path=/trunk/playground/graphics/okular/; revision=606558
2006-11-20 20:10:42 +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
Albert Astals Cid 9099fbecf7 Some krazy fixes
svn path=/trunk/playground/graphics/okular/; revision=605992
2006-11-18 21:36:56 +00:00
Pino Toscano 2cbf32906d check that the target file exists
svn path=/trunk/playground/graphics/okular/; revision=605906
2006-11-18 15:16:16 +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
Tobias Koenig 1479a6d28c Small speed up patch, caches the value of getFreeMemory for 2 seconds,
that reduces the access of /proc/meminfo.

svn path=/trunk/playground/graphics/okular/; revision=605189
2006-11-15 19:39:39 +00:00
Pino Toscano 2d99ab2588 no need to create it on the heap
svn path=/trunk/playground/graphics/okular/; revision=603974
2006-11-11 00:08:35 +00:00
Pino Toscano 56e1266ae5 move initializers to the d-ptr ctor
svn path=/trunk/playground/graphics/okular/; revision=603972
2006-11-10 23:52:02 +00:00
Tobias Koenig bea71df6e0 * Made image rotation asynchronous
* Changed Page API and PagePainter to work only with QImage

svn path=/trunk/playground/graphics/okular/; revision=601581
2006-11-03 17:57:32 +00:00
Pino Toscano 1285f20c21 be able to remove more than one annotation at once (and notify the observers only one)
svn path=/trunk/playground/graphics/okular/; revision=600979
2006-11-01 15:17:22 +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
Albert Astals Cid 54ad65e92f }; -> }
svn path=/trunk/playground/graphics/okular/; revision=599084
2006-10-25 17:29:24 +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 4c0808fabf a bit less of #include's
svn path=/trunk/playground/graphics/okular/; revision=598229
2006-10-22 23:00:39 +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
Pino Toscano 0381a0410e simplify
svn path=/trunk/playground/graphics/okular/; revision=597994
2006-10-22 10:09:38 +00:00
Pino Toscano dd40052d86 old code
svn path=/trunk/playground/graphics/okular/; revision=597993
2006-10-22 09:48:31 +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
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
Tobias Koenig 4cb4c1c86b Add convenience ctor
svn path=/trunk/playground/graphics/okular/; revision=586703
2006-09-20 11:44:58 +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