Changeset 2267 for trunk/src


Ignore:
Timestamp:
Dec 30, 1999, 12:21:30 PM (26 years ago)
Author:
sandervl
Message:

Fixed GetObject for dib sections

Location:
trunk/src/gdi32
Files:
3 edited

Legend:

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

    r1966 r2267  
    1 /* $Id: dibsect.cpp,v 1.11 1999-12-04 13:53:12 hugh Exp $ */
     1/* $Id: dibsect.cpp,v 1.12 1999-12-30 11:21:29 sandervl Exp $ */
    22
    33/*
     
    113113   {
    114114     DIBSection *dsect = section;
    115      dprintf(("Increment section starting at %08X\n",dsect));
     115     dprintf2(("Increment section starting at %08X\n",dsect));
    116116
    117117     /* @@@PH 98/07/11 fix for dsect->next == NULL */
     
    119119             (dsect->next != NULL) )
    120120     {
    121        dprintf(("Increment section to %08X\n",dsect->next));
     121       dprintf2(("Increment section to %08X\n",dsect->next));
    122122       dsect = dsect->next;
    123123     }
     
    125125   }
    126126
    127    dprintf(("Class created"));
     127   dprintf2(("Class created"));
    128128}
    129129//******************************************************************************
     
    366366//******************************************************************************
    367367//******************************************************************************
    368 int DIBSection::GetDIBSection(int iSize , DIBSECTION *pDIBSection)
    369 {
    370   if( (sizeof(DIBSECTION)==iSize) &&
    371       (pDIBSection !=NULL))
     368int DIBSection::GetDIBSection(int iSize, void *lpBuffer)
     369{
     370 DIBSECTION *pDIBSection = (DIBSECTION *)lpBuffer;
     371 LPWINBITMAP dsBm        = (LPWINBITMAP)lpBuffer;
     372
     373  if(iSize == sizeof(DIBSECTION))
    372374  {
    373375    // BITMAP struct
     
    400402    pDIBSection->dsOffset = 0; // TODO: put the correct value here
    401403
    402     return 0; //ERROR_SUCCESS
    403   }
    404   return 87;    //ERROR_INVALID_PARAMETER
     404    return sizeof(DIBSECTION);
     405  }
     406  else
     407  if(iSize == sizeof(WINBITMAP))
     408  {
     409        dsBm->bmType       = 0;  // TODO: put the correct value here
     410        dsBm->bmWidth      = pOS2bmp->cx;
     411        dsBm->bmHeight     = pOS2bmp->cy;
     412        dsBm->bmWidthBytes = bmpsize;
     413        dsBm->bmPlanes     = pOS2bmp->cPlanes;
     414        dsBm->bmBitsPixel  = pOS2bmp->cBitCount;
     415        dsBm->bmBits       = bmpBits;
     416        return sizeof(WINBITMAP);
     417  }
     418  return 0;
    405419
    406420}
  • trunk/src/gdi32/dibsect.h

    r1966 r2267  
    1 /* $Id: dibsect.h,v 1.8 1999-12-04 13:53:14 hugh Exp $ */
     1/* $Id: dibsect.h,v 1.9 1999-12-30 11:21:30 sandervl Exp $ */
    22
    33/*
     
    8383                              UINT coloruse);
    8484
    85                int  GetDIBSection(int iSize , DIBSECTION *pDIBSection);
     85               int  GetDIBSection(int iSize , void *lpBuffer);
    8686
    8787 static DIBSection *getSection() { return section; } ;
  • trunk/src/gdi32/gdi32.cpp

    r2092 r2267  
    1 /* $Id: gdi32.cpp,v 1.26 1999-12-16 16:52:31 cbratschi Exp $ */
     1/* $Id: gdi32.cpp,v 1.27 1999-12-30 11:21:30 sandervl Exp $ */
    22
    33/*
     
    159159//******************************************************************************
    160160//******************************************************************************
    161 int WIN32API GetObjectA( HGDIOBJ arg1, int arg2, void *  arg3)
    162 {
     161int WIN32API GetObjectA( HGDIOBJ hObject, int size, void *lpBuffer)
     162{
     163 int rc;
     164
     165  if(size == 0 || lpBuffer == NULL) {
     166        SetLastError(ERROR_INVALID_PARAMETER);
     167        return 0;
     168  }
    163169
    164170  if(DIBSection::getSection() != NULL)
    165171  {
    166     DIBSection *dsect = DIBSection::find(arg1);
    167     if(dsect)
    168     {
    169       return dsect->GetDIBSection(arg2, (DIBSECTION*)arg3);
    170     }
     172        DIBSection *dsect = DIBSection::find(hObject);
     173        if(dsect)
     174        {
     175                rc = dsect->GetDIBSection(size, lpBuffer);
     176                if(rc == 0) {
     177                        SetLastError(ERROR_INVALID_PARAMETER);
     178                        return 0;
     179                }
     180                SetLastError(ERROR_SUCCESS);
     181                return rc;
     182        }
    171183  }
    172184
    173   dprintf(("GDI32: GetObject %X %X %X\n", arg1, arg2, arg3));
    174   return O32_GetObject(arg1, arg2, arg3);
     185  dprintf(("GDI32: GetObject %X %X %X\n", hObject, size, lpBuffer));
     186  return O32_GetObject(hObject, size, lpBuffer);
     187}
     188//******************************************************************************
     189//******************************************************************************
     190int WIN32API GetObjectW( HGDIOBJ arg1, int arg2, void *  arg3)
     191{
     192    dprintf(("GDI32: GetObjectW %X, %d %X not complete!", arg1, arg2, arg3));
     193    return GetObjectA(arg1, arg2, arg3);
    175194}
    176195//******************************************************************************
     
    13611380//******************************************************************************
    13621381//******************************************************************************
    1363 int WIN32API GetObjectW( HGDIOBJ arg1, int arg2, void *  arg3)
    1364 {
    1365     dprintf(("GDI32: GetObjectW %X, %d %X\n", arg1, arg2, arg3));
    1366     // NOTE: This will not work as is (needs UNICODE support)
    1367     return O32_GetObject(arg1, arg2, arg3);
    1368 }
    1369 //******************************************************************************
    1370 //******************************************************************************
    13711382UINT WIN32API GetOutlineTextMetricsA( HDC arg1, UINT arg2, LPOUTLINETEXTMETRICA  arg3)
    13721383{
Note: See TracChangeset for help on using the changeset viewer.