Index: inc/VCLView.h =================================================================== RCS file: /cvs/oo/gsl/vcl/aqua/inc/VCLView.h,v retrieving revision 1.6 diff -r1.6 VCLView.h 77a78,81 > { > int qdRgnResized; > } > - init; 78a83 > - (void)lockFocus; Index: source/gdi/VCLGraphics.m =================================================================== RCS file: /cvs/oo/gsl/vcl/aqua/source/gdi/VCLGraphics.m,v retrieving revision 1.22 diff -r1.22 VCLGraphics.m 90,91c90,94 < CGrafPtr pCGrafPort = [(NSQuickDrawView *)hView qdPort]; < --- > CGrafPtr pCGrafPort=NULL; > RGBColor oldFore, newFore; > Rect r; > NSRect viewBounds; > 93c96,102 < --- > > // [ed] 12/12/01 The Carbon GrafPort only is valid as long as the view has > // the focus, so we need to be sure to execute lockFocus before assigning > // the port. > > pCGrafPort = [(NSQuickDrawView *)hView qdPort]; > 94a104,109 > } > else > { > // [ed] 12/12/01 Error checking > > fprintf(stderr, "Non nil hView in LockFocusCGrafPort(), but not a quickdrawview\n"); 95a111,116 > } > else > { > // [ed] 12/12/01 Error checking > > fprintf(stderr, "Nil hView in LockFocusCGrafPort()\n"); Index: source/gdi/salgdi.cxx =================================================================== RCS file: /cvs/oo/gsl/vcl/aqua/source/gdi/salgdi.cxx,v retrieving revision 1.55.2.3 diff -r1.55.2.3 salgdi.cxx 485a486,503 > // [ed] 12/1/01 Parameter checks. Limit all of the parameters to fit within > // the current port bounds > > Rect portBounds; > GetPortBounds(maGraphicsData.mpCGrafPort, &portBounds); > > if(nX < portBounds.left) > nX=portBounds.left; > > if(nY < portBounds.top) > nY=portBounds.top; > > if((nHeight > (portBounds.bottom-portBounds.top)-(nY-portBounds.top)) || (nHeight < 0)) > nHeight=portBounds.bottom-portBounds.top-(nY-portBounds.top)-1; > > if((nWidth > (portBounds.right-portBounds.left-(nX-portBounds.left))) || (nHeight < 0)) > nWidth=portBounds.right-portBounds.left-(nX-portBounds.left)-1; > 503c521 < PaintRect( &aRect ); --- > PaintRect( &aRect ); Index: source/gdi/salgdiutils.cxx =================================================================== RCS file: /cvs/oo/gsl/vcl/aqua/source/gdi/salgdiutils.cxx,v retrieving revision 1.4 diff -r1.4 salgdiutils.cxx 241c241,243 < --- > > // [ed] 12/16/01 Don't lock QDView grafports. > 243a246 > && ( rSalGraphics->maGraphicsData.mbWindow != TRUE) 301,302c304,312 < < if ( rSalGraphicsData->mpCGrafPort != NULL ) --- > > // [ed] 12/3/01 Check to make sure we've got a valid graph port > > if(rSalGraphicsData->mpCGrafPort && !IsValidPort(rSalGraphicsData->mpCGrafPort)) > { > fprintf(stderr, "Invalid port in BeginGraphics()\n"); > } > > if ( ( rSalGraphicsData->mpCGrafPort != NULL ) && IsValidPort(rSalGraphicsData->mpCGrafPort)) 329c339 < --- > 360,361c370,374 < < if ( LockPixels( rSalGraphicsData->mhGWorldPixMap ) ) --- > > // [ed] 12/16/01 Don't lock pixels of QDViews > > if ( !rSalGraphicsData->mbWindow && > LockPixels( rSalGraphicsData->mhGWorldPixMap ) ) 382c395 < --- > 385c398 < if ( ( rSalGraphicsData->mbClipRgnChanged == TRUE ) --- > if ( ( rSalGraphicsData->mbClipRgnChanged == TRUE ) 401a415,420 > else > { > // [ed] 12/13/01 GWord graphics error flags set > > fprintf(stderr, "GWorld graphics flags indicate error in BeginGraphics()\n"); > } 402a422,427 > else > { > // [ed] 12/13/01 GWorld graphics has no PixMap handle > > fprintf(stderr, "Valid GWorld, but no pixmap in BeginGraphics()\n"); > } 403a429,434 > else > { > // [ed] 12/13/01 Error checking > > fprintf(stderr, "QuickDraw error in BeginGraphics()\n"); > } 439c470,479 < --- > > /* > > [ed] 12/19/01 Apparently the pen pattern handle we retrieved > in BeginGraphics() is invalid by this point on OS 10.1. > By not attempting to revert the pen pattern, we can avoid > seg faulting the next time we draw into the port. > > +++ Is it necessary to reset the pen pattern? > 443c483,484 < --- > */ > 451a493,506 > // When we get here then the QD port must have changed(?) > // [ed] 12/19/01 This will commit the changes to reset the pen size > // and pen mode. > > PortChanged( rSalGraphicsData->mpCGrafPort ); > > #if defined DBG_UTIL || defined DEBUG || defined _DEBUG > // [ed] 12/19/01 Flush the QuickDraw buffer immediately. This helps > // with VCL debugging. > > if(QDIsPortBuffered(rSalGraphicsData->mpCGrafPort)) > QDFlushPortBuffer( rSalGraphicsData->mpCGrafPort, NULL ); > #endif > 458,465d512 < < // When we get here then the QD port must have changed(?) < < PortChanged( rSalGraphicsData->mpCGrafPort ); < < // Flush the QuickDraw buffer < < QDFlushPortBuffer( rSalGraphicsData->mpCGrafPort, NULL ); Index: source/gdi/salvd.cxx =================================================================== RCS file: /cvs/oo/gsl/vcl/aqua/source/gdi/salvd.cxx,v retrieving revision 1.13 diff -r1.13 salvd.cxx 89c89 < GWorldFlags nFlags = noNewDevice; --- > GWorldFlags nFlags = 0; // [ed] 12/1/01 Allow offscreen gworlds Index: source/window/VCLView.m =================================================================== RCS file: /cvs/oo/gsl/vcl/aqua/source/window/VCLView.m,v retrieving revision 1.4 diff -r1.4 VCLView.m 76a77,114 > - init > { > qdRgnResized=0; > return self; > } > > - (void)lockFocus > { > [super lockFocus]; > > // [ed] 12/15/01 If we haven't done so yet, adjust the visRgn and clipRgn of the port > // to match the view. OS 10.1 changed the default behaviour of the clipping of > // NSQDViews and they now require initialization. > > if(!qdRgnResized) > { > RgnHandle tempRgn; > Rect r; > > r.left=0; > r.top=0; > r.right=[self bounds].size.width; > r.bottom=[self bounds].size.height; > > SetPort([self qdPort]); > > tempRgn=NewRgn(); > RectRgn(tempRgn, &r); > > ClipRect(&r); > SetPortVisibleRegion([self qdPort], tempRgn); > PortChanged([self qdPort]); > > DisposeRgn(tempRgn); > qdRgnResized=1; > } > } > Index: source/window/VCLWindow.m =================================================================== RCS file: /cvs/oo/gsl/vcl/aqua/source/window/VCLWindow.m,v retrieving revision 1.45 diff -r1.45 VCLWindow.m 254,255c254,255 < [hWindow setContentView: [[VCLView new] initWithFrame: [hWindow frame]]]; < --- > [hWindow setContentView: [[[VCLView new] init] initWithFrame: [hWindow frame]]]; >