Changeset 23
- Timestamp:
- 04/11/06 10:13:29 (3 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 modified
-
src/IMainView.h (added)
-
src/MainPter.cxx (added)
-
src/MainPter.h (added)
-
src/Makefile.am (modified) (1 diff)
-
src/epdfview.h (modified) (1 diff)
-
tests/DumbDocument.cxx (modified) (1 diff)
-
tests/DumbDocument.h (modified) (1 diff)
-
tests/DumbMainView.cxx (modified) (1 diff)
-
tests/DumbMainView.h (modified) (1 diff)
-
tests/MainPterTest.cxx (modified) (3 diffs)
-
tests/MainPterTest.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Makefile.am
r21 r23 13 13 MainPter.cxx \ 14 14 MainPter.h \ 15 MainView.h \ 15 16 PDFDocument.cxx \ 16 17 PDFDocument.h -
trunk/src/epdfview.h
r21 r23 31 31 #include <PDFDocument.h> 32 32 33 #include <IMainView.h> 33 34 #include <MainPter.h> 34 35 -
trunk/tests/DumbDocument.cxx
r21 r23 16 16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 18 #include <epdfview.h> 19 #include "DumbDocument.h" 20 21 using namespace ePDFView; 22 23 //////////////////////////////////////////////////////////////// 24 // Interface Methods 25 //////////////////////////////////////////////////////////////// 26 27 DumbDocument::DumbDocument (): 28 IDocument () 29 { 30 } 31 32 DumbDocument::~DumbDocument () 33 { 34 } 35 36 gboolean 37 DumbDocument::isLoaded () 38 { 39 return false; 40 } 41 42 gboolean 43 DumbDocument::loadFile (const gchar *filename, const gchar *password, 44 GError **error) 45 { 46 return false; 47 } 48 49 void 50 DumbDocument::getPageSize (gdouble *width, gdouble *height) 51 { 52 *width = 10; 53 *height = 10; 54 } 55 56 DocumentPage * 57 DumbDocument::renderPage () 58 { 59 return new DocumentPage (); 60 } -
trunk/tests/DumbDocument.h
r21 r23 21 21 namespace ePDFView 22 22 { 23 class DumbDocument 23 class DumbDocument: public IDocument 24 24 { 25 public: 26 DumbDocument (); 27 ~DumbDocument (); 28 29 // Interface methods. 30 gboolean isLoaded (void); 31 gboolean loadFile (const gchar *filename, const gchar *password, 32 GError **error); 33 void getPageSize (gdouble *width, gdouble *height); 34 DocumentPage *renderPage (void); 25 35 }; 26 36 } -
trunk/tests/DumbMainView.cxx
r21 r23 16 16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 18 #include <epdfview.h> 19 #include "DumbMainView.h" 20 21 using namespace ePDFView; 22 23 //////////////////////////////////////////////////////////////// 24 // Interface Methods 25 //////////////////////////////////////////////////////////////// 26 DumbMainView::DumbMainView (MainPter *pter): 27 IMainView (pter) 28 { 29 // This won't be deleted because it's presenter responsability. 30 m_DocumentPage = NULL; 31 m_SensitiveGoToFirstPage = TRUE; 32 m_SensitiveGoToLastPage = TRUE; 33 m_SensitiveGoToNextPage = TRUE; 34 m_SensitiveGoToPage = TRUE; 35 m_SensitiveGoToPreviousPage = TRUE; 36 m_SensitiveZoomIn = TRUE; 37 m_SensitiveZoomOut = TRUE; 38 m_SensitiveZoomFit = TRUE; 39 m_SensitiveZoomWidth = TRUE; 40 m_Shown = FALSE; 41 m_Title = g_strdup (""); 42 } 43 44 DumbMainView::~DumbMainView () 45 { 46 g_free (m_Title); 47 } 48 49 void 50 DumbMainView::sensitiveGoToFirstPage (gboolean sensitive) 51 { 52 m_SensitiveGoToFirstPage = sensitive; 53 } 54 55 void 56 DumbMainView::sensitiveGoToLastPage (gboolean sensitive) 57 { 58 m_SensitiveGoToLastPage = sensitive; 59 } 60 61 void 62 DumbMainView::sensitiveGoToNextPage (gboolean sensitive) 63 { 64 m_SensitiveGoToNextPage = sensitive; 65 } 66 67 void 68 DumbMainView::sensitiveGoToPage (gboolean sensitive) 69 { 70 m_SensitiveGoToPage = sensitive; 71 } 72 73 void 74 DumbMainView::sensitiveGoToPreviousPage (gboolean sensitive) 75 { 76 m_SensitiveGoToPreviousPage = sensitive; 77 } 78 79 void 80 DumbMainView::sensitiveZoomIn (gboolean sensitive) 81 { 82 m_SensitiveZoomIn = sensitive; 83 } 84 85 void 86 DumbMainView::sensitiveZoomOut (gboolean sensitive) 87 { 88 m_SensitiveZoomOut = sensitive; 89 } 90 91 void 92 DumbMainView::sensitiveZoomFit (gboolean sensitive) 93 { 94 m_SensitiveZoomFit = sensitive; 95 } 96 97 void 98 DumbMainView::sensitiveZoomWidth (gboolean sensitive) 99 { 100 m_SensitiveZoomWidth = sensitive; 101 } 102 103 void 104 DumbMainView::show (void) 105 { 106 m_Shown = TRUE; 107 } 108 109 void 110 DumbMainView::setTitle (const gchar *title) 111 { 112 g_free (m_Title); 113 m_Title = g_strdup (title); 114 } 115 116 117 //////////////////////////////////////////////////////////////// 118 // Test Methods 119 //////////////////////////////////////////////////////////////// 120 121 gboolean 122 DumbMainView::isShown () 123 { 124 return m_Shown; 125 } 126 127 const gchar * 128 DumbMainView::getTitle () 129 { 130 return m_Title; 131 } 132 133 gboolean 134 DumbMainView::isSensitiveGoToFirstPage () 135 { 136 return m_SensitiveGoToFirstPage; 137 } 138 139 gboolean 140 DumbMainView::isSensitiveGoToLastPage () 141 { 142 return m_SensitiveGoToLastPage; 143 } 144 145 gboolean 146 DumbMainView::isSensitiveGoToNextPage () 147 { 148 return m_SensitiveGoToNextPage; 149 } 150 151 gboolean 152 DumbMainView::isSensitiveGoToPage () 153 { 154 return m_SensitiveGoToPage; 155 } 156 157 gboolean 158 DumbMainView::isSensitiveGoToPreviousPage () 159 { 160 return m_SensitiveGoToPreviousPage; 161 } 162 163 gboolean 164 DumbMainView::isSensitiveZoomIn () 165 { 166 return m_SensitiveZoomIn; 167 } 168 169 gboolean 170 DumbMainView::isSensitiveZoomOut () 171 { 172 return m_SensitiveZoomOut; 173 } 174 175 gboolean 176 DumbMainView::isSensitiveZoomFit () 177 { 178 return m_SensitiveZoomFit; 179 } 180 181 gboolean 182 DumbMainView::isSensitiveZoomWidth () 183 { 184 return m_SensitiveZoomWidth; 185 } 186 187 gboolean 188 DumbMainView::hasImagePageView () 189 { 190 return NULL != m_DocumentPage; 191 } -
trunk/tests/DumbMainView.h
r21 r23 21 21 namespace ePDFView 22 22 { 23 class DumbMainView 23 class DumbMainView: public IMainView 24 24 { 25 public: 26 // Interface methods. 27 DumbMainView (MainPter *pter); 28 ~DumbMainView (); 29 30 void sensitiveGoToFirstPage (gboolean sensitive); 31 void sensitiveGoToLastPage (gboolean sensitive); 32 void sensitiveGoToNextPage (gboolean sensitive); 33 void sensitiveGoToPage (gboolean sensitive); 34 void sensitiveGoToPreviousPage (gboolean sensitive); 35 void sensitiveZoomIn (gboolean sensitive); 36 void sensitiveZoomOut (gboolean sensitive); 37 void sensitiveZoomFit (gboolean sensitive); 38 void sensitiveZoomWidth (gboolean sensitive); 39 void show (void); 40 void setTitle (const gchar *title); 41 42 // Methods for test purposes. 43 const gchar *getTitle (void); 44 gboolean isShown (void); 45 gboolean isSensitiveGoToFirstPage (void); 46 gboolean isSensitiveGoToLastPage (void); 47 gboolean isSensitiveGoToNextPage (void); 48 gboolean isSensitiveGoToPage (void); 49 gboolean isSensitiveGoToPreviousPage (void); 50 gboolean isSensitiveZoomIn (void); 51 gboolean isSensitiveZoomOut (void); 52 gboolean isSensitiveZoomFit (void); 53 gboolean isSensitiveZoomWidth (void); 54 gboolean hasImagePageView (void); 55 56 protected: 57 DocumentPage *m_DocumentPage; 58 gboolean m_SensitiveGoToFirstPage; 59 gboolean m_SensitiveGoToLastPage; 60 gboolean m_SensitiveGoToNextPage; 61 gboolean m_SensitiveGoToPage; 62 gboolean m_SensitiveGoToPreviousPage; 63 gboolean m_SensitiveZoomIn; 64 gboolean m_SensitiveZoomOut; 65 gboolean m_SensitiveZoomFit; 66 gboolean m_SensitiveZoomWidth; 67 gboolean m_Shown; 68 gchar *m_Title; 25 69 }; 26 70 } -
trunk/tests/MainPterTest.cxx
r21 r23 32 32 MainPterTest::setUp () 33 33 { 34 /*m_Document = new DumbDocument ();34 m_Document = new DumbDocument (); 35 35 m_MainPter = new MainPter (m_Document); 36 36 m_View = new DumbMainView (m_MainPter); 37 m_MainPter->setView (m_View); */37 m_MainPter->setView (m_View); 38 38 } 39 39 … … 60 60 MainPterTest::initialStatus () 61 61 { 62 /*CPPUNIT_ASSERT ( m_View->isShown () );62 CPPUNIT_ASSERT ( m_View->isShown () ); 63 63 CPPUNIT_ASSERT_EQUAL (0, 64 64 g_ascii_strcasecmp ("PDF Viewer", m_View->getTitle ())); … … 72 72 CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 73 73 CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 74 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); */74 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 75 75 } -
trunk/tests/MainPterTest.h
r21 r23 36 36 37 37 private: 38 /*DumbMainView *m_View;38 DumbMainView *m_View; 39 39 DumbDocument *m_Document; 40 MainPter *m_MainPter; */40 MainPter *m_MainPter; 41 41 }; 42 42 }
