summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-02-13 16:12:57 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-02-13 16:12:57 +0000
commitd8f96b579d9359f62b984b2043a8f8c6854efe98 (patch)
tree00b5fa4cd4a195aa82431b0c211a717d6e4b6d86 /src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx
parent4af616a7a27c3104938bf580502c762becd4417b (diff)
Moed Fl::visual and System_Scheme to the driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11166 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx
index 9c3b450cd..3d39ba7ed 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx
@@ -19,6 +19,8 @@
#include "../../config_lib.h"
#include "Fl_WinAPI_Screen_Driver.h"
+#include <FL/Fl.H>
+#include <FL/x.H>
#include <FL/fl_ask.h>
#include <stdio.h>
@@ -40,6 +42,17 @@ Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver()
}
+int Fl_Screen_Driver::visual(int flags)
+{
+ fl_GetDC(0);
+ if (flags & FL_DOUBLE) return 0;
+ if (!(flags & FL_INDEX) &&
+ GetDeviceCaps(fl_gc,BITSPIXEL) <= 8) return 0;
+ if ((flags & FL_RGB8) && GetDeviceCaps(fl_gc,BITSPIXEL)<24) return 0;
+ return 1;
+}
+
+
// We go the much more difficult route of individually picking some multi-screen
// functions from the USER32.DLL . If these functions are not available, we
// will gracefully fall back to single monitor support.
@@ -240,6 +253,45 @@ void Fl_WinAPI_Screen_Driver::flush()
}
+double Fl_WinAPI_Screen_Driver::wait(double time_to_wait)
+{
+ return fl_wait(time_to_wait);
+}
+
+
+int Fl_WinAPI_Screen_Driver::ready()
+{
+ return fl_ready();
+}
+
+
+extern void fl_fix_focus(); // in Fl.cxx
+
+// We have to keep track of whether we have captured the mouse, since
+// MSWindows shows little respect for this... Grep for fl_capture to
+// see where and how this is used.
+extern HWND fl_capture;
+
+
+void Fl_WinAPI_Screen_Driver::grab(Fl_Window* win)
+{
+ if (win) {
+ if (!Fl::grab_) {
+ SetActiveWindow(fl_capture = fl_xid(Fl::first_window()));
+ SetCapture(fl_capture);
+ }
+ Fl::grab_ = win;
+ } else {
+ if (Fl::grab_) {
+ fl_capture = 0;
+ ReleaseCapture();
+ Fl::grab_ = 0;
+ fl_fix_focus();
+ }
+ }
+}
+
+
// simulation of XParseColor:
int Fl_WinAPI_Screen_Driver::parse_color(const char* p, uchar& r, uchar& g, uchar& b)
{
@@ -295,6 +347,12 @@ void Fl_WinAPI_Screen_Driver::get_system_colors()
}
+const char *Fl_WinAPI_Screen_Driver::get_system_scheme()
+{
+ return getenv("FLTK_SCHEME");
+}
+
+
//