X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dbe4a80c57a77b249ef32117efe9fd923066f958..0c1cc9483ecba053bc9a0983a4a8d48898e334f2:/src/mac/carbon/utils.cpp?ds=sidebyside diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 476431c4a1..02f46c0bc5 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -37,9 +37,8 @@ // #include "MoreFilesX.h" -#ifndef __DARWIN__ - #include - #include +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + #include #endif #if wxUSE_GUI @@ -87,8 +86,16 @@ extern bool WXDLLEXPORT wxIsDebuggerRunning() // Emit a beeeeeep void wxBell() { -#ifndef __LP64__ - SysBeep(30); +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + if ( AudioServicesPlayAlertSound ) + AudioServicesPlayAlertSound(kUserPreferredAlert); + else +#endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 + SysBeep(30); +#else + { + } #endif } @@ -126,6 +133,8 @@ void wxBeginBusyCursor(const wxCursor *cursor) { gMacStoredActiveCursor = gMacCurrentCursor; cursor->MacInstall(); + + wxSetCursor(*cursor); } //else: nothing to do, already set } @@ -140,6 +149,8 @@ void wxEndBusyCursor() { gMacStoredActiveCursor.MacInstall(); gMacStoredActiveCursor = wxNullCursor; + + wxSetCursor(wxNullCursor); } } @@ -299,14 +310,16 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt) #if wxUSE_BASE +#include + wxString wxGetOsDescription() { -#ifdef WXWIN_OS_DESCRIPTION - // use configure generated description if available - return wxString(wxT("MacOS (")) + wxT(WXWIN_OS_DESCRIPTION) + wxString(wxT(")")); -#else - return wxT("MacOS"); //TODO:define further -#endif + 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()); } #ifndef __DARWIN__ @@ -1547,7 +1560,7 @@ unsigned int wxMacDataItemBrowserControl::GetLineFromItem(const wxMacDataItem* i { DataBrowserTableViewRowIndex row; OSStatus err = GetItemRow( (DataBrowserItemID) item , &row); - wxASSERT( err == noErr); + wxCHECK( err == noErr, (unsigned)-1 ); return row; } @@ -1555,7 +1568,7 @@ wxMacDataItem* wxMacDataItemBrowserControl::GetItemFromLine(unsigned int n) con { DataBrowserItemID id; OSStatus err = GetItemID( (DataBrowserTableViewRowIndex) n , &id); - wxASSERT( err == noErr); + wxCHECK( err == noErr, NULL ); return (wxMacDataItem*) id; } @@ -1943,11 +1956,11 @@ OSStatus wxMacControl::SetTabEnabled( SInt16 tabNo , bool enable ) CGColorSpaceRef wxMacGetGenericRGBColorSpace() { - static wxMacCFRefHolder genericRGBColorSpace; + static wxCFRef genericRGBColorSpace; if (genericRGBColorSpace == NULL) { - genericRGBColorSpace.Set( CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB ) ); + genericRGBColorSpace.reset( CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB ) ); } return genericRGBColorSpace;