#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
+#include "wx/textctrl.h"
#include "wx/menu.h"
#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
// mac
-#ifndef __UNIX__
+#ifndef __DARWIN__
#if __option(profile)
#include <profiler.h>
#endif
#include "wx/mac/macnotfy.h"
#if wxUSE_SOCKETS
- #ifdef __APPLE__
+ #ifdef __DARWIN__
#include <CoreServices/CoreServices.h>
#else
#include <OpenTransport.h>
int wxApp::s_lastMouseDown = 0 ;
long wxApp::sm_lastMessageTime = 0;
-#ifdef __WXMAC__
-
bool wxApp::s_macDefaultEncodingIsPC = true ;
bool wxApp::s_macSupportPCMenuShortcuts = true ;
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
OSErr wxApp::MacHandleAEODoc(const AppleEvent *event , AppleEvent *reply)
{
+ SysBeep(40) ;
ProcessSerialNumber PSN ;
PSN.highLongOfPSN = 0 ;
PSN.lowLongOfPSN = kCurrentProcess ;
return result ;
}
-#endif
+wxString wxMacMakeStringFromMacString( const char* from , bool mac2pcEncoding )
+{
+ if (mac2pcEncoding)
+ {
+ return wxMacMakePCStringFromMac( from ) ;
+ }
+ else
+ {
+ return wxString( from ) ;
+ }
+}
+
+wxString wxMacMakeStringFromPascal( StringPtr from , bool mac2pcEncoding )
+{
+ // this is safe since a pascal string can never be larger than 256 bytes
+ char s[256] ;
+ CopyPascalStringToC( from , s ) ;
+ if (mac2pcEncoding)
+ {
+ return wxMacMakePCStringFromMac( s ) ;
+ }
+ else
+ {
+ return wxString( s ) ;
+ }
+}
+
+void wxMacStringToPascal( const char * from , StringPtr to , bool pc2macEncoding )
+{
+ if (pc2macEncoding)
+ {
+ CopyCStringToPascal( wxMacMakeMacStringFromPC( from ) , to ) ;
+ }
+ else
+ {
+ CopyCStringToPascal( from , to ) ;
+ }
+}
bool wxApp::Initialize()
{
#endif
-#ifndef __UNIX__
+#ifndef __DARWIN__
// test the minimal configuration necessary
#if !TARGET_CARBON
return FALSE ;
}
-#ifndef __UNIX__
+#ifndef __DARWIN__
#if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 40 ) ;
#endif
// now avoid exceptions thrown for new (bad_alloc)
-#ifndef __UNIX__
+#ifndef __DARWIN__
std::__throws_bad_alloc = FALSE ;
#endif
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
wxTheColourDatabase->Initialize();
+#ifdef __WXDEBUG__
#if wxUSE_LOG
// flush the logged messages if any and install a 'safer' log target: the
// default one (wxLogGui) can't be used after the resources are freed just
// this will flush the old messages if any
delete wxLog::SetActiveTarget(new wxLogStderr);
#endif // wxUSE_LOG
+#endif
wxInitializeStockLists();
wxInitializeStockObjects();
wxClassInfo::CleanUpClasses();
-#ifndef __UNIX__
+#ifndef __DARWIN__
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;