]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/variant.h
adding measuring contexts, streamlining printing code
[wxWidgets.git] / include / wx / variant.h
index d5483080e8ae5409822fce5c5c6456d3e27ae9c3..ff6fc93a4311c943f91e3d574bc84812debaf10b 100644 (file)
@@ -20,6 +20,7 @@
 #include "wx/string.h"
 #include "wx/arrstr.h"
 #include "wx/list.h"
+#include "wx/cpp.h"
 
 #if wxUSE_DATETIME
     #include "wx/datetime.h"
@@ -316,21 +317,15 @@ private:
     DECLARE_DYNAMIC_CLASS(wxVariant)
 };
 
-/* Fake macro parameter value */
-#ifdef EMPTY_PARAMETER_VALUE
-    #undef EMPTY_PARAMETER_VALUE
-#endif
-#define EMPTY_PARAMETER_VALUE
-
 #define DECLARE_VARIANT_OBJECT(classname) \
-    DECLARE_VARIANT_OBJECT_EXPORTED(classname,EMPTY_PARAMETER_VALUE)
+    DECLARE_VARIANT_OBJECT_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE)
 
 #define DECLARE_VARIANT_OBJECT_EXPORTED(classname,expdecl) \
 expdecl classname& operator << ( classname &object, const wxVariant &variant ); \
 expdecl wxVariant& operator << ( wxVariant &variant, const classname &object );
 
 #define IMPLEMENT_VARIANT_OBJECT(classname) \
-    IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname,EMPTY_PARAMETER_VALUE)
+    IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE)
 
 #define IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,expdecl) \
 class classname##VariantData: public wxVariantData \
@@ -381,10 +376,10 @@ expdecl wxVariant& operator << ( wxVariant &variant, const classname &value )\
     return variant;\
 }
 
-// implements a wxVariantData-derived class using for the Eq() method the operator==
-// which must have been provided by "classname"
+// implements a wxVariantData-derived class using for the Eq() method the
+// operator== which must have been provided by "classname"
 #define IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname,expdecl) \
-IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,expdecl) \
+IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) \
 \
 bool classname##VariantData::Eq(wxVariantData& data) const \
 {\
@@ -397,9 +392,11 @@ bool classname##VariantData::Eq(wxVariantData& data) const \
 
 
 // implements a wxVariantData-derived class using for the Eq() method a shallow
-// comparison (through wxObject::IsRefTo function)
+// comparison (through wxObject::IsSameAs function)
+#define IMPLEMENT_VARIANT_OBJECT_SHALLOWCMP(classname) \
+    IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(classname, wxEMPTY_PARAMETER_VALUE)
 #define IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(classname,expdecl) \
-IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,expdecl) \
+IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) \
 \
 bool classname##VariantData::Eq(wxVariantData& data) const \
 {\
@@ -407,7 +404,7 @@ bool classname##VariantData::Eq(wxVariantData& data) const \
 \
     classname##VariantData & otherData = (classname##VariantData &) data;\
 \
-    return (otherData.m_value.IsRefTo(&m_value));\
+    return (otherData.m_value.IsSameAs(m_value));\
 }\