GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
event_manager Class Reference

Provides threadsafe access to octave. More...

#include "event-manager.h"

Collaboration diagram for event_manager:

Public Types

typedef std::list< std::pair< std::string, std::string > > filter_list
 

Public Member Functions

 event_manager (const event_manager &)=delete
 
OCTINTERP_API event_manager (interpreter &interp)
 
virtual ~event_manager (void)
 
void append_history (const std::string &hist_entry)
 
bool apply_preferences (void)
 
void clear_history (void)
 
void clear_workspace (void)
 
void close_gui (void)
 
bool confirm_shutdown (void)
 
OCTINTERP_API void connect_link (const std::shared_ptr< interpreter_events > &obj)
 
bool copy_image_to_clipboard (const std::string &file)
 
int debug_cd_or_addpath_error (const std::string &file, const std::string &dir, bool addpath_option)
 
void directory_changed (const std::string &dir)
 
bool disable (void)
 
OCTINTERP_API void discard_events (void)
 
bool display_exception (const execution_exception &ee, bool beep=false)
 
bool edit_file (const std::string &file)
 
bool edit_variable (const std::string &name, const octave_value &val)
 
OCTINTERP_API bool enable (void)
 
bool enabled (void) const
 
void enter_debugger_event (const std::string &fcn_name, const std::string &fcn_file_name, int line)
 
void execute_command_in_terminal (const std::string &command)
 
void execute_in_debugger_event (const std::string &file, int line)
 
void exit_debugger_event (void)
 
std::list< std::string > file_dialog (const filter_list &filter, const std::string &title, const std::string &filename, const std::string &dirname, const std::string &multimode)
 
void file_remove (const std::string &old_name, const std::string &new_name)
 
void file_renamed (bool load_new)
 
virtual void focus_window (const std::string win_name)
 
uint8NDArray get_named_icon (const std::string &icon_name)
 
std::string gui_preference (const std::string &key, const std::string &value)
 
bool gui_status_update (const std::string &feature, const std::string &status)
 
bool have_dialogs (void) const
 
std::list< std::string > input_dialog (const std::list< std::string > &prompt, const std::string &title, const std::list< float > &nr, const std::list< float > &nc, const std::list< std::string > &defaults)
 
void install_qt_event_handlers (const std::shared_ptr< interpreter_events > &obj)
 
void interpreter_interrupted (void)
 
bool interpreter_output (const std::string &msg)
 
std::pair< std::list< int >, int > list_dialog (const std::list< std::string > &list, const std::string &mode, int width, int height, const std::list< int > &initial_value, const std::string &name, const std::list< std::string > &prompt, const std::string &ok_string, const std::string &cancel_string)
 
event_manageroperator= (const event_manager &)=delete
 
void pop_event_queue (void)
 
OCTINTERP_API void post_event (const fcn_callback &fcn)
 
OCTINTERP_API void post_event (const meth_callback &meth)
 
void post_input_event (void)
 
void pre_input_event (void)
 
OCTINTERP_API void process_events (bool disable=false)
 
bool prompt_new_edit_file (const std::string &file)
 
void push_event_queue (void)
 
std::shared_ptr< interpreter_eventsqt_event_handlers (void) const
 
std::string question_dialog (const std::string &msg, const std::string &title, const std::string &btn1, const std::string &btn2, const std::string &btn3, const std::string &btndef)
 
bool register_documentation (const std::string &file)
 
void set_history (const string_vector &hist)
 
OCTINTERP_API void set_history (void)
 
void set_workspace (bool top_level, const symbol_info_list &syminfo, bool update_variable_editor=true)
 
OCTINTERP_API void set_workspace (void)
 
void show_command_history (void)
 
void show_community_news (int serial=-1)
 
bool show_documentation (const std::string &file)
 
void show_file_browser (void)
 
bool show_preferences (void)
 
void show_release_notes (void)
 
void show_terminal_window (void)
 
void show_workspace (void)
 
void start_gui (bool gui_app=false)
 
bool unregister_documentation (const std::string &file)
 
void update_breakpoint (bool insert, const std::string &file, int line, const std::string &cond="")
 
bool update_gui_lexer (void)
 
void update_path_dialog (void)
 
void update_prompt (const std::string &prompt)
 

Protected Attributes

bool m_debugging
 
mutexm_event_queue_mutex
 
std::stack< std::shared_ptr< event_queue > > m_gui_event_queue
 
bool m_link_enabled
 

Private Attributes

std::shared_ptr< interpreter_eventsm_instance
 
interpreterm_interpreter
 
std::shared_ptr< interpreter_eventsm_qt_event_handlers
 

Detailed Description

Provides threadsafe access to octave.

This class provides thread-safe communication between the interpreter and a GUI.

Definition at line 291 of file event-manager.h.

Member Typedef Documentation

◆ filter_list

typedef std::list<std::pair<std::string, std::string> > event_manager::filter_list

Definition at line 392 of file event-manager.h.

Constructor & Destructor Documentation

◆ event_manager() [1/2]

event_manager::event_manager ( interpreter interp)

◆ event_manager() [2/2]

event_manager::event_manager ( const event_manager )
delete

◆ ~event_manager()

event_manager::~event_manager ( void  )
virtual

Definition at line 77 of file event-manager.cc.

References m_event_queue_mutex.

Member Function Documentation

◆ append_history()

void event_manager::append_history ( const std::string &  hist_entry)
inline

◆ apply_preferences()

bool event_manager::apply_preferences ( void  )
inline

Definition at line 462 of file event-manager.h.

Referenced by F__event_manager_apply_preferences__().

◆ clear_history()

void event_manager::clear_history ( void  )
inline

Definition at line 706 of file event-manager.h.

Referenced by history_system::do_history().

◆ clear_workspace()

void event_manager::clear_workspace ( void  )
inline

Definition at line 680 of file event-manager.h.

Referenced by Fclear(), and interpreter::shutdown().

◆ close_gui()

void event_manager::close_gui ( void  )
inline

Definition at line 379 of file event-manager.h.

Referenced by interpreter::shutdown().

◆ confirm_shutdown()

bool event_manager::confirm_shutdown ( void  )
inline

Definition at line 530 of file event-manager.h.

Referenced by interpreter::quit().

◆ connect_link()

void event_manager::connect_link ( const std::shared_ptr< interpreter_events > &  obj)

Definition at line 89 of file event-manager.cc.

References disable(), and m_instance.

Referenced by interpreter_qobject::execute().

◆ copy_image_to_clipboard()

bool event_manager::copy_image_to_clipboard ( const std::string &  file)
inline

Definition at line 566 of file event-manager.h.

Referenced by F__event_manager_copy_image_to_clipboard__().

◆ debug_cd_or_addpath_error()

int event_manager::debug_cd_or_addpath_error ( const std::string &  file,
const std::string &  dir,
bool  addpath_option 
)
inline

Definition at line 545 of file event-manager.h.

Referenced by load_path::contains_file_in_dir().

◆ directory_changed()

void event_manager::directory_changed ( const std::string &  dir)
inline

Definition at line 651 of file event-manager.h.

Referenced by interpreter::chdir().

◆ disable()

bool event_manager::disable ( void  )
inline

Definition at line 317 of file event-manager.h.

Referenced by connect_link(), process_events(), and interpreter::shutdown().

◆ discard_events()

void event_manager::discard_events ( void  )

◆ display_exception()

bool event_manager::display_exception ( const execution_exception ee,
bool  beep = false 
)
inline

Definition at line 617 of file event-manager.h.

Referenced by error_system::display_exception().

◆ edit_file()

bool event_manager::edit_file ( const std::string &  file)
inline

Definition at line 514 of file event-manager.h.

Referenced by F__event_manager_edit_file__().

◆ edit_variable()

bool event_manager::edit_variable ( const std::string &  name,
const octave_value val 
)
inline

Definition at line 519 of file event-manager.h.

Referenced by Fopenvar(), and base_qobject::workspace_widget().

◆ enable()

bool event_manager::enable ( void  )

Definition at line 97 of file event-manager.cc.

References m_instance, m_link_enabled, and warning().

Referenced by interpreter_qobject::execute().

◆ enabled()

bool event_manager::enabled ( void  ) const
inline

◆ enter_debugger_event()

void event_manager::enter_debugger_event ( const std::string &  fcn_name,
const std::string &  fcn_file_name,
int  line 
)
inline

Definition at line 724 of file event-manager.h.

Referenced by debugger::repl().

◆ execute_command_in_terminal()

void event_manager::execute_command_in_terminal ( const std::string &  command)
inline

Definition at line 578 of file event-manager.h.

◆ execute_in_debugger_event()

void event_manager::execute_in_debugger_event ( const std::string &  file,
int  line 
)
inline

Definition at line 735 of file event-manager.h.

Referenced by debugger::repl().

◆ exit_debugger_event()

void event_manager::exit_debugger_event ( void  )
inline

Definition at line 741 of file event-manager.h.

◆ file_dialog()

std::list<std::string> event_manager::file_dialog ( const filter_list filter,
const std::string &  title,
const std::string &  filename,
const std::string &  dirname,
const std::string &  multimode 
)
inline

Definition at line 395 of file event-manager.h.

References dirname(), and filter().

Referenced by F__event_manager_file_dialog__().

◆ file_remove()

void event_manager::file_remove ( const std::string &  old_name,
const std::string &  new_name 
)
inline

Definition at line 658 of file event-manager.h.

References application::is_gui_running().

Referenced by F__event_manager_file_remove__(), Frename(), Frmdir(), and Funlink().

◆ file_renamed()

void event_manager::file_renamed ( bool  load_new)
inline

◆ focus_window()

virtual void event_manager::focus_window ( const std::string  win_name)
inlinevirtual

Definition at line 571 of file event-manager.h.

Referenced by Fcommandhistory(), Fcommandwindow(), Ffilebrowser(), and Fworkspace().

◆ get_named_icon()

uint8NDArray event_manager::get_named_icon ( const std::string &  icon_name)
inline

Definition at line 554 of file event-manager.h.

Referenced by F__event_manager_named_icon__().

◆ gui_preference()

std::string event_manager::gui_preference ( const std::string &  key,
const std::string &  value 
)
inline

Definition at line 560 of file event-manager.h.

Referenced by F__event_manager_gui_preference__().

◆ gui_status_update()

bool event_manager::gui_status_update ( const std::string &  feature,
const std::string &  status 
)
inline

Definition at line 628 of file event-manager.h.

Referenced by F__event_manager_gui_status_update__(), and F__profiler_enable__().

◆ have_dialogs()

bool event_manager::have_dialogs ( void  ) const
inline

Definition at line 387 of file event-manager.h.

Referenced by F__event_manager_have_dialogs__().

◆ input_dialog()

std::list<std::string> event_manager::input_dialog ( const std::list< std::string > &  prompt,
const std::string &  title,
const std::list< float > &  nr,
const std::list< float > &  nc,
const std::list< std::string > &  defaults 
)
inline

Definition at line 406 of file event-manager.h.

Referenced by F__event_manager_input_dialog__().

◆ install_qt_event_handlers()

void event_manager::install_qt_event_handlers ( const std::shared_ptr< interpreter_events > &  obj)
inline

Definition at line 334 of file event-manager.h.

Referenced by interpreter_qobject::execute().

◆ interpreter_interrupted()

void event_manager::interpreter_interrupted ( void  )
inline

Definition at line 758 of file event-manager.h.

Referenced by interpreter::recover_from_exception().

◆ interpreter_output()

bool event_manager::interpreter_output ( const std::string &  msg)
inline

Definition at line 606 of file event-manager.h.

Referenced by output_system::do_sync().

◆ list_dialog()

std::pair<std::list<int>, int> event_manager::list_dialog ( const std::list< std::string > &  list,
const std::string &  mode,
int  width,
int  height,
const std::list< int > &  initial_value,
const std::string &  name,
const std::list< std::string > &  prompt,
const std::string &  ok_string,
const std::string &  cancel_string 
)
inline

Definition at line 418 of file event-manager.h.

Referenced by F__event_manager_list_dialog__().

◆ operator=()

event_manager& event_manager::operator= ( const event_manager )
delete

◆ pop_event_queue()

void event_manager::pop_event_queue ( void  )

Definition at line 142 of file event-manager.cc.

References m_gui_event_queue.

Referenced by debugger::repl().

◆ post_event() [1/2]

void event_manager::post_event ( const fcn_callback fcn)

◆ post_event() [2/2]

void event_manager::post_event ( const meth_callback meth)

Definition at line 166 of file event-manager.cc.

References enabled(), m_gui_event_queue, and m_interpreter.

◆ post_input_event()

void event_manager::post_input_event ( void  )
inline

Definition at line 718 of file event-manager.h.

◆ pre_input_event()

void event_manager::pre_input_event ( void  )
inline

Definition at line 712 of file event-manager.h.

Referenced by tree_evaluator::parse_and_execute().

◆ process_events()

void event_manager::process_events ( bool  disable = false)

◆ prompt_new_edit_file()

bool event_manager::prompt_new_edit_file ( const std::string &  file)
inline

Definition at line 540 of file event-manager.h.

Referenced by F__event_manager_edit_file__().

◆ push_event_queue()

void event_manager::push_event_queue ( void  )

Definition at line 136 of file event-manager.cc.

References m_gui_event_queue.

Referenced by event_manager(), and debugger::repl().

◆ qt_event_handlers()

std::shared_ptr<interpreter_events> event_manager::qt_event_handlers ( void  ) const
inline

Definition at line 340 of file event-manager.h.

◆ question_dialog()

std::string event_manager::question_dialog ( const std::string &  msg,
const std::string &  title,
const std::string &  btn1,
const std::string &  btn2,
const std::string &  btn3,
const std::string &  btndef 
)
inline

Definition at line 435 of file event-manager.h.

Referenced by F__event_manager_question_dialog__().

◆ register_documentation()

bool event_manager::register_documentation ( const std::string &  file)
inline

Definition at line 584 of file event-manager.h.

Referenced by F__event_manager_register_documentation__().

◆ set_history() [1/2]

void event_manager::set_history ( const string_vector hist)
inline

Definition at line 694 of file event-manager.h.

◆ set_history() [2/2]

void event_manager::set_history ( void  )

◆ set_workspace() [1/2]

void event_manager::set_workspace ( bool  top_level,
const symbol_info_list syminfo,
bool  update_variable_editor = true 
)
inline

Definition at line 672 of file event-manager.h.

◆ set_workspace() [2/2]

◆ show_command_history()

void event_manager::show_command_history ( void  )
inline

Definition at line 490 of file event-manager.h.

Referenced by F__event_manager_show_command_history__().

◆ show_community_news()

void event_manager::show_community_news ( int  serial = -1)
inline

Definition at line 502 of file event-manager.h.

Referenced by F__event_manager_show_community_news__().

◆ show_documentation()

bool event_manager::show_documentation ( const std::string &  file)
inline

Definition at line 479 of file event-manager.h.

Referenced by F__event_manager_show_documentation__().

◆ show_file_browser()

void event_manager::show_file_browser ( void  )
inline

Definition at line 484 of file event-manager.h.

Referenced by F__event_manager_show_file_browser__().

◆ show_preferences()

bool event_manager::show_preferences ( void  )
inline

Definition at line 451 of file event-manager.h.

Referenced by F__event_manager_show_preferences__().

◆ show_release_notes()

void event_manager::show_release_notes ( void  )
inline

Definition at line 508 of file event-manager.h.

Referenced by F__event_manager_show_release_notes__().

◆ show_terminal_window()

void event_manager::show_terminal_window ( void  )
inline

Definition at line 473 of file event-manager.h.

Referenced by F__event_manager_show_terminal_window__().

◆ show_workspace()

void event_manager::show_workspace ( void  )
inline

Definition at line 496 of file event-manager.h.

Referenced by F__event_manager_show_workspace__().

◆ start_gui()

void event_manager::start_gui ( bool  gui_app = false)
inline

Definition at line 373 of file event-manager.h.

Referenced by interpreter::execute(), and Fdesktop().

◆ unregister_documentation()

bool event_manager::unregister_documentation ( const std::string &  file)
inline

Definition at line 595 of file event-manager.h.

Referenced by F__event_manager_unregister_documentation__().

◆ update_breakpoint()

void event_manager::update_breakpoint ( bool  insert,
const std::string &  file,
int  line,
const std::string &  cond = "" 
)
inline

◆ update_gui_lexer()

bool event_manager::update_gui_lexer ( void  )
inline

Definition at line 640 of file event-manager.h.

Referenced by F__event_manager_update_gui_lexer__().

◆ update_path_dialog()

void event_manager::update_path_dialog ( void  )
inline

Definition at line 445 of file event-manager.h.

References application::is_gui_running().

Referenced by rehash_internal().

◆ update_prompt()

void event_manager::update_prompt ( const std::string &  prompt)
inline

Definition at line 686 of file event-manager.h.

Referenced by main_window::handle_octave_ready().

Member Data Documentation

◆ m_debugging

bool event_manager::m_debugging
protected

Definition at line 781 of file event-manager.h.

Referenced by set_workspace().

◆ m_event_queue_mutex

mutex* event_manager::m_event_queue_mutex
protected

Definition at line 767 of file event-manager.h.

Referenced by ~event_manager(), discard_events(), and process_events().

◆ m_gui_event_queue

std::stack<std::shared_ptr <event_queue> > event_manager::m_gui_event_queue
protected

◆ m_instance

std::shared_ptr<interpreter_events> event_manager::m_instance
private

Definition at line 791 of file event-manager.h.

Referenced by connect_link(), enable(), set_history(), and set_workspace().

◆ m_interpreter

interpreter& event_manager::m_interpreter
private

Definition at line 786 of file event-manager.h.

Referenced by post_event(), and set_workspace().

◆ m_link_enabled

bool event_manager::m_link_enabled
protected

Definition at line 782 of file event-manager.h.

Referenced by enable().

◆ m_qt_event_handlers

std::shared_ptr<interpreter_events> event_manager::m_qt_event_handlers
private

Definition at line 793 of file event-manager.h.


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