1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Various utilities
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 // Note: this is done in utilscmn.cpp now.
14 // #pragma implementation "utils.h"
20 #include "wx/apptrait.h"
23 #include "wx/mac/uma.h"
34 # include "MoreFilesX.h"
36 # include "MoreFiles.h"
37 # include "MoreFilesExtras.h"
45 #include "ATSUnicode.h"
46 #include "TextCommon.h"
47 #include "TextEncodingConverter.h"
49 #if defined(__WXMAC__)
50 #include "wx/mac/private.h" // includes mac headers
53 #if defined(__MWERKS__) && wxUSE_UNICODE
57 // ---------------------------------------------------------------------------
58 // code used in both base and GUI compilation
59 // ---------------------------------------------------------------------------
61 // our OS version is the same in non GUI and GUI cases
62 static int DoGetOSVersion(int *majorVsn
, int *minorVsn
)
66 // are there x-platform conventions ?
68 Gestalt(gestaltSystemVersion
, &theSystem
) ;
69 if (minorVsn
!= NULL
) {
70 *minorVsn
= (theSystem
& 0xFF ) ;
72 if (majorVsn
!= NULL
) {
73 *majorVsn
= (theSystem
>> 8 ) ;
85 // defined in unix/utilsunx.cpp for Mac OS X
87 // get full hostname (with domain name if possible)
88 bool wxGetFullHostName(wxChar
*buf
, int maxSize
)
90 return wxGetHostName(buf
, maxSize
);
93 // Get hostname only (without domain name)
94 bool wxGetHostName(wxChar
*buf
, int maxSize
)
96 // Gets Chooser name of user by examining a System resource.
98 const short kComputerNameID
= -16413;
100 short oldResFile
= CurResFile() ;
102 StringHandle chooserName
= (StringHandle
)::GetString(kComputerNameID
);
103 UseResFile(oldResFile
);
105 if (chooserName
&& *chooserName
)
107 HLock( (Handle
) chooserName
) ;
108 wxString name
= wxMacMakeStringFromPascal( *chooserName
) ;
109 HUnlock( (Handle
) chooserName
) ;
110 ReleaseResource( (Handle
) chooserName
) ;
111 wxStrncpy( buf
, name
, maxSize
- 1 ) ;
119 // Get user ID e.g. jacs
120 bool wxGetUserId(wxChar
*buf
, int maxSize
)
122 return wxGetUserName( buf
, maxSize
) ;
125 const wxChar
* wxGetHomeDir(wxString
*pstr
)
127 *pstr
= wxMacFindFolder( (short) kOnSystemDisk
, kPreferencesFolderType
, kDontCreateFolder
) ;
128 return pstr
->c_str() ;
131 // Get user name e.g. Stefan Csomor
132 bool wxGetUserName(wxChar
*buf
, int maxSize
)
134 // Gets Chooser name of user by examining a System resource.
136 const short kChooserNameID
= -16096;
138 short oldResFile
= CurResFile() ;
140 StringHandle chooserName
= (StringHandle
)::GetString(kChooserNameID
);
141 UseResFile(oldResFile
);
143 if (chooserName
&& *chooserName
)
145 HLock( (Handle
) chooserName
) ;
146 wxString name
= wxMacMakeStringFromPascal( *chooserName
) ;
147 HUnlock( (Handle
) chooserName
) ;
148 ReleaseResource( (Handle
) chooserName
) ;
149 wxStrncpy( buf
, name
, maxSize
- 1 ) ;
157 int wxKill(long pid
, wxSignal sig
, wxKillError
*rc
)
163 WXDLLEXPORT
bool wxGetEnv(const wxString
& var
, wxString
*value
)
165 // TODO : under classic there is no environement support, under X yes
169 // set the env var name to the given value, return TRUE on success
170 WXDLLEXPORT
bool wxSetEnv(const wxString
& var
, const wxChar
*value
)
172 // TODO : under classic there is no environement support, under X yes
177 // Execute a program in an Interactive Shell
179 bool wxShell(const wxString
& command
)
185 // Shutdown or reboot the PC
186 bool wxShutdown(wxShutdownFlags wFlags
)
192 // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
193 long wxGetFreeMemory()
198 void wxUsleep(unsigned long milliseconds
)
200 clock_t start
= clock() ;
204 } while( clock() - start
< milliseconds
/ 1000.0 * CLOCKS_PER_SEC
) ;
207 void wxSleep(int nSecs
)
209 wxUsleep(1000*nSecs
);
212 // Consume all events until no more left
217 #endif // !__DARWIN__
225 wxToolkitInfo
& wxConsoleAppTraits::GetToolkitInfo()
227 static wxToolkitInfo info
;
228 info
.os
= DoGetOSVersion(&info
.versionMajor
, &info
.versionMinor
);
229 info
.name
= _T("wxBase");
237 wxToolkitInfo
& wxGUIAppTraits::GetToolkitInfo()
239 static wxToolkitInfo info
;
240 info
.os
= DoGetOSVersion(&info
.versionMajor
, &info
.versionMinor
);
241 info
.shortName
= _T("mac");
242 info
.name
= _T("wxMac");
243 #ifdef __WXUNIVERSAL__
244 info
.shortName
<< _T("univ");
245 info
.name
<< _T("/wxUniversal");
250 // Reading and writing resources (eg WIN.INI, .Xdefaults)
252 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
258 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
261 buf
.Printf(wxT("%.4f"), value
);
263 return wxWriteResource(section
, entry
, buf
, file
);
266 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
269 buf
.Printf(wxT("%ld"), value
);
271 return wxWriteResource(section
, entry
, buf
, file
);
274 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
277 buf
.Printf(wxT("%d"), value
);
279 return wxWriteResource(section
, entry
, buf
, file
);
282 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
288 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
291 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
294 *value
= (float)strtod(s
, NULL
);
301 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
304 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
307 *value
= strtol(s
, NULL
, 10);
314 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
317 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
320 *value
= (int)strtol(s
, NULL
, 10);
326 #endif // wxUSE_RESOURCES
328 int gs_wxBusyCursorCount
= 0;
329 extern wxCursor gMacCurrentCursor
;
330 wxCursor gMacStoredActiveCursor
;
332 // Set the cursor to the busy cursor for all windows
333 void wxBeginBusyCursor(wxCursor
*cursor
)
335 if (gs_wxBusyCursorCount
++ == 0)
337 gMacStoredActiveCursor
= gMacCurrentCursor
;
338 cursor
->MacInstall() ;
340 //else: nothing to do, already set
343 // Restore cursor to normal
344 void wxEndBusyCursor()
346 wxCHECK_RET( gs_wxBusyCursorCount
> 0,
347 wxT("no matching wxBeginBusyCursor() for wxEndBusyCursor()") );
349 if (--gs_wxBusyCursorCount
== 0)
351 gMacStoredActiveCursor
.MacInstall() ;
352 gMacStoredActiveCursor
= wxNullCursor
;
356 // TRUE if we're between the above two calls
359 return (gs_wxBusyCursorCount
> 0);
366 wxString
wxMacFindFolder( short vol
,
368 Boolean createFolder
)
374 if ( FindFolder( vol
, folderType
, createFolder
, &vRefNum
, &dirID
) == noErr
)
377 if ( FSMakeFSSpec( vRefNum
, dirID
, "\p" , &file
) == noErr
)
379 strDir
= wxMacFSSpec2MacFilename( &file
) + wxFILE_SEP_PATH
;
389 // Check whether this window wants to process messages, e.g. Stop button
390 // in long calculations.
391 bool wxCheckForInterrupt(wxWindow
*wnd
)
397 void wxGetMousePosition( int* x
, int* y
)
402 LocalToGlobal( &pt
) ;
407 // Return TRUE if we have a colour display
408 bool wxColourDisplay()
413 // Returns depth of screen
417 SetRect(&globRect
, -32760, -32760, 32760, 32760);
418 GDHandle theMaxDevice
;
421 theMaxDevice
= GetMaxDevice(&globRect
);
422 if (theMaxDevice
!= nil
)
423 theDepth
= (**(**theMaxDevice
).gdPMap
).pixelSize
;
428 // Get size of display
429 void wxDisplaySize(int *width
, int *height
)
432 GetQDGlobalsScreenBits( &screenBits
);
435 *width
= screenBits
.bounds
.right
- screenBits
.bounds
.left
;
437 if (height
!= NULL
) {
438 *height
= screenBits
.bounds
.bottom
- screenBits
.bounds
.top
;
442 void wxDisplaySizeMM(int *width
, int *height
)
444 wxDisplaySize(width
, height
);
445 // on mac 72 is fixed (at least now ;-)
446 float cvPt2Mm
= 25.4 / 72;
449 *width
= int( *width
* cvPt2Mm
);
451 if (height
!= NULL
) {
452 *height
= int( *height
* cvPt2Mm
);
456 void wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
)
459 GetQDGlobalsScreenBits( &screenBits
);
465 *width
= screenBits
.bounds
.right
- screenBits
.bounds
.left
;
467 if (height
!= NULL
) {
468 *height
= screenBits
.bounds
.bottom
- screenBits
.bounds
.top
;
473 GetThemeMenuBarHeight( &mheight
) ;
475 mheight
= LMGetMBarHeight() ;
477 if (height
!= NULL
) {
484 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
486 return wxGenericFindWindowAtPoint(pt
);
493 wxString
wxGetOsDescription()
495 #ifdef WXWIN_OS_DESCRIPTION
496 // use configure generated description if available
497 return wxString(wxT("MacOS (")) + wxT(WXWIN_OS_DESCRIPTION
) + wxString(wxT(")"));
499 return wxT("MacOS") ; //TODO:define further
504 wxChar
*wxGetUserHome (const wxString
& user
)
510 bool wxGetDiskSpace(const wxString
& path
, wxLongLong
*pTotal
, wxLongLong
*pFree
)
520 int pos
= p
.Find(':') ;
521 if ( pos
!= wxNOT_FOUND
) {
530 wxMacStringToPascal( p
, volumeName
) ;
531 OSErr err
= XGetVolumeInfoNoName( volumeName
, 0 , &pb
) ;
532 if ( err
== noErr
) {
534 (*pTotal
) = wxLongLong( pb
.ioVTotalBytes
) ;
537 (*pFree
) = wxLongLong( pb
.ioVFreeBytes
) ;
541 return err
== noErr
;
543 #endif // !__DARWIN__
545 //---------------------------------------------------------------------------
546 // wxMac Specific utility functions
547 //---------------------------------------------------------------------------
549 char StringMac
[] = "\x0d\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
550 "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
551 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xae\xaf"
552 "\xb1\xb4\xb5\xb6\xbb\xbc\xbe\xbf"
553 "\xc0\xc1\xc2\xc4\xc7\xc8\xc9\xcb\xcc\xcd\xce\xcf"
554 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xca\xdb" ;
556 char StringANSI
[] = "\x0a\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8"
557 "\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC"
558 "\x86\xBA\xA2\xA3\xA7\x95\xB6\xDF\xAE\xA9\x99\xB4\xA8\xC6\xD8"
559 "\xB1\xA5\xB5\xF0\xAA\xBA\xE6\xF8"
560 "\xBF\xA1\xAC\x83\xAB\xBB\x85\xC0\xC3\xD5\x8C\x9C"
561 "\x96\x97\x93\x94\x91\x92\xF7\xFF\xA0\x80" ;
563 void wxMacConvertFromPC( const char *from
, char *to
, int len
)
568 for( int i
= 0 ; i
< len
; ++ i
)
570 c
= strchr( StringANSI
, *from
) ;
573 *to
= StringMac
[ c
- StringANSI
] ;
581 for( int i
= 0 ; i
< len
; ++ i
)
583 c
= strchr( StringANSI
, *from
) ;
586 *to
= StringMac
[ c
- StringANSI
] ;
598 void wxMacConvertToPC( const char *from
, char *to
, int len
)
603 for( int i
= 0 ; i
< len
; ++ i
)
605 c
= strchr( StringMac
, *from
) ;
608 *to
= StringANSI
[ c
- StringMac
] ;
616 for( int i
= 0 ; i
< len
; ++ i
)
618 c
= strchr( StringMac
, *from
) ;
621 *to
= StringANSI
[ c
- StringMac
] ;
633 TECObjectRef s_TECNativeCToUnicode
= NULL
;
634 TECObjectRef s_TECUnicodeToNativeC
= NULL
;
635 TECObjectRef s_TECPlatformToNativeC
= NULL
;
636 TECObjectRef s_TECNativeCToPlatform
= NULL
;
637 void wxMacSetupConverters()
639 // if we assume errors are happening here we need low level debugging
640 // since the high level assert will use the encoders that are not yet
642 const int kEncoding
= wxApp::s_macDefaultEncodingIsPC
643 ? (int)kTextEncodingWindowsLatin1
644 : (int)kTextEncodingMacRoman
;
646 OSStatus status
= noErr
;
647 status
= TECCreateConverter(&s_TECNativeCToUnicode
,
649 kTextEncodingUnicodeDefault
);
652 status
= TECCreateConverter(&s_TECUnicodeToNativeC
,
653 kTextEncodingUnicodeDefault
,
656 if ( wxApp::s_macDefaultEncodingIsPC
)
658 status
= TECCreateConverter(&s_TECPlatformToNativeC
,
659 kTextEncodingMacRoman
,
660 kTextEncodingWindowsLatin1
);
663 status
= TECCreateConverter(&s_TECNativeCToPlatform
,
664 kTextEncodingWindowsLatin1
,
665 kTextEncodingMacRoman
);
669 void wxMacCleanupConverters()
671 OSStatus status
= noErr
;
672 status
= TECDisposeConverter(s_TECNativeCToUnicode
);
674 status
= TECDisposeConverter(s_TECUnicodeToNativeC
);
676 status
= TECDisposeConverter(s_TECPlatformToNativeC
);
678 status
= TECDisposeConverter(s_TECNativeCToPlatform
);
681 wxWCharBuffer
wxMacStringToWString( const wxString
&from
)
684 wxWCharBuffer
result( from
.wc_str() ) ;
686 OSStatus status
= noErr
;
687 ByteCount byteOutLen
;
688 ByteCount byteInLen
= from
.Length() ;
689 ByteCount byteBufferLen
= byteInLen
*2 ;
690 wxWCharBuffer
result( from
.Length() ) ;
691 status
= TECConvertText(s_TECNativeCToUnicode
, (ConstTextPtr
)from
.c_str() , byteInLen
, &byteInLen
,
692 (TextPtr
)result
.data(), byteBufferLen
, &byteOutLen
);
693 result
.data()[byteOutLen
/2] = 0 ;
699 wxString
wxMacMakeStringFromCString( const char * from
, int len
)
701 OSStatus status
= noErr
;
703 wxChar
* buf
= result
.GetWriteBuf( len
) ;
705 ByteCount byteOutLen
;
706 ByteCount byteInLen
= len
;
707 ByteCount byteBufferLen
= len
*2 ;
709 status
= TECConvertText(s_TECNativeCToUnicode
, (ConstTextPtr
)from
, byteInLen
, &byteInLen
,
710 (TextPtr
)buf
, byteBufferLen
, &byteOutLen
);
712 if ( !wxApp::s_macDefaultEncodingIsPC
)
713 memcpy( buf
, from
, len
) ;
716 ByteCount byteOutLen
;
717 ByteCount byteInLen
= len
;
718 ByteCount byteBufferLen
= byteInLen
;
720 status
= TECConvertText(s_TECPlatformToNativeC
, (ConstTextPtr
)from
, byteInLen
, &byteInLen
,
721 (TextPtr
)buf
, byteBufferLen
, &byteOutLen
);
725 result
.UngetWriteBuf() ;
729 wxString
wxMacMakeStringFromCString( const char * from
)
731 return wxMacMakeStringFromCString( from
, strlen(from
) ) ;
734 wxCharBuffer
wxMacStringToCString( const wxString
&from
)
737 OSStatus status
= noErr
;
738 ByteCount byteOutLen
;
739 ByteCount byteInLen
= from
.Length() * 2 ;
740 ByteCount byteBufferLen
= from
.Length() ;
741 wxCharBuffer
result( from
.Length() ) ;
742 status
= TECConvertText(s_TECUnicodeToNativeC
, (ConstTextPtr
)from
.wc_str() , byteInLen
, &byteInLen
,
743 (TextPtr
)result
.data(), byteBufferLen
, &byteOutLen
);
746 if ( !wxApp::s_macDefaultEncodingIsPC
)
747 return wxCharBuffer( from
.c_str() ) ;
750 wxCharBuffer
result( from
.Length() ) ;
751 OSStatus status
= noErr
;
752 ByteCount byteOutLen
;
753 ByteCount byteInLen
= from
.Length() ;
754 ByteCount byteBufferLen
= byteInLen
;
756 status
= TECConvertText(s_TECNativeCToPlatform
, (ConstTextPtr
)from
.c_str() , byteInLen
, &byteInLen
,
757 (TextPtr
)result
.data(), byteBufferLen
, &byteOutLen
);
763 void wxMacStringToPascal( const wxString
&from
, StringPtr to
)
765 wxCharBuffer buf
= wxMacStringToCString( from
) ;
766 int len
= strlen(buf
) ;
771 memcpy( (char*) &to
[1] , buf
, len
) ;
774 wxString
wxMacMakeStringFromPascal( ConstStringPtr from
)
776 return wxMacMakeStringFromCString( (char*) &from
[1] , from
[0] ) ;
785 // CFStringRefs (Carbon only)
789 // converts this string into a carbon foundation string with optional pc 2 mac encoding
790 void wxMacCFStringHolder::Assign( const wxString
&str
)
793 m_cfs
= CFStringCreateWithCharacters( kCFAllocatorDefault
,
794 (const unsigned short*)str
.wc_str(), str
.Len() );
796 m_cfs
= CFStringCreateWithCString( kCFAllocatorSystemDefault
, str
.c_str() ,
797 wxApp::s_macDefaultEncodingIsPC
?
798 kCFStringEncodingWindowsLatin1
: CFStringGetSystemEncoding() ) ;
803 wxString
wxMacCFStringHolder::AsString()
806 Size len
= CFStringGetLength( m_cfs
) ;
807 wxChar
* buf
= result
.GetWriteBuf( len
) ;
809 CFStringGetCharacters( m_cfs
, CFRangeMake( 0 , len
) , (UniChar
*) buf
) ;
811 CFStringGetCString( m_cfs
, buf
, len
+1 , wxApp::s_macDefaultEncodingIsPC
?
812 kCFStringEncodingWindowsLatin1
: CFStringGetSystemEncoding() ) ;
815 result
.UngetWriteBuf() ;
821 wxString
wxMacMakeMacStringFromPC( const wxChar
* p
)
824 int len
= wxStrlen ( p
) ;
827 wxChar
* ptr
= result
.GetWriteBuf(len
) ;
828 wxMacConvertFromPC( p
, ptr
, len
) ;
830 result
.UngetWriteBuf( len
) ;
835 wxString
wxMacMakePCStringFromMac( const wxChar
* p
)
838 int len
= wxStrlen ( p
) ;
841 wxChar
* ptr
= result
.GetWriteBuf(len
) ;
842 wxMacConvertToPC( p
, ptr
, len
) ;
844 result
.UngetWriteBuf( len
) ;
849 wxString
wxMacMakeStringFromMacString( const wxChar
* from
, bool mac2pcEncoding
)
853 return wxMacMakePCStringFromMac( from
) ;
857 return wxString( from
) ;
865 wxString
wxMacMakeStringFromPascal( ConstStringPtr from
, bool mac2pcEncoding
)
867 // this is safe since a pascal string can never be larger than 256 bytes
869 CopyPascalStringToC( from
, s
) ;
872 return wxMacMakePCStringFromMac( s
) ;
876 return wxString( s
) ;
880 void wxMacStringToPascal( const wxChar
* from
, StringPtr to
, bool pc2macEncoding
)
884 CopyCStringToPascal( wxMacMakeMacStringFromPC( from
) , to
) ;
888 CopyCStringToPascal( from
, to
) ;
894 #endif //TARGET_CARBON
896 // ----------------------------------------------------------------------------
898 // ----------------------------------------------------------------------------
900 #if defined(__WXMAC__) && !defined(__DARWIN__) && defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
902 // MetroNub stuff doesn't seem to work in CodeWarrior 5.3 Carbon builds...
904 #ifndef __MetroNubUtils__
905 #include "MetroNubUtils.h"
912 #if TARGET_API_MAC_CARBON
914 #include <CodeFragments.h>
916 extern "C" long CallUniversalProc(UniversalProcPtr theProcPtr
, ProcInfoType procInfo
, ...);
918 ProcPtr gCallUniversalProc_Proc
= NULL
;
922 static MetroNubUserEntryBlock
* gMetroNubEntry
= NULL
;
924 static long fRunOnce
= false;
926 /* ---------------------------------------------------------------------------
928 --------------------------------------------------------------------------- */
930 Boolean
IsMetroNubInstalled()
937 gMetroNubEntry
= NULL
;
939 if (Gestalt(gestaltSystemVersion
, &value
) == noErr
&& value
< 0x1000)
941 /* look for MetroNub's Gestalt selector */
942 if (Gestalt(kMetroNubUserSignature
, &result
) == noErr
)
945 #if TARGET_API_MAC_CARBON
946 if (gCallUniversalProc_Proc
== NULL
)
948 CFragConnectionID connectionID
;
951 ProcPtr symbolAddress
;
953 CFragSymbolClass symbolClass
;
955 symbolAddress
= NULL
;
956 err
= GetSharedLibrary("\pInterfaceLib", kPowerPCCFragArch
, kFindCFrag
,
957 &connectionID
, &mainAddress
, errorString
);
961 gCallUniversalProc_Proc
= NULL
;
965 err
= FindSymbol(connectionID
, "\pCallUniversalProc",
966 (Ptr
*) &gCallUniversalProc_Proc
, &symbolClass
);
970 gCallUniversalProc_Proc
= NULL
;
977 MetroNubUserEntryBlock
* block
= (MetroNubUserEntryBlock
*)result
;
979 /* make sure the version of the API is compatible */
980 if (block
->apiLowVersion
<= kMetroNubUserAPIVersion
&&
981 kMetroNubUserAPIVersion
<= block
->apiHiVersion
)
982 gMetroNubEntry
= block
; /* success! */
991 #if TARGET_API_MAC_CARBON
992 return (gMetroNubEntry
!= NULL
&& gCallUniversalProc_Proc
!= NULL
);
994 return (gMetroNubEntry
!= NULL
);
998 /* ---------------------------------------------------------------------------
999 IsMWDebuggerRunning [v1 API]
1000 --------------------------------------------------------------------------- */
1002 Boolean
IsMWDebuggerRunning()
1004 if (IsMetroNubInstalled())
1005 return CallIsDebuggerRunningProc(gMetroNubEntry
->isDebuggerRunning
);
1010 /* ---------------------------------------------------------------------------
1011 AmIBeingMWDebugged [v1 API]
1012 --------------------------------------------------------------------------- */
1014 Boolean
AmIBeingMWDebugged()
1016 if (IsMetroNubInstalled())
1017 return CallAmIBeingDebuggedProc(gMetroNubEntry
->amIBeingDebugged
);
1022 extern bool WXDLLEXPORT
wxIsDebuggerRunning()
1024 return IsMWDebuggerRunning() && AmIBeingMWDebugged();
1029 extern bool WXDLLEXPORT
wxIsDebuggerRunning()
1034 #endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400)