GWindow.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. #include <AK/HashMap.h>
  2. #include <AK/JsonObject.h>
  3. #include <AK/NeverDestroyed.h>
  4. #include <AK/SharedBuffer.h>
  5. #include <LibC/stdio.h>
  6. #include <LibC/stdlib.h>
  7. #include <LibC/unistd.h>
  8. #include <LibDraw/GraphicsBitmap.h>
  9. #include <LibGUI/GApplication.h>
  10. #include <LibGUI/GEvent.h>
  11. #include <LibGUI/GPainter.h>
  12. #include <LibGUI/GWidget.h>
  13. #include <LibGUI/GWindow.h>
  14. #include <LibGUI/GWindowServerConnection.h>
  15. //#define UPDATE_COALESCING_DEBUG
  16. static NeverDestroyed<HashTable<GWindow*>> all_windows;
  17. static NeverDestroyed<HashMap<int, GWindow*>> reified_windows;
  18. GWindow* GWindow::from_window_id(int window_id)
  19. {
  20. auto it = reified_windows->find(window_id);
  21. if (it != reified_windows->end())
  22. return (*it).value;
  23. return nullptr;
  24. }
  25. GWindow::GWindow(CObject* parent)
  26. : CObject(parent)
  27. {
  28. all_windows->set(this);
  29. m_rect_when_windowless = { 100, 400, 140, 140 };
  30. m_title_when_windowless = "GWindow";
  31. }
  32. GWindow::~GWindow()
  33. {
  34. all_windows->remove(this);
  35. hide();
  36. }
  37. void GWindow::close()
  38. {
  39. hide();
  40. }
  41. void GWindow::move_to_front()
  42. {
  43. if (!m_window_id)
  44. return;
  45. GWindowServerConnection::the().send_sync<WindowServer::MoveWindowToFront>(m_window_id);
  46. }
  47. void GWindow::show()
  48. {
  49. if (m_window_id)
  50. return;
  51. auto response = GWindowServerConnection::the().send_sync<WindowServer::CreateWindow>(
  52. m_rect_when_windowless,
  53. m_has_alpha_channel,
  54. m_modal,
  55. m_resizable,
  56. m_fullscreen,
  57. m_show_titlebar,
  58. m_opacity_when_windowless,
  59. m_base_size,
  60. m_size_increment,
  61. (i32)m_window_type,
  62. m_title_when_windowless);
  63. m_window_id = response->window_id();
  64. apply_icon();
  65. reified_windows->set(m_window_id, this);
  66. GApplication::the().did_create_window({});
  67. update();
  68. }
  69. void GWindow::hide()
  70. {
  71. if (!m_window_id)
  72. return;
  73. reified_windows->remove(m_window_id);
  74. GWindowServerConnection::the().send_sync<WindowServer::DestroyWindow>(m_window_id);
  75. m_window_id = 0;
  76. m_pending_paint_event_rects.clear();
  77. m_back_bitmap = nullptr;
  78. m_front_bitmap = nullptr;
  79. bool app_has_visible_windows = false;
  80. for (auto& window : *all_windows) {
  81. if (window->is_visible()) {
  82. app_has_visible_windows = true;
  83. break;
  84. }
  85. }
  86. if (!app_has_visible_windows)
  87. GApplication::the().did_delete_last_window({});
  88. }
  89. void GWindow::set_title(const StringView& title)
  90. {
  91. m_title_when_windowless = title;
  92. if (!m_window_id)
  93. return;
  94. GWindowServerConnection::the().send_sync<WindowServer::SetWindowTitle>(m_window_id, title);
  95. }
  96. String GWindow::title() const
  97. {
  98. if (!m_window_id)
  99. return m_title_when_windowless;
  100. return GWindowServerConnection::the().send_sync<WindowServer::GetWindowTitle>(m_window_id)->title();
  101. }
  102. Rect GWindow::rect() const
  103. {
  104. if (!m_window_id)
  105. return m_rect_when_windowless;
  106. return GWindowServerConnection::the().send_sync<WindowServer::GetWindowRect>(m_window_id)->rect();
  107. }
  108. void GWindow::set_rect(const Rect& a_rect)
  109. {
  110. m_rect_when_windowless = a_rect;
  111. if (!m_window_id) {
  112. if (m_main_widget)
  113. m_main_widget->resize(m_rect_when_windowless.size());
  114. return;
  115. }
  116. GWindowServerConnection::the().send_sync<WindowServer::SetWindowRect>(m_window_id, a_rect);
  117. if (m_back_bitmap && m_back_bitmap->size() != a_rect.size())
  118. m_back_bitmap = nullptr;
  119. if (m_front_bitmap && m_front_bitmap->size() != a_rect.size())
  120. m_front_bitmap = nullptr;
  121. if (m_main_widget)
  122. m_main_widget->resize(a_rect.size());
  123. }
  124. void GWindow::set_window_type(GWindowType window_type)
  125. {
  126. m_window_type = window_type;
  127. }
  128. void GWindow::set_override_cursor(GStandardCursor cursor)
  129. {
  130. if (!m_window_id)
  131. return;
  132. GWindowServerConnection::the().send_sync<WindowServer::SetWindowOverrideCursor>(m_window_id, (u32)cursor);
  133. }
  134. void GWindow::event(CEvent& event)
  135. {
  136. if (event.type() == GEvent::Drop) {
  137. auto& drop_event = static_cast<GDropEvent&>(event);
  138. if (!m_main_widget)
  139. return;
  140. auto result = m_main_widget->hit_test(drop_event.position());
  141. auto local_event = make<GDropEvent>(result.local_position, drop_event.text(), drop_event.data_type(), drop_event.data());
  142. ASSERT(result.widget);
  143. return result.widget->dispatch_event(*local_event, this);
  144. }
  145. if (event.type() == GEvent::MouseUp || event.type() == GEvent::MouseDown || event.type() == GEvent::MouseDoubleClick || event.type() == GEvent::MouseMove || event.type() == GEvent::MouseWheel) {
  146. auto& mouse_event = static_cast<GMouseEvent&>(event);
  147. if (m_global_cursor_tracking_widget) {
  148. auto window_relative_rect = m_global_cursor_tracking_widget->window_relative_rect();
  149. Point local_point { mouse_event.x() - window_relative_rect.x(), mouse_event.y() - window_relative_rect.y() };
  150. auto local_event = make<GMouseEvent>((GEvent::Type)event.type(), local_point, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers(), mouse_event.wheel_delta());
  151. m_global_cursor_tracking_widget->dispatch_event(*local_event, this);
  152. return;
  153. }
  154. if (m_automatic_cursor_tracking_widget) {
  155. auto window_relative_rect = m_automatic_cursor_tracking_widget->window_relative_rect();
  156. Point local_point { mouse_event.x() - window_relative_rect.x(), mouse_event.y() - window_relative_rect.y() };
  157. auto local_event = make<GMouseEvent>((GEvent::Type)event.type(), local_point, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers(), mouse_event.wheel_delta());
  158. m_automatic_cursor_tracking_widget->dispatch_event(*local_event, this);
  159. if (mouse_event.buttons() == 0)
  160. m_automatic_cursor_tracking_widget = nullptr;
  161. return;
  162. }
  163. if (!m_main_widget)
  164. return;
  165. auto result = m_main_widget->hit_test(mouse_event.position());
  166. auto local_event = make<GMouseEvent>((GEvent::Type)event.type(), result.local_position, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers(), mouse_event.wheel_delta());
  167. ASSERT(result.widget);
  168. set_hovered_widget(result.widget);
  169. if (mouse_event.buttons() != 0 && !m_automatic_cursor_tracking_widget)
  170. m_automatic_cursor_tracking_widget = result.widget->make_weak_ptr();
  171. if (result.widget != m_global_cursor_tracking_widget.ptr())
  172. return result.widget->dispatch_event(*local_event, this);
  173. return;
  174. }
  175. if (event.type() == GEvent::MultiPaint) {
  176. if (!m_window_id)
  177. return;
  178. if (!m_main_widget)
  179. return;
  180. auto& paint_event = static_cast<GMultiPaintEvent&>(event);
  181. auto rects = paint_event.rects();
  182. ASSERT(!rects.is_empty());
  183. if (m_back_bitmap && m_back_bitmap->size() != paint_event.window_size()) {
  184. // Eagerly discard the backing store if we learn from this paint event that it needs to be bigger.
  185. // Otherwise we would have to wait for a resize event to tell us. This way we don't waste the
  186. // effort on painting into an undersized bitmap that will be thrown away anyway.
  187. m_back_bitmap = nullptr;
  188. }
  189. bool created_new_backing_store = !m_back_bitmap;
  190. if (!m_back_bitmap) {
  191. m_back_bitmap = create_backing_bitmap(paint_event.window_size());
  192. } else if (m_double_buffering_enabled) {
  193. bool still_has_pixels = m_back_bitmap->shared_buffer()->set_nonvolatile();
  194. if (!still_has_pixels) {
  195. m_back_bitmap = create_backing_bitmap(paint_event.window_size());
  196. created_new_backing_store = true;
  197. }
  198. }
  199. auto rect = rects.first();
  200. if (rect.is_empty() || created_new_backing_store) {
  201. rects.clear();
  202. rects.append({ {}, paint_event.window_size() });
  203. }
  204. for (auto& rect : rects)
  205. m_main_widget->dispatch_event(*make<GPaintEvent>(rect), this);
  206. if (m_double_buffering_enabled)
  207. flip(rects);
  208. else if (created_new_backing_store)
  209. set_current_backing_bitmap(*m_back_bitmap, true);
  210. if (m_window_id) {
  211. Vector<Rect> rects_to_send;
  212. for (auto& r : rects)
  213. rects_to_send.append(r);
  214. GWindowServerConnection::the().post_message(WindowServer::DidFinishPainting(m_window_id, rects_to_send));
  215. }
  216. return;
  217. }
  218. if (event.type() == GEvent::KeyUp || event.type() == GEvent::KeyDown) {
  219. if (m_focused_widget)
  220. return m_focused_widget->dispatch_event(event, this);
  221. if (m_main_widget)
  222. return m_main_widget->dispatch_event(event, this);
  223. return;
  224. }
  225. if (event.type() == GEvent::WindowBecameActive || event.type() == GEvent::WindowBecameInactive) {
  226. m_is_active = event.type() == GEvent::WindowBecameActive;
  227. if (m_main_widget)
  228. m_main_widget->dispatch_event(event, this);
  229. if (m_focused_widget)
  230. m_focused_widget->update();
  231. return;
  232. }
  233. if (event.type() == GEvent::WindowCloseRequest) {
  234. if (on_close_request) {
  235. if (on_close_request() == GWindow::CloseRequestDecision::StayOpen)
  236. return;
  237. }
  238. close();
  239. return;
  240. }
  241. if (event.type() == GEvent::WindowLeft) {
  242. set_hovered_widget(nullptr);
  243. return;
  244. }
  245. if (event.type() == GEvent::Resize) {
  246. auto new_size = static_cast<GResizeEvent&>(event).size();
  247. if (m_back_bitmap && m_back_bitmap->size() != new_size)
  248. m_back_bitmap = nullptr;
  249. if (!m_pending_paint_event_rects.is_empty()) {
  250. m_pending_paint_event_rects.clear_with_capacity();
  251. m_pending_paint_event_rects.append({ {}, new_size });
  252. }
  253. m_rect_when_windowless = { {}, new_size };
  254. m_main_widget->set_relative_rect({ {}, new_size });
  255. return;
  256. }
  257. if (event.type() > GEvent::__Begin_WM_Events && event.type() < GEvent::__End_WM_Events)
  258. return wm_event(static_cast<GWMEvent&>(event));
  259. CObject::event(event);
  260. }
  261. bool GWindow::is_visible() const
  262. {
  263. return m_window_id != 0;
  264. }
  265. void GWindow::update()
  266. {
  267. update({ 0, 0, width(), height() });
  268. }
  269. void GWindow::update(const Rect& a_rect)
  270. {
  271. if (!m_window_id)
  272. return;
  273. for (auto& pending_rect : m_pending_paint_event_rects) {
  274. if (pending_rect.contains(a_rect)) {
  275. #ifdef UPDATE_COALESCING_DEBUG
  276. dbgprintf("Ignoring %s since it's contained by pending rect %s\n", a_rect.to_string().characters(), pending_rect.to_string().characters());
  277. #endif
  278. return;
  279. }
  280. }
  281. if (m_pending_paint_event_rects.is_empty()) {
  282. deferred_invoke([this](auto&) {
  283. auto rects = move(m_pending_paint_event_rects);
  284. if (rects.is_empty())
  285. return;
  286. Vector<Rect> rects_to_send;
  287. for (auto& r : rects)
  288. rects_to_send.append(r);
  289. GWindowServerConnection::the().post_message(WindowServer::InvalidateRect(m_window_id, rects_to_send));
  290. });
  291. }
  292. m_pending_paint_event_rects.append(a_rect);
  293. }
  294. void GWindow::set_main_widget(GWidget* widget)
  295. {
  296. if (m_main_widget == widget)
  297. return;
  298. if (m_main_widget)
  299. remove_child(*m_main_widget);
  300. m_main_widget = widget;
  301. if (m_main_widget) {
  302. add_child(*widget);
  303. auto new_window_rect = rect();
  304. if (m_main_widget->horizontal_size_policy() == SizePolicy::Fixed)
  305. new_window_rect.set_width(m_main_widget->preferred_size().width());
  306. if (m_main_widget->vertical_size_policy() == SizePolicy::Fixed)
  307. new_window_rect.set_height(m_main_widget->preferred_size().height());
  308. set_rect(new_window_rect);
  309. m_main_widget->set_relative_rect({ {}, new_window_rect.size() });
  310. m_main_widget->set_window(this);
  311. if (m_main_widget->accepts_focus())
  312. m_main_widget->set_focus(true);
  313. }
  314. update();
  315. }
  316. void GWindow::set_focused_widget(GWidget* widget)
  317. {
  318. if (m_focused_widget == widget)
  319. return;
  320. if (m_focused_widget) {
  321. CEventLoop::current().post_event(*m_focused_widget, make<GEvent>(GEvent::FocusOut));
  322. m_focused_widget->update();
  323. }
  324. m_focused_widget = widget ? widget->make_weak_ptr() : nullptr;
  325. if (m_focused_widget) {
  326. CEventLoop::current().post_event(*m_focused_widget, make<GEvent>(GEvent::FocusIn));
  327. m_focused_widget->update();
  328. }
  329. }
  330. void GWindow::set_global_cursor_tracking_widget(GWidget* widget)
  331. {
  332. if (widget == m_global_cursor_tracking_widget)
  333. return;
  334. m_global_cursor_tracking_widget = widget ? widget->make_weak_ptr() : nullptr;
  335. }
  336. void GWindow::set_automatic_cursor_tracking_widget(GWidget* widget)
  337. {
  338. if (widget == m_automatic_cursor_tracking_widget)
  339. return;
  340. m_automatic_cursor_tracking_widget = widget ? widget->make_weak_ptr() : nullptr;
  341. }
  342. void GWindow::set_has_alpha_channel(bool value)
  343. {
  344. if (m_has_alpha_channel == value)
  345. return;
  346. m_has_alpha_channel = value;
  347. if (!m_window_id)
  348. return;
  349. m_pending_paint_event_rects.clear();
  350. m_back_bitmap = nullptr;
  351. m_front_bitmap = nullptr;
  352. GWindowServerConnection::the().send_sync<WindowServer::SetWindowHasAlphaChannel>(m_window_id, value);
  353. update();
  354. }
  355. void GWindow::set_double_buffering_enabled(bool value)
  356. {
  357. ASSERT(!m_window_id);
  358. m_double_buffering_enabled = value;
  359. }
  360. void GWindow::set_opacity(float opacity)
  361. {
  362. m_opacity_when_windowless = opacity;
  363. if (!m_window_id)
  364. return;
  365. GWindowServerConnection::the().send_sync<WindowServer::SetWindowOpacity>(m_window_id, opacity);
  366. }
  367. void GWindow::set_hovered_widget(GWidget* widget)
  368. {
  369. if (widget == m_hovered_widget)
  370. return;
  371. if (m_hovered_widget)
  372. CEventLoop::current().post_event(*m_hovered_widget, make<GEvent>(GEvent::Leave));
  373. m_hovered_widget = widget ? widget->make_weak_ptr() : nullptr;
  374. if (m_hovered_widget)
  375. CEventLoop::current().post_event(*m_hovered_widget, make<GEvent>(GEvent::Enter));
  376. }
  377. void GWindow::set_current_backing_bitmap(GraphicsBitmap& bitmap, bool flush_immediately)
  378. {
  379. GWindowServerConnection::the().send_sync<WindowServer::SetWindowBackingStore>(m_window_id, 32, bitmap.pitch(), bitmap.shared_buffer_id(), bitmap.has_alpha_channel(), bitmap.size(), flush_immediately);
  380. }
  381. void GWindow::flip(const Vector<Rect, 32>& dirty_rects)
  382. {
  383. swap(m_front_bitmap, m_back_bitmap);
  384. set_current_backing_bitmap(*m_front_bitmap);
  385. if (!m_back_bitmap || m_back_bitmap->size() != m_front_bitmap->size()) {
  386. m_back_bitmap = create_backing_bitmap(m_front_bitmap->size());
  387. memcpy(m_back_bitmap->scanline(0), m_front_bitmap->scanline(0), m_front_bitmap->size_in_bytes());
  388. m_back_bitmap->shared_buffer()->set_volatile();
  389. return;
  390. }
  391. // Copy whatever was painted from the front to the back.
  392. Painter painter(*m_back_bitmap);
  393. for (auto& dirty_rect : dirty_rects)
  394. painter.blit(dirty_rect.location(), *m_front_bitmap, dirty_rect);
  395. m_back_bitmap->shared_buffer()->set_volatile();
  396. }
  397. NonnullRefPtr<GraphicsBitmap> GWindow::create_shared_bitmap(GraphicsBitmap::Format format, const Size& size)
  398. {
  399. ASSERT(GWindowServerConnection::the().server_pid());
  400. ASSERT(!size.is_empty());
  401. size_t pitch = round_up_to_power_of_two(size.width() * sizeof(RGBA32), 16);
  402. size_t size_in_bytes = size.height() * pitch;
  403. auto shared_buffer = SharedBuffer::create_with_size(size_in_bytes);
  404. ASSERT(shared_buffer);
  405. shared_buffer->share_with(GWindowServerConnection::the().server_pid());
  406. return GraphicsBitmap::create_with_shared_buffer(format, *shared_buffer, size);
  407. }
  408. NonnullRefPtr<GraphicsBitmap> GWindow::create_backing_bitmap(const Size& size)
  409. {
  410. auto format = m_has_alpha_channel ? GraphicsBitmap::Format::RGBA32 : GraphicsBitmap::Format::RGB32;
  411. return create_shared_bitmap(format, size);
  412. }
  413. void GWindow::set_modal(bool modal)
  414. {
  415. ASSERT(!m_window_id);
  416. m_modal = modal;
  417. }
  418. void GWindow::wm_event(GWMEvent&)
  419. {
  420. }
  421. void GWindow::set_icon(const GraphicsBitmap* icon)
  422. {
  423. if (m_icon == icon)
  424. return;
  425. m_icon = create_shared_bitmap(GraphicsBitmap::Format::RGBA32, icon->size());
  426. {
  427. GPainter painter(*m_icon);
  428. painter.blit({ 0, 0 }, *icon, icon->rect());
  429. }
  430. apply_icon();
  431. }
  432. void GWindow::apply_icon()
  433. {
  434. if (!m_icon)
  435. return;
  436. if (!m_window_id)
  437. return;
  438. int rc = seal_shared_buffer(m_icon->shared_buffer_id());
  439. ASSERT(rc == 0);
  440. rc = share_buffer_globally(m_icon->shared_buffer_id());
  441. ASSERT(rc == 0);
  442. static bool has_set_process_icon;
  443. if (!has_set_process_icon)
  444. set_process_icon(m_icon->shared_buffer_id());
  445. GWindowServerConnection::the().send_sync<WindowServer::SetWindowIconBitmap>(m_window_id, m_icon->shared_buffer_id(), m_icon->size());
  446. }
  447. void GWindow::start_wm_resize()
  448. {
  449. GWindowServerConnection::the().post_message(WindowServer::WM_StartWindowResize(GWindowServerConnection::the().my_client_id(), m_window_id));
  450. }
  451. Vector<GWidget*> GWindow::focusable_widgets() const
  452. {
  453. if (!m_main_widget)
  454. return {};
  455. Vector<GWidget*> collected_widgets;
  456. Function<void(GWidget&)> collect_focusable_widgets = [&](GWidget& widget) {
  457. if (widget.accepts_focus())
  458. collected_widgets.append(&widget);
  459. widget.for_each_child_widget([&](auto& child) {
  460. if (!child.is_visible())
  461. return IterationDecision::Continue;
  462. if (!child.is_enabled())
  463. return IterationDecision::Continue;
  464. collect_focusable_widgets(child);
  465. return IterationDecision::Continue;
  466. });
  467. };
  468. collect_focusable_widgets(const_cast<GWidget&>(*m_main_widget));
  469. return collected_widgets;
  470. }
  471. void GWindow::save_to(AK::JsonObject& json)
  472. {
  473. json.set("title", title());
  474. json.set("visible", is_visible());
  475. json.set("active", is_active());
  476. json.set("resizable", is_resizable());
  477. json.set("fullscreen", is_fullscreen());
  478. json.set("rect", rect().to_string());
  479. json.set("base_size", base_size().to_string());
  480. json.set("size_increment", size_increment().to_string());
  481. CObject::save_to(json);
  482. }
  483. void GWindow::set_fullscreen(bool fullscreen)
  484. {
  485. if (m_fullscreen == fullscreen)
  486. return;
  487. m_fullscreen = fullscreen;
  488. if (!m_window_id)
  489. return;
  490. GWindowServerConnection::the().send_sync<WindowServer::SetFullscreen>(m_window_id, fullscreen);
  491. }
  492. void GWindow::schedule_relayout()
  493. {
  494. if (m_layout_pending)
  495. return;
  496. m_layout_pending = true;
  497. deferred_invoke([this](auto&) {
  498. if (main_widget())
  499. main_widget()->do_layout();
  500. update();
  501. m_layout_pending = false;
  502. });
  503. }
  504. void GWindow::update_all_windows(Badge<GWindowServerConnection>)
  505. {
  506. for (auto* window : *all_windows) {
  507. window->update();
  508. }
  509. }
  510. void GWindow::notify_state_changed(Badge<GWindowServerConnection>, bool minimized, bool occluded)
  511. {
  512. m_visible_for_timer_purposes = !minimized && !occluded;
  513. // When double buffering is enabled, minimization/occlusion means we can mark the front bitmap volatile (in addition to the back bitmap.)
  514. // When double buffering is disabled, there is only the back bitmap (which we can now mark volatile!)
  515. RefPtr<GraphicsBitmap>& bitmap = m_double_buffering_enabled ? m_front_bitmap : m_back_bitmap;
  516. if (!bitmap)
  517. return;
  518. if (minimized || occluded) {
  519. bitmap->shared_buffer()->set_volatile();
  520. } else {
  521. if (!bitmap->shared_buffer()->set_nonvolatile()) {
  522. bitmap = nullptr;
  523. update();
  524. }
  525. }
  526. }