summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_MacOS_Sys_Menu_Bar.mm6
-rw-r--r--src/Fl_Sys_Menu_Bar.cxx9
-rw-r--r--src/Fl_System_Driver.H4
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.H3
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.cxx8
5 files changed, 17 insertions, 13 deletions
diff --git a/src/Fl_MacOS_Sys_Menu_Bar.mm b/src/Fl_MacOS_Sys_Menu_Bar.mm
index c589f8118..e529f0769 100644
--- a/src/Fl_MacOS_Sys_Menu_Bar.mm
+++ b/src/Fl_MacOS_Sys_Menu_Bar.mm
@@ -1,7 +1,7 @@
//
// MacOS system menu bar widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2021 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
@@ -42,10 +42,6 @@ static void move_tab_cb(Fl_Widget *, void *data);
static void merge_all_windows_cb(Fl_Widget *, void *data);
#endif
-Fl_Sys_Menu_Bar_Driver *Fl_Sys_Menu_Bar::driver() {
- return Fl_MacOS_Sys_Menu_Bar_Driver::driver();
-}
-
void Fl_MacOS_Sys_Menu_Bar_Driver::draw() {
bar->deactivate(); // prevent Fl_Sys_Menu_Bar object from receiving events
diff --git a/src/Fl_Sys_Menu_Bar.cxx b/src/Fl_Sys_Menu_Bar.cxx
index 662cb0f19..267805cd4 100644
--- a/src/Fl_Sys_Menu_Bar.cxx
+++ b/src/Fl_Sys_Menu_Bar.cxx
@@ -1,7 +1,7 @@
//
// system menu bar widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2021 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
@@ -15,9 +15,10 @@
//
-#include "config_lib.h"
+#include <config.h>
#include "Fl_Sys_Menu_Bar_Driver.H"
#include <FL/platform.H>
+#include "Fl_System_Driver.H"
Fl_Sys_Menu_Bar *fl_sys_menu_bar = 0;
@@ -238,11 +239,9 @@ void Fl_Sys_Menu_Bar::create_window_menu() {
}
#if !defined(FL_DOXYGEN)
-#if ! defined(FL_CFG_WIN_COCOA)
Fl_Sys_Menu_Bar_Driver *Fl_Sys_Menu_Bar::driver() {
- return NULL;
+ return Fl::system_driver()->sys_menu_bar_driver();
}
-#endif // !FL_CFG_WIN_COCOA
Fl_Sys_Menu_Bar_Driver *Fl_Sys_Menu_Bar_Driver::driver_ = 0;
diff --git a/src/Fl_System_Driver.H b/src/Fl_System_Driver.H
index 44b2333c0..59bf1de1a 100644
--- a/src/Fl_System_Driver.H
+++ b/src/Fl_System_Driver.H
@@ -2,7 +2,7 @@
// A base class for platform specific system calls
// for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2020 by Bill Spitzak and others.
+// Copyright 2010-2021 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
@@ -42,6 +42,7 @@ class Fl_File_Icon;
class Fl_File_Browser;
class Fl_Pixmap;
class Fl_Widget;
+class Fl_Sys_Menu_Bar_Driver;
/**
\brief A base class for platform-specific system operations.
@@ -239,6 +240,7 @@ public:
virtual const char *meta_name() { return "Meta"; }
virtual const char *alt_name() { return "Alt"; }
virtual const char *control_name() { return "Ctrl"; }
+ virtual Fl_Sys_Menu_Bar_Driver *sys_menu_bar_driver() { return NULL; }
};
#endif // FL_SYSTEM_DRIVER_H
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H
index 548277901..7d076a9ce 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H
@@ -2,7 +2,7 @@
// Definition of Apple Darwin system driver
// for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2018 by Bill Spitzak and others.
+// Copyright 2010-2021 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
@@ -83,6 +83,7 @@ public:
virtual const char *meta_name();
virtual const char *alt_name();
virtual const char *control_name();
+ virtual Fl_Sys_Menu_Bar_Driver *sys_menu_bar_driver();
};
#endif // FL_DARWIN_SYSTEM_DRIVER_H
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
index a08ff5891..e9c45d1d7 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
@@ -1,7 +1,7 @@
//
// Definition of Apple Darwin system driver.
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2021 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
@@ -22,6 +22,7 @@
#include <FL/filename.H>
#include <FL/Fl_File_Icon.H>
#include <FL/Fl_Preferences.H>
+#include "../Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H"
#include <string.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
#include <xlocale.h>
@@ -366,3 +367,8 @@ const char *Fl_Darwin_System_Driver::local_to_mac_roman(const char *t, int)
{
return t;
}
+
+Fl_Sys_Menu_Bar_Driver *Fl_Darwin_System_Driver::sys_menu_bar_driver()
+{
+ return Fl_MacOS_Sys_Menu_Bar_Driver::driver();
+}