yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
panel_admission.h File Reference

Admission rules for registered workspace windows. More...

#include <cstddef>
#include <string>
#include <vector>
Include dependency graph for panel_admission.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  yaze::editor::PanelAdmissionEntry
 
struct  yaze::editor::PanelAdmissionFinding
 One audit failure. fix tells the panel author what to change. More...
 

Namespaces

namespace  yaze
 
namespace  yaze::editor
 Editors are the view controllers for the application.
 

Functions

const std::vector< PanelAdmissionEntry > & yaze::editor::FirstClassPanelAllowlist ()
 
const PanelAdmissionEntry * yaze::editor::FindFirstClassPanelEntry (const std::string &window_id)
 Returns the allowlist entry for a base window id, or nullptr.
 
const std::vector< PanelAdmissionEntry > & yaze::editor::DeferredPolicyDeclarations ()
 
bool yaze::editor::IsPolicyDeclarationDeferred (const std::string &window_id)
 
std::vector< std::string > yaze::editor::CollectDefaultVisibleWindowIds (const WorkspaceWindowManager &window_manager, size_t session_id)
 
std::vector< PanelAdmissionFinding > yaze::editor::AuditPanelAdmission (const WorkspaceWindowManager &window_manager, size_t session_id)
 Audits every window registered for session_id. Empty means admitted.
 
std::string yaze::editor::FormatPanelAdmissionFindings (const std::vector< PanelAdmissionFinding > &findings)
 Joins findings into one message for test output.
 

Detailed Description

Admission rules for registered workspace windows.

Registering a WindowContent does not make it a first-class window. Every registered window must declare a WindowPresentationPolicy (see editor_panel.h) so the workspace knows where users meet it:

  • A window may be kCoreWorkspace, or visible by default, only when its id is in FirstClassPanelAllowlist() below, with a reason a reviewer accepted.
  • kEmbeddedTool and kDiagnostic windows must name their host surface with WindowPresentationPolicy::WithHost().
  • A window that declares nothing is reported, even though it still behaves as a listed optional pop-out until it chooses.

AuditPanelAdmission() applies these rules to the windows registered in one session. test/unit/editor/panel_admission_test.cc runs it against a booted EditorManager, and scripts/audit_panel_policies.py checks the source tree for panel classes that never declare a policy.

Definition in file panel_admission.h.