changeset 6890:b2b7526a5772

[project @ 2007-09-12 20:14:35 by jwe]
author jwe
date Wed, 12 Sep 2007 20:14:35 +0000
parents ebff56d6b0a8
children e9921bb3d95b
files src/ChangeLog src/graphics.cc src/graphics.h.in src/gripes.cc src/gripes.h
diffstat 5 files changed, 45 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Sep 12 18:32:12 2007 +0000
+++ b/src/ChangeLog	Wed Sep 12 20:14:35 2007 +0000
@@ -1,3 +1,16 @@
+2007-09-12  John W. Eaton  <jwe@octave.org>
+
+	* graphics.cc (text::properties::properties): Default color is
+	black, not white.
+	* graphics.h (text::properties::color): Declare as color_property,
+	not octave_value.
+
+	* graphics.h.in (root_figure::defaults, figure::defaults,
+	axes::defaults, line::defaults, text::defaults, image::defaults,
+	patch::defaults, surface::defaults): New functions.
+	* gripes.cc (gripe_not_implemented): New function.
+	* gripes.h: Provide decl.
+
 2007-09-10  John W. Eaton  <jwe@octave.org>
 
 	* genprops.awk: Add missing newline character at end of file.
--- a/src/graphics.cc	Wed Sep 12 18:32:12 2007 +0000
+++ b/src/graphics.cc	Wed Sep 12 20:14:35 2007 +0000
@@ -1257,7 +1257,7 @@
 
 void
 axes::properties::set_defaults (base_graphics_object& obj,
-				     const std::string& mode)
+				const std::string& mode)
 {
   position = Matrix ();
   title = octave_NaN;
@@ -1873,7 +1873,7 @@
     position (Matrix (1, 3, 0.0)),
     rotation (0),
     horizontalalignment ("left"),
-    color (Matrix (1, 3, 1.0))
+    color (Matrix (1, 3, 0.0))
 { }
 
 void
--- a/src/graphics.h.in	Wed Sep 12 18:32:12 2007 +0000
+++ b/src/graphics.h.in	Wed Sep 12 20:14:35 2007 +0000
@@ -36,6 +36,7 @@
 #include <set>
 #include <string>
 
+#include "gripes.h"
 #include "oct-map.h"
 #include "ov.h"
 
@@ -915,6 +916,11 @@
 
   base_properties& get_properties (void) { return xproperties; }
 
+  void defaults (void) const
+  {
+    gripe_not_implemented ("root_figure::defaults");
+  }
+
   bool valid_object (void) const { return true; }
 
 private:
@@ -1049,6 +1055,8 @@
 
   base_properties& get_properties (void) { return xproperties; }
 
+  void defaults (void) const { gripe_not_implemented ("figure::defaults"); }
+
   bool valid_object (void) const { return true; }
 
 private:
@@ -1227,6 +1235,8 @@
 
   base_properties& get_properties (void) { return xproperties; }
 
+  void defaults (void) const { gripe_not_implemented ("axes::defaults"); }
+
   bool valid_object (void) const { return true; }
 
 private:
@@ -1332,6 +1342,8 @@
 
   base_properties& get_properties (void) { return xproperties; }
 
+  void defaults (void) const { gripe_not_implemented ("line::defaults"); }
+
   bool valid_object (void) const { return true; }
 };
 
@@ -1366,7 +1378,7 @@
       octave_value position
       octave_value rotation
       octave_value horizontalalignment
-      octave_value color
+      color_property color
     END_PROPERTIES
 
     static std::string go_name;
@@ -1425,6 +1437,8 @@
 
   base_properties& get_properties (void) { return xproperties; }
 
+  void defaults (void) const { gripe_not_implemented ("text::defaults"); }
+
   bool valid_object (void) const { return true; }
 };
 
@@ -1515,6 +1529,8 @@
 
   base_properties& get_properties (void) { return xproperties; }
 
+  void defaults (void) const { gripe_not_implemented ("image::defaults"); }
+
   bool valid_object (void) const { return true; }
 };
 
@@ -1615,6 +1631,8 @@
 
   base_properties& get_properties (void) { return xproperties; }
 
+  void defaults (void) const { gripe_not_implemented ("patch::defaults"); }
+
   bool valid_object (void) const { return true; }
 };
 
@@ -1706,6 +1724,8 @@
 
   base_properties& get_properties (void) { return xproperties; }
 
+  void defaults (void) const { gripe_not_implemented ("surface::defaults"); }
+
   bool valid_object (void) const { return true; }
 };
 
--- a/src/gripes.cc	Wed Sep 12 18:32:12 2007 +0000
+++ b/src/gripes.cc	Wed Sep 12 20:14:35 2007 +0000
@@ -38,6 +38,12 @@
 }
 
 void
+gripe_not_implemented (const char *fcn)
+{
+  error ("%s: not implemented", fcn);
+}
+
+void
 gripe_string_invalid (void)
 {
   error ("std::string constant used in invalid context");
--- a/src/gripes.h	Wed Sep 12 18:32:12 2007 +0000
+++ b/src/gripes.h	Wed Sep 12 20:14:35 2007 +0000
@@ -34,6 +34,9 @@
 gripe_not_supported (const char *);
 
 extern OCTINTERP_API void
+gripe_not_implemented (const char *);
+
+extern OCTINTERP_API void
 gripe_string_invalid (void);
 
 extern OCTINTERP_API void