New cpp folder structure

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-07-17 22:35:52 +03:00
committed by Konstantin Pastbin
parent c9cbb64f12
commit 76ffc99abd
2390 changed files with 345 additions and 339 deletions

View File

@@ -0,0 +1,75 @@
#include "drape_gui.hpp"
#include "ruler_helper.hpp"
#include "drape_frontend/color_constants.hpp"
#include "drape_frontend/visual_params.hpp"
#include "base/assert.hpp"
namespace gui
{
df::ColorConstant const kGuiTextColor = "GuiText";
struct DrapeGui::Impl
{
RulerHelper m_rulerHelper;
};
DrapeGui::DrapeGui()
: m_impl(new Impl())
{}
DrapeGui & DrapeGui::Instance()
{
static DrapeGui s_gui;
if (!s_gui.m_impl)
s_gui.m_impl.reset(new Impl());
return s_gui;
}
RulerHelper & DrapeGui::GetRulerHelper()
{
return Instance().GetRulerHelperImpl();
}
dp::FontDecl DrapeGui::GetGuiTextFont()
{
return {df::GetColorConstant(kGuiTextColor), 14};
}
void DrapeGui::Destroy()
{
ASSERT(m_impl != nullptr, ());
m_impl.reset();
}
void DrapeGui::SetSurfaceSize(m2::PointF const & size)
{
std::lock_guard<std::mutex> lock(m_surfaceSizeMutex);
m_surfaceSize = size;
}
m2::PointF DrapeGui::GetSurfaceSize() const
{
std::lock_guard<std::mutex> lock(m_surfaceSizeMutex);
return m_surfaceSize;
}
RulerHelper & DrapeGui::GetRulerHelperImpl()
{
ASSERT(m_impl != nullptr, ());
return m_impl->m_rulerHelper;
}
void DrapeGui::ConnectOnCompassTappedHandler(Shape::TTapHandler const & handler)
{
m_onCompassTappedHandler = handler;
}
void DrapeGui::CallOnCompassTappedHandler()
{
if(m_onCompassTappedHandler != nullptr)
m_onCompassTappedHandler();
}
} // namespace gui