Generated reference › API — ICoreBlocks/ICoreStudio/StudioObjects/PrimaryWindow
kind: generated#api#icoreblocks-icorestudio-studioobjects-primarywindow

API — ICoreBlocks/ICoreStudio/StudioObjects/PrimaryWindow

The public contract of 2 header(s) under src/ICoreBlocks/ICoreStudio/StudioObjects/PrimaryWindow — 2 class/struct definition(s), 36 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.

ICorePrimaryWindow.h#

src/ICoreBlocks/ICoreStudio/StudioObjects/PrimaryWindow/ICorePrimaryWindow.h

ICorePrimaryWindow#

ICorePrimaryWindow.h:29 · class · bases public ICoreWindow · pImpl · 5 declaration(s)

ICorePrimaryWindow The window the app starts in: the menu strip, and one editor beneath it.

class ICorePrimaryWindow : public ICoreWindow {
public:
    // QWidget* rather than QMainWindow*, matching the base and QMainWindow itself.
    explicit ICorePrimaryWindow(ICoreWidget* parent = nullptr);

    // The window's title carries the active project's name, so a project switch
    // is visible in the window strip and two studios are tellable apart.
    // Public because startup can open a project (Settings -> Project) after the
    // window has already been built with the previous project's name on it.
    void updateWindowTitleFromActiveProject();

    // Raises the sign-in wall over this window and returns when it closes.
    //
    // ⚠ THIS IS HOW STARTUP RAISES IT TOO, SINCE 2026-08-24 (owner). The wall
    // used to be shown from Initialization::resolveLicense(), BEFORE any window
    // existed; the instruction is that the primary window always opens and the
    // wall arrives on top of it. Routing the startup wall through the window's
    // own path rather than a second `ICoreSignInDialog` at the shell is what
    // keeps `ICoreLicenseBanner` honest: the banner is built while the session
    // is still Unlicensed, so somebody has to refresh it when the sign-in
    // succeeds, and this is the one place that does.
    //
    // ⚠ ONE WALL AT A TIME. A sign-out re-raises this too, so the guard behind
    // it is what stops a startup wall and a sign-out wall stacking.
    // Cancelling never quits: the session continues Unlicensed.
    void raiseSignInWall();

    ~ICorePrimaryWindow() override;

protected:
    // Closing this window ends the session, so there is nothing to veto: the
    // geometry is stored and the software is wound down, and the base accepts
    // the close. Anything that wants a refusable close has to change here first
    // -- see the note on Application::Impl::noteWindowClosed.
    bool closing() override;

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};

ICorePrimaryWindowBackend.h#

src/ICoreBlocks/ICoreStudio/StudioObjects/PrimaryWindow/ICorePrimaryWindowBackend.h

ICorePrimaryWindowBackend#

ICorePrimaryWindowBackend.h:34 · class · 31 declaration(s)

ICorePrimaryWindowBackend The primary window without the widgets: what its menu rows act on, what they do, and the window state that is remembered between sessions.

class ICorePrimaryWindowBackend {
public:
    // ====================[The window itself]======================

    // The title the window wears for the project that is open: "<project> — <app>",
    // or the app's name alone when there is no project.
    static ICoreString getWindowTitleForActiveProject();

    // The geometry the window opens at. The shipped size and position are applied
    // first, so they are what it falls back to when nothing has been stored yet or
    // the stored blob is unreadable (a screen that no longer exists, a toolkit
    // version that changed the format).
    static void applyStartupWindowGeometry(ICoreWindow* window);

    // Stored unconditionally, even with the preference off: turning "restore
    // window geometry" back on should bring back the last window the user
    // actually had, not whatever was current when they last had it enabled.
    static void storeWindowGeometry(const ICoreWindow* window);

    // Whether a menu's keyboard shortcut may act on what is in front of the user
    // right now. The keys are registered application-wide, because an editor torn
    // off into its own window is a window of its own and would otherwise never
    // hear them -- but that also puts them within earshot of windows that are not
    // editing anything. The project browser, a script runner or a chart window is
    // only borrowing the keyboard, and a Delete pressed there must not reach the
    // canvas behind it. So the key acts in the window that carries the menu strip,
    // and in whichever window holds the editor that currently has the focus.
    static bool activeWindowCarriesTheseShortcuts(const ICoreWindow* menuWindow);

    // ====================[What a menu row acts on]======================
    // Resolved at click time, never held: the focused editor window if there is
    // one, and the caller's fallback otherwise. Each step can come up empty, and
    // the row that asked simply does nothing. The left panel is the one
    // exception: only the primary window has a rail, so when the focused editor
    // has none it is the primary's, and that window is raised to show it.
    static ICoreStudioSurface* menuTargetEditorWindow(ICoreStudioSurface* fallbackWindow);
    static ICoreLeftFixedPanel* menuTargetLeftPanel(ICoreStudioSurface* fallbackWindow);
    static ICoreCanvasParent* menuTargetCanvasParent(ICoreStudioSurface* fallbackWindow);
    static ICoreCanvas* menuTargetCanvas(ICoreStudioSurface* fallbackWindow);
    static ICoreSubsystemTreeNode* menuTargetTreeNode(ICoreStudioSurface* fallbackWindow);

    // ====================[File]======================
    static void createSubsystemInFocusedTreeNode(ICoreStudioSurface* fallbackWindow);

    // ====================[Edit]======================
    // Into the middle of what the canvas is actually showing, which is where a
    // paste with no pointer position behind it belongs.
    static void pasteIntoVisibleCenter(ICoreStudioSurface* fallbackWindow);

    static void selectAllOnFocusedCanvas(ICoreStudioSurface* fallbackWindow);
    static void setSelectionCommentedOut(ICoreStudioSurface* fallbackWindow, bool commentedOut);
    static void toggleSelectionCommentedOut(ICoreStudioSurface* fallbackWindow);
    // To the trash -- or, on the Trash's own canvas, gone for good, as the canvas's
    // right-click Delete does there.
    static void deleteSelection(ICoreStudioSurface* fallbackWindow);
    static void rotateSelection(ICoreStudioSurface* fallbackWindow, double degrees);
    static void renameSelectedBlock(ICoreStudioSurface* fallbackWindow);
    // Edit > Find: the title bar's search field of the window the menu acts on,
    // or of the fallback window when that one has no title bar of its own.
    static void focusSearch(ICoreStudioSurface* fallbackWindow);
    static void reduceSeriesSelection(ICoreStudioSurface* fallbackWindow);
    static void reduceParallelSelection(ICoreStudioSurface* fallbackWindow);
    static void reduceFeedbackSelection(ICoreStudioSurface* fallbackWindow);
    // Auto reduction over the target canvas's level (its selection, when two or more
    // blocks are selected): one reduction, or until none is left. ICoreAutoReduction.
    static void autoReduceOneStep(ICoreStudioSurface* fallbackWindow);
    static void autoReduceFully(ICoreStudioSurface* fallbackWindow);
    static void autoArrangeFocusedTreeNode(ICoreStudioSurface* fallbackWindow);

    // ====================[File]======================
    // The diagram the focused canvas shows, through the print dialog -- what the
    // canvas tool bar's Print Diagram button does.
    static void printFocusedCanvas(ICoreStudioSurface* fallbackWindow, ICoreNativeWidget* dialogParent);

    // ====================[View]======================
    static void applyZoomLevel(ICoreStudioSurface* fallbackWindow, double zoomLevel);
    static void applyZoomFactor(ICoreStudioSurface* fallbackWindow, double factor);
    static void resetPanAndZoom(ICoreStudioSurface* fallbackWindow);

    // Scoped to the selection, unlike the top panel's block-names switch, which
    // overrides every block on the canvas. These write each selected block's own
    // property, so a global override still outranks whatever is set here.
    static void setSelectionNameLabelsVisible(ICoreStudioSurface* fallbackWindow, bool visible);
    static void toggleSelectionNameLabels(ICoreStudioSurface* fallbackWindow);

    // ====================[Run]======================
    // Reports the failure itself, because the row that asked has nowhere to put it.
    static void buildProject();

};
};