From be2926499af2e372c313d965533be3a7ee0dcf4d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 16 May 2016 11:19:10 +0200 Subject: add tobii eyex sdk --- Tobii EyeX/include/eyex-cpp/Context.hpp | 91 +++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 Tobii EyeX/include/eyex-cpp/Context.hpp (limited to 'Tobii EyeX/include/eyex-cpp/Context.hpp') diff --git a/Tobii EyeX/include/eyex-cpp/Context.hpp b/Tobii EyeX/include/eyex-cpp/Context.hpp new file mode 100755 index 0000000..c6cefa0 --- /dev/null +++ b/Tobii EyeX/include/eyex-cpp/Context.hpp @@ -0,0 +1,91 @@ +/********************************************************************************************************************* + * Copyright 2013-2014 Tobii Technology AB. All rights reserved. + * Context.hpp + *********************************************************************************************************************/ + +#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Context__HPP__) +#define __TOBII_TX_CLIENT_CPPBINDINGS_Context__HPP__ + +/*********************************************************************************************************************/ + +TX_NAMESPACE_BEGIN + +/*********************************************************************************************************************/ + +class Context : + public std::enable_shared_from_this +{ + Context(bool trackObjects); + +public: + static std::shared_ptr Create(bool trackObjects); + virtual ~Context(); + + TX_CONTEXTHANDLE GetHandle() const; + void SetName(const std::string& name); + std::string GetName() const; + + TX_TICKET RegisterConnectionStateChangedHandler(ConnectionStateChangedHandler fnConnectionStateChangedHandler); + void UnregisterConnectionStateChangedHandler(TX_TICKET ticket); + + void EnableConnection(); + void DisableConnection(); + void Shutdown(); + + + TX_TICKET RegisterMessageHandler(TX_MESSAGETYPE messageType, std::shared_ptr spOptions, AsyncDataHandler fnAsyncDataHandler); + void UnregisterMessageHandler(TX_TICKET ticket); + + void RegisterStateObserver(const std::string& statePath); + void UnregisterStateObserver(const std::string& statePath); + void GetStateAsync(const std::string& statePath, AsyncDataHandler fnCompletion) const; + std::shared_ptr GetState(const std::string& statePath) const; + + TX_TICKET RegisterStateChangedHandler(const std::string& statePath, AsyncDataHandler fnHandler); + void UnregisterStateChangedHandler(TX_TICKET ticket); + + template + void SetStateAsync(const std::string& statePath, const TValue& value, AsyncDataHandler fnCompletion = nullptr); + + std::vector> GetTrackedObjects() const; + + std::shared_ptr CreateObject(TX_HANDLE hObject) const; + std::shared_ptr CreateObject(Tx::Utils::ScopedHandle& hObject) const; + std::shared_ptr CreateProperty(TX_PROPERTYHANDLE hProperty) const; + + std::shared_ptr CreateBag(TX_PROPERTYBAGTYPE bagType = TX_PROPERTYBAGTYPE_OBJECT) const; + std::shared_ptr CreateStateBag(const std::string& statePath) const; + std::shared_ptr CreateSnapshot() const; + std::shared_ptr CreateGlobalInteractorSnapshot(TX_CONSTSTRING globalInteractorId, std::shared_ptr* pspInteractor) const; + std::shared_ptr CreateCommand(TX_COMMANDTYPE commandType) const; + std::shared_ptr CreateActionCommand(TX_ACTIONTYPE actionType) const; + + void DisableBuiltinKeys(const std::string& windowId, AsyncDataHandler fnCompletion = nullptr) const; + void EnableBuiltinKeys(const std::string& windowId, AsyncDataHandler fnCompletion = nullptr) const; + + void LaunchConfigurationTool(TX_CONFIGURATIONTOOL configurationTool, AsyncDataHandler fnCompletion = nullptr) const; + + template + std::shared_ptr CreateObject(TX_HANDLE hObject) const; + + template + std::shared_ptr CreateObject(Tx::Utils::ScopedHandle& hObject) const; + + void WriteLogMessage(TX_LOGLEVEL level, const std::string& scope, const std::string& message); + void PerformScheduledJobs(); + + void InvokeAsyncDataHandler(TX_CONSTHANDLE hAsyncData, AsyncDataHandler fnHandler) const; + +private: + TX_CONTEXTHANDLE _hContext; +}; + +/*********************************************************************************************************************/ + +TX_NAMESPACE_END + +/*********************************************************************************************************************/ + +#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Context__HPP__) + +/*********************************************************************************************************************/ -- cgit v1.2.3