Kephra / lib / Kephra / API.pm

use v5.12;
use warnings;

use Kephra::API::Command;
use Kephra::API::DocumentStash;
use Kephra::API::Event;
use Kephra::API::KeyMap;
#use Kephra::API::Macro;
#use Kephra::API::Plugin;
#use Kephra::API::Sandrum;
use Kephra::App::Focus;

package Kephra::API;
my $VERSION = 0.5;

#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::Window::_ref }
sub docbar              { $Kephra::App::Bar::Document::_ref #Kephra::App::Part::Editor::docbar() 
}
sub all_docbars         { $Kephra::App::Bar::Document::_ref #Kephra::App::Part::Editor::all_docbars()
}
#sub passive_docbars     { Kephra::App::Part::Editor::passive_docbars() }
sub document            { Kephra::API::DocumentStash::active_doc() }
sub all_documents       { Kephra::API::DocumentStash::all_docs() }
#sub do_with_all_editors {&Kephra::API::DocumentStash::do_with_all_editors }
sub editor              { Kephra::API::DocumentStash::active_editor() }

sub focus           { Kephra::App::Focus::set(@_) }
sub focus_back      { Kephra::App::Focus::set_back(@_) }

sub env_obj  { }

# 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 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 {}


1; # if you want to know more, please read Kephra::Internals.pod
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.