From fa546af28f1e6b9b1996a08349eaf62b6e1d0c3e Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 21 Apr 2016 18:24:49 +0000 Subject: [PATCH] Move all platform-specific code to src/platform/. Without resources, it makes no sense anymore to keep these in separate subdirectories: unixutil* is shared between Cocoa and GTK ports, and gloffscreen* should be shared between all ports (but it's still platform-specific). --- src/CMakeLists.txt | 14 +++++++------- src/export.cpp | 2 +- src/{cocoa => platform}/cocoamain.mm | 4 ++-- src/{unix => platform}/gloffscreen.cpp | 0 src/{unix => platform}/gloffscreen.h | 0 src/{gtk => platform}/gtkmain.cpp | 6 +++--- src/{unix => platform}/unixutil.cpp | 0 src/{win32 => platform}/w32main.cpp | 2 +- src/{win32 => platform}/w32util.cpp | 0 9 files changed, 14 insertions(+), 14 deletions(-) rename src/{cocoa => platform}/cocoamain.mm (99%) rename src/{unix => platform}/gloffscreen.cpp (100%) rename src/{unix => platform}/gloffscreen.h (100%) rename src/{gtk => platform}/gtkmain.cpp (99%) rename src/{unix => platform}/unixutil.cpp (100%) rename src/{win32 => platform}/w32main.cpp (99%) rename src/{win32 => platform}/w32util.cpp (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9548e8a..d7f57cf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,10 +33,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in if(WIN32) set(util_SOURCES - win32/w32util.cpp) + platform/w32util.cpp) else() set(util_SOURCES - unix/unixutil.cpp) + platform/unixutil.cpp) endif() # libslvs @@ -129,7 +129,7 @@ set(generated_SOURCES if(WIN32) set(platform_SOURCES - win32/w32main.cpp) + platform/w32main.cpp) set(platform_LIBRARIES comctl32) @@ -138,8 +138,8 @@ elseif(APPLE) -fobjc-arc) set(platform_SOURCES - cocoa/cocoamain.mm - unix/gloffscreen.cpp) + platform/cocoamain.mm + platform/gloffscreen.cpp) set(platform_BUNDLED_LIBS ${PNG_LIBRARIES} @@ -167,8 +167,8 @@ elseif(HAVE_GTK) ${GLEW_CFLAGS_OTHER}) set(platform_SOURCES - gtk/gtkmain.cpp - unix/gloffscreen.cpp) + platform/gtkmain.cpp + platform/gloffscreen.cpp) set(platform_LIBRARIES ${GTKMM_LIBRARIES} diff --git a/src/export.cpp b/src/export.cpp index f623edb..aba1b69 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -8,7 +8,7 @@ //----------------------------------------------------------------------------- #include "solvespace.h" #ifndef WIN32 -#include +#include #endif #include diff --git a/src/cocoa/cocoamain.mm b/src/platform/cocoamain.mm similarity index 99% rename from src/cocoa/cocoamain.mm rename to src/platform/cocoamain.mm index 185a5cf..1cd4ce0 100644 --- a/src/cocoa/cocoamain.mm +++ b/src/platform/cocoamain.mm @@ -1,7 +1,7 @@ //----------------------------------------------------------------------------- // Our main() function, and Cocoa-specific stuff to set up our windows and // otherwise handle our interface to the operating system. Everything -// outside gtk/... should be standard C++ and OpenGL. +// outside platform/... should be standard C++ and OpenGL. // // Copyright 2015 //----------------------------------------------------------------------------- @@ -14,7 +14,7 @@ #include #include "solvespace.h" -#include "../unix/gloffscreen.h" +#include "gloffscreen.h" #include using SolveSpace::dbp; diff --git a/src/unix/gloffscreen.cpp b/src/platform/gloffscreen.cpp similarity index 100% rename from src/unix/gloffscreen.cpp rename to src/platform/gloffscreen.cpp diff --git a/src/unix/gloffscreen.h b/src/platform/gloffscreen.h similarity index 100% rename from src/unix/gloffscreen.h rename to src/platform/gloffscreen.h diff --git a/src/gtk/gtkmain.cpp b/src/platform/gtkmain.cpp similarity index 99% rename from src/gtk/gtkmain.cpp rename to src/platform/gtkmain.cpp index dec16f1..dd4cef3 100644 --- a/src/gtk/gtkmain.cpp +++ b/src/platform/gtkmain.cpp @@ -1,7 +1,7 @@ //----------------------------------------------------------------------------- -// Our main() function, and GTK3-specific stuff to set up our windows and +// Our main() function, and GTK2/3-specific stuff to set up our windows and // otherwise handle our interface to the operating system. Everything -// outside gtk/... should be standard C++ and OpenGL. +// outside platform/... should be standard C++ and OpenGL. // // Copyright 2015 //----------------------------------------------------------------------------- @@ -52,7 +52,7 @@ #include "solvespace.h" #include "config.h" -#include "../unix/gloffscreen.h" +#include "gloffscreen.h" #ifdef HAVE_SPACEWARE # include diff --git a/src/unix/unixutil.cpp b/src/platform/unixutil.cpp similarity index 100% rename from src/unix/unixutil.cpp rename to src/platform/unixutil.cpp diff --git a/src/win32/w32main.cpp b/src/platform/w32main.cpp similarity index 99% rename from src/win32/w32main.cpp rename to src/platform/w32main.cpp index 8d2310d..7a47751 100644 --- a/src/win32/w32main.cpp +++ b/src/platform/w32main.cpp @@ -1,7 +1,7 @@ //----------------------------------------------------------------------------- // Our WinMain() functions, and Win32-specific stuff to set up our windows // and otherwise handle our interface to the operating system. Everything -// outside win32/... should be standard C++ and gl. +// outside platform/... should be standard C++ and gl. // // Copyright 2008-2013 Jonathan Westhues. //----------------------------------------------------------------------------- diff --git a/src/win32/w32util.cpp b/src/platform/w32util.cpp similarity index 100% rename from src/win32/w32util.cpp rename to src/platform/w32util.cpp