diff --git a/core/page.cpp b/core/page.cpp index 5ae607486..12f32ba1c 100644 --- a/core/page.cpp +++ b/core/page.cpp @@ -22,6 +22,7 @@ #include "form.h" #include "link.h" #include "page.h" +#include "page_p.h" #include "pagesize.h" #include "pagetransition.h" #include "rotationjob.h" @@ -42,64 +43,43 @@ static void deleteObjectRects( QLinkedList< ObjectRect * >& rects, const QSet formfields; - Link * m_openingAction; - Link * m_closingAction; - double m_duration; - QString m_label; -}; -void Page::Private::imageRotationDone() +void PagePrivate::imageRotationDone() { RotationJob *job = static_cast( m_page->sender() ); - QMap< int, PixmapObject >::iterator it = m_page->m_pixmaps.find( job->id() ); + QMap< int, Page::PixmapObject >::iterator it = m_page->m_pixmaps.find( job->id() ); if ( it != m_page->m_pixmaps.end() ) { - PixmapObject &object = it.value(); + Page::PixmapObject &object = it.value(); (*object.m_pixmap) = QPixmap::fromImage( job->image() ); object.m_rotation = job->rotation(); } else { - PixmapObject object; + Page::PixmapObject object; object.m_pixmap = new QPixmap( QPixmap::fromImage( job->image() ) ); object.m_rotation = job->rotation(); @@ -111,7 +91,7 @@ void Page::Private::imageRotationDone() job->deleteLater(); } -QMatrix Page::Private::rotationMatrix() const +QMatrix PagePrivate::rotationMatrix() const { QMatrix matrix; matrix.rotate( (int)m_rotation * 90 ); @@ -136,7 +116,7 @@ QMatrix Page::Private::rotationMatrix() const /** class Page **/ Page::Page( uint page, double w, double h, Rotation o ) - : QObject( 0 ), d( new Private( this, page, w, h, o ) ), + : QObject( 0 ), d( new PagePrivate( this, page, w, h, o ) ), m_textSelections( 0 ) { } diff --git a/core/page.h b/core/page.h index 9ec04e11a..61c8e4980 100644 --- a/core/page.h +++ b/core/page.h @@ -27,6 +27,7 @@ namespace Okular { class Annotation; class FormField; +class PagePrivate; class PageSize; class PageTransition; class SourceReference; @@ -349,8 +350,8 @@ class OKULAR_EXPORT Page : public QObject void rotationFinished( int page ); private: - class Private; - Private* const d; + PagePrivate* const d; + friend class PagePrivate; /** * To improve performance PagePainter accesses the following diff --git a/core/page_p.h b/core/page_p.h new file mode 100644 index 000000000..7e768ebbb --- /dev/null +++ b/core/page_p.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2004 by Enrico Ros * + * Copyright (C) 2007 by Pino Toscano * + * * + * 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 _OKULAR_PAGE_PRIVATE_H_ +#define _OKULAR_PAGE_PRIVATE_H_ + +// qt/kde includes +#include +#include +#include + +// local includes +#include "global.h" + +namespace Okular { + +class FormField; +class Link; +class Page; +class PageTransition; +class TextPage; + +class PagePrivate +{ + public: + PagePrivate( Page *page, uint n, double w, double h, Rotation o ); + ~PagePrivate(); + + void imageRotationDone(); + QMatrix rotationMatrix() const; + + Page *m_page; + int m_number; + Rotation m_orientation; + double m_width, m_height; + Rotation m_rotation; + int m_maxuniqueNum; + + TextPage * m_text; + PageTransition * m_transition; + QLinkedList< FormField * > formfields; + Link * m_openingAction; + Link * m_closingAction; + double m_duration; + QString m_label; +}; + +} + +#endif