- Timestamp:
- Jul 19, 1999, 8:40:44 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibgdi.cpp
r328 r340 1 /* $Id: oslibgdi.cpp,v 1. 2 1999-07-18 14:39:35sandervl Exp $ */1 /* $Id: oslibgdi.cpp,v 1.3 1999-07-19 18:40:43 sandervl Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 19 19 #include <misc.h> 20 20 #include <oslibgdi.h> 21 #include <oslibwin.h> 21 22 22 //******************************************************************************23 //******************************************************************************24 inline PRECTL Win32ToOS2Rect(PVOID pRectl)25 {26 PRECTL pWinRect = (PRECTL)pRectl;27 ULONG tmp;28 29 tmp = pWinRect->yBottom;30 pWinRect->yBottom = pWinRect->yTop;31 pWinRect->yTop = tmp;32 return pWinRect;33 }34 //******************************************************************************35 //******************************************************************************36 inline ULONG MAPWIN32POINT(RECTLOS2 *parent, RECTLOS2 *child, ULONG y)37 {38 return (parent->yTop - parent->yBottom - (child->yTop - child->yBottom) - y - 1);39 }40 23 //****************************************************************************** 41 24 //****************************************************************************** 42 25 inline ULONG MAPWIN32POINT(RECTLOS2 *parent, ULONG cy, ULONG y) 43 26 { 44 return (parent->yTop - parent->yBottom - cy - y - 1); 27 return (parent->yTop - parent->yBottom - cy - y); 28 } 29 //****************************************************************************** 30 //Map win32 y coordinate (in parent window coordinates) to OS/2 y coord. (in parent window coordinates) 31 //****************************************************************************** 32 ULONG MapOS2ToWin32Y(HWND hwndParent, ULONG cy, ULONG y) 33 { 34 RECTLOS2 rectParent = {0}; 35 36 if(hwndParent == OSLIB_HWND_DESKTOP) { 37 hwndParent = HWND_DESKTOP; 38 } 39 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent); 40 return MAPWIN32POINT(&rectParent, cy, y); 45 41 } 46 42 //****************************************************************************** 47 43 //****************************************************************************** 48 ULONG MapOS2ToWin32Y(HWND hwndChild)44 BOOL MapOS2ToWin32Point(HWND hwndParent, HWND hwndChild, OSLIBPOINT *point) 49 45 { 50 HWND hwndParent;51 RECTLOS2 rectParent = {0}, rectChild = {0};52 53 WinQueryWindowRect(hwndChild, (PRECTL)&rectChild);54 hwndParent = WinQueryWindow(hwndChild, QW_PARENT);55 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent);56 return MAPWIN32POINT(&rectParent, &rectChild, rectChild.yBottom);57 }58 //******************************************************************************59 //******************************************************************************60 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y)61 {62 HWND hwndParent;63 RECTLOS2 rectParent = {0}, rectChild = {0};64 65 WinQueryWindowRect(hwndChild, (PRECTL)&rectChild);66 hwndParent = WinQueryWindow(hwndChild, QW_PARENT);67 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent);68 return MAPWIN32POINT(&rectParent, &rectChild, y);69 }70 //******************************************************************************71 //******************************************************************************72 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG cy, ULONG y)73 {74 HWND hwndParent;75 46 RECTLOS2 rectParent = {0}; 76 47 77 hwndParent = WinQueryWindow(hwndChild, QW_PARENT); 78 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent); 79 return MAPWIN32POINT(&rectParent, cy, y); 80 } 81 //****************************************************************************** 82 //****************************************************************************** 83 ULONG MapOS2ToWin32Y(PRECTLOS2 rectParent, PRECTLOS2 rectChild, ULONG y) 84 { 85 return MAPWIN32POINT(rectParent, rectChild, y); 86 } 87 //****************************************************************************** 88 //****************************************************************************** 89 ULONG MapOS2ToWin32Y(PRECTLOS2 rectParent, HWND hwndChild, ULONG y) 90 { 91 RECTLOS2 rectChild = {0}; 92 93 WinQueryWindowRect(hwndChild, (PRECTL)&rectChild); 94 return MAPWIN32POINT(rectParent, &rectChild, y); 95 } 96 //****************************************************************************** 97 //****************************************************************************** 98 ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTLOS2 rectChild, ULONG y) 99 { 100 HWND hwndParent; 101 RECTLOS2 rectParent = {0}; 102 103 hwndParent = WinQueryWindow(hwndChild, QW_PARENT); 104 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent); 105 return MAPWIN32POINT(&rectParent, rectChild, y); 48 if(hwndParent == OSLIB_HWND_DESKTOP) { 49 hwndParent = HWND_DESKTOP; 50 } 51 if(WinMapWindowPoints(hwndChild, hwndParent, (POINTL *)point, 1) != 0) { 52 dprintf(("MapOS2ToWin32Point:WinMapWindowPoint %x %x returned false", hwndParent, hwndChild)); 53 return FALSE; 54 } 55 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent); 56 point->y = rectParent.yTop - point->y; 57 return TRUE; 106 58 } 107 59 //****************************************************************************** … … 110 62 // 111 63 // Parameters: 112 // hwndChild: Child window handle113 // rect Child: OS/2 child window RECTL64 // rectOS2: OS/2 child window RECTL 65 // rectWin32: Win32 Child window RECT (IN) 114 66 // 115 67 // Returns: 116 // rectChild: Converted OS/2 rectange stored in Win32 RECTL (yTop & yBottom reversed)117 68 // TRUE: Success 118 69 // FALSE: Failures 119 70 //****************************************************************************** 120 BOOL MapOS2ToWin32Rectl( HWND hwndChild, PRECTLOS2 rectChild, PRECT rectWin32)71 BOOL MapOS2ToWin32Rectl(PRECTLOS2 rectOS2, PRECT rectWin32) 121 72 { 122 HWND hwndParent; 123 RECTLOS2 rectParent = {0}; 73 ULONG length = rectOS2->yTop - rectOS2->yBottom; 124 74 125 hwndParent = WinQueryWindow(hwndChild, QW_PARENT); 126 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent); 127 128 rectWin32->yTop = MAPWIN32POINT(&rectParent, rectChild->yTop - rectChild->yBottom, rectChild->yBottom); 129 rectWin32->yBottom = MAPWIN32POINT(&rectParent, rectChild->yTop - rectChild->yBottom, rectChild->yTop); 130 rectWin32->xLeft = rectChild->xLeft; 131 rectWin32->xRight = rectChild->xRight; 132 return TRUE; 133 } 134 //****************************************************************************** 135 // MapOS2ToWin32Rectl 136 // Convert OS/2 to Win32 RECTL structure 137 // 138 // Parameters: 139 // rectParent: OS/2 Parent window RECTL 140 // rectChild: OS/2 Child window RECTL 141 // 142 // Returns: 143 // rectChild: Converted OS/2 rectange stored in Win32 RECTL (yTop & yBottom reversed) 144 // TRUE: Success 145 // FALSE: Failures 146 //****************************************************************************** 147 BOOL MapOS2ToWin32Rectl(PRECTLOS2 rectParent, PRECTLOS2 rectChild, PRECT rectWin32) 148 { 149 rectWin32->yTop = MAPWIN32POINT(rectParent, rectChild->yTop - rectChild->yBottom, rectChild->yBottom); 150 rectWin32->yBottom = MAPWIN32POINT(rectParent, rectChild->yTop - rectChild->yBottom, rectChild->yTop); 151 rectWin32->xLeft = rectChild->xLeft; 152 rectWin32->xRight = rectChild->xRight; 75 rectWin32->bottom = length - rectOS2->yBottom; 76 rectWin32->top = length - rectOS2->yTop; 77 rectWin32->left = rectOS2->xLeft; 78 rectWin32->right = rectOS2->xRight; 153 79 return TRUE; 154 80 } … … 158 84 // 159 85 // Parameters: 160 // hwndChild: OS/2 Child window handle (IN)161 86 // rectWin32: Win32 Child window RECT (IN) 162 // rect Child:OS/2 Child window RECTL (OUT)87 // rectOS2: OS/2 Child window RECTL (OUT) 163 88 // Returns: 164 89 // TRUE: Success 165 90 // FALSE: Failures 166 91 //****************************************************************************** 167 BOOL MapWin32ToOS2Rectl( HWND hwndChild, PRECT rectWin32, PRECTLOS2 rectChild)92 BOOL MapWin32ToOS2Rectl(PRECT rectWin32, PRECTLOS2 rectOS2) 168 93 { 169 HWND hwndParent; 170 RECTLOS2 rectParent = {0}; 94 ULONG length = rectWin32->top - rectWin32->bottom; 171 95 172 hwndParent = WinQueryWindow(hwndChild, QW_PARENT); 173 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent); 174 175 rectChild->yTop = MAPWIN32POINT(&rectParent, rectWin32->yBottom - rectWin32->yTop, rectWin32->yBottom); 176 rectChild->yBottom = MAPWIN32POINT(&rectParent, rectWin32->yBottom - rectWin32->yTop, rectWin32->yTop); 177 rectChild->xLeft = rectWin32->xLeft; 178 rectChild->xRight = rectWin32->xRight; 179 return TRUE; 180 } 181 //****************************************************************************** 182 // MapWin32ToOS2Rectl 183 // Convert Win32 to OS/2 RECTL structure 184 // 185 // Parameters: 186 // rectParent: OS/2 Parent window RECTL (IN) 187 // rectWin32: Win32 Child window RECT (IN) 188 // rectChild: OS/2 Child window RECTL (OUT) 189 // Returns: 190 // TRUE: Success 191 // FALSE: Failures 192 //****************************************************************************** 193 BOOL MapWin32ToOS2Rectl(PRECTLOS2 rectParent, PRECT rectWin32, PRECTLOS2 rectChild) 194 { 195 rectChild->yTop = MAPWIN32POINT(rectParent, rectWin32->yBottom - rectWin32->yTop, rectWin32->yBottom); 196 rectChild->yBottom = MAPWIN32POINT(rectParent, rectWin32->yBottom - rectWin32->yTop, rectWin32->yTop); 197 rectChild->xLeft = rectWin32->xLeft; 198 rectChild->xRight = rectWin32->xRight; 199 return TRUE; 96 rectOS2->yBottom = length - rectWin32->bottom; 97 rectOS2->yTop = length - rectWin32->top; 98 rectOS2->xLeft = rectWin32->left; 99 rectOS2->xRight = rectWin32->right; 100 return TRUE; 200 101 } 201 102 //****************************************************************************** 202 103 //****************************************************************************** 203 HDC OSLibWinBeginPaint(HWND hwnd, PVOID pRectl)104 HDC OSLibWinBeginPaint(HWND hwnd, RECT *rectWin32) 204 105 { 205 RECTL OS2 rectlOS2;106 RECTL rectl; 206 107 207 MapWin32ToOS2Rectl(hwnd, (PRECT)pRectl, &rectlOS2); 208 return WinBeginPaint(hwnd, NULLHANDLE, (PRECTL)&rectlOS2); 108 if(WinQueryUpdateRect(hwnd, &rectl) == FALSE) 109 { 110 dprintf(("BeginPaint, NO update rectl")); 111 return 0; 112 } 113 MapOS2ToWin32Rectl((RECTLOS2 *)&rectl, rectWin32); 114 return WinBeginPaint(hwnd, NULLHANDLE, &rectl); 209 115 } 210 116 //****************************************************************************** -
trunk/src/user32/new/oslibgdi.h
r325 r340 1 /* $Id: oslibgdi.h,v 1. 1 1999-07-18 10:39:51sandervl Exp $ */1 /* $Id: oslibgdi.h,v 1.2 1999-07-19 18:40:43 sandervl Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 16 16 #include "win32type.h" 17 17 #endif 18 #include <win32wnd.h> 18 19 19 20 typedef struct … … 25 26 } RECTLOS2, *PRECTLOS2; 26 27 27 HDC OSLibWinBeginPaint(HWND hwnd, PVOID pRectl); 28 typedef struct 29 { 30 LONG x; 31 LONG y; 32 } OSLIBPOINT; 33 34 HDC OSLibWinBeginPaint(HWND hwnd, RECT *pRectl); 28 35 BOOL OSLibWinEndPaint(HDC hdc); 29 36 … … 31 38 BOOL OSLibWinReleasePS(HDC hdc); 32 39 33 ULONG MapOS2ToWin32Y(HWND hwndChild); 34 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y); 35 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG cy, ULONG y); 36 ULONG MapOS2ToWin32Y(PRECTLOS2 rectParent, PRECTLOS2 rectChild, ULONG y); 37 ULONG MapOS2ToWin32Y(PRECTLOS2 rectParent, HWND hwndChild, ULONG y); 38 ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTLOS2 rectChild, ULONG y); 39 BOOL MapOS2ToWin32Rectl(HWND hwndChild, PRECTLOS2 rectChild, PRECT rectWin32); 40 BOOL MapOS2ToWin32Rectl(PRECTLOS2 rectParent, PRECTLOS2 rectChild, PRECT rectWin32); 41 BOOL MapWin32ToOS2Rectl(HWND hwndChild, PRECTLOS2 rectChild, PRECT rectWin32); 42 BOOL MapWin32ToOS2Rectl(PRECTLOS2 rectParent, PRECTLOS2 rectChild, PRECT rectWin32); 40 //****************************************************************************** 41 //Map win32 y coordinate (in window coordinates) to OS/2 y coord. (in window coordinates) 42 //****************************************************************************** 43 inline ULONG MapOS2ToWin32Y(Win32Window *window, ULONG y) 44 { 45 return window->getWindowHeight() - y; 46 } 47 48 ULONG MapOS2ToWin32Y(HWND hwndParent, ULONG cy, ULONG y); 49 BOOL MapOS2ToWin32Point(HWND hwndParent, HWND hwndChild, OSLIBPOINT *point); 50 51 BOOL MapOS2ToWin32Rectl(PRECTLOS2 rectOS2, PRECT rectWin32); 52 BOOL MapWin32ToOS2Rectl(PRECT rectWin32, PRECTLOS2 rectOS2); 43 53 44 54 #endif //__OSLIBGDI_H__ -
trunk/src/user32/new/oslibwin.cpp
r332 r340 1 /* $Id: oslibwin.cpp,v 1.1 5 1999-07-18 18:04:29sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.16 1999-07-19 18:40:43 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 226 226 LONG cy, ULONG fl) 227 227 { 228 HWND hwndParent = hwndInsertBehind; 229 228 230 if(fl & SWP_MOVE) { 229 y = MapOS2ToWin32Y(hwnd, cy, y); 231 switch(hwndParent) 232 { 233 case HWNDOS_TOP: 234 case HWNDOS_BOTTOM: 235 hwndParent = HWND_DESKTOP; 236 break; 237 } 238 y = MapOS2ToWin32Y(hwndParent, cy, y); 230 239 } 231 240 dprintf(("WinSetWindowPos %x %x %d %d %d %d %x", hwnd, hwndInsertBehind, x, y, cx, cy, fl)); … … 255 264 } 256 265 //****************************************************************************** 266 //Returns rectangle in Win32 window coordinates 257 267 //****************************************************************************** 258 268 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect) … … 263 273 rc = WinQueryUpdateRect(hwnd, (PRECTL)&rectl); 264 274 if(rc) { 265 MapOS2ToWin32Rectl(hwnd, &rectl, (PRECT)pRect); 266 } 275 MapOS2ToWin32Rectl(&rectl, (PRECT)pRect); 276 } 277 else memset(pRect, 0, sizeof(RECT)); 267 278 return rc; 268 279 } -
trunk/src/user32/new/pmwindow.cpp
r338 r340 1 /* $Id: pmwindow.cpp,v 1.1 1 1999-07-19 13:58:38sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.12 1999-07-19 18:40:43 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 69 69 (PSZ)WIN32_STDCLASS, /* Window class name */ 70 70 (PFNWP)Win32WindowProc, /* Address of window procedure */ 71 CS_SIZEREDRAW | CS_ MOVENOTIFY | CS_HITTEST,71 CS_SIZEREDRAW | CS_HITTEST, 72 72 8)) { 73 73 dprintf(("WinRegisterClass Win32Window failed")); … … 83 83 { 84 84 POSTMSG_PACKET *postmsg; 85 Win32Window *win32wnd; 86 APIRET rc; 85 OSLIBPOINT point; 86 Win32Window *win32wnd; 87 APIRET rc; 87 88 88 89 //Restore our FS selector … … 160 161 break; 161 162 162 case WM_ MOVE:163 case WM_ADJUSTWINDOWPOS: 163 164 { 164 165 RECTLOS2 rectChild; 165 166 ULONG x, y; 166 167 167 dprintf(("OS2: WM_ MOVE%x", hwnd));168 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd)); 168 169 169 170 WinQueryWindowRect(hwnd, (PRECTL)&rectChild); … … 171 172 //Calculate position relative to parent window (real window or desktop) 172 173 x = rectChild.xLeft; 173 y = MapOS2ToWin32Y(hwnd, &rectChild, rectChild.yBottom);174 // y = MapOS2ToWin32Y(hwnd, &rectChild, rectChild.yBottom); 174 175 175 176 if(win32wnd->MsgMove(x, y)) { … … 182 183 { 183 184 dprintf(("OS2: WM_WINDOWPOSCHANGED %x", hwnd)); 184 }185 186 case WM_ADJUSTWINDOWPOS:187 {188 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd));189 // if(win32wnd->MsgWindowPosChanging(0, 0)) {190 goto RunDefWndProc;191 // }192 break;193 185 } 194 186 … … 269 261 } 270 262 //************************************************************************** 271 //Mouse messages 263 //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen 272 264 //************************************************************************** 273 265 case WM_BUTTON1DOWN: 274 266 dprintf(("OS2: WM_BUTTON1DOWN %x", hwnd)); 275 if(win32wnd->MsgButton(BUTTON_LEFTDOWN, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 276 goto RunDefWndProc; 277 } 278 break; 267 point.x = (*(POINTS *)&mp1).x; 268 point.y = (*(POINTS *)&mp1).y; 269 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 270 if(win32wnd->MsgButton(BUTTON_LEFTDOWN, point.x, point.y)) { 271 goto RunDefWndProc; 272 } 273 break; 274 279 275 case WM_BUTTON1UP: 280 276 dprintf(("OS2: WM_BUTTON1UP %x", hwnd)); 281 if(win32wnd->MsgButton(BUTTON_LEFTUP, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 277 point.x = (*(POINTS *)&mp1).x; 278 point.y = (*(POINTS *)&mp1).y; 279 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 280 if(win32wnd->MsgButton(BUTTON_LEFTUP, point.x, point.y)) { 282 281 goto RunDefWndProc; 283 282 } 284 283 break; 285 284 case WM_BUTTON1DBLCLK: 286 if(win32wnd->MsgButton(BUTTON_LEFTDBLCLICK, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 285 point.x = (*(POINTS *)&mp1).x; 286 point.y = (*(POINTS *)&mp1).y; 287 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 288 if(win32wnd->MsgButton(BUTTON_LEFTDBLCLICK, point.x, point.y)) { 287 289 goto RunDefWndProc; 288 290 } 289 291 break; 290 292 case WM_BUTTON2DOWN: 291 if(win32wnd->MsgButton(BUTTON_RIGHTDOWN, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 293 point.x = (*(POINTS *)&mp1).x; 294 point.y = (*(POINTS *)&mp1).y; 295 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 296 if(win32wnd->MsgButton(BUTTON_RIGHTDOWN, point.x, point.y)) { 292 297 goto RunDefWndProc; 293 298 } 294 299 break; 295 300 case WM_BUTTON2UP: 296 if(win32wnd->MsgButton(BUTTON_RIGHTUP, (*(POINTS *)&mp1).x,MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 301 point.x = (*(POINTS *)&mp1).x; 302 point.y = (*(POINTS *)&mp1).y; 303 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 304 if(win32wnd->MsgButton(BUTTON_RIGHTUP, point.x, point.y)) { 297 305 goto RunDefWndProc; 298 306 } 299 307 break; 300 308 case WM_BUTTON2DBLCLK: 301 if(win32wnd->MsgButton(BUTTON_RIGHTDBLCLICK, (*(POINTS *)&mp1).x,MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 309 point.x = (*(POINTS *)&mp1).x; 310 point.y = (*(POINTS *)&mp1).y; 311 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 312 if(win32wnd->MsgButton(BUTTON_RIGHTDBLCLICK, point.x, point.y)) { 302 313 goto RunDefWndProc; 303 314 } 304 315 break; 305 316 case WM_BUTTON3DOWN: 306 if(win32wnd->MsgButton(BUTTON_MIDDLEDOWN, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 317 point.x = (*(POINTS *)&mp1).x; 318 point.y = (*(POINTS *)&mp1).y; 319 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 320 if(win32wnd->MsgButton(BUTTON_MIDDLEDOWN, point.x, point.y)) { 307 321 goto RunDefWndProc; 308 322 } 309 323 break; 310 324 case WM_BUTTON3UP: 311 if(win32wnd->MsgButton(BUTTON_MIDDLEUP, (*(POINTS *)&mp1).x,MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 325 point.x = (*(POINTS *)&mp1).x; 326 point.y = (*(POINTS *)&mp1).y; 327 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 328 if(win32wnd->MsgButton(BUTTON_MIDDLEUP, point.x, point.y)) { 312 329 goto RunDefWndProc; 313 330 } 314 331 break; 315 332 case WM_BUTTON3DBLCLK: 316 if(win32wnd->MsgButton(BUTTON_MIDDLEDBLCLICK, (*(POINTS *)&mp1).x,MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 333 point.x = (*(POINTS *)&mp1).x; 334 point.y = (*(POINTS *)&mp1).y; 335 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 336 if(win32wnd->MsgButton(BUTTON_MIDDLEDBLCLICK, point.x, point.y)) { 317 337 goto RunDefWndProc; 318 338 } … … 344 364 keystate |= WMMOVE_CTRL; 345 365 346 if(!win32wnd->MsgMouseMove(keystate, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 366 //OS/2 Window coordinates -> Win32 Window coordinates 367 if(!win32wnd->MsgMouseMove(keystate, SHORT1FROMMP(mp1), MapOS2ToWin32Y(win32wnd, SHORT2FROMMP(mp1)))) { 347 368 goto RunDefWndProc; 348 369 } … … 398 419 399 420 case WM_HITTEST: 400 if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y( hwnd, (*(POINTS *)&mp1).y))) {421 if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y(OSLIB_HWND_DESKTOP, hwnd, (*(POINTS *)&mp1).y))) { 401 422 goto RunDefWndProc; 402 423 } -
trunk/src/user32/new/win32wnd.cpp
r338 r340 1 /* $Id: win32wnd.cpp,v 1.1 5 1999-07-19 13:58:38sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.16 1999-07-19 18:40:44 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 391 391 OffsetRect(&rectWindow, maxPos.x - rectWindow.left, 392 392 maxPos.y - rectWindow.top); 393 dprintf(("Sending WM_CREATE"));393 dprintf(("Sending WM_CREATE")); 394 394 if( (SendInternalMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 ) 395 395 { 396 396 SetWindowPos(HWND_TOP, rectClient.left, rectClient.top, 397 rectClient.right-rectClient.left,398 rectClient.bottom-rectClient.top,399 SWP_NOACTIVATE);397 rectClient.right-rectClient.left, 398 rectClient.bottom-rectClient.top, 399 SWP_NOACTIVATE); 400 400 401 401 if (cs->style & WS_VISIBLE) ShowWindow( sw ); … … 1241 1241 RECT rect; 1242 1242 1243 if(OSLibWinQueryUpdateRect(OS2Hwnd, &rect))1244 {//update region not empty1245 SendInternalMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0);1246 }1247 return TRUE;1243 if(OSLibWinQueryUpdateRect(OS2Hwnd, &rect)) 1244 {//update region not empty 1245 SendInternalMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0); 1246 } 1247 return TRUE; 1248 1248 } 1249 1249 //****************************************************************************** … … 1251 1251 BOOL Win32Window::IsIconic() 1252 1252 { 1253 return OSLibWinIsIconic(OS2Hwnd);1253 return OSLibWinIsIconic(OS2Hwnd); 1254 1254 } 1255 1255 //****************************************************************************** … … 1263 1263 HWND hwndRelated; 1264 1264 1265 dprintf(("GetWindow %x %d NOT COMPLETE", getWindowHandle(), uCmd)); 1266 switch(uCmd) 1267 { 1268 case GW_CHILD: 1269 getcmd = QWOS_TOP; 1270 break; 1271 case GW_HWNDFIRST: 1272 if(getParent()) { 1273 getcmd = QWOS_TOP; //top of child windows 1274 } 1275 else getcmd = QWOS_TOP; //TODO 1276 break; 1277 case GW_HWNDLAST: 1278 if(getParent()) { 1279 getcmd = QWOS_BOTTOM; //bottom of child windows 1280 } 1281 else getcmd = QWOS_BOTTOM; //TODO 1282 break; 1283 case GW_HWNDNEXT: 1284 getcmd = QWOS_NEXT; 1285 break; 1286 case GW_HWNDPREV: 1287 getcmd = QWOS_PREV; 1288 break; 1289 case GW_OWNER: 1290 if(owner) { 1291 return owner->getWindowHandle(); 1292 } 1293 else return 0; 1294 } 1295 hwndRelated = OSLibWinQueryWindow(OS2Hwnd, getcmd); 1296 if(hwndRelated) 1297 { 1298 win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR); 1299 magic = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC); 1300 if(CheckMagicDword(magic) && win32wnd) 1265 dprintf(("GetWindow %x %d NOT COMPLETE", getWindowHandle(), uCmd)); 1266 switch(uCmd) 1301 1267 { 1302 return win32wnd->getWindowHandle(); 1268 case GW_CHILD: 1269 getcmd = QWOS_TOP; 1270 break; 1271 case GW_HWNDFIRST: 1272 if(getParent()) { 1273 getcmd = QWOS_TOP; //top of child windows 1274 } 1275 else getcmd = QWOS_TOP; //TODO 1276 break; 1277 case GW_HWNDLAST: 1278 if(getParent()) { 1279 getcmd = QWOS_BOTTOM; //bottom of child windows 1280 } 1281 else getcmd = QWOS_BOTTOM; //TODO 1282 break; 1283 case GW_HWNDNEXT: 1284 getcmd = QWOS_NEXT; 1285 break; 1286 case GW_HWNDPREV: 1287 getcmd = QWOS_PREV; 1288 break; 1289 case GW_OWNER: 1290 if(owner) { 1291 return owner->getWindowHandle(); 1292 } 1293 else return 0; 1303 1294 } 1304 } 1305 return 0; 1295 hwndRelated = OSLibWinQueryWindow(OS2Hwnd, getcmd); 1296 if(hwndRelated) 1297 { 1298 win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR); 1299 magic = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC); 1300 if(CheckMagicDword(magic) && win32wnd) 1301 { 1302 return win32wnd->getWindowHandle(); 1303 } 1304 } 1305 return 0; 1306 1306 } 1307 1307 //****************************************************************************** -
trunk/src/user32/new/win32wnd.h
r338 r340 1 /* $Id: win32wnd.h,v 1.1 4 1999-07-19 13:58:39sandervl Exp $ */1 /* $Id: win32wnd.h,v 1.15 1999-07-19 18:40:44 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 86 86 DWORD getWindowId() { return windowId; }; 87 87 void setWindowId(DWORD id) { windowId = id; }; 88 ULONG getWindowHeight() { return rectClient.bottom - rectClient.top; }; 88 89 89 90 DWORD getFlags() { return flags; }; -
trunk/src/user32/new/wingdi.cpp
r328 r340 1 /* $Id: wingdi.cpp,v 1. 3 1999-07-18 14:39:35sandervl Exp $ */1 /* $Id: wingdi.cpp,v 1.4 1999-07-19 18:40:44 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window graphics apis for OS/2 … … 24 24 Win32Window *window; 25 25 26 window = Win32Window::GetWindowFromHandle(hwnd); 27 if(!window) { 28 dprintf(("GetDC, window %x not found", hwnd)); 29 return 0; 30 } 31 dprintf(("BeginPaint %X\n", hwnd)); 32 if(OSLibWinQueryUpdateRect(window->getOS2WindowHandle(), &lps->rcPaint) == FALSE) 33 { 34 dprintf(("BeginPaint, NO update rectl")); 35 return 0; 36 } 37 lps->hdc = OSLibWinBeginPaint(window->getOS2WindowHandle(), (PVOID)&lps->rcPaint); 26 window = Win32Window::GetWindowFromHandle(hwnd); 27 if(!window) { 28 dprintf(("GetDC, window %x not found", hwnd)); 29 return 0; 30 } 31 dprintf(("BeginPaint %X\n", hwnd)); 32 lps->hdc = OSLibWinBeginPaint(window->getOS2WindowHandle(), &lps->rcPaint); 38 33 39 return lps->hdc;34 return lps->hdc; 40 35 } 41 36 //****************************************************************************** … … 55 50 window = Win32Window::GetWindowFromHandle(hwnd); 56 51 if(!window) { 57 58 52 dprintf(("GetDC, window %x not found", hwnd)); 53 return 0; 59 54 } 60 55 dprintf(("GetDC %x", hwnd));
Note:
See TracChangeset
for help on using the changeset viewer.