Changeset 27 for trunk/Lucide/SOURCE


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
Files:
23 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);
Note: See TracChangeset for help on using the changeset viewer.