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>
* Version 0.12.0

View file

@ -19,6 +19,81 @@
changes and other information that might help developers and users
migrate to using a newer version of the library.
</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>
<heading>Version 0.12.0</heading>
<p>

View file

@ -9,6 +9,10 @@
The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}.
@end ifclear
@section Noteworthy changes in version @samp{0.12.1}
@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
@ -29,7 +33,25 @@ NSKeyValueBinding, NSArrayController, NSController.
for Mac OS X compatibility.
@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}

View file

@ -106,6 +106,9 @@ APPKIT_EXPORT NSString *NSAnimationProgressMark;
*/
@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
float _frameRate; // Wanted frame rate
NSAnimationCurve _curve; // Id of progres->value function

View file

@ -208,6 +208,10 @@ static GSDragView *sharedDragView = nil;
return loc;
}
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
{
return [[self draggingSource] namesOfPromisedFilesDroppedAtDestination: dropDestination];
}
- (BOOL) isDragging
{
@ -707,6 +711,20 @@ static GSDragView *sharedDragView = nil;
}
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:)])
{
NSPoint point;
@ -836,7 +854,7 @@ static GSDragView *sharedDragView = nil;
destWindow = [self windowAcceptingDnDunder: dragPosition
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.
destExternal = (mouseWindowRef != 0) && (destWindow == nil);
@ -891,6 +909,7 @@ static GSDragView *sharedDragView = nil;
// same window, sending update
NSDebugLLog(@"NSDragging", @"sending dnd pos\n");
// FIXME: We should only send this when the destination wantsPeriodicDraggingUpdates
if (destWindow != nil)
{
[self _sendLocalEvent: GSAppKitDraggingUpdate

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3267,19 +3267,6 @@ byExtendingSelection: (BOOL)flag
[_editedCell setEditable: _dataSource_editable];
[_editedCell setObjectValue: [self _objectValueForTableColumn: tb
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
[self _willDisplayCell: _editedCell
@ -3302,6 +3289,9 @@ byExtendingSelection: (BOOL)flag
}
_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];
if (flag)
@ -4727,6 +4717,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
NSLog(@"exiting sizeToFit");
}
*/
- (void) noteNumberOfRowsChanged
{
_numberOfRows = [self _numRows];
@ -4737,8 +4728,30 @@ static BOOL selectContiguousRegion(NSTableView *self,
{
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 */
if ((row != NSNotFound) && (row >= _numberOfRows))
else if (row >= _numberOfRows)
{
[_selectedRows removeIndexesInRange:
NSMakeRange(_numberOfRows, row + 1 - _numberOfRows)];
@ -4793,7 +4806,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
NSRect superviewBounds; // Get this *after* [self setFrame:]
superviewBounds = [_super_view bounds];
if ((superviewBounds.origin.x <= _frame.origin.x)
&& (NSMaxY (superviewBounds) >= NSMaxY (_frame)))
&& (NSMaxY(superviewBounds) >= NSMaxY(_frame)))
{
[self setNeedsDisplay: YES];
}
@ -6336,21 +6349,20 @@ static BOOL selectContiguousRegion(NSTableView *self,
*/
- (void) _postSelectionIsChangingNotification
{
[nc postNotificationName:
NSTableViewSelectionIsChangingNotification
[nc postNotificationName: NSTableViewSelectionIsChangingNotification
object: self];
}
- (void) _postSelectionDidChangeNotification
{
[nc postNotificationName:
NSTableViewSelectionDidChangeNotification
[nc postNotificationName: NSTableViewSelectionDidChangeNotification
object: self];
}
- (void) _postColumnDidMoveNotificationWithOldIndex: (int) oldIndex
newIndex: (int) newIndex
{
[nc postNotificationName:
NSTableViewColumnDidMoveNotification
[nc postNotificationName: NSTableViewColumnDidMoveNotification
object: self
userInfo: [NSDictionary
dictionaryWithObjectsAndKeys:

View file

@ -31,7 +31,8 @@
You should have received a copy of the GNU Library General Public
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"
@ -45,18 +46,18 @@
@implementation NSTextAttachmentCell
- (void)drawWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
characterIndex:(unsigned)charIndex
- (void)drawWithFrame: (NSRect)cellFrame
inView: (NSView *)controlView
characterIndex: (unsigned)charIndex
{
[self drawWithFrame: cellFrame
inView: controlView];
}
- (void)drawWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
characterIndex:(unsigned)charIndex
layoutManager:(NSLayoutManager *)layoutManager
- (void)drawWithFrame: (NSRect)cellFrame
inView: (NSView *)controlView
characterIndex: (unsigned)charIndex
layoutManager: (NSLayoutManager *)layoutManager
{
[self drawWithFrame: cellFrame
inView: controlView
@ -68,10 +69,10 @@
return NSZeroPoint;
}
- (NSRect)cellFrameForTextContainer:(NSTextContainer *)textContainer
proposedLineFragment:(NSRect)lineFrag
glyphPosition:(NSPoint)position
characterIndex:(unsigned)charIndex
- (NSRect)cellFrameForTextContainer: (NSTextContainer *)textContainer
proposedLineFragment: (NSRect)lineFrag
glyphPosition: (NSPoint)position
characterIndex: (unsigned)charIndex
{
NSRect aRect;
@ -85,18 +86,18 @@
return YES;
}
- (BOOL)wantsToTrackMouseForEvent:(NSEvent *)theEvent
inRect:(NSRect)cellFrame
ofView:(NSView *)controlView
atCharacterIndex:(unsigned)charIndex
- (BOOL)wantsToTrackMouseForEvent: (NSEvent *)theEvent
inRect: (NSRect)cellFrame
ofView: (NSView *)controlView
atCharacterIndex: (unsigned)charIndex
{
return [self wantsToTrackMouse];
}
- (BOOL)trackMouse:(NSEvent *)theEvent
inRect:(NSRect)cellFrame
ofView:(NSView *)controlView
untilMouseUp:(BOOL)flag
- (BOOL)trackMouse: (NSEvent *)theEvent
inRect: (NSRect)cellFrame
ofView: (NSView *)controlView
untilMouseUp: (BOOL)flag
{
if ([controlView respondsToSelector: @selector(delegate)])
{
@ -108,8 +109,7 @@
{
if ([theEvent clickCount] == 2)
{
if (delegate != nil &&
[delegate respondsToSelector:
if (delegate != nil && [delegate respondsToSelector:
@selector(textView:doubleClickedOnCell:inRect:)])
{
[delegate textView: textView
@ -120,8 +120,7 @@
}
else
{
if (delegate != nil &&
[delegate respondsToSelector:
if (delegate != nil && [delegate respondsToSelector:
@selector(textView:clickedOnCell:inRect:)])
{
[delegate textView: textView
@ -133,8 +132,7 @@
}
else if (type == NSLeftMouseDragged)
{
if (delegate != nil &&
[delegate respondsToSelector:
if (delegate != nil && [delegate respondsToSelector:
@selector(textView:draggedCell:inRect:event:)])
{
[delegate textView: textView
@ -152,11 +150,11 @@
untilMouseUp: flag];
}
- (BOOL)trackMouse:(NSEvent *)theEvent
inRect:(NSRect)cellFrame
ofView:(NSView *)controlView
atCharacterIndex:(unsigned)charIndex
untilMouseUp:(BOOL)flag
- (BOOL)trackMouse: (NSEvent *)theEvent
inRect: (NSRect)cellFrame
ofView: (NSView *)controlView
atCharacterIndex: (unsigned)charIndex
untilMouseUp: (BOOL)flag
{
if ([controlView respondsToSelector: @selector(delegate)])
{
@ -168,8 +166,7 @@
{
if ([theEvent clickCount] == 2)
{
if (delegate != nil &&
[delegate respondsToSelector:
if (delegate != nil && [delegate respondsToSelector:
@selector(textView:doubleClickedOnCell:inRect:atIndex:)])
{
[delegate textView: textView
@ -181,8 +178,7 @@
}
else
{
if (delegate != nil &&
[delegate respondsToSelector:
if (delegate != nil && [delegate respondsToSelector:
@selector(textView:clickedOnCell:inRect:atIndex:)])
{
[delegate textView: textView
@ -195,8 +191,7 @@
}
else if (type == NSLeftMouseDragged)
{
if (delegate != nil &&
[delegate respondsToSelector:
if (delegate != nil && [delegate respondsToSelector:
@selector(textView:draggedCell:inRect:event:atIndex:)])
{
[delegate textView: textView
@ -215,7 +210,7 @@
untilMouseUp: flag];
}
- (void)setAttachment:(NSTextAttachment *)anObject
- (void)setAttachment: (NSTextAttachment *)anObject
{
NSFileWrapper *fileWrap = [anObject fileWrapper];
@ -252,16 +247,16 @@
return [super cellSize];
}
- (void)highlight:(BOOL)flag
withFrame:(NSRect)cellFrame
inView:(NSView *)controlView
- (void)highlight: (BOOL)flag
withFrame: (NSRect)cellFrame
inView: (NSView *)controlView
{
[super highlight: flag
withFrame: cellFrame
inView: controlView];
}
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
- (void)drawWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
{
[super drawWithFrame: cellFrame inView: controlView];
}
@ -283,7 +278,7 @@
[super dealloc];
}
- (id) initWithFileWrapper:(NSFileWrapper *)fileWrapper
- (id) initWithFileWrapper: (NSFileWrapper *)fileWrapper
{
self = [super init];
if (self != nil)
@ -295,11 +290,14 @@
return self;
}
- (void)setFileWrapper:(NSFileWrapper *)fileWrapper
- (void)setFileWrapper: (NSFileWrapper *)fileWrapper
{
ASSIGN(_fileWrapper, fileWrapper);
// Reset the cell, so it shows the new attachment
if ([_cell respondsToSelector: @selector(setAttachment:)] == YES)
{
[_cell setAttachment: self];
}
}
- (NSFileWrapper *)fileWrapper
@ -312,10 +310,13 @@
return _cell;
}
- (void)setAttachmentCell:(id <NSTextAttachmentCell>)cell
- (void)setAttachmentCell: (id <NSTextAttachmentCell>)cell
{
ASSIGN(_cell, cell);
if ([_cell respondsToSelector: @selector(setAttachment:)] == YES)
{
[_cell setAttachment: self];
}
}
/*
@ -346,8 +347,11 @@
[aDecoder decodeValueOfObjCType: @encode(id) at: &_cell];
// Reconnect the cell, so the cell does not have to store the attachment
if ([_cell respondsToSelector: @selector(setAttachment:)] == YES)
{
[_cell setAttachment: self];
}
}
return self;
}

View file

@ -2680,8 +2680,10 @@ in the main thread.
*/
- (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.y -= delta.height;

View file

@ -11,9 +11,9 @@ GNUSTEP_GUI_LIBTIFF=3.4
# The version number of this release.
GNUSTEP_GUI_MAJOR_VERSION=0
GNUSTEP_GUI_MINOR_VERSION=12
GNUSTEP_GUI_SUBMINOR_VERSION=0
GNUSTEP_GUI_SUBMINOR_VERSION=1
# 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}
VERSION=${GNUSTEP_GUI_VERSION}