1. Herbert Breunung
  2. Kephra

Commits

Herbert Breunung  committed 8429936

making first demo work

  • Participants
  • Parent commits f506c46
  • Branches sp3

Comments (0)

Files changed (5)

File lib/Kephra.pm

View file
  • Ignore whitespace
+package Kephra;
+
+our $VERSION = '0.4.5';
+
+1;

File lib/Kephra/API/KeyMap.pm

View file
  • Ignore whitespace
+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, plus => 43, minus => 45, sharp => 47, 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.pm

View file
  • Ignore whitespace
+use v5.12;
+use warnings;
+use Wx;
+
+package Kephra::App;
+use base qw(Wx::App);
+use Kephra::App::Editor;
+
+sub OnInit {
+	my $app   = shift;
+	my $frame = Wx::Frame->new( undef, &Wx::wxDEFAULT, 'Kephra SP3');
+	my $ed = Kephra::App::Editor->new($frame, -1);
+	Wx::Window::SetFocus( $ed );
+
+	$frame->Show(1);
+	$app->SetTopWindow($frame);
+	1;
+}
+
+1;

File lib/Kephra/App/Editor.pm

View file
  • Ignore whitespace
+use v5.12;
+use warnings;
+
+package Kephra::App::Editor;
+our @ISA = 'Wx::StyledTextCtrl';
+use Wx;
+use Wx::STC;
+use Wx::DND;
+#use Wx::Scintilla;
+
+sub new {
+	my( $class, $parent, $style) = @_;
+	my $self = $class->SUPER::new($parent, -1,[-1,-1],[-1,-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 create_color {
+	my ($r, $g, $b) = @_;
+	Wx::Colour->new(@_);
+}
+
+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);
+			#Kephra::API::log("run command: $cmd");
+			#Kephra::API::Command::run( $cmd );
+			#$ed->GetStyleAt($ed->GetCurrentPos);
+		#} else {
+		$event->Skip
+		#}
+	});
+	#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   
+}
+
+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 is_empty { not shift->GetTextLength }
+
+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 
+eof eq eval exec exists exit exp 
+fcntl fileno flock for foreach fork format formline 
+ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent 
+getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid 
+getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam 
+getpwuid getservbyname getservbyport getservent getsockname getsockopt given 
+glob gmtime goto grep gt 
+hex if index int ioctl join keys kill 
+last lc lcfirst le length link listen local localtime lock log lstat lt 
+m map mkdir msgctl msgget msgrcv msgsnd my ne next no not 
+oct open opendir or ord our pack package pipe pop pos print printf prototype push 
+q qq qr quotemeta qu qw qx 
+rand read readdir readline readlink readpipe recv redo ref rename require reset 
+return reverse rewinddir rindex rmdir
+s say scalar seek seekdir select semctl semget semop send setgrent sethostent 
+setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift 
+shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice 
+split sprintf sqrt srand stat state study sub substr symlink syscall sysopen 
+sysread sysseek system syswrite 
+tell telldir tie tied time times tr truncate
+uc ucfirst umask undef unless unlink unpack unshift untie until use utime 
+values vec wait waitpid wantarray warn when while write x xor y');
+# Add new keyword.
+# $_[0]->StyleSetSpec( &Wx::wxSTC_H_TAG, "fore:#000055" ); # Apply tag style for selected lexer (blue)
+
+	 $self->StyleSetSpec(1,"fore:#ff0000");                                     # Error
+	 $self->StyleSetSpec(2,"fore:#aaaaaa");                                     # Comment
+	 $self->StyleSetSpec(3,"fore:#004000,back:#E0FFE0,$(font.text),eolfilled"); # POD: = at beginning of line
+	 $self->StyleSetSpec(&Wx::wxSTC_PL_NUMBER,"fore:#007f7f");                                     # Number
+	 $self->StyleSetSpec(5,"fore:#000077,bold");                                # Keywords
+	 $self->StyleSetSpec(6,"fore:#ee7b00,back:#fff8f8");                        # Doublequoted string
+	 $self->StyleSetSpec(7,"fore:#f36600,back:#fffcff");                        # Single quoted string
+	 $self->StyleSetSpec(8,"fore:#555555");                                     # Symbols / Punctuation. Currently not used by LexPerl.
+	 $self->StyleSetSpec(9,"");                                                 # Preprocessor. Currently not used by LexPerl.
+	 $self->StyleSetSpec(10,"fore:#002200");                                    # Operators
+	 $self->StyleSetSpec(11,"fore:#3355bb");                                    # Identifiers (functions, etc.)
+	 $self->StyleSetSpec(12,"fore:#228822");                                    # Scalars: $var
+	 $self->StyleSetSpec(13,"fore:#339933");                                    # Array: @var
+	 $self->StyleSetSpec(14,"fore:#44aa44");                                    # Hash: %var
+	 $self->StyleSetSpec(15,"fore:#55bb55");                                    # Symbol table: *var
+	 $self->StyleSetSpec(17,"fore:#000000,back:#A0FFA0");                       # Regex: /re/ or m{re}
+	 $self->StyleSetSpec(18,"fore:#000000,back:#F0E080");                       # Substitution: s/re/ore/
+	 $self->StyleSetSpec(19,"fore:#000000,back:#8080A0");                       # Long Quote (qq, qr, qw, qx) -- obsolete: replaced by qq, qx, qr, qw
+	 $self->StyleSetSpec(20,"fore:#ff7700,back:#f9f9d7");                       # Back Ticks
+	 $self->StyleSetSpec(21,"fore:#600000,back:#FFF0D8,eolfilled");             # Data Section: __DATA__ or __END__ at beginning of line
+	 $self->StyleSetSpec(22,"fore:#000000,back:#DDD0DD");                       # Here-doc (delimiter)
+	 $self->StyleSetSpec(23,"fore:#7F007F,back:#DDD0DD,eolfilled,notbold");     # Here-doc (single quoted, q)
+	 $self->StyleSetSpec(24,"fore:#7F007F,back:#DDD0DD,eolfilled,bold");        # Here-doc (double quoted, qq)
+	 $self->StyleSetSpec(25,"fore:#7F007F,back:#DDD0DD,eolfilled,italics");     # Here-doc (back ticks, qx)
+	 $self->StyleSetSpec(26,"fore:#7F007F,$(font.monospace),notbold");          # Single quoted string, generic 
+	 $self->StyleSetSpec(27,"fore:#ee7b00,back:#fff8f8");                       # qq = Double quoted string
+	 $self->StyleSetSpec(28,"fore:#ff7700,back:#f9f9d7");                       # qx = Back ticks
+	 $self->StyleSetSpec(29,"fore:#000000,back:#A0FFA0");                       # qr = Regex
+	 $self->StyleSetSpec(30,"fore:#f36600,back:#fff8f8");                       # qw = Array
+}
+
+1;
+
+__END__
+
+$self->SetIndicatorCurrent( $c);
+$self->IndicatorFillRange( $start, $len );
+$self->IndicatorClearRange( 0, $len )
+	#Wx::Event::EVT_STC_STYLENEEDED($self, sub{}) 
+	#Wx::Event::EVT_STC_CHARADDED($self, sub {});
+	#Wx::Event::EVT_STC_ROMODIFYATTEMPT($self, sub{}) 
+	#Wx::Event::EVT_STC_KEY($self, sub{}) 
+	#Wx::Event::EVT_STC_DOUBLECLICK($self, sub{}) 
+	Wx::Event::EVT_STC_UPDATEUI($self, -1, sub { 
+		#my ($ed, $event) = @_; $event->Skip; print "change \n"; 
+	});
+	#Wx::Event::EVT_STC_MODIFIED($self, sub {});
+	#Wx::Event::EVT_STC_MACRORECORD($self, sub{}) 
+	#Wx::Event::EVT_STC_MARGINCLICK($self, sub{}) 
+	#Wx::Event::EVT_STC_NEEDSHOWN($self, sub {});
+	#Wx::Event::EVT_STC_PAINTED($self, sub{}) 
+	#Wx::Event::EVT_STC_USERLISTSELECTION($self, sub{}) 
+	#Wx::Event::EVT_STC_UR$selfROPPED($self, sub {});
+	#Wx::Event::EVT_STC_DWELLSTART($self, sub{}) 
+	#Wx::Event::EVT_STC_DWELLEND($self, sub{}) 
+	#Wx::Event::EVT_STC_START_DRAG($self, sub{}) 
+	#Wx::Event::EVT_STC_DRAG_OVER($self, sub{}) 
+	#Wx::Event::EVT_STC_DO_DROP($self, sub {});
+	#Wx::Event::EVT_STC_ZOOM($self, sub{}) 
+	#Wx::Event::EVT_STC_HOTSPOT_CLICK($self, sub{}) 
+	#Wx::Event::EVT_STC_HOTSPOT_DCLICK($self, sub{}) 
+	#Wx::Event::EVT_STC_CALLTIP_CLICK($self, sub{}) 
+	#Wx::Event::EVT_STC_AUTOCOMP_SELECTION($self, sub{})
+	#$self->SetAcceleratorTable( Wx::AcceleratorTable->new() );
+	#Wx::Event::EVT_MENU( $self, 1000, sub { $_[1]->Skip; } );
+	#Wx::Event::EVT_STC_SAVEPOINTREACHED($self, -1, \&Kephra::File::savepoint_reached);
+	#Wx::Event::EVT_STC_SAVEPOINTLEFT($self, -1, \&Kephra::File::savepoint_left);
+	$self->SetAcceleratorTable(
+		Wx::AcceleratorTable->new(
+			[&Wx::wxACCEL_CTRL, ord 'n', 1000],
+	));

File lib/kephra.pl

View file
  • Ignore whitespace
 use v5.12;
 use warnings;
 
-package ServusWelt;
-use Wx qw/ :everything /;
-use base qw(Wx::App);
-use Wx::STC;
-use Wx::DND;
-#use Wx::Scintilla;
+unshift @INC, '.';
+require Kephra;
+require Kephra::App;
+Kephra::App->new->MainLoop;
 
-sub OnInit {
-	my $app   = shift;
-	my $frame = Wx::Frame->new( undef, wxDEFAULT, 'Servus Welt');
-	my $ed = Kephra::App::Editor->new($frame, -1);
-	Wx::Window::SetFocus( $ed );
-
-	$frame->Show(1);
-	$app->SetTopWindow($frame);             # Fenster als oberstes bestimmen
-	1;
-}
-
-package Kephra::App::Editor;
-our @ISA = 'Wx::StyledTextCtrl';
-
-sub new {
-	my( $class, $parent, $style) = @_;
-	my $self = $class->SUPER::new($parent, -1,[-1,-1],[-1,-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 create_color {
-	my ($r, $g, $b) = @_;
-	Wx::Colour->new(@_);
-}
-
-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);
-			#Kephra::API::log("run command: $cmd");
-			#Kephra::API::Command::run( $cmd );
-			#$ed->GetStyleAt($ed->GetCurrentPos);
-		#} else {
-		$event->Skip
-		#}
-	});
-	#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   
-}
-
-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 is_empty { not shift->GetTextLength }
-
-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 
-eof eq eval exec exists exit exp 
-fcntl fileno flock for foreach fork format formline 
-ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent 
-getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid 
-getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam 
-getpwuid getservbyname getservbyport getservent getsockname getsockopt given 
-glob gmtime goto grep gt 
-hex if index int ioctl join keys kill 
-last lc lcfirst le length link listen local localtime lock log lstat lt 
-m map mkdir msgctl msgget msgrcv msgsnd my ne next no not 
-oct open opendir or ord our pack package pipe pop pos print printf prototype push 
-q qq qr quotemeta qu qw qx 
-rand read readdir readline readlink readpipe recv redo ref rename require reset 
-return reverse rewinddir rindex rmdir
-s say scalar seek seekdir select semctl semget semop send setgrent sethostent 
-setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift 
-shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice 
-split sprintf sqrt srand stat state study sub substr symlink syscall sysopen 
-sysread sysseek system syswrite 
-tell telldir tie tied time times tr truncate
-uc ucfirst umask undef unless unlink unpack unshift untie until use utime 
-values vec wait waitpid wantarray warn when while write x xor y');
-# Add new keyword.
-# $_[0]->StyleSetSpec( &Wx::wxSTC_H_TAG, "fore:#000055" ); # Apply tag style for selected lexer (blue)
-
-	 $self->StyleSetSpec(1,"fore:#ff0000");                                     # Error
-	 $self->StyleSetSpec(2,"fore:#aaaaaa");                                     # Comment
-	 $self->StyleSetSpec(3,"fore:#004000,back:#E0FFE0,$(font.text),eolfilled"); # POD: = at beginning of line
-	 $self->StyleSetSpec(&Wx::wxSTC_PL_NUMBER,"fore:#007f7f");                                     # Number
-	 $self->StyleSetSpec(5,"fore:#000077,bold");                                # Keywords
-	 $self->StyleSetSpec(6,"fore:#ee7b00,back:#fff8f8");                        # Doublequoted string
-	 $self->StyleSetSpec(7,"fore:#f36600,back:#fffcff");                        # Single quoted string
-	 $self->StyleSetSpec(8,"fore:#555555");                                     # Symbols / Punctuation. Currently not used by LexPerl.
-	 $self->StyleSetSpec(9,"");                                                 # Preprocessor. Currently not used by LexPerl.
-	 $self->StyleSetSpec(10,"fore:#002200");                                    # Operators
-	 $self->StyleSetSpec(11,"fore:#3355bb");                                    # Identifiers (functions, etc.)
-	 $self->StyleSetSpec(12,"fore:#228822");                                    # Scalars: $var
-	 $self->StyleSetSpec(13,"fore:#339933");                                    # Array: @var
-	 $self->StyleSetSpec(14,"fore:#44aa44");                                    # Hash: %var
-	 $self->StyleSetSpec(15,"fore:#55bb55");                                    # Symbol table: *var
-	 $self->StyleSetSpec(17,"fore:#000000,back:#A0FFA0");                       # Regex: /re/ or m{re}
-	 $self->StyleSetSpec(18,"fore:#000000,back:#F0E080");                       # Substitution: s/re/ore/
-	 $self->StyleSetSpec(19,"fore:#000000,back:#8080A0");                       # Long Quote (qq, qr, qw, qx) -- obsolete: replaced by qq, qx, qr, qw
-	 $self->StyleSetSpec(20,"fore:#ff7700,back:#f9f9d7");                       # Back Ticks
-	 $self->StyleSetSpec(21,"fore:#600000,back:#FFF0D8,eolfilled");             # Data Section: __DATA__ or __END__ at beginning of line
-	 $self->StyleSetSpec(22,"fore:#000000,back:#DDD0DD");                       # Here-doc (delimiter)
-	 $self->StyleSetSpec(23,"fore:#7F007F,back:#DDD0DD,eolfilled,notbold");     # Here-doc (single quoted, q)
-	 $self->StyleSetSpec(24,"fore:#7F007F,back:#DDD0DD,eolfilled,bold");        # Here-doc (double quoted, qq)
-	 $self->StyleSetSpec(25,"fore:#7F007F,back:#DDD0DD,eolfilled,italics");     # Here-doc (back ticks, qx)
-	 $self->StyleSetSpec(26,"fore:#7F007F,$(font.monospace),notbold");          # Single quoted string, generic 
-	 $self->StyleSetSpec(27,"fore:#ee7b00,back:#fff8f8");                       # qq = Double quoted string
-	 $self->StyleSetSpec(28,"fore:#ff7700,back:#f9f9d7");                       # qx = Back ticks
-	 $self->StyleSetSpec(29,"fore:#000000,back:#A0FFA0");                       # qr = Regex
-	 $self->StyleSetSpec(30,"fore:#f36600,back:#fff8f8");                       # qw = Array
-}
-
-
-package main;
-ServusWelt->new->MainLoop;
-
-1;
-
-__END__
-
-$self->SetIndicatorCurrent( $c);
-$self->IndicatorFillRange( $start, $len );
-$self->IndicatorClearRange( 0, $len )
-	#Wx::Event::EVT_STC_STYLENEEDED($self, sub{}) 
-	#Wx::Event::EVT_STC_CHARADDED($self, sub {});
-	#Wx::Event::EVT_STC_ROMODIFYATTEMPT($self, sub{}) 
-	#Wx::Event::EVT_STC_KEY($self, sub{}) 
-	#Wx::Event::EVT_STC_DOUBLECLICK($self, sub{}) 
-	Wx::Event::EVT_STC_UPDATEUI($self, -1, sub { 
-		#my ($ed, $event) = @_; $event->Skip; print "change \n"; 
-	});
-	#Wx::Event::EVT_STC_MODIFIED($self, sub {});
-	#Wx::Event::EVT_STC_MACRORECORD($self, sub{}) 
-	#Wx::Event::EVT_STC_MARGINCLICK($self, sub{}) 
-	#Wx::Event::EVT_STC_NEEDSHOWN($self, sub {});
-	#Wx::Event::EVT_STC_PAINTED($self, sub{}) 
-	#Wx::Event::EVT_STC_USERLISTSELECTION($self, sub{}) 
-	#Wx::Event::EVT_STC_UR$selfROPPED($self, sub {});
-	#Wx::Event::EVT_STC_DWELLSTART($self, sub{}) 
-	#Wx::Event::EVT_STC_DWELLEND($self, sub{}) 
-	#Wx::Event::EVT_STC_START_DRAG($self, sub{}) 
-	#Wx::Event::EVT_STC_DRAG_OVER($self, sub{}) 
-	#Wx::Event::EVT_STC_DO_DROP($self, sub {});
-	#Wx::Event::EVT_STC_ZOOM($self, sub{}) 
-	#Wx::Event::EVT_STC_HOTSPOT_CLICK($self, sub{}) 
-	#Wx::Event::EVT_STC_HOTSPOT_DCLICK($self, sub{}) 
-	#Wx::Event::EVT_STC_CALLTIP_CLICK($self, sub{}) 
-	#Wx::Event::EVT_STC_AUTOCOMP_SELECTION($self, sub{})
-	#$self->SetAcceleratorTable( Wx::AcceleratorTable->new() );
-	#Wx::Event::EVT_MENU( $self, 1000, sub { $_[1]->Skip; } );
-	#Wx::Event::EVT_STC_SAVEPOINTREACHED($self, -1, \&Kephra::File::savepoint_reached);
-	#Wx::Event::EVT_STC_SAVEPOINTLEFT($self, -1, \&Kephra::File::savepoint_left);
-	$self->SetAcceleratorTable(
-		Wx::AcceleratorTable->new(
-			[&Wx::wxACCEL_CTRL, ord 'n', 1000],
-	));
-
-
-