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/Query.inl | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 Tobii EyeX/include/eyex-cpp/Query.inl (limited to 'Tobii EyeX/include/eyex-cpp/Query.inl') diff --git a/Tobii EyeX/include/eyex-cpp/Query.inl b/Tobii EyeX/include/eyex-cpp/Query.inl new file mode 100755 index 0000000..9b6c2e7 --- /dev/null +++ b/Tobii EyeX/include/eyex-cpp/Query.inl @@ -0,0 +1,58 @@ +/********************************************************************************************************************* + * Copyright 2013-2014 Tobii Technology AB. All rights reserved. + * Query.inl + *********************************************************************************************************************/ + +#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Query__INL__) +#define __TOBII_TX_CLIENT_CPPBINDINGS_Query__INL__ + +/*********************************************************************************************************************/ + +TX_NAMESPACE_BEGIN + +/*********************************************************************************************************************/ + +inline Query::Query(const std::shared_ptr& spContext, TX_HANDLE hQuery) +: InteractionObject(spContext, hQuery) +{} + +/*********************************************************************************************************************/ + +inline std::shared_ptr Query::GetBounds() const +{ + Tx::Utils::ScopedHandle hBounds; + TX_VALIDATE(txGetQueryBounds(_hObject, &hBounds)); + auto spBounds = _spContext->CreateObject(hBounds); + return spBounds; +} + +/*********************************************************************************************************************/ + +inline std::vector Query::GetWindowIds() const +{ + TX_SIZE windowIdCount; + TX_VALIDATE(txGetQueryWindowIdCount(_hObject, &windowIdCount)); + + std::vector windowIds; + for (int i = 0; i < windowIdCount; i++) + { + std::string windowId; + TX_VALIDATE(Tx::Utils::GetString(&windowId, [i, this](TX_CHAR* pBuf, TX_SIZE* pSize) + { + return txGetQueryWindowId(_hObject, i, pBuf, pSize); + })); + + windowIds.push_back(windowId); + } + return windowIds; +} + +/*********************************************************************************************************************/ + +TX_NAMESPACE_END + +/*********************************************************************************************************************/ + +#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Query__INL__) + +/*********************************************************************************************************************/ -- cgit v1.2.3