61 property_layout(
const std::string&
name,
const std::function<
void()>& callback,
bool columns =
true);
73 void set_data(
const entt::meta_data& prop,
bool columns =
true);
87 void push_layout(
bool auto_proceed_to_next_column =
true);
118 std::string tooltip_;
120 std::function<void()> callback_;
126 bool columns_open_{};
176 result.edit_finished |= rhs.edit_finished;
177 result.change_recorded |= rhs.change_recorded;
209 std::function<bool(entt::meta_any&)>
getter;
221 std::shared_ptr<meta_any_proxy_impl>
impl = std::make_shared<meta_any_proxy_impl>();
229auto make_proxy(entt::meta_any& var,
const std::string&
name = {}) -> meta_any_proxy;
231auto make_property_proxy(
const meta_any_proxy& var_proxy,
const entt::meta_data& prop) -> meta_any_proxy;
250 std::unordered_map<entt::id_type, std::shared_ptr<inspector>>& type_map)
252 type_map[inspected_type.info().index()] = std::make_shared<T>();
302 entt::meta_factory<inspector>{}.type(
"inspector"_hs);
310#define REFLECT_INSPECTOR_INLINE(inspector_type, inspected_type) \
311 REFLECT_INLINE(inspector_type) \
313 entt::meta_factory<inspector_type>{} \
314 .type(entt::hashed_string{#inspector_type}) \
315 .custom<entt::attributes>( \
316 entt::attributes{entt::attribute{"inspected_type", entt::resolve<inspected_type>()}}) \
318 .func<&inspector::create_and_register<inspector_type>>("create_and_register"_hs); \
326#define REFLECT_INSPECTOR(inspector_type, inspected_type) \
327 REFLECT(inspector_type) \
329 entt::meta_factory<inspector_type>{} \
330 .type(entt::hashed_string{#inspector_type}) \
331 .custom<entt::attributes>( \
332 entt::attributes{entt::attribute{"inspected_type", entt::resolve<inspected_type>()}}) \
334 .func<&inspector::create_and_register<inspector_type>>("create_and_register"_hs); \
Manages ImGui layout for property inspection in the editor.
auto operator=(const property_layout &) -> property_layout &=delete
void set_data(const entt::meta_data &prop, bool columns=true)
Updates layout data from meta property.
property_layout()
Default constructor that registers this layout in the global stack.
void push_layout(bool auto_proceed_to_next_column=true)
Initializes ImGui layout with tables and property label.
static auto get_current() -> property_layout *
Gets the currently active property layout from the global stack.
auto operator=(property_layout &&) -> property_layout &=delete
void pop_layout()
Cleans up ImGui state (IDs, tables, tree nodes)
void prepare_for_item()
Prepares ImGui for rendering the property value widget.
auto push_tree_layout(ImGuiTreeNodeFlags flags=0) -> bool
Creates a collapsible tree node layout for nested properties.
property_layout(property_layout &&)=delete
Disable move operations to prevent stack corruption.
property_layout(const property_layout &)=delete
Disable copy operations due to RAII nature and global stack management.
~property_layout()
Destructor that cleans up ImGui state and removes from stack.
Provides utilities for inspecting and converting sequence-related types to strings.
auto make_property_proxy(const meta_any_proxy &var_proxy, const entt::meta_data &prop) -> meta_any_proxy
auto make_proxy(entt::meta_any &var, const std::string &name) -> meta_any_proxy
Creates a simple proxy for direct variable access.
#define REFLECT_INLINE(cls)
Result of an inspection operation indicating what changes occurred.
bool change_recorded
Whether the change was recorded for undo/redo system.
auto operator|(const inspect_result &rhs) const -> inspect_result
Creates new result by combining two results with logical OR.
bool changed
Whether the value was modified during inspection.
auto operator|=(const inspect_result &rhs) -> inspect_result &
Combines this result with another using logical OR.
bool edit_finished
Whether user finished editing (e.g., released mouse or pressed enter)
std::unique_ptr< property_layout > layout_
Layout manager for this inspector's UI.
virtual void before_inspect(const entt::meta_data &prop)
Called before inspecting a property to set up layout.
bool open_
Whether this inspector's UI section is expanded.
static void create_and_register(const entt::meta_type &inspected_type, std::unordered_map< entt::id_type, std::shared_ptr< inspector > > &type_map)
Factory method to create and register inspector instances.
virtual void after_inspect(const entt::meta_data &prop)
Called after inspecting a property to clean up layout.
virtual ~inspector()=default
Virtual destructor for proper cleanup.
virtual auto inspect(rtti::context &ctx, entt::meta_any &var, const meta_any_proxy &var_proxy, const var_info &info, const entt::meta_custom &custom) -> inspect_result=0
Pure virtual method to render and handle interaction for a variable.
std::function< entt::meta_any(const char *)> attribute_getter
Function type for retrieving meta attributes by name.
Metadata about a variable being inspected.
bool is_property
Whether this is a property that can be overridden in prefabs.
bool read_only
Whether the variable should be displayed as read-only.