]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/utils/convertrc/rc2xml.cpp
offset version by 1 to avoid having compatibility_version of 0.0.0 under Darwin:...
[wxWidgets.git] / contrib / utils / convertrc / rc2xml.cpp
index cbe9100bfea5ad4d6651d050515b275272b6b9cf..84550e020519d28b0b262c2b6b212614c1c127ef 100644 (file)
@@ -15,11 +15,6 @@ cross platform (wxGTK,etc)
 3.  Be able to abort incorrectly formated files without crashing
 */
 
 3.  Be able to abort incorrectly formated files without crashing
 */
 
-#ifdef __GNUG__
-#pragma implementation "rc2xml.cpp"
-#pragma interface "rc2xml.cpp"
-#endif
-
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
@@ -30,7 +25,7 @@ cross platform (wxGTK,etc)
 // for all others, include the necessary headers (this file is usually all you
 // need because it includes almost all "standard" wxWidgets headers
 #ifndef WX_PRECOMP
 // for all others, include the necessary headers (this file is usually all you
 // need because it includes almost all "standard" wxWidgets headers
 #ifndef WX_PRECOMP
-#include <wx/wx.h>
+#include "wx/wx.h"
 #endif
 
 
 #endif
 
 
@@ -38,8 +33,8 @@ cross platform (wxGTK,etc)
 #include "wx/image.h"
 #include "wx/deprecated/setup.h"
 #include "wx/deprecated/resource.h"
 #include "wx/image.h"
 #include "wx/deprecated/setup.h"
 #include "wx/deprecated/resource.h"
-#include <wx/textfile.h>
-#include <wx/tokenzr.h>
+#include "wx/textfile.h"
+#include "wx/tokenzr.h"
 
 
 
 
 
 
@@ -343,7 +338,7 @@ void rc2xml::ParsePushButton(wxString phrase, wxString varname)
 }
 
 
 }
 
 
-bool rc2xml::Seperator(int ch)
+bool rc2xml::Separator(int ch)
 {
 //if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='|')|(ch=='\t'))
     if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='\t'))
 {
 //if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='|')|(ch=='\t'))
     if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='\t'))
@@ -388,7 +383,7 @@ bool rc2xml::ReadRect(int & x, int & y, int & width, int & height)
     return ret; // check for more parameters
 }
 
     return ret; // check for more parameters
 }
 
-wxString rc2xml::GetToken(bool *listseperator)
+wxString rc2xml::GetToken(bool *listseparator)
 {
     wxString token=wxEmptyString;
 
 {
     wxString token=wxEmptyString;
 
@@ -406,7 +401,7 @@ wxString rc2xml::GetToken(bool *listseperator)
     return token;
     }
 
     return token;
     }
 
-    while (Seperator(ch))
+    while (Separator(ch))
     {
     ReadChar(ch);
     if (m_done)
     {
     ReadChar(ch);
     if (m_done)
@@ -419,7 +414,7 @@ wxString rc2xml::GetToken(bool *listseperator)
     }
 
 
     }
 
 
-    while (!Seperator(ch))
+    while (!Separator(ch))
     {
     token += (char)ch;
     ReadChar(ch);
     {
     token += (char)ch;
     ReadChar(ch);
@@ -428,8 +423,8 @@ wxString rc2xml::GetToken(bool *listseperator)
     if (ch == EOF)
         m_done = true;
 
     if (ch == EOF)
         m_done = true;
 
-    if (listseperator)
-      *listseperator = (ch == ',');
+    if (listseparator)
+      *listseparator = (ch == ',');
     return token;
 }
 
     return token;
 }
 
@@ -621,25 +616,22 @@ void rc2xml::ParsePopupMenu()
 
 wxString rc2xml::PeekToken()
 {
 
 wxString rc2xml::PeekToken()
 {
-    wxString token;
-    int p;
-    p=m_rc.Tell();
-    token=GetToken();
+    wxFileOffset p = m_rc.Tell();
+    wxString token=GetToken();
 
     m_rc.Seek(p);
     return token;
 }
 
     m_rc.Seek(p);
     return token;
 }
+
 //MS Windows pain in the butt CONTROL
 void rc2xml::ParseControlMS()
 {
 //MS Windows pain in the butt CONTROL
 void rc2xml::ParseControlMS()
 {
-    wxString label,varname,kindctrl,token;
-    token=PeekToken();
+    wxString token = PeekToken();
 
     if (token.Contains(_T("\"")))
         ParseNormalMSControl();
     else
         ParseWeirdMSControl();
 
     if (token.Contains(_T("\"")))
         ParseNormalMSControl();
     else
         ParseWeirdMSControl();
-
 }
 
 /*    CONTROL         "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH |
 }
 
 /*    CONTROL         "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH |
@@ -706,15 +698,14 @@ bool rc2xml::ReadOrs(wxString & orstring)
 void rc2xml::ParseCtrlButton(wxString label, wxString varname)
 {
     wxString token;
 void rc2xml::ParseCtrlButton(wxString label, wxString varname)
 {
     wxString token;
-    int p;
-    p=m_rc.Tell();
+    wxFileOffset p = m_rc.Tell();
     ReadOrs(token);
     m_rc.Seek(p);
 
     if (token.Find(_T("BS_AUTOCHECKBOX"))!=wxNOT_FOUND)
         ParseCheckBox(label, varname);
     else if ((token.Find(_T("BS_AUTORADIOBUTTON"))!=wxNOT_FOUND)||
     ReadOrs(token);
     m_rc.Seek(p);
 
     if (token.Find(_T("BS_AUTOCHECKBOX"))!=wxNOT_FOUND)
         ParseCheckBox(label, varname);
     else if ((token.Find(_T("BS_AUTORADIOBUTTON"))!=wxNOT_FOUND)||
-                  (token.Find(_T("BS_RADIOBUTTON"))!=wxNOT_FOUND))
+             (token.Find(_T("BS_RADIOBUTTON"))!=wxNOT_FOUND))
         ParseRadioButton(label, varname);
     else if (token.Find(_T("BS_GROUPBOX"))!=wxNOT_FOUND)
         ParseGroupBox(label, varname);
         ParseRadioButton(label, varname);
     else if (token.Find(_T("BS_GROUPBOX"))!=wxNOT_FOUND)
         ParseGroupBox(label, varname);
@@ -1185,70 +1176,63 @@ void rc2xml::ParseStaticBitmap(wxString bitmapname, wxString varname)
 
 void rc2xml::ParseNormalMSControl()
 {
 
 void rc2xml::ParseNormalMSControl()
 {
-wxString label,varname,kindctrl;
-
-label=GetQuoteField();
-varname=GetToken();
-kindctrl=GetQuoteField();
-kindctrl.MakeUpper();
+    wxString label=GetQuoteField();
+    wxString varname=GetToken();
+    wxString kindctrl=GetQuoteField();
+    kindctrl.MakeUpper();
 
     if (kindctrl==_T("MSCTLS_UPDOWN32"))
         ParseSpinCtrl(label,varname);
 
     if (kindctrl==_T("MSCTLS_UPDOWN32"))
         ParseSpinCtrl(label,varname);
-    if (kindctrl==_T("MSCTLS_TRACKBAR32"))
+    else if (kindctrl==_T("MSCTLS_TRACKBAR32"))
         ParseSlider(label,varname);
         ParseSlider(label,varname);
-    if (kindctrl==_T("MSCTLS_PROGRESS32"))
+    else if (kindctrl==_T("MSCTLS_PROGRESS32"))
         ParseProgressBar(label,varname);
         ParseProgressBar(label,varname);
-    if (kindctrl==_T("SYSTREEVIEW32"))
+    else if (kindctrl==_T("SYSTREEVIEW32"))
         ParseTreeCtrl(label,varname);
         ParseTreeCtrl(label,varname);
-    if (kindctrl==_T("SYSMONTHCAL32"))
+    else if (kindctrl==_T("SYSMONTHCAL32"))
         ParseCalendar(label,varname);
         ParseCalendar(label,varname);
-    if (kindctrl==_T("SYSLISTVIEW32"))
+    else if (kindctrl==_T("SYSLISTVIEW32"))
         ParseListCtrl(label,varname);
         ParseListCtrl(label,varname);
-    if (kindctrl==_T("BUTTON"))
+    else if (kindctrl==_T("BUTTON"))
         ParseCtrlButton(label,varname);
         ParseCtrlButton(label,varname);
-    if (kindctrl==_T("RICHEDIT"))
+    else if (kindctrl==_T("RICHEDIT"))
         ParseRichEdit(label,varname);
         ParseRichEdit(label,varname);
-    if (kindctrl==_T("STATIC"))
-        {
+    else if (kindctrl==_T("STATIC"))
+    {
         wxString token;
         wxString token;
-        int p=m_rc.Tell();
+        wxFileOffset p = m_rc.Tell();
         ReadOrs(token);
         m_rc.Seek(p);
         if (token.Find(_T("SS_BITMAP"))!=wxNOT_FOUND)
             ParseStaticBitmap(label,varname);
         else
             ParseStaticText(label,varname);
         ReadOrs(token);
         m_rc.Seek(p);
         if (token.Find(_T("SS_BITMAP"))!=wxNOT_FOUND)
             ParseStaticBitmap(label,varname);
         else
             ParseStaticText(label,varname);
-        }
-    if (kindctrl==_T("EDIT"))
+    }
+    else if (kindctrl==_T("EDIT"))
         ParseTextCtrl(varname);
         ParseTextCtrl(varname);
-    if (kindctrl==_T("LISTBOX"))
+    else if (kindctrl==_T("LISTBOX"))
         ParseListBox(varname);
         ParseListBox(varname);
-    if (kindctrl==_T("COMBOBOX"))
+    else if (kindctrl==_T("COMBOBOX"))
         ParseComboBox(varname);
         ParseComboBox(varname);
-
 }
 
 void rc2xml::ParseWeirdMSControl()
 {
 }
 
 void rc2xml::ParseWeirdMSControl()
 {
-    wxString kindctrl;
-    wxString varname;
-    wxString id;
-    id=GetToken();
-    varname=GetToken();
-    kindctrl=GetQuoteField();
+    wxString id = GetToken();
+    wxString varname = GetToken();
+    wxString kindctrl = GetQuoteField();
     kindctrl.MakeUpper();
 //    CONTROL         IDB_FACE,IDC_STATIC,"Static",SS_BITMAP,26,62,32,30
     if (kindctrl==_T("STATIC"))
     kindctrl.MakeUpper();
 //    CONTROL         IDB_FACE,IDC_STATIC,"Static",SS_BITMAP,26,62,32,30
     if (kindctrl==_T("STATIC"))
-        {
+    {
         if (PeekToken()==_T("SS_BITMAP"))
             ParseStaticBitmap(id,varname);
         else
             wxLogError(_T("Unknown MS Control Static token"));
         if (PeekToken()==_T("SS_BITMAP"))
             ParseStaticBitmap(id,varname);
         else
             wxLogError(_T("Unknown MS Control Static token"));
-        }
-
+    }
 }
 }
-//SCROLLBAR       IDC_SCROLLBAR1,219,56,10,40,SBS_VERT
 
 
+//SCROLLBAR       IDC_SCROLLBAR1,219,56,10,40,SBS_VERT
 void rc2xml::ParseScrollBar()
 {
     wxString token;
 void rc2xml::ParseScrollBar()
 {
     wxString token;