Fixed the flushing optimization code. Updated the documentation.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2540 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Ovidiu Predescu 1997-10-22 00:27:59 +00:00
parent 502453429f
commit 63b4191f3a
10 changed files with 76 additions and 46 deletions

View file

@ -42,7 +42,7 @@ Noteworthy changes in version `0.4.0'
receive the -drawRect: message. Flushing of windows occurs only
in rectangles that get displayed not in the whole window.
* Rotation and scalation of view have been finally implemented. The
* Rotation and scaling of views have been finally implemented. The
code requires backend support for changing the state of the
graphics context accordingly.
@ -51,7 +51,7 @@ Noteworthy changes in version `0.4.0'
exposed region. Copying on scroll will be supported soon, at least
on Solaris DPS, where it seems the Postscript language has
provisions for copying drawn regions of screen. Hopefully DGS
will also have such facilities by the end of the year.
will also have this facility by the end of the year.
* NSScroller has been completely reworked to gain speed by using
timer events.
@ -59,11 +59,11 @@ Noteworthy changes in version `0.4.0'
* NSSlider has been implemented. Thanks to Frank Knobloch for
supporting this and the NSScrollView implementation.
* The library has been ported to work under Solaris with the native
DPS with the NeXT's Portable Distributed Objects (PDO) environment.
* NSBox has been implemented.
* NSCell is able to continuosly send the action to the target while
the user is tracking the mouse.
* The library has been ported to work under Solaris with the native
DPS and the NeXT/Apple's Portable Distributed Objects (PDO)
environment.
* The library has been integrated with the makefile package so we
now benefit from all of the features the makefile package gives
@ -71,6 +71,9 @@ Noteworthy changes in version `0.4.0'
various systems and having different types (debug and profile) of
the library compiled at the same time.
* NSCell is able to continuosly send the action to the target while
the user is tracking the mouse.
* Several cleanups and as usual, many bug fixes.
How can I get support for this software?

View file

@ -1,3 +1,23 @@
Tue Oct 21 16:21:06 1997 Ovidiu Predescu <ovidiu@net-community.com>
Fixed display optimization and the scrolling behavior in the presence
of optimizations.
* Source/NSView.m (_collectInvalidatedRectanglesInArray): Changed the
order in which the matrices are multiplyied to be able to correctly
convert the rectangles between views.
* Source/NSWindow.m (_collectFlushRectangles): Changed the matrices
that are passed to _collectInvalidatedRectanglesInArray:originMatrix:
sizeMatrix: to be the identity matrix.
* Source/PSMatrix.m (sizeInMatrixSpace:): Removed adding TX and TY to
the new size.
(rectInMatrixSpace:): Likewise.
* Source/NSClipView.m (-viewFrameChanged:): Update the bounds origin.
* Source/NSScrollView.m (reflectScrolledClipView:): Changed the
'documentRect' name of the variable to 'documentFrame' to better match
its usage.
* Source/NSScroller.m: Delete unnecessary commented out portions of
code.
Mon Oct 20 14:32:55 1997 Scott Christley <scottc@net-community.com>
* Fill out NSBox implementation.

View file

@ -21,7 +21,7 @@ Flushing of windows occurs only in rectangles that get displayed not in the
whole window.
@item
Rotation and scalation of views have been finally implemented. The code
Rotation and scaling of views have been finally implemented. The code
requires backend support for changing the state of the graphics context
accordingly.
@ -39,6 +39,9 @@ NSScroller has been completely reworked to gain speed by using timer events.
NSSlider has been implemented. Thanks to Frank Knobloch for supporting this
and the NSScrollView implementation.
@item
NSBox has been implemented.
@item
The library has been ported to work under Solaris with the native DPS and the
NeXT/Apple's Portable Distributed Objects (PDO) environment.

4
NEWS
View file

@ -12,7 +12,7 @@ Noteworthy changes in version `0.4.0'
receive the -drawRect: message. Flushing of windows occurs only
in rectangles that get displayed not in the whole window.
* Rotation and scalation of views have been finally implemented. The
* Rotation and scaling of views have been finally implemented. The
code requires backend support for changing the state of the
graphics context accordingly.
@ -29,6 +29,8 @@ Noteworthy changes in version `0.4.0'
* NSSlider has been implemented. Thanks to Frank Knobloch for
supporting this and the NSScrollView implementation.
* NSBox has been implemented.
* The library has been ported to work under Solaris with the native
DPS and the NeXT/Apple's Portable Distributed Objects (PDO)
environment.

View file

@ -176,6 +176,7 @@
- (void)viewFrameChanged:(NSNotification*)aNotification
{
[self setBoundsOrigin:[self constrainScrollPoint:bounds.origin]];
[[self superview] reflectScrolledClipView:self];
}

View file

@ -263,10 +263,11 @@ static Class rulerViewClass = nil;
- (void)reflectScrolledClipView:(NSClipView*)aClipView
{
NSRect documentRect = NSZeroRect;
NSRect documentFrame = NSZeroRect;
NSRect clipViewBounds = NSZeroRect;
float floatValue;
float knobProportion;
id documentView;
if (_knobMoved)
return;
@ -275,18 +276,18 @@ static Class rulerViewClass = nil;
if (_contentView) {
clipViewBounds = [_contentView bounds];
if ([_contentView documentView])
documentRect = [_contentView documentRect];
if ((documentView = [_contentView documentView]))
documentFrame = [documentView frame];
}
if (_hasVertScroller) {
if (documentRect.size.height <= clipViewBounds.size.height)
if (documentFrame.size.height <= clipViewBounds.size.height)
[_vertScroller setEnabled:NO];
else {
[_vertScroller setEnabled:YES];
knobProportion = clipViewBounds.size.height / documentRect.size.height;
knobProportion = clipViewBounds.size.height / documentFrame.size.height;
floatValue = clipViewBounds.origin.y
/ (documentRect.size.height - clipViewBounds.size.height);
/ (documentFrame.size.height - clipViewBounds.size.height);
if (![_contentView isFlipped])
floatValue = 1 - floatValue;
[_vertScroller setFloatValue:floatValue knobProportion:knobProportion];
@ -294,16 +295,17 @@ static Class rulerViewClass = nil;
}
if (_hasHorizScroller) {
if (documentRect.size.width <= clipViewBounds.size.width)
if (documentFrame.size.width <= clipViewBounds.size.width)
[_horizScroller setEnabled:NO];
else {
[_horizScroller setEnabled:YES];
knobProportion = clipViewBounds.size.width / documentRect.size.width;
knobProportion = clipViewBounds.size.width / documentFrame.size.width;
floatValue = clipViewBounds.origin.x
/ (documentRect.size.width - clipViewBounds.size.width);
/ (documentFrame.size.width - clipViewBounds.size.width);
[_horizScroller setFloatValue:floatValue knobProportion:knobProportion];
}
}
[self setNeedsDisplay:YES];
}
- (void)setHorizontalRulerView:(NSRulerView*)aRulerView

View file

@ -214,9 +214,7 @@ static NSButtonCell* knobCell = nil;
else
_floatValue = aFloat;
#if 1
[self setNeedsDisplayInRect:[self rectForPart:NSScrollerKnobSlot]];
#endif
}
- (void)setFloatValue:(float)aFloat
@ -230,13 +228,6 @@ static NSButtonCell* knobCell = nil;
_knobProportion = ratio;
[self setFloatValue:aFloat];
#if 1
[self setNeedsDisplayInRect:[self rectForPart:NSScrollerKnobSlot]];
#else
[self display];
[[self window] flushWindow];
#endif
}
- (void)setFrame:(NSRect)frameRect

View file

@ -903,24 +903,25 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
PSMatrix* copyOfSizeMatrix;
NSView* subview = _subviewsThatNeedDisplay;
copyOfOriginMatrix = [originMatrix copy];
copyOfSizeMatrix = [sizeMatrix copy];
[copyOfOriginMatrix concatenateWith:frameMatrix];
[copyOfOriginMatrix concatenateWith:boundsMatrix];
[copyOfSizeMatrix concatenateWith:boundsMatrix];
// NSLog (@"_collectInvalidatedRectanglesInArray");
while (subview) {
NSRect subviewFrame;
NSRect intersection;
/* Create copies of the original matrices passed by superview */
copyOfOriginMatrix = [originMatrix copy];
copyOfSizeMatrix = [sizeMatrix copy];
/* Concatenate the matrices copies with the subview matrices */
[copyOfOriginMatrix concatenateWith:subview->frameMatrix];
[copyOfOriginMatrix concatenateWith:subview->boundsMatrix];
[copyOfSizeMatrix concatenateWith:subview->boundsMatrix];
if (subview->needs_display) {
subviewFrame = subview->invalidatedRectangle;
/* Compute the origin of the invalidated rectangle into receiver's
coordinates. */
subviewFrame = [self convertRect:subviewFrame fromView:subview];
/* If the subview is rotated compute its bounding rectangle and use this
one instead of the invalidated rectangle. */
if ([subview->frameMatrix isRotated])
@ -932,6 +933,10 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
intersection = NSIntersectionRect (bounds, subviewFrame);
if (intersection.origin.x || intersection.origin.y
|| intersection.size.width || intersection.size.height) {
NSDebugLog (@"intersection (%@) = ((%6.2f, %6.2f), (%6.2f, %6.2f))",
NSStringFromClass(isa),
intersection.origin.x, intersection.origin.y,
intersection.size.width, intersection.size.height);
/* Convert the intersection rectangle to the window coordinates */
intersection.origin
= [copyOfOriginMatrix pointInMatrixSpace:intersection.origin];
@ -939,17 +944,22 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
= [copyOfSizeMatrix sizeInMatrixSpace:intersection.size];
[array addObject:[NSValue valueWithRect:intersection]];
NSDebugLog (@"intersection in window coords = ((%6.2f, %6.2f), (%6.2f, %6.2f))",
intersection.origin.x, intersection.origin.y,
intersection.size.width, intersection.size.height);
}
}
else
else {
[subview _collectInvalidatedRectanglesInArray:array
originMatrix:copyOfOriginMatrix
sizeMatrix:copyOfSizeMatrix];
}
[copyOfOriginMatrix release];
[copyOfSizeMatrix release];
subview = subview->_nextSiblingSubviewThatNeedsDisplay;
}
[copyOfOriginMatrix release];
[copyOfSizeMatrix release];
}
- (NSRect)_boundingRectFor:(NSRect)rect
@ -1125,7 +1135,6 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
m = (TrackingRectangle *)[tracking_rects objectAtIndex:i];
if ([m tag] == tag)
{
//[m release];
[tracking_rects removeObjectAtIndex:i];
return;
}

View file

@ -668,9 +668,8 @@ static BOOL _needsFlushWindows = YES;
// NSLog (@"_collectFlushRectangles");
[_flushRectangles removeAllObjects];
originMatrix = [[content_view _frameMatrix] copy];
[originMatrix concatenateWith:[content_view _boundsMatrix]];
sizeMatrix = [[content_view _boundsMatrix] copy];
originMatrix = [PSMatrix new];
sizeMatrix = [PSMatrix new];
[content_view _collectInvalidatedRectanglesInArray:_flushRectangles
originMatrix:originMatrix

View file

@ -251,8 +251,8 @@ static const float pi = 3.1415926535897932384626433;
{
NSSize new;
new.width = A * size.width + C * size.height + TX;
new.height = B * size.width + D * size.height + TY;
new.width = A * size.width + C * size.height;
new.height = B * size.width + D * size.height;
return new;
}
@ -263,8 +263,8 @@ static const float pi = 3.1415926535897932384626433;
new.origin.x = A * rect.origin.x + C * rect.origin.y + TX;
new.origin.y = B * rect.origin.x + D * rect.origin.y + TY;
new.size.width = A * rect.size.width + C * rect.size.height + TX;
new.size.height = B * rect.size.width + D * rect.size.height + TY;
new.size.width = A * rect.size.width + C * rect.size.height;
new.size.height = B * rect.size.width + D * rect.size.height;
return new;
}