mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 16:10:48 +00:00
Remove NSStackView from branch
This commit is contained in:
parent
bd819ac12c
commit
a8cf81626b
4 changed files with 0 additions and 498 deletions
|
@ -228,7 +228,6 @@
|
|||
#import <AppKit/NSSound.h>
|
||||
#import <AppKit/NSSpeechRecognizer.h>
|
||||
#import <AppKit/NSSpeechSynthesizer.h>
|
||||
#import <AppKit/NSStackView.h>
|
||||
#import <AppKit/NSStepperTouchBarItem.h>
|
||||
#import <AppKit/NSStepper.h>
|
||||
#import <AppKit/NSStepperCell.h>
|
||||
|
|
|
@ -1,163 +0,0 @@
|
|||
/* Definition of class NSStackView
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: 08-08-2020
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110 USA.
|
||||
*/
|
||||
|
||||
#ifndef _NSStackView_h_GNUSTEP_GUI_INCLUDE
|
||||
#define _NSStackView_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <AppKit/NSView.h>
|
||||
#import <AppKit/NSLayoutConstraint.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Gravity
|
||||
enum {
|
||||
NSStackViewGravityTop = 1,
|
||||
NSStackViewGravityLeading = 1,
|
||||
NSStackViewGravityCenter = 2,
|
||||
NSStackViewGravityBottom = 3,
|
||||
NSStackViewGravityTrailing = 3
|
||||
};
|
||||
typedef NSInteger NSStackViewGravity;
|
||||
|
||||
// Distribution
|
||||
enum {
|
||||
NSStackViewDistributionGravityAreas = -1,
|
||||
NSStackViewDistributionFill = 0,
|
||||
NSStackViewDistributionFillEqually,
|
||||
NSStackViewDistributionFillProportionally,
|
||||
NSStackViewDistributionEqualSpacing,
|
||||
NSStackViewDistributionEqualCentering
|
||||
};
|
||||
typedef NSInteger NSStackViewDistribution;
|
||||
|
||||
typedef float NSStackViewVisibilityPriority;
|
||||
static const NSStackViewVisibilityPriority NSStackViewVisibilityPriorityMustHold = 1000.0;
|
||||
static const NSStackViewVisibilityPriority NSStackViewVisibilityPriorityDetachOnlyIfNecessary = 900.0;
|
||||
static const NSStackViewVisibilityPriority NSStackViewVisibilityPriorityNotVisible = 0.0;
|
||||
|
||||
static const CGFloat NSStackViewSpacingUseDefault = FLT_MAX;
|
||||
|
||||
@protocol NSStackViewDelegate;
|
||||
|
||||
@interface NSStackView : NSView
|
||||
{
|
||||
id<NSStackViewDelegate> _delegate;
|
||||
NSUserInterfaceLayoutOrientation _orientation;
|
||||
NSLayoutAttribute _alignment;
|
||||
NSEdgeInsets _edgeInsets;
|
||||
NSStackViewDistribution _distribution;
|
||||
CGFloat _spacing;
|
||||
BOOL _detachesHiddenViews;
|
||||
NSMutableArray *_arrangedSubviews;
|
||||
NSMutableArray *_detachedViews;
|
||||
NSMutableArray *_views;
|
||||
NSMapTable *_customSpacingMap;
|
||||
NSMapTable *_gravityMap;
|
||||
NSMapTable *_visiblePriorityMap;
|
||||
NSMapTable *_clippingMap;
|
||||
}
|
||||
|
||||
// Properties
|
||||
- (void) setDelegate: (id<NSStackViewDelegate>)delegate;
|
||||
- (id<NSStackViewDelegate>) delegate;
|
||||
|
||||
- (void) setOrientation: (NSUserInterfaceLayoutOrientation)o;
|
||||
- (NSUserInterfaceLayoutOrientation) orientation;
|
||||
|
||||
- (void) setAlignment: (NSLayoutAttribute)alignment;
|
||||
- (NSLayoutAttribute) alignment;
|
||||
|
||||
- (void) setEdgeInsets: (NSEdgeInsets)insets;
|
||||
- (NSEdgeInsets) edgeInsets;
|
||||
|
||||
- (void) setDistribution: (NSStackViewDistribution)d;
|
||||
- (NSStackViewDistribution) distribution;
|
||||
|
||||
- (void) setSpacing: (CGFloat)f;
|
||||
- (CGFloat) spacing;
|
||||
|
||||
- (void) setDetachesHiddenViews: (BOOL)f;
|
||||
- (BOOL) detachesHiddenViews;
|
||||
|
||||
- (void) setArrangedSubviews: (NSArray *)arrangedSubviews;
|
||||
- (NSArray *) arrangedSubviews;
|
||||
|
||||
- (void) setDetachedViews: (NSArray *)detachedViews;
|
||||
- (NSArray *) detachedViews;
|
||||
|
||||
// Instance methods
|
||||
// Manage views...
|
||||
+ (instancetype) stackViewWithViews: (NSArray *)views;
|
||||
|
||||
- (void) setCustomSpacing: (CGFloat)spacing afterView: (NSView *)v;
|
||||
- (CGFloat) customSpacingAfterView: (NSView *)v;
|
||||
|
||||
- (void) addArrangedSubview: (NSView *)v;
|
||||
- (void) insertArrangedSubview: (NSView *)v atIndex: (NSInteger)idx;
|
||||
- (void) removeArrangedSubview: (NSView *)v;
|
||||
|
||||
// Custom priorities
|
||||
- (void)setVisibilityPriority: (NSStackViewVisibilityPriority)priority
|
||||
forView: (NSView *)v;
|
||||
- (NSStackViewVisibilityPriority) visibilityPriorityForView: (NSView *)v;
|
||||
|
||||
- (NSLayoutPriority)clippingResistancePriorityForOrientation:(NSLayoutConstraintOrientation)orientation;
|
||||
- (void) setClippingResistancePriority: (NSLayoutPriority)clippingResistancePriority
|
||||
forOrientation: (NSLayoutConstraintOrientation)orientation;
|
||||
|
||||
- (NSLayoutPriority) huggingPriorityForOrientation: (NSLayoutConstraintOrientation)o;
|
||||
- (void) setHuggingPriority: (NSLayoutPriority)huggingPriority
|
||||
forOrientation: (NSLayoutConstraintOrientation)o;
|
||||
|
||||
- (void) setHasEqualSpacing: (BOOL)f; // deprecated
|
||||
- (BOOL) hasEqualSpacing; // deprecated
|
||||
|
||||
- (void)addView: (NSView *)view inGravity: (NSStackViewGravity)gravity;
|
||||
- (void)insertView: (NSView *)view atIndex: (NSUInteger)index inGravity: (NSStackViewGravity)gravity;
|
||||
- (void)removeView: (NSView *)view;
|
||||
- (NSArray *) viewsInGravity: (NSStackViewGravity)gravity;
|
||||
- (void)setViews: (NSArray *)views inGravity: (NSStackViewGravity)gravity;
|
||||
|
||||
@end
|
||||
|
||||
// Protocol
|
||||
@protocol NSStackViewDelegate <NSObject>
|
||||
|
||||
- (void) stackView: (NSStackView *)stackView willDetachViews: (NSArray *)views;
|
||||
- (void) stackView: (NSStackView *)stackView didReattachViews: (NSArray *)views;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSStackView_h_GNUSTEP_GUI_INCLUDE */
|
||||
|
|
@ -132,7 +132,6 @@ NSSlider.m \
|
|||
NSSliderCell.m \
|
||||
NSSliderAccessory.m \
|
||||
NSSliderTouchBarItem.m \
|
||||
NSStackView.m \
|
||||
NSStepperTouchBarItem.m \
|
||||
NSSwitch.m \
|
||||
NSTitlebarAccessoryViewController.m \
|
||||
|
@ -542,7 +541,6 @@ NSSpellServer.h \
|
|||
NSSplitView.h \
|
||||
NSSplitViewController.h \
|
||||
NSSplitViewItem.h \
|
||||
NSStackView.h \
|
||||
NSStepper.h \
|
||||
NSStepperCell.h \
|
||||
NSStepperTouchBarItem.h \
|
||||
|
|
|
@ -1,332 +0,0 @@
|
|||
/* Implementation of class NSStackView
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: 08-08-2020
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110 USA.
|
||||
*/
|
||||
|
||||
#import "AppKit/NSStackView.h"
|
||||
#import "GSFastEnumeration.h"
|
||||
|
||||
@implementation NSStackView
|
||||
|
||||
// Properties
|
||||
- (void) setDelegate: (id<NSStackViewDelegate>)delegate
|
||||
{
|
||||
_delegate = delegate;
|
||||
}
|
||||
|
||||
- (id<NSStackViewDelegate>) delegate
|
||||
{
|
||||
return _delegate;
|
||||
}
|
||||
|
||||
- (void) setOrientation: (NSUserInterfaceLayoutOrientation)o
|
||||
{
|
||||
_orientation = o;
|
||||
}
|
||||
|
||||
- (NSUserInterfaceLayoutOrientation) orientation
|
||||
{
|
||||
return _orientation;
|
||||
}
|
||||
|
||||
- (void) setAlignment: (NSLayoutAttribute)alignment
|
||||
{
|
||||
_alignment = alignment;
|
||||
}
|
||||
|
||||
- (NSLayoutAttribute) alignment
|
||||
{
|
||||
return _alignment;
|
||||
}
|
||||
|
||||
- (void) setEdgeInsets: (NSEdgeInsets)insets
|
||||
{
|
||||
_edgeInsets = insets;
|
||||
}
|
||||
|
||||
- (NSEdgeInsets) edgeInsets
|
||||
{
|
||||
return _edgeInsets;
|
||||
}
|
||||
|
||||
- (void) setDistribution: (NSStackViewDistribution)d
|
||||
{
|
||||
_distribution = d;
|
||||
}
|
||||
|
||||
- (NSStackViewDistribution) distribution
|
||||
{
|
||||
return _distribution;
|
||||
}
|
||||
|
||||
- (void) setSpacing: (CGFloat)f
|
||||
{
|
||||
_spacing = f;
|
||||
}
|
||||
|
||||
- (CGFloat) spacing
|
||||
{
|
||||
return _spacing;
|
||||
}
|
||||
|
||||
- (void) setDetachesHiddenViews: (BOOL)f
|
||||
{
|
||||
_detachesHiddenViews = f;
|
||||
}
|
||||
|
||||
- (BOOL) detachesHiddenViews
|
||||
{
|
||||
return _detachesHiddenViews;
|
||||
}
|
||||
|
||||
- (void) setArrangedSubviews: (NSArray *)arrangedSubviews
|
||||
{
|
||||
ASSIGN(_arrangedSubviews, arrangedSubviews);
|
||||
}
|
||||
|
||||
- (NSArray *) arrangedSubviews
|
||||
{
|
||||
return _arrangedSubviews;
|
||||
}
|
||||
|
||||
- (void) setDetachedViews: (NSArray *)detachedViews
|
||||
{
|
||||
ASSIGN(_detachedViews, detachedViews);
|
||||
}
|
||||
|
||||
- (NSArray *) detachedViews
|
||||
{
|
||||
return _detachedViews;
|
||||
}
|
||||
|
||||
// Instance methods
|
||||
// Manage views...
|
||||
- (instancetype) initWithViews: (NSArray *)views
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
_arrangedSubviews = [[NSMutableArray alloc] initWithArray: views];
|
||||
_detachedViews = [[NSMutableArray alloc] initWithCapacity: [views count]];
|
||||
ASSIGNCOPY(_views, views);
|
||||
_customSpacingMap = RETAIN([NSMapTable weakToWeakObjectsMapTable]);
|
||||
_gravityMap = RETAIN([NSMapTable weakToWeakObjectsMapTable]);
|
||||
_visiblePriorityMap = RETAIN([NSMapTable weakToWeakObjectsMapTable]);
|
||||
_clippingMap = RETAIN([NSMapTable strongToStrongObjectsMapTable]);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_arrangedSubviews);
|
||||
RELEASE(_detachedViews);
|
||||
RELEASE(_views);
|
||||
RELEASE(_customSpacingMap);
|
||||
RELEASE(_gravityMap);
|
||||
RELEASE(_visiblePriorityMap);
|
||||
RELEASE(_clippingMap);
|
||||
_delegate = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+ (instancetype) stackViewWithViews: (NSArray *)views
|
||||
{
|
||||
return [[self alloc] initWithViews: views];
|
||||
}
|
||||
|
||||
- (void) setCustomSpacing: (CGFloat)spacing afterView: (NSView *)v
|
||||
{
|
||||
NSNumber *n = [NSNumber numberWithFloat: spacing];
|
||||
[_customSpacingMap setObject: n
|
||||
forKey: v];
|
||||
}
|
||||
|
||||
- (CGFloat) customSpacingAfterView: (NSView *)v
|
||||
{
|
||||
return [[_customSpacingMap objectForKey: v] floatValue];
|
||||
}
|
||||
|
||||
- (void) addArrangedSubview: (NSView *)v
|
||||
{
|
||||
[_arrangedSubviews addObject: v];
|
||||
}
|
||||
|
||||
- (void) insertArrangedSubview: (NSView *)v atIndex: (NSInteger)idx
|
||||
{
|
||||
[_arrangedSubviews insertObject: v atIndex: idx];
|
||||
}
|
||||
|
||||
- (void) removeArrangedSubview: (NSView *)v
|
||||
{
|
||||
[_arrangedSubviews removeObject: v];
|
||||
}
|
||||
|
||||
// Custom priorities
|
||||
- (void)setVisibilityPriority: (NSStackViewVisibilityPriority)priority
|
||||
forView: (NSView *)v
|
||||
{
|
||||
NSNumber *n = [NSNumber numberWithInteger: priority];
|
||||
[_visiblePriorityMap setObject: n
|
||||
forKey: v];
|
||||
}
|
||||
|
||||
- (NSStackViewVisibilityPriority) visibilityPriorityForView: (NSView *)v
|
||||
{
|
||||
NSNumber *n = [_visiblePriorityMap objectForKey: v];
|
||||
NSStackViewVisibilityPriority p = (NSStackViewVisibilityPriority)[n integerValue];
|
||||
return p;
|
||||
}
|
||||
|
||||
- (NSLayoutPriority)clippingResistancePriorityForOrientation:(NSLayoutConstraintOrientation)orientation
|
||||
{
|
||||
NSNumber *r = [_clippingMap objectForKey: orientation];
|
||||
return (NSLayoutPriority)[r integerValue];
|
||||
}
|
||||
|
||||
- (void) setClippingResistancePriority: (NSLayoutPriority)clippingResistancePriority
|
||||
forOrientation: (NSLayoutConstraintOrientation)orientation
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (NSLayoutPriority) huggingPriorityForOrientation: (NSLayoutConstraintOrientation)o
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setHuggingPriority: (NSLayoutPriority)huggingPriority
|
||||
forOrientation: (NSLayoutConstraintOrientation)o
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setHasEqualSpacing: (BOOL)f
|
||||
{
|
||||
// deprecated
|
||||
}
|
||||
|
||||
- (BOOL) hasEqualSpacing
|
||||
{
|
||||
// deprecated
|
||||
}
|
||||
|
||||
- (void)addView: (NSView *)view inGravity: (NSStackViewGravity)gravity
|
||||
{
|
||||
}
|
||||
|
||||
- (void)insertView: (NSView *)view atIndex: (NSUInteger)index inGravity: (NSStackViewGravity)gravity
|
||||
{
|
||||
}
|
||||
|
||||
- (void)removeView: (NSView *)view
|
||||
{
|
||||
}
|
||||
|
||||
- (NSArray *) viewsInGravity: (NSStackViewGravity)gravity
|
||||
{
|
||||
}
|
||||
|
||||
- (void)setViews: (NSArray *)views inGravity: (NSStackViewGravity)gravity
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setViews: (NSArray *)views
|
||||
{
|
||||
ASSIGN(_arrangedSubviews, views);
|
||||
}
|
||||
|
||||
- (NSArray *) views
|
||||
{
|
||||
return _arrangedSubviews;
|
||||
}
|
||||
|
||||
// Encoding...
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
[super encodeWithCoder: coder];
|
||||
}
|
||||
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder: coder];
|
||||
if (self != nil)
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
if ([coder containsValueForKey: @"NSStackViewAlignment"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewBeginningContainer"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewDetachesHiddenViews"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewEdgeInsets.bottom"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewEdgeInsets.left"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewEdgeInsets.right"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewEdgeInsets.top"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewHasFlagViewHierarchy"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewHorizontalClippingResistance"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewHorizontalHugging"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewOrientation"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewSecondaryAlignment"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewSpacing"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewVerticalClippingResistance"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewVerticalHugging"])
|
||||
{
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSStackViewdistribution"])
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
Loading…
Reference in a new issue