25 #if defined (HAVE_CONFIG_H)
53 : event_queue_mutex (new
octave_mutex ()), gui_event_queue (),
54 debugging (
false), link_enabled (true)
82 error (
"octave_link is already linked!");
111 DEFUN (__octave_link_enabled__, , ,
120 DEFUN (__octave_link_edit_file__,
args, ,
128 if (
args.length () == 1)
136 else if (
args.length () == 2)
148 DEFUN (__octave_link_message_dialog__,
args, ,
156 if (
args.length () == 3)
170 DEFUN (__octave_link_question_dialog__,
args, ,
178 if (
args.length () == 6)
196 DEFUN (__octave_link_file_dialog__,
args, ,
202 if (
args.length () != 6)
218 filter_lst.push_back (std::make_pair (flist(
i,0),
220 ? flist(
i,1) :
"")));
224 std::list<std::string> items_lst
228 nel = items_lst.size ();
233 if (items_lst.front ().empty ())
238 for (std::list<std::string>::iterator it = items_lst.begin ();
239 it != items_lst.end (); it++)
244 retval(idx++) = atoi (it->c_str ());
254 std::list<std::string>::iterator it = items_lst.begin ();
256 for (
int idx = 0; idx < nel; idx++, it++)
257 items.
xelem (idx) = *it;
259 retval =
ovl (items, *it++, atoi (it->c_str ()));
265 DEFUN (__octave_link_list_dialog__,
args, ,
271 if (
args.length () != 8)
277 std::list<std::string> list_lst;
279 list_lst.push_back (tlist(
i));
284 int width = size_matrix(0);
285 int height = size_matrix(1);
287 Matrix initial_matrix =
args(3).matrix_value ();
288 nel = initial_matrix.
numel ();
289 std::list<int> initial_lst;
291 initial_lst.push_back (initial_matrix(
i));
294 list =
args(5).cell_value ();
296 nel = plist.
numel ();
297 std::list<std::string> prompt_lst;
299 prompt_lst.push_back (plist(
i));
305 std::pair<std::list<int>,
int>
result
307 initial_lst, name, prompt_lst,
308 ok_string, cancel_string);
310 std::list<int> items_lst = result.first;
311 nel = items_lst.size ();
314 for (std::list<int>::iterator it = items_lst.begin ();
315 it != items_lst.end (); it++)
317 items.
xelem(i++) = *it;
320 return ovl (items, result.second);
323 DEFUN (__octave_link_input_dialog__,
args, ,
329 if (
args.length () != 4)
332 Cell prompt =
args(0).cell_value ();
335 std::list<std::string> prompt_lst;
337 prompt_lst.push_back (tmp(
i));
347 nr.push_back (rc(
i,0));
348 nc.push_back (rc(
i,1));
351 Cell defaults =
args(3).cell_value ();
354 std::list<std::string> defaults_lst;
356 defaults_lst.push_back (tmp(
i));
360 std::list<std::string> items_lst
364 nel = items_lst.size ();
367 for (std::list<std::string>::iterator it = items_lst.begin ();
368 it != items_lst.end (); it++)
370 items.
xelem(i++) = *it;
376 DEFUN (__octave_link_show_preferences__, , ,
393 if (
args.length () >= 1)
394 file =
args(0).string_value();
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
virtual ~octave_link(void)
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 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)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
octave_idx_type numel(void) const
Number of elements in the array.
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)
event_queue gui_event_queue
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
virtual void do_set_workspace(bool top_level, bool debug, const std::list< workspace_element > &ws)=0
octave_mutex * event_queue_mutex
static bool prompt_new_edit_file(const std::string &file)
octave_idx_type rows(void) const
static octave_link * instance
static scope_id top_scope(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)
Array< std::string > cellstr_value(void) const
void do_discard_events(void)
static void entered_readline_hook(void)
static bool edit_file(const std::string &file)
static void set_workspace(void)
void do_process_events(void)
static bool show_doc(const std::string &file)
static void connect_link(octave_link *)
With real return the complex result
T & xelem(octave_idx_type n)
static int octave_readline_hook(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)
=val(i)}if ode{val(i)}occurs in table i
static void generate_events(void)
static bool show_preferences()
void do_generate_events(void)
static void add_event_hook(event_hook_fcn f)
Vector representing the dimensions (size) of an Array.
static std::list< workspace_element > workspace_info(scope_id scope=xcurrent_scope)
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
octave_idx_type columns(void) const
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
static scope_id current_scope(void)