Commit 30c2f806 authored by Albert Astals Cid's avatar Albert Astals Cid

oKular goes poppler

svn path=/trunk/playground/graphics/oKular/kpdf/; revision=520367
parent 3e168cfd
......@@ -2,5 +2,3 @@ Albert Astals Cid <tsdgeos@yahoo.es>
Enrico Ros <eros.kde@email.it>
Wilco Greven <greven@kde.org>
Christophe Devriese <oelewapperke@ulyssis.org>
XPdf is written by Glyph & Cog, LLC
if test -z "$FREETYPE_CONFIG"; then
echo ""
echo "You're missing freetype development libs."
echo "KPDF will not be build without them"
echo ""
fi
if test x$FREETYPE_VERSION != x; then
if test $FREETYPE_VERSION -lt 9008003; then
echo ""
echo "You're are using freetype older than 2.1.10, it is not mandatory"
echo "to use 2.1.10 but kpdf improves its rendering in some pdf with it"
echo ""
fi
fi
if test -z "$XFT_LIBS"; then
echo ""
echo "You're missing XFT development libs."
echo "KPDF will not be build without them"
echo ""
fi
if test "$HAVE_LIBJPEG" = "no"; then
echo ""
echo "You're missing libjpeg development libs."
echo "KPDF will not be build without them"
echo ""
fi
dnl ##### Check for FreeType 2.0.5+.
dnl ##### (Note: FT_Get_Name_Index was added in FT 2.0.5, and is
dnl ##### the reason that Xpdf requires 2.0.5+.)
KDE_FIND_PATH(freetype-config, FREETYPE_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
AC_MSG_WARN([Could not find libfreetype anywhere, check http://www.freetype.org/])
])
if test -n "$FREETYPE_CONFIG"; then
FREETYPE_VERSION=`$FREETYPE_CONFIG --version 2>/dev/null | sed -e 's/libfreetype //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test -n "$FREETYPE_VERSION" && test "$FREETYPE_VERSION" -ge 9000000; then
LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
LIBFREETYPE_RPATH=
for args in $LIBFREETYPE_LIBS; do
case $args in
-L*) LIBFREETYPE_RPATH="$LIBFREETYPE_RPATH $args" ;;
esac
done
LIBFREETYPE_RPATH=`echo $LIBFREETYPE_RPATH | sed -e "s/-L/-R/g"`
LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
AC_DEFINE_UNQUOTED(HAVE_FREETYPE, 1, [Defines if your system has the freetype library])
else
AC_MSG_WARN([You need at least libfreetype 2.0.5])
DO_NOT_COMPILE="$DO_NOT_COMPILE kpdf"
fi
else
DO_NOT_COMPILE="$DO_NOT_COMPILE kpdf"
fi
AC_SUBST(FREETYPE_VERSION)
AC_SUBST(LIBFREETYPE_LIBS)
AC_SUBST(LIBFREETYPE_CFLAGS)
AC_SUBST(LIBFREETYPE_RPATH)
# Check for xft
KDE_FIND_PATH(xft-config, XFT_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin],)
if test -n "$XFT_CONFIG"; then
XFT_CFLAGS="`$XFT_CONFIG --cflags`"
XFT_LIBS="`$XFT_CONFIG --libs`"
fi
AC_SUBST(XFT_CFLAGS)
AC_SUBST(XFT_LIBS)
if test -z "$XFT_LIBS"; then
DO_NOT_COMPILE="$DO_NOT_COMPILE kpdf"
fi
dnl ##### Check for libpaper (Debian).
LIBPAPER_LIBS=
KDE_CHECK_HEADER(paper.h, [
LIBPAPER_LIBS='-lpaper'
AC_DEFINE_UNQUOTED(HAVE_PAPER_H, 1, [Define to 1 if you have the <paper.h> header file.])
],
AC_DEFINE_UNQUOTED(HAVE_PAPER_H, 0, [Define to 1 if you have the <paper.h> header file.])
)
AC_SUBST(LIBPAPER_LIBS)
AC_CHECK_FUNCS(fseek64 mkstemp mkstemps popen)
AC_FIND_FILE(xpdfrc, [/etc /usr/local/etc /etc/xpdf], xpdfrc)
if test "$xpdfrc" != NO; then
AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$xpdfrc/xpdfrc", [Define the location your xpdfrc])
fi
dnl #### Check for FSEEK variants
KDE_CHECK_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
AC_DEFINE(HAVE_FSEEK64, 1)
else
AC_DEFINE(HAVE_FSEEK64, 0)
fi
dnl #### Enable the user to enable multithearind on xpdf
AC_ARG_ENABLE(multithreaded-kpdf,
AC_HELP_STRING([--enable-multithreaded-kpdf],[include support for multithreading in xpdf code inside kpdf. Has nothing to do with threaded generation of contents, this is configurable via a dialog inside the program itself]),
[
case $enableval in
yes)
AC_DEFINE(MULTITHREADED, 1, [Defines if use multithreading in xpdf code inside kpdf])
;;
no)
AC_DEFINE(MULTITHREADED, 0, [Defines if use multithreading in xpdf code inside kpdf])
;;
*)
AC_DEFINE(MULTITHREADED, 1, [Defines if use multithreading in xpdf code inside kpdf])
;;
esac
]
, AC_DEFINE(MULTITHREADED, 0, [Defines if use multithreading in xpdf code inside kpdf])
)
dnl #### Enable the user to decide if he wants to force drm or not
AC_ARG_ENABLE(force-kpdf-drm,
AC_HELP_STRING([--enable-force-kpdf-drm],[Forces kpdf to check for DRM to decide if you can copy/print protected pdf. (default=no)]),
......@@ -112,11 +15,4 @@ AC_ARG_ENABLE(force-kpdf-drm,
esac
]
, AC_DEFINE(KPDF_FORCE_DRM, 0, [Defines if force the use DRM in kpdf])
)
KDE_CHECK_COMPILER_FLAG([fno-regmove], SUPPORTS_NOREGMOVE=true, SUPPORTS_NOREGMOVE=false)
if test "x$SUPPORTS_NOREGMOVE" = xtrue; then
NOREGMOVE="-fno-regmove"
fi
AC_SUBST(NOREGMOVE)
)
\ No newline at end of file
......@@ -20,7 +20,6 @@
#include "annotations.h"
#include "conf/settings.h"
#include "area.h"
//include "xpdf/TextOutputDev.h"
// temp includes
#include <sys/time.h>
......
......@@ -6,5 +6,9 @@ if include_chm
CHMPLUGINDIR = chm
endif
if include_pdf
PDFPLUGINDIR = xpdf
endif
SUBDIRS = $(GSPLUGINDIR) xpdf fax kimgio $(CHMPLUGINDIR)
......@@ -18,3 +18,11 @@ echo "The chm backend will not be available."
echo ""
fi
if test "x$have_poppler_051" != "xyes"; then
echo ""
echo "You're missing poppler-qt >= 0.5.1"
echo "The pdf backend won't be compiled without poppler >= 0.5.1"
echo "You can download poppler from http://poppler.freedesktop.org/"
echo ""
fi
......@@ -21,3 +21,14 @@ AM_CONDITIONAL(include_ghostscript, test -n "$LIB_QGS")
HAVE_CHMLIB=no
KDE_CHECK_HEADER(chm_lib.h, HAVE_CHMLIB=yes)
AM_CONDITIONAL(include_chm, test "x$HAVE_CHMLIB" = "xyes")
AC_ARG_WITH([poppler],
[AS_HELP_STRING([--with-poppler],
[Enable PDF support through poppler @<:@default=check@:>@])],
[], with_poppler=check)
if test "x$with_poppler" != xno; then
PKG_CHECK_MODULES(POPPLER, poppler >= 0.5.1, have_poppler_051=yes, have_poppler_051=no)
fi
AM_CONDITIONAL(include_pdf, test "x$have_poppler_051" = xyes)
\ No newline at end of file
SUBDIRS = xpdf .
kde_module_LTLIBRARIES = \
libokularGenerator_xpdf.la
INCLUDES = -I$(srcdir)/../.. -I$(srcdir)/xpdf -I$(srcdir)/xpdf/goo -I$(srcdir)/xpdf/splash -I$(top_builddir)/kpdf $(all_includes)
INCLUDES = -I$(srcdir)/../.. -I$(top_builddir)/kpdf $(POPPLER_CFLAGS) $(all_includes)
libokularGenerator_xpdf_la_LIBADD = $(top_builddir)/kpdf/core/liboKularcore.la $(top_builddir)/kpdf/conf/liboKularconf.la \
$(top_builddir)/kpdf/generators/xpdf/xpdf/xpdf/libxpdf.la \
$(LIB_KDEPRINT) $(LIB_KDEUI) -lm
$(POPPLER_LIBS) $(LIB_KDEPRINT) $(LIB_KDEUI) -lm
libokularGenerator_xpdf_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
libokularGenerator_xpdf_la_SOURCES = generator_pdf.cpp gp_outputdev.cpp
libokularGenerator_xpdf_la_SOURCES = generator_pdf.cpp gp_outputdev.cpp pagetransition.cpp
KDE_OPTIONS = nofinal
......
......@@ -25,18 +25,20 @@
#include <kmessagebox.h>
#include <kdebug.h>
// xpdf includes
#include "xpdf/PSOutputDev.h"
#include "xpdf/TextOutputDev.h"
#include "xpdf/Link.h"
#include "xpdf/ErrorCodes.h"
#include "xpdf/UnicodeMap.h"
#include "xpdf/Outline.h"
#include "xpdf/GfxState.h"
#include "xpdf/Annot.h" // for retrieving fonts only
#include "xpdf/UGString.h"
#include "xpdf/GlobalParams.h"
#include "goo/GList.h"
// poppler includes
#include "PSOutputDev.h"
#include "TextOutputDev.h"
#include "Link.h"
#include "ErrorCodes.h"
#include "UnicodeMap.h"
#include "Outline.h"
#include "GfxState.h"
#include "Annot.h" // for retrieving fonts only
#include "UGooString.h"
#include "GlobalParams.h"
#include "goo/GooList.h"
#include "pagetransition.h"
// local includes
#include "generator_pdf.h"
......@@ -80,7 +82,6 @@ PDFGenerator::PDFGenerator( KPDFDocument * doc )
//if ( m_count ) TODO check if we need to insert these lines..
// delete globalParams;
globalParams = new GlobalParams("");
globalParams->setupBaseFonts(NULL);
m_count++;
// generate kpdfOutputDev and cache page color
......@@ -123,7 +124,7 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
}
#endif
// create PDFDoc for the given file
pdfdoc = new PDFDoc( new GString( QFile::encodeName( filePath ) ), 0, 0 );
pdfdoc = new PDFDoc( new GooString( QFile::encodeName( filePath ) ), 0, 0 );
// if the file didn't open correctly it might be encrypted, so ask for a pass
bool firstInput = true;
......@@ -169,9 +170,9 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
}
// 2. reopen the document using the password
GString * pwd2 = new GString( password.data() );
GooString * pwd2 = new GooString( password.data() );
delete pdfdoc;
pdfdoc = new PDFDoc( new GString( QFile::encodeName( filePath ) ), pwd2, pwd2 );
pdfdoc = new PDFDoc( new GooString( QFile::encodeName( filePath ) ), pwd2, pwd2 );
delete pwd2;
// 3. if the password is correct, store it to the wallet
......@@ -371,7 +372,7 @@ const DocumentSynopsis * PDFGenerator::generateDocumentSynopsis()
if ( !outline )
return NULL;
GList * items = outline->getItems();
GooList * items = outline->getItems();
if ( !items || items->getLength() < 1 )
return NULL;
......@@ -560,27 +561,27 @@ bool PDFGenerator::print( KPrinter& printer )
}
KTempFile tf( QString::null, ".ps" );
PSOutputDev *psOut = new PSOutputDev(tf.name().latin1(), pdfdoc->getXRef(), pdfdoc->getCatalog(), 1, pdfdoc->getNumPages(), psModePS);
PSOutputDev *psOut = new PSOutputDev((char*)tf.name().latin1(), pdfdoc->getXRef(), pdfdoc->getCatalog(), 1, pdfdoc->getNumPages(), psModePS);
if (psOut->isOk())
{
std::list<int> pages;
QValueList<int> pageList;
if (!printer.previewOnly())
{
QValueList<int> pageList = printer.pageList();
QValueList<int>::const_iterator it;
for(it = pageList.begin(); it != pageList.end(); ++it) pages.push_back(*it);
pageList = printer.pageList();
}
else
{
for(int i = 1; i <= pdfdoc->getNumPages(); i++) pages.push_back(i);
for(int i = 1; i <= pdfdoc->getNumPages(); i++) pageList.push_back(i);
}
docLock.lock();
// TODO rotation
pdfdoc->displayPages(psOut, pages, 72, 72, 0, false, globalParams->getPSCrop(), gFalse);
for(int page = 0; page < pageList.count(); ++page)
{
// TODO rotation
pdfdoc->displayPage(psOut, page, 72, 72, 0, false, globalParams->getPSCrop(), gFalse);
}
docLock.unlock();
// needs to be here so that the file is flushed, do not merge with the one
......@@ -596,12 +597,12 @@ bool PDFGenerator::print( KPrinter& printer )
}
}
static UGString *QStringToUGString(const QString &s) {
static UGooString *QStringToUGooString(const QString &s) {
int len = s.length();
Unicode *u = (Unicode *)gmallocn(s.length(), sizeof(Unicode));
for (int i = 0; i < len; ++i)
u[i] = s.at(i).unicode();
return new UGString(u, len);
return new UGooString(u, len);
}
QString PDFGenerator::getMetaData( const QString & key, const QString & option )
......@@ -610,7 +611,7 @@ QString PDFGenerator::getMetaData( const QString & key, const QString & option )
if ( key == "StartFullScreen" )
{
// asking for the 'start in fullscreen mode' (pdf property)
if ( pdfdoc->getCatalog()->getPageMode() == Catalog::FullScreen )
if ( pdfdoc->getCatalog()->getPageMode() == Catalog::pageModeFullScreen )
return "yes";
}
else if ( key == "NamedViewport" && !option.isEmpty() )
......@@ -618,7 +619,7 @@ QString PDFGenerator::getMetaData( const QString & key, const QString & option )
// asking for the page related to a 'named link destination'. the
// option is the link name. @see addSynopsisChildren.
DocumentViewport viewport;
UGString * namedDest = QStringToUGString( option );
UGooString * namedDest = QStringToUGooString( option );
docLock.lock();
LinkDest * destination = pdfdoc->findDest( namedDest );
if ( destination )
......@@ -817,7 +818,7 @@ QString PDFGenerator::getDocumentInfo( const QString & data ) const
QString result;
Object obj;
GString *s1;
GooString *s1;
GBool isUnicode;
Unicode u;
int i;
......@@ -906,7 +907,7 @@ QString PDFGenerator::getDocumentDate( const QString & data ) const
return result;
}
void PDFGenerator::addSynopsisChildren( QDomNode * parent, GList * items )
void PDFGenerator::addSynopsisChildren( QDomNode * parent, GooList * items )
{
int numItems = items->getLength();
for ( int i = 0; i < numItems; ++i )
......@@ -937,7 +938,7 @@ void PDFGenerator::addSynopsisChildren( QDomNode * parent, GList * items )
// get the destination for the page now, but it's VERY time consuming,
// so better storing the reference and provide the viewport as metadata
// on demand
UGString *s = g->getNamedDest();
UGooString *s = g->getNamedDest();
QString aux = unicodeToQString( s->unicode(), s->getLength() );
item.setAttribute( "ViewportName", aux );
}
......@@ -956,7 +957,7 @@ void PDFGenerator::addSynopsisChildren( QDomNode * parent, GList * items )
// 3. recursively descend over children
outlineItem->open();
GList * children = outlineItem->getKids();
GooList * children = outlineItem->getKids();
if ( children )
addSynopsisChildren( &item, children );
}
......@@ -1005,7 +1006,7 @@ void PDFGenerator::addFonts( Dict *resDict, Ref **fonts, int &fontsLen, int &fon
docFonts.firstChild().appendChild( fontElem );
// 1. set Name
GString * name = font->getOrigName();
GooString * name = font->getOrigName();
fontElem.setAttribute( "Name", name ? name->getCString() : i18n("[none]") );
// 2. set Type
......@@ -1030,7 +1031,7 @@ void PDFGenerator::addFonts( Dict *resDict, Ref **fonts, int &fontsLen, int &fon
QString sPath = i18n("-");
if ( name && !emb )
{
DisplayFontParam *dfp = globalParams->getDisplayFont( name );
DisplayFontParam *dfp = globalParams->getDisplayFont( font );
if ( dfp )
{
if ( dfp -> kind == displayFontT1 ) sPath = dfp->t1.fileName->getCString();
......@@ -1997,12 +1998,14 @@ void PDFGenerator::fillViewportFromLink( DocumentViewport &viewport, LinkDest *d
void PDFGenerator::addTransition( Page * pdfPage, KPDFPage * page )
// called on opening when MUTEX is not used
{
PageTransition *pdfTransition = pdfPage->getTransition();
if ( !pdfTransition || pdfTransition->getType() == PageTransition::Replace )
Object o;
PageTransition *pdfTransition = new PageTransition(pdfPage->getTrans(&o));
o.free();
if ( !pdfTransition || pdfTransition->type() == PageTransition::Replace )
return;
KPDFPageTransition *transition = new KPDFPageTransition();
switch ( pdfTransition->getType() ) {
switch ( pdfTransition->type() ) {
case PageTransition::Replace:
// won't get here, added to avoid warning
break;
......@@ -2041,9 +2044,9 @@ void PDFGenerator::addTransition( Page * pdfPage, KPDFPage * page )
break;
}
transition->setDuration( pdfTransition->getDuration() );
transition->setDuration( pdfTransition->duration() );
switch ( pdfTransition->getAlignment() ) {
switch ( pdfTransition->alignment() ) {
case PageTransition::Horizontal:
transition->setAlignment( KPDFPageTransition::Horizontal );
break;
......@@ -2052,7 +2055,7 @@ void PDFGenerator::addTransition( Page * pdfPage, KPDFPage * page )
break;
}
switch ( pdfTransition->getDirection() ) {
switch ( pdfTransition->direction() ) {
case PageTransition::Inward:
transition->setDirection( KPDFPageTransition::Inward );
break;
......@@ -2061,8 +2064,8 @@ void PDFGenerator::addTransition( Page * pdfPage, KPDFPage * page )
break;
}
transition->setAngle( pdfTransition->getAngle() );
transition->setScale( pdfTransition->getScale() );
transition->setAngle( pdfTransition->angle() );
transition->setScale( pdfTransition->scale() );
transition->setIsRectangular( pdfTransition->isRectangular() == gTrue );
page->setTransition( transition );
......
......@@ -21,7 +21,7 @@
#include "core/textpage.h"
class PDFDoc;
class GList;
class GooList;
class TextPage;
class LinkDest;
class Page;
......@@ -107,7 +107,7 @@ class PDFGenerator : public Generator
QString getDocumentInfo( const QString & data ) const;
QString getDocumentDate( const QString & data ) const;
// create the document synopsis hieracy
void addSynopsisChildren( QDomNode * parent, GList * items );
void addSynopsisChildren( QDomNode * parent, GooList * items );
// add fonts (in resDict) to the private 'docFonts' class
void addFonts( Dict * resDict, Ref ** fonts, int &fontsLen, int &fontsSize );
// fetch annotations from the pdf file and add they to the page
......
......@@ -28,9 +28,9 @@
#include "core/document.h" // for DocumentViewport
#include "core/page.h"
#include "core/link.h"
#include "xpdf/Link.h"
#include "xpdf/GfxState.h"
#include "xpdf/TextOutputDev.h"
#include "Link.h"
#include "GfxState.h"
#include "TextOutputDev.h"
#include "splash/SplashBitmap.h"
//NOTE: XPDF/Splash *implementation dependant* code is marked with '###'
......@@ -263,7 +263,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
case actionLaunch:
{
LinkLaunch * e = (LinkLaunch *)a;
GString * p = e->getParams();
GooString * p = e->getParams();
link = new KPDFLinkExecute( e->getFileName()->getCString(), p ? p->getCString() : 0 );
}
break;
......@@ -328,7 +328,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
return link;
}
DocumentViewport KPDFOutputDev::decodeViewport( UGString * namedDest, LinkDest * dest )
DocumentViewport KPDFOutputDev::decodeViewport( UGooString * namedDest, LinkDest * dest )
// note: this function is called when processing a page, when the MUTEX is already LOCKED
{
DocumentViewport vp( -1 );
......
......@@ -19,9 +19,12 @@
#pragma interface
#endif
#define USE_FIXEDPOINT 0
#define SPLASH_CMYK 0
#include <qvaluelist.h>
#include "xpdf/PDFDoc.h" // for 'Object'
#include "xpdf/SplashOutputDev.h"
#include "PDFDoc.h" // for 'Object'
#include "SplashOutputDev.h"
class QPixmap;
class KPDFLink;
......@@ -71,7 +74,7 @@ class KPDFOutputDev : public SplashOutputDev
// generate a valid KPDFLink subclass (or null) from a xpdf's LinkAction
KPDFLink * generateLink( LinkAction * a );
// fills up a Viewport structure out of a given LinkGoto link
DocumentViewport decodeViewport( UGString *, class LinkDest * );
DocumentViewport decodeViewport( UGooString *, class LinkDest * );
// generator switches and parameters
bool m_qtThreadSafety;
......
/* PageTransition.cc
* Copyright (C) 2005, Net Integration Technologies, Inc.
*
* 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, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "Object.h"
#include "Error.h"
#include "UGooString.h"
#include "pagetransition.h"
class PageTransitionData
{
public:
PageTransition::Type type;
int duration;
PageTransition::Alignment alignment;
PageTransition::Direction direction;
int angle;
double scale;
bool rectangular;
};
PageTransition::PageTransition(Object *dictObj)
{
data = new PageTransitionData();
data->type = Replace;
data->duration = 1;
data->alignment = Horizontal;
data->direction = Inward;
data->angle = 0;
data->scale = 1.0;
data->rectangular = false;
// Paranoid safety checks
if (dictObj == 0) {
error(-1, "the method PageTransition_x::PageTransition_x(Object *params.dictObj) was called with params.dictObj==0\n");
return;
}
if (dictObj->isDict() == false) {
error(-1, "the method PageTransition_x::PageTransition_x(Object *params.dictObj) was called where params.dictObj->isDict()==false\n");
return;
}
// Obtain a pointer to the dictionary and start parsing.
Dict *transDict = dictObj->getDict();
Object obj;
if (transDict->lookup("S", &obj)->isName()) {
const char *s = obj.getName();
if (strcmp("R", s) == 0)
data->type = Replace;
else if (strcmp("Split", s) == 0)
data->type = Split;
else if (strcmp("Blinds", s) == 0)
data->type = Blinds;
else if (strcmp("Box", s) == 0)
data->type = Box;
else if (strcmp("Wipe", s) == 0)
data->type = Wipe;
else if (strcmp("Dissolve", s) == 0)
data->type = Dissolve;
else if (strcmp("Glitter", s) == 0)
data->type = Glitter;
else if (strcmp("Fly", s) == 0)
data->type = Fly;
else if (strcmp("Push", s) == 0)
data->type = Push;
else if (strcmp("Cover", s) == 0)
data->type = Cover;
else if (strcmp("Uncover", s) == 0)
data->type = Push;
else if (strcmp("Fade", s) == 0)
data->type = Cover;
}
obj.free();
if (transDict->lookup("D", &obj)->isInt()) {
data->duration = obj.getInt();
}
obj.free();
if (transDict->lookup("Dm", &obj)->isName()) {
const char *dm = obj.getName();
if ( strcmp( "H", dm ) == 0 )
data->alignment = Horizontal;
else if ( strcmp( "V", dm ) == 0 )
data->alignment = Vertical;
}
obj.free();
if (transDict->lookup("M", &obj)->isName()) {
const char *m = obj.getName();
if ( strcmp( "I", m ) == 0 )
data->direction = Inward;
else if ( strcmp( "O", m ) == 0 )
data->direction = Outward;
}
obj.free();
if (transDict->lookup("Di", &obj)->isInt()) {
data->angle = obj.getInt();
}
obj.free();
if (transDict->lookup("Di", &obj)->isName()) {
if ( strcmp( "None", obj.getName() ) == 0 )
data->angle = 0;
}
obj.free();
if (transDict->lookup("SS", &obj)->isReal()) {
data->scale = obj.getReal();
}
obj.free();
if (transDict->lookup("B", &obj)->isBool()) {
data->rectangular = obj.getBool();
}
obj.free();
}