[poppler] qt4/src

Patrick Spendrin ps_ml at gmx.de
Sat Mar 29 05:12:08 PDT 2008


Albert Astals Cid schrieb:
>  qt4/src/CMakeLists.txt                    |    4 
>  qt4/src/Makefile.am                       |    4 
>  qt4/src/poppler-page-transition-private.h |   28 +++++
>  qt4/src/poppler-page-transition.cc        |   95 +++++++++++++++++++
>  qt4/src/poppler-page-transition.h         |  146 ++++++++++++++++++++++++++++++
>  5 files changed, 273 insertions(+), 4 deletions(-)
> 
> New commits:
> commit b70ca35dce6da6efdff254c11a63de4f44228278
> Author: Albert Astals Cid <tsdgeos at localhost.(none)>
> Date:   Sat Mar 29 00:30:31 2008 +0100
> 
>     Duplicate page-transition files on qt4
> 
> diff --git a/qt4/src/CMakeLists.txt b/qt4/src/CMakeLists.txt
> index c77df13..1618cc2 100644
> --- a/qt4/src/CMakeLists.txt
> +++ b/qt4/src/CMakeLists.txt
> @@ -24,7 +24,7 @@ set(poppler_qt4_SRCS
>    poppler-qiodeviceoutstream.cc
>    poppler-sound.cc
>    poppler-textbox.cc
> -  ${CMAKE_SOURCE_DIR}/qt/poppler-page-transition.cc
> +  poppler-page-transition.cc
>  )
>  if (ENABLE_SPLASH)
>    set(poppler_qt4_SRCS ${poppler_qt4_SRCS}
> @@ -47,6 +47,6 @@ install(FILES
>    poppler-form.h
>    poppler-optcontent.h
>    poppler-export.h
> -  ${CMAKE_SOURCE_DIR}/qt/poppler-page-transition.h
> +  poppler-page-transition.h
>    DESTINATION include/poppler/qt4)
>  
> diff --git a/qt4/src/Makefile.am b/qt4/src/Makefile.am
> index 95e26a6..c449336 100644
> --- a/qt4/src/Makefile.am
> +++ b/qt4/src/Makefile.am
> @@ -16,7 +16,7 @@ poppler_include_HEADERS =			\
>  	poppler-form.h				\
>  	poppler-optcontent.h			\
>  	poppler-export.h			\
> -	../../qt/poppler-page-transition.h
> +	poppler-page-transition.h
>  
>  lib_LTLIBRARIES = libpoppler-qt4.la
>  
> @@ -31,7 +31,7 @@ libpoppler_qt4_la_SOURCES =			\
>  	poppler-link-extractor.cc		\
>  	poppler-optcontent.cc			\
>  	poppler-optcontent.h			\
> -	../../qt/poppler-page-transition.cc	\
> +	poppler-page-transition.cc		\
>  	poppler-sound.cc			\
>  	poppler-form.cc				\
>  	poppler-base-converter.cc		\
> diff --git a/qt4/src/poppler-page-transition-private.h b/qt4/src/poppler-page-transition-private.h
> new file mode 100644
> index 0000000..63febb0
> --- /dev/null
> +++ b/qt4/src/poppler-page-transition-private.h
> @@ -0,0 +1,28 @@
> +/*
> + * Copyright (C) 2005, Albert Astals Cid
> + *
> + * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
> + */
> +
> +class Object;
> +
> +namespace Poppler {
> +
> +class PageTransitionParams {
> +  public:
> +    Object *dictObj;
> +};
> +
> +}
> diff --git a/qt4/src/poppler-page-transition.cc b/qt4/src/poppler-page-transition.cc
> new file mode 100644
> index 0000000..cde8818
> --- /dev/null
> +++ b/qt4/src/poppler-page-transition.cc
> @@ -0,0 +1,95 @@
> +/* 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
> + */
> +
> +#include "PageTransition.h"
> +#include "poppler-page-transition.h"
> +#include "poppler-page-transition-private.h"
> +
> +namespace Poppler {
> +
> +class PageTransitionData
> +{
> +  public:
> +    PageTransitionData(Object *trans)
> +    {
> +        pt = new ::PageTransition(trans);
> +    }
> +
> +    PageTransitionData(const PageTransitionData &ptd)
> +    {
> +        pt = new ::PageTransition(*ptd.pt);
> +    }
> +
> +    ~PageTransitionData()
> +    {
> +        delete pt;
> +    }
> +
> +    ::PageTransition *pt;
> +};
> +
> +PageTransition::PageTransition(const PageTransitionParams &params)
> +{
> +  data = new PageTransitionData(params.dictObj);
> +}
> +
> +PageTransition::PageTransition(const PageTransition &pt)
> +{
> +  data = new PageTransitionData(*pt.data);
> +}
> +
> +PageTransition::~PageTransition()
> +{
> +  delete data;
> +}
> +
> +PageTransition::Type PageTransition::type() const
> +{
> +  return (Poppler::PageTransition::Type)data->pt->getType();
> +}
> +
> +int PageTransition::duration() const
> +{
> +  return data->pt->getDuration();
> +}
> +
> +PageTransition::Alignment PageTransition::alignment() const
> +{
> +  return (Poppler::PageTransition::Alignment)data->pt->getAlignment();
> +}
> +
> +PageTransition::Direction PageTransition::direction() const
> +{
> +  return (Poppler::PageTransition::Direction)data->pt->getDirection();
> +}
> +
> +int PageTransition::angle() const
> +{
> +  return data->pt->getAngle();
> +}
> +
> +double PageTransition::scale() const
> +{
> +  return data->pt->getScale();
> +}
> +bool PageTransition::isRectangular() const
> +{
> +  return data->pt->isRectangular();
> +}
> +
> +}
> diff --git a/qt4/src/poppler-page-transition.h b/qt4/src/poppler-page-transition.h
> new file mode 100644
> index 0000000..53002ff
> --- /dev/null
> +++ b/qt4/src/poppler-page-transition.h
> @@ -0,0 +1,146 @@
> +/* 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
> + */
> +
> +#ifndef __PAGETRANSITION_X_H__
> +#define __PAGETRANSITION_X_H__
> +
> +namespace Poppler {
> +
> +class PageTransitionParams;
> +class PageTransitionData;
> +
> +/**
> +   \brief Describes how a PDF file viewer shall perform the transition
> +   from one page to another
> +
> +   In PDF files there is a way to specify if the viewer shall use
> +   certain effects to perform the transition from one page to
> +   another. This feature can be used, e.g., in a PDF-based beamer
> +   presentation.
> +
> +   This utility class represents the transition effect, and can be
> +   used to extract the information from a PDF object.
> +*/
> +
> +
> +class PageTransition {
> + public:
> +
> +  /** \brief transition effect that shall be used
> +   */
> +  // if changed remember to keep in sync with PageTransition.h enum
> +  enum Type {
> +    Replace = 0,
> +    Split,
> +    Blinds,
> +    Box,
> +    Wipe,
> +    Dissolve,
> +    Glitter,
> +    Fly,
> +    Push,
> +    Cover,
> +    Uncover,
> +    Fade
> +  };
> +  
> +  /** \brief alignment of the transition effect that shall be used
> +   */
> +  // if changed remember to keep in sync with PageTransition.h enum
> +  enum Alignment {
> +    Horizontal = 0,
> +    Vertical
> +  };
> +  
> +  /** \brief direction of the transition effect that shall be used
> +   */
> +  // if changed remember to keep in sync with PageTransition.h enum
> +  enum Direction {
> +    Inward = 0,
> +    Outward
> +  };
> +  
> +  /** \brief Construct a new PageTransition object from a page dictionary.
> +
> +  Users of the library will rarely need to construct a
> +  PageTransition object themselves. Instead, the method
> +  Poppler::Page::transition() can be used to find out if a certain
> +  transition effect is specified.
> +
> +  @warning In case or error, this method will print an error message to stderr,
> +  and construct a default object.
> +
> +  @param params an object whose dictionary will be read and
> +   parsed. This must be a valid object, whose dictionaries are
> +   accessed by the constructor. The object is only accessed by this
> +   constructor, and may be deleted after the constructor returns.
> +  */
> +  PageTransition(const PageTransitionParams &params);
> +
> +  /** \brief copy constructor */
> +  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
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
Can you please add the #include "poppler-export.h"
and the POPPLER_QT4_EXPORT macro as well?
Thanks for the quick response :-)
> 
regards
Patrick


-- 
web:                 http://windows.kde.org
mailing list:        kde-windows at kde.org
irc:                 #kde-windows (irc.freenode.net)


More information about the poppler mailing list