//
//  GSPathPen.h
//  GlyphsCore
//
//  Created by Georg Seifert on 16.11.11.
//  Copyright 2011 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSBasePen.h>

@class GSLayer;
@class GSPath;

NS_ASSUME_NONNULL_BEGIN

@interface GSPathPen : GSBasePen

@property (nonatomic, strong) GSLayer *layer;
@property (nonatomic, strong, nullable) GSPath *currentPath;

- (instancetype)initWithLayer:(GSLayer *)layer NS_DESIGNATED_INITIALIZER;

/// Defaults to `GSPenOperationQuadratic | GSPenOperationCubic | GSPenOperationQuartic | GSPenOperationHobby | GSPenOperationRaph`.
///
/// Set this value to exclude any of the default options to convert them to one of the supported operations.
/// At a minimum, cubic operations must be supported.
@property (nonatomic) GSPenOperation supportedOperations;

/// Decomposes the components on the layer of the pen and returns the shapes of the layer.
///
/// - Parameter layer: This layer is set as the parent of the components before decomposing them.
- (NSArray<GSPath *> *)decomposeComponentsUsingParentLayer:(nullable GSLayer *)parentLayer;

@end

NS_ASSUME_NONNULL_END
