From 15169ab34118dbc617d499b683adcb7e4f64a961 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 15 Feb 2008 16:21:07 +0000 Subject: [PATCH] applying patch 1894478, 10.5 AudioServices support git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/utils.cpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index ed23889918..b52a6a01b3 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 } @@ -303,14 +310,15 @@ 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 + char data[128]; + struct utsname name; + uname(&name); + sprintf(data, "Mac OS X (%s %s %s)", name.sysname, name.release, name.machine); + return wxString(data, wxConvUTF8); } #ifndef __DARWIN__ -- 2.50.0