changeset 7366:2a2115742cb5

[project @ 2008-01-13 06:46:39 by jwe]
author jwe
date Sun, 13 Jan 2008 06:46:39 +0000
parents f5e801eee0d1
children 600808df131c
files src/ChangeLog src/graphics.cc src/graphics.h.in
diffstat 3 files changed, 251 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Jan 13 06:33:32 2008 +0000
+++ b/src/ChangeLog	Sun Jan 13 06:46:39 2008 +0000
@@ -1,3 +1,11 @@
+2007-12-13  Shai Ayal  <shaiay@users.sourceforge.net>
+
+	* graphics.h.in, graphics.cc (class base_properties): New
+	properties: busyaction, buttondownfcn, clipping, createfcn,
+	deletefcn, handlevisibility, hittest, interruptible, selected,
+	selectionhighlight, uicontextmenu, userdata, visible.
+	(class figure): Delete visible property.
+
 2008-01-13  Michael Goffioul <michael.goffioul@gmail.com>
 
 	* grahpics.h.in: Sprinkle with OCTINTERP_API as needed.
--- a/src/graphics.cc	Sun Jan 13 06:33:32 2008 +0000
+++ b/src/graphics.cc	Sun Jan 13 06:46:39 2008 +0000
@@ -829,6 +829,32 @@
     retval = get_parent ().as_octave_value ();
   else if (name.compare ("children"))
     retval = children;
+  else if (name.compare ("busyaction"))
+    retval = get_busyaction ();
+  else if (name.compare ("buttondownfcn"))
+    retval = get_buttondownfcn ();
+  else if (name.compare ("clipping"))
+    retval = get_clipping ();
+  else if (name.compare ("createfcn"))
+    retval = get_createfcn ();
+  else if (name.compare ("deletefcn"))
+    retval = get_deletefcn ();
+  else if (name.compare ("handlevisibility"))
+    retval = get_handlevisibility ();
+  else if (name.compare ("hittest"))
+    retval = get_hittest ();
+  else if (name.compare ("interruptible"))
+    retval = get_interruptible ();
+  else if (name.compare ("selected"))
+    retval = get_selected ();
+  else if (name.compare ("selectionhighlight"))
+    retval = get_selectionhighlight ();
+  else if (name.compare ("uicontextmenu"))
+    retval = get_uicontextmenu ();
+  else if (name.compare ("userdata"))
+    retval = get_userdata ();
+  else if (name.compare ("visible"))
+    retval = get_visible ();
   else
   {
     std::map<caseless_str, property>::const_iterator it = all_props.find (name);
@@ -856,6 +882,19 @@
   m.assign ("__modified__", is_modified ());
   m.assign ("parent", get_parent ().as_octave_value ());
   m.assign ("children", children);
+  m.assign ("busyaction", get_busyaction ());
+  m.assign ("buttondownfcn", get_buttondownfcn ());
+  m.assign ("clipping", get_clipping ());
+  m.assign ("createfcn", get_createfcn ());
+  m.assign ("deletefcn", get_deletefcn ());
+  m.assign ("handlevisibility", get_handlevisibility ());
+  m.assign ("hittest", get_hittest ());
+  m.assign ("interruptible", get_interruptible ());
+  m.assign ("selected", get_selected ());
+  m.assign ("selectionhighlight", get_selectionhighlight ());
+  m.assign ("uicontextmenu", get_uicontextmenu ());
+  m.assign ("userdata", get_userdata ());
+  m.assign ("visible", get_visible ());
 
   return m;
 }
@@ -871,6 +910,32 @@
     set_parent (val);
   else if (name.compare ("children"))
     maybe_set_children (children, val);
+  else if (name.compare ("busyaction"))
+    set_busyaction (val);
+  else if (name.compare ("buttondownfcn"))
+    set_buttondownfcn (val);
+  else if (name.compare ("clipping"))
+    set_clipping (val);
+  else if (name.compare ("createfcn"))
+    set_createfcn (val);
+  else if (name.compare ("deletefcn"))
+    set_deletefcn (val);
+  else if (name.compare ("handlevisibility"))
+    set_handlevisibility (val);
+  else if (name.compare ("hittest"))
+    set_hittest (val);
+  else if (name.compare ("interruptible"))
+    set_interruptible (val);
+  else if (name.compare ("selected"))
+    set_selected (val);
+  else if (name.compare ("selectionhighlight"))
+    set_selectionhighlight (val);
+  else if (name.compare ("uicontextmenu"))
+    set_uicontextmenu (val);
+  else if (name.compare ("userdata"))
+    set_userdata (val);
+  else if (name.compare ("visible"))
+    set_visible (val);
   else
   {
     std::map<caseless_str, property>::iterator it = all_props.find (name);
--- a/src/graphics.h.in	Sun Jan 13 06:33:32 2008 +0000
+++ b/src/graphics.h.in	Sun Jan 13 06:46:39 2008 +0000
@@ -964,7 +964,21 @@
       type ("type", mh, ty),
       __modified__ ("__modified__", mh, true),
       __myhandle__ (mh),
-      parent ("parent", mh, p), children ()
+      parent ("parent", mh, p), 
+      children (),
+      busyaction ("parent", mh, "{queue}|cancel"),
+      buttondownfcn ("buttondownfcn", mh, octave_value ()),
+      clipping ("clipping", mh, true),
+      createfcn ("createfcn" , mh, octave_value ()),
+      deletefcn ("deletefcn", mh, octave_value ()),
+      handlevisibility ("handlevisibility", mh, "{on}|callback|off"),
+      hittest ("hittest", mh, true),
+      interruptible ("interruptible", mh, true),
+      selected ("selected", mh, false),
+      selectionhighlight ("selectionhighlight", mh, true),
+      uicontextmenu ("uicontextmenu", mh, graphics_handle ()),
+      userdata ("userdata", mh, octave_value ()),
+      visible ("visible", mh, true)
     { }
 
   virtual ~base_properties (void) { }
@@ -1004,7 +1018,33 @@
   bool is_modified (void) const { return __modified__.is_on (); }
  
   graphics_handle get___myhandle__ (void) const { return __myhandle__; }
- 
+  
+  std::string get_busyaction (void) const { return busyaction.current_value (); }
+
+  octave_value get_buttondownfcn (void) const { return buttondownfcn.get (); }
+
+  std::string get_clipping (void) const { return clipping.current_value (); }
+
+  octave_value get_createfcn (void) const { return createfcn.get (); }
+
+  octave_value get_deletefcn (void) const { return deletefcn.get (); }
+
+  std::string get_handlevisibility (void) const { return handlevisibility.current_value (); }
+
+  std::string get_hittest (void) const { return hittest.current_value (); }
+
+  std::string get_interruptible (void) const { return interruptible.current_value (); }
+
+  std::string get_selected (void) const { return selected.current_value (); }
+
+  std::string get_selectionhighlight (void) const { return selectionhighlight.current_value (); }
+  
+  octave_value get_uicontextmenu (void) const { return uicontextmenu.get (); }
+
+  octave_value get_userdata (void) const { return userdata.get (); }
+  
+  std::string get_visible (void) const { return visible.current_value (); }
+
   void remove_child (const graphics_handle& h);
 
   void adopt (const graphics_handle& h)
@@ -1018,6 +1058,125 @@
 
   void set_parent (const octave_value& val);
 
+  void set_busyaction (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        busyaction = val;
+        mark_modified ();
+      }
+  }
+
+  void set_buttondownfcn (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        buttondownfcn = val;
+        mark_modified ();
+      }
+  }
+
+  void set_clipping (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        clipping = val;
+        mark_modified ();
+      }
+  }
+
+  void set_createfcn (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        createfcn = val;
+        mark_modified ();
+      }
+  }
+
+  void set_deletefcn (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        deletefcn = val;
+        mark_modified ();
+      }
+  }
+
+  void set_handlevisibility (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        handlevisibility = val;
+        mark_modified ();
+      }
+  }
+
+  void set_hittest (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        hittest = val;
+        mark_modified ();
+      }
+  }
+
+  void set_interruptible (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        interruptible = val;
+        mark_modified ();
+      }
+  }
+
+  void set_selected (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        selected = val;
+        mark_modified ();
+      }
+  }
+
+  void set_selectionhighlight (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        selectionhighlight = val;
+        mark_modified ();
+      }
+  }
+
+  void set_uicontextmenu (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        uicontextmenu = val;
+        mark_modified ();
+      }
+  }
+
+  void set_userdata (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        userdata = val;
+        mark_modified ();
+      }
+  }
+
+  virtual void set_visible (const octave_value& val)
+  {
+    if (! error_state)
+      {
+        visible = val;
+        mark_modified ();
+      }
+  }
+
+
+
   void reparent (const graphics_handle& new_parent) { parent = new_parent; }
 
   // Update data limits for AXIS_TYPE (xdata, ydata, etc.) in the parent
@@ -1089,6 +1248,19 @@
   handle_property parent;
   // FIXME: use a property class for children
   Matrix children;
+  radio_property busyaction;
+  callback_property buttondownfcn;
+  bool_property clipping;
+  callback_property createfcn;
+  callback_property deletefcn;
+  radio_property handlevisibility;
+  bool_property hittest;
+  bool_property interruptible;
+  bool_property selected;
+  bool_property selectionhighlight;
+  handle_property uicontextmenu;
+  any_property userdata;
+  bool_property visible;
 
 protected:
   std::map<caseless_str, property> all_props;
@@ -1399,7 +1571,6 @@
 
     BEGIN_PROPERTIES(root_figure)
       handle_property currentfigure S , graphics_handle ()
-      bool_property visible , "on"
     END_PROPERTIES
   };
 
@@ -1527,6 +1698,7 @@
   {
   public:
     void close (void);
+    void set_visible (const octave_value& val);
 
     // See the genprops.awk script for an explanation of the
     // properties declarations.
@@ -1538,7 +1710,6 @@
       callback_property closerequestfcn , "closereq"
       handle_property currentaxes S , graphics_handle ()
       array_property colormap , jet_colormap ()
-      bool_property visible S , "on"
       radio_property paperorientation , "{portrait}|landscape"
       color_property color , color_values (1, 1, 1)
     END_PROPERTIES
@@ -1715,7 +1886,6 @@
       radio_property yaxislocation , "{left}|right|zero"
       radio_property xaxislocation , "{bottom}|top|zero"
       array_property view , Matrix ()
-      bool_property visible , "on"
       radio_property nextplot , "add|replace_children|{replace}"
       array_property outerposition , Matrix ()
       radio_property activepositionproperty a , "{outerposition}|position"
@@ -1853,6 +2023,9 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
+    // properties which are not in matlab:
+    // ldata, udata, xldata, xudata, keylabel, interpreter
+
     BEGIN_PROPERTIES(line)
       data_property xdata l , default_data ()
       data_property ydata l , default_data ()