Kephra / lib / Kephra / API.pm

use strict;
use warnings;
use Carp;
use Kephra::App::Window;
use Kephra::Config;
use Kephra::CommandList;
use Kephra::DocumentStash;
use Kephra::EventTable;
use Kephra::KeyMap;
use Kephra::Log;
use Kephra::PluginRegistrar;
use Kephra::SandrumInterpreter;
use Kephra::Worker;


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

Kephra::CommandList::register_switch_var({
	'$app'    => 'app',
	'$win'    => 'main_window',
	'$docbar' => 'docbar',
	'$doc'    => 'document',
	'$ed'     => 'editor',
});

sub app             { $Kephra::App::_ref }
sub main_window     { $Kephra::App::Window::_ref }
sub editor          { Kephra::DocumentStash::active_editor() }
sub docbar          { Kephra::App::Part::Editor::active_docbar() }
sub document        { Kephra::DocumentStash::active_doc() }
sub all_documents   { Kephra::DocumentStash::all_doc() }
sub do_with_all_documents { }

sub focus           { $Kephra::App::Window::_ref->set_focus(@_) }
sub focus_back      { $Kephra::App::Window::_ref->set_focus_back(@_) }

# IO-unit
sub input           { $Kephra::App::Part::IOUnit::_ref->get_line() }
sub output          { $Kephra::App::Part::IOUnit::_ref->output(@_) }
sub log             { $Kephra::App::Part::IOUnit::_ref->output('log', @_) }

sub configs  { }

# event table
sub add_event_callback { }
sub del_event_callback { }
sub trigger_event      { }
sub freeze_event       { }
sub thaw_event         { }


# command list
sub add_command { }
sub del_command { }
sub run_command { }
sub command_status {}

# cmd line lang
sub run_sandrum_commands {}

# 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;
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.