Ignore:
Timestamp:
Jul 24, 1999, 4:01:45 PM (26 years ago)
Author:
sandervl
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/oslibgdi.cpp

    r342 r385  
    1 /* $Id: oslibgdi.cpp,v 1.4 1999-07-20 07:42:35 sandervl Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.5 1999-07-24 14:01:44 sandervl Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    4949        hwndParent = HWND_DESKTOP;
    5050    }
    51     if(WinMapWindowPoints(hwndChild, hwndParent, (POINTL *)point, 1) != 0) {
     51    if(WinMapWindowPoints(hwndChild, hwndParent, (POINTL *)point, 1) != TRUE) {
    5252        dprintf(("MapOS2ToWin32Point:WinMapWindowPoint %x %x returned false", hwndParent, hwndChild));
    5353        return FALSE;
     
    5555    WinQueryWindowRect(hwndParent, (PRECTL)&rectParent);
    5656    point->y = rectParent.yTop - point->y - 1;
     57    return TRUE;
     58}
     59//******************************************************************************
     60// MapOS2ToWin32Rect
     61//   Map os/2 rectangle to screen coordinates and convert to win32 rect
     62//
     63// Parameters:
     64//   hwndParent: Parent window handle
     65//   hwndChild:  Child window handle
     66//   rectOS2:    OS/2 child window RECTL
     67//   rectWin32:  Win32 Child window RECT   (IN)
     68//
     69// Returns:
     70//   TRUE:      Success
     71//   FALSE:     Failures
     72//******************************************************************************
     73BOOL MapOS2ToWin32Rectl(HWND hwndParent, HWND hwndChild, PRECTLOS2 rectOS2, PRECT rectWin32)
     74{
     75 RECTLOS2 rectParent = {0};
     76
     77    if(hwndParent == OSLIB_HWND_DESKTOP) {
     78        hwndParent = HWND_DESKTOP;
     79    }
     80    if(WinMapWindowPoints(hwndChild, hwndParent, (PPOINTL)rectOS2, 2) != TRUE) {
     81        dprintf(("MapOS2ToWin32Rect:WinMapWindowPoint %x %x returned false", hwndParent, hwndChild));
     82        return FALSE;
     83    }
     84
     85    ULONG length = rectOS2->yTop - rectOS2->yBottom;
     86
     87    rectWin32->bottom = length - rectOS2->yBottom;
     88    rectWin32->top    = length - rectOS2->yTop;
     89    rectWin32->left   = rectOS2->xLeft;
     90    rectWin32->right  = rectOS2->xRight;
     91
    5792    return TRUE;
    5893}
     
    134169//******************************************************************************
    135170//******************************************************************************
     171BOOL OSLibWinInvalidateRect(HWND hwnd, PRECT pRect, BOOL fIncludeChildren)
     172{
     173 RECTLOS2 rectl;
     174
     175  MapWin32ToOS2Rectl(pRect, &rectl);
     176  return WinInvalidateRect(hwnd, (PRECTL)&rectl, fIncludeChildren);
     177}
     178//******************************************************************************
     179//Returns rectangle in Win32 window coordinates
     180//******************************************************************************
     181BOOL OSLibWinQueryUpdateRect(HWND hwnd, PRECT pRect)
     182{
     183 BOOL rc;
     184 RECTLOS2 rectl;
     185
     186  rc = WinQueryUpdateRect(hwnd, (PRECTL)&rectl);
     187  if(rc) {
     188        MapOS2ToWin32Rectl(&rectl, pRect);
     189  }
     190  else  memset(pRect, 0, sizeof(RECT));
     191  return rc;
     192}
     193//******************************************************************************
     194//******************************************************************************
     195
Note: See TracChangeset for help on using the changeset viewer.