Author: manolo
Date: 2010-12-29 03:33:42 -0800 (Wed, 29 Dec 2010)
New Revision: 8135
Log:
Mac OS X: removed dependency from AudioToolbox.framework by calling NSBeep()
from Cocoa.
Modified:
branches/branch-1.3/CMakeLists.txt
branches/branch-1.3/README.OSX.txt
branches/branch-1.3/configure.in
branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
branches/branch-1.3/src/Fl_cocoa.mm
branches/branch-1.3/src/fl_ask.cxx
Modified: branches/branch-1.3/CMakeLists.txt
===================================================================
--- branches/branch-1.3/CMakeLists.txt 2010-12-28 21:24:15 UTC (rev 8134)
+++ branches/branch-1.3/CMakeLists.txt 2010-12-29 11:33:42 UTC (rev 8135)
@@ -60,7 +60,7 @@
set(HAVE_STRTOLL 1)
set(HAVE_STRCASECMP 1)
set(HAVE_DIRENT_H 1)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa
-framework Carbon -framework AudioToolBox")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa
-framework Carbon")
endif(APPLE)
if(WIN32)
Modified: branches/branch-1.3/README.OSX.txt
===================================================================
--- branches/branch-1.3/README.OSX.txt 2010-12-28 21:24:15 UTC (rev 8134)
+++ branches/branch-1.3/README.OSX.txt 2010-12-29 11:33:42 UTC (rev 8135)
@@ -299,8 +299,7 @@
If the little helpers above were installed, the menu "File > New Project..."
will pop up a dialog that offers a User Template named Fluid. Select it and
-follow the instructions. You will need to add the "AudioToolbox.framework"
-manually which is needed to create warning beeps.
+follow the instructions.
@@ -310,3 +309,4 @@
Oct 29 2010 - matt: removed warnings
Oct 24 2010 - matt: restructured entire document and verified instructions
Dec 19 2010 - Manolo: corrected typos
+Dec 29 2010 - Manolo: removed reference to AudioToolbox.framework that's no
longer needed
Modified: branches/branch-1.3/configure.in
===================================================================
--- branches/branch-1.3/configure.in 2010-12-28 21:24:15 UTC (rev 8134)
+++ branches/branch-1.3/configure.in 2010-12-29 11:33:42 UTC (rev 8135)
@@ -843,7 +843,7 @@
Darwin*)
# MacOS X uses Cocoa for graphics. There are still some Carbon
leftovers.
- LIBS="$LIBS -framework Cocoa -framework Carbon -framework AudioToolbox"
+ LIBS="$LIBS -framework Cocoa -framework Carbon"
if test x$have_pthread = xyes; then
AC_DEFINE(HAVE_PTHREAD)
Modified: branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
===================================================================
--- branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
2010-12-28 21:24:15 UTC (rev 8134)
+++ branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
2010-12-29 11:33:42 UTC (rev 8135)
@@ -500,7 +500,6 @@
C96290C21274D0CF007D3CFE /* Cocoa.framework in Frameworks */ =
{isa = PBXBuildFile; fileRef = C9628FFD1274D0B3007D3CFE /* Cocoa.framework */;
};
C96290E21274D0EF007D3CFE /* AGL.framework in Frameworks */ =
{isa = PBXBuildFile; fileRef = C96290E11274D0EF007D3CFE /* AGL.framework */; };
C96290E61274D100007D3CFE /* OpenGL.framework in Frameworks */ =
{isa = PBXBuildFile; fileRef = C96290E51274D100007D3CFE /* OpenGL.framework */;
};
- C96290EC1274D134007D3CFE /* AudioToolbox.framework in
Frameworks */ = {isa = PBXBuildFile; fileRef = C96290EB1274D133007D3CFE /*
AudioToolbox.framework */; };
C962910E1274D1D7007D3CFE /* Cocoa.framework in Frameworks */ =
{isa = PBXBuildFile; fileRef = C9628FFD1274D0B3007D3CFE /* Cocoa.framework */;
};
C96291151274D1FD007D3CFE /* Cocoa.framework in Frameworks */ =
{isa = PBXBuildFile; fileRef = C9628FFD1274D0B3007D3CFE /* Cocoa.framework */;
};
C96291E712756D5E007D3CFE /* Carbon.framework in Frameworks */ =
{isa = PBXBuildFile; fileRef = C9628FFB1274D0B3007D3CFE /* Carbon.framework */;
};
@@ -4476,7 +4475,6 @@
C9628FFD1274D0B3007D3CFE /* Cocoa.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree =
SDKROOT; };
C96290E11274D0EF007D3CFE /* AGL.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework;
path = System/Library/Frameworks/AGL.framework; sourceTree = SDKROOT; };
C96290E51274D100007D3CFE /* OpenGL.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree
= SDKROOT; };
- C96290EB1274D133007D3CFE /* AudioToolbox.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
AudioToolbox.framework; path =
System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
C9EDD143127338F600ADB21C /* README.OSX.txt */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name =
README.OSX.txt; path = ../../README.OSX.txt; sourceTree = SOURCE_ROOT; };
C9EDD4DE1274BB6600ADB21C /* png.h */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = png.h; path =
../../png/png.h; sourceTree = SOURCE_ROOT; };
C9EDD4DF1274BB6600ADB21C /* pngconf.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name =
pngconf.h; path = ../../png/pngconf.h; sourceTree = SOURCE_ROOT; };
@@ -5202,7 +5200,6 @@
files = (
C96290C11274D0CD007D3CFE /* Carbon.framework in
Frameworks */,
C96290C21274D0CF007D3CFE /* Cocoa.framework in
Frameworks */,
- C96290EC1274D134007D3CFE /*
AudioToolbox.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6355,7 +6352,6 @@
C9628FFA1274D0A1007D3CFE /* Resources */ = {
isa = PBXGroup;
children = (
- C96290EB1274D133007D3CFE /*
AudioToolbox.framework */,
C9628FFB1274D0B3007D3CFE /* Carbon.framework */,
C9628FFD1274D0B3007D3CFE /* Cocoa.framework */,
C96290E11274D0EF007D3CFE /* AGL.framework */,
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2010-12-28 21:24:15 UTC (rev 8134)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2010-12-29 11:33:42 UTC (rev 8135)
@@ -71,6 +71,7 @@
#include <FL/Fl_Printer.H>
#include <FL/Fl_Input_.H>
#include <FL/Fl_Text_Display.H>
+#include <FL/fl_ask.H>
#include <stdio.h>
#include <stdlib.h>
#include "flstring.h"
@@ -3271,6 +3272,17 @@
return Fl_X::i(w)->xid;
}
+void fl_beep(int type) {
+ switch (type) {
+ case FL_BEEP_DEFAULT :
+ case FL_BEEP_ERROR :
+ NSBeep();
+ break;
+ default :
+ break;
+ }
+}
+
#endif // __APPLE__
//
Modified: branches/branch-1.3/src/fl_ask.cxx
===================================================================
--- branches/branch-1.3/src/fl_ask.cxx 2010-12-28 21:24:15 UTC (rev 8134)
+++ branches/branch-1.3/src/fl_ask.cxx 2010-12-29 11:33:42 UTC (rev 8135)
@@ -47,12 +47,6 @@
#include <FL/x.H>
#include <FL/fl_draw.H>
-#ifdef __APPLE__
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-# include <AudioToolbox/AudioServices.h>
-# endif
-#endif
-
static Fl_Window *message_form;
static Fl_Box *message;
static Fl_Box *icon;
@@ -258,7 +252,7 @@
const char* fl_close= "Close"; ///< string pointer used in common dialogs,
you can change it to a foreign language
// fltk functions:
-
+#ifndef __APPLE__ // the Mac code is in file Fl_cocoa.mm
/**
Emits a system beep message.
\note \#include <FL/fl_ask.H>
@@ -283,35 +277,7 @@
MessageBeep(0xFFFFFFFF);
break;
}
-#elif defined(__APPLE__)
- switch (type) {
- case FL_BEEP_DEFAULT :
- case FL_BEEP_ERROR :
- // How Apple is not any better than Microsoft:
- /* MacOS 8 */ // SysBeep(30);
- /* OS X 10.1 */ // AlertSoundPlay();
- /* OS X 10.5 */ // AudioServicesPlayAlertSound(kUserPreferredAlert);
- /* OS X 10.6 */ //
AudioServicesPlayAlertSound(kSystemSoundID_UserPreferredAlert);
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
- if (AudioServicesPlayAlertSound!=0L)
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
- AudioServicesPlayAlertSound(kSystemSoundID_UserPreferredAlert);
-# else
- AudioServicesPlayAlertSound(kUserPreferredAlert);
-# endif
- else
-# endif
-#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
- AlertSoundPlay();
#else
- {
- }
-#endif
- break;
- default :
- break;
- }
-#else
switch (type) {
case FL_BEEP_DEFAULT :
case FL_BEEP_ERROR :
@@ -327,6 +293,8 @@
}
#endif // WIN32
}
+#endif // __APPLE__
+
/** Shows an information message dialog box.
\note Common dialog boxes are application modal. No more than one common
dialog box
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit