Changeset 100
- Timestamp:
- Jul 23, 2006, 9:21:05 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qwidget_pm.cpp
r97 r100 112 112 } 113 113 114 /** \internal flags for qt_WinProcessWindowObstacles() */115 enum {116 PWO_Children = 0x01,117 PWO_Sibings = 0x02,118 PWO_Ancestors = 0x04,119 PWO_TopLevel = 0x80000000,120 // PWO_Default is suitable in most cases (for simple paint operations)121 PWO_Default = PWO_Children | PWO_Sibings | PWO_Ancestors,122 };123 124 114 /** 125 115 * \internal … … 216 206 } 217 207 208 /** \internal flags for qt_WinProcessWindowObstacles() */ 209 enum { 210 PWO_Children = 0x01, 211 PWO_Sibings = 0x02, 212 PWO_Ancestors = 0x04, 213 PWO_Screen = 0x08, 214 PWO_TopLevel = 0x80000000, 215 // PWO_Default is suitable in most cases (for simple paint operations) 216 PWO_Default = PWO_Children | PWO_Sibings | PWO_Ancestors | PWO_Screen, 217 }; 218 218 219 /** 219 220 * \internal … … 257 258 HWND relative; 258 259 SWP swp; 259 260 // first, go through all children (in z-order) 260 261 // first, process areas placed outside the screen bounds 262 if ( flags & PWO_Screen ) { 263 RECTL rclScr = { 0, 0, QApplication::desktop()->width(), 264 QApplication::desktop()->height() }; 265 WinMapWindowPoints( HWND_DESKTOP, hwnd, (PPOINTL) &rclScr, 2 ); 266 // rough check of whether some window part is outside bounds 267 if ( rclSelf.xLeft < rclScr.xLeft || 268 rclSelf.yBottom < rclScr.yBottom || 269 rclSelf.xRight > rclScr.xRight || 270 rclSelf.yTop > rclScr.yTop ) { 271 GpiSetRegion( displayPS, whrgn, 1, &rclSelf ); 272 HRGN hrgnScr = GpiCreateRegion( displayPS, 1, &rclScr ); 273 // substract the screen region from this window's region 274 // to get parts placed outside 275 GpiCombineRegion( displayPS, whrgn, whrgn, hrgnScr, CRGN_DIFF ); 276 GpiDestroyRegion( displayPS, hrgnScr ); 277 // process the region 278 if ( hrgn != NULLHANDLE ) { 279 cmplx = GpiCombineRegion( displayPS, hrgn, hrgn, whrgn, op ); 280 } else { 281 WinValidateRegion( hwnd, whrgn, FALSE ); 282 } 283 #if defined (DEBUG_WIDGETMASK) 284 qDebug( " collected areas outside screen bounds" ); 285 #endif 286 } 287 } 288 289 // next, go through all children (in z-order) 261 290 if ( flags & PWO_Children ) { 262 291 relative = WinQueryWindow( hwnd, QW_BOTTOM ); … … 289 318 } 290 319 #if defined (DEBUG_WIDGETMASK) 291 qDebug( " extracted" );320 qDebug( " collected" ); 292 321 #endif 293 322 } … … 331 360 } 332 361 #if defined (DEBUG_WIDGETMASK) 333 qDebug( " extracted" );362 qDebug( " collected" ); 334 363 #endif 335 364 } … … 392 421 } 393 422 #if defined (DEBUG_WIDGETMASK) 394 qDebug( " extracted" );423 qDebug( " collected" ); 395 424 #endif 396 425 } … … 759 788 // areas outside the clip region are left unpainted. Instead, we correct 760 789 // the update region of the window ourselves, on every WM_PAINT event. 790 // Note: for top-level widgets, we specify WS_CLIPSIBLINGS anyway to let 791 // the system do correct clipping for us (qt_WinProcessWindowObstacles() 792 // relies on this). It's ok because top-level widgets cannot be non- 793 // rectangular and therefore don't require our magic clipping procedure. 794 if ( topLevel /* && !testWFlags( WPaintUnclipped ) */ ) 795 style |= WS_CLIPSIBLINGS; 761 796 #else 762 797 /// @todo (dmik) … … 765 800 // box and list view. This needs to be investigated. Qt/Win32 does also 766 801 // comment this out... 767 768 style |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN;802 /* if ( !testWFlags( WPaintUnclipped ) ) */ 803 style |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN; 769 804 #endif 770 805 // for all top-level windows except popups we create a WC_FRAME … … 2150 2185 HWND i = id; 2151 2186 while( (i = WinQueryWindow( i, QW_PREV )) ) { 2152 if ( WinIsWindow Showing( i ) ) {2187 if ( WinIsWindowVisible( i ) ) { 2153 2188 WinQueryWindowRect( i, &r ); 2154 2189 WinMapWindowPoints( i, hwnd, (PPOINTL) &r, 2 ); … … 2306 2341 HPS hps = WinGetPS( hwnd ); 2307 2342 2343 // get the current update (invalid) region 2344 HRGN hrgnInv = GpiCreateRegion( hps, 0, NULL ); 2345 if ( WinQueryUpdateRegion( hwnd, hrgnInv ) != RGN_NULL ) { 2346 // validate it (since it's no more up-to-date after scrolling) 2347 WinValidateRegion( hwnd, hrgnInv, clip == NULL ); 2348 // scroll it to get the new invalid region 2349 GpiOffsetRegion( hps, hrgnInv, &ptlDelta ); 2350 } 2351 2308 2352 // get widget bounds (clip region or rect) 2309 2353 HRGN hrgnClip = GpiCreateRegion( hps, 0, NULL ); 2310 2354 qt_WinQueryClipRegionOrRect( hwnd, hrgnClip ); 2355 2356 if ( clip ) { 2357 // intersect it with the given clip rect 2358 HRGN hrgn = GpiCreateRegion( hps, 1, clip ); 2359 GpiCombineRegion( hps, hrgnClip, hrgn, hrgnClip, CRGN_AND ); 2360 GpiDestroyRegion( hps, hrgn ); 2361 } 2362 2311 2363 // compose a region uncovered after scrolling 2312 2364 HRGN hrgnUpd = GpiCreateRegion( hps, 0, NULL ); … … 2314 2366 GpiOffsetRegion( hps, hrgnUpd, &ptlDelta ); 2315 2367 GpiCombineRegion( hps, hrgnUpd, hrgnClip, hrgnUpd, CRGN_DIFF ); 2316 2317 if ( clip ) { 2318 // intersect it with the given clip rect 2319 HRGN hrgn = GpiCreateRegion( hps, 1, clip ); 2320 GpiCombineRegion( hps, hrgnUpd, hrgnClip, hrgnUpd, CRGN_AND ); 2321 GpiDestroyRegion( hps, hrgn ); 2322 } 2323 2324 int pwoFlags = PWO_Ancestors | PWO_Sibings | PWO_TopLevel; 2368 2369 int pwoFlags = PWO_Ancestors | PWO_Sibings | PWO_TopLevel | PWO_Screen; 2325 2370 if ( clip ) 2326 2371 pwoFlags |= PWO_Children; … … 2333 2378 GpiCombineRegion( hps, hrgnDelta, hrgnObst, 0, CRGN_COPY ); 2334 2379 GpiOffsetRegion( hps, hrgnDelta, &ptlDelta ); 2335 // substract the region of obstaces fro the delta region to get pure delta2380 // substract the region of obstaces from the delta region to get pure delta 2336 2381 GpiCombineRegion( hps, hrgnDelta, hrgnDelta, hrgnObst, CRGN_DIFF ); 2337 // substract obstacles the clip region2382 // substract obstacles from the clip region 2338 2383 GpiCombineRegion( hps, hrgnClip, hrgnClip, hrgnObst, CRGN_DIFF ); 2339 2384 // substract pure delta from the clip region (to reduce flicker) 2340 2385 GpiCombineRegion( hps, hrgnClip, hrgnClip, hrgnDelta, CRGN_DIFF ); 2386 // substract the new invalid region from the clip region (to reduce flicker) 2387 GpiCombineRegion( hps, hrgnClip, hrgnClip, hrgnInv, CRGN_DIFF ); 2341 2388 2342 2389 // scroll the area … … 2350 2397 // invalidate the region uncovered after scrolling 2351 2398 WinInvalidateRegion( hwnd, hrgnUpd, clip == NULL ); 2352 2399 2400 // put the new invalid region back 2401 WinInvalidateRegion( hwnd, hrgnInv, clip == NULL ); 2402 2403 GpiDestroyRegion( hps, hrgnInv ); 2353 2404 GpiDestroyRegion( hps, hrgnDelta ); 2354 2405 GpiDestroyRegion( hps, hrgnObst );
Note:
See TracChangeset
for help on using the changeset viewer.