From 24758b5cd65356dcc18e6ae799f115f59969901d Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 29 Dec 2010 11:51:29 +0000 Subject: Mac OS X: keep Mac-specific fl_beep() code in file src/fl_ask.cxx git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8136 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 12 ------------ src/fl_ask.cxx | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index fb15cf539..2ad315037 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -71,7 +71,6 @@ extern "C" { #include #include #include -#include #include #include #include "flstring.h" @@ -3272,17 +3271,6 @@ Window fl_xid(const Fl_Window* w) 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__ // diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index 5eedc77ab..63dd98f28 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -56,6 +56,9 @@ static int ret_val; 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_cancel= "Cancel"; ///< string pointer used in common dialogs, you 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 @@ -277,6 +279,15 @@ void fl_beep(int type) { 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 @@ void fl_beep(int type) { } #endif // WIN32 } -#endif // __APPLE__ /** Shows an information message dialog box. -- cgit v1.2.3