19 #ifdef COVELLITE_GUI_ROCKET
23 #include <Rocket/Rocket.hpp>
24 #include <Rocket/Plugin.hpp>
25 namespace CovelliteGui = ::Rocket;
27 #else // __USING_GTEST
29 #define FontDatabase FontDatabase_dummy
30 #include <Rocket/Rocket.mock.hpp>
46 public ::alicorn::extension::testing::Proxy<Proxy>
49 MOCK_METHOD1(LoadFontFace,
bool(String));
50 MOCK_METHOD2(LoadFontFace,
bool(::std::vector<byte>, String));
54 static bool LoadFontFace(
const String & _Path)
56 return Proxy::GetInstance()->LoadFontFace(_Path);
59 static bool LoadFontFace(const ::std::vector<byte> & _Data,
60 const String & _Dummy)
62 return Proxy::GetInstance()->LoadFontFace(_Data, _Dummy);
72 namespace CovelliteGui = ::mock::Rocket;
77 namespace CovelliteGui = ::CovelliteGui;
82 namespace Core {
using EventListener_tested = EventListener; }
88 public ::alicorn::extension::testing::Proxy<Proxy>
91 MOCK_METHOD0(Initialise,
bool(
void));
94 inline void Initialise(
void)
96 Plugin::Proxy::GetInstance()->Initialise();
105 #endif // __USING_GTEST
113 using CovelliteGuiTime_t = float;
114 using CovelliteGuiUnicode_t = CovelliteGui::Core::word;
116 inline ::std::string CovelliteGuiStringToUtf8(
117 const CovelliteGui::Core::String & _String)
119 return _String.CString();
123 inline void CovelliteGuiRemove(T * _pValue)
125 _pValue->RemoveReference();
128 inline void CovelliteGuiLoadFontFace(const ::std::string & _Path)
130 CovelliteGui::Core::FontDatabase::LoadFontFace(_Path.c_str());
133 inline void CovelliteGuiLoadFontFace(const ::std::vector<uint8_t> & _Data)
135 CovelliteGui::Core::FontDatabase::LoadFontFace(_Data,
"");
138 inline void CovelliteGuiSetProgressBarValue(
139 CovelliteGui::Core::Element * _pProgressBar,
142 using namespace ::alicorn::extension::std;
145 dynamic_cast<CovelliteGui::Controls::ElementFormControl &
>(*_pProgressBar);
147 Control.SetValue(string_cast<::std::string, Encoding::UTF8>(
148 uT(
"%VALUE%").Replace(uT(
"%VALUE%"), _Value)).c_str());
155 #elif defined COVELLITE_GUI_RMLUI
157 #ifndef __USING_GTEST
159 #include <RmlUi/RmlUi.hpp>
160 namespace Rml {
namespace Plugin {
inline void Initialise(
void) {} } }
161 namespace CovelliteGui = ::Rml;
163 #else // __USING_GTEST
165 #include "..\Test.Covellite.Gui\Mock\RmlUi.mock.hpp"
166 namespace CovelliteGui = ::mock::Rml;
171 namespace CovelliteGui = ::CovelliteGui;
176 namespace Core {
using EventListener_tested = EventListener; }
182 public ::alicorn::extension::testing::Proxy<Proxy>
185 MOCK_METHOD0(Initialise,
bool(
void));
188 inline void Initialise(
void)
190 Plugin::Proxy::GetInstance()->Initialise();
199 #endif // __USING_GTEST
207 using CovelliteGuiTime_t = double;
208 using CovelliteGuiUnicode_t = CovelliteGui::Core::Character;
210 inline ::std::string CovelliteGuiStringToUtf8(
211 const CovelliteGui::Core::String & _String)
216 inline void CovelliteGuiRemove(CovelliteGui::Core::ElementDocument * _pDocument)
221 inline void CovelliteGuiRemove(CovelliteGui::Core::Context * _pContext)
223 CovelliteGui::Core::RemoveContext(_pContext->GetName());
226 inline void CovelliteGuiLoadFontFace(const ::std::string & _Path)
228 CovelliteGui::Core::LoadFontFace(_Path.c_str());
231 inline void CovelliteGuiLoadFontFace(const ::std::vector<uint8_t> & _Data)
233 CovelliteGui::Core::LoadFontFace(_Data.data(),
static_cast<int>(_Data.size()),
234 "", CovelliteGui::Core::Style::FontStyle::Normal,
235 CovelliteGui::Core::Style::FontWeight::Normal);
238 inline void CovelliteGuiSetProgressBarValue(
239 CovelliteGui::Core::Element * _pProgressBar,
243 dynamic_cast<CovelliteGui::Controls::ElementProgressBar &
>(*_pProgressBar);
245 Control.SetValue(_Value);
252 #else // COVELLITE_GUI_*
254 namespace CovelliteGui
260 template<
typename>
class Vector2;
261 using Vector2i = Vector2<int>;
262 class ElementDocument;
270 #endif // COVELLITE_GUI_*