Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Luc Peurière <jlp@nerim.net>2008-03-13 18:40:24 +0300
committerJean-Luc Peurière <jlp@nerim.net>2008-03-13 18:40:24 +0300
commit526d0bec4722900a86d81ff0f5d71504b2b4ad8c (patch)
tree726fc6e9434695b358d3b9e15eb51526fffe6d67 /intern/ghost
parent09bb791249da886521759ead88b9b36673f6968f (diff)
final (??) work on NDOF branch
it is now in a state where it can be safely merged with trunk. Note: basic icons were provided but I'm not an icondesigner and working in a 16x15 grid is way too small for me, so feel free to change them.
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/GHOST_C-api.h5
-rw-r--r--intern/ghost/GHOST_ISystem.h2
-rw-r--r--intern/ghost/intern/GHOST_C-api.cpp2
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.cpp28
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.h2
-rw-r--r--intern/ghost/intern/GHOST_System.cpp7
-rw-r--r--intern/ghost/intern/GHOST_System.h3
7 files changed, 17 insertions, 32 deletions
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 568437b4231..2b17b8f8c61 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -272,15 +272,12 @@ extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
/**
* Open N-degree of freedom devices
*/
-extern void GHOST_OpenNDOF(GHOST_SystemHandle systemhandle,
+extern int GHOST_OpenNDOF(GHOST_SystemHandle systemhandle,
GHOST_WindowHandle windowhandle,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen
);
-
- // original patch only
- // GHOST_NDOFEventHandler_fp setNdofEventHandler);
/***************************************************************************************
** Cursor management functionality
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index 541a78cbaa9..381aac64de0 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -302,7 +302,7 @@ public:
/**
* Starts the N-degree of freedom device manager
*/
- virtual void openNDOF(GHOST_IWindow*,
+ virtual int openNDOF(GHOST_IWindow*,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 8fa79261483..054cd507d1d 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -259,7 +259,7 @@ GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_Eve
return system->addEventConsumer((GHOST_CallbackEventConsumer*)consumerhandle);
}
-void GHOST_OpenNDOF(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle,
+int GHOST_OpenNDOF(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen)
diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp
index 501d6c57dd5..5254952f03c 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManager.cpp
@@ -57,19 +57,22 @@ GHOST_NDOFManager::~GHOST_NDOFManager()
}
-void
+int
GHOST_NDOFManager::deviceOpen(GHOST_IWindow* window,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen)
{
+ int Pid;
+
ndofLibraryInit = setNdofLibraryInit;
ndofLibraryShutdown = setNdofLibraryShutdown;
ndofDeviceOpen = setNdofDeviceOpen;
if (ndofLibraryInit && ndofDeviceOpen)
{
- printf("%i client \n", ndofLibraryInit());
+ Pid= ndofLibraryInit();
+ printf("%i client \n", Pid);
#if defined(_WIN32) || defined(__APPLE__)
m_DeviceHandle = ndofDeviceOpen((void *)&currentNdofValues);
#else
@@ -78,26 +81,13 @@ GHOST_NDOFManager::deviceOpen(GHOST_IWindow* window,
void *ndofInfo = sys->prepareNdofInfo(&currentNdofValues);
m_DeviceHandle = ndofDeviceOpen(ndofInfo);
#endif
- }
+ return (Pid > 0) ? 0 : 1;
+
+ } else
+ return 1;
}
-/** original patch only */
-/*
-GHOST_TEventNDOFData*
-GHOST_NDOFManager::handle(unsigned int message, unsigned int* wParam, unsigned long* lParam)
-{
- static GHOST_TEventNDOFData sbdata;
- int handled = 0;
- if (ndofEventHandler && m_DeviceHandle != 0)
- {
- handled = ndofEventHandler(&sbdata.tx, m_DeviceHandle, message, wParam, lParam);
- }
- printf("handled %i\n", handled);
- return handled ? &sbdata : 0;
-}
-*/
-
bool
GHOST_NDOFManager::available() const
{
diff --git a/intern/ghost/intern/GHOST_NDOFManager.h b/intern/ghost/intern/GHOST_NDOFManager.h
index c1f0b2c80af..18d651b89af 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.h
+++ b/intern/ghost/intern/GHOST_NDOFManager.h
@@ -34,7 +34,7 @@ public:
GHOST_NDOFManager();
virtual ~GHOST_NDOFManager();
- void deviceOpen(GHOST_IWindow* window,
+ int deviceOpen(GHOST_IWindow* window,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen);
diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp
index 674b1f67d55..a083dfd88d6 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -240,18 +240,15 @@ GHOST_TSuccess GHOST_System::pushEvent(GHOST_IEvent* event)
return success;
}
-void GHOST_System::openNDOF(GHOST_IWindow* w,
+int GHOST_System::openNDOF(GHOST_IWindow* w,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen)
-// original patch only
-// GHOST_NDOFEventHandler_fp setNdofEventHandler)
{
- m_ndofManager->deviceOpen(w,
+ return m_ndofManager->deviceOpen(w,
setNdofLibraryInit,
setNdofLibraryShutdown,
setNdofDeviceOpen);
- // setNdofEventHandler);
}
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index a45196ee3da..4c797fbaa80 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -193,8 +193,9 @@ public:
/** Inherited from GHOST_ISystem
* Opens the N-degree of freedom device manager
+ * return 0 if device found, 1 otherwise
*/
- virtual void openNDOF(GHOST_IWindow* w,
+ virtual int openNDOF(GHOST_IWindow* w,
GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen);