Blender V5.0
GHOST_NDOFManagerCocoa.mm File Reference
#include "GHOST_NDOFManagerCocoa.hh"
#include "GHOST_SystemCocoa.hh"
import <Cocoa/Cocoa.h>
#include <dlfcn.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  ConnexionDeviceState

Macros

#define DEBUG_NDOF_DRIVER   false
#define kConnexionClientModeTakeOver   1
#define kConnexionMaskAll   0x3fff
#define kConnexionMaskAxis   0x3f00
#define kConnexionMaskNoButtons   0x0
#define kConnexionMaskAllButtons   0xffffffff
#define kConnexionCmdHandleButtons   2
#define kConnexionCmdHandleAxis   3
#define kConnexionCmdAppSpecific   10
#define kConnexionCmdAppEvent   11
#define kConnexionMsgDeviceState   '3dSR'
#define kConnexionCtlGetDeviceID   '3did'
#define DECLARE_FUNC(name)
#define LOAD_FUNC(name)

Typedefs

typedef void(* AddedHandler) (uint32_t)
typedef void(* RemovedHandler) (uint32_t)
typedef void(* MessageHandler) (uint32_t, uint32_t msg_type, void *msg_arg)
typedef int16_t(* SetConnexionHandlers_ptr) (MessageHandler, AddedHandler, RemovedHandler, bool)
typedef void(* CleanupConnexionHandlers_ptr) ()
typedef uint16_t(* RegisterConnexionClient_ptr) (uint32_t signature, const char *name, uint16_t mode, uint32_t mask)
typedef void(* SetConnexionClientButtonMask_ptr) (uint16_t clientID, uint32_t buttonMask)
typedef void(* UnregisterConnexionClient_ptr) (uint16_t clientID)
typedef int16_t(* ConnexionClientControl_ptr) (uint16_t clientID, uint32_t message, int32_t param, int32_t *result)

Functions

 DECLARE_FUNC (SetConnexionHandlers)
 DECLARE_FUNC (CleanupConnexionHandlers)
 DECLARE_FUNC (RegisterConnexionClient)
 DECLARE_FUNC (SetConnexionClientButtonMask)
 DECLARE_FUNC (UnregisterConnexionClient)
 DECLARE_FUNC (ConnexionClientControl)
static void * load_func (void *module, const char *func_name)
static bool load_driver_functions ()
static void unload_driver ()
static void DeviceAdded (uint32_t)
static void DeviceRemoved (uint32_t)
static void DeviceEvent (uint32_t, uint32_t msg_type, void *msg_arg)

Variables

static GHOST_SystemCocoaghost_system = nullptr
static GHOST_NDOFManagerndof_manager = nullptr
static uint16_t clientID = 0
static bool driver_loaded = false
static NSString * new_driver_minimal_version = @"@"1.3.4.473"
static void * module

Macro Definition Documentation

◆ DEBUG_NDOF_DRIVER

#define DEBUG_NDOF_DRIVER   false

Definition at line 5 of file GHOST_NDOFManagerCocoa.mm.

◆ DECLARE_FUNC

#define DECLARE_FUNC ( name)
Value:
name##_ptr name = nullptr
const char * name

Definition at line 80 of file GHOST_NDOFManagerCocoa.mm.

◆ kConnexionClientModeTakeOver

#define kConnexionClientModeTakeOver   1

◆ kConnexionCmdAppEvent

#define kConnexionCmdAppEvent   11

Definition at line 41 of file GHOST_NDOFManagerCocoa.mm.

Referenced by DeviceEvent().

◆ kConnexionCmdAppSpecific

#define kConnexionCmdAppSpecific   10

Definition at line 40 of file GHOST_NDOFManagerCocoa.mm.

Referenced by DeviceEvent().

◆ kConnexionCmdHandleAxis

#define kConnexionCmdHandleAxis   3

Definition at line 39 of file GHOST_NDOFManagerCocoa.mm.

Referenced by DeviceEvent().

◆ kConnexionCmdHandleButtons

#define kConnexionCmdHandleButtons   2

Definition at line 38 of file GHOST_NDOFManagerCocoa.mm.

Referenced by DeviceEvent().

◆ kConnexionCtlGetDeviceID

#define kConnexionCtlGetDeviceID   '3did'

Definition at line 43 of file GHOST_NDOFManagerCocoa.mm.

Referenced by DeviceAdded().

◆ kConnexionMaskAll

#define kConnexionMaskAll   0x3fff

◆ kConnexionMaskAllButtons

#define kConnexionMaskAllButtons   0xffffffff

◆ kConnexionMaskAxis

#define kConnexionMaskAxis   0x3f00

◆ kConnexionMaskNoButtons

#define kConnexionMaskNoButtons   0x0

◆ kConnexionMsgDeviceState

#define kConnexionMsgDeviceState   '3dSR'

Definition at line 42 of file GHOST_NDOFManagerCocoa.mm.

Referenced by DeviceEvent().

◆ LOAD_FUNC

#define LOAD_FUNC ( name)
Value:
static void * load_func(void *module, const char *func_name)
static struct PyModuleDef module
Definition python.cpp:796

Definition at line 105 of file GHOST_NDOFManagerCocoa.mm.

Referenced by load_driver_functions().

Typedef Documentation

◆ AddedHandler

typedef void(* AddedHandler) (uint32_t)

Definition at line 62 of file GHOST_NDOFManagerCocoa.mm.

◆ CleanupConnexionHandlers_ptr

typedef void(* CleanupConnexionHandlers_ptr) ()

Definition at line 68 of file GHOST_NDOFManagerCocoa.mm.

◆ ConnexionClientControl_ptr

typedef int16_t(* ConnexionClientControl_ptr) (uint16_t clientID, uint32_t message, int32_t param, int32_t *result)

Definition at line 75 of file GHOST_NDOFManagerCocoa.mm.

◆ MessageHandler

typedef void(* MessageHandler) (uint32_t, uint32_t msg_type, void *msg_arg)

Definition at line 64 of file GHOST_NDOFManagerCocoa.mm.

◆ RegisterConnexionClient_ptr

typedef uint16_t(* RegisterConnexionClient_ptr) (uint32_t signature, const char *name, uint16_t mode, uint32_t mask)

Definition at line 69 of file GHOST_NDOFManagerCocoa.mm.

◆ RemovedHandler

typedef void(* RemovedHandler) (uint32_t)

Definition at line 63 of file GHOST_NDOFManagerCocoa.mm.

◆ SetConnexionClientButtonMask_ptr

typedef void(* SetConnexionClientButtonMask_ptr) (uint16_t clientID, uint32_t buttonMask)

Definition at line 73 of file GHOST_NDOFManagerCocoa.mm.

◆ SetConnexionHandlers_ptr

typedef int16_t(* SetConnexionHandlers_ptr) (MessageHandler, AddedHandler, RemovedHandler, bool)

Definition at line 67 of file GHOST_NDOFManagerCocoa.mm.

◆ UnregisterConnexionClient_ptr

typedef void(* UnregisterConnexionClient_ptr) (uint16_t clientID)

Definition at line 74 of file GHOST_NDOFManagerCocoa.mm.

Function Documentation

◆ DECLARE_FUNC() [1/6]

DECLARE_FUNC ( CleanupConnexionHandlers )

◆ DECLARE_FUNC() [2/6]

DECLARE_FUNC ( ConnexionClientControl )

◆ DECLARE_FUNC() [3/6]

DECLARE_FUNC ( RegisterConnexionClient )

◆ DECLARE_FUNC() [4/6]

DECLARE_FUNC ( SetConnexionClientButtonMask )

◆ DECLARE_FUNC() [5/6]

DECLARE_FUNC ( SetConnexionHandlers )

◆ DECLARE_FUNC() [6/6]

DECLARE_FUNC ( UnregisterConnexionClient )

◆ DeviceAdded()

void DeviceAdded ( uint32_t )
static

◆ DeviceEvent()

◆ DeviceRemoved()

void DeviceRemoved ( uint32_t )
static

Definition at line 164 of file GHOST_NDOFManagerCocoa.mm.

References printf.

Referenced by GHOST_NDOFManagerCocoa::GHOST_NDOFManagerCocoa().

◆ load_driver_functions()

bool load_driver_functions ( )
static

◆ load_func()

void * load_func ( void * module,
const char * func_name )
static

Definition at line 89 of file GHOST_NDOFManagerCocoa.mm.

References module, and printf.

◆ unload_driver()

void unload_driver ( )
static

Definition at line 144 of file GHOST_NDOFManagerCocoa.mm.

References module.

Referenced by GHOST_NDOFManagerCocoa::~GHOST_NDOFManagerCocoa().

Variable Documentation

◆ clientID

◆ driver_loaded

◆ ghost_system

◆ module

void* module
static

Definition at line 107 of file GHOST_NDOFManagerCocoa.mm.

◆ ndof_manager

◆ new_driver_minimal_version

NSString* new_driver_minimal_version = @"@"1.3.4.473"
static