[poppler] poppler/qt: Makefile.am, 1.7, 1.8 poppler-page.cc, 1.8,
1.9 poppler-qt.h, 1.12, 1.13
Albert Astals Cid
aacid at freedesktop.org
Fri Dec 30 14:31:34 PST 2005
- Previous message: [poppler]
poppler/poppler: Makefile.am, 1.16, 1.17 PageTransition.cc,
NONE, 1.1 PageTransition.h, NONE, 1.1 Private.h, NONE, 1.1
- Next message: [poppler] poppler/qt4/src: poppler-page.cc,1.10,1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvs/poppler/poppler/qt
In directory gabe:/tmp/cvs-serv25153/qt
Modified Files:
Makefile.am poppler-page.cc poppler-qt.h
Log Message:
Puting PageTransition implementation into poppler "core", both Qt and Qt4 frontends use it.
Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/qt/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Makefile.am 8 Dec 2005 12:42:51 -0000 1.7
+++ Makefile.am 30 Dec 2005 22:31:32 -0000 1.8
@@ -9,7 +9,7 @@
poppler_includedir = $(includedir)/poppler
poppler_include_HEADERS = \
- poppler-qt.h
+ poppler-qt.h ../poppler/PageTransition.h
lib_LTLIBRARIES=libpoppler-qt.la
libpoppler_qt_la_SOURCES = \
Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-page.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- poppler-page.cc 21 Nov 2005 22:12:16 -0000 1.8
+++ poppler-page.cc 30 Dec 2005 22:31:32 -0000 1.9
@@ -22,6 +22,7 @@
#include <qimage.h>
#include <GlobalParams.h>
#include <PDFDoc.h>
+#include <Private.h>
#include <Catalog.h>
#include <ErrorCodes.h>
#include <SplashOutputDev.h>
@@ -31,110 +32,6 @@
namespace Poppler {
-class PageTransitionData {
- public:
- Object *trans;
-};
-
-//------------------------------------------------------------------------
-// PageTransition
-//------------------------------------------------------------------------
-
-PageTransition::PageTransition(const PageTransitionData &data)
- : type(Replace),
- duration(1),
- alignment(Horizontal),
- direction(Inward),
- angle(0),
- scale(1.0),
- rectangular(false)
-{
- Object obj;
- Object *dictObj = data.trans;
-
- if (dictObj->isDict()) {
- Dict *transDict = dictObj->getDict();
-
- if (transDict->lookup("S", &obj)->isName()) {
- const char *s = obj.getName();
- if (strcmp("R", s) == 0)
- type = Replace;
- else if (strcmp("Split", s) == 0)
- type = Split;
- else if (strcmp("Blinds", s) == 0)
- type = Blinds;
- else if (strcmp("Box", s) == 0)
- type = Box;
- else if (strcmp("Wipe", s) == 0)
- type = Wipe;
- else if (strcmp("Dissolve", s) == 0)
- type = Dissolve;
- else if (strcmp("Glitter", s) == 0)
- type = Glitter;
- else if (strcmp("Fly", s) == 0)
- type = Fly;
- else if (strcmp("Push", s) == 0)
- type = Push;
- else if (strcmp("Cover", s) == 0)
- type = Cover;
- else if (strcmp("Uncover", s) == 0)
- type = Push;
- else if (strcmp("Fade", s) == 0)
- type = Cover;
- }
- obj.free();
-
- if (transDict->lookup("D", &obj)->isInt()) {
- duration = obj.getInt();
- }
- obj.free();
-
- if (transDict->lookup("Dm", &obj)->isName()) {
- const char *dm = obj.getName();
- if ( strcmp( "H", dm ) == 0 )
- alignment = Horizontal;
- else if ( strcmp( "V", dm ) == 0 )
- alignment = Vertical;
- }
- obj.free();
-
- if (transDict->lookup("M", &obj)->isName()) {
- const char *m = obj.getName();
- if ( strcmp( "I", m ) == 0 )
- direction = Inward;
- else if ( strcmp( "O", m ) == 0 )
- direction = Outward;
- }
- obj.free();
-
- if (transDict->lookup("Di", &obj)->isInt()) {
- angle = obj.getInt();
- }
- obj.free();
-
- if (transDict->lookup("Di", &obj)->isName()) {
- if ( strcmp( "None", obj.getName() ) == 0 )
- angle = 0;
- }
- obj.free();
-
- if (transDict->lookup("SS", &obj)->isReal()) {
- scale = obj.getReal();
- }
- obj.free();
-
- if (transDict->lookup("B", &obj)->isBool()) {
- rectangular = obj.getBool();
- }
- obj.free();
- }
-}
-
-PageTransition::~PageTransition()
-{
-}
-
-
class PageData {
public:
const Document *doc;
@@ -268,9 +165,9 @@
if (!data->transition)
{
Object o;
- PageTransitionData ptd;
- ptd.trans = data->doc->data->doc.getCatalog()->getPage(data->index + 1)->getTrans(&o);
- data->transition = new PageTransition(ptd);
+ PageTransitionParams params;
+ params.dictObj = data->doc->data->doc.getCatalog()->getPage(data->index + 1)->getTrans(&o);
+ data->transition = new PageTransition(params);
o.free();
}
return data->transition;
Index: poppler-qt.h
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-qt.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- poppler-qt.h 4 Dec 2005 11:30:00 -0000 1.12
+++ poppler-qt.h 30 Dec 2005 22:31:32 -0000 1.13
@@ -24,6 +24,8 @@
#include <qdatetime.h>
#include <qpixmap.h>
+#include <PageTransition.h>
+
namespace Poppler {
class Document;
@@ -118,76 +120,6 @@
FontInfoData *data;
};
-class PageTransitionData;
-class PageTransition
-{
-friend class Page;
-public:
- enum Type {
- Replace,
- Split,
- Blinds,
- Box,
- Wipe,
- Dissolve,
- Glitter,
- Fly,
- Push,
- Cover,
- Uncover,
- Fade
- };
-
- enum Alignment {
- Horizontal,
- Vertical
- };
-
- enum Direction {
- Inward,
- Outward
- };
-
-
- // Destructor
- ~PageTransition();
-
- // Get type of the transition.
- Type getType() const { return type; }
-
- // Get duration of the transition in seconds.
- int getDuration() const { return duration; }
-
- // Get dimension in which the transition effect
- // occurs.
- Alignment getAlignment() const { return alignment; }
-
- // Get direction of motion of the transition effect.
- Direction getDirection() const { return direction; }
-
- // Get direction in which the transition effect moves.
- int getAngle() const { return angle; }
-
- // Get starting or ending scale.
- double getScale() const { return scale; }
-
- // Returns true if the area to be flown is rectangular and
- // opaque.
- bool isRectangular() const { return rectangular; }
-
-private:
- // Construct a new PageTransition object from a page dictionary.
- PageTransition( const PageTransitionData &data );
-
- Type type;
- int duration;
- Alignment alignment;
- Direction direction;
- int angle;
- double scale;
- bool rectangular;
-};
-
class PageData;
class Page {
friend class Document;
- Previous message: [poppler]
poppler/poppler: Makefile.am, 1.16, 1.17 PageTransition.cc,
NONE, 1.1 PageTransition.h, NONE, 1.1 Private.h, NONE, 1.1
- Next message: [poppler] poppler/qt4/src: poppler-page.cc,1.10,1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the poppler
mailing list