Changeset 27


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
Files:
52 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;
  • trunk/Lucide/SOURCE/plugins/ludjvu/ludjvu.cpp

    r2 r27  
    8484
    8585    return TRUE;
     86}
     87
     88SOM_Scope short  SOMLINK getBpp(LuDjvuDocument *somSelf,  Environment *ev)
     89{
     90    return 3;
    8691}
    8792
     
    162167    long pixbuf_rowsize = pixbuf->getRowSize( ev );
    163168    long pixbuf_height = pixbuf->getHeight( ev );
    164 
    165     LuPixbuf *pb = new LuPixbuf( ev, prect.w, prect.h );
     169    short bpp = getBpp( somSelf, ev );
     170
     171    LuPixbuf *pb = new LuPixbuf( ev, prect.w, prect.h, bpp );
    166172    long pb_rowsize = pb->getRowSize( ev );
    167173    char *pbbuf = (char *)pb->getDataPtr( ev );
     
    177183        src = pbbuf + (y * pb_rowsize);
    178184        dst = pixbuf_data + (i * pixbuf_rowsize);
    179         memcpy( dst, src, src_width * 3 );
     185        memcpy( dst, src, src_width * bpp );
    180186    }
    181187    delete pb;
     
    218224    int t_width = thumb_width;
    219225    int t_height = thumb_height;
    220     LuPixbuf *tmppb = new LuPixbuf( ev, thumb_width, thumb_height );
     226    short bpp = getBpp( somSelf, ev );
     227    LuPixbuf *tmppb = new LuPixbuf( ev, thumb_width, thumb_height, bpp );
    221228    char *tmppb_data = (char *)tmppb->getDataPtr( ev );
    222229    int tmppb_rowstride = tmppb->getRowSize( ev );
     
    225232                            d->d_format, tmppb_rowstride, tmppb_data );
    226233
    227     LuPixbuf *pixbuf = new LuPixbuf( ev, thumb_width, thumb_height );
     234    LuPixbuf *pixbuf = new LuPixbuf( ev, thumb_width, thumb_height, bpp );
    228235    char *pixbuf_data = (char *)pixbuf->getDataPtr( ev );
    229236    int pixbuf_rowstride = pixbuf->getRowSize( ev );
  • trunk/Lucide/SOURCE/plugins/ludjvu/ludjvu.idl

    r2 r27  
    2121
    2222        loadFile: override;
     23        getBpp: override;
    2324        isScalable: override;
    2425        getPageCount: override;
  • trunk/Lucide/SOURCE/plugins/ludjvu/ludjvu.xh

    r2 r27  
    7272                string* error);
    7373typedef somTP_LuDjvuDocument_loadFile *somTD_LuDjvuDocument_loadFile;
     74typedef short   SOMLINK somTP_LuDjvuDocument_getBpp(LuDjvuDocument *somSelf, Environment *ev);
     75typedef somTP_LuDjvuDocument_getBpp *somTD_LuDjvuDocument_getBpp;
    7476typedef boolean   SOMLINK somTP_LuDjvuDocument_isScalable(LuDjvuDocument *somSelf, Environment *ev);
    7577typedef somTP_LuDjvuDocument_isScalable *somTD_LuDjvuDocument_isScalable;
     
    173175typedef LuDocument_LuRectSequence*   SOMLINK somTP_LuDjvuDocument_searchText(LuDjvuDocument *somSelf, Environment *ev,
    174176                long pagenum,
    175                 string text);
     177                string text,
     178                boolean caseSensitive);
    176179typedef somTP_LuDjvuDocument_searchText *somTD_LuDjvuDocument_searchText;
    177180typedef void   SOMLINK somTP_LuDjvuDocument_somDefaultInit(LuDjvuDocument *somSelf,
     
    372375
    373376
     377/* method: getBpp */
     378short   getBpp(Environment *ev)
     379{
     380   return SOM_ResolveD(this,LuDjvuDocument,LuDocument,getBpp)
     381        (this, ev);
     382}
     383
     384
    374385/* method: isScalable */
    375386boolean   isScalable(Environment *ev)
     
    636647LuDocument_LuRectSequence*   searchText(Environment *ev,
    637648                long pagenum,
    638                 string text)
     649                string text,
     650                boolean caseSensitive)
    639651{
    640652   return SOM_ResolveD(this,LuDjvuDocument,LuDocument,searchText)
    641         (this, ev,pagenum,text);
     653        (this, ev,pagenum,text,caseSensitive);
    642654}
    643655
  • trunk/Lucide/SOURCE/plugins/ludjvu/ludjvu.xih

    r2 r27  
    7878#ifdef METHOD_MACROS
    7979  #define _loadFile somSelf->loadFile
     80  #define _getBpp somSelf->getBpp
    8081  #define _isScalable somSelf->isScalable
    8182  #define _isRotable somSelf->isRotable
     
    137138  #define _somDumpSelfInt somSelf->somDumpSelfInt
    138139  #define _loadFile somSelf->loadFile
     140  #define _getBpp somSelf->getBpp
    139141  #define _isScalable somSelf->isScalable
    140142  #define _getPageCount somSelf->getPageCount
     
    203205#define LuDjvuDocument_parents_loadFile(somSelf,ev,filename,password,error) (\
    204206   LuDjvuDocument_parent_LuDocument_loadFile(somSelf,ev,filename,password,error))
     207
     208/*
     209 * Overridden method: getBpp
     210 */
     211SOM_Scope short  SOMLINK getBpp(LuDjvuDocument *somSelf, Environment *ev);
     212static char *somMN_LuDjvuDocumentgetBpp = "LuDocument::getBpp";
     213static somId somId_LuDjvuDocumentgetBpp = &somMN_LuDjvuDocumentgetBpp;
     214#ifdef somId_getBpp
     215#undef somId_getBpp
     216#else
     217#define somId_getBpp somId_LuDjvuDocumentgetBpp
     218#endif
     219typedef short   SOMLINK somTP_xih_LuDjvuDocument_getBpp(LuDjvuDocument *somSelf, Environment *ev);
     220typedef somTP_xih_LuDjvuDocument_getBpp *somTD_xih_LuDjvuDocument_getBpp;
     221/* define the parent method call macro */
     222static somMethodProc* LuDjvuDocument_parent_LuDocument_getBpp_resolved;
     223#define LuDjvuDocument_parent_LuDocument_getBpp(somSelf,ev) \
     224  ((( somTD_xih_LuDjvuDocument_getBpp ) \
     225      LuDjvuDocument_parent_LuDocument_getBpp_resolved) \
     226        (somSelf,ev))
     227/* define a variety of (possibly ambiguous) short forms */
     228#ifndef SOMGD_pmc_parent_getBpp
     229  #ifdef parent_getBpp
     230    #define SOMGD_pmc_parent_getBpp
     231    #undef parent_getBpp
     232  #else
     233#define parent_getBpp LuDjvuDocument_parent_LuDocument_getBpp
     234  #endif
     235#endif
     236#ifndef SOMGD_pmc_parent_LuDocument_getBpp
     237  #ifdef parent_LuDocument_getBpp
     238    #define SOMGD_pmc_parent_LuDocument_getBpp
     239    #undef parent_LuDocument_getBpp
     240  #else
     241    #define parent_LuDocument_getBpp LuDjvuDocument_parent_LuDocument_getBpp
     242  #endif
     243#endif
     244#define LuDjvuDocument_parents_getBpp(somSelf,ev) (\
     245   LuDjvuDocument_parent_LuDocument_getBpp(somSelf,ev))
    205246
    206247/*
     
    510551    {    &somId_LuDjvuDocumentloadFile,
    511552         (somMethodProc *) loadFile  },
     553    {    &somId_LuDjvuDocumentgetBpp,
     554         (somMethodProc *) getBpp  },
    512555    {    &somId_LuDjvuDocumentisScalable,
    513556         (somMethodProc *) isScalable  },
     
    540583
    541584static somStaticClassInfo LuDjvuDocumentSCI = {
    542     4, 0, 9, 0, 0, 0, /* layout version 4 */
     585    4, 0, 10, 0, 0, 0, /* layout version 4 */
    543586    LuDjvuDocument_MajorVersion, LuDjvuDocument_MinorVersion,
    544587    sizeof(LuDjvuDocumentData), LuDjvuDocument_MaxNoMethods, 1,
     
    598641    LuDjvuDocument_parent_LuDocument_isScalable_resolved =
    599642        somParentNumResolve(LuDjvuDocumentCClassData.parentMtab, 1, LuDocumentClassData.isScalable);
     643    LuDjvuDocument_parent_LuDocument_getBpp_resolved =
     644        somParentNumResolve(LuDjvuDocumentCClassData.parentMtab, 1, LuDocumentClassData.getBpp);
    600645    LuDjvuDocument_parent_LuDocument_loadFile_resolved =
    601646        somParentNumResolve(LuDjvuDocumentCClassData.parentMtab, 1, LuDocumentClassData.loadFile);
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.cpp

    r2 r27  
    4545{
    4646    return "NULL plugin, abstract base class for Lucide plugins.";
     47}
     48
     49
     50/*
     51 * SOM_Scope long  SOMLINK getBpp(LuDocument *somSelf,  Environment *ev)
     52 */
     53
     54/*
     55 * The prototype for getBpp was replaced by the following prototype:
     56 */
     57SOM_Scope short  SOMLINK getBpp(LuDocument *somSelf,  Environment *ev)
     58{
     59    // Abstract method does nothing
     60    return 0;
    4761}
    4862
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.idl

    r2 r27  
    3838                      inout string error );
    3939
     40    /**
     41     * getBpp
     42     *
     43     * Return value: Number of bytes per pixel used for draw.
     44     **/
     45    short getBpp();
    4046
    4147    /**
     
    422428    implementation
    423429    {
    424         releaseorder: loadFile, isScalable, isRotable, getPageCount,
    425                       getPageSize, renderPageToPixbuf,
     430        releaseorder: loadFile, getBpp, isScalable, isRotable,
     431                      getPageCount, getPageSize, renderPageToPixbuf,
    426432                      isAsynchRenderingSupported, renderPageToPixbufAsynch,
    427433                      isHaveText, getSelectionRectangles, freeRectangles,
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.xh

    r2 r27  
    143143        SOMClass *classObject;
    144144        somMToken loadFile;
     145        somMToken getBpp;
    145146        somMToken isScalable;
    146147        somMToken isRotable;
     
    189190                string* error);
    190191typedef somTP_LuDocument_loadFile *somTD_LuDocument_loadFile;
     192typedef short   SOMLINK somTP_LuDocument_getBpp(LuDocument *somSelf, Environment *ev);
     193typedef somTP_LuDocument_getBpp *somTD_LuDocument_getBpp;
    191194typedef boolean   SOMLINK somTP_LuDocument_isScalable(LuDocument *somSelf, Environment *ev);
    192195typedef somTP_LuDocument_isScalable *somTD_LuDocument_isScalable;
     
    490493
    491494
     495/* method: getBpp */
     496short   getBpp(Environment *ev)
     497{
     498   return SOM_ResolveD(this,LuDocument,LuDocument,getBpp)
     499        (this, ev);
     500}
     501
     502
    492503/* method: isScalable */
    493504boolean   isScalable(Environment *ev)
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.xih

    r2 r27  
    3232#endif
    3333
    34 #define LuDocument_MaxNoMethods 29
     34#define LuDocument_MaxNoMethods 30
    3535
    3636/*
     
    9090  #define _somDumpSelfInt somSelf->somDumpSelfInt
    9191  #define _loadFile somSelf->loadFile
     92  #define _getBpp somSelf->getBpp
    9293  #define _isScalable somSelf->isScalable
    9394  #define _isRotable somSelf->isRotable
     
    156157
    157158/*
     159 * New Method: getBpp
     160 */
     161SOM_Scope short  SOMLINK getBpp(LuDocument *somSelf, Environment *ev);
     162#ifndef somMN_getBpp_defined
     163#define somMN_getBpp_defined
     164static char *somMN_getBpp = "getBpp";
     165static somId somId_getBpp = &somMN_getBpp;
     166#endif  /* somMN_getBpp_defined */
     167#ifndef somDS_getBpp_defined
     168#define somDS_getBpp_defined
     169static char *somDS_getBpp = "::LuDocument::getBpp";
     170static somId somDI_getBpp = &somDS_getBpp;
     171#endif  /* somDS_getBpp_defined */
     172
     173static somMethodInfo getBppMethodInfo = {12, 8, 0};
     174
     175static somApRdInfo getBppStubs = {0, 0, &getBppMethodInfo};
     176
     177/*
    158178 * New Method: isScalable
    159179 */
     
    699719         (somMethodProc *) ((void*) &loadFileStubs) },
    700720#endif
     721    {    &LuDocumentClassData.getBpp,
     722         &somId_getBpp,
     723         &somDI_getBpp,
     724         (somMethodProc *) getBpp,
     725         (somMethodProc *)((void*)-1),
     726#ifdef getBpp_somApRdDefault
     727         0},
     728#else
     729         (somMethodProc *) ((void*) &getBppStubs) },
     730#endif
    701731    {    &LuDocumentClassData.isScalable,
    702732         &somId_isScalable,
     
    9721002
    9731003static somStaticClassInfo LuDocumentSCI = {
    974     4, 25, 1, 0, 4, 0, /* layout version 4 */
     1004    4, 26, 1, 0, 4, 0, /* layout version 4 */
    9751005    LuDocument_MajorVersion, LuDocument_MinorVersion,
    9761006    0, LuDocument_MaxNoMethods, 1,
     
    9951025    0, /* number of SelectInheritedMethods */
    9961026    0, /* no SelectInheritedMethods */
    997     29, /* number of classdata entries */
     1027    30, /* number of classdata entries */
    9981028    0, /* no list provided currently */
    9991029    0, /* number of migrated methods */
  • trunk/Lucide/SOURCE/plugins/ludoc/lupixbuf.cpp

    r2 r27  
    55 *     SOM incremental update: 2.24
    66 */
     7
    78
    89/*
     
    2021
    2122
    22 SOM_Scope void SOMLINK LuPixbufInit(LuPixbuf *somSelf,  Environment *ev,
    23                                     somInitCtrl* ctrl, long w, long h)
     23
     24/*
     25 * SOM_Scope void SOMLINK LuPixbufInit(LuPixbuf *somSelf,  Environment *ev,
     26 *                                     somInitCtrl* ctrl, long w, long h)
     27 */
     28
     29/*
     30 * The prototype for LuPixbufInit was replaced by the following prototype:
     31 */
     32SOM_Scope void SOMLINK LuPixbufInit(LuPixbuf *somSelf,  Environment *ev,
     33                                    somInitCtrl* ctrl, long w,
     34                                    long h, short bpp)
    2435{
    2536    LuPixbufData *somThis;
     
    3243    somThis->width = w;
    3344    somThis->height = h;
    34     somThis->bpp = 3;
     45    somThis->bpp = bpp;
    3546    somThis->rowsize = ( somThis->width * somThis->bpp );
    36     somThis->rowsize = (somThis->rowsize + 3) &~3;
     47    if ( bpp != 4 ) {
     48            somThis->rowsize = (somThis->rowsize + 3) &~3;
     49        }
    3750    somThis->dlen = somThis->rowsize * somThis->height;
    3851    somThis->data = new char[ somThis->dlen ];
     
    5164    LuPixbufData *somThis = LuPixbufGetData(somSelf);
    5265    return somThis->height;
     66}
     67
     68SOM_Scope short  SOMLINK getBpp(LuPixbuf *somSelf,  Environment *ev)
     69{
     70    LuPixbufData *somThis = LuPixbufGetData(somSelf);
     71    return somThis->bpp;
    5372}
    5473
  • trunk/Lucide/SOURCE/plugins/ludoc/lupixbuf.idl

    r2 r27  
    1414interface LuPixbuf : SOMObject
    1515{
    16     void LuPixbufInit( inout somInitCtrl ctrl, in long w, in long h );
     16    void LuPixbufInit( inout somInitCtrl ctrl, in long w, in long h, in short bpp );
    1717    long getWidth();
    1818    long getHeight();
     19    short getBpp();
    1920    long getRowSize();
    2021    long getDataLen();
     
    2728    implementation
    2829    {
    29         releaseorder: LuPixbufInit, getWidth, getHeight, getRowSize,
     30        releaseorder: LuPixbufInit, getWidth, getHeight, getBpp, getRowSize,
    3031                                      getDataLen, getDataPtr, putAt;
    3132   
  • trunk/Lucide/SOURCE/plugins/ludoc/lupixbuf.xh

    r2 r27  
    5353        somMToken getWidth;
    5454        somMToken getHeight;
     55        somMToken getBpp;
    5556        somMToken getRowSize;
    5657        somMToken getDataLen;
     
    7374                somInitCtrl* ctrl,
    7475                long w,
    75                 long h);
     76                long h,
     77                short bpp);
    7678typedef somTP_LuPixbuf_LuPixbufInit *somTD_LuPixbuf_LuPixbufInit;
    7779typedef long   SOMLINK somTP_LuPixbuf_getWidth(LuPixbuf *somSelf, Environment *ev);
     
    7981typedef long   SOMLINK somTP_LuPixbuf_getHeight(LuPixbuf *somSelf, Environment *ev);
    8082typedef somTP_LuPixbuf_getHeight *somTD_LuPixbuf_getHeight;
     83typedef short   SOMLINK somTP_LuPixbuf_getBpp(LuPixbuf *somSelf, Environment *ev);
     84typedef somTP_LuPixbuf_getBpp *somTD_LuPixbuf_getBpp;
    8185typedef long   SOMLINK somTP_LuPixbuf_getRowSize(LuPixbuf *somSelf, Environment *ev);
    8286typedef somTP_LuPixbuf_getRowSize *somTD_LuPixbuf_getRowSize;
     
    275279#endif
    276280
    277 LuPixbuf(Environment *ev,long w,long h)
    278 {
    279    LuPixbufInit(ev,0,w,h);
     281LuPixbuf(Environment *ev,long w,long h,short bpp)
     282{
     283   LuPixbufInit(ev,0,w,h,bpp);
    280284}
    281285
     
    285289                somInitCtrl* ctrl,
    286290                long w,
    287                 long h)
     291                long h,
     292                short bpp)
    288293{
    289294   SOM_ResolveD(this,LuPixbuf,LuPixbuf,LuPixbufInit)
    290         (this, ev,ctrl,w,h);
     295        (this, ev,ctrl,w,h,bpp);
    291296}
    292297
     
    304309{
    305310   return SOM_ResolveD(this,LuPixbuf,LuPixbuf,getHeight)
     311        (this, ev);
     312}
     313
     314
     315/* method: getBpp */
     316short   getBpp(Environment *ev)
     317{
     318   return SOM_ResolveD(this,LuPixbuf,LuPixbuf,getBpp)
    306319        (this, ev);
    307320}
  • trunk/Lucide/SOURCE/plugins/ludoc/lupixbuf.xih

    r2 r27  
    3232#endif
    3333
    34 #define LuPixbuf_MaxNoMethods 7
     34#define LuPixbuf_MaxNoMethods 8
    3535
    3636/*
     
    120120  #define _getWidth somSelf->getWidth
    121121  #define _getHeight somSelf->getHeight
     122  #define _getBpp somSelf->getBpp
    122123  #define _getRowSize somSelf->getRowSize
    123124  #define _getDataLen somSelf->getDataLen
     
    145146                somInitCtrl* ctrl,
    146147                long w,
    147                 long h);
     148                long h,
     149                short bpp);
    148150#ifndef somMN_LuPixbufInit_defined
    149151#define somMN_LuPixbufInit_defined
     
    156158static somId somDI_LuPixbufInit = &somDS_LuPixbufInit;
    157159#endif  /* somDS_LuPixbufInit_defined */
    158 #define LuPixbufInit_somApRdDefault
     160
     161static somMethodInfo LuPixbufInitMethodInfo = {0, 24, 0};
     162
     163static somApRdInfo LuPixbufInitStubs = {0, 0, &LuPixbufInitMethodInfo};
    159164
    160165/*
     
    189194#endif  /* somDS_getHeight_defined */
    190195#define getHeight_somApRdDefault
     196
     197/*
     198 * New Method: getBpp
     199 */
     200SOM_Scope short  SOMLINK getBpp(LuPixbuf *somSelf, Environment *ev);
     201#ifndef somMN_getBpp_defined
     202#define somMN_getBpp_defined
     203static char *somMN_getBpp = "getBpp";
     204static somId somId_getBpp = &somMN_getBpp;
     205#endif  /* somMN_getBpp_defined */
     206#ifndef somDS_getBpp_defined
     207#define somDS_getBpp_defined
     208static char *somDS_getBpp = "::LuPixbuf::getBpp";
     209static somId somDI_getBpp = &somDS_getBpp;
     210#endif  /* somDS_getBpp_defined */
     211
     212static somMethodInfo getBppMethodInfo = {12, 8, 0};
     213
     214static somApRdInfo getBppStubs = {0, 0, &getBppMethodInfo};
    191215
    192216/*
     
    310334         (somMethodProc *) ((void*) &getHeightStubs) },
    311335#endif
     336    {    &LuPixbufClassData.getBpp,
     337         &somId_getBpp,
     338         &somDI_getBpp,
     339         (somMethodProc *) getBpp,
     340         (somMethodProc *)((void*)-1),
     341#ifdef getBpp_somApRdDefault
     342         0},
     343#else
     344         (somMethodProc *) ((void*) &getBppStubs) },
     345#endif
    312346    {    &LuPixbufClassData.getRowSize,
    313347         &somId_getRowSize,
     
    377411
    378412static somStaticClassInfo LuPixbufSCI = {
    379     4, 7, 1, 0, 0, 0, /* layout version 4 */
     413    4, 8, 1, 0, 0, 0, /* layout version 4 */
    380414    LuPixbuf_MajorVersion, LuPixbuf_MinorVersion,
    381415    sizeof(LuPixbufData), LuPixbuf_MaxNoMethods, 1,
     
    400434    0, /* number of SelectInheritedMethods */
    401435    0, /* no SelectInheritedMethods */
    402     7, /* number of classdata entries */
     436    8, /* number of classdata entries */
    403437    0, /* no list provided currently */
    404438    0, /* number of migrated methods */
  • trunk/Lucide/SOURCE/plugins/lujpeg/lujpeg.cpp

    r2 r27  
     1
     2/*
     3 *  This file was generated by the SOM Compiler.
     4 *  Generated using:
     5 *     SOM incremental update: 2.24
     6 */
     7
    18/*
    29 *  This file was generated by the SOM Compiler and Emitter Framework.
     
    6572    }
    6673
     74    short bpp = getBpp( somSelf, ev );
    6775    jpeg_decompress_struct cinfo;
    6876    jpeg_error_mgr jerr;
     
    7684    d->width = cinfo.output_width;
    7785    d->height = cinfo.output_height;
    78     d->pb = new LuPixbuf( ev, cinfo.output_width, cinfo.output_height );
     86    d->pb = new LuPixbuf( ev, cinfo.output_width, cinfo.output_height, bpp );
    7987
    8088    int pixbuf_rowstride, pixbuf_height, pixbuf_width;
     
    97105        jpeg_read_scanlines( &cinfo, buffer, 1 );
    98106        dst = pixbuf_data + i * pixbuf_rowstride;
    99         for ( j = 0; j < pixbuf_rowstride; j += 3 )
     107        for ( j = 0; j < pixbuf_rowstride; j += bpp )
    100108        {
    101109            dst[ j ] = buffer[0][ j + 2 ];
     
    110118
    111119    return TRUE;
     120}
     121
     122SOM_Scope short  SOMLINK getBpp(LuJpegDocument *somSelf,  Environment *ev)
     123{
     124    return 3;
    112125}
    113126
     
    146159    //            src_x, src_y, src_width, src_height );
    147160
     161    short bpp = getBpp( somSelf, ev );
    148162    int pb_rowstride = d->pb->getRowSize( ev );
    149163    int pb_height = d->pb->getHeight( ev );
     
    155169    for ( y = pb_height-(src_y+src_height), i = 0; i < src_height; y++, i++ )
    156170    {
    157         src = pb_data + (y * pb_rowstride) + (src_x*3);
     171        src = pb_data + (y * pb_rowstride) + (src_x * bpp);
    158172        dst = pixbuf_data + (i * pixbuf_rowstride);
    159         memcpy( dst, src, src_width * 3 );
     173        memcpy( dst, src, src_width * bpp );
    160174    }
    161175    //long len = __min( pixbuf->getDataLen(ev), d->pb->getDataLen(ev) );
  • trunk/Lucide/SOURCE/plugins/lujpeg/lujpeg.idl

    r2 r27  
    2525       
    2626        loadFile: override;
     27        getBpp: override;
    2728        getPageCount: override;
    2829        getPageSize: override;
  • trunk/Lucide/SOURCE/plugins/lujpeg/lujpeg.xh

    r2 r27  
    7272                string* error);
    7373typedef somTP_LuJpegDocument_loadFile *somTD_LuJpegDocument_loadFile;
     74typedef short   SOMLINK somTP_LuJpegDocument_getBpp(LuJpegDocument *somSelf, Environment *ev);
     75typedef somTP_LuJpegDocument_getBpp *somTD_LuJpegDocument_getBpp;
    7476typedef boolean   SOMLINK somTP_LuJpegDocument_isScalable(LuJpegDocument *somSelf, Environment *ev);
    7577typedef somTP_LuJpegDocument_isScalable *somTD_LuJpegDocument_isScalable;
     
    9395                LuPixbuf* pixbuf);
    9496typedef somTP_LuJpegDocument_renderPageToPixbuf *somTD_LuJpegDocument_renderPageToPixbuf;
     97typedef boolean   SOMLINK somTP_LuJpegDocument_isAsynchRenderingSupported(LuJpegDocument *somSelf, Environment *ev);
     98typedef somTP_LuJpegDocument_isAsynchRenderingSupported *somTD_LuJpegDocument_isAsynchRenderingSupported;
     99typedef void   SOMLINK somTP_LuJpegDocument_renderPageToPixbufAsynch(LuJpegDocument *somSelf, Environment *ev,
     100                long pagenum,
     101                long src_x,
     102                long src_y,
     103                long src_width,
     104                long src_height,
     105                double scale,
     106                long rotation,
     107                LuPixbuf* pixbuf,
     108                LuDocument_asynchCallbackFn fnd,
     109                LuDocument_asynchCallbackFn fna,
     110                somToken fndata);
     111typedef somTP_LuJpegDocument_renderPageToPixbufAsynch *somTD_LuJpegDocument_renderPageToPixbufAsynch;
    95112typedef boolean   SOMLINK somTP_LuJpegDocument_isHaveText(LuJpegDocument *somSelf, Environment *ev);
    96113typedef somTP_LuJpegDocument_isHaveText *somTD_LuJpegDocument_isHaveText;
     
    158175typedef LuDocument_LuRectSequence*   SOMLINK somTP_LuJpegDocument_searchText(LuJpegDocument *somSelf, Environment *ev,
    159176                long pagenum,
    160                 string text);
     177                string text,
     178                boolean caseSensitive);
    161179typedef somTP_LuJpegDocument_searchText *somTD_LuJpegDocument_searchText;
    162180typedef void   SOMLINK somTP_LuJpegDocument_somDefaultInit(LuJpegDocument *somSelf,
     
    357375
    358376
     377/* method: getBpp */
     378short   getBpp(Environment *ev)
     379{
     380   return SOM_ResolveD(this,LuJpegDocument,LuDocument,getBpp)
     381        (this, ev);
     382}
     383
     384
    359385/* method: isScalable */
    360386boolean   isScalable(Environment *ev)
     
    405431   SOM_ResolveD(this,LuJpegDocument,LuDocument,renderPageToPixbuf)
    406432        (this, ev,pagenum,src_x,src_y,src_width,src_height,scale,rotation,pixbuf);
     433}
     434
     435
     436/* method: isAsynchRenderingSupported */
     437boolean   isAsynchRenderingSupported(Environment *ev)
     438{
     439   return SOM_ResolveD(this,LuJpegDocument,LuDocument,isAsynchRenderingSupported)
     440        (this, ev);
     441}
     442
     443
     444/* method: renderPageToPixbufAsynch */
     445void   renderPageToPixbufAsynch(Environment *ev,
     446                long pagenum,
     447                long src_x,
     448                long src_y,
     449                long src_width,
     450                long src_height,
     451                double scale,
     452                long rotation,
     453                LuPixbuf* pixbuf,
     454                LuDocument_asynchCallbackFn fnd,
     455                LuDocument_asynchCallbackFn fna,
     456                somToken fndata)
     457{
     458   SOM_ResolveD(this,LuJpegDocument,LuDocument,renderPageToPixbufAsynch)
     459        (this, ev,pagenum,src_x,src_y,src_width,src_height,scale,rotation,pixbuf,fnd,fna,fndata);
    407460}
    408461
     
    594647LuDocument_LuRectSequence*   searchText(Environment *ev,
    595648                long pagenum,
    596                 string text)
     649                string text,
     650                boolean caseSensitive)
    597651{
    598652   return SOM_ResolveD(this,LuJpegDocument,LuDocument,searchText)
    599         (this, ev,pagenum,text);
     653        (this, ev,pagenum,text,caseSensitive);
    600654}
    601655
  • trunk/Lucide/SOURCE/plugins/lujpeg/lujpeg.xih

    r2 r27  
    7878#ifdef METHOD_MACROS
    7979  #define _loadFile somSelf->loadFile
     80  #define _getBpp somSelf->getBpp
    8081  #define _isScalable somSelf->isScalable
    8182  #define _isRotable somSelf->isRotable
     
    8384  #define _getPageSize somSelf->getPageSize
    8485  #define _renderPageToPixbuf somSelf->renderPageToPixbuf
     86  #define _isAsynchRenderingSupported somSelf->isAsynchRenderingSupported
     87  #define _renderPageToPixbufAsynch somSelf->renderPageToPixbufAsynch
    8588  #define _isHaveText somSelf->isHaveText
    8689  #define _getSelectionRectangles somSelf->getSelectionRectangles
     
    135138  #define _somDumpSelfInt somSelf->somDumpSelfInt
    136139  #define _loadFile somSelf->loadFile
     140  #define _getBpp somSelf->getBpp
    137141  #define _getPageCount somSelf->getPageCount
    138142  #define _getPageSize somSelf->getPageSize
     
    198202#define LuJpegDocument_parents_loadFile(somSelf,ev,filename,password,error) (\
    199203   LuJpegDocument_parent_LuDocument_loadFile(somSelf,ev,filename,password,error))
     204
     205/*
     206 * Overridden method: getBpp
     207 */
     208SOM_Scope short  SOMLINK getBpp(LuJpegDocument *somSelf, Environment *ev);
     209static char *somMN_LuJpegDocumentgetBpp = "LuDocument::getBpp";
     210static somId somId_LuJpegDocumentgetBpp = &somMN_LuJpegDocumentgetBpp;
     211#ifdef somId_getBpp
     212#undef somId_getBpp
     213#else
     214#define somId_getBpp somId_LuJpegDocumentgetBpp
     215#endif
     216typedef short   SOMLINK somTP_xih_LuJpegDocument_getBpp(LuJpegDocument *somSelf, Environment *ev);
     217typedef somTP_xih_LuJpegDocument_getBpp *somTD_xih_LuJpegDocument_getBpp;
     218/* define the parent method call macro */
     219static somMethodProc* LuJpegDocument_parent_LuDocument_getBpp_resolved;
     220#define LuJpegDocument_parent_LuDocument_getBpp(somSelf,ev) \
     221  ((( somTD_xih_LuJpegDocument_getBpp ) \
     222      LuJpegDocument_parent_LuDocument_getBpp_resolved) \
     223        (somSelf,ev))
     224/* define a variety of (possibly ambiguous) short forms */
     225#ifndef SOMGD_pmc_parent_getBpp
     226  #ifdef parent_getBpp
     227    #define SOMGD_pmc_parent_getBpp
     228    #undef parent_getBpp
     229  #else
     230#define parent_getBpp LuJpegDocument_parent_LuDocument_getBpp
     231  #endif
     232#endif
     233#ifndef SOMGD_pmc_parent_LuDocument_getBpp
     234  #ifdef parent_LuDocument_getBpp
     235    #define SOMGD_pmc_parent_LuDocument_getBpp
     236    #undef parent_LuDocument_getBpp
     237  #else
     238    #define parent_LuDocument_getBpp LuJpegDocument_parent_LuDocument_getBpp
     239  #endif
     240#endif
     241#define LuJpegDocument_parents_getBpp(somSelf,ev) (\
     242   LuJpegDocument_parent_LuDocument_getBpp(somSelf,ev))
    200243
    201244/*
     
    376419    {    &somId_LuJpegDocumentloadFile,
    377420         (somMethodProc *) loadFile  },
     421    {    &somId_LuJpegDocumentgetBpp,
     422         (somMethodProc *) getBpp  },
    378423    {    &somId_LuJpegDocumentgetPageCount,
    379424         (somMethodProc *) getPageCount  },
     
    400445
    401446static somStaticClassInfo LuJpegDocumentSCI = {
    402     4, 0, 6, 0, 0, 0, /* layout version 4 */
     447    4, 0, 7, 0, 0, 0, /* layout version 4 */
    403448    LuJpegDocument_MajorVersion, LuJpegDocument_MinorVersion,
    404449    sizeof(LuJpegDocumentData), LuJpegDocument_MaxNoMethods, 1,
     
    452497    LuJpegDocument_parent_LuDocument_getPageCount_resolved =
    453498        somParentNumResolve(LuJpegDocumentCClassData.parentMtab, 1, LuDocumentClassData.getPageCount);
     499    LuJpegDocument_parent_LuDocument_getBpp_resolved =
     500        somParentNumResolve(LuJpegDocumentCClassData.parentMtab, 1, LuDocumentClassData.getBpp);
    454501    LuJpegDocument_parent_LuDocument_loadFile_resolved =
    455502        somParentNumResolve(LuJpegDocumentCClassData.parentMtab, 1, LuDocumentClassData.loadFile);
  • trunk/Lucide/SOURCE/plugins/lujpeg/makefile

    r17 r27  
    5757-xr
    5858-I..\ludoc
    59 -ID:\Projects\libjpeg
     59-I..\..\..\..\libjpeg
    6060-DOS2
    6161| MAKE.CFG >NUL
  • trunk/Lucide/SOURCE/plugins/lupoppler/lupoppler.cpp

    r23 r27  
    154154}
    155155
     156
     157SOM_Scope short  SOMLINK getBpp(LuPopplerDocument *somSelf,  Environment *ev)
     158{
     159    return 4;
     160}
    156161
    157162SOM_Scope boolean  SOMLINK isScalable(LuPopplerDocument *somSelf,
     
    11611166    }
    11621167
    1163     LuPixbuf *pixbuf = new LuPixbuf( ev, width, height );
     1168    short bpp = getBpp( somSelf, ev );
     1169    LuPixbuf *pixbuf = new LuPixbuf( ev, width, height, bpp );
    11641170    char *pixbuf_data = (char *)pixbuf->getDataPtr( ev );
    11651171    int pixbuf_rowstride = pixbuf->getRowSize( ev );
     
    11701176        src = data + ( j * rowstride );
    11711177        dst = pixbuf_data + (i * pixbuf_rowstride);
    1172         for ( int k = 0; k < pixbuf_rowstride; k+= 3 )
     1178        for ( int k = 0; k < pixbuf_rowstride; k += bpp )
    11731179        {
    11741180            dst[ k ]     = src[ k + 2 ];
     
    13431349    white[1] = 255;
    13441350    white[2] = 255;
    1345     document->output_dev = new SplashOutputDev( splashModeBGR8, 4, gFalse, white );
     1351    document->output_dev = new SplashOutputDev( splashModeRGB8, 4, gFalse, white );
    13461352    document->output_dev->startDoc( document->doc->getXRef() );
    13471353
  • trunk/Lucide/SOURCE/plugins/lupoppler/lupoppler.idl

    r2 r27  
    2525       
    2626        loadFile: override;
     27        getBpp: override;
    2728        isScalable: override;
    2829        isRotable: override;
  • trunk/Lucide/SOURCE/plugins/lupoppler/lupoppler.xh

    r2 r27  
    7272                string* error);
    7373typedef somTP_LuPopplerDocument_loadFile *somTD_LuPopplerDocument_loadFile;
     74typedef short   SOMLINK somTP_LuPopplerDocument_getBpp(LuPopplerDocument *somSelf, Environment *ev);
     75typedef somTP_LuPopplerDocument_getBpp *somTD_LuPopplerDocument_getBpp;
    7476typedef boolean   SOMLINK somTP_LuPopplerDocument_isScalable(LuPopplerDocument *somSelf, Environment *ev);
    7577typedef somTP_LuPopplerDocument_isScalable *somTD_LuPopplerDocument_isScalable;
     
    373375
    374376
     377/* method: getBpp */
     378short   getBpp(Environment *ev)
     379{
     380   return SOM_ResolveD(this,LuPopplerDocument,LuDocument,getBpp)
     381        (this, ev);
     382}
     383
     384
    375385/* method: isScalable */
    376386boolean   isScalable(Environment *ev)
  • trunk/Lucide/SOURCE/plugins/lupoppler/lupoppler.xih

    r2 r27  
    7878#ifdef METHOD_MACROS
    7979  #define _loadFile somSelf->loadFile
     80  #define _getBpp somSelf->getBpp
    8081  #define _isScalable somSelf->isScalable
    8182  #define _isRotable somSelf->isRotable
     
    137138  #define _somDumpSelfInt somSelf->somDumpSelfInt
    138139  #define _loadFile somSelf->loadFile
     140  #define _getBpp somSelf->getBpp
    139141  #define _isScalable somSelf->isScalable
    140142  #define _isRotable somSelf->isRotable
     
    223225
    224226/*
     227 * Overridden method: getBpp
     228 */
     229SOM_Scope short  SOMLINK getBpp(LuPopplerDocument *somSelf, Environment *ev);
     230static char *somMN_LuPopplerDocumentgetBpp = "LuDocument::getBpp";
     231static somId somId_LuPopplerDocumentgetBpp = &somMN_LuPopplerDocumentgetBpp;
     232#ifdef somId_getBpp
     233#undef somId_getBpp
     234#else
     235#define somId_getBpp somId_LuPopplerDocumentgetBpp
     236#endif
     237typedef short   SOMLINK somTP_xih_LuPopplerDocument_getBpp(LuPopplerDocument *somSelf, Environment *ev);
     238typedef somTP_xih_LuPopplerDocument_getBpp *somTD_xih_LuPopplerDocument_getBpp;
     239/* define the parent method call macro */
     240static somMethodProc* LuPopplerDocument_parent_LuDocument_getBpp_resolved;
     241#define LuPopplerDocument_parent_LuDocument_getBpp(somSelf,ev) \
     242  ((( somTD_xih_LuPopplerDocument_getBpp ) \
     243      LuPopplerDocument_parent_LuDocument_getBpp_resolved) \
     244        (somSelf,ev))
     245/* define a variety of (possibly ambiguous) short forms */
     246#ifndef SOMGD_pmc_parent_getBpp
     247  #ifdef parent_getBpp
     248    #define SOMGD_pmc_parent_getBpp
     249    #undef parent_getBpp
     250  #else
     251#define parent_getBpp LuPopplerDocument_parent_LuDocument_getBpp
     252  #endif
     253#endif
     254#ifndef SOMGD_pmc_parent_LuDocument_getBpp
     255  #ifdef parent_LuDocument_getBpp
     256    #define SOMGD_pmc_parent_LuDocument_getBpp
     257    #undef parent_LuDocument_getBpp
     258  #else
     259    #define parent_LuDocument_getBpp LuPopplerDocument_parent_LuDocument_getBpp
     260  #endif
     261#endif
     262#define LuPopplerDocument_parents_getBpp(somSelf,ev) (\
     263   LuPopplerDocument_parent_LuDocument_getBpp(somSelf,ev))
     264
     265/*
    225266 * Overridden method: isScalable
    226267 */
     
    12841325    {    &somId_LuPopplerDocumentloadFile,
    12851326         (somMethodProc *) loadFile  },
     1327    {    &somId_LuPopplerDocumentgetBpp,
     1328         (somMethodProc *) getBpp  },
    12861329    {    &somId_LuPopplerDocumentisScalable,
    12871330         (somMethodProc *) isScalable  },
     
    13501393
    13511394static somStaticClassInfo LuPopplerDocumentSCI = {
    1352     4, 0, 27, 0, 0, 0, /* layout version 4 */
     1395    4, 0, 28, 0, 0, 0, /* layout version 4 */
    13531396    LuPopplerDocument_MajorVersion, LuPopplerDocument_MinorVersion,
    13541397    sizeof(LuPopplerDocumentData), LuPopplerDocument_MaxNoMethods, 1,
     
    14441487    LuPopplerDocument_parent_LuDocument_isScalable_resolved =
    14451488        somParentNumResolve(LuPopplerDocumentCClassData.parentMtab, 1, LuDocumentClassData.isScalable);
     1489    LuPopplerDocument_parent_LuDocument_getBpp_resolved =
     1490        somParentNumResolve(LuPopplerDocumentCClassData.parentMtab, 1, LuDocumentClassData.getBpp);
    14461491    LuPopplerDocument_parent_LuDocument_loadFile_resolved =
    14471492        somParentNumResolve(LuPopplerDocumentCClassData.parentMtab, 1, LuDocumentClassData.loadFile);
  • trunk/poppler/mypoppler/goo/GooVector.h

    r2 r27  
    2323    }
    2424
    25    T* copy(T* src1,T* scr2,T* dest){
     25   T* copy(T* src1,T* src2,T* dest){
    2626     T* tmp=src1;
    2727     T* d=dest;
    28       while(tmp!=scr2){
     28      while(tmp!=src2){
    2929        *d=*tmp;
    3030         d++;tmp++;
  • trunk/poppler/mypoppler/poppler/CairoFontEngine.h

    r2 r27  
    3232  Gushort *codeToGID;
    3333  int codeToGIDLen;
    34   double m11, m12, m21, m22;
    3534};
    3635
  • trunk/poppler/mypoppler/poppler/CairoOutputDev.cc

    r2 r27  
    5353  fontEngine = NULL;
    5454  glyphs = NULL;
    55   surface = NULL;
    5655  fill_pattern = NULL;
    5756  stroke_pattern = NULL;
     
    5958  fill_opacity = 1.0;
    6059  textClipPath = NULL;
     60  cairo = NULL;
    6161}
    6262
     
    6666  }
    6767  FT_Done_FreeType(ft_lib);
    68   cairo_surface_destroy (surface);
     68 
     69  if (cairo)
     70    cairo_destroy (cairo);
    6971  cairo_pattern_destroy (stroke_pattern);
    7072  cairo_pattern_destroy (fill_pattern);
    7173}
    7274
    73 void CairoOutputDev::setSurface(cairo_surface_t *surface)
     75void CairoOutputDev::setCairo(cairo_t *cairo)
    7476{
    75   cairo_surface_destroy (this->surface);
    76   cairo_surface_reference (surface);
    77   this->surface = surface;
     77  if (this->cairo != NULL)
     78    cairo_destroy (this->cairo);
     79  if (cairo != NULL)
     80    this->cairo = cairo_reference (cairo);
     81  else
     82    this->cairo = NULL;
    7883}
    7984
     
    8489  }
    8590  fontEngine = new CairoFontEngine(ft_lib);
    86 }
    87 
    88 void CairoOutputDev::startPage(int pageNum, GfxState *state) {
    89   cairo = cairo_create (surface);
    90 }
    91 
    92 void CairoOutputDev::endPage() {
    93   cairo_destroy (cairo);
    9491}
    9592
     
    261258
    262259  needFontUpdate = gFalse;
    263 
    264   if (state->getFont()->getType() == fontType3)
    265     return;
    266260
    267261  currentFont = fontEngine->getFont (state->getFont(), xref);
     
    379373
    380374  glyphs[glyphCount].index = currentFont->getGlyph (code, u, uLen);
    381   state->transform(x, y, &tx, &ty);
     375  state->transform(x - originX, y - originY, &tx, &ty);
    382376  glyphs[glyphCount].x = tx;
    383377  glyphs[glyphCount].y = ty;
     
    452446
    453447void CairoOutputDev::type3D1(GfxState *state, double wx, double wy,
    454                               double llx, double lly, double urx, double ury) {
     448                             double llx, double lly, double urx, double ury) {
    455449}
    456450
     
    529523  image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_A8,
    530524                                               width, height, row_stride);
    531   if (image == NULL)
    532     return;
     525  if (image == NULL) {
     526    delete imgStr;
     527    return;
     528  }
    533529  pattern = cairo_pattern_create_for_surface (image);
    534   if (pattern == NULL)
    535     return;
     530  if (pattern == NULL) {
     531    delete imgStr;
     532    return;
     533  }
    536534
    537535  cairo_matrix_invert (&matrix);
     
    550548  cairo_surface_destroy (image);
    551549  free (buffer);
     550  delete imgStr;
     551}
     552
     553void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
     554                                Stream *str, int width, int height,
     555                                GfxImageColorMap *colorMap,
     556                                Stream *maskStr, int maskWidth,
     557                                int maskHeight, GBool maskInvert)
     558{
     559  ImageStream *maskImgStr;
     560  maskImgStr = new ImageStream(maskStr, maskWidth, 1, 1);
     561  maskImgStr->reset();
     562
     563  int row_stride = (maskWidth + 3) & ~3;
     564  unsigned char *maskBuffer;
     565  maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight);
     566  unsigned char *maskDest;
     567  cairo_surface_t *maskImage;
     568  cairo_pattern_t *maskPattern;
     569  Guchar *pix;
     570  int x, y;
     571
     572  int invert_bit;
     573 
     574  invert_bit = maskInvert ? 1 : 0;
     575
     576  for (y = 0; y < height; y++) {
     577    pix = maskImgStr->getLine();
     578    maskDest = maskBuffer + y * row_stride;
     579    for (x = 0; x < width; x++) {
     580      if (pix[x] ^ invert_bit)
     581        *maskDest++ = 0;
     582      else
     583        *maskDest++ = 255;
     584    }
     585  }
     586
     587  maskImage = cairo_image_surface_create_for_data (maskBuffer, CAIRO_FORMAT_A8,
     588                                                 maskWidth, maskHeight, row_stride);
     589
     590  delete maskImgStr;
     591  maskStr->close();
     592
     593  unsigned char *buffer;
     594  unsigned int *dest;
     595  cairo_surface_t *image;
     596  cairo_pattern_t *pattern;
     597  ImageStream *imgStr;
     598  GfxRGB rgb;
     599  int alpha, i;
     600  double *ctm;
     601  cairo_matrix_t matrix;
     602  cairo_matrix_t maskMatrix;
     603  int is_identity_transform;
     604
     605  buffer = (unsigned char *)gmalloc (width * height * 4);
     606
     607  /* TODO: Do we want to cache these? */
     608  imgStr = new ImageStream(str, width,
     609                           colorMap->getNumPixelComps(),
     610                           colorMap->getBits());
     611  imgStr->reset();
     612 
     613  /* ICCBased color space doesn't do any color correction
     614   * so check its underlying color space as well */
     615  is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB ||
     616                  colorMap->getColorSpace()->getMode() == csICCBased &&
     617                  ((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB;
     618
     619  for (y = 0; y < height; y++) {
     620    dest = (unsigned int *) (buffer + y * 4 * width);
     621    pix = imgStr->getLine();
     622    colorMap->getRGBLine (pix, dest, width);
     623  }
     624
     625  image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_RGB24,
     626                                                 width, height, width * 4);
     627
     628  if (image == NULL) {
     629    delete imgStr;
     630    return;
     631  }
     632  pattern = cairo_pattern_create_for_surface (image);
     633  maskPattern = cairo_pattern_create_for_surface (maskImage);
     634  if (pattern == NULL) {
     635    delete imgStr;
     636    return;
     637  }
     638
     639  ctm = state->getCTM();
     640  LOG (printf ("drawImageMask %dx%d, matrix: %f, %f, %f, %f, %f, %f\n",
     641               width, height, ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]));
     642  matrix.xx = ctm[0] / width;
     643  matrix.xy = -ctm[2] / height;
     644  matrix.yx = ctm[1] / width;
     645  matrix.yy = -ctm[3] / height;
     646  matrix.x0 = ctm[2] + ctm[4];
     647  matrix.y0 = ctm[3] + ctm[5];
     648
     649  maskMatrix.xx = ctm[0] / maskWidth;
     650  maskMatrix.xy = -ctm[2] / maskHeight;
     651  maskMatrix.yx = ctm[1] / maskWidth;
     652  maskMatrix.yy = -ctm[3] / maskHeight;
     653  maskMatrix.x0 = ctm[2] + ctm[4];
     654  maskMatrix.y0 = ctm[3] + ctm[5];
     655
     656  cairo_matrix_invert (&matrix);
     657  cairo_matrix_invert (&maskMatrix);
     658
     659  cairo_pattern_set_matrix (pattern, &matrix);
     660  cairo_pattern_set_matrix (maskPattern, &maskMatrix);
     661
     662  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BILINEAR);
     663  cairo_set_source (cairo, pattern);
     664  cairo_mask (cairo, maskPattern);
     665
     666  cairo_pattern_destroy (maskPattern);
     667  cairo_surface_destroy (maskImage);
     668  cairo_pattern_destroy (pattern);
     669  cairo_surface_destroy (image);
     670  free (buffer);
     671  free (maskBuffer);
    552672  delete imgStr;
    553673}
     
    595715  double *ctm;
    596716  cairo_matrix_t matrix;
     717  cairo_matrix_t maskMatrix;
    597718  int is_identity_transform;
    598719
     
    620741                                                 width, height, width * 4);
    621742
    622   if (image == NULL)
    623     return;
     743  if (image == NULL) {
     744    delete imgStr;
     745    return;
     746  }
    624747  pattern = cairo_pattern_create_for_surface (image);
    625748  maskPattern = cairo_pattern_create_for_surface (maskImage);
    626   if (pattern == NULL)
    627     return;
     749  if (pattern == NULL) {
     750    delete imgStr;
     751    return;
     752  }
    628753
    629754  ctm = state->getCTM();
     
    637762  matrix.y0 = ctm[3] + ctm[5];
    638763
     764  maskMatrix.xx = ctm[0] / maskWidth;
     765  maskMatrix.xy = -ctm[2] / maskHeight;
     766  maskMatrix.yx = ctm[1] / maskWidth;
     767  maskMatrix.yy = -ctm[3] / maskHeight;
     768  maskMatrix.x0 = ctm[2] + ctm[4];
     769  maskMatrix.y0 = ctm[3] + ctm[5];
     770
    639771  cairo_matrix_invert (&matrix);
     772  cairo_matrix_invert (&maskMatrix);
    640773
    641774  cairo_pattern_set_matrix (pattern, &matrix);
    642   cairo_pattern_set_matrix (maskPattern, &matrix);
     775  cairo_pattern_set_matrix (maskPattern, &maskMatrix);
    643776
    644777  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BILINEAR);
     
    720853  }
    721854
    722   if (image == NULL)
    723     return;
     855  if (image == NULL) {
     856   delete imgStr;
     857   return;
     858  }
    724859  pattern = cairo_pattern_create_for_surface (image);
    725   if (pattern == NULL)
    726     return;
     860  if (pattern == NULL) {
     861    delete imgStr;
     862    return;
     863  }
    727864
    728865  ctm = state->getCTM();
  • trunk/poppler/mypoppler/poppler/CairoOutputDev.h

    r2 r27  
    5353  // Does this device use beginType3Char/endType3Char?  Otherwise,
    5454  // text in Type 3 fonts will be drawn with drawChar/drawString.
    55   virtual GBool interpretType3Chars() { return gTrue; }
     55  virtual GBool interpretType3Chars() { return gFalse; }
    5656
    5757  //----- initialization and control
    5858
    5959  // Start a page.
    60   virtual void startPage(int pageNum, GfxState *state);
     60  virtual void startPage(int pageNum, GfxState *state) { }
    6161
    6262  // End a page.
    63   virtual void endPage();
     63  virtual void endPage() { }
    6464
    6565  //----- link borders
     
    125125                                GfxImageColorMap *maskColorMap);
    126126
     127  virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
     128                                int width, int height,
     129                                GfxImageColorMap *colorMap,
     130                                Stream *maskStr,
     131                                int maskWidth, int maskHeight,
     132                                GBool maskInvert);
     133
     134
    127135  //----- Type 3 font operators
    128136  virtual void type3D0(GfxState *state, double wx, double wy);
     
    137145  GBool isReverseVideo() { return gFalse; }
    138146 
    139   void setSurface (cairo_surface_t *surface);
     147  void setCairo (cairo_t *cr);
    140148
    141149protected:
  • trunk/poppler/mypoppler/poppler/Catalog.cc

    r2 r27  
    511511{
    512512  Entry **entry;
     513  char *cname;
    513514
    514515  entry = (Entry **) bsearch(name, entries,
     
    518519    return gTrue;
    519520  } else {
    520     printf("failed to look up %s\n", name->getCString());
     521    cname = name->getCString();
     522    printf("failed to look up %s\n", cname);
     523    delete[] cname;
    521524    obj->initNull();
    522525    return gFalse;
  • trunk/poppler/mypoppler/poppler/FontInfo.cc

    r2 r27  
    153153    name = NULL;
    154154  }
    155  
     155
    156156  // font type
    157157  type = (FontInfo::Type)font->getType();
     
    163163    emb = font->getEmbeddedFontID(&embRef);
    164164  }
     165
     166  if (!emb)
     167  {
     168    DisplayFontParam *dfp = globalParams->getDisplayFont(font);
     169    if (dfp)
     170    {
     171      if (dfp->kind == displayFontT1) file = dfp->t1.fileName->copy();
     172      else file = dfp->tt.fileName->copy();
     173    }
     174    else file = NULL;
     175  }
     176  else file = NULL;
    165177
    166178  // look for a ToUnicode map
     
    186198
    187199FontInfo::FontInfo(FontInfo& f) {
    188   name = f.name->copy();
     200  name = f.name ? f.name->copy() : NULL;
     201  file = f.file ? f.file->copy() : NULL;
    189202  type = f.type;
    190203  emb = f.emb;
     
    196209FontInfo::~FontInfo() {
    197210  delete name;
    198 }
     211  delete file;
     212}
  • trunk/poppler/mypoppler/poppler/FontInfo.h

    r2 r27  
    2626
    2727  GooString *getName()      { return name; };
     28  GooString *getFile()      { return file; };
    2829  Type       getType()      { return type; };
    2930  GBool      getEmbedded()  { return emb; };
     
    3334private:
    3435  GooString *name;
     36  GooString *file;
    3537  Type type;
    3638  GBool emb;
  • trunk/poppler/mypoppler/poppler/Function.cc

    r2 r27  
    391391        idx += idxMul[k] * (e[k][t & 1]);
    392392      }
    393       s[j] = samples[idx];
     393      if (idx >= 0 && idx < nSamples) s[j] = samples[idx];
    394394    }
    395395
  • trunk/poppler/mypoppler/poppler/Gfx.cc

    r2 r27  
    484484  out = outA;
    485485  state = new GfxState(72, 72, box, 0, gFalse);
     486  out->updateAll(state);
    486487  fontChanged = gFalse;
    487488  clip = clipNone;
     
    25242525    fflush(stdout);
    25252526  }
     2527
     2528  font->incRefCnt();
    25262529  state->setFont(font, args[1].getNum());
    25272530  fontChanged = gTrue;
  • trunk/poppler/mypoppler/poppler/GfxFont.cc

    r2 r27  
    149149  stretch = StretchNotDefined;
    150150  weight = WeightNotDefined;
     151  refCnt = 1;
    151152}
    152153
     
    166167    delete extFontFile;
    167168  }
     169}
     170
     171void GfxFont::incRefCnt() {
     172  refCnt++;
     173}
     174
     175void GfxFont::decRefCnt() {
     176  if (--refCnt == 0)
     177    delete this;
    168178}
    169179
     
    458468  int n, i, a, b, m;
    459469
     470  refCnt = 1;
    460471  type = typeA;
    461472  ctu = NULL;
     
    11091120  int excepsSize, i, j, k, n;
    11101121
     1122  refCnt = 1;
    11111123  ascent = 0.95;
    11121124  descent = -0.35;
     
    16211633  for (i = 0; i < numFonts; ++i) {
    16221634    if (fonts[i]) {
    1623       delete fonts[i];
     1635      fonts[i]->decRefCnt();
    16241636    }
    16251637  }
  • trunk/poppler/mypoppler/poppler/GfxFont.h

    r2 r27  
    115115
    116116  GBool isOk() { return ok; }
     117
     118  void incRefCnt();
     119  void decRefCnt();
    117120
    118121  // Get font tag.
     
    216219  double ascent;                // max height above baseline
    217220  double descent;               // max depth below baseline
     221  int refCnt;
    218222  GBool ok;
    219223};
  • trunk/poppler/mypoppler/poppler/GfxState.cc

    r2 r27  
    2222#include "Page.h"
    2323#include "GfxState.h"
     24#include "GfxFont.h"
    2425#include "UGooString.h"
    2526
     
    38503851    delete saved;
    38513852  }
     3853  if (font) {
     3854    font->decRefCnt();
     3855  }
    38523856}
    38533857
     
    38713875    memcpy(lineDash, state->lineDash, lineDashLength * sizeof(double));
    38723876  }
     3877  if (font)
     3878    font->incRefCnt();
     3879
    38733880  saved = NULL;
    38743881}
     
    40384045  }
    40394046  strokePattern = pattern;
     4047}
     4048
     4049void GfxState::setFont(GfxFont *fontA, double fontSizeA) {
     4050  if (font)
     4051    font->decRefCnt();
     4052
     4053  font = fontA;
     4054  fontSize = fontSizeA;
    40404055}
    40414056
  • trunk/poppler/mypoppler/poppler/GfxState.h

    r2 r27  
    11281128  void setLineCap(int lineCap1) { lineCap = lineCap1; }
    11291129  void setMiterLimit(double limit) { miterLimit = limit; }
    1130   void setFont(GfxFont *fontA, double fontSizeA)
    1131     { font = fontA; fontSize = fontSizeA; }
     1130  void setFont(GfxFont *fontA, double fontSizeA);
    11321131  void setTextMat(double a, double b, double c,
    11331132                  double d, double e, double f)
  • trunk/poppler/mypoppler/poppler/JBIG2Stream.cc

    r2 r27  
    12301230  Guint refFlags, nRefSegs;
    12311231  Guint *refSegs;
     1232  int segDataPos;
    12321233  int c1, c2, c3;
    12331234  Guint i;
     
    12961297      goto eofError2;
    12971298    }
     1299
     1300    // keep track of the start of the segment data
     1301    segDataPos = getPos();
    12981302
    12991303    // read the segment data
     
    13741378    }
    13751379
     1380    // Make sure the segment handler read all of the bytes in the
     1381    // segment data, unless this segment is marked as having an
     1382    // unknown length (section 7.2.7 of the JBIG2 Final Committee Draft)
     1383
     1384    if (segLength != 0xffffffff) {
     1385
     1386      int segExtraBytes = segDataPos + segLength - getPos();
     1387      if (segExtraBytes > 0) {
     1388
     1389        // If we didn't read all of the bytes in the segment data,
     1390        // indicate an error, and throw away the rest of the data.
     1391       
     1392        // v.3.1.01.13 of the LuraTech PDF Compressor Server will
     1393        // sometimes generate an extraneous NULL byte at the end of
     1394        // arithmetic-coded symbol dictionary segments when numNewSyms
     1395        // == 0.  Segments like this often occur for blank pages.
     1396       
     1397        error(getPos(), "%d extraneous byte%s after segment",
     1398              segExtraBytes, (segExtraBytes > 1) ? "s" : "");
     1399       
     1400        // Burn through the remaining bytes -- inefficient, but
     1401        // hopefully we're not doing this much
     1402       
     1403        int trash;
     1404        for (int i = segExtraBytes; i > 0; i--) {
     1405          readByte(&trash);
     1406        }
     1407       
     1408      } else if (segExtraBytes < 0) {
     1409       
     1410        // If we read more bytes than we should have, according to the
     1411        // segment length field, note an error.
     1412       
     1413        error(getPos(), "Previous segment handler read too many bytes");
     1414       
     1415      }
     1416
     1417    }
     1418   
    13761419    gfree(refSegs);
    13771420  }
     
    24172460  }
    24182461
     2462  delete skipBitmap;
    24192463  gfree(grayImg);
    24202464
  • trunk/poppler/mypoppler/poppler/Makefile

    r17 r27  
    33CC=wcl386
    44
    5 CFLAGS=-zq -zp=4 -bm -sg -ox -xs -xr -I.. -I..\..\freetype-2.1.10\include -I..\..\fontconfig-2.3.2-os2 -DOS2 -DUSE_ANNOTS_VIEW
     5CFLAGS=-zq -zp=4 -bm -sg -ox -xs -xr -I.. -I..\goo -I..\..\freetype-2.1.10\include -I..\..\fontconfig-2.3.2-os2 -DOS2 -DUSE_ANNOTS_VIEW
    66
    77LIBS=libpoppler.lib
  • trunk/poppler/mypoppler/poppler/Page.cc

    r2 r27  
    392392  annotList = new Annots(xref, catalog, annots.fetch(xref, &obj));
    393393  obj.free();
    394 #ifdef USE_ANNOTS_VIEW
    395394  if (annotList->getNumAnnots() > 0) {
    396395    if (globalParams->getPrintCommands()) {
     
    406405    out->dump();
    407406  }
    408 #endif
    409407  delete annotList;
    410408
  • trunk/poppler/mypoppler/poppler/PageLabelInfo.cc

    r2 r27  
    9292    default:
    9393      if (i > 5) {
    94         str->append(wh[2 * k + 1]);
    95         i -= 5;
     94       str->append(wh[2 * k + 1]);
     95       i -= 5;
    9696      }
    9797      for (j = 0; j < i; j++) {
    98         str->append(wh[2 * k + 0]);
    99       }
    100     }
    101        
     98       str->append(wh[2 * k + 0]);
     99      }
     100    }
     101       
    102102    divisor = divisor / 10;
    103103  }
  • trunk/poppler/mypoppler/poppler/SecurityHandler.cc

    r2 r27  
    1313#endif
    1414
    15 #include "goo/GooString.h"
     15#include "GooString.h"
    1616#include "PDFDoc.h"
    1717#include "Decrypt.h"
  • trunk/poppler/mypoppler/poppler/SecurityHandler.h

    r2 r27  
    1616#endif
    1717
    18 #include "goo/gtypes.h"
     18#include "gtypes.h"
    1919#include "Object.h"
    2020
  • trunk/poppler/mypoppler/poppler/TextOutputDev.cc

    r2 r27  
    498498  xMin = yMin = 0;
    499499  xMax = yMax = -1;
     500  normalized = NULL;
     501  normalized_len = 0;
     502  normalized_idx = NULL;
    500503}
    501504
     
    511514  gfree(edge);
    512515  gfree(col);
     516  if (normalized) {
     517    gfree(normalized);
     518    gfree(normalized_idx);
     519  }
    513520}
    514521
     
    23762383
    23772384  // sort blocks into xy order for column assignment
     2385  if (blocks)
     2386    gfree (blocks);
    23782387  blocks = (TextBlock **)gmallocn(nBlocks, sizeof(TextBlock *));
    23792388  for (blk = blkList, i = 0; blk; blk = blk->next, ++i) {
     
    25132522  blkArray = (TextBlock **)gmallocn(nBlocks, sizeof(TextBlock *));
    25142523  memcpy(blkArray, blocks, nBlocks * sizeof(TextBlock *));
     2524  while (flows) {
     2525    flow = flows;
     2526    flows = flows->next;
     2527    delete flow;
     2528  }
    25152529  flows = lastFlow = NULL;
    25162530  firstBlkIdx = 0;
     
    26532667  // convert the search string to uppercase
    26542668  if (!caseSensitive) {
    2655     s2 = (Unicode *)gmallocn(len, sizeof(Unicode));
     2669    s2 = unicodeNormalizeNFKC(s, len, &len, NULL);
    26562670    for (i = 0; i < len; ++i) {
    2657       s2[i] = unicodeToUpper(s[i]);
     2671      s2[i] = unicodeToUpper(s2[i]);
    26582672    }
    26592673  } else {
    2660     s2 = s;
     2674    s2 = unicodeNormalizeNFKC(s, len, &len, NULL);
    26612675  }
    26622676
     
    27132727      }
    27142728
     2729      if (!line->normalized)
     2730        line->normalized = unicodeNormalizeNFKC(line->text, line->len,
     2731                                                &line->normalized_len,
     2732                                                &line->normalized_idx);
    27152733      // convert the line to uppercase
    2716       m = line->len;
     2734      m = line->normalized_len;
    27172735      if (!caseSensitive) {
    27182736        if (m > txtSize) {
     
    27212739        }
    27222740        for (k = 0; k < m; ++k) {
    2723           txt[k] = unicodeToUpper(line->text[k]);
     2741          txt[k] = unicodeToUpper(line->normalized[k]);
    27242742          }
    27252743          } else {
    2726         txt = line->text;
     2744        txt = line->normalized;
    27272745          }
    27282746
     
    27432761          switch (line->rot) {
    27442762          case 0:
    2745             xMin1 = line->edge[j];
    2746             xMax1 = line->edge[j + len];
     2763            xMin1 = line->edge[line->normalized_idx[j]];
     2764            xMax1 = line->edge[line->normalized_idx[j + len]];
    27472765            yMin1 = line->yMin;
    27482766            yMax1 = line->yMax;
     
    27512769            xMin1 = line->xMin;
    27522770            xMax1 = line->xMax;
    2753             yMin1 = line->edge[j];
    2754             yMax1 = line->edge[j + len];
     2771            yMin1 = line->edge[line->normalized_idx[j]];
     2772            yMax1 = line->edge[line->normalized_idx[j + len]];
    27552773            break;
    27562774          case 2:
    2757             xMin1 = line->edge[j + len];
    2758             xMax1 = line->edge[j];
     2775            xMin1 = line->edge[line->normalized_idx[j + len]];
     2776            xMax1 = line->edge[line->normalized_idx[j]];
    27592777            yMin1 = line->yMin;
    27602778            yMax1 = line->yMax;
     
    27632781            xMin1 = line->xMin;
    27642782            xMax1 = line->xMax;
    2765             yMin1 = line->edge[j + len];
    2766             yMax1 = line->edge[j];
     2783            yMin1 = line->edge[line->normalized_idx[j + len]];
     2784            yMax1 = line->edge[line->normalized_idx[j]];
    27672785            break;
    27682786          }
     
    28082826    }
    28092827
     2828  gfree(s2);
    28102829  if (!caseSensitive) {
    2811     gfree(s2);
    28122830    gfree(txt);
    28132831  }
     
    33603378  state->setFillColor(glyph_color);
    33613379  out->updateFillColor(state);
     3380  word->font->gfxFont->incRefCnt();
    33623381  state->setFont(word->font->gfxFont, word->fontSize);
    33633382  out->updateFont(state);
     
    33753394 
    33763395  out->endString(state);
     3396
     3397  delete string;
    33773398}
    33783399
  • trunk/poppler/mypoppler/poppler/TextOutputDev.h

    r2 r27  
    241241  GBool hyphenated;             // set if last char is a hyphen
    242242  TextLine *next;               // next line in block
     243  Unicode *normalized;          // normalized form of Unicode text
     244  int normalized_len;           // number of normalized Unicode chars
     245  int *normalized_idx;          // indices of normalized chars into Unicode text
    243246
    244247  friend class TextLineFrag;
  • trunk/poppler/mypoppler/poppler/UnicodeTypeTable.cc

    r2 r27  
    1010#include "CharTypes.h"
    1111#include "UnicodeTypeTable.h"
     12#include "goo/gmem.h"
    1213
    1314struct UnicodeMapTableEntry {
     
    948949}
    949950
     951#define UNICODE_LAST_CHAR 0x10FFFF
     952#define UNICODE_MAX_TABLE_INDEX (UNICODE_LAST_CHAR / 256 + 1)
     953// large empty block between U+2FA1D and U+E0001
     954#define UNICODE_LAST_CHAR_PART1 0x2FAFF
     955#define UNICODE_LAST_PAGE_PART1 (UNICODE_LAST_CHAR_PART1 / 256)
     956#define UNICODE_PART2_START 0xE0000
     957
     958#include "UnicodeCClassTables.h"
     959#include "UnicodeCompTables.h"
     960#include "UnicodeDecompTables.h"
     961
     962#define CC_PART1(Page, Char) \
     963  ((combining_class_table_part1[Page] >= UNICODE_MAX_TABLE_INDEX) \
     964   ? (combining_class_table_part1[Page] - UNICODE_MAX_TABLE_INDEX) \
     965   : (cclass_data[combining_class_table_part1[Page]][Char]))
     966
     967#define CC_PART2(Page, Char) \
     968  ((combining_class_table_part2[Page] >= UNICODE_MAX_TABLE_INDEX) \
     969   ? (combining_class_table_part2[Page] - UNICODE_MAX_TABLE_INDEX) \
     970   : (cclass_data[combining_class_table_part2[Page]][Char]))
     971
     972#define COMBINING_CLASS(u) (((u) <= UNICODE_LAST_CHAR_PART1) \
     973    ? CC_PART1((u) / 256, (u) % 256) \
     974    : (((u) >= UNICODE_PART2_START && (u) <= UNICODE_LAST_CHAR) \
     975      ? CC_PART2(((u) - UNICODE_PART2_START) / 256, (u) % 256) \
     976      : 0))
     977
     978// Write the compatibility decomposition of @u into @buf, returning the number
     979// of characters written. @buf may be NULL, in which case the length of the
     980// decomposition is returned but nothing is written. If @u is its own
     981// decomposition, write @u into @buf and return 1.
     982static int decomp_compat(Unicode u, Unicode *buf) {
     983  // decomposition tables stored as lists {character, decomp_length, offset}
     984  // so we do a binary search
     985  int start = 0, end = DECOMP_TABLE_LENGTH;
     986  if (u >= decomp_table[start].character
     987      && u <= decomp_table[end - 1].character)
     988    while (gTrue) {
     989      int midpoint = (start + end) / 2;
     990      if (u == decomp_table[midpoint].character) {
     991        int offset = decomp_table[midpoint].offset;
     992        if (offset == -1)
     993          break;
     994        else {
     995          int length = decomp_table[midpoint].length, i;
     996          if (buf)
     997            for (i = 0; i < length; ++i)
     998              buf[i] = decomp_expansion[offset + i];
     999          return length;
     1000        }
     1001      } else if (midpoint == start)
     1002        break;
     1003      else if (u > decomp_table[midpoint].character)
     1004        start = midpoint;
     1005      else
     1006        end = midpoint;
     1007    }
     1008  if (buf)
     1009    *buf = u;
     1010  return 1;
     1011}
     1012
     1013#define CI(Page, Char) \
     1014  ((compose_table[Page] >= UNICODE_MAX_TABLE_INDEX) \
     1015   ? (compose_table[Page] - UNICODE_MAX_TABLE_INDEX) \
     1016   : (compose_data[compose_table[Page]][Char]))
     1017
     1018#define COMPOSE_INDEX(u) \
     1019     ((((u) / 256) > (COMPOSE_TABLE_LAST)) ? 0 : CI((u) / 256, (u) % 255))
     1020
     1021// If @add combines with @base, write the combination to @out and return
     1022// gTrue. Otherwise return gFalse.
     1023static GBool combine(Unicode base, Unicode add, Unicode *out) {
     1024  unsigned short idx_base, idx_add;
     1025
     1026  idx_base = COMPOSE_INDEX(base);
     1027  if (idx_base >= COMPOSE_FIRST_SINGLE_START
     1028      && idx_base < COMPOSE_SECOND_START) {
     1029    if (compose_first_single[idx_base - COMPOSE_FIRST_SINGLE_START][0]
     1030        == add) {
     1031      *out = compose_first_single[idx_base - COMPOSE_FIRST_SINGLE_START][1];
     1032      return gTrue;
     1033    } else
     1034      return gFalse;
     1035  }
     1036
     1037  idx_add = COMPOSE_INDEX(add);
     1038  if (idx_add >= COMPOSE_SECOND_SINGLE_START) {
     1039    if (compose_second_single[idx_add - COMPOSE_SECOND_SINGLE_START][0]
     1040        == base) {
     1041      *out = compose_second_single[idx_add - COMPOSE_SECOND_SINGLE_START][1];
     1042      return gTrue;
     1043    } else
     1044      return gFalse;
     1045  }
     1046
     1047  if (idx_base >= COMPOSE_FIRST_START && idx_base < COMPOSE_FIRST_SINGLE_START
     1048      && idx_add >= COMPOSE_SECOND_START
     1049      && idx_add < COMPOSE_SECOND_SINGLE_START) {
     1050    Unicode o = compose_array[idx_base - COMPOSE_FIRST_START]
     1051      [idx_add - COMPOSE_SECOND_START];
     1052    if (o) {
     1053      *out = o;
     1054      return gTrue;
     1055    }
     1056  }
     1057
     1058  return gFalse;
     1059}
     1060
     1061#define HANGUL_S_BASE 0xAC00
     1062#define HANGUL_L_BASE 0x1100
     1063#define HANGUL_V_BASE 0x1161
     1064#define HANGUL_T_BASE 0x11A7
     1065#define HANGUL_L_COUNT 19
     1066#define HANGUL_V_COUNT 21
     1067#define HANGUL_T_COUNT 28
     1068#define HANGUL_S_COUNT (HANGUL_L_COUNT * HANGUL_V_COUNT * HANGUL_T_COUNT)
     1069#define HANGUL_N_COUNT (HANGUL_V_COUNT * HANGUL_T_COUNT)
     1070#define HANGUL_IS_L(u) (((u) >= HANGUL_L_BASE) \
     1071    && ((u) < HANGUL_L_BASE + HANGUL_L_COUNT))
     1072#define HANGUL_IS_V(u) (((u) >= HANGUL_V_BASE) \
     1073    && ((u) < HANGUL_V_BASE + HANGUL_V_COUNT))
     1074#define HANGUL_IS_T(u) (((u) >= HANGUL_T_BASE) \
     1075    && ((u) < HANGUL_T_BASE + HANGUL_T_COUNT))
     1076#define HANGUL_IS_SYLLABLE(u) (((u) >= HANGUL_S_BASE) \
     1077    && ((u) < HANGUL_S_BASE + HANGUL_S_COUNT))
     1078#define HANGUL_SYLLABLE_IS_LV(u) (((u) - HANGUL_S_BASE) % HANGUL_T_COUNT == 0)
     1079#define IS_HANGUL(u) (HANGUL_IS_L(u) || HANGUL_IS_V(u) || HANGUL_IS_T(u) \
     1080    || HANGUL_IS_SYLLABLE(u))
     1081#define HANGUL_COMPOSE_L_V(l, v) (HANGUL_S_BASE + (HANGUL_T_COUNT * \
     1082      (((v) - HANGUL_V_BASE) + (HANGUL_V_COUNT * ((l) - HANGUL_L_BASE)))))
     1083#define HANGUL_COMPOSE_LV_T(lv, t) ((lv) + ((t) - HANGUL_T_BASE))
     1084
     1085// Converts Unicode string @in of length @len to its normalization in form
     1086// NFKC (compatibility decomposition + canonical composition). The length of
     1087// the resulting Unicode string is returned in @out_len. If non-NULL, @indices
     1088// is assigned the location of a newly-allocated array of length @out_len + 1,
     1089// for each character in the normalized string giving the index in @in of the
     1090// corresponding unnormalized character. @indices is not guaranteed monotone or
     1091// onto.
     1092Unicode *unicodeNormalizeNFKC(Unicode *in, int len,
     1093                              int *out_len, int **indices) {
     1094  Unicode *out;
     1095  int i, o, *classes, *idx = NULL;
     1096
     1097  for (i = 0, o = 0; i < len; ++i) {
     1098    if (HANGUL_IS_L(in[i]) || HANGUL_IS_SYLLABLE(in[i])) {
     1099      o += 1;
     1100    } else
     1101      o += decomp_compat(in[i], NULL);
     1102  }
     1103 
     1104  out = (Unicode *) gmallocn(o, sizeof(Unicode));
     1105  classes = (int *) gmallocn(o, sizeof(int));
     1106  if (indices)
     1107    idx = (int *) gmallocn(o + 1, sizeof(int));
     1108
     1109  for (i = 0, o = 0; i < len; ) {
     1110    Unicode u = in[i];
     1111    if (IS_HANGUL(u)) {
     1112      if (HANGUL_IS_L(u)) {
     1113        Unicode l = u;
     1114        if (i+1 < len && HANGUL_IS_V(in[i+1])) {
     1115          Unicode lv = HANGUL_COMPOSE_L_V(l, in[++i]);
     1116          if (i+1 < len && HANGUL_IS_T(in[i+1]))
     1117            out[o] = HANGUL_COMPOSE_LV_T(lv, in[++i]);
     1118          else
     1119            out[o] = lv;
     1120        } else
     1121          out[o] = l;
     1122      } else if (HANGUL_SYLLABLE_IS_LV(u)) {
     1123        Unicode lv = u;
     1124        if (i+1 < len && HANGUL_IS_T(in[i+1]))
     1125          out[o] = HANGUL_COMPOSE_LV_T(lv, in[++i]);
     1126        else
     1127          out[o] = lv;
     1128      } else
     1129        out[o] = u;
     1130      if (indices)
     1131        idx[o] = i;
     1132      ++i; ++o;
     1133    } else {
     1134      int j, p, q, r, s, dlen;
     1135      // write compatibility decompositions into out (we have enough space)
     1136      // chomp in until a starter is reached
     1137      for (j = i, p = o; j < len; ++j) {
     1138        u = in[j];
     1139        if (j != i && COMBINING_CLASS(u) == 0)
     1140          break;
     1141        dlen = decomp_compat(u, out + p);
     1142        for (q = p; q < p + dlen; ++q) {
     1143          classes[q] = COMBINING_CLASS(out[q]);
     1144          if (indices)
     1145            idx[q] = j;
     1146        }
     1147        p += dlen;
     1148      }
     1149      // put out[o, p) in canonical ordering
     1150      for (q = o + 1; q < p; ++q)
     1151        for (r = q; r > o + 1; --r) {   // FIXME worth using a better sort?
     1152          int swap;
     1153          if (classes[r] >= classes[r-1])
     1154            break;
     1155          u = out[r]; out[r] = out[r - 1]; out[r - 1] = u;
     1156          swap = classes[r]; classes[r] = classes[r - 1]; classes[r - 1] = swap;
     1157          if (indices)
     1158            swap = idx[r]; idx[r] = idx[r - 1]; idx[r - 1] = swap;
     1159        }
     1160      // canonical compose out[o, p)
     1161      for (q = o + 1; q < p; ++q)
     1162        if (!combine(out[o], out[q], &out[o]))
     1163          break;
     1164      // move out[q, p) back to [o+1, ?)
     1165      if (q != o + 1)
     1166        for (r = q, s = o + 1; r < p; ++r, ++s) {
     1167          out[s] = out[r];
     1168          if (indices)
     1169            idx[s] = idx[r];
     1170        }
     1171      else
     1172        s = p;
     1173      i = j; o = s;
     1174    }
     1175  }
     1176
     1177  *out_len = o;
     1178  gfree(classes);
     1179  if (indices) {
     1180    idx[o] = len;
     1181    *indices = idx;
     1182  }
     1183  return out;
     1184}
  • trunk/poppler/mypoppler/poppler/UnicodeTypeTable.h

    r2 r27  
    1818extern Unicode unicodeToUpper(Unicode c);
    1919
     20extern Unicode *unicodeNormalizeNFKC(Unicode *in, int len,
     21                                     int *out_len, int **offsets);
     22
    2023#endif
  • trunk/poppler/mypoppler/poppler/XRef.cc

    r2 r27  
    938938int XRef::getNumEntry(int offset) const
    939939{
    940   int res = -1;
    941   int resOffset = -1;
    942   XRefEntry e;
    943   for (int i = 0; i < size; ++i)
     940  if (size > 0)
    944941  {
    945     e = entries[i];
    946     if (e.offset < offset && e.offset > resOffset)
     942    int res = 0;
     943    Guint resOffset = entries[0].offset;
     944    XRefEntry e;
     945    for (int i = 1; i < size; ++i)
    947946    {
    948       res = i;
    949       resOffset = e.offset;
    950     }
    951   }
    952   return res;
     947      e = entries[i];
     948      if (e.offset < offset && e.offset >= resOffset)
     949      {
     950        res = i;
     951        resOffset = e.offset;
     952      }
     953    }
     954    return res;
     955  }
     956  else return -1;
    953957}
    954958
  • trunk/poppler/mypoppler/poppler/diff

    r2 r27  
    1 diff -EbBc ./SecurityHandler.cc D:\Projects\poppler\mypoppler\poppler/SecurityHandler.cc
    2 *** ./SecurityHandler.cc        Fri Sep 16 20:29:18 2005
    3 --- D:\Projects\poppler\mypoppler\poppler/SecurityHandler.cc    Mon Jan 30 20:32:06 2006
    4 ***************
    5 *** 12,18 ****
    6   #pragma implementation
    7   #endif
    8  
    9 ! #include "GooString.h"
    10   #include "PDFDoc.h"
    11   #include "Decrypt.h"
    12   #include "Error.h"
    13 --- 12,18 ----
    14   #pragma implementation
    15   #endif
    16  
    17 ! #include "goo/GooString.h"
    18   #include "PDFDoc.h"
    19   #include "Decrypt.h"
    20   #include "Error.h"
    21 diff -EbBc ./SecurityHandler.h D:\Projects\poppler\mypoppler\poppler/SecurityHandler.h
    22 *** ./SecurityHandler.h Fri Sep 16 20:29:18 2005
    23 --- D:\Projects\poppler\mypoppler\poppler/SecurityHandler.h     Mon Jan 30 20:31:30 2006
    24 ***************
    25 *** 15,21 ****
    26   #pragma interface
    27   #endif
    28  
    29 ! #include "gtypes.h"
    30   #include "Object.h"
    31  
    32   class GooString;
    33 --- 15,21 ----
    34   #pragma interface
    35   #endif
    36  
    37 ! #include "goo/gtypes.h"
    38   #include "Object.h"
    39  
    40   class GooString;
    411diff -EbBc ./poppler-config.h D:\Projects\poppler\mypoppler\poppler/poppler-config.h
    422*** ./poppler-config.h  Mon Dec 12 21:21:44 2005
  • trunk/poppler/mypoppler/poppler/poppler-config.h

    r2 r27  
    1818/* Enable multithreading support. */
    1919#ifndef MULTITHREADING
    20 #define MULTITHREADED 0
     20#define MULTITHREADED 1
    2121#endif
    2222
  • trunk/poppler/mypoppler/splash/Splash.cc

    r2 r27  
    320320        p = row;
    321321        for (x = 0; x < bitmap->width; ++x) {
     322          *p++ = color[2];
     323          *p++ = color[1];
    322324          *p++ = color[0];
    323           *p++ = color[1];
    324           *p++ = color[2];
     325          *p++ = 255;
    325326        }
    326327        row += bitmap->rowSize;
     
    964965      case splashModeRGB8:
    965966      case splashModeBGR8:
    966         p = &bitmap->data[y * bitmap->rowSize + 3 * x];
     967        p = &bitmap->data[y * bitmap->rowSize + 4 * x];
    967968        (*blendFunc)(color, p, blend, bitmap->mode);
    968         p[0] = (alpha2 * blend[0] + ialpha2 * p[0]) >> 8;
     969        p[0] = (alpha2 * blend[2] + ialpha2 * p[0]) >> 8;
    969970        p[1] = (alpha2 * blend[1] + ialpha2 * p[1]) >> 8;
    970         p[2] = (alpha2 * blend[2] + ialpha2 * p[2]) >> 8;
     971        p[2] = (alpha2 * blend[0] + ialpha2 * p[2]) >> 8;
    971972        break;
    972973      case splashModeARGB8:
     
    10151016      case splashModeRGB8:
    10161017      case splashModeBGR8:
    1017         p = &bitmap->data[y * bitmap->rowSize + 3 * x];
    1018         p[0] = color[0];
     1018        p = &bitmap->data[y * bitmap->rowSize + 4 * x];
     1019        p[0] = color[2];
    10191020        p[1] = color[1];
    1020         p[2] = color[2];
     1021        p[2] = color[0];
    10211022        break;
    10221023      case splashModeARGB8:
     
    10931094      case splashModeRGB8:
    10941095      case splashModeBGR8:
    1095         p = &bitmap->data[y * bitmap->rowSize + 3 * x];
     1096        p = &bitmap->data[y * bitmap->rowSize + 4 * x];
    10961097        (*blendFunc)(color, p, blend, bitmap->mode);
    1097         p[0] = (alpha2 * blend[0] + ialpha2 * p[0]) >> 8;
     1098        p[0] = (alpha2 * blend[2] + ialpha2 * p[0]) >> 8;
    10981099        p[1] = (alpha2 * blend[1] + ialpha2 * p[1]) >> 8;
    1099         p[2] = (alpha2 * blend[2] + ialpha2 * p[2]) >> 8;
     1100        p[2] = (alpha2 * blend[0] + ialpha2 * p[2]) >> 8;
    11001101        break;
    11011102      case splashModeARGB8:
     
    11451146      case splashModeRGB8:
    11461147      case splashModeBGR8:
    1147         p = &bitmap->data[y * bitmap->rowSize + 3 * x];
    1148         p[0] = color[0];
     1148        p = &bitmap->data[y * bitmap->rowSize + 4 * x];
     1149        p[0] = color[2];
    11491150        p[1] = color[1];
    1150         p[2] = color[2];
     1151        p[2] = color[0];
    11511152        break;
    11521153      case splashModeARGB8:
     
    14061407    case splashModeRGB8:
    14071408    case splashModeBGR8:
    1408       p = &bitmap->data[y * bitmap->rowSize + 3 * x0];
     1409      p = &bitmap->data[y * bitmap->rowSize + 4 * x0];
    14091410      if (pattern->isStatic()) {
    14101411        pattern->getColor(0, 0, color);
     
    14171418            }
    14181419            (*blendFunc)(color, p, blend, bitmap->mode);
    1419             p[0] = (alpha2 * blend[0] + ialpha2 * p[0]) >> 8;
     1420            p[0] = (alpha2 * blend[2] + ialpha2 * p[0]) >> 8;
    14201421            p[1] = (alpha2 * blend[1] + ialpha2 * p[1]) >> 8;
    1421             p[2] = (alpha2 * blend[2] + ialpha2 * p[2]) >> 8;
     1422            p[2] = (alpha2 * blend[0] + ialpha2 * p[2]) >> 8;
    14221423            if (!noClip) {
    14231424              updateModX(x0 + i);
     
    14251426            }
    14261427          }
    1427           p += 3;
     1428          p += 4;
    14281429        }
    14291430      } else {
     
    14451446            }
    14461447          }
    1447           p += 3;
     1448          p += 4;
    14481449        }
    14491450      }
     
    16991700    case splashModeRGB8:
    17001701    case splashModeBGR8:
    1701       p = &bitmap->data[y * bitmap->rowSize + 3 * x0];
     1702      p = &bitmap->data[y * bitmap->rowSize + 4 * x0];
    17021703      if (pattern->isStatic()) {
    17031704        pattern->getColor(0, 0, color);
    17041705        for (i = 0; i < n; ++i) {
    17051706          if (noClip || state->clip->test(x0 + i, y)) {
    1706             p[0] = color[0];
     1707            p[0] = color[2];
    17071708            p[1] = color[1];
    1708             p[2] = color[2];
     1709            p[2] = color[0];
    17091710            if (!noClip) {
    17101711              updateModX(x0 + i);
     
    17121713            }
    17131714          }
    1714           p += 3;
     1715          p += 4;
    17151716        }
    17161717      } else {
     
    17261727            }
    17271728          }
    1728           p += 3;
     1729          p += 4;
    17291730        }
    17301731      }
     
    18991900  case splashModeRGB8:
    19001901  case splashModeBGR8:
    1901     p = &bitmap->data[y * bitmap->rowSize + 3 * x0];
     1902    p = &bitmap->data[y * bitmap->rowSize + 4 * x0];
    19021903    for (i = 0; i < n; ++i) {
    19031904      if (noClip || state->clip->test(x0 + i, y)) {
    19041905        pattern->getColor(x0 + i, y, color);
    1905         p[0] ^= color[0];
     1906        p[0] ^= color[2];
    19061907        p[1] ^= color[1];
    1907         p[2] ^= color[2];
     1908        p[2] ^= color[0];
    19081909        if (!noClip) {
    19091910          updateModX(x0 + i);
     
    19111912        }
    19121913      }
    1913       p += 3;
     1914      p += 4;
    19141915    }
    19151916    break;
     
    20562057                case splashModeRGB8:
    20572058                case splashModeBGR8:
    2058                   pix = &bitmap->data[y1 * bitmap->rowSize + 3 * x1];
     2059                  pix = &bitmap->data[y1 * bitmap->rowSize + 4 * x1];
    20592060                  (*blendFunc)(fg, pix, blend, bitmap->mode);
    2060                   pix[0] = (alpha * blend[0] + ialpha * pix[0]) >> 8;
     2061                  pix[0] = (alpha * blend[2] + ialpha * pix[0]) >> 8;
    20612062                  pix[1] = (alpha * blend[1] + ialpha * pix[1]) >> 8;
    2062                   pix[2] = (alpha * blend[2] + ialpha * pix[2]) >> 8;
     2063                  pix[2] = (alpha * blend[0] + ialpha * pix[2]) >> 8;
    20632064                  break;
    20642065                case splashModeARGB8:
     
    21372138                  case splashModeRGB8:
    21382139                  case splashModeBGR8:
    2139                     pix = &bitmap->data[y1 * bitmap->rowSize + 3 * x1];
     2140                    pix = &bitmap->data[y1 * bitmap->rowSize + 4 * x1];
    21402141                    (*blendFunc)(fg, pix, blend, bitmap->mode);
    2141                     pix[0] = (alpha * blend[0] + ialpha * pix[0]) >> 8;
     2142                    pix[0] = (alpha * blend[2] + ialpha * pix[0]) >> 8;
    21422143                    pix[1] = (alpha * blend[1] + ialpha * pix[1]) >> 8;
    2143                     pix[2] = (alpha * blend[2] + ialpha * pix[2]) >> 8;
     2144                    pix[2] = (alpha * blend[0] + ialpha * pix[2]) >> 8;
    21442145                    break;
    21452146                  case splashModeARGB8:
     
    22122213                case splashModeRGB8:
    22132214                case splashModeBGR8:
    2214                   pix = &bitmap->data[y1 * bitmap->rowSize + 3 * x1];
    2215                   pix[0] = (alpha * fg[0] + ialpha * pix[0]) >> 8;
     2215                  pix = &bitmap->data[y1 * bitmap->rowSize + 4 * x1];
     2216                  pix[0] = (alpha * fg[2] + ialpha * pix[0]) >> 8;
    22162217                  pix[1] = (alpha * fg[1] + ialpha * pix[1]) >> 8;
    2217                   pix[2] = (alpha * fg[2] + ialpha * pix[2]) >> 8;
     2218                  pix[2] = (alpha * fg[0] + ialpha * pix[2]) >> 8;
    22182219                  break;
    22192220                case splashModeARGB8:
     
    22772278                  case splashModeRGB8:
    22782279                  case splashModeBGR8:
    2279                     pix = &bitmap->data[y1 * bitmap->rowSize + 3 * x1];
    2280                     pix[0] = fg[0];
     2280                    pix = &bitmap->data[y1 * bitmap->rowSize + 4 * x1];
     2281                    pix[0] = fg[2];
    22812282                    pix[1] = fg[1];
    2282                     pix[2] = fg[2];
     2283                    pix[2] = fg[0];
    22832284                    break;
    22842285                  case splashModeARGB8:
  • trunk/poppler/mypoppler/splash/SplashBitmap.cc

    r2 r27  
    3737  case splashModeRGB8:
    3838  case splashModeBGR8:
    39     rowSize = width * 3;
     39    rowSize = width * 4;
    4040    break;
    4141  case splashModeARGB8:
     
    129129        fputc(splashRGB8G(p), f);
    130130        fputc(splashRGB8B(p), f);
    131         p += 3;
     131        p += 4;
    132132      }
    133133      row += rowSize;
     
    214214  case splashModeRGB8:
    215215  case splashModeBGR8:
    216     p = &data[y * rowSize + 3 * x];
    217     pixel[0] = p[0];
    218     pixel[1] = p[1];
    219     pixel[2] = p[2];
     216    p = &data[y * rowSize + 4 * x];
     217    pixel[0] = p[2];
     218    pixel[1] = p[1];
     219    pixel[2] = p[0];
    220220    break;
    221221  case splashModeARGB8:
  • trunk/poppler/mypoppler/splash/SplashFTFont.cc

    r2 r27  
    5454{
    5555  FT_Face face;
    56   SplashCoord size, div;
     56  double size, div;
    5757  int x, y;
    5858
Note: See TracChangeset for help on using the changeset viewer.