[poppler] poppler/qt: Makefile.am, 1.8, 1.9 poppler-page-transition.cc, NONE, 1.1 poppler-page-transition.h, NONE, 1.1 poppler-page.cc, 1.11, 1.12 poppler-private.h, 1.3, 1.4 poppler-qt.h, 1.14, 1.15

Kristian Høgsberg krh at freedesktop.org
Fri Jan 6 02:06:01 PST 2006


Update of /cvs/poppler/poppler/qt
In directory gabe:/tmp/cvs-serv554/qt

Modified Files:
	Makefile.am poppler-page.cc poppler-private.h poppler-qt.h 
Added Files:
	poppler-page-transition.cc poppler-page-transition.h 
Log Message:
2006-01-06  Kristian Høgsberg  <krh at redhat.com>

        * qt/poppler-page.cc:
        * qt/poppler-private.h:
        * qt/poppler-qt.h:
        * qt4/src/Makefile.am:
        * qt/Makefile.am:
        * poppler/Makefile.am: Move PageTransition to qt bindings, move
        contents from Private.h to qt/poppler-private.h.

        * poppler/TextOutputDev.cc (visitWord): Remove #warning.

        * utils/Makefile.am (pdfimages_SOURCES): Add ImageOutputDev.h, use
        dist_man1_MANS so we actually dist the man pages.

        * goo/Makefile.am (poppler_goo_include_HEADERS): Add GooVector.h.

        * glib/reference/Makefile.am: DOC_SOURCE_DIR must be relative to
        $(srcdir), fix this to make distchek run.

        * m4/qt.m4:
        * m4/libjpeg.m4:
        * acinclude.m4:
        * configure.ac: Split out Qt and libjpeg checks from configure.ac
        and acinclude.m4 to m4/qt.m4 and m4/libjpeg.m4.



Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/qt/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Makefile.am	30 Dec 2005 22:31:32 -0000	1.8
+++ Makefile.am	6 Jan 2006 10:05:59 -0000	1.9
@@ -9,16 +9,18 @@
 
 poppler_includedir = $(includedir)/poppler
 poppler_include_HEADERS =			\
-	poppler-qt.h ../poppler/PageTransition.h
+	poppler-qt.h				\
+	poppler-page-transition.h
 
-lib_LTLIBRARIES=libpoppler-qt.la
+lib_LTLIBRARIES = libpoppler-qt.la
 libpoppler_qt_la_SOURCES =			\
 	poppler-document.cc			\
 	poppler-fontinfo.cc			\
 	poppler-page.cc				\
+	poppler-page-transition.cc		\
 	poppler-private.h
 
-libpoppler_qt_la_LIBADD= 			\
+libpoppler_qt_la_LIBADD = 			\
 	$(top_builddir)/poppler/libpoppler.la	\
 	$(POPPLER_QT_LIBS)			\
 	$(FREETYPE_LIBS)

--- NEW FILE: poppler-page-transition.cc ---
/* 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 "poppler-page-transition.h"
#include "poppler-private.h"

namespace Poppler {

class PageTransitionData
{
  public:
    PageTransition::Type type;
    int duration;
    PageTransition::Alignment alignment;
    PageTransition::Direction direction;
    int angle;
    double scale;
    bool rectangular;
};

PageTransition::PageTransition(const PageTransitionParams &params)
{
  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 (params.dictObj == 0) {
    error(-1, "the method PageTransition_x::PageTransition_x(Object *params.dictObj) was called with params.dictObj==0\n");
    return;
  }
  if (params.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 = params.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();
}

PageTransition::PageTransition(const PageTransition &pt)
{
  data = new PageTransitionData();
  data->type = pt.data->type;
  data->duration = pt.data->duration;
  data->alignment = pt.data->alignment;
  data->direction = pt.data->direction;
  data->angle = pt.data->angle;
  data->scale = pt.data->scale;
  data->rectangular = pt.data->rectangular;
}

PageTransition::~PageTransition()
{
}

PageTransition::Type PageTransition::type() const
{
  return data->type;
}

int PageTransition::duration() const
{
  return data->duration;
}

PageTransition::Alignment PageTransition::alignment() const
{
  return data->alignment;
}

PageTransition::Direction PageTransition::direction() const
{
  return data->direction;
}

int PageTransition::angle() const
{
  return data->angle;
}

double PageTransition::scale() const
{
  return data->scale;
}
bool PageTransition::isRectangular() const
{
  return data->rectangular;
}

}

--- NEW FILE: poppler-page-transition.h ---
/* PageTransition.h
 * Copyright (C) 2005, Net Integration Technologies, Inc.
 * Copyright (C) 2005, Brad Hards <bradh at frogmouth.net>
 *
 * 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.
 */

#ifndef __PAGETRANSITION_X_H__
#define __PAGETRANSITION_X_H__

namespace Poppler {

class PageTransitionParams;
class PageTransitionData;

class PageTransition {
 public:
  enum Type {
    Replace,
    Split,
    Blinds,
    Box,
    Wipe,
    Dissolve,
    Glitter,
    Fly,
    Push,
    Cover,
    Uncover,
    Fade
  };
  
  enum Alignment {
    Horizontal,
    Vertical
  };
  
  enum Direction {
    Inward,
    Outward
  };
  
  /** \brief Construct a new PageTransition object from a page dictionary.

  In case or error, this method will print an error message to stderr,
  and construct a default object.

  @param dictObj pointer to an object whose dictionary will be read
  and parsed. The pointer dictObj must point to a valid object, whose
  dictionaries are accessed by the constructor. The dictObj is only
  accessed by this constructor, and may be deleted after the
  constructor returns.
  */
  PageTransition(const PageTransitionParams &params);
  
  PageTransition(const PageTransition &pt);
  
  /**
     Destructor
  */
  ~PageTransition();
  
  /**
     \brief Get type of the transition.
  */
  Type type() const;
  
  /**
     \brief Get duration of the transition in seconds.
  */
  int duration() const;
  
  /**
     \brief Get dimension in which the transition effect occurs.
  */
  Alignment alignment() const;
  
  /**
     \brief Get direction of motion of the transition effect.
  */
  Direction direction() const;
  
  /**
     \brief Get direction in which the transition effect moves.
  */
  int angle() const;
  
  /**
     \brief Get starting or ending scale.
  */
  double scale() const;
  
  /**
     \brief Returns true if the area to be flown is rectangular and
     opaque.
  */
  bool isRectangular() const;
  
 private:
  PageTransitionData *data;
};

}

#endif

Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-page.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- poppler-page.cc	5 Jan 2006 13:53:58 -0000	1.11
+++ poppler-page.cc	6 Jan 2006 10:05:59 -0000	1.12
@@ -22,7 +22,6 @@
 #include <qimage.h>
 #include <GlobalParams.h>
 #include <PDFDoc.h>
-#include <Private.h>
 #include <Catalog.h>
 #include <ErrorCodes.h>
 #include <SplashOutputDev.h>

Index: poppler-private.h
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-private.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- poppler-private.h	1 Jan 2006 22:18:48 -0000	1.3
+++ poppler-private.h	6 Jan 2006 10:05:59 -0000	1.4
@@ -16,8 +16,10 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <SplashOutputDev.h>
 #include <PDFDoc.h>
 #include <FontInfo.h>
+#include <Object.h>
 
 namespace Poppler {
 
@@ -51,6 +53,9 @@
   SplashOutputDev *m_outputDev;
 };
 
-}
-
+class PageTransitionParams {
+  public:
+    Object *dictObj;
+};
 
+}

Index: poppler-qt.h
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-qt.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- poppler-qt.h	5 Jan 2006 13:53:58 -0000	1.14
+++ poppler-qt.h	6 Jan 2006 10:05:59 -0000	1.15
@@ -24,7 +24,7 @@
 #include <qdatetime.h>
 #include <qpixmap.h>
 
-#include <PageTransition.h>
+#include <poppler-page-transition.h>
 
 namespace Poppler {
 



More information about the poppler mailing list