]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/HelpGen/src/HelpGen.cpp
Regenerated makefiles in the correct place.
[wxWidgets.git] / utils / HelpGen / src / HelpGen.cpp
index bc4f9bd1676050c20eb94c20b773e762727c5f61..fdde4c0c5fd941408d2740eac5c8cbc563e5dcac 100644 (file)
 // wxWindows
 #include "wx/wxprec.h"
 
 // wxWindows
 #include "wx/wxprec.h"
 
-#if wxUSE_GUI
-    #error "This is a console program and can be only compiled using wxBase"
-#endif
-
 #ifndef WX_PRECOMP
     #include "wx/string.h"
     #include "wx/log.h"
     #include "wx/dynarray.h"
 #ifndef WX_PRECOMP
     #include "wx/string.h"
     #include "wx/log.h"
     #include "wx/dynarray.h"
-    #include "wx/wx.h"
+    #include "wx/app.h"
 #endif // WX_PRECOMP
 
 #include "wx/file.h"
 #endif // WX_PRECOMP
 
 #include "wx/file.h"
 #undef GetCurrentTime
 #endif
 
 #undef GetCurrentTime
 #endif
 
-// -----------------------------------------------------------------------------
-// global vars
-// -----------------------------------------------------------------------------
-
-class HelpGenApp: public wxApp
-{
-public:
-    HelpGenApp() {};
-
-    // don't let wxWin parse our cmd line, we do it ourselves
-    virtual bool OnInit() { return TRUE; }
-
-    virtual int OnRun();
-};
-
-// IMPLEMENT_APP(HelpGenApp);
-
 // -----------------------------------------------------------------------------
 // private functions
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // private functions
 // -----------------------------------------------------------------------------
@@ -542,10 +521,12 @@ private:
 // implementation
 // =============================================================================
 
 // implementation
 // =============================================================================
 
+static char **g_argv = NULL;
+
 // this function never returns
 static void usage()
 {
 // this function never returns
 static void usage()
 {
-    wxString prog = wxTheApp->argv[0];
+    wxString prog = g_argv[0];
     wxString basename = prog.AfterLast('/');
 #ifdef __WXMSW__
     if ( !basename )
     wxString basename = prog.AfterLast('/');
 #ifdef __WXMSW__
     if ( !basename )
@@ -581,8 +562,18 @@ static void usage()
     exit(1);
 }
 
     exit(1);
 }
 
-int HelpGenApp::OnRun()
+int main(int argc, char **argv)
 {
 {
+    g_argv = argv;
+
+    wxInitializer initializer;
+    if ( !initializer )
+    {
+        fprintf(stderr, "Failed to initialize the wxWindows library, aborting.");
+
+        return -1;
+    }
+
     enum
     {
         Mode_None,
     enum
     {
         Mode_None,
@@ -788,21 +779,6 @@ int HelpGenApp::OnRun()
     return 0;
 }
 
     return 0;
 }
 
-int main(int argc, char **argv)
-{
-    wxInitializer initializer;
-    if ( !initializer )
-    {
-        fprintf(stderr, "Failed to initialize the wxWindows library, aborting.");
-
-        return -1;
-    }
-       HelpGenApp app;
-       app.argc = argc;
-       app.argv = argv;
-       return app.OnRun();
-}
-
 // -----------------------------------------------------------------------------
 // HelpGenVisitor implementation
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // HelpGenVisitor implementation
 // -----------------------------------------------------------------------------
@@ -1140,6 +1116,12 @@ void HelpGenVisitor::VisitClass( spClass& cl )
     }
     totalText << derived << "\n\n";
 
     }
     totalText << derived << "\n\n";
 
+    // include file section
+    wxString includeFile = "\\wxheading{Include files}\n\n";
+    includeFile << "<" << m_fileHeader << ">";
+
+    totalText << includeFile << "\n\n";
+
     // write all this to file
     m_file.WriteTeX(totalText);
 
     // write all this to file
     m_file.WriteTeX(totalText);
 
@@ -2147,7 +2129,7 @@ static void TeXUnfilter(wxString* str)
 
     // undo TeXFilter
     static wxRegEx reNonSpecialSpecials("\\\\([#$%&_{}])"),
 
     // undo TeXFilter
     static wxRegEx reNonSpecialSpecials("\\\\([#$%&_{}])"),
-                   reAccents("\\\\verb|([~^])|");
+                   reAccents("\\\\verb\\|([~^])\\|");
 
     reNonSpecialSpecials.ReplaceAll(str, "\\1");
     reAccents.ReplaceAll(str, "\\1");
 
     reNonSpecialSpecials.ReplaceAll(str, "\\1");
     reAccents.ReplaceAll(str, "\\1");
@@ -2197,6 +2179,18 @@ static const wxString GetVersionString()
 
 /*
    $Log$
 
 /*
    $Log$
+   Revision 1.25  2003/09/03 17:39:27  MBN
+     Compilation fixes.
+
+   Revision 1.24  2003/08/13 22:59:37  VZ
+   compilation fix
+
+   Revision 1.23  2003/06/13 17:05:43  VZ
+   quote '|' inside regexes (fixes dump mode); fixed crash due to strange HelpGenApp code
+
+   Revision 1.22  2002/01/21 21:18:50  JS
+   Now adds 'include file' heading
+
    Revision 1.21  2002/01/04 11:06:09  JS
    Fixed missing membersections bug and also bug with functions not being written
    in the right class
    Revision 1.21  2002/01/04 11:06:09  JS
    Fixed missing membersections bug and also bug with functions not being written
    in the right class