App-Asciio

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

	{
	$all_modules{$_} = $_ ;
	push @split_modules, $_ ;
	}

my @setup_lib=
qw(
setup/setup.ini

setup/actions/align.pl
setup/actions/clipboard.pl
setup/actions/debug.pl
setup/actions/elements_manipulation.pl
setup/actions/file.pl
setup/actions/mouse.pl
setup/actions/new_elements.pl
setup/actions/colors.pl
setup/actions/unsorted.pl
setup/actions/presentation.pl

setup/actions/context_menu_multi_wirl.pl

Build.PL  view on Meta::CPAN

setup/import_export/ascii.pl
setup/import_export/asciioe.pl
setup/import_export/perl.pl

setup/stencils/asciio
setup/stencils/computer
setup/stencils/people
setup/stencils/divers

setup/GTK/setup.ini
setup/GTK/actions/clipboard.pl
setup/GTK/import_export/png.pl
) ;

for(@setup_lib)
	{
	$all_modules{$_} = "lib/App/Asciio/$_" ;
	}

sub GetVersionAndRevisionFrom
{

MANIFEST  view on Meta::CPAN

META.yml
README
Todo.txt

script/asciio_to_text
script/A

setup/setup.ini

setup/actions/align.pl
setup/actions/clipboard.pl
setup/actions/debug.pl
setup/actions/elements_manipulation.pl
setup/actions/file.pl
setup/actions/mouse.pl
setup/actions/new_elements.pl
setup/actions/unsorted.pl
setup/actions/context_menu_multi_wirl.pl
setup/actions/context_menu_box.pl
setup/actions/context_menu_rulers.pl
setup/actions/colors.pl

MANIFEST  view on Meta::CPAN

script/asciio

lib/App/Asciio/GTK/Asciio.pm
lib/App/Asciio/GTK/Asciio/Dialogs.pm
lib/App/Asciio/GTK/Asciio/stripes/wirl_arrow.pm
lib/App/Asciio/GTK/Asciio/stripes/editable_box2.pm
lib/App/Asciio/GTK/Asciio/stripes/editable_arrow2.pm
lib/App/Asciio/GTK/Asciio/Menues.pm

setup/GTK/setup.ini
setup/GTK/actions/clipboard.pl
setup/GTK/import_export/png.pl


META.json

Todo.txt  view on Meta::CPAN

	- click + key on arrow adds a 'flex' point

what's new section

night colors don't change the ruler colors

? generate "nice looking" graph
	- interface to ditaa
	- HTML document?!

copy to clipboard removes empty lines at the begining of the buffer

two section arrow middle connector keeps horizontal with linked element
	this would reduce the amount of changes that need to be done manually

Curses UI

tutorial

add offset input to multiple element creation window

Todo.txt  view on Meta::CPAN


arrow merge object
	like a single character text but nicer to use with  arrows
	or merge arrow connections directely (weld them together)
	
multi-ended connectors
	add remove end from multi ended connectors

start and end connectors should have different colors

copy elements to the system clipboard to allow copies between instances

handle multiple versions with one of the following mechanisms:
	- embed git::PurePerl 
	- use PAR 
	- multiple directories

Display version somewhere

connected, non auto-connect, arrows loose their connection if the connectee is resized
	=> this is because resize doesn't keep the connection. The 

Todo.txt  view on Meta::CPAN

#handle error when running external command
	Can't exec "dsq": No such file or directory at '/devel/perl_modules/App/Asciio/blib/lib/App/Asciio/setup//actions/unsorted.pl' line 365.
	Use of uninitialized value in split at /devel/perl_modules/App/Asciio/blib/lib/App/Asciio/stripes/editable_box2.pm line 50.

#paste at the mouse position
	
#per arrow autoconnect

#dynamically add connectors

#copy selected elements to clipboard
	
#move ruler line definition to the setup
	allow removal of rulers
	allow specific location of rulers

#dynamically generate GROUP_COLORS

#figlet support
	Done via external command 
	Emanuel Haupt <ehaupt@freebsd.org>

Todo.txt  view on Meta::CPAN


#make a script library

!update_diagram should be called when running in script mode
	let the script writer decide if they want "optimized" connections or not

# proper setup structure

#editable arrow has connections!! use resize/info/highlight points instead

# export ASCII to clipboard

#quick connect
	if selected elements
		connect element under to selected elements
		deselect all
	else
		select element
		
#forward mouse to ACTIONS

Todo.txt  view on Meta::CPAN


#multiline arrow

!reapeat box
	given a text, it will repeat it depednding on the size
		!full multiples or not

#process box

#segfault
#can't use Data::TreeDumper in copy to clipboard

# 'new connection' is flashed for a connector that is already connected

#tab to select first element generate 'uninitialzed value at 134'

#undo
	#do not save undo buffer
	
#copy doesn't keep connections

lib/App/Asciio.pm  view on Meta::CPAN

=item * select all

=item * delete

=item * undo

=item * group/ungroup

=item * open / save

=item * local clipboard operations

=item * send to front/back

=item * insert arrow, boxes, text

=item * ...

=back

The available commands are displayed if you press B<K>. 

lib/App/Asciio.pm  view on Meta::CPAN


=head3 your own element type

For simple elements, put your design in a box. That should cover 90% of anyone's needs. You can look in 
I<lib/stripes> for element implementation examples.

=head2 exporting to ASCII

You can export to a file in ASCII format but using the B<.txt> extension.

Exporting to the clipboard is done with B<ctl + e>.

=head1 EXAMPLES

	
           User code ^            ^ OS code
                      \          /
                       \        /
                        \      /
           User code <----Mode----->OS code
                        /      \

lib/App/Asciio.pm  view on Meta::CPAN

if($event->{BUTTON} == 1) 
	{
	my $modifiers = $event->{MODIFIERS} ;
	
	my ($first_element) = first_value {$self->is_over_element($_, $x, $y)} reverse @{$self->{ELEMENTS}} ;
	
	if ($modifiers eq 'C00')
		{
		if(defined $first_element)
			{
			$self->run_actions_by_name('Copy to clipboard', ['Insert from clipboard', 0, 0])  ;
			}
		}
	else
		{
		if(defined $first_element)
			{
			 if ($modifiers eq '00S')
				{
				$self->select_elements_flip($first_element) ;
				}

setup/GTK/actions/clipboard.pl  view on Meta::CPAN


use List::Util qw(min max) ;

#----------------------------------------------------------------------------------------------

register_action_handlers
	(
	'Export to clipboard & primary as ascii'=> ['C00-e', \&export_to_clipboard_as_ascii] ,
	'Import from clipboard to box'=> ['C0S-E', \&import_from_clipboard_to_box] ,
	'Import from primary to box'=> ['0A0-e', \&import_from_primary_to_box] ,
	) ;

#----------------------------------------------------------------------------------------------

sub export_to_clipboard_as_ascii
{
my ($self) = @_ ;

my $ascii = $self->transform_elements_to_ascii_buffer($self->get_selected_elements(1)) ;

Gtk2::Clipboard->get (Gtk2::Gdk->SELECTION_CLIPBOARD)->set_text($ascii);

# also put in selection  --  DH
Gtk2::Clipboard->get (Gtk2::Gdk->SELECTION_PRIMARY)->set_text($ascii);
}

#----------------------------------------------------------------------------------------------

sub import_from_clipboard_to_box
{
my ($self) = @_ ;

my $ascii = Gtk2::Clipboard->get (Gtk2::Gdk->SELECTION_CLIPBOARD)->wait_for_text();

my $element = $self->add_new_element_named('stencils/asciio/box', $self->{MOUSE_X}, $self->{MOUSE_Y}) ;

$element->set_text('', $ascii) ;

$self->select_elements(1, $element) ;

setup/GTK/setup.ini  view on Meta::CPAN

{
STENCILS =>
	[
	],
	
ACTION_FILES =>
	[
	'actions/clipboard.pl',
	],
	
HOOK_FILES =>
	[
	],

ASCIIO_OBJECT_SETUP =>
	[
	],
	

setup/actions/clipboard.pl  view on Meta::CPAN


use List::Util qw(min max) ;

#----------------------------------------------------------------------------------------------

register_action_handlers
	(
	'Copy to clipboard' => 
		[
		['C00-c', 'C00-Insert']
		, \&copy_to_clipboard
		],
		
	'Insert from clipboard' => 
		[
		['C00-v', '00S-Insert']
		, \&insert_from_clipboard
		],
	) ;


#----------------------------------------------------------------------------------------------

sub copy_to_clipboard
{
my ($self) = @_ ;

my @selected_elements = $self->get_selected_elements(1) ;
return unless @selected_elements ;

my %selected_elements = map { $_ => 1} @selected_elements ;

my @connections =
	grep 

setup/actions/clipboard.pl  view on Meta::CPAN

	{
	ELEMENTS =>  \@selected_elements,
	CONNECTIONS => \@connections ,
	};
	
$self->{CLIPBOARD} =  Clone::clone($elements_and_connections) ;
} ;	
	
#----------------------------------------------------------------------------------------------

sub insert_from_clipboard
{
my ($self, $x_offset, $y_offset) = @_ ;

if(defined $self->{CLIPBOARD}{ELEMENTS} && @{$self->{CLIPBOARD}{ELEMENTS}})
	{
	$self->create_undo_snapshot() ;

	$self->deselect_all_elements() ;
		
	unless(defined $x_offset)

setup/actions/clipboard.pl  view on Meta::CPAN

				
			pop @{$element->{GROUP}} ;
			push @{$element->{GROUP}}, $new_group{$group} ;
			}
		else
			{
			delete $element->{GROUP} ;
			}
		}

	my $clipboard = Clone::clone($self->{CLIPBOARD}) ;

	$self->add_elements_no_connection(@{$clipboard->{ELEMENTS}}) ;
	$self->add_connections(@{$clipboard->{CONNECTIONS}}) ;

	$self->update_display() ;
	}
} ;	
	

setup/actions/file.pl  view on Meta::CPAN

	my $asciio = new App::Asciio() ;

	use Module::Util qw(find_installed) ;
	use File::Basename ;
	my ($basename, $path, $ext) = File::Basename::fileparse(find_installed('App::Asciio'), ('\..*')) ;
	my $setup_path = $path . $basename . '/setup/' ;
	
	$asciio->setup([$setup_path .  'setup.ini', ] ) ;
	
	$asciio->load_file($file_name) ;
	$asciio->run_actions_by_name('Select all elements', 'Copy to clipboard') ;
	
	use Clone ;
	$self->{CLIPBOARD} = Clone::clone($asciio->{CLIPBOARD}) ; 
	
	$self->run_actions_by_name(['Insert from clipboard', $x, $y]) ;
	}
} ;

setup/setup.ini  view on Meta::CPAN

	[
	'stencils/asciio',
	'stencils/computer',
	'stencils/people',
	'stencils/divers',
	],
	
ACTION_FILES =>
	[
	'actions/align.pl',
	'actions/clipboard.pl',
	'actions/debug.pl',
	'actions/new_elements.pl',
	'actions/elements_manipulation.pl',
	'actions/file.pl',
	'actions/mouse.pl',
	'actions/colors.pl',
	'actions/unsorted.pl',
	'actions/presentation.pl',
	
	'actions/context_menu_multi_wirl.pl',



( run in 2.809 seconds using v1.01-cache-2.11-cpan-df04353d9ac )