From 5aa3fc9655560c68ab43573e4afb2d40833d01bf Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 10 Feb 2016 22:43:45 +0000 Subject: Moving fl_beep into screen driver. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11152 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/X11/Fl_X11_Screen_Driver.cxx | 16 ++++++++++++++++ src/drivers/X11/Fl_X11_Screen_Driver.h | 2 ++ 2 files changed, 18 insertions(+) (limited to 'src/drivers/X11') diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index 6ae8458a1..6a53f65f6 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -21,6 +21,7 @@ #include "Fl_X11_Screen_Driver.h" #include #include +#include #if HAVE_XINERAMA # include @@ -186,6 +187,21 @@ void Fl_X11_Screen_Driver::screen_dpi(float &h, float &v, int n) } +void Fl_X11_Screen_Driver::beep(int type) { + switch (type) { + case FL_BEEP_DEFAULT : + case FL_BEEP_ERROR : + if (!fl_display) fl_open_display(); + XBell(fl_display, 100); + break; + default : + if (!fl_display) fl_open_display(); + XBell(fl_display, 50); + break; + } +} + + // // End of "$Id$". diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.h b/src/drivers/X11/Fl_X11_Screen_Driver.h index 23e57fd52..635e975dc 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.h +++ b/src/drivers/X11/Fl_X11_Screen_Driver.h @@ -50,6 +50,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); }; -- cgit v1.2.3