summaryrefslogtreecommitdiff
path: root/src/drivers/Darwin
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-13 08:56:23 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-13 08:56:35 +0100
commitb549cfaaea11ce5e881e2151a838c91a031ad9ba (patch)
treea8a34a8cd7270a4d4ca68bca08c1b6e6388220d4 /src/drivers/Darwin
parente8461a6191e0afa5fd96290856d1a056437469d0 (diff)
Separate platform init functions from platform-specific driver files
Diffstat (limited to 'src/drivers/Darwin')
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.cxx10
-rw-r--r--src/drivers/Darwin/fl_macOS_platform_init.cxx59
2 files changed, 59 insertions, 10 deletions
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
index dad46dfc7..9f59d8cae 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
@@ -89,16 +89,6 @@ const char *Fl_Darwin_System_Driver::control_name() {
return "⌃\\"; // "\xe2\x8c\x83\\"; // U+2303 (up arrowhead)
}
-/*
- Creates a driver that manages all system related calls.
-
- This function must be implemented once for every platform.
- */
-Fl_System_Driver *Fl_System_Driver::newSystemDriver()
-{
- return new Fl_Darwin_System_Driver();
-}
-
Fl_Darwin_System_Driver::Fl_Darwin_System_Driver() : Fl_Posix_System_Driver() {
if (fl_mac_os_version == 0) fl_mac_os_version = calc_mac_os_version();
// initialize key table
diff --git a/src/drivers/Darwin/fl_macOS_platform_init.cxx b/src/drivers/Darwin/fl_macOS_platform_init.cxx
new file mode 100644
index 000000000..fc18e90db
--- /dev/null
+++ b/src/drivers/Darwin/fl_macOS_platform_init.cxx
@@ -0,0 +1,59 @@
+//
+// macOS-specific code to initialize macOS support.
+//
+// Copyright 2022 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file. If this
+// file is missing or damaged, see the license at:
+//
+// https://www.fltk.org/COPYING.php
+//
+// Please see the following page on how to report bugs and issues:
+//
+// https://www.fltk.org/bugs.php
+//
+
+
+#include "../Quartz/Fl_Quartz_Copy_Surface_Driver.H"
+#include "../Quartz/Fl_Quartz_Graphics_Driver.H"
+#include "../Cocoa/Fl_Cocoa_Screen_Driver.H"
+#include "../Darwin/Fl_Darwin_System_Driver.H"
+#include "../Cocoa/Fl_Cocoa_Window_Driver.H"
+#include "../Quartz/Fl_Quartz_Image_Surface_Driver.H"
+
+
+Fl_Copy_Surface_Driver *Fl_Copy_Surface_Driver::newCopySurfaceDriver(int w, int h)
+{
+ return new Fl_Quartz_Copy_Surface_Driver(w, h);
+}
+
+
+Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver()
+{
+ return new Fl_Quartz_Graphics_Driver();
+}
+
+
+Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver()
+{
+ return new Fl_Cocoa_Screen_Driver();
+}
+
+
+Fl_System_Driver *Fl_System_Driver::newSystemDriver()
+{
+ return new Fl_Darwin_System_Driver();
+}
+
+
+Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *w)
+{
+ return new Fl_Cocoa_Window_Driver(w);
+}
+
+
+Fl_Image_Surface_Driver *Fl_Image_Surface_Driver::newImageSurfaceDriver(int w, int h, int high_res, Fl_Offscreen off)
+{
+ return new Fl_Quartz_Image_Surface_Driver(w, h, high_res, off);
+}