1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XML resources
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xmlres.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #include "wx/dialog.h"
24 #include "wx/wfstream.h"
25 #include "wx/filesys.h"
28 #include "wx/tokenzr.h"
29 #include "wx/fontenum.h"
30 #include "wx/module.h"
31 #include "wx/bitmap.h"
33 #include "wx/fontmap.h"
35 #include "wx/xml/xml.h"
36 #include "wx/xml/xmlres.h"
38 #include "wx/arrimpl.cpp"
39 WX_DEFINE_OBJARRAY(wxXmlResourceDataRecords
);
42 wxXmlResource::wxXmlResource(bool use_locale
)
44 m_Handlers
.DeleteContents(TRUE
);
45 m_UseLocale
= use_locale
;
48 wxXmlResource::wxXmlResource(const wxString
& filemask
, bool use_locale
)
50 m_UseLocale
= use_locale
;
51 m_Handlers
.DeleteContents(TRUE
);
55 wxXmlResource::~wxXmlResource()
61 bool wxXmlResource::Load(const wxString
& filemask
)
64 wxXmlResourceDataRecord
*drec
;
65 bool iswild
= wxIsWild(filemask
);
69 # define wxXmlFindFirst fsys.FindFirst(filemask, wxFILE)
70 # define wxXmlFindNext fsys.FindNext()
72 # define wxXmlFindFirst wxFindFirstFile(filemask, wxFILE)
73 # define wxXmlFindNext wxFindNextFile()
82 if (filemask
.Lower().Matches("*.zip") ||
83 filemask
.Lower().Matches("*.rsc"))
88 fnd2
= fs2
.FindFirst(fnd
+ wxT("#zip:*.xmb"), wxFILE
);
91 drec
= new wxXmlResourceDataRecord
;
94 fnd2
= fs2
.FindNext();
100 drec
= new wxXmlResourceDataRecord
;
110 # undef wxXmlFindFirst
111 # undef wxXmlFindNext
117 void wxXmlResource::AddHandler(wxXmlResourceHandler
*handler
)
119 m_Handlers
.Append(handler
);
120 handler
->SetParentResource(this);
125 void wxXmlResource::ClearHandlers()
132 wxMenu
*wxXmlResource::LoadMenu(const wxString
& name
)
134 return (wxMenu
*)CreateResFromNode(FindResource(name
, wxT("wxMenu")), NULL
, NULL
);
139 wxMenuBar
*wxXmlResource::LoadMenuBar(const wxString
& name
)
141 return (wxMenuBar
*)CreateResFromNode(FindResource(name
, wxT("wxMenuBar")), NULL
, NULL
);
146 wxToolBar
*wxXmlResource::LoadToolBar(wxWindow
*parent
, const wxString
& name
)
148 return (wxToolBar
*)CreateResFromNode(FindResource(name
, wxT("wxToolBar")), parent
, NULL
);
153 wxDialog
*wxXmlResource::LoadDialog(wxWindow
*parent
, const wxString
& name
)
155 wxDialog
*dialog
= new wxDialog
;
156 if (!LoadDialog(dialog
, parent
, name
))
157 { delete dialog
; return NULL
; }
161 bool wxXmlResource::LoadDialog(wxDialog
*dlg
, wxWindow
*parent
, const wxString
& name
)
163 return CreateResFromNode(FindResource(name
, wxT("wxDialog")), parent
, dlg
) != NULL
;
168 wxPanel
*wxXmlResource::LoadPanel(wxWindow
*parent
, const wxString
& name
)
170 return (wxPanel
*)CreateResFromNode(FindResource(name
, wxT("wxPanel")), parent
, NULL
);
173 bool wxXmlResource::LoadPanel(wxPanel
*panel
, wxWindow
*parent
, const wxString
& name
)
175 return CreateResFromNode(FindResource(name
, wxT("wxPanel")), parent
, panel
) != NULL
;
180 wxBitmap
wxXmlResource::LoadBitmap(const wxString
& name
)
182 wxBitmap
*bmp
= (wxBitmap
*)CreateResFromNode(
183 FindResource(name
, wxT("wxBitmap")), NULL
, NULL
);
186 if (bmp
) { rt
= *bmp
; delete bmp
; }
190 wxIcon
wxXmlResource::LoadIcon(const wxString
& name
)
192 wxIcon
*icon
= (wxIcon
*)CreateResFromNode(
193 FindResource(name
, wxT("wxIcon")), NULL
, NULL
);
196 if (icon
) { rt
= *icon
; delete icon
; }
202 void wxXmlResource::ProcessPlatformProperty(wxXmlNode
*node
)
207 wxXmlNode
*c
= node
->GetChildren();
211 if (!c
->GetPropVal(_T("platform"), &s
))
215 wxStringTokenizer
tkn(s
, " |");
217 while (tkn
.HasMoreTokens())
219 s
= tkn
.GetNextToken();
222 s
== wxString(_T("win"))
223 #elif defined(__UNIX__)
224 s
== wxString(_T("unix"))
225 #elif defined(__MAC__)
226 s
== wxString(_T("mac"))
227 #elif defined(__OS2__)
228 s
== wxString(_T("os2"))
237 ProcessPlatformProperty(c
);
240 node
->RemoveChild(c
);
250 void wxXmlResource::UpdateResources()
253 # if wxUSE_FILESYSTEM
258 for (size_t i
= 0; i
< m_Data
.GetCount(); i
++)
260 modif
= (m_Data
[i
].Doc
== NULL
);
264 # if wxUSE_FILESYSTEM
265 file
= fsys
.OpenFile(m_Data
[i
].File
);
266 modif
= file
&& file
->GetModificationTime() > m_Data
[i
].Time
;
268 wxLogError(_("Cannot open file '%s'."), m_Data
[i
].File
.c_str());
271 modif
= wxDateTime(wxFileModificationTime(m_Data
[i
].File
)) > m_Data
[i
].Time
;
277 wxInputStream
*stream
;
279 # if wxUSE_FILESYSTEM
280 file
= fsys
.OpenFile(m_Data
[i
].File
);
281 stream
= file
->GetStream();
283 stream
= new wxFileInputStream(m_Data
[i
].File
);
288 delete m_Data
[i
].Doc
;
289 m_Data
[i
].Doc
= new wxXmlDocument
;
291 if (!stream
|| !m_Data
[i
].Doc
->Load(*stream
))
293 wxLogError(_("Cannot load resources from file '%s'."), m_Data
[i
].File
.c_str());
294 delete m_Data
[i
].Doc
;
295 m_Data
[i
].Doc
= NULL
;
297 else if (m_Data
[i
].Doc
->GetRoot()->GetName() != _T("resource"))
299 wxLogError(_("Invalid XML resource '%s': doesn't have root node 'resource'."), m_Data
[i
].File
.c_str());
300 delete m_Data
[i
].Doc
;
301 m_Data
[i
].Doc
= NULL
;
304 ProcessPlatformProperty(m_Data
[i
].Doc
->GetRoot());
306 # if wxUSE_FILESYSTEM
317 wxXmlNode
*wxXmlResource::FindResource(const wxString
& name
, const wxString
& classname
)
319 UpdateResources(); //ensure everything is up-to-date
322 for (size_t f
= 0; f
< m_Data
.GetCount(); f
++)
324 if (m_Data
[f
].Doc
== NULL
|| m_Data
[f
].Doc
->GetRoot() == NULL
) continue;
325 for (wxXmlNode
*node
= m_Data
[f
].Doc
->GetRoot()->GetChildren();
326 node
; node
= node
->GetNext())
327 if (node
->GetType() == wxXML_ELEMENT_NODE
&&
329 node
->GetPropVal(wxT("class"), wxEmptyString
) == classname
) &&
330 node
->GetName() == wxT("object") &&
331 node
->GetPropVal(wxT("name"), &dummy
) &&
335 m_CurFileSystem
.ChangePathTo(m_Data
[f
].File
);
341 wxLogError(_("XML resource '%s' (class '%s') not found!"),
342 name
.c_str(), classname
.c_str());
348 wxObject
*wxXmlResource::CreateResFromNode(wxXmlNode
*node
, wxObject
*parent
, wxObject
*instance
)
350 if (node
== NULL
) return NULL
;
352 wxXmlResourceHandler
*handler
;
354 wxNode
* ND
= m_Handlers
.GetFirst();
357 handler
= (wxXmlResourceHandler
*)ND
->GetData();
358 if (node
->GetName() == _T("object") && handler
->CanHandle(node
))
360 ret
= handler
->CreateResource(node
, parent
, instance
);
366 wxLogError(_("No handler found for XML node '%s', class '%s'!"),
367 node
->GetName().c_str(),
368 node
->GetPropVal(_T("class"), wxEmptyString
).c_str());
380 wxXmlResourceHandler::wxXmlResourceHandler()
381 : m_Node(NULL
), m_Parent(NULL
), m_Instance(NULL
),
382 m_ParentAsWindow(NULL
), m_InstanceAsWindow(NULL
)
387 wxObject
*wxXmlResourceHandler::CreateResource(wxXmlNode
*node
, wxObject
*parent
, wxObject
*instance
)
389 wxXmlNode
*myNode
= m_Node
;
390 wxString myClass
= m_Class
;
391 wxObject
*myParent
= m_Parent
, *myInstance
= m_Instance
;
392 wxWindow
*myParentAW
= m_ParentAsWindow
, *myInstanceAW
= m_InstanceAsWindow
;
395 m_Class
= node
->GetPropVal(_T("class"), wxEmptyString
);
397 m_Instance
= instance
;
398 m_ParentAsWindow
= wxDynamicCast(m_Parent
, wxWindow
);
399 m_InstanceAsWindow
= wxDynamicCast(m_Instance
, wxWindow
);
401 wxObject
*returned
= DoCreateResource();
405 m_Parent
= myParent
; m_ParentAsWindow
= myParentAW
;
406 m_Instance
= myInstance
; m_InstanceAsWindow
= myInstanceAW
;
412 void wxXmlResourceHandler::AddStyle(const wxString
& name
, int value
)
414 m_StyleNames
.Add(name
);
415 m_StyleValues
.Add(value
);
420 void wxXmlResourceHandler::AddWindowStyles()
422 ADD_STYLE(wxSIMPLE_BORDER
);
423 ADD_STYLE(wxSUNKEN_BORDER
);
424 ADD_STYLE(wxDOUBLE_BORDER
);
425 ADD_STYLE(wxRAISED_BORDER
);
426 ADD_STYLE(wxSTATIC_BORDER
);
427 ADD_STYLE(wxTRANSPARENT_WINDOW
);
428 ADD_STYLE(wxWANTS_CHARS
);
429 ADD_STYLE(wxNO_FULL_REPAINT_ON_RESIZE
);
434 bool wxXmlResourceHandler::HasParam(const wxString
& param
)
436 return (GetParamNode(param
) != NULL
);
440 int wxXmlResourceHandler::GetStyle(const wxString
& param
, int defaults
)
442 wxString s
= GetParamValue(param
);
444 if (!s
) return defaults
;
446 wxStringTokenizer
tkn(s
, _T("| "), wxTOKEN_STRTOK
);
450 while (tkn
.HasMoreTokens())
452 fl
= tkn
.GetNextToken();
453 index
= m_StyleNames
.Index(fl
);
454 if (index
!= wxNOT_FOUND
)
455 style
|= m_StyleValues
[index
];
457 wxLogError(_("Unknown style flag ") + fl
);
464 wxString
wxXmlResourceHandler::GetText(const wxString
& param
)
466 wxString str1
= GetParamValue(param
);
470 for (dt
= str1
.c_str(); *dt
; dt
++)
472 // Remap $ to &, map $$ to $ (for things like "&File..." --
473 // this is illegal in XML, so we use "$File..."):
477 case '$' : str2
<< '$'; break;
478 default : str2
<< '&' << *dt
; break;
480 // Remap \n to CR, \r LF, \t to TAB:
481 else if (*dt
== '\\')
484 case 'n' : str2
<< '\n'; break;
485 case 't' : str2
<< '\t'; break;
486 case 'r' : str2
<< '\r'; break;
487 default : str2
<< '\\' << *dt
; break;
492 if (m_Resource
->GetUseLocale())
493 return wxGetTranslation(str2
);
500 long wxXmlResourceHandler::GetLong(const wxString
& param
, long defaultv
)
503 wxString str1
= GetParamValue(param
);
505 if (!str1
.ToLong(&value
))
512 int wxXmlResourceHandler::GetID()
514 wxString sid
= GetName();
517 if (sid
== _T("-1")) return -1;
518 else if (sid
.IsNumber() && sid
.ToLong(&num
)) return num
;
519 #define stdID(id) else if (sid == _T(#id)) return id
520 stdID(wxID_OPEN
); stdID(wxID_CLOSE
); stdID(wxID_NEW
);
521 stdID(wxID_SAVE
); stdID(wxID_SAVEAS
); stdID(wxID_REVERT
);
522 stdID(wxID_EXIT
); stdID(wxID_UNDO
); stdID(wxID_REDO
);
523 stdID(wxID_HELP
); stdID(wxID_PRINT
); stdID(wxID_PRINT_SETUP
);
524 stdID(wxID_PREVIEW
); stdID(wxID_ABOUT
); stdID(wxID_HELP_CONTENTS
);
525 stdID(wxID_HELP_COMMANDS
); stdID(wxID_HELP_PROCEDURES
);
526 stdID(wxID_CUT
); stdID(wxID_COPY
); stdID(wxID_PASTE
);
527 stdID(wxID_CLEAR
); stdID(wxID_FIND
); stdID(wxID_DUPLICATE
);
528 stdID(wxID_SELECTALL
); stdID(wxID_OK
); stdID(wxID_CANCEL
);
529 stdID(wxID_APPLY
); stdID(wxID_YES
); stdID(wxID_NO
);
530 stdID(wxID_STATIC
); stdID(wxID_FORWARD
); stdID(wxID_BACKWARD
);
531 stdID(wxID_DEFAULT
); stdID(wxID_MORE
); stdID(wxID_SETUP
);
532 stdID(wxID_RESET
); stdID(wxID_HELP_CONTEXT
);
534 else return XMLID(sid
.c_str());
538 wxString
wxXmlResourceHandler::GetName()
540 return m_Node
->GetPropVal(_T("name"), _T("-1"));
545 bool wxXmlResourceHandler::GetBool(const wxString
& param
, bool defaultv
)
547 wxString v
= GetParamValue(param
);
549 if (!v
) return defaultv
;
550 else return (v
== _T("1"));
555 wxColour
wxXmlResourceHandler::GetColour(const wxString
& param
)
557 wxString v
= GetParamValue(param
);
558 unsigned long tmp
= 0;
560 if (v
.Length() != 7 || v
[0] != _T('#') ||
561 wxSscanf(v
.c_str(), _T("#%lX"), &tmp
) != 1)
563 wxLogError(_("XML resource: Incorrect colour specification '%s' for property '%s'."),
564 v
.c_str(), param
.c_str());
568 return wxColour((tmp
& 0xFF0000) >> 16 ,
569 (tmp
& 0x00FF00) >> 8,
575 wxBitmap
wxXmlResourceHandler::GetBitmap(const wxString
& param
, wxSize size
)
577 wxString name
= GetParamValue(param
);
578 if (name
.IsEmpty()) return wxNullBitmap
;
580 wxFSFile
*fsfile
= GetCurFileSystem().OpenFile(name
);
583 wxLogError(_("XML resource: Cannot create bitmap from '%s'."), param
.mb_str());
586 wxImage
img(*(fsfile
->GetStream()));
589 wxImage
img(GetParamValue(_T("bitmap")));
593 wxLogError(_("XML resource: Cannot create bitmap from '%s'."), param
.mb_str());
596 if (!(size
== wxDefaultSize
)) img
.Rescale(size
.x
, size
.y
);
597 return img
.ConvertToBitmap();
602 wxIcon
wxXmlResourceHandler::GetIcon(const wxString
& param
, wxSize size
)
604 #if wxCHECK_VERSION(2,3,0) || defined(__WXMSW__)
606 icon
.CopyFromBitmap(GetBitmap(param
, size
));
609 wxBitmap bmppt
= GetBitmap(param
, size
);
610 iconpt
= (wxIcon
*)(&bmppt
);
611 wxIcon
icon(*iconpt
);
618 wxXmlNode
*wxXmlResourceHandler::GetParamNode(const wxString
& param
)
620 wxXmlNode
*n
= m_Node
->GetChildren();
624 if (n
->GetType() == wxXML_ELEMENT_NODE
&& n
->GetName() == param
)
632 wxString
wxXmlResourceHandler::GetNodeContent(wxXmlNode
*node
)
635 if (n
== NULL
) return wxEmptyString
;
636 n
= n
->GetChildren();
640 if (n
->GetType() == wxXML_TEXT_NODE
||
641 n
->GetType() == wxXML_CDATA_SECTION_NODE
)
642 return n
->GetContent();
645 return wxEmptyString
;
650 wxString
wxXmlResourceHandler::GetParamValue(const wxString
& param
)
653 return GetNodeContent(m_Node
);
655 return GetNodeContent(GetParamNode(param
));
660 wxSize
wxXmlResourceHandler::GetSize(const wxString
& param
)
662 wxString s
= GetParamValue(param
);
663 if (s
.IsEmpty()) s
= _T("-1,-1");
667 is_dlg
= s
[s
.Length()-1] == _T('d');
668 if (is_dlg
) s
.RemoveLast();
670 if (!s
.BeforeFirst(_T(',')).ToLong(&sx
) ||
671 !s
.AfterLast(_T(',')).ToLong(&sy
))
673 wxLogError(_("Cannot parse coordinates from '%s'."), s
.mb_str());
674 return wxDefaultSize
;
679 if (m_InstanceAsWindow
)
680 return wxDLG_UNIT(m_InstanceAsWindow
, wxSize(sx
, sy
));
681 else if (m_ParentAsWindow
)
682 return wxDLG_UNIT(m_ParentAsWindow
, wxSize(sx
, sy
));
685 wxLogError(_("Cannot convert dialog units: dialog unknown."));
686 return wxDefaultSize
;
689 else return wxSize(sx
, sy
);
694 wxPoint
wxXmlResourceHandler::GetPosition(const wxString
& param
)
696 wxSize sz
= GetSize(param
);
697 return wxPoint(sz
.x
, sz
.y
);
702 wxCoord
wxXmlResourceHandler::GetDimension(const wxString
& param
, wxCoord defaultv
)
704 wxString s
= GetParamValue(param
);
705 if (s
.IsEmpty()) return defaultv
;
709 is_dlg
= s
[s
.Length()-1] == _T('d');
710 if (is_dlg
) s
.RemoveLast();
714 wxLogError(_("Cannot parse dimension from '%s'."), s
.mb_str());
720 if (m_InstanceAsWindow
)
721 return wxDLG_UNIT(m_InstanceAsWindow
, wxSize(sx
, 0)).x
;
722 else if (m_ParentAsWindow
)
723 return wxDLG_UNIT(m_ParentAsWindow
, wxSize(sx
, 0)).x
;
726 wxLogError(_("Cannot convert dialog units: dialog unknown."));
735 wxFont
wxXmlResourceHandler::GetFont(const wxString
& param
)
737 wxXmlNode
*font_node
= GetParamNode(param
);
738 if (font_node
== NULL
)
740 wxLogError(_("Cannot find font node '%s'."), param
.mb_str());
744 wxXmlNode
*oldnode
= m_Node
;
747 long size
= GetLong(_T("size"), 12);
749 wxString style
= GetParamValue(_T("style"));
750 wxString weight
= GetParamValue(_T("weight"));
751 int istyle
= wxNORMAL
, iweight
= wxNORMAL
;
752 if (style
== _T("italic")) istyle
= wxITALIC
;
753 else if (style
== _T("slant")) istyle
= wxSLANT
;
754 if (weight
== _T("bold")) iweight
= wxBOLD
;
755 else if (weight
== _T("light")) iweight
= wxLIGHT
;
757 wxString family
= GetParamValue(_T("family"));
758 int ifamily
= wxDEFAULT
;
759 if (family
== _T("decorative")) ifamily
= wxDECORATIVE
;
760 else if (family
== _T("roman")) ifamily
= wxROMAN
;
761 else if (family
== _T("script")) ifamily
= wxSCRIPT
;
762 else if (family
== _T("swiss")) ifamily
= wxSWISS
;
763 else if (family
== _T("modern")) ifamily
= wxMODERN
;
765 bool underlined
= GetBool(_T("underlined"), FALSE
);
767 wxString encoding
= GetParamValue(_T("encoding"));
769 wxFontEncoding enc
= wxFONTENCODING_DEFAULT
;
770 if (!encoding
.IsEmpty()) enc
= mapper
.CharsetToEncoding(encoding
);
771 if (enc
== wxFONTENCODING_SYSTEM
) enc
= wxFONTENCODING_SYSTEM
;
773 wxString faces
= GetParamValue(_T("face"));
774 wxString facename
= wxEmptyString
;
775 wxFontEnumerator enu
;
776 enu
.EnumerateFacenames();
777 wxStringTokenizer
tk(faces
, _T(","));
778 while (tk
.HasMoreTokens())
780 int index
= enu
.GetFacenames()->Index(tk
.GetNextToken(), FALSE
);
781 if (index
!= wxNOT_FOUND
)
783 facename
= (*enu
.GetFacenames())[index
];
790 wxFont
font(size
, ifamily
, istyle
, iweight
, underlined
, facename
, enc
);
795 void wxXmlResourceHandler::SetupWindow(wxWindow
*wnd
)
799 if (HasParam(_T("exstyle")))
800 wnd
->SetExtraStyle(GetStyle(_T("exstyle")));
801 if (HasParam(_T("bg")))
802 wnd
->SetBackgroundColour(GetColour(_T("bg")));
803 if (HasParam(_T("fg")))
804 wnd
->SetForegroundColour(GetColour(_T("fg")));
805 if (GetBool(_T("enabled"), 1) == 0)
807 if (GetBool(_T("focused"), 0) == 1)
809 if (GetBool(_T("hidden"), 0) == 1)
812 if (HasParam(_T("tooltip")))
813 wnd
->SetToolTip(GetText(_T("tooltip")));
815 if (HasParam(_T("font")))
816 wnd
->SetFont(GetFont());
820 void wxXmlResourceHandler::CreateChildren(wxObject
*parent
, bool this_hnd_only
)
822 wxXmlNode
*n
= m_Node
->GetChildren();
826 if (n
->GetType() == wxXML_ELEMENT_NODE
&&
827 n
->GetName() == _T("object"))
829 if (this_hnd_only
&& CanHandle(n
))
830 CreateResource(n
, parent
, NULL
);
832 m_Resource
->CreateResFromNode(n
, parent
, NULL
);
839 void wxXmlResourceHandler::CreateChildrenPrivately(wxObject
*parent
, wxXmlNode
*rootnode
)
842 if (rootnode
== NULL
) root
= m_Node
; else root
= rootnode
;
843 wxXmlNode
*n
= root
->GetChildren();
847 if (n
->GetType() == wxXML_ELEMENT_NODE
&& CanHandle(n
))
849 CreateResource(n
, parent
, NULL
);
863 // --------------- XMLID implementation -----------------------------
865 #define XMLID_TABLE_SIZE 1024
875 static XMLID_record
*XMLID_Records
[XMLID_TABLE_SIZE
] = {NULL
};
876 static int XMLID_LastID
= wxID_HIGHEST
;
878 /*static*/ int wxXmlResource::GetXMLID(const char *str_id
)
882 for (const char *c
= str_id
; *c
!= '\0'; c
++) index
+= (int)*c
;
883 index
%= XMLID_TABLE_SIZE
;
885 XMLID_record
*oldrec
= NULL
;
887 for (XMLID_record
*rec
= XMLID_Records
[index
]; rec
; rec
= rec
->next
)
889 if (strcmp(rec
->key
, str_id
) == 0)
897 XMLID_record
**rec_var
= (oldrec
== NULL
) ?
898 &XMLID_Records
[index
] : &oldrec
->next
;
899 *rec_var
= new XMLID_record
;
900 (*rec_var
)->id
= ++XMLID_LastID
;
901 (*rec_var
)->key
= strdup(str_id
);
902 (*rec_var
)->next
= NULL
;
904 return (*rec_var
)->id
;
908 static void CleanXMLID_Record(XMLID_record
*rec
)
912 CleanXMLID_Record(rec
->next
);
918 static void CleanXMLID_Records()
920 for (int i
= 0; i
< XMLID_TABLE_SIZE
; i
++)
921 CleanXMLID_Record(XMLID_Records
[i
]);
931 // --------------- module and globals -----------------------------
934 static wxXmlResource gs_XmlResource
;
936 wxXmlResource
*wxTheXmlResource
= &gs_XmlResource
;
939 class wxXmlResourceModule
: public wxModule
941 DECLARE_DYNAMIC_CLASS(wxXmlResourceModule
)
943 wxXmlResourceModule() {}
944 bool OnInit() {return TRUE
;}
947 wxTheXmlResource
->ClearHandlers();
948 CleanXMLID_Records();
952 IMPLEMENT_DYNAMIC_CLASS(wxXmlResourceModule
, wxModule
)