[poppler] 3 commits - cpp/poppler-global.cpp cpp/poppler-page-transition.cpp cpp/poppler-private.cpp cpp/poppler-rectangle.cpp qt4/src qt4/tests

Pino Toscano pino at kemper.freedesktop.org
Fri Sep 17 13:20:48 PDT 2010


 cpp/poppler-global.cpp          |  124 ++++++++++++++++++++++++++++++++++++++++
 cpp/poppler-page-transition.cpp |   32 ++++++++++
 cpp/poppler-private.cpp         |    8 +-
 cpp/poppler-rectangle.cpp       |   19 ++++++
 qt4/src/poppler-private.cc      |    2 
 qt4/tests/check_strings.cpp     |   18 +++++
 6 files changed, 198 insertions(+), 5 deletions(-)

New commits:
commit fa3abc23656204eedd022ee1c73d9e5af758cdac
Author: Pino Toscano <pino at kde.org>
Date:   Fri Sep 17 22:20:09 2010 +0200

    [cpp] More bits of API documentation.

diff --git a/cpp/poppler-global.cpp b/cpp/poppler-global.cpp
index fbdf5a9..3af7328 100644
--- a/cpp/poppler-global.cpp
+++ b/cpp/poppler-global.cpp
@@ -62,6 +62,130 @@ using namespace poppler;
  A class that cannot be copied.
  */
 
+/**
+ \enum poppler::rotation_enum
+
+ The case sensitivity.
+*/
+/**
+ \var poppler::rotation_enum poppler::rotate_0
+
+ A rotation of 0 degrees clockwise.
+*/
+/**
+ \var poppler::rotation_enum poppler::rotate_90
+
+ A rotation of 90 degrees clockwise.
+*/
+/**
+ \var poppler::rotation_enum poppler::rotate_180
+
+ A rotation of 180 degrees clockwise.
+*/
+/**
+ \var poppler::rotation_enum poppler::rotate_270
+
+ A rotation of 270 degrees clockwise.
+*/
+
+/**
+ \enum poppler::page_box_enum
+
+ A possible box of a page in a PDF %document.
+*/
+/**
+ \var poppler::page_box_enum poppler::media_box
+
+ The "media" box.
+*/
+/**
+ \var poppler::page_box_enum poppler::crop_box
+
+ The "crop" box.
+*/
+/**
+ \var poppler::page_box_enum poppler::bleed_box
+
+ The "bleed" box.
+*/
+/**
+ \var poppler::page_box_enum poppler::trim_box
+
+ The "trim" box.
+*/
+/**
+ \var poppler::page_box_enum poppler::art_box
+
+ The "art" box.
+*/
+
+/**
+ \enum poppler::permission_enum
+
+ A possible permission in a PDF %document.
+*/
+/**
+ \var poppler::permission_enum poppler::perm_print
+
+ The permission to allow the print of a %document.
+*/
+/**
+ \var poppler::permission_enum poppler::perm_change
+
+ The permission to change a %document.
+
+ This is a generic "change" permission, so other permissions could affect
+ some types of changes.
+*/
+/**
+ \var poppler::permission_enum poppler::perm_copy
+
+ The permission to allow the copy or extraction of the text in a %document.
+*/
+/**
+ \var poppler::permission_enum poppler::perm_add_notes
+
+ The permission to allow the addition or editing of annotations,
+ and the filling of interactive form fields (including signature fields).
+*/
+/**
+ \var poppler::permission_enum poppler::perm_fill_forms
+
+ The permission to allow the the filling of interactive form fields
+ (including signature fields).
+
+ \note this permission can be set even when the \ref poppler::perm_add_notes "perm_add_notes"
+       is not: this means that only the filling of forms is allowed.
+*/
+/**
+ \var poppler::permission_enum poppler::perm_accessibility
+
+ The permission to allow the extracting of content (for example, text) for
+ accessibility usage (e.g. for a screen reader).
+*/
+/**
+ \var poppler::permission_enum poppler::perm_assemble
+
+ The permission to allow to "assemble" a %document.
+
+ This implies operations such as the insertion, the rotation and the deletion
+ of pages; the creation of bookmarks and thumbnail images.
+
+ \note this permission can be set even when the \ref poppler::perm_change "perm_change"
+       is not
+*/
+/**
+ \var poppler::permission_enum poppler::perm_print_high_resolution
+
+ The permission to allow the high resolution print of a %document.
+*/
+
+/**
+ \enum poppler::case_sensitivity_enum
+
+ The case sensitivity.
+*/
+
 
 noncopyable::noncopyable()
 {
diff --git a/cpp/poppler-page-transition.cpp b/cpp/poppler-page-transition.cpp
index 92ae4fc..91c5b84 100644
--- a/cpp/poppler-page-transition.cpp
+++ b/cpp/poppler-page-transition.cpp
@@ -33,17 +33,49 @@ public:
     PageTransition pt;
 };
 
+/**
+ \class poppler::page_transition poppler-page-transition.h "poppler/cpp/poppler-page-transition.h"
+
+ A transition between two pages in a PDF %document.
+
+ Usually shown in a presentation mode of a PDF viewer.
+ */
+
+/**
+ \enum poppler::page_transition::type_enum
+
+ The possibe types of a %page transition.
+*/
+
+/**
+ \enum poppler::page_transition::alignment_enum
+
+ The alignment of a %page transition.
+*/
+
+/**
+ \enum poppler::page_transition::direction_enum
+
+ The direction of an animation in a %page transition.
+*/
+
 
 page_transition::page_transition(Object *params)
     : d(new page_transition_private(params))
 {
 }
 
+/**
+ Copy constructor.
+ */
 page_transition::page_transition(const page_transition &pt)
     : d(new page_transition_private(*pt.d))
 {
 }
 
+/**
+ Destructor.
+ */
 page_transition::~page_transition()
 {
     delete d;
diff --git a/cpp/poppler-rectangle.cpp b/cpp/poppler-rectangle.cpp
index 57fd859..462280b 100644
--- a/cpp/poppler-rectangle.cpp
+++ b/cpp/poppler-rectangle.cpp
@@ -22,6 +22,25 @@
 
 using namespace poppler;
 
+/**
+ \class poppler::rectangle poppler-rectangle.h "poppler/cpp/poppler-rectangle.h"
+
+ A rectangle.
+ */
+
+/**
+ \typedef poppler::rect
+
+ A rectangle with int dimensions and coordinates.
+ */
+
+/**
+ \typedef poppler::rectf
+
+ A rectangle with float (double) dimensions and coordinates.
+ */
+
+
 std::ostream& poppler::operator<<(std::ostream& stream, const rect &r)
 {
     stream << "[" << r.x() << "," << r.y() << " " << r.width() << "+" << r.height() << "]";
commit c5f7b5becc9993c05b67a470d5a1e431806b98d6
Author: Pino Toscano <pino at kde.org>
Date:   Fri Sep 17 20:26:37 2010 +0200

    update copyrights

diff --git a/qt4/src/poppler-private.cc b/qt4/src/poppler-private.cc
index df55b20..1cbcc91 100644
--- a/qt4/src/poppler-private.cc
+++ b/qt4/src/poppler-private.cc
@@ -1,7 +1,7 @@
 /* poppler-private.cc: qt interface to poppler
  * Copyright (C) 2005, Net Integration Technologies, Inc.
  * Copyright (C) 2006 by Albert Astals Cid <aacid at kde.org>
- * Copyright (C) 2008 by Pino Toscano <pino at kde.org>
+ * Copyright (C) 2008, 2010 by Pino Toscano <pino at kde.org>
  * Inspired on code by
  * Copyright (C) 2004 by Albert Astals Cid <tsdgeos at terra.es>
  * Copyright (C) 2004 by Enrico Ros <eros.kde at email.it>
diff --git a/qt4/tests/check_strings.cpp b/qt4/tests/check_strings.cpp
index 457be36..7c3e3ed 100644
--- a/qt4/tests/check_strings.cpp
+++ b/qt4/tests/check_strings.cpp
@@ -1,3 +1,21 @@
+/*
+ * Copyright (C) 2010, Pino Toscano <pino at kde.org>
+ *
+ * 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 <QtTest/QtTest>
 
 #include <poppler-qt4.h>
commit ae517042570327b860c1db6b68f9697d5c104657
Author: Pino Toscano <pino at kde.org>
Date:   Fri Sep 17 19:39:10 2010 +0200

    [cpp] improve a bit the Unicode* -> ustring conversion
    
    (although IMHO not yet solved)

diff --git a/cpp/poppler-private.cpp b/cpp/poppler-private.cpp
index 5b63786..6f6704a 100644
--- a/cpp/poppler-private.cpp
+++ b/cpp/poppler-private.cpp
@@ -84,11 +84,11 @@ ustring detail::unicode_GooString_to_ustring(GooString *str)
 
 ustring detail::unicode_to_ustring(const Unicode *u, int length)
 {
-    ustring str(length, 0);
-    ustring::iterator it = str.begin(), it_end = str.end();
+    ustring str(length * 2, 0);
+    ustring::iterator it = str.begin();
     const Unicode *uu = u;
-    for (; it != it_end; ++it) {
-        *it = ustring::value_type(*uu++);
+    for (int i = 0; i < length; ++i) {
+        *it++ = ustring::value_type(*uu++ & 0xffff);
     }
     return str;
 }


More information about the poppler mailing list