1) Some method of installing Octave builtin functions that can override
the present builtin functions and still access the core builtin
functions. This is analogous to the C++ inheritance concept. Say the C++
code for the GUI that sets up builtins is something like:
octave_link = launch_octave_in_another_thread ();
/* INSTALL */
octave_link->install_octave_command ("dbstop",
octave_link::qt_dbstop_routine);
octave_link->install_octave_command ("dbclear",
octave_link::qt_dbclear_routine);
octave_link->install_octave_command ("dbcont",
octave_link::qt_dbcontinue_routine);
etc.
for which an example routine might be:
octave_value_list
octave_link::qt_dbstop_routine (varargs, etc.)
{
/* ACCESS CORE */
octave_value_list retval = corefeval ("dbstop", varargs, etc.);
// Now interpret the retval and its ramifications on Qt GUI elements.
if (retval[0].is_numeric ())
{
QString filename = varargs[0].string_value ().c_str();
// Found a valid breakpoint.
emit add_breakpoint (filename, retval[0].int_value());
}
return retval;
}
The above code needs no callbacks, hooks, etc. Just the
install_octave_command() and corefeval() routine.