FLTK logo

[master] 67817f6 - Remove small files fl_XXX_gl_platform_init.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] 67817f6 - Remove small files fl_XXX_gl_platform_init.cxx "ManoloFLTK" Nov 30, 2022  
 
commit 67817f696cf8ab47f6f4bee89313367cf0462cea
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Wed Nov 30 17:51:35 2022 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Wed Nov 30 17:51:35 2022 +0100

    Remove small files fl_XXX_gl_platform_init.cxx
    
    The single-function content of these files is moved to Fl_XXX_Gl_Window_Driver.cxx.

 src/CMakeLists.txt                                 | 10 +++---
 src/Makefile                                       | 10 ++----
 src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm     |  6 ++++
 src/drivers/Cocoa/fl_macOS_gl_platform_init.cxx    | 24 ---------------
 .../Wayland/Fl_Wayland_Gl_Window_Driver.cxx        | 12 ++++++++
 .../Wayland/fl_wayland_gl_platform_init.cxx        | 36 ----------------------
 src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx  |  6 ++++
 src/drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx  | 24 ---------------
 src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx        |  7 +++++
 src/drivers/X11/fl_X11_gl_platform_init.cxx        | 24 ---------------
 10 files changed, 38 insertions(+), 121 deletions(-)

diff --git src/CMakeLists.txt src/CMakeLists.txt
index 4713614..fb71a49 100644
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -428,22 +428,20 @@ set (GL_DRIVER_FILES
   drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx
 )
 if (OPTION_USE_WAYLAND)
-  set (GL_DRIVER_FILES ${GL_DRIVER_FILES}
-    drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
-    drivers/Wayland/fl_wayland_gl_platform_init.cxx)
+  set (GL_DRIVER_FILES ${GL_DRIVER_FILES} drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx)
   set (GL_DRIVER_HEADER_FILES drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H)
   if (FLTK_USE_X11)
     list (APPEND GL_DRIVER_FILES drivers/X11/Fl_X11_Gl_Window_Driver.cxx)
     list (APPEND GL_DRIVER_HEADER_FILES drivers/X11/Fl_X11_Gl_Window_Driver.H)
   endif (FLTK_USE_X11)
 elseif (FLTK_USE_X11)
-  set (GL_DRIVER_FILES ${GL_DRIVER_FILES} drivers/X11/Fl_X11_Gl_Window_Driver.cxx drivers/X11/fl_X11_gl_platform_init.cxx)
+  set (GL_DRIVER_FILES ${GL_DRIVER_FILES} drivers/X11/Fl_X11_Gl_Window_Driver.cxx)
   set (GL_DRIVER_HEADER_FILES drivers/X11/Fl_X11_Gl_Window_Driver.H)
 elseif (APPLE)
-  set (GL_DRIVER_FILES ${GL_DRIVER_FILES} drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm drivers/Cocoa/fl_macOS_gl_platform_init.cxx)
+  set (GL_DRIVER_FILES ${GL_DRIVER_FILES} drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm)
   set (GL_DRIVER_HEADER_FILES drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H)
 elseif (WIN32)
-  set (GL_DRIVER_FILES ${GL_DRIVER_FILES} drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx)
+  set (GL_DRIVER_FILES ${GL_DRIVER_FILES} drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx)
   set (GL_DRIVER_HEADER_FILES drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.H)
 endif (OPTION_USE_WAYLAND)
 
diff --git src/Makefile src/Makefile
index a2b9ed0..a551738 100644
--- src/Makefile
+++ src/Makefile
@@ -205,16 +205,12 @@ GLCPPFILES = \
 	drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx \
 	drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx
 
-GLCPPFILES_OSX = drivers/Cocoa/fl_macOS_gl_platform_init.cxx
 GLOBJCPPFILES = drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
-GLCPPFILES_X11 = drivers/X11/Fl_X11_Gl_Window_Driver.cxx \
-		 drivers/X11/fl_X11_gl_platform_init.cxx
+GLCPPFILES_X11 = drivers/X11/Fl_X11_Gl_Window_Driver.cxx
 GLCPPFILES_XFT = $(GLCPPFILES_X11)
 GLCPPFILES_CAIRO = $(GLCPPFILES_X11)
-GLCPPFILES_WIN = drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx \
-		 drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx
-GLCPPFILES_WAYLAND = drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx \
-		     drivers/Wayland/fl_wayland_gl_platform_init.cxx
+GLCPPFILES_WIN = drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx
+GLCPPFILES_WAYLAND = drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
 GLCPPFILES_WAYLANDX11 = $(GLCPPFILES_WAYLAND) \
 		        drivers/X11/Fl_X11_Gl_Window_Driver.cxx
 
diff --git src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
index 2420d12..f54871d 100644
--- src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
+++ src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
@@ -56,6 +56,12 @@ Fl_Cocoa_Gl_Window_Driver::Fl_Cocoa_Gl_Window_Driver(Fl_Gl_Window *win) :
 }
 
 
+Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
+{
+  return new Fl_Cocoa_Gl_Window_Driver(w);
+}
+
+
 static NSOpenGLPixelFormat* mode_to_NSOpenGLPixelFormat(int m, const int *alistp)
 {
   NSOpenGLPixelFormatAttribute attribs[32];
diff --git src/drivers/Cocoa/fl_macOS_gl_platform_init.cxx src/drivers/Cocoa/fl_macOS_gl_platform_init.cxx
deleted file mode 100644
index 421c665..0000000
--- src/drivers/Cocoa/fl_macOS_gl_platform_init.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Wayland-specific code to initialize wayland 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 "Fl_Cocoa_Gl_Window_Driver.H"
-
-
-Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
-{
-  return new Fl_Cocoa_Gl_Window_Driver(w);
-}
diff --git src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
index 59f9266..86aeee8 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -23,6 +23,9 @@
 #include "Fl_Wayland_Window_Driver.H"
 #include "Fl_Wayland_Graphics_Driver.H"
 #include "Fl_Wayland_Gl_Window_Driver.H"
+#ifdef FLTK_USE_X11
+#  include "../X11/Fl_X11_Gl_Window_Driver.H"
+#endif
 #include <wayland-egl.h>
 #include <EGL/egl.h>
 #include <FL/gl.h>
@@ -73,6 +76,15 @@ Fl_Wayland_Gl_Window_Driver::Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win) : Fl
 }
 
 
+Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
+{
+#ifdef FLTK_USE_X11
+  if (!Fl_Wayland_Screen_Driver::wl_display) return new Fl_X11_Gl_Window_Driver(w);
+#endif
+  return new Fl_Wayland_Gl_Window_Driver(w);
+}
+
+
 void Fl_Wayland_Gl_Window_Driver::init() {
   EGLint major, minor;
 
diff --git src/drivers/Wayland/fl_wayland_gl_platform_init.cxx src/drivers/Wayland/fl_wayland_gl_platform_init.cxx
deleted file mode 100644
index 1c734be..0000000
--- src/drivers/Wayland/fl_wayland_gl_platform_init.cxx
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Wayland-specific code to initialize wayland 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 <config.h>
-#if HAVE_GL
-
-#include "Fl_Wayland_Gl_Window_Driver.H"
-#include "Fl_Wayland_Screen_Driver.H"
-#ifdef FLTK_USE_X11
-#include "../X11/Fl_X11_Gl_Window_Driver.H"
-#endif
-
-Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
-{
-#ifdef FLTK_USE_X11
-  if (Fl_Wayland_Screen_Driver::wl_display) return new Fl_Wayland_Gl_Window_Driver(w);
-  return new Fl_X11_Gl_Window_Driver(w);
-#else
-  return new Fl_Wayland_Gl_Window_Driver(w);
-#endif
-}
-
-#endif // HAVE_GL
diff --git src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx
index 50af220..e941fa5 100644
--- src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx
+++ src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx
@@ -53,6 +53,12 @@ public:
 };
 
 
+Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
+{
+  return new Fl_WinAPI_Gl_Window_Driver(w);
+}
+
+
 Fl_Gl_Choice *Fl_WinAPI_Gl_Window_Driver::find(int m, const int *alistp)
 {
   Fl_WinAPI_Gl_Choice *g = (Fl_WinAPI_Gl_Choice*)Fl_Gl_Window_Driver::find_begin(m, alistp);
diff --git src/drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx src/drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx
deleted file mode 100644
index f5b26be..0000000
--- src/drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Wayland-specific code to initialize wayland 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 "Fl_WinAPI_Gl_Window_Driver.H"
-
-
-Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
-{
-  return new Fl_WinAPI_Gl_Window_Driver(w);
-}
diff --git src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
index d0b79a0..bbcebbd 100644
--- src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
+++ src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
@@ -44,6 +44,13 @@ public:
   }
 };
 
+#ifndef FLTK_USE_WAYLAND
+Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
+{
+  return new Fl_X11_Gl_Window_Driver(w);
+}
+#endif
+
 void Fl_X11_Gl_Window_Driver::draw_string_legacy(const char* str, int n) {
   draw_string_legacy_get_list(str, n);
 }
diff --git src/drivers/X11/fl_X11_gl_platform_init.cxx src/drivers/X11/fl_X11_gl_platform_init.cxx
deleted file mode 100644
index 66cfb69..0000000
--- src/drivers/X11/fl_X11_gl_platform_init.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// X11-specific code to initialize wayland 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 "Fl_X11_Gl_Window_Driver.H"
-
-
-Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
-{
-  return new Fl_X11_Gl_Window_Driver(w);
-}
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'.