Minor tidyup for window flushing

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3695 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-02-12 17:00:59 +00:00
parent 5af19c7b13
commit eddafd66d5
3 changed files with 84 additions and 44 deletions

View file

@ -1,3 +1,8 @@
Fri Feb 12 16:20:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSView.m: Improve window flushing
* Source/NSWindow.m: ditto
Fri Feb 12 13:37:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSCell.m: Fixes to draw text using NSText (by Benhur)

View file

@ -1042,6 +1042,7 @@ BOOL changedSize = NO;
}
}
needs_display = stillNeedsDisplay;
[window flushWindow];
}
}
@ -1099,8 +1100,6 @@ BOOL changedSize = NO;
}
}
[window flushWindow];
/*
* If the rect we displayed contains the invalidRect
* for the view then we can empty invalidRect.
@ -1115,6 +1114,7 @@ BOOL changedSize = NO;
stillNeedsDisplay = YES;
}
needs_display = stillNeedsDisplay;
[window flushWindow];
}
- (void)drawRect:(NSRect)rect

View file

@ -510,7 +510,10 @@ NSPoint basePoint;
//
// Managing the display
//
- (void)disableFlushWindow { disable_flush_window = YES; }
- (void) disableFlushWindow
{
disable_flush_window = YES;
}
- (void) display
{
@ -524,7 +527,8 @@ NSPoint basePoint;
[[content_view superview] display]; // Draw the window view
[self enableFlushWindow]; // Reenable displaying and
} // flush the window
[self flushWindowIfNeeded]; // flush the window
}
- (void) displayIfNeeded
{
@ -539,9 +543,14 @@ NSPoint basePoint;
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
if (is_autodisplay && needs_display) // if autodisplay is
{ // enabled and window
[self displayIfNeeded]; // display
/*
* if autodisplay is enabled and window display
*/
if (is_autodisplay && needs_display)
{
[self disableFlushWindow];
[self displayIfNeeded];
[self enableFlushWindow];
[self flushWindowIfNeeded];
}
[nc postNotificationName: NSWindowDidUpdateNotification object: self];
@ -556,11 +565,30 @@ NSPoint basePoint;
}
}
- (void)flushWindow {} // implemented in back end
- (void)enableFlushWindow { disable_flush_window = NO; }
- (BOOL)isAutodisplay { return is_autodisplay; }
- (BOOL)isFlushWindowDisabled { return disable_flush_window; }
- (void)setAutodisplay:(BOOL)flag { is_autodisplay = flag; }
- (void) flushWindow
{
// implemented in back end
}
- (void) enableFlushWindow
{
disable_flush_window = NO;
}
- (BOOL) isAutodisplay
{
return is_autodisplay;
}
- (BOOL) isFlushWindowDisabled
{
return disable_flush_window;
}
- (void) setAutodisplay: (BOOL)flag
{
is_autodisplay = flag;
}
- (void) setViewsNeedDisplay: (BOOL)flag
{
@ -568,8 +596,15 @@ NSPoint basePoint;
[[NSApplication sharedApplication] setWindowsNeedUpdate: YES];
}
- (BOOL)viewsNeedDisplay { return needs_display; }
- (void)useOptimizedDrawing:(BOOL)flag { optimize_drawing = flag; }
- (BOOL) viewsNeedDisplay
{
return needs_display;
}
- (void) useOptimizedDrawing: (BOOL)flag
{
optimize_drawing = flag;
}
- (BOOL) canStoreColor
{