#include "wx/dynarray.h"
#include "wx/wxchar.h"
#include "wx/icon.h"
+ #include "wx/stdpaths.h"
+ #include "wx/filename.h"
#endif
#include "wx/log.h"
// ---------------------------------------------------------------------------
extern wxChar* wxBuffer;
-extern wxList* wxWinHandleList;
extern wxList WXDLLEXPORT wxPendingDelete;
extern wxCursor* g_globalCursor;
void* gsock;
};
-// These defines and wrapper functions are used here and in gsockpm.c
+// These defines are used here and in gsockpm.cpp
#define wxSockReadMask 0x01
#define wxSockWriteMask 0x02
-#ifdef __EMX__
-extern "C"
-int wxAppAddSocketHandler(int handle, int mask,
- void (*callback)(void*), void * gsock)
-{
- return wxTheApp->AddSocketHandler(handle, mask, callback, gsock);
-}
-extern "C"
-void wxAppRemoveSocketHandler(int handle)
-{
- wxTheApp->RemoveSocketHandler(handle);
-}
-#else
-// Linkage mode problems using callbacks with extern C in a .cpp module
-int wxAppAddSocketHandler(int handle, int mask,
- void (*callback)(void*), void * gsock)
-{
- return wxTheApp->AddSocketHandler(handle, mask, callback, gsock);
-}
-void wxAppRemoveSocketHandler(int handle)
-{
- wxTheApp->RemoveSocketHandler(handle);
-}
-#endif
-
void wxApp::HandleSockets()
{
bool pendingEvent = FALSE;
// OS2 has to have an anchorblock
//
vHabmain = WinInitialize(0);
-
+ wxFileName GetPrefix(argv[0]);
+ GetPrefix.MakeAbsolute();
+ wxStandardPaths::SetInstallPrefix(GetPrefix.GetPath());
if (!vHabmain)
{
// TODO: at least give some error message here...
// wxRedirectIOToConsole();
#endif
- wxWinHandleList = new wxList(wxKEY_INTEGER);
+ wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
// This is to foil optimizations in Visual C++ that throw out dummy.obj.
// PLEASE DO NOT ALTER THIS.
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
if (!::WinRegisterClass( vHab
{
vError = ::WinGetLastError(vHab);
sError = wxPMErrorToStr(vError);
- wxLogLastError(sError);
+ wxLogLastError(sError.c_str());
return FALSE;
}
return TRUE;
} // end of wxApp::RegisterWindowClasses
//
-// Cleans up any wxWindows internal structures left lying around
+// Cleans up any wxWidgets internal structures left lying around
//
void wxApp::CleanUp()
{
// TODO: ::DeleteObject( wxDisableButtonBrush );
}
- if (wxWinHandleList)
- delete wxWinHandleList;
+ delete wxWinHandleHash;
+ wxWinHandleHash = NULL;
// Delete Message queue
if (wxTheApp->m_hMq)
#endif
} // end of wxApp::~wxApp
-bool wxApp::Initialized()
-{
- if (GetTopWindow())
- return TRUE;
- else
- return FALSE;
-} // end of wxApp::Initialized
-
bool gbInOnIdle = FALSE;
void wxApp::OnIdle(