Changeset 5607 for trunk/src


Ignore:
Timestamp:
Apr 27, 2001, 7:37:23 PM (24 years ago)
Author:
sandervl
Message:

minor changes

Location:
trunk/src/gdi32
Files:
2 edited

Legend:

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

    r5390 r5607  
    1 /* $Id: gdi32.cpp,v 1.67 2001-03-27 20:47:53 sandervl Exp $ */
     1/* $Id: gdi32.cpp,v 1.68 2001-04-27 17:37:23 sandervl Exp $ */
    22
    33/*
     
    223223//******************************************************************************
    224224//******************************************************************************
    225 COLORREF WIN32API GetPixel( HDC arg1, int arg2, int  arg3)
    226 {
    227 ////    dprintf(("GDI32: GetPixel\n"));
    228     return O32_GetPixel(arg1, arg2, arg3);
    229 }
    230 //******************************************************************************
    231 //******************************************************************************
    232 COLORREF WIN32API SetPixel( HDC arg1, int arg2, int arg3, COLORREF  arg4)
    233 {
    234 ////    dprintf(("GDI32: SetPixel\n"));
    235     return O32_SetPixel(arg1, arg2, arg3, arg4);
     225COLORREF WIN32API GetPixel( HDC hdc, int x, int y)
     226{
     227 COLORREF color;
     228
     229    color = O32_GetPixel(hdc, x, y);
     230    dprintf2(("GDI32: GetPixel %x (%d,%d) -> %x", hdc, x, y, color));
     231    return color;
     232}
     233//******************************************************************************
     234//******************************************************************************
     235COLORREF WIN32API SetPixel( HDC hdc, int x, int y, COLORREF color)
     236{
     237    dprintf2(("GDI32: SetPixel %x (%d,%d) %x", hdc, x, y, color));
     238    return O32_SetPixel(hdc, x, y, color);
    236239}
    237240//******************************************************************************
     
    786789BOOL WIN32API GetCharWidth32W(HDC hdc, UINT iFirstChar, UINT iLastChar, PINT pWidthArray)
    787790{
    788     dprintf(("GDI32: GetCharWidth32W, not properly implemented"));
     791    dprintf(("GDI32: GetCharWidth32W might not work properly %x %x %x %x", hdc, iFirstChar, iLastChar, pWidthArray));
    789792    return O32_GetCharWidth(hdc, iFirstChar, iLastChar, pWidthArray);
    790793}
  • trunk/src/gdi32/region.cpp

    r4848 r5607  
    1 /* $Id: region.cpp,v 1.19 2000-12-29 18:40:44 sandervl Exp $ */
     1/* $Id: region.cpp,v 1.20 2001-04-27 17:37:23 sandervl Exp $ */
    22
    33/*
     
    358358}
    359359//******************************************************************************
     360int WIN32API GetRgnBox( HRGN hrgn, PRECT pRect);
    360361//******************************************************************************
    361362ODINFUNCTIONNODBG2(int, SelectClipRgn, HDC, hdc, HRGN, hrgn)
     
    364365 HRGN hrgnNewClip;
    365366 HRGN hrgnOldClip;
     367#ifdef DEBUG
     368 HRGN hrgn1 = hrgn;
     369#endif
    366370
    367371    pDCData  pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
     
    374378
    375379    dprintf(("SelectClipRgn: %x %x", hdc, hrgn));
    376 
    377380    if(hrgn)
    378381    {
    379382        hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    380383        if(hrgn == HANDLE_OBJ_ERROR) {
    381             dprintf(("WARNING: SelectClipRgn: invalid region!", hdc, hrgn));
     384            dprintf(("WARNING: SelectClipRgn: invalid region!", hdc, hrgn1));
    382385            SetLastError(ERROR_INVALID_HANDLE_W);
    383386            return ERROR_W;
     
    413416            //SvL: Must check if origin changed here. Sometimes happens when
    414417            //     window looses focus. (don't know why....)
    415             if(pHps->isClient)
    416                 selectClientArea(pHps);
     418            checkOrigin(pHps);
    417419            return lComplexity;
    418420        }
    419421    }
    420422
    421     dprintf(("WARNING: SelectClipRgn: RGN_ERROR!", hdc, hrgn));
     423    dprintf(("WARNING: SelectClipRgn: RGN_ERROR!", hdc, hrgn1));
    422424    if(hrgnNewClip)
    423425        GpiDestroyRegion(pHps->hps, hrgnNewClip);
     
    430432ODINFUNCTIONNODBG3(int, ExtSelectClipRgn, HDC, hdc, HRGN, hrgn, int, mode)
    431433{
     434#ifdef DEBUG
     435 HRGN hrgn1 = hrgn;
     436#endif
     437
    432438   pDCData    pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
    433439   if (!pHps)
     
    444450   {
    445451        SetLastError(ERROR_INVALID_PARAMETER_W);
    446         dprintf(("WARNING: ExtSelectRgn %x %x %d invalid parameter", hdc, hrgn, mode));
     452        dprintf(("WARNING: ExtSelectRgn %x %x %d invalid parameter", hdc, hrgn1, mode));
    447453        return ERROR_W;
    448454   }
     
    459465        {
    460466            SetLastError(ERROR_INVALID_PARAMETER_W);
    461             dprintf(("WARNING: ExtSelectRgn %x %x %d invalid parameter", hdc, hrgn, mode));
     467            dprintf(("WARNING: ExtSelectRgn %x %x %d invalid parameter", hdc, hrgn1, mode));
    462468            return ERROR_W;
    463469        }
     
    468474        hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    469475        if(hrgn == HANDLE_OBJ_ERROR) {
    470             dprintf(("WARNING: ExtSelectRgn %x %x %d invalid region handle", hdc, hrgn, mode));
     476            dprintf(("WARNING: ExtSelectRgn %x %x %d invalid region handle", hdc, hrgn1, mode));
    471477            SetLastError(ERROR_INVALID_HANDLE_W);
    472478            return 0;
     
    474480   }
    475481
    476    dprintf(("WARNING: ExtSelectRgn %x %x %d", hdc, hrgn, mode));
     482   dprintf(("ExtSelectRgn %x %x %d", hdc, hrgn1, mode));
    477483   //TODO: metafile recording
    478484   if(hrgn)
     
    526532        //SvL: Must check if origin changed here. Sometimes happens when
    527533        //     window looses focus. (don't know why....)
    528         if(pHps->isClient)
    529             selectClientArea(pHps);
     534        checkOrigin(pHps);
    530535
    531536        if (lComplexity != RGN_ERROR)
     
    612617   LONG       lComplexity = RGN_RECT;
    613618   HRGN       hrgnClip = NULL, hrgnTemp;
     619#ifdef DEBUG
     620   HRGN       hrgn1 = hrgn;
     621#endif
    614622
    615623    hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    616624    if(hrgn == HANDLE_OBJ_ERROR || !pHps) {
    617         dprintf(("WARNING: GetClipRgn %x %x invalid handle", hdc, hrgn));
     625        dprintf(("WARNING: GetClipRgn %x %x invalid handle", hdc, hrgn1));
    618626        SetLastError(ERROR_INVALID_HANDLE_W);
    619627        return 0;
     
    641649    else lComplexity = RGN_NULL;
    642650
    643     dprintf(("GetClipRgn %x %x returned %d", hdc, hrgn, lComplexity != RGN_NULL));
     651    dprintf(("GetClipRgn %x %x returned %d", hdc, hrgn1, lComplexity != RGN_NULL));
    644652    SetLastError(ERROR_SUCCESS_W);
    645653    if(lComplexity == RGN_NULL)
     
    10551063    ULONG lComplexity;
    10561064    LONG  mode;
     1065#ifdef DEBUG
     1066   HRGN hrgn1 = hrgnDest;
     1067   HRGN hrgn2 = hrgnSrc1;
     1068   HRGN hrgn3 = hrgnSrc2;
     1069#endif
    10571070
    10581071    switch(combineMode) {
     
    10821095    hrgnSrc2 = ObjGetHandleData(hrgnSrc2, GDIOBJ_REGION);
    10831096    if(hrgnDest == HANDLE_OBJ_ERROR || hrgnSrc1 == HANDLE_OBJ_ERROR  || (hrgnSrc2 == HANDLE_OBJ_ERROR && combineMode != RGN_COPY_W)) {
    1084         dprintf(("WARNING: CombineRgn %x %x %x %d invalid region", hrgnDest, hrgnSrc1, hrgnSrc2, combineMode));
     1097        dprintf(("WARNING: CombineRgn %x %x %x %d invalid region", hrgn1, hrgn2, hrgn3, combineMode));
    10851098        SetLastError(ERROR_INVALID_HANDLE_W);
    10861099        return ERROR_W;
     
    10891102    lComplexity = GpiCombineRegion(hpsRegion, hrgnDest, hrgnSrc1, hrgnSrc2, mode);
    10901103    if(lComplexity == RGN_ERROR) {
    1091         dprintf(("WARNING: CombineRgn %x %x %x %d GpiCombineRegion failed (%x)", hrgnDest, hrgnSrc1, hrgnSrc2, mode, WinGetLastError(0)));
     1104        dprintf(("WARNING: CombineRgn %x %x %x %d GpiCombineRegion failed (%x)", hrgn1, hrgn2, hrgn3, mode, WinGetLastError(0)));
    10921105        SetLastError(ERROR_INVALID_HANDLE_W);
    10931106        return ERROR_W;
    10941107    }
     1108    dprintf(("CombineRgn %x %x %x %d", hrgn1, hrgn2, hrgn3, mode));
    10951109    SetLastError(ERROR_SUCCESS_W);
    10961110    return lComplexity;
     
    11011115{
    11021116   LONG lEquality;
     1117#ifdef DEBUG
     1118   HRGN hrgnt1 = hrgn1;
     1119   HRGN hrgnt2 = hrgn2;
     1120#endif
    11031121
    11041122   hrgn1 = ObjGetHandleData(hrgn1, GDIOBJ_REGION);
    11051123   hrgn2 = ObjGetHandleData(hrgn2, GDIOBJ_REGION);
    11061124   if(hrgn1 == HANDLE_OBJ_ERROR || hrgn2 == HANDLE_OBJ_ERROR) {
    1107         dprintf(("WARNING: EqualRgn %x %x invalid region", hrgn1, hrgn2));
     1125        dprintf(("WARNING: EqualRgn %x %x invalid region", hrgnt1, hrgnt2));
    11081126        SetLastError(ERROR_INVALID_HANDLE_W);
    11091127        return FALSE;
     
    11111129   lEquality = GpiEqualRegion(hpsRegion, hrgn1, hrgn2);
    11121130
    1113    dprintf(("EqualRgn %x %x = %d", hrgn1, hrgn2, lEquality));
     1131   dprintf(("EqualRgn %x %x = %d", hrgnt1, hrgnt2, lEquality));
    11141132   SetLastError(ERROR_SUCCESS_W);
    11151133
     
    11281146{
    11291147   BOOL    result = FALSE;
     1148#ifdef DEBUG
     1149   HRGN      hrgn1 = hrgn;
     1150#endif
    11301151
    11311152    hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    11321153    if(hrgn == HANDLE_OBJ_ERROR) {
    1133         dprintf(("WARNING: SetRectRgn %x (%d,%d)(%d,%d) invalid region handle", hrgn, left, top, right, bottom));
     1154        dprintf(("WARNING: SetRectRgn %x (%d,%d)(%d,%d) invalid region handle", hrgn1, left, top, right, bottom));
    11341155        SetLastError(ERROR_INVALID_HANDLE_W);
    11351156        return 0;
     
    11371158    RECTL rectl = { left, top, right, bottom }; //reversed y coordinates
    11381159    if(GpiSetRegion(hpsRegion, hrgn, 1, &rectl)) {
    1139         dprintf(("SetRectRgn %x (%d,%d)(%d,%d)", hrgn, left, top, right, bottom));
     1160        dprintf(("SetRectRgn %x (%d,%d)(%d,%d)", hrgn1, left, top, right, bottom));
    11401161        return TRUE;
    11411162    }
    1142     dprintf(("WARNING: SetRectRgn %x (%d,%d)(%d,%d) GpiSetRegion failed %x", hrgn, left, top, right, bottom, WinGetLastError(0)));
     1163    dprintf(("WARNING: SetRectRgn %x (%d,%d)(%d,%d) GpiSetRegion failed %x", hrgn1, left, top, right, bottom, WinGetLastError(0)));
    11431164    return FALSE;
    11441165}
     
    11471168ODINFUNCTIONNODBG3(ULONG, GetRegionData, HRGN, hrgn, ULONG, count, PRGNDATA, pData)
    11481169{
     1170#ifdef DEBUG
     1171   HRGN      hrgn1 = hrgn;
     1172#endif
     1173
    11491174    if(!count && pData)
    11501175    {
    1151         dprintf(("WARNING: GetRegionData %x %d %x; invalid parameter", hrgn, count, pData));
     1176        dprintf(("WARNING: GetRegionData %x %d %x; invalid parameter", hrgn1, count, pData));
    11521177        SetLastError(ERROR_INVALID_PARAMETER_W);
    11531178        return 0;
     
    11551180    hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    11561181    if(hrgn == HANDLE_OBJ_ERROR) {
    1157         dprintf(("WARNING: GetRegionData %x %d %x; invalid region handle", hrgn, count, pData));
     1182        dprintf(("WARNING: GetRegionData %x %d %x; invalid region handle", hrgn1, count, pData));
    11581183        SetLastError(ERROR_INVALID_HANDLE_W);
    11591184        return 0;
     
    11651190    if(!GpiQueryRegionRects(hpsRegion, hrgn, NULL, &rgnRect, NULL))
    11661191    {
    1167         dprintf(("WARNING: GetRegionData %x %d %x: GpiQueryRegionRects failed! (%x)", hrgn, count, pData, WinGetLastError(0)));
    1168         return 0;
    1169     }
    1170 
    1171     dprintf(("GetRegionData %x %d %x", hrgn, count, pData));
     1192        dprintf(("WARNING: GetRegionData %x %d %x: GpiQueryRegionRects failed! (%x)", hrgn1, count, pData, WinGetLastError(0)));
     1193        return 0;
     1194    }
     1195
     1196    dprintf(("GetRegionData %x %d %x", hrgn1, count, pData));
    11721197
    11731198    ULONG bufSizeNeeded = rgnRect.crcReturned * sizeof(RECT) + sizeof (RGNDATAHEADER);
     
    12101235   BOOL      success;
    12111236   LONG      lComplexity;
     1237#ifdef DEBUG
     1238   HRGN      hrgn1 = hrgn;
     1239#endif
    12121240
    12131241    hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    12141242    if(hrgn == HANDLE_OBJ_ERROR) {
    1215         dprintf(("WARNING: GetRgnBox %x %x invalid region!", hrgn, pRect));
     1243        dprintf(("WARNING: GetRgnBox %x %x invalid region!", hrgn1, pRect));
    12161244        SetLastError(ERROR_INVALID_HANDLE_W);
    12171245        return FALSE;
    12181246    }
    1219 
    1220     dprintf(("GetRgnBox %x %x", hrgn, pRect));
    12211247
    12221248    RECTL  rectl;
     
    12351261            dprintf(("WARNING: GetRgnBox error in region!"));
    12361262    }
     1263    dprintf(("GetRgnBox %x (%d,%d)(%d,%d)", hrgn1, pRect->left, pRect->bottom, pRect->right, pRect->top));
    12371264
    12381265    SetLastError(ERROR_SUCCESS_W);
     
    12431270ODINFUNCTIONNODBG2(BOOL, InvertRgn, HDC, hdc, HRGN, hrgn)
    12441271{
     1272#ifdef DEBUG
     1273    HRGN      hrgn1 = hrgn;
     1274#endif
    12451275    pDCData pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
    12461276
     
    12531283    //todo metafile recording
    12541284
    1255     dprintf(("InvertRgn %x %x", hdc, hrgn));
     1285    dprintf(("InvertRgn %x %x", hdc, hrgn1));
    12561286
    12571287    interpretRegionAs(pHps, NULL, hrgn, AS_WORLD);
     
    12921322{
    12931323   LONG   lComplexity;
     1324#ifdef DEBUG
     1325   HRGN      hrgn1 = hrgn;
     1326#endif
    12941327
    12951328    hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
     
    12991332        return ERROR_W;
    13001333    }
    1301     dprintf(("OffsetRgn %x %d %d", hrgn, xOffset, yOffset));
     1334    dprintf(("OffsetRgn %x %d %d", hrgn1, xOffset, yOffset));
    13021335
    13031336    POINTL   ptlOffset = {xOffset, yOffset};
     
    13371370{
    13381371    HBRUSH hbrushRestore = 0;
     1372#ifdef DEBUG
     1373    HRGN   hrgn1 = hrgn;
     1374#endif
    13391375    pDCData  pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
    13401376
     
    13591395        }
    13601396    }
    1361     dprintf(("FrameRgn %x %x %x (%d,%d)", hdc, hrgn, hBrush, width, height));
     1397    dprintf(("FrameRgn %x %x %x (%d,%d)", hdc, hrgn1, hBrush, width, height));
    13621398    interpretRegionAs(pHps, NULL, hrgn, AS_WORLD);
    13631399
     
    13801416 BOOL   success;
    13811417 HBRUSH hbrushRestore = 0;
     1418#ifdef DEBUG
     1419 HRGN   hrgn1 = hrgn;
     1420#endif
    13821421
    13831422    pDCData  pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
     
    13851424    hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    13861425    if(!pHps || hrgn == HANDLE_OBJ_ERROR) {
    1387         dprintf(("WARNING: FillRgn %x %x %x invalid handle!", hdc, hrgn, hBrush));
     1426        dprintf(("WARNING: FillRgn %x %x %x invalid handle!", hdc, hrgn1, hBrush));
    13881427        SetLastError(ERROR_INVALID_HANDLE_W);
    13891428        return FALSE;
     
    13951434        if (!hbrushRestore)
    13961435        {
    1397             dprintf(("WARNING: FillRgn %x %x %x invalid brush!", hdc, hrgn, hBrush));
     1436            dprintf(("WARNING: FillRgn %x %x %x invalid brush!", hdc, hrgn1, hBrush));
    13981437            SetLastError(ERROR_INVALID_HANDLE_W);
    13991438            return FALSE;
    14001439        }
    14011440    }
    1402     dprintf(("FillRgn %x %x %x", hdc, hrgn, hBrush));
     1441    dprintf(("FillRgn %x %x %x", hdc, hrgn1, hBrush));
    14031442
    14041443    interpretRegionAs(pHps, NULL, hrgn, AS_WORLD);
     
    14331472   BOOL      success;
    14341473   LONG      lInside;
     1474#ifdef DEBUG
     1475   HRGN      hrgn1 = hrgn;
     1476#endif
    14351477
    14361478    hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    14371479    if(hrgn == HANDLE_OBJ_ERROR) {
    1438         dprintf(("WARNING: PtInRgn %x (%d,%d) invalid region!", hrgn, x, y));
     1480        dprintf(("WARNING: PtInRgn %x (%d,%d) invalid region!", hrgn1, x, y));
    14391481        SetLastError(ERROR_INVALID_HANDLE_W);
    14401482        return FALSE;
     
    14501492    SetLastError(ERROR_SUCCESS_W);
    14511493
    1452     dprintf(("WARNING: PtInRgn %x (%d,%d) returned %d", hrgn, x, y, (success && lInside == PRGN_INSIDE) ? 1 : 0));
     1494    dprintf(("PtInRgn %x (%d,%d) returned %d", hrgn1, x, y, (success && lInside == PRGN_INSIDE) ? 1 : 0));
    14531495
    14541496    if(success && lInside == PRGN_INSIDE)
     
    14631505   BOOL      success;
    14641506   LONG      lInside;
     1507#ifdef DEBUG
     1508   HRGN      hrgn1 = hrgn;
     1509#endif
    14651510
    14661511    if(!pRect) {
    1467         dprintf(("WARNING: RectInRgn %x %x invalid parameter!", hrgn, pRect));
     1512        dprintf(("WARNING: RectInRgn %x %x invalid parameter!", hrgn1, pRect));
    14681513        SetLastError(ERROR_INVALID_PARAMETER_W);
    14691514        return FALSE;
     
    14711516    hrgn = ObjGetHandleData(hrgn, GDIOBJ_REGION);
    14721517    if(hrgn == HANDLE_OBJ_ERROR) {
    1473         dprintf(("WARNING: RectInRgn %x %x invalid region", hrgn, pRect));
     1518        dprintf(("WARNING: RectInRgn %x %x invalid region", hrgn1, pRect));
    14741519        SetLastError(ERROR_INVALID_HANDLE_W);
    14751520        return FALSE;
     
    14911536    SetLastError(ERROR_SUCCESS_W);
    14921537
    1493     dprintf(("WARNING: RectInRgn %x %x returned %d", hrgn, pRect, (success && (lInside == RRGN_INSIDE || lInside == RRGN_PARTIAL)) ? 1 : 0));
     1538    dprintf(("RectInRgn %x %x returned %d", hrgn1, pRect, (success && (lInside == RRGN_INSIDE || lInside == RRGN_PARTIAL)) ? 1 : 0));
    14941539
    14951540    if(success && (lInside == RRGN_INSIDE || lInside == RRGN_PARTIAL))
Note: See TracChangeset for help on using the changeset viewer.