1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XML resource compiler
4 // Author: Vaclav Slavik, Eduardo Marques <edrdo@netcabo.pt>
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx/wx.h".
12 #include "wx/wxprec.h"
18 // for all others, include the necessary headers
24 #include "wx/cmdline.h"
25 #include "wx/xml/xml.h"
27 #include "wx/filename.h"
28 #include "wx/wfstream.h"
30 #include "wx/hashset.h"
32 WX_DECLARE_HASH_SET(wxString
, wxStringHash
, wxStringEqual
, StringSet
);
37 XRCWidgetData(const wxString
& vname
,const wxString
& vclass
)
38 : m_class(vclass
), m_name(vname
) {}
39 const wxString
& GetName() const { return m_name
; }
40 const wxString
& GetClass() const { return m_class
; }
46 #include "wx/arrimpl.cpp"
47 WX_DECLARE_OBJARRAY(XRCWidgetData
,ArrayOfXRCWidgetData
);
48 WX_DEFINE_OBJARRAY(ArrayOfXRCWidgetData
)
54 wxString m_parentClassName
;
55 StringSet m_ancestorClassNames
;
56 ArrayOfXRCWidgetData m_wdata
;
58 void BrowseXmlNode(wxXmlNode
* node
)
65 if (node
->GetName() == _T("object")
66 && node
->GetPropVal(_T("class"),&classValue
)
67 && node
->GetPropVal(_T("name"),&nameValue
))
69 m_wdata
.Add(XRCWidgetData(nameValue
,classValue
));
71 children
= node
->GetChildren();
73 BrowseXmlNode(children
);
74 node
= node
->GetNext();
79 XRCWndClassData(const wxString
& className
,
80 const wxString
& parentClassName
,
81 const wxXmlNode
* node
) :
82 m_className(className
) , m_parentClassName(parentClassName
)
84 if ( className
== _T("wxMenu") )
86 m_ancestorClassNames
.insert(_T("wxMenu"));
87 m_ancestorClassNames
.insert(_T("wxMenuBar"));
89 else if ( className
== _T("wxMDIChildFrame") )
91 m_ancestorClassNames
.insert(_T("wxMDIParentFrame"));
93 else if( className
== _T("wxMenuBar") ||
94 className
== _T("wxStatusBar") ||
95 className
== _T("wxToolBar") )
97 m_ancestorClassNames
.insert(_T("wxFrame"));
101 m_ancestorClassNames
.insert(_T("wxWindow"));
104 BrowseXmlNode(node
->GetChildren());
107 const ArrayOfXRCWidgetData
& GetWidgetData()
112 bool IsRealClass(const wxString
& name
)
114 if (name
== _T("tool") ||
115 name
== _T("unknown") ||
116 name
== _T("notebookpage") ||
117 name
== _T("separator") ||
118 name
== _T("sizeritem") ||
119 name
== _T("wxMenuItem"))
126 void GenerateHeaderCode(wxFFile
& file
)
129 file
.Write(_T("class ") + m_className
+ _T(" : public ") + m_parentClassName
130 + _T(" {\nprotected:\n"));
132 for(i
=0;i
<m_wdata
.Count();++i
)
134 const XRCWidgetData
& w
= m_wdata
.Item(i
);
135 if( !IsRealClass(w
.GetClass()) ) continue;
136 if( w
.GetName().Length() == 0 ) continue;
138 _T(" ") + w
.GetClass() + _T("* ") + w
.GetName()
141 file
.Write(_T("\nprivate:\n void InitWidgetsFromXRC(wxWindow *parent){\n")
142 _T(" wxXmlResource::Get()->LoadObject(this,parent,_T(\"")
147 for(i
=0;i
<m_wdata
.Count();++i
)
149 const XRCWidgetData
& w
= m_wdata
.Item(i
);
150 if( !IsRealClass(w
.GetClass()) ) continue;
151 if( w
.GetName().Length() == 0 ) continue;
154 + _T(" = XRCCTRL(*this,\"")
160 file
.Write(_T(" }\n"));
162 file
.Write( _T("public:\n"));
164 if ( m_ancestorClassNames
.size() == 1 )
170 *m_ancestorClassNames
.begin() +
171 _T(" *parent=NULL){\n") +
172 _T(" InitWidgetsFromXRC((wxWindow *)parent);\n")
179 file
.Write(m_className
+ _T("(){\n") +
180 _T(" InitWidgetsFromXRC(NULL);\n")
184 for ( StringSet::const_iterator it
= m_ancestorClassNames
.begin();
185 it
!= m_ancestorClassNames
.end();
188 file
.Write(m_className
+ _T("(") + *it
+ _T(" *parent){\n") +
189 _T(" InitWidgetsFromXRC((wxWindow *)parent);\n")
196 WX_DECLARE_OBJARRAY(XRCWndClassData
,ArrayOfXRCWndClassData
);
197 WX_DEFINE_OBJARRAY(ArrayOfXRCWndClassData
)
200 class XmlResApp
: public wxAppConsole
203 // don't use builtin cmd line parsing:
204 virtual bool OnInit() { return true; }
208 void ParseParams(const wxCmdLineParser
& cmdline
);
210 wxArrayString
PrepareTempFiles();
211 void FindFilesInXML(wxXmlNode
*node
, wxArrayString
& flist
, const wxString
& inputPath
);
213 wxString
GetInternalFileName(const wxString
& name
, const wxArrayString
& flist
);
214 void DeleteTempFiles(const wxArrayString
& flist
);
215 void MakePackageZIP(const wxArrayString
& flist
);
216 void MakePackageCPP(const wxArrayString
& flist
);
217 void MakePackagePython(const wxArrayString
& flist
);
219 void OutputGettext();
220 wxArrayString
FindStrings();
221 wxArrayString
FindStrings(wxXmlNode
*node
);
223 bool flagVerbose
, flagCPP
, flagPython
, flagGettext
;
224 wxString parOutput
, parFuncname
, parOutputPath
;
225 wxArrayString parFiles
;
228 ArrayOfXRCWndClassData aXRCWndClassData
;
233 IMPLEMENT_APP_CONSOLE(XmlResApp
)
235 int XmlResApp::OnRun()
237 static const wxCmdLineEntryDesc cmdLineDesc
[] =
239 { wxCMD_LINE_SWITCH
, _T("h"), _T("help"), _T("show help message"),
240 wxCMD_LINE_VAL_NONE
, wxCMD_LINE_OPTION_HELP
},
241 { wxCMD_LINE_SWITCH
, _T("v"), _T("verbose"), _T("be verbose"), (wxCmdLineParamType
)0, 0 },
242 { wxCMD_LINE_SWITCH
, _T("e"), _T("extra-cpp-code"), _T("output C++ header file with XRC derived classes"), (wxCmdLineParamType
)0, 0 },
243 { wxCMD_LINE_SWITCH
, _T("c"), _T("cpp-code"), _T("output C++ source rather than .rsc file"), (wxCmdLineParamType
)0, 0 },
244 { wxCMD_LINE_SWITCH
, _T("p"), _T("python-code"), _T("output wxPython source rather than .rsc file"), (wxCmdLineParamType
)0, 0 },
245 { wxCMD_LINE_SWITCH
, _T("g"), _T("gettext"), _T("output list of translatable strings (to stdout or file if -o used)"), (wxCmdLineParamType
)0, 0 },
246 { wxCMD_LINE_OPTION
, _T("n"), _T("function"), _T("C++/Python function name (with -c or -p) [InitXmlResource]"), (wxCmdLineParamType
)0, 0 },
247 { wxCMD_LINE_OPTION
, _T("o"), _T("output"), _T("output file [resource.xrs/cpp]"), (wxCmdLineParamType
)0, 0 },
248 #if 0 // not yet implemented
249 { wxCMD_LINE_OPTION
, _T("l"), _T("list-of-handlers"), _T("output list of necessary handlers to this file"), (wxCmdLineParamType
)0, 0 },
251 { wxCMD_LINE_PARAM
, NULL
, NULL
, _T("input file(s)"),
252 wxCMD_LINE_VAL_STRING
,
253 wxCMD_LINE_PARAM_MULTIPLE
| wxCMD_LINE_OPTION_MANDATORY
},
255 { wxCMD_LINE_NONE
, NULL
, NULL
, NULL
, (wxCmdLineParamType
)0, 0 }
258 wxCmdLineParser
parser(cmdLineDesc
, argc
, argv
);
260 switch (parser
.Parse())
280 void XmlResApp::ParseParams(const wxCmdLineParser
& cmdline
)
282 flagGettext
= cmdline
.Found(_T("g"));
283 flagVerbose
= cmdline
.Found(_T("v"));
284 flagCPP
= cmdline
.Found(_T("c"));
285 flagPython
= cmdline
.Found(_T("p"));
286 flagH
= flagCPP
&& cmdline
.Found(_T("e"));
289 if (!cmdline
.Found(_T("o"), &parOutput
))
292 parOutput
= wxEmptyString
;
296 parOutput
= _T("resource.cpp");
298 parOutput
= _T("resource.py");
300 parOutput
= _T("resource.xrs");
303 if (!parOutput
.empty())
305 wxFileName
fn(parOutput
);
307 parOutput
= fn
.GetFullPath();
308 parOutputPath
= wxPathOnly(parOutput
);
310 if (!parOutputPath
) parOutputPath
= _T(".");
312 if (!cmdline
.Found(_T("n"), &parFuncname
))
313 parFuncname
= _T("InitXmlResource");
315 for (size_t i
= 0; i
< cmdline
.GetParamCount(); i
++)
318 wxString fn
=wxFindFirstFile(cmdline
.GetParam(i
), wxFILE
);
325 parFiles
.Add(cmdline
.GetParam(i
));
333 void XmlResApp::CompileRes()
335 wxArrayString files
= PrepareTempFiles();
337 wxRemoveFile(parOutput
);
342 MakePackageCPP(files
);
347 MakePackagePython(files
);
349 MakePackageZIP(files
);
352 DeleteTempFiles(files
);
356 wxString
XmlResApp::GetInternalFileName(const wxString
& name
, const wxArrayString
& flist
)
358 wxString name2
= name
;
359 name2
.Replace(_T(":"), _T("_"));
360 name2
.Replace(_T("/"), _T("_"));
361 name2
.Replace(_T("\\"), _T("_"));
362 name2
.Replace(_T("*"), _T("_"));
363 name2
.Replace(_T("?"), _T("_"));
365 wxString s
= wxFileNameFromPath(parOutput
) + _T("$") + name2
;
367 if (wxFileExists(s
) && flist
.Index(s
) == wxNOT_FOUND
)
369 for (int i
= 0;; i
++)
371 s
.Printf(wxFileNameFromPath(parOutput
) + _T("$%03i-") + name2
, i
);
372 if (!wxFileExists(s
) || flist
.Index(s
) != wxNOT_FOUND
)
379 wxArrayString
XmlResApp::PrepareTempFiles()
383 for (size_t i
= 0; i
< parFiles
.Count(); i
++)
386 wxPrintf(_T("processing ") + parFiles
[i
] + _T("...\n"));
390 if (!doc
.Load(parFiles
[i
]))
392 wxLogError(_T("Error parsing file ") + parFiles
[i
]);
397 wxString name
, ext
, path
;
398 wxSplitPath(parFiles
[i
], &path
, &name
, &ext
);
400 FindFilesInXML(doc
.GetRoot(), flist
, path
);
403 wxXmlNode
* node
= (doc
.GetRoot())->GetChildren();
404 wxString classValue
,nameValue
;
406 if(node
->GetName() == _T("object")
407 && node
->GetPropVal(_T("class"),&classValue
)
408 && node
->GetPropVal(_T("name"),&nameValue
)){
410 aXRCWndClassData
.Add(
411 XRCWndClassData(nameValue
,classValue
,node
)
414 node
= node
-> GetNext();
417 wxString internalName
= GetInternalFileName(parFiles
[i
], flist
);
419 doc
.Save(parOutputPath
+ wxFILE_SEP_PATH
+ internalName
);
420 flist
.Add(internalName
);
427 // Does 'node' contain filename information at all?
428 static bool NodeContainsFilename(wxXmlNode
*node
)
430 const wxString name
= node
->GetName();
432 // Any bitmaps (bitmap2 is used for disabled toolbar buttons):
433 if ( name
== _T("bitmap") || name
== _T("bitmap2") )
436 if ( name
== _T("icon") )
439 // URLs in wxHtmlWindow:
440 if ( name
== _T("url") )
444 wxXmlNode
*parent
= node
->GetParent();
445 if (parent
!= NULL
&&
446 parent
->GetPropVal(_T("class"), _T("")) == _T("wxBitmapButton") &&
447 (name
== _T("focus") ||
448 name
== _T("disabled") ||
449 name
== _T("selected")))
452 // wxBitmap or wxIcon toplevel resources:
453 if ( name
== _T("object") )
455 wxString klass
= node
->GetPropVal(_T("class"), wxEmptyString
);
456 if (klass
== _T("wxBitmap") || klass
== _T("wxIcon"))
463 // find all files mentioned in structure, e.g. <bitmap>filename</bitmap>
464 void XmlResApp::FindFilesInXML(wxXmlNode
*node
, wxArrayString
& flist
, const wxString
& inputPath
)
466 // Is 'node' XML node element?
467 if (node
== NULL
) return;
468 if (node
->GetType() != wxXML_ELEMENT_NODE
) return;
470 bool containsFilename
= NodeContainsFilename(node
);
472 wxXmlNode
*n
= node
->GetChildren();
475 if (containsFilename
&&
476 (n
->GetType() == wxXML_TEXT_NODE
||
477 n
->GetType() == wxXML_CDATA_SECTION_NODE
))
480 if (wxIsAbsolutePath(n
->GetContent()) || inputPath
.empty())
481 fullname
= n
->GetContent();
483 fullname
= inputPath
+ wxFILE_SEP_PATH
+ n
->GetContent();
486 wxPrintf(_T("adding ") + fullname
+ _T("...\n"));
488 wxString filename
= GetInternalFileName(n
->GetContent(), flist
);
489 n
->SetContent(filename
);
491 if (flist
.Index(filename
) == wxNOT_FOUND
)
494 wxFileInputStream
sin(fullname
);
495 wxFileOutputStream
sout(parOutputPath
+ wxFILE_SEP_PATH
+ filename
);
496 sin
.Read(sout
); // copy the stream
500 if (n
->GetType() == wxXML_ELEMENT_NODE
)
501 FindFilesInXML(n
, flist
, inputPath
);
509 void XmlResApp::DeleteTempFiles(const wxArrayString
& flist
)
511 for (size_t i
= 0; i
< flist
.Count(); i
++)
512 wxRemoveFile(parOutputPath
+ wxFILE_SEP_PATH
+ flist
[i
]);
517 void XmlResApp::MakePackageZIP(const wxArrayString
& flist
)
521 for (size_t i
= 0; i
< flist
.Count(); i
++)
522 files
+= flist
[i
] + _T(" ");
526 wxPrintf(_T("compressing ") + parOutput
+ _T("...\n"));
528 wxString cwd
= wxGetCwd();
529 wxSetWorkingDirectory(parOutputPath
);
530 int execres
= wxExecute(_T("zip -9 -j ") +
531 wxString(flagVerbose
? _T("\"") : _T("-q \"")) +
532 parOutput
+ _T("\" ") + files
, true);
533 wxSetWorkingDirectory(cwd
);
536 wxLogError(_T("Unable to execute zip program. Make sure it is in the path."));
537 wxLogError(_T("You can download it at http://www.cdrom.com/pub/infozip/"));
545 static wxString
FileToCppArray(wxString filename
, int num
)
550 wxFFile
file(filename
, wxT("rb"));
551 wxFileOffset offset
= file
.Length();
552 wxASSERT_MSG( offset
>= 0 , wxT("Invalid file length") );
554 const size_t lng
= wx_truncate_cast(size_t, offset
);
555 wxASSERT_MSG( lng
== offset
, wxT("Huge file not supported") );
557 snum
.Printf(_T("%i"), num
);
558 output
.Printf(_T("static size_t xml_res_size_") + snum
+ _T(" = %i;\n"), lng
);
559 output
+= _T("static unsigned char xml_res_file_") + snum
+ _T("[] = {\n");
560 // we cannot use string literals because MSVC is dumb wannabe compiler
561 // with arbitrary limitation to 2048 strings :(
563 unsigned char *buffer
= new unsigned char[lng
];
564 file
.Read(buffer
, lng
);
566 for (size_t i
= 0, linelng
= 0; i
< lng
; i
++)
568 tmp
.Printf(_T("%i"), buffer
[i
]);
569 if (i
!= 0) output
<< _T(',');
576 linelng
+= tmp
.Length()+1;
581 output
+= _T("};\n\n");
587 void XmlResApp::MakePackageCPP(const wxArrayString
& flist
)
589 wxFFile
file(parOutput
, wxT("wt"));
593 wxPrintf(_T("creating C++ source file ") + parOutput
+ _T("...\n"));
597 _T("// This file was automatically generated by wxrc, do not edit by hand.\n")
599 _T("#include <wx/wxprec.h>\n")
601 _T("#ifdef __BORLANDC__\n")
602 _T(" #pragma hdrstop\n")
606 _T("#include <wx/filesys.h>\n")
607 _T("#include <wx/fs_mem.h>\n")
608 _T("#include <wx/xrc/xmlres.h>\n")
609 _T("#include <wx/xrc/xh_all.h>\n")
612 for (i
= 0; i
< flist
.Count(); i
++)
614 FileToCppArray(parOutputPath
+ wxFILE_SEP_PATH
+ flist
[i
], i
));
617 _T("void ") + parFuncname
+ wxT("()\n")
620 _T(" // Check for memory FS. If not present, load the handler:\n")
622 _T(" wxMemoryFSHandler::AddFile(wxT(\"XRC_resource/dummy_file\"), wxT(\"dummy one\"));\n")
623 _T(" wxFileSystem fsys;\n")
624 _T(" wxFSFile *f = fsys.OpenFile(wxT(\"memory:XRC_resource/dummy_file\"));\n")
625 _T(" wxMemoryFSHandler::RemoveFile(wxT(\"XRC_resource/dummy_file\"));\n")
626 _T(" if (f) delete f;\n")
627 _T(" else wxFileSystem::AddHandler(new wxMemoryFSHandler);\n")
631 for (i
= 0; i
< flist
.Count(); i
++)
634 s
.Printf(_T(" wxMemoryFSHandler::AddFile(wxT(\"XRC_resource/") + flist
[i
] +
635 _T("\"), xml_res_file_%i, xml_res_size_%i);\n"), i
, i
);
639 for (i
= 0; i
< parFiles
.Count(); i
++)
641 file
.Write(_T(" wxXmlResource::Get()->Load(wxT(\"memory:XRC_resource/") +
642 GetInternalFileName(parFiles
[i
], flist
) + _T("\"));\n"));
645 file
.Write(_T("}\n"));
650 void XmlResApp::GenCPPHeader()
652 wxString fileSpec
= ((parOutput
.BeforeLast('.')).AfterLast('/')).AfterLast('\\');
653 wxString heaFileName
= fileSpec
+ _T(".h");
655 wxFFile
file(heaFileName
, wxT("wt"));
658 _T("// This file was automatically generated by wxrc, do not edit by hand.\n")
660 _T("#ifndef __") + fileSpec
+ _T("_h__\n")
661 _T("#define __") + fileSpec
+ _T("_h__\n")
663 for(size_t i
=0;i
<aXRCWndClassData
.Count();++i
){
664 aXRCWndClassData
.Item(i
).GenerateHeaderCode(file
);
669 + _T("();\n#endif\n"));
672 static wxString
FileToPythonArray(wxString filename
, int num
)
677 wxFFile
file(filename
, wxT("rb"));
678 wxFileOffset offset
= file
.Length();
679 wxASSERT_MSG( offset
>= 0 , wxT("Invalid file length") );
681 const size_t lng
= wx_truncate_cast(size_t, offset
);
682 wxASSERT_MSG( offset
== lng
, wxT("Huge file not supported") );
684 snum
.Printf(_T("%i"), num
);
685 output
= _T(" xml_res_file_") + snum
+ _T(" = '''\\\n");
687 unsigned char *buffer
= new unsigned char[lng
];
688 file
.Read(buffer
, lng
);
690 for (size_t i
= 0, linelng
= 0; i
< lng
; i
++)
692 unsigned char c
= buffer
[i
];
698 else if (c
< 32 || c
> 127 || c
== '\'')
699 tmp
.Printf(_T("\\x%02x"), c
);
707 output
<< _T("\\\n");
710 linelng
+= tmp
.Length();
715 output
+= _T("'''\n\n");
721 void XmlResApp::MakePackagePython(const wxArrayString
& flist
)
723 wxFFile
file(parOutput
, wxT("wt"));
727 wxPrintf(_T("creating Python source file ") + parOutput
+ _T("...\n"));
731 _T("# This file was automatically generated by wxrc, do not edit by hand.\n")
734 _T("import wx.xrc\n\n")
738 file
.Write(_T("def ") + parFuncname
+ _T("():\n"));
740 for (i
= 0; i
< flist
.Count(); i
++)
742 FileToPythonArray(parOutputPath
+ wxFILE_SEP_PATH
+ flist
[i
], i
));
745 _T(" # check if the memory filesystem handler has been loaded yet, and load it if not\n")
746 _T(" wx.MemoryFSHandler.AddFile('XRC_resource/dummy_file', 'dummy value')\n")
747 _T(" fsys = wx.FileSystem()\n")
748 _T(" f = fsys.OpenFile('memory:XRC_resource/dummy_file')\n")
749 _T(" wx.MemoryFSHandler.RemoveFile('XRC_resource/dummy_file')\n")
750 _T(" if f is not None:\n")
753 _T(" wx.FileSystem.AddHandler(wx.MemoryFSHandler())\n")
755 _T(" # load all the strings as memory files and load into XmlRes\n")
759 for (i
= 0; i
< flist
.Count(); i
++)
762 s
.Printf(_T(" wx.MemoryFSHandler.AddFile('XRC_resource/") + flist
[i
] +
763 _T("', xml_res_file_%i)\n"), i
);
766 for (i
= 0; i
< parFiles
.Count(); i
++)
768 file
.Write(_T(" wx.xrc.XmlResource.Get().Load('memory:XRC_resource/") +
769 GetInternalFileName(parFiles
[i
], flist
) + _T("')\n"));
772 file
.Write(_T("\n"));
777 void XmlResApp::OutputGettext()
779 wxArrayString str
= FindStrings();
782 if (parOutput
.empty())
785 fout
.Open(parOutput
, wxT("wt"));
787 for (size_t i
= 0; i
< str
.GetCount(); i
++)
788 fout
.Write(_T("_(\"") + str
[i
] + _T("\");\n"));
790 if (!parOutput
) fout
.Detach();
795 wxArrayString
XmlResApp::FindStrings()
797 wxArrayString arr
, a2
;
799 for (size_t i
= 0; i
< parFiles
.Count(); i
++)
802 wxPrintf(_T("processing ") + parFiles
[i
] + _T("...\n"));
805 if (!doc
.Load(parFiles
[i
]))
807 wxLogError(_T("Error parsing file ") + parFiles
[i
]);
811 a2
= FindStrings(doc
.GetRoot());
812 WX_APPEND_ARRAY(arr
, a2
);
820 static wxString
ConvertText(const wxString
& str
)
825 for (dt
= str
.c_str(); *dt
; dt
++)
829 if ( *(++dt
) == wxT('_') )
832 str2
<< wxT('&') << *dt
;
838 case wxT('\n') : str2
<< wxT("\\n"); break;
839 case wxT('\t') : str2
<< wxT("\\t"); break;
840 case wxT('\r') : str2
<< wxT("\\r"); break;
841 case wxT('\\') : if ((*(dt
+1) != 'n') &&
848 case wxT('"') : str2
<< wxT("\\\""); break;
849 default : str2
<< *dt
; break;
858 wxArrayString
XmlResApp::FindStrings(wxXmlNode
*node
)
863 if (n
== NULL
) return arr
;
864 n
= n
->GetChildren();
868 if ((node
->GetType() == wxXML_ELEMENT_NODE
) &&
869 // parent is an element, i.e. has subnodes...
870 (n
->GetType() == wxXML_TEXT_NODE
||
871 n
->GetType() == wxXML_CDATA_SECTION_NODE
) &&
872 // ...it is textnode...
874 node
/*not n!*/->GetName() == _T("label") ||
875 (node
/*not n!*/->GetName() == _T("value") &&
876 !n
->GetContent().IsNumber()) ||
877 node
/*not n!*/->GetName() == _T("help") ||
878 node
/*not n!*/->GetName() == _T("longhelp") ||
879 node
/*not n!*/->GetName() == _T("tooltip") ||
880 node
/*not n!*/->GetName() == _T("htmlcode") ||
881 node
/*not n!*/->GetName() == _T("title") ||
882 node
/*not n!*/->GetName() == _T("item")
884 // ...and known to contain translatable string
887 node
->GetPropVal(_T("translate"), _T("1")) != _T("0"))
889 arr
.Add(ConvertText(n
->GetContent()));
894 if (n
->GetType() == wxXML_ELEMENT_NODE
)
896 wxArrayString a2
= FindStrings(n
);
897 WX_APPEND_ARRAY(arr
, a2
);