From ea89ec17601f25ac04c7fe301dc632f72a1c14dc Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 5 Jun 2001 22:03:02 +0000 Subject: [PATCH] Changed WXDLLEXPORT's to WXXMLDLLEXPORT so the xmlres library can be used from wx DLL without it being a DLL also. Some work will still need to be done for making xmlres be a DLL... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xml/xh_bmp.h | 4 +-- contrib/include/wx/xml/xh_bmpbt.h | 2 +- contrib/include/wx/xml/xh_bttn.h | 2 +- contrib/include/wx/xml/xh_cald.h | 2 +- contrib/include/wx/xml/xh_chckb.h | 2 +- contrib/include/wx/xml/xh_chckl.h | 2 +- contrib/include/wx/xml/xh_choic.h | 2 +- contrib/include/wx/xml/xh_combo.h | 2 +- contrib/include/wx/xml/xh_dlg.h | 2 +- contrib/include/wx/xml/xh_frame.h | 2 +- contrib/include/wx/xml/xh_gauge.h | 4 +-- contrib/include/wx/xml/xh_html.h | 2 +- contrib/include/wx/xml/xh_listb.h | 2 +- contrib/include/wx/xml/xh_listc.h | 2 +- contrib/include/wx/xml/xh_menu.h | 4 +-- contrib/include/wx/xml/xh_notbk.h | 2 +- contrib/include/wx/xml/xh_panel.h | 2 +- contrib/include/wx/xml/xh_radbt.h | 2 +- contrib/include/wx/xml/xh_radbx.h | 2 +- contrib/include/wx/xml/xh_scrol.h | 4 +-- contrib/include/wx/xml/xh_sizer.h | 4 +-- contrib/include/wx/xml/xh_slidr.h | 4 +-- contrib/include/wx/xml/xh_spin.h | 8 ++--- contrib/include/wx/xml/xh_stbmp.h | 2 +- contrib/include/wx/xml/xh_stbox.h | 2 +- contrib/include/wx/xml/xh_stlin.h | 2 +- contrib/include/wx/xml/xh_sttxt.h | 2 +- contrib/include/wx/xml/xh_text.h | 2 +- contrib/include/wx/xml/xh_toolb.h | 4 +-- contrib/include/wx/xml/xh_tree.h | 2 +- contrib/include/wx/xml/xh_unkwn.h | 2 +- contrib/include/wx/xml/xml.h | 55 +++++++++++++++++-------------- contrib/include/wx/xml/xmlio.h | 10 +++--- contrib/include/wx/xml/xmlres.h | 44 +++++++++++++++---------- 34 files changed, 102 insertions(+), 89 deletions(-) diff --git a/contrib/include/wx/xml/xh_bmp.h b/contrib/include/wx/xml/xh_bmp.h index 023657eb5d..91a4d0280e 100644 --- a/contrib/include/wx/xml/xh_bmp.h +++ b/contrib/include/wx/xml/xh_bmp.h @@ -18,7 +18,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxBitmapXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxBitmapXmlHandler : public wxXmlResourceHandler { public: wxBitmapXmlHandler(); @@ -26,7 +26,7 @@ public: virtual bool CanHandle(wxXmlNode *node); }; -class WXDLLEXPORT wxIconXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxIconXmlHandler : public wxXmlResourceHandler { public: wxIconXmlHandler(); diff --git a/contrib/include/wx/xml/xh_bmpbt.h b/contrib/include/wx/xml/xh_bmpbt.h index 3ff085694c..5da3190191 100644 --- a/contrib/include/wx/xml/xh_bmpbt.h +++ b/contrib/include/wx/xml/xh_bmpbt.h @@ -18,7 +18,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxBitmapButtonXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxBitmapButtonXmlHandler : public wxXmlResourceHandler { public: wxBitmapButtonXmlHandler(); diff --git a/contrib/include/wx/xml/xh_bttn.h b/contrib/include/wx/xml/xh_bttn.h index ac96d2cdc4..5e5df78b69 100644 --- a/contrib/include/wx/xml/xh_bttn.h +++ b/contrib/include/wx/xml/xh_bttn.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxButtonXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxButtonXmlHandler : public wxXmlResourceHandler { public: wxButtonXmlHandler(); diff --git a/contrib/include/wx/xml/xh_cald.h b/contrib/include/wx/xml/xh_cald.h index 997d32ce36..60b7f618f0 100644 --- a/contrib/include/wx/xml/xh_cald.h +++ b/contrib/include/wx/xml/xh_cald.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxCalendarCtrlXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxCalendarCtrlXmlHandler : public wxXmlResourceHandler { public: wxCalendarCtrlXmlHandler(); diff --git a/contrib/include/wx/xml/xh_chckb.h b/contrib/include/wx/xml/xh_chckb.h index eb06a74495..e28f3502b3 100644 --- a/contrib/include/wx/xml/xh_chckb.h +++ b/contrib/include/wx/xml/xh_chckb.h @@ -20,7 +20,7 @@ #if wxUSE_CHECKBOX -class WXDLLEXPORT wxCheckBoxXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxCheckBoxXmlHandler : public wxXmlResourceHandler { public: wxCheckBoxXmlHandler(); diff --git a/contrib/include/wx/xml/xh_chckl.h b/contrib/include/wx/xml/xh_chckl.h index ee216edd6d..9c42fa20be 100644 --- a/contrib/include/wx/xml/xh_chckl.h +++ b/contrib/include/wx/xml/xh_chckl.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxCheckListXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxCheckListXmlHandler : public wxXmlResourceHandler { public: wxCheckListXmlHandler(); diff --git a/contrib/include/wx/xml/xh_choic.h b/contrib/include/wx/xml/xh_choic.h index 6750d3585d..16a2e1a428 100644 --- a/contrib/include/wx/xml/xh_choic.h +++ b/contrib/include/wx/xml/xh_choic.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxChoiceXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxChoiceXmlHandler : public wxXmlResourceHandler { public: wxChoiceXmlHandler(); diff --git a/contrib/include/wx/xml/xh_combo.h b/contrib/include/wx/xml/xh_combo.h index 9a0963bb90..2c5dc402e2 100644 --- a/contrib/include/wx/xml/xh_combo.h +++ b/contrib/include/wx/xml/xh_combo.h @@ -19,7 +19,7 @@ #if wxUSE_COMBOBOX -class WXDLLEXPORT wxComboBoxXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxComboBoxXmlHandler : public wxXmlResourceHandler { public: wxComboBoxXmlHandler(); diff --git a/contrib/include/wx/xml/xh_dlg.h b/contrib/include/wx/xml/xh_dlg.h index 1c6d9b3f06..135e126eb0 100644 --- a/contrib/include/wx/xml/xh_dlg.h +++ b/contrib/include/wx/xml/xh_dlg.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxDialogXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxDialogXmlHandler : public wxXmlResourceHandler { public: wxDialogXmlHandler(); diff --git a/contrib/include/wx/xml/xh_frame.h b/contrib/include/wx/xml/xh_frame.h index b903baf7e3..f5b3bb1bef 100644 --- a/contrib/include/wx/xml/xh_frame.h +++ b/contrib/include/wx/xml/xh_frame.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxFrameXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxFrameXmlHandler : public wxXmlResourceHandler { public: wxFrameXmlHandler(); diff --git a/contrib/include/wx/xml/xh_gauge.h b/contrib/include/wx/xml/xh_gauge.h index d5d78d02c4..8dfcccf7db 100644 --- a/contrib/include/wx/xml/xh_gauge.h +++ b/contrib/include/wx/xml/xh_gauge.h @@ -22,9 +22,9 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxGaugeXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxGaugeXmlHandler : public wxXmlResourceHandler { - enum + enum { wxGAUGE_DEFAULT_RANGE = 100 }; diff --git a/contrib/include/wx/xml/xh_html.h b/contrib/include/wx/xml/xh_html.h index ae57b76a50..cf1a0603ca 100644 --- a/contrib/include/wx/xml/xh_html.h +++ b/contrib/include/wx/xml/xh_html.h @@ -21,7 +21,7 @@ #if wxUSE_HTML -class WXDLLEXPORT wxHtmlWindowXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxHtmlWindowXmlHandler : public wxXmlResourceHandler { public: wxHtmlWindowXmlHandler(); diff --git a/contrib/include/wx/xml/xh_listb.h b/contrib/include/wx/xml/xh_listb.h index e4a51cf753..5a7d8d24a2 100644 --- a/contrib/include/wx/xml/xh_listb.h +++ b/contrib/include/wx/xml/xh_listb.h @@ -19,7 +19,7 @@ #if wxUSE_LISTBOX -class WXDLLEXPORT wxListBoxXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxListBoxXmlHandler : public wxXmlResourceHandler { public: wxListBoxXmlHandler(); diff --git a/contrib/include/wx/xml/xh_listc.h b/contrib/include/wx/xml/xh_listc.h index ea392c8cde..77d184a6e4 100644 --- a/contrib/include/wx/xml/xh_listc.h +++ b/contrib/include/wx/xml/xh_listc.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxListCtrlXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxListCtrlXmlHandler : public wxXmlResourceHandler { public: wxListCtrlXmlHandler(); diff --git a/contrib/include/wx/xml/xh_menu.h b/contrib/include/wx/xml/xh_menu.h index b352abba46..070e9b2de5 100644 --- a/contrib/include/wx/xml/xh_menu.h +++ b/contrib/include/wx/xml/xh_menu.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxMenuXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxMenuXmlHandler : public wxXmlResourceHandler { public: wxMenuXmlHandler(); @@ -28,7 +28,7 @@ private: bool m_insideMenu; }; -class WXDLLEXPORT wxMenuBarXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxMenuBarXmlHandler : public wxXmlResourceHandler { public: wxMenuBarXmlHandler(); diff --git a/contrib/include/wx/xml/xh_notbk.h b/contrib/include/wx/xml/xh_notbk.h index a857e95584..5ee74d85fd 100644 --- a/contrib/include/wx/xml/xh_notbk.h +++ b/contrib/include/wx/xml/xh_notbk.h @@ -20,7 +20,7 @@ class WXDLLEXPORT wxNotebook; -class WXDLLEXPORT wxNotebookXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxNotebookXmlHandler : public wxXmlResourceHandler { public: wxNotebookXmlHandler(); diff --git a/contrib/include/wx/xml/xh_panel.h b/contrib/include/wx/xml/xh_panel.h index 040f7ebc57..fd5afdc5c9 100644 --- a/contrib/include/wx/xml/xh_panel.h +++ b/contrib/include/wx/xml/xh_panel.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxPanelXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxPanelXmlHandler : public wxXmlResourceHandler { public: wxPanelXmlHandler(); diff --git a/contrib/include/wx/xml/xh_radbt.h b/contrib/include/wx/xml/xh_radbt.h index d6ca6b7f55..0658ff5f6f 100644 --- a/contrib/include/wx/xml/xh_radbt.h +++ b/contrib/include/wx/xml/xh_radbt.h @@ -20,7 +20,7 @@ #if wxUSE_RADIOBOX -class WXDLLEXPORT wxRadioButtonXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxRadioButtonXmlHandler : public wxXmlResourceHandler { public: wxRadioButtonXmlHandler(); diff --git a/contrib/include/wx/xml/xh_radbx.h b/contrib/include/wx/xml/xh_radbx.h index f75ea65a7c..7343d39f66 100644 --- a/contrib/include/wx/xml/xh_radbx.h +++ b/contrib/include/wx/xml/xh_radbx.h @@ -19,7 +19,7 @@ #if wxUSE_RADIOBOX -class WXDLLEXPORT wxRadioBoxXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxRadioBoxXmlHandler : public wxXmlResourceHandler { public: wxRadioBoxXmlHandler(); diff --git a/contrib/include/wx/xml/xh_scrol.h b/contrib/include/wx/xml/xh_scrol.h index 8e838d74e2..a190117556 100644 --- a/contrib/include/wx/xml/xh_scrol.h +++ b/contrib/include/wx/xml/xh_scrol.h @@ -20,9 +20,9 @@ -class WXDLLEXPORT wxScrollBarXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxScrollBarXmlHandler : public wxXmlResourceHandler { - enum + enum { wxSL_DEFAULT_VALUE = 0, wxSL_DEFAULT_MIN = 0, diff --git a/contrib/include/wx/xml/xh_sizer.h b/contrib/include/wx/xml/xh_sizer.h index d2dc509fca..7210672bb2 100644 --- a/contrib/include/wx/xml/xh_sizer.h +++ b/contrib/include/wx/xml/xh_sizer.h @@ -20,7 +20,7 @@ class WXDLLEXPORT wxSizer; -class WXDLLEXPORT wxSizerXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxSizerXmlHandler : public wxXmlResourceHandler { public: wxSizerXmlHandler(); @@ -30,7 +30,7 @@ public: private: bool m_isInside; wxSizer *m_parentSizer; - + bool IsSizerNode(wxXmlNode *node); }; diff --git a/contrib/include/wx/xml/xh_slidr.h b/contrib/include/wx/xml/xh_slidr.h index 74bb51f6f4..45be53ae66 100644 --- a/contrib/include/wx/xml/xh_slidr.h +++ b/contrib/include/wx/xml/xh_slidr.h @@ -20,9 +20,9 @@ #if wxUSE_SLIDER -class WXDLLEXPORT wxSliderXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxSliderXmlHandler : public wxXmlResourceHandler { - enum + enum { wxSL_DEFAULT_VALUE = 0, wxSL_DEFAULT_MIN = 0, diff --git a/contrib/include/wx/xml/xh_spin.h b/contrib/include/wx/xml/xh_spin.h index afa2574cbc..871a249f06 100644 --- a/contrib/include/wx/xml/xh_spin.h +++ b/contrib/include/wx/xml/xh_spin.h @@ -19,9 +19,9 @@ #include "wx/defs.h" #if wxUSE_SPINBTN -class WXDLLEXPORT wxSpinButtonXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxSpinButtonXmlHandler : public wxXmlResourceHandler { - enum + enum { wxSP_DEFAULT_VALUE = 0, wxSP_DEFAULT_MIN = 0, @@ -36,9 +36,9 @@ public: #endif #if wxUSE_SPINCTRL -class WXDLLEXPORT wxSpinCtrlXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxSpinCtrlXmlHandler : public wxXmlResourceHandler { - enum + enum { wxSP_DEFAULT_VALUE = 0, wxSP_DEFAULT_MIN = 0, diff --git a/contrib/include/wx/xml/xh_stbmp.h b/contrib/include/wx/xml/xh_stbmp.h index 9c8e352d39..1fa07a405e 100644 --- a/contrib/include/wx/xml/xh_stbmp.h +++ b/contrib/include/wx/xml/xh_stbmp.h @@ -18,7 +18,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxStaticBitmapXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxStaticBitmapXmlHandler : public wxXmlResourceHandler { public: wxStaticBitmapXmlHandler(); diff --git a/contrib/include/wx/xml/xh_stbox.h b/contrib/include/wx/xml/xh_stbox.h index fa078a8274..f4055a2abf 100644 --- a/contrib/include/wx/xml/xh_stbox.h +++ b/contrib/include/wx/xml/xh_stbox.h @@ -18,7 +18,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxStaticBoxXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxStaticBoxXmlHandler : public wxXmlResourceHandler { public: wxStaticBoxXmlHandler(); diff --git a/contrib/include/wx/xml/xh_stlin.h b/contrib/include/wx/xml/xh_stlin.h index ef18b8b3e4..cad1234c41 100644 --- a/contrib/include/wx/xml/xh_stlin.h +++ b/contrib/include/wx/xml/xh_stlin.h @@ -19,7 +19,7 @@ #if wxUSE_STATLINE -class WXDLLEXPORT wxStaticLineXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxStaticLineXmlHandler : public wxXmlResourceHandler { public: wxStaticLineXmlHandler(); diff --git a/contrib/include/wx/xml/xh_sttxt.h b/contrib/include/wx/xml/xh_sttxt.h index dbd56847dc..713f29d443 100644 --- a/contrib/include/wx/xml/xh_sttxt.h +++ b/contrib/include/wx/xml/xh_sttxt.h @@ -18,7 +18,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxStaticTextXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxStaticTextXmlHandler : public wxXmlResourceHandler { public: wxStaticTextXmlHandler(); diff --git a/contrib/include/wx/xml/xh_text.h b/contrib/include/wx/xml/xh_text.h index 8406d525c5..db8bbb5b7c 100644 --- a/contrib/include/wx/xml/xh_text.h +++ b/contrib/include/wx/xml/xh_text.h @@ -18,7 +18,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxTextCtrlXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxTextCtrlXmlHandler : public wxXmlResourceHandler { public: wxTextCtrlXmlHandler(); diff --git a/contrib/include/wx/xml/xh_toolb.h b/contrib/include/wx/xml/xh_toolb.h index 572b971f00..426b58cc64 100644 --- a/contrib/include/wx/xml/xh_toolb.h +++ b/contrib/include/wx/xml/xh_toolb.h @@ -21,13 +21,13 @@ class WXDLLEXPORT wxToolBar; -class WXDLLEXPORT wxToolBarXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxToolBarXmlHandler : public wxXmlResourceHandler { public: wxToolBarXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); - + private: bool m_isInside; wxToolBar *m_toolbar; diff --git a/contrib/include/wx/xml/xh_tree.h b/contrib/include/wx/xml/xh_tree.h index 23e62e9fa4..9c3fe46a1a 100644 --- a/contrib/include/wx/xml/xh_tree.h +++ b/contrib/include/wx/xml/xh_tree.h @@ -17,7 +17,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxTreeCtrlXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxTreeCtrlXmlHandler : public wxXmlResourceHandler { public: wxTreeCtrlXmlHandler(); diff --git a/contrib/include/wx/xml/xh_unkwn.h b/contrib/include/wx/xml/xh_unkwn.h index ac13ee5313..1506345ffd 100644 --- a/contrib/include/wx/xml/xh_unkwn.h +++ b/contrib/include/wx/xml/xh_unkwn.h @@ -18,7 +18,7 @@ #include "wx/xml/xmlres.h" -class WXDLLEXPORT wxUnknownWidgetXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxUnknownWidgetXmlHandler : public wxXmlResourceHandler { public: wxUnknownWidgetXmlHandler(); diff --git a/contrib/include/wx/xml/xml.h b/contrib/include/wx/xml/xml.h index 0d1e71bb41..de3b3fe7ed 100644 --- a/contrib/include/wx/xml/xml.h +++ b/contrib/include/wx/xml/xml.h @@ -20,11 +20,16 @@ #include "wx/object.h" #include "wx/list.h" +#ifdef WXXMLISDLL +#define WXXMLDLLEXPORT WXDLLEXPORT +#else +#define WXXMLDLLEXPORT +#endif -class WXDLLEXPORT wxXmlNode; -class WXDLLEXPORT wxXmlProperty; -class WXDLLEXPORT wxXmlDocument; -class WXDLLEXPORT wxXmlIOHandler; +class WXXMLDLLEXPORT wxXmlNode; +class WXXMLDLLEXPORT wxXmlProperty; +class WXXMLDLLEXPORT wxXmlDocument; +class WXXMLDLLEXPORT wxXmlIOHandler; class WXDLLEXPORT wxInputStream; class WXDLLEXPORT wxOutputStream; @@ -65,11 +70,11 @@ enum wxXmlIOType // Example: in "src" is property with value // "hello.gif" and "id" is prop. with value "3". -class WXDLLEXPORT wxXmlProperty +class WXXMLDLLEXPORT wxXmlProperty { public: wxXmlProperty() : m_next(NULL) {} - wxXmlProperty(const wxString& name, const wxString& value, + wxXmlProperty(const wxString& name, const wxString& value, wxXmlProperty *next) : m_name(name), m_value(value), m_next(next) {} ~wxXmlProperty() { delete m_next; } @@ -97,18 +102,18 @@ private: // with content="hi"). // // If wxUSE_UNICODE is 0, all strings are encoded in UTF-8 encoding (same as -// ASCII for characters 0-127). You can use wxMBConvUTF8 to convert then to +// ASCII for characters 0-127). You can use wxMBConvUTF8 to convert then to // desired encoding: // // wxCSConv myConv("iso8859-2"); // wxString s(cMB2WC(node->GetContent().c_str()), myConv); -class WXDLLEXPORT wxXmlNode +class WXXMLDLLEXPORT wxXmlNode { public: - wxXmlNode() : m_properties(NULL), m_parent(NULL), + wxXmlNode() : m_properties(NULL), m_parent(NULL), m_children(NULL), m_next(NULL) {} - wxXmlNode(wxXmlNode *parent,wxXmlNodeType type, + wxXmlNode(wxXmlNode *parent,wxXmlNodeType type, const wxString& name, const wxString& content, wxXmlProperty *props, wxXmlNode *next); ~wxXmlNode() { delete m_properties; delete m_next; delete m_children; } @@ -121,7 +126,7 @@ public: wxXmlNode& operator=(const wxXmlNode& node); // user-friendly creation: - wxXmlNode(wxXmlNodeType type, const wxString& name, + wxXmlNode(wxXmlNodeType type, const wxString& name, const wxString& content = wxEmptyString); void AddChild(wxXmlNode *child); void InsertChild(wxXmlNode *child, wxXmlNode *before_node); @@ -140,7 +145,7 @@ public: wxXmlProperty *GetProperties() const { return m_properties; } bool GetPropVal(const wxString& propName, wxString *value) const; - wxString GetPropVal(const wxString& propName, + wxString GetPropVal(const wxString& propName, const wxString& defaultVal) const; bool HasProp(const wxString& propName) const; @@ -171,17 +176,17 @@ private: -// This class holds XML data/document as parsed by libxml. Note that -// internal representation is independant on libxml and you can use +// This class holds XML data/document as parsed by libxml. Note that +// internal representation is independant on libxml and you can use // it without libxml (see Load/SaveBinary). -class WXDLLEXPORT wxXmlDocument : public wxObject +class WXXMLDLLEXPORT wxXmlDocument : public wxObject { public: wxXmlDocument() : wxObject(), m_version(wxT("1.0")), m_root(NULL) {} - wxXmlDocument(const wxString& filename, + wxXmlDocument(const wxString& filename, wxXmlIOType io_type = wxXML_IO_AUTO); - wxXmlDocument(wxInputStream& stream, + wxXmlDocument(wxInputStream& stream, wxXmlIOType io_type = wxXML_IO_AUTO); ~wxXmlDocument() { delete m_root; } @@ -189,16 +194,16 @@ public: wxXmlDocument& operator=(const wxXmlDocument& doc); // Parses .xml file and loads data. Returns TRUE on success, FALSE - // otherwise. + // otherwise. // NOTE: Any call to this method will result into linking against libxml // and app's binary size will grow by ca. 250kB bool Load(const wxString& filename, wxXmlIOType io_type = wxXML_IO_AUTO); bool Load(wxInputStream& stream, wxXmlIOType io_type = wxXML_IO_AUTO); // Saves document as .xml file. - bool Save(const wxString& filename, + bool Save(const wxString& filename, wxXmlIOType io_type = wxXML_IO_TEXT_OUTPUT) const; - bool Save(wxOutputStream& stream, + bool Save(wxOutputStream& stream, wxXmlIOType io_type = wxXML_IO_TEXT_OUTPUT) const; bool IsOk() const { return m_root != NULL; } @@ -211,7 +216,7 @@ public: // Returns encoding of document (may be empty). // Note: this is the encoding original fail was saved in, *not* the // encoding of in-memory representation! Data in wxXmlNode are always - // stored in wchar_t (in Unicode build) or UTF-8 encoded + // stored in wchar_t (in Unicode build) or UTF-8 encoded // (if wxUSE_UNICODE is 0). wxString GetEncoding() const { return m_encoding; } @@ -239,21 +244,21 @@ private: // wxXmlIOHandler takes care of loading and/or saving XML data. // see xmlio.h for available handlers -class WXDLLEXPORT wxXmlIOHandler : public wxObject +class WXXMLDLLEXPORT wxXmlIOHandler : public wxObject { public: wxXmlIOHandler() {} - + virtual wxXmlIOType GetType() = 0; virtual bool CanLoad(wxInputStream& stream) = 0; virtual bool CanSave() = 0; - + virtual bool Load(wxInputStream& stream, wxXmlDocument& doc) = 0; virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc) = 0; }; - +void wxXmlInitXmlModule(); #endif // _WX_XML_H_ diff --git a/contrib/include/wx/xml/xmlio.h b/contrib/include/wx/xml/xmlio.h index 81bb543047..452db4f80d 100644 --- a/contrib/include/wx/xml/xmlio.h +++ b/contrib/include/wx/xml/xmlio.h @@ -20,7 +20,7 @@ #include "wx/xml/xml.h" -class WXDLLEXPORT wxXmlIOHandlerExpat : public wxXmlIOHandler +class WXXMLDLLEXPORT wxXmlIOHandlerExpat : public wxXmlIOHandler { public: virtual wxXmlIOType GetType() { return wxXML_IO_EXPAT; } @@ -32,7 +32,7 @@ public: }; -class WXDLLEXPORT wxXmlIOHandlerWriter : public wxXmlIOHandler +class WXXMLDLLEXPORT wxXmlIOHandlerWriter : public wxXmlIOHandler { public: virtual wxXmlIOType GetType() { return wxXML_IO_TEXT_OUTPUT; } @@ -44,7 +44,7 @@ public: }; -class WXDLLEXPORT wxXmlIOHandlerBin : public wxXmlIOHandler +class WXXMLDLLEXPORT wxXmlIOHandlerBin : public wxXmlIOHandler { public: wxXmlIOHandlerBin() {} @@ -56,7 +56,7 @@ public: virtual bool Load(wxInputStream& stream, wxXmlDocument& doc); virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc); -protected: +protected: wxString ReadHeader(wxInputStream& stream); void WriteHeader(wxOutputStream& stream, const wxString& header); }; @@ -65,7 +65,7 @@ protected: #if wxUSE_ZLIB -class WXDLLEXPORT wxXmlIOHandlerBinZ : public wxXmlIOHandlerBin +class WXXMLDLLEXPORT wxXmlIOHandlerBinZ : public wxXmlIOHandlerBin { public: wxXmlIOHandlerBinZ() {} diff --git a/contrib/include/wx/xml/xmlres.h b/contrib/include/wx/xml/xmlres.h index 9615242e8d..172de3007f 100644 --- a/contrib/include/wx/xml/xmlres.h +++ b/contrib/include/wx/xml/xmlres.h @@ -25,6 +25,8 @@ #include "wx/bitmap.h" #include "wx/icon.h" +#include "wx/xml/xml.h" + class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxMenuBar; class WXDLLEXPORT wxDialog; @@ -33,9 +35,8 @@ class WXDLLEXPORT wxWindow; class WXDLLEXPORT wxFrame; class WXDLLEXPORT wxToolBar; -class WXDLLEXPORT wxXmlResourceHandler; +class WXXMLDLLEXPORT wxXmlResourceHandler; -#include "wx/xml/xml.h" // These macros indicate current version of XML resources (this information is // encoded in root node of XRC file as "version" property). @@ -61,7 +62,7 @@ class WXDLLEXPORT wxXmlResourceHandler; WX_XMLRES_CURRENT_VERSION_RELEASE * 256 + \ WX_XMLRES_CURRENT_VERSION_REVISION) -class WXDLLEXPORT wxXmlResourceDataRecord +class WXXMLDLLEXPORT wxXmlResourceDataRecord { public: wxXmlResourceDataRecord() : Doc(NULL), Time(wxDateTime::Now()) {} @@ -72,13 +73,19 @@ public: wxDateTime Time; }; + +#ifdef WXXMLISDLL WX_DECLARE_EXPORTED_OBJARRAY(wxXmlResourceDataRecord, wxXmlResourceDataRecords); +#else +WX_DECLARE_OBJARRAY(wxXmlResourceDataRecord, wxXmlResourceDataRecords); +#endif -// This class holds XML resources from one or more .xml files + +// This class holds XML resources from one or more .xml files // (or derived forms, either binary or zipped -- see manual for -// details). +// details). -class WXDLLEXPORT wxXmlResource : public wxObject +class WXXMLDLLEXPORT wxXmlResource : public wxObject { public: // Ctor. If use_locale is TRUE, translatable strings are @@ -100,7 +107,7 @@ public: // Initialize only specific handler (or custom handler). Convention says // that handler name is equal to control's name plus 'XmlHandler', e.g. // wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. XML resource compiler - // (xmlres) can create include file that contains initialization code for + // (xmlres) can create include file that contains initialization code for // all controls used within the resource. void AddHandler(wxXmlResourceHandler *handler); @@ -138,7 +145,7 @@ public: // Loads bitmap or icon resource from file: wxBitmap LoadBitmap(const wxString& name); wxIcon LoadIcon(const wxString& name); - + // Attaches unknown control into given panel/window/dialog: // (unknown controls are used in conjunction with ) bool AttachUnknownControl(const wxString& name, wxWindow *control, @@ -148,14 +155,14 @@ public: // resource. To be used in event tables // Macro XMLID is provided for convenience static int GetXMLID(const char *str_id); - + // Returns version info (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a) long GetVersion() const { return m_version; } - + // Compares resources version to argument. Returns -1 if resources version // is less than the argument, +1 if greater and 0 if they equal. int CompareVersion(int major, int minor, int release, int revision) const - { return GetVersion() - + { return GetVersion() - (major*256*256*256 + minor*256*256 + release*256 + revision); } protected: @@ -177,7 +184,7 @@ protected: private: long m_version; - + bool m_useLocale; wxList m_handlers; wxXmlResourceDataRecords m_data; @@ -202,7 +209,7 @@ extern wxXmlResource *wxTheXmlResource; // EVT_MENU(XMLID("about"), MyFrame::OnAbout) // EVT_MENU(XMLID("new"), MyFrame::OnNew) // EVT_MENU(XMLID("open"), MyFrame::OnOpen) -// END_EVENT_TABLE() +// END_EVENT_TABLE() #define XMLID(str_id) \ wxXmlResource::GetXMLID(wxT(str_id)) @@ -225,7 +232,7 @@ extern wxXmlResource *wxTheXmlResource; #endif -class WXDLLEXPORT wxXmlResourceHandler : public wxObject +class WXXMLDLLEXPORT wxXmlResourceHandler : public wxObject { public: wxXmlResourceHandler(); @@ -237,7 +244,7 @@ public: // that is often neccessary to create resource // if instance != NULL it should not create new instance via 'new' but // rather use this one and call its Create method - wxObject *CreateResource(wxXmlNode *node, wxObject *parent, + wxObject *CreateResource(wxXmlNode *node, wxObject *parent, wxObject *instance); // This one is called from CreateResource after variables @@ -273,12 +280,12 @@ protected: // Gets node content from wxXML_ENTITY_NODE // (the problem is, content is represented as // wxXML_ENTITY_NODE name="tag", content="" - // |-- wxXML_TEXT_NODE or + // |-- wxXML_TEXT_NODE or // wxXML_CDATA_SECTION_NODE name="" content="content" wxString GetNodeContent(wxXmlNode *node); // Check to see if a param exists - bool HasParam(const wxString& param); + bool HasParam(const wxString& param); // Finds the node or returns NULL wxXmlNode *GetParamNode(const wxString& param); @@ -335,7 +342,7 @@ protected: void CreateChildren(wxObject *parent, bool this_hnd_only = FALSE); void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL); - wxObject *CreateResFromNode(wxXmlNode *node, + wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL) { return m_resource->CreateResFromNode(node, parent, instance); } @@ -346,5 +353,6 @@ protected: #define ADD_STYLE(style) AddStyle(wxT(#style), style) +void wxXmlInitResourceModule(); #endif // _WX_XMLRES_H_ -- 2.45.2