]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/app.cpp
vsprintf() is ANSI so there is normally no need to test for it
[wxWidgets.git] / src / gtk1 / app.cpp
index d65cff17cf4185f0a326c03b8edaa4284db67bd6..05395a5b4682c069ab043eb870afd6f9bbf97379 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        app.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling, Julian Smart
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -20,6 +20,7 @@
 #include "wx/font.h"
 #include "wx/settings.h"
 #include "wx/resource.h"
+#include "wx/module.h"
 
 #include "unistd.h"
 
@@ -323,30 +324,14 @@ void wxApp::CommonInit(void)
 
   wxInitializeResourceSystem();
 
-  // For PostScript printing
-#if wxUSE_POSTSCRIPT
-/* Now done in wxPostScriptModule
-  wxInitializePrintSetupData();
-  wxThePrintPaperDatabase = new wxPrintPaperDatabase;
-  wxThePrintPaperDatabase->CreateDatabase();
- */
-#endif
-
-
-/*
-  wxBitmap::InitStandardHandlers();
-
-  g_globalCursor = new wxCursor;
-*/
+  wxImage::InitStandardHandlers();
+  
+//  g_globalCursor = new wxCursor;
 }
 
 void wxApp::CommonCleanUp(void)
 {
   wxDELETE(wxTheColourDatabase);
-/* Now done in wxPostScriptModule
-  wxDELETE(wxThePrintPaperDatabase);
-  wxDELETE(wxThePrintSetupData);
- */
   wxDELETE(wxTheFontNameDirectory);
   wxDeleteStockObjects();
 
@@ -357,6 +342,8 @@ void wxApp::CommonCleanUp(void)
   wxDeleteStockLists();
 
   wxCleanUpResourceSystem();
+  
+  wxImage::CleanUpHandlers();
 
   wxSystemSettings::Done();
 }
@@ -376,13 +363,14 @@ int wxEntry( int argc, char *argv[] )
 
   wxClassInfo::InitializeClasses();
 
-#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+  /* Debug stream no longer used
+#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
   streambuf* sBuf = new wxDebugStreamBuf;
   ostream* oStr = new ostream(sBuf) ;
   wxDebugContext::SetStream(oStr, sBuf);
-
 #endif
+*/
 
   if (!wxTheApp)
   {
@@ -437,6 +425,9 @@ int wxEntry( int argc, char *argv[] )
 
   wxApp::CommonInit();
 
+  wxModule::RegisterModules();
+  if (!wxModule::InitializeModules()) return FALSE;
+    
   wxTheApp->OnInitGui();
 
   // Here frames insert themselves automatically
@@ -455,29 +446,32 @@ int wxEntry( int argc, char *argv[] )
 
   wxTheApp->OnExit();
 
+  wxModule::CleanUpModules();
+  
   wxApp::CommonCleanUp();
 
   wxDELETE(wxTheApp);
 
-  wxLog *oldLog = wxLog::SetActiveTarget( NULL );
-  if (oldLog) delete oldLog;
-  
   wxClassInfo::CleanUpClasses();
   
   delete[] wxBuffer;
   
-#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
   
   if (wxDebugContext::CountObjectsLeft() > 0)
   {
-    wxTrace("There were memory leaks.\n");
+    wxLogDebug("There were memory leaks.\n");
     wxDebugContext::Dump();
     wxDebugContext::PrintStatistics();
   }
-  wxDebugContext::SetStream(NULL, NULL);
+//  wxDebugContext::SetStream(NULL, NULL);
   
 #endif
 
+  wxLog *oldLog = wxLog::SetActiveTarget( NULL );
+  if (oldLog) delete oldLog;
+
+
   return retValue;
 }