From 75360443eb879b49a72c11b2a3d2d299ca61f9d7 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Fri, 28 Sep 2012 13:40:18 +0000 Subject: Modified sendHeadposeToGame, so it also sends raw data. Unified the code by adding the Dll class to the protocols and moving the dialog to a separate source. git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@173 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Protocol_Base/ftnoir_protocol_base.h | 32 +++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'FTNoIR_Protocol_Base') diff --git a/FTNoIR_Protocol_Base/ftnoir_protocol_base.h b/FTNoIR_Protocol_Base/ftnoir_protocol_base.h index 76f5ecc7..214aae7f 100644 --- a/FTNoIR_Protocol_Base/ftnoir_protocol_base.h +++ b/FTNoIR_Protocol_Base/ftnoir_protocol_base.h @@ -58,12 +58,8 @@ struct IProtocol virtual ~IProtocol() {} virtual void Initialize() = 0; virtual bool checkServerInstallationOK ( HANDLE handle ) = 0; - virtual void sendHeadposeToGame( THeadPoseData *headpose ) = 0; + virtual void sendHeadposeToGame( THeadPoseData *headpose, THeadPoseData *rawheadpose ) = 0; virtual void getNameFromGame( char *dest ) = 0; // Take care dest can handle up to 100 chars... - - virtual void getFullName(QString *strToBeFilled) = 0; - virtual void getShortName(QString *strToBeFilled) = 0; - virtual void getDescription(QString *strToBeFilled) = 0; }; typedef IProtocol* IProtocolPtr; @@ -85,6 +81,26 @@ struct IProtocolDialog { virtual ~IProtocolDialog() {} virtual void Initialize(QWidget *parent) = 0; +}; + +typedef IProtocolDialog* IProtocolDialogPtr; + +// Factory function that creates instances of the Protocol object. +EXTERN_C +FTNOIR_PROTOCOL_BASE_EXPORT +IProtocolDialogPtr +__stdcall +GetProtocolDialog(void); + +//////////////////////////////////////////////////////////////////////////////// +// COM-Like abstract interface. +// This interface doesn't require __declspec(dllexport/dllimport) specifier. +// Method calls are dispatched via virtual table. +// Any C++ compiler can use it. +// Instances are obtained via factory function. +struct IProtocolDll +{ + virtual ~IProtocolDll() {} virtual void getFullName(QString *strToBeFilled) = 0; virtual void getShortName(QString *strToBeFilled) = 0; @@ -92,14 +108,14 @@ struct IProtocolDialog virtual void getIcon(QIcon *icon) = 0; }; -typedef IProtocolDialog* IProtocolDialogPtr; +typedef IProtocolDll* IProtocolDllPtr; // Factory function that creates instances of the Protocol object. EXTERN_C FTNOIR_PROTOCOL_BASE_EXPORT -IProtocolDialogPtr +IProtocolDllPtr __stdcall -GetProtocolDialog(void); +GetProtocolDll(void); #endif // FTNOIR_PROTOCOL_BASE_H -- cgit v1.2.3