// DO NOT EDIT!  Generated automatically by genprops.awk.

// ******** base ********

base_properties::base_properties (const std::string& ty, const graphics_handle& mh, const graphics_handle& p)
  :     m_beingdeleted ("beingdeleted", mh, "off"),
    m_busyaction ("busyaction", mh, "{queue}|cancel"),
    m_buttondownfcn ("buttondownfcn", mh, Matrix ()),
    m_children ("children", mh, Matrix ()),
    m_clipping ("clipping", mh, "on"),
    m_contextmenu ("contextmenu", mh, graphics_handle ()),
    m_createfcn ("createfcn", mh, Matrix ()),
    m_deletefcn ("deletefcn", mh, Matrix ()),
    m_handlevisibility ("handlevisibility", mh, "{on}|callback|off"),
    m_hittest ("hittest", mh, "on"),
    m_interruptible ("interruptible", mh, "on"),
    m_parent ("parent", mh, p),
    m_pickableparts ("pickableparts", mh, "{visible}|all|none"),
    m_selected ("selected", mh, "off"),
    m_selectionhighlight ("selectionhighlight", mh, "on"),
    m_tag ("tag", mh, ""),
    m_type ("type", mh, ty),
    m_uicontextmenu ("uicontextmenu", mh, graphics_handle ()),
    m_userdata ("userdata", mh, Matrix ()),
    m_visible ("visible", mh, "on"),
    m___appdata__ ("__appdata__", mh, Matrix ()),
    m___modified__ ("__modified__", mh, "on"),
    m___myhandle__ (mh)
{
  m_beingdeleted.set_id (ID_BEINGDELETED);
  m_busyaction.set_id (ID_BUSYACTION);
  m_buttondownfcn.set_id (ID_BUTTONDOWNFCN);
  m_children.set_id (ID_CHILDREN);
  m_clipping.set_id (ID_CLIPPING);
  m_contextmenu.set_id (ID_CONTEXTMENU);
  m_createfcn.set_id (ID_CREATEFCN);
  m_deletefcn.set_id (ID_DELETEFCN);
  m_handlevisibility.set_id (ID_HANDLEVISIBILITY);
  m_hittest.set_id (ID_HITTEST);
  m_interruptible.set_id (ID_INTERRUPTIBLE);
  m_parent.set_id (ID_PARENT);
  m_pickableparts.set_id (ID_PICKABLEPARTS);
  m_selected.set_id (ID_SELECTED);
  m_selectionhighlight.set_id (ID_SELECTIONHIGHLIGHT);
  m_tag.set_id (ID_TAG);
  m_type.set_id (ID_TYPE);
  m_uicontextmenu.set_id (ID_UICONTEXTMENU);
  m_uicontextmenu.set_hidden (true);
  m_userdata.set_id (ID_USERDATA);
  m_visible.set_id (ID_VISIBLE);
  m___appdata__.set_id (ID___APPDATA__);
  m___appdata__.set_hidden (true);
  m___modified__.set_id (ID___MODIFIED__);
  m___modified__.set_hidden (true);
  init ();
}

void
base_properties::set (const caseless_str& pname, const octave_value& val)
{
  if (pname.compare ("beingdeleted"))
    set_beingdeleted (val);
  else if (pname.compare ("busyaction"))
    set_busyaction (val);
  else if (pname.compare ("buttondownfcn"))
    set_buttondownfcn (val);
  else if (pname.compare ("children"))
    set_children (val);
  else if (pname.compare ("clipping"))
    set_clipping (val);
  else if (pname.compare ("contextmenu"))
    set_contextmenu (val);
  else if (pname.compare ("createfcn"))
    set_createfcn (val);
  else if (pname.compare ("deletefcn"))
    set_deletefcn (val);
  else if (pname.compare ("handlevisibility"))
    set_handlevisibility (val);
  else if (pname.compare ("hittest"))
    set_hittest (val);
  else if (pname.compare ("interruptible"))
    set_interruptible (val);
  else if (pname.compare ("parent"))
    set_parent (val);
  else if (pname.compare ("pickableparts"))
    set_pickableparts (val);
  else if (pname.compare ("selected"))
    set_selected (val);
  else if (pname.compare ("selectionhighlight"))
    set_selectionhighlight (val);
  else if (pname.compare ("tag"))
    set_tag (val);
  else if (pname.compare ("uicontextmenu"))
    set_uicontextmenu (val);
  else if (pname.compare ("userdata"))
    set_userdata (val);
  else if (pname.compare ("visible"))
    set_visible (val);
  else if (pname.compare ("__appdata__"))
    set___appdata__ (val);
  else if (pname.compare ("__modified__"))
    set___modified__ (val);
  else
    set_dynamic (pname, val);
}

octave_value
base_properties::get (bool all) const
{
  octave_map m = get_dynamic (all).map_value ();

  m.assign ("beingdeleted", octave_value (get_beingdeleted ()));
  m.assign ("busyaction", octave_value (get_busyaction ()));
  m.assign ("buttondownfcn", octave_value (get_buttondownfcn ()));
  m.assign ("children", octave_value (get_children ()));
  m.assign ("clipping", octave_value (get_clipping ()));
  m.assign ("contextmenu", octave_value (get_contextmenu ().as_octave_value ()));
  m.assign ("createfcn", octave_value (get_createfcn ()));
  m.assign ("deletefcn", octave_value (get_deletefcn ()));
  m.assign ("handlevisibility", octave_value (get_handlevisibility ()));
  m.assign ("hittest", octave_value (get_hittest ()));
  m.assign ("interruptible", octave_value (get_interruptible ()));
  m.assign ("parent", octave_value (get_parent ().as_octave_value ()));
  m.assign ("pickableparts", octave_value (get_pickableparts ()));
  m.assign ("selected", octave_value (get_selected ()));
  m.assign ("selectionhighlight", octave_value (get_selectionhighlight ()));
  m.assign ("tag", octave_value (get_tag ()));
  m.assign ("type", octave_value (get_type ()));
  if (all)
    m.assign ("uicontextmenu", octave_value (get_uicontextmenu ().as_octave_value ()));
  m.assign ("userdata", octave_value (get_userdata ()));
  m.assign ("visible", octave_value (get_visible ()));
  if (all)
    m.assign ("__appdata__", octave_value (get___appdata__ ()));
  if (all)
    m.assign ("__modified__", octave_value (get___modified__ ()));
  if (all)
    m.assign ("__myhandle__", octave_value (get___myhandle__ ().as_octave_value ()));

  return m;
}

octave_value
base_properties::get (const caseless_str& pname) const
{
  octave_value retval;

  if (pname.compare ("beingdeleted"))
    retval = get_beingdeleted ();
  else if (pname.compare ("busyaction"))
    retval = get_busyaction ();
  else if (pname.compare ("buttondownfcn"))
    retval = get_buttondownfcn ();
  else if (pname.compare ("children"))
    retval = get_children ();
  else if (pname.compare ("clipping"))
    retval = get_clipping ();
  else if (pname.compare ("contextmenu"))
    retval = get_contextmenu ().as_octave_value ();
  else if (pname.compare ("createfcn"))
    retval = get_createfcn ();
  else if (pname.compare ("deletefcn"))
    retval = get_deletefcn ();
  else if (pname.compare ("handlevisibility"))
    retval = get_handlevisibility ();
  else if (pname.compare ("hittest"))
    retval = get_hittest ();
  else if (pname.compare ("interruptible"))
    retval = get_interruptible ();
  else if (pname.compare ("parent"))
    retval = get_parent ().as_octave_value ();
  else if (pname.compare ("pickableparts"))
    retval = get_pickableparts ();
  else if (pname.compare ("selected"))
    retval = get_selected ();
  else if (pname.compare ("selectionhighlight"))
    retval = get_selectionhighlight ();
  else if (pname.compare ("tag"))
    retval = get_tag ();
  else if (pname.compare ("type"))
    retval = get_type ();
  else if (pname.compare ("uicontextmenu"))
    retval = get_uicontextmenu ().as_octave_value ();
  else if (pname.compare ("userdata"))
    retval = get_userdata ();
  else if (pname.compare ("visible"))
    retval = get_visible ();
  else if (pname.compare ("__appdata__"))
    retval = get___appdata__ ();
  else if (pname.compare ("__modified__"))
    retval = get___modified__ ();
  else if (pname.compare ("__myhandle__"))
    retval = get___myhandle__ ().as_octave_value ();
  else
    retval = get_dynamic (pname);

  return retval;
}

property
base_properties::get_property (const caseless_str& pname)
{
  if (pname.compare ("beingdeleted"))
    return property (&m_beingdeleted, true);
  else if (pname.compare ("busyaction"))
    return property (&m_busyaction, true);
  else if (pname.compare ("buttondownfcn"))
    return property (&m_buttondownfcn, true);
  else if (pname.compare ("children"))
    return property (&m_children, true);
  else if (pname.compare ("clipping"))
    return property (&m_clipping, true);
  else if (pname.compare ("contextmenu"))
    return property (&m_contextmenu, true);
  else if (pname.compare ("createfcn"))
    return property (&m_createfcn, true);
  else if (pname.compare ("deletefcn"))
    return property (&m_deletefcn, true);
  else if (pname.compare ("handlevisibility"))
    return property (&m_handlevisibility, true);
  else if (pname.compare ("hittest"))
    return property (&m_hittest, true);
  else if (pname.compare ("interruptible"))
    return property (&m_interruptible, true);
  else if (pname.compare ("parent"))
    return property (&m_parent, true);
  else if (pname.compare ("pickableparts"))
    return property (&m_pickableparts, true);
  else if (pname.compare ("selected"))
    return property (&m_selected, true);
  else if (pname.compare ("selectionhighlight"))
    return property (&m_selectionhighlight, true);
  else if (pname.compare ("tag"))
    return property (&m_tag, true);
  else if (pname.compare ("type"))
    return property (&m_type, true);
  else if (pname.compare ("uicontextmenu"))
    return property (&m_uicontextmenu, true);
  else if (pname.compare ("userdata"))
    return property (&m_userdata, true);
  else if (pname.compare ("visible"))
    return property (&m_visible, true);
  else if (pname.compare ("__appdata__"))
    return property (&m___appdata__, true);
  else if (pname.compare ("__modified__"))
    return property (&m___modified__, true);
  else
    return get_property_dynamic (pname);
}

property_list::pval_map_type
base_properties::factory_defaults ()
{
  property_list::pval_map_type m;

  m["beingdeleted"] = "off";
  m["busyaction"] = "queue";
  m["buttondownfcn"] = Matrix ();
  m["clipping"] = "on";
  m["contextmenu"] = graphics_handle ().as_octave_value ();
  m["createfcn"] = Matrix ();
  m["deletefcn"] = Matrix ();
  m["handlevisibility"] = "on";
  m["hittest"] = "on";
  m["interruptible"] = "on";
  m["pickableparts"] = "visible";
  m["selected"] = "off";
  m["selectionhighlight"] = "on";
  m["tag"] = "";
  m["uicontextmenu"] = graphics_handle ().as_octave_value ();
  m["userdata"] = Matrix ();
  m["visible"] = "on";
  m["__appdata__"] = Matrix ();
  m["__modified__"] = "on";

  return m;
}

std::set<std::string>
base_properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("beingdeleted");
      all_pnames.insert ("busyaction");
      all_pnames.insert ("buttondownfcn");
      all_pnames.insert ("children");
      all_pnames.insert ("clipping");
      all_pnames.insert ("contextmenu");
      all_pnames.insert ("createfcn");
      all_pnames.insert ("deletefcn");
      all_pnames.insert ("handlevisibility");
      all_pnames.insert ("hittest");
      all_pnames.insert ("interruptible");
      all_pnames.insert ("parent");
      all_pnames.insert ("pickableparts");
      all_pnames.insert ("selected");
      all_pnames.insert ("selectionhighlight");
      all_pnames.insert ("tag");
      all_pnames.insert ("type");
      all_pnames.insert ("uicontextmenu");
      all_pnames.insert ("userdata");
      all_pnames.insert ("visible");
      all_pnames.insert ("__appdata__");
      all_pnames.insert ("__modified__");
      all_pnames.insert ("__myhandle__");

      initialized = true;
    }

  return all_pnames;
}

bool
base_properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
base_properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("type");
      all_pnames.insert ("__myhandle__");

      initialized = true;
    }

  return all_pnames;
}

bool
base_properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
base_properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> dyn_props = dynamic_property_names ();
  retval.insert (dyn_props.begin (), dyn_props.end ());
  for (std::map<caseless_str, property, cmp_caseless_str>::const_iterator p = m_all_props.begin ();
       p != m_all_props.end (); p++)
    retval.insert (p->first);

  return retval;
}

// ******** root_figure ********

root_figure::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_callbackobject ("callbackobject", mh, graphics_handle ()),
    m_commandwindowsize ("commandwindowsize", mh, Matrix (1, 2, 0)),
    m_currentfigure ("currentfigure", mh, graphics_handle ()),
    m_fixedwidthfontname ("fixedwidthfontname", mh, "Courier"),
    m_monitorpositions ("monitorpositions", mh, default_screensize ()),
    m_pointerlocation ("pointerlocation", mh, Matrix (1, 2, 0)),
    m_pointerwindow ("pointerwindow", mh, 0.0),
    m_screendepth ("screendepth", mh, default_screendepth ()),
    m_screenpixelsperinch ("screenpixelsperinch", mh, default_screenpixelsperinch ()),
    m_screensize ("screensize", mh, default_screensize ()),
    m_showhiddenhandles ("showhiddenhandles", mh, "off"),
    m_units ("units", mh, "{pixels}|inches|centimeters|points|normalized|characters")
{
  m_callbackobject.set_id (ID_CALLBACKOBJECT);
  m_commandwindowsize.set_id (ID_COMMANDWINDOWSIZE);
  m_currentfigure.set_id (ID_CURRENTFIGURE);
  m_fixedwidthfontname.set_id (ID_FIXEDWIDTHFONTNAME);
  m_monitorpositions.set_id (ID_MONITORPOSITIONS);
  m_pointerlocation.set_id (ID_POINTERLOCATION);
  m_pointerwindow.set_id (ID_POINTERWINDOW);
  m_screendepth.set_id (ID_SCREENDEPTH);
  m_screenpixelsperinch.set_id (ID_SCREENPIXELSPERINCH);
  m_screensize.set_id (ID_SCREENSIZE);
  m_showhiddenhandles.set_id (ID_SHOWHIDDENHANDLES);
  m_units.set_id (ID_UNITS);
  init ();
}

void
root_figure::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("currentfigure"))
    set_currentfigure (val);
  else if (pname.compare ("fixedwidthfontname"))
    set_fixedwidthfontname (val);
  else if (pname.compare ("pointerlocation"))
    set_pointerlocation (val);
  else if (pname.compare ("showhiddenhandles"))
    set_showhiddenhandles (val);
  else if (pname.compare ("units"))
    set_units (val);
  else
    base_properties::set (pname, val);
}

octave_value
root_figure::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("callbackobject", octave_value (get_callbackobject ().as_octave_value ()));
  m.assign ("commandwindowsize", octave_value (get_commandwindowsize ()));
  m.assign ("currentfigure", octave_value (get_currentfigure ().as_octave_value ()));
  m.assign ("fixedwidthfontname", octave_value (get_fixedwidthfontname ()));
  m.assign ("monitorpositions", octave_value (get_monitorpositions ()));
  m.assign ("pointerlocation", octave_value (get_pointerlocation ()));
  m.assign ("pointerwindow", octave_value (get_pointerwindow ()));
  m.assign ("screendepth", octave_value (get_screendepth ()));
  m.assign ("screenpixelsperinch", octave_value (get_screenpixelsperinch ()));
  m.assign ("screensize", octave_value (get_screensize ()));
  m.assign ("showhiddenhandles", octave_value (get_showhiddenhandles ()));
  m.assign ("units", octave_value (get_units ()));

  return m;
}

octave_value
root_figure::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("callbackobject"))
    retval = get_callbackobject ().as_octave_value ();
  else if (pname.compare ("commandwindowsize"))
    retval = get_commandwindowsize ();
  else if (pname.compare ("currentfigure"))
    retval = get_currentfigure ().as_octave_value ();
  else if (pname.compare ("fixedwidthfontname"))
    retval = get_fixedwidthfontname ();
  else if (pname.compare ("monitorpositions"))
    retval = get_monitorpositions ();
  else if (pname.compare ("pointerlocation"))
    retval = get_pointerlocation ();
  else if (pname.compare ("pointerwindow"))
    retval = get_pointerwindow ();
  else if (pname.compare ("screendepth"))
    retval = get_screendepth ();
  else if (pname.compare ("screenpixelsperinch"))
    retval = get_screenpixelsperinch ();
  else if (pname.compare ("screensize"))
    retval = get_screensize ();
  else if (pname.compare ("showhiddenhandles"))
    retval = get_showhiddenhandles ();
  else if (pname.compare ("units"))
    retval = get_units ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
root_figure::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("callbackobject"))
    return property (&m_callbackobject, true);
  else if (pname.compare ("commandwindowsize"))
    return property (&m_commandwindowsize, true);
  else if (pname.compare ("currentfigure"))
    return property (&m_currentfigure, true);
  else if (pname.compare ("fixedwidthfontname"))
    return property (&m_fixedwidthfontname, true);
  else if (pname.compare ("monitorpositions"))
    return property (&m_monitorpositions, true);
  else if (pname.compare ("pointerlocation"))
    return property (&m_pointerlocation, true);
  else if (pname.compare ("pointerwindow"))
    return property (&m_pointerwindow, true);
  else if (pname.compare ("screendepth"))
    return property (&m_screendepth, true);
  else if (pname.compare ("screenpixelsperinch"))
    return property (&m_screenpixelsperinch, true);
  else if (pname.compare ("screensize"))
    return property (&m_screensize, true);
  else if (pname.compare ("showhiddenhandles"))
    return property (&m_showhiddenhandles, true);
  else if (pname.compare ("units"))
    return property (&m_units, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
root_figure::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["callbackobject"] = graphics_handle ().as_octave_value ();
  m["commandwindowsize"] = Matrix (1, 2, 0);
  m["currentfigure"] = graphics_handle ().as_octave_value ();
  m["fixedwidthfontname"] = "Courier";
  m["monitorpositions"] = default_screensize ();
  m["pointerlocation"] = Matrix (1, 2, 0);
  m["pointerwindow"] = 0.0;
  m["screendepth"] = default_screendepth ();
  m["screenpixelsperinch"] = default_screenpixelsperinch ();
  m["screensize"] = default_screensize ();
  m["showhiddenhandles"] = "off";
  m["units"] = "pixels";

  return m;
}

std::string root_figure::properties::s_go_name ("root");

std::set<std::string>
root_figure::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("callbackobject");
      all_pnames.insert ("commandwindowsize");
      all_pnames.insert ("currentfigure");
      all_pnames.insert ("fixedwidthfontname");
      all_pnames.insert ("monitorpositions");
      all_pnames.insert ("pointerlocation");
      all_pnames.insert ("pointerwindow");
      all_pnames.insert ("screendepth");
      all_pnames.insert ("screenpixelsperinch");
      all_pnames.insert ("screensize");
      all_pnames.insert ("showhiddenhandles");
      all_pnames.insert ("units");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
root_figure::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
root_figure::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("callbackobject");
      all_pnames.insert ("commandwindowsize");
      all_pnames.insert ("monitorpositions");
      all_pnames.insert ("pointerwindow");
      all_pnames.insert ("screendepth");
      all_pnames.insert ("screenpixelsperinch");
      all_pnames.insert ("screensize");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
root_figure::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
root_figure::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
root_figure::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** figure ********

figure::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_alphamap ("alphamap", mh, Matrix (64, 1, 1)),
    m_buttondownfcn ("buttondownfcn", mh, Matrix ()),
    m_closerequestfcn ("closerequestfcn", mh, "closereq"),
    m_color ("color", mh, color_property (color_values (1, 1, 1), radio_values ("none"))),
    m_colormap ("colormap", mh, viridis_colormap ()),
    m_currentaxes ("currentaxes", mh, graphics_handle ()),
    m_currentcharacter ("currentcharacter", mh, ""),
    m_currentobject ("currentobject", mh, graphics_handle ()),
    m_currentpoint ("currentpoint", mh, Matrix (2, 1, 0)),
    m_dockcontrols ("dockcontrols", mh, "on"),
    m_filename ("filename", mh, ""),
    m_graphicssmoothing ("graphicssmoothing", mh, "on"),
    m_innerposition ("innerposition", mh, default_figure_position ()),
    m_integerhandle ("integerhandle", mh, "on"),
    m_inverthardcopy ("inverthardcopy", mh, "on"),
    m_keypressfcn ("keypressfcn", mh, Matrix ()),
    m_keyreleasefcn ("keyreleasefcn", mh, Matrix ()),
    m_menubar ("menubar", mh, "{figure}|none"),
    m_name ("name", mh, ""),
    m_number ("number", mh, Matrix ()),
    m_nextplot ("nextplot", mh, "{add}|new|replace|replacechildren"),
    m_numbertitle ("numbertitle", mh, "on"),
    m_outerposition ("outerposition", mh, Matrix (1, 4, -1.0)),
    m_paperorientation ("paperorientation", mh, "{portrait}|landscape"),
    m_paperposition ("paperposition", mh, default_figure_paperposition ()),
    m_paperpositionmode ("paperpositionmode", mh, "{auto}|manual"),
    m_papersize ("papersize", mh, default_figure_papersize ()),
    m_papertype ("papertype", mh, "{usletter}|uslegal|a0|a1|a2|a3|a4|a5|b0|b1|b2|b3|b4|b5|arch-a|arch-b|arch-c|arch-d|arch-e|a|b|c|d|e|tabloid|<custom>"),
    m_paperunits ("paperunits", mh, "{inches}|centimeters|normalized|points"),
    m_pointer ("pointer", mh, "{arrow}|crosshair|ibeam|watch|topl|topr|botl|botr|left|top|right|bottom|circle|cross|fleur|custom|hand"),
    m_pointershapecdata ("pointershapecdata", mh, Matrix (16, 16, 1)),
    m_pointershapehotspot ("pointershapehotspot", mh, Matrix (1, 2, 1)),
    m_position ("position", mh, default_figure_position ()),
    m_renderer ("renderer", mh, "{opengl}|painters"),
    m_renderermode ("renderermode", mh, "{auto}|manual"),
    m_resize ("resize", mh, "on"),
    m_resizefcn ("resizefcn", mh, Matrix ()),
    m_selectiontype ("selectiontype", mh, "{normal}|extend|alt|open"),
    m_sizechangedfcn ("sizechangedfcn", mh, Matrix ()),
    m_toolbar ("toolbar", mh, "{auto}|figure|none"),
    m_units ("units", mh, "{pixels}|normalized|inches|centimeters|points|characters"),
    m_windowbuttondownfcn ("windowbuttondownfcn", mh, Matrix ()),
    m_windowbuttonmotionfcn ("windowbuttonmotionfcn", mh, Matrix ()),
    m_windowbuttonupfcn ("windowbuttonupfcn", mh, Matrix ()),
    m_windowkeypressfcn ("windowkeypressfcn", mh, Matrix ()),
    m_windowkeyreleasefcn ("windowkeyreleasefcn", mh, Matrix ()),
    m_windowscrollwheelfcn ("windowscrollwheelfcn", mh, Matrix ()),
    m_windowstate ("windowstate", mh, "{normal}|minimized|maximized|fullscreen"),
    m_windowstyle ("windowstyle", mh, "{normal}|modal|docked"),
    m_pickableparts ("pickableparts", mh, "{visible}"),
    m___gl_extensions__ ("__gl_extensions__", mh, ""),
    m___gl_renderer__ ("__gl_renderer__", mh, ""),
    m___gl_vendor__ ("__gl_vendor__", mh, ""),
    m___gl_version__ ("__gl_version__", mh, ""),
    m___gl_window__ ("__gl_window__", mh, "off"),
    m___graphics_toolkit__ ("__graphics_toolkit__", mh, default_graphics_toolkit ()),
    m___guidata__ ("__guidata__", mh, Matrix ()),
    m___mouse_mode__ ("__mouse_mode__", mh, "{none}|pan|rotate|select|text|zoom"),
    m___printing__ ("__printing__", mh, "off"),
    m___pan_mode__ ("__pan_mode__", mh, Matrix ()),
    m___plot_stream__ ("__plot_stream__", mh, Matrix ()),
    m___rotate_mode__ ("__rotate_mode__", mh, Matrix ()),
    m___zoom_mode__ ("__zoom_mode__", mh, Matrix ()),
    m___device_pixel_ratio__ ("__device_pixel_ratio__", mh, 1.0)
{
  m_alphamap.set_id (ID_ALPHAMAP);
  m_buttondownfcn.set_id (ID_BUTTONDOWNFCN);
  m_closerequestfcn.set_id (ID_CLOSEREQUESTFCN);
  m_color.set_id (ID_COLOR);
  m_colormap.set_id (ID_COLORMAP);
  m_currentaxes.set_id (ID_CURRENTAXES);
  m_currentcharacter.set_id (ID_CURRENTCHARACTER);
  m_currentobject.set_id (ID_CURRENTOBJECT);
  m_currentpoint.set_id (ID_CURRENTPOINT);
  m_dockcontrols.set_id (ID_DOCKCONTROLS);
  m_filename.set_id (ID_FILENAME);
  m_graphicssmoothing.set_id (ID_GRAPHICSSMOOTHING);
  m_innerposition.set_id (ID_INNERPOSITION);
  m_integerhandle.set_id (ID_INTEGERHANDLE);
  m_inverthardcopy.set_id (ID_INVERTHARDCOPY);
  m_keypressfcn.set_id (ID_KEYPRESSFCN);
  m_keyreleasefcn.set_id (ID_KEYRELEASEFCN);
  m_menubar.set_id (ID_MENUBAR);
  m_name.set_id (ID_NAME);
  m_number.set_id (ID_NUMBER);
  m_nextplot.set_id (ID_NEXTPLOT);
  m_numbertitle.set_id (ID_NUMBERTITLE);
  m_outerposition.set_id (ID_OUTERPOSITION);
  m_paperorientation.set_id (ID_PAPERORIENTATION);
  m_paperposition.set_id (ID_PAPERPOSITION);
  m_paperpositionmode.set_id (ID_PAPERPOSITIONMODE);
  m_papersize.set_id (ID_PAPERSIZE);
  m_papertype.set_id (ID_PAPERTYPE);
  m_paperunits.set_id (ID_PAPERUNITS);
  m_pointer.set_id (ID_POINTER);
  m_pointershapecdata.set_id (ID_POINTERSHAPECDATA);
  m_pointershapehotspot.set_id (ID_POINTERSHAPEHOTSPOT);
  m_position.set_id (ID_POSITION);
  m_renderer.set_id (ID_RENDERER);
  m_renderermode.set_id (ID_RENDERERMODE);
  m_resize.set_id (ID_RESIZE);
  m_resizefcn.set_id (ID_RESIZEFCN);
  m_selectiontype.set_id (ID_SELECTIONTYPE);
  m_sizechangedfcn.set_id (ID_SIZECHANGEDFCN);
  m_toolbar.set_id (ID_TOOLBAR);
  m_units.set_id (ID_UNITS);
  m_windowbuttondownfcn.set_id (ID_WINDOWBUTTONDOWNFCN);
  m_windowbuttonmotionfcn.set_id (ID_WINDOWBUTTONMOTIONFCN);
  m_windowbuttonupfcn.set_id (ID_WINDOWBUTTONUPFCN);
  m_windowkeypressfcn.set_id (ID_WINDOWKEYPRESSFCN);
  m_windowkeyreleasefcn.set_id (ID_WINDOWKEYRELEASEFCN);
  m_windowscrollwheelfcn.set_id (ID_WINDOWSCROLLWHEELFCN);
  m_windowstate.set_id (ID_WINDOWSTATE);
  m_windowstyle.set_id (ID_WINDOWSTYLE);
  m_pickableparts.set_id (ID_PICKABLEPARTS);
  m_pickableparts.set_hidden (true);
  m___gl_extensions__.set_id (ID___GL_EXTENSIONS__);
  m___gl_extensions__.set_hidden (true);
  m___gl_renderer__.set_id (ID___GL_RENDERER__);
  m___gl_renderer__.set_hidden (true);
  m___gl_vendor__.set_id (ID___GL_VENDOR__);
  m___gl_vendor__.set_hidden (true);
  m___gl_version__.set_id (ID___GL_VERSION__);
  m___gl_version__.set_hidden (true);
  m___gl_window__.set_id (ID___GL_WINDOW__);
  m___gl_window__.set_hidden (true);
  m___graphics_toolkit__.set_id (ID___GRAPHICS_TOOLKIT__);
  m___graphics_toolkit__.set_hidden (true);
  m___guidata__.set_id (ID___GUIDATA__);
  m___guidata__.set_hidden (true);
  m___mouse_mode__.set_id (ID___MOUSE_MODE__);
  m___mouse_mode__.set_hidden (true);
  m___printing__.set_id (ID___PRINTING__);
  m___printing__.set_hidden (true);
  m___pan_mode__.set_id (ID___PAN_MODE__);
  m___pan_mode__.set_hidden (true);
  m___plot_stream__.set_id (ID___PLOT_STREAM__);
  m___plot_stream__.set_hidden (true);
  m___rotate_mode__.set_id (ID___ROTATE_MODE__);
  m___rotate_mode__.set_hidden (true);
  m___zoom_mode__.set_id (ID___ZOOM_MODE__);
  m___zoom_mode__.set_hidden (true);
  m___device_pixel_ratio__.set_id (ID___DEVICE_PIXEL_RATIO__);
  m___device_pixel_ratio__.set_hidden (true);
  init ();
}

void
figure::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("alphamap"))
    set_alphamap (val);
  else if (pname.compare ("buttondownfcn"))
    set_buttondownfcn (val);
  else if (pname.compare ("closerequestfcn"))
    set_closerequestfcn (val);
  else if (pname.compare ("color"))
    set_color (val);
  else if (pname.compare ("colormap"))
    set_colormap (val);
  else if (pname.compare ("currentaxes"))
    set_currentaxes (val);
  else if (pname.compare ("dockcontrols"))
    set_dockcontrols (val);
  else if (pname.compare ("filename"))
    set_filename (val);
  else if (pname.compare ("graphicssmoothing"))
    set_graphicssmoothing (val);
  else if (pname.compare ("innerposition"))
    set_innerposition (val);
  else if (pname.compare ("integerhandle"))
    set_integerhandle (val);
  else if (pname.compare ("inverthardcopy"))
    set_inverthardcopy (val);
  else if (pname.compare ("keypressfcn"))
    set_keypressfcn (val);
  else if (pname.compare ("keyreleasefcn"))
    set_keyreleasefcn (val);
  else if (pname.compare ("menubar"))
    set_menubar (val);
  else if (pname.compare ("name"))
    set_name (val);
  else if (pname.compare ("nextplot"))
    set_nextplot (val);
  else if (pname.compare ("numbertitle"))
    set_numbertitle (val);
  else if (pname.compare ("outerposition"))
    set_outerposition (val);
  else if (pname.compare ("paperorientation"))
    set_paperorientation (val);
  else if (pname.compare ("paperposition"))
    set_paperposition (val);
  else if (pname.compare ("paperpositionmode"))
    set_paperpositionmode (val);
  else if (pname.compare ("papersize"))
    set_papersize (val);
  else if (pname.compare ("papertype"))
    set_papertype (val);
  else if (pname.compare ("paperunits"))
    set_paperunits (val);
  else if (pname.compare ("pointer"))
    set_pointer (val);
  else if (pname.compare ("pointershapecdata"))
    set_pointershapecdata (val);
  else if (pname.compare ("pointershapehotspot"))
    set_pointershapehotspot (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("renderer"))
    set_renderer (val);
  else if (pname.compare ("renderermode"))
    set_renderermode (val);
  else if (pname.compare ("resize"))
    set_resize (val);
  else if (pname.compare ("resizefcn"))
    set_resizefcn (val);
  else if (pname.compare ("selectiontype"))
    set_selectiontype (val);
  else if (pname.compare ("sizechangedfcn"))
    set_sizechangedfcn (val);
  else if (pname.compare ("toolbar"))
    set_toolbar (val);
  else if (pname.compare ("units"))
    set_units (val);
  else if (pname.compare ("windowbuttondownfcn"))
    set_windowbuttondownfcn (val);
  else if (pname.compare ("windowbuttonmotionfcn"))
    set_windowbuttonmotionfcn (val);
  else if (pname.compare ("windowbuttonupfcn"))
    set_windowbuttonupfcn (val);
  else if (pname.compare ("windowkeypressfcn"))
    set_windowkeypressfcn (val);
  else if (pname.compare ("windowkeyreleasefcn"))
    set_windowkeyreleasefcn (val);
  else if (pname.compare ("windowscrollwheelfcn"))
    set_windowscrollwheelfcn (val);
  else if (pname.compare ("windowstate"))
    set_windowstate (val);
  else if (pname.compare ("windowstyle"))
    set_windowstyle (val);
  else if (pname.compare ("pickableparts"))
    set_pickableparts (val);
  else if (pname.compare ("__gl_window__"))
    set___gl_window__ (val);
  else if (pname.compare ("__graphics_toolkit__"))
    set___graphics_toolkit__ (val);
  else if (pname.compare ("__guidata__"))
    set___guidata__ (val);
  else if (pname.compare ("__mouse_mode__"))
    set___mouse_mode__ (val);
  else if (pname.compare ("__printing__"))
    set___printing__ (val);
  else if (pname.compare ("__pan_mode__"))
    set___pan_mode__ (val);
  else if (pname.compare ("__plot_stream__"))
    set___plot_stream__ (val);
  else if (pname.compare ("__rotate_mode__"))
    set___rotate_mode__ (val);
  else if (pname.compare ("__zoom_mode__"))
    set___zoom_mode__ (val);
  else if (pname.compare ("__device_pixel_ratio__"))
    set___device_pixel_ratio__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
figure::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("alphamap", octave_value (get_alphamap ()));
  m.assign ("buttondownfcn", octave_value (get_buttondownfcn ()));
  m.assign ("closerequestfcn", octave_value (get_closerequestfcn ()));
  m.assign ("color", octave_value (get_color ()));
  m.assign ("colormap", octave_value (get_colormap ()));
  m.assign ("currentaxes", octave_value (get_currentaxes ().as_octave_value ()));
  m.assign ("currentcharacter", octave_value (get_currentcharacter ()));
  m.assign ("currentobject", octave_value (get_currentobject ().as_octave_value ()));
  m.assign ("currentpoint", octave_value (get_currentpoint ()));
  m.assign ("dockcontrols", octave_value (get_dockcontrols ()));
  m.assign ("filename", octave_value (get_filename ()));
  m.assign ("graphicssmoothing", octave_value (get_graphicssmoothing ()));
  m.assign ("innerposition", octave_value (get_innerposition ()));
  m.assign ("integerhandle", octave_value (get_integerhandle ()));
  m.assign ("inverthardcopy", octave_value (get_inverthardcopy ()));
  m.assign ("keypressfcn", octave_value (get_keypressfcn ()));
  m.assign ("keyreleasefcn", octave_value (get_keyreleasefcn ()));
  m.assign ("menubar", octave_value (get_menubar ()));
  m.assign ("name", octave_value (get_name ()));
  m.assign ("number", octave_value (get_number ()));
  m.assign ("nextplot", octave_value (get_nextplot ()));
  m.assign ("numbertitle", octave_value (get_numbertitle ()));
  m.assign ("outerposition", octave_value (get_outerposition ()));
  m.assign ("paperorientation", octave_value (get_paperorientation ()));
  m.assign ("paperposition", octave_value (get_paperposition ()));
  m.assign ("paperpositionmode", octave_value (get_paperpositionmode ()));
  m.assign ("papersize", octave_value (get_papersize ()));
  m.assign ("papertype", octave_value (get_papertype ()));
  m.assign ("paperunits", octave_value (get_paperunits ()));
  m.assign ("pointer", octave_value (get_pointer ()));
  m.assign ("pointershapecdata", octave_value (get_pointershapecdata ()));
  m.assign ("pointershapehotspot", octave_value (get_pointershapehotspot ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("renderer", octave_value (get_renderer ()));
  m.assign ("renderermode", octave_value (get_renderermode ()));
  m.assign ("resize", octave_value (get_resize ()));
  m.assign ("resizefcn", octave_value (get_resizefcn ()));
  m.assign ("selectiontype", octave_value (get_selectiontype ()));
  m.assign ("sizechangedfcn", octave_value (get_sizechangedfcn ()));
  m.assign ("toolbar", octave_value (get_toolbar ()));
  m.assign ("units", octave_value (get_units ()));
  m.assign ("windowbuttondownfcn", octave_value (get_windowbuttondownfcn ()));
  m.assign ("windowbuttonmotionfcn", octave_value (get_windowbuttonmotionfcn ()));
  m.assign ("windowbuttonupfcn", octave_value (get_windowbuttonupfcn ()));
  m.assign ("windowkeypressfcn", octave_value (get_windowkeypressfcn ()));
  m.assign ("windowkeyreleasefcn", octave_value (get_windowkeyreleasefcn ()));
  m.assign ("windowscrollwheelfcn", octave_value (get_windowscrollwheelfcn ()));
  m.assign ("windowstate", octave_value (get_windowstate ()));
  m.assign ("windowstyle", octave_value (get_windowstyle ()));
  if (all)
    m.assign ("pickableparts", octave_value (get_pickableparts ()));
  if (all)
    m.assign ("__gl_extensions__", octave_value (get___gl_extensions__ ()));
  if (all)
    m.assign ("__gl_renderer__", octave_value (get___gl_renderer__ ()));
  if (all)
    m.assign ("__gl_vendor__", octave_value (get___gl_vendor__ ()));
  if (all)
    m.assign ("__gl_version__", octave_value (get___gl_version__ ()));
  if (all)
    m.assign ("__gl_window__", octave_value (get___gl_window__ ()));
  if (all)
    m.assign ("__graphics_toolkit__", octave_value (get___graphics_toolkit__ ()));
  if (all)
    m.assign ("__guidata__", octave_value (get___guidata__ ()));
  if (all)
    m.assign ("__mouse_mode__", octave_value (get___mouse_mode__ ()));
  if (all)
    m.assign ("__printing__", octave_value (get___printing__ ()));
  if (all)
    m.assign ("__pan_mode__", octave_value (get___pan_mode__ ()));
  if (all)
    m.assign ("__plot_stream__", octave_value (get___plot_stream__ ()));
  if (all)
    m.assign ("__rotate_mode__", octave_value (get___rotate_mode__ ()));
  if (all)
    m.assign ("__zoom_mode__", octave_value (get___zoom_mode__ ()));
  if (all)
    m.assign ("__device_pixel_ratio__", octave_value (get___device_pixel_ratio__ ()));

  return m;
}

octave_value
figure::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("alphamap"))
    retval = get_alphamap ();
  else if (pname.compare ("buttondownfcn"))
    retval = get_buttondownfcn ();
  else if (pname.compare ("closerequestfcn"))
    retval = get_closerequestfcn ();
  else if (pname.compare ("color"))
    retval = get_color ();
  else if (pname.compare ("colormap"))
    retval = get_colormap ();
  else if (pname.compare ("currentaxes"))
    retval = get_currentaxes ().as_octave_value ();
  else if (pname.compare ("currentcharacter"))
    retval = get_currentcharacter ();
  else if (pname.compare ("currentobject"))
    retval = get_currentobject ().as_octave_value ();
  else if (pname.compare ("currentpoint"))
    retval = get_currentpoint ();
  else if (pname.compare ("dockcontrols"))
    retval = get_dockcontrols ();
  else if (pname.compare ("filename"))
    retval = get_filename ();
  else if (pname.compare ("graphicssmoothing"))
    retval = get_graphicssmoothing ();
  else if (pname.compare ("innerposition"))
    retval = get_innerposition ();
  else if (pname.compare ("integerhandle"))
    retval = get_integerhandle ();
  else if (pname.compare ("inverthardcopy"))
    retval = get_inverthardcopy ();
  else if (pname.compare ("keypressfcn"))
    retval = get_keypressfcn ();
  else if (pname.compare ("keyreleasefcn"))
    retval = get_keyreleasefcn ();
  else if (pname.compare ("menubar"))
    retval = get_menubar ();
  else if (pname.compare ("name"))
    retval = get_name ();
  else if (pname.compare ("number"))
    retval = get_number ();
  else if (pname.compare ("nextplot"))
    retval = get_nextplot ();
  else if (pname.compare ("numbertitle"))
    retval = get_numbertitle ();
  else if (pname.compare ("outerposition"))
    retval = get_outerposition ();
  else if (pname.compare ("paperorientation"))
    retval = get_paperorientation ();
  else if (pname.compare ("paperposition"))
    retval = get_paperposition ();
  else if (pname.compare ("paperpositionmode"))
    retval = get_paperpositionmode ();
  else if (pname.compare ("papersize"))
    retval = get_papersize ();
  else if (pname.compare ("papertype"))
    retval = get_papertype ();
  else if (pname.compare ("paperunits"))
    retval = get_paperunits ();
  else if (pname.compare ("pointer"))
    retval = get_pointer ();
  else if (pname.compare ("pointershapecdata"))
    retval = get_pointershapecdata ();
  else if (pname.compare ("pointershapehotspot"))
    retval = get_pointershapehotspot ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("renderer"))
    retval = get_renderer ();
  else if (pname.compare ("renderermode"))
    retval = get_renderermode ();
  else if (pname.compare ("resize"))
    retval = get_resize ();
  else if (pname.compare ("resizefcn"))
    retval = get_resizefcn ();
  else if (pname.compare ("selectiontype"))
    retval = get_selectiontype ();
  else if (pname.compare ("sizechangedfcn"))
    retval = get_sizechangedfcn ();
  else if (pname.compare ("toolbar"))
    retval = get_toolbar ();
  else if (pname.compare ("units"))
    retval = get_units ();
  else if (pname.compare ("windowbuttondownfcn"))
    retval = get_windowbuttondownfcn ();
  else if (pname.compare ("windowbuttonmotionfcn"))
    retval = get_windowbuttonmotionfcn ();
  else if (pname.compare ("windowbuttonupfcn"))
    retval = get_windowbuttonupfcn ();
  else if (pname.compare ("windowkeypressfcn"))
    retval = get_windowkeypressfcn ();
  else if (pname.compare ("windowkeyreleasefcn"))
    retval = get_windowkeyreleasefcn ();
  else if (pname.compare ("windowscrollwheelfcn"))
    retval = get_windowscrollwheelfcn ();
  else if (pname.compare ("windowstate"))
    retval = get_windowstate ();
  else if (pname.compare ("windowstyle"))
    retval = get_windowstyle ();
  else if (pname.compare ("pickableparts"))
    retval = get_pickableparts ();
  else if (pname.compare ("__gl_extensions__"))
    retval = get___gl_extensions__ ();
  else if (pname.compare ("__gl_renderer__"))
    retval = get___gl_renderer__ ();
  else if (pname.compare ("__gl_vendor__"))
    retval = get___gl_vendor__ ();
  else if (pname.compare ("__gl_version__"))
    retval = get___gl_version__ ();
  else if (pname.compare ("__gl_window__"))
    retval = get___gl_window__ ();
  else if (pname.compare ("__graphics_toolkit__"))
    retval = get___graphics_toolkit__ ();
  else if (pname.compare ("__guidata__"))
    retval = get___guidata__ ();
  else if (pname.compare ("__mouse_mode__"))
    retval = get___mouse_mode__ ();
  else if (pname.compare ("__printing__"))
    retval = get___printing__ ();
  else if (pname.compare ("__pan_mode__"))
    retval = get___pan_mode__ ();
  else if (pname.compare ("__plot_stream__"))
    retval = get___plot_stream__ ();
  else if (pname.compare ("__rotate_mode__"))
    retval = get___rotate_mode__ ();
  else if (pname.compare ("__zoom_mode__"))
    retval = get___zoom_mode__ ();
  else if (pname.compare ("__device_pixel_ratio__"))
    retval = get___device_pixel_ratio__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
figure::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("alphamap"))
    return property (&m_alphamap, true);
  else if (pname.compare ("buttondownfcn"))
    return property (&m_buttondownfcn, true);
  else if (pname.compare ("closerequestfcn"))
    return property (&m_closerequestfcn, true);
  else if (pname.compare ("color"))
    return property (&m_color, true);
  else if (pname.compare ("colormap"))
    return property (&m_colormap, true);
  else if (pname.compare ("currentaxes"))
    return property (&m_currentaxes, true);
  else if (pname.compare ("currentcharacter"))
    return property (&m_currentcharacter, true);
  else if (pname.compare ("currentobject"))
    return property (&m_currentobject, true);
  else if (pname.compare ("currentpoint"))
    return property (&m_currentpoint, true);
  else if (pname.compare ("dockcontrols"))
    return property (&m_dockcontrols, true);
  else if (pname.compare ("filename"))
    return property (&m_filename, true);
  else if (pname.compare ("graphicssmoothing"))
    return property (&m_graphicssmoothing, true);
  else if (pname.compare ("innerposition"))
    return property (&m_innerposition, true);
  else if (pname.compare ("integerhandle"))
    return property (&m_integerhandle, true);
  else if (pname.compare ("inverthardcopy"))
    return property (&m_inverthardcopy, true);
  else if (pname.compare ("keypressfcn"))
    return property (&m_keypressfcn, true);
  else if (pname.compare ("keyreleasefcn"))
    return property (&m_keyreleasefcn, true);
  else if (pname.compare ("menubar"))
    return property (&m_menubar, true);
  else if (pname.compare ("name"))
    return property (&m_name, true);
  else if (pname.compare ("number"))
    return property (&m_number, true);
  else if (pname.compare ("nextplot"))
    return property (&m_nextplot, true);
  else if (pname.compare ("numbertitle"))
    return property (&m_numbertitle, true);
  else if (pname.compare ("outerposition"))
    return property (&m_outerposition, true);
  else if (pname.compare ("paperorientation"))
    return property (&m_paperorientation, true);
  else if (pname.compare ("paperposition"))
    return property (&m_paperposition, true);
  else if (pname.compare ("paperpositionmode"))
    return property (&m_paperpositionmode, true);
  else if (pname.compare ("papersize"))
    return property (&m_papersize, true);
  else if (pname.compare ("papertype"))
    return property (&m_papertype, true);
  else if (pname.compare ("paperunits"))
    return property (&m_paperunits, true);
  else if (pname.compare ("pointer"))
    return property (&m_pointer, true);
  else if (pname.compare ("pointershapecdata"))
    return property (&m_pointershapecdata, true);
  else if (pname.compare ("pointershapehotspot"))
    return property (&m_pointershapehotspot, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("renderer"))
    return property (&m_renderer, true);
  else if (pname.compare ("renderermode"))
    return property (&m_renderermode, true);
  else if (pname.compare ("resize"))
    return property (&m_resize, true);
  else if (pname.compare ("resizefcn"))
    return property (&m_resizefcn, true);
  else if (pname.compare ("selectiontype"))
    return property (&m_selectiontype, true);
  else if (pname.compare ("sizechangedfcn"))
    return property (&m_sizechangedfcn, true);
  else if (pname.compare ("toolbar"))
    return property (&m_toolbar, true);
  else if (pname.compare ("units"))
    return property (&m_units, true);
  else if (pname.compare ("windowbuttondownfcn"))
    return property (&m_windowbuttondownfcn, true);
  else if (pname.compare ("windowbuttonmotionfcn"))
    return property (&m_windowbuttonmotionfcn, true);
  else if (pname.compare ("windowbuttonupfcn"))
    return property (&m_windowbuttonupfcn, true);
  else if (pname.compare ("windowkeypressfcn"))
    return property (&m_windowkeypressfcn, true);
  else if (pname.compare ("windowkeyreleasefcn"))
    return property (&m_windowkeyreleasefcn, true);
  else if (pname.compare ("windowscrollwheelfcn"))
    return property (&m_windowscrollwheelfcn, true);
  else if (pname.compare ("windowstate"))
    return property (&m_windowstate, true);
  else if (pname.compare ("windowstyle"))
    return property (&m_windowstyle, true);
  else if (pname.compare ("pickableparts"))
    return property (&m_pickableparts, true);
  else if (pname.compare ("__gl_extensions__"))
    return property (&m___gl_extensions__, true);
  else if (pname.compare ("__gl_renderer__"))
    return property (&m___gl_renderer__, true);
  else if (pname.compare ("__gl_vendor__"))
    return property (&m___gl_vendor__, true);
  else if (pname.compare ("__gl_version__"))
    return property (&m___gl_version__, true);
  else if (pname.compare ("__gl_window__"))
    return property (&m___gl_window__, true);
  else if (pname.compare ("__graphics_toolkit__"))
    return property (&m___graphics_toolkit__, true);
  else if (pname.compare ("__guidata__"))
    return property (&m___guidata__, true);
  else if (pname.compare ("__mouse_mode__"))
    return property (&m___mouse_mode__, true);
  else if (pname.compare ("__printing__"))
    return property (&m___printing__, true);
  else if (pname.compare ("__pan_mode__"))
    return property (&m___pan_mode__, true);
  else if (pname.compare ("__plot_stream__"))
    return property (&m___plot_stream__, true);
  else if (pname.compare ("__rotate_mode__"))
    return property (&m___rotate_mode__, true);
  else if (pname.compare ("__zoom_mode__"))
    return property (&m___zoom_mode__, true);
  else if (pname.compare ("__device_pixel_ratio__"))
    return property (&m___device_pixel_ratio__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
figure::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["alphamap"] = Matrix (64, 1, 1);
  m["buttondownfcn"] = Matrix ();
  m["closerequestfcn"] = "closereq";
  m["color"] = color_property (color_values (1, 1, 1), radio_values ("none"));
  m["colormap"] = viridis_colormap ();
  m["currentaxes"] = graphics_handle ().as_octave_value ();
  m["currentcharacter"] = "";
  m["currentobject"] = graphics_handle ().as_octave_value ();
  m["currentpoint"] = Matrix (2, 1, 0);
  m["dockcontrols"] = "on";
  m["filename"] = "";
  m["graphicssmoothing"] = "on";
  m["innerposition"] = default_figure_position ();
  m["integerhandle"] = "on";
  m["inverthardcopy"] = "on";
  m["keypressfcn"] = Matrix ();
  m["keyreleasefcn"] = Matrix ();
  m["menubar"] = "figure";
  m["name"] = "";
  m["number"] = Matrix ();
  m["nextplot"] = "add";
  m["numbertitle"] = "on";
  m["outerposition"] = Matrix (1, 4, -1.0);
  m["paperorientation"] = "portrait";
  m["paperposition"] = default_figure_paperposition ();
  m["paperpositionmode"] = "auto";
  m["papersize"] = default_figure_papersize ();
  m["papertype"] = "usletter";
  m["paperunits"] = "inches";
  m["pointer"] = "arrow";
  m["pointershapecdata"] = Matrix (16, 16, 1);
  m["pointershapehotspot"] = Matrix (1, 2, 1);
  m["position"] = default_figure_position ();
  m["renderer"] = "opengl";
  m["renderermode"] = "auto";
  m["resize"] = "on";
  m["resizefcn"] = Matrix ();
  m["selectiontype"] = "normal";
  m["sizechangedfcn"] = Matrix ();
  m["toolbar"] = "auto";
  m["units"] = "pixels";
  m["windowbuttondownfcn"] = Matrix ();
  m["windowbuttonmotionfcn"] = Matrix ();
  m["windowbuttonupfcn"] = Matrix ();
  m["windowkeypressfcn"] = Matrix ();
  m["windowkeyreleasefcn"] = Matrix ();
  m["windowscrollwheelfcn"] = Matrix ();
  m["windowstate"] = "normal";
  m["windowstyle"] = "normal";
  m["pickableparts"] = "visible";
  m["__gl_extensions__"] = "";
  m["__gl_renderer__"] = "";
  m["__gl_vendor__"] = "";
  m["__gl_version__"] = "";
  m["__gl_window__"] = "off";
  m["__graphics_toolkit__"] = default_graphics_toolkit ();
  m["__guidata__"] = Matrix ();
  m["__mouse_mode__"] = "none";
  m["__printing__"] = "off";
  m["__pan_mode__"] = Matrix ();
  m["__plot_stream__"] = Matrix ();
  m["__rotate_mode__"] = Matrix ();
  m["__zoom_mode__"] = Matrix ();
  m["__device_pixel_ratio__"] = 1.0;

  return m;
}

std::string figure::properties::s_go_name ("figure");

std::set<std::string>
figure::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alphamap");
      all_pnames.insert ("buttondownfcn");
      all_pnames.insert ("closerequestfcn");
      all_pnames.insert ("color");
      all_pnames.insert ("colormap");
      all_pnames.insert ("currentaxes");
      all_pnames.insert ("currentcharacter");
      all_pnames.insert ("currentobject");
      all_pnames.insert ("currentpoint");
      all_pnames.insert ("dockcontrols");
      all_pnames.insert ("filename");
      all_pnames.insert ("graphicssmoothing");
      all_pnames.insert ("innerposition");
      all_pnames.insert ("integerhandle");
      all_pnames.insert ("inverthardcopy");
      all_pnames.insert ("keypressfcn");
      all_pnames.insert ("keyreleasefcn");
      all_pnames.insert ("menubar");
      all_pnames.insert ("name");
      all_pnames.insert ("number");
      all_pnames.insert ("nextplot");
      all_pnames.insert ("numbertitle");
      all_pnames.insert ("outerposition");
      all_pnames.insert ("paperorientation");
      all_pnames.insert ("paperposition");
      all_pnames.insert ("paperpositionmode");
      all_pnames.insert ("papersize");
      all_pnames.insert ("papertype");
      all_pnames.insert ("paperunits");
      all_pnames.insert ("pointer");
      all_pnames.insert ("pointershapecdata");
      all_pnames.insert ("pointershapehotspot");
      all_pnames.insert ("position");
      all_pnames.insert ("renderer");
      all_pnames.insert ("renderermode");
      all_pnames.insert ("resize");
      all_pnames.insert ("resizefcn");
      all_pnames.insert ("selectiontype");
      all_pnames.insert ("sizechangedfcn");
      all_pnames.insert ("toolbar");
      all_pnames.insert ("units");
      all_pnames.insert ("windowbuttondownfcn");
      all_pnames.insert ("windowbuttonmotionfcn");
      all_pnames.insert ("windowbuttonupfcn");
      all_pnames.insert ("windowkeypressfcn");
      all_pnames.insert ("windowkeyreleasefcn");
      all_pnames.insert ("windowscrollwheelfcn");
      all_pnames.insert ("windowstate");
      all_pnames.insert ("windowstyle");
      all_pnames.insert ("pickableparts");
      all_pnames.insert ("__gl_extensions__");
      all_pnames.insert ("__gl_renderer__");
      all_pnames.insert ("__gl_vendor__");
      all_pnames.insert ("__gl_version__");
      all_pnames.insert ("__gl_window__");
      all_pnames.insert ("__graphics_toolkit__");
      all_pnames.insert ("__guidata__");
      all_pnames.insert ("__mouse_mode__");
      all_pnames.insert ("__printing__");
      all_pnames.insert ("__pan_mode__");
      all_pnames.insert ("__plot_stream__");
      all_pnames.insert ("__rotate_mode__");
      all_pnames.insert ("__zoom_mode__");
      all_pnames.insert ("__device_pixel_ratio__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
figure::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
figure::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("currentcharacter");
      all_pnames.insert ("currentobject");
      all_pnames.insert ("currentpoint");
      all_pnames.insert ("number");
      all_pnames.insert ("__gl_extensions__");
      all_pnames.insert ("__gl_renderer__");
      all_pnames.insert ("__gl_vendor__");
      all_pnames.insert ("__gl_version__");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
figure::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
figure::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
figure::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** axes ********

axes::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_activepositionproperty ("activepositionproperty", mh, "{outerposition}|position"),
    m_alim ("alim", mh, default_lim ()),
    m_alimmode ("alimmode", mh, "{auto}|manual"),
    m_alphamap ("alphamap", mh, Matrix ()),
    m_alphascale ("alphascale", mh, "{linear}|log"),
    m_ambientlightcolor ("ambientlightcolor", mh, color_values (1, 1, 1)),
    m_box ("box", mh, "off"),
    m_boxstyle ("boxstyle", mh, "{back}|full"),
    m_cameraposition ("cameraposition", mh, Matrix (1, 3, 0.0)),
    m_camerapositionmode ("camerapositionmode", mh, "{auto}|manual"),
    m_cameratarget ("cameratarget", mh, Matrix (1, 3, 0.0)),
    m_cameratargetmode ("cameratargetmode", mh, "{auto}|manual"),
    m_cameraupvector ("cameraupvector", mh, Matrix (1, 3, 0.0)),
    m_cameraupvectormode ("cameraupvectormode", mh, "{auto}|manual"),
    m_cameraviewangle ("cameraviewangle", mh, 6.6086),
    m_cameraviewanglemode ("cameraviewanglemode", mh, "{auto}|manual"),
    m_clim ("clim", mh, default_lim ()),
    m_climmode ("climmode", mh, "{auto}|manual"),
    m_clippingstyle ("clippingstyle", mh, "{3dbox}|rectangle"),
    m_color ("color", mh, color_property (color_values (1, 1, 1), radio_values ("none"))),
    m_colormap ("colormap", mh, Matrix ()),
    m_colororder ("colororder", mh, default_colororder ()),
    m_colororderindex ("colororderindex", mh, 1.0),
    m_colorscale ("colorscale", mh, "{linear}|log"),
    m_currentpoint ("currentpoint", mh, Matrix (2, 3, 0.0)),
    m_dataaspectratio ("dataaspectratio", mh, Matrix (1, 3, 1.0)),
    m_dataaspectratiomode ("dataaspectratiomode", mh, "{auto}|manual"),
    m_fontangle ("fontangle", mh, "{normal}|italic"),
    m_fontname ("fontname", mh, OCTAVE_DEFAULT_FONTNAME),
    m_fontsize ("fontsize", mh, 10),
    m_fontsizemode ("fontsizemode", mh, "{auto}|manual"),
    m_fontsmoothing ("fontsmoothing", mh, "on"),
    m_fontunits ("fontunits", mh, "{points}|inches|centimeters|normalized|pixels"),
    m_fontweight ("fontweight", mh, "{normal}|bold"),
    m_gridalpha ("gridalpha", mh, 0.15),
    m_gridalphamode ("gridalphamode", mh, "{auto}|manual"),
    m_gridcolor ("gridcolor", mh, color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"))),
    m_gridcolormode ("gridcolormode", mh, "{auto}|manual"),
    m_gridlinestyle ("gridlinestyle", mh, "{-}|--|:|-.|none"),
    m_innerposition ("innerposition", mh, default_axes_position ()),
    m_interactions ("interactions", mh, Matrix ()),
    m_labelfontsizemultiplier ("labelfontsizemultiplier", mh, 1.1),
    m_layer ("layer", mh, "{bottom}|top"),
    m_layout ("layout", mh, graphics_handle ()),
    m_legend ("legend", mh, graphics_handle ()),
    m_linestyleorder ("linestyleorder", mh, "-"),
    m_linestyleorderindex ("linestyleorderindex", mh, 1.0),
    m_linewidth ("linewidth", mh, 0.5),
    m_minorgridalpha ("minorgridalpha", mh, 0.25),
    m_minorgridalphamode ("minorgridalphamode", mh, "{auto}|manual"),
    m_minorgridcolor ("minorgridcolor", mh, color_property (color_values (0.1, 0.1, 0.1), radio_values ("none"))),
    m_minorgridcolormode ("minorgridcolormode", mh, "{auto}|manual"),
    m_minorgridlinestyle ("minorgridlinestyle", mh, "{:}|-|--|-.|none"),
    m_nextplot ("nextplot", mh, "{replace}|add|replacechildren"),
    m_nextseriesindex ("nextseriesindex", mh, 1.0),
    m_outerposition ("outerposition", mh, default_axes_outerposition ()),
    m_plotboxaspectratio ("plotboxaspectratio", mh, Matrix (1, 3, 1.0)),
    m_plotboxaspectratiomode ("plotboxaspectratiomode", mh, "{auto}|manual"),
    m_position ("position", mh, default_axes_position ()),
    m_positionconstraint ("positionconstraint", mh, "{outerposition}|innerposition"),
    m_projection ("projection", mh, "{orthographic}|perspective"),
    m_sortmethod ("sortmethod", mh, "{depth}|childorder"),
    m_tickdir ("tickdir", mh, "{in}|out|both|none"),
    m_tickdirmode ("tickdirmode", mh, "{auto}|manual"),
    m_ticklabelinterpreter ("ticklabelinterpreter", mh, "{tex}|latex|none"),
    m_ticklength ("ticklength", mh, default_axes_ticklength ()),
    m_tightinset ("tightinset", mh, Matrix (1, 4, 0.0)),
    m_title ("title", mh, make_graphics_handle ("text", m___myhandle__, false, false, false)),
    m_titlefontsizemultiplier ("titlefontsizemultiplier", mh, 1.1),
    m_titlefontweight ("titlefontweight", mh, "{bold}|normal"),
    m_toolbar ("toolbar", mh, graphics_handle ()),
    m_units ("units", mh, "{normalized}|inches|centimeters|points|pixels|characters"),
    m_view ("view", mh, default_axes_view ()),
    m_xaxis ("xaxis", mh, graphics_handle ()),
    m_xaxislocation ("xaxislocation", mh, "{bottom}|top|origin"),
    m_xcolor ("xcolor", mh, color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"))),
    m_xcolormode ("xcolormode", mh, "{auto}|manual"),
    m_xdir ("xdir", mh, "{normal}|reverse"),
    m_xgrid ("xgrid", mh, "off"),
    m_xlabel ("xlabel", mh, make_graphics_handle ("text", m___myhandle__, false, false, false)),
    m_xlim ("xlim", mh, default_lim ()),
    m_xlimitmethod ("xlimitmethod", mh, "{tickaligned}|tight|padded"),
    m_xlimmode ("xlimmode", mh, "{auto}|manual"),
    m_xminorgrid ("xminorgrid", mh, "off"),
    m_xminortick ("xminortick", mh, "off"),
    m_xminortickvalues ("xminortickvalues", mh, Matrix ()),
    m_xminortickvaluesmode ("xminortickvaluesmode", mh, "{auto}|manual"),
    m_xscale ("xscale", mh, "{linear}|log"),
    m_xtick ("xtick", mh, default_axes_tick ()),
    m_xticklabel ("xticklabel", mh, ""),
    m_xticklabelmode ("xticklabelmode", mh, "{auto}|manual"),
    m_xticklabelrotation ("xticklabelrotation", mh, 0.0),
    m_xtickmode ("xtickmode", mh, "{auto}|manual"),
    m_yaxis ("yaxis", mh, graphics_handle ()),
    m_yaxislocation ("yaxislocation", mh, "{left}|right|origin"),
    m_ycolor ("ycolor", mh, color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"))),
    m_ycolormode ("ycolormode", mh, "{auto}|manual"),
    m_ydir ("ydir", mh, "{normal}|reverse"),
    m_ygrid ("ygrid", mh, "off"),
    m_ylabel ("ylabel", mh, make_graphics_handle ("text", m___myhandle__, false, false, false)),
    m_ylim ("ylim", mh, default_lim ()),
    m_ylimitmethod ("ylimitmethod", mh, "{tickaligned}|tight|padded"),
    m_ylimmode ("ylimmode", mh, "{auto}|manual"),
    m_yminorgrid ("yminorgrid", mh, "off"),
    m_yminortick ("yminortick", mh, "off"),
    m_yminortickvalues ("yminortickvalues", mh, Matrix ()),
    m_yminortickvaluesmode ("yminortickvaluesmode", mh, "{auto}|manual"),
    m_yscale ("yscale", mh, "{linear}|log"),
    m_ytick ("ytick", mh, default_axes_tick ()),
    m_yticklabel ("yticklabel", mh, ""),
    m_yticklabelmode ("yticklabelmode", mh, "{auto}|manual"),
    m_yticklabelrotation ("yticklabelrotation", mh, 0.0),
    m_ytickmode ("ytickmode", mh, "{auto}|manual"),
    m_zaxis ("zaxis", mh, graphics_handle ()),
    m_zcolor ("zcolor", mh, color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"))),
    m_zcolormode ("zcolormode", mh, "{auto}|manual"),
    m_zdir ("zdir", mh, "{normal}|reverse"),
    m_zgrid ("zgrid", mh, "off"),
    m_zlabel ("zlabel", mh, make_graphics_handle ("text", m___myhandle__, false, false, false)),
    m_zlim ("zlim", mh, default_lim ()),
    m_zlimitmethod ("zlimitmethod", mh, "{tickaligned}|tight|padded"),
    m_zlimmode ("zlimmode", mh, "{auto}|manual"),
    m_zminorgrid ("zminorgrid", mh, "off"),
    m_zminortick ("zminortick", mh, "off"),
    m_zminortickvalues ("zminortickvalues", mh, Matrix ()),
    m_zminortickvaluesmode ("zminortickvaluesmode", mh, "{auto}|manual"),
    m_zscale ("zscale", mh, "{linear}|log"),
    m_ztick ("ztick", mh, default_axes_tick ()),
    m_zticklabel ("zticklabel", mh, ""),
    m_zticklabelmode ("zticklabelmode", mh, "{auto}|manual"),
    m_zticklabelrotation ("zticklabelrotation", mh, 0.0),
    m_ztickmode ("ztickmode", mh, "{auto}|manual"),
    m___colormap__ ("__colormap__", mh, Matrix ()),
    m_mousewheelzoom ("mousewheelzoom", mh, 0.5),
    m___autopos_tag__ ("__autopos_tag__", mh, "{none}|subplot"),
    m_looseinset ("looseinset", mh, Matrix (1, 4, 0.0)),
    m___fontsize_points__ ("__fontsize_points__", mh, 0)
{
  m_activepositionproperty.set_id (ID_ACTIVEPOSITIONPROPERTY);
  m_activepositionproperty.set_hidden (true);
  m_alim.set_id (ID_ALIM);
  m_alimmode.set_id (ID_ALIMMODE);
  m_alphamap.set_id (ID_ALPHAMAP);
  m_alphascale.set_id (ID_ALPHASCALE);
  m_ambientlightcolor.set_id (ID_AMBIENTLIGHTCOLOR);
  m_box.set_id (ID_BOX);
  m_boxstyle.set_id (ID_BOXSTYLE);
  m_cameraposition.set_id (ID_CAMERAPOSITION);
  m_camerapositionmode.set_id (ID_CAMERAPOSITIONMODE);
  m_cameratarget.set_id (ID_CAMERATARGET);
  m_cameratargetmode.set_id (ID_CAMERATARGETMODE);
  m_cameraupvector.set_id (ID_CAMERAUPVECTOR);
  m_cameraupvectormode.set_id (ID_CAMERAUPVECTORMODE);
  m_cameraviewangle.set_id (ID_CAMERAVIEWANGLE);
  m_cameraviewanglemode.set_id (ID_CAMERAVIEWANGLEMODE);
  m_clim.set_id (ID_CLIM);
  m_climmode.set_id (ID_CLIMMODE);
  m_clippingstyle.set_id (ID_CLIPPINGSTYLE);
  m_color.set_id (ID_COLOR);
  m_colormap.set_id (ID_COLORMAP);
  m_colororder.set_id (ID_COLORORDER);
  m_colororderindex.set_id (ID_COLORORDERINDEX);
  m_colorscale.set_id (ID_COLORSCALE);
  m_currentpoint.set_id (ID_CURRENTPOINT);
  m_dataaspectratio.set_id (ID_DATAASPECTRATIO);
  m_dataaspectratiomode.set_id (ID_DATAASPECTRATIOMODE);
  m_fontangle.set_id (ID_FONTANGLE);
  m_fontname.set_id (ID_FONTNAME);
  m_fontsize.set_id (ID_FONTSIZE);
  m_fontsizemode.set_id (ID_FONTSIZEMODE);
  m_fontsmoothing.set_id (ID_FONTSMOOTHING);
  m_fontunits.set_id (ID_FONTUNITS);
  m_fontweight.set_id (ID_FONTWEIGHT);
  m_gridalpha.set_id (ID_GRIDALPHA);
  m_gridalphamode.set_id (ID_GRIDALPHAMODE);
  m_gridcolor.set_id (ID_GRIDCOLOR);
  m_gridcolormode.set_id (ID_GRIDCOLORMODE);
  m_gridlinestyle.set_id (ID_GRIDLINESTYLE);
  m_innerposition.set_id (ID_INNERPOSITION);
  m_interactions.set_id (ID_INTERACTIONS);
  m_labelfontsizemultiplier.set_id (ID_LABELFONTSIZEMULTIPLIER);
  m_layer.set_id (ID_LAYER);
  m_layout.set_id (ID_LAYOUT);
  m_legend.set_id (ID_LEGEND);
  m_linestyleorder.set_id (ID_LINESTYLEORDER);
  m_linestyleorderindex.set_id (ID_LINESTYLEORDERINDEX);
  m_linewidth.set_id (ID_LINEWIDTH);
  m_minorgridalpha.set_id (ID_MINORGRIDALPHA);
  m_minorgridalphamode.set_id (ID_MINORGRIDALPHAMODE);
  m_minorgridcolor.set_id (ID_MINORGRIDCOLOR);
  m_minorgridcolormode.set_id (ID_MINORGRIDCOLORMODE);
  m_minorgridlinestyle.set_id (ID_MINORGRIDLINESTYLE);
  m_nextplot.set_id (ID_NEXTPLOT);
  m_nextseriesindex.set_id (ID_NEXTSERIESINDEX);
  m_outerposition.set_id (ID_OUTERPOSITION);
  m_plotboxaspectratio.set_id (ID_PLOTBOXASPECTRATIO);
  m_plotboxaspectratiomode.set_id (ID_PLOTBOXASPECTRATIOMODE);
  m_position.set_id (ID_POSITION);
  m_positionconstraint.set_id (ID_POSITIONCONSTRAINT);
  m_projection.set_id (ID_PROJECTION);
  m_sortmethod.set_id (ID_SORTMETHOD);
  m_tickdir.set_id (ID_TICKDIR);
  m_tickdirmode.set_id (ID_TICKDIRMODE);
  m_ticklabelinterpreter.set_id (ID_TICKLABELINTERPRETER);
  m_ticklength.set_id (ID_TICKLENGTH);
  m_tightinset.set_id (ID_TIGHTINSET);
  m_title.set_id (ID_TITLE);
  m_titlefontsizemultiplier.set_id (ID_TITLEFONTSIZEMULTIPLIER);
  m_titlefontweight.set_id (ID_TITLEFONTWEIGHT);
  m_toolbar.set_id (ID_TOOLBAR);
  m_units.set_id (ID_UNITS);
  m_view.set_id (ID_VIEW);
  m_xaxis.set_id (ID_XAXIS);
  m_xaxislocation.set_id (ID_XAXISLOCATION);
  m_xcolor.set_id (ID_XCOLOR);
  m_xcolormode.set_id (ID_XCOLORMODE);
  m_xdir.set_id (ID_XDIR);
  m_xgrid.set_id (ID_XGRID);
  m_xlabel.set_id (ID_XLABEL);
  m_xlim.set_id (ID_XLIM);
  m_xlimitmethod.set_id (ID_XLIMITMETHOD);
  m_xlimmode.set_id (ID_XLIMMODE);
  m_xminorgrid.set_id (ID_XMINORGRID);
  m_xminortick.set_id (ID_XMINORTICK);
  m_xminortickvalues.set_id (ID_XMINORTICKVALUES);
  m_xminortickvaluesmode.set_id (ID_XMINORTICKVALUESMODE);
  m_xscale.set_id (ID_XSCALE);
  m_xtick.set_id (ID_XTICK);
  m_xticklabel.set_id (ID_XTICKLABEL);
  m_xticklabelmode.set_id (ID_XTICKLABELMODE);
  m_xticklabelrotation.set_id (ID_XTICKLABELROTATION);
  m_xtickmode.set_id (ID_XTICKMODE);
  m_yaxis.set_id (ID_YAXIS);
  m_yaxislocation.set_id (ID_YAXISLOCATION);
  m_ycolor.set_id (ID_YCOLOR);
  m_ycolormode.set_id (ID_YCOLORMODE);
  m_ydir.set_id (ID_YDIR);
  m_ygrid.set_id (ID_YGRID);
  m_ylabel.set_id (ID_YLABEL);
  m_ylim.set_id (ID_YLIM);
  m_ylimitmethod.set_id (ID_YLIMITMETHOD);
  m_ylimmode.set_id (ID_YLIMMODE);
  m_yminorgrid.set_id (ID_YMINORGRID);
  m_yminortick.set_id (ID_YMINORTICK);
  m_yminortickvalues.set_id (ID_YMINORTICKVALUES);
  m_yminortickvaluesmode.set_id (ID_YMINORTICKVALUESMODE);
  m_yscale.set_id (ID_YSCALE);
  m_ytick.set_id (ID_YTICK);
  m_yticklabel.set_id (ID_YTICKLABEL);
  m_yticklabelmode.set_id (ID_YTICKLABELMODE);
  m_yticklabelrotation.set_id (ID_YTICKLABELROTATION);
  m_ytickmode.set_id (ID_YTICKMODE);
  m_zaxis.set_id (ID_ZAXIS);
  m_zcolor.set_id (ID_ZCOLOR);
  m_zcolormode.set_id (ID_ZCOLORMODE);
  m_zdir.set_id (ID_ZDIR);
  m_zgrid.set_id (ID_ZGRID);
  m_zlabel.set_id (ID_ZLABEL);
  m_zlim.set_id (ID_ZLIM);
  m_zlimitmethod.set_id (ID_ZLIMITMETHOD);
  m_zlimmode.set_id (ID_ZLIMMODE);
  m_zminorgrid.set_id (ID_ZMINORGRID);
  m_zminortick.set_id (ID_ZMINORTICK);
  m_zminortickvalues.set_id (ID_ZMINORTICKVALUES);
  m_zminortickvaluesmode.set_id (ID_ZMINORTICKVALUESMODE);
  m_zscale.set_id (ID_ZSCALE);
  m_ztick.set_id (ID_ZTICK);
  m_zticklabel.set_id (ID_ZTICKLABEL);
  m_zticklabelmode.set_id (ID_ZTICKLABELMODE);
  m_zticklabelrotation.set_id (ID_ZTICKLABELROTATION);
  m_ztickmode.set_id (ID_ZTICKMODE);
  m___colormap__.set_id (ID___COLORMAP__);
  m___colormap__.set_hidden (true);
  m_mousewheelzoom.set_id (ID_MOUSEWHEELZOOM);
  m___autopos_tag__.set_id (ID___AUTOPOS_TAG__);
  m___autopos_tag__.set_hidden (true);
  m_looseinset.set_id (ID_LOOSEINSET);
  m_looseinset.set_hidden (true);
  m___fontsize_points__.set_id (ID___FONTSIZE_POINTS__);
  m___fontsize_points__.set_hidden (true);
  init ();
}

void
axes::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("activepositionproperty"))
    set_activepositionproperty (val);
  else if (pname.compare ("alim"))
    set_alim (val);
  else if (pname.compare ("alimmode"))
    set_alimmode (val);
  else if (pname.compare ("alphamap"))
    set_alphamap (val);
  else if (pname.compare ("alphascale"))
    set_alphascale (val);
  else if (pname.compare ("ambientlightcolor"))
    set_ambientlightcolor (val);
  else if (pname.compare ("box"))
    set_box (val);
  else if (pname.compare ("boxstyle"))
    set_boxstyle (val);
  else if (pname.compare ("cameraposition"))
    set_cameraposition (val);
  else if (pname.compare ("camerapositionmode"))
    set_camerapositionmode (val);
  else if (pname.compare ("cameratarget"))
    set_cameratarget (val);
  else if (pname.compare ("cameratargetmode"))
    set_cameratargetmode (val);
  else if (pname.compare ("cameraupvector"))
    set_cameraupvector (val);
  else if (pname.compare ("cameraupvectormode"))
    set_cameraupvectormode (val);
  else if (pname.compare ("cameraviewangle"))
    set_cameraviewangle (val);
  else if (pname.compare ("cameraviewanglemode"))
    set_cameraviewanglemode (val);
  else if (pname.compare ("clim"))
    set_clim (val);
  else if (pname.compare ("climmode"))
    set_climmode (val);
  else if (pname.compare ("clippingstyle"))
    set_clippingstyle (val);
  else if (pname.compare ("color"))
    set_color (val);
  else if (pname.compare ("colormap"))
    set_colormap (val);
  else if (pname.compare ("colororder"))
    set_colororder (val);
  else if (pname.compare ("colororderindex"))
    set_colororderindex (val);
  else if (pname.compare ("colorscale"))
    set_colorscale (val);
  else if (pname.compare ("currentpoint"))
    set_currentpoint (val);
  else if (pname.compare ("dataaspectratio"))
    set_dataaspectratio (val);
  else if (pname.compare ("dataaspectratiomode"))
    set_dataaspectratiomode (val);
  else if (pname.compare ("fontangle"))
    set_fontangle (val);
  else if (pname.compare ("fontname"))
    set_fontname (val);
  else if (pname.compare ("fontsize"))
    set_fontsize (val);
  else if (pname.compare ("fontsizemode"))
    set_fontsizemode (val);
  else if (pname.compare ("fontsmoothing"))
    set_fontsmoothing (val);
  else if (pname.compare ("fontunits"))
    set_fontunits (val);
  else if (pname.compare ("fontweight"))
    set_fontweight (val);
  else if (pname.compare ("gridalpha"))
    set_gridalpha (val);
  else if (pname.compare ("gridalphamode"))
    set_gridalphamode (val);
  else if (pname.compare ("gridcolor"))
    set_gridcolor (val);
  else if (pname.compare ("gridcolormode"))
    set_gridcolormode (val);
  else if (pname.compare ("gridlinestyle"))
    set_gridlinestyle (val);
  else if (pname.compare ("innerposition"))
    set_innerposition (val);
  else if (pname.compare ("labelfontsizemultiplier"))
    set_labelfontsizemultiplier (val);
  else if (pname.compare ("layer"))
    set_layer (val);
  else if (pname.compare ("linestyleorder"))
    set_linestyleorder (val);
  else if (pname.compare ("linestyleorderindex"))
    set_linestyleorderindex (val);
  else if (pname.compare ("linewidth"))
    set_linewidth (val);
  else if (pname.compare ("minorgridalpha"))
    set_minorgridalpha (val);
  else if (pname.compare ("minorgridalphamode"))
    set_minorgridalphamode (val);
  else if (pname.compare ("minorgridcolor"))
    set_minorgridcolor (val);
  else if (pname.compare ("minorgridcolormode"))
    set_minorgridcolormode (val);
  else if (pname.compare ("minorgridlinestyle"))
    set_minorgridlinestyle (val);
  else if (pname.compare ("nextplot"))
    set_nextplot (val);
  else if (pname.compare ("outerposition"))
    set_outerposition (val);
  else if (pname.compare ("plotboxaspectratio"))
    set_plotboxaspectratio (val);
  else if (pname.compare ("plotboxaspectratiomode"))
    set_plotboxaspectratiomode (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("positionconstraint"))
    set_positionconstraint (val);
  else if (pname.compare ("projection"))
    set_projection (val);
  else if (pname.compare ("sortmethod"))
    set_sortmethod (val);
  else if (pname.compare ("tickdir"))
    set_tickdir (val);
  else if (pname.compare ("tickdirmode"))
    set_tickdirmode (val);
  else if (pname.compare ("ticklabelinterpreter"))
    set_ticklabelinterpreter (val);
  else if (pname.compare ("ticklength"))
    set_ticklength (val);
  else if (pname.compare ("title"))
    set_title (val);
  else if (pname.compare ("titlefontsizemultiplier"))
    set_titlefontsizemultiplier (val);
  else if (pname.compare ("titlefontweight"))
    set_titlefontweight (val);
  else if (pname.compare ("units"))
    set_units (val);
  else if (pname.compare ("view"))
    set_view (val);
  else if (pname.compare ("xaxislocation"))
    set_xaxislocation (val);
  else if (pname.compare ("xcolor"))
    set_xcolor (val);
  else if (pname.compare ("xcolormode"))
    set_xcolormode (val);
  else if (pname.compare ("xdir"))
    set_xdir (val);
  else if (pname.compare ("xgrid"))
    set_xgrid (val);
  else if (pname.compare ("xlabel"))
    set_xlabel (val);
  else if (pname.compare ("xlim"))
    set_xlim (val);
  else if (pname.compare ("xlimitmethod"))
    set_xlimitmethod (val);
  else if (pname.compare ("xlimmode"))
    set_xlimmode (val);
  else if (pname.compare ("xminorgrid"))
    set_xminorgrid (val);
  else if (pname.compare ("xminortick"))
    set_xminortick (val);
  else if (pname.compare ("xminortickvalues"))
    set_xminortickvalues (val);
  else if (pname.compare ("xminortickvaluesmode"))
    set_xminortickvaluesmode (val);
  else if (pname.compare ("xscale"))
    set_xscale (val);
  else if (pname.compare ("xtick"))
    set_xtick (val);
  else if (pname.compare ("xticklabel"))
    set_xticklabel (val);
  else if (pname.compare ("xticklabelmode"))
    set_xticklabelmode (val);
  else if (pname.compare ("xticklabelrotation"))
    set_xticklabelrotation (val);
  else if (pname.compare ("xtickmode"))
    set_xtickmode (val);
  else if (pname.compare ("yaxislocation"))
    set_yaxislocation (val);
  else if (pname.compare ("ycolor"))
    set_ycolor (val);
  else if (pname.compare ("ycolormode"))
    set_ycolormode (val);
  else if (pname.compare ("ydir"))
    set_ydir (val);
  else if (pname.compare ("ygrid"))
    set_ygrid (val);
  else if (pname.compare ("ylabel"))
    set_ylabel (val);
  else if (pname.compare ("ylim"))
    set_ylim (val);
  else if (pname.compare ("ylimitmethod"))
    set_ylimitmethod (val);
  else if (pname.compare ("ylimmode"))
    set_ylimmode (val);
  else if (pname.compare ("yminorgrid"))
    set_yminorgrid (val);
  else if (pname.compare ("yminortick"))
    set_yminortick (val);
  else if (pname.compare ("yminortickvalues"))
    set_yminortickvalues (val);
  else if (pname.compare ("yminortickvaluesmode"))
    set_yminortickvaluesmode (val);
  else if (pname.compare ("yscale"))
    set_yscale (val);
  else if (pname.compare ("ytick"))
    set_ytick (val);
  else if (pname.compare ("yticklabel"))
    set_yticklabel (val);
  else if (pname.compare ("yticklabelmode"))
    set_yticklabelmode (val);
  else if (pname.compare ("yticklabelrotation"))
    set_yticklabelrotation (val);
  else if (pname.compare ("ytickmode"))
    set_ytickmode (val);
  else if (pname.compare ("zcolor"))
    set_zcolor (val);
  else if (pname.compare ("zcolormode"))
    set_zcolormode (val);
  else if (pname.compare ("zdir"))
    set_zdir (val);
  else if (pname.compare ("zgrid"))
    set_zgrid (val);
  else if (pname.compare ("zlabel"))
    set_zlabel (val);
  else if (pname.compare ("zlim"))
    set_zlim (val);
  else if (pname.compare ("zlimitmethod"))
    set_zlimitmethod (val);
  else if (pname.compare ("zlimmode"))
    set_zlimmode (val);
  else if (pname.compare ("zminorgrid"))
    set_zminorgrid (val);
  else if (pname.compare ("zminortick"))
    set_zminortick (val);
  else if (pname.compare ("zminortickvalues"))
    set_zminortickvalues (val);
  else if (pname.compare ("zminortickvaluesmode"))
    set_zminortickvaluesmode (val);
  else if (pname.compare ("zscale"))
    set_zscale (val);
  else if (pname.compare ("ztick"))
    set_ztick (val);
  else if (pname.compare ("zticklabel"))
    set_zticklabel (val);
  else if (pname.compare ("zticklabelmode"))
    set_zticklabelmode (val);
  else if (pname.compare ("zticklabelrotation"))
    set_zticklabelrotation (val);
  else if (pname.compare ("ztickmode"))
    set_ztickmode (val);
  else if (pname.compare ("__colormap__"))
    set___colormap__ (val);
  else if (pname.compare ("mousewheelzoom"))
    set_mousewheelzoom (val);
  else if (pname.compare ("__autopos_tag__"))
    set___autopos_tag__ (val);
  else if (pname.compare ("looseinset"))
    set_looseinset (val);
  else
    base_properties::set (pname, val);
}

octave_value
axes::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  if (all)
    m.assign ("activepositionproperty", octave_value (get_activepositionproperty ()));
  m.assign ("alim", octave_value (get_alim ()));
  m.assign ("alimmode", octave_value (get_alimmode ()));
  m.assign ("alphamap", octave_value (get_alphamap ()));
  m.assign ("alphascale", octave_value (get_alphascale ()));
  m.assign ("ambientlightcolor", octave_value (get_ambientlightcolor ()));
  m.assign ("box", octave_value (get_box ()));
  m.assign ("boxstyle", octave_value (get_boxstyle ()));
  m.assign ("cameraposition", octave_value (get_cameraposition ()));
  m.assign ("camerapositionmode", octave_value (get_camerapositionmode ()));
  m.assign ("cameratarget", octave_value (get_cameratarget ()));
  m.assign ("cameratargetmode", octave_value (get_cameratargetmode ()));
  m.assign ("cameraupvector", octave_value (get_cameraupvector ()));
  m.assign ("cameraupvectormode", octave_value (get_cameraupvectormode ()));
  m.assign ("cameraviewangle", octave_value (get_cameraviewangle ()));
  m.assign ("cameraviewanglemode", octave_value (get_cameraviewanglemode ()));
  m.assign ("clim", octave_value (get_clim ()));
  m.assign ("climmode", octave_value (get_climmode ()));
  m.assign ("clippingstyle", octave_value (get_clippingstyle ()));
  m.assign ("color", octave_value (get_color ()));
  m.assign ("colormap", octave_value (get_colormap ()));
  m.assign ("colororder", octave_value (get_colororder ()));
  m.assign ("colororderindex", octave_value (get_colororderindex ()));
  m.assign ("colorscale", octave_value (get_colorscale ()));
  m.assign ("currentpoint", octave_value (get_currentpoint ()));
  m.assign ("dataaspectratio", octave_value (get_dataaspectratio ()));
  m.assign ("dataaspectratiomode", octave_value (get_dataaspectratiomode ()));
  m.assign ("fontangle", octave_value (get_fontangle ()));
  m.assign ("fontname", octave_value (get_fontname ()));
  m.assign ("fontsize", octave_value (get_fontsize ()));
  m.assign ("fontsizemode", octave_value (get_fontsizemode ()));
  m.assign ("fontsmoothing", octave_value (get_fontsmoothing ()));
  m.assign ("fontunits", octave_value (get_fontunits ()));
  m.assign ("fontweight", octave_value (get_fontweight ()));
  m.assign ("gridalpha", octave_value (get_gridalpha ()));
  m.assign ("gridalphamode", octave_value (get_gridalphamode ()));
  m.assign ("gridcolor", octave_value (get_gridcolor ()));
  m.assign ("gridcolormode", octave_value (get_gridcolormode ()));
  m.assign ("gridlinestyle", octave_value (get_gridlinestyle ()));
  m.assign ("innerposition", octave_value (get_innerposition ()));
  m.assign ("interactions", octave_value (get_interactions ()));
  m.assign ("labelfontsizemultiplier", octave_value (get_labelfontsizemultiplier ()));
  m.assign ("layer", octave_value (get_layer ()));
  m.assign ("layout", octave_value (get_layout ().as_octave_value ()));
  m.assign ("legend", octave_value (get_legend ().as_octave_value ()));
  m.assign ("linestyleorder", octave_value (get_linestyleorder ()));
  m.assign ("linestyleorderindex", octave_value (get_linestyleorderindex ()));
  m.assign ("linewidth", octave_value (get_linewidth ()));
  m.assign ("minorgridalpha", octave_value (get_minorgridalpha ()));
  m.assign ("minorgridalphamode", octave_value (get_minorgridalphamode ()));
  m.assign ("minorgridcolor", octave_value (get_minorgridcolor ()));
  m.assign ("minorgridcolormode", octave_value (get_minorgridcolormode ()));
  m.assign ("minorgridlinestyle", octave_value (get_minorgridlinestyle ()));
  m.assign ("nextplot", octave_value (get_nextplot ()));
  m.assign ("nextseriesindex", octave_value (get_nextseriesindex ()));
  m.assign ("outerposition", octave_value (get_outerposition ()));
  m.assign ("plotboxaspectratio", octave_value (get_plotboxaspectratio ()));
  m.assign ("plotboxaspectratiomode", octave_value (get_plotboxaspectratiomode ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("positionconstraint", octave_value (get_positionconstraint ()));
  m.assign ("projection", octave_value (get_projection ()));
  m.assign ("sortmethod", octave_value (get_sortmethod ()));
  m.assign ("tickdir", octave_value (get_tickdir ()));
  m.assign ("tickdirmode", octave_value (get_tickdirmode ()));
  m.assign ("ticklabelinterpreter", octave_value (get_ticklabelinterpreter ()));
  m.assign ("ticklength", octave_value (get_ticklength ()));
  m.assign ("tightinset", octave_value (get_tightinset ()));
  m.assign ("title", octave_value (get_title ().as_octave_value ()));
  m.assign ("titlefontsizemultiplier", octave_value (get_titlefontsizemultiplier ()));
  m.assign ("titlefontweight", octave_value (get_titlefontweight ()));
  m.assign ("toolbar", octave_value (get_toolbar ().as_octave_value ()));
  m.assign ("units", octave_value (get_units ()));
  m.assign ("view", octave_value (get_view ()));
  m.assign ("xaxis", octave_value (get_xaxis ().as_octave_value ()));
  m.assign ("xaxislocation", octave_value (get_xaxislocation ()));
  m.assign ("xcolor", octave_value (get_xcolor ()));
  m.assign ("xcolormode", octave_value (get_xcolormode ()));
  m.assign ("xdir", octave_value (get_xdir ()));
  m.assign ("xgrid", octave_value (get_xgrid ()));
  m.assign ("xlabel", octave_value (get_xlabel ().as_octave_value ()));
  m.assign ("xlim", octave_value (get_xlim ()));
  m.assign ("xlimitmethod", octave_value (get_xlimitmethod ()));
  m.assign ("xlimmode", octave_value (get_xlimmode ()));
  m.assign ("xminorgrid", octave_value (get_xminorgrid ()));
  m.assign ("xminortick", octave_value (get_xminortick ()));
  m.assign ("xminortickvalues", octave_value (get_xminortickvalues ()));
  m.assign ("xminortickvaluesmode", octave_value (get_xminortickvaluesmode ()));
  m.assign ("xscale", octave_value (get_xscale ()));
  m.assign ("xtick", octave_value (get_xtick ()));
  m.assign ("xticklabel", octave_value (get_xticklabel ()));
  m.assign ("xticklabelmode", octave_value (get_xticklabelmode ()));
  m.assign ("xticklabelrotation", octave_value (get_xticklabelrotation ()));
  m.assign ("xtickmode", octave_value (get_xtickmode ()));
  m.assign ("yaxis", octave_value (get_yaxis ().as_octave_value ()));
  m.assign ("yaxislocation", octave_value (get_yaxislocation ()));
  m.assign ("ycolor", octave_value (get_ycolor ()));
  m.assign ("ycolormode", octave_value (get_ycolormode ()));
  m.assign ("ydir", octave_value (get_ydir ()));
  m.assign ("ygrid", octave_value (get_ygrid ()));
  m.assign ("ylabel", octave_value (get_ylabel ().as_octave_value ()));
  m.assign ("ylim", octave_value (get_ylim ()));
  m.assign ("ylimitmethod", octave_value (get_ylimitmethod ()));
  m.assign ("ylimmode", octave_value (get_ylimmode ()));
  m.assign ("yminorgrid", octave_value (get_yminorgrid ()));
  m.assign ("yminortick", octave_value (get_yminortick ()));
  m.assign ("yminortickvalues", octave_value (get_yminortickvalues ()));
  m.assign ("yminortickvaluesmode", octave_value (get_yminortickvaluesmode ()));
  m.assign ("yscale", octave_value (get_yscale ()));
  m.assign ("ytick", octave_value (get_ytick ()));
  m.assign ("yticklabel", octave_value (get_yticklabel ()));
  m.assign ("yticklabelmode", octave_value (get_yticklabelmode ()));
  m.assign ("yticklabelrotation", octave_value (get_yticklabelrotation ()));
  m.assign ("ytickmode", octave_value (get_ytickmode ()));
  m.assign ("zaxis", octave_value (get_zaxis ().as_octave_value ()));
  m.assign ("zcolor", octave_value (get_zcolor ()));
  m.assign ("zcolormode", octave_value (get_zcolormode ()));
  m.assign ("zdir", octave_value (get_zdir ()));
  m.assign ("zgrid", octave_value (get_zgrid ()));
  m.assign ("zlabel", octave_value (get_zlabel ().as_octave_value ()));
  m.assign ("zlim", octave_value (get_zlim ()));
  m.assign ("zlimitmethod", octave_value (get_zlimitmethod ()));
  m.assign ("zlimmode", octave_value (get_zlimmode ()));
  m.assign ("zminorgrid", octave_value (get_zminorgrid ()));
  m.assign ("zminortick", octave_value (get_zminortick ()));
  m.assign ("zminortickvalues", octave_value (get_zminortickvalues ()));
  m.assign ("zminortickvaluesmode", octave_value (get_zminortickvaluesmode ()));
  m.assign ("zscale", octave_value (get_zscale ()));
  m.assign ("ztick", octave_value (get_ztick ()));
  m.assign ("zticklabel", octave_value (get_zticklabel ()));
  m.assign ("zticklabelmode", octave_value (get_zticklabelmode ()));
  m.assign ("zticklabelrotation", octave_value (get_zticklabelrotation ()));
  m.assign ("ztickmode", octave_value (get_ztickmode ()));
  if (all)
    m.assign ("__colormap__", octave_value (get___colormap__ ()));
  m.assign ("mousewheelzoom", octave_value (get_mousewheelzoom ()));
  if (all)
    m.assign ("__autopos_tag__", octave_value (get___autopos_tag__ ()));
  if (all)
    m.assign ("looseinset", octave_value (get_looseinset ()));
  if (all)
    m.assign ("__fontsize_points__", octave_value (get___fontsize_points__ ()));

  return m;
}

octave_value
axes::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("activepositionproperty"))
    retval = get_activepositionproperty ();
  else if (pname.compare ("alim"))
    retval = get_alim ();
  else if (pname.compare ("alimmode"))
    retval = get_alimmode ();
  else if (pname.compare ("alphamap"))
    retval = get_alphamap ();
  else if (pname.compare ("alphascale"))
    retval = get_alphascale ();
  else if (pname.compare ("ambientlightcolor"))
    retval = get_ambientlightcolor ();
  else if (pname.compare ("box"))
    retval = get_box ();
  else if (pname.compare ("boxstyle"))
    retval = get_boxstyle ();
  else if (pname.compare ("cameraposition"))
    retval = get_cameraposition ();
  else if (pname.compare ("camerapositionmode"))
    retval = get_camerapositionmode ();
  else if (pname.compare ("cameratarget"))
    retval = get_cameratarget ();
  else if (pname.compare ("cameratargetmode"))
    retval = get_cameratargetmode ();
  else if (pname.compare ("cameraupvector"))
    retval = get_cameraupvector ();
  else if (pname.compare ("cameraupvectormode"))
    retval = get_cameraupvectormode ();
  else if (pname.compare ("cameraviewangle"))
    retval = get_cameraviewangle ();
  else if (pname.compare ("cameraviewanglemode"))
    retval = get_cameraviewanglemode ();
  else if (pname.compare ("clim"))
    retval = get_clim ();
  else if (pname.compare ("climmode"))
    retval = get_climmode ();
  else if (pname.compare ("clippingstyle"))
    retval = get_clippingstyle ();
  else if (pname.compare ("color"))
    retval = get_color ();
  else if (pname.compare ("colormap"))
    retval = get_colormap ();
  else if (pname.compare ("colororder"))
    retval = get_colororder ();
  else if (pname.compare ("colororderindex"))
    retval = get_colororderindex ();
  else if (pname.compare ("colorscale"))
    retval = get_colorscale ();
  else if (pname.compare ("currentpoint"))
    retval = get_currentpoint ();
  else if (pname.compare ("dataaspectratio"))
    retval = get_dataaspectratio ();
  else if (pname.compare ("dataaspectratiomode"))
    retval = get_dataaspectratiomode ();
  else if (pname.compare ("fontangle"))
    retval = get_fontangle ();
  else if (pname.compare ("fontname"))
    retval = get_fontname ();
  else if (pname.compare ("fontsize"))
    retval = get_fontsize ();
  else if (pname.compare ("fontsizemode"))
    retval = get_fontsizemode ();
  else if (pname.compare ("fontsmoothing"))
    retval = get_fontsmoothing ();
  else if (pname.compare ("fontunits"))
    retval = get_fontunits ();
  else if (pname.compare ("fontweight"))
    retval = get_fontweight ();
  else if (pname.compare ("gridalpha"))
    retval = get_gridalpha ();
  else if (pname.compare ("gridalphamode"))
    retval = get_gridalphamode ();
  else if (pname.compare ("gridcolor"))
    retval = get_gridcolor ();
  else if (pname.compare ("gridcolormode"))
    retval = get_gridcolormode ();
  else if (pname.compare ("gridlinestyle"))
    retval = get_gridlinestyle ();
  else if (pname.compare ("innerposition"))
    retval = get_innerposition ();
  else if (pname.compare ("interactions"))
    retval = get_interactions ();
  else if (pname.compare ("labelfontsizemultiplier"))
    retval = get_labelfontsizemultiplier ();
  else if (pname.compare ("layer"))
    retval = get_layer ();
  else if (pname.compare ("layout"))
    retval = get_layout ().as_octave_value ();
  else if (pname.compare ("legend"))
    retval = get_legend ().as_octave_value ();
  else if (pname.compare ("linestyleorder"))
    retval = get_linestyleorder ();
  else if (pname.compare ("linestyleorderindex"))
    retval = get_linestyleorderindex ();
  else if (pname.compare ("linewidth"))
    retval = get_linewidth ();
  else if (pname.compare ("minorgridalpha"))
    retval = get_minorgridalpha ();
  else if (pname.compare ("minorgridalphamode"))
    retval = get_minorgridalphamode ();
  else if (pname.compare ("minorgridcolor"))
    retval = get_minorgridcolor ();
  else if (pname.compare ("minorgridcolormode"))
    retval = get_minorgridcolormode ();
  else if (pname.compare ("minorgridlinestyle"))
    retval = get_minorgridlinestyle ();
  else if (pname.compare ("nextplot"))
    retval = get_nextplot ();
  else if (pname.compare ("nextseriesindex"))
    retval = get_nextseriesindex ();
  else if (pname.compare ("outerposition"))
    retval = get_outerposition ();
  else if (pname.compare ("plotboxaspectratio"))
    retval = get_plotboxaspectratio ();
  else if (pname.compare ("plotboxaspectratiomode"))
    retval = get_plotboxaspectratiomode ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("positionconstraint"))
    retval = get_positionconstraint ();
  else if (pname.compare ("projection"))
    retval = get_projection ();
  else if (pname.compare ("sortmethod"))
    retval = get_sortmethod ();
  else if (pname.compare ("tickdir"))
    retval = get_tickdir ();
  else if (pname.compare ("tickdirmode"))
    retval = get_tickdirmode ();
  else if (pname.compare ("ticklabelinterpreter"))
    retval = get_ticklabelinterpreter ();
  else if (pname.compare ("ticklength"))
    retval = get_ticklength ();
  else if (pname.compare ("tightinset"))
    retval = get_tightinset ();
  else if (pname.compare ("title"))
    retval = get_title ().as_octave_value ();
  else if (pname.compare ("titlefontsizemultiplier"))
    retval = get_titlefontsizemultiplier ();
  else if (pname.compare ("titlefontweight"))
    retval = get_titlefontweight ();
  else if (pname.compare ("toolbar"))
    retval = get_toolbar ().as_octave_value ();
  else if (pname.compare ("units"))
    retval = get_units ();
  else if (pname.compare ("view"))
    retval = get_view ();
  else if (pname.compare ("xaxis"))
    retval = get_xaxis ().as_octave_value ();
  else if (pname.compare ("xaxislocation"))
    retval = get_xaxislocation ();
  else if (pname.compare ("xcolor"))
    retval = get_xcolor ();
  else if (pname.compare ("xcolormode"))
    retval = get_xcolormode ();
  else if (pname.compare ("xdir"))
    retval = get_xdir ();
  else if (pname.compare ("xgrid"))
    retval = get_xgrid ();
  else if (pname.compare ("xlabel"))
    retval = get_xlabel ().as_octave_value ();
  else if (pname.compare ("xlim"))
    retval = get_xlim ();
  else if (pname.compare ("xlimitmethod"))
    retval = get_xlimitmethod ();
  else if (pname.compare ("xlimmode"))
    retval = get_xlimmode ();
  else if (pname.compare ("xminorgrid"))
    retval = get_xminorgrid ();
  else if (pname.compare ("xminortick"))
    retval = get_xminortick ();
  else if (pname.compare ("xminortickvalues"))
    retval = get_xminortickvalues ();
  else if (pname.compare ("xminortickvaluesmode"))
    retval = get_xminortickvaluesmode ();
  else if (pname.compare ("xscale"))
    retval = get_xscale ();
  else if (pname.compare ("xtick"))
    retval = get_xtick ();
  else if (pname.compare ("xticklabel"))
    retval = get_xticklabel ();
  else if (pname.compare ("xticklabelmode"))
    retval = get_xticklabelmode ();
  else if (pname.compare ("xticklabelrotation"))
    retval = get_xticklabelrotation ();
  else if (pname.compare ("xtickmode"))
    retval = get_xtickmode ();
  else if (pname.compare ("yaxis"))
    retval = get_yaxis ().as_octave_value ();
  else if (pname.compare ("yaxislocation"))
    retval = get_yaxislocation ();
  else if (pname.compare ("ycolor"))
    retval = get_ycolor ();
  else if (pname.compare ("ycolormode"))
    retval = get_ycolormode ();
  else if (pname.compare ("ydir"))
    retval = get_ydir ();
  else if (pname.compare ("ygrid"))
    retval = get_ygrid ();
  else if (pname.compare ("ylabel"))
    retval = get_ylabel ().as_octave_value ();
  else if (pname.compare ("ylim"))
    retval = get_ylim ();
  else if (pname.compare ("ylimitmethod"))
    retval = get_ylimitmethod ();
  else if (pname.compare ("ylimmode"))
    retval = get_ylimmode ();
  else if (pname.compare ("yminorgrid"))
    retval = get_yminorgrid ();
  else if (pname.compare ("yminortick"))
    retval = get_yminortick ();
  else if (pname.compare ("yminortickvalues"))
    retval = get_yminortickvalues ();
  else if (pname.compare ("yminortickvaluesmode"))
    retval = get_yminortickvaluesmode ();
  else if (pname.compare ("yscale"))
    retval = get_yscale ();
  else if (pname.compare ("ytick"))
    retval = get_ytick ();
  else if (pname.compare ("yticklabel"))
    retval = get_yticklabel ();
  else if (pname.compare ("yticklabelmode"))
    retval = get_yticklabelmode ();
  else if (pname.compare ("yticklabelrotation"))
    retval = get_yticklabelrotation ();
  else if (pname.compare ("ytickmode"))
    retval = get_ytickmode ();
  else if (pname.compare ("zaxis"))
    retval = get_zaxis ().as_octave_value ();
  else if (pname.compare ("zcolor"))
    retval = get_zcolor ();
  else if (pname.compare ("zcolormode"))
    retval = get_zcolormode ();
  else if (pname.compare ("zdir"))
    retval = get_zdir ();
  else if (pname.compare ("zgrid"))
    retval = get_zgrid ();
  else if (pname.compare ("zlabel"))
    retval = get_zlabel ().as_octave_value ();
  else if (pname.compare ("zlim"))
    retval = get_zlim ();
  else if (pname.compare ("zlimitmethod"))
    retval = get_zlimitmethod ();
  else if (pname.compare ("zlimmode"))
    retval = get_zlimmode ();
  else if (pname.compare ("zminorgrid"))
    retval = get_zminorgrid ();
  else if (pname.compare ("zminortick"))
    retval = get_zminortick ();
  else if (pname.compare ("zminortickvalues"))
    retval = get_zminortickvalues ();
  else if (pname.compare ("zminortickvaluesmode"))
    retval = get_zminortickvaluesmode ();
  else if (pname.compare ("zscale"))
    retval = get_zscale ();
  else if (pname.compare ("ztick"))
    retval = get_ztick ();
  else if (pname.compare ("zticklabel"))
    retval = get_zticklabel ();
  else if (pname.compare ("zticklabelmode"))
    retval = get_zticklabelmode ();
  else if (pname.compare ("zticklabelrotation"))
    retval = get_zticklabelrotation ();
  else if (pname.compare ("ztickmode"))
    retval = get_ztickmode ();
  else if (pname.compare ("__colormap__"))
    retval = get___colormap__ ();
  else if (pname.compare ("mousewheelzoom"))
    retval = get_mousewheelzoom ();
  else if (pname.compare ("__autopos_tag__"))
    retval = get___autopos_tag__ ();
  else if (pname.compare ("looseinset"))
    retval = get_looseinset ();
  else if (pname.compare ("__fontsize_points__"))
    retval = get___fontsize_points__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
axes::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("activepositionproperty"))
    return property (&m_activepositionproperty, true);
  else if (pname.compare ("alim"))
    return property (&m_alim, true);
  else if (pname.compare ("alimmode"))
    return property (&m_alimmode, true);
  else if (pname.compare ("alphamap"))
    return property (&m_alphamap, true);
  else if (pname.compare ("alphascale"))
    return property (&m_alphascale, true);
  else if (pname.compare ("ambientlightcolor"))
    return property (&m_ambientlightcolor, true);
  else if (pname.compare ("box"))
    return property (&m_box, true);
  else if (pname.compare ("boxstyle"))
    return property (&m_boxstyle, true);
  else if (pname.compare ("cameraposition"))
    return property (&m_cameraposition, true);
  else if (pname.compare ("camerapositionmode"))
    return property (&m_camerapositionmode, true);
  else if (pname.compare ("cameratarget"))
    return property (&m_cameratarget, true);
  else if (pname.compare ("cameratargetmode"))
    return property (&m_cameratargetmode, true);
  else if (pname.compare ("cameraupvector"))
    return property (&m_cameraupvector, true);
  else if (pname.compare ("cameraupvectormode"))
    return property (&m_cameraupvectormode, true);
  else if (pname.compare ("cameraviewangle"))
    return property (&m_cameraviewangle, true);
  else if (pname.compare ("cameraviewanglemode"))
    return property (&m_cameraviewanglemode, true);
  else if (pname.compare ("clim"))
    return property (&m_clim, true);
  else if (pname.compare ("climmode"))
    return property (&m_climmode, true);
  else if (pname.compare ("clippingstyle"))
    return property (&m_clippingstyle, true);
  else if (pname.compare ("color"))
    return property (&m_color, true);
  else if (pname.compare ("colormap"))
    return property (&m_colormap, true);
  else if (pname.compare ("colororder"))
    return property (&m_colororder, true);
  else if (pname.compare ("colororderindex"))
    return property (&m_colororderindex, true);
  else if (pname.compare ("colorscale"))
    return property (&m_colorscale, true);
  else if (pname.compare ("currentpoint"))
    return property (&m_currentpoint, true);
  else if (pname.compare ("dataaspectratio"))
    return property (&m_dataaspectratio, true);
  else if (pname.compare ("dataaspectratiomode"))
    return property (&m_dataaspectratiomode, true);
  else if (pname.compare ("fontangle"))
    return property (&m_fontangle, true);
  else if (pname.compare ("fontname"))
    return property (&m_fontname, true);
  else if (pname.compare ("fontsize"))
    return property (&m_fontsize, true);
  else if (pname.compare ("fontsizemode"))
    return property (&m_fontsizemode, true);
  else if (pname.compare ("fontsmoothing"))
    return property (&m_fontsmoothing, true);
  else if (pname.compare ("fontunits"))
    return property (&m_fontunits, true);
  else if (pname.compare ("fontweight"))
    return property (&m_fontweight, true);
  else if (pname.compare ("gridalpha"))
    return property (&m_gridalpha, true);
  else if (pname.compare ("gridalphamode"))
    return property (&m_gridalphamode, true);
  else if (pname.compare ("gridcolor"))
    return property (&m_gridcolor, true);
  else if (pname.compare ("gridcolormode"))
    return property (&m_gridcolormode, true);
  else if (pname.compare ("gridlinestyle"))
    return property (&m_gridlinestyle, true);
  else if (pname.compare ("innerposition"))
    return property (&m_innerposition, true);
  else if (pname.compare ("interactions"))
    return property (&m_interactions, true);
  else if (pname.compare ("labelfontsizemultiplier"))
    return property (&m_labelfontsizemultiplier, true);
  else if (pname.compare ("layer"))
    return property (&m_layer, true);
  else if (pname.compare ("layout"))
    return property (&m_layout, true);
  else if (pname.compare ("legend"))
    return property (&m_legend, true);
  else if (pname.compare ("linestyleorder"))
    return property (&m_linestyleorder, true);
  else if (pname.compare ("linestyleorderindex"))
    return property (&m_linestyleorderindex, true);
  else if (pname.compare ("linewidth"))
    return property (&m_linewidth, true);
  else if (pname.compare ("minorgridalpha"))
    return property (&m_minorgridalpha, true);
  else if (pname.compare ("minorgridalphamode"))
    return property (&m_minorgridalphamode, true);
  else if (pname.compare ("minorgridcolor"))
    return property (&m_minorgridcolor, true);
  else if (pname.compare ("minorgridcolormode"))
    return property (&m_minorgridcolormode, true);
  else if (pname.compare ("minorgridlinestyle"))
    return property (&m_minorgridlinestyle, true);
  else if (pname.compare ("nextplot"))
    return property (&m_nextplot, true);
  else if (pname.compare ("nextseriesindex"))
    return property (&m_nextseriesindex, true);
  else if (pname.compare ("outerposition"))
    return property (&m_outerposition, true);
  else if (pname.compare ("plotboxaspectratio"))
    return property (&m_plotboxaspectratio, true);
  else if (pname.compare ("plotboxaspectratiomode"))
    return property (&m_plotboxaspectratiomode, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("positionconstraint"))
    return property (&m_positionconstraint, true);
  else if (pname.compare ("projection"))
    return property (&m_projection, true);
  else if (pname.compare ("sortmethod"))
    return property (&m_sortmethod, true);
  else if (pname.compare ("tickdir"))
    return property (&m_tickdir, true);
  else if (pname.compare ("tickdirmode"))
    return property (&m_tickdirmode, true);
  else if (pname.compare ("ticklabelinterpreter"))
    return property (&m_ticklabelinterpreter, true);
  else if (pname.compare ("ticklength"))
    return property (&m_ticklength, true);
  else if (pname.compare ("tightinset"))
    return property (&m_tightinset, true);
  else if (pname.compare ("title"))
    return property (&m_title, true);
  else if (pname.compare ("titlefontsizemultiplier"))
    return property (&m_titlefontsizemultiplier, true);
  else if (pname.compare ("titlefontweight"))
    return property (&m_titlefontweight, true);
  else if (pname.compare ("toolbar"))
    return property (&m_toolbar, true);
  else if (pname.compare ("units"))
    return property (&m_units, true);
  else if (pname.compare ("view"))
    return property (&m_view, true);
  else if (pname.compare ("xaxis"))
    return property (&m_xaxis, true);
  else if (pname.compare ("xaxislocation"))
    return property (&m_xaxislocation, true);
  else if (pname.compare ("xcolor"))
    return property (&m_xcolor, true);
  else if (pname.compare ("xcolormode"))
    return property (&m_xcolormode, true);
  else if (pname.compare ("xdir"))
    return property (&m_xdir, true);
  else if (pname.compare ("xgrid"))
    return property (&m_xgrid, true);
  else if (pname.compare ("xlabel"))
    return property (&m_xlabel, true);
  else if (pname.compare ("xlim"))
    return property (&m_xlim, true);
  else if (pname.compare ("xlimitmethod"))
    return property (&m_xlimitmethod, true);
  else if (pname.compare ("xlimmode"))
    return property (&m_xlimmode, true);
  else if (pname.compare ("xminorgrid"))
    return property (&m_xminorgrid, true);
  else if (pname.compare ("xminortick"))
    return property (&m_xminortick, true);
  else if (pname.compare ("xminortickvalues"))
    return property (&m_xminortickvalues, true);
  else if (pname.compare ("xminortickvaluesmode"))
    return property (&m_xminortickvaluesmode, true);
  else if (pname.compare ("xscale"))
    return property (&m_xscale, true);
  else if (pname.compare ("xtick"))
    return property (&m_xtick, true);
  else if (pname.compare ("xticklabel"))
    return property (&m_xticklabel, true);
  else if (pname.compare ("xticklabelmode"))
    return property (&m_xticklabelmode, true);
  else if (pname.compare ("xticklabelrotation"))
    return property (&m_xticklabelrotation, true);
  else if (pname.compare ("xtickmode"))
    return property (&m_xtickmode, true);
  else if (pname.compare ("yaxis"))
    return property (&m_yaxis, true);
  else if (pname.compare ("yaxislocation"))
    return property (&m_yaxislocation, true);
  else if (pname.compare ("ycolor"))
    return property (&m_ycolor, true);
  else if (pname.compare ("ycolormode"))
    return property (&m_ycolormode, true);
  else if (pname.compare ("ydir"))
    return property (&m_ydir, true);
  else if (pname.compare ("ygrid"))
    return property (&m_ygrid, true);
  else if (pname.compare ("ylabel"))
    return property (&m_ylabel, true);
  else if (pname.compare ("ylim"))
    return property (&m_ylim, true);
  else if (pname.compare ("ylimitmethod"))
    return property (&m_ylimitmethod, true);
  else if (pname.compare ("ylimmode"))
    return property (&m_ylimmode, true);
  else if (pname.compare ("yminorgrid"))
    return property (&m_yminorgrid, true);
  else if (pname.compare ("yminortick"))
    return property (&m_yminortick, true);
  else if (pname.compare ("yminortickvalues"))
    return property (&m_yminortickvalues, true);
  else if (pname.compare ("yminortickvaluesmode"))
    return property (&m_yminortickvaluesmode, true);
  else if (pname.compare ("yscale"))
    return property (&m_yscale, true);
  else if (pname.compare ("ytick"))
    return property (&m_ytick, true);
  else if (pname.compare ("yticklabel"))
    return property (&m_yticklabel, true);
  else if (pname.compare ("yticklabelmode"))
    return property (&m_yticklabelmode, true);
  else if (pname.compare ("yticklabelrotation"))
    return property (&m_yticklabelrotation, true);
  else if (pname.compare ("ytickmode"))
    return property (&m_ytickmode, true);
  else if (pname.compare ("zaxis"))
    return property (&m_zaxis, true);
  else if (pname.compare ("zcolor"))
    return property (&m_zcolor, true);
  else if (pname.compare ("zcolormode"))
    return property (&m_zcolormode, true);
  else if (pname.compare ("zdir"))
    return property (&m_zdir, true);
  else if (pname.compare ("zgrid"))
    return property (&m_zgrid, true);
  else if (pname.compare ("zlabel"))
    return property (&m_zlabel, true);
  else if (pname.compare ("zlim"))
    return property (&m_zlim, true);
  else if (pname.compare ("zlimitmethod"))
    return property (&m_zlimitmethod, true);
  else if (pname.compare ("zlimmode"))
    return property (&m_zlimmode, true);
  else if (pname.compare ("zminorgrid"))
    return property (&m_zminorgrid, true);
  else if (pname.compare ("zminortick"))
    return property (&m_zminortick, true);
  else if (pname.compare ("zminortickvalues"))
    return property (&m_zminortickvalues, true);
  else if (pname.compare ("zminortickvaluesmode"))
    return property (&m_zminortickvaluesmode, true);
  else if (pname.compare ("zscale"))
    return property (&m_zscale, true);
  else if (pname.compare ("ztick"))
    return property (&m_ztick, true);
  else if (pname.compare ("zticklabel"))
    return property (&m_zticklabel, true);
  else if (pname.compare ("zticklabelmode"))
    return property (&m_zticklabelmode, true);
  else if (pname.compare ("zticklabelrotation"))
    return property (&m_zticklabelrotation, true);
  else if (pname.compare ("ztickmode"))
    return property (&m_ztickmode, true);
  else if (pname.compare ("__colormap__"))
    return property (&m___colormap__, true);
  else if (pname.compare ("mousewheelzoom"))
    return property (&m_mousewheelzoom, true);
  else if (pname.compare ("__autopos_tag__"))
    return property (&m___autopos_tag__, true);
  else if (pname.compare ("looseinset"))
    return property (&m_looseinset, true);
  else if (pname.compare ("__fontsize_points__"))
    return property (&m___fontsize_points__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
axes::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["activepositionproperty"] = "outerposition";
  m["alim"] = default_lim ();
  m["alimmode"] = "auto";
  m["alphamap"] = Matrix ();
  m["alphascale"] = "linear";
  m["ambientlightcolor"] = color_values (1, 1, 1);
  m["box"] = "off";
  m["boxstyle"] = "back";
  m["cameraposition"] = Matrix (1, 3, 0.0);
  m["camerapositionmode"] = "auto";
  m["cameratarget"] = Matrix (1, 3, 0.0);
  m["cameratargetmode"] = "auto";
  m["cameraupvector"] = Matrix (1, 3, 0.0);
  m["cameraupvectormode"] = "auto";
  m["cameraviewangle"] = 6.6086;
  m["cameraviewanglemode"] = "auto";
  m["clim"] = default_lim ();
  m["climmode"] = "auto";
  m["clippingstyle"] = "3dbox";
  m["color"] = color_property (color_values (1, 1, 1), radio_values ("none"));
  m["colormap"] = Matrix ();
  m["colororder"] = default_colororder ();
  m["colororderindex"] = 1.0;
  m["colorscale"] = "linear";
  m["currentpoint"] = Matrix (2, 3, 0.0);
  m["dataaspectratio"] = Matrix (1, 3, 1.0);
  m["dataaspectratiomode"] = "auto";
  m["fontangle"] = "normal";
  m["fontname"] = OCTAVE_DEFAULT_FONTNAME;
  m["fontsize"] = 10;
  m["fontsizemode"] = "auto";
  m["fontsmoothing"] = "on";
  m["fontunits"] = "points";
  m["fontweight"] = "normal";
  m["gridalpha"] = 0.15;
  m["gridalphamode"] = "auto";
  m["gridcolor"] = color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"));
  m["gridcolormode"] = "auto";
  m["gridlinestyle"] = "-";
  m["innerposition"] = default_axes_position ();
  m["interactions"] = Matrix ();
  m["labelfontsizemultiplier"] = 1.1;
  m["layer"] = "bottom";
  m["layout"] = graphics_handle ().as_octave_value ();
  m["legend"] = graphics_handle ().as_octave_value ();
  m["linestyleorder"] = "-";
  m["linestyleorderindex"] = 1.0;
  m["linewidth"] = 0.5;
  m["minorgridalpha"] = 0.25;
  m["minorgridalphamode"] = "auto";
  m["minorgridcolor"] = color_property (color_values (0.1, 0.1, 0.1), radio_values ("none"));
  m["minorgridcolormode"] = "auto";
  m["minorgridlinestyle"] = ":";
  m["nextplot"] = "replace";
  m["nextseriesindex"] = 1.0;
  m["outerposition"] = default_axes_outerposition ();
  m["plotboxaspectratio"] = Matrix (1, 3, 1.0);
  m["plotboxaspectratiomode"] = "auto";
  m["position"] = default_axes_position ();
  m["positionconstraint"] = "outerposition";
  m["projection"] = "orthographic";
  m["sortmethod"] = "depth";
  m["tickdir"] = "in";
  m["tickdirmode"] = "auto";
  m["ticklabelinterpreter"] = "tex";
  m["ticklength"] = default_axes_ticklength ();
  m["tightinset"] = Matrix (1, 4, 0.0);
  m["titlefontsizemultiplier"] = 1.1;
  m["titlefontweight"] = "bold";
  m["toolbar"] = graphics_handle ().as_octave_value ();
  m["units"] = "normalized";
  m["view"] = default_axes_view ();
  m["xaxis"] = graphics_handle ().as_octave_value ();
  m["xaxislocation"] = "bottom";
  m["xcolor"] = color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"));
  m["xcolormode"] = "auto";
  m["xdir"] = "normal";
  m["xgrid"] = "off";
  m["xlim"] = default_lim ();
  m["xlimitmethod"] = "tickaligned";
  m["xlimmode"] = "auto";
  m["xminorgrid"] = "off";
  m["xminortick"] = "off";
  m["xminortickvalues"] = Matrix ();
  m["xminortickvaluesmode"] = "auto";
  m["xscale"] = "linear";
  m["xtick"] = default_axes_tick ();
  m["xticklabel"] = "";
  m["xticklabelmode"] = "auto";
  m["xticklabelrotation"] = 0.0;
  m["xtickmode"] = "auto";
  m["yaxis"] = graphics_handle ().as_octave_value ();
  m["yaxislocation"] = "left";
  m["ycolor"] = color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"));
  m["ycolormode"] = "auto";
  m["ydir"] = "normal";
  m["ygrid"] = "off";
  m["ylim"] = default_lim ();
  m["ylimitmethod"] = "tickaligned";
  m["ylimmode"] = "auto";
  m["yminorgrid"] = "off";
  m["yminortick"] = "off";
  m["yminortickvalues"] = Matrix ();
  m["yminortickvaluesmode"] = "auto";
  m["yscale"] = "linear";
  m["ytick"] = default_axes_tick ();
  m["yticklabel"] = "";
  m["yticklabelmode"] = "auto";
  m["yticklabelrotation"] = 0.0;
  m["ytickmode"] = "auto";
  m["zaxis"] = graphics_handle ().as_octave_value ();
  m["zcolor"] = color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"));
  m["zcolormode"] = "auto";
  m["zdir"] = "normal";
  m["zgrid"] = "off";
  m["zlim"] = default_lim ();
  m["zlimitmethod"] = "tickaligned";
  m["zlimmode"] = "auto";
  m["zminorgrid"] = "off";
  m["zminortick"] = "off";
  m["zminortickvalues"] = Matrix ();
  m["zminortickvaluesmode"] = "auto";
  m["zscale"] = "linear";
  m["ztick"] = default_axes_tick ();
  m["zticklabel"] = "";
  m["zticklabelmode"] = "auto";
  m["zticklabelrotation"] = 0.0;
  m["ztickmode"] = "auto";
  m["__colormap__"] = Matrix ();
  m["mousewheelzoom"] = 0.5;
  m["__autopos_tag__"] = "none";
  m["looseinset"] = Matrix (1, 4, 0.0);
  m["__fontsize_points__"] = 0;

  return m;
}

std::string axes::properties::s_go_name ("axes");

std::set<std::string>
axes::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("activepositionproperty");
      all_pnames.insert ("alim");
      all_pnames.insert ("alimmode");
      all_pnames.insert ("alphamap");
      all_pnames.insert ("alphascale");
      all_pnames.insert ("ambientlightcolor");
      all_pnames.insert ("box");
      all_pnames.insert ("boxstyle");
      all_pnames.insert ("cameraposition");
      all_pnames.insert ("camerapositionmode");
      all_pnames.insert ("cameratarget");
      all_pnames.insert ("cameratargetmode");
      all_pnames.insert ("cameraupvector");
      all_pnames.insert ("cameraupvectormode");
      all_pnames.insert ("cameraviewangle");
      all_pnames.insert ("cameraviewanglemode");
      all_pnames.insert ("clim");
      all_pnames.insert ("climmode");
      all_pnames.insert ("clippingstyle");
      all_pnames.insert ("color");
      all_pnames.insert ("colormap");
      all_pnames.insert ("colororder");
      all_pnames.insert ("colororderindex");
      all_pnames.insert ("colorscale");
      all_pnames.insert ("currentpoint");
      all_pnames.insert ("dataaspectratio");
      all_pnames.insert ("dataaspectratiomode");
      all_pnames.insert ("fontangle");
      all_pnames.insert ("fontname");
      all_pnames.insert ("fontsize");
      all_pnames.insert ("fontsizemode");
      all_pnames.insert ("fontsmoothing");
      all_pnames.insert ("fontunits");
      all_pnames.insert ("fontweight");
      all_pnames.insert ("gridalpha");
      all_pnames.insert ("gridalphamode");
      all_pnames.insert ("gridcolor");
      all_pnames.insert ("gridcolormode");
      all_pnames.insert ("gridlinestyle");
      all_pnames.insert ("innerposition");
      all_pnames.insert ("interactions");
      all_pnames.insert ("labelfontsizemultiplier");
      all_pnames.insert ("layer");
      all_pnames.insert ("layout");
      all_pnames.insert ("legend");
      all_pnames.insert ("linestyleorder");
      all_pnames.insert ("linestyleorderindex");
      all_pnames.insert ("linewidth");
      all_pnames.insert ("minorgridalpha");
      all_pnames.insert ("minorgridalphamode");
      all_pnames.insert ("minorgridcolor");
      all_pnames.insert ("minorgridcolormode");
      all_pnames.insert ("minorgridlinestyle");
      all_pnames.insert ("nextplot");
      all_pnames.insert ("nextseriesindex");
      all_pnames.insert ("outerposition");
      all_pnames.insert ("plotboxaspectratio");
      all_pnames.insert ("plotboxaspectratiomode");
      all_pnames.insert ("position");
      all_pnames.insert ("positionconstraint");
      all_pnames.insert ("projection");
      all_pnames.insert ("sortmethod");
      all_pnames.insert ("tickdir");
      all_pnames.insert ("tickdirmode");
      all_pnames.insert ("ticklabelinterpreter");
      all_pnames.insert ("ticklength");
      all_pnames.insert ("tightinset");
      all_pnames.insert ("title");
      all_pnames.insert ("titlefontsizemultiplier");
      all_pnames.insert ("titlefontweight");
      all_pnames.insert ("toolbar");
      all_pnames.insert ("units");
      all_pnames.insert ("view");
      all_pnames.insert ("xaxis");
      all_pnames.insert ("xaxislocation");
      all_pnames.insert ("xcolor");
      all_pnames.insert ("xcolormode");
      all_pnames.insert ("xdir");
      all_pnames.insert ("xgrid");
      all_pnames.insert ("xlabel");
      all_pnames.insert ("xlim");
      all_pnames.insert ("xlimitmethod");
      all_pnames.insert ("xlimmode");
      all_pnames.insert ("xminorgrid");
      all_pnames.insert ("xminortick");
      all_pnames.insert ("xminortickvalues");
      all_pnames.insert ("xminortickvaluesmode");
      all_pnames.insert ("xscale");
      all_pnames.insert ("xtick");
      all_pnames.insert ("xticklabel");
      all_pnames.insert ("xticklabelmode");
      all_pnames.insert ("xticklabelrotation");
      all_pnames.insert ("xtickmode");
      all_pnames.insert ("yaxis");
      all_pnames.insert ("yaxislocation");
      all_pnames.insert ("ycolor");
      all_pnames.insert ("ycolormode");
      all_pnames.insert ("ydir");
      all_pnames.insert ("ygrid");
      all_pnames.insert ("ylabel");
      all_pnames.insert ("ylim");
      all_pnames.insert ("ylimitmethod");
      all_pnames.insert ("ylimmode");
      all_pnames.insert ("yminorgrid");
      all_pnames.insert ("yminortick");
      all_pnames.insert ("yminortickvalues");
      all_pnames.insert ("yminortickvaluesmode");
      all_pnames.insert ("yscale");
      all_pnames.insert ("ytick");
      all_pnames.insert ("yticklabel");
      all_pnames.insert ("yticklabelmode");
      all_pnames.insert ("yticklabelrotation");
      all_pnames.insert ("ytickmode");
      all_pnames.insert ("zaxis");
      all_pnames.insert ("zcolor");
      all_pnames.insert ("zcolormode");
      all_pnames.insert ("zdir");
      all_pnames.insert ("zgrid");
      all_pnames.insert ("zlabel");
      all_pnames.insert ("zlim");
      all_pnames.insert ("zlimitmethod");
      all_pnames.insert ("zlimmode");
      all_pnames.insert ("zminorgrid");
      all_pnames.insert ("zminortick");
      all_pnames.insert ("zminortickvalues");
      all_pnames.insert ("zminortickvaluesmode");
      all_pnames.insert ("zscale");
      all_pnames.insert ("ztick");
      all_pnames.insert ("zticklabel");
      all_pnames.insert ("zticklabelmode");
      all_pnames.insert ("zticklabelrotation");
      all_pnames.insert ("ztickmode");
      all_pnames.insert ("__colormap__");
      all_pnames.insert ("mousewheelzoom");
      all_pnames.insert ("__autopos_tag__");
      all_pnames.insert ("looseinset");
      all_pnames.insert ("__fontsize_points__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
axes::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
axes::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("interactions");
      all_pnames.insert ("layout");
      all_pnames.insert ("legend");
      all_pnames.insert ("nextseriesindex");
      all_pnames.insert ("tightinset");
      all_pnames.insert ("toolbar");
      all_pnames.insert ("xaxis");
      all_pnames.insert ("yaxis");
      all_pnames.insert ("zaxis");
      all_pnames.insert ("__fontsize_points__");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
axes::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
axes::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
axes::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** line ********

line::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_color ("color", mh, color_property (color_values (0, 0, 0), radio_values ("none"))),
    m_displayname ("displayname", mh, ""),
    m_linejoin ("linejoin", mh, "{round}|miter|chamfer"),
    m_linestyle ("linestyle", mh, "{-}|--|:|-.|none"),
    m_linewidth ("linewidth", mh, 0.5),
    m_marker ("marker", mh, "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram"),
    m_markeredgecolor ("markeredgecolor", mh, color_property (radio_values ("{auto}|none"), color_values (0, 0, 0))),
    m_markerfacecolor ("markerfacecolor", mh, color_property (radio_values ("auto|{none}"), color_values (0, 0, 0))),
    m_markersize ("markersize", mh, 6),
    m_xdata ("xdata", mh, default_data ()),
    m_xdatasource ("xdatasource", mh, ""),
    m_ydata ("ydata", mh, default_data ()),
    m_ydatasource ("ydatasource", mh, ""),
    m_zdata ("zdata", mh, Matrix ()),
    m_zdatasource ("zdatasource", mh, ""),
    m_xlim ("xlim", mh, default_data_lim ()),
    m_ylim ("ylim", mh, default_data_lim ()),
    m_zlim ("zlim", mh, Matrix ()),
    m_xliminclude ("xliminclude", mh, "on"),
    m_yliminclude ("yliminclude", mh, "on"),
    m_zliminclude ("zliminclude", mh, "on")
{
  m_color.set_id (ID_COLOR);
  m_displayname.set_id (ID_DISPLAYNAME);
  m_linejoin.set_id (ID_LINEJOIN);
  m_linestyle.set_id (ID_LINESTYLE);
  m_linewidth.set_id (ID_LINEWIDTH);
  m_marker.set_id (ID_MARKER);
  m_markeredgecolor.set_id (ID_MARKEREDGECOLOR);
  m_markerfacecolor.set_id (ID_MARKERFACECOLOR);
  m_markersize.set_id (ID_MARKERSIZE);
  m_xdata.set_id (ID_XDATA);
  m_xdatasource.set_id (ID_XDATASOURCE);
  m_ydata.set_id (ID_YDATA);
  m_ydatasource.set_id (ID_YDATASOURCE);
  m_zdata.set_id (ID_ZDATA);
  m_zdatasource.set_id (ID_ZDATASOURCE);
  m_xlim.set_id (ID_XLIM);
  m_xlim.set_hidden (true);
  m_ylim.set_id (ID_YLIM);
  m_ylim.set_hidden (true);
  m_zlim.set_id (ID_ZLIM);
  m_zlim.set_hidden (true);
  m_xliminclude.set_id (ID_XLIMINCLUDE);
  m_xliminclude.set_hidden (true);
  m_yliminclude.set_id (ID_YLIMINCLUDE);
  m_yliminclude.set_hidden (true);
  m_zliminclude.set_id (ID_ZLIMINCLUDE);
  m_zliminclude.set_hidden (true);
  init ();
}

void
line::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("color"))
    set_color (val);
  else if (pname.compare ("displayname"))
    set_displayname (val);
  else if (pname.compare ("linejoin"))
    set_linejoin (val);
  else if (pname.compare ("linestyle"))
    set_linestyle (val);
  else if (pname.compare ("linewidth"))
    set_linewidth (val);
  else if (pname.compare ("marker"))
    set_marker (val);
  else if (pname.compare ("markeredgecolor"))
    set_markeredgecolor (val);
  else if (pname.compare ("markerfacecolor"))
    set_markerfacecolor (val);
  else if (pname.compare ("markersize"))
    set_markersize (val);
  else if (pname.compare ("xdata"))
    set_xdata (val);
  else if (pname.compare ("xdatasource"))
    set_xdatasource (val);
  else if (pname.compare ("ydata"))
    set_ydata (val);
  else if (pname.compare ("ydatasource"))
    set_ydatasource (val);
  else if (pname.compare ("zdata"))
    set_zdata (val);
  else if (pname.compare ("zdatasource"))
    set_zdatasource (val);
  else if (pname.compare ("xliminclude"))
    set_xliminclude (val);
  else if (pname.compare ("yliminclude"))
    set_yliminclude (val);
  else if (pname.compare ("zliminclude"))
    set_zliminclude (val);
  else
    base_properties::set (pname, val);
}

octave_value
line::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("color", octave_value (get_color ()));
  m.assign ("displayname", octave_value (get_displayname ()));
  m.assign ("linejoin", octave_value (get_linejoin ()));
  m.assign ("linestyle", octave_value (get_linestyle ()));
  m.assign ("linewidth", octave_value (get_linewidth ()));
  m.assign ("marker", octave_value (get_marker ()));
  m.assign ("markeredgecolor", octave_value (get_markeredgecolor ()));
  m.assign ("markerfacecolor", octave_value (get_markerfacecolor ()));
  m.assign ("markersize", octave_value (get_markersize ()));
  m.assign ("xdata", octave_value (get_xdata ()));
  m.assign ("xdatasource", octave_value (get_xdatasource ()));
  m.assign ("ydata", octave_value (get_ydata ()));
  m.assign ("ydatasource", octave_value (get_ydatasource ()));
  m.assign ("zdata", octave_value (get_zdata ()));
  m.assign ("zdatasource", octave_value (get_zdatasource ()));
  if (all)
    m.assign ("xlim", octave_value (get_xlim ()));
  if (all)
    m.assign ("ylim", octave_value (get_ylim ()));
  if (all)
    m.assign ("zlim", octave_value (get_zlim ()));
  if (all)
    m.assign ("xliminclude", octave_value (get_xliminclude ()));
  if (all)
    m.assign ("yliminclude", octave_value (get_yliminclude ()));
  if (all)
    m.assign ("zliminclude", octave_value (get_zliminclude ()));

  return m;
}

octave_value
line::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("color"))
    retval = get_color ();
  else if (pname.compare ("displayname"))
    retval = get_displayname ();
  else if (pname.compare ("linejoin"))
    retval = get_linejoin ();
  else if (pname.compare ("linestyle"))
    retval = get_linestyle ();
  else if (pname.compare ("linewidth"))
    retval = get_linewidth ();
  else if (pname.compare ("marker"))
    retval = get_marker ();
  else if (pname.compare ("markeredgecolor"))
    retval = get_markeredgecolor ();
  else if (pname.compare ("markerfacecolor"))
    retval = get_markerfacecolor ();
  else if (pname.compare ("markersize"))
    retval = get_markersize ();
  else if (pname.compare ("xdata"))
    retval = get_xdata ();
  else if (pname.compare ("xdatasource"))
    retval = get_xdatasource ();
  else if (pname.compare ("ydata"))
    retval = get_ydata ();
  else if (pname.compare ("ydatasource"))
    retval = get_ydatasource ();
  else if (pname.compare ("zdata"))
    retval = get_zdata ();
  else if (pname.compare ("zdatasource"))
    retval = get_zdatasource ();
  else if (pname.compare ("xlim"))
    retval = get_xlim ();
  else if (pname.compare ("ylim"))
    retval = get_ylim ();
  else if (pname.compare ("zlim"))
    retval = get_zlim ();
  else if (pname.compare ("xliminclude"))
    retval = get_xliminclude ();
  else if (pname.compare ("yliminclude"))
    retval = get_yliminclude ();
  else if (pname.compare ("zliminclude"))
    retval = get_zliminclude ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
line::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("color"))
    return property (&m_color, true);
  else if (pname.compare ("displayname"))
    return property (&m_displayname, true);
  else if (pname.compare ("linejoin"))
    return property (&m_linejoin, true);
  else if (pname.compare ("linestyle"))
    return property (&m_linestyle, true);
  else if (pname.compare ("linewidth"))
    return property (&m_linewidth, true);
  else if (pname.compare ("marker"))
    return property (&m_marker, true);
  else if (pname.compare ("markeredgecolor"))
    return property (&m_markeredgecolor, true);
  else if (pname.compare ("markerfacecolor"))
    return property (&m_markerfacecolor, true);
  else if (pname.compare ("markersize"))
    return property (&m_markersize, true);
  else if (pname.compare ("xdata"))
    return property (&m_xdata, true);
  else if (pname.compare ("xdatasource"))
    return property (&m_xdatasource, true);
  else if (pname.compare ("ydata"))
    return property (&m_ydata, true);
  else if (pname.compare ("ydatasource"))
    return property (&m_ydatasource, true);
  else if (pname.compare ("zdata"))
    return property (&m_zdata, true);
  else if (pname.compare ("zdatasource"))
    return property (&m_zdatasource, true);
  else if (pname.compare ("xlim"))
    return property (&m_xlim, true);
  else if (pname.compare ("ylim"))
    return property (&m_ylim, true);
  else if (pname.compare ("zlim"))
    return property (&m_zlim, true);
  else if (pname.compare ("xliminclude"))
    return property (&m_xliminclude, true);
  else if (pname.compare ("yliminclude"))
    return property (&m_yliminclude, true);
  else if (pname.compare ("zliminclude"))
    return property (&m_zliminclude, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
line::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["color"] = color_property (color_values (0, 0, 0), radio_values ("none"));
  m["displayname"] = "";
  m["linejoin"] = "round";
  m["linestyle"] = "-";
  m["linewidth"] = 0.5;
  m["marker"] = "none";
  m["markeredgecolor"] = color_property (radio_values ("{auto}|none"), color_values (0, 0, 0));
  m["markerfacecolor"] = color_property (radio_values ("auto|{none}"), color_values (0, 0, 0));
  m["markersize"] = 6;
  m["xdata"] = default_data ();
  m["xdatasource"] = "";
  m["ydata"] = default_data ();
  m["ydatasource"] = "";
  m["zdata"] = Matrix ();
  m["zdatasource"] = "";
  m["xlim"] = default_data_lim ();
  m["ylim"] = default_data_lim ();
  m["zlim"] = Matrix ();
  m["xliminclude"] = "on";
  m["yliminclude"] = "on";
  m["zliminclude"] = "on";

  return m;
}

std::string line::properties::s_go_name ("line");

std::set<std::string>
line::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("color");
      all_pnames.insert ("displayname");
      all_pnames.insert ("linejoin");
      all_pnames.insert ("linestyle");
      all_pnames.insert ("linewidth");
      all_pnames.insert ("marker");
      all_pnames.insert ("markeredgecolor");
      all_pnames.insert ("markerfacecolor");
      all_pnames.insert ("markersize");
      all_pnames.insert ("xdata");
      all_pnames.insert ("xdatasource");
      all_pnames.insert ("ydata");
      all_pnames.insert ("ydatasource");
      all_pnames.insert ("zdata");
      all_pnames.insert ("zdatasource");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");
      all_pnames.insert ("xliminclude");
      all_pnames.insert ("yliminclude");
      all_pnames.insert ("zliminclude");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
line::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
line::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
line::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
line::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
line::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** text ********

text::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_backgroundcolor ("backgroundcolor", mh, color_property (radio_values ("{none}"), color_values (1, 1, 1))),
    m_color ("color", mh, color_property (color_values (0, 0, 0), radio_values ("none"))),
    m_edgecolor ("edgecolor", mh, color_property (radio_values ("{none}"), color_values (0, 0, 0))),
    m_editing ("editing", mh, "off"),
    m_extent ("extent", mh, Matrix (1, 4, 0.0)),
    m_fontangle ("fontangle", mh, "{normal}|italic"),
    m_fontname ("fontname", mh, OCTAVE_DEFAULT_FONTNAME),
    m_fontsize ("fontsize", mh, 10),
    m_fontsmoothing ("fontsmoothing", mh, "on"),
    m_fontunits ("fontunits", mh, "inches|centimeters|normalized|{points}|pixels"),
    m_fontweight ("fontweight", mh, "{normal}|bold"),
    m_horizontalalignment ("horizontalalignment", mh, "{left}|center|right"),
    m_interpreter ("interpreter", mh, "{tex}|none|latex"),
    m_linestyle ("linestyle", mh, "{-}|--|:|-.|none"),
    m_linewidth ("linewidth", mh, 0.5),
    m_margin ("margin", mh, 3),
    m_position ("position", mh, Matrix (1, 3, 0.0)),
    m_rotation ("rotation", mh, 0),
    m_string ("string", mh, ""),
    m_units ("units", mh, "{data}|pixels|normalized|inches|centimeters|points"),
    m_verticalalignment ("verticalalignment", mh, "top|cap|{middle}|baseline|bottom"),
    m_xlim ("xlim", mh, Matrix ()),
    m_ylim ("ylim", mh, Matrix ()),
    m_zlim ("zlim", mh, Matrix ()),
    m_xliminclude ("xliminclude", mh, "off"),
    m_yliminclude ("yliminclude", mh, "off"),
    m_zliminclude ("zliminclude", mh, "off"),
    m_positionmode ("positionmode", mh, "{auto}|manual"),
    m_rotationmode ("rotationmode", mh, "{auto}|manual"),
    m_horizontalalignmentmode ("horizontalalignmentmode", mh, "{auto}|manual"),
    m_verticalalignmentmode ("verticalalignmentmode", mh, "{auto}|manual"),
    m___autopos_tag__ ("__autopos_tag__", mh, "{none}|xlabel|ylabel|zlabel|title"),
    m___fontsize_points__ ("__fontsize_points__", mh, 0)
{
  m_backgroundcolor.set_id (ID_BACKGROUNDCOLOR);
  m_color.set_id (ID_COLOR);
  m_edgecolor.set_id (ID_EDGECOLOR);
  m_editing.set_id (ID_EDITING);
  m_extent.set_id (ID_EXTENT);
  m_fontangle.set_id (ID_FONTANGLE);
  m_fontname.set_id (ID_FONTNAME);
  m_fontsize.set_id (ID_FONTSIZE);
  m_fontsmoothing.set_id (ID_FONTSMOOTHING);
  m_fontunits.set_id (ID_FONTUNITS);
  m_fontweight.set_id (ID_FONTWEIGHT);
  m_horizontalalignment.set_id (ID_HORIZONTALALIGNMENT);
  m_interpreter.set_id (ID_INTERPRETER);
  m_linestyle.set_id (ID_LINESTYLE);
  m_linewidth.set_id (ID_LINEWIDTH);
  m_margin.set_id (ID_MARGIN);
  m_position.set_id (ID_POSITION);
  m_rotation.set_id (ID_ROTATION);
  m_string.set_id (ID_STRING);
  m_units.set_id (ID_UNITS);
  m_verticalalignment.set_id (ID_VERTICALALIGNMENT);
  m_xlim.set_id (ID_XLIM);
  m_xlim.set_hidden (true);
  m_ylim.set_id (ID_YLIM);
  m_ylim.set_hidden (true);
  m_zlim.set_id (ID_ZLIM);
  m_zlim.set_hidden (true);
  m_xliminclude.set_id (ID_XLIMINCLUDE);
  m_xliminclude.set_hidden (true);
  m_yliminclude.set_id (ID_YLIMINCLUDE);
  m_yliminclude.set_hidden (true);
  m_zliminclude.set_id (ID_ZLIMINCLUDE);
  m_zliminclude.set_hidden (true);
  m_positionmode.set_id (ID_POSITIONMODE);
  m_positionmode.set_hidden (true);
  m_rotationmode.set_id (ID_ROTATIONMODE);
  m_rotationmode.set_hidden (true);
  m_horizontalalignmentmode.set_id (ID_HORIZONTALALIGNMENTMODE);
  m_horizontalalignmentmode.set_hidden (true);
  m_verticalalignmentmode.set_id (ID_VERTICALALIGNMENTMODE);
  m_verticalalignmentmode.set_hidden (true);
  m___autopos_tag__.set_id (ID___AUTOPOS_TAG__);
  m___autopos_tag__.set_hidden (true);
  m___fontsize_points__.set_id (ID___FONTSIZE_POINTS__);
  m___fontsize_points__.set_hidden (true);
  init ();
}

void
text::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("backgroundcolor"))
    set_backgroundcolor (val);
  else if (pname.compare ("color"))
    set_color (val);
  else if (pname.compare ("edgecolor"))
    set_edgecolor (val);
  else if (pname.compare ("editing"))
    set_editing (val);
  else if (pname.compare ("fontangle"))
    set_fontangle (val);
  else if (pname.compare ("fontname"))
    set_fontname (val);
  else if (pname.compare ("fontsize"))
    set_fontsize (val);
  else if (pname.compare ("fontsmoothing"))
    set_fontsmoothing (val);
  else if (pname.compare ("fontunits"))
    set_fontunits (val);
  else if (pname.compare ("fontweight"))
    set_fontweight (val);
  else if (pname.compare ("horizontalalignment"))
    set_horizontalalignment (val);
  else if (pname.compare ("interpreter"))
    set_interpreter (val);
  else if (pname.compare ("linestyle"))
    set_linestyle (val);
  else if (pname.compare ("linewidth"))
    set_linewidth (val);
  else if (pname.compare ("margin"))
    set_margin (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("rotation"))
    set_rotation (val);
  else if (pname.compare ("string"))
    set_string (val);
  else if (pname.compare ("units"))
    set_units (val);
  else if (pname.compare ("verticalalignment"))
    set_verticalalignment (val);
  else if (pname.compare ("xliminclude"))
    set_xliminclude (val);
  else if (pname.compare ("yliminclude"))
    set_yliminclude (val);
  else if (pname.compare ("zliminclude"))
    set_zliminclude (val);
  else if (pname.compare ("positionmode"))
    set_positionmode (val);
  else if (pname.compare ("rotationmode"))
    set_rotationmode (val);
  else if (pname.compare ("horizontalalignmentmode"))
    set_horizontalalignmentmode (val);
  else if (pname.compare ("verticalalignmentmode"))
    set_verticalalignmentmode (val);
  else if (pname.compare ("__autopos_tag__"))
    set___autopos_tag__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
text::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("backgroundcolor", octave_value (get_backgroundcolor ()));
  m.assign ("color", octave_value (get_color ()));
  m.assign ("edgecolor", octave_value (get_edgecolor ()));
  m.assign ("editing", octave_value (get_editing ()));
  m.assign ("extent", octave_value (get_extent ()));
  m.assign ("fontangle", octave_value (get_fontangle ()));
  m.assign ("fontname", octave_value (get_fontname ()));
  m.assign ("fontsize", octave_value (get_fontsize ()));
  m.assign ("fontsmoothing", octave_value (get_fontsmoothing ()));
  m.assign ("fontunits", octave_value (get_fontunits ()));
  m.assign ("fontweight", octave_value (get_fontweight ()));
  m.assign ("horizontalalignment", octave_value (get_horizontalalignment ()));
  m.assign ("interpreter", octave_value (get_interpreter ()));
  m.assign ("linestyle", octave_value (get_linestyle ()));
  m.assign ("linewidth", octave_value (get_linewidth ()));
  m.assign ("margin", octave_value (get_margin ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("rotation", octave_value (get_rotation ()));
  m.assign ("string", octave_value (get_string ()));
  m.assign ("units", octave_value (get_units ()));
  m.assign ("verticalalignment", octave_value (get_verticalalignment ()));
  if (all)
    m.assign ("xlim", octave_value (get_xlim ()));
  if (all)
    m.assign ("ylim", octave_value (get_ylim ()));
  if (all)
    m.assign ("zlim", octave_value (get_zlim ()));
  if (all)
    m.assign ("xliminclude", octave_value (get_xliminclude ()));
  if (all)
    m.assign ("yliminclude", octave_value (get_yliminclude ()));
  if (all)
    m.assign ("zliminclude", octave_value (get_zliminclude ()));
  if (all)
    m.assign ("positionmode", octave_value (get_positionmode ()));
  if (all)
    m.assign ("rotationmode", octave_value (get_rotationmode ()));
  if (all)
    m.assign ("horizontalalignmentmode", octave_value (get_horizontalalignmentmode ()));
  if (all)
    m.assign ("verticalalignmentmode", octave_value (get_verticalalignmentmode ()));
  if (all)
    m.assign ("__autopos_tag__", octave_value (get___autopos_tag__ ()));
  if (all)
    m.assign ("__fontsize_points__", octave_value (get___fontsize_points__ ()));

  return m;
}

octave_value
text::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("backgroundcolor"))
    retval = get_backgroundcolor ();
  else if (pname.compare ("color"))
    retval = get_color ();
  else if (pname.compare ("edgecolor"))
    retval = get_edgecolor ();
  else if (pname.compare ("editing"))
    retval = get_editing ();
  else if (pname.compare ("extent"))
    retval = get_extent ();
  else if (pname.compare ("fontangle"))
    retval = get_fontangle ();
  else if (pname.compare ("fontname"))
    retval = get_fontname ();
  else if (pname.compare ("fontsize"))
    retval = get_fontsize ();
  else if (pname.compare ("fontsmoothing"))
    retval = get_fontsmoothing ();
  else if (pname.compare ("fontunits"))
    retval = get_fontunits ();
  else if (pname.compare ("fontweight"))
    retval = get_fontweight ();
  else if (pname.compare ("horizontalalignment"))
    retval = get_horizontalalignment ();
  else if (pname.compare ("interpreter"))
    retval = get_interpreter ();
  else if (pname.compare ("linestyle"))
    retval = get_linestyle ();
  else if (pname.compare ("linewidth"))
    retval = get_linewidth ();
  else if (pname.compare ("margin"))
    retval = get_margin ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("rotation"))
    retval = get_rotation ();
  else if (pname.compare ("string"))
    retval = get_string ();
  else if (pname.compare ("units"))
    retval = get_units ();
  else if (pname.compare ("verticalalignment"))
    retval = get_verticalalignment ();
  else if (pname.compare ("xlim"))
    retval = get_xlim ();
  else if (pname.compare ("ylim"))
    retval = get_ylim ();
  else if (pname.compare ("zlim"))
    retval = get_zlim ();
  else if (pname.compare ("xliminclude"))
    retval = get_xliminclude ();
  else if (pname.compare ("yliminclude"))
    retval = get_yliminclude ();
  else if (pname.compare ("zliminclude"))
    retval = get_zliminclude ();
  else if (pname.compare ("positionmode"))
    retval = get_positionmode ();
  else if (pname.compare ("rotationmode"))
    retval = get_rotationmode ();
  else if (pname.compare ("horizontalalignmentmode"))
    retval = get_horizontalalignmentmode ();
  else if (pname.compare ("verticalalignmentmode"))
    retval = get_verticalalignmentmode ();
  else if (pname.compare ("__autopos_tag__"))
    retval = get___autopos_tag__ ();
  else if (pname.compare ("__fontsize_points__"))
    retval = get___fontsize_points__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
text::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("backgroundcolor"))
    return property (&m_backgroundcolor, true);
  else if (pname.compare ("color"))
    return property (&m_color, true);
  else if (pname.compare ("edgecolor"))
    return property (&m_edgecolor, true);
  else if (pname.compare ("editing"))
    return property (&m_editing, true);
  else if (pname.compare ("extent"))
    return property (&m_extent, true);
  else if (pname.compare ("fontangle"))
    return property (&m_fontangle, true);
  else if (pname.compare ("fontname"))
    return property (&m_fontname, true);
  else if (pname.compare ("fontsize"))
    return property (&m_fontsize, true);
  else if (pname.compare ("fontsmoothing"))
    return property (&m_fontsmoothing, true);
  else if (pname.compare ("fontunits"))
    return property (&m_fontunits, true);
  else if (pname.compare ("fontweight"))
    return property (&m_fontweight, true);
  else if (pname.compare ("horizontalalignment"))
    return property (&m_horizontalalignment, true);
  else if (pname.compare ("interpreter"))
    return property (&m_interpreter, true);
  else if (pname.compare ("linestyle"))
    return property (&m_linestyle, true);
  else if (pname.compare ("linewidth"))
    return property (&m_linewidth, true);
  else if (pname.compare ("margin"))
    return property (&m_margin, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("rotation"))
    return property (&m_rotation, true);
  else if (pname.compare ("string"))
    return property (&m_string, true);
  else if (pname.compare ("units"))
    return property (&m_units, true);
  else if (pname.compare ("verticalalignment"))
    return property (&m_verticalalignment, true);
  else if (pname.compare ("xlim"))
    return property (&m_xlim, true);
  else if (pname.compare ("ylim"))
    return property (&m_ylim, true);
  else if (pname.compare ("zlim"))
    return property (&m_zlim, true);
  else if (pname.compare ("xliminclude"))
    return property (&m_xliminclude, true);
  else if (pname.compare ("yliminclude"))
    return property (&m_yliminclude, true);
  else if (pname.compare ("zliminclude"))
    return property (&m_zliminclude, true);
  else if (pname.compare ("positionmode"))
    return property (&m_positionmode, true);
  else if (pname.compare ("rotationmode"))
    return property (&m_rotationmode, true);
  else if (pname.compare ("horizontalalignmentmode"))
    return property (&m_horizontalalignmentmode, true);
  else if (pname.compare ("verticalalignmentmode"))
    return property (&m_verticalalignmentmode, true);
  else if (pname.compare ("__autopos_tag__"))
    return property (&m___autopos_tag__, true);
  else if (pname.compare ("__fontsize_points__"))
    return property (&m___fontsize_points__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
text::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["backgroundcolor"] = color_property (radio_values ("{none}"), color_values (1, 1, 1));
  m["color"] = color_property (color_values (0, 0, 0), radio_values ("none"));
  m["edgecolor"] = color_property (radio_values ("{none}"), color_values (0, 0, 0));
  m["editing"] = "off";
  m["extent"] = Matrix (1, 4, 0.0);
  m["fontangle"] = "normal";
  m["fontname"] = OCTAVE_DEFAULT_FONTNAME;
  m["fontsize"] = 10;
  m["fontsmoothing"] = "on";
  m["fontunits"] = "points";
  m["fontweight"] = "normal";
  m["horizontalalignment"] = "left";
  m["interpreter"] = "tex";
  m["linestyle"] = "-";
  m["linewidth"] = 0.5;
  m["margin"] = 3;
  m["position"] = Matrix (1, 3, 0.0);
  m["rotation"] = 0;
  m["string"] = "";
  m["units"] = "data";
  m["verticalalignment"] = "middle";
  m["xlim"] = Matrix ();
  m["ylim"] = Matrix ();
  m["zlim"] = Matrix ();
  m["xliminclude"] = "off";
  m["yliminclude"] = "off";
  m["zliminclude"] = "off";
  m["positionmode"] = "auto";
  m["rotationmode"] = "auto";
  m["horizontalalignmentmode"] = "auto";
  m["verticalalignmentmode"] = "auto";
  m["__autopos_tag__"] = "none";
  m["__fontsize_points__"] = 0;

  return m;
}

std::string text::properties::s_go_name ("text");

std::set<std::string>
text::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("backgroundcolor");
      all_pnames.insert ("color");
      all_pnames.insert ("edgecolor");
      all_pnames.insert ("editing");
      all_pnames.insert ("extent");
      all_pnames.insert ("fontangle");
      all_pnames.insert ("fontname");
      all_pnames.insert ("fontsize");
      all_pnames.insert ("fontsmoothing");
      all_pnames.insert ("fontunits");
      all_pnames.insert ("fontweight");
      all_pnames.insert ("horizontalalignment");
      all_pnames.insert ("interpreter");
      all_pnames.insert ("linestyle");
      all_pnames.insert ("linewidth");
      all_pnames.insert ("margin");
      all_pnames.insert ("position");
      all_pnames.insert ("rotation");
      all_pnames.insert ("string");
      all_pnames.insert ("units");
      all_pnames.insert ("verticalalignment");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");
      all_pnames.insert ("xliminclude");
      all_pnames.insert ("yliminclude");
      all_pnames.insert ("zliminclude");
      all_pnames.insert ("positionmode");
      all_pnames.insert ("rotationmode");
      all_pnames.insert ("horizontalalignmentmode");
      all_pnames.insert ("verticalalignmentmode");
      all_pnames.insert ("__autopos_tag__");
      all_pnames.insert ("__fontsize_points__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
text::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
text::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("extent");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");
      all_pnames.insert ("__fontsize_points__");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
text::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
text::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
text::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** image ********

image::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_alphadata ("alphadata", mh, Matrix (1, 1, 1.0)),
    m_alphadatamapping ("alphadatamapping", mh, "{none}|direct|scaled"),
    m_cdata ("cdata", mh, default_image_cdata ()),
    m_cdatamapping ("cdatamapping", mh, "scaled|{direct}"),
    m_xdata ("xdata", mh, Matrix ()),
    m_ydata ("ydata", mh, Matrix ()),
    m_alim ("alim", mh, Matrix ()),
    m_clim ("clim", mh, Matrix ()),
    m_xlim ("xlim", mh, Matrix ()),
    m_ylim ("ylim", mh, Matrix ()),
    m_aliminclude ("aliminclude", mh, "on"),
    m_climinclude ("climinclude", mh, "on"),
    m_xliminclude ("xliminclude", mh, "on"),
    m_yliminclude ("yliminclude", mh, "on"),
    m_xdatamode ("xdatamode", mh, "{auto}|manual"),
    m_ydatamode ("ydatamode", mh, "{auto}|manual")
{
  m_alphadata.set_id (ID_ALPHADATA);
  m_alphadatamapping.set_id (ID_ALPHADATAMAPPING);
  m_cdata.set_id (ID_CDATA);
  m_cdatamapping.set_id (ID_CDATAMAPPING);
  m_xdata.set_id (ID_XDATA);
  m_ydata.set_id (ID_YDATA);
  m_alim.set_id (ID_ALIM);
  m_alim.set_hidden (true);
  m_clim.set_id (ID_CLIM);
  m_clim.set_hidden (true);
  m_xlim.set_id (ID_XLIM);
  m_xlim.set_hidden (true);
  m_ylim.set_id (ID_YLIM);
  m_ylim.set_hidden (true);
  m_aliminclude.set_id (ID_ALIMINCLUDE);
  m_aliminclude.set_hidden (true);
  m_climinclude.set_id (ID_CLIMINCLUDE);
  m_climinclude.set_hidden (true);
  m_xliminclude.set_id (ID_XLIMINCLUDE);
  m_xliminclude.set_hidden (true);
  m_yliminclude.set_id (ID_YLIMINCLUDE);
  m_yliminclude.set_hidden (true);
  m_xdatamode.set_id (ID_XDATAMODE);
  m_xdatamode.set_hidden (true);
  m_ydatamode.set_id (ID_YDATAMODE);
  m_ydatamode.set_hidden (true);
  init ();
}

void
image::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("alphadata"))
    set_alphadata (val);
  else if (pname.compare ("alphadatamapping"))
    set_alphadatamapping (val);
  else if (pname.compare ("cdata"))
    set_cdata (val);
  else if (pname.compare ("cdatamapping"))
    set_cdatamapping (val);
  else if (pname.compare ("xdata"))
    set_xdata (val);
  else if (pname.compare ("ydata"))
    set_ydata (val);
  else if (pname.compare ("aliminclude"))
    set_aliminclude (val);
  else if (pname.compare ("climinclude"))
    set_climinclude (val);
  else if (pname.compare ("xliminclude"))
    set_xliminclude (val);
  else if (pname.compare ("yliminclude"))
    set_yliminclude (val);
  else if (pname.compare ("xdatamode"))
    set_xdatamode (val);
  else if (pname.compare ("ydatamode"))
    set_ydatamode (val);
  else
    base_properties::set (pname, val);
}

octave_value
image::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("alphadata", octave_value (get_alphadata ()));
  m.assign ("alphadatamapping", octave_value (get_alphadatamapping ()));
  m.assign ("cdata", octave_value (get_cdata ()));
  m.assign ("cdatamapping", octave_value (get_cdatamapping ()));
  m.assign ("xdata", octave_value (get_xdata ()));
  m.assign ("ydata", octave_value (get_ydata ()));
  if (all)
    m.assign ("alim", octave_value (get_alim ()));
  if (all)
    m.assign ("clim", octave_value (get_clim ()));
  if (all)
    m.assign ("xlim", octave_value (get_xlim ()));
  if (all)
    m.assign ("ylim", octave_value (get_ylim ()));
  if (all)
    m.assign ("aliminclude", octave_value (get_aliminclude ()));
  if (all)
    m.assign ("climinclude", octave_value (get_climinclude ()));
  if (all)
    m.assign ("xliminclude", octave_value (get_xliminclude ()));
  if (all)
    m.assign ("yliminclude", octave_value (get_yliminclude ()));
  if (all)
    m.assign ("xdatamode", octave_value (get_xdatamode ()));
  if (all)
    m.assign ("ydatamode", octave_value (get_ydatamode ()));

  return m;
}

octave_value
image::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("alphadata"))
    retval = get_alphadata ();
  else if (pname.compare ("alphadatamapping"))
    retval = get_alphadatamapping ();
  else if (pname.compare ("cdata"))
    retval = get_cdata ();
  else if (pname.compare ("cdatamapping"))
    retval = get_cdatamapping ();
  else if (pname.compare ("xdata"))
    retval = get_xdata ();
  else if (pname.compare ("ydata"))
    retval = get_ydata ();
  else if (pname.compare ("alim"))
    retval = get_alim ();
  else if (pname.compare ("clim"))
    retval = get_clim ();
  else if (pname.compare ("xlim"))
    retval = get_xlim ();
  else if (pname.compare ("ylim"))
    retval = get_ylim ();
  else if (pname.compare ("aliminclude"))
    retval = get_aliminclude ();
  else if (pname.compare ("climinclude"))
    retval = get_climinclude ();
  else if (pname.compare ("xliminclude"))
    retval = get_xliminclude ();
  else if (pname.compare ("yliminclude"))
    retval = get_yliminclude ();
  else if (pname.compare ("xdatamode"))
    retval = get_xdatamode ();
  else if (pname.compare ("ydatamode"))
    retval = get_ydatamode ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
image::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("alphadata"))
    return property (&m_alphadata, true);
  else if (pname.compare ("alphadatamapping"))
    return property (&m_alphadatamapping, true);
  else if (pname.compare ("cdata"))
    return property (&m_cdata, true);
  else if (pname.compare ("cdatamapping"))
    return property (&m_cdatamapping, true);
  else if (pname.compare ("xdata"))
    return property (&m_xdata, true);
  else if (pname.compare ("ydata"))
    return property (&m_ydata, true);
  else if (pname.compare ("alim"))
    return property (&m_alim, true);
  else if (pname.compare ("clim"))
    return property (&m_clim, true);
  else if (pname.compare ("xlim"))
    return property (&m_xlim, true);
  else if (pname.compare ("ylim"))
    return property (&m_ylim, true);
  else if (pname.compare ("aliminclude"))
    return property (&m_aliminclude, true);
  else if (pname.compare ("climinclude"))
    return property (&m_climinclude, true);
  else if (pname.compare ("xliminclude"))
    return property (&m_xliminclude, true);
  else if (pname.compare ("yliminclude"))
    return property (&m_yliminclude, true);
  else if (pname.compare ("xdatamode"))
    return property (&m_xdatamode, true);
  else if (pname.compare ("ydatamode"))
    return property (&m_ydatamode, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
image::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["alphadata"] = Matrix (1, 1, 1.0);
  m["alphadatamapping"] = "none";
  m["cdata"] = default_image_cdata ();
  m["cdatamapping"] = "direct";
  m["xdata"] = Matrix ();
  m["ydata"] = Matrix ();
  m["alim"] = Matrix ();
  m["clim"] = Matrix ();
  m["xlim"] = Matrix ();
  m["ylim"] = Matrix ();
  m["aliminclude"] = "on";
  m["climinclude"] = "on";
  m["xliminclude"] = "on";
  m["yliminclude"] = "on";
  m["xdatamode"] = "auto";
  m["ydatamode"] = "auto";

  return m;
}

std::string image::properties::s_go_name ("image");

std::set<std::string>
image::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alphadata");
      all_pnames.insert ("alphadatamapping");
      all_pnames.insert ("cdata");
      all_pnames.insert ("cdatamapping");
      all_pnames.insert ("xdata");
      all_pnames.insert ("ydata");
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("aliminclude");
      all_pnames.insert ("climinclude");
      all_pnames.insert ("xliminclude");
      all_pnames.insert ("yliminclude");
      all_pnames.insert ("xdatamode");
      all_pnames.insert ("ydatamode");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
image::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
image::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
image::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
image::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
image::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** light ********

light::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_color ("color", mh, color_values (1, 1, 1)),
    m_position ("position", mh, default_light_position ()),
    m_style ("style", mh, "{infinite}|local")
{
  m_color.set_id (ID_COLOR);
  m_position.set_id (ID_POSITION);
  m_style.set_id (ID_STYLE);
  init ();
}

void
light::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("color"))
    set_color (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("style"))
    set_style (val);
  else
    base_properties::set (pname, val);
}

octave_value
light::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("color", octave_value (get_color ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("style", octave_value (get_style ()));

  return m;
}

octave_value
light::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("color"))
    retval = get_color ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("style"))
    retval = get_style ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
light::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("color"))
    return property (&m_color, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("style"))
    return property (&m_style, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
light::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["color"] = color_values (1, 1, 1);
  m["position"] = default_light_position ();
  m["style"] = "infinite";

  return m;
}

std::string light::properties::s_go_name ("light");

std::set<std::string>
light::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("color");
      all_pnames.insert ("position");
      all_pnames.insert ("style");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
light::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
light::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
light::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
light::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
light::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** patch ********

patch::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_alphadatamapping ("alphadatamapping", mh, "none|{scaled}|direct"),
    m_ambientstrength ("ambientstrength", mh, 0.3),
    m_backfacelighting ("backfacelighting", mh, "unlit|lit|{reverselit}"),
    m_cdata ("cdata", mh, Matrix ()),
    m_cdatamapping ("cdatamapping", mh, "{scaled}|direct"),
    m_diffusestrength ("diffusestrength", mh, 0.6),
    m_displayname ("displayname", mh, ""),
    m_edgealpha ("edgealpha", mh, double_radio_property (1.0, radio_values ("flat|interp"))),
    m_edgecolor ("edgecolor", mh, color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))),
    m_edgelighting ("edgelighting", mh, "{none}|flat|gouraud|phong"),
    m_facealpha ("facealpha", mh, double_radio_property (1.0, radio_values ("flat|interp"))),
    m_facecolor ("facecolor", mh, color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))),
    m_facelighting ("facelighting", mh, "none|{flat}|gouraud|phong"),
    m_facenormals ("facenormals", mh, Matrix ()),
    m_facenormalsmode ("facenormalsmode", mh, "{auto}|manual"),
    m_faces ("faces", mh, default_patch_faces ()),
    m_facevertexalphadata ("facevertexalphadata", mh, Matrix ()),
    m_facevertexcdata ("facevertexcdata", mh, Matrix ()),
    m_linestyle ("linestyle", mh, "{-}|--|:|-.|none"),
    m_linewidth ("linewidth", mh, 0.5),
    m_marker ("marker", mh, "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram"),
    m_markeredgecolor ("markeredgecolor", mh, color_property (radio_values ("none|{auto}|flat"), color_values (0, 0, 0))),
    m_markerfacecolor ("markerfacecolor", mh, color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0))),
    m_markersize ("markersize", mh, 6),
    m_specularcolorreflectance ("specularcolorreflectance", mh, 1.0),
    m_specularexponent ("specularexponent", mh, 10.0),
    m_specularstrength ("specularstrength", mh, 0.9),
    m_vertexnormals ("vertexnormals", mh, Matrix ()),
    m_vertexnormalsmode ("vertexnormalsmode", mh, "{auto}|manual"),
    m_vertices ("vertices", mh, default_patch_vertices ()),
    m_xdata ("xdata", mh, default_patch_xdata ()),
    m_ydata ("ydata", mh, default_patch_ydata ()),
    m_zdata ("zdata", mh, Matrix ()),
    m_alim ("alim", mh, Matrix ()),
    m_clim ("clim", mh, Matrix ()),
    m_xlim ("xlim", mh, Matrix ()),
    m_ylim ("ylim", mh, Matrix ()),
    m_zlim ("zlim", mh, Matrix ()),
    m_aliminclude ("aliminclude", mh, "on"),
    m_climinclude ("climinclude", mh, "on"),
    m_xliminclude ("xliminclude", mh, "on"),
    m_yliminclude ("yliminclude", mh, "on"),
    m_zliminclude ("zliminclude", mh, "on")
{
  m_alphadatamapping.set_id (ID_ALPHADATAMAPPING);
  m_ambientstrength.set_id (ID_AMBIENTSTRENGTH);
  m_backfacelighting.set_id (ID_BACKFACELIGHTING);
  m_cdata.set_id (ID_CDATA);
  m_cdatamapping.set_id (ID_CDATAMAPPING);
  m_diffusestrength.set_id (ID_DIFFUSESTRENGTH);
  m_displayname.set_id (ID_DISPLAYNAME);
  m_edgealpha.set_id (ID_EDGEALPHA);
  m_edgecolor.set_id (ID_EDGECOLOR);
  m_edgelighting.set_id (ID_EDGELIGHTING);
  m_facealpha.set_id (ID_FACEALPHA);
  m_facecolor.set_id (ID_FACECOLOR);
  m_facelighting.set_id (ID_FACELIGHTING);
  m_facenormals.set_id (ID_FACENORMALS);
  m_facenormalsmode.set_id (ID_FACENORMALSMODE);
  m_faces.set_id (ID_FACES);
  m_facevertexalphadata.set_id (ID_FACEVERTEXALPHADATA);
  m_facevertexcdata.set_id (ID_FACEVERTEXCDATA);
  m_linestyle.set_id (ID_LINESTYLE);
  m_linewidth.set_id (ID_LINEWIDTH);
  m_marker.set_id (ID_MARKER);
  m_markeredgecolor.set_id (ID_MARKEREDGECOLOR);
  m_markerfacecolor.set_id (ID_MARKERFACECOLOR);
  m_markersize.set_id (ID_MARKERSIZE);
  m_specularcolorreflectance.set_id (ID_SPECULARCOLORREFLECTANCE);
  m_specularexponent.set_id (ID_SPECULAREXPONENT);
  m_specularstrength.set_id (ID_SPECULARSTRENGTH);
  m_vertexnormals.set_id (ID_VERTEXNORMALS);
  m_vertexnormalsmode.set_id (ID_VERTEXNORMALSMODE);
  m_vertices.set_id (ID_VERTICES);
  m_xdata.set_id (ID_XDATA);
  m_ydata.set_id (ID_YDATA);
  m_zdata.set_id (ID_ZDATA);
  m_alim.set_id (ID_ALIM);
  m_alim.set_hidden (true);
  m_clim.set_id (ID_CLIM);
  m_clim.set_hidden (true);
  m_xlim.set_id (ID_XLIM);
  m_xlim.set_hidden (true);
  m_ylim.set_id (ID_YLIM);
  m_ylim.set_hidden (true);
  m_zlim.set_id (ID_ZLIM);
  m_zlim.set_hidden (true);
  m_aliminclude.set_id (ID_ALIMINCLUDE);
  m_aliminclude.set_hidden (true);
  m_climinclude.set_id (ID_CLIMINCLUDE);
  m_climinclude.set_hidden (true);
  m_xliminclude.set_id (ID_XLIMINCLUDE);
  m_xliminclude.set_hidden (true);
  m_yliminclude.set_id (ID_YLIMINCLUDE);
  m_yliminclude.set_hidden (true);
  m_zliminclude.set_id (ID_ZLIMINCLUDE);
  m_zliminclude.set_hidden (true);
  init ();
}

void
patch::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("alphadatamapping"))
    set_alphadatamapping (val);
  else if (pname.compare ("ambientstrength"))
    set_ambientstrength (val);
  else if (pname.compare ("backfacelighting"))
    set_backfacelighting (val);
  else if (pname.compare ("cdata"))
    set_cdata (val);
  else if (pname.compare ("cdatamapping"))
    set_cdatamapping (val);
  else if (pname.compare ("diffusestrength"))
    set_diffusestrength (val);
  else if (pname.compare ("displayname"))
    set_displayname (val);
  else if (pname.compare ("edgealpha"))
    set_edgealpha (val);
  else if (pname.compare ("edgecolor"))
    set_edgecolor (val);
  else if (pname.compare ("edgelighting"))
    set_edgelighting (val);
  else if (pname.compare ("facealpha"))
    set_facealpha (val);
  else if (pname.compare ("facecolor"))
    set_facecolor (val);
  else if (pname.compare ("facelighting"))
    set_facelighting (val);
  else if (pname.compare ("facenormals"))
    set_facenormals (val);
  else if (pname.compare ("facenormalsmode"))
    set_facenormalsmode (val);
  else if (pname.compare ("faces"))
    set_faces (val);
  else if (pname.compare ("facevertexalphadata"))
    set_facevertexalphadata (val);
  else if (pname.compare ("facevertexcdata"))
    set_facevertexcdata (val);
  else if (pname.compare ("linestyle"))
    set_linestyle (val);
  else if (pname.compare ("linewidth"))
    set_linewidth (val);
  else if (pname.compare ("marker"))
    set_marker (val);
  else if (pname.compare ("markeredgecolor"))
    set_markeredgecolor (val);
  else if (pname.compare ("markerfacecolor"))
    set_markerfacecolor (val);
  else if (pname.compare ("markersize"))
    set_markersize (val);
  else if (pname.compare ("specularcolorreflectance"))
    set_specularcolorreflectance (val);
  else if (pname.compare ("specularexponent"))
    set_specularexponent (val);
  else if (pname.compare ("specularstrength"))
    set_specularstrength (val);
  else if (pname.compare ("vertexnormals"))
    set_vertexnormals (val);
  else if (pname.compare ("vertexnormalsmode"))
    set_vertexnormalsmode (val);
  else if (pname.compare ("vertices"))
    set_vertices (val);
  else if (pname.compare ("xdata"))
    set_xdata (val);
  else if (pname.compare ("ydata"))
    set_ydata (val);
  else if (pname.compare ("zdata"))
    set_zdata (val);
  else if (pname.compare ("aliminclude"))
    set_aliminclude (val);
  else if (pname.compare ("climinclude"))
    set_climinclude (val);
  else if (pname.compare ("xliminclude"))
    set_xliminclude (val);
  else if (pname.compare ("yliminclude"))
    set_yliminclude (val);
  else if (pname.compare ("zliminclude"))
    set_zliminclude (val);
  else
    base_properties::set (pname, val);
}

octave_value
patch::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("alphadatamapping", octave_value (get_alphadatamapping ()));
  m.assign ("ambientstrength", octave_value (get_ambientstrength ()));
  m.assign ("backfacelighting", octave_value (get_backfacelighting ()));
  m.assign ("cdata", octave_value (get_cdata ()));
  m.assign ("cdatamapping", octave_value (get_cdatamapping ()));
  m.assign ("diffusestrength", octave_value (get_diffusestrength ()));
  m.assign ("displayname", octave_value (get_displayname ()));
  m.assign ("edgealpha", octave_value (get_edgealpha ()));
  m.assign ("edgecolor", octave_value (get_edgecolor ()));
  m.assign ("edgelighting", octave_value (get_edgelighting ()));
  m.assign ("facealpha", octave_value (get_facealpha ()));
  m.assign ("facecolor", octave_value (get_facecolor ()));
  m.assign ("facelighting", octave_value (get_facelighting ()));
  m.assign ("facenormals", octave_value (get_facenormals ()));
  m.assign ("facenormalsmode", octave_value (get_facenormalsmode ()));
  m.assign ("faces", octave_value (get_faces ()));
  m.assign ("facevertexalphadata", octave_value (get_facevertexalphadata ()));
  m.assign ("facevertexcdata", octave_value (get_facevertexcdata ()));
  m.assign ("linestyle", octave_value (get_linestyle ()));
  m.assign ("linewidth", octave_value (get_linewidth ()));
  m.assign ("marker", octave_value (get_marker ()));
  m.assign ("markeredgecolor", octave_value (get_markeredgecolor ()));
  m.assign ("markerfacecolor", octave_value (get_markerfacecolor ()));
  m.assign ("markersize", octave_value (get_markersize ()));
  m.assign ("specularcolorreflectance", octave_value (get_specularcolorreflectance ()));
  m.assign ("specularexponent", octave_value (get_specularexponent ()));
  m.assign ("specularstrength", octave_value (get_specularstrength ()));
  m.assign ("vertexnormals", octave_value (get_vertexnormals ()));
  m.assign ("vertexnormalsmode", octave_value (get_vertexnormalsmode ()));
  m.assign ("vertices", octave_value (get_vertices ()));
  m.assign ("xdata", octave_value (get_xdata ()));
  m.assign ("ydata", octave_value (get_ydata ()));
  m.assign ("zdata", octave_value (get_zdata ()));
  if (all)
    m.assign ("alim", octave_value (get_alim ()));
  if (all)
    m.assign ("clim", octave_value (get_clim ()));
  if (all)
    m.assign ("xlim", octave_value (get_xlim ()));
  if (all)
    m.assign ("ylim", octave_value (get_ylim ()));
  if (all)
    m.assign ("zlim", octave_value (get_zlim ()));
  if (all)
    m.assign ("aliminclude", octave_value (get_aliminclude ()));
  if (all)
    m.assign ("climinclude", octave_value (get_climinclude ()));
  if (all)
    m.assign ("xliminclude", octave_value (get_xliminclude ()));
  if (all)
    m.assign ("yliminclude", octave_value (get_yliminclude ()));
  if (all)
    m.assign ("zliminclude", octave_value (get_zliminclude ()));

  return m;
}

octave_value
patch::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("alphadatamapping"))
    retval = get_alphadatamapping ();
  else if (pname.compare ("ambientstrength"))
    retval = get_ambientstrength ();
  else if (pname.compare ("backfacelighting"))
    retval = get_backfacelighting ();
  else if (pname.compare ("cdata"))
    retval = get_cdata ();
  else if (pname.compare ("cdatamapping"))
    retval = get_cdatamapping ();
  else if (pname.compare ("diffusestrength"))
    retval = get_diffusestrength ();
  else if (pname.compare ("displayname"))
    retval = get_displayname ();
  else if (pname.compare ("edgealpha"))
    retval = get_edgealpha ();
  else if (pname.compare ("edgecolor"))
    retval = get_edgecolor ();
  else if (pname.compare ("edgelighting"))
    retval = get_edgelighting ();
  else if (pname.compare ("facealpha"))
    retval = get_facealpha ();
  else if (pname.compare ("facecolor"))
    retval = get_facecolor ();
  else if (pname.compare ("facelighting"))
    retval = get_facelighting ();
  else if (pname.compare ("facenormals"))
    retval = get_facenormals ();
  else if (pname.compare ("facenormalsmode"))
    retval = get_facenormalsmode ();
  else if (pname.compare ("faces"))
    retval = get_faces ();
  else if (pname.compare ("facevertexalphadata"))
    retval = get_facevertexalphadata ();
  else if (pname.compare ("facevertexcdata"))
    retval = get_facevertexcdata ();
  else if (pname.compare ("linestyle"))
    retval = get_linestyle ();
  else if (pname.compare ("linewidth"))
    retval = get_linewidth ();
  else if (pname.compare ("marker"))
    retval = get_marker ();
  else if (pname.compare ("markeredgecolor"))
    retval = get_markeredgecolor ();
  else if (pname.compare ("markerfacecolor"))
    retval = get_markerfacecolor ();
  else if (pname.compare ("markersize"))
    retval = get_markersize ();
  else if (pname.compare ("specularcolorreflectance"))
    retval = get_specularcolorreflectance ();
  else if (pname.compare ("specularexponent"))
    retval = get_specularexponent ();
  else if (pname.compare ("specularstrength"))
    retval = get_specularstrength ();
  else if (pname.compare ("vertexnormals"))
    retval = get_vertexnormals ();
  else if (pname.compare ("vertexnormalsmode"))
    retval = get_vertexnormalsmode ();
  else if (pname.compare ("vertices"))
    retval = get_vertices ();
  else if (pname.compare ("xdata"))
    retval = get_xdata ();
  else if (pname.compare ("ydata"))
    retval = get_ydata ();
  else if (pname.compare ("zdata"))
    retval = get_zdata ();
  else if (pname.compare ("alim"))
    retval = get_alim ();
  else if (pname.compare ("clim"))
    retval = get_clim ();
  else if (pname.compare ("xlim"))
    retval = get_xlim ();
  else if (pname.compare ("ylim"))
    retval = get_ylim ();
  else if (pname.compare ("zlim"))
    retval = get_zlim ();
  else if (pname.compare ("aliminclude"))
    retval = get_aliminclude ();
  else if (pname.compare ("climinclude"))
    retval = get_climinclude ();
  else if (pname.compare ("xliminclude"))
    retval = get_xliminclude ();
  else if (pname.compare ("yliminclude"))
    retval = get_yliminclude ();
  else if (pname.compare ("zliminclude"))
    retval = get_zliminclude ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
patch::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("alphadatamapping"))
    return property (&m_alphadatamapping, true);
  else if (pname.compare ("ambientstrength"))
    return property (&m_ambientstrength, true);
  else if (pname.compare ("backfacelighting"))
    return property (&m_backfacelighting, true);
  else if (pname.compare ("cdata"))
    return property (&m_cdata, true);
  else if (pname.compare ("cdatamapping"))
    return property (&m_cdatamapping, true);
  else if (pname.compare ("diffusestrength"))
    return property (&m_diffusestrength, true);
  else if (pname.compare ("displayname"))
    return property (&m_displayname, true);
  else if (pname.compare ("edgealpha"))
    return property (&m_edgealpha, true);
  else if (pname.compare ("edgecolor"))
    return property (&m_edgecolor, true);
  else if (pname.compare ("edgelighting"))
    return property (&m_edgelighting, true);
  else if (pname.compare ("facealpha"))
    return property (&m_facealpha, true);
  else if (pname.compare ("facecolor"))
    return property (&m_facecolor, true);
  else if (pname.compare ("facelighting"))
    return property (&m_facelighting, true);
  else if (pname.compare ("facenormals"))
    return property (&m_facenormals, true);
  else if (pname.compare ("facenormalsmode"))
    return property (&m_facenormalsmode, true);
  else if (pname.compare ("faces"))
    return property (&m_faces, true);
  else if (pname.compare ("facevertexalphadata"))
    return property (&m_facevertexalphadata, true);
  else if (pname.compare ("facevertexcdata"))
    return property (&m_facevertexcdata, true);
  else if (pname.compare ("linestyle"))
    return property (&m_linestyle, true);
  else if (pname.compare ("linewidth"))
    return property (&m_linewidth, true);
  else if (pname.compare ("marker"))
    return property (&m_marker, true);
  else if (pname.compare ("markeredgecolor"))
    return property (&m_markeredgecolor, true);
  else if (pname.compare ("markerfacecolor"))
    return property (&m_markerfacecolor, true);
  else if (pname.compare ("markersize"))
    return property (&m_markersize, true);
  else if (pname.compare ("specularcolorreflectance"))
    return property (&m_specularcolorreflectance, true);
  else if (pname.compare ("specularexponent"))
    return property (&m_specularexponent, true);
  else if (pname.compare ("specularstrength"))
    return property (&m_specularstrength, true);
  else if (pname.compare ("vertexnormals"))
    return property (&m_vertexnormals, true);
  else if (pname.compare ("vertexnormalsmode"))
    return property (&m_vertexnormalsmode, true);
  else if (pname.compare ("vertices"))
    return property (&m_vertices, true);
  else if (pname.compare ("xdata"))
    return property (&m_xdata, true);
  else if (pname.compare ("ydata"))
    return property (&m_ydata, true);
  else if (pname.compare ("zdata"))
    return property (&m_zdata, true);
  else if (pname.compare ("alim"))
    return property (&m_alim, true);
  else if (pname.compare ("clim"))
    return property (&m_clim, true);
  else if (pname.compare ("xlim"))
    return property (&m_xlim, true);
  else if (pname.compare ("ylim"))
    return property (&m_ylim, true);
  else if (pname.compare ("zlim"))
    return property (&m_zlim, true);
  else if (pname.compare ("aliminclude"))
    return property (&m_aliminclude, true);
  else if (pname.compare ("climinclude"))
    return property (&m_climinclude, true);
  else if (pname.compare ("xliminclude"))
    return property (&m_xliminclude, true);
  else if (pname.compare ("yliminclude"))
    return property (&m_yliminclude, true);
  else if (pname.compare ("zliminclude"))
    return property (&m_zliminclude, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
patch::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["alphadatamapping"] = "scaled";
  m["ambientstrength"] = 0.3;
  m["backfacelighting"] = "reverselit";
  m["cdata"] = Matrix ();
  m["cdatamapping"] = "scaled";
  m["diffusestrength"] = 0.6;
  m["displayname"] = "";
  m["edgealpha"] = double_radio_property (1.0, radio_values ("flat|interp"));
  m["edgecolor"] = color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"));
  m["edgelighting"] = "none";
  m["facealpha"] = double_radio_property (1.0, radio_values ("flat|interp"));
  m["facecolor"] = color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"));
  m["facelighting"] = "flat";
  m["facenormals"] = Matrix ();
  m["facenormalsmode"] = "auto";
  m["faces"] = default_patch_faces ();
  m["facevertexalphadata"] = Matrix ();
  m["facevertexcdata"] = Matrix ();
  m["linestyle"] = "-";
  m["linewidth"] = 0.5;
  m["marker"] = "none";
  m["markeredgecolor"] = color_property (radio_values ("none|{auto}|flat"), color_values (0, 0, 0));
  m["markerfacecolor"] = color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0));
  m["markersize"] = 6;
  m["specularcolorreflectance"] = 1.0;
  m["specularexponent"] = 10.0;
  m["specularstrength"] = 0.9;
  m["vertexnormals"] = Matrix ();
  m["vertexnormalsmode"] = "auto";
  m["vertices"] = default_patch_vertices ();
  m["xdata"] = default_patch_xdata ();
  m["ydata"] = default_patch_ydata ();
  m["zdata"] = Matrix ();
  m["alim"] = Matrix ();
  m["clim"] = Matrix ();
  m["xlim"] = Matrix ();
  m["ylim"] = Matrix ();
  m["zlim"] = Matrix ();
  m["aliminclude"] = "on";
  m["climinclude"] = "on";
  m["xliminclude"] = "on";
  m["yliminclude"] = "on";
  m["zliminclude"] = "on";

  return m;
}

std::string patch::properties::s_go_name ("patch");

std::set<std::string>
patch::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alphadatamapping");
      all_pnames.insert ("ambientstrength");
      all_pnames.insert ("backfacelighting");
      all_pnames.insert ("cdata");
      all_pnames.insert ("cdatamapping");
      all_pnames.insert ("diffusestrength");
      all_pnames.insert ("displayname");
      all_pnames.insert ("edgealpha");
      all_pnames.insert ("edgecolor");
      all_pnames.insert ("edgelighting");
      all_pnames.insert ("facealpha");
      all_pnames.insert ("facecolor");
      all_pnames.insert ("facelighting");
      all_pnames.insert ("facenormals");
      all_pnames.insert ("facenormalsmode");
      all_pnames.insert ("faces");
      all_pnames.insert ("facevertexalphadata");
      all_pnames.insert ("facevertexcdata");
      all_pnames.insert ("linestyle");
      all_pnames.insert ("linewidth");
      all_pnames.insert ("marker");
      all_pnames.insert ("markeredgecolor");
      all_pnames.insert ("markerfacecolor");
      all_pnames.insert ("markersize");
      all_pnames.insert ("specularcolorreflectance");
      all_pnames.insert ("specularexponent");
      all_pnames.insert ("specularstrength");
      all_pnames.insert ("vertexnormals");
      all_pnames.insert ("vertexnormalsmode");
      all_pnames.insert ("vertices");
      all_pnames.insert ("xdata");
      all_pnames.insert ("ydata");
      all_pnames.insert ("zdata");
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");
      all_pnames.insert ("aliminclude");
      all_pnames.insert ("climinclude");
      all_pnames.insert ("xliminclude");
      all_pnames.insert ("yliminclude");
      all_pnames.insert ("zliminclude");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
patch::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
patch::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
patch::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
patch::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
patch::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** scatter ********

scatter::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_annotation ("annotation", mh, Matrix ()),
    m_cdata ("cdata", mh, Matrix ()),
    m_cdatamode ("cdatamode", mh, "{auto}|manual"),
    m_cdatasource ("cdatasource", mh, ""),
    m_datatiptemplate ("datatiptemplate", mh, Matrix ()),
    m_displayname ("displayname", mh, ""),
    m_latitudedata ("latitudedata", mh, Matrix ()),
    m_latitudedatasource ("latitudedatasource", mh, ""),
    m_linewidth ("linewidth", mh, 0.5),
    m_longitudedata ("longitudedata", mh, Matrix ()),
    m_longitudedatasource ("longitudedatasource", mh, ""),
    m_marker ("marker", mh, "{o}|+|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram|none"),
    m_markeredgealpha ("markeredgealpha", mh, 1.0),
    m_markeredgecolor ("markeredgecolor", mh, color_property (radio_values ("{flat}|none"), color_values (0, 0, 0))),
    m_markerfacealpha ("markerfacealpha", mh, 1.0),
    m_markerfacecolor ("markerfacecolor", mh, color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0))),
    m_rdata ("rdata", mh, Matrix ()),
    m_rdatasource ("rdatasource", mh, ""),
    m_seriesindex ("seriesindex", mh, Matrix ()),
    m_sizedata ("sizedata", mh, Matrix ()),
    m_sizedatasource ("sizedatasource", mh, ""),
    m_thetadata ("thetadata", mh, Matrix ()),
    m_thetadatasource ("thetadatasource", mh, ""),
    m_xdata ("xdata", mh, Matrix ()),
    m_xdatasource ("xdatasource", mh, ""),
    m_ydata ("ydata", mh, Matrix ()),
    m_ydatasource ("ydatasource", mh, ""),
    m_zdata ("zdata", mh, Matrix ()),
    m_zdatasource ("zdatasource", mh, ""),
    m_alim ("alim", mh, Matrix ()),
    m_clim ("clim", mh, Matrix ()),
    m_xlim ("xlim", mh, Matrix ()),
    m_ylim ("ylim", mh, Matrix ()),
    m_zlim ("zlim", mh, Matrix ()),
    m_aliminclude ("aliminclude", mh, "on"),
    m_climinclude ("climinclude", mh, "on"),
    m_xliminclude ("xliminclude", mh, "on"),
    m_yliminclude ("yliminclude", mh, "on"),
    m_zliminclude ("zliminclude", mh, "on")
{
  m_annotation.set_id (ID_ANNOTATION);
  m_cdata.set_id (ID_CDATA);
  m_cdatamode.set_id (ID_CDATAMODE);
  m_cdatasource.set_id (ID_CDATASOURCE);
  m_datatiptemplate.set_id (ID_DATATIPTEMPLATE);
  m_displayname.set_id (ID_DISPLAYNAME);
  m_latitudedata.set_id (ID_LATITUDEDATA);
  m_latitudedatasource.set_id (ID_LATITUDEDATASOURCE);
  m_linewidth.set_id (ID_LINEWIDTH);
  m_longitudedata.set_id (ID_LONGITUDEDATA);
  m_longitudedatasource.set_id (ID_LONGITUDEDATASOURCE);
  m_marker.set_id (ID_MARKER);
  m_markeredgealpha.set_id (ID_MARKEREDGEALPHA);
  m_markeredgecolor.set_id (ID_MARKEREDGECOLOR);
  m_markerfacealpha.set_id (ID_MARKERFACEALPHA);
  m_markerfacecolor.set_id (ID_MARKERFACECOLOR);
  m_rdata.set_id (ID_RDATA);
  m_rdatasource.set_id (ID_RDATASOURCE);
  m_seriesindex.set_id (ID_SERIESINDEX);
  m_sizedata.set_id (ID_SIZEDATA);
  m_sizedatasource.set_id (ID_SIZEDATASOURCE);
  m_thetadata.set_id (ID_THETADATA);
  m_thetadatasource.set_id (ID_THETADATASOURCE);
  m_xdata.set_id (ID_XDATA);
  m_xdatasource.set_id (ID_XDATASOURCE);
  m_ydata.set_id (ID_YDATA);
  m_ydatasource.set_id (ID_YDATASOURCE);
  m_zdata.set_id (ID_ZDATA);
  m_zdatasource.set_id (ID_ZDATASOURCE);
  m_alim.set_id (ID_ALIM);
  m_alim.set_hidden (true);
  m_clim.set_id (ID_CLIM);
  m_clim.set_hidden (true);
  m_xlim.set_id (ID_XLIM);
  m_xlim.set_hidden (true);
  m_ylim.set_id (ID_YLIM);
  m_ylim.set_hidden (true);
  m_zlim.set_id (ID_ZLIM);
  m_zlim.set_hidden (true);
  m_aliminclude.set_id (ID_ALIMINCLUDE);
  m_aliminclude.set_hidden (true);
  m_climinclude.set_id (ID_CLIMINCLUDE);
  m_climinclude.set_hidden (true);
  m_xliminclude.set_id (ID_XLIMINCLUDE);
  m_xliminclude.set_hidden (true);
  m_yliminclude.set_id (ID_YLIMINCLUDE);
  m_yliminclude.set_hidden (true);
  m_zliminclude.set_id (ID_ZLIMINCLUDE);
  m_zliminclude.set_hidden (true);
  init ();
}

void
scatter::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("annotation"))
    set_annotation (val);
  else if (pname.compare ("cdata"))
    set_cdata (val);
  else if (pname.compare ("cdatamode"))
    set_cdatamode (val);
  else if (pname.compare ("cdatasource"))
    set_cdatasource (val);
  else if (pname.compare ("datatiptemplate"))
    set_datatiptemplate (val);
  else if (pname.compare ("displayname"))
    set_displayname (val);
  else if (pname.compare ("latitudedata"))
    set_latitudedata (val);
  else if (pname.compare ("latitudedatasource"))
    set_latitudedatasource (val);
  else if (pname.compare ("linewidth"))
    set_linewidth (val);
  else if (pname.compare ("longitudedata"))
    set_longitudedata (val);
  else if (pname.compare ("longitudedatasource"))
    set_longitudedatasource (val);
  else if (pname.compare ("marker"))
    set_marker (val);
  else if (pname.compare ("markeredgealpha"))
    set_markeredgealpha (val);
  else if (pname.compare ("markeredgecolor"))
    set_markeredgecolor (val);
  else if (pname.compare ("markerfacealpha"))
    set_markerfacealpha (val);
  else if (pname.compare ("markerfacecolor"))
    set_markerfacecolor (val);
  else if (pname.compare ("rdata"))
    set_rdata (val);
  else if (pname.compare ("rdatasource"))
    set_rdatasource (val);
  else if (pname.compare ("seriesindex"))
    set_seriesindex (val);
  else if (pname.compare ("sizedata"))
    set_sizedata (val);
  else if (pname.compare ("sizedatasource"))
    set_sizedatasource (val);
  else if (pname.compare ("thetadata"))
    set_thetadata (val);
  else if (pname.compare ("thetadatasource"))
    set_thetadatasource (val);
  else if (pname.compare ("xdata"))
    set_xdata (val);
  else if (pname.compare ("xdatasource"))
    set_xdatasource (val);
  else if (pname.compare ("ydata"))
    set_ydata (val);
  else if (pname.compare ("ydatasource"))
    set_ydatasource (val);
  else if (pname.compare ("zdata"))
    set_zdata (val);
  else if (pname.compare ("zdatasource"))
    set_zdatasource (val);
  else if (pname.compare ("aliminclude"))
    set_aliminclude (val);
  else if (pname.compare ("climinclude"))
    set_climinclude (val);
  else if (pname.compare ("xliminclude"))
    set_xliminclude (val);
  else if (pname.compare ("yliminclude"))
    set_yliminclude (val);
  else if (pname.compare ("zliminclude"))
    set_zliminclude (val);
  else
    base_properties::set (pname, val);
}

octave_value
scatter::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("annotation", octave_value (get_annotation ()));
  m.assign ("cdata", octave_value (get_cdata ()));
  m.assign ("cdatamode", octave_value (get_cdatamode ()));
  m.assign ("cdatasource", octave_value (get_cdatasource ()));
  m.assign ("datatiptemplate", octave_value (get_datatiptemplate ()));
  m.assign ("displayname", octave_value (get_displayname ()));
  m.assign ("latitudedata", octave_value (get_latitudedata ()));
  m.assign ("latitudedatasource", octave_value (get_latitudedatasource ()));
  m.assign ("linewidth", octave_value (get_linewidth ()));
  m.assign ("longitudedata", octave_value (get_longitudedata ()));
  m.assign ("longitudedatasource", octave_value (get_longitudedatasource ()));
  m.assign ("marker", octave_value (get_marker ()));
  m.assign ("markeredgealpha", octave_value (get_markeredgealpha ()));
  m.assign ("markeredgecolor", octave_value (get_markeredgecolor ()));
  m.assign ("markerfacealpha", octave_value (get_markerfacealpha ()));
  m.assign ("markerfacecolor", octave_value (get_markerfacecolor ()));
  m.assign ("rdata", octave_value (get_rdata ()));
  m.assign ("rdatasource", octave_value (get_rdatasource ()));
  m.assign ("seriesindex", octave_value (get_seriesindex ()));
  m.assign ("sizedata", octave_value (get_sizedata ()));
  m.assign ("sizedatasource", octave_value (get_sizedatasource ()));
  m.assign ("thetadata", octave_value (get_thetadata ()));
  m.assign ("thetadatasource", octave_value (get_thetadatasource ()));
  m.assign ("xdata", octave_value (get_xdata ()));
  m.assign ("xdatasource", octave_value (get_xdatasource ()));
  m.assign ("ydata", octave_value (get_ydata ()));
  m.assign ("ydatasource", octave_value (get_ydatasource ()));
  m.assign ("zdata", octave_value (get_zdata ()));
  m.assign ("zdatasource", octave_value (get_zdatasource ()));
  if (all)
    m.assign ("alim", octave_value (get_alim ()));
  if (all)
    m.assign ("clim", octave_value (get_clim ()));
  if (all)
    m.assign ("xlim", octave_value (get_xlim ()));
  if (all)
    m.assign ("ylim", octave_value (get_ylim ()));
  if (all)
    m.assign ("zlim", octave_value (get_zlim ()));
  if (all)
    m.assign ("aliminclude", octave_value (get_aliminclude ()));
  if (all)
    m.assign ("climinclude", octave_value (get_climinclude ()));
  if (all)
    m.assign ("xliminclude", octave_value (get_xliminclude ()));
  if (all)
    m.assign ("yliminclude", octave_value (get_yliminclude ()));
  if (all)
    m.assign ("zliminclude", octave_value (get_zliminclude ()));

  return m;
}

octave_value
scatter::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("annotation"))
    retval = get_annotation ();
  else if (pname.compare ("cdata"))
    retval = get_cdata ();
  else if (pname.compare ("cdatamode"))
    retval = get_cdatamode ();
  else if (pname.compare ("cdatasource"))
    retval = get_cdatasource ();
  else if (pname.compare ("datatiptemplate"))
    retval = get_datatiptemplate ();
  else if (pname.compare ("displayname"))
    retval = get_displayname ();
  else if (pname.compare ("latitudedata"))
    retval = get_latitudedata ();
  else if (pname.compare ("latitudedatasource"))
    retval = get_latitudedatasource ();
  else if (pname.compare ("linewidth"))
    retval = get_linewidth ();
  else if (pname.compare ("longitudedata"))
    retval = get_longitudedata ();
  else if (pname.compare ("longitudedatasource"))
    retval = get_longitudedatasource ();
  else if (pname.compare ("marker"))
    retval = get_marker ();
  else if (pname.compare ("markeredgealpha"))
    retval = get_markeredgealpha ();
  else if (pname.compare ("markeredgecolor"))
    retval = get_markeredgecolor ();
  else if (pname.compare ("markerfacealpha"))
    retval = get_markerfacealpha ();
  else if (pname.compare ("markerfacecolor"))
    retval = get_markerfacecolor ();
  else if (pname.compare ("rdata"))
    retval = get_rdata ();
  else if (pname.compare ("rdatasource"))
    retval = get_rdatasource ();
  else if (pname.compare ("seriesindex"))
    retval = get_seriesindex ();
  else if (pname.compare ("sizedata"))
    retval = get_sizedata ();
  else if (pname.compare ("sizedatasource"))
    retval = get_sizedatasource ();
  else if (pname.compare ("thetadata"))
    retval = get_thetadata ();
  else if (pname.compare ("thetadatasource"))
    retval = get_thetadatasource ();
  else if (pname.compare ("xdata"))
    retval = get_xdata ();
  else if (pname.compare ("xdatasource"))
    retval = get_xdatasource ();
  else if (pname.compare ("ydata"))
    retval = get_ydata ();
  else if (pname.compare ("ydatasource"))
    retval = get_ydatasource ();
  else if (pname.compare ("zdata"))
    retval = get_zdata ();
  else if (pname.compare ("zdatasource"))
    retval = get_zdatasource ();
  else if (pname.compare ("alim"))
    retval = get_alim ();
  else if (pname.compare ("clim"))
    retval = get_clim ();
  else if (pname.compare ("xlim"))
    retval = get_xlim ();
  else if (pname.compare ("ylim"))
    retval = get_ylim ();
  else if (pname.compare ("zlim"))
    retval = get_zlim ();
  else if (pname.compare ("aliminclude"))
    retval = get_aliminclude ();
  else if (pname.compare ("climinclude"))
    retval = get_climinclude ();
  else if (pname.compare ("xliminclude"))
    retval = get_xliminclude ();
  else if (pname.compare ("yliminclude"))
    retval = get_yliminclude ();
  else if (pname.compare ("zliminclude"))
    retval = get_zliminclude ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
scatter::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("annotation"))
    return property (&m_annotation, true);
  else if (pname.compare ("cdata"))
    return property (&m_cdata, true);
  else if (pname.compare ("cdatamode"))
    return property (&m_cdatamode, true);
  else if (pname.compare ("cdatasource"))
    return property (&m_cdatasource, true);
  else if (pname.compare ("datatiptemplate"))
    return property (&m_datatiptemplate, true);
  else if (pname.compare ("displayname"))
    return property (&m_displayname, true);
  else if (pname.compare ("latitudedata"))
    return property (&m_latitudedata, true);
  else if (pname.compare ("latitudedatasource"))
    return property (&m_latitudedatasource, true);
  else if (pname.compare ("linewidth"))
    return property (&m_linewidth, true);
  else if (pname.compare ("longitudedata"))
    return property (&m_longitudedata, true);
  else if (pname.compare ("longitudedatasource"))
    return property (&m_longitudedatasource, true);
  else if (pname.compare ("marker"))
    return property (&m_marker, true);
  else if (pname.compare ("markeredgealpha"))
    return property (&m_markeredgealpha, true);
  else if (pname.compare ("markeredgecolor"))
    return property (&m_markeredgecolor, true);
  else if (pname.compare ("markerfacealpha"))
    return property (&m_markerfacealpha, true);
  else if (pname.compare ("markerfacecolor"))
    return property (&m_markerfacecolor, true);
  else if (pname.compare ("rdata"))
    return property (&m_rdata, true);
  else if (pname.compare ("rdatasource"))
    return property (&m_rdatasource, true);
  else if (pname.compare ("seriesindex"))
    return property (&m_seriesindex, true);
  else if (pname.compare ("sizedata"))
    return property (&m_sizedata, true);
  else if (pname.compare ("sizedatasource"))
    return property (&m_sizedatasource, true);
  else if (pname.compare ("thetadata"))
    return property (&m_thetadata, true);
  else if (pname.compare ("thetadatasource"))
    return property (&m_thetadatasource, true);
  else if (pname.compare ("xdata"))
    return property (&m_xdata, true);
  else if (pname.compare ("xdatasource"))
    return property (&m_xdatasource, true);
  else if (pname.compare ("ydata"))
    return property (&m_ydata, true);
  else if (pname.compare ("ydatasource"))
    return property (&m_ydatasource, true);
  else if (pname.compare ("zdata"))
    return property (&m_zdata, true);
  else if (pname.compare ("zdatasource"))
    return property (&m_zdatasource, true);
  else if (pname.compare ("alim"))
    return property (&m_alim, true);
  else if (pname.compare ("clim"))
    return property (&m_clim, true);
  else if (pname.compare ("xlim"))
    return property (&m_xlim, true);
  else if (pname.compare ("ylim"))
    return property (&m_ylim, true);
  else if (pname.compare ("zlim"))
    return property (&m_zlim, true);
  else if (pname.compare ("aliminclude"))
    return property (&m_aliminclude, true);
  else if (pname.compare ("climinclude"))
    return property (&m_climinclude, true);
  else if (pname.compare ("xliminclude"))
    return property (&m_xliminclude, true);
  else if (pname.compare ("yliminclude"))
    return property (&m_yliminclude, true);
  else if (pname.compare ("zliminclude"))
    return property (&m_zliminclude, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
scatter::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["annotation"] = Matrix ();
  m["cdata"] = Matrix ();
  m["cdatamode"] = "auto";
  m["cdatasource"] = "";
  m["datatiptemplate"] = Matrix ();
  m["displayname"] = "";
  m["latitudedata"] = Matrix ();
  m["latitudedatasource"] = "";
  m["linewidth"] = 0.5;
  m["longitudedata"] = Matrix ();
  m["longitudedatasource"] = "";
  m["marker"] = "o";
  m["markeredgealpha"] = 1.0;
  m["markeredgecolor"] = color_property (radio_values ("{flat}|none"), color_values (0, 0, 0));
  m["markerfacealpha"] = 1.0;
  m["markerfacecolor"] = color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0));
  m["rdata"] = Matrix ();
  m["rdatasource"] = "";
  m["seriesindex"] = Matrix ();
  m["sizedata"] = Matrix ();
  m["sizedatasource"] = "";
  m["thetadata"] = Matrix ();
  m["thetadatasource"] = "";
  m["xdata"] = Matrix ();
  m["xdatasource"] = "";
  m["ydata"] = Matrix ();
  m["ydatasource"] = "";
  m["zdata"] = Matrix ();
  m["zdatasource"] = "";
  m["alim"] = Matrix ();
  m["clim"] = Matrix ();
  m["xlim"] = Matrix ();
  m["ylim"] = Matrix ();
  m["zlim"] = Matrix ();
  m["aliminclude"] = "on";
  m["climinclude"] = "on";
  m["xliminclude"] = "on";
  m["yliminclude"] = "on";
  m["zliminclude"] = "on";

  return m;
}

std::string scatter::properties::s_go_name ("scatter");

std::set<std::string>
scatter::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("annotation");
      all_pnames.insert ("cdata");
      all_pnames.insert ("cdatamode");
      all_pnames.insert ("cdatasource");
      all_pnames.insert ("datatiptemplate");
      all_pnames.insert ("displayname");
      all_pnames.insert ("latitudedata");
      all_pnames.insert ("latitudedatasource");
      all_pnames.insert ("linewidth");
      all_pnames.insert ("longitudedata");
      all_pnames.insert ("longitudedatasource");
      all_pnames.insert ("marker");
      all_pnames.insert ("markeredgealpha");
      all_pnames.insert ("markeredgecolor");
      all_pnames.insert ("markerfacealpha");
      all_pnames.insert ("markerfacecolor");
      all_pnames.insert ("rdata");
      all_pnames.insert ("rdatasource");
      all_pnames.insert ("seriesindex");
      all_pnames.insert ("sizedata");
      all_pnames.insert ("sizedatasource");
      all_pnames.insert ("thetadata");
      all_pnames.insert ("thetadatasource");
      all_pnames.insert ("xdata");
      all_pnames.insert ("xdatasource");
      all_pnames.insert ("ydata");
      all_pnames.insert ("ydatasource");
      all_pnames.insert ("zdata");
      all_pnames.insert ("zdatasource");
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");
      all_pnames.insert ("aliminclude");
      all_pnames.insert ("climinclude");
      all_pnames.insert ("xliminclude");
      all_pnames.insert ("yliminclude");
      all_pnames.insert ("zliminclude");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
scatter::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
scatter::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
scatter::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
scatter::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
scatter::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** surface ********

surface::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_alphadata ("alphadata", mh, Matrix (1, 1, 1.0)),
    m_alphadatamapping ("alphadatamapping", mh, "none|direct|{scaled}"),
    m_ambientstrength ("ambientstrength", mh, 0.3),
    m_backfacelighting ("backfacelighting", mh, "unlit|lit|{reverselit}"),
    m_cdata ("cdata", mh, default_surface_cdata ()),
    m_cdatamapping ("cdatamapping", mh, "{scaled}|direct"),
    m_cdatasource ("cdatasource", mh, ""),
    m_diffusestrength ("diffusestrength", mh, 0.6),
    m_displayname ("displayname", mh, ""),
    m_edgealpha ("edgealpha", mh, double_radio_property (1.0, radio_values ("flat|interp"))),
    m_edgecolor ("edgecolor", mh, color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))),
    m_edgelighting ("edgelighting", mh, "{none}|flat|gouraud|phong"),
    m_facealpha ("facealpha", mh, double_radio_property (1.0, radio_values ("flat|interp|texturemap"))),
    m_facecolor ("facecolor", mh, color_property (radio_values ("none|{flat}|interp|texturemap"), color_values (0, 0, 0))),
    m_facelighting ("facelighting", mh, "none|{flat}|gouraud|phong"),
    m_facenormals ("facenormals", mh, Matrix ()),
    m_facenormalsmode ("facenormalsmode", mh, "{auto}|manual"),
    m_linestyle ("linestyle", mh, "{-}|--|:|-.|none"),
    m_linewidth ("linewidth", mh, 0.5),
    m_marker ("marker", mh, "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram"),
    m_markeredgecolor ("markeredgecolor", mh, color_property (radio_values ("none|{auto}|flat"), color_values (0, 0, 0))),
    m_markerfacecolor ("markerfacecolor", mh, color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0))),
    m_markersize ("markersize", mh, 6),
    m_meshstyle ("meshstyle", mh, "{both}|row|column"),
    m_specularcolorreflectance ("specularcolorreflectance", mh, 1),
    m_specularexponent ("specularexponent", mh, 10),
    m_specularstrength ("specularstrength", mh, 0.9),
    m_vertexnormals ("vertexnormals", mh, Matrix ()),
    m_vertexnormalsmode ("vertexnormalsmode", mh, "{auto}|manual"),
    m_xdata ("xdata", mh, default_surface_xdata ()),
    m_xdatasource ("xdatasource", mh, ""),
    m_ydata ("ydata", mh, default_surface_ydata ()),
    m_ydatasource ("ydatasource", mh, ""),
    m_zdata ("zdata", mh, default_surface_zdata ()),
    m_zdatasource ("zdatasource", mh, ""),
    m_alim ("alim", mh, Matrix ()),
    m_clim ("clim", mh, Matrix ()),
    m_xlim ("xlim", mh, Matrix ()),
    m_ylim ("ylim", mh, Matrix ()),
    m_zlim ("zlim", mh, Matrix ()),
    m_aliminclude ("aliminclude", mh, "on"),
    m_climinclude ("climinclude", mh, "on"),
    m_xliminclude ("xliminclude", mh, "on"),
    m_yliminclude ("yliminclude", mh, "on"),
    m_zliminclude ("zliminclude", mh, "on")
{
  m_alphadata.set_id (ID_ALPHADATA);
  m_alphadatamapping.set_id (ID_ALPHADATAMAPPING);
  m_ambientstrength.set_id (ID_AMBIENTSTRENGTH);
  m_backfacelighting.set_id (ID_BACKFACELIGHTING);
  m_cdata.set_id (ID_CDATA);
  m_cdatamapping.set_id (ID_CDATAMAPPING);
  m_cdatasource.set_id (ID_CDATASOURCE);
  m_diffusestrength.set_id (ID_DIFFUSESTRENGTH);
  m_displayname.set_id (ID_DISPLAYNAME);
  m_edgealpha.set_id (ID_EDGEALPHA);
  m_edgecolor.set_id (ID_EDGECOLOR);
  m_edgelighting.set_id (ID_EDGELIGHTING);
  m_facealpha.set_id (ID_FACEALPHA);
  m_facecolor.set_id (ID_FACECOLOR);
  m_facelighting.set_id (ID_FACELIGHTING);
  m_facenormals.set_id (ID_FACENORMALS);
  m_facenormalsmode.set_id (ID_FACENORMALSMODE);
  m_linestyle.set_id (ID_LINESTYLE);
  m_linewidth.set_id (ID_LINEWIDTH);
  m_marker.set_id (ID_MARKER);
  m_markeredgecolor.set_id (ID_MARKEREDGECOLOR);
  m_markerfacecolor.set_id (ID_MARKERFACECOLOR);
  m_markersize.set_id (ID_MARKERSIZE);
  m_meshstyle.set_id (ID_MESHSTYLE);
  m_specularcolorreflectance.set_id (ID_SPECULARCOLORREFLECTANCE);
  m_specularexponent.set_id (ID_SPECULAREXPONENT);
  m_specularstrength.set_id (ID_SPECULARSTRENGTH);
  m_vertexnormals.set_id (ID_VERTEXNORMALS);
  m_vertexnormalsmode.set_id (ID_VERTEXNORMALSMODE);
  m_xdata.set_id (ID_XDATA);
  m_xdatasource.set_id (ID_XDATASOURCE);
  m_ydata.set_id (ID_YDATA);
  m_ydatasource.set_id (ID_YDATASOURCE);
  m_zdata.set_id (ID_ZDATA);
  m_zdatasource.set_id (ID_ZDATASOURCE);
  m_alim.set_id (ID_ALIM);
  m_alim.set_hidden (true);
  m_clim.set_id (ID_CLIM);
  m_clim.set_hidden (true);
  m_xlim.set_id (ID_XLIM);
  m_xlim.set_hidden (true);
  m_ylim.set_id (ID_YLIM);
  m_ylim.set_hidden (true);
  m_zlim.set_id (ID_ZLIM);
  m_zlim.set_hidden (true);
  m_aliminclude.set_id (ID_ALIMINCLUDE);
  m_aliminclude.set_hidden (true);
  m_climinclude.set_id (ID_CLIMINCLUDE);
  m_climinclude.set_hidden (true);
  m_xliminclude.set_id (ID_XLIMINCLUDE);
  m_xliminclude.set_hidden (true);
  m_yliminclude.set_id (ID_YLIMINCLUDE);
  m_yliminclude.set_hidden (true);
  m_zliminclude.set_id (ID_ZLIMINCLUDE);
  m_zliminclude.set_hidden (true);
  init ();
}

void
surface::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("alphadata"))
    set_alphadata (val);
  else if (pname.compare ("alphadatamapping"))
    set_alphadatamapping (val);
  else if (pname.compare ("ambientstrength"))
    set_ambientstrength (val);
  else if (pname.compare ("backfacelighting"))
    set_backfacelighting (val);
  else if (pname.compare ("cdata"))
    set_cdata (val);
  else if (pname.compare ("cdatamapping"))
    set_cdatamapping (val);
  else if (pname.compare ("cdatasource"))
    set_cdatasource (val);
  else if (pname.compare ("diffusestrength"))
    set_diffusestrength (val);
  else if (pname.compare ("displayname"))
    set_displayname (val);
  else if (pname.compare ("edgealpha"))
    set_edgealpha (val);
  else if (pname.compare ("edgecolor"))
    set_edgecolor (val);
  else if (pname.compare ("edgelighting"))
    set_edgelighting (val);
  else if (pname.compare ("facealpha"))
    set_facealpha (val);
  else if (pname.compare ("facecolor"))
    set_facecolor (val);
  else if (pname.compare ("facelighting"))
    set_facelighting (val);
  else if (pname.compare ("facenormals"))
    set_facenormals (val);
  else if (pname.compare ("facenormalsmode"))
    set_facenormalsmode (val);
  else if (pname.compare ("linestyle"))
    set_linestyle (val);
  else if (pname.compare ("linewidth"))
    set_linewidth (val);
  else if (pname.compare ("marker"))
    set_marker (val);
  else if (pname.compare ("markeredgecolor"))
    set_markeredgecolor (val);
  else if (pname.compare ("markerfacecolor"))
    set_markerfacecolor (val);
  else if (pname.compare ("markersize"))
    set_markersize (val);
  else if (pname.compare ("meshstyle"))
    set_meshstyle (val);
  else if (pname.compare ("specularcolorreflectance"))
    set_specularcolorreflectance (val);
  else if (pname.compare ("specularexponent"))
    set_specularexponent (val);
  else if (pname.compare ("specularstrength"))
    set_specularstrength (val);
  else if (pname.compare ("vertexnormals"))
    set_vertexnormals (val);
  else if (pname.compare ("vertexnormalsmode"))
    set_vertexnormalsmode (val);
  else if (pname.compare ("xdata"))
    set_xdata (val);
  else if (pname.compare ("xdatasource"))
    set_xdatasource (val);
  else if (pname.compare ("ydata"))
    set_ydata (val);
  else if (pname.compare ("ydatasource"))
    set_ydatasource (val);
  else if (pname.compare ("zdata"))
    set_zdata (val);
  else if (pname.compare ("zdatasource"))
    set_zdatasource (val);
  else if (pname.compare ("aliminclude"))
    set_aliminclude (val);
  else if (pname.compare ("climinclude"))
    set_climinclude (val);
  else if (pname.compare ("xliminclude"))
    set_xliminclude (val);
  else if (pname.compare ("yliminclude"))
    set_yliminclude (val);
  else if (pname.compare ("zliminclude"))
    set_zliminclude (val);
  else
    base_properties::set (pname, val);
}

octave_value
surface::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("alphadata", octave_value (get_alphadata ()));
  m.assign ("alphadatamapping", octave_value (get_alphadatamapping ()));
  m.assign ("ambientstrength", octave_value (get_ambientstrength ()));
  m.assign ("backfacelighting", octave_value (get_backfacelighting ()));
  m.assign ("cdata", octave_value (get_cdata ()));
  m.assign ("cdatamapping", octave_value (get_cdatamapping ()));
  m.assign ("cdatasource", octave_value (get_cdatasource ()));
  m.assign ("diffusestrength", octave_value (get_diffusestrength ()));
  m.assign ("displayname", octave_value (get_displayname ()));
  m.assign ("edgealpha", octave_value (get_edgealpha ()));
  m.assign ("edgecolor", octave_value (get_edgecolor ()));
  m.assign ("edgelighting", octave_value (get_edgelighting ()));
  m.assign ("facealpha", octave_value (get_facealpha ()));
  m.assign ("facecolor", octave_value (get_facecolor ()));
  m.assign ("facelighting", octave_value (get_facelighting ()));
  m.assign ("facenormals", octave_value (get_facenormals ()));
  m.assign ("facenormalsmode", octave_value (get_facenormalsmode ()));
  m.assign ("linestyle", octave_value (get_linestyle ()));
  m.assign ("linewidth", octave_value (get_linewidth ()));
  m.assign ("marker", octave_value (get_marker ()));
  m.assign ("markeredgecolor", octave_value (get_markeredgecolor ()));
  m.assign ("markerfacecolor", octave_value (get_markerfacecolor ()));
  m.assign ("markersize", octave_value (get_markersize ()));
  m.assign ("meshstyle", octave_value (get_meshstyle ()));
  m.assign ("specularcolorreflectance", octave_value (get_specularcolorreflectance ()));
  m.assign ("specularexponent", octave_value (get_specularexponent ()));
  m.assign ("specularstrength", octave_value (get_specularstrength ()));
  m.assign ("vertexnormals", octave_value (get_vertexnormals ()));
  m.assign ("vertexnormalsmode", octave_value (get_vertexnormalsmode ()));
  m.assign ("xdata", octave_value (get_xdata ()));
  m.assign ("xdatasource", octave_value (get_xdatasource ()));
  m.assign ("ydata", octave_value (get_ydata ()));
  m.assign ("ydatasource", octave_value (get_ydatasource ()));
  m.assign ("zdata", octave_value (get_zdata ()));
  m.assign ("zdatasource", octave_value (get_zdatasource ()));
  if (all)
    m.assign ("alim", octave_value (get_alim ()));
  if (all)
    m.assign ("clim", octave_value (get_clim ()));
  if (all)
    m.assign ("xlim", octave_value (get_xlim ()));
  if (all)
    m.assign ("ylim", octave_value (get_ylim ()));
  if (all)
    m.assign ("zlim", octave_value (get_zlim ()));
  if (all)
    m.assign ("aliminclude", octave_value (get_aliminclude ()));
  if (all)
    m.assign ("climinclude", octave_value (get_climinclude ()));
  if (all)
    m.assign ("xliminclude", octave_value (get_xliminclude ()));
  if (all)
    m.assign ("yliminclude", octave_value (get_yliminclude ()));
  if (all)
    m.assign ("zliminclude", octave_value (get_zliminclude ()));

  return m;
}

octave_value
surface::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("alphadata"))
    retval = get_alphadata ();
  else if (pname.compare ("alphadatamapping"))
    retval = get_alphadatamapping ();
  else if (pname.compare ("ambientstrength"))
    retval = get_ambientstrength ();
  else if (pname.compare ("backfacelighting"))
    retval = get_backfacelighting ();
  else if (pname.compare ("cdata"))
    retval = get_cdata ();
  else if (pname.compare ("cdatamapping"))
    retval = get_cdatamapping ();
  else if (pname.compare ("cdatasource"))
    retval = get_cdatasource ();
  else if (pname.compare ("diffusestrength"))
    retval = get_diffusestrength ();
  else if (pname.compare ("displayname"))
    retval = get_displayname ();
  else if (pname.compare ("edgealpha"))
    retval = get_edgealpha ();
  else if (pname.compare ("edgecolor"))
    retval = get_edgecolor ();
  else if (pname.compare ("edgelighting"))
    retval = get_edgelighting ();
  else if (pname.compare ("facealpha"))
    retval = get_facealpha ();
  else if (pname.compare ("facecolor"))
    retval = get_facecolor ();
  else if (pname.compare ("facelighting"))
    retval = get_facelighting ();
  else if (pname.compare ("facenormals"))
    retval = get_facenormals ();
  else if (pname.compare ("facenormalsmode"))
    retval = get_facenormalsmode ();
  else if (pname.compare ("linestyle"))
    retval = get_linestyle ();
  else if (pname.compare ("linewidth"))
    retval = get_linewidth ();
  else if (pname.compare ("marker"))
    retval = get_marker ();
  else if (pname.compare ("markeredgecolor"))
    retval = get_markeredgecolor ();
  else if (pname.compare ("markerfacecolor"))
    retval = get_markerfacecolor ();
  else if (pname.compare ("markersize"))
    retval = get_markersize ();
  else if (pname.compare ("meshstyle"))
    retval = get_meshstyle ();
  else if (pname.compare ("specularcolorreflectance"))
    retval = get_specularcolorreflectance ();
  else if (pname.compare ("specularexponent"))
    retval = get_specularexponent ();
  else if (pname.compare ("specularstrength"))
    retval = get_specularstrength ();
  else if (pname.compare ("vertexnormals"))
    retval = get_vertexnormals ();
  else if (pname.compare ("vertexnormalsmode"))
    retval = get_vertexnormalsmode ();
  else if (pname.compare ("xdata"))
    retval = get_xdata ();
  else if (pname.compare ("xdatasource"))
    retval = get_xdatasource ();
  else if (pname.compare ("ydata"))
    retval = get_ydata ();
  else if (pname.compare ("ydatasource"))
    retval = get_ydatasource ();
  else if (pname.compare ("zdata"))
    retval = get_zdata ();
  else if (pname.compare ("zdatasource"))
    retval = get_zdatasource ();
  else if (pname.compare ("alim"))
    retval = get_alim ();
  else if (pname.compare ("clim"))
    retval = get_clim ();
  else if (pname.compare ("xlim"))
    retval = get_xlim ();
  else if (pname.compare ("ylim"))
    retval = get_ylim ();
  else if (pname.compare ("zlim"))
    retval = get_zlim ();
  else if (pname.compare ("aliminclude"))
    retval = get_aliminclude ();
  else if (pname.compare ("climinclude"))
    retval = get_climinclude ();
  else if (pname.compare ("xliminclude"))
    retval = get_xliminclude ();
  else if (pname.compare ("yliminclude"))
    retval = get_yliminclude ();
  else if (pname.compare ("zliminclude"))
    retval = get_zliminclude ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
surface::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("alphadata"))
    return property (&m_alphadata, true);
  else if (pname.compare ("alphadatamapping"))
    return property (&m_alphadatamapping, true);
  else if (pname.compare ("ambientstrength"))
    return property (&m_ambientstrength, true);
  else if (pname.compare ("backfacelighting"))
    return property (&m_backfacelighting, true);
  else if (pname.compare ("cdata"))
    return property (&m_cdata, true);
  else if (pname.compare ("cdatamapping"))
    return property (&m_cdatamapping, true);
  else if (pname.compare ("cdatasource"))
    return property (&m_cdatasource, true);
  else if (pname.compare ("diffusestrength"))
    return property (&m_diffusestrength, true);
  else if (pname.compare ("displayname"))
    return property (&m_displayname, true);
  else if (pname.compare ("edgealpha"))
    return property (&m_edgealpha, true);
  else if (pname.compare ("edgecolor"))
    return property (&m_edgecolor, true);
  else if (pname.compare ("edgelighting"))
    return property (&m_edgelighting, true);
  else if (pname.compare ("facealpha"))
    return property (&m_facealpha, true);
  else if (pname.compare ("facecolor"))
    return property (&m_facecolor, true);
  else if (pname.compare ("facelighting"))
    return property (&m_facelighting, true);
  else if (pname.compare ("facenormals"))
    return property (&m_facenormals, true);
  else if (pname.compare ("facenormalsmode"))
    return property (&m_facenormalsmode, true);
  else if (pname.compare ("linestyle"))
    return property (&m_linestyle, true);
  else if (pname.compare ("linewidth"))
    return property (&m_linewidth, true);
  else if (pname.compare ("marker"))
    return property (&m_marker, true);
  else if (pname.compare ("markeredgecolor"))
    return property (&m_markeredgecolor, true);
  else if (pname.compare ("markerfacecolor"))
    return property (&m_markerfacecolor, true);
  else if (pname.compare ("markersize"))
    return property (&m_markersize, true);
  else if (pname.compare ("meshstyle"))
    return property (&m_meshstyle, true);
  else if (pname.compare ("specularcolorreflectance"))
    return property (&m_specularcolorreflectance, true);
  else if (pname.compare ("specularexponent"))
    return property (&m_specularexponent, true);
  else if (pname.compare ("specularstrength"))
    return property (&m_specularstrength, true);
  else if (pname.compare ("vertexnormals"))
    return property (&m_vertexnormals, true);
  else if (pname.compare ("vertexnormalsmode"))
    return property (&m_vertexnormalsmode, true);
  else if (pname.compare ("xdata"))
    return property (&m_xdata, true);
  else if (pname.compare ("xdatasource"))
    return property (&m_xdatasource, true);
  else if (pname.compare ("ydata"))
    return property (&m_ydata, true);
  else if (pname.compare ("ydatasource"))
    return property (&m_ydatasource, true);
  else if (pname.compare ("zdata"))
    return property (&m_zdata, true);
  else if (pname.compare ("zdatasource"))
    return property (&m_zdatasource, true);
  else if (pname.compare ("alim"))
    return property (&m_alim, true);
  else if (pname.compare ("clim"))
    return property (&m_clim, true);
  else if (pname.compare ("xlim"))
    return property (&m_xlim, true);
  else if (pname.compare ("ylim"))
    return property (&m_ylim, true);
  else if (pname.compare ("zlim"))
    return property (&m_zlim, true);
  else if (pname.compare ("aliminclude"))
    return property (&m_aliminclude, true);
  else if (pname.compare ("climinclude"))
    return property (&m_climinclude, true);
  else if (pname.compare ("xliminclude"))
    return property (&m_xliminclude, true);
  else if (pname.compare ("yliminclude"))
    return property (&m_yliminclude, true);
  else if (pname.compare ("zliminclude"))
    return property (&m_zliminclude, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
surface::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["alphadata"] = Matrix (1, 1, 1.0);
  m["alphadatamapping"] = "scaled";
  m["ambientstrength"] = 0.3;
  m["backfacelighting"] = "reverselit";
  m["cdata"] = default_surface_cdata ();
  m["cdatamapping"] = "scaled";
  m["cdatasource"] = "";
  m["diffusestrength"] = 0.6;
  m["displayname"] = "";
  m["edgealpha"] = double_radio_property (1.0, radio_values ("flat|interp"));
  m["edgecolor"] = color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"));
  m["edgelighting"] = "none";
  m["facealpha"] = double_radio_property (1.0, radio_values ("flat|interp|texturemap"));
  m["facecolor"] = color_property (radio_values ("none|{flat}|interp|texturemap"), color_values (0, 0, 0));
  m["facelighting"] = "flat";
  m["facenormals"] = Matrix ();
  m["facenormalsmode"] = "auto";
  m["linestyle"] = "-";
  m["linewidth"] = 0.5;
  m["marker"] = "none";
  m["markeredgecolor"] = color_property (radio_values ("none|{auto}|flat"), color_values (0, 0, 0));
  m["markerfacecolor"] = color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0));
  m["markersize"] = 6;
  m["meshstyle"] = "both";
  m["specularcolorreflectance"] = 1;
  m["specularexponent"] = 10;
  m["specularstrength"] = 0.9;
  m["vertexnormals"] = Matrix ();
  m["vertexnormalsmode"] = "auto";
  m["xdata"] = default_surface_xdata ();
  m["xdatasource"] = "";
  m["ydata"] = default_surface_ydata ();
  m["ydatasource"] = "";
  m["zdata"] = default_surface_zdata ();
  m["zdatasource"] = "";
  m["alim"] = Matrix ();
  m["clim"] = Matrix ();
  m["xlim"] = Matrix ();
  m["ylim"] = Matrix ();
  m["zlim"] = Matrix ();
  m["aliminclude"] = "on";
  m["climinclude"] = "on";
  m["xliminclude"] = "on";
  m["yliminclude"] = "on";
  m["zliminclude"] = "on";

  return m;
}

std::string surface::properties::s_go_name ("surface");

std::set<std::string>
surface::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alphadata");
      all_pnames.insert ("alphadatamapping");
      all_pnames.insert ("ambientstrength");
      all_pnames.insert ("backfacelighting");
      all_pnames.insert ("cdata");
      all_pnames.insert ("cdatamapping");
      all_pnames.insert ("cdatasource");
      all_pnames.insert ("diffusestrength");
      all_pnames.insert ("displayname");
      all_pnames.insert ("edgealpha");
      all_pnames.insert ("edgecolor");
      all_pnames.insert ("edgelighting");
      all_pnames.insert ("facealpha");
      all_pnames.insert ("facecolor");
      all_pnames.insert ("facelighting");
      all_pnames.insert ("facenormals");
      all_pnames.insert ("facenormalsmode");
      all_pnames.insert ("linestyle");
      all_pnames.insert ("linewidth");
      all_pnames.insert ("marker");
      all_pnames.insert ("markeredgecolor");
      all_pnames.insert ("markerfacecolor");
      all_pnames.insert ("markersize");
      all_pnames.insert ("meshstyle");
      all_pnames.insert ("specularcolorreflectance");
      all_pnames.insert ("specularexponent");
      all_pnames.insert ("specularstrength");
      all_pnames.insert ("vertexnormals");
      all_pnames.insert ("vertexnormalsmode");
      all_pnames.insert ("xdata");
      all_pnames.insert ("xdatasource");
      all_pnames.insert ("ydata");
      all_pnames.insert ("ydatasource");
      all_pnames.insert ("zdata");
      all_pnames.insert ("zdatasource");
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");
      all_pnames.insert ("aliminclude");
      all_pnames.insert ("climinclude");
      all_pnames.insert ("xliminclude");
      all_pnames.insert ("yliminclude");
      all_pnames.insert ("zliminclude");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
surface::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
surface::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
surface::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
surface::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
surface::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** hggroup ********

hggroup::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_displayname ("displayname", mh, ""),
    m_alim ("alim", mh, Matrix ()),
    m_clim ("clim", mh, Matrix ()),
    m_xlim ("xlim", mh, Matrix ()),
    m_ylim ("ylim", mh, Matrix ()),
    m_zlim ("zlim", mh, Matrix ()),
    m_aliminclude ("aliminclude", mh, "on"),
    m_climinclude ("climinclude", mh, "on"),
    m_xliminclude ("xliminclude", mh, "on"),
    m_yliminclude ("yliminclude", mh, "on"),
    m_zliminclude ("zliminclude", mh, "on")
{
  m_displayname.set_id (ID_DISPLAYNAME);
  m_alim.set_id (ID_ALIM);
  m_alim.set_hidden (true);
  m_clim.set_id (ID_CLIM);
  m_clim.set_hidden (true);
  m_xlim.set_id (ID_XLIM);
  m_xlim.set_hidden (true);
  m_ylim.set_id (ID_YLIM);
  m_ylim.set_hidden (true);
  m_zlim.set_id (ID_ZLIM);
  m_zlim.set_hidden (true);
  m_aliminclude.set_id (ID_ALIMINCLUDE);
  m_aliminclude.set_hidden (true);
  m_climinclude.set_id (ID_CLIMINCLUDE);
  m_climinclude.set_hidden (true);
  m_xliminclude.set_id (ID_XLIMINCLUDE);
  m_xliminclude.set_hidden (true);
  m_yliminclude.set_id (ID_YLIMINCLUDE);
  m_yliminclude.set_hidden (true);
  m_zliminclude.set_id (ID_ZLIMINCLUDE);
  m_zliminclude.set_hidden (true);
  init ();
}

void
hggroup::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("displayname"))
    set_displayname (val);
  else if (pname.compare ("aliminclude"))
    set_aliminclude (val);
  else if (pname.compare ("climinclude"))
    set_climinclude (val);
  else if (pname.compare ("xliminclude"))
    set_xliminclude (val);
  else if (pname.compare ("yliminclude"))
    set_yliminclude (val);
  else if (pname.compare ("zliminclude"))
    set_zliminclude (val);
  else
    base_properties::set (pname, val);
}

octave_value
hggroup::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("displayname", octave_value (get_displayname ()));
  if (all)
    m.assign ("alim", octave_value (get_alim ()));
  if (all)
    m.assign ("clim", octave_value (get_clim ()));
  if (all)
    m.assign ("xlim", octave_value (get_xlim ()));
  if (all)
    m.assign ("ylim", octave_value (get_ylim ()));
  if (all)
    m.assign ("zlim", octave_value (get_zlim ()));
  if (all)
    m.assign ("aliminclude", octave_value (get_aliminclude ()));
  if (all)
    m.assign ("climinclude", octave_value (get_climinclude ()));
  if (all)
    m.assign ("xliminclude", octave_value (get_xliminclude ()));
  if (all)
    m.assign ("yliminclude", octave_value (get_yliminclude ()));
  if (all)
    m.assign ("zliminclude", octave_value (get_zliminclude ()));

  return m;
}

octave_value
hggroup::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("displayname"))
    retval = get_displayname ();
  else if (pname.compare ("alim"))
    retval = get_alim ();
  else if (pname.compare ("clim"))
    retval = get_clim ();
  else if (pname.compare ("xlim"))
    retval = get_xlim ();
  else if (pname.compare ("ylim"))
    retval = get_ylim ();
  else if (pname.compare ("zlim"))
    retval = get_zlim ();
  else if (pname.compare ("aliminclude"))
    retval = get_aliminclude ();
  else if (pname.compare ("climinclude"))
    retval = get_climinclude ();
  else if (pname.compare ("xliminclude"))
    retval = get_xliminclude ();
  else if (pname.compare ("yliminclude"))
    retval = get_yliminclude ();
  else if (pname.compare ("zliminclude"))
    retval = get_zliminclude ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
hggroup::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("displayname"))
    return property (&m_displayname, true);
  else if (pname.compare ("alim"))
    return property (&m_alim, true);
  else if (pname.compare ("clim"))
    return property (&m_clim, true);
  else if (pname.compare ("xlim"))
    return property (&m_xlim, true);
  else if (pname.compare ("ylim"))
    return property (&m_ylim, true);
  else if (pname.compare ("zlim"))
    return property (&m_zlim, true);
  else if (pname.compare ("aliminclude"))
    return property (&m_aliminclude, true);
  else if (pname.compare ("climinclude"))
    return property (&m_climinclude, true);
  else if (pname.compare ("xliminclude"))
    return property (&m_xliminclude, true);
  else if (pname.compare ("yliminclude"))
    return property (&m_yliminclude, true);
  else if (pname.compare ("zliminclude"))
    return property (&m_zliminclude, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
hggroup::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["displayname"] = "";
  m["alim"] = Matrix ();
  m["clim"] = Matrix ();
  m["xlim"] = Matrix ();
  m["ylim"] = Matrix ();
  m["zlim"] = Matrix ();
  m["aliminclude"] = "on";
  m["climinclude"] = "on";
  m["xliminclude"] = "on";
  m["yliminclude"] = "on";
  m["zliminclude"] = "on";

  return m;
}

std::string hggroup::properties::s_go_name ("hggroup");

std::set<std::string>
hggroup::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("displayname");
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");
      all_pnames.insert ("aliminclude");
      all_pnames.insert ("climinclude");
      all_pnames.insert ("xliminclude");
      all_pnames.insert ("yliminclude");
      all_pnames.insert ("zliminclude");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
hggroup::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
hggroup::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("alim");
      all_pnames.insert ("clim");
      all_pnames.insert ("xlim");
      all_pnames.insert ("ylim");
      all_pnames.insert ("zlim");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
hggroup::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
hggroup::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
hggroup::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uimenu ********

uimenu::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_accelerator ("accelerator", mh, ""),
    m_callback ("callback", mh, Matrix ()),
    m_checked ("checked", mh, "off"),
    m_enable ("enable", mh, "on"),
    m_foregroundcolor ("foregroundcolor", mh, color_values (0, 0, 0)),
    m_label ("label", mh, ""),
    m_menuselectedfcn ("menuselectedfcn", mh, Matrix ()),
    m_position ("position", mh, 0),
    m_separator ("separator", mh, "off"),
    m_text ("text", mh, ""),
    m___fltk_label__ ("__fltk_label__", mh, ""),
    m___object__ ("__object__", mh, Matrix ())
{
  m_accelerator.set_id (ID_ACCELERATOR);
  m_callback.set_id (ID_CALLBACK);
  m_callback.set_hidden (true);
  m_checked.set_id (ID_CHECKED);
  m_enable.set_id (ID_ENABLE);
  m_foregroundcolor.set_id (ID_FOREGROUNDCOLOR);
  m_label.set_id (ID_LABEL);
  m_label.set_hidden (true);
  m_menuselectedfcn.set_id (ID_MENUSELECTEDFCN);
  m_position.set_id (ID_POSITION);
  m_separator.set_id (ID_SEPARATOR);
  m_text.set_id (ID_TEXT);
  m___fltk_label__.set_id (ID___FLTK_LABEL__);
  m___fltk_label__.set_hidden (true);
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  init ();
}

void
uimenu::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("accelerator"))
    set_accelerator (val);
  else if (pname.compare ("callback"))
    set_callback (val);
  else if (pname.compare ("checked"))
    set_checked (val);
  else if (pname.compare ("enable"))
    set_enable (val);
  else if (pname.compare ("foregroundcolor"))
    set_foregroundcolor (val);
  else if (pname.compare ("label"))
    set_label (val);
  else if (pname.compare ("menuselectedfcn"))
    set_menuselectedfcn (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("separator"))
    set_separator (val);
  else if (pname.compare ("text"))
    set_text (val);
  else if (pname.compare ("__fltk_label__"))
    set___fltk_label__ (val);
  else if (pname.compare ("__object__"))
    set___object__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
uimenu::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("accelerator", octave_value (get_accelerator ()));
  if (all)
    m.assign ("callback", octave_value (get_callback ()));
  m.assign ("checked", octave_value (get_checked ()));
  m.assign ("enable", octave_value (get_enable ()));
  m.assign ("foregroundcolor", octave_value (get_foregroundcolor ()));
  if (all)
    m.assign ("label", octave_value (get_label ()));
  m.assign ("menuselectedfcn", octave_value (get_menuselectedfcn ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("separator", octave_value (get_separator ()));
  m.assign ("text", octave_value (get_text ()));
  if (all)
    m.assign ("__fltk_label__", octave_value (get___fltk_label__ ()));
  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));

  return m;
}

octave_value
uimenu::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("accelerator"))
    retval = get_accelerator ();
  else if (pname.compare ("callback"))
    retval = get_callback ();
  else if (pname.compare ("checked"))
    retval = get_checked ();
  else if (pname.compare ("enable"))
    retval = get_enable ();
  else if (pname.compare ("foregroundcolor"))
    retval = get_foregroundcolor ();
  else if (pname.compare ("label"))
    retval = get_label ();
  else if (pname.compare ("menuselectedfcn"))
    retval = get_menuselectedfcn ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("separator"))
    retval = get_separator ();
  else if (pname.compare ("text"))
    retval = get_text ();
  else if (pname.compare ("__fltk_label__"))
    retval = get___fltk_label__ ();
  else if (pname.compare ("__object__"))
    retval = get___object__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uimenu::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("accelerator"))
    return property (&m_accelerator, true);
  else if (pname.compare ("callback"))
    return property (&m_callback, true);
  else if (pname.compare ("checked"))
    return property (&m_checked, true);
  else if (pname.compare ("enable"))
    return property (&m_enable, true);
  else if (pname.compare ("foregroundcolor"))
    return property (&m_foregroundcolor, true);
  else if (pname.compare ("label"))
    return property (&m_label, true);
  else if (pname.compare ("menuselectedfcn"))
    return property (&m_menuselectedfcn, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("separator"))
    return property (&m_separator, true);
  else if (pname.compare ("text"))
    return property (&m_text, true);
  else if (pname.compare ("__fltk_label__"))
    return property (&m___fltk_label__, true);
  else if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uimenu::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["accelerator"] = "";
  m["callback"] = Matrix ();
  m["checked"] = "off";
  m["enable"] = "on";
  m["foregroundcolor"] = color_values (0, 0, 0);
  m["label"] = "";
  m["menuselectedfcn"] = Matrix ();
  m["position"] = 0;
  m["separator"] = "off";
  m["text"] = "";
  m["__fltk_label__"] = "";
  m["__object__"] = Matrix ();

  return m;
}

std::string uimenu::properties::s_go_name ("uimenu");

std::set<std::string>
uimenu::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("accelerator");
      all_pnames.insert ("callback");
      all_pnames.insert ("checked");
      all_pnames.insert ("enable");
      all_pnames.insert ("foregroundcolor");
      all_pnames.insert ("label");
      all_pnames.insert ("menuselectedfcn");
      all_pnames.insert ("position");
      all_pnames.insert ("separator");
      all_pnames.insert ("text");
      all_pnames.insert ("__fltk_label__");
      all_pnames.insert ("__object__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uimenu::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uimenu::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uimenu::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uimenu::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uimenu::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uicontextmenu ********

uicontextmenu::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_callback ("callback", mh, Matrix ()),
    m_position ("position", mh, Matrix (1, 2, 0.0)),
    m___object__ ("__object__", mh, Matrix ())
{
  m_callback.set_id (ID_CALLBACK);
  m_position.set_id (ID_POSITION);
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  init ();
}

void
uicontextmenu::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("callback"))
    set_callback (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("__object__"))
    set___object__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
uicontextmenu::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("callback", octave_value (get_callback ()));
  m.assign ("position", octave_value (get_position ()));
  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));

  return m;
}

octave_value
uicontextmenu::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("callback"))
    retval = get_callback ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("__object__"))
    retval = get___object__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uicontextmenu::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("callback"))
    return property (&m_callback, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uicontextmenu::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["callback"] = Matrix ();
  m["position"] = Matrix (1, 2, 0.0);
  m["__object__"] = Matrix ();

  return m;
}

std::string uicontextmenu::properties::s_go_name ("uicontextmenu");

std::set<std::string>
uicontextmenu::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("callback");
      all_pnames.insert ("position");
      all_pnames.insert ("__object__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uicontextmenu::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uicontextmenu::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uicontextmenu::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uicontextmenu::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uicontextmenu::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uicontrol ********

uicontrol::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_backgroundcolor ("backgroundcolor", mh, color_values (0.94, 0.94, 0.94)),
    m_callback ("callback", mh, Matrix ()),
    m_cdata ("cdata", mh, Matrix ()),
    m_clipping ("clipping", mh, "on"),
    m_enable ("enable", mh, "{on}|inactive|off"),
    m_extent ("extent", mh, Matrix (1, 4, 0.0)),
    m_fontangle ("fontangle", mh, "{normal}|italic"),
    m_fontname ("fontname", mh, OCTAVE_DEFAULT_FONTNAME),
    m_fontsize ("fontsize", mh, 10),
    m_fontunits ("fontunits", mh, "inches|centimeters|normalized|{points}|pixels"),
    m_fontweight ("fontweight", mh, "{normal}|bold"),
    m_foregroundcolor ("foregroundcolor", mh, color_values (0, 0, 0)),
    m_horizontalalignment ("horizontalalignment", mh, "left|{center}|right"),
    m_keypressfcn ("keypressfcn", mh, Matrix ()),
    m_listboxtop ("listboxtop", mh, 1),
    m_max ("max", mh, 1),
    m_min ("min", mh, 0),
    m_position ("position", mh, default_control_position ()),
    m_sliderstep ("sliderstep", mh, default_control_sliderstep ()),
    m_string ("string", mh, ""),
    m_style ("style", mh, "{pushbutton}|togglebutton|radiobutton|checkbox|edit|text|slider|frame|listbox|popupmenu"),
    m_tooltipstring ("tooltipstring", mh, ""),
    m_units ("units", mh, "normalized|inches|centimeters|points|{pixels}|characters"),
    m_value ("value", mh, Matrix (1, 1, 0.0)),
    m_verticalalignment ("verticalalignment", mh, "top|{middle}|bottom"),
    m___focus__ ("__focus__", mh, "off"),
    m___object__ ("__object__", mh, Matrix ())
{
  m_backgroundcolor.set_id (ID_BACKGROUNDCOLOR);
  m_callback.set_id (ID_CALLBACK);
  m_cdata.set_id (ID_CDATA);
  m_clipping.set_id (ID_CLIPPING);
  m_enable.set_id (ID_ENABLE);
  m_extent.set_id (ID_EXTENT);
  m_fontangle.set_id (ID_FONTANGLE);
  m_fontname.set_id (ID_FONTNAME);
  m_fontsize.set_id (ID_FONTSIZE);
  m_fontunits.set_id (ID_FONTUNITS);
  m_fontweight.set_id (ID_FONTWEIGHT);
  m_foregroundcolor.set_id (ID_FOREGROUNDCOLOR);
  m_horizontalalignment.set_id (ID_HORIZONTALALIGNMENT);
  m_keypressfcn.set_id (ID_KEYPRESSFCN);
  m_listboxtop.set_id (ID_LISTBOXTOP);
  m_max.set_id (ID_MAX);
  m_min.set_id (ID_MIN);
  m_position.set_id (ID_POSITION);
  m_sliderstep.set_id (ID_SLIDERSTEP);
  m_string.set_id (ID_STRING);
  m_style.set_id (ID_STYLE);
  m_tooltipstring.set_id (ID_TOOLTIPSTRING);
  m_units.set_id (ID_UNITS);
  m_value.set_id (ID_VALUE);
  m_verticalalignment.set_id (ID_VERTICALALIGNMENT);
  m___focus__.set_id (ID___FOCUS__);
  m___focus__.set_hidden (true);
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  init ();
}

void
uicontrol::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("backgroundcolor"))
    set_backgroundcolor (val);
  else if (pname.compare ("callback"))
    set_callback (val);
  else if (pname.compare ("cdata"))
    set_cdata (val);
  else if (pname.compare ("clipping"))
    set_clipping (val);
  else if (pname.compare ("enable"))
    set_enable (val);
  else if (pname.compare ("fontangle"))
    set_fontangle (val);
  else if (pname.compare ("fontname"))
    set_fontname (val);
  else if (pname.compare ("fontsize"))
    set_fontsize (val);
  else if (pname.compare ("fontunits"))
    set_fontunits (val);
  else if (pname.compare ("fontweight"))
    set_fontweight (val);
  else if (pname.compare ("foregroundcolor"))
    set_foregroundcolor (val);
  else if (pname.compare ("horizontalalignment"))
    set_horizontalalignment (val);
  else if (pname.compare ("keypressfcn"))
    set_keypressfcn (val);
  else if (pname.compare ("listboxtop"))
    set_listboxtop (val);
  else if (pname.compare ("max"))
    set_max (val);
  else if (pname.compare ("min"))
    set_min (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("sliderstep"))
    set_sliderstep (val);
  else if (pname.compare ("string"))
    set_string (val);
  else if (pname.compare ("style"))
    set_style (val);
  else if (pname.compare ("tooltipstring"))
    set_tooltipstring (val);
  else if (pname.compare ("units"))
    set_units (val);
  else if (pname.compare ("value"))
    set_value (val);
  else if (pname.compare ("verticalalignment"))
    set_verticalalignment (val);
  else if (pname.compare ("__focus__"))
    set___focus__ (val);
  else if (pname.compare ("__object__"))
    set___object__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
uicontrol::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("backgroundcolor", octave_value (get_backgroundcolor ()));
  m.assign ("callback", octave_value (get_callback ()));
  m.assign ("cdata", octave_value (get_cdata ()));
  m.assign ("clipping", octave_value (get_clipping ()));
  m.assign ("enable", octave_value (get_enable ()));
  m.assign ("extent", octave_value (get_extent ()));
  m.assign ("fontangle", octave_value (get_fontangle ()));
  m.assign ("fontname", octave_value (get_fontname ()));
  m.assign ("fontsize", octave_value (get_fontsize ()));
  m.assign ("fontunits", octave_value (get_fontunits ()));
  m.assign ("fontweight", octave_value (get_fontweight ()));
  m.assign ("foregroundcolor", octave_value (get_foregroundcolor ()));
  m.assign ("horizontalalignment", octave_value (get_horizontalalignment ()));
  m.assign ("keypressfcn", octave_value (get_keypressfcn ()));
  m.assign ("listboxtop", octave_value (get_listboxtop ()));
  m.assign ("max", octave_value (get_max ()));
  m.assign ("min", octave_value (get_min ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("sliderstep", octave_value (get_sliderstep ()));
  m.assign ("string", octave_value (get_string ()));
  m.assign ("style", octave_value (get_style ()));
  m.assign ("tooltipstring", octave_value (get_tooltipstring ()));
  m.assign ("units", octave_value (get_units ()));
  m.assign ("value", octave_value (get_value ()));
  m.assign ("verticalalignment", octave_value (get_verticalalignment ()));
  if (all)
    m.assign ("__focus__", octave_value (get___focus__ ()));
  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));

  return m;
}

octave_value
uicontrol::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("backgroundcolor"))
    retval = get_backgroundcolor ();
  else if (pname.compare ("callback"))
    retval = get_callback ();
  else if (pname.compare ("cdata"))
    retval = get_cdata ();
  else if (pname.compare ("clipping"))
    retval = get_clipping ();
  else if (pname.compare ("enable"))
    retval = get_enable ();
  else if (pname.compare ("extent"))
    retval = get_extent ();
  else if (pname.compare ("fontangle"))
    retval = get_fontangle ();
  else if (pname.compare ("fontname"))
    retval = get_fontname ();
  else if (pname.compare ("fontsize"))
    retval = get_fontsize ();
  else if (pname.compare ("fontunits"))
    retval = get_fontunits ();
  else if (pname.compare ("fontweight"))
    retval = get_fontweight ();
  else if (pname.compare ("foregroundcolor"))
    retval = get_foregroundcolor ();
  else if (pname.compare ("horizontalalignment"))
    retval = get_horizontalalignment ();
  else if (pname.compare ("keypressfcn"))
    retval = get_keypressfcn ();
  else if (pname.compare ("listboxtop"))
    retval = get_listboxtop ();
  else if (pname.compare ("max"))
    retval = get_max ();
  else if (pname.compare ("min"))
    retval = get_min ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("sliderstep"))
    retval = get_sliderstep ();
  else if (pname.compare ("string"))
    retval = get_string ();
  else if (pname.compare ("style"))
    retval = get_style ();
  else if (pname.compare ("tooltipstring"))
    retval = get_tooltipstring ();
  else if (pname.compare ("units"))
    retval = get_units ();
  else if (pname.compare ("value"))
    retval = get_value ();
  else if (pname.compare ("verticalalignment"))
    retval = get_verticalalignment ();
  else if (pname.compare ("__focus__"))
    retval = get___focus__ ();
  else if (pname.compare ("__object__"))
    retval = get___object__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uicontrol::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("backgroundcolor"))
    return property (&m_backgroundcolor, true);
  else if (pname.compare ("callback"))
    return property (&m_callback, true);
  else if (pname.compare ("cdata"))
    return property (&m_cdata, true);
  else if (pname.compare ("clipping"))
    return property (&m_clipping, true);
  else if (pname.compare ("enable"))
    return property (&m_enable, true);
  else if (pname.compare ("extent"))
    return property (&m_extent, true);
  else if (pname.compare ("fontangle"))
    return property (&m_fontangle, true);
  else if (pname.compare ("fontname"))
    return property (&m_fontname, true);
  else if (pname.compare ("fontsize"))
    return property (&m_fontsize, true);
  else if (pname.compare ("fontunits"))
    return property (&m_fontunits, true);
  else if (pname.compare ("fontweight"))
    return property (&m_fontweight, true);
  else if (pname.compare ("foregroundcolor"))
    return property (&m_foregroundcolor, true);
  else if (pname.compare ("horizontalalignment"))
    return property (&m_horizontalalignment, true);
  else if (pname.compare ("keypressfcn"))
    return property (&m_keypressfcn, true);
  else if (pname.compare ("listboxtop"))
    return property (&m_listboxtop, true);
  else if (pname.compare ("max"))
    return property (&m_max, true);
  else if (pname.compare ("min"))
    return property (&m_min, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("sliderstep"))
    return property (&m_sliderstep, true);
  else if (pname.compare ("string"))
    return property (&m_string, true);
  else if (pname.compare ("style"))
    return property (&m_style, true);
  else if (pname.compare ("tooltipstring"))
    return property (&m_tooltipstring, true);
  else if (pname.compare ("units"))
    return property (&m_units, true);
  else if (pname.compare ("value"))
    return property (&m_value, true);
  else if (pname.compare ("verticalalignment"))
    return property (&m_verticalalignment, true);
  else if (pname.compare ("__focus__"))
    return property (&m___focus__, true);
  else if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uicontrol::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["backgroundcolor"] = color_values (0.94, 0.94, 0.94);
  m["callback"] = Matrix ();
  m["cdata"] = Matrix ();
  m["clipping"] = "on";
  m["enable"] = "on";
  m["extent"] = Matrix (1, 4, 0.0);
  m["fontangle"] = "normal";
  m["fontname"] = OCTAVE_DEFAULT_FONTNAME;
  m["fontsize"] = 10;
  m["fontunits"] = "points";
  m["fontweight"] = "normal";
  m["foregroundcolor"] = color_values (0, 0, 0);
  m["horizontalalignment"] = "center";
  m["keypressfcn"] = Matrix ();
  m["listboxtop"] = 1;
  m["max"] = 1;
  m["min"] = 0;
  m["position"] = default_control_position ();
  m["sliderstep"] = default_control_sliderstep ();
  m["string"] = "";
  m["style"] = "pushbutton";
  m["tooltipstring"] = "";
  m["units"] = "pixels";
  m["value"] = Matrix (1, 1, 0.0);
  m["verticalalignment"] = "middle";
  m["__focus__"] = "off";
  m["__object__"] = Matrix ();

  return m;
}

std::string uicontrol::properties::s_go_name ("uicontrol");

std::set<std::string>
uicontrol::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("backgroundcolor");
      all_pnames.insert ("callback");
      all_pnames.insert ("cdata");
      all_pnames.insert ("clipping");
      all_pnames.insert ("enable");
      all_pnames.insert ("extent");
      all_pnames.insert ("fontangle");
      all_pnames.insert ("fontname");
      all_pnames.insert ("fontsize");
      all_pnames.insert ("fontunits");
      all_pnames.insert ("fontweight");
      all_pnames.insert ("foregroundcolor");
      all_pnames.insert ("horizontalalignment");
      all_pnames.insert ("keypressfcn");
      all_pnames.insert ("listboxtop");
      all_pnames.insert ("max");
      all_pnames.insert ("min");
      all_pnames.insert ("position");
      all_pnames.insert ("sliderstep");
      all_pnames.insert ("string");
      all_pnames.insert ("style");
      all_pnames.insert ("tooltipstring");
      all_pnames.insert ("units");
      all_pnames.insert ("value");
      all_pnames.insert ("verticalalignment");
      all_pnames.insert ("__focus__");
      all_pnames.insert ("__object__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uicontrol::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uicontrol::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("extent");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uicontrol::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uicontrol::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uicontrol::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uibuttongroup ********

uibuttongroup::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_backgroundcolor ("backgroundcolor", mh, color_values (0.94, 0.94, 0.94)),
    m_bordertype ("bordertype", mh, "none|{etchedin}|etchedout|beveledin|beveledout|line"),
    m_borderwidth ("borderwidth", mh, 1),
    m_clipping ("clipping", mh, "on"),
    m_fontangle ("fontangle", mh, "{normal}|italic"),
    m_fontname ("fontname", mh, OCTAVE_DEFAULT_FONTNAME),
    m_fontsize ("fontsize", mh, 10),
    m_fontunits ("fontunits", mh, "inches|centimeters|normalized|{points}|pixels"),
    m_fontweight ("fontweight", mh, "{normal}|bold"),
    m_foregroundcolor ("foregroundcolor", mh, color_values (0, 0, 0)),
    m_highlightcolor ("highlightcolor", mh, color_values (1, 1, 1)),
    m_position ("position", mh, default_panel_position ()),
    m_resizefcn ("resizefcn", mh, Matrix ()),
    m_selectedobject ("selectedobject", mh, graphics_handle ()),
    m_selectionchangedfcn ("selectionchangedfcn", mh, Matrix ()),
    m_shadowcolor ("shadowcolor", mh, color_values (0.7, 0.7, 0.7)),
    m_sizechangedfcn ("sizechangedfcn", mh, Matrix ()),
    m_units ("units", mh, "{normalized}|inches|centimeters|points|pixels|characters"),
    m_title ("title", mh, ""),
    m_titleposition ("titleposition", mh, "{lefttop}|centertop|righttop|leftbottom|centerbottom|rightbottom"),
    m___object__ ("__object__", mh, Matrix ())
{
  m_backgroundcolor.set_id (ID_BACKGROUNDCOLOR);
  m_bordertype.set_id (ID_BORDERTYPE);
  m_borderwidth.set_id (ID_BORDERWIDTH);
  m_clipping.set_id (ID_CLIPPING);
  m_fontangle.set_id (ID_FONTANGLE);
  m_fontname.set_id (ID_FONTNAME);
  m_fontsize.set_id (ID_FONTSIZE);
  m_fontunits.set_id (ID_FONTUNITS);
  m_fontweight.set_id (ID_FONTWEIGHT);
  m_foregroundcolor.set_id (ID_FOREGROUNDCOLOR);
  m_highlightcolor.set_id (ID_HIGHLIGHTCOLOR);
  m_position.set_id (ID_POSITION);
  m_resizefcn.set_id (ID_RESIZEFCN);
  m_selectedobject.set_id (ID_SELECTEDOBJECT);
  m_selectionchangedfcn.set_id (ID_SELECTIONCHANGEDFCN);
  m_shadowcolor.set_id (ID_SHADOWCOLOR);
  m_sizechangedfcn.set_id (ID_SIZECHANGEDFCN);
  m_units.set_id (ID_UNITS);
  m_title.set_id (ID_TITLE);
  m_titleposition.set_id (ID_TITLEPOSITION);
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  init ();
}

void
uibuttongroup::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("backgroundcolor"))
    set_backgroundcolor (val);
  else if (pname.compare ("bordertype"))
    set_bordertype (val);
  else if (pname.compare ("borderwidth"))
    set_borderwidth (val);
  else if (pname.compare ("clipping"))
    set_clipping (val);
  else if (pname.compare ("fontangle"))
    set_fontangle (val);
  else if (pname.compare ("fontname"))
    set_fontname (val);
  else if (pname.compare ("fontsize"))
    set_fontsize (val);
  else if (pname.compare ("fontunits"))
    set_fontunits (val);
  else if (pname.compare ("fontweight"))
    set_fontweight (val);
  else if (pname.compare ("foregroundcolor"))
    set_foregroundcolor (val);
  else if (pname.compare ("highlightcolor"))
    set_highlightcolor (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("resizefcn"))
    set_resizefcn (val);
  else if (pname.compare ("selectedobject"))
    set_selectedobject (val);
  else if (pname.compare ("selectionchangedfcn"))
    set_selectionchangedfcn (val);
  else if (pname.compare ("shadowcolor"))
    set_shadowcolor (val);
  else if (pname.compare ("sizechangedfcn"))
    set_sizechangedfcn (val);
  else if (pname.compare ("units"))
    set_units (val);
  else if (pname.compare ("title"))
    set_title (val);
  else if (pname.compare ("titleposition"))
    set_titleposition (val);
  else if (pname.compare ("__object__"))
    set___object__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
uibuttongroup::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("backgroundcolor", octave_value (get_backgroundcolor ()));
  m.assign ("bordertype", octave_value (get_bordertype ()));
  m.assign ("borderwidth", octave_value (get_borderwidth ()));
  m.assign ("clipping", octave_value (get_clipping ()));
  m.assign ("fontangle", octave_value (get_fontangle ()));
  m.assign ("fontname", octave_value (get_fontname ()));
  m.assign ("fontsize", octave_value (get_fontsize ()));
  m.assign ("fontunits", octave_value (get_fontunits ()));
  m.assign ("fontweight", octave_value (get_fontweight ()));
  m.assign ("foregroundcolor", octave_value (get_foregroundcolor ()));
  m.assign ("highlightcolor", octave_value (get_highlightcolor ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("resizefcn", octave_value (get_resizefcn ()));
  m.assign ("selectedobject", octave_value (get_selectedobject ().as_octave_value ()));
  m.assign ("selectionchangedfcn", octave_value (get_selectionchangedfcn ()));
  m.assign ("shadowcolor", octave_value (get_shadowcolor ()));
  m.assign ("sizechangedfcn", octave_value (get_sizechangedfcn ()));
  m.assign ("units", octave_value (get_units ()));
  m.assign ("title", octave_value (get_title ()));
  m.assign ("titleposition", octave_value (get_titleposition ()));
  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));

  return m;
}

octave_value
uibuttongroup::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("backgroundcolor"))
    retval = get_backgroundcolor ();
  else if (pname.compare ("bordertype"))
    retval = get_bordertype ();
  else if (pname.compare ("borderwidth"))
    retval = get_borderwidth ();
  else if (pname.compare ("clipping"))
    retval = get_clipping ();
  else if (pname.compare ("fontangle"))
    retval = get_fontangle ();
  else if (pname.compare ("fontname"))
    retval = get_fontname ();
  else if (pname.compare ("fontsize"))
    retval = get_fontsize ();
  else if (pname.compare ("fontunits"))
    retval = get_fontunits ();
  else if (pname.compare ("fontweight"))
    retval = get_fontweight ();
  else if (pname.compare ("foregroundcolor"))
    retval = get_foregroundcolor ();
  else if (pname.compare ("highlightcolor"))
    retval = get_highlightcolor ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("resizefcn"))
    retval = get_resizefcn ();
  else if (pname.compare ("selectedobject"))
    retval = get_selectedobject ().as_octave_value ();
  else if (pname.compare ("selectionchangedfcn"))
    retval = get_selectionchangedfcn ();
  else if (pname.compare ("shadowcolor"))
    retval = get_shadowcolor ();
  else if (pname.compare ("sizechangedfcn"))
    retval = get_sizechangedfcn ();
  else if (pname.compare ("units"))
    retval = get_units ();
  else if (pname.compare ("title"))
    retval = get_title ();
  else if (pname.compare ("titleposition"))
    retval = get_titleposition ();
  else if (pname.compare ("__object__"))
    retval = get___object__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uibuttongroup::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("backgroundcolor"))
    return property (&m_backgroundcolor, true);
  else if (pname.compare ("bordertype"))
    return property (&m_bordertype, true);
  else if (pname.compare ("borderwidth"))
    return property (&m_borderwidth, true);
  else if (pname.compare ("clipping"))
    return property (&m_clipping, true);
  else if (pname.compare ("fontangle"))
    return property (&m_fontangle, true);
  else if (pname.compare ("fontname"))
    return property (&m_fontname, true);
  else if (pname.compare ("fontsize"))
    return property (&m_fontsize, true);
  else if (pname.compare ("fontunits"))
    return property (&m_fontunits, true);
  else if (pname.compare ("fontweight"))
    return property (&m_fontweight, true);
  else if (pname.compare ("foregroundcolor"))
    return property (&m_foregroundcolor, true);
  else if (pname.compare ("highlightcolor"))
    return property (&m_highlightcolor, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("resizefcn"))
    return property (&m_resizefcn, true);
  else if (pname.compare ("selectedobject"))
    return property (&m_selectedobject, true);
  else if (pname.compare ("selectionchangedfcn"))
    return property (&m_selectionchangedfcn, true);
  else if (pname.compare ("shadowcolor"))
    return property (&m_shadowcolor, true);
  else if (pname.compare ("sizechangedfcn"))
    return property (&m_sizechangedfcn, true);
  else if (pname.compare ("units"))
    return property (&m_units, true);
  else if (pname.compare ("title"))
    return property (&m_title, true);
  else if (pname.compare ("titleposition"))
    return property (&m_titleposition, true);
  else if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uibuttongroup::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["backgroundcolor"] = color_values (0.94, 0.94, 0.94);
  m["bordertype"] = "etchedin";
  m["borderwidth"] = 1;
  m["clipping"] = "on";
  m["fontangle"] = "normal";
  m["fontname"] = OCTAVE_DEFAULT_FONTNAME;
  m["fontsize"] = 10;
  m["fontunits"] = "points";
  m["fontweight"] = "normal";
  m["foregroundcolor"] = color_values (0, 0, 0);
  m["highlightcolor"] = color_values (1, 1, 1);
  m["position"] = default_panel_position ();
  m["resizefcn"] = Matrix ();
  m["selectedobject"] = graphics_handle ().as_octave_value ();
  m["selectionchangedfcn"] = Matrix ();
  m["shadowcolor"] = color_values (0.7, 0.7, 0.7);
  m["sizechangedfcn"] = Matrix ();
  m["units"] = "normalized";
  m["title"] = "";
  m["titleposition"] = "lefttop";
  m["__object__"] = Matrix ();

  return m;
}

std::string uibuttongroup::properties::s_go_name ("uibuttongroup");

std::set<std::string>
uibuttongroup::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("backgroundcolor");
      all_pnames.insert ("bordertype");
      all_pnames.insert ("borderwidth");
      all_pnames.insert ("clipping");
      all_pnames.insert ("fontangle");
      all_pnames.insert ("fontname");
      all_pnames.insert ("fontsize");
      all_pnames.insert ("fontunits");
      all_pnames.insert ("fontweight");
      all_pnames.insert ("foregroundcolor");
      all_pnames.insert ("highlightcolor");
      all_pnames.insert ("position");
      all_pnames.insert ("resizefcn");
      all_pnames.insert ("selectedobject");
      all_pnames.insert ("selectionchangedfcn");
      all_pnames.insert ("shadowcolor");
      all_pnames.insert ("sizechangedfcn");
      all_pnames.insert ("units");
      all_pnames.insert ("title");
      all_pnames.insert ("titleposition");
      all_pnames.insert ("__object__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uibuttongroup::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uibuttongroup::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uibuttongroup::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uibuttongroup::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uibuttongroup::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uipanel ********

uipanel::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_backgroundcolor ("backgroundcolor", mh, color_values (0.94, 0.94, 0.94)),
    m_bordertype ("bordertype", mh, "none|{etchedin}|etchedout|beveledin|beveledout|line"),
    m_borderwidth ("borderwidth", mh, 1),
    m_fontangle ("fontangle", mh, "{normal}|italic"),
    m_fontname ("fontname", mh, OCTAVE_DEFAULT_FONTNAME),
    m_fontsize ("fontsize", mh, 10),
    m_fontunits ("fontunits", mh, "inches|centimeters|normalized|{points}|pixels"),
    m_fontweight ("fontweight", mh, "{normal}|bold"),
    m_foregroundcolor ("foregroundcolor", mh, color_values (0, 0, 0)),
    m_highlightcolor ("highlightcolor", mh, color_values (1, 1, 1)),
    m_position ("position", mh, default_panel_position ()),
    m_resizefcn ("resizefcn", mh, Matrix ()),
    m_shadowcolor ("shadowcolor", mh, color_values (0.7, 0.7, 0.7)),
    m_sizechangedfcn ("sizechangedfcn", mh, Matrix ()),
    m_title ("title", mh, ""),
    m_titleposition ("titleposition", mh, "{lefttop}|centertop|righttop|leftbottom|centerbottom|rightbottom"),
    m_units ("units", mh, "{normalized}|inches|centimeters|points|pixels|characters"),
    m___object__ ("__object__", mh, Matrix ())
{
  m_backgroundcolor.set_id (ID_BACKGROUNDCOLOR);
  m_bordertype.set_id (ID_BORDERTYPE);
  m_borderwidth.set_id (ID_BORDERWIDTH);
  m_fontangle.set_id (ID_FONTANGLE);
  m_fontname.set_id (ID_FONTNAME);
  m_fontsize.set_id (ID_FONTSIZE);
  m_fontunits.set_id (ID_FONTUNITS);
  m_fontweight.set_id (ID_FONTWEIGHT);
  m_foregroundcolor.set_id (ID_FOREGROUNDCOLOR);
  m_highlightcolor.set_id (ID_HIGHLIGHTCOLOR);
  m_position.set_id (ID_POSITION);
  m_resizefcn.set_id (ID_RESIZEFCN);
  m_shadowcolor.set_id (ID_SHADOWCOLOR);
  m_sizechangedfcn.set_id (ID_SIZECHANGEDFCN);
  m_title.set_id (ID_TITLE);
  m_titleposition.set_id (ID_TITLEPOSITION);
  m_units.set_id (ID_UNITS);
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  init ();
}

void
uipanel::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("backgroundcolor"))
    set_backgroundcolor (val);
  else if (pname.compare ("bordertype"))
    set_bordertype (val);
  else if (pname.compare ("borderwidth"))
    set_borderwidth (val);
  else if (pname.compare ("fontangle"))
    set_fontangle (val);
  else if (pname.compare ("fontname"))
    set_fontname (val);
  else if (pname.compare ("fontsize"))
    set_fontsize (val);
  else if (pname.compare ("fontunits"))
    set_fontunits (val);
  else if (pname.compare ("fontweight"))
    set_fontweight (val);
  else if (pname.compare ("foregroundcolor"))
    set_foregroundcolor (val);
  else if (pname.compare ("highlightcolor"))
    set_highlightcolor (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("resizefcn"))
    set_resizefcn (val);
  else if (pname.compare ("shadowcolor"))
    set_shadowcolor (val);
  else if (pname.compare ("sizechangedfcn"))
    set_sizechangedfcn (val);
  else if (pname.compare ("title"))
    set_title (val);
  else if (pname.compare ("titleposition"))
    set_titleposition (val);
  else if (pname.compare ("units"))
    set_units (val);
  else if (pname.compare ("__object__"))
    set___object__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
uipanel::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("backgroundcolor", octave_value (get_backgroundcolor ()));
  m.assign ("bordertype", octave_value (get_bordertype ()));
  m.assign ("borderwidth", octave_value (get_borderwidth ()));
  m.assign ("fontangle", octave_value (get_fontangle ()));
  m.assign ("fontname", octave_value (get_fontname ()));
  m.assign ("fontsize", octave_value (get_fontsize ()));
  m.assign ("fontunits", octave_value (get_fontunits ()));
  m.assign ("fontweight", octave_value (get_fontweight ()));
  m.assign ("foregroundcolor", octave_value (get_foregroundcolor ()));
  m.assign ("highlightcolor", octave_value (get_highlightcolor ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("resizefcn", octave_value (get_resizefcn ()));
  m.assign ("shadowcolor", octave_value (get_shadowcolor ()));
  m.assign ("sizechangedfcn", octave_value (get_sizechangedfcn ()));
  m.assign ("title", octave_value (get_title ()));
  m.assign ("titleposition", octave_value (get_titleposition ()));
  m.assign ("units", octave_value (get_units ()));
  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));

  return m;
}

octave_value
uipanel::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("backgroundcolor"))
    retval = get_backgroundcolor ();
  else if (pname.compare ("bordertype"))
    retval = get_bordertype ();
  else if (pname.compare ("borderwidth"))
    retval = get_borderwidth ();
  else if (pname.compare ("fontangle"))
    retval = get_fontangle ();
  else if (pname.compare ("fontname"))
    retval = get_fontname ();
  else if (pname.compare ("fontsize"))
    retval = get_fontsize ();
  else if (pname.compare ("fontunits"))
    retval = get_fontunits ();
  else if (pname.compare ("fontweight"))
    retval = get_fontweight ();
  else if (pname.compare ("foregroundcolor"))
    retval = get_foregroundcolor ();
  else if (pname.compare ("highlightcolor"))
    retval = get_highlightcolor ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("resizefcn"))
    retval = get_resizefcn ();
  else if (pname.compare ("shadowcolor"))
    retval = get_shadowcolor ();
  else if (pname.compare ("sizechangedfcn"))
    retval = get_sizechangedfcn ();
  else if (pname.compare ("title"))
    retval = get_title ();
  else if (pname.compare ("titleposition"))
    retval = get_titleposition ();
  else if (pname.compare ("units"))
    retval = get_units ();
  else if (pname.compare ("__object__"))
    retval = get___object__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uipanel::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("backgroundcolor"))
    return property (&m_backgroundcolor, true);
  else if (pname.compare ("bordertype"))
    return property (&m_bordertype, true);
  else if (pname.compare ("borderwidth"))
    return property (&m_borderwidth, true);
  else if (pname.compare ("fontangle"))
    return property (&m_fontangle, true);
  else if (pname.compare ("fontname"))
    return property (&m_fontname, true);
  else if (pname.compare ("fontsize"))
    return property (&m_fontsize, true);
  else if (pname.compare ("fontunits"))
    return property (&m_fontunits, true);
  else if (pname.compare ("fontweight"))
    return property (&m_fontweight, true);
  else if (pname.compare ("foregroundcolor"))
    return property (&m_foregroundcolor, true);
  else if (pname.compare ("highlightcolor"))
    return property (&m_highlightcolor, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("resizefcn"))
    return property (&m_resizefcn, true);
  else if (pname.compare ("shadowcolor"))
    return property (&m_shadowcolor, true);
  else if (pname.compare ("sizechangedfcn"))
    return property (&m_sizechangedfcn, true);
  else if (pname.compare ("title"))
    return property (&m_title, true);
  else if (pname.compare ("titleposition"))
    return property (&m_titleposition, true);
  else if (pname.compare ("units"))
    return property (&m_units, true);
  else if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uipanel::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["backgroundcolor"] = color_values (0.94, 0.94, 0.94);
  m["bordertype"] = "etchedin";
  m["borderwidth"] = 1;
  m["fontangle"] = "normal";
  m["fontname"] = OCTAVE_DEFAULT_FONTNAME;
  m["fontsize"] = 10;
  m["fontunits"] = "points";
  m["fontweight"] = "normal";
  m["foregroundcolor"] = color_values (0, 0, 0);
  m["highlightcolor"] = color_values (1, 1, 1);
  m["position"] = default_panel_position ();
  m["resizefcn"] = Matrix ();
  m["shadowcolor"] = color_values (0.7, 0.7, 0.7);
  m["sizechangedfcn"] = Matrix ();
  m["title"] = "";
  m["titleposition"] = "lefttop";
  m["units"] = "normalized";
  m["__object__"] = Matrix ();

  return m;
}

std::string uipanel::properties::s_go_name ("uipanel");

std::set<std::string>
uipanel::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("backgroundcolor");
      all_pnames.insert ("bordertype");
      all_pnames.insert ("borderwidth");
      all_pnames.insert ("fontangle");
      all_pnames.insert ("fontname");
      all_pnames.insert ("fontsize");
      all_pnames.insert ("fontunits");
      all_pnames.insert ("fontweight");
      all_pnames.insert ("foregroundcolor");
      all_pnames.insert ("highlightcolor");
      all_pnames.insert ("position");
      all_pnames.insert ("resizefcn");
      all_pnames.insert ("shadowcolor");
      all_pnames.insert ("sizechangedfcn");
      all_pnames.insert ("title");
      all_pnames.insert ("titleposition");
      all_pnames.insert ("units");
      all_pnames.insert ("__object__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uipanel::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uipanel::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uipanel::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uipanel::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uipanel::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uitable ********

uitable::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m___object__ ("__object__", mh, Matrix ()),
    m_backgroundcolor ("backgroundcolor", mh, default_table_backgroundcolor ()),
    m_celleditcallback ("celleditcallback", mh, Matrix ()),
    m_cellselectioncallback ("cellselectioncallback", mh, Matrix ()),
    m_columneditable ("columneditable", mh, Matrix ()),
    m_columnformat ("columnformat", mh, Cell ()),
    m_columnname ("columnname", mh, "numbered"),
    m_columnwidth ("columnwidth", mh, "auto"),
    m_data ("data", mh, Matrix ()),
    m_enable ("enable", mh, "on"),
    m_extent ("extent", mh, Matrix (1, 4, 0.0)),
    m_fontangle ("fontangle", mh, "{normal}|italic"),
    m_fontname ("fontname", mh, OCTAVE_DEFAULT_FONTNAME),
    m_fontsize ("fontsize", mh, 10),
    m_fontunits ("fontunits", mh, "inches|centimeters|normalized|{points}|pixels"),
    m_fontweight ("fontweight", mh, "{normal}|bold"),
    m_foregroundcolor ("foregroundcolor", mh, color_values (0, 0, 0)),
    m_keypressfcn ("keypressfcn", mh, Matrix ()),
    m_keyreleasefcn ("keyreleasefcn", mh, Matrix ()),
    m_position ("position", mh, default_table_position ()),
    m_rearrangeablecolumns ("rearrangeablecolumns", mh, "off"),
    m_rowname ("rowname", mh, "numbered"),
    m_rowstriping ("rowstriping", mh, "on"),
    m_tooltipstring ("tooltipstring", mh, ""),
    m_units ("units", mh, "normalized|inches|centimeters|points|{pixels}|characters")
{
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  m_backgroundcolor.set_id (ID_BACKGROUNDCOLOR);
  m_celleditcallback.set_id (ID_CELLEDITCALLBACK);
  m_cellselectioncallback.set_id (ID_CELLSELECTIONCALLBACK);
  m_columneditable.set_id (ID_COLUMNEDITABLE);
  m_columnformat.set_id (ID_COLUMNFORMAT);
  m_columnname.set_id (ID_COLUMNNAME);
  m_columnwidth.set_id (ID_COLUMNWIDTH);
  m_data.set_id (ID_DATA);
  m_enable.set_id (ID_ENABLE);
  m_extent.set_id (ID_EXTENT);
  m_fontangle.set_id (ID_FONTANGLE);
  m_fontname.set_id (ID_FONTNAME);
  m_fontsize.set_id (ID_FONTSIZE);
  m_fontunits.set_id (ID_FONTUNITS);
  m_fontweight.set_id (ID_FONTWEIGHT);
  m_foregroundcolor.set_id (ID_FOREGROUNDCOLOR);
  m_keypressfcn.set_id (ID_KEYPRESSFCN);
  m_keyreleasefcn.set_id (ID_KEYRELEASEFCN);
  m_position.set_id (ID_POSITION);
  m_rearrangeablecolumns.set_id (ID_REARRANGEABLECOLUMNS);
  m_rowname.set_id (ID_ROWNAME);
  m_rowstriping.set_id (ID_ROWSTRIPING);
  m_tooltipstring.set_id (ID_TOOLTIPSTRING);
  m_units.set_id (ID_UNITS);
  init ();
}

void
uitable::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("__object__"))
    set___object__ (val);
  else if (pname.compare ("backgroundcolor"))
    set_backgroundcolor (val);
  else if (pname.compare ("celleditcallback"))
    set_celleditcallback (val);
  else if (pname.compare ("cellselectioncallback"))
    set_cellselectioncallback (val);
  else if (pname.compare ("columneditable"))
    set_columneditable (val);
  else if (pname.compare ("columnformat"))
    set_columnformat (val);
  else if (pname.compare ("columnname"))
    set_columnname (val);
  else if (pname.compare ("columnwidth"))
    set_columnwidth (val);
  else if (pname.compare ("data"))
    set_data (val);
  else if (pname.compare ("enable"))
    set_enable (val);
  else if (pname.compare ("fontangle"))
    set_fontangle (val);
  else if (pname.compare ("fontname"))
    set_fontname (val);
  else if (pname.compare ("fontsize"))
    set_fontsize (val);
  else if (pname.compare ("fontunits"))
    set_fontunits (val);
  else if (pname.compare ("fontweight"))
    set_fontweight (val);
  else if (pname.compare ("foregroundcolor"))
    set_foregroundcolor (val);
  else if (pname.compare ("keypressfcn"))
    set_keypressfcn (val);
  else if (pname.compare ("keyreleasefcn"))
    set_keyreleasefcn (val);
  else if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("rearrangeablecolumns"))
    set_rearrangeablecolumns (val);
  else if (pname.compare ("rowname"))
    set_rowname (val);
  else if (pname.compare ("rowstriping"))
    set_rowstriping (val);
  else if (pname.compare ("tooltipstring"))
    set_tooltipstring (val);
  else if (pname.compare ("units"))
    set_units (val);
  else
    base_properties::set (pname, val);
}

octave_value
uitable::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));
  m.assign ("backgroundcolor", octave_value (get_backgroundcolor ()));
  m.assign ("celleditcallback", octave_value (get_celleditcallback ()));
  m.assign ("cellselectioncallback", octave_value (get_cellselectioncallback ()));
  m.assign ("columneditable", octave_value (get_columneditable ()));
  m.assign ("columnformat", octave_value (get_columnformat ()));
  m.assign ("columnname", octave_value (get_columnname ()));
  m.assign ("columnwidth", octave_value (get_columnwidth ()));
  m.assign ("data", octave_value (get_data ()));
  m.assign ("enable", octave_value (get_enable ()));
  m.assign ("extent", octave_value (get_extent ()));
  m.assign ("fontangle", octave_value (get_fontangle ()));
  m.assign ("fontname", octave_value (get_fontname ()));
  m.assign ("fontsize", octave_value (get_fontsize ()));
  m.assign ("fontunits", octave_value (get_fontunits ()));
  m.assign ("fontweight", octave_value (get_fontweight ()));
  m.assign ("foregroundcolor", octave_value (get_foregroundcolor ()));
  m.assign ("keypressfcn", octave_value (get_keypressfcn ()));
  m.assign ("keyreleasefcn", octave_value (get_keyreleasefcn ()));
  m.assign ("position", octave_value (get_position ()));
  m.assign ("rearrangeablecolumns", octave_value (get_rearrangeablecolumns ()));
  m.assign ("rowname", octave_value (get_rowname ()));
  m.assign ("rowstriping", octave_value (get_rowstriping ()));
  m.assign ("tooltipstring", octave_value (get_tooltipstring ()));
  m.assign ("units", octave_value (get_units ()));

  return m;
}

octave_value
uitable::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("__object__"))
    retval = get___object__ ();
  else if (pname.compare ("backgroundcolor"))
    retval = get_backgroundcolor ();
  else if (pname.compare ("celleditcallback"))
    retval = get_celleditcallback ();
  else if (pname.compare ("cellselectioncallback"))
    retval = get_cellselectioncallback ();
  else if (pname.compare ("columneditable"))
    retval = get_columneditable ();
  else if (pname.compare ("columnformat"))
    retval = get_columnformat ();
  else if (pname.compare ("columnname"))
    retval = get_columnname ();
  else if (pname.compare ("columnwidth"))
    retval = get_columnwidth ();
  else if (pname.compare ("data"))
    retval = get_data ();
  else if (pname.compare ("enable"))
    retval = get_enable ();
  else if (pname.compare ("extent"))
    retval = get_extent ();
  else if (pname.compare ("fontangle"))
    retval = get_fontangle ();
  else if (pname.compare ("fontname"))
    retval = get_fontname ();
  else if (pname.compare ("fontsize"))
    retval = get_fontsize ();
  else if (pname.compare ("fontunits"))
    retval = get_fontunits ();
  else if (pname.compare ("fontweight"))
    retval = get_fontweight ();
  else if (pname.compare ("foregroundcolor"))
    retval = get_foregroundcolor ();
  else if (pname.compare ("keypressfcn"))
    retval = get_keypressfcn ();
  else if (pname.compare ("keyreleasefcn"))
    retval = get_keyreleasefcn ();
  else if (pname.compare ("position"))
    retval = get_position ();
  else if (pname.compare ("rearrangeablecolumns"))
    retval = get_rearrangeablecolumns ();
  else if (pname.compare ("rowname"))
    retval = get_rowname ();
  else if (pname.compare ("rowstriping"))
    retval = get_rowstriping ();
  else if (pname.compare ("tooltipstring"))
    retval = get_tooltipstring ();
  else if (pname.compare ("units"))
    retval = get_units ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uitable::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else if (pname.compare ("backgroundcolor"))
    return property (&m_backgroundcolor, true);
  else if (pname.compare ("celleditcallback"))
    return property (&m_celleditcallback, true);
  else if (pname.compare ("cellselectioncallback"))
    return property (&m_cellselectioncallback, true);
  else if (pname.compare ("columneditable"))
    return property (&m_columneditable, true);
  else if (pname.compare ("columnformat"))
    return property (&m_columnformat, true);
  else if (pname.compare ("columnname"))
    return property (&m_columnname, true);
  else if (pname.compare ("columnwidth"))
    return property (&m_columnwidth, true);
  else if (pname.compare ("data"))
    return property (&m_data, true);
  else if (pname.compare ("enable"))
    return property (&m_enable, true);
  else if (pname.compare ("extent"))
    return property (&m_extent, true);
  else if (pname.compare ("fontangle"))
    return property (&m_fontangle, true);
  else if (pname.compare ("fontname"))
    return property (&m_fontname, true);
  else if (pname.compare ("fontsize"))
    return property (&m_fontsize, true);
  else if (pname.compare ("fontunits"))
    return property (&m_fontunits, true);
  else if (pname.compare ("fontweight"))
    return property (&m_fontweight, true);
  else if (pname.compare ("foregroundcolor"))
    return property (&m_foregroundcolor, true);
  else if (pname.compare ("keypressfcn"))
    return property (&m_keypressfcn, true);
  else if (pname.compare ("keyreleasefcn"))
    return property (&m_keyreleasefcn, true);
  else if (pname.compare ("position"))
    return property (&m_position, true);
  else if (pname.compare ("rearrangeablecolumns"))
    return property (&m_rearrangeablecolumns, true);
  else if (pname.compare ("rowname"))
    return property (&m_rowname, true);
  else if (pname.compare ("rowstriping"))
    return property (&m_rowstriping, true);
  else if (pname.compare ("tooltipstring"))
    return property (&m_tooltipstring, true);
  else if (pname.compare ("units"))
    return property (&m_units, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uitable::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["__object__"] = Matrix ();
  m["backgroundcolor"] = default_table_backgroundcolor ();
  m["celleditcallback"] = Matrix ();
  m["cellselectioncallback"] = Matrix ();
  m["columneditable"] = Matrix ();
  m["columnformat"] = Cell ();
  m["columnname"] = "numbered";
  m["columnwidth"] = "auto";
  m["data"] = Matrix ();
  m["enable"] = "on";
  m["extent"] = Matrix (1, 4, 0.0);
  m["fontangle"] = "normal";
  m["fontname"] = OCTAVE_DEFAULT_FONTNAME;
  m["fontsize"] = 10;
  m["fontunits"] = "points";
  m["fontweight"] = "normal";
  m["foregroundcolor"] = color_values (0, 0, 0);
  m["keypressfcn"] = Matrix ();
  m["keyreleasefcn"] = Matrix ();
  m["position"] = default_table_position ();
  m["rearrangeablecolumns"] = "off";
  m["rowname"] = "numbered";
  m["rowstriping"] = "on";
  m["tooltipstring"] = "";
  m["units"] = "pixels";

  return m;
}

std::string uitable::properties::s_go_name ("uitable");

std::set<std::string>
uitable::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("__object__");
      all_pnames.insert ("backgroundcolor");
      all_pnames.insert ("celleditcallback");
      all_pnames.insert ("cellselectioncallback");
      all_pnames.insert ("columneditable");
      all_pnames.insert ("columnformat");
      all_pnames.insert ("columnname");
      all_pnames.insert ("columnwidth");
      all_pnames.insert ("data");
      all_pnames.insert ("enable");
      all_pnames.insert ("extent");
      all_pnames.insert ("fontangle");
      all_pnames.insert ("fontname");
      all_pnames.insert ("fontsize");
      all_pnames.insert ("fontunits");
      all_pnames.insert ("fontweight");
      all_pnames.insert ("foregroundcolor");
      all_pnames.insert ("keypressfcn");
      all_pnames.insert ("keyreleasefcn");
      all_pnames.insert ("position");
      all_pnames.insert ("rearrangeablecolumns");
      all_pnames.insert ("rowname");
      all_pnames.insert ("rowstriping");
      all_pnames.insert ("tooltipstring");
      all_pnames.insert ("units");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uitable::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uitable::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("extent");

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uitable::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uitable::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uitable::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uitoolbar ********

uitoolbar::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m___object__ ("__object__", mh, Matrix ())
{
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  init ();
}

void
uitoolbar::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("__object__"))
    set___object__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
uitoolbar::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));

  return m;
}

octave_value
uitoolbar::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("__object__"))
    retval = get___object__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uitoolbar::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uitoolbar::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["__object__"] = Matrix ();

  return m;
}

std::string uitoolbar::properties::s_go_name ("uitoolbar");

std::set<std::string>
uitoolbar::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("__object__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uitoolbar::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uitoolbar::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uitoolbar::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uitoolbar::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uitoolbar::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uipushtool ********

uipushtool::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_cdata ("cdata", mh, Matrix ()),
    m_clickedcallback ("clickedcallback", mh, Matrix ()),
    m_enable ("enable", mh, "on"),
    m_separator ("separator", mh, "off"),
    m_tooltipstring ("tooltipstring", mh, ""),
    m___named_icon__ ("__named_icon__", mh, ""),
    m___object__ ("__object__", mh, Matrix ())
{
  m_cdata.set_id (ID_CDATA);
  m_clickedcallback.set_id (ID_CLICKEDCALLBACK);
  m_enable.set_id (ID_ENABLE);
  m_separator.set_id (ID_SEPARATOR);
  m_tooltipstring.set_id (ID_TOOLTIPSTRING);
  m___named_icon__.set_id (ID___NAMED_ICON__);
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  init ();
}

void
uipushtool::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("cdata"))
    set_cdata (val);
  else if (pname.compare ("clickedcallback"))
    set_clickedcallback (val);
  else if (pname.compare ("enable"))
    set_enable (val);
  else if (pname.compare ("separator"))
    set_separator (val);
  else if (pname.compare ("tooltipstring"))
    set_tooltipstring (val);
  else if (pname.compare ("__named_icon__"))
    set___named_icon__ (val);
  else if (pname.compare ("__object__"))
    set___object__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
uipushtool::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("cdata", octave_value (get_cdata ()));
  m.assign ("clickedcallback", octave_value (get_clickedcallback ()));
  m.assign ("enable", octave_value (get_enable ()));
  m.assign ("separator", octave_value (get_separator ()));
  m.assign ("tooltipstring", octave_value (get_tooltipstring ()));
  m.assign ("__named_icon__", octave_value (get___named_icon__ ()));
  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));

  return m;
}

octave_value
uipushtool::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("cdata"))
    retval = get_cdata ();
  else if (pname.compare ("clickedcallback"))
    retval = get_clickedcallback ();
  else if (pname.compare ("enable"))
    retval = get_enable ();
  else if (pname.compare ("separator"))
    retval = get_separator ();
  else if (pname.compare ("tooltipstring"))
    retval = get_tooltipstring ();
  else if (pname.compare ("__named_icon__"))
    retval = get___named_icon__ ();
  else if (pname.compare ("__object__"))
    retval = get___object__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uipushtool::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("cdata"))
    return property (&m_cdata, true);
  else if (pname.compare ("clickedcallback"))
    return property (&m_clickedcallback, true);
  else if (pname.compare ("enable"))
    return property (&m_enable, true);
  else if (pname.compare ("separator"))
    return property (&m_separator, true);
  else if (pname.compare ("tooltipstring"))
    return property (&m_tooltipstring, true);
  else if (pname.compare ("__named_icon__"))
    return property (&m___named_icon__, true);
  else if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uipushtool::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["cdata"] = Matrix ();
  m["clickedcallback"] = Matrix ();
  m["enable"] = "on";
  m["separator"] = "off";
  m["tooltipstring"] = "";
  m["__named_icon__"] = "";
  m["__object__"] = Matrix ();

  return m;
}

std::string uipushtool::properties::s_go_name ("uipushtool");

std::set<std::string>
uipushtool::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("cdata");
      all_pnames.insert ("clickedcallback");
      all_pnames.insert ("enable");
      all_pnames.insert ("separator");
      all_pnames.insert ("tooltipstring");
      all_pnames.insert ("__named_icon__");
      all_pnames.insert ("__object__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uipushtool::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uipushtool::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uipushtool::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uipushtool::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uipushtool::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

// ******** uitoggletool ********

uitoggletool::properties::properties (const graphics_handle& mh, const graphics_handle& p)
  : base_properties (s_go_name, mh, p),
    m_cdata ("cdata", mh, Matrix ()),
    m_clickedcallback ("clickedcallback", mh, Matrix ()),
    m_enable ("enable", mh, "on"),
    m_offcallback ("offcallback", mh, Matrix ()),
    m_oncallback ("oncallback", mh, Matrix ()),
    m_separator ("separator", mh, "off"),
    m_state ("state", mh, "off"),
    m_tooltipstring ("tooltipstring", mh, ""),
    m___named_icon__ ("__named_icon__", mh, ""),
    m___object__ ("__object__", mh, Matrix ())
{
  m_cdata.set_id (ID_CDATA);
  m_clickedcallback.set_id (ID_CLICKEDCALLBACK);
  m_enable.set_id (ID_ENABLE);
  m_offcallback.set_id (ID_OFFCALLBACK);
  m_oncallback.set_id (ID_ONCALLBACK);
  m_separator.set_id (ID_SEPARATOR);
  m_state.set_id (ID_STATE);
  m_tooltipstring.set_id (ID_TOOLTIPSTRING);
  m___named_icon__.set_id (ID___NAMED_ICON__);
  m___object__.set_id (ID___OBJECT__);
  m___object__.set_hidden (true);
  init ();
}

void
uitoggletool::properties::set (const caseless_str& pname_arg, const octave_value& val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("set", s_go_name, pnames, pname_arg);

  if (has_readonly_property (pname))
    {
      error ("set: \"%s\" is read-only", pname.c_str ());
      return;
    }

  if (pname.compare ("cdata"))
    set_cdata (val);
  else if (pname.compare ("clickedcallback"))
    set_clickedcallback (val);
  else if (pname.compare ("enable"))
    set_enable (val);
  else if (pname.compare ("offcallback"))
    set_offcallback (val);
  else if (pname.compare ("oncallback"))
    set_oncallback (val);
  else if (pname.compare ("separator"))
    set_separator (val);
  else if (pname.compare ("state"))
    set_state (val);
  else if (pname.compare ("tooltipstring"))
    set_tooltipstring (val);
  else if (pname.compare ("__named_icon__"))
    set___named_icon__ (val);
  else if (pname.compare ("__object__"))
    set___object__ (val);
  else
    base_properties::set (pname, val);
}

octave_value
uitoggletool::properties::get (bool all) const
{
  octave_map m = base_properties::get (all).map_value ();

  m.assign ("cdata", octave_value (get_cdata ()));
  m.assign ("clickedcallback", octave_value (get_clickedcallback ()));
  m.assign ("enable", octave_value (get_enable ()));
  m.assign ("offcallback", octave_value (get_offcallback ()));
  m.assign ("oncallback", octave_value (get_oncallback ()));
  m.assign ("separator", octave_value (get_separator ()));
  m.assign ("state", octave_value (get_state ()));
  m.assign ("tooltipstring", octave_value (get_tooltipstring ()));
  m.assign ("__named_icon__", octave_value (get___named_icon__ ()));
  if (all)
    m.assign ("__object__", octave_value (get___object__ ()));

  return m;
}

octave_value
uitoggletool::properties::get (const caseless_str& pname_arg) const
{
  octave_value retval;

  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("cdata"))
    retval = get_cdata ();
  else if (pname.compare ("clickedcallback"))
    retval = get_clickedcallback ();
  else if (pname.compare ("enable"))
    retval = get_enable ();
  else if (pname.compare ("offcallback"))
    retval = get_offcallback ();
  else if (pname.compare ("oncallback"))
    retval = get_oncallback ();
  else if (pname.compare ("separator"))
    retval = get_separator ();
  else if (pname.compare ("state"))
    retval = get_state ();
  else if (pname.compare ("tooltipstring"))
    retval = get_tooltipstring ();
  else if (pname.compare ("__named_icon__"))
    retval = get___named_icon__ ();
  else if (pname.compare ("__object__"))
    retval = get___object__ ();
  else
    retval = base_properties::get (pname);

  return retval;
}

property
uitoggletool::properties::get_property (const caseless_str& pname_arg)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", s_go_name, pnames, pname_arg);

  if (pname.compare ("cdata"))
    return property (&m_cdata, true);
  else if (pname.compare ("clickedcallback"))
    return property (&m_clickedcallback, true);
  else if (pname.compare ("enable"))
    return property (&m_enable, true);
  else if (pname.compare ("offcallback"))
    return property (&m_offcallback, true);
  else if (pname.compare ("oncallback"))
    return property (&m_oncallback, true);
  else if (pname.compare ("separator"))
    return property (&m_separator, true);
  else if (pname.compare ("state"))
    return property (&m_state, true);
  else if (pname.compare ("tooltipstring"))
    return property (&m_tooltipstring, true);
  else if (pname.compare ("__named_icon__"))
    return property (&m___named_icon__, true);
  else if (pname.compare ("__object__"))
    return property (&m___object__, true);
  else
    return base_properties::get_property (pname);
}

property_list::pval_map_type
uitoggletool::properties::factory_defaults ()
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["cdata"] = Matrix ();
  m["clickedcallback"] = Matrix ();
  m["enable"] = "on";
  m["offcallback"] = Matrix ();
  m["oncallback"] = Matrix ();
  m["separator"] = "off";
  m["state"] = "off";
  m["tooltipstring"] = "";
  m["__named_icon__"] = "";
  m["__object__"] = Matrix ();

  return m;
}

std::string uitoggletool::properties::s_go_name ("uitoggletool");

std::set<std::string>
uitoggletool::properties::core_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {
      all_pnames.insert ("cdata");
      all_pnames.insert ("clickedcallback");
      all_pnames.insert ("enable");
      all_pnames.insert ("offcallback");
      all_pnames.insert ("oncallback");
      all_pnames.insert ("separator");
      all_pnames.insert ("state");
      all_pnames.insert ("tooltipstring");
      all_pnames.insert ("__named_icon__");
      all_pnames.insert ("__object__");

      std::set<std::string> base_pnames = base_properties::core_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uitoggletool::properties::has_core_property (const caseless_str& pname)
{
  std::set<std::string> pnames = core_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uitoggletool::properties::readonly_property_names ()
{
  static std::set<std::string> all_pnames;

  static bool initialized = false;

  if (! initialized)
    {

      std::set<std::string> base_pnames = base_properties::readonly_property_names ();
      all_pnames.insert (base_pnames.begin (), base_pnames.end ());

      initialized = true;
    }

  return all_pnames;
}

bool
uitoggletool::properties::has_readonly_property (const caseless_str& pname)
{
  std::set<std::string> pnames = readonly_property_names ();

  return pnames.find (pname) != pnames.end ();
}

std::set<std::string>
uitoggletool::properties::all_property_names () const
{
  static std::set<std::string> all_pnames = core_property_names ();

  std::set<std::string> retval = all_pnames;
  std::set<std::string> base_props = base_properties::all_property_names ();
  retval.insert (base_props.begin (), base_props.end ());

  return retval;
}

bool
uitoggletool::properties::has_property (const caseless_str& pname) const
{
  std::set<std::string> pnames = all_property_names ();

  return pnames.find (pname) != pnames.end ();
}

