GHOST: rename suffix X11 to Unix for non X11 files

We may use these for Wayland or SDL back-ends.
This commit is contained in:
Campbell Barton 2015-11-16 21:57:05 +11:00
parent 86154b11ee
commit dc14629b26
8 changed files with 48 additions and 41 deletions

View 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)

View 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

View 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;

View File

@ -23,13 +23,14 @@
#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;

View 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
@ -31,11 +31,11 @@
/* 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__ */

View File

@ -24,12 +24,11 @@
* ***** 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 */

View File

@ -24,31 +24,31 @@
* ***** 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__ */

View 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