Changeset 58
- Timestamp:
- 04/14/06 10:13:02 (2 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 modified
- 2 moved
-
src/DocumentOutline.cxx (moved) (moved from trunk/src/DocumentIndex.cxx) (1 diff)
-
src/DocumentOutline.h (moved) (moved from trunk/src/DocumentIndex.h) (2 diffs)
-
src/DocumentPage.cxx (modified) (1 diff)
-
src/IDocument.cxx (modified) (3 diffs)
-
src/IDocument.h (modified) (2 diffs)
-
src/MainPter.cxx (modified) (1 diff)
-
src/Makefile.am (modified) (1 diff)
-
src/PDFDocument.cxx (modified) (1 diff)
-
src/PDFDocument.h (modified) (1 diff)
-
src/epdfview.h (modified) (1 diff)
-
tests/DocumentOutlineTest.cxx (added)
-
tests/DocumentOutlineTest.h (added)
-
tests/MainPterTest.cxx (modified) (1 diff)
-
tests/Makefile.am (modified) (2 diffs)
-
tests/PDFDocumentTest.cxx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DocumentOutline.cxx
r49 r58 22 22 23 23 /// 24 /// @brief Constructs a new Document Index.24 /// @brief Constructs a new DocumentOutline. 25 25 /// 26 Document Index::DocumentIndex()26 DocumentOutline::DocumentOutline () 27 27 { 28 28 } 29 29 30 30 /// 31 /// @brief Destroys any dynamically created object of DocumentIndex;31 /// @brief Destroys any dynamically allocated memory for DocumentOutline. 32 32 /// 33 Document Index::~DocumentIndex()33 DocumentOutline::~DocumentOutline () 34 34 { 35 35 } 36 36 37 37 /// 38 /// @brief Get the number of children for this index.38 /// @brief Get the outline's destination page. 39 39 /// 40 /// @return The number of children this index has. 40 /// I'm only using the outlines as a way to go to an specific page, although 41 /// the PDF Specification says that an outline could open a page from another 42 /// file, execute an application, etc... I won't use all those features and 43 /// concentrate only on the pages. 44 /// 45 /// @return The destination page number for the outline number or 1 if the 46 /// outline item has no page number (like the root outline item or 47 /// other kinds of destinations). 41 48 /// 42 49 gint 43 DocumentIndex::getNumChildren () 50 DocumentOutline::getDestinationPage () 51 { 52 return 1; 53 } 54 55 /// 56 /// @brief The first children of the outline item. 57 /// 58 /// @return The pointer to the first children of the outline item, or 59 /// NULL if the outline has no children. 60 /// 61 DocumentOutline * 62 DocumentOutline::getFirstChild () 63 { 64 return NULL; 65 } 66 67 /// 68 /// @brief Gets the number of children for this outline. 69 /// 70 /// @return The number of children this utline has. 71 /// 72 gint 73 DocumentOutline::getNumChildren () 44 74 { 45 75 return 0; 46 76 } 77 78 /// 79 /// @brief Gets the outline's title. 80 /// 81 /// @return The title of the outline item or an empty string if the 82 /// outline item has no title (like the root outline item). 83 /// 84 const gchar * 85 DocumentOutline::getTitle () 86 { 87 return ""; 88 } -
trunk/src/DocumentOutline.h
r49 r58 16 16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 18 #if !defined (__DOCUMENT_ INDEX_H__)19 #define __DOCUMENT_ INDEX_H__18 #if !defined (__DOCUMENT_OUTLINE_H__) 19 #define __DOCUMENT_OUTLINE_H__ 20 20 21 21 namespace ePDFView 22 22 { 23 23 /// 24 /// @class Document Index25 /// @brief Stores the document's index name, actionand its children.24 /// @class DocumentOutline 25 /// @brief Stores the document's outline title, page num. and its children. 26 26 /// 27 27 /// Some documents have an index with them. This index can be used to … … 29 29 /// contents. 30 30 /// 31 /// Each node contains a name, an action an possibly children nodes. The32 /// only node that have an empty name and no action is the top level33 /// DocumentIndex, that is only used as a container for all other34 /// DocumentIndexobjects.31 /// Each node contains a title, a destination page an possibly children 32 /// nodes. The only node that have an empty name and a 0 page number is the 33 /// top level DocumentOutline, that is only used as a container for all 34 /// other DocumentOutline objects. 35 35 /// 36 class Document Index36 class DocumentOutline 37 37 { 38 38 public: 39 Document Index(void);40 ~Document Index(void);39 DocumentOutline (void); 40 ~DocumentOutline (void); 41 41 42 gint getDestinationPage (void); 43 DocumentOutline *getFirstChild (void); 42 44 gint getNumChildren (void); 45 const gchar *getTitle (void); 43 46 }; 44 47 } 45 48 46 #endif // !__DOCUMENT_ INDEX_H__49 #endif // !__DOCUMENT_OUTLINE_H__ -
trunk/src/DocumentPage.cxx
r49 r58 17 17 18 18 #include <config.h> 19 #include <string.h> 19 20 #include "epdfview.h" 20 21 -
trunk/src/IDocument.cxx
r49 r58 127 127 m_Creator = NULL; 128 128 m_CurrentPage = 0; 129 m_ DocumentIndex = new DocumentIndex();129 m_Outline = new DocumentOutline (); 130 130 m_FileName = NULL; 131 131 m_Format = NULL; … … 148 148 IDocument::~IDocument () 149 149 { 150 delete m_ DocumentIndex;150 delete m_Outline; 151 151 g_free (m_Author); 152 152 g_free (m_CreationDate); … … 557 557 558 558 /// 559 /// @brief Get the document's index.560 /// 561 /// @return The top level Document Indexfor this document.562 /// 563 DocumentIndex & 564 IDocument::getDocumentIndex () 565 { 566 g_assert (NULL != m_DocumentIndex && "The document index is NULL."); 567 568 return *(m_DocumentIndex);559 /// @brief Get the document's outline. 560 /// 561 /// @return The top level DocumentOutline for this document. 562 /// The returned object must not be freed, the 563 /// IDocument class will do it. 564 /// 565 DocumentOutline * 566 IDocument::getOutline () 567 { 568 return m_Outline; 569 569 } 570 570 -
trunk/src/IDocument.h
r56 r58 199 199 void setNumPages (gint numPages); 200 200 gint getCurrentPageNum (void); 201 Document Index &getDocumentIndex(void);201 DocumentOutline *getOutline (void); 202 202 203 203 void goToFirstPage (void); … … 231 231 gchar *m_Creator; 232 232 gint m_CurrentPage; 233 Document Index *m_DocumentIndex;233 DocumentOutline *m_Outline; 234 234 gchar *m_Format; 235 235 gchar *m_FileName; -
trunk/src/MainPter.cxx
r49 r58 17 17 18 18 #include <config.h> 19 #include <stdlib.h> 19 20 #include "epdfview.h" 20 21 -
trunk/src/Makefile.am
r47 r58 5 5 6 6 libepdfview_a_SOURCES = \ 7 Document Index.cxx \8 Document Index.h\7 DocumentOutline.cxx \ 8 DocumentOutline.h \ 9 9 DocumentPage.h \ 10 10 DocumentPage.cxx \ -
trunk/src/PDFDocument.cxx
r49 r58 19 19 20 20 // Poppler headers. 21 #include <PDFDoc.h> 22 #include <CairoOutputDev.h> 21 23 #include <ErrorCodes.h> 22 24 #include <GlobalParams.h> -
trunk/src/PDFDocument.h
r49 r58 18 18 #if !defined (__PDF_DOCUMENT_H__) 19 19 #define __PDF_DOCUMENT_H__ 20 21 22 /// Forward declarations. 23 class PDFDoc; 24 class CairoOutputDev; 20 25 21 26 namespace ePDFView -
trunk/src/epdfview.h
r23 r58 22 22 #include <glib.h> 23 23 24 // Poppler headers. 25 #include <PDFDoc.h> 26 #include <CairoOutputDev.h> 27 28 #include <DocumentIndex.h> 24 #include <DocumentOutline.h> 29 25 #include <DocumentPage.h> 30 26 #include <IDocument.h> -
trunk/tests/MainPterTest.cxx
r55 r58 16 16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 18 #include <glib.h> 19 #include <IDocument.h> 20 #include <IMainView.h> 21 #include <MainPter.h> 18 #include <epdfview.h> 22 19 #include "DumbDocument.h" 23 20 #include "DumbMainView.h" -
trunk/tests/Makefile.am
r21 r58 8 8 9 9 test_epdfview_SOURCES = \ 10 DocumentOutlineTest.cxx \ 11 DocumentOutlineTest.h \ 10 12 DumbDocument.cxx \ 11 13 DumbDocument.h \ … … 22 24 -I$(top_srcdir)/src \ 23 25 $(GLIB_CFLAGS) \ 24 $(POPPLER_CFLAGS) \25 26 $(CPPUNIT_CFLAGS) 26 27 -
trunk/tests/PDFDocumentTest.cxx
r22 r58 79 79 CPPUNIT_ASSERT_EQUAL (0, m_Document->getNumPages ()); 80 80 CPPUNIT_ASSERT_EQUAL (0, m_Document->getCurrentPageNum ()); 81 82 DocumentIndex &index = m_Document->getDocumentIndex ();83 CPPUNIT_ASSERT_EQUAL (0, index.getNumChildren ());84 81 } 85 82
