Changeset 27 for trunk/Lucide/SOURCE/gui


Ignore:
Timestamp:
May 25, 2006, 4:09:55 PM (15 years ago)
Author:
Eugene Romanenko
Message:

poppler updated to version 0.5.2, also needed changes to be compatible with new poppler

Location:
trunk/Lucide/SOURCE/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/docViewer.cpp

    r26 r27  
    5252    fullwidth   = 0;
    5353    fullheight  = 0;
     54    bpp         = 0;
    5455    zoom        = 1.0;
    5556    realzoom    = 1.0;
     
    147148    {
    148149        totalpages = doc->getPageCount( ev );
     150        bpp = doc->getBpp( ev );
    149151
    150152        pagesizes = new LuSize[ totalpages ];
     
    600602long _System DocumentViewer::asynchCallbackFnDraw( void *data )
    601603{
    602     DocumentViewer *d = (DocumentViewer *)data;
    603     HPS hps = WinGetPS( d->hWndDoc );
     604    DocumentViewer *_this = (DocumentViewer *)data;
     605    HPS hps = WinGetPS( _this->hWndDoc );
    604606    if ( hps != NULLHANDLE )
    605607    {
    606         PRECTL drawRect = &((*d->drawareas)[d->drawareaIndex].drawrect);
     608        PRECTL drawRect = &((*_this->drawareas)[_this->drawareaIndex].drawrect);
    607609        LONG rclx = drawRect->xRight - drawRect->xLeft;
    608610        LONG rcly = drawRect->yTop - drawRect->yBottom;
     
    618620        pbmi.cy = rcly;
    619621        pbmi.cPlanes = 1;
    620         pbmi.cBitCount = 24;
    621         GpiDrawBits( hps, d->pixbuf->getDataPtr( d->ev ), &pbmi, 4L,
     622        pbmi.cBitCount = _this->bpp * 8;
     623        GpiDrawBits( hps, _this->pixbuf->getDataPtr( _this->ev ), &pbmi, 4L,
    622624                     aptlPoints, lRop, BBO_IGNORE );
    623625
     
    639641    while ( !_this->termdraw )
    640642    {
    641 somPrintf("1\n");
    642643        DosWaitEventSem( _this->haveDraw, SEM_INDEFINITE_WAIT );
    643644        DosResetEventSem( _this->haveDraw, &postCnt );
    644645        _this->abortAsynch = false;
    645 somPrintf("2\n");
    646646
    647647        if ( ( _this->drawareas != NULL ) && ( _this->doc != NULL ) )
    648648        {
    649 somPrintf("3\n");
    650649            DosRequestMutexSem( _this->todrawAccess, SEM_INDEFINITE_WAIT );
    651650
     
    654653                  _this->drawareaIndex++ )
    655654            {
    656 somPrintf("4\n");
    657655                PageDrawArea *pda = &(*_this->drawareas)[ _this->drawareaIndex ];
    658 somPrintf("4.1\n");
    659656
    660657                LONG rclx = pda->drawrect.xRight - pda->drawrect.xLeft;
    661658                LONG rcly = pda->drawrect.yTop - pda->drawrect.yBottom;
    662                 _this->pixbuf = new LuPixbuf( _this->ev, rclx, rcly );
    663 somPrintf("4.2\n");
     659                _this->pixbuf = new LuPixbuf( _this->ev, rclx, rcly, _this->bpp );
    664660                _this->doc->renderPageToPixbufAsynch( _this->ev, pda->pagenum,
    665661                       pda->startpos.x, pda->startpos.y, rclx, rcly, _this->realzoom, 0,
    666662                       _this->pixbuf, asynchCallbackFnDraw, asynchCallbackFnAbort, p );
    667 somPrintf("4.3\n");
    668663                delete _this->pixbuf;
    669664                _this->pixbuf = NULL;
    670 somPrintf("4.4\n");
    671665
    672666                if ( _this->abortAsynch ) {
    673667                    break;  // TODO: remove completed areas from drawareas
    674668                }
    675 somPrintf("5\n");
    676669            }
    677670
    678671            if ( !_this->abortAsynch )
    679672            {
    680 somPrintf("6\n");
    681673                HPS hps = WinGetPS( _this->hWndDoc );
    682674                if ( hps != NULLHANDLE ) {
     
    693685                delete _this->drawareas;
    694686                _this->drawareas = NULL;
    695 somPrintf("7\n");
    696687            }
    697688
    698689            DosReleaseMutexSem( _this->todrawAccess );
    699690        }
    700 somPrintf("8\n");
    701691    }
    702692
     
    856846        LONG rcly = rclDraw.yTop - rclDraw.yBottom;
    857847
    858         pixbuf = new LuPixbuf( ev, rclx, rcly );
     848        pixbuf = new LuPixbuf( ev, rclx, rcly, bpp );
    859849        POINTL aptlPoints[4]={ rclDraw.xLeft, rclDraw.yBottom,
    860850                               rclDraw.xRight-1, rclDraw.yTop-1,
     
    869859        pbmi.cy = rcly;
    870860        pbmi.cPlanes = 1;
    871         pbmi.cBitCount = 24;
     861        pbmi.cBitCount = bpp * 8;
    872862        GpiDrawBits( hpsBuffer, pixbuf->getDataPtr( ev ), &pbmi, 4L,
    873863                     aptlPoints, lRop, BBO_IGNORE );
     
    1001991        LONG rcly = pda->drawrect.yTop - pda->drawrect.yBottom;
    1002992
    1003         pixbuf = new LuPixbuf( ev, rclx, rcly );
     993        pixbuf = new LuPixbuf( ev, rclx, rcly, bpp );
    1004994        POINTL aptlPoints[4]={ pda->drawrect.xLeft, pda->drawrect.yBottom,
    1005995                               pda->drawrect.xRight-1, pda->drawrect.yTop-1,
     
    10141004        pbmi.cy = rcly;
    10151005        pbmi.cPlanes = 1;
    1016         pbmi.cBitCount = 24;
     1006        pbmi.cBitCount = bpp * 8;
    10171007        GpiDrawBits( hpsBuffer, pixbuf->getDataPtr( ev ), &pbmi, 4L,
    10181008                     aptlPoints, lRop, BBO_IGNORE );
  • trunk/Lucide/SOURCE/gui/docViewer.h

    r26 r27  
    106106        Environment *ev;
    107107        LuPixbuf *pixbuf;
     108        short bpp;
    108109        double width, height, zoom, realzoom, fullwidth, fullheight;
    109110        long totalpages, currentpage;
Note: See TracChangeset for help on using the changeset viewer.