Index: scripts/plot/__go_draw_axes__.m =================================================================== RCS file: /cvs/octave/scripts/plot/__go_draw_axes__.m,v retrieving revision 1.99 diff -c -p -r1.99 __go_draw_axes__.m *** scripts/plot/__go_draw_axes__.m 14 Jan 2008 19:50:10 -0000 1.99 --- scripts/plot/__go_draw_axes__.m 15 Jan 2008 13:57:39 -0000 *************** function __go_draw_axes__ (h, plot_strea *** 24,30 **** if (nargin == 4) ! axis_obj = get (h); parent_figure_obj = get (axis_obj.parent); --- 24,30 ---- if (nargin == 4) ! axis_obj = __get__ (h); parent_figure_obj = get (axis_obj.parent); Index: scripts/plot/__go_draw_figure__.m =================================================================== RCS file: /cvs/octave/scripts/plot/__go_draw_figure__.m,v retrieving revision 1.13 diff -c -p -r1.13 __go_draw_figure__.m *** scripts/plot/__go_draw_figure__.m 10 Dec 2007 06:52:51 -0000 1.13 --- scripts/plot/__go_draw_figure__.m 15 Jan 2008 13:57:39 -0000 *************** function __go_draw_figure__ (f, plot_str *** 33,39 **** if (nkids > 0) axes_count = 0; for i = 1:nkids ! obj = get (kids(i)); switch (obj.type) case "axes" axes_count++; --- 33,39 ---- if (nkids > 0) axes_count = 0; for i = 1:nkids ! obj = __get__ (kids(i)); switch (obj.type) case "axes" axes_count++; Index: scripts/plot/drawnow.m =================================================================== RCS file: /cvs/octave/scripts/plot/drawnow.m,v retrieving revision 1.30 diff -c -p -r1.30 drawnow.m *** scripts/plot/drawnow.m 9 Jan 2008 20:27:59 -0000 1.30 --- scripts/plot/drawnow.m 15 Jan 2008 13:57:39 -0000 *************** function drawnow (term, file, mono, debu *** 49,55 **** endif h = get (0, "currentfigure"); if (h) ! f = get (h); plot_stream = []; fid = []; unwind_protect --- 49,55 ---- endif h = get (0, "currentfigure"); if (h) ! f = __get__ (h); plot_stream = []; fid = []; unwind_protect *************** function drawnow (term, file, mono, debu *** 74,80 **** elseif (nargin == 0) for h = __go_figure_handles__ () if (! (isnan (h) || h == 0)) ! f = get (h); if (f.__modified__) plot_stream = f.__plot_stream__; figure_is_visible = strcmp (f.visible, "on"); --- 74,80 ---- elseif (nargin == 0) for h = __go_figure_handles__ () if (! (isnan (h) || h == 0)) ! f = __get__ (h); if (f.__modified__) plot_stream = f.__plot_stream__; figure_is_visible = strcmp (f.visible, "on"); Index: src/genprops.awk =================================================================== RCS file: /cvs/octave/src/genprops.awk,v retrieving revision 1.11 diff -c -p -r1.11 genprops.awk *** src/genprops.awk 14 Jan 2008 08:58:02 -0000 1.11 --- src/genprops.awk 15 Jan 2008 13:57:39 -0000 *************** *** 51,57 **** ## } ## ## If present, the QUALIFIERS string may include any of the characters ! ## g, G, m, s, S, o, O, which have the following meanings: ## ## g: There is a custom inline definition for the get function, ## so we don't emit one. --- 51,57 ---- ## } ## ## If present, the QUALIFIERS string may include any of the characters ! ## g, G, m, s, S, o, O, h, which have the following meanings: ## ## g: There is a custom inline definition for the get function, ## so we don't emit one. *************** *** 106,111 **** --- 106,113 ---- ## ## to the type-specific set function. ## + ## h: Make the property hidden + ## ## The 'o' and 'O' qualifiers are only useful when the the property type ## is something other than octave_value. *************** function emit_common_declarations () *** 204,210 **** printf (" properties (const graphics_handle& mh, const graphics_handle& p);\n\n"); printf (" ~properties (void) { }\n\n"); printf (" void set (const caseless_str& name, const octave_value& val);\n\n"); ! printf (" octave_value get (void) const;\n\n"); printf (" octave_value get (const caseless_str& name) const;\n\n"); printf (" std::string graphics_object_name (void) const { return go_name; }\n\n"); printf (" static property_list::pval_map_type factory_defaults (void);\n\n"); --- 206,212 ---- printf (" properties (const graphics_handle& mh, const graphics_handle& p);\n\n"); printf (" ~properties (void) { }\n\n"); printf (" void set (const caseless_str& name, const octave_value& val);\n\n"); ! printf (" octave_value get (bool all = false) const;\n\n"); printf (" octave_value get (const caseless_str& name) const;\n\n"); printf (" std::string graphics_object_name (void) const { return go_name; }\n\n"); printf (" static property_list::pval_map_type factory_defaults (void);\n\n"); *************** function emit_source () *** 322,333 **** printf ("\n") >> filename; } ! printf ("{\n init ();\n") >> filename; ! ## for (i = 1; i <= idx; i++) ! ## printf (" insert_static_property (\"%s\", %s);\n", name[i], name[i]) >> filename; ! printf ("}\n\n") >> filename; ## set method --- 324,339 ---- printf ("\n") >> filename; } ! printf ("{\n") >> filename; ! for (i = 1; i <= idx; i++) ! { ! ## printf (" insert_static_property (\"%s\", %s);\n", name[i], name[i]) >> filename; ! if (hidden[i]) ! printf (" %s.set_hidden (true);\n", name[i]) >> filename; ! } ! printf (" init ();\n}\n\n") >> filename; ## set method *************** function emit_source () *** 344,356 **** ## get "all" method ! printf ("octave_value\n%s::properties::get (void) const\n{\n", class_name) >> filename; ! printf (" Octave_map m = base_properties::get ().map_value ();\n\n") >> filename; for (i = 1; i <= idx; i++) { ! printf (" m.assign (\"%s\", get_%s ()%s);\n", name[i], name[i], ! (type[i] == "handle_property" ? ".as_octave_value ()" : "")) >> filename; } printf ("\n return m;\n}\n\n") >> filename; --- 350,366 ---- ## get "all" method ! printf ("octave_value\n%s::properties::get (bool all) const\n{\n", class_name) >> filename; ! printf (" Octave_map m = base_properties::get (all).map_value ();\n\n") >> filename; for (i = 1; i <= idx; i++) { ! if (hidden[i]) ! printf (" if (all)\n m.assign (\"%s\", get_%s ()%s);\n", name[i], name[i], ! (type[i] == "handle_property" ? ".as_octave_value ()" : "")) >> filename; ! else ! printf (" m.assign (\"%s\", get_%s ()%s);\n", name[i], name[i], ! (type[i] == "handle_property" ? ".as_octave_value ()" : "")) >> filename; } printf ("\n return m;\n}\n\n") >> filename; *************** BEGIN { *** 449,454 **** --- 459,465 ---- limits[idx] = 0; mode[idx] = 0; + hidden[idx] = 0; emit_get[idx] = "definition"; emit_set[idx] = "definition"; default[idx] = ""; *************** BEGIN { *** 488,493 **** --- 499,508 ---- ## but we still emit the declaration. if (index (quals, "S")) emit_set[idx] = "declaration"; + + ## The property is hidden + if (index (quals, "h")) + hidden[idx] = 1; ## ## emmit an asignment set function ## if (index (quals, "a")) Index: src/graphics.cc =================================================================== RCS file: /cvs/octave/src/graphics.cc,v retrieving revision 1.74 diff -c -p -r1.74 graphics.cc *** src/graphics.cc 15 Jan 2008 07:40:23 -0000 1.74 --- src/graphics.cc 15 Jan 2008 13:57:39 -0000 *************** base_properties::get (const caseless_str *** 954,970 **** } octave_value ! base_properties::get (void) const { Octave_map m; for (std::map::const_iterator it = all_props.begin (); it != all_props.end (); ++it) ! m.assign (it->second.get_name (), it->second.get ()); m.assign ("tag", get_tag ()); m.assign ("type", get_type ()); ! m.assign ("__modified__", is_modified ()); m.assign ("parent", get_parent ().as_octave_value ()); m.assign ("children", children); m.assign ("busyaction", get_busyaction ()); --- 954,972 ---- } octave_value ! base_properties::get (bool all) const { Octave_map m; for (std::map::const_iterator it = all_props.begin (); it != all_props.end (); ++it) ! if (all || ! it->second.is_hidden ()) ! m.assign (it->second.get_name (), it->second.get ()); m.assign ("tag", get_tag ()); m.assign ("type", get_type ()); ! if (all) ! m.assign ("__modified__", is_modified ()); m.assign ("parent", get_parent ().as_octave_value ()); m.assign ("children", children); m.assign ("busyaction", get_busyaction ()); *************** base_properties::mark_modified (void) *** 1107,1113 **** { __modified__ = "on"; graphics_object parent_obj = gh_manager::get_object (get_parent ()); ! parent_obj.mark_modified (); } void --- 1109,1116 ---- { __modified__ = "on"; graphics_object parent_obj = gh_manager::get_object (get_parent ()); ! if (parent_obj) ! parent_obj.mark_modified (); } void *************** values or lists respectively.\n\ *** 1970,1975 **** --- 1973,2033 ---- return retval; } + DEFUN (__get__, args, , + "-*- texinfo -*-\n\ + @deftypefn {Built-in Function} {} __get__ (@var{h})\n\ + Return all properties from the graphics handle @var{h}.\n\ + If @var{h} is a vector, return a cell array including the property\n\ + values or lists respectively.\n\ + @end deftypefn") + { + octave_value retval; + octave_value_list vlist; + + int nargin = args.length (); + + if (nargin == 1) + { + ColumnVector hcv (args(0).vector_value ()); + + if (! error_state) + { + octave_idx_type len = hcv.length (); + + vlist.resize (len); + + for (octave_idx_type n = 0; n < len; n++) + { + graphics_object obj = gh_manager::get_object (hcv(n)); + + if (obj) + vlist(n) = obj.get (true); + else + { + error ("get: invalid handle (= %g)", hcv(n)); + break; + } + } + } + else + error ("get: expecting graphics handle as first argument"); + } + else + print_usage (); + + if (! error_state) + { + octave_idx_type len = vlist.length (); + + if (len > 1) + retval = Cell (vlist); + else if (len == 1) + retval = vlist(0); + } + + return retval; + } + static octave_value make_graphics_object (const std::string& go_name, const octave_value_list& args) Index: src/graphics.h.in =================================================================== RCS file: /cvs/octave/src/graphics.h.in,v retrieving revision 1.36 diff -c -p -r1.36 graphics.h.in *** src/graphics.h.in 15 Jan 2008 06:57:15 -0000 1.36 --- src/graphics.h.in 15 Jan 2008 13:57:39 -0000 *************** public: *** 1005,1011 **** virtual octave_value get (const caseless_str&) const; ! virtual octave_value get (void) const; property get_property (const caseless_str&) const; --- 1005,1011 ---- virtual octave_value get (const caseless_str&) const; ! virtual octave_value get (bool all = false) const; property get_property (const caseless_str&) const; *************** public: *** 1314,1320 **** error ("base_graphics_object::set_defaults: invalid graphics object"); } ! virtual octave_value get (void) const { error ("base_graphics_object::get: invalid graphics object"); return octave_value (); --- 1314,1320 ---- error ("base_graphics_object::set_defaults: invalid graphics object"); } ! virtual octave_value get (bool all = false) const { error ("base_graphics_object::get: invalid graphics object"); return octave_value (); *************** public: *** 1453,1459 **** void set_defaults (const std::string& mode) { rep->set_defaults (mode); } ! octave_value get (void) const { return rep->get (); } octave_value get (const caseless_str& name) const { --- 1453,1459 ---- void set_defaults (const std::string& mode) { rep->set_defaults (mode); } ! octave_value get (bool all = false) const { return rep->get (all); } octave_value get (const caseless_str& name) const { *************** public: *** 1619,1627 **** xproperties.set (name, value); } ! octave_value get (void) const { ! return xproperties.get (); } octave_value get (const caseless_str& name) const --- 1619,1627 ---- xproperties.set (name, value); } ! octave_value get (bool all = false) const { ! return xproperties.get (all); } octave_value get (const caseless_str& name) const *************** public: *** 1710,1717 **** // properties declarations. BEGIN_PROPERTIES(figure) ! any_property __plot_stream__ , Matrix () ! bool_property __enhanced__ , "on" radio_property nextplot , "add|replace_children|{replace}" callback_property closerequestfcn , "closereq" handle_property currentaxes S , graphics_handle () --- 1710,1717 ---- // properties declarations. BEGIN_PROPERTIES(figure) ! any_property __plot_stream__ h , Matrix () ! bool_property __enhanced__ h , "on" radio_property nextplot , "add|replace_children|{replace}" callback_property closerequestfcn , "closereq" handle_property currentaxes S , graphics_handle () *************** public: *** 1777,1785 **** xproperties.set (name, value); } ! octave_value get (void) const { ! return xproperties.get (); } octave_value get (const caseless_str& name) const --- 1777,1785 ---- xproperties.set (name, value); } ! octave_value get (bool all = false) const { ! return xproperties.get (all); } octave_value get (const caseless_str& name) const *************** public: *** 1848,1854 **** array_property colororder , default_colororder () array_property dataaspectratio m , Matrix (1, 3, 1.0) radio_property dataaspectratiomode , "{auto}|manual" ! radio_property layer a , "{bottom}|top" array_property xlim m , default_lim () array_property ylim m , default_lim () array_property zlim m , default_lim () --- 1848,1854 ---- array_property colororder , default_colororder () array_property dataaspectratio m , Matrix (1, 3, 1.0) radio_property dataaspectratiomode , "{auto}|manual" ! radio_property layer , "{bottom}|top" array_property xlim m , default_lim () array_property ylim m , default_lim () array_property zlim m , default_lim () *************** public: *** 1878,1884 **** radio_property xticklabelmode , "{auto}|manual" radio_property yticklabelmode , "{auto}|manual" radio_property zticklabelmode , "{auto}|manual" ! color_property color a , color_property (color_values (1, 1, 1), radio_values ("none")) color_property xcolor , color_values (0, 0, 0) color_property ycolor , color_values (0, 0, 0) color_property zcolor , color_values (0, 0, 0) --- 1878,1884 ---- radio_property xticklabelmode , "{auto}|manual" radio_property yticklabelmode , "{auto}|manual" radio_property zticklabelmode , "{auto}|manual" ! color_property color , color_property (color_values (1, 1, 1), radio_values ("none")) color_property xcolor , color_values (0, 0, 0) color_property ycolor , color_values (0, 0, 0) color_property zcolor , color_values (0, 0, 0) *************** public: *** 1893,1900 **** array_property view , Matrix () radio_property nextplot , "add|replace_children|{replace}" array_property outerposition , Matrix () ! radio_property activepositionproperty a , "{outerposition}|position" ! radio_property __colorbar__ a , "{none}|north|south|east|west|northoutside|southoutside|eastoutside|westoutside" END_PROPERTIES protected: --- 1893,1900 ---- array_property view , Matrix () radio_property nextplot , "add|replace_children|{replace}" array_property outerposition , Matrix () ! radio_property activepositionproperty , "{outerposition}|position" ! radio_property __colorbar__ h , "{none}|north|south|east|west|northoutside|southoutside|eastoutside|westoutside" END_PROPERTIES protected: *************** public: *** 1970,1978 **** xproperties.set_defaults (*this, mode); } ! octave_value get (void) const { ! return xproperties.get (); } octave_value get (const caseless_str& name) const --- 1970,1978 ---- xproperties.set_defaults (*this, mode); } ! octave_value get (bool all = false) const { ! return xproperties.get (all); } octave_value get (const caseless_str& name) const *************** public: *** 2047,2053 **** color_property markerfacecolor , "auto|{none}" double_property markersize , 6 string_property keylabel , "" ! radio_property interpreter a , "{tex}|none|latex" string_property displayname , "" radio_property erase_mode , "{normal}|none|xor|background" END_PROPERTIES --- 2047,2053 ---- color_property markerfacecolor , "auto|{none}" double_property markersize , 6 string_property keylabel , "" ! radio_property interpreter , "{tex}|none|latex" string_property displayname , "" radio_property erase_mode , "{normal}|none|xor|background" END_PROPERTIES *************** public: *** 2086,2094 **** xproperties.set (name, val); } ! octave_value get (void) const { ! return xproperties.get (); } octave_value get (const caseless_str& name) const --- 2086,2094 ---- xproperties.set (name, val); } ! octave_value get (bool all = false) const { ! return xproperties.get (all); } octave_value get (const caseless_str& name) const *************** public: *** 2133,2141 **** color_property color , color_values (0, 0, 0) string_property fontname , "Helvetica" double_property fontsize , 10 ! radio_property fontangle a , "{normal}|italic|oblique" ! radio_property fontweight a , "light|{normal}|demi|bold" ! radio_property interpreter a , "{tex}|none|latex" color_property backgroundcolor , "{none}" string_property displayname , "" color_property edgecolor , "{none}" --- 2133,2141 ---- color_property color , color_values (0, 0, 0) string_property fontname , "Helvetica" double_property fontsize , 10 ! radio_property fontangle , "{normal}|italic|oblique" ! radio_property fontweight , "light|{normal}|demi|bold" ! radio_property interpreter , "{tex}|none|latex" color_property backgroundcolor , "{none}" string_property displayname , "" color_property edgecolor , "{none}" *************** public: *** 2188,2196 **** xproperties.set (name, val); } ! octave_value get (void) const { ! return xproperties.get (); } octave_value get (const caseless_str& name) const --- 2188,2196 ---- xproperties.set (name, val); } ! octave_value get (bool all = false) const { ! return xproperties.get (all); } octave_value get (const caseless_str& name) const *************** public: *** 2271,2279 **** xproperties.set (name, val); } ! octave_value get (void) const { ! return xproperties.get (); } octave_value get (const caseless_str& name) const --- 2271,2279 ---- xproperties.set (name, val); } ! octave_value get (bool all = false) const { ! return xproperties.get (all); } octave_value get (const caseless_str& name) const *************** public: *** 2314,2339 **** data_property ydata l , Matrix () data_property zdata l , Matrix () data_property cdata l , Matrix () ! radio_property cdatamapping a , "{scaled}|direct" array_property faces , Matrix () data_property facevertexalphadata , Matrix () data_property facevertexcdata , Matrix () array_property vertices , Matrix () array_property vertexnormals , Matrix () ! radio_property normalmode a , "{auto}|manual" ! color_property facecolor a , "{flat}|none|interp" double_property facealpha , 1.0 ! radio_property facelighting a , "{flat}|none|gouraud|phong" ! color_property edgecolor a , color_property (color_values (0, 0, 0), radio_values ("flat|none|interp")) double_property edgealpha , 1.0 ! radio_property edgelighting a , "{none}|flat|gouraud|phong" ! radio_property backfacelighting a , "{reverselit}|unlit|lit" double_property ambientstrength , 0.3 double_property diffusestrength , 0.6 double_property specularstrength , 0.6 double_property specularexponent , 10.0 double_property specularcolorreflectance , 1.0 ! radio_property erasemode a , "{normal}|background|xor|none" radio_property linestyle , "{-}|--|:|-.|none" double_property linewidth , 0.5 radio_property marker , "{none}|s|o|x|+|.|*|<|>|v|^|d|p|h" --- 2314,2339 ---- data_property ydata l , Matrix () data_property zdata l , Matrix () data_property cdata l , Matrix () ! radio_property cdatamapping , "{scaled}|direct" array_property faces , Matrix () data_property facevertexalphadata , Matrix () data_property facevertexcdata , Matrix () array_property vertices , Matrix () array_property vertexnormals , Matrix () ! radio_property normalmode , "{auto}|manual" ! color_property facecolor , "{flat}|none|interp" double_property facealpha , 1.0 ! radio_property facelighting , "{flat}|none|gouraud|phong" ! color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("flat|none|interp")) double_property edgealpha , 1.0 ! radio_property edgelighting , "{none}|flat|gouraud|phong" ! radio_property backfacelighting , "{reverselit}|unlit|lit" double_property ambientstrength , 0.3 double_property diffusestrength , 0.6 double_property specularstrength , 0.6 double_property specularexponent , 10.0 double_property specularcolorreflectance , 1.0 ! radio_property erasemode , "{normal}|background|xor|none" radio_property linestyle , "{-}|--|:|-.|none" double_property linewidth , 0.5 radio_property marker , "{none}|s|o|x|+|.|*|<|>|v|^|d|p|h" *************** public: *** 2341,2347 **** color_property markerfacecolor , "auto|{none}" double_property markersize , 6 string_property keylabel , "" ! radio_property interpreter a , "{tex}|none|latex" END_PROPERTIES protected: --- 2341,2347 ---- color_property markerfacecolor , "auto|{none}" double_property markersize , 6 string_property keylabel , "" ! radio_property interpreter , "{tex}|none|latex" END_PROPERTIES protected: *************** public: *** 2385,2393 **** xproperties.set (name, val); } ! octave_value get (void) const { ! return xproperties.get (); } octave_value get (const caseless_str& name) const --- 2385,2393 ---- xproperties.set (name, val); } ! octave_value get (bool all = false) const { ! return xproperties.get (all); } octave_value get (const caseless_str& name) const *************** public: *** 2428,2436 **** data_property ydata l , Matrix () data_property zdata l , Matrix () data_property cdata l , Matrix () ! color_property facecolor a , "{flat}|none|interp" double_property facealpha , 1.0 ! color_property edgecolor a , color_property (color_values (0, 0, 0), radio_values ("flat|none|interp")) radio_property linestyle , "{-}|--|:|-.|none" double_property linewidth , 0.5 radio_property marker , "{none}|s|o|x|+|.|*|<|>|v|^|d|p|h" --- 2428,2436 ---- data_property ydata l , Matrix () data_property zdata l , Matrix () data_property cdata l , Matrix () ! color_property facecolor , "{flat}|none|interp" double_property facealpha , 1.0 ! color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("flat|none|interp")) radio_property linestyle , "{-}|--|:|-.|none" double_property linewidth , 0.5 radio_property marker , "{none}|s|o|x|+|.|*|<|>|v|^|d|p|h" *************** public: *** 2438,2444 **** color_property markerfacecolor , "auto|{none}" double_property markersize , 6 string_property keylabel , "" ! radio_property interpreter a , "{tex}|none|latex" END_PROPERTIES protected: --- 2438,2444 ---- color_property markerfacecolor , "auto|{none}" double_property markersize , 6 string_property keylabel , "" ! radio_property interpreter , "{tex}|none|latex" END_PROPERTIES protected: *************** public: *** 2480,2488 **** xproperties.set (name, val); } ! octave_value get (void) const { ! return xproperties.get (); } octave_value get (const caseless_str& name) const --- 2480,2488 ---- xproperties.set (name, val); } ! octave_value get (bool all = false) const { ! return xproperties.get (all); } octave_value get (const caseless_str& name) const *************** private: *** 2639,2645 **** graphics_object do_get_object (const graphics_handle& h) { ! iterator p = handle_map.find (h); return (p != handle_map.end ()) ? p->second : graphics_object (); } --- 2639,2645 ---- graphics_object do_get_object (const graphics_handle& h) { ! iterator p = (h.ok () ? handle_map.find (h) : handle_map.end ()); return (p != handle_map.end ()) ? p->second : graphics_object (); }