Author: manolo
Date: 2010-12-29 03:51:29 -0800 (Wed, 29 Dec 2010)
New Revision: 8136
Log:
Mac OS X: keep Mac-specific fl_beep() code in file src/fl_ask.cxx

Modified:
   branches/branch-1.3/src/Fl_cocoa.mm
   branches/branch-1.3/src/fl_ask.cxx

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2010-12-29 11:33:42 UTC (rev 8135)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2010-12-29 11:51:29 UTC (rev 8136)
@@ -71,7 +71,6 @@
 #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"
@@ -3272,17 +3271,6 @@
   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-29 11:33:42 UTC (rev 8135)
+++ branches/branch-1.3/src/fl_ask.cxx  2010-12-29 11:51:29 UTC (rev 8136)
@@ -56,6 +56,9 @@
 static const char *iconlabel = "?";
 Fl_Font fl_message_font_ = FL_HELVETICA;
 Fl_Fontsize fl_message_size_ = 14;
+#ifdef __APPLE__
+extern "C" void NSBeep(void);
+#endif
 
 static char avoidRecursion = 0;
 
@@ -252,7 +255,6 @@
 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>
@@ -277,6 +279,15 @@
       MessageBeep(0xFFFFFFFF);
       break;
   }
+#elif defined(__APPLE__)
+  switch (type) {
+    case FL_BEEP_DEFAULT :
+    case FL_BEEP_ERROR :
+      NSBeep();
+      break;
+    default :
+      break;
+  }  
 #else
   switch (type) {
     case FL_BEEP_DEFAULT :
@@ -293,7 +304,6 @@
   }
 #endif // WIN32
 }
-#endif // __APPLE__
 
 /** Shows an information message dialog box.
 

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to