Skip to content

Commit

Permalink
ADDED: bindings sub groups
Browse files Browse the repository at this point in the history
  • Loading branch information
nkh committed Nov 21, 2023
1 parent 812480e commit b285804
Show file tree
Hide file tree
Showing 12 changed files with 469 additions and 668 deletions.
2 changes: 1 addition & 1 deletion documentation/mdbook_asciio/src/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We're working on having packages pre-build for different distributions

## Ubuntu (probably other bian derived too)
## Ubuntu (probably other debian derivates too)

```bash
apt install libdata-compare-perl libdata-compare-perl libdirectory-scratch-structured-perl libeval-context-perl libextutils-pkgconfig-perl libfile-homedir-perl libgtk3-perl libio-prompter-perl libterm-size-any-perl libterm-termkey-perl libtest-block-perl libtermkey-dev libmodule-build-perl libsereal-perl libcompress-bzip2-perl libpango-perl libcarp-clan-perl libtest-deep-perl libtest-most-perl libdevel-stacktrace-perl libexception-class-perl libcapture-tiny-perl libtest-differences-perl libmodule-util-perl libtest-nowarnings-perl
Expand Down
378 changes: 0 additions & 378 deletions group_bindings.md

This file was deleted.

2 changes: 1 addition & 1 deletion lib/App/Asciio/Actions/Mouse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $self->{MOUSE_X} += $x_offset ;
$self->{MOUSE_Y} += $y_offset ;

($self->{SELECTION_RECTANGLE}{START_X}, $self->{SELECTION_RECTANGLE}{START_Y}) = ($self->{MOUSE_X}, $self->{MOUSE_Y}) ;
($self->{SELECTION_RECTANGLE}{END_X}, $self->{SELECTION_RECTANGLE}{END_Y}) = ($self->{MOUSE_X}, $self->{MOUSE_Y}) ;
($self->{SELECTION_RECTANGLE}{END_X}, $self->{SELECTION_RECTANGLE}{END_Y}) = ($self->{MOUSE_X}, $self->{MOUSE_Y}) ;

$self->update_display() ;
}
Expand Down
32 changes: 16 additions & 16 deletions lib/App/Asciio/Setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ my($self, $setup_ini_files) = @_ ;

for my $setup_file (@{$setup_ini_files})
{
print "Initializing with '$setup_file'\n" if $self->{DISPLAY_SETUP_INFORMATION};
print STDERR "Initializing with '$setup_file'\n" if $self->{DISPLAY_SETUP_INFORMATION};
warn "Asciio: Warning: can't find setup data '$setup_file'\n" and next unless -e $setup_file ;

push @{$self->{SETUP_PATHS}}, $setup_file ;
Expand Down Expand Up @@ -62,25 +62,25 @@ for my $stencil (@{$stencils})
{
if(-f "$setup_path/$stencil")
{
print "loading stencil '$setup_path/$stencil'\n" if $self->{DISPLAY_SETUP_INFORMATION} ;
print STDERR "loading stencil '$setup_path/$stencil'\n" if $self->{DISPLAY_SETUP_INFORMATION} ;
$self->load_elements("$setup_path/$stencil", $stencil) ;
}
elsif(-d "$setup_path/$stencil")
{
for(glob("$setup_path/$stencil/*"))
{
print "batch loading stencil '$setup_path/$stencil/$_'\n" if $self->{DISPLAY_SETUP_INFORMATION} ;
print STDERR "batch loading stencil '$setup_path/$stencil/$_'\n" if $self->{DISPLAY_SETUP_INFORMATION} ;
$self->load_elements($_, $stencil) ;
}
}
else
{
print "Unknown type '$setup_path/$stencil'!\n" ;
print STDERR "Unknown type '$setup_path/$stencil'!\n" ;
}
}
else
{
print "Can't find '$setup_path/$stencil'!\n" ;
print STDERR "Can't find '$setup_path/$stencil'!\n" ;
}
}
}
Expand Down Expand Up @@ -173,7 +173,7 @@ for my $action_file (@{ $action_files })
if('HASH' eq ref $action_handler_definition)
{
$shortcuts_definition = $action_handler_definition->{SHORTCUTS} ;
# print "\e[31maction_handler: '$name' is group $shortcuts_definition\e[m\n" ;
# print STDERR "\e[31maction_handler: '$name' is group $shortcuts_definition\e[m\n" ;

$action_handler = $self->get_group_action_handler($setup_path, $action_file, $name, $action_handler_definition) ;
}
Expand All @@ -193,7 +193,7 @@ for my $action_file (@{ $action_files })
}
else
{
# print "ignoring '$name'\n" ;
# print STDERR "ignoring '$name'\n" ;
next ;
}

Expand Down Expand Up @@ -251,16 +251,16 @@ for my $action_file (@{ $action_files })
{
if(exists $self->{ACTIONS}{$shortcut})
{
print "Overriding shortcut '$shortcut'\n" ;
print "\tnew is '$name' defined in file '$setup_path/$action_file'\n" ;
print "\told was '$self->{ACTIONS}{$shortcut}{NAME}' defined in file '$self->{ACTIONS}{$shortcut}{ORIGIN}'\n" ;
print STDERR "Overriding shortcut '$shortcut'\n" ;
print STDERR "\tnew is '$name' defined in file '$setup_path/$action_file'\n" ;
print STDERR "\told was '$self->{ACTIONS}{$shortcut}{NAME}' defined in file '$self->{ACTIONS}{$shortcut}{ORIGIN}'\n" ;
}

$self->{ACTIONS}{$shortcut} = $action_handler ;

if (! defined $action_handler->{CODE} && ! defined $action_handler->{CONTEXT_MENU_SUB})
{
print "\e[33mNo action for action_handler: '$name', file: '$setup_path/$action_file'\e[m\n" ;
print STDERR "\e[33mNo action for action_handler: '$name', file: '$setup_path/$action_file'\e[m\n" ;
delete $self->{ACTIONS}{$shortcut} ;
}

Expand Down Expand Up @@ -288,7 +288,7 @@ my $name = $action_handler->{NAME} ;
if(exists $self->{ACTIONS_BY_NAME}{$name})
{
my $reused = '' ;
print "\e[33mOverriding action: '$name', file: '$action_file', old_file: '" . ($self->{ACTIONS_BY_NAME}{ORIGINS}{$name}{ORIGIN} // 'unknown') ;
print STDERR "\e[33mOverriding action: '$name', file: '$action_file', old_file: '" . ($self->{ACTIONS_BY_NAME}{ORIGINS}{$name}{ORIGIN} // 'unknown') ;

my $old_handler = $self->{ACTIONS_BY_NAME}{$name} ;

Expand Down Expand Up @@ -321,7 +321,7 @@ if(exists $self->{ACTIONS_BY_NAME}{$name})
$action_handler->{CONTEXT_MENU_ARGUMENTS} = $old_handler->{CONTEXT_MENU_ARGUMENTS} ;
}

print "$reused\e[m\n" ;
print STDERR "$reused\e[m\n" ;
}
}

Expand Down Expand Up @@ -408,10 +408,10 @@ for my $name (keys %{$group_definition})

for my $shortcut ('ARRAY' eq ref $shortcuts_definition ? @$shortcuts_definition : ($shortcuts_definition))
{
print "Overriding action group '$shortcut' with definition from file '$setup_path/$action_file'!\n"
print STDERR "Overriding action group '$shortcut' with definition from file '$setup_path/$action_file'!\n"
if exists $handler{$shortcut} ;

# print "\e[32maction_handler: '$name' shortcut: $shortcut\e[m\n" ;
# print STDERR "\e[32maction_handler: '$name' shortcut: $shortcut\e[m\n" ;
$handler{$shortcut} = $action_handler ;

$handler{$shortcut}{GROUP_NAME} = $group_name if defined $group_name ;
Expand Down Expand Up @@ -461,7 +461,7 @@ EOC
{
if(exists $self->{IMPORT_EXPORT_HANDLERS}{$extension})
{
print "Overriding import/export handler for extension '$extension' in file '$setup_path/$import_export_file'\n" ;
print STDERR "Overriding import/export handler for extension '$extension' in file '$setup_path/$import_export_file'\n" ;
}

$self->{IMPORT_EXPORT_HANDLERS}{$extension} = $import_export_handlers{$extension} ;
Expand Down
8 changes: 1 addition & 7 deletions lib/App/Asciio/Text/Asciio.pm
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,6 @@ if ($self->{MOUSE_TOGGLE})
}

render_text($text_array, $COLS, $ROWS) ;

if(defined $self->{ACTION_VERBOSE})
{
print "\e[2;81H\e[32m$self->{LAST_ACTION} " ;
print "\e[3;81H$selection_rectangle" ;
}
}

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -578,5 +572,5 @@ it and/or modify it under the same terms as Perl itself.

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

"Terinal world domination!" ;
"Terminal world domination!" ;

4 changes: 3 additions & 1 deletion script/tasciio
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ $asciio->run_actions_by_name(['Open', $title]) if defined $title ;
$asciio->setup($setup_paths) ;

$asciio->set_title($title) if defined $title ;
$asciio->{ACTION_VERBOSE} = sub { $asciio->{LAST_ACTION} = $_[0] ; } ;

STDERR->autoflush(1) ;
$asciio->{ACTION_VERBOSE} = sub { print STDERR "$_[0]\n" ; } ;

my ($character_width, $character_height) = $asciio->get_character_size() ;

Expand Down
Binary file added setup/Stencils/default_stencil.asciio
Binary file not shown.
File renamed without changes.
Binary file added setup/Stencils/stencil_divers.asciio
Binary file not shown.
Binary file added setup/Stencils/stencil_people.asciio
Binary file not shown.
Loading

0 comments on commit b285804

Please sign in to comment.