Changeset 1966 for trunk/src


Ignore:
Timestamp:
Dec 4, 1999, 2:53:14 PM (26 years ago)
Author:
hugh
Message:

Implemented DEFAULT_GUI_FONT for GetStockObject
DIBSecttion now get the DC Palette on creation and updated if DC pal changes.

Location:
trunk/src/gdi32
Files:
4 edited

Legend:

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

    r1937 r1966  
    1 /* $Id: dibsect.cpp,v 1.10 1999-12-02 13:26:04 achimha Exp $ */
     1/* $Id: dibsect.cpp,v 1.11 1999-12-04 13:53:12 hugh Exp $ */
    22
    33/*
     
    101101   dprintf(("pOS2bmp->ulCompression %d\n", pOS2bmp->ulCompression));
    102102   dprintf(("pOS2bmp->cbImage       %d\n", pOS2bmp->cbImage));
     103   dprintf(("Bits at 0x%08X\n",bmpBits));
    103104
    104105   this->handle = handle;
     
    123124     dsect->next = this;
    124125   }
     126
    125127   dprintf(("Class created"));
    126128}
     
    134136        free(pOS2bmp);
    135137
    136    if(section == this) {
    137         section = this->next;
    138    }
    139    else {
    140         DIBSection *dsect = section;
    141 
    142         while(dsect->next != this) {
    143                 dsect = dsect->next;
    144         }
    145         dsect->next = this->next;
     138   if(section == this)
     139   {
     140     section = this->next;
     141   }
     142   else
     143   {
     144     DIBSection *dsect = section;
     145
     146     while(dsect->next != this)
     147     {
     148       dsect = dsect->next;
     149     }
     150     dsect->next = this->next;
    146151   }
    147152}
     
    161166  switch(pbmi->biBitCount)
    162167  {
    163         case 1:
    164                 bmpsize /= 8;
    165                 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
    166                 os2bmpsize += palsize;
    167                 break;
    168         case 4:
    169                 bmpsize /= 2;
    170                 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
    171                 os2bmpsize += palsize;
    172                 break;
    173         case 8:
    174                 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
    175                 os2bmpsize += palsize;
    176                 break;
    177         case 16:
    178                 bmpsize *= 2;
    179                 break;
    180         case 24:
    181                 bmpsize *= 3;
    182                 break;
    183         case 32:
    184                 bmpsize *= 4;
    185                 break;
    186    }
    187    if(bmpsize & 3) {
    188         bmpsize = (bmpsize + 3) & ~3;
     168    case 1:
     169      bmpsize /= 8;
     170      palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
     171      os2bmpsize += palsize;
     172      break;
     173    case 4:
     174      bmpsize /= 2;
     175      palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
     176      os2bmpsize += palsize;
     177      break;
     178    case 8:
     179      palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2);
     180      os2bmpsize += palsize;
     181      break;
     182    case 16:
     183      bmpsize *= 2;
     184      break;
     185    case 24:
     186      bmpsize *= 3;
     187      break;
     188    case 32:
     189      bmpsize *= 4;
     190      break;
     191   }
     192
     193   if(bmpsize & 3)
     194   {
     195     bmpsize = (bmpsize + 3) & ~3;
    189196   }
    190197
     
    216223 int i;
    217224
    218   if(startIdx + cEntries > (1 << pOS2bmp->cBitCount)) {
    219         dprintf(("DIBSection::SetDIBColorTable, invalid nr of entries %d %d\n", startIdx, cEntries));
    220         return(0);
    221   }
     225  if(startIdx + cEntries > (1 << pOS2bmp->cBitCount))
     226  {
     227    dprintf(("DIBSection::SetDIBColorTable, invalid nr of entries %d %d\n", startIdx, cEntries));
     228    return(0);
     229  }
     230
    222231  memcpy(&pOS2bmp->argbColor[startIdx], rgb, cEntries*sizeof(RGB2));
    223   for(i=startIdx;i<cEntries;i++) {
    224         pOS2bmp->argbColor[i].fcOptions = 0;
    225   }
     232
     233  for(i=startIdx;i<cEntries;i++)
     234  {
     235    pOS2bmp->argbColor[i].fcOptions = 0;
     236    dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&pOS2bmp->argbColor[i])) ));
     237  }
     238
    226239  return(cEntries);
    227240}
     
    306319  this->hdc  = hdc;
    307320  hwndParent = WinWindowFromDC(hdc);
     321  dprintf(("SelectDIBObject(0x%08X) hwndParent = 0x%08X\n",hdc, hwndParent));
    308322}
    309323//******************************************************************************
     
    313327 DIBSection *dsect = section;
    314328
    315   while(dsect) {
    316         if(dsect->handle == handle) {
    317                 return(dsect);
    318         }
    319         dsect = dsect->next;
     329  while(dsect)
     330  {
     331    if(dsect->handle == handle)
     332    {
     333      return(dsect);
     334    }
     335    dsect = dsect->next;
    320336  }
    321337  return(NULL);
     
    328344 DIBSection *dsect = section;
    329345
    330   while(dsect) {
    331         if(dsect->hdc == hdc) {
    332                 return(dsect);
    333         }
    334         dsect = dsect->next;
     346  while(dsect)
     347  {
     348    if(dsect->hdc == hdc)
     349    {
     350      return(dsect);
     351    }
     352    dsect = dsect->next;
    335353  }
    336354  return(NULL);
     
    343361
    344362  if(dsect)
    345         delete dsect;
    346 
    347 }
    348 //******************************************************************************
    349 //******************************************************************************
    350 int DIBSection::GetDIBSection(int iSize , DIBSECTION *pDIBSection){
     363    delete dsect;
     364
     365}
     366//******************************************************************************
     367//******************************************************************************
     368int DIBSection::GetDIBSection(int iSize , DIBSECTION *pDIBSection)
     369{
    351370  if( (sizeof(DIBSECTION)==iSize) &&
    352371      (pDIBSection !=NULL))
     
    388407//******************************************************************************
    389408//******************************************************************************
     409char  DIBSection::GetBitCount()
     410{
     411   if(NULL==pOS2bmp)
     412     return 0;
     413   else
     414     return pOS2bmp->cBitCount;
     415}
     416//******************************************************************************
     417//******************************************************************************
    390418DIBSection *DIBSection::section = NULL;
    391 
  • trunk/src/gdi32/dibsect.h

    r1937 r1966  
    1 /* $Id: dibsect.h,v 1.7 1999-12-02 13:26:05 achimha Exp $ */
     1/* $Id: dibsect.h,v 1.8 1999-12-04 13:53:14 hugh Exp $ */
    22
    33/*
     
    1010
    1111#ifdef OS2_ONLY
    12 typedef struct {
     12typedef struct
     13{
    1314  BYTE rgbBlue;
    1415  BYTE rgbGreen;
     
    6768              char *GetDIBObject()           { return bmpBits;  };
    6869              void  SelectDIBObject(HDC hdc);
    69 
     70              char  GetBitCount();
    7071              void  UnSelectDIBObject()      { this->hdc = 0;   };
    7172
  • trunk/src/gdi32/font.cpp

    r1707 r1966  
    1 /* $Id: font.cpp,v 1.6 1999-11-11 19:09:34 sandervl Exp $ */
     1/* $Id: font.cpp,v 1.7 1999-12-04 13:53:12 hugh Exp $ */
    22
    33/*
     
    3737
    3838typedef struct {
    39         DWORD userProc;
    40         DWORD userData;
    41         DWORD dwFlags;
     39  DWORD userProc;
     40  DWORD userData;
     41  DWORD dwFlags;
    4242} ENUMUSERDATA;
    4343
     
    7272  { HANGEUL_CHARSET, 949, FS(19)},
    7373  { CHINESEBIG5_CHARSET, 950, FS(20)},
    74   { JOHAB_CHARSET, 1361, FS(21)}, 
     74  { JOHAB_CHARSET, 1361, FS(21)},
    7575  /* reserved for alternate ANSI and OEM */
    7676  { DEFAULT_CHARSET, 0, FS(0)},
     
    266266{
    267267 ENUMUSERDATA *lpEnumData = (ENUMUSERDATA *)arg4;
    268  FONTENUMPROCA proc = (FONTENUMPROCA)lpEnumData->userProc; 
     268 FONTENUMPROCA proc = (FONTENUMPROCA)lpEnumData->userProc;
    269269
    270270  return proc(lpLogFont, lpTextM, arg3, lpEnumData->userData);
     
    276276{
    277277 ENUMUSERDATA *lpEnumData = (ENUMUSERDATA *)arg4;
    278  FONTENUMPROCW proc = (FONTENUMPROCW)lpEnumData->userProc; 
     278 FONTENUMPROCW proc = (FONTENUMPROCW)lpEnumData->userProc;
    279279 ENUMLOGFONTW LogFont;
    280280 NEWTEXTMETRICW textM;
     
    321321{
    322322 ENUMUSERDATA *lpEnumData = (ENUMUSERDATA *)arg4;
    323  FONTENUMPROCEXA proc = (FONTENUMPROCEXA)lpEnumData->userProc; 
     323 FONTENUMPROCEXA proc = (FONTENUMPROCEXA)lpEnumData->userProc;
    324324 ENUMLOGFONTEXA logFont;
    325325 NEWTEXTMETRICEXA textM;
     
    340340{
    341341 ENUMUSERDATA *lpEnumData = (ENUMUSERDATA *)arg4;
    342  FONTENUMPROCEXW proc = (FONTENUMPROCEXW)lpEnumData->userProc; 
     342 FONTENUMPROCEXW proc = (FONTENUMPROCEXW)lpEnumData->userProc;
    343343 ENUMLOGFONTEXW LogFont;
    344344 NEWTEXTMETRICEXW textM;
     
    598598 * Fills a CHARSETINFO structure for a character set, code page, or
    599599 * font. This allows making the correspondance between different labelings
    600  * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges) 
     600 * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges)
    601601 * of the same encoding.
    602602 *
     
    613613       if flags == TCI_SRCCHARSET: a character set value
    614614       if flags == TCI_SRCCODEPAGE: a code page value
    615                 */
     615    */
    616616  LPCHARSETINFO lpCs, /* structure to receive charset information */
    617617  DWORD flags /* determines interpretation of lpSrc */
     
    620620    switch (flags) {
    621621    case TCI_SRCFONTSIG:
    622         while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++;
     622  while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++;
    623623      break;
    624624    case TCI_SRCCODEPAGE:
  • trunk/src/gdi32/gdi32.cpp

    r1961 r1966  
    1 /* $Id: gdi32.cpp,v 1.22 1999-12-03 17:31:49 cbratschi Exp $ */
     1/* $Id: gdi32.cpp,v 1.23 1999-12-04 13:53:12 hugh Exp $ */
    22
    33/*
     
    149149//******************************************************************************
    150150//******************************************************************************
     151
     152static hFntDefaultGui = NULL;
    151153HGDIOBJ WIN32API GetStockObject(int arg1)
    152154{
    153155 HGDIOBJ obj;
    154156
    155     switch(arg1) {
     157    switch(arg1)
     158    {
    156159        case DEFAULT_GUI_FONT:
    157                 obj = NULL;
     160                if(NULL==hFntDefaultGui)
     161                  hFntDefaultGui = CreateFontA( 0, 0, 0, 0, FW_MEDIUM, FALSE,
     162                                                FALSE, FALSE, ANSI_CHARSET,
     163                                                OUT_DEFAULT_PRECIS,
     164                                                CLIP_DEFAULT_PRECIS,
     165                                                DEFAULT_QUALITY,
     166                                                FIXED_PITCH|FF_MODERN, "WarpSans");
     167                obj = hFntDefaultGui;
    158168                break;
    159169        default:
     
    168178UINT WIN32API RealizePalette( HDC arg1)
    169179{
    170     dprintf(("GDI32: RealizePalette\n"));
     180    dprintf(("GDI32: RealizePalette(0x%08X)\n",arg1));
    171181    return O32_RealizePalette(arg1);
    172182}
     
    176186{
    177187
    178     if(DIBSection::getSection() != NULL)
     188  if(DIBSection::getSection() != NULL)
     189  {
     190    DIBSection *dsect = DIBSection::find(arg1);
     191    if(dsect)
    179192    {
    180       DIBSection *dsect = DIBSection::find(arg1);
    181       if(dsect)
    182       {
    183         return dsect->GetDIBSection(arg2, (DIBSECTION*)arg3);
    184       }
     193      return dsect->GetDIBSection(arg2, (DIBSECTION*)arg3);
    185194    }
    186 
    187     dprintf(("GDI32: GetObject %X %X %X\n", arg1, arg2, arg3));
    188     return O32_GetObject(arg1, arg2, arg3);
     195  }
     196
     197  dprintf(("GDI32: GetObject %X %X %X\n", arg1, arg2, arg3));
     198  return O32_GetObject(arg1, arg2, arg3);
    189199}
    190200//******************************************************************************
     
    214224HPALETTE WIN32API CreatePalette( const LOGPALETTE * arg1)
    215225{
     226  HPALETTE rc;
    216227    dprintf(("GDI32: CreatePalette\n"));
    217     return O32_CreatePalette(arg1);
     228   for(int i=0; i<arg1->palNumEntries;i++)
     229   {
     230     dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) ));
     231   }
     232   rc = O32_CreatePalette(arg1);
     233   dprintf(("  returns 0x%08X\n",rc));
     234
     235   return rc;
    218236}
    219237//******************************************************************************
     
    266284HBITMAP WIN32API CreateDIBitmap(HDC arg1, const BITMAPINFOHEADER * arg2, DWORD arg3, const void * arg4, const BITMAPINFO * arg5, UINT  arg6)
    267285{
     286  int iHeight;
     287  HBITMAP rc;
    268288    dprintf(("GDI32: CreateDIBitmap\n"));
    269 //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA)
    270     if(arg2->biHeight < 0) {
    271         ((BITMAPINFOHEADER *)arg2)->biHeight = -arg2->biHeight;
     289
     290    //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA)
     291
     292    iHeight = arg2->biHeight;
     293    if(arg2->biHeight < 0)
     294    {
     295      ((BITMAPINFOHEADER *)arg2)->biHeight = -arg2->biHeight;
    272296    }
    273     return O32_CreateDIBitmap(arg1, arg2, arg3, arg4, arg5, arg6);
     297
     298    rc = O32_CreateDIBitmap(arg1, arg2, arg3, arg4, arg5, arg6);
     299
     300    ((BITMAPINFOHEADER *)arg2)->biHeight = iHeight;
     301
     302    return rc;
    274303}
    275304//******************************************************************************
     
    378407int WIN32API SetStretchBltMode( HDC arg1, int  arg2)
    379408{
    380   dprintf(("GDI32: SetStretchBltMode %X, %x\n",arg1, arg2));
     409  dprintf(("GDI32: SetStretchBltMode 0x%08X, 0x%08X\n",arg1, arg2));
    381410
    382411  if(DIBSection::getSection() != NULL)
     
    398427////    dprintf(("GDI32: SelectObject\n"));
    399428
    400     if(DIBSection::getSection() != NULL) {
    401         DIBSection *dsect;
    402 
    403         dsect = DIBSection::find(hdc);
    404         if(dsect) {//remove previously selected dibsection
    405                 dsect->UnSelectDIBObject();
    406         }
    407         dsect = DIBSection::find((DWORD)hObj);
    408         if(dsect) {
    409                 dsect->SelectDIBObject(hdc);
    410         }
     429    if(DIBSection::getSection() != NULL)
     430    {
     431      DIBSection *dsect;
     432
     433      dsect = DIBSection::find(hdc);
     434      if(dsect)
     435      {
     436        //remove previously selected dibsection
     437        dsect->UnSelectDIBObject();
     438      }
     439      dsect = DIBSection::find((DWORD)hObj);
     440      if(dsect)
     441      {
     442        dsect->SelectDIBObject(hdc);
     443      }
    411444    }
    412445    rc = O32_SelectObject(hdc, hObj);
    413     if(rc != 0 && DIBSection::getSection != NULL) {
    414         DIBSection *dsect = DIBSection::find((DWORD)rc);
    415         if(dsect) {
    416                 dsect->UnSelectDIBObject();
    417         }
     446    if(rc != 0 && DIBSection::getSection != NULL)
     447    {
     448      DIBSection *dsect = DIBSection::find((DWORD)rc);
     449      if(dsect)
     450      {
     451        dsect->UnSelectDIBObject();
     452      }
    418453    }
    419454    return(rc);
     
    423458HPALETTE WIN32API SelectPalette(HDC arg1, HPALETTE arg2, BOOL arg3)
    424459{
    425     dprintf(("GDI32: SelectPalette %x", arg1));
    426     return O32_SelectPalette(arg1, arg2, arg3);
     460  dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)\n", arg1, arg2, arg3));
     461  if(DIBSection::getSection() != NULL)
     462  {
     463    DIBSection *dsect = DIBSection::findHDC(arg1);
     464    if(dsect)
     465    {
     466      PALETTEENTRY Pal[256];
     467      char PalSize = dsect->GetBitCount();
     468      dprintf(("       - Set Palette Values in DIBSection\n"));
     469      if(PalSize<=8)
     470      {
     471        GetPaletteEntries( arg2, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);
     472        dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal);
     473      }
     474
     475    }
     476  }
     477  return O32_SelectPalette(arg1, arg2, arg3);
    427478}
    428479//******************************************************************************
     
    651702    char *astring2 = UnicodeToAsciiString((LPWSTR)arg2);
    652703    char *astring3 = UnicodeToAsciiString((LPWSTR)arg3);
     704
    653705    if(arg4)
    654706    {
     
    697749      devmode.dmReserved1        = arg4->dmReserved1;
    698750      devmode.dmReserved2        = arg4->dmReserved2;
    699 
    700751      rc = O32_CreateDC(astring1,astring2,astring3,&devmode);
    701752    }
     
    706757    FreeAsciiString(astring2);
    707758    FreeAsciiString(astring3);
     759
    708760    if(arg4)
    709761    {
     
    739791HENHMETAFILE WIN32API CreateEnhMetaFileW( HDC arg1, LPCWSTR arg2, const RECT * arg3, LPCWSTR  arg4)
    740792{
    741     dprintf(("GDI32: CreateEnhMetaFileW STUB"));
    742     // NOTE: This will not work as is (needs UNICODE support)
    743 //    return O32_CreateEnhMetaFile(arg1, arg2, arg3, arg4);
    744     return 0;
     793    char *astring1 = UnicodeToAsciiString((LPWSTR)arg2);
     794    char *astring2 = UnicodeToAsciiString((LPWSTR)arg4);
     795    HENHMETAFILE   rc;
     796
     797    dprintf(("GDI32: CreateMetaFileW"));
     798    rc = O32_CreateEnhMetaFile(arg1,astring1,arg3,astring2);
     799    FreeAsciiString(astring1);
     800    FreeAsciiString(astring2);
     801    return rc;
    745802}
    746803//******************************************************************************
     
    13221379UINT WIN32API GetNearestPaletteIndex( HPALETTE arg1, COLORREF  arg2)
    13231380{
    1324     dprintf(("GDI32: GetNearestPaletteIndex\n"));
    1325     return O32_GetNearestPaletteIndex(arg1, arg2);
     1381    UINT rc;
     1382    dprintf(("GDI32: GetNearestPaletteIndex (0x%08X ,0x%08X) ",arg1,arg2));
     1383    rc = O32_GetNearestPaletteIndex(arg1, arg2);
     1384    dprintf(("Returns %d\n",rc));
     1385    return rc;
    13261386}
    13271387//******************************************************************************
     
    21082168//******************************************************************************
    21092169//WINE: OBJECTS\DIB.C
    2110 //******************************************************************************
    2111 HBITMAP WIN32API CreateDIBSection(HDC hdc, BITMAPINFO *pbmi, UINT iUsage,
    2112                                      VOID **ppvBits, HANDLE hSection, DWORD dwOffset)
     2170//*********************************************************************************
     2171HBITMAP WIN32API CreateDIBSection( HDC hdc, BITMAPINFO *pbmi, UINT iUsage,
     2172                                   VOID **ppvBits, HANDLE hSection, DWORD dwOffset)
    21132173{
    21142174 HBITMAP res = 0;
    21152175 BOOL    fFlip = 0;
     2176 int iHeight, iWidth;
    21162177
    21172178  dprintf(("GDI32: CreateDIBSection %x %x %x %d", hdc, iUsage, hSection, dwOffset));
    2118   if(hSection) {
    2119         dprintf(("GDI32: CreateDIBSection, hSection != NULL, not supported!\n"));
    2120         return NULL;
     2179  if(hSection)
     2180  {
     2181    dprintf(("GDI32: CreateDIBSection, hSection != NULL, not supported!\n"));
     2182    return NULL;
    21212183  }
    21222184
    21232185  //SvL: 13-9-98: StarCraft uses bitmap with negative height
    2124   if(pbmi->bmiHeader.biWidth < 0) {
    2125         pbmi->bmiHeader.biWidth = -pbmi->bmiHeader.biWidth;
    2126         fFlip = FLIP_HOR;
     2186  iWidth = pbmi->bmiHeader.biWidth;
     2187  if(pbmi->bmiHeader.biWidth < 0)
     2188  {
     2189    pbmi->bmiHeader.biWidth = -pbmi->bmiHeader.biWidth;
     2190    fFlip = FLIP_HOR;
    21272191  }
    2128   if(pbmi->bmiHeader.biHeight < 0) {
    2129         pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight;
    2130         fFlip |= FLIP_VERT;
     2192  iHeight = pbmi->bmiHeader.biHeight;
     2193  if(pbmi->bmiHeader.biHeight < 0)
     2194  {
     2195    pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight;
     2196    fFlip |= FLIP_VERT;
    21312197  }
    21322198
     
    21342200  if (res)
    21352201  {
    2136         DIBSection *dsect = new DIBSection((WINBITMAPINFOHEADER *)&pbmi->bmiHeader, (DWORD)res, fFlip);
    2137         dprintf(("Constructor returned\n",res));
    2138         if(ppvBits!=NULL)
    2139           *ppvBits = dsect->GetDIBObject();
    2140         dprintf(("GDI32: return %08X\n",res));
    2141         return(res);
     2202    ULONG Pal[256];
     2203    char PalSize;
     2204    LOGPALETTE tmpPal = { 0x300,1,{0,0,0,0}};
     2205    HPALETTE hpalCur, hpalTmp;
     2206    DIBSection *dsect = new DIBSection((WINBITMAPINFOHEADER *)&pbmi->bmiHeader, (DWORD)res, fFlip);
     2207    dprintf(("Constructor returned\n"));
     2208
     2209    if(NULL!=dsect)
     2210    {
     2211      PalSize = dsect->GetBitCount();
     2212      if(PalSize<=8)
     2213      {
     2214        // Now get the current Palette from the DC
     2215        hpalTmp = CreatePalette(&tmpPal);
     2216        hpalCur = SelectPalette(hdc, hpalTmp, FALSE);
     2217
     2218        // and use it to set the DIBColorTable
     2219        GetPaletteEntries( hpalCur, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);
     2220        dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal);
     2221
     2222        // Restore the DC Palette
     2223        SelectPalette(hdc,hpalCur,FALSE);
     2224        DeleteObject(hpalTmp);
     2225      }
     2226      // Set the hdc in the DIBSection so we can update the palete if a new
     2227      // Paletet etc. gets selected into the DC.
     2228
     2229      dsect->SelectDIBObject(hdc);
     2230
     2231      if(ppvBits!=NULL)
     2232        *ppvBits = dsect->GetDIBObject();
     2233
     2234      pbmi->bmiHeader.biWidth = iWidth;
     2235      pbmi->bmiHeader.biHeight = iHeight;
     2236
     2237      dprintf(("GDI32: return %08X\n",res));
     2238      return(res);
     2239    }
    21422240  }
    21432241
    21442242  /* Error.  */
    2145   if (res) DeleteObject(res);
     2243  if (res)
     2244    DeleteObject(res);
    21462245  *ppvBits = NULL;
    21472246#ifdef DEBUG
     
    21562255//******************************************************************************
    21572256//******************************************************************************
    2158 UINT WIN32API GetDIBColorTable(HDC hdc, UINT uStartIndex, UINT cEntries,
     2257UINT WIN32API GetDIBColorTable( HDC hdc, UINT uStartIndex, UINT cEntries,
    21592258                                  RGBQUAD *pColors)
    21602259{
     
    21882287
    21892288  dprintf(("GDI32: SetDIBColorTable\n"));
    2190   if(dsect) {
    2191         return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors));
     2289  if(dsect)
     2290  {
     2291    return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors));
    21922292  }
    2193   else  return(0);
     2293  else
     2294    return(0);
    21942295}
    21952296//******************************************************************************
     
    25722673 * Result    : TRUE / FALSE
    25732674 * Remark    :
    2574  * Status    : UNTESTED STUB
     2675 * Status    : UNTESTED
    25752676 *
    25762677 * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
     2678 *             Markus Montkowski [Wen, 1999/01/12 20:18]
    25772679 *****************************************************************************/
    25782680
     
    25812683                                  CONST   XFORM *lLPXFORM2)
    25822684{
    2583   dprintf(("GDI32: CombineTransform(%08xh,%08xh,%08xh) not implemented.\n",
     2685  dprintf(("GDI32: CombineTransform(%08xh,%08xh,%08xh).\n",
    25842686           lLPXFORMResult,
    25852687           lLPXFORM1,
    25862688           lLPXFORM2));
    25872689
     2690  XFORM xfrm;
     2691  if( O32_IsBadWritePtr( (void*)lLPXFORMResult, sizeof(XFORM)) ||
     2692      O32_IsBadReadPtr(  (void*)lLPXFORM1, sizeof(XFORM)) ||
     2693      O32_IsBadWritePtr( (void*)lLPXFORM2, sizeof(XFORM)) )
    25882694  return (FALSE);
     2695
     2696  // Add the translations
     2697  lLPXFORMResult->eDx = lLPXFORM1->eDx + lLPXFORM2->eDx;
     2698  lLPXFORMResult->eDy = lLPXFORM1->eDy + lLPXFORM2->eDy;
     2699
     2700  // Multiply the matrixes
     2701  xfrm.eM11 = lLPXFORM1->eM11 * lLPXFORM2->eM11 + lLPXFORM1->eM21 * lLPXFORM1->eM12;
     2702  xfrm.eM12 = lLPXFORM1->eM11 * lLPXFORM2->eM12 + lLPXFORM1->eM12 * lLPXFORM1->eM22;
     2703  xfrm.eM21 = lLPXFORM1->eM21 * lLPXFORM2->eM11 + lLPXFORM1->eM22 * lLPXFORM1->eM21;
     2704  xfrm.eM22 = lLPXFORM1->eM21 * lLPXFORM2->eM12 + lLPXFORM1->eM22 * lLPXFORM1->eM22;
     2705
     2706  // Now copy to resulting XFROM as the pt must not be distinct
     2707  lLPXFORMResult->eM11 = xfrm.eM11;
     2708  lLPXFORMResult->eM12 = xfrm.eM12;
     2709  lLPXFORMResult->eM21 = xfrm.eM21;
     2710  lLPXFORMResult->eM22 = xfrm.eM22;
     2711
     2712  return (TRUE);
    25892713}
    25902714
Note: See TracChangeset for help on using the changeset viewer.