Merge with revision 39619 of GUI main branch

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@39629 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2016-04-06 17:57:36 +00:00
parent 59be9b4a52
commit fab1e8f6f4
3 changed files with 63 additions and 13 deletions

View file

@ -4,7 +4,7 @@
A view that allows you to scroll a document view that's too big to display
entirely on a window.
Copyright (C) 1996 Free Software Foundation, Inc.
Copyright (C) 1996-2015 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: July 1997
@ -34,6 +34,15 @@
#import <AppKit/NSView.h>
enum
{
NSScrollElasticityAutomatic = 0,
NSScrollElasticityNone = 1,
NSScrollElasticityAllowed = 2
};
typedef NSInteger NSScrollElasticity;
@class NSClipView;
@class NSRulerView;
@class NSColor;
@ -66,6 +75,8 @@
BOOL _autohidesScrollers;
NSUInteger _reflectScrolledClipView_HRecursionCnt;
NSUInteger _reflectScrolledClipView_VRecursionCnt;
NSScrollElasticity _horizScrollElasticity;
NSScrollElasticity _vertScrollElasticity;
}
/* Calculating layout */
@ -144,6 +155,16 @@
- (BOOL)autohidesScrollers;
- (void)setAutohidesScrollers:(BOOL)flag;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
- (NSScrollElasticity)horizontalScrollElasticity;
- (void)setHorizontalScrollElasticity:(NSScrollElasticity)value;
- (NSScrollElasticity)verticalScrollElasticity;
- (void)setVerticalScrollElasticity:(NSScrollElasticity)value;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST)
- (BOOL)allowsMagnification;
- (void)setAllowsMagnification:(BOOL)m;
#endif
/* Updating display after scrolling */
- (void)reflectScrolledClipView:(NSClipView*)aClipView;

View file

@ -224,6 +224,8 @@ static CGFloat scrollerWidth;
// For compatibility the ruler should be present but not visible.
[self setHasHorizontalRuler: YES];
[self tile];
_horizScrollElasticity = NSScrollElasticityAutomatic;
_vertScrollElasticity = NSScrollElasticityAutomatic;
[[NSNotificationCenter defaultCenter]
addObserver: self
@ -398,6 +400,27 @@ static CGFloat scrollerWidth;
_autohidesScrollers = flag;
}
- (NSScrollElasticity)horizontalScrollElasticity
{
return _horizScrollElasticity;
}
- (void)setHorizontalScrollElasticity:(NSScrollElasticity)value
{
_horizScrollElasticity = value;
}
- (NSScrollElasticity)verticalScrollElasticity
{
return _vertScrollElasticity;
}
- (void)setVerticalScrollElasticity:(NSScrollElasticity)value
{
_vertScrollElasticity = value;
}
- (void) scrollWheel: (NSEvent *)theEvent
{
NSRect clipViewBounds;
@ -913,7 +936,7 @@ static CGFloat scrollerWidth;
// Testplant-MAL-2015-07-08: keeping testplant branch code...
_reflectScrolledClipView_HRecursionCnt--;
}
if (_hasHeaderView)
{
NSPoint headerClipViewOrigin;
@ -1366,17 +1389,12 @@ GSOppositeEdge(NSRectEdge edge)
- (BOOL) isOpaque
{
#if 0
// FIXME: Only needs to be NO in a corner case,
// when [[GSTheme theme] scrollViewUseBottomCorner] is NO
// and the theme tile for the bottom corner is transparent.
// So maybe cache the value of
// [[GSTheme theme] scrollViewUseBottomCorner] and check it here.
return NO;
#else
// Testplant-MAL-2015-07-08: keeping testplant branch code...
return [_contentView isOpaque];
#endif
}
- (NSBorderType) borderType
@ -1532,6 +1550,17 @@ GSOppositeEdge(NSRectEdge edge)
return _vertScroller;
}
- (BOOL)allowsMagnification
{
//we need an ivar for this
return NO;
}
- (void)setAllowsMagnification:(BOOL)m
{
//we need an ivar for this
}
/*
* NSCoding protocol
*/

View file

@ -1060,11 +1060,11 @@ static float buttonsOffset = 1.0; // buttonsWidth = sw - 2*buttonsOffset
}
else
{
[[GSTheme theme] drawScrollerRect: rect
inView: self
hitPart: _hitPart
isHorizontal: _scFlags.isHorizontal];
}
[[GSTheme theme] drawScrollerRect: rect
inView: self
hitPart: _hitPart
isHorizontal: _scFlags.isHorizontal];
}
}
/**<p>(Un)Highlight the button specified by <var>whichButton</var>.
@ -1127,7 +1127,7 @@ static float buttonsOffset = 1.0; // buttonsWidth = sw - 2*buttonsOffset
- (void) drawKnobSlot
{
[self drawKnobSlotInRect: [self rectForPart: NSScrollerKnobSlot]
highlight: NO];
highlight: NO];
}
- (void) drawKnobSlotInRect: (NSRect)slotRect highlight: (BOOL)flag