Changeset 328 for trunk/src/user32/new/pmwindow.cpp
- Timestamp:
- Jul 18, 1999, 4:39:35 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/pmwindow.cpp
r325 r328 1 /* $Id: pmwindow.cpp,v 1. 8 1999-07-18 10:39:51sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.9 1999-07-18 14:39:35 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 39 39 hmq = WinCreateMsgQueue(hab, 0); 40 40 41 if(!hab || !hmq) 41 if(!hab || !hmq) 42 42 { 43 43 UINT error; … … 46 46 if (!hab || error != PMERR_MSG_QUEUE_ALREADY_EXISTS) 47 47 { 48 49 50 51 } 52 48 dprintf(("WinInitialize or WinCreateMsgQueue failed %x %x", hab, hmq)); 49 dprintf((" Error = %x",error)); 50 return(FALSE); 51 } 52 else 53 53 { 54 55 56 57 58 59 60 54 if(!hab) { 55 hab = WinQueryAnchorBlock(HWND_DESKTOP); 56 dprintf(("WinQueryAnchorBlock returned %x", hab)); 57 } 58 if(!hmq) { 59 hmq = HMQ_CURRENT; 60 } 61 61 } 62 62 } … … 69 69 (PSZ)WIN32_STDCLASS, /* Window class name */ 70 70 (PFNWP)Win32WindowProc, /* Address of window procedure */ 71 CS_SIZEREDRAW , /* Class style */71 CS_SIZEREDRAW | CS_MOVENOTIFY | CS_HITTEST, 72 72 8)) { 73 73 dprintf(("WinRegisterClass Win32Window failed")); … … 101 101 //internal messages 102 102 case WM_WIN32_POSTMESSAGEA: 103 postmsg = (POSTMSG_PACKET *)mp1;104 if(postmsg == NULL) {105 106 107 }108 win32wnd->SendMessageA(postmsg->Msg, postmsg->wParam, postmsg->lParam);109 free(postmsg);110 break;111 103 postmsg = (POSTMSG_PACKET *)mp1; 104 if(postmsg == NULL) { 105 dprintf(("WM_WIN32_POSTMESSAGEA, postmsg NULL!!")); 106 break; 107 } 108 win32wnd->SendMessageA(postmsg->Msg, postmsg->wParam, postmsg->lParam); 109 free(postmsg); 110 break; 111 112 112 case WM_WIN32_POSTMESSAGEW: 113 postmsg = (POSTMSG_PACKET *)mp1;114 if(postmsg == NULL) {115 116 117 }118 win32wnd->SendMessageW(postmsg->Msg, postmsg->wParam, postmsg->lParam);119 free(postmsg);120 break;113 postmsg = (POSTMSG_PACKET *)mp1; 114 if(postmsg == NULL) { 115 dprintf(("WM_WIN32_POSTMESSAGEW, postmsg NULL!!")); 116 break; 117 } 118 win32wnd->SendMessageW(postmsg->Msg, postmsg->wParam, postmsg->lParam); 119 free(postmsg); 120 break; 121 121 122 122 //OS/2 msgs 123 123 case WM_CREATE: 124 124 //Processing is done in after WinCreateWindow returns 125 dprintf(("OS2: WM_CREATE %x", hwnd));126 RestoreOS2TIB();127 return (MRESULT)FALSE;125 dprintf(("OS2: WM_CREATE %x", hwnd)); 126 RestoreOS2TIB(); 127 return (MRESULT)FALSE; 128 128 129 129 case WM_QUIT: 130 dprintf(("OS2: WM_QUIT %x", hwnd));130 dprintf(("OS2: WM_QUIT %x", hwnd)); 131 131 if(win32wnd->MsgQuit()) { 132 132 goto RunDefWndProc; … … 135 135 136 136 case WM_CLOSE: 137 dprintf(("OS2: WM_CLOSE %x", hwnd));137 dprintf(("OS2: WM_CLOSE %x", hwnd)); 138 138 if(win32wnd->MsgClose()) { 139 139 goto RunDefWndProc; … … 142 142 143 143 case WM_DESTROY: 144 dprintf(("OS2: WM_DESTROY %x", hwnd));144 dprintf(("OS2: WM_DESTROY %x", hwnd)); 145 145 if(win32wnd->MsgDestroy()) { 146 146 goto RunDefWndProc; … … 149 149 150 150 case WM_ENABLE: 151 dprintf(("OS2: WM_ENABLE %x", hwnd));151 dprintf(("OS2: WM_ENABLE %x", hwnd)); 152 152 if(win32wnd->MsgEnable((ULONG)mp1)) { 153 153 goto RunDefWndProc; … … 156 156 157 157 case WM_SHOW: 158 dprintf(("OS2: WM_SHOW %x", hwnd));158 dprintf(("OS2: WM_SHOW %x", hwnd)); 159 159 if(win32wnd->MsgShow((ULONG)mp1)) { 160 160 goto RunDefWndProc; … … 165 165 { 166 166 RECTLOS2 rectChild; 167 ULONG x Parent, yParent;168 169 dprintf(("OS2: WM_MOVE %x", hwnd));170 171 WinQueryWindowRect(hwnd, (PRECTL)&rectChild);167 ULONG x, y; 168 169 dprintf(("OS2: WM_MOVE %x", hwnd)); 170 171 WinQueryWindowRect(hwnd, (PRECTL)&rectChild); 172 172 173 173 //Calculate position relative to parent window (real window or desktop) 174 x Parent= rectChild.xLeft;175 y Parent= MapOS2ToWin32Y(hwnd, &rectChild, rectChild.yBottom);176 177 if(win32wnd->MsgMove(xParent, yParent)) {178 174 x = rectChild.xLeft; 175 y = MapOS2ToWin32Y(hwnd, &rectChild, rectChild.yBottom); 176 177 if(win32wnd->MsgMove(x, y)) { 178 goto RunDefWndProc; 179 179 } 180 180 break; … … 183 183 case WM_WINDOWPOSCHANGED: 184 184 { 185 break;185 dprintf(("OS2: WM_WINDOWPOSCHANGED %x", hwnd)); 186 186 } 187 187 188 188 case WM_ADJUSTWINDOWPOS: 189 189 { 190 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd));191 // 192 goto RunDefWndProc; 193 // 190 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd)); 191 // if(win32wnd->MsgWindowPosChanging(0, 0)) { 192 goto RunDefWndProc; 193 // } 194 194 break; 195 195 } … … 199 199 HPS hps; 200 200 201 dprintf(("OS2: WM_ERASEBACKGROUND %x", hwnd));201 dprintf(("OS2: WM_ERASEBACKGROUND %x", hwnd)); 202 202 hps = WinGetPS(hwnd); 203 if( win32wnd->MsgEraseBackGround((ULONG)hps))203 if(!win32wnd->MsgEraseBackGround((ULONG)hps)) 204 204 { 205 205 /* … … 217 217 SWP swp; 218 218 219 dprintf(("OS2: WM_SIZE %x", hwnd));219 dprintf(("OS2: WM_SIZE %x", hwnd)); 220 220 rc = WinQueryWindowPos(hwnd, &swp); 221 221 if(rc == FALSE) { … … 236 236 HWND hwndActivate = (HWND)mp1; 237 237 238 dprintf(("OS2: WM_ACTIVATE %x", hwnd));238 dprintf(("OS2: WM_ACTIVATE %x", hwnd)); 239 239 if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) { 240 240 //another (non-win32) application's window … … 248 248 } 249 249 case WM_FOCUSCHANGE: 250 break; 250 dprintf(("OS2: WM_FOCUSCHANGE %x", hwnd)); 251 goto RunDefWndProc; 251 252 252 253 case WM_SETFOCUS: … … 254 255 HWND hwndFocus = (HWND)mp1; 255 256 256 dprintf(("OS2: WM_SETFOCUS %x", hwnd));257 dprintf(("OS2: WM_SETFOCUS %x", hwnd)); 257 258 if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) { 258 259 //another (non-win32) application's window … … 273 274 //************************************************************************** 274 275 case WM_BUTTON1DOWN: 275 if(win32wnd->MsgButton(BUTTON_LEFTDOWN, (*(POINTS *)&mp1).x, (*(POINTS *)&mp1).y)) { 276 dprintf(("OS2: WM_BUTTON1DOWN %x", hwnd)); 277 if(win32wnd->MsgButton(BUTTON_LEFTDOWN, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 276 278 goto RunDefWndProc; 277 279 } 278 280 break; 279 281 case WM_BUTTON1UP: 280 if(win32wnd->MsgButton(BUTTON_LEFTUP, (*(POINTS *)&mp1).x, (*(POINTS *)&mp1).y)) { 282 dprintf(("OS2: WM_BUTTON1UP %x", hwnd)); 283 if(win32wnd->MsgButton(BUTTON_LEFTUP, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 281 284 goto RunDefWndProc; 282 285 } 283 286 break; 284 287 case WM_BUTTON1DBLCLK: 285 if(win32wnd->MsgButton(BUTTON_LEFTDBLCLICK, (*(POINTS *)&mp1).x, (*(POINTS *)&mp1).y)) {288 if(win32wnd->MsgButton(BUTTON_LEFTDBLCLICK, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 286 289 goto RunDefWndProc; 287 290 } 288 291 break; 289 292 case WM_BUTTON2DOWN: 290 if(win32wnd->MsgButton(BUTTON_RIGHTDOWN, (*(POINTS *)&mp1).x, (*(POINTS *)&mp1).y)) {293 if(win32wnd->MsgButton(BUTTON_RIGHTDOWN, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 291 294 goto RunDefWndProc; 292 295 } 293 296 break; 294 297 case WM_BUTTON2UP: 295 if(win32wnd->MsgButton(BUTTON_RIGHTUP, (*(POINTS *)&mp1).x, (*(POINTS *)&mp1).y)) {298 if(win32wnd->MsgButton(BUTTON_RIGHTUP, (*(POINTS *)&mp1).x,MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 296 299 goto RunDefWndProc; 297 300 } 298 301 break; 299 302 case WM_BUTTON2DBLCLK: 300 if(win32wnd->MsgButton(BUTTON_RIGHTDBLCLICK, (*(POINTS *)&mp1).x, (*(POINTS *)&mp1).y)) { 301 goto RunDefWndProc; 302 } 303 break; 303 if(win32wnd->MsgButton(BUTTON_RIGHTDBLCLICK, (*(POINTS *)&mp1).x,MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 304 goto RunDefWndProc; 305 } 306 break; 307 case WM_BUTTON3DOWN: 308 if(win32wnd->MsgButton(BUTTON_MIDDLEDOWN, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 309 goto RunDefWndProc; 310 } 311 break; 312 case WM_BUTTON3UP: 313 if(win32wnd->MsgButton(BUTTON_MIDDLEUP, (*(POINTS *)&mp1).x,MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 314 goto RunDefWndProc; 315 } 316 break; 317 case WM_BUTTON3DBLCLK: 318 if(win32wnd->MsgButton(BUTTON_MIDDLEDBLCLICK, (*(POINTS *)&mp1).x,MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 319 goto RunDefWndProc; 320 } 321 break; 322 304 323 case WM_BUTTON2MOTIONSTART: 305 324 case WM_BUTTON2MOTIONEND: … … 308 327 case WM_BUTTON1MOTIONEND: 309 328 case WM_BUTTON1CLICK: 310 case WM_BUTTON3DOWN:311 case WM_BUTTON3UP:312 case WM_BUTTON3DBLCLK:313 329 case WM_BUTTON3MOTIONSTART: 314 330 case WM_BUTTON3MOTIONEND: 315 331 case WM_BUTTON3CLICK: 316 break;332 goto RunDefWndProc; 317 333 318 334 case WM_MOUSEMOVE: 319 break; 335 { 336 ULONG keystate = 0; 337 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1)) 338 keystate |= WMMOVE_LBUTTON; 339 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2)) 340 keystate |= WMMOVE_MBUTTON; 341 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3)) 342 keystate |= WMMOVE_RBUTTON; 343 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT)) 344 keystate |= WMMOVE_SHIFT; 345 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL)) 346 keystate |= WMMOVE_CTRL; 347 348 if(!win32wnd->MsgMouseMove(keystate, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 349 goto RunDefWndProc; 350 } 351 break; 352 } 320 353 321 354 //************************************************************************** … … 323 356 //************************************************************************** 324 357 case WM_VSCROLL: 325 break;326 358 case WM_HSCROLL: 327 break;328 359 329 360 case WM_CONTROL: 330 break;331 361 332 362 case WM_COMMAND: 333 363 case WM_SYSCOMMAND: 334 break;335 364 336 365 case WM_CHAR: 337 break;338 366 339 367 case WM_INITMENU: … … 341 369 case WM_MENUEND: 342 370 case WM_NEXTMENU: 343 break;344 371 345 372 case WM_TIMER: 346 break;347 373 goto RunDefWndProc; 374 348 375 case WM_SETWINDOWPARAMS: 349 376 { 350 377 WNDPARAMS *wndParams = (WNDPARAMS *)mp1; 351 378 352 dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));353 if(wndParams->fsStatus & WPM_TEXT) {354 355 356 357 }358 goto RunDefWndProc;379 dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd)); 380 if(wndParams->fsStatus & WPM_TEXT) { 381 if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) { 382 goto RunDefWndProc; 383 } 384 } 385 goto RunDefWndProc; 359 386 } 360 387 361 388 case WM_PAINT: 362 dprintf(("OS2: WM_PAINT %x", hwnd));389 dprintf(("OS2: WM_PAINT %x", hwnd)); 363 390 if(win32wnd->MsgPaint(0, 0)) { 364 391 goto RunDefWndProc; … … 366 393 break; 367 394 395 case WM_HITTEST: 396 if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) { 397 goto RunDefWndProc; 398 } 399 break; 400 368 401 case WM_SYSCOLORCHANGE: 369 402 case WM_SYSVALUECHANGED: 370 break;371 372 403 case WM_CALCVALIDRECTS: 373 404 case WM_QUERYWINDOWPARAMS: 374 case WM_HITTEST:375 405 case WM_SETSELECTION: 376 406 case WM_PPAINT: … … 391 421 case WM_SAVEAPPLICATION: 392 422 case WM_SEMANTICEVENT: 393 break;394 423 default: 395 dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));424 dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd)); 396 425 RestoreOS2TIB(); 397 426 return WinDefWindowProc( hwnd, msg, mp1, mp2 );
Note:
See TracChangeset
for help on using the changeset viewer.