1 #include "lxgui/gui_frame_container.hpp"
3 #include "lxgui/gui_factory.hpp"
4 #include "lxgui/gui_frame.hpp"
5 #include "lxgui/gui_frame_renderer.hpp"
6 #include "lxgui/gui_manager.hpp"
7 #include "lxgui/gui_out.hpp"
8 #include "lxgui/gui_registry.hpp"
9 #include "lxgui/utils_std.hpp"
15 factory_(fac), registry_(reg), renderer_(rdr) {}
28 utils::observer_ptr<frame> added_frame = obj;
29 root_frames_.push_back(std::move(obj));
34 frame* frame_raw = obj.get();
39 root_frames_, [&](
const auto& root_frame) {
return root_frame.get() == frame_raw; });
41 if (iter == root_frames_.end())
45 return std::move(*iter);
57 auto iter_remove = std::remove_if(
58 root_frames_.begin(), root_frames_.end(), [](
auto& obj) { return obj == nullptr; });
60 root_frames_.erase(iter_remove, root_frames_.end());
Handles the creation of new UI objects.
utils::owner_ptr< frame > create_frame(registry ®, const frame_core_attributes &attr)
Creates a new frame.
virtual utils::observer_ptr< frame > create_root_frame_(frame_core_attributes attr)
void garbage_collect()
Clean deleted entries from the frame list.
utils::owner_ptr< frame > remove_root_frame(const utils::observer_ptr< frame > &obj)
Remove a frame from the list of frames owned by this frame_container.
frame_container(factory &fac, registry ®, utils::observer_ptr< frame_renderer > rdr)
Constructor.
utils::view::adaptor< const root_frame_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter > const_root_frame_list_view
utils::view::adaptor< root_frame_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter > root_frame_list_view
root_frame_list_view get_root_frames()
Returns the root frame list.
utils::observer_ptr< frame > add_root_frame(utils::owner_ptr< frame > obj)
Make a frame owned by this frame_container.
A region that can contain other regions and react to events.
Keeps track of created UI objects and records their names for lookup.
Allow iterating over a container without access to the container itself.
auto find_if(C &v, T &&f)
oup::observable_sealed_ptr< T > owner_ptr
Struct holding all the core information about a frame necessary for its creation.
utils::observer_ptr< frame_renderer > rdr