]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxrc/wxrc.cpp
create the single global IO dispatcher in wxFDIODispatcher; don't use wxSelectDispatc...
[wxWidgets.git] / utils / wxrc / wxrc.cpp
index dd31ea31e4bf1b50b82f5676983224c1ebdc6693..9d7bd03d1437ec0b9a30bad143e976d6523ec649 100644 (file)
@@ -65,8 +65,8 @@ private:
         while (node)
         {
             if (node->GetName() == _T("object")
-                && node->GetPropVal(_T("class"),&classValue)
-                && node->GetPropVal(_T("name"),&nameValue))
+                && node->GetAttribute(_T("class"),&classValue)
+                && node->GetAttribute(_T("name"),&nameValue))
             {
                 m_wdata.Add(XRCWidgetData(nameValue,classValue));
             }
@@ -409,8 +409,8 @@ wxArrayString XmlResApp::PrepareTempFiles()
                 wxString classValue,nameValue;
                 while(node){
                     if(node->GetName() == _T("object")
-                     && node->GetPropVal(_T("class"),&classValue)
-                     && node->GetPropVal(_T("name"),&nameValue)){
+                     && node->GetAttribute(_T("class"),&classValue)
+                     && node->GetAttribute(_T("name"),&nameValue)){
 
                       aXRCWndClassData.Add(
                         XRCWndClassData(nameValue,classValue,node)
@@ -441,14 +441,10 @@ static bool NodeContainsFilename(wxXmlNode *node)
    if ( name == _T("icon") )
        return true;
 
-   // URLs in wxHtmlWindow:
-   if ( name == _T("url") )
-       return true;
-
    // wxBitmapButton:
    wxXmlNode *parent = node->GetParent();
    if (parent != NULL &&
-       parent->GetPropVal(_T("class"), _T("")) == _T("wxBitmapButton") &&
+       parent->GetAttribute(_T("class"), _T("")) == _T("wxBitmapButton") &&
        (name == _T("focus") ||
         name == _T("disabled") ||
         name == _T("selected")))
@@ -457,13 +453,22 @@ static bool NodeContainsFilename(wxXmlNode *node)
    // wxBitmap or wxIcon toplevel resources:
    if ( name == _T("object") )
    {
-       wxString klass = node->GetPropVal(_T("class"), wxEmptyString);
+       wxString klass = node->GetAttribute(_T("class"), wxEmptyString);
        if (klass == _T("wxBitmap") ||
                klass == _T("wxIcon") ||
                 klass == _T("data") )
            return true;
    }
 
+   // URLs in wxHtmlWindow:
+   if ( name == _T("url") &&
+        parent != NULL &&
+        parent->GetAttribute(_T("class"), _T("")) == _T("wxHtmlWindow") )
+   {
+       // FIXME: this is wrong for e.g. http:// URLs
+       return true;
+   }
+
    return false;
 }
 
@@ -629,7 +634,7 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist)
               FileToCppArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i));
 
     file.Write(""
-"void ") + parFuncname + wxT("()\n"
+"void " + parFuncname + "()\n"
 "{\n"
 "\n"
 "    // Check for memory FS. If not present, load the handler:\n"
@@ -685,8 +690,8 @@ void XmlResApp::GenCPPHeader()
 "//\n"
 "// This file was automatically generated by wxrc, do not edit by hand.\n"
 "//\n\n"
-"#ifndef __")  + fileSpec + _T("_h__\n"
-"#define __")  + fileSpec + _T("_h__\n"
+"#ifndef __"  + fileSpec + "_h__\n"
+"#define __"  + fileSpec + "_h__\n"
 );
     for(size_t i=0;i<aXRCWndClassData.GetCount();++i){
                 aXRCWndClassData.Item(i).GenerateHeaderCode(file);
@@ -710,7 +715,7 @@ static wxString FileToPythonArray(wxString filename, int num)
     wxASSERT_MSG( offset == lng, wxT("Huge file not supported") );
 
     snum.Printf(_T("%i"), num);
-    output = _T("    xml_res_file_") + snum + _T(" = '''\\\n");
+    output = "    xml_res_file_" + snum + " = '''\\\n";
 
     unsigned char *buffer = new unsigned char[lng];
     file.Read(buffer, lng);
@@ -763,7 +768,7 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
     );
 
 
-    file.Write("def ") + parFuncname + _T("():\n");
+    file.Write("def " + parFuncname + "():\n");
 
     for (i = 0; i < flist.GetCount(); i++)
         file.Write(
@@ -813,7 +818,7 @@ void XmlResApp::OutputGettext()
         fout.Open(parOutput, wxT("wt"));
 
     for (size_t i = 0; i < str.GetCount(); i++)
-        fout.Write("_(\"") + str[i] + "\");\n";
+        fout.Write("_(\"" + str[i] + "\");\n");
 
     if (!parOutput) fout.Detach();
 }
@@ -912,7 +917,7 @@ wxArrayString XmlResApp::FindStrings(wxXmlNode *node)
             // ...and known to contain translatable string
         {
             if (!flagGettext ||
-                node->GetPropVal(_T("translate"), _T("1")) != _T("0"))
+                node->GetAttribute(_T("translate"), _T("1")) != _T("0"))
             {
                 arr.Add(ConvertText(n->GetContent()));
             }