- Timestamp:
- Sep 16, 1999, 8:00:44 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/dc.cpp
r949 r962 1 /* $Id: dc.cpp,v 1. 1 1999-09-15 23:18:49 sandervlExp $ */1 /* $Id: dc.cpp,v 1.2 1999-09-16 18:00:43 dengert Exp $ */ 2 2 3 3 /* … … 46 46 RECT rcPaint; 47 47 BOOL fRestore; 48 BOOL fIncUpdate;48 BOOL IncUpdate; 49 49 BYTE rgbReserved[32]; 50 50 } PAINTSTRUCT_W, *PPAINTSTRUCT_W, *LPPAINTSTRUCT_W; … … 116 116 #define DCX_LOCKWINDOWUPDATE_W 0x00000400L 117 117 #define DCX_VALIDATE_W 0x00200000L 118 119 #define RDW_INVALIDATE_W 0x0001 120 #define RDW_INTERNALPAINT_W 0x0002 121 #define RDW_ERASE_W 0x0004 122 #define RDW_VALIDATE_W 0x0008 123 #define RDW_NOINTERNALPAINT_W 0x0010 124 #define RDW_NOERASE_W 0x0020 125 #define RDW_NOCHILDREN_W 0x0040 126 #define RDW_ALLCHILDREN_W 0x0080 127 #define RDW_UPDATENOW_W 0x0100 128 #define RDW_ERASENOW_W 0x0200 129 #define RDW_FRAME_W 0x0400 130 #define RDW_NOFRAME_W 0x0800 118 131 119 132 typedef struct _RGNDATAHEADER_W { … … 1038 1051 return (rc); 1039 1052 } 1053 1054 BOOL WIN32API UpdateWindow (HWND hwnd) 1055 { 1056 if (!hwnd) 1057 return FALSE; 1058 1059 USHORT sel = RestoreOS2FS(); 1060 Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd); 1061 1062 dprintf (("User32: UpdateWindow hwnd %x -> wnd %x", hwnd, wnd)); 1063 1064 if (WinQueryUpdateRect (wnd->getOS2WindowHandle(), NULL)) 1065 sendEraseBkgnd (wnd); 1066 1067 wnd->MsgPaint(0); 1068 1069 SetFS(sel); 1070 return (TRUE); 1071 } 1072 1073 // This implementation of RedrawWindow supports 1074 // RDW_ERASE 1075 // RDW_NOERASE 1076 // RDW_INTERNALPAINT 1077 // RDW_NOINTERNALPAINT 1078 // RDW_INVALIDATE 1079 // RDW_VALIDATE 1080 // RDW_ERASENOW 1081 // RDW_UPDATENOW 1082 1083 BOOL WIN32API RedrawWindow (HWND hwnd, const RECT *pRect, HRGN hrgn, DWORD redraw) 1084 { 1085 Win32BaseWindow *wnd; 1086 1087 if (redraw & (RDW_FRAME_W | RDW_NOFRAME_W)) 1088 { 1089 // SET_ERROR_WIN( ERROR_NOT_SUPPORTED_W ); 1090 return FALSE; 1091 } 1092 1093 USHORT sel = RestoreOS2FS(); 1094 dprintf(("USER32: RedrawWindow %X, %X %X %X", hwnd, pRect, hrgn, redraw)); 1095 1096 if (hwnd == NULLHANDLE) { 1097 hwnd = HWND_DESKTOP; 1098 wnd = NULL; 1099 } 1100 else 1101 { 1102 wnd = Win32BaseWindow::GetWindowFromHandle (hwnd); 1103 1104 if (!wnd) 1105 { 1106 // SET_ERROR_LAST(); 1107 SetFS(sel); 1108 return FALSE; 1109 } 1110 hwnd = wnd->getOS2WindowHandle(); 1111 } 1112 1113 BOOL IncludeChildren = redraw & RDW_ALLCHILDREN_W ? TRUE : FALSE; 1114 BOOL success = TRUE; 1115 HPS hpsTemp = NULLHANDLE; 1116 HRGN hrgnTemp = NULLHANDLE; 1117 RECTL rectl; 1118 1119 if (redraw & RDW_UPDATENOW_W) redraw &= ~RDW_ERASENOW_W; 1120 1121 #if 0 1122 if (redraw & RDW_NOERASE_W) 1123 setEraseBkgnd (FALSE); 1124 1125 if (redraw & RDW_UPDATENOW_W) 1126 setSupressErase (TRUE, FALSE); 1127 else if (redraw & RDW_ERASENOW_W) 1128 setSupressErase (FALSE, FALSE); 1129 else 1130 { 1131 QMSG qmsg; 1132 BOOL bErase; 1133 1134 bErase = (WinPeekMsg (HABX, &qmsg, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE) 1135 && (redraw & RDW_NOERASE_W) == 0); 1136 1137 setSupressErase (FALSE, !bErase); 1138 } 1139 1140 if (redraw & (RDW_NOINTERNALPAINT_W | RDW_INTERNALPAINT_W)) 1141 { 1142 QMSG qmsg; 1143 1144 WinPeekMsg( (HAB)0, &qmsg, hwnd, WM_VIRTUAL_INTERNALPAINT, 1145 WM_VIRTUAL_INTERNALPAINT, PM_REMOVE ); 1146 } 1147 #endif 1148 1149 if (hrgn) 1150 { 1151 ULONG BytesNeeded; 1152 PRGNDATA_W RgnData; 1153 PRECTL pr; 1154 int i; 1155 LONG height = wnd ? wnd->getWindowHeight() : OSLibQueryScreenHeight(); 1156 1157 if (!hrgn) 1158 goto error; 1159 1160 BytesNeeded = _O32_GetRegionData (hrgn, 0, NULL); 1161 RgnData = (PRGNDATA_W)_alloca (BytesNeeded); 1162 if (RgnData == NULL) 1163 goto error; 1164 _O32_GetRegionData (hrgn, BytesNeeded, RgnData); 1165 1166 pr = (PRECTL)(RgnData->Buffer); 1167 for (i = RgnData->rdh.nCount; i > 0; i--, pr++) { 1168 LONG temp = pr->yTop; 1169 pr->yTop = height - pr->yBottom; 1170 pr->yBottom = height - temp; 1171 } 1172 1173 hpsTemp = WinGetScreenPS (HWND_DESKTOP); 1174 hrgnTemp = GpiCreateRegion (hpsTemp, RgnData->rdh.nCount, (PRECTL)(RgnData->Buffer)); 1175 if (!hrgnTemp) goto error; 1176 } 1177 else if (pRect) 1178 { 1179 LONG height = wnd ? wnd->getWindowHeight() : OSLibQueryScreenHeight(); 1180 1181 PMRECT_FROM_WINRECT (rectl, *pRect); 1182 rectl.yTop = height - rectl.yTop; 1183 rectl.yBottom = height - rectl.yBottom; 1184 } 1185 1186 if (redraw & RDW_INVALIDATE_W) 1187 { 1188 // if (redraw & RDW_ERASE_W) 1189 // setEraseBkgnd (TRUE, TRUE); 1190 1191 if (!pRect && !hrgn) 1192 success = WinInvalidateRect (hwnd, NULL, IncludeChildren); 1193 else if (hrgn) 1194 success = WinInvalidateRegion (hwnd, hrgnTemp, IncludeChildren); 1195 else 1196 success = WinInvalidateRect (hwnd, &rectl, IncludeChildren); 1197 if (!success) goto error; 1198 } 1199 else if (redraw & RDW_VALIDATE_W) 1200 { 1201 if (WinQueryUpdateRect (hwnd, NULL)) 1202 { 1203 if (!pRect && !hrgn) 1204 success = WinValidateRect (hwnd, NULL, IncludeChildren); 1205 else if (hrgn) 1206 success = WinValidateRegion (hwnd, hrgnTemp, IncludeChildren); 1207 else 1208 success = WinValidateRect (hwnd, &rectl, IncludeChildren); 1209 if (!success) goto error; 1210 } 1211 } 1212 1213 if (WinQueryUpdateRect (hwnd, NULL)) 1214 { 1215 if (redraw & RDW_UPDATENOW_W) 1216 wnd->MsgPaint (0, FALSE); 1217 1218 // else if ((redraw & RDW_ERASE_W) && (redraw & RDW_ERASENOW_W)) 1219 // setEraseBkgnd (FALSE, !sendEraseBkgnd (wnd)); 1220 } 1221 else if ((redraw & RDW_INTERNALPAINT_W) && !(redraw & RDW_INVALIDATE_W)) 1222 { 1223 if (redraw & RDW_UPDATENOW_W) 1224 wnd->MsgPaint (0, FALSE); 1225 // else 1226 // WinPostMsg( hwnd, WM_VIRTUAL_INTERNALPAINT, MPVOID, MPVOID ); 1227 } 1228 1229 error: 1230 /* clean up */ 1231 if (hrgnTemp) 1232 GpiDestroyRegion (hpsTemp, hrgnTemp); 1233 1234 if (hpsTemp) 1235 WinReleasePS (hpsTemp); 1236 1237 // if ((redraw & RDW_INVALIDATE_W) == 0) 1238 // setSupressErase (FALSE, FALSE); 1239 // else if ((redraw & RDW_ERASENOW_W) == RDW_ERASENOW_W) 1240 // setSupressErase (FALSE, TRUE); 1241 1242 // if (!success) 1243 // SET_ERROR_LAST(); 1244 1245 SetFS(sel); 1246 return (success); 1247 } 1248 1249 BOOL WIN32API InvalidateRect (HWND hwnd, const RECT *pRect, BOOL erase) 1250 { 1251 USHORT sel = RestoreOS2FS(); 1252 // Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd); 1253 BOOL result; 1254 1255 // todo !! 1256 // if ( isFrame without client ) 1257 // erase = TRUE; 1258 1259 result = RedrawWindow (hwnd, pRect, NULLHANDLE, 1260 RDW_ALLCHILDREN_W | RDW_INVALIDATE_W | 1261 (erase ? RDW_ERASE_W : 0) | 1262 (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0)); 1263 SetFS(sel); 1264 return (result); 1265 } 1266 1267 BOOL WIN32API InvalidateRgn (HWND hwnd, HRGN hrgn, BOOL erase) 1268 { 1269 USHORT sel = RestoreOS2FS(); 1270 // Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd); 1271 BOOL result; 1272 1273 // todo !! 1274 // if ( isFrame without client ) 1275 // erase = TRUE; 1276 1277 result = RedrawWindow (hwnd, NULL, hrgn, 1278 RDW_ALLCHILDREN_W | RDW_INVALIDATE_W | 1279 (erase ? RDW_ERASE_W : 0) | 1280 (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0)); 1281 SetFS(sel); 1282 return (result); 1283 } 1284 1040 1285 //****************************************************************************** 1041 1286 //****************************************************************************** -
trunk/src/user32/user32.cpp
r949 r962 1 /* $Id: user32.cpp,v 1.2 5 1999-09-15 23:18:57 sandervlExp $ */1 /* $Id: user32.cpp,v 1.26 1999-09-16 18:00:44 dengert Exp $ */ 2 2 3 3 /* … … 1040 1040 //****************************************************************************** 1041 1041 //****************************************************************************** 1042 #if 0 1042 1043 BOOL WIN32API InvalidateRgn( HWND arg1, HRGN arg2, BOOL arg3) 1043 1044 { … … 1047 1048 return O32_InvalidateRgn(arg1, arg2, arg3); 1048 1049 } 1050 #endif 1049 1051 //****************************************************************************** 1050 1052 //****************************************************************************** -
trunk/src/user32/window.cpp
r949 r962 1 /* $Id: window.cpp,v 1. 1 1999-09-15 23:19:02 sandervlExp $ */1 /* $Id: window.cpp,v 1.2 1999-09-16 18:00:43 dengert Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 300 300 //****************************************************************************** 301 301 //****************************************************************************** 302 #if 0 302 303 BOOL WIN32API UpdateWindow(HWND hwnd) 303 304 { … … 312 313 return window->UpdateWindow(); 313 314 } 315 #endif 314 316 //****************************************************************************** 315 317 //****************************************************************************** … … 518 520 //****************************************************************************** 519 521 //****************************************************************************** 522 523 #if 0 520 524 BOOL WIN32API RedrawWindow( HWND arg1, const RECT * arg2, HRGN arg3, UINT arg4) 521 525 { … … 531 535 return(rc); 532 536 } 537 #endif 533 538 //****************************************************************************** 534 539 //****************************************************************************** … … 993 998 curpid = GetCurrentProcessId(); 994 999 995 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP); 1000 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP); 996 1001 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0) 997 1002 { 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1003 OSLibWinQueryWindowProcess(hwndNext, &pid, &tid); 1004 if(!(curpid == pid && dwThreadId == tid)) 1005 continue; 1006 1007 window = Win32BaseWindow::GetWindowFromHandle(hwndNext); 1008 if(window == NULL) { 1009 //OS/2 window or non-frame window, so skip it 1010 continue; 1011 } 1012 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) 1013 break; 1009 1014 } 1010 1015 OSLibWinEndEnumWindows (henum); … … 1028 1033 } 1029 1034 1030 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP); 1035 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP); 1031 1036 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0) 1032 1037 { 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1038 window = Win32BaseWindow::GetWindowFromHandle(hwndNext); 1039 if(window == NULL) { 1040 //OS/2 window or non-frame window, so skip it 1041 continue; 1042 } 1043 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) 1044 { 1045 rc = FALSE; 1046 break; 1047 } 1043 1048 } 1044 1049 OSLibWinEndEnumWindows(henum); … … 1057 1062 1058 1063 do { 1059 henum = OSLibWinBeginEnumWindows(hwndParent);1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1064 henum = OSLibWinBeginEnumWindows(hwndParent); 1065 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0) 1066 { 1067 window = Win32BaseWindow::GetWindowFromHandle(hwndNext); 1068 if(window == NULL) { 1069 //OS/2 window or non-frame window, so skip it 1070 continue; 1071 } 1072 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) { 1073 goto Abort; 1074 } 1075 } 1076 if(hwndParent == OSLIB_HWND_OBJECT) 1077 break; 1078 hwndParent = OSLIB_HWND_OBJECT; 1079 OSLibWinEndEnumWindows(henum); 1075 1080 } 1076 1081 while(TRUE); … … 1093 1098 //****************************************************************************** 1094 1099 //****************************************************************************** 1100 #if 0 1095 1101 BOOL WIN32API InvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase) 1096 1102 { … … 1109 1115 else return OSLibWinInvalidateRect(hWnd,NULL,bErase); 1110 1116 } 1117 #endif 1111 1118 //****************************************************************************** 1112 1119 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.