-//
-// TODO BEGIN move to utils_osx.cpp
-//
-
-#if wxUSE_BASE
-
-extern bool WXDLLEXPORT wxIsDebuggerRunning()
-{
- // TODO : try to find out ...
- return false;
-}
-
-#if wxOSX_USE_COCOA_OR_CARBON
-
-// our OS version is the same in non GUI and GUI cases
-wxOperatingSystemId wxGetOsVersion(int *majorVsn, int *minorVsn)
-{
- SInt32 theSystem;
- Gestalt(gestaltSystemVersion, &theSystem);
-
- if ( majorVsn != NULL )
- *majorVsn = (theSystem >> 8);
-
- if ( minorVsn != NULL )
- *minorVsn = (theSystem & 0xFF);
-
- return wxOS_MAC_OSX_DARWIN;
-}
-
-#include <sys/utsname.h>
-
-wxString wxGetOsDescription()
-{
- struct utsname name;
- uname(&name);
- return wxString::Format(_T("Mac OS X (%s %s %s)"),
- wxString::FromAscii(name.sysname).c_str(),
- wxString::FromAscii(name.release).c_str(),
- wxString::FromAscii(name.machine).c_str());
-}
-
-#endif // wxOSX_USE_COCOA_OR_CARBON
-
-
-//---------------------------------------------------------------------------
-// wxMac Specific utility functions
-//---------------------------------------------------------------------------
-
-void wxMacStringToPascal( const wxString&from , StringPtr to )
-{
- wxCharBuffer buf = from.mb_str( wxConvLocal );
- int len = strlen(buf);
-
- if ( len > 255 )
- len = 255;
- to[0] = len;
- memcpy( (char*) &to[1] , buf , len );
-}
-
-wxString wxMacMakeStringFromPascal( ConstStringPtr from )
-{
- return wxString( (char*) &from[1] , wxConvLocal , from[0] );
-}
-
-#endif // wxUSE_BASE
-
-#if wxUSE_GUI
-
-// Check whether this window wants to process messages, e.g. Stop button
-// in long calculations.
-bool wxCheckForInterrupt(wxWindow *WXUNUSED(wnd))
-{
- // TODO
- return false;
-}
-
-// Return true if we have a colour display
-bool wxColourDisplay()
-{
- return true;
-}
-
-#if wxOSX_USE_COCOA_OR_CARBON
-// Returns depth of screen
-int wxDisplayDepth()
-{
- int theDepth = (int) CGDisplayBitsPerPixel(CGMainDisplayID());
- return theDepth;
-}
-
-// Get size of display
-void wxDisplaySize(int *width, int *height)
-{
- // TODO adapt for multi-displays
- CGRect bounds = CGDisplayBounds(CGMainDisplayID());
- if ( width )
- *width = (int)bounds.size.width ;
- if ( height )
- *height = (int)bounds.size.height;
-}
-#endif
-
-void wxDisplaySizeMM(int *width, int *height)
-{
- wxDisplaySize(width, height);
- // on mac 72 is fixed (at least now;-)
- double cvPt2Mm = 25.4 / 72;
-
- if (width != NULL)
- *width = int( *width * cvPt2Mm );
-
- if (height != NULL)
- *height = int( *height * cvPt2Mm );
-}
-
-
-wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
-{
- // We suppose that toolkit version is the same as OS version under Mac
- wxGetOsVersion(verMaj, verMin);
-
- return wxPORT_OSX;
-}
-
-wxEventLoopBase* wxGUIAppTraits::CreateEventLoop()
-{
- return new wxEventLoop;
-}
-
-wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
-{
- return wxGenericFindWindowAtPoint(pt);
-}
-
-/*
- Return the generic RGB color space. This is a 'get' function and the caller should
- not release the returned value unless the caller retains it first. Usually callers
- of this routine will immediately use the returned colorspace with CoreGraphics
- so they typically do not need to retain it themselves.
-
- This function creates the generic RGB color space once and hangs onto it so it can
- return it whenever this function is called.
-*/
-
-CGColorSpaceRef wxMacGetGenericRGBColorSpace()
-{
- static wxCFRef<CGColorSpaceRef> genericRGBColorSpace;
-
- if (genericRGBColorSpace == NULL)
- {
-#if wxOSX_USE_IPHONE
- genericRGBColorSpace.reset( CGColorSpaceCreateDeviceRGB() );
-#else
- genericRGBColorSpace.reset( CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB ) );
-#endif
- }
-
- return genericRGBColorSpace;
-}
-
-#if wxOSX_USE_COCOA_OR_CARBON
-
-CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush )
-{
- CGColorRef color ;
- HIThemeBrushCreateCGColor( brush, &color );
- return color;
-}
-
-#endif // wxOSX_USE_COCOA_OR_CARBON
-
-IMPLEMENT_ABSTRACT_CLASS( wxWidgetImpl , wxObject )
-
-wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , bool isRootControl )
-{
- Init();
- m_isRootControl = isRootControl;
- m_wxPeer = peer;
-}
-
-wxWidgetImpl::wxWidgetImpl()
-{
- Init();
-}
-
-wxWidgetImpl::~wxWidgetImpl()
-{
-}
-
-void wxWidgetImpl::Init()
-{
- m_isRootControl = false;
- m_wxPeer = NULL;
- m_needsFocusRect = false;
-}
-
-void wxWidgetImpl::Destroy()
-{
-}
-
-void wxWidgetImpl::SetNeedsFocusRect( bool needs )
-{
- m_needsFocusRect = needs;
-}
-
-bool wxWidgetImpl::NeedsFocusRect() const
-{
- return m_needsFocusRect;
-}
-
-#endif // wxUSE_GUI
-
-//
-// TODO END move to utils_osx.cpp
-//
-
-//
-// carbon version
-//
-
-#if wxOSX_USE_CARBON
-