Copying kpdf_experiments into branch and reordering directories. Look there

for the file naming map and file  versioning. Please wait until the commit
storm ends to report any bug. Albert and Enrico
Moved KPDFDocumentObserver in its own include file. Updated dependancies.

svn path=/trunk/kdegraphics/kpdf/; revision=374928
remotes/origin/kpdf-3.4
Enrico Ros 22 years ago
parent eee2673370
commit d983cfdd76
  1. 4
      core/document.cpp
  2. 35
      core/document.h
  3. 48
      core/observer.h
  4. 4
      part.cpp
  5. 4
      part.h
  6. 4
      shell.h
  7. 5
      ui/pageview.cpp
  8. 4
      ui/pageview.h
  9. 7
      ui/presentationwidget.h
  10. 1
      ui/thumbnaillist.cpp
  11. 6
      ui/thumbnaillist.h
  12. 2
      ui/toc.cpp
  13. 7
      ui/toc.h

@ -26,11 +26,11 @@
// local includes // local includes
#include "document.h" #include "document.h"
#include "observer.h"
#include "page.h" #include "page.h"
#include "link.h" #include "link.h"
#include "conf/settings.h"
#include "generator_pdf/generator_pdf.h" // PDF generator #include "generator_pdf/generator_pdf.h" // PDF generator
//#include "generator_ps/generator_ps.H" // PS generator #include "conf/settings.h"
// structures used internally by KPDFDocument for local variables storage // structures used internally by KPDFDocument for local variables storage
class KPDFDocumentPrivate class KPDFDocumentPrivate

@ -15,43 +15,14 @@
#include <qstring.h> #include <qstring.h>
#include <qdom.h> #include <qdom.h>
class KPrinter;
class KPDFPage; class KPDFPage;
class KPDFLink; class KPDFLink;
class Generator; class KPDFDocumentObserver;
class DocumentInfo; class DocumentInfo;
class DocumentSynopsis; class DocumentSynopsis;
class Generator;
class PixmapRequest; class PixmapRequest;
class KPrinter;
/**
* @short Base class for objects being notified when something changes.
*
* Inherit this class and call KPDFDocument->addObserver( yourClass ) to get
* notified of asyncronous events (new pixmap generated, or changed, etc..).
*/
class KPDFDocumentObserver
{
public:
// you must give each observer a unique ID (used for notifications)
virtual uint observerId() const = 0;
// commands from the Document to all observers
virtual void pageSetup( const QValueVector<KPDFPage*> & /*pages*/, bool /*documentChanged*/ ) {};
virtual void pageSetCurrent( int /*pageNumber*/, const QRect & /*viewport*/ = QRect() ) {};
// queries to observers
virtual bool canUnloadPixmap( int /*pageNum*/ ) { return true; }
// monitor changes in pixmaps (generation thread complete)
virtual void notifyPixmapChanged( int /*pageNumber*/ ) {};
virtual void notifyPixmapsCleared() {};
};
#define PRESENTATION_ID 1
#define PART_ID 2
#define PAGEVIEW_ID 3
#define THUMBNAILS_ID 4
#define TOC_ID 5
/** /**
* @short The Document. Heart of everything. Actions take place here. * @short The Document. Heart of everything. Actions take place here.

@ -0,0 +1,48 @@
/***************************************************************************
* Copyright (C) 2005 by Enrico Ros <eros.kde@email.it> *
* Copyright (C) 2005 by Albert Astals Cid <tsdgeos@terra.es> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef _KPDF_DOCUMENTOBSERVER_H_
#define _KPDF_DOCUMENTOBSERVER_H_
#include <qvaluevector.h>
#include <qrect.h>
/** IDs for observers. Globally defined here. **/
#define PRESENTATION_ID 1
#define PART_ID 2
#define PAGEVIEW_ID 3
#define THUMBNAILS_ID 4
#define TOC_ID 5
/**
* @short Base class for objects being notified when something changes.
*
* Inherit this class and call KPDFDocument->addObserver( yourClass ) to get
* notified of asyncronous events (new pixmap generated, or changed, etc..).
*/
class KPDFDocumentObserver
{
public:
// you must give each observer a unique ID (used for notifications)
virtual uint observerId() const = 0;
// commands from the Document to all observers
virtual void pageSetup( const QValueVector< class KPDFPage * > & /*pages*/, bool /*documentChanged*/ ) {};
virtual void pageSetCurrent( int /*pageNumber*/, const QRect & /*viewport*/ = QRect() ) {};
// queries to observers
virtual bool canUnloadPixmap( int /*pageNum*/ ) { return true; }
// monitor changes in pixmaps (generation thread complete)
virtual void notifyPixmapChanged( int /*pageNumber*/ ) {};
virtual void notifyPixmapsCleared() {};
};
#endif

@ -21,6 +21,7 @@
* (at your option) any later version. * * (at your option) any later version. *
***************************************************************************/ ***************************************************************************/
// qt/kde includes
#include <qsplitter.h> #include <qsplitter.h>
#include <qpainter.h> #include <qpainter.h>
#include <qlayout.h> #include <qlayout.h>
@ -28,7 +29,6 @@
#include <qvbox.h> #include <qvbox.h>
#include <qtoolbox.h> #include <qtoolbox.h>
#include <qpushbutton.h> #include <qpushbutton.h>
#include <dcopobject.h> #include <dcopobject.h>
#include <kaction.h> #include <kaction.h>
#include <kdirwatch.h> #include <kdirwatch.h>
@ -48,8 +48,8 @@
#include <kxmlguiclient.h> #include <kxmlguiclient.h>
#include <kxmlguifactory.h> #include <kxmlguifactory.h>
// local includes
#include "xpdf/GlobalParams.h" #include "xpdf/GlobalParams.h"
#include "part.h" #include "part.h"
#include "ui/pageview.h" #include "ui/pageview.h"
#include "ui/thumbnaillist.h" #include "ui/thumbnaillist.h"

@ -18,9 +18,8 @@
#include <kparts/browserextension.h> #include <kparts/browserextension.h>
#include <kparts/part.h> #include <kparts/part.h>
#include "core/observer.h"
#include "dcop.h" #include "dcop.h"
#include "core/document.h"
class QWidget; class QWidget;
class QSplitter; class QSplitter;
@ -35,6 +34,7 @@ class KSelectAction;
class KAboutData; class KAboutData;
class KPrinter; class KPrinter;
class KPDFDocument;
class ThumbnailList; class ThumbnailList;
class PageView; class PageView;
class SearchWidget; class SearchWidget;

@ -73,8 +73,8 @@ namespace KPDF
void optionsConfigureToolbars(); void optionsConfigureToolbars();
void applyNewToolbarConfig(); void applyNewToolbarConfig();
void slotUpdateFullScreen(); void slotUpdateFullScreen();
void slotShowMenubar(); void slotShowMenubar();
public slots: public slots:
void openURL( const KURL & url ); void openURL( const KURL & url );

@ -16,13 +16,13 @@
* (at your option) any later version. * * (at your option) any later version. *
***************************************************************************/ ***************************************************************************/
// qt/kde includes
#include <qcursor.h> #include <qcursor.h>
#include <qpainter.h> #include <qpainter.h>
#include <qtimer.h> #include <qtimer.h>
#include <qpushbutton.h> #include <qpushbutton.h>
#include <qapplication.h> #include <qapplication.h>
#include <qclipboard.h> #include <qclipboard.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kurldrag.h> #include <kurldrag.h>
#include <kaction.h> #include <kaction.h>
@ -34,11 +34,14 @@
#include <kimageio.h> #include <kimageio.h>
#include <kdebug.h> #include <kdebug.h>
// system includes
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
// local includes
#include "pageview.h" #include "pageview.h"
#include "pageviewutils.h" #include "pageviewutils.h"
#include "core/document.h"
#include "core/page.h" #include "core/page.h"
#include "core/link.h" #include "core/link.h"
#include "core/generator.h" #include "core/generator.h"

@ -21,12 +21,12 @@
#include <qscrollview.h> #include <qscrollview.h>
#include <qvaluevector.h> #include <qvaluevector.h>
#include "core/observer.h"
#include "core/document.h"
class KURL; class KURL;
class KActionCollection; class KActionCollection;
class KPDFDocument;
class PageViewItem; class PageViewItem;
class PageViewPrivate; class PageViewPrivate;

@ -14,12 +14,15 @@
#include <qpixmap.h> #include <qpixmap.h>
#include <qstringlist.h> #include <qstringlist.h>
#include <qvaluevector.h> #include <qvaluevector.h>
#include "core/document.h" #include "core/observer.h"
class PresentationFrame;
class KToolBar; class KToolBar;
class QTimer; class QTimer;
class KPDFDocument;
class KPDFPage;
class PresentationFrame;
/** /**
* @short A widget that shows pages as fullscreen slides (with transitions fx). * @short A widget that shows pages as fullscreen slides (with transitions fx).
* *

@ -18,6 +18,7 @@
// local includes // local includes
#include "thumbnaillist.h" #include "thumbnaillist.h"
#include "core/document.h"
#include "core/generator.h" #include "core/generator.h"
#include "core/page.h" #include "core/page.h"

@ -7,13 +7,13 @@
* (at your option) any later version. * * (at your option) any later version. *
***************************************************************************/ ***************************************************************************/
#ifndef THUMBNAILLIST_H #ifndef _KPDF_THUMBNAILLIST_H_
#define THUMBNAILLIST_H #define _KPDF_THUMBNAILLIST_H_
#include <qscrollview.h> #include <qscrollview.h>
#include <qvaluevector.h> #include <qvaluevector.h>
#include <qvbox.h> #include <qvbox.h>
#include "core/document.h" #include "core/observer.h"
class QTimer; class QTimer;
class KActionCollection; class KActionCollection;

@ -13,8 +13,8 @@
// local includes // local includes
#include "toc.h" #include "toc.h"
#include "core/page.h"
#include "core/document.h" #include "core/document.h"
#include "core/page.h"
// uncomment following to enable a 2nd column showing the page referred by // uncomment following to enable a 2nd column showing the page referred by
// each tree entry // each tree entry

@ -7,12 +7,11 @@
* (at your option) any later version. * * (at your option) any later version. *
***************************************************************************/ ***************************************************************************/
#ifndef TOC_H #ifndef _KPDF_TOC_H_
#define TOC_H #define _KPDF_TOC_H_
#include <klistview.h> #include <klistview.h>
#include "core/observer.h"
#include "core/document.h"
class TOC : public KListView, public KPDFDocumentObserver class TOC : public KListView, public KPDFDocumentObserver
{ {

Loading…
Cancel
Save