- Timestamp:
- Jan 12, 2000, 6:37:29 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/dc.cpp
r2353 r2421 1 /* $Id: dc.cpp,v 1.1 0 2000-01-07 17:38:46cbratschi Exp $ */1 /* $Id: dc.cpp,v 1.11 2000-01-12 17:37:28 cbratschi Exp $ */ 2 2 3 3 /* … … 553 553 if (updateRegionExists) 554 554 { 555 //CB: for PM empty rect is valid 556 if ((rectl.xLeft == rectl.xRight) || (rectl.yTop == rectl.yBottom)) return FALSE; 555 557 //SvL: Hack for memory.exe (doesn't get repainted properly otherwise) 556 558 // if (wnd->isOwnDC() && wnd->getOwnDC()) … … 604 606 605 607 if (updateRegionExists) 608 { 609 //CB: for PM empty rect is valid 610 if ((rectl.xLeft == rectl.xRight) || (rectl.yTop == rectl.yBottom)) return FALSE; 606 611 mapOS2ToWin32Rect(hwnd,(PRECTLOS2)&rectl,pRect); 607 else608 pRect->left = pRect->top = pRect->right = pRect->bottom = 0;612 } else 613 pRect->left = pRect->top = pRect->right = pRect->bottom = 0; 609 614 610 615 return updateRegionExists; … … 722 727 ULONG BytesNeeded; 723 728 PRGNDATA_W RgnData; 724 PRECT Lpr;729 PRECT pr; 725 730 int i; 726 LONG height = OSLibQueryScreenHeight();731 RECTL rectl; 727 732 728 733 if (!hrgn) … … 736 741 737 742 i = RgnData->rdh.nCount; 738 pr = (PRECT L)(RgnData->Buffer);743 pr = (PRECT)(RgnData->Buffer); 739 744 740 745 success = TRUE; 741 746 if (flags & DCX_EXCLUDERGN_W) 747 { 748 #if 0 //CB: todo 742 749 for (; (i > 0) && success; i--, pr++) { 743 750 LONG y = pr->yBottom; … … 747 754 success &= GpiExcludeClipRectangle (pHps->hps, pr); 748 755 } 749 else 750 for (; (i > 0) && success; i--, pr++) { 751 LONG y = pr->yBottom; 752 753 pr->yBottom = height - pr->yTop; 754 pr->yTop = height - y; 755 success &= GpiIntersectClipRectangle (pHps->hps, pr); 756 } 756 #endif 757 } else //DCX_INTERSECTRGN_W 758 { 759 O32_SelectClipRgn(pHps->hps,hrgn); //CB: works so far 760 } 757 761 if (!success) 758 762 goto error; -
trunk/src/user32/new/dc.h
r2290 r2421 1 /* $Id: dc.h,v 1. 3 2000-01-01 14:54:51cbratschi Exp $ */1 /* $Id: dc.h,v 1.4 2000-01-12 17:37:29 cbratschi Exp $ */ 2 2 /* 3 3 * public dc functions … … 343 343 344 344 return yyrc; 345 } 345 } 346 346 347 347 BOOL OPEN32API _O32_CreateCaret (HWND hwnd, HBITMAP hbm, int width, int height); … … 353 353 354 354 yyrc = _O32_CreateCaret(a, b, c, d); 355 SetFS(sel); 356 357 return yyrc; 358 } 359 360 BOOL OPEN32API _O32_SelectClipRgn(HDC hdc,HRGN hrgn); 361 362 inline BOOL O32_SelectClipRgn(HDC hdc,HRGN hrgn) 363 { 364 BOOL yyrc; 365 USHORT sel = RestoreOS2FS(); 366 367 yyrc = _O32_SelectClipRgn(hdc,hrgn); 355 368 SetFS(sel); 356 369 … … 426 439 // from pmddi.h: 427 440 /* CopyClipRegion */ 428 441 429 442 #define COPYCRGN_ALLINTERSECT 0L 430 443 #define COPYCRGN_VISRGN 1L … … 432 445 433 446 /* SetupDC */ 434 447 435 448 #define SETUPDC_VISRGN 0x00000001L 436 449 #define SETUPDC_ORIGIN 0x00000002L -
trunk/src/user32/new/pmframe.cpp
r2418 r2421 1 /* $Id: pmframe.cpp,v 1.1 2 2000-01-12 15:14:16 sandervlExp $ */1 /* $Id: pmframe.cpp,v 1.13 2000-01-12 17:37:29 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 107 107 { 108 108 case WM_FORMATFRAME: 109 109 break; 110 110 111 111 case WM_MINMAXFRAME: … … 118 118 { 119 119 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W); 120 } 120 } 121 121 else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE) 122 122 { 123 123 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W); 124 } 124 } 125 125 else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE) 126 126 { … … 262 262 263 263 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) 264 265 266 267 268 269 270 271 272 273 274 264 { 265 swpClient.hwnd = win32wnd->getOS2WindowHandle(); 266 swpClient.hwndInsertBehind = 0; 267 swpClient.x = 0; 268 swpClient.y = 0; 269 swpClient.cx = 0; 270 swpClient.cy = 0; 271 swpClient.fl = pswp->fl & ~SWP_ZORDER; 272 WinSetMultWindowPos(thdb->hab, &swpClient, 1); 273 goto PosChangedEnd; 274 } 275 275 276 276 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { … … 285 285 286 286 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 287 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 288 289 win32wnd->MsgFormatFrame(); 290 //CB: todo: use result for WM_CALCVALIDRECTS 291 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 292 293 swpClient.hwnd = win32wnd->getOS2WindowHandle(); 294 swpClient.hwndInsertBehind = 0; 295 swpClient.x = rect.xLeft; 296 swpClient.y = rect.yBottom; 297 swpClient.cx = rect.xRight-rect.xLeft; 298 swpClient.cy = rect.yTop-rect.yBottom; 299 //TODO: Get rid of SWP_SHOW; needed for winhlp32 button bar for now 300 swpClient.fl = (pswp->fl & ~SWP_ZORDER) | SWP_MOVE | SWP_SHOW; 301 WinSetMultWindowPos(thdb->hab, &swpClient, 1); 302 } 303 303 304 304 if(win32wnd->CanReceiveSizeMsgs()) … … 307 307 //update child positions: rectWindow is in window coordinates 308 308 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 309 310 309 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle()); 310 } 311 311 312 312 PosChangedEnd: … … 317 317 case WM_CALCVALIDRECTS: 318 318 { 319 PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1;320 UINT res = 0; //= CVR_ALIGNLEFT | CVR_ALIGNTOP;321 322 //CB: todo: use WM_NCCALCSIZE result323 if (win32wnd->getWindowClass())324 {325 DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W);326 327 if ((dwStyle & CS_HREDRAW_W) && (newRect->xRight-newRect->xLeft != oldRect->xRight-oldRect->xLeft))328 res |= CVR_REDRAW;329 else if ((dwStyle & CS_VREDRAW_W) && (newRect->yTop-newRect->yBottom != oldRect->yTop-oldRect->yBottom))330 res |= CVR_REDRAW;331 } else res |= CVR_REDRAW;332 333 //CB: PM sets client window position334 // RestoreOS2TIB();335 // OldFrameProc(hwnd,msg,mp1,mp2);336 // SetWin32TIB();337 338 319 RestoreOS2TIB(); 339 return (MRESULT) res;320 return (MRESULT)CVR_REDRAW; //always redraw frame 340 321 } 341 322 … … 357 338 if (topOwner) WinSetWindowPos(topOwner->getOS2FrameWindowHandle(),hwnd,0,0,0,0,SWP_ZORDER); 358 339 } 359 } 340 } 360 341 else 361 342 { … … 404 385 SWP swpClient = {0}; 405 386 406 407 408 409 410 411 412 413 414 415 416 417 387 win32wnd->MsgFormatFrame(); 388 //CB: todo: use result for WM_CALCVALIDRECTS 389 mapWin32ToOS2Rect(WinQueryWindow(win32wnd->getOS2FrameWindowHandle(),QW_PARENT),win32wnd->getOS2FrameWindowHandle(),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 390 391 swpClient.hwnd = win32wnd->getOS2WindowHandle(); 392 swpClient.hwndInsertBehind = 0; 393 swpClient.x = rect.xLeft; 394 swpClient.y = rect.yBottom; 395 swpClient.cx = rect.xRight-rect.xLeft; 396 swpClient.cy = rect.yTop-rect.yBottom; 397 swpClient.fl = SWP_MOVE | SWP_SIZE; 398 WinSetMultWindowPos(GetThreadHAB(), &swpClient, 1); 418 399 } 419 400 //****************************************************************************** -
trunk/src/user32/new/pmwindow.cpp
r2415 r2421 1 /* $Id: pmwindow.cpp,v 1.3 6 2000-01-12 12:40:46 sandervlExp $ */1 /* $Id: pmwindow.cpp,v 1.37 2000-01-12 17:37:29 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 297 297 case WM_CALCVALIDRECTS: 298 298 { 299 dprintf(("OS2: WM_CALCVALIDRECTS")); 300 goto RunDefWndProc; 299 PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1; 300 UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP; 301 302 //CB: todo: use WM_NCCALCSIZE result 303 if (win32wnd->getWindowClass()) 304 { 305 DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W); 306 307 if ((dwStyle & CS_HREDRAW_W) && (newRect->xRight-newRect->xLeft != oldRect->xRight-oldRect->xLeft)) 308 res |= CVR_REDRAW; 309 else if ((dwStyle & CS_VREDRAW_W) && (newRect->yTop-newRect->yBottom != oldRect->yTop-oldRect->yBottom)) 310 res |= CVR_REDRAW; 311 } else res |= CVR_REDRAW; 312 313 RestoreOS2TIB(); 314 WinDefWindowProc(hwnd,msg,mp1,mp2); 315 RestoreOS2TIB(); 316 return (MRESULT)res; 301 317 } 302 318 -
trunk/src/user32/new/win32wbase.cpp
r2418 r2421 1 /* $Id: win32wbase.cpp,v 1.3 6 2000-01-12 15:14:16 sandervlExp $ */1 /* $Id: win32wbase.cpp,v 1.37 2000-01-12 17:37:29 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 1034 1034 RECT client = rectClient; 1035 1035 1036 //CB: bug in dc.cpp!!!1037 if ((rect.left == rect.right) || (rect.bottom == rect.top)) return 0;1038 1036 mapWin32Rect(getParent() ? getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,OS2HwndFrame,&client); 1039 1037 if ((rect.left >= client.left) && (rect.left < client.right) && … … 1042 1040 (rect.bottom >= client.top) && (rect.bottom < client.bottom)) 1043 1041 return 0; 1042 1044 1043 hrgn = CreateRectRgnIndirect(&rect); 1045 1044 if (!hrgn) return 0; 1046 //CB: bug in GetDCEx with region!!! 1047 rc = SendInternalMessageA(WM_NCPAINT,/*hrgn*/0,0); 1048 //dprintf(("CB: %d %d %d %d",rect.left,rect.top,rect.bottom,rect.right)); 1045 rc = SendInternalMessageA(WM_NCPAINT,hrgn,0); 1049 1046 DeleteObject(hrgn); 1050 //CB: todo: check if intersection with client, what does PM's frame???1051 1047 1052 1048 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.