Cadabra
Computer algebra system for field theory problems
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cadabra::Console Class Reference

#include <Console.hh>

Inheritance diagram for cadabra::Console:

Classes

class  TextViewProxy
 

Public Types

enum class  Position : int { Hidden =0 , DockedH =1 , DockedV =2 , Floating =3 }
 

Public Member Functions

 Console (sigc::slot< void > run_slot)
 
void initialize ()
 
void send_input (const std::string &code)
 
std::string grab_input (uint64_t &id)
 
void signal_message (const nlohmann::json &msg)
 
void scroll_to_bottom ()
 

Private Member Functions

void set_input (const Glib::ustring &line, size_t range_start=std::string::npos, size_t range_end=std::string::npos)
 
void prompt (bool continuation, bool newline=false)
 
void create_cell (uint64_t parent_id, uint64_t cell_id)
 
uint64_t get_server_cell ()
 
void insert_text (uint64_t cell_id, const std::string &text, const Glib::RefPtr< Gtk::TextTag > &tag)
 
void insert_graphic (uint64_t cell_id, const std::string &bytes)
 
void insert_tex (uint64_t cell_id, const std::shared_ptr< TeXEngine::TeXRequest > &content)
 
void process_message_queue ()
 
virtual bool on_configure_event (GdkEventConfigure *cfg) override
 

Private Attributes

Glib::Dispatcher dispatch_message
 
Glib::Dispatcher run
 
bool needs_focus
 
Glib::RefPtr< Gtk::TextBuffer > buffer
 
std::string collect
 
std::queue< nlohmann::json > message_queue
 
std::queue< std::pair< std::string, Glib::RefPtr< Gtk::TextMark > > > run_queue
 
TeXEngine tex_engine
 
std::map< uint64_t, Glib::RefPtr< Gtk::TextMark > > cells
 
uint64_t server_cell_id
 
Glib::RefPtr< Gtk::TextMark > input_begin
 
Glib::RefPtr< Gtk::TextMark > prompt_begin
 
Glib::RefPtr< Gtk::TextTag > prompt_tag
 
Glib::RefPtr< Gtk::TextTag > input_tag
 
Glib::RefPtr< Gtk::TextTag > output_tag
 
Glib::RefPtr< Gtk::TextTag > warning_tag
 
Glib::RefPtr< Gtk::TextTag > error_tag
 
TextViewProxy input
 
Gtk::TextView tv
 
Gtk::ScrolledWindow win
 

Member Enumeration Documentation

◆ Position

enum cadabra::Console::Position : int
strong
Enumerator
Hidden 
DockedH 
DockedV 
Floating 

Constructor & Destructor Documentation

◆ Console()

Console::Console ( sigc::slot< void >  run_slot)

Member Function Documentation

◆ create_cell()

void Console::create_cell ( uint64_t  parent_id,
uint64_t  cell_id 
)
private

◆ get_server_cell()

uint64_t Console::get_server_cell ( )
private

◆ grab_input()

std::string Console::grab_input ( uint64_t &  id)

◆ initialize()

void Console::initialize ( )

◆ insert_graphic()

void Console::insert_graphic ( uint64_t  cell_id,
const std::string &  bytes 
)
private

◆ insert_tex()

void Console::insert_tex ( uint64_t  cell_id,
const std::shared_ptr< TeXEngine::TeXRequest > &  content 
)
private

◆ insert_text()

void Console::insert_text ( uint64_t  cell_id,
const std::string &  text,
const Glib::RefPtr< Gtk::TextTag > &  tag 
)
private

◆ on_configure_event()

bool Console::on_configure_event ( GdkEventConfigure *  cfg)
overrideprivatevirtual

◆ process_message_queue()

void Console::process_message_queue ( )
private

◆ prompt()

void Console::prompt ( bool  continuation,
bool  newline = false 
)
private

◆ scroll_to_bottom()

void Console::scroll_to_bottom ( )

◆ send_input()

void Console::send_input ( const std::string &  code)

◆ set_input()

void Console::set_input ( const Glib::ustring &  line,
size_t  range_start = std::string::npos,
size_t  range_end = std::string::npos 
)
private

◆ signal_message()

void Console::signal_message ( const nlohmann::json &  msg)

Member Data Documentation

◆ buffer

Glib::RefPtr<Gtk::TextBuffer> cadabra::Console::buffer
private

◆ cells

std::map<uint64_t, Glib::RefPtr<Gtk::TextMark> > cadabra::Console::cells
private

◆ collect

std::string cadabra::Console::collect
private

◆ dispatch_message

Glib::Dispatcher cadabra::Console::dispatch_message
private

◆ error_tag

Glib::RefPtr<Gtk::TextTag> cadabra::Console::error_tag
private

◆ input

TextViewProxy cadabra::Console::input
private

◆ input_begin

Glib::RefPtr<Gtk::TextMark> cadabra::Console::input_begin
private

◆ input_tag

Glib::RefPtr<Gtk::TextTag> cadabra::Console::input_tag
private

◆ message_queue

std::queue<nlohmann::json> cadabra::Console::message_queue
private

◆ needs_focus

bool cadabra::Console::needs_focus
private

◆ output_tag

Glib::RefPtr<Gtk::TextTag> cadabra::Console::output_tag
private

◆ prompt_begin

Glib::RefPtr<Gtk::TextMark> cadabra::Console::prompt_begin
private

◆ prompt_tag

Glib::RefPtr<Gtk::TextTag> cadabra::Console::prompt_tag
private

◆ run

Glib::Dispatcher cadabra::Console::run
private

◆ run_queue

std::queue<std::pair<std::string, Glib::RefPtr<Gtk::TextMark> > > cadabra::Console::run_queue
private

◆ server_cell_id

uint64_t cadabra::Console::server_cell_id
private

◆ tex_engine

TeXEngine cadabra::Console::tex_engine
private

◆ tv

Gtk::TextView cadabra::Console::tv
private

◆ warning_tag

Glib::RefPtr<Gtk::TextTag> cadabra::Console::warning_tag
private

◆ win

Gtk::ScrolledWindow cadabra::Console::win
private

The documentation for this class was generated from the following files: