Commits

Herbert Breunung  committed ad08407

repurpose this branch for litttle standalone expriments, less duplication

  • Participants
  • Parent commits 55a7b43
  • Branches sp1

Comments (0)

Files changed (213)

File Changes

-Revision history for Kephra
-
-0.5     Module::Starter (ed) the rewrite on 2 June 2011
-

File MANIFEST

-Changes
-bin/kephra
-lib/Kephra.pm
-LICENSE
-Makefile.PL
-MANIFEST			This list of files
-README
-t/00-start.t
-t/01-compile.t
-t/pod.t

File Makefile.PL

-use 5.006;
-use strict;
-use warnings;
-use ExtUtils::MakeMaker;
-
-WriteMakefile(
-    NAME                => 'Kephra',
-    AUTHOR              => q{Herbert Breunung <lichtkind@cpan.org>},
-    VERSION_FROM        => 'lib/Kephra.pm',
-    ABSTRACT_FROM       => 'lib/Kephra.pm',
-    ($ExtUtils::MakeMaker::VERSION >= 6.3002
-      ? ('LICENSE'=> 'gpl_2')
-      : ()),
-    PL_FILES            => {},
-    PREREQ_PM => {
-        'Test::More' => 0,
-        'Benchmark' => 0,
-        'Encode' => 0,
-        'File::Find' => 0,
-        'File::Spec::Functions' => 0,
-        'File::UserConfig' => 0,
-        'Config::General' => 0,
-        'YAML::Tiny' => 0,
-        'PPI' => 0.009,
-        'Moo' => 0.009,
-        'Wx' => 0.74,
-        'Wx::Perl::ProcessStream' => 0,
-    },
-    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
-    clean               => { FILES => 'Kephra-*' },
-);

File README

-Kephra
-
-this is the rewrite of Kephra and will hopefully become version 0.6
-
-
-INSTALLATION
-
-To install this module, run the following commands:
-
-    perl Makefile.PL
-    make
-    make test
-    make install
-
-SUPPORT AND DOCUMENTATION
-
-After installing, you can find documentation for this module with the
-perldoc command.
-
-    perldoc Kephra
-
-You can also look for information at:
-
-    HG Source Archive
-        https://bitbucket.org/lichtkind/kephra
-
-    Homepage
-        https://http://kephra.sourceforge.net
-
-    RT, CPAN's request tracker (report bugs here)
-        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Kephra
-
-    AnnoCPAN, Annotated CPAN documentation
-        http://annocpan.org/dist/Kephra
-
-    CPAN Ratings
-        http://cpanratings.perl.org/d/Kephra
-
-    Search CPAN
-        http://search.cpan.org/dist/Kephra/
-
-
-LICENSE AND COPYRIGHT
-
-Copyright (C) 2011 Herbert Breunung
-
-This program is released under the following license: gpl2
-

File bin/kephra

-#! /usr/bin/perl -w
-#############################################################################
-## Author:      Herbert Breunung
-## Purpose:     Kephra starter
-## Created:     1/06/2011
-## Copyright:   (c) Herbert Breunung
-## Licence:     GPLv2
-#############################################################################
-
-use strict;
-our $VERSION = '0.1';
-
-BEGIN {
-	my $dir = -d 'lib' ? 'lib' : '../lib';
-	unshift @INC, $dir;
-	require Kephra;
-}
-
-
-Kephra::start();
-
-__END__
-
-=head1 NAME
-
-kephra - Kephra starter script
-
-=head1 SYNOPSIS
-
-    > kephra [<files>]   # start with certain files open
-
-for main Docs please go to the main Module named L<Kephra>.
-
-=cut
-

File data/empty.xpm

Added
New image

File data/iso.txt

+���������

File data/proton.xpm

Added
New image

File data/utf.txt

+öäüäöü

File doc/Components.pod

-=head1 Kephra Graphical Components
-
-the visible parts of the editor app:
-
-component     position            key                    purpose
-
---------------------------------------------------------------------------------
-
-MenuBar       top 1
-
-MainToolBar   top 2                             icons, dropdown menu, tool panel 
-
-TabBar        top 3                     
-Editor        center                            main editing area, dividable by 4
-
-SearchBar     below 1                           find and goto functions
-
-TextLab       below 2                           find|lines -> replace append, prepend
-
-IOUnit
- Output        below Search     ctrl+shift+<    just watching various output channels
- InputRow      below Output     ctrl+<          typing commands to kephra/perl/shell/other
-
-StatusLine    below Input
-
-
-
-FileBrowser   left                F2
-
-Project       left                 
-Manager
-
-
-TreeLib       right               F7           nested list of snippets (runnable with *)
-
-DocBrowser    right               F8           simple html browser (converst POD)
-
-OrgPad        right               F9           simple org mode clone
-
-ScratchSheet  right              F12           plain temp text buffer, 1 global, 1 per doc
-
-
-# Document      external
-# Viewer        window
-
-Dialogs: File, Color, Config, Info
-
-
-=head2 Visual Overview
-_______________________________________________________________________________
-|____________________________________menu_____________________________________|
-|________________________________global_toolbar_______________________________|
-|                  |___|___|___|___|____|___|___|___|___|___|                 |
-|                  |                    |                   |                 |
-|    filebrowser   |    editor leftup   |  editor rightup   |                 |
-|                  |                    |                   |     treelib     |
-|   projectmanager |                    |                   |                 |
-|                  |                    |                   |     orgpad      |
-|                  |              editor panel              |                 |
-|                  |____________________|___________________|    scratchsheet |
-|                  |___|___|___|___|____|___|___|___|___|___|                 |
-|                  |                    |                   |    clipboard    |
-|                  |      left down     |    right down     |                 |
-|                  |                    |                   |                 |
-|                  |____________________|___________________|                 |
-|                  |__________________find__________________|                 |
-|                  |_________________replace________________|                 |
-|      left        |_________________textlab________________|      right      |
-|    sidepanel     |___|___|___|___|___|____________________|    sidepanel    |
-|                  |                                        |                 |
-|                  |                 output                 |                 |
-|                  |                                        |                 |
-|                  |________________________________________|                 |
-|__________________|_________________input__________________|_________________|
-|___________________________status____________________________________________|

File doc/Index.pod

Empty file removed.

File doc/LongFeatureList.txt

-
-File:
-	new/open/save/reload/exit
-
-Encodings
-	Utf/Latin1/ASCII
-
-Syntaxmodes:
-	are files that contain information perl language
-	fileendings to recognize it
-	file content to recognize it
-	keywords
-	colors for the syntaxhiglighting
-	comment character
-	compiler/interpreter/lint command
-
-Search:

File doc/Overview.pod

-=head1 Kephra Overview
-
-Welcome to the root document of the Kephra user documentation.
-All paths are short from here.
-If you are new, it is the best point to start from.
-
-=head2 Philosophy
-
-=head3 Main Objective
-
-=head3 Inspirations
-
-  Nedit, Kommodo, Vim, Emacs, Geany, Gedit
-
-=head3 Design Decisions
-
-=head2 Techology
-
-=head2 Main Features
-
-

File doc/Plan.txt

Empty file removed.

File doc/Sanddrum.pod

-=head1 Sandrum
-
-=head2 SYNOPSIS
-
-language of the Kephra command line
-
-=head2 Main Idea
-
-The best thing about vi is the way to control the editor with short comands,
-that get typed into a seperate line.
-For complex operations is this the fastest way to get thigs done.
-Thats because each latter can open a new context.
-This way you can stuff much more commands onto the keayboard.
-Also the the options of each command multiply the into the unimaginable,
-if you just think in terms of point and click or simple key combinations
-
-Why not Perl? All commands would be much longer/complicated.
-But its also possible. In a different command line just one tab away.
-
-=head2 Name
-
-Kephra, depicted as a scarab is a desert beatle. 
-For communication the beat the sand, making low frequency sound signals.
-
-
-=head2 Command Overview
-
-  .       -     repeat last action
-  /../    -     match / find
-  /../../ -     substitute
-  g/d     -     goto line number /d stands for number (regex syntax)
-  gb      -     goto [docs] beginning
-  ge      -     goto        end
-  gs/w    -     goto sub name = /w
-  gd.     -     goto doc nr (/d) or name(/w)
-  dw      -     delete word
-  dl      -     delete line
-  cw      -     copy word
-  cl      -     copy line
-  cs      -     copy selection
-  sa      -     select all
-  u       -     undo
-  r       -     redo

File lib/.DS_Store

Binary file added.

File lib/Kephra.pm

-# See end of file for docs
-use v5.10;
-use strict;
-use warnings;
-
-
-package Kephra;
-our $NAME     = __PACKAGE__;    # name of entire application
-our $VERSION  = '0.4.5.12';
-
-our @external_dependencies = (
-	qw/Benchmark Encode Encode::Guess Cwd/,
-	qw/File::Find File::Spec File::UserConfig Config::General YAML/,
-	qw/Moo/, #PPI 
-	qw/Wx Wx::STC Wx::Perl::ProcessStream/, #  Wx::Scintilla
-);
-our @used_wx_modules = qw/Wx::AUI Wx::DND Wx::RichText/; # Wx::STC Wx::HTML
-
-sub start {
-	#start_worker_thread();
-	load_libs();
-	configdir();
-	Kephra::App->new()->MainLoop();
-}
-
-sub load_libs {
-	my $pkg = __PACKAGE__;
-	eval 'require ' . $_ for @external_dependencies, @used_wx_modules;
-	require Kephra::App;
-	#$require_string .= $pkg . '::'; eval $require_string . $_ for @needed_at_first;
-}
-
-
-sub start_worker_thread {
-	# TODO:  
-	#Kephra::Works
-}
-
-sub configdir {
-	#$_[0] and $_[0] eq $NAME and shift;
-	#print File::UserConfig->configdir(@_);
-	#my $configdir = File::UserConfig->configdir;
-	#print $configdir,"\n";
-}
-
-sub debug {
-	#Wx->import( ':everything' );
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-Kephra - fresh and beautiful text editor that works as you prefer
-
-=head1 SYNOPSIS
-
-just start it with some files already open
-
-    kephra file.name file name ....
-
-=head1 User Documentation
-
-
-
-=head1 INTERNALS
-
-just follow L<Kephra::API>.
-
-=head1 AUTHOR
-
-Herbert Breunung, C<< <lichtkind at cpan.org> >>
-
-=head1 BUGS
-
-Please report any bugs or feature requests to C<bug-kephra at rt.cpan.org>, or through
-the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Kephra>.  I will be notified, and then you'll
-automatically be notified of progress on your bug as I make changes.
-
-
-=head1 SUPPORT
-
-You can find documentation for this module with the perldoc command.
-
-	perldoc Kephra
-
-You can also look for information at:
-
-=over 2
-
-=item * HG Source Archive
-
-L<https://bitbucket.org/lichtkind/kephra>
-
-=item * Homepage
-
-L<https://http://kephra.sourceforge.net>
-
-=item * RT: CPAN's request tracker (report bugs here)
-
-L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Kephra>
-
-=item * AnnoCPAN: Annotated CPAN documentation
-
-L<http://annocpan.org/dist/Kephra>
-
-=item * CPAN Ratings
-
-L<http://cpanratings.perl.org/d/Kephra>
-
-=item * Search CPAN
-
-L<http://search.cpan.org/dist/Kephra/>
-
-=back
-
-
-=head1 ACKNOWLEDGEMENTS
-
-=over 2
-
-=item * Herbert Breunung E<lt>lichtkind@cpan.orgE<gt> (main author and design lead)
-
-=back
-
-=head1 LICENSE AND COPYRIGHT
-
-Copyright 2011 Herbert Breunung.
-
-This program is released under the license: gpl v2
-
-=cut

File lib/Kephra/API.pm

-use strict;
-use warnings;
-
-use Kephra::API::Command;
-use Kephra::API::Doc;
-use Kephra::API::Event;
-use Kephra::API::KeyMap;
-#use Kephra::API::Plugin;
-#use Kephra::API::Sandrum;
-use Kephra::App::Focus;
-#use Kephra::App::Window;
-use Kephra::App::Bar::Document;
-#use Kephra::Config;
-use Kephra::Log;
-#use Kephra::Worker;
-
-
-package Kephra::API;
-my $VERSION = 0.1;
-
-Kephra::API::Command::switch_variables({
- '$app'    => { switch => 'app',         class => 'Kephra::App' },
- '$win'    => { switch => 'main_window', class => 'Kephra::App::Window' },
- '$docbar' => { switch => 'docbar',      class => 'Kephra::App::Bar::Document' },
- '$doc'    => { switch => 'document',    class => 'Kephra::Document' },
- '$ed'     => { switch => 'editor',      class => 'Kephra::App::Editor' },
-});
-
-sub app                 { $Kephra::App::_ref }
-sub main_window         { $Kephra::App::Frame::_ref }
-sub docbar              { Kephra::App::Part::Editor::docbar() }
-sub all_docbars         { Kephra::App::Part::Editor::all_docbars() }
-sub passive_docbars     { Kephra::App::Part::Editor::passive_docbars() }
-sub document            { Kephra::API::Doc::active() }
-sub all_documents       { Kephra::API::Doc::all() }
-sub do_with_all_editors {&Kephra::API::Doc::do_with_all_editors }
-sub editor              { Kephra::API::Doc::active_editor() }
-
-sub focus               { Kephra::App::Focus::set(@_) }
-sub focus_back          { Kephra::App::Focus::set_back(@_) }
-
-# IO-unit
-#sub input  { main_window()->{'part'}{'iounit'}->get_line() if ref main_window() and exists main_window()->{'part'}{'iounit'} }
-#sub output { main_window()->{'part'}{'iounit'}->output(@_) if ref main_window() and exists main_window()->{'part'}{'iounit'} }
-#sub log    { main_window()->{'part'}{'iounit'}->output('log', @_) if ref main_window() and exists main_window()->{'part'}{'iounit'} }
-
-sub note {}
-sub warn {}
-sub error {}
-
-
-sub configs  { }
-
-# command list
-sub add_command { }
-sub del_command { }
-sub run_command { }
-sub command_status {}
-
-# cmd line lang
-sub run_sandrum_commands {}
-
-# event table
-sub add_event_callback { }
-sub del_event_callback { }
-sub trigger_event      { }
-sub freeze_event       { }
-sub thaw_event         { }
-
-# plugin API
-sub register_plugin {}
-sub get_plugin_status {}
-sub get_plugin_data {}
-sub available_plugins {}
-sub unregister_plugin {}
-
-# if you want to know more, read Kephra::Internals.pod
-
-
-1;

File lib/Kephra/API/Command.pm

-use strict;
-use warnings;
-
-package Kephra::API::Command;                             # callable by the user
-
-my %list;     # by ID
-#my %keyproxy;# by keycode
-my %switchvar; #switchvar vor cmd definitions
-my $done_init = 0;
-
-
-sub      _raw_list { \%list }
-sub sub_exists     { no strict 'refs'; !!*{ $_[0] }{CODE} if $_[0] }
-sub package_exists { no strict 'refs'; !!%{ $_[0] . '::' } if $_[0] }
-sub calling_module { ( caller(1) )[0] }
-
-
-sub switch_variables {
-	my ($var_def) = shift;
-	my $api = 'Kephra::API';
-	my $caller = calling_module();
-	return Kephra::Log::error("only callable by $api", 1) if $caller ne $api;
-	return Kephra::Log::error("has to be called before init", 1)
-		if $done_init and not keys %switchvar;
-	#return Kephra::Log::error("call me just once", 1) if keys %switchvar;
-	return Kephra::Log::error("need a hashref", 1) unless ref $var_def eq 'HASH';
-	for my $var (keys %$var_def){
-		delete $var_def->{$var} unless substr($var, 0, 1) eq '$';
-		delete $var_def->{$var} unless sub_exists( $api .'::'. $var_def->{$var}{'switch'} );
-		delete $var_def->{$var} unless package_exists ( $var_def->{$var}{'class'} );
-	}
-	%switchvar = %$var_def;
-}
-
-sub register {
-	my $cmd = shift;
-	return Kephra::Log::error("cmd def have to be in a hash ref, not $cmd", 1)
-		unless ref $cmd eq 'HASH';
-	my $caller = calling_module();
-	for my $ID (keys %$cmd) {
-		Kephra::Log::warning( 
-			"$cmd already registered to do ". property($ID, 'sub')." by ".
-			property($ID, 'source')  ), next if registered( $ID );
-		#for (qw/sub options state event label help keys icon/){} filter input later
-		$list{$ID}           = $cmd->{$ID};
-		$list{$ID}{'source'} = $caller;
-		compile($ID) if $done_init;
-	}
-}
-
-sub init {
-	compile( keys %list );
-	$done_init = 1;
-}
-
-sub compile {
-	for my $cmd_ID (@_) {
-		my $cmd = $list{ $cmd_ID };
-		my $sub = $cmd->{'sub'};
-		Kephra::Log::warning( "$cmd_ID lacks value on hashkey 'sub'"), next unless $sub;
-
-		if ( substr($sub, 0, 1) eq '$'){
-			my $method_pos = index($sub, '->');
-			my $var = substr($sub, 0, $method_pos);
-			Kephra::Log::warning
-				("unknown switchvar $var in $cmd_ID 'sub' entry", 1), next
-					unless ref $switchvar{ $var };
-			my $method = $switchvar{$var}{'class'}.'::'.substr($sub, $method_pos+2);
-			# move that check into test suite
-			#Kephra::Log::warning ("called unknown method with $sub", 1), next
-			#	unless sub_exists($method) ;
-			
-			$cmd->{'coderef'} = 'Kephra::API::' . $switchvar{$var}{'switch'} . '()' .
-			                      substr($sub, $method_pos);
-		}
-		elsif ( index($sub, '::') == -1) {
-			$cmd->{'coderef'} = $cmd->{'source'} . '::' . $sub
-		}
-		else { $cmd->{'coderef'} = $sub }
-
-		# add parameter if are any
-		$cmd->{'coderef'} .= exists $cmd->{'parameter'} # just one parameter yet
-			? "( '" . $cmd->{'parameter'} . "' )"
-			: '()';
-		$cmd->{'coderef'} = eval 'sub { ' . $cmd->{'coderef'} . ' }';
-
-		Kephra::API::KeyMap::register_keys({ $cmd_ID => $cmd->{'keys'} }) if $cmd->{'keys'};
-	}
-}
-
-
-sub run {
-	my $cmd = shift;
-	$cmd = [$cmd] unless ref $cmd eq ref [];
-	my $return;
-	for (@$cmd) { $return = $list{$_}{'coderef'}->() if exists $list{$_} }
-	$return;
-}
-sub run_by_keycode {
-	my ($code, $map) = @_;
-}
-
-sub registered      { 1 if defined $_[0]  and exists $list{ $_[0] }             }
-sub property_exists { 1 if registered($_[0]) and exists $list{ $_[0] }{ $_[1] } }
-sub add {}
-
-sub all_properties { 
-	if ( registered($_[0]) ) { $list{$_[0]} }
-	else { Kephra::Log::warning('requested data of unknown command '.$_[0], 1) }
-}
-sub property       { $list{$_[0]}{$_[1]}         if property_exists(@_) }
-sub set_property   { $list{$_[0]}{$_[1]} = $_[2] if property_exists(@_) }
-
-
-1;
-
-__END__
-
-=head1 Command Definition
-
-cmd_ID => {
-	coderef   => compiled from sub, source and option, saves state
-	sub       => 'Kephra::File::new',
-	parameter => [],
-	source    => package that registered that cmd
-	state     => return value of the call or antother coderef
-	event     => '',
-	label     => 'New',
-	help      => '', # help text to be shown in statusbar or as popup
-	keys      => 'Ctrl + N',
-	icon      => '',
-	bitmap    => '',  #Wx::Bitmap Object
-}

File lib/Kephra/API/Doc.pm

-use v5.10;
-use strict;
-use warnings;
-use Wx;
-use Kephra::App::Editor;
-use Kephra::App::Panel;
-use Kephra::Document;
-
-package Kephra::API::Doc;
-my %document = ('ID'=>{});             # keys of subhashes: ID editor panel file
-my $active;
-my $lowest_free_ID = 1;
-my $lowest_free_anon_NR = 1;
-
-use constant DOC_CLASS => 'Kephra::Document';
-use Scalar::Util qw(blessed looks_like_number);
-
-
-sub active        { $active || '' }
-sub active_editor { $active->editor->{Kephra::API::docbar()} if $active }
-sub active_panel  { $active->panel->{Kephra::API::docbar()} if $active }
-sub set_active {
-	my $doc = find( shift );
-	$active = $doc if $doc;
-}
-sub previous      { App::Kephra::Focus::last( DOC_CLASS ) }
-sub all           { values %{$document{'ID'}} }
-
-sub is { return 1 if blessed($_[0]) and $_[0]->isa( DOC_CLASS ); return 0 }
-
-
-sub add {
-	my $doc = shift;
-	Kephra::Log::warning('need a ' . DOC_CLASS . " thats in stash, not $doc!", 1)
-		unless is($doc);
-	$document{'ID'}  {$lowest_free_ID} = $doc;
-	add_instance($doc, $_) for values $doc->panel;
-	if ($doc->file_path) {
-		$document{'file'}{$doc->file_path} = $doc;
-	} else {
-		$doc->anon_NR( $lowest_free_anon_NR++ );
-		$document{'anon'}{$doc->anon_NR} = $doc;
-	}
-	$lowest_free_ID++;
-}
-
-
-sub rename_file {
-	my $doc = find( shift );
-	Kephra::Log::warning('need a ' . DOC_CLASS . " thats in stash, not $doc!", 1)
-		unless is($doc);
-	my $file = $doc->old_file_path;
-	delete $document{'file'}{$file} if $file and $document{'file'}{$file};
-	if ($doc->file_path){
-		$document{'file'}{$doc->file_path} = $doc;
-		unless ($doc->old_file_path) {
-			delete $document{'anon'}{$doc->anon_NR};
-			$doc->anon_NR(0);
-		}
-	} else {
-		if ($doc->old_file_path) {
-			$doc->anon_NR( $lowest_free_anon_NR++ );
-			$document{'anon'}{$doc->anon_NR} = $doc;
-		}
-	}
-}
-
-
-sub remove {
-	my $doc = shift;
-#say "remove $doc ", scalar keys %{$document{'ID'}}, ' ',scalar keys %{$document{'file'}}; 
-	Kephra::Log::warning('need a ' . DOC_CLASS . ' thats in stash, not $doc!', 1)
-		unless is($doc);
-	delete $document{'ID'}{$doc->ID} if $doc->ID;
-	#remove_instance($doc, $_) for values $doc->panel;
-	delete $document{'file'}{$doc->file_path} if $doc->file_path;
-#say "removed $doc ", scalar keys %{$document{'ID'}}, ' ',scalar keys %{$document{'file'}}; 
-}
-
-
-sub add_instance {
-	my ($doc, $bar) = @_;
-	return Kephra::Log::warning('need as first parameter a'.DOC_CLASS.' thats in stash, not $doc!', 1)
-		unless is($doc);
-	return Kephra::Log::warning("need as second parameter a Kephra::App::Bar::Document instance")
-		unless blessed($bar) eq 'Kephra::App::Bar::Document';
-	$document{'panel'} { $doc->panel->{$bar}  } = $doc;
-	$document{'editor'}{ $doc->editor->{$bar} } = $doc;
-}
-
-
-sub remove_instance {
-	my ($doc, $bar) = @_;
-	return Kephra::Log::warning('need as first parameter a'.DOC_CLASS.' thats in stash, not $doc!', 1)
-		unless is($doc);
-	return Kephra::Log::warning("need as second parameter a Kephra::App::Bar::Document instance")
-		unless blessed($bar) eq 'Kephra::App::Bar::Document';
-	delete $document{'panel'}{ $doc->panel->{$bar} };
-	delete $document{'editor'}{ $doc->editor->{$bar} };
-}
-
-
-sub find {
-	my $any = shift;
-	Kephra::Log::warning("need a parameter!", 1) unless defined $any and $any;
-	return     looks_like_number($any)                                     ? $document{'ID'}    {$any}
-	         : ref($any) eq ''                                             ? $document{'file'}  {$any}
-	         : $any->isa('Kephra::App::Panel')                             ? $document{'panel'} {$any}
-	         : $any->isa('Kephra::App::Editor')                            ? $document{'editor'}{$any}
-	         :($any->isa(DOC_CLASS) and $document{'ID'}{$any->ID} eq $any) ? $any
-	         :                                                               undef;
-}
-
-
-sub file_loaded {
-	my $file_path = shift;
-	#Kephra::Log::warning("needs a file path as input!") unless $file_path and -e $file_path;
-	for my $doc ( all() ) {
-		return 1 if $doc->file_path and $doc->file_path eq $file_path;
-	}
-}
-
-
-sub all_editors { keys %{$document{'editor'}} }
-sub do_with_all_editors {
-}
-
-1;
-

File lib/Kephra/API/Event.pm

-use strict;
-use warnings;
-use Kephra::API;
-
-package Kephra::API::Event;
-
-my %event;
-
-sub add_callback {}
-sub del_callback {}
-sub trigger_callback {}
-sub freeze_callback {}
-sub thaw_callback{}
-
-sub add_event {}
-sub del_event {}
-sub trigger_event {}
-sub freeze_event {}
-sub thaw_event{}
-
-sub global_halt {}
-sub global_restore {}
-
-
-1;

File lib/Kephra/API/KeyMap.pm

-use strict;
-use warnings;
-use Wx;
-use Kephra::API;
-
-package Kephra::API::KeyMap;
-
-my %definition;
-my %code;
-my %mod_key_value = ( shift => 1000, ctrl => 2000, alt  => 4000);
-my %key_value = (
-	left  => &Wx::WXK_LEFT,      right => &Wx::WXK_RIGHT,
-	up    => &Wx::WXK_UP,         down => &Wx::WXK_DOWN,
-	pageup=> &Wx::WXK_PAGEUP, pagedown => &Wx::WXK_PAGEDOWN,
-	home  => &Wx::WXK_HOME,        end => &Wx::WXK_END,
-	delete => &Wx::WXK_DELETE,  insert => &Wx::WXK_INSERT,
-	back  => &Wx::WXK_BACK,        tab => &Wx::WXK_TAB,
-	esc   => &Wx::WXK_ESCAPE,    
-	enter => &Wx::WXK_RETURN,    space => &Wx::WXK_SPACE,
-	F1 => &Wx::WXK_F1, F2 => &Wx::WXK_F2,  F3 => &Wx::WXK_F3,  F4 => &Wx::WXK_F4,
-	F5 => &Wx::WXK_F5, F6 => &Wx::WXK_F6,  F7 => &Wx::WXK_F7,  F8 => &Wx::WXK_F8,
-	F9 => &Wx::WXK_F9,F10 => &Wx::WXK_F10,F11 => &Wx::WXK_F11,F12 => &Wx::WXK_F12,
-	pound => 35, tilde => 92,
-	num_left  => &Wx::WXK_NUMPAD_LEFT,  num_right=> &Wx::WXK_NUMPAD_RIGHT,
-	num_up    => &Wx::WXK_NUMPAD_UP,    num_down => &Wx::WXK_NUMPAD_DOWN,
-	num_space => &Wx::WXK_NUMPAD_SPACE, num_tab  => &Wx::WXK_NUMPAD_TAB,
-	num_enter => &Wx::WXK_NUMPAD_ENTER, num_F1   => &Wx::WXK_NUMPAD_F1,
-);
-my $main_map = 'editor';
-
-sub apply {}
-sub build {}
-sub copy {}
-sub overlay {}
-sub register_map {
-}
-
-sub register_keys {
-	my ($keys, $map) = @_;
-	return Kephra::Log::warning("got no hashref") unless ref $keys eq ref {};
-	$map = $main_map unless defined $map;
-	for my $cmd (keys %$keys) {
-		$definition{$map}{ $cmd } = $keys->{$cmd};
-		my $code = keycode_from_definition( $keys->{$cmd} );
-		unless (exists $code{$map}{ $code }) { $code{$map}{ $code } = $cmd }
-		else {
-			Kephra::Log::warning("$cmd tried to register the already taken keycode $code");
-		}
-	}
-}
-
-sub keycode_is_registered {
-	my ($code, $map) = @_;
-	Kephra::Log::warning('got no key code') unless $code;
-	$map = $main_map unless defined $map;
-	return 1 if defined $code{$map}{$code} and $code{$map}{$code}
-}
-
-sub cmd_from_keycode {
-	my ($code, $map) = @_;
-	Kephra::Log::warning('got no key code') unless $code;
-	$map = $main_map unless defined $map;
-	$code{$map}{$code};
-}
-
-sub keycode_from_definition {
-	my $def = shift;
-	$def =~ tr/ 	//d;
-	Kephra::Log::warning('got no key definition') unless $def;
-
-	my @key = split '\+', $def;           # only + can combine key in definition
-	my $code = length($key[-1]) == 1 ? ord uc $key[-1] : $key_value{ $key[-1] };
-	Kephra::Log::warning('don\'t know this key '.$key[-1]) unless $code;
-
-	$code += $mod_key_value{ shift(@key) } while @key > 1;
-	Kephra::Log::warning("got unknown key definition $def") unless $code;
-	return $code;
-}
-
-sub keycode_from_event {
-	my $event = shift;
-	Kephra::Log::warning ("got no event, but $event") unless ref $event and $event->isa('Wx::Event');
-	my $code = $event->GetKeyCode;
-	$code += $mod_key_value{'shift'} if $event->ShiftDown;
-	$code += $mod_key_value{'ctrl'} if $event->ControlDown;
-	$code += $mod_key_value{'alt'} if $event->AltDown;
-	return $code;
-}
-
-sub react_on_event {
-	my ($event, $map) = @_;
-	Kephra::Log::warning ("got no event, but $event") unless ref $event and $event->isa('Wx::Event');
-	$map = $main_map unless defined $map;
-	my $key = keycode_from_event($event);
-	Kephra::API::log("pressed key $key inside the ".(caller)[0]);
-	if (keycode_is_registered($key)){
-			my $cmd = cmd_from_code($key);
-			Kephra::API::log("run command: $cmd");
-			Kephra::API::Command::run( $cmd );
-	}
-	else {$event->Skip}
-}
-
-1;

File lib/Kephra/App/Bar/Document.pm

-use v5.12;
-use warnings;
-use Wx;
-use Wx::AUI;
-use Kephra::API;
-use Kephra::API::Command;
-
-package Kephra::App::Bar::Document;
-our @ISA = 'Wx::AuiNotebook';
-our $_ref;
-
-use Scalar::Util qw(blessed looks_like_number);
-
-
-Kephra::API::Command::register({
- 'docbar-select-left'     =>{sub=>'$docbar->select_page_left',     label=>'Previous Tab',  keys=>'ctrl+pageup'},
- 'docbar-select-right'    =>{sub=>'$docbar->select_page_right',    label=>'Next Tab',      keys=>'ctrl+pagedown'},
- #'docbar-select-leftmost'=>{sub=>'$docbar->select_page_leftmost', label=>'First Tab',     keys=>'ctrl+shift+pageup'},
- #'docbar-select-rightmost'=>{sub=>'$docbar->select_page_rightmost',label=>'Last Tab',      keys=>'ctrl+shift+pagedown'},
- 'docbar-move-left'       =>{sub=>'$docbar->move_page_left',       label=>'Move Left',     keys=>'ctrl+shift+pageup'},
- 'docbar-move-right'      =>{sub=>'$docbar->move_page_right',      label=>'Move Right',    keys=>'ctrl+shift+pagedown'},
- #'docbar-move-leftmost'   =>{sub=>'$docbar->move_page_leftmost',   label=>'Move Leftmost', keys=>'alt+shift+pageup'},
- #'docbar-move-rightmost'  =>{sub=>'$docbar->move_page_rightmost',  label=>'Move Rightmost',keys=>'alt+shift+pagedown'},
-});
-
-
-sub new {
-	my( $class, $parent) = @_;
-	my $self = $_ref = $class->SUPER::new( $parent, -1, [-1,-1], [-1,-1],
-		&Wx::wxAUI_NB_TOP | &Wx::wxAUI_NB_TAB_MOVE | &Wx::wxAUI_NB_WINDOWLIST_BUTTON |
-		&Wx::wxAUI_NB_SCROLL_BUTTONS | &Wx::wxAUI_NB_CLOSE_ON_ACTIVE_TAB
-	);
-
-	$self->{'visual_page_order'} = [];   # visual order of internal pos : vis -> int
-	$self->{'internal_page_order'} = []; # internal order of visual pos : int -> vis
-
-	$_->add_instance($self) for Kephra::API::all_documents();
-	$self->mount_events();
-
-	return $self;
-}
-
-sub Destroy {
-	my ($self) = @_;
-	$_->del_instance($self) for Kephra::API::all_documents();
-	$self->SUPER::Destroy( );
-	1;
-}
-
-sub mount_events {
-	my ($self) = @_;
-	#Wx::Event::EVT_SET_FOCUS ($self,  sub { print "focus--\n";$_[1]->Skip });
-	Wx::Event::EVT_AUINOTEBOOK_BEGIN_DRAG( $self, -1, sub {
-		my ($bar, $event ) = @_;
-		$bar->{'DND_page_nr'} = $event->GetSelection;
-	});
-	Wx::Event::EVT_AUINOTEBOOK_END_DRAG($self, -1, sub {
-		my ($bar, $event ) = @_;
-		return unless defined $bar->{'DND_page_nr'};
-		$bar->move_page_position_visually($bar->{'DND_page_nr'}, $event->GetSelection);
-		$bar->{'DND_page_nr'} = undef;
-		Kephra::App::Focus::stay();
-	});
-	Wx::Event::EVT_AUINOTEBOOK_PAGE_CHANGED( $self, -1, sub {
-		my ($bar, $event ) = @_;
-		my $new_page = $bar->GetPage( $event->GetSelection );
-		Kephra::API::Doc::set_active( $new_page );
-		Kephra::API::main_window()->refresh_title();
-		Kephra::API::focus( $new_page );
-		$event->Skip;
-	});
-	Wx::Event::EVT_AUINOTEBOOK_PAGE_CLOSE( $self, -1, sub {
-		my ($bar, $event ) = @_; 
-		$event->Veto;
-		Kephra::File::close_active();
-	});
-	# keep focus on editor even when klicking on tab bar
-	#Wx::Event::EVT_LEFT_DOWN( $self, sub { Kephra::API::active_editor()->focus; print "--down"; });
-	#$self->Connect( -1, -1, &Wx::wxEVT_SET_FOCUS, sub {  print "--"; } )
-	#Wx::Event::EVT_SET_FOCUS( $self, sub { my ($bar, $event ) = @_; $event->Skip; say "--bar"; });
-}
-
-sub unmount_events {
-	my ($self) = @_;
-	Wx::Event::EVT_AUINOTEBOOK_BEGIN_DRAG( $self, -1, sub {});
-	Wx::Event::EVT_AUINOTEBOOK_END_DRAG  ( $self, -1, sub {});
-	Wx::Event::EVT_AUINOTEBOOK_PAGE_CHANGED( $self, -1, sub {});
-	Wx::Event::EVT_AUINOTEBOOK_PAGE_CLOSE  ( $self, -1, sub {});
-}
-
-
-sub add_page {
-	my ($self, $new_page, $position, $title, $set_active) = @_;
-	return Kephra::Log::warning( "got no panel", 1 ) until Kephra::App::Util::is_panel($new_page);
-	my $active_pos = $self->GetSelection;
-
-	$title    = ''                           unless defined $title;
-	$position = 'right'                      if $position eq 'default' or $position eq -1;
-	$position = $self->rightmost_page_pos+1  if $position eq 'rightmost';
-	$position = $active_pos + 1              if $position eq 'right';
-	$position = $active_pos                  if $position eq 'left';
-	$position = $self->leftmost_page_pos     if $position eq 'leftmost';
-	$set_active = 0                          unless defined $set_active;
-
-	$new_page->Reparent($self);
-	$self->InsertPage( $position, $new_page, $title, $set_active);
-	#$self->set_page_title( $title, $new_page );
-	Kephra::API::focus($new_page) if $set_active;
-	Kephra::API::main_window()->refresh_title() if $set_active;
-
-	# inserting new index to position translators
-	for   (@{$self->{'visual_page_order'}}){ $_++ if $_ >= $position }
-	splice @{$self->{'visual_page_order'}},  $position, 0, $position;
-	$self->refresh_internal_page_order();
-
-	$self;
-}
-
-sub remove_page {
-	my ($self, $page) = @_;
-	my $internal_position = $self->GetPageIndex( $page );
-
-	$self->RemovePage( $internal_position );
-	my $visual_position = $self->{'internal_page_order'}[$internal_position];
-	my $visual = $self->{'visual_page_order'};
-	splice @$visual, $visual_position, 1;
-	for (@$visual) {$_-- if $_ >= $internal_position}
-	$self->{'visual_page_order'} = $visual;
-	$self->refresh_internal_page_order;
-}
-
-
-sub refresh_internal_page_order {       # sync visual_page_order index with internal_page_order after each change
-	my ($self) = @_;
-	my $visual = $self->{'visual_page_order'};
-	return unless ref $visual eq ref [];
-	my $internal;
-	$internal->[ $visual->[$_] ] = $_ for 0 .. @$visual-1;
-	$self->{'internal_page_order'} = $internal;
-}
-
-sub move_page_position_visually {          # for dnd only
-	my ($self, $from, $to ) = @_;
-	return unless $from >= 0 and $from < $self->GetPageCount;
-	return unless $to >= 0 and $to < $self->GetPageCount;
-	my $position = splice @{$self->{'visual_page_order'}}, $from, 1;
-	splice @{$self->{'visual_page_order'}}, $to, 0, $position;
-	$self->refresh_internal_page_order();
-}
-
-sub move_page_visually  {               # for movements by keyboard
-	my ($self, $from, $to ) = @_;
-	my $max = $self->GetPageCount - 1;
-	return if $from < 0 or $from > $max;
-	return if $to < 0 or $to > $max;
-	return if $from == $to;
-
-	my $pos = $self->{'visual_page_order'}[ $from ];
-	my $page = $self->GetPage( $pos );
-	my $label = $self->GetPageText( $pos );
-	my $visual = $self->{'visual_page_order'};
-
-	$self->unmount_events();
-	$self->RemovePage( $pos );
-	$self->InsertPage( $to, $page, $label);
-	my $removed = splice @$visual, $from, 1;
-	if ($from < $to) { for (@$visual) {$_-- if $_ > $removed and $_ <= $to} }
-	else             { for (@$visual) {$_++ if $_ < $removed and $_ >= $to} }
-	splice @$visual, $to, 0, $to;
-	$self->{'visual_page_order'} = $visual;
-	$self->refresh_internal_page_order();
-	$self->SetSelection( $self->{'visual_page_order'}[$to] );
-	$self->mount_events();
-}
-
-sub move_page_left      {
-	my ($self) = @_;
-	$self->move_page_visually ( 
-		$self->active_visual_pos, $self->next_page_pos_rot_left( $self->GetSelection )
-	);
-}
-sub move_page_right     {
-	my ($self) = @_;
-	$self->move_page_visually( 
-		$self->active_visual_pos, $self->next_page_pos_rot_right( $self->GetSelection )
-	);
-}
-sub move_page_leftmost  { 
-	my ($self) = @_;
-	$self->move_page_visually( $self->active_visual_pos, $self->leftmost_page_pos );
-}
-sub move_page_rightmost { 
-	my ($self) = @_;
-	$self->move_page_visually( $self->active_visual_pos, $self->rightmost_page_pos );
-}
-
-sub select_page_left    { 
-	my ($self) = @_;
-	$self->raise_page( $self->next_page_pos_rot_left( $self->GetSelection ) );
-}
-sub select_page_right   { 
-	my ($self) = @_;
-	$self->raise_page( $self->next_page_pos_rot_right( $self->GetSelection ) );
-}
-sub select_page_leftmost  { $_[0]->raise_page( $_[0]->leftmost_page_pos ) }
-sub select_page_rightmost { $_[0]->raise_page( $_[0]->rightmost_page_pos ) }
-
-sub active_visual_pos     { $_[0]->{'internal_page_order'}[ $_[0]->GetSelection ] }
-sub leftmost_page_pos     { 0 }
-sub rightmost_page_pos    { $_[0]->GetPageCount-1 }
-sub valid_page_pos        { 
-	1 if $_[1] >= $_[0]->leftmost_page_pos and $_[1]<= $_[0]->rightmost_page_pos
-}
-sub next_page_pos_rot_left{
-	my ($self) = @_; # take in position of internal order
-	my $pos = $self->{'internal_page_order'}[ $_[1] ];
-	$self->{'visual_page_order'}[$pos == 0 ? $self->rightmost_page_pos : $pos-1]
-}
-sub next_page_pos_rot_right{
-	my ($self) = @_; # take in position of internal order
-	my $pos = $self->{'internal_page_order'}[ $_[1] ];
-	$self->{'visual_page_order'}[$pos == $self->rightmost_page_pos ? 0 : $pos+1]
-}
-
-
-sub raise_page    {
-	my ($self, $pop) = @_; # can be Position Or Page (panel reference)
-	my $position = int $pop eq $pop ? $pop : $self->GetPageIndex($pop);
-	return unless $self->valid_page_pos( $position );
-	# if just selecting the currrent, only tab drives focus nuts
-	$self->SetSelection( $position ) unless $position == $self->GetSelection;
-	my $page = $self->GetPage($position);
-	my $doc = Kephra::API::Doc::find($page);
-	Kephra::API::Doc::set_active( $doc );
-	Kephra::API::focus ( defined $doc ? $doc->editor->{$self} : $page );
-	Kephra::API::main_window()->refresh_title();
-
-}
-
-
-sub active_title { $_[0]->GetPageText( $_[0]->GetSelection ) }
-
-sub set_page_title {
-	my ($self, $label, $page) = @_;
-	$page = $self->GetSelection unless defined $page;
-	return Kephra::Log::warning("need a Kephra::App::Panel or valid position number") 
-		unless (looks_like_number($page) and $self->valid_page_pos($page))
-		or (blessed($page) and $page->isa('Kephra::App::Panel'));
-	my $found = $self->GetPageIndex($page);
-	my $position = $found eq &Wx::wxNOT_FOUND ? $page : $found;
-	$self->SetPageText( $position, $label );
-}
-
-
-1;

File lib/Kephra/App/Bar/MainTool.pm

-use strict;
-use warnings;
-
-package Kephra::App::Bar::MainTool;
-
-
-1;

File lib/Kephra/App/Bar/Search.pm

-use strict;
-use warnings;
-use Wx;
-
-use Kephra::App::ToolBar;
-use Kephra::Config::Default;
-use Kephra::Log;
-
-package Kephra::App::Bar::Search;
-our @ISA = 'Wx::Panel';
-
-sub new {
-	my( $class, $parent) = @_;
-	my $panel = $class->SUPER::new($parent, -1, [-1,-1],[-1, -1]);
-
-	my $bar_def = Kephra::Config::Default::searchbar();
-	return Kephra::Log::error('got no array ref as bar definition') unless ref $bar_def eq 'ARRAY';
-
-	my $bar_data = Kephra::App::ToolBar::assemble($bar_def);
-	my $bar = Kephra::App::ToolBar::compile($bar_data, $panel);
-	my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );
-	$sizer->Add($bar, 1, &Wx::wxGROW, 0);
-	$panel->SetSizer($sizer);
-
-    return $panel;
-}
-
-
-1;

File lib/Kephra/App/Bar/Side.pm

-use strict;
-use warnings;
-use Wx;
-use Kephra::API;
-use Kephra::App::Splitter;
-use Kephra::App::ToolBar;
-use Kephra::App::Util;
-
-package Kephra::App::Bar::Side;
-our @ISA = 'Wx::Panel';
-
-sub new {
-}
-sub add {}
-sub remove {}
-
-sub open {}
-sub close {}
-sub raise {}
-
-1;

File lib/Kephra/App/Bar/Status.pm

-use strict;
-use warnings;
-use Wx;
-use Kephra::App::Util;
-
-package Kephra::App::Bar::Status;
-our @ISA = 'Wx::Panel';
-
-my $color = Kephra::App::Util::get('create_color');
-
-sub new {
-	my( $class, $parent) = @_;
-	my $self = $class->SUPER::new($parent, -1, [-1,-1],[-1, 30]);
-	my $sizer = Wx::BoxSizer->new( &Wx::wxHORIZONTAL );
-	my $grey = $color->('#aaaaaa');
-	for my $type (qw(cursorpos mode tabs EOL info)){
-		my $label = $self->{'label'}{$type} = Wx::TextCtrl->new($self, -1, $type);
-		$label->SetEditable(0);
-		$label->SetForegroundColour($grey);
-		$sizer->Add( $label, 0, &Wx::wxLEFT | &Wx::wxTOP | &Wx::wxBOTTOM, 5 );
-		#$sizer->SetSizeHints($label);
-		Wx::Event::EVT_SET_FOCUS($label, sub { Kephra::App::Focus::stay() });
-	}
-	$self->SetSizer($sizer);
-	return $self;
-}
-
-
-1;

File lib/Kephra/App/Dialog.pm

-use v5.10;
-use strict;
-use warnings;
-use Wx;
-use Kephra::API;
-
-package Kephra::App::Dialog;
-
-Kephra::API::Command::register({
- 'config-global-dialog'=>{sub=>'config',       label=>'Dialog',       keys=> 'ctrl+alt+c'},
- 'config-keymap-dialog'=>{sub=>'keymap',       label=>'Keymapping',   keys=> 'ctrl+alt+k'},
-});
-
-
-sub _parent { Kephra::API::main_window() }
-
-# standard dialogs
-
-sub message {
-	$_[1] = $_[1] || 'Kephra Message'; 
-	splice @_, 2, 0, &Wx::wxOK | &Wx::wxSTAY_ON_TOP;
-	_box( @_ );
-}
-sub info   {
-	$_[1] = $_[1] || 'Kephra Information'; 
-	splice @_, 2, 0, &Wx::wxOK | &Wx::wxICON_INFORMATION | &Wx::wxSTAY_ON_TOP;
-	_box( @_ );
-}
-sub warning {
-	$_[1] = $_[1] || 'Kephra Warning'; 
-	splice @_, 2, 0, &Wx::wxOK | &Wx::wxICON_WARNING | &Wx::wxSTAY_ON_TOP;
-	_box( @_ );
-}
-sub yes_no     { 
-	$_[1] = $_[1] || 'Kephra Question'; 
-	splice @_, 2, 0, &Wx::wxYES_NO | &Wx::wxICON_QUESTION | &Wx::wxSTAY_ON_TOP;
-	_box( @_ );
-}
-sub yes_no_cancel{
-	$_[1] = $_[1] || 'Kephra Question'; 
-	splice @_, 2, 0, &Wx::wxYES_NO | &Wx::wxCANCEL | &Wx::wxICON_QUESTION | &Wx::wxSTAY_ON_TOP;
-	_box( @_ );
-}
-sub _box {                                   # $message, $title, $style, $parent
-	Kephra::Log::warning('need at least a message as first parameter', 2) unless $_[0];
-	$_[3] = $_[3] || _parent(); 
-	Wx::MessageBox( @_ );
-}
-
-sub get_file_open {
-	my $title  = shift // 'Open File ...';
-	my $dir    = shift // '.';
-	my $filter = shift // '(*)|*';
-	my $parent = shift // _parent();
-	Wx::FileSelector( $title, $dir, '', '', $filter, &Wx::wxFD_OPEN, $parent);
-}
-
-sub get_files_open {
-	my $title  = shift // 'Open File ...';
-	my $dir    = shift // '.';
-	my $filter = shift // '(*)|*';
-	my $parent = shift // _parent();
-	my $dialog = Wx::FileDialog->new
-		($parent, $title, $dir, '', $filter, &Wx::wxFD_OPEN | &Wx::wxFD_MULTIPLE);
-	if ($dialog->ShowModal != &Wx::wxID_CANCEL) {
-		return $dialog->GetPaths;
-	}
-}
-
-sub get_file_save { 
-	my $title  = shift // 'Save File As ...';
-	my $dir    = shift // '.';
-	my $filter = shift // '(*)|*';
-	my $parent = shift // _parent();
-	Wx::FileSelector( $title, $dir, '', '', $filter, &Wx::wxFD_SAVE, $parent);
-}
-
-sub get_dir  {  Wx::DirSelector      ( @_[0,1], 0, [-1,-1], _parent()) }
-sub get_font {  Wx::GetFontFromUser  ( _parent(), $_[0]) }
-sub get_text {  Wx::GetTextFromUser  ( $_[0], $_[1], "", _parent()) }
-sub get_number {Wx::GetNumberFromUser( $_[0], '', $_[1],$_[2], 0, 100000, _parent())}
-
-# own dialogs
-#sub find {
-	#require Kephra::App::Dialog::Search; &Kephra::App::Dialog::Search::find;
-#}
-#sub replace {
-	#require Kephra::App::Dialog::Search; &Kephra::App::Dialog::Search::replace;
-#}
-#sub choose_color {
-	#require Kephra::App::Dialog::Color; Kephra::App::Dialog::Color::choose_color();
-#}
-sub about {
-	require Kephra::App::Dialog::About;
-	Kephra::App::Dialog::About::create( )->ShowModal;
-}
-sub config {
-	require Kephra::App::Dialog::Config;
-	Kephra::App::Dialog::Config::create( )->ShowModal;
-}
-sub documentation {
-	require Kephra::App::Dialog::Documentation;
-	Kephra::App::Dialog::Documentation::create( )->ShowModal;
-}
-sub keymap {
-	require Kephra::App::Dialog::Keymap;
-	Kephra::App::Dialog::Keymap::create( )->ShowModal;
-}
-
-#sub notify_file_changed {
-	#require Kephra::App::Dialog::Notify; &Kephra::App::Dialog::Notify::file_changed;
-#}
-#sub notify_file_deleted {
-	#require Kephra::App::Dialog::Notify; &Kephra::App::Dialog::Notify::file_deleted;
-#}
-#sub save_on_exit {
-	#require Kephra::App::Dialog::Exit; &Kephra::App::Dialog::Exit::save_on_exit;
-#}
-
-
-1;

File lib/Kephra/App/Dialog/About.pm

-use strict;
-use warnings;
-use Wx;
-use Kephra::App::Panel;
-
-package Kephra::App::Dialog::About;
-my $cache;
-
-sub create {
-	return $cache if defined $cache;
-	my $dialog = $cache = Wx::Dialog->new(
-		Kephra::App::Dialog::_parent(shift), -1,
-		'About '.$Kephra::NAME . ' '.$Kephra::VERSION , [-1,-1], [800,600]
-	);
-
-	# change later to toolbook
-	my $book = Wx::Listbook->new($dialog, -1, [-1, -1], [-1, -1], &Wx::wxBK_DEFAULT);
-	my (%panel, %sizer);
-	for my $label (qw(program components contributors)){
-		$sizer{$label} = Wx::BoxSizer->new( &Wx::wxVERTICAL );
-		$panel{$label} = Wx::Panel->new($dialog, -1);
-		$panel{$label}->SetSizer($sizer{$label});
-		$book->AddPage($panel{$label}, ' '.ucfirst $label.' ', 1, 0);
-	}
-
-	my $std_pos = &Wx::wxALIGN_CENTER | &Wx::wxLEFT | &Wx::wxTOP;
-	my @s_params = (0, $std_pos, 10);
-	$sizer{'program'}->AddSpacer(10);
-	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'this program is developed to empower the user and to function as it feels to be right'), 0, $std_pos, 10 );
-	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'it also aims to be beautiful, consistent and evolving'), 0, $std_pos, 10 );
-	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'in an ever changing world a program should connect easy to other software'), 0, $std_pos, 10 );
-	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'it also should support the user in his learning'), 0, $std_pos, 10 );
-	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'at the bottom writing and especially programming is handling and organizing information'), 0, $std_pos, 10 );
-	$sizer{'program'}->AddStretchSpacer(1);
-	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'licensed under the GPL version 2'), 0, $std_pos, 10 );
-	$sizer{'program'}->AddStretchSpacer(1);
-	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'dedicated to all who ever tried to write an editor'), 0, $std_pos, 10 );
-	$sizer{'program'}->AddStretchSpacer(1);
-
-	use Alien::wxWidgets;
-	#scintilla version mapping
-	#'2.4.2' '1.54'}
-	#'2.6.2' '1.62'}
-	#'2.6.3' '1.62'}
-	#'2.8.4' '1.70'}
-	#'2.8.7' '1.70'}
-	#'2.8.10''1.70'}
-	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Perl  '.$^V), 0, $std_pos, 10 );
-	$sizer{'components'}->AddSpacer(10);
-	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Wx  '.$Wx::VERSION), 0, $std_pos, 10 );
-	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Alien::wxWidgets  '.Alien::wxWidgets->version), 0, $std_pos, 10 );
-	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, &Wx::wxVERSION_STRING), 0, $std_pos, 10 );
-	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Wx::Perl::ProcessStream  '.$Wx::Perl::ProcessStream::VERSION), 0, $std_pos, 10 );
-	$sizer{'components'}->AddSpacer(10);
-	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'YAML  '.$YAML::VERSION), 0, $std_pos, 10 );
-	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'File::UserConfig  '.$File::UserConfig::VERSION), 0, $std_pos, 10 );
-	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Moo  '.$Moo::VERSION), 0, $std_pos, 10 );
-
-	$sizer{'contributors'}->AddSpacer(10);
-	$sizer{'contributors'}->Add( Wx::StaticText->new($panel{'contributors'}, -1, 'Written mostly by Herbert Breunung'), 0, $std_pos, 10 );
-	$sizer{'contributors'}->Add( Wx::StaticText->new($panel{'contributors'}, -1, 'CPAN ID: Lichkind'), 0, $std_pos, 10 );
-
-	$book->SetSelection(0);
-
-	my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );
-	$sizer->Add($book, 1, &Wx::wxGROW, 0);
-	$dialog->SetSizer($sizer);
-
-
-	$dialog;
-}
-
-1;

File lib/Kephra/App/Dialog/Base.pm

Empty file removed.

File lib/Kephra/App/Dialog/Config.pm

-use strict;
-use warnings;
-use Wx;
-
-package Kephra::App::Dialog::Config;
-my $cache;
-
-sub create {
-	return $cache if defined $cache;
-	my $dialog = $cache = Wx::Dialog->new(
-		Kephra::App::Dialog::_parent(shift), -1,
-		$Kephra::NAME . ' '.$Kephra::VERSION .' Configuration', [-1,-1], [800,600]
-	);
-	my %node;
-	my $tree = Wx::Treebook->new($dialog, -1);
-	$tree->AddPage(Wx::Panel->new($dialog, -1), 'General');
-	$tree->AddPage(Wx::Panel->new($dialog, -1), 'File');
-	$tree->AddSubPage(Wx::Panel->new($dialog, -1), 'Open');
-	$tree->AddSubPage(Wx::Panel->new($dialog, -1), 'Close');
-	$tree->AddSubPage(Wx::Panel->new($dialog, -1), 'Session');
-	$tree->AddPage(Wx::Panel->new($dialog, -1), 'Editor');
-	$tree->AddPage(Wx::Panel->new($dialog, -1), 'Syntaxmode');
-	$tree->AddSubPage(Wx::Panel->new($dialog, -1), 'Perl');
-	$tree->AddPage(Wx::Panel->new($dialog, -1), 'IOUnit');
-	$tree->AddPage(Wx::Panel->new($dialog, -1), 'FileBrowser');
-	$tree->AddPage(Wx::Panel->new($dialog, -1), 'TreeLib');
-	$tree->AddPage(Wx::Panel->new($dialog, -1), 'Plugin');
-	$tree->ExpandNode($_, 1) for 1..9;
-
-	my @button_label = qw(Accept Cancel); # from left to right
-	my %button;
-	$button{lc $_} = Wx::Button->new( $dialog, -1, $_ ) for @button_label;
-	my $keysizer = Wx::BoxSizer->new( &Wx::wxHORIZONTAL );
-	$keysizer->AddStretchSpacer();
-	$keysizer->Add($button{lc($_)}, 0, &Wx::wxGROW | &Wx::wxALL, 10) for @button_label;
-	my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );
-	$sizer->Add($tree, 1, &Wx::wxGROW, 0);
-	$sizer->Add(Wx::StaticLine->new($dialog, -1, [-1,-1], [-1,2]), 0, &Wx::wxTOP | &Wx::wxGROW, 10);
-	$sizer->Add($keysizer, 0, &Wx::wxGROW, 0);
-	$dialog->SetSizer($sizer);
-
-	Wx::Event::EVT_BUTTON($dialog, $button{'accept'}, sub {
-		$dialog->EndModal(0);
-	});
-	Wx::Event::EVT_BUTTON($dialog, $button{'cancel'}, sub {
-		$dialog->EndModal(0);
-	});
-
-	$dialog;
-}
-
-1;

File lib/Kephra/App/Dialog/Documentation.pm

-use strict;
-use warnings;
-
-use Wx;
-
-package Kephra::App::Dialog::Documentation;
-my $cache;
-
-sub create {
-	return $cache if defined $cache;
-	my $dialog = $cache = Wx::Dialog->new(
-		Kephra::App::Dialog::_parent(shift), -1,
-		$Kephra::NAME . ' '.$Kephra::VERSION .' User Guide and Documentation',
-		[-1, -1],[800, 600],
-	);
-	$dialog;
-}
-
-1;

File lib/Kephra/App/Dialog/Keymap.pm

-use strict;
-use warnings;
-
-use Wx;
-use Kephra::CommandList;
-
-package Kephra::App::Dialog::Keymap;
-my $cache;
-
-sub create {
-	return $cache if defined $cache;
-	my $dialog = $cache = Wx::Dialog->new(
-		Kephra::App::Dialog::_parent(shift), -1,
-		$Kephra::NAME . ' '.$Kephra::VERSION .' Keymap Settings', [-1,-1], [800,600]
-	);
-	my $list = Wx::ListCtrl->new(
-		$dialog, -1,  &Wx::wxDefaultPosition, &Wx::wxDefaultSize, &Wx::wxLC_REPORT 
-	);
-	my $col;
-	my $data = Kephra::CommandList::_raw();
-	$list->InsertColumn($col++, $_) for qw(Command Keys Help);
-	$list->SetColumnWidth(0, 200);
-	$list->SetColumnWidth(1, 140);
-	$list->SetColumnWidth(2, 540);
-	my $row;
-	for (sort keys %$data){
-		my $iid = $list->InsertImageStringItem( $row++, $_, 0 ); # imd 3rd index
-		$list->SetItem( $iid, 1, $data->{$_}{keys}, 0) if $data->{$_}{keys};
-		$list->SetItem( $iid, 2, $data->{$_}{help}, 0) if $data->{$_}{help};
-	}
-
-	my @button_label = qw(Accept Cancel); # from left to right
-	my %button;
-	$button{lc $_} = Wx::Button->new( $dialog, -1, $_ ) for @button_label;
-	my $keysizer = Wx::BoxSizer->new( &Wx::wxHORIZONTAL );
-	$keysizer->AddStretchSpacer();
-	$keysizer->Add($button{lc($_)}, 0, &Wx::wxGROW | &Wx::wxALL, 10) for @button_label;
-	my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );
-	$sizer->Add($list, 1, &Wx::wxGROW, 0);
-	$sizer->Add($keysizer, 0, &Wx::wxGROW, 0);
-	$dialog->SetSizer($sizer);
-
-	Wx::Event::EVT_LIST_COL_CLICK($list, -1, sub {
-		my ($list, $ev) = @_;
-		#$_[1]->GetColumn;
-	});
-	Wx::Event::EVT_BUTTON($dialog, $button{'accept'}, sub {
-		$dialog->EndModal(0);
-	});
-	Wx::Event::EVT_BUTTON($dialog, $button{'cancel'}, sub {
-		$dialog->EndModal(0);
-	});
-
-	$dialog;
-}
-
-1;

File lib/Kephra/App/Editor.pm

-use v5.12;
-use warnings;
-use Wx;
-use Wx::STC;
-use Kephra::API;
-use Kephra::App::Editor::TextDropTarget;
-
-
-package Kephra::App::Editor;
-our @ISA = 'Wx::StyledTextCtrl';
-#our @ISA = 'Wx::ScintillaTextCtrl';
-use Kephra::App::Util qw(create_color);
-
-
-sub new {
-	my( $class, $parent, $style) = @_;
-	my $self = $class->SUPER::new($parent, -1);
-	$self->load_font();  # before setting highlighting
-	$self->set_perlhighlight();
-	$self->set_colors(); # after highlight
-	$self->set_margin();
-	$self->mount_events();
-	$self->set_tab_size(4);
-	$self->set_tab_usage(1);
-	$self->SetScrollWidth(300);
-	return $self;
-}
-
-sub is_empty { not shift->GetTextLength }
-
-sub mount_events {
-	my ($self, @which) = @_;
-	$self->DragAcceptFiles(1) if $^O eq 'MSWin32'; # enable drop files on win
-	$self->SetDropTarget( Kephra::App::Editor::TextDropTarget->new($self) );
-
-	Wx::Event::EVT_STC_CHANGE       ($self, -1, sub {
-		my ($ed, $event) = @_;
-		$ed->{'change_pos'} = $ed->GetCurrentPos;
-		$event->Skip;
-	} );
-	
-	Wx::Event::EVT_KEY_DOWN ($self, sub {
-		my ($ed, $event) = @_;
-		my $key = Kephra::API::KeyMap::keycode_from_event($event);
-		#Kephra::API::log("pressed key $key inside the editor");
-		if (Kephra::API::KeyMap::keycode_is_registered($key)){
-			my $cmd = Kephra::API::KeyMap::cmd_from_keycode($key);
-			#say $cmd;
-			#Kephra::API::log("run command: $cmd");
-			Kephra::API::Command::run( $cmd );
-		}
-		else {$event->Skip}
-		#elsif ($key ==  &Wx::WXK_PAGEUP + 2000){$output_book->AdvanceSelection(0)}
-		#elsif ($key ==  ord('Q')        + 4000){Kephra::API::app()->close_save }
-	});
-	#Wx::Event::EVT_RIGHT_DOWN
-	#Wx::Event::EVT_STC_UPDATEUI
-	Wx::Event::EVT_STC_SAVEPOINTREACHED
-		($self, -1, sub { Kephra::App::Part::Editor::refresh_doc_label() });
-	Wx::Event::EVT_STC_SAVEPOINTLEFT
-		($self, -1, sub { Kephra::App::Part::Editor::refresh_doc_label() });
-	Wx::Event::EVT_SET_FOCUS( $self, sub {
-		my ($ed, $event ) = @_;
-		$event->Skip;
-		Kephra::App::Part::Editor::select_docbar( $ed->GetParent->GetParent );
-	});
-	#Wx::Event::EVT_DROP_FILES       ($ep, sub{});
-	#Wx::Event::EVT_STC_START_DRAG   ($ep, -1, sub {
-	#Wx::Event::EVT_STC_DRAG_OVER    ($ep, -1, sub { $droppos = $_[1]->GetPosition });
-	#Wx::Event::EVT_STC_DO_DROP   
-	$self;
-}
-sub unmount_events {
-	my ($self) = @_;
-	Wx::Event::EVT_STC_CHANGE($self, -1, sub { } );
-	Wx::Event::EVT_KEY_DOWN($self, sub { $_[1]->Skip });
-	#Wx::Event::EVT_RIGHT_DOWN
-	#Wx::Event::EVT_STC_UPDATEUI
-	Wx::Event::EVT_STC_SAVEPOINTREACHED($self, -1, sub { });
-	Wx::Event::EVT_STC_SAVEPOINTLEFT($self, -1, sub { });
-	Wx::Event::EVT_SET_FOCUS( $self, sub { });
-	#Wx::Event::EVT_DROP_FILES       ($ep, sub{});
-	#Wx::Event::EVT_STC_START_DRAG   ($ep, -1, sub {
-	#Wx::Event::EVT_STC_DRAG_OVER    ($ep, -1, sub { $droppos = $_[1]->GetPosition });
-	#Wx::Event::EVT_STC_DO_DROP   
-	$self;
-}
-
-sub set_margin {
-	my ($self, $style) = @_;
-
-	if (not defined $style or not $style or $style eq 'default') {
-		$self->SetMarginType( 0, &Wx::wxSTC_MARGIN_SYMBOL );
-		$self->SetMarginType( 1, &Wx::wxSTC_MARGIN_NUMBER );
-		$self->SetMarginType( 2, &Wx::wxSTC_MARGIN_SYMBOL );
-		$self->SetMarginMask( 0, 0x01FFFFFF );
-		$self->SetMarginMask( 1, 0 );
-		$self->SetMarginMask( 2, &Wx::wxSTC_MASK_FOLDERS );
-		$self->SetMarginSensitive( 0, 1 );
-		$self->SetMarginSensitive( 1, 1 );
-		$self->SetMarginSensitive( 2, 1 );
-		$self->StyleSetForeground(&Wx::wxSTC_STYLE_LINENUMBER, create_color(123,123,137));
-		$self->StyleSetBackground(&Wx::wxSTC_STYLE_LINENUMBER, create_color(226,226,222));
-		$self->SetMarginWidth(0,  0);
-		$self->SetMarginWidth(1, 31);
-		$self->SetMarginWidth(2,  0);
-		# extra text margin
-	}
-	elsif ($style eq 'no') { $self->SetMarginWidth($_, 0) for 1..3 }
-
-	# extra margin left and right inside the white text area
-	$self->SetMargins(2, 2);
-	$self;
-}
-
-sub insert_text {
-	my ($self, $text, $pos) = @_;
-	$pos = $self->GetCurrentPos unless defined $pos;
-	$self->InsertText($pos, $text);
-}
-
-sub set_tab_size {
-	my ($self, $size) = @_;
-	$self->SetTabWidth($size);
-	$self->SetIndent($size);
-	$self->SetHighlightGuide($size);
-}
-sub set_tab_usage {
-	my ($self, $usage) = @_;
-	$self->SetUseTabs($usage);
-}
-
-sub set_colors {
-	my $self = shift;
-	$self->SetCaretLineBack( create_color(250,245,185) );
-	#$self->SetCaretPeriod( 500 );
-	#$self->SetCaretWidth( 2 );
-	$self->SetCaretForeground( create_color(0,0,255) );
-	$self->SetCaretLineVisible(1);
-	$self->SetSelForeground( 1, create_color(243,243,243) );
-	$self->SetSelBackground( 1, create_color(0, 17, 119) );
-	$self->SetWhitespaceForeground( 1, create_color(204, 204, 153) );
-	$self->SetViewWhiteSpace(1);
-
-	$self->SetEdgeColour( create_color(200,200,255) );
-	$self->SetEdgeColumn( 80 );
-	$self->SetEdgeMode( &Wx::wxSTC_EDGE_LINE );
-}
-
-sub load_font {
-	my ($self, $font) = @_;
-	my ( $fontweight, $fontstyle ) = ( &Wx::wxNORMAL, &Wx::wxNORMAL );
-	$font = {
-		#family => 'Courier New', # old default
-		family => 'DejaVu Sans Mono',
-		size => 10,
-		style => 'normal',
-		weight => 'normal',    
-	} unless defined $font;
-	#my $font = _config()->{font};
-	$fontweight = &Wx::wxLIGHT  if $font->{weight} eq 'light';
-	$fontweight = &Wx::wxBOLD   if $font->{weight} eq 'bold';
-	$fontstyle  = &Wx::wxSLANT  if $font->{style}  eq 'slant';
-	$fontstyle  = &Wx::wxITALIC if $font->{style}  eq 'italic';
-	my $wx_font = Wx::Font->new( 
-		$font->{size}, &Wx::wxDEFAULT, $fontstyle, $fontweight, 0, $font->{family}
-	);
-	$self->StyleSetFont( &Wx::wxSTC_STYLE_DEFAULT, $wx_font ) if $wx_font->Ok > 0;
-}
-
-sub focus {  Kephra::API::focus( $_[0] ) }
-
-sub set_perlhighlight {
-	my ($self) = @_;
-	$self->StyleClearAll;
-	$self->SetLexer( &Wx::wxSTC_LEX_PERL );         # Set Lexers to use
-	$self->SetKeyWords(0, 'NULL 
-__FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ __WARN__ __DIE__
-AUTOLOAD BEGIN CHECK CORE DESTROY END EQ GE GT INIT LE LT NE UNITCHECK 
-abs accept alarm and atan2 bind binmode bless break
-caller chdir chmod chomp chop chown chr chroot close closedir cmp connect
-continue cos crypt
-dbmclose dbmopen default defined delete die do dump
-each else elsif endgrent endhostent endnetent endprotoent endpwent endservent