FLTK logo

[master] 1298bf0 - Remove FL_CFG_WIN_COCOA preprocessor variable from Fl_Sys_Menu_Bar.cxx

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 1298bf0 - Remove FL_CFG_WIN_COCOA preprocessor variable from Fl_Sys_Menu_Bar.cxx "ManoloFLTK" Feb 16, 2021  
 
commit 1298bf00f577292a46c4ff22ff46a0e2ee3ba30d
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Feb 16 14:54:38 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Feb 16 15:50:15 2021 +0100

    Remove FL_CFG_WIN_COCOA preprocessor variable from Fl_Sys_Menu_Bar.cxx

 src/Fl_MacOS_Sys_Menu_Bar.mm                   | 6 +-----
 src/Fl_Sys_Menu_Bar.cxx                        | 9 ++++-----
 src/Fl_System_Driver.H                         | 4 +++-
 src/drivers/Darwin/Fl_Darwin_System_Driver.H   | 3 ++-
 src/drivers/Darwin/Fl_Darwin_System_Driver.cxx | 8 +++++++-
 5 files changed, 17 insertions(+), 13 deletions(-)

diff --git src/Fl_MacOS_Sys_Menu_Bar.mm src/Fl_MacOS_Sys_Menu_Bar.mm
index c589f81..e529f07 100644
--- src/Fl_MacOS_Sys_Menu_Bar.mm
+++ 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 src/Fl_Sys_Menu_Bar.cxx src/Fl_Sys_Menu_Bar.cxx
index 662cb0f..267805c 100644
--- src/Fl_Sys_Menu_Bar.cxx
+++ 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 src/Fl_System_Driver.H src/Fl_System_Driver.H
index 44b2333..59bf1de 100644
--- src/Fl_System_Driver.H
+++ 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 src/drivers/Darwin/Fl_Darwin_System_Driver.H src/drivers/Darwin/Fl_Darwin_System_Driver.H
index 5482779..7d076a9 100644
--- src/drivers/Darwin/Fl_Darwin_System_Driver.H
+++ 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 src/drivers/Darwin/Fl_Darwin_System_Driver.cxx src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
index a08ff58..e9c45d1 100644
--- src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
+++ 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();
+}
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.