octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [changeset] - have closereq() respect the property "tag"


From: John W. Eaton
Subject: Re: [changeset] - have closereq() respect the property "tag"
Date: Mon, 20 Oct 2008 12:24:21 -0400

On 20-Oct-2008, Ben Abbott wrote:

| On Oct 20, 2008, at 11:42 AM, John W. Eaton wrote:
| 
| > Hmm.  I suppose type should be "root" in Octave as well, instead of
| > "root_figure".
| >
| > jwe
| 
| I would think so. However, I have no idea what might presently rely  
| upon "root_figure".

I don't see any uses of it in the .m files, or any checks on the
object name that use "root_figure" in the C++ files, so I checked in
the following change.

jwe

# HG changeset patch
# User John W. Eaton <address@hidden>
# Date 1224519748 14400
# Node ID e41f420875dbb65416b3ca013f727e50c38fec00
# Parent  db19494c7c2a3735ddba417c10a9e9ec8620e07a
set name of root_figure object to root

diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-20  John W. Eaton  <address@hidden>
+
+       * genprops.awk: Allow whitespace between BEGIN_PROPERTIES and
+       opening paren.  Accept optional second argument for graphics
+       object name.
+       * graphics.h.in (root_figure properties): Pass "root" as second
+       arg to BEGIN_PROPERTIES.
+
 2008-10-16  John W. Eaton  <address@hidden>
 
        * graphics.cc (make_handle_fraction): New static function.
diff --git a/src/genprops.awk b/src/genprops.awk
--- a/src/genprops.awk
+++ b/src/genprops.awk
@@ -558,7 +558,7 @@
 
     if (! base)
       printf ("std::string %s::properties::go_name (\"%s\");\n\n",
-              class_name, class_name) >> filename;
+              class_name, object_name) >> filename;
   }
 }
 
@@ -569,14 +569,22 @@
   pcount = 0;
 }
 
-/BEGIN_PROPERTIES\(.*\)/ {
+/BEGIN_PROPERTIES *\(.*\)/ {
   gather = 1;
   idx = 0;
   str = $0;
-  k = index (str, "BEGIN_PROPERTIES(");
-  str = substr (str, k + 17);
-  l = index (str, ")");
-  class_name = substr (str, 1, l-1);
+  beg = index (str, "(") + 1;
+  len = index (str, ")") - beg;
+  args = substr (str, beg, len);
+  n = split (args, arg_list, ",");
+  if (n > 0)
+      class_name = arg_list[1];
+  if (n > 1)
+      object_name = arg_list[2];
+  else
+      object_name = class_name;
+  gsub (/ /, "", class_name);
+  gsub (/ /, "", object_name);
   base = 0;
   next;
 }
diff --git a/src/graphics.h.in b/src/graphics.h.in
--- a/src/graphics.h.in
+++ b/src/graphics.h.in
@@ -2094,7 +2094,7 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
-    BEGIN_PROPERTIES(root_figure)
+    BEGIN_PROPERTIES (root_figure, root)
       handle_property currentfigure S , graphics_handle ()
       handle_property callbackobject Sr , graphics_handle ()
       bool_property showhiddenhandles , "off"
@@ -2260,7 +2260,7 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
-    BEGIN_PROPERTIES(figure)
+    BEGIN_PROPERTIES (figure)
       any_property __plot_stream__ h , Matrix ()
       bool_property __enhanced__ h , "on"
       radio_property nextplot , "new|{add}|replace_children|replace"
@@ -2541,7 +2541,7 @@
 
     // properties which are not in matlab: interpreter
 
-    BEGIN_PROPERTIES(axes)
+    BEGIN_PROPERTIES (axes)
       array_property position u , default_axes_position ()
       handle_property title SOf , gh_manager::make_graphics_handle ("text", 
__myhandle__)
       bool_property box , "on"
@@ -2841,7 +2841,7 @@
     // properties which are not in matlab:
     // ldata, udata, xldata, xudata, keylabel, interpreter
 
-    BEGIN_PROPERTIES(line)
+    BEGIN_PROPERTIES (line)
       row_vector_property xdata u , default_data ()
       row_vector_property ydata u , default_data ()
       row_vector_property zdata u , Matrix ()
@@ -2918,7 +2918,7 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
-    BEGIN_PROPERTIES(text)
+    BEGIN_PROPERTIES (text)
       string_property string , ""
       radio_property units , 
"{data}|pixels|normalized|inches|centimeters|points"
       array_property position u , Matrix (1, 3, 0.0)
@@ -3016,7 +3016,7 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
-    BEGIN_PROPERTIES(image)
+    BEGIN_PROPERTIES (image)
       row_vector_property xdata u , Matrix ()
       row_vector_property ydata u , Matrix ()
       array_property cdata u , Matrix ()
@@ -3101,7 +3101,7 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
-    BEGIN_PROPERTIES(patch)
+    BEGIN_PROPERTIES (patch)
       array_property xdata u , Matrix ()
       array_property ydata u , Matrix ()
       array_property zdata u , Matrix ()
@@ -3219,7 +3219,7 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
-    BEGIN_PROPERTIES(surface)
+    BEGIN_PROPERTIES (surface)
       array_property xdata u , Matrix ()
       array_property ydata u , Matrix ()
       array_property zdata u , Matrix ()
@@ -3366,7 +3366,7 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
-    BEGIN_PROPERTIES(hggroup)
+    BEGIN_PROPERTIES (hggroup)
       // hidden properties for limit computation
       row_vector_property xlim hr , Matrix()
       row_vector_property ylim hr , Matrix()

reply via email to

[Prev in Thread] Current Thread [Next in Thread]