25 #if ! defined (octave_octave_link_h)
26 #define octave_octave_link_h 1
28 #include "octave-config.h"
61 instance->do_generate_events ();
72 instance->link_enabled =
false;
74 instance->do_process_events ();
81 instance->do_discard_events ();
89 retval = instance->do_confirm_shutdown ();
94 static bool exit (
int status)
99 retval = instance->do_exit (status);
104 template <
typename T>
108 instance->do_post_event (obj, method);
111 template <
typename T,
typename A>
115 instance->do_post_event (obj, method, arg);
118 template <
typename T,
typename A>
122 instance->do_post_event (obj, method, arg);
128 instance->do_entered_readline_hook ();
134 instance->do_finished_readline_hook ();
140 return enabled () ? instance->do_copy_image_to_clipboard (file) :
false;
146 return enabled () ? instance->do_edit_file (file) :
false;
152 return enabled () ? instance->do_prompt_new_edit_file (file) :
false;
159 return enabled () ? instance->do_message_dialog (dlg, msg, title) : 0;
167 return enabled () ? instance->do_question_dialog (msg, title, btn1,
168 btn2, btn3, btndef) : 0;
171 static std::pair<std::list<int>,
int>
174 int width,
int height,
175 const std::list<int>& initial_value,
177 const std::list<std::string>& prompt,
182 ? instance->do_list_dialog (list, mode, width, height,
183 initial_value, name, prompt,
184 ok_string, cancel_string)
185 : std::pair<std::list<int>,
int> ();
188 static std::list<std::string>
191 const std::list<float>& nr,
192 const std::list<float>& nc,
193 const std::list<std::string>& defaults)
196 ? instance->do_input_dialog (prompt, title, nr, nc, defaults)
197 : std::list<std::string> ();
200 typedef std::list<std::pair<std::string, std::string> >
filter_list;
202 static std::list<std::string>
208 ? instance->do_file_dialog (filter, title, filename, dirname,
210 : std::list<std::string> ();
218 ? instance->do_debug_cd_or_addpath_error (file, dir, addpath_option)
225 instance->do_change_directory (dir);
232 instance->do_execute_command_in_terminal (command);
235 static void set_workspace (
void);
238 const std::list<workspace_element>& ws)
241 instance->do_set_workspace (top_level, instance->debugging, ws);
247 instance->do_clear_workspace ();
253 instance->do_set_history (hist);
259 instance->do_append_history (hist_entry);
265 instance->do_clear_history ();
271 instance->do_pre_input_event ();
277 instance->do_post_input_event ();
284 instance->debugging =
true;
286 instance->do_enter_debugger_event (file, line);
293 instance->do_execute_in_debugger_event (file, line);
298 if (enabled () && instance->debugging)
300 instance->debugging =
false;
302 instance->do_exit_debugger_event ();
311 instance->do_update_breakpoint (insert, file, line, cond);
320 instance->do_set_default_prompts (ps1, ps2, ps4);
325 return instance_ok () ? instance->link_enabled :
false;
333 instance->do_show_preferences ();
345 instance->do_show_doc (file);
376 void do_generate_events (
void);
377 void do_process_events (
void);
378 void do_discard_events (
void);
380 template <
typename T>
386 template <
typename T,
typename A>
389 gui_event_queue.
add_method (obj, method, arg);
392 template <
typename T,
typename A>
395 gui_event_queue.
add_method (obj, method, arg);
401 virtual bool do_confirm_shutdown (
void) = 0;
402 virtual bool do_exit (
int status) = 0;
418 virtual std::pair<std::list<int>,
int>
419 do_list_dialog (
const std::list<std::string>&
list,
421 int width,
int height,
422 const std::list<int>& initial_value,
424 const std::list<std::string>& prompt,
428 virtual std::list<std::string>
429 do_input_dialog (
const std::list<std::string>& prompt,
431 const std::list<float>& nr,
432 const std::list<float>& nc,
433 const std::list<std::string>& defaults) = 0;
435 virtual std::list<std::string>
443 bool addpath_option) = 0;
445 virtual void do_change_directory (
const std::string& dir) = 0;
450 do_set_workspace (
bool top_level,
bool debug,
451 const std::list<workspace_element>& ws) = 0;
453 virtual void do_clear_workspace (
void) = 0;
456 virtual void do_append_history (
const std::string& hist_entry) = 0;
457 virtual void do_clear_history (
void) = 0;
459 virtual void do_pre_input_event (
void) = 0;
460 virtual void do_post_input_event (
void) = 0;
468 virtual void do_exit_debugger_event (
void) = 0;
470 virtual void do_update_breakpoint (
bool insert,
477 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)
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 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 change_directory(const std::string &dir)
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)
workspace_element operator=(const workspace_element &ws_elt)
event_queue gui_event_queue
static void set_history(const string_vector &hist)
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)
octave_mutex * event_queue_mutex
void add_method(T *obj, void(T::*method)(void))
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)
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)
static bool exit(int status)
static void entered_readline_hook(void)
static void post_input_event(void)
void do_entered_readline_hook(void)
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))
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_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 generate_events(void)
static void set_workspace(bool top_level, const std::list< workspace_element > &ws)
static bool show_preferences()
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
F77_RET_T const F77_INT F77_CMPLX * A