diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2016-02-10 22:43:45 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2016-02-10 22:43:45 +0000 |
| commit | 5aa3fc9655560c68ab43573e4afb2d40833d01bf (patch) | |
| tree | f2d5b14fbc41a498edfa11b356b6656d7570a740 /src/drivers/Cocoa | |
| parent | 1a3c2dfd08a230e253b35df6e553c499c62c8686 (diff) | |
Moving fl_beep into screen driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11152 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Cocoa')
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx | 19 | ||||
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx index 94dedb813..704c3dc72 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx @@ -19,8 +19,11 @@ #include "../../config_lib.h" #include "Fl_Cocoa_Screen_Driver.h" +#include <FL/fl_ask.h> +extern "C" void NSBeep(void); + /** Creates a driver that manages all screen and display related calls. @@ -93,6 +96,22 @@ void Fl_Cocoa_Screen_Driver::screen_dpi(float &h, float &v, int n) } +/** + Emits a system beep message. + \param[in] type The beep type from the \ref Fl_Beep enumeration. + \note \#include <FL/fl_ask.H> + */ +void Fl_Cocoa_Screen_Driver::beep(int type) { + switch (type) { + case FL_BEEP_DEFAULT : + case FL_BEEP_ERROR : + NSBeep(); + break; + default : + break; + } +} + // // End of "$Id$". diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h index 4023e8706..4c5cf8a7e 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h @@ -55,6 +55,8 @@ public: virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n); virtual void screen_dpi(float &h, float &v, int n=0); virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n); + // --- audible output + virtual void beep(int type); }; |
