]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/object.h
added GAUGE standard colour and use it in DrawProgressBar() if the colour
[wxWidgets.git] / include / wx / object.h
index f165dd169313211e7248472a509ed4cb181a1aa7..599bcd5fc6e5f211d036cfe2be5da98a79e47cff 100644 (file)
@@ -84,7 +84,7 @@ public:
     static const wxClassInfo  *GetFirst() { return sm_first; }
     const wxClassInfo         *GetNext() const { return m_next; }
     static wxClassInfo        *FindClass(const wxChar *className);
-    
+
         // Climb upwards through inheritance hierarchy.
         // Dual inheritance is catered for.
 
@@ -201,18 +201,18 @@ private:                                        \
     static const wxString sm_className;         \
 public:                                         \
     name##PluginSentinel();                     \
-    ~##name##PluginSentinel();                  \
+    ~name##PluginSentinel();                    \
 };                                              \
 name##PluginSentinel  m_pluginsentinel;
 
 #define _IMPLEMENT_DL_SENTINEL(name)                                \
  const wxString name::name##PluginSentinel::sm_className(#name);    \
  name::name##PluginSentinel::name##PluginSentinel() {               \
-    wxDLManifestEntry *e = (wxDLManifestEntry*) wxDLManifestEntry::ms_classes.Get(#name);   \
+    wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name);   \
     if( e != 0 ) { e->RefObj(); }                                      \
  }                                                                  \
- name::name##PluginSentinel::~##name##PluginSentinel() {            \
-    wxDLManifestEntry *e = (wxDLManifestEntry*) wxDLManifestEntry::ms_classes.Get(#name);   \
+ name::name##PluginSentinel::~name##PluginSentinel() {            \
+    wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name);   \
     if( e != 0 ) { e->UnrefObj(); }                                 \
  }
 #else
@@ -382,18 +382,33 @@ public:
     virtual void Dump(wxSTD ostream& str);
 #endif
 
-        // make a 'clone' of the object
-  
+    // ref counted data handling methods
+
+    // get/set
+    wxObjectRefData *GetRefData() const { return m_refData; }
+    void SetRefData(wxObjectRefData *data) { m_refData = data; }
+
+    // make a 'clone' of the object
     void Ref(const wxObject& clone);
 
-        // destroy a reference
-  
+    // destroy a reference
     void UnRef();
 
-    inline wxObjectRefData *GetRefData() const { return m_refData; }
-    inline void SetRefData(wxObjectRefData *data) { m_refData = data; }
-
 protected:
+    // ensure that our data is not shared with anybody else: if we have no
+    // data, it is created using CreateRefData() below, if we have shared data
+    // it is copied using CloneRefData(), otherwise nothing is done
+    void AllocExclusive();
+
+    // both methods must be implemented if Unshare() is used, not pure virtual
+    // only because of the backwards compatibility reasons
+
+    // create a new m_refData
+    virtual wxObjectRefData *CreateRefData() const;
+
+    // create a new m_refData initialized with the given one
+    virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
+
     wxObjectRefData *m_refData;
 };