diff src/graphics.cc @ 6595:55586d763de1

[project @ 2007-04-27 15:31:10 by dbateman]
author dbateman
date Fri, 27 Apr 2007 15:31:10 +0000
parents 9520d1004a73
children 49724abe1236
line wrap: on
line diff
--- a/src/graphics.cc	Fri Apr 27 15:00:10 2007 +0000
+++ b/src/graphics.cc	Fri Apr 27 15:31:10 2007 +0000
@@ -40,6 +40,8 @@
 #include <ov-fcn-handle.h>
 #include <parse.h>
 
+#include "graphics.h"
+
 static void
 gripe_set_invalid (const std::string& pname)
 {
@@ -3661,6 +3663,44 @@
   return octave_value (gh_manager::figure_handle_list ());
 }
 
+octave_value
+get_property_from_handle (double handle, const std::string &property,
+			  const std::string &func)
+{
+  graphics_object obj = gh_manager::get_object (handle);
+  octave_value retval;
+
+  if (obj)
+    {
+      property_name p = std::string (property);
+      retval = obj.get (p);
+    }
+  else
+    error ("%s: invalid handle (= %g)", func.c_str(), handle);
+
+  return retval;
+}
+
+bool
+set_property_in_handle (double handle, const std::string &property,
+			const octave_value &arg, const std::string &func)
+{
+  graphics_object obj = gh_manager::get_object (handle);
+  int ret = false;
+
+  if (obj)
+    {
+      property_name p = std::string (property);
+      obj.set (p, arg);
+      if (!error_state)
+	ret = true;
+    }
+  else
+    error ("%s: invalid handle (= %g)", func.c_str(), handle);
+
+  return ret;
+}
+
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***