Mercurial > hg > octave-lojdl
changeset 7967:6add0f974aee
Add __go_execute_callback__
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 22 Jul 2008 17:24:17 -0400 |
parents | 5747be3ac497 |
children | 0d607e8dbbfa |
files | src/ChangeLog src/graphics.cc |
diffstat | 2 files changed, 48 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2008-07-22 Michael Goffioul <michael.goffioul@gmail.com> + * graphics.cc (F__go_execute_callback__): New function. + * DLD-FUNCTIONS/fltk_backend.cc: Undefine min/max after FLTK headers inclusion.
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -4415,6 +4415,52 @@ return octave_value (gh_manager::figure_handle_list ()); } +DEFUN (__go_execute_callback__, args, , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} __go_execute_callback__ (@var{h}, @var{name})\n\ +@deftypefnx {Built-in Function} {} __go_execute_callback__ (@var{h}, @var{name}, @var{param})\n\ +Undocumented internal function.\n\ +@end deftypefn") +{ + octave_value retval; + + int nargin = args.length (); + + if (nargin == 2 || nargin == 3) + { + double val = args(0).double_value (); + + if (! error_state) + { + graphics_handle h = gh_manager::lookup (val); + + if (h.ok ()) + { + std::string name = args(1).string_value (); + + if (! error_state) + { + if (nargin == 2) + gh_manager::execute_callback (h, name); + else + gh_manager::execute_callback (h, name, args(2)); + } + else + error ("__go_execute_callback__: invalid callback name"); + } + else + error ("__go_execute_callback__: invalid graphics object (= %g)", + val); + } + else + error ("__go_execute_callback__: invalid graphics object"); + } + else + print_usage (); + + return retval; +} + DEFUN (available_backends, , , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} available_backends ()\n\