- Timestamp:
- Feb 24, 2000, 8:19:10 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/dc.cpp
r2804 r2881 1 /* $Id: dc.cpp,v 1.4 8 2000-02-16 14:34:13sandervl Exp $ */1 /* $Id: dc.cpp,v 1.49 2000-02-24 19:19:07 sandervl Exp $ */ 2 2 3 3 /* … … 38 38 #include <winerror.h> 39 39 40 #define DBG_LOCALLOG 40 #define DBG_LOCALLOG DBG_dc 41 41 #include "dbglocal.h" 42 42 … … 488 488 489 489 pHps->hdcType = TYPE_3; 490 491 HideCaret(hwnd); 492 493 if(wnd->needsEraseBkgnd()) { 494 wnd->setEraseBkgnd(FALSE); 495 lpps->fErase = (wnd->MsgEraseBackGround(pHps->hps) != 0); 496 } 497 else lpps->fErase = TRUE; 490 498 lpps->hdc = (HDC)hps; 491 492 if(!wnd->isSuppressErase()) {493 wnd->setSuppressErase(TRUE);494 wnd->setEraseBkgnd (FALSE, !wnd->MsgEraseBackGround(lpps->hdc));495 }496 lpps->fErase = wnd->isPSErase();497 499 498 500 if (!hPS_ownDC) … … 522 524 dprintf (("USER32: EndPaint(%x)", hwnd)); 523 525 526 ShowCaret(hwnd); 524 527 if (!pPaint || !pPaint->hdc ) 525 528 return TRUE; … … 534 537 WinEndPaint (pHps->hps); 535 538 } 536 wnd->set SuppressErase(FALSE);539 wnd->setEraseBkgnd(TRUE); 537 540 538 541 exit: … … 618 621 } 619 622 620 if(!wnd->isSuppressErase() && lComplexity != RGN_NULL) { 621 wnd->setSuppressErase(TRUE); 622 wnd->setEraseBkgnd (FALSE, !wnd->MsgEraseBackGround(pHps->hps)); 623 } 624 lpps->fErase = wnd->isPSErase(); //correct ?? 623 if(wnd->needsEraseBkgnd() && lComplexity != RGN_NULL) { 624 wnd->setEraseBkgnd(FALSE); 625 lpps->fErase = (wnd->MsgEraseBackGround(pHps->hps) != 0); 626 } 627 else lpps->fErase = TRUE; 628 625 629 lpps->hdc = (HDC)pHps->hps; 626 630 … … 683 687 dprintf(("EndPaint: wrong hdc %x!!", pPaint->hdc)); 684 688 } 685 wnd->set SuppressErase(FALSE);689 wnd->setEraseBkgnd(TRUE); 686 690 ShowCaret(hwnd); 687 691 … … 1045 1049 if (redraw & (RDW_FRAME_W | RDW_NOFRAME_W)) 1046 1050 { 1047 O32_SetLastError (ERROR_NOT_SUPPORTED);1048 return FALSE;1051 O32_SetLastError (ERROR_NOT_SUPPORTED); 1052 return FALSE; 1049 1053 } 1050 1054 … … 1056 1060 return FALSE; 1057 1061 #else 1058 hwnd = HWND_DESKTOP; 1059 wnd = Win32BaseWindow::GetWindowFromOS2Handle(OSLIB_HWND_DESKTOP); 1060 1061 if (!wnd) 1062 { 1063 dprintf(("USER32:dc: RedrawWindow can't find desktop window %08xh\n", 1062 hwnd = HWND_DESKTOP; 1063 wnd = Win32BaseWindow::GetWindowFromOS2Handle(OSLIB_HWND_DESKTOP); 1064 1065 if (!wnd) 1066 { 1067 dprintf(("USER32:dc: RedrawWindow can't find desktop window %08xh\n", 1068 hwnd)); 1069 O32_SetLastError (ERROR_INVALID_PARAMETER); 1070 return FALSE; 1071 } 1072 #endif 1073 } 1074 else 1075 { 1076 wnd = Win32BaseWindow::GetWindowFromHandle (hwnd); 1077 1078 if (!wnd) 1079 { 1080 dprintf(("USER32:dc: RedrawWindow can't find window %08xh\n", 1064 1081 hwnd)); 1065 O32_SetLastError (ERROR_INVALID_PARAMETER); 1066 return FALSE; 1067 } 1068 #endif 1069 } 1070 else 1071 { 1072 wnd = Win32BaseWindow::GetWindowFromHandle (hwnd); 1073 1074 if (!wnd) 1075 { 1076 dprintf(("USER32:dc: RedrawWindow can't find window %08xh\n", 1077 hwnd)); 1078 O32_SetLastError (ERROR_INVALID_PARAMETER); 1079 return FALSE; 1080 } 1081 hwnd = wnd->getOS2WindowHandle(); 1082 O32_SetLastError (ERROR_INVALID_PARAMETER); 1083 return FALSE; 1084 } 1085 hwnd = wnd->getOS2WindowHandle(); 1082 1086 } 1083 1087 … … 1088 1092 RECTL rectl; 1089 1093 1090 if (redraw & RDW_UPDATENOW_W) redraw &= ~RDW_ERASENOW_W;1091 1092 //SvL: Should we check if there is already an invalidated window part before1093 // deciding to skip erase?1094 if(redraw & RDW_NOERASE_W || ((redraw & (RDW_INVALIDATE_W|RDW_ERASE_W|RDW_ERASENOW_W)) == RDW_INVALIDATE_W)) {1095 wnd->setSuppressErase(TRUE);1096 }1097 else wnd->setSuppressErase(FALSE);1098 1099 1094 if (hrgn) 1100 1095 { … … 1136 1131 if (redraw & RDW_INVALIDATE_W) 1137 1132 { 1138 if (redraw & RDW_ERASE_W) 1139 wnd->setEraseBkgnd (TRUE, TRUE); 1140 1141 if (!pRect && !hrgn) 1142 success = WinInvalidateRect (hwnd, NULL, IncludeChildren); 1143 else if (hrgn) 1144 success = WinInvalidateRegion (hwnd, hrgnTemp, IncludeChildren); 1145 else 1146 success = WinInvalidateRect (hwnd, &rectl, IncludeChildren); 1147 if (!success) goto error; 1133 //TODO: SvL: pingpong.exe doesn't have RDW_NOERASE, but doesn't want WM_ERASEBKGND msgs 1134 if (redraw & RDW_ERASE_W) 1135 wnd->setEraseBkgnd (TRUE); 1136 1137 if (!pRect && !hrgn) 1138 success = WinInvalidateRect (hwnd, NULL, IncludeChildren); 1139 else 1140 if (hrgn) 1141 success = WinInvalidateRegion (hwnd, hrgnTemp, IncludeChildren); 1142 else 1143 success = WinInvalidateRect (hwnd, &rectl, IncludeChildren); 1144 1145 if (!success) goto error; 1148 1146 } 1149 1147 else if (redraw & RDW_VALIDATE_W) 1150 1148 { 1151 if (WinQueryUpdateRect (hwnd, NULL)) 1152 { 1153 if (!pRect && !hrgn) 1154 success = WinValidateRect (hwnd, NULL, IncludeChildren); 1155 else if (hrgn) 1156 success = WinValidateRegion (hwnd, hrgnTemp, IncludeChildren); 1157 else 1158 success = WinValidateRect (hwnd, &rectl, IncludeChildren); 1159 if (!success) goto error; 1160 } 1149 if (redraw & RDW_NOERASE_W) 1150 wnd->setEraseBkgnd(FALSE); 1151 1152 if (WinQueryUpdateRect (hwnd, NULL)) 1153 { 1154 if (!pRect && !hrgn) 1155 success = WinValidateRect (hwnd, NULL, IncludeChildren); 1156 else 1157 if (hrgn) 1158 success = WinValidateRegion (hwnd, hrgnTemp, IncludeChildren); 1159 else 1160 success = WinValidateRect (hwnd, &rectl, IncludeChildren); 1161 if (!success) goto error; 1162 } 1161 1163 } 1162 1164 1163 1165 if(WinQueryUpdateRect(hwnd, NULL)) 1164 1166 { 1167 //TODO: Does this work if RDW_ALLCHILDREN is set?? 1165 1168 if(redraw & RDW_UPDATENOW_W) { 1166 1169 wnd->MsgPaint (0, FALSE); 1167 1170 } 1168 1171 else 1169 if((redraw & RDW_ERASE_W) && (redraw & RDW_ERASENOW_W)) 1170 wnd->setEraseBkgnd (FALSE, !sendEraseBkgnd (wnd)); 1172 // if((redraw & RDW_ERASE_W) && (redraw & RDW_ERASENOW_W)) 1173 if(redraw & RDW_ERASENOW_W && wnd->needsEraseBkgnd()) 1174 wnd->setEraseBkgnd(sendEraseBkgnd(wnd) == 0); 1171 1175 } 1172 1176 else if((redraw & RDW_INTERNALPAINT_W) && !(redraw & RDW_INVALIDATE_W)) … … 1185 1189 WinReleasePS (hpsTemp); 1186 1190 1187 //SvL: Test1188 // if ((redraw & RDW_INVALIDATE_W) == 0)1189 // wnd->setSuppressErase (FALSE);1190 // else if ((redraw & RDW_ERASENOW_W) == RDW_ERASENOW_W)1191 // wnd->setSuppressErase (TRUE);1192 1193 1191 if (!success) 1194 1192 O32_SetLastError (ERROR_INVALID_PARAMETER); … … 1208 1206 1209 1207 dprintf (("User32: UpdateWindow hwnd %x", hwnd)); 1210 ////SvL: This doesn't work right (it's what Wine does) -> TODO 1211 //// return RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW_W | RDW_NOCHILDREN_W); 1208 ////SvL: This doesn't work right (Wine uses RDW_NOCHILDREN_W -> doesn't work here) 1209 //// Breaks vpbuddy 1210 //// return RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW_W | RDW_ALLCHILDREN_W); 1212 1211 WinUpdateWindow(wnd->getOS2WindowHandle()); 1213 1212 return TRUE; -
trunk/src/user32/oslibmsgtranslate.cpp
r2804 r2881 1 /* $Id: oslibmsgtranslate.cpp,v 1.1 7 2000-02-16 14:34:27sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.18 2000-02-24 19:19:08 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 326 326 if (!win32wnd->CanReceiveSizeMsgs()) goto dummymessage; 327 327 328 ULONG windowStyle = WinQueryWindowULong(os2Msg->hwnd, QWL_STYLE); 329 win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MAXIMIZE_W|WS_MINIMIZE_W)); 330 if (windowStyle & WS_MINIMIZED) { 331 win32wnd->setStyle(win32wnd->getStyle() | WS_MINIMIZE_W); 332 } 333 else 334 if (windowStyle & WS_MAXIMIZED) { 335 win32wnd->setStyle(win32wnd->getStyle() | WS_MAXIMIZE_W); 336 } 337 328 338 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 329 339 dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy)); … … 667 677 case WM_PAINT: 668 678 { 669 if(win32wnd->Is Iconic()) {679 if(win32wnd->IsWindowIconic()) { 670 680 winMsg->message = WINWM_PAINTICON; 671 681 } -
trunk/src/user32/win32dlg.cpp
r2857 r2881 1 /* $Id: win32dlg.cpp,v 1.4 5 2000-02-22 17:07:41 cbratschiExp $ */1 /* $Id: win32dlg.cpp,v 1.46 2000-02-24 19:19:08 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 238 238 { 239 239 ShowWindow( SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */ 240 ::UpdateWindow( getWindowHandle() );240 UpdateWindow( getWindowHandle() ); 241 241 } 242 242 SetLastError(0); … … 972 972 BOOL Win32Dialog::restoreFocus() 973 973 { 974 if (!hwndFocus || Is Iconic()) return FALSE;974 if (!hwndFocus || IsWindowIconic()) return FALSE; 975 975 976 976 if (!::IsWindow( hwndFocus )) return FALSE; -
trunk/src/user32/win32wbase.cpp
r2873 r2881 1 /* $Id: win32wbase.cpp,v 1.16 8 2000-02-23 17:05:17 cbratschiExp $ */1 /* $Id: win32wbase.cpp,v 1.169 2000-02-24 19:19:08 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 131 131 hwndLinkAfter = HWND_BOTTOM; 132 132 flags = 0; 133 isIcon = FALSE;134 133 lastHitTestVal = HTOS_NORMAL; 135 134 owner = NULL; … … 140 139 141 140 EraseBkgndFlag = TRUE; 142 PSEraseFlag = FALSE;143 SuppressEraseFlag = FALSE;144 141 145 142 horzScrollInfo = NULL; … … 981 978 ULONG Win32BaseWindow::MsgPaint(ULONG tmp1, BOOL select) 982 979 { 983 if (select && isIcon)984 return SendInternalMessageA(WM_PAINTICON, 0, 0);980 if (select && IsWindowIconic()) 981 return SendInternalMessageA(WM_PAINTICON, 1, 0); 985 982 else 986 983 return SendInternalMessageA(WM_PAINT, 0, 0); … … 998 995 hdcErase = O32_GetDC(OS2Hwnd); 999 996 1000 if( isIcon)997 if(IsWindowIconic()) 1001 998 rc = SendInternalMessageA(WM_ICONERASEBKGND, hdcErase, 0); 1002 999 else … … 1146 1143 1147 1144 return FALSE; 1145 } 1146 //****************************************************************************** 1147 //****************************************************************************** 1148 BOOL Win32BaseWindow::IsWindowIconic() 1149 { 1150 return ((getStyle() & WS_MINIMIZE) && windowClass->getIcon()); 1148 1151 } 1149 1152 //****************************************************************************** … … 2309 2312 } 2310 2313 //****************************************************************************** 2311 //Don't call WinUpdateWindow as that one also updates the child windows2312 //Also need to send WM_PAINT directly to the window procedure, which doesn't2313 //always happen with WinUpdateWindow (could be posted if thread doesn't own window)2314 //******************************************************************************2315 BOOL Win32BaseWindow::UpdateWindow()2316 {2317 RECT rect;2318 2319 if(OSLibWinQueryUpdateRect(OS2Hwnd, &rect))2320 {//update region not empty2321 HDC hdc;2322 2323 hdc = O32_GetDC(OS2Hwnd);2324 if (isIcon)2325 {2326 SendInternalMessageA(WM_ICONERASEBKGND, (WPARAM)hdc, 0);2327 SendInternalMessageA(WM_PAINTICON, 0, 0);2328 }2329 else2330 {2331 SendInternalMessageA(WM_ERASEBKGND, (WPARAM)hdc, 0);2332 SendInternalMessageA(WM_PAINT, 0, 0);2333 }2334 O32_ReleaseDC(OS2Hwnd, hdc);2335 }2336 return TRUE;2337 }2338 //******************************************************************************2339 //******************************************************************************2340 BOOL Win32BaseWindow::IsIconic()2341 {2342 return OSLibWinIsIconic(OS2Hwnd);2343 }2344 //******************************************************************************2345 2314 //TODO: Should not enumerate children that are created during the enumeration! 2346 2315 //****************************************************************************** … … 2773 2742 { 2774 2743 STYLESTRUCT ss; 2744 2745 //SvL: TODO: Can you change minimize or maximize status here too? 2775 2746 2776 2747 if(dwStyle == value) -
trunk/src/user32/win32wbase.h
r2857 r2881 1 /* $Id: win32wbase.h,v 1.8 5 2000-02-22 17:07:43 cbratschiExp $ */1 /* $Id: win32wbase.h,v 1.86 2000-02-24 19:19:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 212 212 213 213 BOOL IsChild(HWND hwndParent); 214 214 215 HWND GetTopWindow(); 215 216 Win32BaseWindow *GetTopParent(); 216 BOOL UpdateWindow(); 217 BOOL IsIconic(); 217 218 218 HWND GetWindow(UINT uCmd); 219 219 virtual BOOL EnableWindow(BOOL fEnable); … … 233 233 BOOL IsWindowEnabled(); 234 234 BOOL IsWindowVisible(); 235 //Created with CreateWindowExA or ExW 236 // BOOL IsUnicode() { return isUnicode; }; 235 BOOL IsWindowIconic(); 237 236 //Window procedure type 238 237 BOOL IsWindowUnicode(); … … 330 329 LONG lastHitTestVal; //Last value returned by WM_NCHITTEST handler 331 330 332 BOOL isIcon;333 331 BOOL fFirstShow; 334 332 BOOL fIsDialog; … … 441 439 442 440 ULONG EraseBkgndFlag:1, 443 PSEraseFlag:1, 444 SuppressEraseFlag:1, 445 filler:29; 441 filler:31; 446 442 public: 447 VOID setEraseBkgnd (BOOL erase, BOOL PSErase = FALSE) 448 { EraseBkgndFlag = erase; PSEraseFlag = PSErase; } 449 VOID setSuppressErase (BOOL erase = FALSE) 450 { SuppressEraseFlag = erase; } 451 BOOL isEraseBkgnd() { return EraseBkgndFlag; } 452 BOOL isPSErase() { return EraseBkgndFlag | PSEraseFlag; } 453 BOOL isSuppressErase() { return SuppressEraseFlag; } 443 VOID setEraseBkgnd (BOOL erase) { EraseBkgndFlag = erase; } 444 BOOL needsEraseBkgnd() { return EraseBkgndFlag; } 454 445 }; 455 446 -
trunk/src/user32/window.cpp
r2852 r2881 1 /* $Id: window.cpp,v 1.5 6 2000-02-21 17:25:33 cbratschiExp $ */1 /* $Id: window.cpp,v 1.57 2000-02-24 19:19:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 405 405 return FALSE; 406 406 } 407 rc = window->Is Iconic();407 rc = window->IsWindowIconic(); 408 408 dprintf(("IsIconic %x returned %d", hwnd, rc)); 409 409 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.