]> git.saurik.com Git - wxWidgets.git/commitdiff
Move wxVariant support for GDI classes to their
authorRobert Roebling <robert@roebling.de>
Sat, 30 Sep 2006 20:45:15 +0000 (20:45 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 30 Sep 2006 20:45:15 +0000 (20:45 +0000)
    files (and thus away from wxBase).
  Add export declaration field for variant macros.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/variant.tex
include/wx/bitmap.h
include/wx/colour.h
include/wx/icon.h
include/wx/image.h
include/wx/variant.h
src/common/bmpbase.cpp
src/common/colourcmn.cpp
src/common/image.cpp
src/common/variant.cpp

index 11c574c389b7c274dc9a7888d7faf01a0fb99897..8205ca19bd07224a13f969c1293cae9cc6df7df5 100644 (file)
@@ -67,8 +67,6 @@ the shift operator conversion for a few of its drawing related classes:
 
 \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)
index e2431b9e5380902531e641625127620cf483f3a3..b12e30dbeaee1aedd3bdbd6d80cbb27084cbce4b 100644 (file)
@@ -30,6 +30,15 @@ class WXDLLEXPORT wxImage;
 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
 // ----------------------------------------------------------------------------
index 7bba397dc2abed2fd67be9c3f514a5a728ce91cd..18101e11de5a21e09afba84d85629383c7f7d8f2 100644 (file)
@@ -16,6 +16,8 @@
 #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
index 34993fdb40db8b8372eaccd76af814dd79a83dae..f4f92e7451ecac755c3db0cabed0c238eaeb0c1f 100644 (file)
   #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_
index 3e3e8d46f59033a9955691771a2af6db7d3e32ce..8718380516efeaf0f426c0d7729556ee59a928b2 100644 (file)
@@ -65,6 +65,15 @@ class WXDLLEXPORT wxImageHandler;
 class WXDLLEXPORT wxImage;
 class WXDLLEXPORT wxPalette;
 
+//-----------------------------------------------------------------------------
+// wxVariant support
+//-----------------------------------------------------------------------------
+
+#if wxUSE_VARIANT
+#include "wx/variant.h"
+DECLARE_VARIANT_OBJECT_EXPORTED(wxImage,WXDLLEXPORT)
+#endif
+
 //-----------------------------------------------------------------------------
 // wxImageHandler
 //-----------------------------------------------------------------------------
index 8f3648547404faed3d187d39d4ff37915b32bcca..43edc77ccb3ba9d14780f596e0550b919148a87c 100644 (file)
@@ -316,12 +316,23 @@ 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) \
-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:\
@@ -363,7 +374,7 @@ wxClassInfo* classname##VariantData::GetValueClassInfo()\
     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 ) );\
     \
@@ -372,27 +383,13 @@ classname& operator << ( classname &value, const wxVariant &variant )\
     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.
index d8c879f146f6570bb0ace6ca2418498b8561373f..17324c3760a3fa974a8bdda9227537468c0d981f 100644 (file)
     #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)
 
index a20851c7674cccca3c355a3acb2e14772204464f..a77017922fdc686a894c852fe1169226d0649df3 100644 (file)
@@ -25,6 +25,9 @@
     #include "wx/gdicmn.h"
 #endif
 
+#if wxUSE_VARIANT
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLEXPORT)
+#endif
 
 // ============================================================================
 // wxString <-> wxColour conversions
index 652d2c905d87270990376b23a932c7a07c556a44..8e656989899a1d1ebee326d4aadeb8b18c5d90b3 100644 (file)
     #endif // wxUSE_FILE/wxUSE_FFILE
 #endif // HAS_FILE_STREAMS
 
+#if wxUSE_VARIANT
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxImage,WXDLLEXPORT)
+#endif
+
 //-----------------------------------------------------------------------------
 // wxImage
 //-----------------------------------------------------------------------------
index 308965606bff483cbedbf0c6a9918951961bf84e..b2cca822ace0c41a69e20c6e17952d4b64c0d9e2 100644 (file)
@@ -2026,11 +2026,4 @@ bool wxVariant::Convert(wxDateTime* value) const
 }
 #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