]> git.saurik.com Git - wxWidgets.git/commitdiff
implement out-of-line destructors where needed instead of using __DARWIN__
authorGilles Depeyrot <gilles_depeyrot@mac.com>
Mon, 7 Jan 2002 21:52:28 +0000 (21:52 +0000)
committerGilles Depeyrot <gilles_depeyrot@mac.com>
Mon, 7 Jan 2002 21:52:28 +0000 (21:52 +0000)
specific conditional compilation

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

28 files changed:
include/wx/app.h
include/wx/choice.h
include/wx/control.h
include/wx/ctrlsub.h
include/wx/font.h
include/wx/frame.h
include/wx/gauge.h
include/wx/geometry.h
include/wx/list.h
include/wx/listbox.h
include/wx/popupwin.h
include/wx/statbmp.h
include/wx/timer.h
include/wx/toplevel.h
src/common/appcmn.cpp
src/common/bmpbase.cpp
src/common/choiccmn.cpp
src/common/ctrlcmn.cpp
src/common/ctrlsub.cpp
src/common/fontcmn.cpp
src/common/framecmn.cpp
src/common/gaugecmn.cpp
src/common/gdicmn.cpp
src/common/lboxcmn.cpp
src/common/popupcmn.cpp
src/common/sizer.cpp
src/common/timercmn.cpp
src/common/toplvcmn.cpp

index 4e562c5968d153e35f84fc1a6e4262b78fd0ef9c..9c76ed5d7eef66a32e6972b9eefe7b3aa8ce4176 100644 (file)
@@ -88,6 +88,7 @@ class WXDLLEXPORT wxAppBase : public wxEvtHandler
 {
 public:
     wxAppBase();
+    virtual ~wxAppBase();
 
     // the virtual functions which may/must be overridden in the derived class
     // -----------------------------------------------------------------------
@@ -326,11 +327,6 @@ public:
     static wxAppInitializerFunction GetInitializerFunction()
         { return m_appInitFn; }
 
-    // needed to avoid link errors
-#ifdef __DARWIN__
-    virtual ~wxAppBase() { }
-#endif
-
     // process all events in the wxPendingEvents list
     virtual void ProcessPendingEvents();
 
index 6110e4b35b60588ff6782103313c22d504a476b7..6664996a0b9f94d20f887ab4f3b07ac749f45803 100644 (file)
@@ -38,9 +38,7 @@ class WXDLLEXPORT wxChoiceBase : public wxControlWithItems
 {
 public:
     // all generic methods are in wxControlWithItems
-#ifdef __DARWIN__
-    virtual ~wxChoiceBase() {}
-#endif
+    virtual ~wxChoiceBase();
 
     // single selection logic
     virtual void SetSelection(int n) = 0;
@@ -56,7 +54,6 @@ public:
 
     // emulate selecting the item event.GetInt()
     void Command(wxCommandEvent& event);
-
 };
 
 // ----------------------------------------------------------------------------
index 549f98d1837422a2983379ec46088af954da60fe..24338b06b5dddc42ee2f220c32aa879b14bbd772 100644 (file)
@@ -33,6 +33,8 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr;
 class WXDLLEXPORT wxControlBase : public wxWindow
 {
 public:
+    virtual ~wxControlBase();
+
     // Create() function adds the validator parameter
     bool Create(wxWindow *parent, wxWindowID id,
                 const wxPoint& pos = wxDefaultPosition,
@@ -48,10 +50,6 @@ public:
     // get the control alignment (left/right/centre, top/bottom/centre)
     int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; }
 
-#ifdef __DARWIN__
-    virtual ~wxControlBase() { }
-#endif
-
 protected:
     // creates the control (calls wxWindowBase::CreateBase inside) and adds it
     // to the list of parents children
index 0fa00d4e64e7483906165a72020e70ce7b898a94..ac07defc279e08bc0280c65ad51e578949dc1c44 100644 (file)
@@ -32,6 +32,7 @@ class WXDLLEXPORT wxItemContainer
 {
 public:
     wxItemContainer() { m_clientDataItemsType = wxClientData_None; }
+    virtual ~wxItemContainer();
 
     // adding items
     // ------------
@@ -86,10 +87,6 @@ public:
     int Number() const { return GetCount(); }
 #endif // WXWIN_COMPATIBILITY_2_2
 
-#ifdef __DARWIN__
-    virtual ~wxItemContainer() { }
-#endif
-
 protected:
     virtual int DoAppend(const wxString& item) = 0;
 
index f324d115c9402b8ebb7970ebaf6fff31e41f2fc9..7eac1f1dc5815925ae2644e0caf1d2fb1a2e1636 100644 (file)
@@ -78,9 +78,7 @@ class WXDLLEXPORT wxFontBase : public wxGDIObject
 {
 public:
     // creator function
-#ifdef __DARWIN__
-    virtual ~wxFontBase() { }
-#endif
+    virtual ~wxFontBase();
 
     // from the font components
     static wxFont *New(
index 2fa2d92fece63024eb54cef43dec2fe361b80238..ac7e48f61c5036e0cadbd20df82c25fb197dfa87 100644 (file)
@@ -54,9 +54,7 @@ class WXDLLEXPORT wxFrameBase : public wxTopLevelWindow
 public:
     // construction
     wxFrameBase();
-#ifdef __DARWIN__
-    virtual ~wxFrameBase() { }
-#endif
+    virtual ~wxFrameBase();
 
     wxFrame *New(wxWindow *parent,
                  wxWindowID id,
index 801dab194354263a08351171f8c2b0cd5a61efe4..5f2634a6063adbb0573d205c00eeeca07a96460e 100644 (file)
@@ -31,9 +31,8 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
 class WXDLLEXPORT wxGaugeBase : public wxControl
 {
 public:
-#ifdef __DARWIN__
-    virtual ~wxGaugeBase() { }
-#endif
+    virtual ~wxGaugeBase();
+
     bool Create(wxWindow *parent,
                 wxWindowID id,
                 int range,
index 7ff4213e3b4b0637d6bf5856bfe263c586c44980..d8d0a8a22647c668d16900eb0b25e632345a4e12 100644 (file)
@@ -31,9 +31,7 @@
 #ifdef __WXMSW__
     #define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c )
 #elif defined( __WXMAC__ )
-    #ifndef __DARWIN__
-        #include "Math64.h"
-    #endif
+    #include "Math64.h"
     #define wxMulDivInt32( a , b , c ) S32Set( S64Div( S64Multiply( S64Set(a) , S64Set(b) ) , S64Set(c) ) )
 #else
     #define wxMulDivInt32( a , b , c ) ((wxInt32)((a)*(((wxDouble)b)/((wxDouble)c))))
index ef40e6d6f1de48ad9eb9992c94427b6539837416..477e4fc48da46113cfd595e91af545af3c08667a 100644 (file)
@@ -493,9 +493,8 @@ class WXDLLEXPORT wxList : public wxObjectList
 {
 public:
     wxList(int key_type = wxKEY_NONE) : wxObjectList((wxKeyType)key_type) { }
-#ifdef __DARWIN__
+    // this destructor is required for Darwin
    ~wxList() { }
-#endif
 
     wxList& operator=(const wxList& list)
         { return (wxList&)wxListBase::operator=(list); }
index afe6348038eec94a85bdd781a979ab143dda383b..23f3100c5305c1ccf52ea4a7ff3038bdc890623c 100644 (file)
@@ -45,9 +45,7 @@ class WXDLLEXPORT wxListBoxBase : public wxControlWithItems
 public:
     // all generic methods are in wxControlWithItems, except for the following
     // ones which are not yet implemented by wxChoice/wxCombobox
-#ifdef __DARWIN__
-    virtual ~wxListBoxBase() { }
-#endif
+    virtual ~wxListBoxBase();
 
     void Insert(const wxString& item, int pos)
         { DoInsert(item, pos); }
index 3d9bb5e966215f0281194163b68284d82cadfd39..55862dea2d6aea68c7c73cacec40f6910e002219 100644 (file)
@@ -28,9 +28,7 @@ class WXDLLEXPORT wxPopupWindowBase : public wxWindow
 {
 public:
     wxPopupWindowBase() { }
-#ifdef __DARWIN__
-    virtual ~wxPopupWindowBase() { }
-#endif
+    virtual ~wxPopupWindowBase();
 
     // create the popup window
     //
index 93f26e79245c927ddccabe604330a0d19dbf2971..9f90791f5b15322028eea947bbd58601ea5f495f 100644 (file)
@@ -30,9 +30,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBitmapNameStr;
 class WXDLLEXPORT wxStaticBitmapBase : public wxControl
 {
  public:
-#ifdef __DARWIN__
-    ~wxStaticBitmapBase() { }
-#endif
+    virtual ~wxStaticBitmapBase();
     
     // our interface
     virtual void SetIcon(const wxIcon& icon) = 0;
index f835029b3cab13bc40386033dc1681cb328f2e52..b5ce8d830caf9e39b9295e553a0e1003e457e816 100644 (file)
@@ -49,9 +49,7 @@ public:
     void SetOwner(wxEvtHandler *owner, int id = -1)
         { m_owner = owner; m_idTimer = id; }
 
-#ifdef __DARWIN__
-    virtual ~wxTimerBase() { }
-#endif
+    virtual ~wxTimerBase();
 
     // working with the timer
     // ----------------------
index ce0ec8aecee7f703d73ad4d7a5ff0c1f9ed8842d..c07f0232bd98833622271e4b2748d284819d4cee 100644 (file)
@@ -74,10 +74,7 @@ class WXDLLEXPORT wxTopLevelWindowBase : public wxWindow
 public:
     // construction
     wxTopLevelWindowBase();
-
-#ifdef __DARWIN__
-    virtual ~wxTopLevelWindowBase() {}
-#endif
+    virtual ~wxTopLevelWindowBase();
 
     // top level wnd state
     // --------------------
index 59e2ef34c69cd746cfb487dd7b389561b702392d..c3461c2934a2abb6f8f375761eff03bd4fb14f7f 100644 (file)
@@ -76,6 +76,11 @@ wxAppBase::wxAppBase()
 #endif // wxUSE_GUI
 }
 
+wxAppBase::~wxAppBase()
+{
+    // this destructor is required for Darwin
+}
+
 #if wxUSE_GUI
 bool wxAppBase::OnInitGui()
 {
index 8715e67d10ac2eb432efed3665ff4af6320dd69f..bc47df63a5217c506521cda5736539095c96fecd 100644 (file)
@@ -109,8 +109,6 @@ void wxBitmapBase::CleanUpHandlers()
     }
 }
 
-
-
 class wxBitmapBaseModule: public wxModule
 {
 DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule)
index 06345dbdc6e7198961e0f1bd16b271a62036da2c..de1d8431a919a9e3b6717d5e013f370d0d3635ef 100644 (file)
 // implementation
 // ============================================================================
 
+wxChoiceBase::~wxChoiceBase()
+{
+    // this destructor is required for Darwin
+}
+
 // ----------------------------------------------------------------------------
 // selection
 // ----------------------------------------------------------------------------
index 97ea795e5756707e35a3a98c441af472579bbd79..a61beaa16c07f5fe1a1d4251f9b76ce34040b794 100644 (file)
 // implementation
 // ============================================================================
 
+wxControlBase::~wxControlBase()
+{
+    // this destructor is required for Darwin
+}
+
 bool wxControlBase::Create(wxWindow *parent,
                            wxWindowID id,
                            const wxPoint &pos,
@@ -125,6 +130,11 @@ void wxControlBase::InitCommandEvent(wxCommandEvent& event) const
 
 #if wxUSE_STATBMP
 
+wxStaticBitmapBase::~wxStaticBitmapBase()
+{
+    // this destructor is required for Darwin
+}
+
 wxSize wxStaticBitmapBase::DoGetBestClientSize() const
 {
     wxBitmap bmp = GetBitmap();
index 1d8421d7287df0a26acfb06af9d7410fabebede1..1c7e18ea27ac807f9643e750732326cd60344ddb 100644 (file)
 // implementation
 // ============================================================================
 
+wxItemContainer::~wxItemContainer()
+{
+    // this destructor is required for Darwin
+}
+
 // ----------------------------------------------------------------------------
 // selection
 // ----------------------------------------------------------------------------
index 94b9bab49bf9940bfa1630b6326bf13c0d67078d..938e9259fdc0e11ef88849216b89594163700874 100644 (file)
 
 wxFontEncoding wxFontBase::ms_encodingDefault = wxFONTENCODING_SYSTEM;
 
+wxFontBase::~wxFontBase()
+{
+    // this destructor is required for Darwin
+}
+
 /* static */
 wxFont *wxFontBase::New(int size,
                         int family,
index 7b067ddf0dda3d3585e91b4b4e72623a57089a29..544189a24c7a68c61921e1b789029df3ab0e33c3 100644 (file)
@@ -78,6 +78,11 @@ wxFrameBase::wxFrameBase()
 #endif // wxUSE_STATUSBAR
 }
 
+wxFrameBase::~wxFrameBase()
+{
+    // this destructor is required for Darwin
+}
+
 wxFrame *wxFrameBase::New(wxWindow *parent,
                           wxWindowID id,
                           const wxString& title,
index 585f8e6f680cccde126320e8baddc5ede878b906..eeee3569084aee20b9c081ca0b92098c58cc9cd7 100644 (file)
 // implementation
 // ============================================================================
 
+wxGaugeBase::~wxGaugeBase()
+{
+    // this destructor is required for Darwin
+}
+
 // ----------------------------------------------------------------------------
 // wxGauge creation
 // ----------------------------------------------------------------------------
index d33e03f7399b592ab79bb1216cde0c08b778c058..b8815324100cff21c6e4735677192edb15e389f0 100644 (file)
@@ -623,7 +623,7 @@ wxBrushList::~wxBrushList ()
     {
       wxBrush *brush = (wxBrush *) node->Data ();
       wxNode *next = node->Next ();
-      if (brush->GetVisible())
+      if (brush && brush->GetVisible())
         delete brush;
       node = next;
     }
index 39e70a027c6028d12aa1ce7f2961aadb227ea6d5..55ab6ade5e23ce4966754747a349eb4380031928 100644 (file)
 // implementation
 // ============================================================================
 
+wxListBoxBase::~wxListBoxBase()
+{
+    // this destructor is required for Darwin
+}
+
 // ----------------------------------------------------------------------------
 // adding items
 // ----------------------------------------------------------------------------
index ff6d0c08181a466027c0f28a38cd5ef88a73d87e..b06a532c7a0956219697f7e26312b062be2b4665 100644 (file)
@@ -108,6 +108,11 @@ END_EVENT_TABLE()
 // wxPopupWindowBase
 // ----------------------------------------------------------------------------
 
+wxPopupWindowBase::~wxPopupWindowBase()
+{
+    // this destructor is required for Darwin
+}
+
 bool wxPopupWindowBase::Create(wxWindow* WXUNUSED(parent), int WXUNUSED(flags))
 {
     return TRUE;
index 410aac2bd8e27dab2477b7116f11b377e0aa52f3..d11c537e32c22f34e63370c3ab3c55a5d5b0cc28 100644 (file)
 
 //---------------------------------------------------------------------------
 
-IMPLEMENT_ABSTRACT_CLASS(wxSizerItem, wxObject);
-IMPLEMENT_ABSTRACT_CLASS(wxSizer, wxObject);
-IMPLEMENT_ABSTRACT_CLASS(wxGridSizer, wxSizer);
-IMPLEMENT_ABSTRACT_CLASS(wxFlexGridSizer, wxGridSizer);
-IMPLEMENT_ABSTRACT_CLASS(wxBoxSizer, wxSizer);
+IMPLEMENT_ABSTRACT_CLASS(wxSizerItem, wxObject)
+IMPLEMENT_ABSTRACT_CLASS(wxSizer, wxObject)
+IMPLEMENT_ABSTRACT_CLASS(wxGridSizer, wxSizer)
+IMPLEMENT_ABSTRACT_CLASS(wxFlexGridSizer, wxGridSizer)
+IMPLEMENT_ABSTRACT_CLASS(wxBoxSizer, wxSizer)
 #if wxUSE_STATBOX
-IMPLEMENT_ABSTRACT_CLASS(wxStaticBoxSizer, wxBoxSizer);
+IMPLEMENT_ABSTRACT_CLASS(wxStaticBoxSizer, wxBoxSizer)
 #endif
 #if wxUSE_NOTEBOOK
-IMPLEMENT_ABSTRACT_CLASS(wxNotebookSizer, wxSizer);
+IMPLEMENT_ABSTRACT_CLASS(wxNotebookSizer, wxSizer)
 #endif
 
 //---------------------------------------------------------------------------
index 3ff1adf9d1dc7c50ce30dfb3b8e020532e8fed06..b9f1269ec081a7fdb2706d0cb4308e285d7864be 100644 (file)
 
 #if wxUSE_GUI && wxUSE_TIMER
 
+wxTimerBase::~wxTimerBase()
+{
+    // this destructor is required for Darwin
+}
+
 void wxTimerBase::Notify()
 {
     // the base class version generates an event if it has owner - which it
index ea6992d636e00d9d35fc334f0209bcfe7ae31556..87a63e86485090823d2ef93318a184cf8c7ea30b 100644 (file)
@@ -60,6 +60,11 @@ wxTopLevelWindowBase::wxTopLevelWindowBase()
 {
 }
 
+wxTopLevelWindowBase::~wxTopLevelWindowBase()
+{
+    // this destructor is required for Darwin
+}
+
 bool wxTopLevelWindowBase::Destroy()
 {
     // delayed destruction: the frame will be deleted during the next idle