25 #if !defined (octave_octave_link_h)
26 #define octave_octave_link_h 1
59 instance->do_generate_events ();
70 instance->link_enabled =
false;
72 instance->do_process_events ();
79 instance->do_discard_events ();
87 retval = instance->do_confirm_shutdown ();
92 static bool exit (
int status)
97 retval = instance->do_exit (status);
106 instance->do_post_event (obj, method);
109 template <
class T,
class A>
113 instance->do_post_event (obj, method, arg);
116 template <
class T,
class A>
120 instance->do_post_event (obj, method, arg);
126 instance->do_entered_readline_hook ();
132 instance->do_finished_readline_hook ();
138 return enabled () ? instance->do_copy_image_to_clipboard (file) :
false;
144 return enabled () ? instance->do_edit_file (file) :
false;
150 return enabled () ? instance->do_prompt_new_edit_file (file) :
false;
155 const std::string& title)
157 return enabled () ? instance->do_message_dialog (dlg, msg, title) : 0;
162 const std::string& btn1,
const std::string& btn2,
163 const std::string& btn3,
const std::string& btndef)
165 return enabled () ? instance->do_question_dialog (msg, title, btn1,
166 btn2, btn3, btndef) : 0;
169 static std::pair<std::list<int>,
int>
171 const std::string& mode,
172 int width,
int height,
173 const std::list<int>& initial_value,
174 const std::string& name,
175 const std::list<std::string>& prompt,
176 const std::string& ok_string,
177 const std::string& cancel_string)
180 ? instance->do_list_dialog (list, mode, width, height,
181 initial_value, name, prompt,
182 ok_string, cancel_string)
183 : std::pair<std::list<int>,
int> ();
186 static std::list<std::string>
188 const std::string& title,
189 const std::list<float>& nr,
190 const std::list<float>& nc,
191 const std::list<std::string>& defaults)
194 ? instance->do_input_dialog (prompt, title, nr, nc, defaults)
195 : std::list<std::string> ();
198 typedef std::list<std::pair<std::string, std::string> >
filter_list;
200 static std::list<std::string>
202 const std::string& filename,
const std::string& dirname,
203 const std::string& multimode)
206 ? instance->do_file_dialog (filter, title, filename, dirname,
208 : std::list<std::string> ();
213 const std::string& dir,
217 ? instance->do_debug_cd_or_addpath_error (file, dir, addpath_option)
224 instance->do_change_directory (dir);
231 instance->do_execute_command_in_terminal (command);
234 static void set_workspace (
void);
237 const std::list<workspace_element>& ws)
240 instance->do_set_workspace (top_level, instance->debugging, ws);
246 instance->do_clear_workspace ();
252 instance->do_set_history (hist);
258 instance->do_append_history (hist_entry);
264 instance->do_clear_history ();
270 instance->do_pre_input_event ();
276 instance->do_post_input_event ();
283 instance->debugging =
true;
285 instance->do_enter_debugger_event (file, line);
292 instance->do_execute_in_debugger_event (file, line);
297 if (enabled () && instance->debugging)
299 instance->debugging =
false;
301 instance->do_exit_debugger_event ();
309 instance->do_update_breakpoint (insert, file, line);
318 instance->do_set_default_prompts (ps1, ps2, ps4);
323 return instance_ok () ? instance->link_enabled :
false;
331 instance->do_show_preferences ();
343 instance->do_show_doc (file);
374 void do_generate_events (
void);
375 void do_process_events (
void);
376 void do_discard_events (
void);
384 template <
class T,
class A>
387 gui_event_queue.
add_method (obj, method, arg);
390 template <
class T,
class A>
393 gui_event_queue.
add_method (obj, method, arg);
399 virtual bool do_confirm_shutdown (
void) = 0;
400 virtual bool do_exit (
int status) = 0;
402 virtual bool do_copy_image_to_clipboard (
const std::string& file) = 0;
404 virtual bool do_edit_file (
const std::string& file) = 0;
405 virtual bool do_prompt_new_edit_file (
const std::string& file) = 0;
408 do_message_dialog (
const std::string& dlg,
const std::string& msg,
409 const std::string& title) = 0;
412 do_question_dialog (
const std::string& msg,
const std::string& title,
413 const std::string& btn1,
const std::string& btn2,
414 const std::string& btn3,
const std::string& btndef) = 0;
416 virtual std::pair<std::list<int>,
int>
417 do_list_dialog (
const std::list<std::string>& list,
418 const std::string& mode,
419 int width,
int height,
420 const std::list<int>& initial_value,
421 const std::string& name,
422 const std::list<std::string>& prompt,
423 const std::string& ok_string,
424 const std::string& cancel_string) = 0;
426 virtual std::list<std::string>
427 do_input_dialog (
const std::list<std::string>& prompt,
428 const std::string& title,
429 const std::list<float>& nr,
430 const std::list<float>& nc,
431 const std::list<std::string>& defaults) = 0;
433 virtual std::list<std::string>
434 do_file_dialog (
const filter_list&
filter,
const std::string& title,
435 const std::string& filename,
const std::string& dirname,
436 const std::string& multimode) = 0;
439 do_debug_cd_or_addpath_error (
const std::string& file,
440 const std::string& dir,
441 bool addpath_option) = 0;
443 virtual void do_change_directory (
const std::string& dir) = 0;
445 virtual void do_execute_command_in_terminal (
const std::string& command) = 0;
448 do_set_workspace (
bool top_level,
bool debug,
449 const std::list<workspace_element>& ws) = 0;
451 virtual void do_clear_workspace (
void) = 0;
454 virtual void do_append_history (
const std::string& hist_entry) = 0;
455 virtual void do_clear_history (
void) = 0;
457 virtual void do_pre_input_event (
void) = 0;
458 virtual void do_post_input_event (
void) = 0;
461 do_enter_debugger_event (
const std::string& file,
int line) = 0;
464 do_execute_in_debugger_event (
const std::string& file,
int line) = 0;
466 virtual void do_exit_debugger_event (
void) = 0;
468 virtual void do_update_breakpoint (
bool insert,
469 const std::string& file,
int line) = 0;
471 virtual void do_set_default_prompts (std::string& ps1, std::string& ps2,
472 std::string& ps4) = 0;
474 virtual void do_show_preferences (
void) = 0;
476 virtual void do_show_doc (
const std::string &file) = 0;
479 #endif // OCTAVELINK_H
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)
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)
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)
F77_RET_T const octave_idx_type Complex * A
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)
int octave_link(const std::string &old_name, const std::string &new_name)
static void update_breakpoint(bool insert, const std::string &file, int line)
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)
MArray< double > filter(MArray< double > &, MArray< double > &, MArray< double > &, int dim)
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 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)
virtual ~octave_link(void)
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)
std::list< std::pair< std::string, std::string > > filter_list