[poppler] poppler/qt4/src: Makefile.am, 1.1, 1.2 poppler-fontinfo.cc, NONE, 1.1 poppler-qt4.h, 1.12, 1.13 poppler-textbox.cc, NONE, 1.1

Albert Astals Cid aacid at freedesktop.org
Sat Dec 3 14:20:56 PST 2005


Update of /cvs/poppler/poppler/qt4/src
In directory gabe:/tmp/cvs-serv8057/qt4/src

Modified Files:
	Makefile.am poppler-qt4.h 
Added Files:
	poppler-fontinfo.cc poppler-textbox.cc 
Log Message:
 * qt4/src/poppler-qt4.h:
 * qt4/src/poppler-fontinfo.cc:
 * qt4/src/poppler-textbox.cc: Remove implementation of that classes from the header, use pimpl


Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile.am	28 Jun 2005 10:00:09 -0000	1.1
+++ Makefile.am	3 Dec 2005 22:20:54 -0000	1.2
@@ -14,6 +14,8 @@
 libpoppler_qt4_la_SOURCES =			\
 	poppler-document.cc			\
 	poppler-page.cc				\
+	poppler-fontinfo.cc			\
+	poppler-textbox.cc			\
 	poppler-private.h
 
 libpoppler_qt4_la_LIBADD= 			\

--- NEW FILE: poppler-fontinfo.cc ---
/* poppler-qt.h: qt interface to poppler
 * Copyright (C) 2005, Net Integration Technologies, Inc.
 * Copyright (C) 2005, Tobias Koening
 *
 * 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.
 */

#define UNSTABLE_POPPLER_QT4

#include "poppler-qt4.h"

namespace Poppler {

class FontInfoData
{
	public:
		QString fontName;
		bool isEmbedded;
		bool isSubset;
		FontInfo::Type type;
};

FontInfo::FontInfo( const QString &fontName, const bool isEmbedded, const bool isSubset, Type type )
{
	m_data = new FontInfoData();
	m_data->fontName = fontName;
	m_data->isEmbedded = isEmbedded;
	m_data->isSubset = isSubset;
	m_data->type = type;
}

FontInfo::~FontInfo()
{
	delete m_data;
}

const QString &FontInfo::name() const
{
	return m_data->fontName;
}

bool FontInfo::isEmbedded() const
{
	return m_data->isEmbedded;
}

bool FontInfo::isSubset() const
{
	return m_data->isSubset;
}

FontInfo::Type FontInfo::type() const
{
	return m_data->type;
}

}

Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- poppler-qt4.h	3 Dec 2005 21:35:46 -0000	1.12
+++ poppler-qt4.h	3 Dec 2005 22:20:54 -0000	1.13
@@ -35,17 +35,16 @@
 
     class PageData;
 
+    class TextBoxData;
     class TextBox {
     public:
-      TextBox(const QString& text, const QRectF &bBox) :
-	m_text(text), m_bBox(bBox) {};
+      TextBox(const QString& text, const QRectF &bBox);
       
-      QString text() const { return m_text; };
-      QRectF boundingBox() const { return m_bBox; };
+      const QString &text() const;
+      const QRectF &boundingBox() const;
 	
     private:
-	QString m_text;
-	QRectF m_bBox;
+	TextBoxData *m_data;
     };
 
 
@@ -53,6 +52,7 @@
        Container class for information about a font within a PDF
        document
     */
+    class FontInfoData;
     class FontInfo {
     public:
 	enum Type {
@@ -69,27 +69,22 @@
 	/**
 	   Create a new font information container
 	*/
-	FontInfo( const QString fontName, const bool isEmbedded,
-		  const bool isSubset, Type type):
-	    m_fontName(fontName),
-	    m_isEmbedded(isEmbedded),
-	    m_isSubset(isSubset),
-	    m_type(type)
-	    {};
+	FontInfo( const QString &fontName, const bool isEmbedded,
+		  const bool isSubset, Type type);
+	
+	~FontInfo();
 
 	/**
 	   The name of the font. Can be QString::null if the font has no name
 	*/
-	QString name() const
-	    { return m_fontName; }
+	const QString &name() const;
 
 	/**
 	   Whether the font is embedded in the file, or not
 
 	   \return true if the font is embedded
 	*/
-	bool isEmbedded() const
-	    { return m_isEmbedded; }
+	bool isEmbedded() const;
 
 	/**
 	   Whether the font provided is only a subset of the full
@@ -97,21 +92,17 @@
 
 	   \return true if the font is only a subset
 	*/
-	bool isSubset() const
-	    { return m_isSubset; }
+	bool isSubset() const;
 
 	/**
 	   The type of font encoding
 	*/
-	Type type() const
-	    { return m_type; }
+	Type type() const;
+
+	const QString &typeName() const;
 
-	QString typeName() const;
     private:
-	QString m_fontName;
-	bool m_isEmbedded;
-	bool m_isSubset;
-	Type m_type;
+	FontInfoData *m_data;
     };
 
 

--- NEW FILE: poppler-textbox.cc ---
/* poppler-qt.h: qt interface to poppler
 * 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.
 */

#define UNSTABLE_POPPLER_QT4

#include "poppler-qt4.h"

namespace Poppler {

class TextBoxData
{
	public:
		QString text;
		QRectF bBox;
};

TextBox::TextBox(const QString& text, const QRectF &bBox)
{
	m_data = new TextBoxData();
	m_data->text = text;
	m_data->bBox = bBox;
}

const QString &TextBox::text() const
{
	return m_data->text;
}

const QRectF &TextBox::boundingBox() const
{
	return m_data->bBox;
};

}



More information about the poppler mailing list