// Name: app.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $id$
+// Id: $Id$
// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/font.h"
#include "wx/settings.h"
#include "wx/resource.h"
+#include "wx/module.h"
#include "unistd.h"
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();
wxDeleteStockLists();
wxCleanUpResourceSystem();
+
+ wxImage::CleanUpHandlers();
wxSystemSettings::Done();
}
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)
{
wxApp::CommonInit();
+ wxModule::RegisterModules();
+ if (!wxModule::InitializeModules()) return FALSE;
+
wxTheApp->OnInitGui();
// Here frames insert themselves automatically
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;
}