Changeset 148
- Timestamp:
- 05/05/06 15:43:37 (2 years ago)
- Files:
-
- trunk/src/Config.cxx (modified) (1 diff)
- trunk/src/Config.h (modified) (2 diffs)
- trunk/src/DocumentLink.cxx (modified) (3 diffs)
- trunk/src/DocumentLink.h (modified) (2 diffs)
- trunk/src/DocumentOutline.h (modified) (1 diff)
- trunk/src/DocumentPage.cxx (modified) (2 diffs)
- trunk/src/DocumentPage.h (modified) (1 diff)
- trunk/src/IDocument.cxx (modified) (16 diffs)
- trunk/src/IDocument.h (modified) (3 diffs)
- trunk/src/IDocumentObserver.h (modified) (1 diff)
- trunk/src/IJob.cxx (modified) (4 diffs)
- trunk/src/IJob.h (modified) (3 diffs)
- trunk/src/IMainView.h (modified) (5 diffs)
- trunk/src/IPageView.h (modified) (3 diffs)
- trunk/src/JobLoad.cxx (modified) (2 diffs)
- trunk/src/JobLoad.h (modified) (1 diff)
- trunk/src/JobRender.cxx (modified) (12 diffs)
- trunk/src/JobRender.h (modified) (3 diffs)
- trunk/src/MainPter.cxx (modified) (6 diffs)
- trunk/src/MainPter.h (modified) (1 diff)
- trunk/src/PDFDocument.cxx (modified) (2 diffs)
- trunk/src/PDFDocument.h (modified) (1 diff)
- trunk/src/PagePter.cxx (modified) (7 diffs)
- trunk/src/PagePter.h (modified) (2 diffs)
- trunk/src/main.cxx (modified) (1 diff)
- trunk/tests/PDFDocumentTest.cxx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/Config.cxx
r113 r148 91 91 /// This is the main "entry point" for the configuration. All classes that 92 92 /// want to get configuration must call this function to retrieve the 93 /// configuration object. The first time this func ion is called creates93 /// configuration object. The first time this function is called creates 94 94 /// the object. 95 95 /// trunk/src/Config.h
r100 r148 58 58 59 59 protected: 60 /// The configuration values. 60 61 GKeyFile *m_Values; 61 62 … … 63 64 Config (Config &config) { } 64 65 66 /// The global configuration object that is returned by 67 /// ePDFView::Config::getConfig() function. 65 68 static Config *m_Config; 69 /// This is for test only purposes. If this variables is 70 /// set to false, the Config class doesn't load 71 /// the configuration values from the file and doesn't save 72 /// it when destroyed. 66 73 static gboolean m_LoadFile; 67 74 68 gboolean getBoolean (const gchar *group, const char *key,75 gboolean getBoolean (const gchar *group, const gchar *key, 69 76 gboolean defaultValue); 70 gint getInteger (const gchar *group, const char *key,77 gint getInteger (const gchar *group, const gchar *key, 71 78 gint defaultValue); 72 gchar *getString (const gchar *group, const char *key,79 gchar *getString (const gchar *group, const gchar *key, 73 80 const gchar *defaultValue); 74 81 }; trunk/src/DocumentLink.cxx
r147 r148 21 21 using namespace ePDFView; 22 22 23 /// 24 /// @brief Construct a new DocumentLink object. 25 /// 26 /// @param x1 The X coordinate of the link's top-left corner. 27 /// @param y1 The Y coordinate of the link's top-left corner. 28 /// @param x2 The X coordinate of the link's bottom-right corner. 29 /// @param y2 The Y coordinate of the link's bottom-right corner. 30 /// @param destinationPage The page number the links points to. 31 /// 23 32 DocumentLink::DocumentLink (gdouble x1, gdouble y1, gdouble x2, gdouble y2, 24 33 gint destinationPage) … … 31 40 } 32 41 42 /// 43 /// @brief Destroys all dynamically allocated memory by DocumentLink. 44 /// 33 45 DocumentLink::~DocumentLink () 34 46 { 35 47 } 36 48 49 /// 50 /// @brief Gets the destination page number. 51 /// 52 /// @return The page number the link's points at. 53 /// 37 54 gint 38 55 DocumentLink::getDestinationPage () … … 41 58 } 42 59 60 /// 61 /// @brief Checks if a position is over the link. 62 /// 63 /// This function just check that the given position (x, y) is either 64 /// inside the link's rectangle (i.e., is over the link) or not. 65 /// 66 /// @param x The X coordinate of the position to check. 67 /// @param y The Y coordinate of the position to check. 68 /// 69 /// @return TRUE if the position is over the link. FALSE otherwise. 70 /// 43 71 gboolean 44 72 DocumentLink::positionIsOver (gint x, gint y) trunk/src/DocumentLink.h
r147 r148 21 21 namespace ePDFView 22 22 { 23 /// 24 /// @class DocumentLink 25 /// @brief A single link on a page. 26 /// 27 /// This class is used by ePDFView::DocumentPage to maintain a list 28 /// of all links that a single page have. A link, in this version of 29 /// ePDFView, is just a rectangle on a page that points to another page. 30 /// 23 31 class DocumentLink 24 32 { … … 32 40 33 41 protected: 42 /// The number of the link's destination page. 34 43 gint m_DestinationPage; 44 /// The X coordinate of the link's top-left corner. 35 45 gdouble m_X1; 46 /// The X coordinate of the link's bottom-right corner. 36 47 gdouble m_X2; 48 /// The Y coordinate of the link's top-left corner. 37 49 gdouble m_Y1; 50 /// The Y coordinate of the link's bottom-right corner. 38 51 gdouble m_Y2; 39 52 }; trunk/src/DocumentOutline.h
r61 r148 50 50 void setDestination (gint destination); 51 51 52 private: 52 protected: 53 /// The list of this outline's children. 53 54 GList *m_Children; 55 /// The page number this outline points to. 54 56 gint m_Destination; 57 /// @brief This is used to know which child to return when calling 58 /// the DocumentOutline::getNextChild() function. 55 59 GList *m_LastReturnedChild; 60 /// The outline's parent outline. 56 61 DocumentOutline *m_Parent; 62 /// The outline's name or title. 57 63 gchar *m_Title; 58 64 }; trunk/src/DocumentPage.cxx
r147 r148 51 51 } 52 52 53 /// 54 /// @brief Adds a new link to the page. 55 /// 56 /// When rendering the page, the responsible document will extract the 57 /// links from the page and call this function with each links it find. 58 /// 59 /// @param link The link to add. The DocumentPage class will delete it. 60 /// 53 61 void 54 62 DocumentPage::addLink (DocumentLink *link) … … 75 83 } 76 84 85 /// 86 /// @brief Gets the link for a given position. 87 /// 88 /// This function will get the link whose rectangle is under the position 89 /// passed as parameter. 90 /// 91 /// @param x The X coordinate of the link's position. 92 /// @param y The Y coordinate of the link's position. 93 /// 94 /// @return The link under the position (x, y) or NULL if no link exists. 95 /// 77 96 DocumentLink * 78 97 DocumentPage::getLinkAtPosition (gint x, gint y) trunk/src/DocumentPage.h
r147 r148 41 41 gboolean newPage (gint width, gint height); 42 42 43 private: 43 protected: 44 /// The page's image. 44 45 guchar *m_Data; 46 /// The page's height. 45 47 gint m_Height; 48 /// The page's width. 46 49 gint m_Width; 50 /// The list of links from the page. 47 51 GList *m_LinkList; 48 52 }; trunk/src/IDocument.cxx
r147 r148 169 169 } 170 170 171 /// 172 /// @brief Attaches a new observer object. 173 /// 174 /// When a changes happens on the document all classes that 175 /// have been attached to the document will receive a notification 176 /// of such a change. 177 /// 178 /// @param observer The observer object to attach. 179 /// 171 180 void 172 181 IDocument::attach (const IDocumentObserver *observer) … … 177 186 } 178 187 179 void 180 IDocument::deattach (const IDocumentObserver *observer) 181 { 182 g_assert (NULL != observer && "Tried to deattach a NULL observer."); 188 /// 189 /// @brief Detaches an observer object. 190 /// 191 /// When a previously attached object is detached no longer receives 192 /// notification messages when the document is changed. 193 /// 194 /// @param observer The observer object to detach. 195 /// 196 void 197 IDocument::detach (const IDocumentObserver *observer) 198 { 199 g_assert (NULL != observer && "Tried to detach a NULL observer."); 183 200 184 201 m_Observers = g_list_remove_all (m_Observers, observer); 185 202 } 186 203 204 /// 205 /// @brief The document has been loaded. 206 /// 207 /// This is called when the JobLoad class is done. It in turn notifies 208 /// all attached observers about this situation. 209 /// 187 210 void 188 211 IDocument::notifyLoad () … … 200 223 } 201 224 225 /// 226 /// @brief The document couldn't be loaded. 227 /// 228 /// This is called by the JobLoad class when the document couldn't 229 /// be opened. It in turns notifies all attached observers. 230 /// 231 /// @param error The error message of why couldn't open the document. 232 /// 202 233 void 203 234 IDocument::notifyLoadError (const GError *error) … … 211 242 } 212 243 244 /// 245 /// @brief The document couldn't be loaded because it's encrypted. 246 /// 247 /// This is called by the JobLoad class when the document to load is 248 /// encrypted and no password or an invalid one was supplied. It in turns 249 /// notifies all attached observers. 250 /// 251 /// @param fileName The file that was trying to load. 252 /// @param reload TRUE if the document was trying to reload, FALSE if it 253 /// was being loaded as new. 254 /// @param error The error message that the operation produced. 255 /// 213 256 void 214 257 IDocument::notifyLoadPassword (const gchar *fileName, gboolean reload, … … 223 266 } 224 267 268 /// 269 /// @brief The current page has been changed. 270 /// 271 /// This is called when the current page has been changed. It notifies 272 /// all attached observers about this. 273 /// 225 274 void 226 275 IDocument::notifyPageChanged () … … 235 284 } 236 285 286 /// 287 /// @brief A document's page has been rendered. 288 /// 289 /// This is called by the JobRender class when it finished to render 290 /// a document's page. 291 /// 292 /// @param pageNumber The number of the page that has been rendered. 293 /// @param age The age that the page had when started to be rendered. 294 /// @param pageImage The rendered page's image. 295 /// 237 296 void 238 297 IDocument::notifyPageRendered (gint pageNumber, guint32 age, … … 253 312 } 254 313 314 /// 315 /// @brief The page has been rotated. 316 /// 317 /// This is called when the page rotation changes. It notifies all 318 /// attached observer about this. 319 /// 255 320 void 256 321 IDocument::notifyPageRotated () … … 265 330 } 266 331 332 /// 333 /// @brief The page's zoom has been changed. 334 /// 335 /// This is called when the page scale has been changed. It notifies 336 /// all attached observers about this. 337 /// 267 338 void 268 339 IDocument::notifyPageZoomed () … … 277 348 } 278 349 350 /// 351 /// @brief The document has been reloaded. 352 /// 353 /// This is called by the JobLoad class when the document has been reloaded. 354 /// It in turns notifies all attached observers about this. 355 /// 279 356 void 280 357 IDocument::notifyReload () … … 293 370 } 294 371 372 /// 373 /// @brief Loads a file. 374 /// 375 /// This is used when loading a new file name. 376 /// 377 /// @param fileName The file name to load. 378 /// @param password The password to use to load the file or NULL if no 379 /// password is used. 380 /// 295 381 void 296 382 IDocument::load (const gchar *fileName, const gchar *password) … … 307 393 } 308 394 395 /// 396 /// @brief Reloads the document. 397 /// 398 /// Opens again the same file name using the previously used password. 399 /// 309 400 void 310 401 IDocument::reload (void) … … 759 850 /// @brief Gets the document's current page image. 760 851 /// 761 /// @return The rendered image of the current page. 852 /// @return The rendered image of the current page or NULL if the image 853 /// is not yet available. 762 854 /// 763 855 DocumentPage * 764 856 IDocument::getCurrentPage () 765 857 { 766 volatilePageCache *cachedPage = getCachedPage (m_CurrentPage);858 PageCache *cachedPage = getCachedPage (m_CurrentPage); 767 859 if ( NULL == cachedPage ) 768 860 { … … 1151 1243 } 1152 1244 1245 /// 1246 /// @brief Retrieves a page from the cache. 1247 /// 1248 /// @param pageNum The number of the page to get from the cache. 1249 /// 1250 /// @return The page cached if the page is in the cache or NULL if it's not 1251 /// in the cache. 1252 /// 1153 1253 PageCache * 1154 1254 IDocument::getCachedPage (gint pageNum) … … 1210 1310 /// 1211 1311 /// Deletes all elements from the cache. This must be done from 1212 /// the deriv ated classes destructor.1312 /// the derived classes destructor. 1213 1313 /// 1214 1314 void … … 1227 1327 } 1228 1328 1329 /// 1330 /// @brief Checks if the current page has a link on a given position. 1331 /// 1332 /// Checks if under a given position the document's current page have a 1333 /// link. 1334 /// 1335 /// @param x The X coordinate of the position to check. 1336 /// @param y The Y coordinate of the position to check. 1337 /// 1338 /// @return TRUE if the document's current page has a link under the given 1339 /// position. FALSE otherwise. 1340 /// 1229 1341 gboolean 1230 1342 IDocument::hasLinkAtPosition (gint x, gint y) … … 1242 1354 } 1243 1355 1356 /// 1357 /// @brief Actives a link under a given position. 1358 /// 1359 /// Activating a link means following the link: goes to the page 1360 /// that the links point to. 1361 /// 1362 /// @param x The X coordinate of the current page's link to activate. 1363 /// @param y The Y coordinate of the current page's link to activate. 1364 /// 1244 1365 void 1245 1366 IDocument::activateLinkAtPosition (gint x, gint y) trunk/src/IDocument.h
r147 r148 106 106 } PageLayout; 107 107 108 108 /// 109 /// @brief A cached page. 110 /// 109 111 typedef struct 110 112 { 113 /// The page's age in the cache. 111 114 guint32 age; 115 /// The page's number. 112 116 gint pageNumber; 117 /// The rendered page image. 113 118 DocumentPage *pageImage; 114 119 } PageCache; … … 183 188 184 189 void attach (const IDocumentObserver *observer); 185 void de attach (const IDocumentObserver *observer);190 void detach (const IDocumentObserver *observer); 186 191 187 192 void notifyLoad (void); … … 270 275 void refreshCache (void); 271 276 277 /// The document's author. 272 278 gchar *m_Author; 279 /// The document's creation date and time. 273 280 gchar *m_CreationDate; 281 /// The document's software creator. 274 282 gchar *m_Creator; 283 /// The document's currently shown page. 275 284 gint m_CurrentPage; 285 /// The document's format. 276 286 gchar *m_Format; 287 /// The document's password. 277 288 gchar *m_FileName; 289 /// The document's keyword. 278 290 gchar *m_Keywords; 291 /// Tells if the document is linearized or not. 279 292 gchar *m_Linearized; 293 /// The document's modification date and time. 280 294 gchar *m_ModifiedDate; 295 /// @brief The list of classes that will receive notifications 296 /// when the document changes. 281 297 GList *m_Observers; 298 /// The document's outline or index. 282 299 DocumentOutline *m_Outline; 300 /// The cache of already rendered document's pages. 283 301 GList *m_PageCache; 302 /// The age that will get the next page of the cache. 284 303 gint m_PageCacheAge; 304 /// The document's page layout. 285 305 PageLayout m_PageLayout; 306 /// The document's page mode. 286 307 PageMode m_PageMode; 308 /// The number of pages the document has. 287 309 gint m_PageNumber; 310 /// The last password used to open the document. 288 311 gchar *m_Password; 312 /// The document's software producer. 289 313 gchar *m_Producer; 314 /// The document's current rotation in degrees. 290 315 gint m_Rotation; 316 /// The document's current zoom or scale level. 291 317 gdouble m_Scale; 318 /// The document's subject. 292 319 gchar *m_Subject; 320 /// The document's title. 293 321 gchar *m_Title; 294 322 }; trunk/src/IDocumentObserver.h
r136 r148 21 21 namespace ePDFView 22 22 { 23 /// @class IDocumentObserver 24 /// @brief Interface for IDocument's observers. 25 /// 26 /// A document observer is just a class that receives notifications 27 /// of the document when it changes its state. 28 /// 23 29 class IDocumentObserver 24 30 { 25 31 public: 32 /// @brief Destroys all dynamically allocated memory. 26 33 virtual ~IDocumentObserver (void) { } 27 34 35 /// 36 /// @brief The document has been loaded. 37 /// 38 /// This function is called when the document has been 39 /// loaded successfully. 40 /// 28 41 virtual void notifyLoad (void) { } 42 43 /// 44 /// @brief The document couldn't be loaded due an error. 45 /// 46 /// This function is called when the document couldn't be 47 /// loaded because of an error. The error message is 48 /// passed as a parameter. 49 /// 50 /// @param error The error code and message. 51 /// 29 52 virtual void notifyLoadError (const GError *error) { } 53 54 /// 55 /// @brief The document is encrypted. 56 /// 57 /// This function is called when the document couldn't be 58 /// loaded because it's encrypted and no password or an invalid 59 /// password was supplied. 60 /// 61 /// @param fileName The file name that was trying to load. 62 /// @param reload TRUE if it was trying to reload the file, FALSE 63 /// if it was trying to load a new file. 64 /// @param error The error message and code that the operation 65 /// produced. 30 66 virtual void notifyLoadPassword (const gchar *fileName, 31 67 gboolean reload, 32 68 const GError *error) { } 69 70 /// 71 /// @brief The current page has been changed. 72 /// 73 /// This function is called when the current page has been 74 /// replaced by a new one. 75 /// 76 /// @param pageNum The number of the new page. 77 /// 33 78 virtual void notifyPageChanged (gint pageNum) { } 79 80 /// 81 /// @brief The current page has been rotated. 82 /// 83 /// This function is called when the current page has been 84 /// rotated. 85 /// 86 /// @param rotation The rotation angle in degrees. 87 /// 34 88 virtual void notifyPageRotated (gint rotation) { } 89 90 /// 91 /// @brief The current page has been scaled. 92 /// 93 /// This function is called when the current page zoom level 94 /// has been changed. 95 /// 96 /// @param zoom The current scale. 97 /// 35 98 virtual void notifyPageZoomed (gdouble zoom) { } 99 100 /// 101 /// @brief The document has been reloaded. 102 /// 103 /// This function is called when the document has been reloaded 104 /// successfully. 105 /// 36 106 virtual void notifyReload (void) { } 37 107 38 108 protected: 109 /// 110 /// @brief Constructs a new IDocumentObserver object. 39 111 IDocumentObserver (void) { } 40 112 }; trunk/src/IJob.cxx
r130 r148 20 20 using namespace ePDFView; 21 21 22 /// The queue of jobs to run in background. 22 23 GAsyncQueue *IJob::m_JobsQueue = NULL; 23 24 25 /// 26 /// @brief Clears the list of jobs. 27 /// 28 /// This is mainly used for the test suites when they are going 29 /// to delete the document class and don't want to generate segmentation 30 /// faults. It just pops all queued jobs without run them. 31 /// 24 32 void 25 33 IJob::clearQueue (void) … … 33 41 } 34 42 43 /// 44 /// @brief The job dispatcher. 45 /// 46 /// This function is the one that will run in a thread. What it does is 47 /// just pop queued jobs from the queue and then runs them. 48 /// 35 49 gpointer 36 50 IJob::dispatcher (gpointer data) … … 46 60 } 47 61 62 /// 63 /// @brief Initialises the job dispatcher. 64 /// 65 /// This function must be the first called before any other jobs-related 66 /// function, as it does initialised the thread subsystem, created the 67 /// threaded dispatcher() function and initialised the job queue. 68 /// 48 69 void 49 70 IJob::init () … … 61 82 } 62 83 84 /// 85 /// @brief Adds a new job to the queue. 86 /// 87 /// It adds a new job to the queued jobs that will be dispatched by 88 /// the dispatch() function. 89 /// 90 /// @param job The job to add to the queue. 91 /// 63 92 void 64 93 IJob::queue (IJob *job) trunk/src/IJob.h
r130 r148 31 31 namespace ePDFView 32 32 { 33 /// @class IJob 34 /// @brief Interface for jobs. 35 /// 36 /// A Job is simply a process that will be processed in background 37 /// by the dispatch() function. 38 /// 33 39 class IJob 34 40 { 35 41 public: 42 /// @brief Destroys all dynamically allocated memory for IJob. 36 43 virtual ~IJob (void) { } 37 44 … … 41 48 static void queue (IJob *job); 42 49 50 /// 51 /// @brief Runs the job. 52 /// 53 /// This is called by the dispatcher() function when 54 /// the job must start its work. It's the job's entry point. 55 /// 56 /// @return TRUE if the job must be deleted after the 57 /// call to run(). FALSE if the job will be 58 /// deleted by himself. 59 /// 43 60 virtual gboolean run (void) = 0; 44 61 … … 46 63 static GAsyncQueue *m_JobsQueue; 47 64 65 /// @brief Creates a new IJob object. 48 66 IJob () { } 49 67 }; trunk/src/IMainView.h
r140 r148 57 57 58 58 /// 59 /// @brief Actives or d esactives the zoom to fit.59 /// @brief Actives or datives the zoom to fit. 60 60 /// 61 61 /// The view must change the state of the zoom to fit option 62 62 /// to @a active. 63 63 /// 64 /// @param active TRUE if the option must be activ ed, FALSE64 /// @param active TRUE if the option must be activated, FALSE 65 65 /// otherwise. 66 66 /// … … 68 68 69 69 /// 70 /// @brief Actives or de sactives the zoom to width.70 /// @brief Actives or deactivates the zoom to width. 71 71 /// 72 72 /// The view must change the state of the zoom to width option 73 73 /// to @a active. 74 74 /// 75 /// @param active TRUE if the option must be activ ed, FALSE75 /// @param active TRUE if the option must be activated, FALSE 76 76 /// otherwise. 77 77 /// … … 84 84 /// the toolkit's specific open dialog. 85 85 /// 86 /// @param folder The last folder used to open a file. This is87 /// used to show this folder when the open dialog88 /// appears.86 /// @param lastFolder The last folder used to open a file. This is 87 /// used to show this folder when the open dialog 88 /// appears. 89 89 /// 90 90 /// @return A copy of the file name that the user will try to open … … 337 337 338 338 /// 339 /// @brief Shows the status bar.340 /// 341 /// The view must show the status bar or hide it depending339 /// @brief Shows the status bar. 340 /// 341 /// The view must show the status bar or hide it depending 342 342 /// on the @a show parameter. 343 343 /// 344 /// @param show TRUE if the status bar must be shown,344 /// @param show TRUE if the status bar must be shown, 345 345 /// FALSE otherwise. 346 346 /// … … 348 348 349 349 /// 350 /// @brief Shows the too bar.350 /// @brief Shows the tool bar. 351 351 /// 352 352 /// The view must show the toolbar or hide it depending trunk/src/IPageView.h
r147 r148 24 24 class PagePter; 25 25 26 /// 27 /// @brief The possible cursor for the page view. 28 /// 26 29 enum PageCursor 27 30 { … … 41 44 /// No scroll. 42 45 PAGE_SCROLL_NONE, 43 /// Scroll to the begin ing of the page.46 /// Scroll to the beginning of the page. 44 47 PAGE_SCROLL_START, 45 48 /// Scroll to the bottom of the page. 46 49 PAGE_SCROLL_END 47 50 }; 48 51 52 /// 53 /// @class IPageView. 54 /// @brief Interface for the page view. 55 /// 56 /// The page view is the responsible to show the page's image, 57 /// handle the scroll of it and the links. It will also tell 58 /// the available width and height space when doing a zoom to fit or 59 /// zoom to width. 60 /// 49 61 class IPageView 50 62 { 51 63 public: 64 /// 65 /// @brief Destroys all dynamically allocated memory. 66 /// 52 67 virtual ~IPageView (void) { } 68 69 /// 70 /// @brief Sets the view's presenter. 71 /// 72 /// @param pter The presenter that controls the view and the 73 /// view sends notices to. 74 /// 53 75 virtual void setPresenter (PagePter *pter) { m_Pter = pter; } 76 77 /// 78 /// @brief Gets the view's presenter. 79 /// 80 /// @return The presenter that controls the view or NULL if 81 /// it was not set. 82 /// 54 83 PagePter *getPresenter (void) { return m_Pter; } 55 84 … … 123 152 124 153 protected: 154 /// 155 /// @brief Creates a new IPageView object. 156 /// 125 157 IPageView (void) { m_Pter = NULL; } 126 158 159 /// @brief The view's presenter. 127 160 PagePter *m_Pter; 128 161 }; trunk/src/JobLoad.cxx
r136 r148 102 102 /// @brief Check if we are reloading. 103 103 /// 104 /// @return TR EUif are reloading, FALSE otherwise.104 /// @return TRUE if are reloading, FALSE otherwise. 105 105 /// 106 106 gboolean … … 111 111 112 112 /// 113 /// @brief Open the document. 114 /// 113 /// @brief Opens the document. 115 114 /// 116 115 gboolean trunk/src/JobLoad.h
r136 r148 49 49 50 50 protected: 51 /// The document to notify when loaded or on error. 51 52 IDocument *m_Document; 53 /// The error produced when loading. 52 54 GError *m_Error; 55 /// The file name to load or reload. 53 56 gchar *m_FileName; 57 /// The password to use when loading the file. 54 58 gchar *m_Password; 59 /// Tells if we are reloading or loading from new. 55 60 gboolean m_Reload; 56 61 }; trunk/src/JobRender.cxx
r145 r148 22 22 G_LOCK_DEFINE (JobRender); 23 23 24 /// Tells if we can render more pages or not. Used in test suites only. 24 25 gboolean JobRender::m_CanProcessJobs = TRUE; 26 /// This tells the minimum age the jobs must have in order to process them. 25 27 guint32 JobRender::m_MinAge = 0; 26 28 … … 28 30 static gboolean job_render_done (gpointer data); 29 31 32 /// 33 /// @brief Creates a new JobRender object. 34 /// 30 35 JobRender::JobRender (): 31 36 IJob () … … 37 42 } 38 43 44 /// 45 /// @brief Deletes all dynamically allocated memory for JobRender. 46 /// 39 47 JobRender::~JobRender() 40 48 { 41 49 } 42 50 51 /// 52 /// @brief Renders a page. 53 /// 43 54 gboolean 44 55 JobRender::run (void) … … 57 68 } 58 69 70 /// 71 /// @brief Gets the job's age. 72 /// 73 /// @return The age of the job. 74 /// 59 75 guint32 60 76 JobRender::getAge () … … 63 79 } 64 80 81 /// 82 /// @brief Gets the document to get the page to render. 83 /// 84 /// @return The document class to use to render the page or NULL if can't 85 /// process more jobs (test only.) 86 /// 65 87 IDocument * 66 88 JobRender::getDocument () … … 76 98 } 77 99 100 /// 101 /// @brief Gets the rendered page image. 102 /// 103 /// @return The rendered page image as returned by the document class. 104 /// 78 105 DocumentPage * 79 106 JobRender::getPageImage () … … 82 109 } 83 110 111 /// 112 /// @brief Gets the page number to render. 113 /// 114 /// @return The number of the page to render. 115 /// 84 116 gint 85 117 JobRender::getPageNumber () … … 88 120 } 89 121 122 /// 123 /// @brief Sets the job's age. 124 /// 125 /// @param age The job's age. 126 /// 90 127 void 91 128 JobRender::setAge (guint32 age) … … 94 131 } 95 132 133 /// 134 /// @brief Sets the document class to use to render. 135 /// 136 /// @param document The document class to us
