Patches backported from trunk.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_stable_20070311@25587 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2007-11-17 16:05:47 +00:00
parent 99c6b7e28e
commit bad8642e29
18 changed files with 1207 additions and 874 deletions

View file

@ -1,3 +1,92 @@
2007-06-07 Sergii Stoian <stoyan255@gmail.com>
* Source/NSBrowser.m: ([drawWithFrame:inView:]) Pass inset rect by
1 to drawInteriorWithFrame:.
* Source/NSSavePanel.m: ([_initWithoutGModel]) Change propeties of
buttons: remove setting buttons type (by default
NSMomentaryPushInButton); refuse first responder for buttons.
Set setImageDimsWhenDisabled:NO to image button. Cleanup.
* Backported from trunk.
2007-06-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSOpenPanel.m: In -filenames append name to directory using
the standard method rather than by concatenating them joined by a
slash. Might fix bug #19929 but even if it doesn't cure that, it
certainly fixes an error.
* Backported from trunk.
2007-05-28 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSView.m: ([scrollRect:by:]) restrict scrolled rectangle to
the bounds of the view.
* Backported from trunk.
2007-05-23 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSPrintOperation.m
(-runOperationModalForWindow:...contextInfo:,
-_printOperationDidRun:returnCode:contextInfo:) Only set and use
GSModalRunDelegate and GSModalRunSelector values when not nil.
* Backported from trunk.
2007-05-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTextAttachment.m: For MacOS-X compatibility, don't call
([-setAttachment:]) on the cell if the cell class doesn't implement
it.
* Backported from trunk.
2007-05-10 Riccardo Mottola <rmottola@users.sf.net>
* Source/NSAnimation.m: removed some C99-isms
* Source/NSBitmapImageRep+GIF.m : removed some C99-isms
* Source/NSDocument.m : removed some C99-isms
* Backported from trunk.
2007-05-10 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSAnimation.m: removed some C99-isms and simplified by
removing attempt to avoid locking when in single threaded mode.
* Headers/AppKit/NSAnimation.h: added an ivar and FIXME comments.
* Backported from trunk.
2007-05-08 Riccardo Mottola <rmottola@users.sf.net>
* Source/NSAnimation.m: removed some C99-isms
* Backported from trunk.
2007-04-29 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSButtonCell.m
* Source/NSMenuItemCell.m: Whitespace cleanup.
* Backported from trunk.
2007-04-27 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTableView.m (-editColumn::row:withEvent:select:): Set
the background colour of the text object and make it draw its background.
* Backported from trunk.
2007-04-24 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTableView.m (-noteNumberOfRowsChanged): Handle the case
correctly where an empty selection is not allowed and now there
are rows available.
* Backported from trunk.
2007-04-13 Adam Fedor <fedor@gnu.org> 2007-04-13 Adam Fedor <fedor@gnu.org>
* Version 0.12.0 * Version 0.12.0

View file

@ -19,6 +19,81 @@
changes and other information that might help developers and users changes and other information that might help developers and users
migrate to using a newer version of the library. migrate to using a newer version of the library.
</p> </p>
<section>
<heading>Version 0.12.1</heading>
<p>
</p>
</section>
<section>
<heading>Version 0.12.0</heading>
<p>
It has been a long time since the last release and many things
have been added and changed, including new classes, new ivars,
and new methods.
</p>
<deflist>
<term>Tooltips</term>
<desc>
A Tooltip implementation was added.
</desc>
<term>NSBitmapImage Improvements</term>
<desc>
Lots of improvements to the NSBitmapImage subclasses.
</desc>
<term>Theming Improvements</term>
<desc>
GSTheme and other classes were added to improve support
of theming.
</desc>
<term>New Methods added</term>
<desc>
Added new methods from Mac OS X 10.4 for NSControl, NSResponder,
NSDocument, NSPrintOperation, NSWindowController, NSCell,
NSMenuItem, NSView. Some ivar names were changed also.
</desc>
<term>New ivars added</term>
<desc>
Added new ivars for NSMenuItem, NSPrintOperation, NSTableView,
NSDrawer, NSScrollView, NSAlert, NSTextView.
</desc>
<term>New Classes Added</term>
<desc>
New classes from Mac OS X 10.4 and earlier were added including
NSLevelIndicator, NSObjectController, NSUserDefaultsController,
NSKeyValueBinding, NSArrayController, NSController.
</desc>
<term>NSSpellServer moved to base</term>
<desc>
NSSpellServer was moved to GNUstep base for Mac OS X
compatibility.
</desc>
<term>NSTabViewType enumerations</term>
<desc>
Enumerations were changed to match values from Mac OS X.
</desc>
<term>GNUstep GUI updated for Make 2.0</term>
<desc>
GNUstep GUI was updated to work with GNUstep Make 2.0. This
includes versioned resources.
</desc>
<term>NSAffineTransform moved to base</term>
<desc>
Much of NSAffineTransform was moved to gnustep-base to match
with Mac OS X. Many older methods were marked as deprecated
in favor of the more recent Mac OS X methods.
</desc>
<term>NSAlert in alternate threads</term>
<desc>
NSAlerts are performed in the main thread even if called
from another thread.
</desc>
<term>NSAnimation Class Added</term>
<desc>
Preliminary code for the NSAnimation class has been added.
Only NSAnimationNonBlocking mode implemented.
</desc>
</deflist>
</section>
<section> <section>
<heading>Version 0.12.0</heading> <heading>Version 0.12.0</heading>
<p> <p>

View file

@ -9,6 +9,10 @@
The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}. The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}.
@end ifclear @end ifclear
@section Noteworthy changes in version @samp{0.12.1}
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.12.0} @section Noteworthy changes in version @samp{0.12.0}
It has been a long time since the last release and many things have been It has been a long time since the last release and many things have been
@ -29,7 +33,25 @@ NSKeyValueBinding, NSArrayController, NSController.
for Mac OS X compatibility. for Mac OS X compatibility.
@end itemize @end itemize
@ifclear ANNOUNCE-ONLY @section Noteworthy changes in version @samp{0.12.0}
It has been a long time since the last release and many things have been
added and changed, including new classes, new ivars, and new methods.
@itemize @bullet
@item Lots of improvements to the NSBitmapImage subclasses thanks to Mark Tracy
@item GSTheme and other classes were added to improve support of theming.
@item Added new methods from Mac OS X 10.4 for NSControl, NSResponder,
NSDocument, NSPrintOperation, NSWindowController, NSCell,
NSMenuItem, NSView. Some ivar names were changed also.
@item Added new ivars for NSMenuItem, NSPrintOperation, NSTableView,
NSDrawer, NSScrollView.
@item New classes from Mac OS X 10.4 and earlier were added including
NSLevelIndicator, NSObjectController, NSUserDefaultsController,
NSKeyValueBinding, NSArrayController, NSController.
@item NSSpellServer and NSAffineTransform was moved to GNUstep base
for Mac OS X compatibility.
@end itemize
@section Noteworthy changes in version @samp{0.11.0} @section Noteworthy changes in version @samp{0.11.0}

View file

@ -106,6 +106,9 @@ APPKIT_EXPORT NSString *NSAnimationProgressMark;
*/ */
@interface NSAnimation : NSObject < NSCopying, NSCoding, GSAnimation > @interface NSAnimation : NSObject < NSCopying, NSCoding, GSAnimation >
{ {
// FIXME ... all these ivars should be hidden inside a pointer to an
// FIXME ... opaque data structure, so that layout etc can be changed
// FIXME ... without breaking binary compatibility.
NSTimeInterval _duration; // Duration of the animation NSTimeInterval _duration; // Duration of the animation
float _frameRate; // Wanted frame rate float _frameRate; // Wanted frame rate
NSAnimationCurve _curve; // Id of progres->value function NSAnimationCurve _curve; // Id of progres->value function

View file

@ -208,6 +208,10 @@ static GSDragView *sharedDragView = nil;
return loc; return loc;
} }
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
{
return [[self draggingSource] namesOfPromisedFilesDroppedAtDestination: dropDestination];
}
- (BOOL) isDragging - (BOOL) isDragging
{ {
@ -707,6 +711,20 @@ static GSDragView *sharedDragView = nil;
} }
if ([dragSource respondsToSelector: if ([dragSource respondsToSelector:
@selector(draggedImage:endedAt:operation:)])
{
NSPoint point;
point = [theEvent locationInWindow];
// Convert from mouse cursor coordinate to image coordinate
point.x -= offset.width;
point.y -= offset.height;
point = [[theEvent window] convertBaseToScreen: point];
[dragSource draggedImage: [self draggedImage]
endedAt: point
operation: targetMask & dragMask & operationMask];
}
else if ([dragSource respondsToSelector:
@selector(draggedImage:endedAt:deposited:)]) @selector(draggedImage:endedAt:deposited:)])
{ {
NSPoint point; NSPoint point;
@ -836,7 +854,7 @@ static GSDragView *sharedDragView = nil;
destWindow = [self windowAcceptingDnDunder: dragPosition destWindow = [self windowAcceptingDnDunder: dragPosition
windowRef: &mouseWindowRef]; windowRef: &mouseWindowRef];
// If we have are not hovering above a window that we own // If we are not hovering above a window that we own
// we are dragging to an external application. // we are dragging to an external application.
destExternal = (mouseWindowRef != 0) && (destWindow == nil); destExternal = (mouseWindowRef != 0) && (destWindow == nil);
@ -891,6 +909,7 @@ static GSDragView *sharedDragView = nil;
// same window, sending update // same window, sending update
NSDebugLLog(@"NSDragging", @"sending dnd pos\n"); NSDebugLLog(@"NSDragging", @"sending dnd pos\n");
// FIXME: We should only send this when the destination wantsPeriodicDraggingUpdates
if (destWindow != nil) if (destWindow != nil)
{ {
[self _sendLocalEvent: GSAppKitDraggingUpdate [self _sendLocalEvent: GSAppKitDraggingUpdate

View file

@ -27,6 +27,7 @@
*/ */
#include <AppKit/NSAnimation.h> #include <AppKit/NSAnimation.h>
#include <GNUstepBase/GSLock.h>
#include <Foundation/NSNotification.h> #include <Foundation/NSNotification.h>
#include <Foundation/NSValue.h> #include <Foundation/NSValue.h>
#include <Foundation/NSException.h> #include <Foundation/NSException.h>
@ -115,9 +116,10 @@ _GSRationalBezierEval (_GSRationalBezierDesc *rb, float t)
static inline float static inline float
_GSRationalBezierDerivEval (_GSRationalBezierDesc *rb, float t) _GSRationalBezierDerivEval (_GSRationalBezierDesc *rb, float t)
{ {
float h;
if (!rb->areBezierDescComputed) if (!rb->areBezierDescComputed)
_GSRationalBezierComputeBezierDesc (rb); _GSRationalBezierComputeBezierDesc (rb);
float h = _GSBezierEval (&(rb->d),t); h = _GSBezierEval (&(rb->d),t);
return ( _GSBezierDerivEval(&(rb->n),t) * h return ( _GSBezierDerivEval(&(rb->n),t) * h
- _GSBezierEval (&(rb->n),t) * _GSBezierDerivEval(&(rb->d),t) ) - _GSBezierEval (&(rb->n),t) * _GSBezierDerivEval(&(rb->d),t) )
/ (h*h); / (h*h);
@ -176,22 +178,36 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
return (NSComparisonResult)(diff / fabs (diff)); return (NSComparisonResult)(diff / fabs (diff));
} }
/* Thread locking/unlocking support macros.
* _isThreaded flag is an ivar that records whether the
* NSAnimation is running in thread mode.
* __gs_isLocked flag is local to each method and records
* whether the thread is locked and must be locked before
* the method exits.
* Both are needed because _isThreaded is reset when the
* NSAnimation stops : that may happen at any time between
* a lock/unlock pair.
*/
#define _NSANIMATION_LOCKING_SETUP \
BOOL __gs_isLocked = NO;
#define _NSANIMATION_LOCK \ #define _NSANIMATION_LOCK \
BOOL __gs_isLocked = NO; \
if (_isThreaded) \ if (_isThreaded) \
{ \ { \
__gs_isLocked = YES; \ NSAssert(__gs_isLocked == NO, NSInternalInconsistencyException); \
NSDebugFLLog(@"NSAnimationLock",\ NSDebugFLLog(@"NSAnimationLock",\
@"%@ LOCK %@",self,[NSThread currentThread]);\ @"%@ LOCK %@",self,[NSThread currentThread]);\
[_isAnimatingLock lock]; \ [_isAnimatingLock lock]; \
__gs_isLocked = YES; \
} }
#define _NSANIMATION_UNLOCK \ #define _NSANIMATION_UNLOCK \
if (__gs_isLocked) \ if (__gs_isLocked) \
{ \ { \
__gs_isLocked = YES; \ /* NSAssert(__gs_isLocked == YES, NSInternalInconsistencyException); */ \
NSDebugFLLog(@"NSAnimationLock",\ NSDebugFLLog(@"NSAnimationLock",\
@"%@ UNLOCK %@",self,[NSThread currentThread]);\ @"%@ UNLOCK %@",self,[NSThread currentThread]);\
__gs_isLocked = NO; \
[_isAnimatingLock unlock]; \ [_isAnimatingLock unlock]; \
} }
@ -212,11 +228,13 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) addProgressMark: (NSAnimationProgress)progress - (void) addProgressMark: (NSAnimationProgress)progress
{ {
_NSANIMATION_LOCKING_SETUP;
if (progress < 0.0) progress = 0.0; if (progress < 0.0) progress = 0.0;
if (progress > 1.0) progress = 1.0; if (progress > 1.0) progress = 1.0;
_NSANIMATION_LOCK;
_NSANIMATION_LOCK;
if (GSIArrayCount(_progressMarks) == 0) if (GSIArrayCount(_progressMarks) == 0)
{ // First mark { // First mark
GSIArrayAddItem (_progressMarks,progress); GSIArrayAddItem (_progressMarks,progress);
@ -248,6 +266,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (NSAnimationBlockingMode) animationBlockingMode - (NSAnimationBlockingMode) animationBlockingMode
{ {
NSAnimationBlockingMode m; NSAnimationBlockingMode m;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
m = _blockingMode; m = _blockingMode;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -257,6 +277,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (NSAnimationCurve) animationCurve - (NSAnimationCurve) animationCurve
{ {
NSAnimationCurve c; NSAnimationCurve c;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
c = _curve; c = _curve;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -265,6 +287,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) clearStartAnimation - (void) clearStartAnimation
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
[[NSNotificationCenter defaultCenter] [[NSNotificationCenter defaultCenter]
removeObserver: self removeObserver: self
@ -277,6 +301,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) clearStopAnimation - (void) clearStopAnimation
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
[[NSNotificationCenter defaultCenter] [[NSNotificationCenter defaultCenter]
removeObserver: self removeObserver: self
@ -290,6 +316,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (NSAnimationProgress) currentProgress - (NSAnimationProgress) currentProgress
{ {
NSAnimationProgress p; NSAnimationProgress p;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
p = _currentProgress; p = _currentProgress;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -299,6 +327,7 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (float) currentValue - (float) currentValue
{ {
float value; float value;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
@ -344,6 +373,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (id) delegate - (id) delegate
{ {
id d; id d;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
d = (_delegate == nil)? nil : GS_GC_UNHIDE (_delegate); d = (_delegate == nil)? nil : GS_GC_UNHIDE (_delegate);
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -353,6 +384,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (NSTimeInterval) duration - (NSTimeInterval) duration
{ {
NSTimeInterval d; NSTimeInterval d;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
d = _duration; d = _duration;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -362,6 +395,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (float) frameRate - (float) frameRate
{ {
float f; float f;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
f = _frameRate; f = _frameRate;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -410,7 +445,7 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
(BOOL (*)(id,SEL,NSAnimation*)) NULL; (BOOL (*)(id,SEL,NSAnimation*)) NULL;
_isThreaded = NO; _isThreaded = NO;
_isAnimatingLock = [[NSRecursiveLock alloc] init]; _isAnimatingLock = [GSLazyRecursiveLock new];
} }
return self; return self;
} }
@ -447,6 +482,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (BOOL) isAnimating - (BOOL) isAnimating
{ {
BOOL f; BOOL f;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
f = (_animator != nil)? [_animator isAnimationRunning] : NO; f = (_animator != nil)? [_animator isAnimationRunning] : NO;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -456,10 +493,12 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (NSArray*) progressMarks - (NSArray*) progressMarks
{ {
NSNumber **cpmn; NSNumber **cpmn;
unsigned count;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
unsigned count = GSIArrayCount (_progressMarks); count = GSIArrayCount (_progressMarks);
if (!_isCachedProgressMarkNumbersValid) if (!_isCachedProgressMarkNumbersValid)
{ {
@ -494,9 +533,12 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) removeProgressMark: (NSAnimationProgress)progress - (void) removeProgressMark: (NSAnimationProgress)progress
{ {
unsigned index;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
unsigned index = GSIArraySearch (_progressMarks,progress,nsanimation_progressMarkSorter); index = GSIArraySearch (_progressMarks,progress,nsanimation_progressMarkSorter);
if ( index < GSIArrayCount(_progressMarks) if ( index < GSIArrayCount(_progressMarks)
&& progress == GSIArrayItemAtIndex (_progressMarks,index) ) && progress == GSIArrayItemAtIndex (_progressMarks,index) )
{ {
@ -518,6 +560,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) setAnimationBlockingMode: (NSAnimationBlockingMode)mode - (void) setAnimationBlockingMode: (NSAnimationBlockingMode)mode
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
_isANewAnimatorNeeded |= (_blockingMode != mode); _isANewAnimatorNeeded |= (_blockingMode != mode);
_blockingMode = mode; _blockingMode = mode;
@ -526,6 +570,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) setAnimationCurve: (NSAnimationCurve)curve - (void) setAnimationCurve: (NSAnimationCurve)curve
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
if (_currentProgress <= 0.0f || _currentProgress >= 1.0f) if (_currentProgress <= 0.0f || _currentProgress >= 1.0f)
@ -589,6 +635,7 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
{ {
BOOL needSearchNextMark = NO; BOOL needSearchNextMark = NO;
NSAnimationProgress markedProgress; NSAnimationProgress markedProgress;
_NSANIMATION_LOCKING_SETUP;
if (progress < 0.0) progress = 0.0; if (progress < 0.0) progress = 0.0;
if (progress > 1.0) progress = 1.0; if (progress > 1.0) progress = 1.0;
@ -636,6 +683,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) setDelegate: (id)delegate - (void) setDelegate: (id)delegate
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
_delegate = (delegate == nil)? nil : GS_GC_HIDE (delegate); _delegate = (delegate == nil)? nil : GS_GC_HIDE (delegate);
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -643,6 +692,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) setDuration: (NSTimeInterval)duration - (void) setDuration: (NSTimeInterval)duration
{ {
_NSANIMATION_LOCKING_SETUP;
if (duration<=0.0) if (duration<=0.0)
[NSException raise: NSInvalidArgumentException [NSException raise: NSInvalidArgumentException
format: @"%@ Duration must be > 0.0 (passed: %f)",self,duration]; format: @"%@ Duration must be > 0.0 (passed: %f)",self,duration];
@ -653,6 +704,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) setFrameRate: (float)fps - (void) setFrameRate: (float)fps
{ {
_NSANIMATION_LOCKING_SETUP;
if (fps<0.0) if (fps<0.0)
[NSException raise: NSInvalidArgumentException [NSException raise: NSInvalidArgumentException
format: @"%@ Framerate must be >= 0.0 (passed: %f)",self,fps]; format: @"%@ Framerate must be >= 0.0 (passed: %f)",self,fps];
@ -670,6 +723,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) setProgressMarks: (NSArray*)marks - (void) setProgressMarks: (NSArray*)marks
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
GSIArrayEmpty (_progressMarks); GSIArrayEmpty (_progressMarks);
_nextMark = 0; _nextMark = 0;
@ -685,12 +740,13 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) startAnimation - (void) startAnimation
{ {
unsigned i;
if ([self isAnimating]) if ([self isAnimating])
return; return;
NSDebugFLLog (@"NSAnimationStart",@"%@",self); NSDebugFLLog (@"NSAnimationStart",@"%@",self);
unsigned i;
for (i=0; i<GSIArrayCount(_progressMarks); i++) for (i=0; i<GSIArrayCount(_progressMarks); i++)
NSDebugFLLog (@"NSAnimationMark", NSDebugFLLog (@"NSAnimationMark",
@"%@ Mark #%d : %f", @"%@ Mark #%d : %f",
@ -707,10 +763,11 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
if (_delegate != nil) if (_delegate != nil)
{ {
id delegate;
NSDebugFLLog (@"NSAnimationDelegate", NSDebugFLLog (@"NSAnimationDelegate",
@"%@ Cache delegation methods",self); @"%@ Cache delegation methods",self);
// delegation methods are cached while the animation is running // delegation methods are cached while the animation is running
id delegate;
delegate = GS_GC_UNHIDE (_delegate); delegate = GS_GC_UNHIDE (_delegate);
_delegate_animationDidReachProgressMark = _delegate_animationDidReachProgressMark =
([delegate respondsToSelector: @selector (animation:didReachProgressMark:)]) ? ([delegate respondsToSelector: @selector (animation:didReachProgressMark:)]) ?
@ -807,6 +864,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) startWhenAnimation: (NSAnimation*)animation - (void) startWhenAnimation: (NSAnimation*)animation
reachesProgress: (NSAnimationProgress)start reachesProgress: (NSAnimationProgress)start
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
_startAnimation = animation; _startAnimation = animation;
@ -825,6 +884,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) stopAnimation - (void) stopAnimation
{ {
_NSANIMATION_LOCKING_SETUP;
if ([self isAnimating]) if ([self isAnimating])
{ {
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
@ -836,6 +897,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) stopWhenAnimation: (NSAnimation*)animation - (void) stopWhenAnimation: (NSAnimation*)animation
reachesProgress: (NSAnimationProgress)stop reachesProgress: (NSAnimationProgress)stop
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
_stopAnimation = animation; _stopAnimation = animation;
@ -868,11 +931,13 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) animatorDidStart - (void) animatorDidStart
{ {
id delegate;
_NSANIMATION_LOCKING_SETUP;
NSDebugFLLog (@"NSAnimationAnimator",@"%@",self); NSDebugFLLog (@"NSAnimationAnimator",@"%@",self);
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
id delegate;
delegate = GS_GC_UNHIDE (_currentDelegate); delegate = GS_GC_UNHIDE (_currentDelegate);
if (_delegate_animationShouldStart) // method is cached (the animation is running) if (_delegate_animationShouldStart) // method is cached (the animation is running)
@ -887,11 +952,13 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) animatorDidStop - (void) animatorDidStop
{ {
id delegate;
_NSANIMATION_LOCKING_SETUP;
NSDebugFLLog (@"NSAnimationAnimator",@"%@ Progress = %f",self,_currentProgress); NSDebugFLLog (@"NSAnimationAnimator",@"%@ Progress = %f",self,_currentProgress);
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
id delegate;
delegate = GS_GC_UNHIDE (_currentDelegate); delegate = GS_GC_UNHIDE (_currentDelegate);
if (_currentProgress < 1.0) if (_currentProgress < 1.0)
{ {
@ -916,11 +983,14 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) animatorStep: (NSTimeInterval) elapsedTime; - (void) animatorStep: (NSTimeInterval) elapsedTime;
{ {
NSAnimationProgress progress;
_NSANIMATION_LOCKING_SETUP;
NSDebugFLLog (@"NSAnimationAnimator",@"%@ Elapsed time : %f",self,elapsedTime); NSDebugFLLog (@"NSAnimationAnimator",@"%@ Elapsed time : %f",self,elapsedTime);
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
NSAnimationProgress progress = (elapsedTime / _duration); progress = (elapsedTime / _duration);
{ // have some marks been passed ? { // have some marks been passed ?
// NOTE: the case where progress == markedProgress is // NOTE: the case where progress == markedProgress is
@ -945,13 +1015,16 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) _gs_startAnimationReachesProgressMark: (NSNotification*)notification - (void) _gs_startAnimationReachesProgressMark: (NSNotification*)notification
{ {
NSAnimation *animation = [notification object]; NSAnimation *animation;
NSAnimationProgress mark NSAnimationProgress mark;
= [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue]; _NSANIMATION_LOCKING_SETUP;
NSDebugFLLog (@"NSAnimationMark",
@"%@ Start Animation %@ reaches %f",self,animation,mark);
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
animation = [notification object];
mark = [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue];
NSDebugFLLog (@"NSAnimationMark",
@"%@ Start Animation %@ reaches %f",self,animation,mark);
if ( animation == _startAnimation && mark == _startMark) if ( animation == _startAnimation && mark == _startMark)
{ {
@ -962,15 +1035,20 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
} }
- (void) _gs_stopAnimationReachesProgressMark: (NSNotification*)notification - (void) _gs_stopAnimationReachesProgressMark: (NSNotification*)notification
{ {
NSAnimation *animation = [notification object]; NSAnimation *animation;
NSAnimationProgress mark NSAnimationProgress mark;
= [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue]; _NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK;
animation = [notification object];
mark = [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue];
NSDebugFLLog (@"NSAnimationMark", NSDebugFLLog (@"NSAnimationMark",
@"%@ Stop Animation %@ reaches %f",self,animation,mark); @"%@ Stop Animation %@ reaches %f",self,animation,mark);
_NSANIMATION_LOCK;
if ( animation == _stopAnimation && mark == _stopMark) if ( animation == _stopAnimation && mark == _stopMark)
{ {
@ -987,6 +1065,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) _gs_didReachProgressMark: (NSAnimationProgress) progress - (void) _gs_didReachProgressMark: (NSAnimationProgress) progress
{ {
_NSANIMATION_LOCKING_SETUP;
NSDebugFLLog (@"NSAnimationMark",@"%@ progress %f",self, progress); NSDebugFLLog (@"NSAnimationMark",@"%@ progress %f",self, progress);
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
@ -1074,6 +1154,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (unsigned int) frameCount - (unsigned int) frameCount
{ {
unsigned c; unsigned c;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
c = (_animator != nil)? [_animator frameCount] : 0; c = (_animator != nil)? [_animator frameCount] : 0;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -1082,6 +1164,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (void) resetCounters - (void) resetCounters
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
if (_animator != nil) [_animator resetCounters]; if (_animator != nil) [_animator resetCounters];
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -1090,6 +1174,8 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
- (float) actualFrameRate; - (float) actualFrameRate;
{ {
float r; float r;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
r = (_animator != nil)? [_animator frameRate] : 0.0; r = (_animator != nil)? [_animator frameRate] : 0.0;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -1314,6 +1400,8 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
- (void) setViewAnimations: (NSArray*)animations - (void) setViewAnimations: (NSArray*)animations
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
if (_viewAnimations != animations) if (_viewAnimations != animations)
DESTROY (_viewAnimationDesc); DESTROY (_viewAnimationDesc);
@ -1324,6 +1412,8 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
- (NSArray*) viewAnimations - (NSArray*) viewAnimations
{ {
NSArray *a; NSArray *a;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
a = _viewAnimations; a = _viewAnimations;
_NSANIMATION_UNLOCK; _NSANIMATION_UNLOCK;
@ -1332,6 +1422,8 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
- (void) startAnimation - (void) startAnimation
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
if (_viewAnimationDesc == nil) if (_viewAnimationDesc == nil)
{ {
@ -1351,6 +1443,8 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
- (void) stopAnimation - (void) stopAnimation
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
[super stopAnimation]; [super stopAnimation];
[self setCurrentProgress: 1.0]; [self setCurrentProgress: 1.0];
@ -1371,6 +1465,8 @@ NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect";
- (void) setCurrentProgress: (NSAnimationProgress)progress - (void) setCurrentProgress: (NSAnimationProgress)progress
{ {
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK; _NSANIMATION_LOCK;
[super setCurrentProgress: progress]; [super setCurrentProgress: progress];
[self performSelectorOnMainThread: @selector (_gs_updateViewsWithValue:) [self performSelectorOnMainThread: @selector (_gs_updateViewsWithValue:)

View file

@ -112,9 +112,11 @@ static void gs_gif_init_input_source(gs_gif_input_src *src, NSData *data)
/* Function to write GIF to buffer */ /* Function to write GIF to buffer */
static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len) static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
{ {
NSMutableData *nsData;
if (len <= 0) return 0; if (len <= 0) return 0;
NSMutableData * nsData = file->UserData; nsData = file->UserData;
[nsData appendBytes: buffer length: len]; [nsData appendBytes: buffer length: len];
return len; return len;
} }

View file

@ -207,7 +207,8 @@ static NSTextFieldCell *titleCell;
} }
[[GSTheme theme] drawGrayBezel: cellFrame withClip: NSZeroRect]; [[GSTheme theme] drawGrayBezel: cellFrame withClip: NSZeroRect];
[self drawInteriorWithFrame: cellFrame inView: controlView]; [self drawInteriorWithFrame: NSInsetRect(cellFrame, 1.0, 1.0)
inView: controlView];
} }
@end @end

View file

@ -565,12 +565,14 @@ withContentsOfURL: (NSURL *)url
- (NSFileWrapper *)fileWrapperOfType: (NSString *)type - (NSFileWrapper *)fileWrapperOfType: (NSString *)type
error: (NSError **)error error: (NSError **)error
{ {
NSData *data;
if (OVERRIDDEN(fileWrapperRepresentationOfType:)) if (OVERRIDDEN(fileWrapperRepresentationOfType:))
{ {
return [self fileWrapperRepresentationOfType: type]; return [self fileWrapperRepresentationOfType: type];
} }
NSData *data = [self dataOfType: type error: error]; data = [self dataOfType: type error: error];
if (data == nil) if (data == nil)
return nil; return nil;

View file

@ -385,8 +385,8 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
{ {
while ((currCell = [cellEnum nextObject])) while ((currCell = [cellEnum nextObject]))
{ {
[ret addObject: [NSString stringWithFormat: @"%@/%@", dir, [ret addObject:
[currCell stringValue]]]; [dir stringByAppendingPathComponent: [currCell stringValue]]];
} }
} }
return ret; return ret;

View file

@ -517,12 +517,15 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
NSMutableDictionary *dict; NSMutableDictionary *dict;
NSPrintPanel *panel = [self printPanel]; NSPrintPanel *panel = [self printPanel];
if (delegate != nil && didRunSelector != NULL)
{
/* Save the selector so we can use it later */ /* Save the selector so we can use it later */
dict = [_print_info dictionary]; dict = [_print_info dictionary];
[dict setObject: [NSValue value: &didRunSelector withObjCType: @encode(SEL)] [dict setObject: [NSValue value: &didRunSelector withObjCType: @encode(SEL)]
forKey: @"GSModalRunSelector"]; forKey: @"GSModalRunSelector"];
[dict setObject: delegate [dict setObject: delegate
forKey: @"GSModalRunDelegate"]; forKey: @"GSModalRunDelegate"];
}
/* Assume we want to show the panel regardless of the value /* Assume we want to show the panel regardless of the value
of _showPanels of _showPanels
@ -703,10 +706,13 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
dict = [_print_info dictionary]; dict = [_print_info dictionary];
[[dict objectForKey: @"GSModalRunSelector"] getValue: &didRunSelector]; [[dict objectForKey: @"GSModalRunSelector"] getValue: &didRunSelector];
delegate = [dict objectForKey: @"GSModalRunDelegate"]; delegate = [dict objectForKey: @"GSModalRunDelegate"];
if (delegate != nil && didRunSelector != NULL)
{
didRun = (void (*)(id, SEL, BOOL, id))[delegate methodForSelector: didRun = (void (*)(id, SEL, BOOL, id))[delegate methodForSelector:
didRunSelector]; didRunSelector];
didRun (delegate, didRunSelector, success, contextInfo); didRun (delegate, didRunSelector, success, contextInfo);
} }
}

View file

@ -221,14 +221,13 @@ static BOOL _gs_display_reading_progress = NO;
r = NSMakeRect (43, 6, 27, 27); r = NSMakeRect (43, 6, 27, 27);
button = [[NSButton alloc] initWithFrame: r]; button = [[NSButton alloc] initWithFrame: r];
[button setRefusesFirstResponder: YES];
[button setBordered: YES]; [button setBordered: YES];
[button setButtonType: NSMomentaryPushButton];
image = [NSImage imageNamed: @"common_Home"]; image = [NSImage imageNamed: @"common_Home"];
[button setImage: image]; [button setImage: image];
[button setImagePosition: NSImageOnly]; [button setImagePosition: NSImageOnly];
[button setTarget: self]; [button setTarget: self];
[button setAction: @selector(_setHomeDirectory)]; [button setAction: @selector(_setHomeDirectory)];
// [_form setNextKeyView: button];
[button setAutoresizingMask: NSViewMinXMargin]; [button setAutoresizingMask: NSViewMinXMargin];
[button setTag: NSFileHandlingPanelHomeButton]; [button setTag: NSFileHandlingPanelHomeButton];
[_bottomView addSubview: button]; [_bottomView addSubview: button];
@ -238,8 +237,8 @@ static BOOL _gs_display_reading_progress = NO;
r = NSMakeRect (78, 6, 27, 27); r = NSMakeRect (78, 6, 27, 27);
button = [[NSButton alloc] initWithFrame: r]; button = [[NSButton alloc] initWithFrame: r];
[button setRefusesFirstResponder: YES];
[button setBordered: YES]; [button setBordered: YES];
[button setButtonType: NSMomentaryPushButton];
image = [NSImage imageNamed: @"common_Mount"]; image = [NSImage imageNamed: @"common_Mount"];
[button setImage: image]; [button setImage: image];
[button setImagePosition: NSImageOnly]; [button setImagePosition: NSImageOnly];
@ -254,8 +253,8 @@ static BOOL _gs_display_reading_progress = NO;
r = NSMakeRect (112, 6, 27, 27); r = NSMakeRect (112, 6, 27, 27);
button = [[NSButton alloc] initWithFrame: r]; button = [[NSButton alloc] initWithFrame: r];
[button setRefusesFirstResponder: YES];
[button setBordered: YES]; [button setBordered: YES];
[button setButtonType: NSMomentaryPushButton];
image = [NSImage imageNamed: @"common_Unmount"]; image = [NSImage imageNamed: @"common_Unmount"];
[button setImage: image]; [button setImage: image];
[button setImagePosition: NSImageOnly]; [button setImagePosition: NSImageOnly];
@ -270,8 +269,8 @@ static BOOL _gs_display_reading_progress = NO;
r = NSMakeRect (148, 6, 71, 27); r = NSMakeRect (148, 6, 71, 27);
button = [[NSButton alloc] initWithFrame: r]; button = [[NSButton alloc] initWithFrame: r];
[button setRefusesFirstResponder: YES];
[button setBordered: YES]; [button setBordered: YES];
[button setButtonType: NSMomentaryPushButton];
[button setTitle: @"Cancel"]; [button setTitle: @"Cancel"];
[button setImagePosition: NSNoImage]; [button setImagePosition: NSNoImage];
[button setTarget: self]; [button setTarget: self];
@ -285,8 +284,8 @@ static BOOL _gs_display_reading_progress = NO;
r = NSMakeRect (228, 6, 71, 27); r = NSMakeRect (228, 6, 71, 27);
_okButton = [[NSButton alloc] initWithFrame: r]; _okButton = [[NSButton alloc] initWithFrame: r];
[button setRefusesFirstResponder: YES];
[_okButton setBordered: YES]; [_okButton setBordered: YES];
[_okButton setButtonType: NSMomentaryPushButton];
[_okButton setTitle: @"OK"]; [_okButton setTitle: @"OK"];
[_okButton setImagePosition: NSImageRight]; [_okButton setImagePosition: NSImageRight];
[_okButton setImage: [NSImage imageNamed: @"common_ret"]]; [_okButton setImage: [NSImage imageNamed: @"common_ret"]];
@ -311,6 +310,7 @@ static BOOL _gs_display_reading_progress = NO;
[button setImage: image]; [button setImage: image];
[button setBordered: NO]; [button setBordered: NO];
[button setEnabled: NO]; [button setEnabled: NO];
[[button cell] setImageDimsWhenDisabled: NO];
[button setImagePosition: NSImageOnly]; [button setImagePosition: NSImageOnly];
[button setAutoresizingMask: NSViewMinYMargin]; [button setAutoresizingMask: NSViewMinYMargin];
[button setTag: NSFileHandlingPanelImageButton]; [button setTag: NSFileHandlingPanelImageButton];

View file

@ -3267,19 +3267,6 @@ byExtendingSelection: (BOOL)flag
[_editedCell setEditable: _dataSource_editable]; [_editedCell setEditable: _dataSource_editable];
[_editedCell setObjectValue: [self _objectValueForTableColumn: tb [_editedCell setObjectValue: [self _objectValueForTableColumn: tb
row: rowIndex]]; row: rowIndex]];
/* [_dataSource tableView: self
objectValueForTableColumn: tb
row: rowIndex]]; */
// We really want the correct background color!
if ([_editedCell respondsToSelector: @selector(setBackgroundColor:)])
{
[(NSTextFieldCell *)_editedCell setBackgroundColor: _backgroundColor];
}
else
{
[t setBackgroundColor: _backgroundColor];
}
// But of course the delegate can mess it up if it wants // But of course the delegate can mess it up if it wants
[self _willDisplayCell: _editedCell [self _willDisplayCell: _editedCell
@ -3302,6 +3289,9 @@ byExtendingSelection: (BOOL)flag
} }
_textObject = [_editedCell setUpFieldEditorAttributes: t]; _textObject = [_editedCell setUpFieldEditorAttributes: t];
// FIXME: Which background color do we want here?
[_textObject setBackgroundColor: [NSColor selectedControlColor]];
[_textObject setDrawsBackground: YES];
drawingRect = [self frameOfCellAtColumn: columnIndex row: rowIndex]; drawingRect = [self frameOfCellAtColumn: columnIndex row: rowIndex];
if (flag) if (flag)
@ -4727,6 +4717,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
NSLog(@"exiting sizeToFit"); NSLog(@"exiting sizeToFit");
} }
*/ */
- (void) noteNumberOfRowsChanged - (void) noteNumberOfRowsChanged
{ {
_numberOfRows = [self _numRows]; _numberOfRows = [self _numRows];
@ -4737,8 +4728,30 @@ static BOOL selectContiguousRegion(NSTableView *self,
{ {
int row = [_selectedRows lastIndex]; int row = [_selectedRows lastIndex];
if (row == NSNotFound)
{
if (!_allowsEmptySelection)
{
/* We shouldn't allow empty selection - try
selecting the last row */
int lastRow = _numberOfRows - 1;
if (lastRow > -1)
{
[self _postSelectionIsChangingNotification];
[_selectedRows addIndex: lastRow];
_selectedRow = lastRow;
[self _postSelectionDidChangeNotification];
}
else
{
/* problem - there are no rows at all */
_selectedRow = -1;
}
}
}
/* Check that all selected rows are in the new range of rows */ /* Check that all selected rows are in the new range of rows */
if ((row != NSNotFound) && (row >= _numberOfRows)) else if (row >= _numberOfRows)
{ {
[_selectedRows removeIndexesInRange: [_selectedRows removeIndexesInRange:
NSMakeRange(_numberOfRows, row + 1 - _numberOfRows)]; NSMakeRange(_numberOfRows, row + 1 - _numberOfRows)];
@ -6336,21 +6349,20 @@ static BOOL selectContiguousRegion(NSTableView *self,
*/ */
- (void) _postSelectionIsChangingNotification - (void) _postSelectionIsChangingNotification
{ {
[nc postNotificationName: [nc postNotificationName: NSTableViewSelectionIsChangingNotification
NSTableViewSelectionIsChangingNotification
object: self]; object: self];
} }
- (void) _postSelectionDidChangeNotification - (void) _postSelectionDidChangeNotification
{ {
[nc postNotificationName: [nc postNotificationName: NSTableViewSelectionDidChangeNotification
NSTableViewSelectionDidChangeNotification
object: self]; object: self];
} }
- (void) _postColumnDidMoveNotificationWithOldIndex: (int) oldIndex - (void) _postColumnDidMoveNotificationWithOldIndex: (int) oldIndex
newIndex: (int) newIndex newIndex: (int) newIndex
{ {
[nc postNotificationName: [nc postNotificationName: NSTableViewColumnDidMoveNotification
NSTableViewColumnDidMoveNotification
object: self object: self
userInfo: [NSDictionary userInfo: [NSDictionary
dictionaryWithObjectsAndKeys: dictionaryWithObjectsAndKeys:

View file

@ -31,7 +31,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/ */
#include "AppKit/NSCell.h" #include "AppKit/NSCell.h"
@ -108,8 +109,7 @@
{ {
if ([theEvent clickCount] == 2) if ([theEvent clickCount] == 2)
{ {
if (delegate != nil && if (delegate != nil && [delegate respondsToSelector:
[delegate respondsToSelector:
@selector(textView:doubleClickedOnCell:inRect:)]) @selector(textView:doubleClickedOnCell:inRect:)])
{ {
[delegate textView: textView [delegate textView: textView
@ -120,8 +120,7 @@
} }
else else
{ {
if (delegate != nil && if (delegate != nil && [delegate respondsToSelector:
[delegate respondsToSelector:
@selector(textView:clickedOnCell:inRect:)]) @selector(textView:clickedOnCell:inRect:)])
{ {
[delegate textView: textView [delegate textView: textView
@ -133,8 +132,7 @@
} }
else if (type == NSLeftMouseDragged) else if (type == NSLeftMouseDragged)
{ {
if (delegate != nil && if (delegate != nil && [delegate respondsToSelector:
[delegate respondsToSelector:
@selector(textView:draggedCell:inRect:event:)]) @selector(textView:draggedCell:inRect:event:)])
{ {
[delegate textView: textView [delegate textView: textView
@ -168,8 +166,7 @@
{ {
if ([theEvent clickCount] == 2) if ([theEvent clickCount] == 2)
{ {
if (delegate != nil && if (delegate != nil && [delegate respondsToSelector:
[delegate respondsToSelector:
@selector(textView:doubleClickedOnCell:inRect:atIndex:)]) @selector(textView:doubleClickedOnCell:inRect:atIndex:)])
{ {
[delegate textView: textView [delegate textView: textView
@ -181,8 +178,7 @@
} }
else else
{ {
if (delegate != nil && if (delegate != nil && [delegate respondsToSelector:
[delegate respondsToSelector:
@selector(textView:clickedOnCell:inRect:atIndex:)]) @selector(textView:clickedOnCell:inRect:atIndex:)])
{ {
[delegate textView: textView [delegate textView: textView
@ -195,8 +191,7 @@
} }
else if (type == NSLeftMouseDragged) else if (type == NSLeftMouseDragged)
{ {
if (delegate != nil && if (delegate != nil && [delegate respondsToSelector:
[delegate respondsToSelector:
@selector(textView:draggedCell:inRect:event:atIndex:)]) @selector(textView:draggedCell:inRect:event:atIndex:)])
{ {
[delegate textView: textView [delegate textView: textView
@ -299,8 +294,11 @@
{ {
ASSIGN(_fileWrapper, fileWrapper); ASSIGN(_fileWrapper, fileWrapper);
// Reset the cell, so it shows the new attachment // Reset the cell, so it shows the new attachment
if ([_cell respondsToSelector: @selector(setAttachment:)] == YES)
{
[_cell setAttachment: self]; [_cell setAttachment: self];
} }
}
- (NSFileWrapper *)fileWrapper - (NSFileWrapper *)fileWrapper
{ {
@ -315,8 +313,11 @@
- (void)setAttachmentCell: (id <NSTextAttachmentCell>)cell - (void)setAttachmentCell: (id <NSTextAttachmentCell>)cell
{ {
ASSIGN(_cell, cell); ASSIGN(_cell, cell);
if ([_cell respondsToSelector: @selector(setAttachment:)] == YES)
{
[_cell setAttachment: self]; [_cell setAttachment: self];
} }
}
/* /*
* NSCoding protocol * NSCoding protocol
@ -346,8 +347,11 @@
[aDecoder decodeValueOfObjCType: @encode(id) at: &_cell]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_cell];
// Reconnect the cell, so the cell does not have to store the attachment // Reconnect the cell, so the cell does not have to store the attachment
if ([_cell respondsToSelector: @selector(setAttachment:)] == YES)
{
[_cell setAttachment: self]; [_cell setAttachment: self];
} }
}
return self; return self;
} }

View file

@ -2680,8 +2680,10 @@ in the main thread.
*/ */
- (void) scrollRect: (NSRect)aRect by: (NSSize)delta - (void) scrollRect: (NSRect)aRect by: (NSSize)delta
{ {
NSPoint destPoint = aRect.origin; NSPoint destPoint;
aRect = NSIntersectionRect(aRect, _bounds); // Don't copy stuff outside.
destPoint = aRect.origin;
destPoint.x -= delta.width; destPoint.x -= delta.width;
destPoint.y -= delta.height; destPoint.y -= delta.height;

View file

@ -11,9 +11,9 @@ GNUSTEP_GUI_LIBTIFF=3.4
# The version number of this release. # The version number of this release.
GNUSTEP_GUI_MAJOR_VERSION=0 GNUSTEP_GUI_MAJOR_VERSION=0
GNUSTEP_GUI_MINOR_VERSION=12 GNUSTEP_GUI_MINOR_VERSION=12
GNUSTEP_GUI_SUBMINOR_VERSION=0 GNUSTEP_GUI_SUBMINOR_VERSION=1
# numeric value should match above # numeric value should match above
VERSION_NUMBER=012.0 VERSION_NUMBER=012.1
GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION} GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION}
VERSION=${GNUSTEP_GUI_VERSION} VERSION=${GNUSTEP_GUI_VERSION}