Move NSView private method to NSView.m and their declarations into NSViewPrivate.h

This commit is contained in:
Gregory John Casamento 2020-07-25 09:28:01 -04:00
parent 0add17530a
commit 7734331930
7 changed files with 34 additions and 31 deletions

View file

@ -229,6 +229,7 @@
#import <AppKit/NSStoryboardSegue.h>
#import <AppKit/NSSeguePerforming.h>
#import <AppKit/NSSwitch.h>
#import <AppKit/NSSplitViewController.h>
#import <AppKit/NSTableColumn.h>
#import <AppKit/NSTableHeaderCell.h>
#import <AppKit/NSTableHeaderView.h>

View file

@ -2,7 +2,7 @@
Copyright (C) 2020 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 07-23-2020
Date: 23-07-2020
This file is part of the GNUstep Library.

View file

@ -29,35 +29,10 @@
#import "AppKit/NSSplitViewController.h"
#import "AppKit/NSSplitViewItem.h"
#import "AppKit/NSView.h"
#import "NSViewPrivate.h"
#import "GSFastEnumeration.h"
@interface NSView (__NSSplitViewController_Notifications__)
- (void) _viewWillMoveToWindow: (NSWindow *)w;
- (void) _viewWillMoveToSuperview: (NSView *)v;
- (void) _viewDidMoveToWindow;
@end
@interface NSView (__NSSplitViewController_Private__)
- (void) insertSubview: (NSView *)sv atIndex: (NSUInteger)idx;
@end
@implementation NSView (__NSSplitViewController_Private__)
- (void) insertSubview: (NSView *)sv atIndex: (NSUInteger)idx
{
[sv _viewWillMoveToWindow: _window];
[sv _viewWillMoveToSuperview: self];
[sv setNextResponder: self];
[_sub_views insertObject: sv atIndex: idx];
_rFlags.has_subviews = 1;
[sv resetCursorRects];
[sv setNeedsDisplay: YES];
[sv _viewDidMoveToWindow];
[sv viewDidMoveToSuperview];
[self didAddSubview: sv];
}
@end
@implementation NSSplitViewController
// return splitview...
- (NSSplitView *) splitView
@ -97,7 +72,7 @@
{
NSViewController *vc = [item viewController];
[_splitViewItems addObject: item];
if(vc != nil)
if (vc != nil)
{
NSView *v = [vc view];
if (v != nil)
@ -117,7 +92,7 @@
NSView *v = [vc view];
if (v != nil)
{
[sv insertSubview: v atIndex: index];
[sv _insertSubview: v atIndex: index];
}
}
[_splitViewItems insertObject: item atIndex: index];

View file

@ -2,7 +2,7 @@
Copyright (C) 2020 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 07-23-2020
Date: 23-07-2020
This file is part of the GNUstep Library.

View file

@ -88,6 +88,8 @@
{
NSTabViewItem *item = [[NSTabViewItem alloc] init];
[item setViewController: vc];
[item setLabel: [vc title]];
AUTORELEASE(item);
return item;
}

View file

@ -205,7 +205,6 @@ GSSetDragTypes(NSView* obj, NSArray *types)
* Private methods.
*/
/*
* The [-_invalidateCoordinates] method marks the coordinate mapping
* matrices (matrixFromWindow and _matrixToWindow) and the cached visible
@ -5132,6 +5131,28 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
@end
@implementation NSView (__NSViewPrivateMethods__)
/*
* This method inserts a view at a given place in the view hierarchy.
*/
- (void) _insertSubview: (NSView *)sv atIndex: (NSUInteger)idx
{
[sv _viewWillMoveToWindow: _window];
[sv _viewWillMoveToSuperview: self];
[sv setNextResponder: self];
[_sub_views insertObject: sv atIndex: idx];
_rFlags.has_subviews = 1;
[sv resetCursorRects];
[sv setNeedsDisplay: YES];
[sv _viewDidMoveToWindow];
[sv viewDidMoveToSuperview];
[self didAddSubview: sv];
}
@end
@implementation NSView(KeyViewLoop)
static NSComparisonResult

View file

@ -34,4 +34,8 @@
- (void) _recursiveSetUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView;
@end
@interface NSView (__NSViewPrivateMethods__)
- (void) _insertSubview: (NSView *)sv atIndex: (NSUInteger)idx;
@end
#endif // _GNUstep_H_NSViewPrivate