Provides threadsafe access to octave. More...
#include "event-manager.h"
Public Types | |
typedef std::list< std::pair< std::string, std::string > > | filter_list |
Public Member Functions | |
event_manager (const event_manager &)=delete | |
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) |
bool | confirm_shutdown (void) |
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) |
void | discard_events (void) |
bool | edit_file (const std::string &file) |
bool | edit_variable (const std::string &name, const octave_value &val) |
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) |
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) |
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_manager & | operator= (const event_manager &)=delete |
void | post_event (const fcn_callback &fcn) |
void | post_event (const meth_callback &meth) |
void | post_input_event (void) |
void | pre_input_event (void) |
void | process_events (bool disable=false) |
bool | prompt_new_edit_file (const std::string &file) |
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_doc (const std::string &file) |
void | set_history (const string_vector &hist) |
void | set_workspace (bool top_level, const octave::symbol_info_list &syminfo, bool update_variable_editor=true) |
void | set_workspace (void) |
bool | show_doc (const std::string &file) |
bool | show_preferences (void) |
bool | unregister_doc (const std::string &file) |
void | update_breakpoint (bool insert, const std::string &file, int line, const std::string &cond="") |
void | update_path_dialog (void) |
Protected Attributes | |
bool | debugging |
octave::mutex * | event_queue_mutex |
octave::event_queue | gui_event_queue |
bool | link_enabled |
Private Attributes | |
std::shared_ptr< interpreter_events > | instance |
interpreter & | m_interpreter |
Provides threadsafe access to octave.
This class provides thread-safe communication between the interpreter and a GUI.
Definition at line 249 of file event-manager.h.
typedef std::list<std::pair<std::string, std::string> > octave::event_manager::filter_list |
Definition at line 317 of file event-manager.h.
octave::event_manager::event_manager | ( | interpreter & | interp | ) |
Definition at line 53 of file event-manager.cc.
References octave::command_editor::add_event_hook(), and octave::readline_event_hook().
|
delete |
|
virtual |
Definition at line 61 of file event-manager.cc.
References event_queue_mutex.
|
inline |
Definition at line 542 of file event-manager.h.
References enabled(), and instance.
Referenced by octave::edit_history_add_hist(), and octave::history_system::write_timestamp().
|
inline |
Definition at line 387 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_apply_preferences__().
|
inline |
Definition at line 548 of file event-manager.h.
References enabled(), and instance.
Referenced by octave::history_system::do_history().
|
inline |
Definition at line 530 of file event-manager.h.
References enabled(), and instance.
Referenced by Fclear().
|
inline |
Definition at line 425 of file event-manager.h.
References enabled(), instance, and retval.
Referenced by octave::interpreter::quit().
void octave::event_manager::connect_link | ( | const std::shared_ptr< interpreter_events > & | obj | ) |
Definition at line 73 of file event-manager.cc.
References disable(), and instance.
Referenced by octave::interpreter_qobject::execute().
|
inline |
Definition at line 460 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_copy_image_to_clipboard__().
|
inline |
Definition at line 440 of file event-manager.h.
References enabled(), and instance.
Referenced by octave::load_path::contains_file_in_dir().
|
inline |
Definition at line 501 of file event-manager.h.
References enabled(), and instance.
Referenced by octave::interpreter::chdir().
|
inline |
Definition at line 272 of file event-manager.h.
References link_enabled, and retval.
Referenced by connect_link(), process_events(), and octave::interpreter::shutdown().
void octave::event_manager::discard_events | ( | void | ) |
Definition at line 108 of file event-manager.cc.
References octave::action_container::discard(), enabled(), event_queue_mutex, gui_event_queue, octave::mutex::lock(), and octave::mutex::unlock().
|
inline |
Definition at line 409 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_edit_file__().
|
inline |
Definition at line 414 of file event-manager.h.
References enabled(), instance, and name.
Referenced by Fopenvar().
bool octave::event_manager::enable | ( | void | ) |
Definition at line 81 of file event-manager.cc.
References instance, link_enabled, retval, and warning().
Referenced by octave::interpreter_qobject::execute().
|
inline |
Definition at line 279 of file event-manager.h.
References link_enabled.
Referenced by append_history(), apply_preferences(), clear_history(), clear_workspace(), confirm_shutdown(), copy_image_to_clipboard(), debug_cd_or_addpath_error(), directory_changed(), discard_events(), edit_file(), edit_variable(), enter_debugger_event(), execute_command_in_terminal(), execute_in_debugger_event(), exit_debugger_event(), F__event_manager_enabled__(), file_dialog(), file_remove(), file_renamed(), focus_window(), get_named_icon(), gui_preference(), input_dialog(), list_dialog(), post_event(), post_input_event(), pre_input_event(), process_events(), prompt_new_edit_file(), question_dialog(), register_doc(), set_history(), set_workspace(), show_doc(), show_preferences(), unregister_doc(), update_breakpoint(), and update_path_dialog().
|
inline |
Definition at line 566 of file event-manager.h.
References debugging, enabled(), and instance.
Referenced by octave::debugger::repl().
|
inline |
Definition at line 472 of file event-manager.h.
|
inline |
Definition at line 577 of file event-manager.h.
References enabled(), and instance.
Referenced by octave::debugger::repl().
|
inline |
Definition at line 583 of file event-manager.h.
|
inline |
Definition at line 320 of file event-manager.h.
References octave::sys::file_ops::dirname(), enabled(), filter(), and instance.
Referenced by F__event_manager_file_dialog__().
|
inline |
Definition at line 508 of file event-manager.h.
References enabled(), instance, and octave::application::is_gui_running().
Referenced by F__event_manager_file_remove__(), Frename(), Frmdir(), and Funlink().
|
inline |
Definition at line 514 of file event-manager.h.
References enabled(), instance, and octave::application::is_gui_running().
Referenced by F__event_manager_file_renamed__(), Frename(), Frmdir(), and Funlink().
|
inlinevirtual |
Definition at line 465 of file event-manager.h.
References enabled(), and instance.
Referenced by Fcommandhistory(), Fcommandwindow(), Ffilebrowser(), and Fworkspace().
|
inline |
Definition at line 448 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_named_icon__().
|
inline |
Definition at line 454 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_gui_preference__().
|
inline |
Definition at line 331 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_input_dialog__().
|
inline |
Definition at line 343 of file event-manager.h.
References enabled(), instance, and name.
Referenced by F__event_manager_list_dialog__().
|
delete |
|
inline |
Definition at line 296 of file event-manager.h.
References octave::action_container::add(), enabled(), and gui_event_queue.
Referenced by octave::interpreter_qobject::interpreter_event(), and QtHandles::qt_graphics_toolkit::interpreter_event().
|
inline |
Definition at line 302 of file event-manager.h.
References octave::action_container::add(), enabled(), gui_event_queue, and m_interpreter.
|
inline |
Definition at line 560 of file event-manager.h.
|
inline |
Definition at line 554 of file event-manager.h.
void octave::event_manager::process_events | ( | bool | disable = false | ) |
Definition at line 93 of file event-manager.cc.
References disable(), enabled(), event_queue_mutex, gui_event_queue, octave::mutex::lock(), octave::action_container::run(), and octave::mutex::unlock().
Referenced by octave::readline_event_hook(), and octave::interpreter::shutdown().
|
inline |
Definition at line 435 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_edit_file__().
|
inline |
Definition at line 360 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_question_dialog__().
|
inline |
Definition at line 478 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_register_doc__().
|
inline |
Definition at line 536 of file event-manager.h.
References enabled(), and instance.
Referenced by octave::history_system::do_history(), and octave::history_system::initialize().
|
inline |
Definition at line 522 of file event-manager.h.
void octave::event_manager::set_workspace | ( | void | ) |
Definition at line 120 of file event-manager.cc.
References octave::tree_evaluator::at_top_level(), debugging, enabled(), octave::interpreter::get_evaluator(), octave::tree_evaluator::get_symbol_info(), instance, and m_interpreter.
Referenced by octave::main_window::handle_load_workspace_request(), octave::main_window::handle_open_any_request(), octave::main_window::handle_rename_variable_request(), octave::main_window::handle_variable_editor_update(), and octave::debugger::repl().
|
inline |
Definition at line 398 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_show_doc__().
|
inline |
Definition at line 376 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_show_preferences__().
|
inline |
Definition at line 489 of file event-manager.h.
References enabled(), and instance.
Referenced by F__event_manager_unregister_doc__().
|
inline |
Definition at line 593 of file event-manager.h.
References enabled(), and instance.
Referenced by octave::tree_statement_list::add_breakpoint(), octave::tree_statement_list::remove_all_breakpoints(), and octave::bp_table::remove_breakpoint_1().
|
inline |
Definition at line 370 of file event-manager.h.
References enabled(), instance, and octave::application::is_gui_running().
Referenced by octave::rehash_internal().
|
protected |
Definition at line 617 of file event-manager.h.
Referenced by enter_debugger_event(), exit_debugger_event(), and set_workspace().
|
protected |
Definition at line 612 of file event-manager.h.
Referenced by ~event_manager(), discard_events(), and process_events().
|
protected |
Definition at line 615 of file event-manager.h.
Referenced by discard_events(), post_event(), and process_events().
|
private |
Definition at line 607 of file event-manager.h.
Referenced by append_history(), apply_preferences(), clear_history(), clear_workspace(), confirm_shutdown(), connect_link(), copy_image_to_clipboard(), debug_cd_or_addpath_error(), directory_changed(), edit_file(), edit_variable(), enable(), enter_debugger_event(), execute_command_in_terminal(), execute_in_debugger_event(), exit_debugger_event(), file_dialog(), file_remove(), file_renamed(), focus_window(), get_named_icon(), gui_preference(), input_dialog(), list_dialog(), post_input_event(), pre_input_event(), prompt_new_edit_file(), question_dialog(), register_doc(), set_history(), set_workspace(), show_doc(), show_preferences(), unregister_doc(), update_breakpoint(), and update_path_dialog().
|
protected |
Definition at line 618 of file event-manager.h.
|
private |
Definition at line 602 of file event-manager.h.
Referenced by post_event(), and set_workspace().