Graphics properties as objects
Michael Goffioul
michael.goffioul at gmail.com
Thu Jan 10 05:34:04 CST 2008
Hi again [sorry to bother you so much],
I'd like to have your opinion about the option I'm using (taking all previous
comments into account), before completing the changes for the whole
graphics code.
I decided to keep the overloaded <object>::properties::get and the like,
because of the problem I reported earlier. I was reluctant to go that way,
because it does not scale well when you want to add a property or a
completely new object. But this can be mostly worked around if you try
to auto-generate as much as possible. This is what I'm trying now and
the result is in attachment (for the "figure" example)
The initial specs are (in graphics.h.in):
class properties : public base_properties
{
public:
void close (void);
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 , octave_NaN
array_property colormap , jet_colormap ()
bool_property visible S , "on"
radio_property paperorientation , "{portrait}|landscape"
color_property color , color_values (1, 1, 1)
END_PROPERTIES
};
This generates graphics.h (the generated portion is in figtest.h)
*and* an additional graphics-props.cc file (see attachment). This
file is intended to be simply included in graphics.cc and drastically
reduces the code that you have write manually.
What do you think about this scheme?
Michael.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: figtest.h
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080110/06362906/attachment-0001.h
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: graphics-props.cc
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080110/06362906/attachment-0001.ksh
More information about the Octave-maintainers
mailing list