Changeset 2881 for trunk/src/user32/dc.cpp
- Timestamp:
- Feb 24, 2000, 8:19:10 PM (26 years ago)
- File:
-
- 1 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;
Note:
See TracChangeset
for help on using the changeset viewer.