NSAnimation, NSApplication and NSArrayController merges

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38705 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2015-06-26 17:22:16 +00:00
parent 9bc4dda8ff
commit 0ccefadb47
3 changed files with 65 additions and 17 deletions

View file

@ -534,7 +534,7 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
- (void) removeProgressMark: (NSAnimationProgress)progress
{
unsigned index;
NSUInteger index;
_NSANIMATION_LOCKING_SETUP;
_NSANIMATION_LOCK;
@ -547,8 +547,8 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
GSIArrayRemoveItemAtIndex(_progressMarks,index);
_isCachedProgressMarkNumbersValid = NO;
if (_nextMark > index) _nextMark--;
NSDebugMLLog(@"NSAnimationMark",@"Remove mark #%d for (next:#%d)",
index, progress, _nextMark);
NSDebugMLLog(@"NSAnimationMark",@"Remove mark #%lu (%f) for (next:#%d)",
(unsigned long)index, progress, _nextMark);
}
else
NSWarnMLog(@"Unexistent progress mark");
@ -797,7 +797,7 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
[delegate methodForSelector: @selector (animationShouldStart:)]
: NULL;
NSDebugMLLog(@"NSAnimationDelegate",
@"Delegation methods : %x %x %x %x %x",
@"Delegation methods : %p %p %p %p %p",
_delegate_animationDidReachProgressMark,
_delegate_animationValueForProgress,
_delegate_animationDidEnd,

View file

@ -1872,6 +1872,7 @@ See Also: -runModalForWindow:
NSEventType type = [_current_event type];
[self sendEvent: _current_event];
// Testplant-MAL-2015-06-26: keeping testplant fix...
[_session->window displayIfNeeded];
// update (en/disable) the services menu's items
@ -1970,26 +1971,31 @@ See -runModalForWindow:
* Put up a modal window centered relative to docWindow. On OS X this is
* deprecated in favor of
* -beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: .
* <em>Not implemented under GNUstep. Currently just centers window on the
* screen.</em>
*/
- (NSInteger) runModalForWindow: (NSWindow *)theWindow
relativeToWindow: (NSWindow *)docWindow
{
// FIXME
NSRect frame = [docWindow frame];
NSPoint point = frame.origin;
NSSize size = [theWindow frame].size;
if ((docWindow != nil) && (theWindow != nil))
{
NSRect docFrame = [docWindow frame];
NSPoint point = docFrame.origin;
NSRect theFrame = [theWindow frame];
NSSize size = theFrame.size;
// Calculate window position...
point.x += (frame.size.width - size.width) / 2;
point.y += (frame.size.height - size.height);
// Calculate window position...
point.x += (docFrame.size.width - size.width) / 2;
// Testplant-MAL-2015-06-26: Keeping position at top...
point.y += (docFrame.size.height - size.height);
NSDebugLLog(@"NSWindow", @"Positioning window %@ relative to %@ at %@",
NSStringFromRect(theFrame), NSStringFromRect(docFrame), NSStringFromPoint(point));
// Position window...
[theWindow setFrameOrigin:point];
}
// Position window...
[theWindow setFrameOrigin:point];
[theWindow orderWindow: NSWindowAbove
relativeTo: [docWindow windowNumber]];
return [self runModalForWindow: theWindow];
}

View file

@ -48,6 +48,8 @@
if (self == [NSArrayController class])
{
[self exposeBinding: NSContentArrayBinding];
[self setKeys: [NSArray arrayWithObjects: NSContentBinding, NSContentObjectBinding, nil]
triggerChangeNotificationsForDependentKey: @"arrangedObjects"];
}
}
@ -82,42 +84,76 @@
- (void) addObject: (id)obj
{
[self willChangeValueForKey: NSContentBinding];
[_content addObject: obj];
if ([self automaticallyRearrangesObjects])
{
[self rearrangeObjects];
}
else
{
// FIXME: Should check whether _arranged_objects is mutable
ASSIGN(_arranged_objects, [_arranged_objects arrayByAddingObject: obj]);
}
if ([self selectsInsertedObjects])
{
[self addSelectedObjects: [NSArray arrayWithObject: obj]];
}
[self didChangeValueForKey: NSContentBinding];
}
- (void) addObjects: (NSArray*)obj
{
[self willChangeValueForKey: NSContentBinding];
[_content addObjectsFromArray: obj];
if ([self automaticallyRearrangesObjects])
{
[self rearrangeObjects];
}
else
{
// FIXME: Should check whether _arranged_objects is mutable
ASSIGN(_arranged_objects, [_arranged_objects arrayByAddingObjectsFromArray: obj]);
}
if ([self selectsInsertedObjects])
{
[self addSelectedObjects: obj];
}
[self didChangeValueForKey: NSContentBinding];
}
- (void) removeObject: (id)obj
{
[self willChangeValueForKey: NSContentBinding];
[_content removeObject: obj];
[self removeSelectedObjects: [NSArray arrayWithObject: obj]];
if ([self automaticallyRearrangesObjects])
{
[self rearrangeObjects];
}
else
{
// FIXME
//[_arranged_objects removeObject: obj];
}
[self didChangeValueForKey: NSContentBinding];
}
- (void) removeObjects: (NSArray*)obj
{
[self willChangeValueForKey: NSContentBinding];
[_content removeObjectsInArray: obj];
[self removeSelectedObjects: obj];
if ([self automaticallyRearrangesObjects])
{
[self rearrangeObjects];
}
else
{
// FIXME
//[_arranged_objects removeObjectsInArray: obj];
}
[self didChangeValueForKey: NSContentBinding];
}
- (BOOL) canInsert
@ -135,7 +171,7 @@
{
id new = [self newObject];
[_content addObject: new];
[self addObject: new];
RELEASE(new);
}
@ -440,6 +476,7 @@ atArrangedObjectIndexes: (NSIndexSet*)idx
[coder encodeBool: [self selectsInsertedObjects] forKey: @"NSSelectsInsertedObjects"];
[coder encodeBool: [self clearsFilterPredicateOnInsertion] forKey:
@"NSClearsFilterPredicateOnInsertion"];
[coder encodeBool: [self automaticallyRearrangesObjects] forKey: @"NSAutomaticallyRearrangesObjects"];
}
else
{
@ -475,6 +512,11 @@ atArrangedObjectIndexes: (NSIndexSet*)idx
[self setClearsFilterPredicateOnInsertion:
[coder decodeBoolForKey: @"NSClearsFilterPredicateOnInsertion"]];
}
if ([coder containsValueForKey: @"NSAutomaticallyRearrangesObjects"])
{
[self setAutomaticallyRearrangesObjects:
[coder decodeBoolForKey: @"NSAutomaticallyRearrangesObjects"]];
}
}
else
{