25 #if ! defined (octave_octave_link_h) 26 #define octave_octave_link_h 1 28 #include "octave-config.h" 73 instance->do_generate_events ();
84 instance->do_disable ();
86 instance->do_process_events ();
93 instance->do_discard_events ();
101 retval = instance->do_confirm_shutdown ();
106 template <
typename T>
110 instance->do_post_event (obj,
method);
113 template <
typename T,
typename A>
117 instance->do_post_event (obj,
method,
arg);
120 template <
typename T,
typename A>
124 instance->do_post_event (obj,
method,
arg);
127 template <
class T,
class A,
class B>
135 template <
class T,
class A,
class B,
class C>
137 void (T::*
method) (
const A&,
const B&,
const C&),
144 template <
class T,
class A,
class B,
class C,
class D>
147 void (T::*
method) (
const A&,
const B&,
const C&,
const D&),
151 instance->do_post_event<T,
A,
B,
C, D>
159 instance->do_post_exception (
p);
165 instance->do_entered_readline_hook ();
171 instance->do_finished_readline_hook ();
177 return enabled () ? instance->do_copy_image_to_clipboard (
file) :
false;
183 return enabled () ? instance->do_edit_file (
file) :
false;
189 return enabled () ? instance->do_prompt_new_edit_file (
file) :
false;
196 return enabled () ? instance->do_message_dialog (dlg, msg, title) : 0;
204 return enabled () ? instance->do_question_dialog (msg, title, btn1,
205 btn2, btn3, btndef) :
"";
208 static std::pair<std::list<int>,
int>
211 int width,
int height,
212 const std::list<int>& initial_value,
214 const std::list<std::string>& prompt,
219 ? instance->do_list_dialog (
list,
mode, width, height,
220 initial_value,
name, prompt,
221 ok_string, cancel_string)
222 : std::pair<std::list<int>,
int> ();
225 static std::list<std::string>
228 const std::list<float>& nr,
229 const std::list<float>& nc,
230 const std::list<std::string>& defaults)
233 ? instance->do_input_dialog (prompt, title, nr, nc, defaults)
234 : std::list<std::string> ();
237 typedef std::list<std::pair<std::string, std::string>>
filter_list;
239 static std::list<std::string>
247 : std::list<std::string> ();
255 ? instance->do_debug_cd_or_addpath_error (
file, dir, addpath_option)
262 instance->do_change_directory (dir);
269 instance->do_execute_command_in_terminal (
command);
272 static void set_workspace (
void);
276 bool update_variable_editor =
true)
279 instance->do_set_workspace (top_level, instance->debugging, scope,
280 update_variable_editor);
286 instance->do_clear_workspace ();
292 instance->do_set_history (hist);
298 instance->do_append_history (hist_entry);
304 instance->do_clear_history ();
310 instance->do_pre_input_event ();
316 instance->do_post_input_event ();
323 instance->debugging =
true;
325 instance->do_enter_debugger_event (
file,
line);
332 instance->do_execute_in_debugger_event (
file,
line);
337 if (enabled () && instance->debugging)
339 instance->debugging =
false;
341 instance->do_exit_debugger_event ();
350 instance->do_update_breakpoint (insert,
file,
line, cond);
375 instance->do_set_default_prompts (ps1, ps2, ps4);
380 return instance_ok () ? instance->do_enable () :
false;
385 return instance_ok () ? instance->do_disable () :
false;
390 bool retval = link_enabled;
397 bool retval = link_enabled;
398 link_enabled =
false;
404 return instance_ok () ? instance->link_enabled :
false;
412 instance->do_show_preferences ();
424 instance->do_show_doc (
file);
436 instance->do_register_doc (
file);
448 instance->do_unregister_doc (
file);
461 instance->do_edit_variable (
name,
val);
485 void do_generate_events (
void);
486 void do_process_events (
void);
487 void do_discard_events (
void);
489 template <
typename T>
495 template <
typename T,
typename A>
501 template <
typename T,
typename A>
507 template <
class T,
class A,
class B>
515 template <
class T,
class A,
class B,
class C>
517 void (T::*
method) (
const A&,
const B&,
const C&),
524 template <
class T,
class A,
class B,
class C,
class D>
527 void (T::*
method) (
const A&,
const B&,
const C&,
const D&),
537 std::rethrow_exception (
p);
549 virtual bool do_confirm_shutdown (
void) = 0;
565 virtual std::pair<std::list<int>,
int>
566 do_list_dialog (
const std::list<std::string>&
list,
568 int width,
int height,
569 const std::list<int>& initial_value,
571 const std::list<std::string>& prompt,
575 virtual std::list<std::string>
576 do_input_dialog (
const std::list<std::string>& prompt,
578 const std::list<float>& nr,
579 const std::list<float>& nc,
580 const std::list<std::string>& defaults) = 0;
582 virtual std::list<std::string>
590 bool addpath_option) = 0;
592 virtual void do_change_directory (
const std::string& dir) = 0;
597 do_set_workspace (
bool top_level,
bool debug,
599 bool update_variable_editor) = 0;
601 virtual void do_clear_workspace (
void) = 0;
604 virtual void do_append_history (
const std::string& hist_entry) = 0;
605 virtual void do_clear_history (
void) = 0;
607 virtual void do_pre_input_event (
void) = 0;
608 virtual void do_post_input_event (
void) = 0;
616 virtual void do_exit_debugger_event (
void) = 0;
618 virtual void do_update_breakpoint (
bool insert,
625 virtual void do_show_preferences (
void) = 0;
static void enter_debugger_event(const std::string &file, int line)
void do_post_event(T *obj, void(T::*method)(void))
static void pre_input_event(void)
static int message_dialog(const std::string &dlg, const std::string &msg, const std::string &title)
static 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)
For example cd octave end example noindent changes the current working directory to file
static void clear_workspace(void)
static int debug_cd_or_addpath_error(const std::string &file, const std::string &dir, bool addpath_option)
F77_RET_T const F77_INT F77_CMPLX const F77_INT F77_CMPLX * B
void do_post_event(T *obj, void(T::*method)(const A &, const B &, const C &), const A &arg_a, const B &arg_b, const C &arg_c)
Provides threadsafe access to octave.
void do_post_event(T *obj, void(T::*method)(const A &), const A &arg)
static void finished_readline_hook(void)
The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list
static void post_event(T *obj, void(T::*method)(const A &, const B &, const C &), const A &arg_a, const B &arg_b, const C &arg_c)
static void exit_debugger_event(void)
static 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)
static bool instance_ok(void)
static void discard_events(void)
static void post_exception(const std::exception_ptr &p)
static void change_directory(const std::string &dir)
identity matrix If supplied two scalar respectively For allows like xample val
static void post_event(T *obj, void(T::*method)(A), A arg)
static bool enabled(void)
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
static void process_events(bool disable=false)
static bool edit_variable(const std::string &name, const octave_value &val)
octave::event_queue gui_event_queue
static void set_history(const string_vector &hist)
static octave_link * disconnect_link(bool delete_instance=true)
void do_post_event(T *obj, void(T::*method)(const A &, const B &, const C &, const D &), const A &arg_a, const B &arg_b, const C &arg_c, const D &arg_d)
std::string dirname(const std::string &path)
static void post_event(T *obj, void(T::*method)(const A &, const B &, const C &, const D &), const A &arg_a, const B &arg_b, const C &arg_c, const D &arg_d)
static void update_breakpoint(bool insert, const std::string &file, int line, const std::string &cond="")
to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any simply delete all the lines from the buffer before leaving the editor When invoked with no edit the previously executed command
static void execute_in_debugger_event(const std::string &file, int line)
static void execute_command_in_terminal(const std::string &command)
static void set_default_prompts(std::string &ps1, std::string &ps2, std::string &ps4)
static bool prompt_new_edit_file(const std::string &file)
octave::mutex * event_queue_mutex
static void set_workspace(bool top_level, const octave::symbol_scope &scope, bool update_variable_editor=true)
static octave_link * instance
static void clear_history(void)
static 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)
nd deftypefn *std::string name
static void entered_readline_hook(void)
F77_RET_T const F77_INT F77_CMPLX * A
static void post_input_event(void)
void do_entered_readline_hook(void)
static bool register_doc(const std::string &file)
void do_post_event(T *obj, void(T::*method)(A), A arg)
static bool edit_file(const std::string &file)
static bool copy_image_to_clipboard(const std::string &file)
static bool show_doc(const std::string &file)
static void post_event(T *obj, void(T::*method)(void))
static bool disable(void)
void do_post_exception(const std::exception_ptr &p)
MArray< T > filter(MArray< T > &b, MArray< T > &a, MArray< T > &x, MArray< T > &si, int dim=0)
static void post_event(T *obj, void(T::*method)(const A &), const A &arg)
void do_post_event(T *obj, void(T::*method)(const A &, const B &), const A &arg_a, const B &arg_b)
void do_finished_readline_hook(void)
static bool confirm_shutdown(void)
static 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)
static void post_event(T *obj, void(T::*method)(const A &, const B &), const A &arg_a, const B &arg_b)
static void generate_events(void)
static bool unregister_doc(const std::string &file)
static bool show_preferences()
void add_method(T *obj, void(T::*method)(void))
void rethrow_exception_callback(const std::exception_ptr &p)
static void append_history(const std::string &hist_entry)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
std::list< std::pair< std::string, std::string > > filter_list