\begin{verbatim}
IMPLEMENT_VARIANT_OBJECT(wxColour)
-IMPLEMENT_VARIANT_OBJECT(wxPen)
-IMPLEMENT_VARIANT_OBJECT(wxBrush)
IMPLEMENT_VARIANT_OBJECT(wxImage)
IMPLEMENT_VARIANT_OBJECT(wxIcon)
IMPLEMENT_VARIANT_OBJECT(wxBitmap)
class WXDLLEXPORT wxMask;
class WXDLLEXPORT wxPalette;
+// ----------------------------------------------------------------------------
+// wxVariant support
+// ----------------------------------------------------------------------------
+
+#if wxUSE_VARIANT
+#include "wx/variant.h"
+DECLARE_VARIANT_OBJECT_EXPORTED(wxBitmap,WXDLLEXPORT)
+#endif
+
// ----------------------------------------------------------------------------
// wxMask represents the transparent area of the bitmap
// ----------------------------------------------------------------------------
#include "wx/gdiobj.h"
+class WXDLLEXPORT wxColour;
+
// the standard wxColour constructors;
// this macro avoids to repeat these lines across all colour.h files, since
// Set() is a virtual function and thus cannot be called by wxColourBase
#define wxC2S_HTML_SYNTAX 4 // return colour in #rrggbb syntax
-class WXDLLEXPORT wxColour;
-
const unsigned char wxALPHA_TRANSPARENT = 0;
const unsigned char wxALPHA_OPAQUE = 0xff;
+// ----------------------------------------------------------------------------
+// wxVariant support
+// ----------------------------------------------------------------------------
+
+#if wxUSE_VARIANT
+#include "wx/variant.h"
+DECLARE_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLEXPORT)
+#endif
+
//-----------------------------------------------------------------------------
// wxColourBase: this class has no data members, just some functions to avoid
// code redundancy in all native wxColour implementations
#include "wx/os2/icon.h"
#endif
+//-----------------------------------------------------------------------------
+// wxVariant support
+//-----------------------------------------------------------------------------
+
+#if wxUSE_VARIANT
+#include "wx/variant.h"
+DECLARE_VARIANT_OBJECT_EXPORTED(wxIcon,WXDLLEXPORT)
+#endif
+
+
#endif
// _WX_ICON_H_BASE_
class WXDLLEXPORT wxImage;
class WXDLLEXPORT wxPalette;
+//-----------------------------------------------------------------------------
+// wxVariant support
+//-----------------------------------------------------------------------------
+
+#if wxUSE_VARIANT
+#include "wx/variant.h"
+DECLARE_VARIANT_OBJECT_EXPORTED(wxImage,WXDLLEXPORT)
+#endif
+
//-----------------------------------------------------------------------------
// wxImageHandler
//-----------------------------------------------------------------------------
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) \
-classname& operator << ( classname &object, const wxVariant &variant ); \
-wxVariant& operator << ( wxVariant &variant, const classname &object );
+ DECLARE_VARIANT_OBJECT_EXPORTED(classname,EMPTY_PARAMETER_VALUE)
+
+#define DECLARE_VARIANT_OBJECT_EXPORTED(classname,expdecl) \
+classname& expdecl operator << ( classname &object, const wxVariant &variant ); \
+wxVariant& expdecl operator << ( wxVariant &variant, const classname &object );
#define IMPLEMENT_VARIANT_OBJECT(classname) \
+ IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname,EMPTY_PARAMETER_VALUE)
+
+#define IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname,expdecl) \
class classname##VariantData: public wxVariantData \
{ \
public:\
return m_value.GetClassInfo();\
}\
\
-classname& operator << ( classname &value, const wxVariant &variant )\
+classname& expdecl operator << ( classname &value, const wxVariant &variant )\
{\
wxASSERT( wxIsKindOf( variant.GetData(), classname##VariantData ) );\
\
return value;\
}\
\
-wxVariant& operator << ( wxVariant &variant, const classname &value )\
+wxVariant& expdecl operator << ( wxVariant &variant, const classname &value )\
{\
classname##VariantData *data = new classname##VariantData( value );\
variant.SetData( data );\
return variant;\
}
-#include "wx/colour.h"
-#include "wx/pen.h"
-#include "wx/brush.h"
-#include "wx/image.h"
-#include "wx/icon.h"
-#include "wx/bitmap.h"
-
-DECLARE_VARIANT_OBJECT(wxColour)
-DECLARE_VARIANT_OBJECT(wxPen)
-DECLARE_VARIANT_OBJECT(wxBrush)
-DECLARE_VARIANT_OBJECT(wxImage)
-DECLARE_VARIANT_OBJECT(wxIcon)
-DECLARE_VARIANT_OBJECT(wxBitmap)
-
// Since we want type safety wxVariant we need to fetch and dynamic_cast
// in a seemingly safe way so the compiler can check, so we define
// a dynamic_cast /wxDynamicCast analogue.
#include "wx/module.h"
#endif // WX_PRECOMP
+
+#if wxUSE_VARIANT
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxBitmap,WXDLLEXPORT)
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxIcon,WXDLLEXPORT)
+#endif
+
+
IMPLEMENT_ABSTRACT_CLASS(wxBitmapBase, wxGDIObject)
IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandlerBase,wxObject)
#include "wx/gdicmn.h"
#endif
+#if wxUSE_VARIANT
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLEXPORT)
+#endif
// ============================================================================
// wxString <-> wxColour conversions
#endif // wxUSE_FILE/wxUSE_FFILE
#endif // HAS_FILE_STREAMS
+#if wxUSE_VARIANT
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxImage,WXDLLEXPORT)
+#endif
+
//-----------------------------------------------------------------------------
// wxImage
//-----------------------------------------------------------------------------
}
#endif // wxUSE_DATETIME
-IMPLEMENT_VARIANT_OBJECT(wxColour)
-IMPLEMENT_VARIANT_OBJECT(wxPen)
-IMPLEMENT_VARIANT_OBJECT(wxBrush)
-IMPLEMENT_VARIANT_OBJECT(wxImage)
-IMPLEMENT_VARIANT_OBJECT(wxIcon)
-IMPLEMENT_VARIANT_OBJECT(wxBitmap)
-
#endif // wxUSE_VARIANT