Author: mlytwyn
Date: Sun Feb 12 19:40:35 2017
New Revision: 40336
URL: http://svn.gna.org/viewcvs/gnustep?rev=40336&view=rev
Log:
Revert last bad commit
Modified:
libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSDragView.h
libs/gui/branches/gnustep_testplant_branch/Source/GSDragView.m
libs/gui/branches/gnustep_testplant_branch/Source/GSXib5KeyedUnarchiver.m
libs/gui/branches/gnustep_testplant_branch/Source/NSClipView.m
libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m
libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m
libs/gui/branches/gnustep_testplant_branch/Source/NSWindow.m
Modified:
libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSDragView.h
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSDragView.h?rev=40336&r1=40335&r2=40336&view=diff
==============================================================================
---
libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSDragView.h
(original)
+++
libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSDragView.h
Sun Feb 12 19:40:35 2017
@@ -129,7 +129,7 @@
timestamp: (NSTimeInterval)time
toWindow: (NSInteger)dWindowNumber;
- (NSWindow*) windowAcceptingDnDunder: (NSPoint)mouseLocation
- windowRef: (NSInteger*)mouseWindowRef;
+ windowRef: (int*)mouseWindowRef;
@end
#endif
Modified: libs/gui/branches/gnustep_testplant_branch/Source/GSDragView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSDragView.m?rev=40336&r1=40335&r2=40336&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/GSDragView.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/GSDragView.m Sun Feb
12 19:40:35 2017
@@ -357,7 +357,7 @@
set, if there is a native window, but no GNUstep window at this location.
*/
- (NSWindow*) windowAcceptingDnDunder: (NSPoint)mouseLocation
- windowRef: (NSInteger*)mouseWindowRef
+ windowRef: (int*)mouseWindowRef
{
NSInteger win;
@@ -890,7 +890,7 @@
//--- Store old values -----------------------------------------------------
NSWindow *oldDestWindow = destWindow;
BOOL oldDestExternal = destExternal;
- NSInteger mouseWindowRef;
+ int mouseWindowRef;
BOOL changeCursor = NO;
//--- Move drag image to the new position -----------------------------------
Modified:
libs/gui/branches/gnustep_testplant_branch/Source/GSXib5KeyedUnarchiver.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSXib5KeyedUnarchiver.m?rev=40336&r1=40335&r2=40336&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/GSXib5KeyedUnarchiver.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/GSXib5KeyedUnarchiver.m
Sun Feb 12 19:40:35 2017
@@ -1608,7 +1608,7 @@
if (baseWritingDirection == nil)
[paragraphStyle setBaseWritingDirection:
NSWritingDirectionNaturalDirection];
- else if ([@"leftToRight" isEqualToString: baseWritingDirection])
+ else if ([@"" isEqualToString: baseWritingDirection])
[paragraphStyle setBaseWritingDirection: NSWritingDirectionLeftToRight];
else if ([@"rightToLeft" isEqualToString: baseWritingDirection])
[paragraphStyle setBaseWritingDirection: NSWritingDirectionRightToLeft];
@@ -2884,7 +2884,6 @@
}
else if ([@"NSPathSeparator" isEqualToString: key])
{
- // This would allow to do system dependent path separator decoding...
object = @"/";
}
else if ([key hasPrefix:@"NS"])
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSClipView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSClipView.m?rev=40336&r1=40335&r2=40336&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSClipView.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSClipView.m Sun Feb
12 19:40:35 2017
@@ -27,10 +27,8 @@
*/
#import "config.h"
-#import <Foundation/NSDebug.h>
+#import <Foundation/NSNotification.h>
#import <Foundation/NSException.h>
-#import <Foundation/NSNotification.h>
-#import <Foundation/NSUserDefaults.h>
#import "AppKit/NSClipView.h"
#import "AppKit/NSCursor.h"
@@ -493,9 +491,6 @@
*/
- (BOOL) autoscroll: (NSEvent*)theEvent
{
- static CGFloat ScrollingMargin = 15.0;
-
- CGFloat scrollingMargin;
NSPoint new;
NSPoint delta;
NSRect r;
@@ -505,27 +500,22 @@
return NO;
}
- // Use defaults value if present...
- scrollingMargin = [[NSUserDefaults standardUserDefaults] floatForKey:
@"GSAutoScrollingMargin"];
- if (scrollingMargin == 0) // otherwise use static coded default...
- scrollingMargin = ScrollingMargin;
-
- new = [_documentView convertPoint: [theEvent locationInWindow]
- fromView: nil];
+ new = [_documentView convertPoint: [theEvent locationInWindow]
+ fromView: nil];
r = [self documentVisibleRect];
- if ((new.x > NSMinX(r)) && (new.x < NSMinX(r)+scrollingMargin))
- delta.x = (new.x - NSMinX(r)) - scrollingMargin;
- else if ((new.x > NSMaxX(r)-scrollingMargin) && (new.x < NSMaxX(r)))
- delta.x = scrollingMargin - (NSMaxX(r) - new.x);
+ if (new.x < NSMinX(r))
+ delta.x = new.x - NSMinX(r);
+ else if (new.x > NSMaxX(r))
+ delta.x = new.x - NSMaxX(r);
else
delta.x = 0;
- if ((new.y > NSMinY(r)) && (new.y < NSMinY(r)+scrollingMargin))
- delta.y = (new.y - NSMinY(r)) - scrollingMargin;
- else if ((new.y > NSMaxY(r)-scrollingMargin) && (new.y < NSMaxY(r)))
- delta.y = scrollingMargin - (NSMaxY(r) - new.y);
+ if (new.y < NSMinY(r))
+ delta.y = new.y - NSMinY(r);
+ else if (new.y > NSMaxY(r))
+ delta.y = new.y - NSMaxY(r);
else
delta.y = 0;
@@ -533,13 +523,6 @@
new.y = _bounds.origin.y + delta.y;
new = [self constrainScrollPoint: new];
-// NSWarnMLog(@"self: %@ theEventLocInWin: %@ docVisRect: %@ docPnt: %@
delta: %@ new: %@ equ: %ld", self,
-// NSStringFromPoint([theEvent locationInWindow]),
-// NSStringFromRect(r),
-// NSStringFromPoint([_documentView convertPoint: [theEvent
locationInWindow] fromView: nil]),
-// NSStringFromPoint(delta),
-// NSStringFromPoint(new),
-// (long)(NSEqualPoints(new, _bounds.origin)));
if (NSEqualPoints(new, _bounds.origin))
return NO;
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m?rev=40336&r1=40335&r2=40336&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m Sun Feb
12 19:40:35 2017
@@ -3661,45 +3661,6 @@
return([cell hitTestForEvent:event inRect:cellFrame ofView:self]);
}
return(NSCellHitNone);
-}
-
-- (void)mouseEntered:(NSEvent *)event
-{
- NSWarnMLog(@"self: %@ event: %@", self, event);
- [super mouseEntered: event];
-}
-
-- (void)mouseMoved:(NSEvent *)event
-{
- NSWarnMLog(@"self: %@ event: %@", self, event);
- [super mouseMoved: event];
-}
-
-#if 0
-- (void)mouseDragged:(NSEvent *)event
-{
-// NSWarnMLog(@"self: %@ event: %@", self, event);
- NSPoint locInWin = [event locationInWindow];
- NSPoint locInView = [self convertPoint: locInWin toView: nil];
- NSRect bounds = [self bounds];
- NSRect frameTop = NSMakeRect(0, 0, bounds.size.width, 10);
- NSRect frameBot = NSMakeRect(0, NSMaxY(bounds), bounds.size.width,
NSMaxY(bounds)-10);
-// NSWarnMLog(@"locInWin: %@ locInView: %@ bounds: %@ frameTop: %@ frameBot:
%@",
-// NSStringFromPoint(locInWin),
-// NSStringFromPoint(locInView),
-// NSStringFromRect(bounds),
-// NSStringFromRect(frameTop),
-// NSStringFromRect(frameBot));
- //if (NSPointInRect(locInView, frameTop) || NSPointInRect(locInView,
frameBot))
- [self autoscroll: event];
- [super mouseDragged: event];
-}
-#endif
-
-- (void)mouseExited:(NSEvent *)event
-{
- NSWarnMLog(@"self: %@ event: %@", self, event);
- [super mouseExited: event];
}
- (void) mouseDown: (NSEvent *)theEvent
@@ -3956,10 +3917,6 @@
case NSLeftMouseDown:
case NSLeftMouseDragged:
- NSWarnMLog(@"NSLeftMouseDown | NSLeftMouseDragged:
dragOperationPossible: %ld mouseWin: %@ initLoc: %@",
- (long)dragOperationPossible,
- NSStringFromPoint(mouseLocationWin),
- NSStringFromPoint(initialLocation));
if (fabs(mouseLocationWin.x - initialLocation.x) > 1
|| fabs(mouseLocationWin.y - initialLocation.y) > 1)
{
@@ -3981,7 +3938,6 @@
{
if ([self _startDragOperationWithEvent: theEvent
clickedRow:_clickedRow])
{
- NSWarnMLog(@"_startDragOperationWithEvent");
RELEASE(oldSelectedRows);
IF_NO_GC(DESTROY(arp));
return;
@@ -3998,7 +3954,6 @@
// mouse dragged within table
if (startedPeriodicEvents == YES)
{
- NSWarnMLog(@"stopPeriodicEvents");
[NSEvent stopPeriodicEvents];
startedPeriodicEvents = NO;
}
@@ -4046,9 +4001,9 @@
else
{
// Mouse dragged out of the table
- NSTimeInterval period = computePeriod(mouseLocationWin,
- minYVisible,
- maxYVisible);
+ NSTimeInterval period = computePeriod(mouseLocationWin,
+ minYVisible,
+ maxYVisible);
if (startedPeriodicEvents == YES)
{
@@ -4061,7 +4016,6 @@
}
/* Start periodic events */
oldPeriod = period;
- NSWarnMLog(@"startPeriodicEvents: %f", oldPeriod);
[NSEvent startPeriodicEventsAfterDelay: 0
withPeriod: oldPeriod];
startedPeriodicEvents = YES;
@@ -4072,7 +4026,6 @@
}
break;
case NSPeriodic:
- NSWarnMLog(@"NSPeriodic");
if (mouseBelowView == YES)
{
if (currentRow == -1 && oldRow != -1)
@@ -6543,7 +6496,6 @@
- (NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender
{
- NSWarnMLog(@"self: %@ sender: %@", self, sender);
currentDropRow = -1;
currentDropOperation = -1;
oldDropRow = -1;
@@ -6555,7 +6507,6 @@
- (void) draggingExited: (id <NSDraggingInfo>) sender
{
- NSWarnMLog(@"self: %@ sender: %@", self, sender);
[self setNeedsDisplayInRect: oldDraggingRect];
[self displayIfNeeded];
}
@@ -6695,7 +6646,6 @@
NSDragOperation dragOperation = [sender draggingSourceOperationMask];
BOOL isSameDropTargetThanBefore = (lastQuarterPosition == quarterPosition
&& currentDragOperation == dragOperation);
- NSWarnMLog(@"self: %@ sender: %@", self, sender);
[self _scrollRowAtPointToVisible: p];
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m?rev=40336&r1=40335&r2=40336&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m Sun Feb
12 19:40:35 2017
@@ -5784,7 +5784,6 @@
inMode:
NSEventTrackingRunLoopMode
dequeue: YES];
}
- NSWarnMLog(@"currentEvent: %@", currentEvent);
if (currentEvent && [currentEvent type] == NSLeftMouseUp)
break;
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSWindow.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSWindow.m?rev=40336&r1=40335&r2=40336&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSWindow.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSWindow.m Sun Feb
12 19:40:35 2017
@@ -80,7 +80,6 @@
#import "AppKit/NSWindowController.h"
#import "AppKit/PSOperators.h"
-#import "GNUstepGUI/GSDragView.h"
#import "GNUstepGUI/GSTheme.h"
#import "GNUstepGUI/GSTrackingRect.h"
#import "GNUstepGUI/GSDisplayServer.h"
@@ -106,7 +105,6 @@
static id<GSWindowDecorator> windowDecorator = nil;
-NSView *GSDragViewForEvent(NSView *wv, NSEvent *theEvent, id<NSDraggingInfo>
dragInfo);
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
@interface NSObject (DragInfoBackend)
@@ -3871,14 +3869,14 @@
}
}
/* Activate the app *after* making the receiver key, as app
- activation tries to make the previous key window key.
- However, don't activate the app after a single click into
- the app icon or a miniwindow. This allows dragging app
- icons and miniwindows without unnecessarily switching
- applications (cf. Sect. 4 of the OpenStep UI Guidelines).
- */
+ activation tries to make the previous key window key.
+ However, don't activate the app after a single click into
+ the app icon or a miniwindow. This allows dragging app
+ icons and miniwindows without unnecessarily switching
+ applications (cf. Sect. 4 of the OpenStep UI Guidelines).
+ */
if ((_styleMask & (NSIconWindowMask | NSMiniWindowMask)) == 0
- && [NSApp isActive] == NO)
+ && [NSApp isActive] == NO)
{
v = nil;
[NSApp activateIgnoringOtherApps: YES];
@@ -3930,10 +3928,10 @@
[self mouseDown: theEvent];
}
}
- else
- {
- NSDebugLLog(@"NSEvent", @"Discard (window closed) %@",
theEvent);
- }
+ else
+ {
+ NSDebugLLog(@"NSEvent", @"Discard (window closed) %@", theEvent);
+ }
_lastPoint = [theEvent locationInWindow];
break;
}
@@ -3949,7 +3947,7 @@
case NSOtherMouseDown:
v = [_wv hitTest: [theEvent locationInWindow]];
- ASSIGN(_lastOtherMouseDownView, v);
+ ASSIGN(_lastOtherMouseDownView, v);
[v otherMouseDown: theEvent];
_lastPoint = [theEvent locationInWindow];
break;
@@ -3965,7 +3963,7 @@
case NSRightMouseDown:
v = [_wv hitTest: [theEvent locationInWindow]];
- ASSIGN(_lastRightMouseDownView, v);
+ ASSIGN(_lastRightMouseDownView, v);
[v rightMouseDown: theEvent];
_lastPoint = [theEvent locationInWindow];
break;
@@ -3986,28 +3984,11 @@
switch (type)
{
case NSLeftMouseDragged:
- v = GSDragViewForEvent(_wv, theEvent, [GSServerForWindow(self)
dragInfo]);
-#if 0
- NSWarnMLog(@"NSLeftMouseDragged %p - v: %@
_lastLeftMouseDownView: %@ eventLoc: %@", self,
- v, _lastLeftMouseDownView,
NSStringFromPoint([theEvent locationInWindow]));
-#endif
// Testplant-MAL-2015-07-08: keeping testplant branch code...
-#if 0
- if ([[GSDragView sharedDragView] isDragging] && v)
- {
- _lastLeftMouseDownView = v;
- [v mouseDragged: theEvent];
- }
+ if (_lastLeftMouseDownView)
+ [_lastLeftMouseDownView mouseDragged: theEvent];
else
-#endif
- if (_lastLeftMouseDownView)
- {
- [_lastLeftMouseDownView mouseDragged: theEvent];
- }
- else
- {
- [self mouseDragged: theEvent];
- }
+ [self mouseDragged: theEvent];
break;
case NSOtherMouseDragged:
[_lastOtherMouseDownView otherMouseDragged: theEvent];
@@ -4360,12 +4341,19 @@
BOOL isEntry;
dragInfo = [GSServerForWindow(self) dragInfo];
- v = GSDragViewForEvent(_wv, theEvent, dragInfo);
+ v = [_wv hitTest: [theEvent locationInWindow]];
+
+ while (v != nil)
+ {
+ if (v->_rFlags.has_draginfo != 0
+ && GSViewAcceptsDrag(v, dragInfo))
+ break;
+ v = [v superview];
+ }
if (v == nil)
- {
- v = _wv;
- }
-
+ {
+ v = _wv;
+ }
if (_lastDragView == v)
{
isEntry = NO;
@@ -4403,15 +4391,7 @@
{
action = NSDragOperationNone;
}
-
-#if 1
- // Support for autoscrolling...
- if ([theEvent subtype] == GSAppKitDraggingUpdate)
- {
- [v autoscroll: theEvent];
- }
-#endif
-
+
e = [NSEvent otherEventWithType: NSAppKitDefined
location: [theEvent locationInWindow]
modifierFlags: 0
@@ -5952,21 +5932,6 @@
@end
-NSView *GSDragViewForEvent(NSView *wv, NSEvent *theEvent, id<NSDraggingInfo>
dragInfo)
-{
- NSView *v = [wv hitTest: [theEvent locationInWindow]];
-
- while (v != nil)
- {
- if (v->_rFlags.has_draginfo != 0
- && GSViewAcceptsDrag(v, dragInfo))
- break;
- v = [v superview];
- }
-
- return v;
-}
-
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo)
{
NSPasteboard *pb = [dragInfo draggingPasteboard];
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs