]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/xrc/xmlres.h
Added fontfactory.h that should have been part of 49213.
[wxWidgets.git] / include / wx / xrc / xmlres.h
index 1f03015c1d1556dec5100adeb0881b0eb05a8b5e..6146f5956f6ef216efc38f7e83c199257c2665c4 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "wx/string.h"
 #include "wx/dynarray.h"
-#include "wx/arrstr.h"
 #include "wx/datetime.h"
 #include "wx/list.h"
 #include "wx/gdicmn.h"
@@ -27,6 +26,7 @@
 #include "wx/artprov.h"
 #include "wx/colour.h"
 #include "wx/animate.h"
+#include "wx/vector.h"
 
 #include "wx/xml/xml.h"
 
@@ -40,9 +40,9 @@ class WXDLLIMPEXP_FWD_CORE wxToolBar;
 
 class WXDLLIMPEXP_FWD_XRC wxXmlResourceHandler;
 class WXDLLIMPEXP_FWD_XRC wxXmlSubclassFactory;
-class WXDLLIMPEXP_FWD_XRC wxXmlSubclassFactoriesList;
+class wxXmlSubclassFactories;
 class wxXmlResourceModule;
-
+class wxXmlResourceDataRecords;
 
 // These macros indicate current version of XML resources (this information is
 // encoded in root node of XRC file as "version" property).
@@ -68,28 +68,6 @@ class wxXmlResourceModule;
                  WX_XMLRES_CURRENT_VERSION_RELEASE * 256 + \
                  WX_XMLRES_CURRENT_VERSION_REVISION)
 
-class WXDLLIMPEXP_XRC wxXmlResourceDataRecord
-{
-public:
-    wxXmlResourceDataRecord() : Doc(NULL) {
-#if wxUSE_DATETIME
-        Time = wxDateTime::Now();
-#endif
-    }
-    ~wxXmlResourceDataRecord() {delete Doc;}
-
-    wxString File;
-    wxXmlDocument *Doc;
-#if wxUSE_DATETIME
-    wxDateTime Time;
-#endif
-};
-
-
-WX_DECLARE_USER_EXPORTED_OBJARRAY(wxXmlResourceDataRecord,
-                                  wxXmlResourceDataRecords,
-                                  WXDLLIMPEXP_XRC);
-
 enum wxXmlResourceFlags
 {
     wxXRC_USE_LOCALE     = 1,
@@ -287,12 +265,16 @@ protected:
     static bool IsArchive(const wxString& filename);
 #endif // wxUSE_FILESYSTEM
 
+private:
+    wxXmlResourceDataRecords& Data() { return *m_data; }
+    const wxXmlResourceDataRecords& Data() const { return *m_data; }
+
 private:
     long m_version;
 
     int m_flags;
-    wxList m_handlers;
-    wxXmlResourceDataRecords m_data;
+    wxVector<wxXmlResourceHandler*> m_handlers;
+    wxXmlResourceDataRecords *m_data;
 #if wxUSE_FILESYSTEM
     wxFileSystem m_curFileSystem;
     wxFileSystem& GetCurFileSystem() { return m_curFileSystem; }
@@ -304,7 +286,7 @@ private:
     friend class wxXmlResourceHandler;
     friend class wxXmlResourceModule;
 
-    static wxXmlSubclassFactoriesList *ms_subclassFactories;
+    static wxXmlSubclassFactories *ms_subclassFactories;
 
     // singleton instance:
     static wxXmlResource *ms_instance;
@@ -337,6 +319,18 @@ private:
 #define XRCCTRL(window, id, type) \
     (wxStaticCast((window).FindWindow(XRCID(id)), type))
 
+// This macro returns pointer to sizer item
+// Example:
+//
+// <object class="spacer" name="area">
+//   <size>400, 300</size>
+// </object>
+//
+// wxSizerItem* item = XRCSIZERITEM(*this, "area")
+
+#define XRCSIZERITEM(window, id) \
+    ((window).GetSizer() ? (window).GetSizer()->GetItemById(XRCID(id)) : NULL)
+
 // wxXmlResourceHandler is an abstract base class for resource handlers
 // capable of creating a control from an XML node.