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);
362 wxString
wxMacFindFolder( short vol
,
364 Boolean createFolder
)
370 if ( FindFolder( vol
, folderType
, createFolder
, &vRefNum
, &dirID
) == noErr
)
373 if ( FSMakeFSSpec( vRefNum
, dirID
, "\p" , &file
) == noErr
)
375 strDir
= wxMacFSSpec2MacFilename( &file
) + wxFILE_SEP_PATH
;
381 // Check whether this window wants to process messages, e.g. Stop button
382 // in long calculations.
383 bool wxCheckForInterrupt(wxWindow
*wnd
)
389 void wxGetMousePosition( int* x
, int* y
)
394 LocalToGlobal( &pt
) ;
399 // Return TRUE if we have a colour display
400 bool wxColourDisplay()
405 // Returns depth of screen
409 SetRect(&globRect
, -32760, -32760, 32760, 32760);
410 GDHandle theMaxDevice
;
413 theMaxDevice
= GetMaxDevice(&globRect
);
414 if (theMaxDevice
!= nil
)
415 theDepth
= (**(**theMaxDevice
).gdPMap
).pixelSize
;
420 // Get size of display
421 void wxDisplaySize(int *width
, int *height
)
424 GetQDGlobalsScreenBits( &screenBits
);
427 *width
= screenBits
.bounds
.right
- screenBits
.bounds
.left
;
429 if (height
!= NULL
) {
430 *height
= screenBits
.bounds
.bottom
- screenBits
.bounds
.top
;
434 void wxDisplaySizeMM(int *width
, int *height
)
436 wxDisplaySize(width
, height
);
437 // on mac 72 is fixed (at least now ;-)
438 float cvPt2Mm
= 25.4 / 72;
441 *width
= int( *width
* cvPt2Mm
);
443 if (height
!= NULL
) {
444 *height
= int( *height
* cvPt2Mm
);
448 void wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
)
451 GetQDGlobalsScreenBits( &screenBits
);
457 *width
= screenBits
.bounds
.right
- screenBits
.bounds
.left
;
459 if (height
!= NULL
) {
460 *height
= screenBits
.bounds
.bottom
- screenBits
.bounds
.top
;
465 GetThemeMenuBarHeight( &mheight
) ;
467 mheight
= LMGetMBarHeight() ;
469 if (height
!= NULL
) {
476 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
478 return wxGenericFindWindowAtPoint(pt
);
485 wxString
wxGetOsDescription()
487 #ifdef WXWIN_OS_DESCRIPTION
488 // use configure generated description if available
489 return wxString(wxT("MacOS (")) + wxT(WXWIN_OS_DESCRIPTION
) + wxString(wxT(")"));
491 return wxT("MacOS") ; //TODO:define further
496 wxChar
*wxGetUserHome (const wxString
& user
)
502 bool wxGetDiskSpace(const wxString
& path
, wxLongLong
*pTotal
, wxLongLong
*pFree
)
512 int pos
= p
.Find(':') ;
513 if ( pos
!= wxNOT_FOUND
) {
522 wxMacStringToPascal( p
, volumeName
) ;
523 OSErr err
= XGetVolumeInfoNoName( volumeName
, 0 , &pb
) ;
524 if ( err
== noErr
) {
526 (*pTotal
) = wxLongLong( pb
.ioVTotalBytes
) ;
529 (*pFree
) = wxLongLong( pb
.ioVFreeBytes
) ;
533 return err
== noErr
;
535 #endif // !__DARWIN__
541 //---------------------------------------------------------------------------
542 // wxMac Specific utility functions
543 //---------------------------------------------------------------------------
545 char StringMac
[] = "\x0d\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
546 "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
547 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xae\xaf"
548 "\xb1\xb4\xb5\xb6\xbb\xbc\xbe\xbf"
549 "\xc0\xc1\xc2\xc4\xc7\xc8\xc9\xcb\xcc\xcd\xce\xcf"
550 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xca\xdb" ;
552 char StringANSI
[] = "\x0a\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8"
553 "\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC"
554 "\x86\xBA\xA2\xA3\xA7\x95\xB6\xDF\xAE\xA9\x99\xB4\xA8\xC6\xD8"
555 "\xB1\xA5\xB5\xF0\xAA\xBA\xE6\xF8"
556 "\xBF\xA1\xAC\x83\xAB\xBB\x85\xC0\xC3\xD5\x8C\x9C"
557 "\x96\x97\x93\x94\x91\x92\xF7\xFF\xA0\x80" ;
559 void wxMacConvertFromPC( const char *from
, char *to
, int len
)
564 for( int i
= 0 ; i
< len
; ++ i
)
566 c
= strchr( StringANSI
, *from
) ;
569 *to
= StringMac
[ c
- StringANSI
] ;
577 for( int i
= 0 ; i
< len
; ++ i
)
579 c
= strchr( StringANSI
, *from
) ;
582 *to
= StringMac
[ c
- StringANSI
] ;
594 void wxMacConvertToPC( const char *from
, char *to
, int len
)
599 for( int i
= 0 ; i
< len
; ++ i
)
601 c
= strchr( StringMac
, *from
) ;
604 *to
= StringANSI
[ c
- StringMac
] ;
612 for( int i
= 0 ; i
< len
; ++ i
)
614 c
= strchr( StringMac
, *from
) ;
617 *to
= StringANSI
[ c
- StringMac
] ;
629 TECObjectRef s_TECNativeCToUnicode
= NULL
;
630 TECObjectRef s_TECUnicodeToNativeC
= NULL
;
631 TECObjectRef s_TECPlatformToNativeC
= NULL
;
632 TECObjectRef s_TECNativeCToPlatform
= NULL
;
633 void wxMacSetupConverters()
635 // if we assume errors are happening here we need low level debugging
636 // since the high level assert will use the encoders that are not yet
638 const int kEncoding
= wxApp::s_macDefaultEncodingIsPC
639 ? (int)kTextEncodingWindowsLatin1
640 : (int)kTextEncodingMacRoman
;
642 OSStatus status
= noErr
;
643 status
= TECCreateConverter(&s_TECNativeCToUnicode
,
645 kTextEncodingUnicodeDefault
);
648 status
= TECCreateConverter(&s_TECUnicodeToNativeC
,
649 kTextEncodingUnicodeDefault
,
652 if ( wxApp::s_macDefaultEncodingIsPC
)
654 status
= TECCreateConverter(&s_TECPlatformToNativeC
,
655 kTextEncodingMacRoman
,
656 kTextEncodingWindowsLatin1
);
659 status
= TECCreateConverter(&s_TECNativeCToPlatform
,
660 kTextEncodingWindowsLatin1
,
661 kTextEncodingMacRoman
);
665 void wxMacCleanupConverters()
667 OSStatus status
= noErr
;
668 status
= TECDisposeConverter(s_TECNativeCToUnicode
);
670 status
= TECDisposeConverter(s_TECUnicodeToNativeC
);
672 status
= TECDisposeConverter(s_TECPlatformToNativeC
);
674 status
= TECDisposeConverter(s_TECNativeCToPlatform
);
677 wxWCharBuffer
wxMacStringToWString( const wxString
&from
)
680 wxWCharBuffer
result( from
.wc_str() ) ;
682 OSStatus status
= noErr
;
683 ByteCount byteOutLen
;
684 ByteCount byteInLen
= from
.Length() ;
685 ByteCount byteBufferLen
= byteInLen
*2 ;
686 wxWCharBuffer
result( from
.Length() ) ;
687 status
= TECConvertText(s_TECNativeCToUnicode
, (ConstTextPtr
)from
.c_str() , byteInLen
, &byteInLen
,
688 (TextPtr
)result
.data(), byteBufferLen
, &byteOutLen
);
689 result
.data()[byteOutLen
/2] = 0 ;
694 wxString
wxMacMakeStringFromCString( const char * from
, int len
)
696 OSStatus status
= noErr
;
698 wxChar
* buf
= result
.GetWriteBuf( len
) ;
700 ByteCount byteOutLen
;
701 ByteCount byteInLen
= len
;
702 ByteCount byteBufferLen
= len
*2 ;
704 status
= TECConvertText(s_TECNativeCToUnicode
, (ConstTextPtr
)from
, byteInLen
, &byteInLen
,
705 (TextPtr
)buf
, byteBufferLen
, &byteOutLen
);
707 if ( !wxApp::s_macDefaultEncodingIsPC
)
708 memcpy( buf
, from
, len
) ;
711 ByteCount byteOutLen
;
712 ByteCount byteInLen
= len
;
713 ByteCount byteBufferLen
= byteInLen
;
715 status
= TECConvertText(s_TECPlatformToNativeC
, (ConstTextPtr
)from
, byteInLen
, &byteInLen
,
716 (TextPtr
)buf
, byteBufferLen
, &byteOutLen
);
720 result
.UngetWriteBuf() ;
724 wxString
wxMacMakeStringFromCString( const char * from
)
726 return wxMacMakeStringFromCString( from
, strlen(from
) ) ;
729 wxCharBuffer
wxMacStringToCString( const wxString
&from
)
732 OSStatus status
= noErr
;
733 ByteCount byteOutLen
;
734 ByteCount byteInLen
= from
.Length() * 2 ;
735 ByteCount byteBufferLen
= from
.Length() ;
736 wxCharBuffer
result( from
.Length() ) ;
737 status
= TECConvertText(s_TECUnicodeToNativeC
, (ConstTextPtr
)from
.wc_str() , byteInLen
, &byteInLen
,
738 (TextPtr
)result
.data(), byteBufferLen
, &byteOutLen
);
741 if ( !wxApp::s_macDefaultEncodingIsPC
)
742 return wxCharBuffer( from
.c_str() ) ;
745 wxCharBuffer
result( from
.Length() ) ;
746 OSStatus status
= noErr
;
747 ByteCount byteOutLen
;
748 ByteCount byteInLen
= from
.Length() ;
749 ByteCount byteBufferLen
= byteInLen
;
751 status
= TECConvertText(s_TECNativeCToPlatform
, (ConstTextPtr
)from
.c_str() , byteInLen
, &byteInLen
,
752 (TextPtr
)result
.data(), byteBufferLen
, &byteOutLen
);
758 void wxMacStringToPascal( const wxString
&from
, StringPtr to
)
760 wxCharBuffer buf
= wxMacStringToCString( from
) ;
761 int len
= strlen(buf
) ;
766 memcpy( (char*) &to
[1] , buf
, len
) ;
769 wxString
wxMacMakeStringFromPascal( ConstStringPtr from
)
771 return wxMacMakeStringFromCString( (char*) &from
[1] , from
[0] ) ;
775 // CFStringRefs (Carbon only)
779 // converts this string into a carbon foundation string with optional pc 2 mac encoding
780 void wxMacCFStringHolder::Assign( const wxString
&str
)
783 m_cfs
= CFStringCreateWithCharacters( kCFAllocatorDefault
,
784 (const unsigned short*)str
.wc_str(), str
.Len() );
786 m_cfs
= CFStringCreateWithCString( kCFAllocatorSystemDefault
, str
.c_str() ,
787 wxApp::s_macDefaultEncodingIsPC
?
788 kCFStringEncodingWindowsLatin1
: CFStringGetSystemEncoding() ) ;
793 wxString
wxMacCFStringHolder::AsString()
796 Size len
= CFStringGetLength( m_cfs
) ;
797 wxChar
* buf
= result
.GetWriteBuf( len
) ;
799 CFStringGetCharacters( m_cfs
, CFRangeMake( 0 , len
) , (UniChar
*) buf
) ;
801 CFStringGetCString( m_cfs
, buf
, len
+1 , wxApp::s_macDefaultEncodingIsPC
?
802 kCFStringEncodingWindowsLatin1
: CFStringGetSystemEncoding() ) ;
805 result
.UngetWriteBuf() ;
811 wxString
wxMacMakeMacStringFromPC( const wxChar
* p
)
814 int len
= wxStrlen ( p
) ;
817 wxChar
* ptr
= result
.GetWriteBuf(len
) ;
818 wxMacConvertFromPC( p
, ptr
, len
) ;
820 result
.UngetWriteBuf( len
) ;
825 wxString
wxMacMakePCStringFromMac( const wxChar
* p
)
828 int len
= wxStrlen ( p
) ;
831 wxChar
* ptr
= result
.GetWriteBuf(len
) ;
832 wxMacConvertToPC( p
, ptr
, len
) ;
834 result
.UngetWriteBuf( len
) ;
839 wxString
wxMacMakeStringFromMacString( const wxChar
* from
, bool mac2pcEncoding
)
843 return wxMacMakePCStringFromMac( from
) ;
847 return wxString( from
) ;
855 wxString
wxMacMakeStringFromPascal( ConstStringPtr from
, bool mac2pcEncoding
)
857 // this is safe since a pascal string can never be larger than 256 bytes
859 CopyPascalStringToC( from
, s
) ;
862 return wxMacMakePCStringFromMac( s
) ;
866 return wxString( s
) ;
870 void wxMacStringToPascal( const wxChar
* from
, StringPtr to
, bool pc2macEncoding
)
874 CopyCStringToPascal( wxMacMakeMacStringFromPC( from
) , to
) ;
878 CopyCStringToPascal( from
, to
) ;
884 #endif //TARGET_CARBON
886 // ----------------------------------------------------------------------------
888 // ----------------------------------------------------------------------------
890 #if defined(__WXMAC__) && !defined(__DARWIN__) && defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
892 // MetroNub stuff doesn't seem to work in CodeWarrior 5.3 Carbon builds...
894 #ifndef __MetroNubUtils__
895 #include "MetroNubUtils.h"
902 #if TARGET_API_MAC_CARBON
904 #include <CodeFragments.h>
906 extern "C" long CallUniversalProc(UniversalProcPtr theProcPtr
, ProcInfoType procInfo
, ...);
908 ProcPtr gCallUniversalProc_Proc
= NULL
;
912 static MetroNubUserEntryBlock
* gMetroNubEntry
= NULL
;
914 static long fRunOnce
= false;
916 /* ---------------------------------------------------------------------------
918 --------------------------------------------------------------------------- */
920 Boolean
IsMetroNubInstalled()
927 gMetroNubEntry
= NULL
;
929 if (Gestalt(gestaltSystemVersion
, &value
) == noErr
&& value
< 0x1000)
931 /* look for MetroNub's Gestalt selector */
932 if (Gestalt(kMetroNubUserSignature
, &result
) == noErr
)
935 #if TARGET_API_MAC_CARBON
936 if (gCallUniversalProc_Proc
== NULL
)
938 CFragConnectionID connectionID
;
941 ProcPtr symbolAddress
;
943 CFragSymbolClass symbolClass
;
945 symbolAddress
= NULL
;
946 err
= GetSharedLibrary("\pInterfaceLib", kPowerPCCFragArch
, kFindCFrag
,
947 &connectionID
, &mainAddress
, errorString
);
951 gCallUniversalProc_Proc
= NULL
;
955 err
= FindSymbol(connectionID
, "\pCallUniversalProc",
956 (Ptr
*) &gCallUniversalProc_Proc
, &symbolClass
);
960 gCallUniversalProc_Proc
= NULL
;
967 MetroNubUserEntryBlock
* block
= (MetroNubUserEntryBlock
*)result
;
969 /* make sure the version of the API is compatible */
970 if (block
->apiLowVersion
<= kMetroNubUserAPIVersion
&&
971 kMetroNubUserAPIVersion
<= block
->apiHiVersion
)
972 gMetroNubEntry
= block
; /* success! */
981 #if TARGET_API_MAC_CARBON
982 return (gMetroNubEntry
!= NULL
&& gCallUniversalProc_Proc
!= NULL
);
984 return (gMetroNubEntry
!= NULL
);
988 /* ---------------------------------------------------------------------------
989 IsMWDebuggerRunning [v1 API]
990 --------------------------------------------------------------------------- */
992 Boolean
IsMWDebuggerRunning()
994 if (IsMetroNubInstalled())
995 return CallIsDebuggerRunningProc(gMetroNubEntry
->isDebuggerRunning
);
1000 /* ---------------------------------------------------------------------------
1001 AmIBeingMWDebugged [v1 API]
1002 --------------------------------------------------------------------------- */
1004 Boolean
AmIBeingMWDebugged()
1006 if (IsMetroNubInstalled())
1007 return CallAmIBeingDebuggedProc(gMetroNubEntry
->amIBeingDebugged
);
1012 extern bool WXDLLEXPORT
wxIsDebuggerRunning()
1014 return IsMWDebuggerRunning() && AmIBeingMWDebugged();
1019 extern bool WXDLLEXPORT
wxIsDebuggerRunning()
1024 #endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400)