/*
 * @file	CNGraphics.swift
 * @brief	Define data type for graphics
 * @par Copyright
 *   Copyright (C) 2018 Steel Wheels Project
 */

import Foundation

public enum CNAlignment: Int32 {
	case Left
	case Center
	case Right

	case Top
	case Middle
	case Bottom

	public var isVertical: Bool {
		get {
			let result: Bool
			switch self {
			case .Left, .Center, .Right:
				result = false
			case .Top, .Middle, .Bottom:
				result = true
			}
			return result
		}
	}

	public init(nsTextAlignment align: NSTextAlignment) {
		switch align {
		case .left:	self = .Left
		case .center:	self = .Center
		case .right:	self = .Right
		default:	self = .Left
		}
	}

	public func toNSTextAlignment() -> NSTextAlignment {
		let result: NSTextAlignment
		switch self {
		case .Left,   .Top:		result = .left
		case .Center, .Middle:		result = .center
		case .Right,  .Bottom:		result = .right
		}
		return result
	}
}


/*
 * @file	CNGraphics.swift
 * @brief	Define data type for graphics
 * @par Copyright
 *   Copyright (C) 2018 Steel Wheels Project
 */

import Foundation

public enum CNAxis: Int32
{
	case horizontal
	case vertical

	public var description: String {
		let result: String
		switch self {
		case .horizontal:	result = "horizontal"
		case .vertical:		result = "vertial"
		}
		return result
	}
}


public enum CNAlignment: Int32 {
	case leading
	case trailing
	case fill
	case center

	public var description: String {
		let result: String
		switch self {
		case .leading:		result = "leading"
		case .trailing:		result = "trailing"
		case .fill:		result = "fill"
		case .center:		result = "center"
		}
		return result
	}
}

public enum CNDistribution {
	case fill
	case fillEqually
	case equalSpacing

	public var description: String {
		let result: String
		switch self {
		case .fill:		result = "fill"
		case .fillEqually:	result = "fillEqually"
		case .equalSpacing:	result = "equalSpacing"
		}
		return result
	}
}


Add CNAxis and CNDistribution classes
CoconutData: Add CNAxis and CNDistribution classes
