Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::InspectorWindow Class Reference

Floating inspector window that displays the view hierarchy and properties of a target view tree in a separate OS window. More...

#include <inspector_window.hpp>

Public Types

using HostFactory

Public Member Functions

 InspectorWindow (View &target_root, WindowManager *mgr=nullptr, WindowHost *parent=nullptr, HostFactory host_factory={})
 Construct an inspector targeting the given root view.
 ~InspectorWindow ()
 InspectorWindow (const InspectorWindow &)=delete
InspectorWindow & operator= (const InspectorWindow &)=delete
void show ()
 Show the inspector window.
void hide ()
 Hide the inspector window.
void toggle ()
 Toggle visibility.
bool is_visible () const
 Whether the inspector window is currently visible.
void refresh ()
 Refresh the tree and properties from the target root.
void select_view (View *view)
 Select a specific view and update the property list.
void register_command_handler (CommandRegistry &registry)
 Register the toggle command (kToggleCommand, default chord Cmd+I / Ctrl+I) with a caller-owned CommandRegistry.
void install_keyboard_shortcut ()
 Install Cmd+I / Ctrl+I keyboard shortcut on the target root's on_global_key.

Static Public Attributes

static constexpr CommandID kToggleCommand = 0x504C5049
 Command id for the "Toggle Layout Inspector" action registered by register_command_handler().

Detailed Description

Floating inspector window that displays the view hierarchy and properties of a target view tree in a separate OS window.

Privately implements CommandHandler so the inspector can register its toggle command with a shell-owned CommandRegistry (see register_command_handler) without exposing the handler interface as public API.

Member Typedef Documentation

◆ HostFactory

Initial value:
std::function<std::unique_ptr<WindowHost>(
View& root, const WindowOptions& options)>
Definition view.hpp:73
Definition window_host.hpp:29

Constructor & Destructor Documentation

◆ InspectorWindow() [1/2]

pulp::view::InspectorWindow::InspectorWindow ( View & target_root,
WindowManager * mgr = nullptr,
WindowHost * parent = nullptr,
HostFactory host_factory = {} )

Construct an inspector targeting the given root view.

Parameters
target_rootThe root of the view tree to inspect.
mgrOptional WindowManager for registration.
parentOptional parent WindowHost (positions relative to it).
host_factoryOptional host creation override for tests or embedders that route inspector windows through a custom host.

◆ ~InspectorWindow()

pulp::view::InspectorWindow::~InspectorWindow ( )

◆ InspectorWindow() [2/2]

pulp::view::InspectorWindow::InspectorWindow ( const InspectorWindow & )
delete

Member Function Documentation

◆ hide()

void pulp::view::InspectorWindow::hide ( )

Hide the inspector window.

◆ install_keyboard_shortcut()

void pulp::view::InspectorWindow::install_keyboard_shortcut ( )

Install Cmd+I / Ctrl+I keyboard shortcut on the target root's on_global_key.

DEPRECATED — direct assignment owns the entire global-key hook, so a second tool installing its shortcut silently disables this one. New shells should own a CommandRegistry, call route_global_keys() once, and use register_command_handler() instead. Kept for backward compatibility with single-tool callers.

◆ is_visible()

bool pulp::view::InspectorWindow::is_visible ( ) const

Whether the inspector window is currently visible.

◆ operator=()

InspectorWindow & pulp::view::InspectorWindow::operator= ( const InspectorWindow & )
delete

◆ refresh()

void pulp::view::InspectorWindow::refresh ( )

Refresh the tree and properties from the target root.

◆ register_command_handler()

void pulp::view::InspectorWindow::register_command_handler ( CommandRegistry & registry)

Register the toggle command (kToggleCommand, default chord Cmd+I / Ctrl+I) with a caller-owned CommandRegistry.

Preferred over install_keyboard_shortcut(): the registry path composes with other tools instead of clobbering View::on_global_key. RAII: the handler is removed automatically in the destructor, so dispatch after this window is destroyed simply finds no handler. The registry must outlive this window (the destructor calls back into it). Re-registering moves the handler to the new registry. Does NOT touch target_root_.on_global_key; route the root key path once per shell with route_global_keys(root, registry).

◆ select_view()

void pulp::view::InspectorWindow::select_view ( View * view)

Select a specific view and update the property list.

◆ show()

void pulp::view::InspectorWindow::show ( )

Show the inspector window.

◆ toggle()

void pulp::view::InspectorWindow::toggle ( )

Toggle visibility.

Member Data Documentation

◆ kToggleCommand

CommandID pulp::view::InspectorWindow::kToggleCommand = 0x504C5049
staticconstexpr

Command id for the "Toggle Layout Inspector" action registered by register_command_handler().

Stable so apps can reference it from menus or a KeyMappingEditor. ASCII 'PLPI'.


The documentation for this class was generated from the following file: