# HG changeset patch # User jwe # Date 1189800537 0 # Node ID 1758d3d3d2663c8455e1ad146bc2301ef8fd412f # Parent a56ab599ac4ce7cbab755bc29de9a8fde41cbcb4 [project @ 2007-09-14 20:08:56 by jwe] diff -r a56ab599ac4c -r 1758d3d3d266 src/ChangeLog --- a/src/ChangeLog Fri Sep 14 19:47:12 2007 +0000 +++ b/src/ChangeLog Fri Sep 14 20:08:57 2007 +0000 @@ -1,3 +1,7 @@ +2007-09-14 Shai Ayal + + * genprop.awk: Handle "a" modifier. + 2007-09-14 Kai Habel * graphics.h.in (radio_values::contains): New function. diff -r a56ab599ac4c -r 1758d3d3d266 src/genprops.awk --- a/src/genprops.awk Fri Sep 14 19:47:12 2007 +0000 +++ b/src/genprops.awk Fri Sep 14 20:08:57 2007 +0000 @@ -53,6 +53,29 @@ ## O: There is a custom extern definition for the octave_value version ## of the set function, so we emit only the declaration. ## +## a: The octave_value version of the set function will use assignment: +## +## void +## set_NAME (const octave_value& val) +## { +## TYPE tmp (NAME); +## tmp = val; +## set_NAME (tmp); +## } +## +## This is useful for things like the radio_value classes which +## use an overloaded assignment operator of the form +## +## radio_property& operator = (const octave_value& val); +## +## that preserves the list of possible values, which is different +## from what would happen if we simply used the +## +## TYPE (const octave_value&) +## +## constructor, which creates a new radio_property and so cannot +## preserve the old list of possible values. +## ## m: Add the line ## ## set_NAMEmode ("manual"); @@ -113,6 +136,11 @@ if (emit_ov_set[i] == "defn") printf (" { set_%s (%s (val)); }\n\n", name[i], type[i]); + else if (emit_ov_set[i] == "asign") + { + printf ("\n {\n %s tmp (%s);\n tmp = val;\n set_%s (tmp);\n };\n\n", + type[i], name[i], name[i], name[i]); + } else printf (";\n"); } @@ -194,6 +222,10 @@ if (index (quals, "S")) emit_set[idx] = "decl"; + ## emmit an asignment set function + if (index (quals, "a")) + emit_ov_set[idx] = "asign"; + if (type[idx] != "octave_value") { ## The 'o' and 'O' qualifiers are only useful when the