11#include " application.hxx"
22
3- namespace {
4- ruis::real get_dots_per_inch (){
3+ namespace {
4+ ruis::real get_dots_per_inch ()
5+ {
56 float scale = [[UIScreen mainScreen] scale];
67
78 ruis::real value;
@@ -13,18 +14,21 @@ ruis::real get_dots_per_inch(){
1314 } else {
1415 value = 160 * scale;
1516 }
16- utki::log_debug ([&](auto &o){o << " dpi = " << value << std::endl;});
17+ utki::log_debug ([&](auto & o) {
18+ o << " dpi = " << value << std::endl;
19+ });
1720 return value;
1821}
19- }
22+ } // namespace
2023
21- namespace {
22- ruis::real get_dots_per_pp (){
24+ namespace {
25+ ruis::real get_dots_per_pp ()
26+ {
2327 float scale = [[UIScreen mainScreen] scale];
2428
2529 return ruis::real (scale);
2630}
27- }
31+ } // namespace
2832
2933application_glue::application_glue (utki::version_duplet gl_version) :
3034 gl_version(std::move(gl_version))
@@ -40,9 +44,7 @@ void application_glue::render()
4044app_window& application_glue::make_window (ruisapp::window_parameters window_params)
4145{
4246 if (this ->window .has_value ()) {
43- throw std::logic_error (
44- " application::make_window(): one window already exists, only one window allowed on ios"
45- );
47+ throw std::logic_error (" application::make_window(): one window already exists, only one window allowed on ios" );
4648 }
4749
4850 utki::assert (!this ->window .has_value (), SL);
@@ -69,10 +71,10 @@ app_window& application_glue::make_window(ruisapp::window_parameters window_para
6971 [this ](std::function<void ()> procedure) {
7072 auto p = reinterpret_cast <NSInteger>(new std::function<void ()>(std::move (procedure)));
7173
72- dispatch_async (dispatch_get_main_queue (), ^{
73- std::unique_ptr<std::function<void ()>> m (reinterpret_cast <std::function<void ()>*>(p));
74- (*m)();
75- });
74+ dispatch_async (dispatch_get_main_queue (), ^{
75+ std::unique_ptr<std::function<void ()>> m (reinterpret_cast <std::function<void ()>*>(p));
76+ (*m)();
77+ });
7678 },
7779 .updater = this ->updater ,
7880 .renderer = utki::make_shared<ruis::render::renderer>(
@@ -82,7 +84,7 @@ app_window& application_glue::make_window(ruisapp::window_parameters window_para
8284 ),
8385 .style_provider = std::move (ruis_style_provider),
8486 .units = ruis::units (
85- get_dots_per_inch (),
87+ get_dots_per_inch (), //
8688 get_dots_per_pp ()
8789 )
8890 });
@@ -106,15 +108,16 @@ ruisapp::application::application(parameters params) :
106108 )
107109{}
108110
109- std::unique_ptr<papki::file> ruisapp::application::get_res_file (std::string_view path)const {
111+ std::unique_ptr<papki::file> ruisapp::application::get_res_file (std::string_view path) const
112+ {
110113 std::string dir ([[[NSBundle mainBundle] resourcePath] fileSystemRepresentation]);
111114
112- // TRACE(<< "res path = " << dir << std::endl)
115+ // TRACE(<< "res path = " << dir << std::endl)
113116
114117 auto rdf = std::make_unique<papki::root_dir>(
115- std::make_unique<papki::fs_file>(), //
116- dir + " /" // TODO: use utki::cat()?
117- );
118+ std::make_unique<papki::fs_file>(), //
119+ dir + " /" // TODO: use utki::cat()?
120+ );
118121 rdf->set_path (path);
119122
120123 return rdf;
0 commit comments