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

Provides threadsafe access to octave. More...

#include "event-manager.h"

Collaboration diagram for octave::event_manager:

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_manageroperator= (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::mutexevent_queue_mutex
 
octave::event_queue gui_event_queue
 
bool link_enabled
 

Private Attributes

std::shared_ptr< interpreter_eventsinstance
 
interpreterm_interpreter
 

Detailed Description

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.

Member Typedef Documentation

◆ filter_list

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

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

Constructor & Destructor Documentation

◆ event_manager() [1/2]

octave::event_manager::event_manager ( interpreter interp)

◆ event_manager() [2/2]

octave::event_manager::event_manager ( const event_manager )
delete

◆ ~event_manager()

octave::event_manager::~event_manager ( void  )
virtual

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

References event_queue_mutex.

Member Function Documentation

◆ append_history()

void octave::event_manager::append_history ( const std::string &  hist_entry)
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().

◆ apply_preferences()

bool octave::event_manager::apply_preferences ( void  )
inline

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

References enabled(), and instance.

Referenced by F__event_manager_apply_preferences__().

◆ clear_history()

void octave::event_manager::clear_history ( void  )
inline

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

References enabled(), and instance.

Referenced by octave::history_system::do_history().

◆ clear_workspace()

void octave::event_manager::clear_workspace ( void  )
inline

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

References enabled(), and instance.

Referenced by Fclear().

◆ confirm_shutdown()

bool octave::event_manager::confirm_shutdown ( void  )
inline

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

References enabled(), instance, and retval.

Referenced by octave::interpreter::quit().

◆ connect_link()

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().

◆ copy_image_to_clipboard()

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

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

References enabled(), and instance.

Referenced by F__event_manager_copy_image_to_clipboard__().

◆ debug_cd_or_addpath_error()

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

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

References enabled(), and instance.

Referenced by octave::load_path::contains_file_in_dir().

◆ directory_changed()

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

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

References enabled(), and instance.

Referenced by octave::interpreter::chdir().

◆ disable()

bool octave::event_manager::disable ( void  )
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().

◆ discard_events()

void octave::event_manager::discard_events ( void  )

◆ edit_file()

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

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

References enabled(), and instance.

Referenced by F__event_manager_edit_file__().

◆ edit_variable()

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

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

References enabled(), instance, and name.

Referenced by Fopenvar().

◆ enable()

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().

◆ enabled()

◆ enter_debugger_event()

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

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

References debugging, enabled(), and instance.

Referenced by octave::debugger::repl().

◆ execute_command_in_terminal()

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

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

References enabled(), and instance.

◆ execute_in_debugger_event()

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

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

References enabled(), and instance.

Referenced by octave::debugger::repl().

◆ exit_debugger_event()

void octave::event_manager::exit_debugger_event ( void  )
inline

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

References debugging, enabled(), and instance.

◆ file_dialog()

std::list<std::string> octave::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

◆ file_remove()

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

◆ file_renamed()

void octave::event_manager::file_renamed ( bool  load_new)
inline

◆ focus_window()

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

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

References enabled(), and instance.

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

◆ get_named_icon()

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

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

References enabled(), and instance.

Referenced by F__event_manager_named_icon__().

◆ gui_preference()

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

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

References enabled(), and instance.

Referenced by F__event_manager_gui_preference__().

◆ input_dialog()

std::list<std::string> octave::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 331 of file event-manager.h.

References enabled(), and instance.

Referenced by F__event_manager_input_dialog__().

◆ list_dialog()

std::pair<std::list<int>, int> octave::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 343 of file event-manager.h.

References enabled(), instance, and name.

Referenced by F__event_manager_list_dialog__().

◆ operator=()

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

◆ post_event() [1/2]

void octave::event_manager::post_event ( const fcn_callback fcn)
inline

◆ post_event() [2/2]

void octave::event_manager::post_event ( const meth_callback meth)
inline

◆ post_input_event()

void octave::event_manager::post_input_event ( void  )
inline

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

References enabled(), and instance.

◆ pre_input_event()

void octave::event_manager::pre_input_event ( void  )
inline

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

References enabled(), and instance.

◆ process_events()

void octave::event_manager::process_events ( bool  disable = false)

◆ prompt_new_edit_file()

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

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

References enabled(), and instance.

Referenced by F__event_manager_edit_file__().

◆ question_dialog()

std::string octave::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 360 of file event-manager.h.

References enabled(), and instance.

Referenced by F__event_manager_question_dialog__().

◆ register_doc()

bool octave::event_manager::register_doc ( const std::string &  file)
inline

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

References enabled(), and instance.

Referenced by F__event_manager_register_doc__().

◆ set_history()

void octave::event_manager::set_history ( const string_vector hist)
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().

◆ set_workspace() [1/2]

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

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

References debugging, enabled(), and instance.

◆ set_workspace() [2/2]

◆ show_doc()

bool octave::event_manager::show_doc ( const std::string &  file)
inline

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

References enabled(), and instance.

Referenced by F__event_manager_show_doc__().

◆ show_preferences()

bool octave::event_manager::show_preferences ( void  )
inline

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

References enabled(), and instance.

Referenced by F__event_manager_show_preferences__().

◆ unregister_doc()

bool octave::event_manager::unregister_doc ( const std::string &  file)
inline

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

References enabled(), and instance.

Referenced by F__event_manager_unregister_doc__().

◆ update_breakpoint()

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

◆ update_path_dialog()

void octave::event_manager::update_path_dialog ( void  )
inline

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

References enabled(), instance, and octave::application::is_gui_running().

Referenced by octave::rehash_internal().

Member Data Documentation

◆ debugging

bool octave::event_manager::debugging
protected

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

Referenced by enter_debugger_event(), exit_debugger_event(), and set_workspace().

◆ event_queue_mutex

octave::mutex* octave::event_manager::event_queue_mutex
protected

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

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

◆ gui_event_queue

octave::event_queue octave::event_manager::gui_event_queue
protected

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

Referenced by discard_events(), post_event(), and process_events().

◆ instance

◆ link_enabled

bool octave::event_manager::link_enabled
protected

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

Referenced by disable(), enable(), and enabled().

◆ m_interpreter

interpreter& octave::event_manager::m_interpreter
private

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

Referenced by post_event(), and set_workspace().


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