Changeset 1849 for trunk/src/user32/oslibgdi.cpp
- Timestamp:
- Nov 26, 1999, 6:06:09 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibgdi.cpp
r1297 r1849 1 /* $Id: oslibgdi.cpp,v 1. 3 1999-10-14 18:27:57 sandervlExp $ */1 /* $Id: oslibgdi.cpp,v 1.4 1999-11-26 17:06:07 cbratschi Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 85 85 } 86 86 87 if(hwndParent != HWND_DESKTOP) 87 if(hwndParent != HWND_DESKTOP) 88 88 { 89 90 91 92 89 window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndParent); 90 if(window == NULL) 91 return FALSE; 92 height = window->getWindowHeight(); 93 93 } 94 94 else height = OSLibQueryScreenHeight(); … … 106 106 // 107 107 // Parameters: 108 // hwnd: OS/2 window handle 108 109 // rectOS2: OS/2 child window RECTL 109 110 // rectWin32: Win32 Child window RECT (IN) … … 113 114 // FALSE: Failures 114 115 //****************************************************************************** 115 BOOL MapOS2ToWin32Rectl(PRECTLOS2 rectOS2, PRECT rectWin32) 116 { 117 ULONG length = rectOS2->yTop - rectOS2->yBottom; 118 119 rectWin32->bottom = length - rectOS2->yBottom; 120 rectWin32->top = length - rectOS2->yTop; 116 BOOL MapOS2ToWin32Rectl(HWND hwnd,PRECTLOS2 rectOS2, PRECT rectWin32) 117 { 118 RECTL rect; 119 120 if (!WinQueryWindowRect(hwnd,&rect)) return FALSE; 121 122 rectWin32->bottom = rect.yTop-rectOS2->yBottom; 123 rectWin32->top = rect.yTop-rectOS2->yTop; 121 124 rectWin32->left = rectOS2->xLeft; 122 125 rectWin32->right = rectOS2->xRight; 126 123 127 return TRUE; 124 128 } … … 128 132 // 129 133 // Parameters: 134 // hwnd: OS/2 window handle 130 135 // rectWin32: Win32 Child window RECT (IN) 131 136 // rectOS2: OS/2 Child window RECTL (OUT) … … 134 139 // FALSE: Failures 135 140 //****************************************************************************** 136 BOOL MapWin32ToOS2Rectl(PRECT rectWin32, PRECTLOS2 rectOS2) 137 { 138 ULONG length = rectWin32->bottom - rectWin32->top; 139 140 rectOS2->yBottom = length - rectWin32->bottom; 141 rectOS2->yTop = length - rectWin32->top; 141 BOOL MapWin32ToOS2Rectl(HWND hwnd,PRECT rectWin32, PRECTLOS2 rectOS2) 142 { 143 RECTL rect; 144 145 if (!WinQueryWindowRect(hwnd,&rect)) return FALSE; 146 147 rectOS2->yBottom = rect.yTop-rectWin32->bottom; 148 rectOS2->yTop = rect.yTop-rectWin32->top; 142 149 rectOS2->xLeft = rectWin32->left; 143 150 rectOS2->xRight = rectWin32->right; 151 144 152 return TRUE; 153 } 154 //****************************************************************************** 155 //****************************************************************************** 156 BOOL MapOS2ToWin32WindowRect(PRECTLOS2 rectOS2,PRECT rectWin32) 157 { 158 rectWin32->bottom = rectOS2->yTop; 159 rectWin32->top = rectOS2->yBottom; 160 rectWin32->left = rectOS2->xLeft; 161 rectWin32->right = rectOS2->xRight; 162 163 return TRUE; 164 } 165 //****************************************************************************** 166 //****************************************************************************** 167 BOOL MapWin32ToOS2WindowRect(PRECT rectWin32,PRECTLOS2 rectOS2) 168 { 169 rectOS2->yBottom = rectWin32->top; 170 rectOS2->yTop = rectWin32->bottom; 171 rectOS2->xLeft = rectWin32->left; 172 rectOS2->xRight = rectWin32->right; 173 174 return TRUE; 145 175 } 146 176 //****************************************************************************** … … 155 185 return 0; 156 186 } 157 MapOS2ToWin32Rectl( (RECTLOS2 *)&rectl, rectWin32);187 MapOS2ToWin32Rectl(hwnd,(RECTLOS2 *)&rectl, rectWin32); 158 188 return WinBeginPaint(hwnd, NULLHANDLE, &rectl); 159 189 } … … 169 199 { 170 200 if(hwnd == OSLIB_HWND_DESKTOP) 171 201 hwnd = HWND_DESKTOP; 172 202 173 203 return (HDC)WinGetPS(hwnd); … … 186 216 187 217 if(pRect) { 188 MapWin32ToOS2Rectl( pRect, &rectl);218 MapWin32ToOS2Rectl(hwnd,pRect, &rectl); 189 219 return WinInvalidateRect(hwnd, (PRECTL)&rectl, fIncludeChildren); 190 220 } … … 201 231 rc = WinQueryUpdateRect(hwnd, (PRECTL)&rectl); 202 232 if(rc) { 203 MapOS2ToWin32Rectl( &rectl, pRect);233 MapOS2ToWin32Rectl(hwnd,&rectl, pRect); 204 234 } 205 235 else memset(pRect, 0, sizeof(RECT));
Note:
See TracChangeset
for help on using the changeset viewer.