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
This commit is contained in:
@@ -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();
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxBitmapButtonXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxBitmapButtonXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxBitmapButtonXmlHandler();
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxButtonXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxButtonXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxButtonXmlHandler();
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxCalendarCtrlXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxCalendarCtrlXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxCalendarCtrlXmlHandler();
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#if wxUSE_CHECKBOX
|
||||
|
||||
class WXDLLEXPORT wxCheckBoxXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxCheckBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxCheckBoxXmlHandler();
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxCheckListXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxCheckListXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxCheckListXmlHandler();
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxChoiceXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxChoiceXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxChoiceXmlHandler();
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
class WXDLLEXPORT wxComboBoxXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxComboBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxComboBoxXmlHandler();
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxDialogXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxDialogXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxDialogXmlHandler();
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxFrameXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxFrameXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxFrameXmlHandler();
|
||||
|
@@ -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
|
||||
};
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
#if wxUSE_HTML
|
||||
|
||||
class WXDLLEXPORT wxHtmlWindowXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxHtmlWindowXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxHtmlWindowXmlHandler();
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#if wxUSE_LISTBOX
|
||||
|
||||
class WXDLLEXPORT wxListBoxXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxListBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxListBoxXmlHandler();
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxListCtrlXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxListCtrlXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxListCtrlXmlHandler();
|
||||
|
@@ -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();
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
class WXDLLEXPORT wxNotebook;
|
||||
|
||||
class WXDLLEXPORT wxNotebookXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxNotebookXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxNotebookXmlHandler();
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxPanelXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxPanelXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxPanelXmlHandler();
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
class WXDLLEXPORT wxRadioButtonXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxRadioButtonXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxRadioButtonXmlHandler();
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
class WXDLLEXPORT wxRadioBoxXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxRadioBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxRadioBoxXmlHandler();
|
||||
|
@@ -20,9 +20,9 @@
|
||||
|
||||
|
||||
|
||||
class WXDLLEXPORT wxScrollBarXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxScrollBarXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
enum
|
||||
enum
|
||||
{
|
||||
wxSL_DEFAULT_VALUE = 0,
|
||||
wxSL_DEFAULT_MIN = 0,
|
||||
|
@@ -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);
|
||||
};
|
||||
|
||||
|
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxStaticBitmapXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxStaticBitmapXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxStaticBitmapXmlHandler();
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxStaticBoxXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxStaticBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxStaticBoxXmlHandler();
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#if wxUSE_STATLINE
|
||||
|
||||
class WXDLLEXPORT wxStaticLineXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxStaticLineXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxStaticLineXmlHandler();
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxStaticTextXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxStaticTextXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxStaticTextXmlHandler();
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxTextCtrlXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxTextCtrlXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxTextCtrlXmlHandler();
|
||||
|
@@ -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;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxTreeCtrlXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxTreeCtrlXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxTreeCtrlXmlHandler();
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxUnknownWidgetXmlHandler : public wxXmlResourceHandler
|
||||
class WXXMLDLLEXPORT wxUnknownWidgetXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxUnknownWidgetXmlHandler();
|
||||
|
@@ -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 <img src="hello.gif" id="3"/> "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_
|
||||
|
@@ -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() {}
|
||||
|
@@ -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 <object class="unknown">)
|
||||
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, <tag>content<tag> 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_
|
||||
|
Reference in New Issue
Block a user