Changeset 223
- Timestamp:
- 06/11/06 15:35:34 (2 years ago)
- Files:
-
- trunk/src/JobPrint.cxx (modified) (5 diffs)
- trunk/src/JobPrint.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/JobPrint.cxx
r222 r223 60 60 } 61 61 62 gboolean 63 JobPrint::getCollate () 64 { 65 return m_Collate; 66 } 67 62 68 guint 63 69 JobPrint::getCurrentPage () … … 66 72 } 67 73 74 guint 75 JobPrint::getNumberOfCopies () 76 { 77 return m_NumberOfCopies; 78 } 79 68 80 IDocument & 69 81 JobPrint::getDocument () … … 80 92 } 81 93 94 PrintPageLayout 95 JobPrint::getPageLayout () 96 { 97 return m_PageLayout; 98 } 99 100 PrintPageOrientation 101 JobPrint::getPageOrientation () 102 { 103 return m_PageOrientation; 104 } 105 82 106 const gchar * 83 107 JobPrint::getPageRangeString () … … 96 120 { 97 121 return m_PageWidth; 122 } 123 124 const gchar * 125 JobPrint::getPrinterName () 126 { 127 return m_PrinterName; 98 128 } 99 129 … … 396 426 JobPrint *job = (JobPrint *)data; 397 427 job->getDocument().outputPostscriptEnd (); 428 429 // Add Cups options. 430 cups_option_t *options; 431 gint numOptions = 0; 432 433 gchar *numCopies = g_strdup_printf ("%d", job->getNumberOfCopies ()); 434 numOptions = cupsAddOption ("copies", numCopies, numOptions, &options); 435 g_free (numCopies); 436 437 gchar *collate = g_strdup (job->getCollate() ? "True" : "False"); 438 numOptions = cupsAddOption ("Collate", collate, numOptions, &options); 439 g_free (collate); 440 441 gchar *orientation = NULL; 442 if ( PRINT_PAGE_ORIENTATION_LANDSCAPE == job->getPageOrientation () ) 443 { 444 orientation = g_strdup_printf ("4"); 445 } 446 else 447 { 448 orientation = g_strdup_printf ("3"); 449 } 450 numOptions = cupsAddOption ("orientation-requested", orientation, 451 numOptions, &options); 452 g_free (orientation); 453 454 gchar *layout = NULL; 455 switch (job->getPageLayout ()) 456 { 457 case PRINT_PAGE_LAYOUT_2IN1: 458 layout = g_strdup_printf ("%d", 2); 459 break; 460 461 case PRINT_PAGE_LAYOUT_4IN1: 462 layout = g_strdup_printf ("%d", 4); 463 break; 464 465 default: 466 layout = g_strdup_printf ("%d", 1); 467 } 468 numOptions = cupsAddOption ("number-up", layout, numOptions, &options); 469 470 cupsPrintFile (job->getPrinterName (), job->getTempFileName (), 471 job->getDocument ().getFileName (), numOptions, options); 472 473 cupsFreeOptions (numOptions, options); 474 398 475 JOB_NOTIFIER_END (); 399 476 trunk/src/JobPrint.h
r222 r223 63 63 ~JobPrint (void); 64 64 65 gboolean getCollate (void); 65 66 IDocument &getDocument (void); 67 guint getNumberOfCopies (void); 68 PrintPageLayout getPageLayout (void); 69 PrintPageOrientation getPageOrientation (void); 70 const gchar *getPrinterName (void); 71 const gchar *getTempFileName (void); 66 72 virtual gboolean run (void); 67 73 void setCollate (gboolean collate); … … 97 103 PrintPageSet getPageSet (void); 98 104 gfloat getPageWidth (void); 99 const gchar *getTempFileName (void);100 105 void setCurrentPage (guint pageNumber); 101 106 void setTempFileName (const gchar *fileName);
