summaryrefslogtreecommitdiff
path: root/src/drivers/Cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/Cocoa')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx46
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h9
2 files changed, 55 insertions, 0 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
index e34f8b998..5bd136bcd 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
+++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
@@ -20,12 +20,16 @@
#include "../../config_lib.h"
#include "Fl_Cocoa_Screen_Driver.h"
#include <FL/Fl.H>
+#include <FL/x.H>
#include <FL/fl_ask.h>
#include <stdio.h>
extern "C" void NSBeep(void);
+extern double fl_mac_flush_and_wait(double time_to_wait);
+extern int fl_ready();
+
/**
Creates a driver that manages all screen and display related calls.
@@ -121,6 +125,42 @@ void Fl_Cocoa_Screen_Driver::flush() {
}
+double Fl_Cocoa_Screen_Driver::wait(double time_to_wait)
+{
+ Fl::run_checks();
+ return fl_mac_flush_and_wait(time_to_wait);
+}
+
+
+int Fl_Cocoa_Screen_Driver::ready()
+{
+ return fl_ready();
+}
+
+
+extern void fl_fix_focus(); // in Fl.cxx
+
+extern void *fl_capture;
+
+
+void Fl_Cocoa_Screen_Driver::grab(Fl_Window* win)
+{
+ if (win) {
+ if (!Fl::grab_) {
+ fl_capture = Fl_X::i(Fl::first_window())->xid;
+ Fl_X::i(Fl::first_window())->set_key_window();
+ }
+ Fl::grab_ = win;
+ } else {
+ if (Fl::grab_) {
+ fl_capture = 0;
+ Fl::grab_ = 0;
+ fl_fix_focus();
+ }
+ }
+}
+
+
// simulation of XParseColor:
int Fl_Cocoa_Screen_Driver::parse_color(const char* p, uchar& r, uchar& g, uchar& b)
{
@@ -182,6 +222,12 @@ void Fl_Cocoa_Screen_Driver::get_system_colors()
}
+const char *Fl_Cocoa_Screen_Driver::get_system_scheme()
+{
+ return getenv("FLTK_SCHEME");
+}
+
+
//
// End of "$Id$".
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h
index b06192205..22c17b165 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h
+++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.h
@@ -39,6 +39,9 @@
*/
+class Fl_Window;
+
+
class FL_EXPORT Fl_Cocoa_Screen_Driver : public Fl_Screen_Driver
{
protected:
@@ -47,6 +50,8 @@ protected:
float dpi_v[MAX_SCREENS];
public:
+ // --- display management
+ // --- screen configuration
virtual void init();
virtual int x();
virtual int y();
@@ -59,9 +64,13 @@ public:
virtual void beep(int type);
// --- global events
virtual void flush();
+ virtual double wait(double time_to_wait);
+ virtual int ready();
+ virtual void grab(Fl_Window* win);
// --- global colors
virtual int parse_color(const char* p, uchar& r, uchar& g, uchar& b);
virtual void get_system_colors();
+ virtual const char *get_system_scheme();
};