# HG changeset patch
# User Remi Thebault <remi.thebault@gmail.com>
# Date 1605904272 -3600
#      Fri Nov 20 21:31:12 2020 +0100
# Node ID 7506cc2a6da3fd9c36e2f8715bf951698b142d3a
# Parent  04d2ffd19c0de90dc93f32659a3ec14aab441360
fix build on Windows

property_type defined symbols such as HANDLE, BOOL or
CALLBACK, which have special meaning on Windows.
property_type is  now switched to a plain C enum, with
identifiers prefixed by "PROP_"

diff -r 04d2ffd19c0d -r 7506cc2a6da3 libgui/src/property-inspector-table.cc
--- a/libgui/src/property-inspector-table.cc	Tue Nov 17 21:21:07 2020 +0100
+++ b/libgui/src/property-inspector-table.cc	Fri Nov 20 21:31:12 2020 +0100
@@ -97,7 +97,7 @@ namespace octave
 
   static bool specific_matrix_item (const base_property *prop)
   {
-    if (prop->prop_type () == property_type::COLOR)
+    if (prop->prop_type () == PROP_COLOR)
       {
         // color have matrix values but deserve special treatment
         return false;
@@ -164,7 +164,7 @@ namespace octave
     // the octave_value
     switch (prop->prop_type ())
       {
-      case property_type::HANDLE:
+      case PROP_HANDLE:
         {
           const auto *p = static_cast<const handle_property *> (prop);
           auto gh = p->handle_value ();
@@ -179,7 +179,7 @@ namespace octave
               .arg (QString::number (gh.value ()),
                     QString::fromStdString (obj.type ()));
         }
-      case property_type::CALLBACK:
+      case PROP_CALLBACK:
         {
           auto val = prop->get ();
           if (!val.is_defined () || val.isempty ())
@@ -235,34 +235,34 @@ namespace octave
 
     switch (prop->prop_type ())
       {
-      case property_type::INVALID:
+      case PROP_INVALID:
         return "invalid";
-      case property_type::ROW_VECTOR:
-      case property_type::ARRAY:
+      case PROP_ROW_VECTOR:
+      case PROP_ARRAY:
         return QString ("%1 matrix").arg (dims_string (prop->get ().dims ()));
-      case property_type::BOOL:
+      case PROP_BOOL:
         return "boolean";
-      case property_type::CALLBACK:
+      case PROP_CALLBACK:
         return "callback";
-      case property_type::CHILDREN:
+      case PROP_CHILDREN:
         return "children";
-      case property_type::COLOR:
+      case PROP_COLOR:
         return "color";
-      case property_type::DOUBLE:
+      case PROP_DOUBLE:
         return "double";
-      case property_type::DOUBLE_RADIO:
+      case PROP_DOUBLE_RADIO:
         return "double radio";
-      case property_type::HANDLE:
+      case PROP_HANDLE:
         return "handle";
-      case property_type::RADIO:
+      case PROP_RADIO:
         return "radio";
-      case property_type::STRING:
+      case PROP_STRING:
         return "string";
-      case property_type::STRING_ARRAY:
+      case PROP_STRING_ARRAY:
         return "string array";
-      case property_type::TEXT_LABEL:
+      case PROP_TEXT_LABEL:
         return "text label";
-      case property_type::ANY:
+      case PROP_ANY:
         return "any";
       }
     return "";
@@ -277,19 +277,19 @@ namespace octave
 
     switch (prop->prop_type ())
       {
-      case property_type::INVALID:
-      case property_type::STRING_ARRAY:
-      case property_type::DOUBLE_RADIO:
-      case property_type::CHILDREN:
-      case property_type::HANDLE:
-      case property_type::CALLBACK:
-      case property_type::ANY:
+      case PROP_INVALID:
+      case PROP_STRING_ARRAY:
+      case PROP_DOUBLE_RADIO:
+      case PROP_CHILDREN:
+      case PROP_HANDLE:
+      case PROP_CALLBACK:
+      case PROP_ANY:
         return false;
       default:
         break;
       }
 
-    if (prop->prop_type () == property_type::COLOR)
+    if (prop->prop_type () == PROP_COLOR)
       return true;
 
     return prop->is_radio () || value.is_string () || value.is_real_scalar ()
@@ -597,7 +597,7 @@ namespace octave
         const auto *prop
             = static_cast<base_property *> (index.internalPointer ());
 
-        if (prop->prop_type () == property_type::COLOR)
+        if (prop->prop_type () == PROP_COLOR)
           {
             const auto *cp = static_cast<const color_property *> (prop);
             if (cp->is_rgb ())
@@ -666,7 +666,7 @@ namespace octave
         const auto *prop
             = static_cast<base_property *> (index.internalPointer ());
 
-        if (prop->prop_type () == property_type::COLOR)
+        if (prop->prop_type () == PROP_COLOR)
           {
             const auto *cp = static_cast<const color_property *> (prop);
             if (cp->is_rgb ())
@@ -719,7 +719,7 @@ namespace octave
         const auto *prop
             = static_cast<base_property *> (index.internalPointer ());
 
-        if (prop->prop_type () == property_type::COLOR)
+        if (prop->prop_type () == PROP_COLOR)
           {
             // Color editor is quite big. it need to fit in at least three rows
 
diff -r 04d2ffd19c0d -r 7506cc2a6da3 libinterp/corefcn/graphics.in.h
--- a/libinterp/corefcn/graphics.in.h	Tue Nov 17 21:21:07 2020 +0100
+++ b/libinterp/corefcn/graphics.in.h	Fri Nov 20 21:31:12 2020 +0100
@@ -60,23 +60,23 @@
 
 // ---------------------------------------------------------------------
 
-enum class property_type
+enum property_type
 {
-  INVALID,
-  ARRAY,
-  BOOL,
-  CALLBACK,
-  CHILDREN,
-  COLOR,
-  DOUBLE,
-  DOUBLE_RADIO,
-  HANDLE,
-  RADIO,
-  ROW_VECTOR,
-  STRING,
-  STRING_ARRAY,
-  TEXT_LABEL,
-  ANY,
+  PROP_INVALID,
+  PROP_ARRAY,
+  PROP_BOOL,
+  PROP_CALLBACK,
+  PROP_CHILDREN,
+  PROP_COLOR,
+  PROP_DOUBLE,
+  PROP_DOUBLE_RADIO,
+  PROP_HANDLE,
+  PROP_RADIO,
+  PROP_ROW_VECTOR,
+  PROP_STRING,
+  PROP_STRING_ARRAY,
+  PROP_TEXT_LABEL,
+  PROP_ANY,
 };
 
 class base_scaler
@@ -333,7 +333,7 @@ public:
 
   virtual bool is_radio (void) const { return false; }
 
-  virtual property_type prop_type () const { return property_type::INVALID; }
+  virtual property_type prop_type () const { return PROP_INVALID; }
 
   int get_id (void) const { return id; }
 
@@ -463,7 +463,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::STRING;
+    return PROP_STRING;
   }
 
   octave_value get (void) const
@@ -553,7 +553,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::STRING_ARRAY;
+    return PROP_STRING_ARRAY;
   }
 
   octave_value get (void) const
@@ -770,7 +770,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::TEXT_LABEL;
+    return PROP_TEXT_LABEL;
   }
 
   octave_value get (void) const
@@ -979,7 +979,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::RADIO;
+    return PROP_RADIO;
   }
 
   octave_value get (void) const { return octave_value (current_val); }
@@ -1150,7 +1150,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::COLOR;
+    return PROP_COLOR;
   }
 
   octave_value get (void) const
@@ -1236,7 +1236,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::DOUBLE;
+    return PROP_DOUBLE;
   }
 
   octave_value get (void) const { return octave_value (current_val); }
@@ -1365,7 +1365,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::DOUBLE_RADIO;
+    return PROP_DOUBLE_RADIO;
   }
 
   octave_value get (void) const
@@ -1459,7 +1459,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::ARRAY;
+    return PROP_ARRAY;
   }
 
   octave_value get (void) const { return data; }
@@ -1580,7 +1580,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::ROW_VECTOR;
+    return PROP_ROW_VECTOR;
   }
 
   void add_constraint (const std::string& type)
@@ -1676,7 +1676,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::BOOL;
+    return PROP_BOOL;
   }
 
   bool is_on (void) const { return is ("on"); }
@@ -1714,7 +1714,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::HANDLE;
+    return PROP_HANDLE;
   }
 
   octave_value get (void) const { return current_val.as_octave_value (); }
@@ -1769,7 +1769,7 @@ public:
     return *this;
   }
 
-  virtual property_type prop_type () const override { return property_type::ANY; }
+  virtual property_type prop_type () const override { return PROP_ANY; }
 
   base_property * clone (void) const { return new any_property (*this); }
 
@@ -1810,7 +1810,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::CHILDREN;
+    return PROP_CHILDREN;
   }
 
   children_property& operator = (const octave_value& val)
@@ -1994,7 +1994,7 @@ public:
 
   virtual property_type prop_type () const override
   {
-    return property_type::CALLBACK;
+    return PROP_CALLBACK;
   }
 
   octave_value get (void) const { return callback; }
# HG changeset patch
# User Remi Thebault <remi.thebault@gmail.com>
# Date 1605904802 -3600
#      Fri Nov 20 21:40:02 2020 +0100
# Node ID 872e727a8cbba328da0d167ebdd43943e1bf647f
# Parent  7506cc2a6da3fd9c36e2f8715bf951698b142d3a
remove dead code

diff -r 7506cc2a6da3 -r 872e727a8cbb libinterp/corefcn/graphics.in.h
--- a/libinterp/corefcn/graphics.in.h	Fri Nov 20 21:31:12 2020 +0100
+++ b/libinterp/corefcn/graphics.in.h	Fri Nov 20 21:40:02 2020 +0100
@@ -6994,21 +6994,4 @@ OCTINTERP_API graphics_handle gca (void)
 
 OCTINTERP_API void close_all_figures (void);
 
-// property introspection system
-
-struct graphics_property_info
-{
-  std::string name;
-  int id;
-  property_type type;
-};
-
-struct graphics_handle_type_info
-{
-  std::string type;
-  std::vector<graphics_property_info> static_prop_info;
-};
-
-
-
 #endif
