Changeset 123 for trunk/Lucide


Ignore:
Timestamp:
Sep 15, 2006, 5:39:39 PM (15 years ago)
Author:
Eugene Romanenko
Message:

allow printing in descending order (closes #88), small interface fixes (closes #89)

Location:
trunk/Lucide
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/BIN/Lucide.lng

    r122 r123  
    192192PD_WRONG_MARGINS=Wrong margins!
    193193# other 'print'-related messages
    194 PRINT_PRINTING_PAGE_OF=Printing page %d of %d...
     194PRINT_PRINTING_PAGE_OF=Printing page %d (%d of %d)...
    195195PRINT_GENERATING_POSTSCRIPT=Generating postscript file...
    196196PRINT_SPOOLING_POSTSCRIPT=Spooling postscript data...
  • trunk/Lucide/BIN/Lucide_de.lng

    r111 r123  
    190190PD_WRONG_MARGINS=Ungltige Seitenr„nder!
    191191# other 'print'-related messages
    192 PRINT_PRINTING_PAGE_OF=Drucke Seite %d von %d...
     192PRINT_PRINTING_PAGE_OF=Drucke Seite %d (%d von %d)...
    193193PRINT_GENERATING_POSTSCRIPT=Erzeuge Postscript-Datei...
    194194PRINT_SPOOLING_POSTSCRIPT=Sende Postscript-Daten...
  • trunk/Lucide/BIN/Lucide_es.lng

    r118 r123  
    195195PD_WRONG_MARGINS=­M rgenes err¢neos!
    196196# other 'print'-related messages
    197 PRINT_PRINTING_PAGE_OF=Imprimiendo p gina %d de %d...
     197PRINT_PRINTING_PAGE_OF=Imprimiendo p gina %d (%d de %d)...
    198198PRINT_GENERATING_POSTSCRIPT=Generando archivo postscript...
    199199PRINT_SPOOLING_POSTSCRIPT=Enviando datos postcript al controlador de spool...
  • trunk/Lucide/BIN/Lucide_nl.lng

    r118 r123  
    190190PD_WRONG_MARGINS=Verkeerde marge!
    191191# other 'print'-related messages
    192 PRINT_PRINTING_PAGE_OF=Afdrukken pagina %d van %d...
     192PRINT_PRINTING_PAGE_OF=Afdrukken pagina %d (%d van %d)...
    193193PRINT_GENERATING_POSTSCRIPT=Genereren van postscript bestand...
    194194PRINT_SPOOLING_POSTSCRIPT=Postscript gegevens aan het bufferen...
  • trunk/Lucide/BIN/Lucide_sv.lng

    r108 r123  
    190190PD_WRONG_MARGINS=Fel marginaler!
    191191# other 'print'-related messages
    192 PRINT_PRINTING_PAGE_OF=Skriver ut sidan %d av %d...
     192PRINT_PRINTING_PAGE_OF=Skriver ut sidan %d (%d av %d)...
    193193PRINT_GENERATING_POSTSCRIPT=Skapar postscriptfil...
    194194PRINT_SPOOLING_POSTSCRIPT=Spoolar postscriptdata...
  • trunk/Lucide/BIN/Lucide_zh_TW.lng

    r115 r123  
    190190PD_WRONG_MARGINS=¿ù»~Ãä¬É!
    191191# other 'print'-related messages
    192 PRINT_PRINTING_PAGE_OF=ŠCŠL­¶ %d €§ %d...
     192PRINT_PRINTING_PAGE_OF=ŠCŠL­¶ %d (%d €§ %d)...
    193193PRINT_GENERATING_POSTSCRIPT=²£¥Í Postscript ÀÉ...
    194194PRINT_SPOOLING_POSTSCRIPT=±ÆŠs Postscript žê®Æ...
  • trunk/Lucide/SOURCE/gui/print.cpp

    r102 r123  
    169169    DevEscape( hdcPrinter, DEVESC_STARTDOC, strlen(title), (PBYTE)title, NULL, NULL );
    170170
    171     long totalpages = psetup->pgto - psetup->pgfrom + 1;
    172     for ( long pg = psetup->pgfrom; pg <= psetup->pgto; pg++ )
     171
     172    long totalpages = abs( psetup->pgto - psetup->pgfrom ) + 1;
     173    long pg = psetup->pgfrom;
     174    for ( long i = 0; i < totalpages; i++ )
    173175    {
    174176        char *fmt = newstrdupL( PRINT_PRINTING_PAGE_OF );
    175177        char *buf = new char[ 255 ];
    176         snprintf( buf, 255, fmt, pg, totalpages );
     178        snprintf( buf, 255, fmt, pg, i + 1, totalpages );
    177179        progressDlg->setText( buf );
    178180        delete fmt;
     
    188190            break;
    189191        }
     192
     193        pg += ( psetup->pgfrom <= psetup->pgto ) ? 1 : -1;
    190194    }
    191195
     
    310314
    311315    boolean rcexp = doc->exportToPostScript( ev, tmpps, psetup->pgfrom-1, psetup->pgto-1,
    312                                              pwidth, pheight, false, &abortPrinting );
     316                                             pwidth, pheight, &abortPrinting );
    313317
    314318    if ( abortPrinting ) {
  • trunk/Lucide/SOURCE/gui/printDlg.cpp

    r102 r123  
    589589                                _this->psetup->pgto = tmpVal;
    590590                            }
    591                             if ( _this->psetup->pgfrom > _this->psetup->pgto ) {
    592                                 long tmp = _this->psetup->pgfrom;
    593                                 _this->psetup->pgfrom = _this->psetup->pgto;
    594                                 _this->psetup->pgto = tmp;
    595                             }
    596591                        }
    597592
  • trunk/Lucide/SOURCE/plugins/ludjvu/ludjvu.cpp

    r95 r123  
    355355                                    long first_page, long last_page,
    356356                                    double width, double height,
    357                                     boolean duplex, boolean* brkExport)
     357                                    boolean* brkExport)
    358358{
    359359#ifdef __GNUC__
  • trunk/Lucide/SOURCE/plugins/ludjvu/ludjvu.xh

    r95 r123  
    159159                double width,
    160160                double height,
    161                 boolean duplex,
    162161                boolean* brkExport);
    163162typedef somTP_LuDjvuDocument_exportToPostScript *somTD_LuDjvuDocument_exportToPostScript;
     
    604603                double width,
    605604                double height,
    606                 boolean duplex,
    607605                boolean* brkExport)
    608606{
    609607   return SOM_ResolveD(this,LuDjvuDocument,LuDocument,exportToPostScript)
    610         (this, ev,filename,first_page,last_page,width,height,duplex,brkExport);
     608        (this, ev,filename,first_page,last_page,width,height,brkExport);
    611609}
    612610
  • trunk/Lucide/SOURCE/plugins/ludjvu/ludjvu.xih

    r95 r123  
    649649                double width,
    650650                double height,
    651                 boolean duplex,
    652651                boolean* brkExport);
    653652static char *somMN_LuDjvuDocumentexportToPostScript = "LuDocument::exportToPostScript";
     
    664663                double width,
    665664                double height,
    666                 boolean duplex,
    667665                boolean* brkExport);
    668666typedef somTP_xih_LuDjvuDocument_exportToPostScript *somTD_xih_LuDjvuDocument_exportToPostScript;
    669667/* define the parent method call macro */
    670668static somMethodProc* LuDjvuDocument_parent_LuDocument_exportToPostScript_resolved;
    671 #define LuDjvuDocument_parent_LuDocument_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,duplex,brkExport) \
     669#define LuDjvuDocument_parent_LuDocument_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,brkExport) \
    672670  ((( somTD_xih_LuDjvuDocument_exportToPostScript ) \
    673671      LuDjvuDocument_parent_LuDocument_exportToPostScript_resolved) \
    674         (somSelf,ev,filename,first_page,last_page,width,height,duplex,brkExport))
     672        (somSelf,ev,filename,first_page,last_page,width,height,brkExport))
    675673/* define a variety of (possibly ambiguous) short forms */
    676674#ifndef SOMGD_pmc_parent_exportToPostScript
     
    690688  #endif
    691689#endif
    692 #define LuDjvuDocument_parents_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,duplex,brkExport) (\
    693    LuDjvuDocument_parent_LuDocument_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,duplex,brkExport))
     690#define LuDjvuDocument_parents_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,brkExport) (\
     691   LuDjvuDocument_parent_LuDocument_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,brkExport))
    694692
    695693/*
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.cpp

    r99 r123  
    286286
    287287
     288
     289/*
     290 * SOM_Scope boolean  SOMLINK exportToPostScript(LuDocument *somSelf,
     291 *                                                Environment *ev,
     292 *                                               string filename,
     293 *                                               long first_page,
     294 *                                               long last_page,
     295 *                                               double width, double height,
     296 *                                               boolean duplex,
     297 *                                               boolean* brkExport)
     298 */
     299
     300/*
     301 * The prototype for exportToPostScript was replaced by the following prototype:
     302 */
    288303SOM_Scope boolean  SOMLINK exportToPostScript(LuDocument *somSelf,
    289304                                               Environment *ev,
     
    292307                                              long last_page,
    293308                                              double width, double height,
    294                                               boolean duplex,
    295309                                              boolean* brkExport)
    296310{
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.idl

    r95 r123  
    348348     *        BoundingBox DSC comments and other places in the
    349349     *        generated PostScript)
    350      * duplex: whether to force duplex printing (on printers which
    351      *         support this)
    352350     * brkExport: pointer to boolean variable which must be checked
    353351     *            during generating postscript, if it's TRUE - interrupt
     
    361359    boolean exportToPostScript( in string filename,
    362360                     in long first_page, in long last_page,
    363                      in double width, in double height, in boolean duplex,
     361                     in double width, in double height,
    364362                     inout boolean brkExport );
    365363
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.xh

    r95 r123  
    280280                double width,
    281281                double height,
    282                 boolean duplex,
    283282                boolean* brkExport);
    284283typedef somTP_LuDocument_exportToPostScript *somTD_LuDocument_exportToPostScript;
     
    725724                double width,
    726725                double height,
    727                 boolean duplex,
    728726                boolean* brkExport)
    729727{
    730728   return SOM_ResolveD(this,LuDocument,LuDocument,exportToPostScript)
    731         (this, ev,filename,first_page,last_page,width,height,duplex,brkExport);
     729        (this, ev,filename,first_page,last_page,width,height,brkExport);
    732730}
    733731
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.xih

    r95 r123  
    575575                double width,
    576576                double height,
    577                 boolean duplex,
    578577                boolean* brkExport);
    579578#ifndef somMN_exportToPostScript_defined
     
    59159020, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
    592591
    593 static somMethodInfo exportToPostScriptMethodInfo = {11, 44, &exportToPostScriptFloatMap};
     592static somMethodInfo exportToPostScriptMethodInfo = {11, 40, &exportToPostScriptFloatMap};
    594593
    595594static somApRdInfo exportToPostScriptStubs = {0, 0, &exportToPostScriptMethodInfo};
  • trunk/Lucide/SOURCE/plugins/lupoppler/lupoppler.cpp

    r99 r123  
    323323    DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &now, sizeof( long ) );
    324324    long dist = ( now - cd->tmr );
    325     if ( ( dist > cd->delay ) || cd->forceDraw ) 
    326     {
    327         // Note: we use out->getBitmap() on each iteration instead
    328         //       of remembering pointer to bitmap before call
    329         //       page->displaySlice() because OutputDev may change
    330         //       bitmap during page->displaySlice() processing.
     325    if ( ( dist > cd->delay ) || cd->forceDraw )
     326    {
     327        // Note: we use out->getBitmap() on each iteration instead
     328        //       of remembering pointer to bitmap before call
     329        //       page->displaySlice() because OutputDev may change
     330        //       bitmap during page->displaySlice() processing.
    331331        copy_page_to_pixbuf( cd->ev, cd->out->getBitmap(), cd->pixbuf );
    332332        cd->fnd( cd->fndata );
     
    682682                                    long first_page, long last_page,
    683683                                    double width, double height,
    684                                     boolean duplex, boolean* brkExport)
     684                                    boolean* brkExport)
    685685{
    686686    if ( filename == NULL ) {
    687687        return FALSE;
    688688    }
    689     if ( last_page < first_page ) {
     689
     690    LuPopplerDocumentData *somThis = LuPopplerDocumentGetData(somSelf);
     691    PDFDoc *doc = ((PopplerDocument *)somThis->data)->doc;
     692
     693    PSOutputDev *out = new PSOutputDev( filename, doc->getXRef(), doc->getCatalog(),
     694                                (first_page <= last_page) ? (first_page + 1) : (last_page + 1),
     695                                (first_page <= last_page) ? (last_page + 1) : (first_page + 1),
     696                                        psModePS, (int)width, (int)height,
     697                                        gFalse, 0, 0, 0, 0, gFalse );
     698
     699    if ( !out->isOk() ) {
     700        delete out;
    690701        return FALSE;
    691702    }
    692703
    693     LuPopplerDocumentData *somThis = LuPopplerDocumentGetData(somSelf);
    694     PDFDoc *doc = ((PopplerDocument *)somThis->data)->doc;
    695 
    696     PSOutputDev *out = new PSOutputDev( filename, doc->getXRef(),
    697                                         doc->getCatalog(),
    698                                         first_page + 1, last_page + 1,
    699                                         psModePS, (int)width, (int)height,
    700                                         duplex, 0, 0, 0, 0, gFalse );
    701 
    702         if ( !out->isOk() ) {
    703                 delete out;
    704         return FALSE;
    705         }
    706 
    707         if ( *brkExport ) {
    708                 delete out;
     704    if ( *brkExport ) {
     705        delete out;
    709706        return TRUE;
    710         }
    711        
    712     for ( long i = first_page; (i <= last_page) && !(*brkExport); i++ ) {
    713         doc->displayPage( out, i + 1, 72.0, 72.0, 0, gFalse, gTrue, gFalse );
     707    }
     708
     709    long pagestoprint = abs( last_page - first_page ) + 1;
     710    long pg = first_page;
     711    for ( long i = 0; (i < pagestoprint) && !(*brkExport); i++ ) {
     712        doc->displayPage( out, pg + 1, 72.0, 72.0, 0, gFalse, gTrue, gFalse );
     713        pg += ( first_page <= last_page ) ? 1 : -1;
    714714    }
    715715
     
    13031303
    13041304
    1305 SOM_Scope boolean  SOMLINK isFixedImage(LuPopplerDocument *somSelf, 
     1305SOM_Scope boolean  SOMLINK isFixedImage(LuPopplerDocument *somSelf,
    13061306                                         Environment *ev)
    13071307{
  • trunk/Lucide/SOURCE/plugins/lupoppler/lupoppler.xh

    r95 r123  
    159159                double width,
    160160                double height,
    161                 boolean duplex,
    162161                boolean* brkExport);
    163162typedef somTP_LuPopplerDocument_exportToPostScript *somTD_LuPopplerDocument_exportToPostScript;
     
    604603                double width,
    605604                double height,
    606                 boolean duplex,
    607605                boolean* brkExport)
    608606{
    609607   return SOM_ResolveD(this,LuPopplerDocument,LuDocument,exportToPostScript)
    610         (this, ev,filename,first_page,last_page,width,height,duplex,brkExport);
     608        (this, ev,filename,first_page,last_page,width,height,brkExport);
    611609}
    612610
  • trunk/Lucide/SOURCE/plugins/lupoppler/lupoppler.xih

    r95 r123  
    917917                double width,
    918918                double height,
    919                 boolean duplex,
    920919                boolean* brkExport);
    921920static char *somMN_LuPopplerDocumentexportToPostScript = "LuDocument::exportToPostScript";
     
    932931                double width,
    933932                double height,
    934                 boolean duplex,
    935933                boolean* brkExport);
    936934typedef somTP_xih_LuPopplerDocument_exportToPostScript *somTD_xih_LuPopplerDocument_exportToPostScript;
    937935/* define the parent method call macro */
    938936static somMethodProc* LuPopplerDocument_parent_LuDocument_exportToPostScript_resolved;
    939 #define LuPopplerDocument_parent_LuDocument_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,duplex,brkExport) \
     937#define LuPopplerDocument_parent_LuDocument_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,brkExport) \
    940938  ((( somTD_xih_LuPopplerDocument_exportToPostScript ) \
    941939      LuPopplerDocument_parent_LuDocument_exportToPostScript_resolved) \
    942         (somSelf,ev,filename,first_page,last_page,width,height,duplex,brkExport))
     940        (somSelf,ev,filename,first_page,last_page,width,height,brkExport))
    943941/* define a variety of (possibly ambiguous) short forms */
    944942#ifndef SOMGD_pmc_parent_exportToPostScript
     
    958956  #endif
    959957#endif
    960 #define LuPopplerDocument_parents_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,duplex,brkExport) (\
    961    LuPopplerDocument_parent_LuDocument_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,duplex,brkExport))
     958#define LuPopplerDocument_parents_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,brkExport) (\
     959   LuPopplerDocument_parent_LuDocument_exportToPostScript(somSelf,ev,filename,first_page,last_page,width,height,brkExport))
    962960
    963961/*
Note: See TracChangeset for help on using the changeset viewer.