Changeset 1937 for trunk/src


Ignore:
Timestamp:
Dec 2, 1999, 2:26:05 PM (26 years ago)
Author:
achimha
Message:

changes from Markus

Location:
trunk/src/gdi32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibsect.cpp

    r1830 r1937  
    1 /* $Id: dibsect.cpp,v 1.9 1999-11-24 19:30:18 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.10 1999-12-02 13:26:04 achimha Exp $ */
    22
    33/*
     
    228228//******************************************************************************
    229229//******************************************************************************
    230 BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nWidth,
    231                         int nHeight, int nXsrc, int nYsrc, DWORD Rop)
     230BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nDestWidth,
     231                        int nDestHeight, int nXsrc, int nYsrc,
     232                        int nSrcWidth, int nSrcHeight, DWORD Rop)
    232233{
    233234 HPS    hps = (HPS)hdcDest;
     
    237238  HWND hwndDest = WindowFromDC(hdcDest);
    238239  hwndDest = Win32ToOS2Handle(hwndDest);
    239   if(hwndDest != 0) {
    240          hps = WinGetPS(hwndDest);
    241   }
    242   if(hps == 0) {
    243         eprintf(("DIBSection::BitBlt, hps == 0 hwndDest = %X", hwndDest));
    244         return(FALSE);
    245   }
    246 
    247   dprintf(("DIBSection::BitBlt %X %x (%d,%d) to (%d,%d) (%d,%d) rop %x\n", hdcDest, hwndDest, nXdest, nYdest, nWidth, nHeight, nXsrc, nYsrc, Rop));
     240  if(hwndDest != 0)
     241  {
     242    hps = WinGetPS(hwndDest);
     243  }
     244  if(hps == 0)
     245  {
     246    eprintf(("DIBSection::BitBlt, hps == 0 hwndDest = %X", hwndDest));
     247    return(FALSE);
     248  }
     249
     250  dprintf(("DIBSection::BitBlt %X %x to(%d,%d)(%d,%d) from (%d,%d)(%d,%d) rop %x\n",
     251          hdcDest, hwndDest, nXdest, nYdest, nDestWidth, nDestHeight,
     252          nXsrc, nYsrc, nSrcWidth, nSrcHeight, Rop));
    248253
    249254  point[0].x = nXdest;
    250255  point[0].y = nYdest;
    251   point[1].x = nXdest + nWidth - 1;
    252   point[1].y = nYdest + nHeight - 1;
     256  point[1].x = nXdest + nDestWidth - 1;
     257  point[1].y = nYdest + nDestHeight - 1;
    253258  point[2].x = nXsrc;
    254259  point[2].y = nYsrc;
    255   if(nXsrc + nWidth > pOS2bmp->cx) {
    256         point[3].x = pOS2bmp->cx;
    257   }
    258   else  point[3].x = nXsrc + nWidth;
    259 
    260   if(nYsrc + nHeight > pOS2bmp->cy) {
    261         point[3].y = pOS2bmp->cy;
    262   }
    263   else  point[3].y = nYsrc + nHeight;
     260  if(nXsrc + nSrcWidth > pOS2bmp->cx)
     261  {
     262    point[3].x = pOS2bmp->cx;
     263  }
     264  else
     265    point[3].x = nXsrc + nSrcWidth;
     266
     267  if(nYsrc + nSrcHeight > pOS2bmp->cy)
     268  {
     269    point[3].y = pOS2bmp->cy;
     270  }
     271  else
     272    point[3].y = nYsrc + nSrcHeight;
    264273
    265274#if 1
    266   if(fFlip & FLIP_VERT) {
    267         GpiEnableYInversion(hps, nHeight);
    268   }
    269 
    270   if(fFlip & FLIP_HOR) {
     275  if(fFlip & FLIP_VERT)
     276  {
     277    GpiEnableYInversion(hps, nDestHeight);
     278  }
     279
     280  if(fFlip & FLIP_HOR)
     281  {
    271282    ULONG x;
    272         x = point[0].x;
    273         point[0].x = point[1].x;
    274         point[1].x = x;
     283    x = point[0].x;
     284    point[0].x = point[1].x;
     285    point[1].x = x;
    275286  }
    276287#endif
     
    278289  rc = GpiDrawBits(hps, bmpBits, pOS2bmp, 4, &point[0], ROP_SRCCOPY, BBO_OR);
    279290
    280   if(hwndDest != 0) {
    281           WinReleasePS(hps);
     291  if(hwndDest != 0)
     292  {
     293    WinReleasePS(hps);
    282294  }
    283295  if(rc == GPI_OK)
    284         return(TRUE);
     296    return(TRUE);
     297
    285298  dprintf(("DIBSection::BitBlt %X (%d,%d) (%d,%d) to (%d,%d) (%d,%d) returned %d\n", hps, point[0].x, point[0].y, point[1].x, point[1].y, point[2].x, point[2].y, point[3].x, point[3].y, rc));
    286299  dprintf(("WinGetLastError returned %X\n", WinGetLastError(WinQueryAnchorBlock(hwndDest)) & 0xFFFF));
     
    347360    pDIBSection->dsBm.bmBitsPixel  = pOS2bmp->cBitCount;
    348361    pDIBSection->dsBm.bmBits       = bmpBits;
    349         // BITMAPINFOHEADER     data
    350         pDIBSection->dsBmih.biSize = sizeof(BITMAPINFOHEADER);
     362    // BITMAPINFOHEADER data
     363    pDIBSection->dsBmih.biSize = sizeof(BITMAPINFOHEADER);
    351364    pDIBSection->dsBmih.biWidth       = pOS2bmp->cx;
    352365    pDIBSection->dsBmih.biHeight      = pOS2bmp->cy;
     
    364377    pDIBSection->dsBitfields[2] = 0;
    365378
    366         pDIBSection->dshSection = this->handle;
    367        
    368         pDIBSection->dsOffset = 0; // TODO: put the correct value here
    369        
    370         return 0; //ERROR_SUCCESS
     379    pDIBSection->dshSection = this->handle;
     380
     381    pDIBSection->dsOffset = 0; // TODO: put the correct value here
     382
     383    return 0; //ERROR_SUCCESS
    371384  }
    372385  return 87;    //ERROR_INVALID_PARAMETER
  • trunk/src/gdi32/dibsect.h

    r1830 r1937  
    1 /* $Id: dibsect.h,v 1.6 1999-11-24 19:30:18 sandervl Exp $ */
     1/* $Id: dibsect.h,v 1.7 1999-12-02 13:26:05 achimha Exp $ */
    22
    33/*
     
    5151typedef struct
    5252{
    53         WINBITMAP               dsBm;
    54         WINBITMAPINFOHEADER     dsBmih;
    55         DWORD                   dsBitfields[3];
    56         HANDLE          dshSection;
    57         DWORD                   dsOffset;
     53  WINBITMAP   dsBm;
     54  WINBITMAPINFOHEADER dsBmih;
     55  DWORD     dsBitfields[3];
     56  HANDLE    dshSection;
     57  DWORD     dsOffset;
    5858} DIBSECTION,*LPDIBSECTION;
    5959#endif
     
    7171
    7272              BOOL  BitBlt(HDC hdcDest, int nXdest, int nYDest,
    73                            int nWidth, int nHeight, int nXsrc, int nYSrc, DWORD Rop);
     73                           int nDestWidth, int nDestHeight,
     74                           int nXsrc, int nYSrc,
     75                           int nSrcWidth, int nSrcHeight,
     76                           DWORD Rop);
    7477
    7578               int  SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb);
    7679
    77                int  SetDIBits(HDC hdc, HBITMAP hbitmap, UINT startscan, UINT
     80         int  SetDIBits(HDC hdc, HBITMAP hbitmap, UINT startscan, UINT
    7881                              lines, const VOID *bits, WINBITMAPINFOHEADER *pbmi,
    7982                              UINT coloruse);
     
    102105#endif
    103106
     107
Note: See TracChangeset for help on using the changeset viewer.