GHOST: rename suffix X11 to Unix for non X11 files
authorCampbell Barton <ideasman42@gmail.com>
Mon, 16 Nov 2015 10:57:05 +0000 (21:57 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 16 Nov 2015 10:57:05 +0000 (21:57 +1100)
We may use these for Wayland or SDL back-ends.

intern/ghost/CMakeLists.txt
intern/ghost/SConscript
intern/ghost/intern/GHOST_ISystemPaths.cpp
intern/ghost/intern/GHOST_NDOFManagerUnix.cpp [moved from intern/ghost/intern/GHOST_NDOFManagerX11.cpp with 93% similarity]
intern/ghost/intern/GHOST_NDOFManagerUnix.h [moved from intern/ghost/intern/GHOST_NDOFManagerX11.h with 80% similarity]
intern/ghost/intern/GHOST_SystemPathsUnix.cpp [moved from intern/ghost/intern/GHOST_SystemPathsX11.cpp with 83% similarity]
intern/ghost/intern/GHOST_SystemPathsUnix.h [moved from intern/ghost/intern/GHOST_SystemPathsX11.h with 88% similarity]
intern/ghost/intern/GHOST_SystemX11.cpp

index 948b4bf..d31e947 100644 (file)
@@ -225,9 +225,9 @@ elseif(WITH_X11)
 
        if(WITH_INPUT_NDOF)
                list(APPEND SRC
-                       intern/GHOST_NDOFManagerX11.cpp
+                       intern/GHOST_NDOFManagerUnix.cpp
 
-                       intern/GHOST_NDOFManagerX11.h
+                       intern/GHOST_NDOFManagerUnix.h
                )
        endif()
 
@@ -310,8 +310,8 @@ if(APPLE)
 
 elseif(UNIX)
        list(APPEND SRC
-               intern/GHOST_SystemPathsX11.cpp
-               intern/GHOST_SystemPathsX11.h
+               intern/GHOST_SystemPathsUnix.cpp
+               intern/GHOST_SystemPathsUnix.h
        )
 
        if(NOT WITH_INSTALL_PORTABLE)
index 0abd2c2..8fbe65f 100644 (file)
@@ -116,6 +116,11 @@ elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64
         except ValueError:
             pass
 
+        try:
+            sources.remove('intern' + os.sep + f + 'Unix.cpp')
+        except ValueError:
+            pass
+
         try:
             sources.remove('intern' + os.sep + f + 'SDL.cpp')
         except ValueError:
@@ -137,6 +142,10 @@ elif window_system == 'darwin':
             sources.remove('intern' + os.sep + f + 'X11.cpp')
         except ValueError:
             pass
+        try:
+            sources.remove('intern' + os.sep + f + 'Unix.cpp')
+        except ValueError:
+            pass
         try:
             sources.remove('intern' + os.sep + f + 'SDL.cpp')
         except ValueError:
@@ -175,7 +184,7 @@ else:
         elif window_system=='darwin':
             sources.remove('intern' + os.sep + 'GHOST_NDOFManagerCocoa.mm')
         else:
-            sources.remove('intern' + os.sep + 'GHOST_NDOFManagerX11.cpp')
+            sources.remove('intern' + os.sep + 'GHOST_NDOFManagerUnix.cpp')
     except ValueError:
         pass
 
index 581467f..6ebcb37 100644 (file)
@@ -44,7 +44,7 @@
 #  ifdef __APPLE__
 #      include "GHOST_SystemPathsCocoa.h"
 #  else
-#    include "GHOST_SystemPathsX11.h"
+#    include "GHOST_SystemPathsUnix.h"
 #  endif
 #endif
 
@@ -62,7 +62,7 @@ GHOST_TSuccess GHOST_ISystemPaths::create()
 #  ifdef __APPLE__
                m_systemPaths = new GHOST_SystemPathsCocoa();
 #  else
-               m_systemPaths = new GHOST_SystemPathsX11();
+               m_systemPaths = new GHOST_SystemPathsUnix();
 #  endif
 #endif 
                success = m_systemPaths != 0 ? GHOST_kSuccess : GHOST_kFailure;
similarity index 93%
rename from intern/ghost/intern/GHOST_NDOFManagerX11.cpp
rename to intern/ghost/intern/GHOST_NDOFManagerUnix.cpp
index 753321b..df51635 100644 (file)
 
 #ifdef WITH_INPUT_NDOF
 
-#include "GHOST_NDOFManagerX11.h"
-#include "GHOST_SystemX11.h"
+#include "GHOST_NDOFManagerUnix.h"
+#include "GHOST_System.h"
+
 #include <spnav.h>
 #include <stdio.h>
 
 
-GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
+GHOST_NDOFManagerUnix::GHOST_NDOFManagerUnix(GHOST_System& sys)
     : GHOST_NDOFManager(sys),
       m_available(false)
 {
@@ -63,13 +64,13 @@ GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
        }
 }
 
-GHOST_NDOFManagerX11::~GHOST_NDOFManagerX11()
+GHOST_NDOFManagerUnix::~GHOST_NDOFManagerUnix()
 {
        if (m_available)
                spnav_close();
 }
 
-bool GHOST_NDOFManagerX11::available()
+bool GHOST_NDOFManagerUnix::available()
 {
        return m_available;
 }
@@ -89,7 +90,7 @@ bool GHOST_NDOFManagerX11::available()
 static bool motion_test_prev = false;
 #endif
 
-bool GHOST_NDOFManagerX11::processEvents()
+bool GHOST_NDOFManagerUnix::processEvents()
 {
        bool anyProcessed = false;
 
similarity index 80%
rename from intern/ghost/intern/GHOST_NDOFManagerX11.h
rename to intern/ghost/intern/GHOST_NDOFManagerUnix.h
index 4629bae..278a8cb 100644 (file)
@@ -21,8 +21,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
  
-#ifndef __GHOST_NDOFMANAGERX11_H__
-#define __GHOST_NDOFMANAGERX11_H__
+#ifndef __GHOST_NDOFMANAGERUNIX_H__
+#define __GHOST_NDOFMANAGERUNIX_H__
 
 #ifdef WITH_INPUT_NDOF
 
 /* Event capture is handled within the NDOF manager on Linux,
  * so there's no need for SystemX11 to look for them. */
 
-class GHOST_NDOFManagerX11 : public GHOST_NDOFManager
+class GHOST_NDOFManagerUnix : public GHOST_NDOFManager
 {
 public:
-       GHOST_NDOFManagerX11(GHOST_System&);
-       ~GHOST_NDOFManagerX11();
+       GHOST_NDOFManagerUnix(GHOST_System&);
+       ~GHOST_NDOFManagerUnix();
        bool available();
        bool processEvents();
 
@@ -43,6 +43,5 @@ private:
        bool m_available;
 };
 
-#endif /* WITH_INPUT_NDOF */
-#endif /* #include guard */
-
+#endif  /* WITH_INPUT_NDOF */
+#endif  /* __GHOST_NDOFMANAGERUNIX_H__ */
similarity index 83%
rename from intern/ghost/intern/GHOST_SystemPathsX11.cpp
rename to intern/ghost/intern/GHOST_SystemPathsUnix.cpp
index 5473e40..8738b8d 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file ghost/intern/GHOST_SystemPathsX11.cpp
+/** \file ghost/intern/GHOST_SystemPathsUnix.cpp
  *  \ingroup GHOST
  */
 
-
-#include "GHOST_SystemPathsX11.h"
+#include "GHOST_SystemPathsUnix.h"
 
 #include "GHOST_Debug.h"
 
@@ -52,15 +51,15 @@ static const char *static_path = PREFIX "/share";
 static const char *static_path = NULL;
 #endif
 
-GHOST_SystemPathsX11::GHOST_SystemPathsX11()
+GHOST_SystemPathsUnix::GHOST_SystemPathsUnix()
 {
 }
 
-GHOST_SystemPathsX11::~GHOST_SystemPathsX11()
+GHOST_SystemPathsUnix::~GHOST_SystemPathsUnix()
 {
 }
 
-const GHOST_TUns8 *GHOST_SystemPathsX11::getSystemDir(int, const char *versionstr) const
+const GHOST_TUns8 *GHOST_SystemPathsUnix::getSystemDir(int, const char *versionstr) const
 {
        /* no prefix assumes a portable build which only uses bundled scripts */
        if (static_path) {
@@ -71,7 +70,7 @@ const GHOST_TUns8 *GHOST_SystemPathsX11::getSystemDir(int, const char *versionst
        return NULL;
 }
 
-const GHOST_TUns8 *GHOST_SystemPathsX11::getUserDir(int version, const char *versionstr) const
+const GHOST_TUns8 *GHOST_SystemPathsUnix::getUserDir(int version, const char *versionstr) const
 {
        static string user_path = "";
        static int last_version = 0;
@@ -116,12 +115,12 @@ const GHOST_TUns8 *GHOST_SystemPathsX11::getUserDir(int version, const char *ver
        }
 }
 
-const GHOST_TUns8 *GHOST_SystemPathsX11::getBinaryDir() const
+const GHOST_TUns8 *GHOST_SystemPathsUnix::getBinaryDir() const
 {
        return NULL;
 }
 
-void GHOST_SystemPathsX11::addToSystemRecentFiles(const char * /*filename*/) const
+void GHOST_SystemPathsUnix::addToSystemRecentFiles(const char * /*filename*/) const
 {
        /* XXXXX TODO: Implementation for X11 if possible */
 
similarity index 88%
rename from intern/ghost/intern/GHOST_SystemPathsX11.h
rename to intern/ghost/intern/GHOST_SystemPathsUnix.h
index 23cc2e4..c30e717 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file ghost/intern/GHOST_SystemPathsX11.h
+/** \file ghost/intern/GHOST_SystemPathsUnix.h
  *  \ingroup GHOST
  */
 
 
-#ifndef __GHOST_SYSTEMPATHSX11_H__
-#define __GHOST_SYSTEMPATHSX11_H__
+#ifndef __GHOST_SYSTEMPATHSUNIX_H__
+#define __GHOST_SYSTEMPATHSUNIX_H__
 
 #include "GHOST_SystemPaths.h"
 #include "../GHOST_Types.h"
 
 
-class GHOST_SystemPathsX11 : public GHOST_SystemPaths {
+class GHOST_SystemPathsUnix : public GHOST_SystemPaths {
 public:
 
        /**
         * Constructor
         * this class should only be instanciated by GHOST_ISystem.
         */
-       GHOST_SystemPathsX11();
+       GHOST_SystemPathsUnix();
        
        /**
         * Destructor.
         */
-       ~GHOST_SystemPathsX11();
+       ~GHOST_SystemPathsUnix();
 
        /**
         * Determine the base dir in which shared resources are located. It will first try to use
@@ -76,5 +76,4 @@ public:
        void addToSystemRecentFiles(const char *filename) const;
 };
 
-#endif
-
+#endif  /* __GHOST_SYSTEMPATHSUNIX_H__ */
index 325cba0..1cad9ca 100644 (file)
@@ -48,7 +48,7 @@
 #include "GHOST_DisplayManagerX11.h"
 #include "GHOST_EventDragnDrop.h"
 #ifdef WITH_INPUT_NDOF
-#  include "GHOST_NDOFManagerX11.h"
+#  include "GHOST_NDOFManagerUnix.h"
 #endif
 
 #ifdef WITH_XDND
@@ -202,7 +202,7 @@ init()
 
        if (success) {
 #ifdef WITH_INPUT_NDOF
-               m_ndofManager = new GHOST_NDOFManagerX11(*this);
+               m_ndofManager = new GHOST_NDOFManagerUnix(*this);
 #endif
                m_displayManager = new GHOST_DisplayManagerX11(this);
 
@@ -589,7 +589,7 @@ processEvents(
                }
 
 #ifdef WITH_INPUT_NDOF
-               if (static_cast<GHOST_NDOFManagerX11 *>(m_ndofManager)->processEvents()) {
+               if (static_cast<GHOST_NDOFManagerUnix *>(m_ndofManager)->processEvents()) {
                        anyProcessed = true;
                }
 #endif