Skip to content

Commit 361ea2f

Browse files
committed
format
1 parent ef9b276 commit 361ea2f

5 files changed

Lines changed: 279 additions & 268 deletions

File tree

src/ruisapp/glue/android/application.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public:
3737
const utki::shared_ref<native_window> ruis_native_window;
3838

3939
app_window(
40-
utki::shared_ref<ruis::context> ruis_context,//
40+
utki::shared_ref<ruis::context> ruis_context, //
4141
utki::shared_ref<native_window> ruis_native_window
4242
) :
4343
ruisapp::window(std::move(ruis_context)),

src/ruisapp/glue/ios/application.cxx

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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

2933
application_glue::application_glue(utki::version_duplet gl_version) :
3034
gl_version(std::move(gl_version))
@@ -40,9 +44,7 @@ void application_glue::render()
4044
app_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;

src/ruisapp/glue/ios/application.hxx

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,50 @@
66

77
#include "window.hxx"
88

9-
namespace{
10-
class app_window : public ruisapp::window{
9+
namespace {
10+
class app_window : public ruisapp::window
11+
{
1112
public:
12-
const utki::shared_ref<native_window> ruis_native_window;
13+
const utki::shared_ref<native_window> ruis_native_window;
1314

14-
app_window(
15-
utki::shared_ref<ruis::context> ruis_context, //
16-
utki::shared_ref<native_window> ruis_native_window
17-
) :
15+
app_window(
16+
utki::shared_ref<ruis::context> ruis_context, //
17+
utki::shared_ref<native_window> ruis_native_window
18+
) :
1819
ruisapp::window(std::move(ruis_context)),
1920
ruis_native_window(std::move(ruis_native_window))
2021
{
21-
this->ruis_native_window.get().set_app_window(this);
22-
}
22+
this->ruis_native_window.get().set_app_window(this);
23+
}
2324
};
24-
}
25+
} // namespace
2526

26-
namespace{
27-
class application_glue : public utki::destructable{
28-
const utki::version_duplet gl_version;
27+
namespace {
28+
class application_glue : public utki::destructable
29+
{
30+
const utki::version_duplet gl_version;
2931

30-
// Only one window on ios.
32+
// Only one window on ios.
3133
std::optional<app_window> window;
3234

3335
public:
34-
const utki::shared_ref<ruis::updater> updater = utki::make_shared<ruis::updater>();
36+
const utki::shared_ref<ruis::updater> updater = utki::make_shared<ruis::updater>();
3537

36-
application_glue(utki::version_duplet gl_version);
38+
application_glue(utki::version_duplet gl_version);
3739

38-
app_window& make_window(ruisapp::window_parameters window_params);
40+
app_window& make_window(ruisapp::window_parameters window_params);
3941

40-
void render();
42+
void render();
4143

42-
app_window* get_window()
44+
app_window* get_window()
4345
{
4446
if (this->window.has_value()) {
4547
return &this->window.value();
4648
}
4749
return nullptr;
4850
}
4951
};
50-
}
52+
} // namespace
5153

5254
namespace {
5355
inline application_glue& get_glue(ruisapp::application& app)

0 commit comments

Comments
 (0)