52 : event_queue_mutex (new
octave_mutex ()), gui_event_queue (),
53 debugging (false), link_enabled (true)
76 ::error (
"octave_link is already linked!");
106 DEFUN (__octave_link_enabled__, , ,
108 @deftypefn {Built-in Function} {} __octave_link_enabled__ ()\n\
109 Undocumented internal function.\n\
115 DEFUN (__octave_link_edit_file__, args, ,
117 @deftypefn {Built-in Function} {} __octave_link_edit_file__ (@var{file})\n\
118 Undocumented internal function.\n\
123 if (args.length () == 1)
134 error (
"expecting file name as argument");
136 else if (args.length () == 2)
138 std::string file = args(0).string_value ();
147 error (
"expecting file name as first argument");
153 DEFUN (__octave_link_message_dialog__, args, ,
155 @deftypefn {Built-in Function} {} __octave_link_message_dialog__ (@var{dlg}, @var{msg}, @var{title})\n\
156 Undocumented internal function.\n\
161 if (args.length () == 3)
164 std::string msg = args(1).string_value ();
165 std::string title = args(2).string_value ();
174 error (
"invalid arguments");
180 DEFUN (__octave_link_question_dialog__, args, ,
182 @deftypefn {Built-in Function} {} __octave_link_question_dialog__ (@var{msg}, @var{title}, @var{btn1}, @var{btn2}, @var{btn3}, @var{default})\n\
183 Undocumented internal function.\n\
188 if (args.length () == 6)
191 std::string title = args(1).string_value ();
192 std::string btn1 = args(2).string_value ();
193 std::string btn2 = args(3).string_value ();
194 std::string btn3 = args(4).string_value ();
195 std::string btndef = args(5).string_value ();
205 error (
"invalid arguments");
211 DEFUN (__octave_link_file_dialog__, args, ,
213 @deftypefn {Built-in Function} {} __octave_link_file_dialog__ (@var{filterlist}, @var{title}, @var{filename}, @var{size} @var{multiselect}, @var{pathname})\n\
214 Undocumented internal function.\n\
219 if (args.length () == 6)
223 std::string title = args(1).string_value ();
224 std::string filename = args(2).string_value ();
225 Matrix pos = args(3).matrix_value ();
226 std::string multi_on = args(4).string_value ();
227 std::string pathname = args(5).string_value ();
233 filter_lst.push_back (std::make_pair (flist(i,0),
235 ? flist(i,1) :
"")));
241 std::list<std::string> items_lst
245 nel = items_lst.size ();
253 for (std::list<std::string>::iterator it = items_lst.begin ();
254 it != items_lst.end (); it++)
258 if (idx == 1 && retval(0).string_value ().
length () == 0)
262 retval(2) = atoi (retval(2).string_value ().c_str ());
268 nel = items_lst.size () - 2;
271 std::list<std::string>::iterator it = items_lst.begin ();
273 for (
int idx = 0; idx < nel; idx++)
275 items.
xelem (idx) = *it;
281 retval(2) = atoi (it->c_str ());
285 error (
"invalid arguments");
291 DEFUN (__octave_link_list_dialog__, args, ,
293 @deftypefn {Built-in Function} {} __octave_link_list_dialog__ (@var{list}, @var{mode}, @var{size}, @var{intial}, @var{name}, @var{prompt}, @var{ok_string}, @var{cancel_string})\n\
294 Undocumented internal function.\n\
299 if (args.length () == 8)
301 Cell list = args(0).cell_value ();
304 std::list<std::string> list_lst;
306 list_lst.push_back (tlist(i));
308 std::string mode = args(1).string_value ();
310 Matrix size_matrix = args(2).matrix_value ();
311 int width = size_matrix(0);
312 int height = size_matrix(1);
314 Matrix initial_matrix = args(3).matrix_value ();
315 nel = initial_matrix.
numel ();
316 std::list<int> initial_lst;
318 initial_lst.push_back (initial_matrix(i));
320 std::string name = args(4).string_value ();
321 list = args(5).cell_value ();
323 nel = plist.
numel ();
324 std::list<std::string> prompt_lst;
326 prompt_lst.push_back (plist(i));
327 std::string ok_string = args(6).string_value ();
328 std::string cancel_string = args(7).string_value ();
334 std::pair<std::list<int>,
int> result
336 initial_lst, name, prompt_lst,
337 ok_string, cancel_string);
339 std::list<int> items_lst = result.first;
340 nel = items_lst.size ();
343 for (std::list<int>::iterator it = items_lst.begin ();
344 it != items_lst.end (); it++)
346 items.
xelem(i++) = *it;
349 retval(1) = result.second;
353 error (
"invalid arguments");
359 DEFUN (__octave_link_input_dialog__, args, ,
361 @deftypefn {Built-in Function} {} __octave_link_input_dialog__ (@var{prompt}, @var{title}, @var{rowscols}, @var{defaults})\n\
362 Undocumented internal function.\n\
367 if (args.length () == 4)
369 Cell prompt = args(0).cell_value ();
372 std::list<std::string> prompt_lst;
374 prompt_lst.push_back (tmp(i));
376 std::string title = args(1).string_value ();
378 Matrix rc = args(2).matrix_value ();
384 nr.push_back (rc(i,0));
385 nc.push_back (rc(i,1));
388 Cell defaults = args(3).cell_value ();
391 std::list<std::string> defaults_lst;
393 defaults_lst.push_back (tmp(i));
399 std::list<std::string> items_lst
403 nel = items_lst.size ();
406 for (std::list<std::string>::iterator it = items_lst.begin ();
407 it != items_lst.end (); it++)
409 items.
xelem(i++) = *it;
415 error (
"invalid arguments");
421 DEFUN (__octave_link_show_preferences__, , ,
423 @deftypefn {Built-in Function} {} __octave_link_show_preferences__ ()\n\
424 Undocumented internal function.\n\
434 DEFUN (__octave_link_show_doc__, args, ,
436 @deftypefn {Built-in Function} {} __octave_link_show_doc__ (@var{filename})\n\
437 Undocumented internal function.\n\
443 if (args.length () >= 1)
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 finished_readline_hook(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)
octave_idx_type numel(void) const
Number of elements in the array.
static bool enabled(void)
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,...)
static void add_event_hook(event_hook_fcn f)
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)
std::string string_value(bool force=false) const
static bool edit_file(const std::string &file)
static void set_workspace(void)
static std::list< workspace_element > workspace_info(void)
void do_process_events(void)
static bool show_doc(const std::string &file)
static void connect_link(octave_link *)
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)
static void generate_events(void)
static bool show_preferences()
void do_generate_events(void)
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
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)