
use strict ;
use warnings ;
use utf8 ;

use App::Asciio::Stencil qw(create_box create_element) ;

[
create_box(NAME => 'box',              TEXT_ONLY => '',     WITH_FRAME => 1, WITH_SIZE => [4, 2], ),
create_box(NAME => 'shrink_box',       TEXT_ONLY => 'text', WITH_FRAME => 1, WITH_SIZE => [4, 2], AUTO_SHRINK => 1,),
create_box(NAME => 'text',             TEXT_ONLY => 'Text', AUTO_SHRINK => 1,),
create_box(NAME => 'connector',        TEXT_ONLY => 'o',    AUTO_SHRINK => 1,),
create_box(NAME => 'connector2',       TEXT_ONLY => '*',    AUTO_SHRINK => 1,),

do {
my $resistor = create_box
	(
	NAME               => 'resistor',
	TEXT_ONLY          => <<'TEXT'
 |
[ ]
 |
TEXT
,
	WITH_FRAME         => 0,
	OPTIMIZE_DISABLED  => 1,
	RESIZABLE          => 0,
	DEFAULT_CONNECTORS => 0,
	CONNECTORS =>   [
				[1, -1, -1,   0, -1, -1,   'top_center'],
				[1, -1, -1,   2, -1, -1,   'bottom_center'],
			],
	) ;

$resistor
}, 

create_box
	(
	NAME               => 'rabbit paw',
	TEXT_ONLY          => <<'TEXT'
(\_/)
(O.o)
/>
TEXT
,
	WITH_FRAME         => 0,
	OPTIMIZE_DISABLED  => 1,
	RESIZABLE          => 0,
	DEFAULT_CONNECTORS => 0,
	CONNECTORS         => [[2, -1, -1, 2, -1, -1, 'paw']]
	),

create_box
	(
	NAME => 'box unicode',
	TEXT_ONLY => '',
	WITH_FRAME => 1,
	WITH_SIZE => [4, 2],
	BOX_TYPE =>
		[
			[1, 'top',             '╭',  '─',  '╮', 1, ],
			[0, 'title separator', '│',  '─',  '│', 1, ],
			[1, 'body separator',  '│ ', '│', ' │', 1, ], 
			[1, 'bottom',          '╰',  '─',  '╯', 1, ],
			[1, 'fill-character',  '',   ' ', '',   1, ],
		]
	),

create_element
	(
	NAME => 'wirl_arrow',
	CLASS => 'App::Asciio::stripes::section_wirl_arrow',
	POINTS => [[2, -2, 'up']],
	DIRECTION => '',
	ALLOW_DIAGONAL_LINES => 0,
	EDITABLE => 1,
	RESIZABLE => 1,
	),

create_element
	(
	NAME => 'wirl_arrow unicode',
	CLASS => 'App::Asciio::stripes::section_wirl_arrow',
	POINTS => [[2, -2, 'up']],
	DIRECTION => '',
	ALLOW_DIAGONAL_LINES => 0,
	EDITABLE => 1,
	RESIZABLE => 1,
	ARROW_TYPE =>
		[
			['origin',      '',  '*',  '',  '',  '', 1],
			['up',         '│',  '│',  '',  '', '^', 1],
			['down',       '│',  '│',  '',  '', 'v', 1],
			['left',       '─',  '─',  '',  '', '<', 1],
			['upleft',     '│',  '│', '╮', '─', '<', 1],
			['leftup',     '─',  '─', '╰', '│', '^', 1],
			['downleft',   '│',  '│', '╯', '─', '<', 1],
			['leftdown',   '─',  '─', '╭', '│', 'v', 1],
			['right',      '─',  '─',  '',  '', '>', 1],
			['upright',    '│',  '│', '╭', '─', '>', 1],
			['rightup',    '─',  '─', '╯', '│', '^', 1],
			['downright',  '│',  '│', '╰', '─', '>', 1],
			['rightdown',  '─',  '─', '╮', '│', 'v', 1],
			['45',         '/',  '/',  '',  '', '^', 1],
			['135',       '\\', '\\',  '',  '', 'v', 1],
			['225',        '/',  '/',  '',  '', 'v', 1],
			['315',       '\\', '\\',  '',  '', '^', 1],
		],
	),

create_element
	(
	NAME => 'angled arrow',
	CLASS => 'App::Asciio::stripes::angled_arrow',
	END_X => 3,
	END_Y => -2,
	DIRECTION => 'up-right',
	RESIZABLE => 1,
	) ,

create_element
	(
	NAME => 'angled arrow unicode',
	CLASS => 'App::Asciio::stripes::angled_arrow',
	END_X => 3,
	END_Y => -2,
	DIRECTION => 'up-right',
	RESIZABLE => 1,
	ARROW_TYPE =>
		[
			['origin'     , '*',  '?', '?', '?', '?', '?', '?', 1],
			['up'         , "'",  '│', '?', '?', '.', '?', '?', 1],
			['down'       , '.',  '│', '?', '?', "'", '?', '?', 1],
			['left'       , '─',  '─', '?', '?', '─', '?', '?', 1],
			['right'      , '─',  '─', '?', '?', '─', '?', '?', 1],
			['up-left'    , "'", '\\', '.', '─', '─', '│', "'", 1],
			['left-up'    , '─', '\\', "'", '─', '.', '│', "'", 1],
			['down-left'  , '.',  '/', "'", '─', '─', '│', "'", 1],
			['left-down'  , '─',  '/', '.', '─', "'", '│', "'", 1],
			['up-right'   , "'",  '/', '.', '─', '─', '│', "'", 1],
			['right-up'   , '─',  '/', "'", '─', '.', '│', "'", 1],
			['down-right' , '.', '\\', "'", '─', '─', '│', "'", 1],
			['right-down' , '─', '\\', '.', '─', "'", '│', "'", 1],
		],
	),

create_element
	(
	NAME => 'axis',
	CLASS => 'App::Asciio::stripes::editable_arrow2',
	END_X => 3,
	END_Y => -3,
	RESIZABLE => 1,
	EDITABLE => 1,
	) ,

create_element
	(
	NAME => 'axis no arrow',
	CLASS => 'App::Asciio::stripes::editable_arrow2',
	END_X => 3,
	END_Y => -3,
	RESIZABLE => 1,
	EDITABLE => 1,
	ARROW_TYPE =>
		[
			['Up',    '|',  '|', '|', 1],
			['45',    '/',  '/', '/', 1],
			['Right', '-',  '-', '-', 1],
			['135',  '\\', '\\', '\\', 1],
			['Down',  '|',  '|', '|', 1],
			['225',   '/',  '/', '/', 1],
			['Left',  '-',  '-', '-', 1],
			['315',  '\\', '\\', '\\', 1],
		],
	) ,
	
create_element
	(
	NAME => 'Boxes/if',
	CLASS => 'App::Asciio::stripes::if_box',
	TEXT_ONLY => 'condition',
	EDITABLE => 1,
	) ,

create_element
	(
	NAME => 'Boxes/process',
	CLASS => 'App::Asciio::stripes::process_box',
	TEXT_ONLY => 'process',
	EDITABLE => 1,
	) ,

create_element
	(
	NAME => 'Shape/rhombus',
	CLASS => 'App::Asciio::stripes::rhombus',
	RESIZABLE => 1,
	EDITABLE => 1,
	TEXT_ONLY => '', 
	) ,

create_element
	(
	NAME => 'Shape/ellipse',
	CLASS => 'App::Asciio::stripes::ellipse',
	RESIZABLE => 1,
	EDITABLE => 1,
	TEXT_ONLY => '',
	) ,

create_element
	(
	NAME => 'Boxes/exec',
	CLASS => 'App::Asciio::stripes::exec_box',
	TEXT_ONLY => '',
	EDITABLE => 1,
	) ,

create_element
	(
	NAME => 'Boxes/exec no border',
	CLASS => 'App::Asciio::stripes::exec_box',
	TEXT_ONLY => '$',
	EDITABLE => 1,
	NO_BORDER => 1,
	) ,

create_element
	(
	NAME => 'Boxes/exec verbatim',
	CLASS => 'App::Asciio::stripes::exec_box',
	TEXT_ONLY => '$',
	EDITABLE => 1,
	# NO_BORDER => 1,
	RUN_VERBATIM => 1,
	) ,

create_element
	(
	NAME => 'Boxes/exec verbatim once',
	CLASS => 'App::Asciio::stripes::exec_box',
	TEXT_ONLY => '$',
	EDITABLE => 1,
	# NO_BORDER => 1,
	RUN_VERBATIM => 1,
	RUN_ONCE => 1,
	) ,

create_element
	(
	NAME => 'Boxes/exec add lines',
	CLASS => 'App::Asciio::stripes::exec_box',
	TEXT_ONLY => '$',
	EDITABLE => 1,
	# NO_BORDER => 1,
	RUN_VERBATIM => 1,
	VERBATIM_COMMAND => "nl -n ln -b a -w 2 -s' ' 2>&1 <<EOT"
	) ,

create_element
	(
	NAME => 'Shape/triangle/down',
	CLASS => 'App::Asciio::stripes::triangle_down',
	RESIZABLE => 1,
	EDITABLE => 0,
	) ,

create_element
	(
	NAME => 'Shape/triangle/up',
	CLASS => 'App::Asciio::stripes::triangle_up',
	RESIZABLE => 1,
	EDITABLE => 0,
	) ,

create_element
	(
	NAME => 'center connect box',
	CLASS => 'App::Asciio::stripes::center_connect_box',
	TEXT_ONLY => 'X',
	EDITABLE => 1,
	AUTO_SHRINK => 1,
	) ,

create_box(NAME => 'Scale/1_to_10_vertical',   TEXT_ONLY => "1\n2\n3\n4\n5\n6\n7\n8\n9\n0",) ,
create_box(NAME => 'Scale/1_to_50_horizontal', TEXT_ONLY => '1___5____0____5____0____5____0____5____0____5____0', ),
create_box(NAME => 'Scale/1_to_10_horizontal', TEXT_ONLY => '1234567890',),
] ;

