Changeset 233

Show
Ignore:
Timestamp:
06/13/06 16:11:47 (2 years ago)
Author:
jordi
Message:

The JobPrint? now implements the new Resolution and ColorMode?.

Location:
trunk/src
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/IPrintView.h

    r232 r233  
    123123 
    124124            /// 
     125            /// @brief Gets the currently selected color model. 
     126            /// 
     127            /// @return The value of the color model that is selected. 
     128            /// 
     129            virtual gchar *getColorModel (void) = 0; 
     130 
     131            /// 
    125132            /// @brief Gets the number of copies to do. 
    126133            /// 
     
    161168 
    162169            /// 
     170            /// @brief Gets the currently selected resolution. 
     171            /// 
     172            /// @return The value of the resolution that is selected. 
     173            ///         This value is the @a value parameter of the 
     174            ///         addResolution() function. 
     175            /// 
     176            virtual gchar *getResolution (void) = 0; 
     177 
     178            /// 
    163179            /// @brief Gets the name of the currently selected printer. 
    164180            /// 
  • trunk/src/JobPrint.cxx

    r223 r233  
    3333{ 
    3434    m_Collate = FALSE; 
     35    m_ColorModel = NULL; 
    3536    m_CurrentPage = 1; 
    3637    m_Document = NULL; 
     
    4546    m_PageWidth = 0.1147f; 
    4647    m_PrinterName = NULL; 
     48    m_Resolution = NULL; 
    4749    m_TempFileName = NULL; 
    4850} 
     
    5557    delete m_DocumentCopy; 
    5658    delete[] m_PageRange; 
     59    g_free (m_ColorModel); 
    5760    g_free (m_PageRangeString); 
    5861    g_free (m_PrinterName); 
     62    g_free (m_Resolution); 
    5963    g_free (m_TempFileName); 
    6064} 
     
    6670} 
    6771 
     72const gchar * 
     73JobPrint::getColorModel () 
     74{ 
     75    return m_ColorModel; 
     76} 
     77 
    6878guint 
    6979JobPrint::getCurrentPage () 
     
    126136{ 
    127137    return m_PrinterName; 
     138} 
     139 
     140const gchar * 
     141JobPrint::getResolution () 
     142{ 
     143    return m_Resolution; 
    128144} 
    129145 
     
    175191 
    176192void 
     193JobPrint::setColorModel (const gchar *colorModel) 
     194{ 
     195    g_free (m_ColorModel); 
     196    m_ColorModel = g_strdup (colorModel); 
     197} 
     198 
     199void 
    177200JobPrint::setCurrentPage (guint pageNumber) 
    178201{ 
     
    229252    m_PageWidth = pageWidth; 
    230253    m_PageHeight = pageHeight; 
     254} 
     255 
     256void 
     257JobPrint::setResolution (const gchar *resolution) 
     258{ 
     259    g_free (m_Resolution); 
     260    m_Resolution = g_strdup (resolution); 
    231261} 
    232262 
     
    467497    } 
    468498    numOptions = cupsAddOption ("number-up", layout, numOptions, &options); 
     499    numOptions = cupsAddOption ("ColorModel", job->getColorModel (), 
     500                                numOptions, &options); 
     501    numOptions = cupsAddOption ("Resolution", job->getResolution (), 
     502                                numOptions, &options); 
    469503 
    470504    cupsPrintFile (job->getPrinterName (), job->getTempFileName (), 
  • trunk/src/JobPrint.h

    r223 r233  
    6464 
    6565            gboolean getCollate (void); 
     66            const gchar *getColorModel (void); 
    6667            IDocument &getDocument (void); 
    6768            guint getNumberOfCopies (void); 
     
    6970            PrintPageOrientation getPageOrientation (void); 
    7071            const gchar *getPrinterName (void); 
     72            const gchar *getResolution (void); 
    7173            const gchar *getTempFileName (void); 
    7274            virtual gboolean run (void); 
    7375            void setCollate (gboolean collate); 
     76            void setColorModel (const gchar *colorModel); 
    7477            void setDocument (IDocument *document); 
    7578            void setNumberOfCopies (guint copies); 
     
    8083            void setPageSize (gfloat pageWidth, gfloat pageHeight); 
    8184            void setPrinterName (const gchar *name); 
     85            void setResolution (const gchar *resolution); 
    8286            void setUpPrint (void); 
    8387 
    8488        protected: 
    8589            gboolean m_Collate; 
     90            gchar *m_ColorModel; 
    8691            guint m_CurrentPage; 
    8792            IDocument *m_Document; 
     
    9499            gchar *m_PageRangeString; 
    95100            PrintPageSet m_PageSet; 
     101            gchar *m_Resolution; 
    96102            gfloat m_PageWidth; 
    97103            gchar *m_PrinterName; 
  • trunk/src/PrintPter.cxx

    r232 r233  
    113113        getPageSizeForPrinter (printerName, pageSizeName, 
    114114                               &pageWidth, &pageHeight); 
    115         g_free (pageSizeName); 
    116115        // Create the new print job. 
    117116        JobPrint *job = new JobPrint (); 
     
    148147        job->setPageOrientation (view.getPageOrientation ()); 
    149148        job->setPageLayout (view.getPageLayout ()); 
     149 
     150        gchar *colorModel = view.getColorModel (); 
     151        job->setColorModel (colorModel); 
     152        gchar *resolution = view.getResolution (); 
     153        job->setResolution (resolution); 
    150154 
    151155        IJob::enqueue (job); 
  • trunk/src/gtk/PrintView.cxx

    r232 r233  
    177177} 
    178178 
     179gchar * 
     180PrintView::getColorModel () 
     181{ 
     182    gchar *colorModel = NULL; 
     183    getOptionFromComboBox (m_ColorModelView, &colorModel); 
     184    return colorModel; 
     185} 
     186 
    179187PrintPageLayout 
    180188PrintView::getPageLayout () 
     
    205213    getOptionFromComboBox (m_PageSizeView, &pageSize); 
    206214    return pageSize; 
     215} 
     216 
     217gchar * 
     218PrintView::getResolution () 
     219{ 
     220    gchar *resolution = NULL; 
     221    getOptionFromComboBox (m_ResolutionView, &resolution); 
     222    return resolution; 
    207223} 
    208224 
  • trunk/src/gtk/PrintView.h

    r232 r233  
    4242            virtual void clearResolutionList (void); 
    4343            virtual guint getNumberOfCopies (void); 
     44            virtual gchar *getColorModel (void); 
    4445            virtual PrintPageLayout getPageLayout (void); 
    4546            virtual PrintPageOrientation getPageOrientation (void); 
    4647            virtual const gchar *getPageRange (void); 
    4748            virtual gchar *getPageSize (void); 
     49            virtual gchar *getResolution (void); 
    4850            virtual gchar *getSelectedPrinterName (void); 
    4951            virtual gboolean isCheckedCollate (void);