diff --git a/Development/Source/Core/System/E3Controller.cpp b/Development/Source/Core/System/E3Controller.cpp index f72aae56f..ae10c5a23 100644 --- a/Development/Source/Core/System/E3Controller.cpp +++ b/Development/Source/Core/System/E3Controller.cpp @@ -856,8 +856,8 @@ E3ControllerState_New(TQ3ControllerRef controllerRef) #else return((TQ3ControllerStateObject)0); #endif + //TODO: (or not todo?) Q3Object_Dispose(aTQ3ControllerStateObject) to be implemented... (locally) } -#warning TODO? Q3Object_Dispose(aTQ3ControllerStateObject) to be implemented... (locally) diff --git a/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerCoreOSX.mm b/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerCoreOSX.mm index 94f844d64..222a3ad48 100644 --- a/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerCoreOSX.mm +++ b/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerCoreOSX.mm @@ -85,7 +85,7 @@ client is implemented via PDO (portable distributed objects). #include "ControllerCoreOSXinternals.h" #if Q3_DEBUG -#import +#import #endif //============================================================================= @@ -108,15 +108,6 @@ client is implemented via PDO (portable distributed objects). //----------------------------------------------------------------------------- // Internal variables go here -/* - ControllerInstance: - -holds library local instance data of controller - -TBC/TBD: - --change in a way that the library's local data supports more than one controller - --Best place to do this is the Controller Driver class ControllerDriverCoreOSX - */ -//ControllerDriverCoreOSX *ControllerInstances = NULL; - /* privateDeviceDBProxy: @@ -134,7 +125,7 @@ client is implemented via PDO (portable distributed objects). #pragma mark - //proxy object id of Controller DB vended by Device Server App -static TQ3Status idOfDB(id *theID) +static TQ3Status proxyOfDeviceDB(id *theID) { TQ3Status status = kQ3Failure; *theID = nil; @@ -161,19 +152,20 @@ static TQ3Status idOfDB(id *theID) //proxy object id for key in controllerRef static id proxyOfControllerRef(TQ3ControllerRef controllerRef) +//TODO: proxyOfControllerRef: change in a way that the library's local data supports more than one controller, local or remote +//TODO: cache the proxy in a dictionary, controllerRef would be the key { //hunt for the connection name as given by the controllerRef and return the proxy #if Q3_DEBUG - NSLog(@"proxyOfControllerRef: hunt for: %@\n",(NSString*)controllerRef); + NSLog(@"proxyOfControllerRef: hunt for: %@\n",(NSString*)controllerRef);//bad access when different processes! #endif - //fetch vended database object: server name is passed key id proxy = [NSConnection rootProxyForConnectionWithRegisteredName:(NSString*)controllerRef host:nil]; [proxy setProtocolForProxy:@protocol(Q3DOController)]; - + return proxy; -};//TODO: proxyOfControllerRef: change in a way that the library's local data supports more than one controller, local or remote +}; #pragma mark - @@ -196,7 +188,7 @@ static id proxyOfControllerRef(TQ3ControllerRef controllerRef) TQ3ControllerRef controllerRef = (TQ3ControllerRef)NULL; //TQ3ControllerRef is a *void !! id proxyDB; - status = idOfDB(&proxyDB); + status = proxyOfDeviceDB(&proxyDB); if (kQ3Success==status) { @@ -241,7 +233,7 @@ static id proxyOfControllerRef(TQ3ControllerRef controllerRef) TQ3Status status = kQ3Failure; id proxyDB; - status = idOfDB(&proxyDB); + status = proxyOfDeviceDB(&proxyDB); if (kQ3Success==status) status = [proxyDB getListChanged:listChanged SerialNumber:serialNumber]; @@ -261,7 +253,7 @@ static id proxyOfControllerRef(TQ3ControllerRef controllerRef) TQ3Status status = kQ3Failure; id proxyDB; - status = idOfDB(&proxyDB); + status = proxyOfDeviceDB(&proxyDB); if (kQ3Success==status){ /*next Controller in db; returns string with key (UUID); @@ -830,7 +822,7 @@ static id proxyOfControllerRef(TQ3ControllerRef controllerRef) TQ3Status status = kQ3Failure; id proxyDB; - status = idOfDB(&proxyDB); + status = proxyOfDeviceDB(&proxyDB); if (kQ3Success==status) { (void)[proxyDB trackerDeleted:[trackerObject->instance trackerUUID]]; diff --git a/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerCoreOSXinternals.h b/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerCoreOSXinternals.h index 29196f275..a6c559c81 100644 --- a/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerCoreOSXinternals.h +++ b/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerCoreOSXinternals.h @@ -48,6 +48,13 @@ #ifndef ControllerCoreOSX_ControllerCoreOSXinternals_h #define ControllerCoreOSX_ControllerCoreOSXinternals_h +//============================================================================= +// C++ preamble +//----------------------------------------------------------------------------- +#ifdef __cplusplus +extern "C" { +#endif + typedef struct TC3TrackerEvent { TQ3Uns32 EventTimeStampKey; @@ -75,4 +82,11 @@ typedef struct TC3ControllerInstanceData TQ3ControllerData instanceData;//public instance data from Controller_New } TC3ControllerInstanceData, *TC3ControllerInstanceDataPtr; +//============================================================================= +// C++ postamble +//----------------------------------------------------------------------------- +#ifdef __cplusplus +} +#endif + #endif diff --git a/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerDriverCoreOSX.h b/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerDriverCoreOSX.h index c28f282d9..886b787de 100644 --- a/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerDriverCoreOSX.h +++ b/Development/Source/Platform/Cocoa/ControllerCoreOSX/ControllerDriverCoreOSX.h @@ -51,6 +51,9 @@ @interface ControllerDriverCoreOSX : NSObject { +/* + ControllerDriverCoreOSX: holds library local instance data of controller + */ @private //TODO: change according to coding convention TQ3ControllerData _controllerData; diff --git a/Development/Source/Platform/Cocoa/ControllerDB/Q3DcontrollerPDO.mm b/Development/Source/Platform/Cocoa/ControllerDB/Q3DcontrollerPDO.mm index fc8b5ba2b..8c7bae86e 100644 --- a/Development/Source/Platform/Cocoa/ControllerDB/Q3DcontrollerPDO.mm +++ b/Development/Source/Platform/Cocoa/ControllerDB/Q3DcontrollerPDO.mm @@ -49,7 +49,7 @@ #import "Q3DcontrollerPDO.h" #if Q3_DEBUG -#import +#import #endif @implementation Q3DcontrollerPDO diff --git a/Development/Source/Platform/Cocoa/ControllerDB/Q3Ddb.mm b/Development/Source/Platform/Cocoa/ControllerDB/Q3Ddb.mm index 63fc6acd1..8e081e142 100644 --- a/Development/Source/Platform/Cocoa/ControllerDB/Q3Ddb.mm +++ b/Development/Source/Platform/Cocoa/ControllerDB/Q3Ddb.mm @@ -49,12 +49,12 @@ #import "Q3Ddb.h" #import "Q3DcontrollerPDO.h" #import "IPCprotocolPDO.h" +#include "E3MacDeviceDbStart.h" + #if Q3_DEBUG -#import +#import #endif -#include "E3MacDeviceDbStart.h" - @implementation Q3Ddb : NSObject - (id)init { @@ -213,7 +213,8 @@ - (out TQ3ControllerRefCast)nextCC3Controller: (in TQ3ControllerRefCast) current if (idx>=[_controllerPDOs count]) return NULL; - return (TQ3ControllerRefCast)[[_controllerPDOs objectAtIndex:idx] controllerRef]; + + return (TQ3ControllerRefCast)[[_controllerPDOs objectAtIndex:idx] UUID]; }; diff --git a/Development/Source/Platform/Cocoa/E3CocoaPrefix.h b/Development/Source/Platform/Cocoa/E3CocoaPrefix.h index 904a4c426..1ffcab796 100644 --- a/Development/Source/Platform/Cocoa/E3CocoaPrefix.h +++ b/Development/Source/Platform/Cocoa/E3CocoaPrefix.h @@ -54,14 +54,14 @@ // compile controller support in #ifndef QUESA_SUPPORT_CONTROLLER #define QUESA_SUPPORT_CONTROLLER 1 - #define QD3D_CONTROLLER_LEGACY_FUNCTIONALITY 1 + #define QD3D_CONTROLLER_LEGACY_FUNCTIONALITY 1 //used for implementing Q3ControllerState_SaveAndReset #endif #if Q3_DEBUG #if QUESA_SUPPORT_CONTROLLER - #warning QUESA_SUPPORT_CONTROLLER is set + #warning QUESA_SUPPORT_CONTROLLER, Q3_DEBUG are set #else - #warning QUESA_SUPPORT_CONTROLLER not set + #warning QUESA_SUPPORT_CONTROLLER, Q3_DEBUG are not set #endif #endif