API — ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow
The public contract of 9 header(s) under src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow — 11 class/struct definition(s), 174 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.
| Header | Defines | Declarations | Bases |
|---|---|---|---|
ICoreCommandBar.h | ICoreCommandBar, ICoreCommandTextBox | 29 | public ICoreWidget; public ICoreLineEdit |
ICoreCommandHistoryStore.h | ICoreCommandHistoryStoreNotifier, ICoreCommandHistoryStore | 7 | — |
ICoreCommandScriptWindow.h | ICoreCommandScriptWindow | 66 | public ICoreWidget |
ICoreCommandWindow.h | ICoreCommandWindow | 6 | public ICoreWidget |
ICoreScriptDockHost.h | ICoreScriptDockHost | 22 | public ICoreWidget |
ICoreScriptEditorWindow.h | ICoreScriptEditorWindow | 15 | public ICoreWidget |
ICoreScriptOutputModel.h | ICoreScriptOutputModel | 13 | — |
ICoreScriptPanelTitle.h | ICoreScriptPanelTitle | 12 | public ICoreWidget |
ICoreScriptPanelWindow.h | ICoreScriptPanelWindow | 4 | public ICoreWidget |
ICoreCommandBar.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreCommandBar.h
Run whatever is in the input now: record it for recall, raise onCommandEntered, clear the field. What Enter on a finished line does, and what Enter on a chosen SUGGESTION also does -- see the key interceptor in the .cpp for why this prompt collapses the two.
ICoreCommandBar#
ICoreCommandBar.h:18 · class · bases public ICoreWidget · pImpl · 24 declaration(s)
class ICoreCommandBar : public ICoreWidget {
public:
explicit ICoreCommandBar(ICoreWidget* parent = nullptr);
double bgOpacity() const;
void setBgOpacity(double opacity);
void animateBackgroundOpacity(double targetOpacity);
// Run whatever is in the input now: record it for recall, raise
// onCommandEntered, clear the field. What Enter on a finished line does,
// and what Enter on a chosen SUGGESTION also does -- see the key
// interceptor in the .cpp for why this prompt collapses the two.
void submitCurrentLine();
void cancelCommand();
void showClearButton() const;
void focusInput() const; // put the keyboard caret back in the input line
// Supplies the candidate names for Tab completion and the live suggestion
// popup (e.g. command + function names). Keeps the bar decoupled from any
// specific command system.
using CompletionSource = std::function<ICoreStringList()>;
void setCompletionSource(CompletionSource source);
// True while the live suggestion popup is showing — the input box defers
// Up/Down to the popup instead of walking history.
bool isCompleterPopupVisible() const;
// True once the user has arrowed onto one of the popup's entries. From that
// moment Enter/Tab belong to the suggestion, not to the half-typed line
// underneath it.
bool hasHighlightedCompletion() const;
// Put the arrowed-onto suggestion into the line (replacing just the name
// being typed) and close the popup. Returns false — leaving the line
// untouched — when no entry was picked, so the caller can carry on with
// whatever the key normally does.
bool acceptHighlightedCompletion();
void hideCompleterPopup();
// Offer a key to the suggestion popup — Up/Down walk it, Escape closes it.
// Answers true when the popup consumed it.
//
// ⚠ THE FIELD'S INTERCEPTOR HAS TO DO THIS BY HAND, because it is the one
// installed LAST and an ICoreLineEdit publishes one interceptor slot rather
// than a chain. See ICoreCommandTextBox::installKeyPolicy().
bool offerKeyToCompleter(const ICoreKeyEvent& key);
// Whether the caret is in this bar's input. Driven by the input itself
// (ICoreCommandTextBox's focus hooks) rather than polled, because the bar
// paints its own rim and has to repaint on the edge.
void setInputFocused(bool focused);
[[nodiscard]] bool isInputFocused() const;
// Re-evaluate the suggestion list against the text/caret currently in the
// input. Called on every edit; also after a Tab fills part of a name in.
void refreshCompletions();
// Tab completion against the completion source: takes the highlighted
// suggestion if there is one, otherwise fills the name being typed in as far
// as the candidates unambiguously agree.
void tabComplete();
// Records a submitted line and resets the recall cursor to the newest entry.
void pushHistory(const ICoreString& commandLine);
// Up/Down recall. `currentDraft` is the in-progress text, stashed on the
// first Up so Down past the newest entry can restore it.
ICoreString historyPrevious(const ICoreString& currentDraft);
ICoreString historyNext();
~ICoreCommandBar() override;
// Raised when the user presses Enter on a non-empty line. The input is
// cleared right after, so the console owns the submitted text from here on.
ICoreSignal<ICoreString> onCommandEntered;
// Ctrl+C (or Escape) with nothing selected — the prompt's "stop what you
// are in the middle of" (the core-MATLAB row C2.12). The bar does not
// know what that means, so it only reports the key; the command window
// decides, and abandons the open block if there is one.
//
// Ctrl+C is COPY when a selection exists, and the interceptor checks that
// before claiming the key: a shortcut that eats copy would be a worse
// trade than not having the shortcut. Escape has no other meaning in this
// field, so it always means this.
ICoreSignal<> onInterruptRequested;
protected:
void paintContent(ICorePainter& painter) override;
void pointerEntered() override;
void pointerLeft() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreCommandTextBox#
ICoreCommandBar.h:120 · class · bases public ICoreLineEdit · pImpl · 5 declaration(s)
class ICoreCommandTextBox : public ICoreLineEdit {
public:
// The body moved to the .cpp with the state it sets up: it was the largest
// in-header body in this module (the header surface rule).
explicit ICoreCommandTextBox(ICoreCommandBar* parent);
// Declared, defined in the .cpp: the residue below is a unique_ptr to an
// Impl this header cannot see.
~ICoreCommandTextBox() override;
// ⚠⚠ RE-RUN AFTER THE COMPLETER IS BUILT, AND THAT IS NOT A REFRESH — IT IS
// THE ONLY THING THAT KEEPS THIS FIELD'S KEYS. `ICoreCompleter`'s
// constructor installs an interceptor of its own on an `ICoreLineEdit`
// host, and the wrapper publishes ONE interceptor slot rather than a chain,
// so whoever installs last owns every key. This field installs its policy
// in its constructor and the completer is built afterwards
// (`setCompletionSource`), so the completer silently took Tab, Enter,
// Escape, Ctrl+C and the Up/Down history recall — all of it, from the
// moment Quick Code gained suggestions.
//
// The completer's own header states the rule and the direction that works:
// *"A caller that installs its own AFTER building a completer takes the
// keys back, which is the right way round."* This is that call.
void installKeyPolicy();
protected:
// The bar around this field draws the rim, so the field is what tells it
// when the caret arrives and leaves. Both call the base first -- the base
// is what repaints the field's own chrome.
void focusGained(const ICoreFocusEvent& event) override;
void focusLost(const ICoreFocusEvent& event) override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreCommandHistoryStore.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreCommandHistoryStore.h
ICoreCommandHistoryStore
Persistence for the command console's Up/Down recall list, so the arrow keys reach lines typed in EARLIER runs of the application and not just this one. Lines are kept, one per line and oldest first, in a flat text file inside the stable application home folder (ICoreDocumentsFolder:: getApplicationHomeFolderPath), the same place and the same shape ICoreRecentProjects uses.
Why APPEND and not rewrite
The application home folder is shared by every instance of the app running as this user -- it is deliberately not sandboxed. A submit therefore appends its one line rather than writing the whole list back: two instances open at
ICoreCommandHistoryStoreNotifier#
ICoreCommandHistoryStore.h:33 · class · final · 0 declaration(s)
ICoreCommandHistoryStore is an all-static facade with no instance to hang a signal on, so the one signal it raises lives on a small notifier beside it -- the shape ICoreUserPreferences uses for the...
class ICoreCommandHistoryStoreNotifier final {
public:
// Raised by clear(). A live recall list must drop its IN-MEMORY copy when
// the file goes: clearing only the file would leave Up still walking this
// session's lines and the next submit writing them straight back.
ICoreSignal<> onHistoryCleared;
};
};
ICoreCommandHistoryStore#
ICoreCommandHistoryStore.h:43 · class · 7 declaration(s)
class ICoreCommandHistoryStore {
public:
// The change-signal source -- see ICoreCommandHistoryStoreNotifier.
static ICoreCommandHistoryStoreNotifier& notifier();
// Binds the console verb that clears the history (clearCommandHistory).
// Called once from Initialization, beside the other registerAll()s.
static void registerConsoleCommands();
// Oldest -> newest, already capped at maxEntries(), trimming the file if it
// had grown past it. Empty on first launch, which is not an error -- and
// empty at depth 0, where it deliberately leaves the file alone.
static std::vector<std::string> load();
// Records one submitted line. Blank lines and a line identical to the one
// already at the end of the file are dropped, so holding Enter on a command
// does not fill the file with it. Records nothing at all at depth 0.
static void append(const std::string& commandLine);
// Forgets every recorded line and raises notifier().onHistoryCleared, so a
// live recall list empties with the file. This is the console's "clear
// history", not its "clear the output pane" -- and it has no visible
// effect, which is why it reports HOW MANY lines it dropped rather than
// succeeding in silence the way cls() can afford to.
static size_t clear();
// Where the list is kept: <application home>/commandHistory.txt. Public for
// the same reason ICoreRecentProjects::recentProjectsFilePath() is -- the
// regression suite has to leave a non-sandboxed application home exactly as
// it found it, and needs to name the file without restating it.
static std::filesystem::path historyFilePath();
// How many lines survive a trim: ICoreUserPreferences::
// getCommandHistoryDepth(), which Settings -> Editor -> Command Console
// drives. ZERO means recall is off -- append() writes nothing and load()
// returns nothing, but neither erases the file that is already there.
static size_t maxEntries();
};
};
ICoreCommandScriptWindow.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreCommandScriptWindow.h
ICoreCommandScriptWindow#
ICoreCommandScriptWindow.h:43 · class · bases public ICoreWidget · pImpl · 66 declaration(s)
Standalone Script Runner window, opened from the block editor's left fixed panel.
class ICoreCommandScriptWindow : public ICoreWidget {
public:
explicit ICoreCommandScriptWindow(ICoreWidget* parent = nullptr);
~ICoreCommandScriptWindow() override;
// --- Driving the window without a pointer (S6.3) ---------
// What the toolbar and the explorer do, as calls: for a menu bar (S4.3)
// and for a suite that has to check the window's own behaviour rather
// than the interpreter's.
// Re-read the scripts folder and open `fileName` (with its extension).
// False when the folder has no such script.
bool openScript(const ICoreString& fileName);
[[nodiscard]] ICoreString currentScript() const;
// The editor, for the editing commands it carries (go to line, toggle
// comment, breakpoints...). Owned by the window.
[[nodiscard]] ICoreScriptCodeEditor* editor() const;
// Run and Run Line (F9, the selection when there is one), exactly as
// their buttons do.
void runScript();
void runCaretLine();
// What the status bar says about the last run, and every row the Problems
// pane lists, in its order (the last run's failure first).
[[nodiscard]] ICoreString lastRunStatus() const;
[[nodiscard]] std::vector<ICoreScriptDiagnostic> listedProblems() const;
// The status bar's problem count (S4.15): "No problems" or "✗ 2 ⚠ 1".
[[nodiscard]] ICoreString problemStatus() const;
// The signature help under the editor (S3.10), flat, with the argument
// the caret is in shown as [arg]; empty when none is shown.
[[nodiscard]] ICoreString signatureHelp() const;
// The action rows of one menu (S4.3) -- "File", "Edit", "View", "Run",
// "Debug" -- as "text" or "text\tshortcut".
[[nodiscard]] std::vector<ICoreString> menuRows(const ICoreString& menuTitle) const;
// The open scripts' tabs, in the order they are shown (S4.1), and closing
// one as its × does (saving it first when it is the current one). False
// when no tab has that script.
[[nodiscard]] std::vector<ICoreString> openTabs() const;
bool closeScript(const ICoreString& fileName);
// Explicit save (S3.1, D1): whether a tab has edits not on
// disk, File > Save All, and File > Autosave.
// Find / Replace (S3.3), as the bar does it: open it on a query with its
// three options, step, read its count ("2 of 5", "no matches"), replace.
void find(const ICoreString& query, bool matchCase = false, bool wholeWord = false, bool regex = false);
void findNext();
void findPrevious();
[[nodiscard]] ICoreString findStatus() const;
void replaceMatch(const ICoreString& with);
void replaceAllMatches(const ICoreString& with);
void closeFindBar();
// The explorer as a tree (S4.2): its rows as shown ("▼ tools", " fit.icore"),
// and renaming or deleting an entry as its menu does, without the dialog.
// A rename answers what went wrong, or empty.
[[nodiscard]] std::vector<ICoreString> explorerRows() const;
// A click on the navigator's row `row`, through the list's own click
// signal -- a folder row opens or shuts, and the rows are rebuilt under it.
void clickExplorerRow(int row);
ICoreString renameScriptEntry(const ICoreString& from, const ICoreString& to);
void deleteScriptFolder(const ICoreString& folder);
[[nodiscard]] bool isModified(const ICoreString& fileName) const;
bool saveAll();
void setAutosave(bool on);
// --- The debugger, as calls (S5, S4.4, S4.17) -------------
// What the toolbar's Debug, Continue, Step Over / Into / Out, Stop and the
// Run menu's Run to Cursor do. A run stays on the GUI thread and yields
// (decision D2); a pause is a loop over the interpreter's event pump, so
// these are what a pause handler's slice -- a click, or a test -- calls.
void debugScript();
void runToCursor(int line);
void continueRun();
void stepOver();
void stepInto();
void stepOut();
void stopRun();
void setStopOnError(bool on);
// "idle", "running" or "paused"; and while paused, "file:line".
[[nodiscard]] ICoreString runState() const;
[[nodiscard]] ICoreString pausedAt() const;
// The Debug pane's rows: the paused call stack, innermost first, and the
// watches as "expression = value". selectFrame(row) picks the frame the
// Variables panel and the watches read.
[[nodiscard]] std::vector<ICoreString> callStackRows() const;
void addWatch(const ICoreString& expression);
[[nodiscard]] std::vector<ICoreString> watchRows() const;
void selectFrame(int row);
// --- Panels, secondary windows, the navigator (S7) -------------
// What View, the panel bar, a tab dragged off the strip and a double-click
// in the navigator do, as calls. Panel keys: "navigator", "output",
// "problems", "variables", "debug".
void setPanelVisible(const ICoreString& key, bool visible);
[[nodiscard]] bool isPanelVisible(const ICoreString& key) const;
// The panel bar at the window's right edge (S7.11): a press on a panel's
// button (false when it has none), whether that button is lit, and the
// panels it has buttons for, top to bottom.
bool clickPanelBarButton(const ICoreString& key);
[[nodiscard]] bool isPanelBarButtonOn(const ICoreString& key) const;
[[nodiscard]] std::vector<ICoreString> panelBarKeys() const;
// The room a panel's slot has in its split, across it: 0 while it is put
// away or floating, -1 for no such panel. "bottom" is the height of the
// area under the editor, 0 while all four of its panels are away (S7.14);
// "left" and "right" the widths of the areas beside it (S7.16).
[[nodiscard]] int panelExtent(const ICoreString& key) const;
// Docking beside the code (S7.16). Where a panel docks: "left", "right"
// or "bottom" ("" for the navigator or no such panel), and in which
// window: -1 the IDE, 0.. a secondary window (floatingScripts' order),
// -2 none. The panels docked at a side of a window, in order.
[[nodiscard]] ICoreString panelDockSide(const ICoreString& key) const;
[[nodiscard]] int panelDockWindow(const ICoreString& key) const;
[[nodiscard]] std::vector<ICoreString> panelsDockedAt(const ICoreString& side, int window = -1) const;
// A point on a window's code, at fractions of its width and height -- where
// a test lets a dragged title go.
[[nodiscard]] ICorePoint codeScreenPoint(double fx, double fy, int window = -1) const;
// A panel's title dragged over `screenPoint` (its onDragMoved), and
// whether a window shows where it would dock.
bool movePanelTitle(const ICoreString& key, const ICorePoint& screenPoint);
// The width of a panel's title -- the handle a drag takes hold of, which
// is the title bar's free room, not its name (S7.18). -1 for none.
[[nodiscard]] int panelTitleWidth(const ICoreString& key) const;
[[nodiscard]] bool isDropHintShown(int window = -1) const;
// The dividers around a window's code a pointer can take hold of: one
// between each two panes that show, none beside a panel put away (S7.21)
// -- and, for the IDE, the navigator's beside the work area (S7.22).
[[nodiscard]] int panelDividerCount(int window = -1) const;
// Tear the script's tab off into a window of its own (it must be open),
// and dock it back. False when there is no such tab.
bool floatScript(const ICoreString& fileName);
bool dockScript(const ICoreString& fileName);
// A tab torn off its strip and let go at `screenPoint`, reported through
// the strip's own onTabDetached -- the IDE's or its secondary window's.
// False when no tab holds the script.
bool dropTornOffTab(const ICoreString& fileName, const ICorePoint& screenPoint);
// Panels in windows of their own (S7.7): what the title's pop-out button
// does, and a title dragged off its row and let go at `screenPoint`
// (through the title's own onDragReleased). The navigator does not float.
bool floatPanel(const ICoreString& key);
bool dockPanel(const ICoreString& key);
[[nodiscard]] bool isPanelFloating(const ICoreString& key) const;
// Let go at a point over an editor window's code, near its left, right or
// bottom edge, it docks there (S7.16).
bool dropPanelTitle(const ICoreString& key, const ICorePoint& screenPoint);
// A point in this window, on the screen (where a drop "over the IDE" lands).
[[nodiscard]] ICorePoint screenPointAt(const ICorePoint& local) const;
// The scripts in secondary windows, one list per window.
[[nodiscard]] std::vector<std::vector<ICoreString>> floatingScripts() const;
// The text the script's editor holds, wherever that editor is.
[[nodiscard]] ICoreString scriptText(const ICoreString& fileName) const;
protected:
void shown() override; // refresh the explorer from disk on open
bool closing() override; // autosave the open script on close
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreCommandWindow.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreCommandWindow.h
ICoreCommandWindow#
ICoreCommandWindow.h:21 · class · bases public ICoreWidget · pImpl · nested LineResult · 6 declaration(s)
Self-use developer command console with a Python-REPL feel.
class ICoreCommandWindow : public ICoreWidget {
public:
explicit ICoreCommandWindow(ICoreWidget* parent = nullptr);
ICoreLoggerTextBox* getHistoryTextBox() const;
// Outcome of resolving a single console line (see evaluateLine).
struct LineResult {
bool ok = true; // false => the line failed (render/log as an error)
ICoreString output; // the text the prompt would have printed
};
// Resolve one console line through the exact grammar the interactive prompt
// uses. Since 2026-09-02 the grammar itself is
// ICoreConsoleInterpreter::evaluateLine (ICoreCoder, L6) — recipe statements,
// assignment, variable read, bare expression, then a registered command; ';'
// splits statements and silences the ones it terminates. This is a
// forwarder kept for the window's callers; new code calls the interpreter.
// The prompt itself feeds an ICoreConsoleInterpreter INSTANCE, so a block
// (`for … end`) typed over several lines is held until its `end`.
static LineResult evaluateLine(const ICoreString& line);
// True when every statement on `line` is ';'-terminated (nothing follows the
// last top-level ';'), so a successful run prints nothing whatsoever. Callers
// that echo the source line before running it — the Script Runner — use this
// to drop the echo too, otherwise the ';' would silence the output but leave
// a bare ">>> line" behind. Failures should still be echoed for context.
static bool isFullySuppressed(const ICoreString& line);
// Variable lookup for ICoreExpressionEvaluator: rebuilds the typed ICoreValue
// (matrix / polynomial / tf / state-space) from the global variables space.
// Exposed so other command-engine commands can evaluate matrix expressions
// the same way the console prompt does (e.g. plot's matrix argument).
static bool resolveGlobalVariable(const std::string& name, ICoreValue& out);
// A line that ran from OUTSIDE the window -- a coding agent, through the
// agent bridge (the agent-bridge board, AB.21) -- shown in every open Command
// Window, labelled with `who` instead of the prompt, with its output under it.
// So what an agent did to the model is on screen, not only in its own chat.
// Nothing is run here: the line has already run. Main thread only.
static void echoExternal(const ICoreString& who, const ICoreString& line,
const ICoreString& output, bool ok);
~ICoreCommandWindow() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreScriptDockHost.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreScriptDockHost.h
ICoreScriptDockHost#
ICoreScriptDockHost.h:37 · class · bases public ICoreWidget · pImpl · nested DropTarget · 22 declaration(s)
The code of an ICore Script IDE window with three dock areas around it: LEFT and RIGHT of it, full height, and UNDER it (S7.16).
class ICoreScriptDockHost : public ICoreWidget {
public:
// `center` is the code: tabs, editors and whatever sits with them.
explicit ICoreScriptDockHost(ICoreWidget* center, ICoreNativeWidget* parent = nullptr);
~ICoreScriptDockHost() override;
// ---- slots ----------------------------------------------------------------
// Into `side` at `index` (-1, or past the end, appends), CLOSED. A slot
// already here moves.
void insertSlot(ICoreWidget* slot, ICoreScriptDockSide side, int index);
// Out of this host, left alive and parentless for the next insertSlot.
void removeSlot(ICoreWidget* slot);
void setSlotOpen(ICoreWidget* slot, bool open);
[[nodiscard]] bool contains(const ICoreWidget* slot) const;
[[nodiscard]] bool isSlotOpen(const ICoreWidget* slot) const;
[[nodiscard]] ICoreScriptDockSide sideOf(const ICoreWidget* slot) const;
[[nodiscard]] int indexOf(const ICoreWidget* slot) const;
[[nodiscard]] std::vector<ICoreWidget*> slots(ICoreScriptDockSide side) const; // in order
// Its room across its area (a width in Bottom, a height at the sides): 0
// while closed, -1 when it is not here.
[[nodiscard]] int slotExtent(const ICoreWidget* slot) const;
// The area's width (Left, Right) or height (Bottom): 0 while it is away.
[[nodiscard]] int areaExtent(ICoreScriptDockSide side) const;
// The dividers a pointer can take hold of: one between each two panes
// that show -- none beside an area away or a slot closed (S7.21).
[[nodiscard]] int dividerCount() const;
// ---- the drag -------------------------------------------------------------
struct DropTarget {
bool valid = false;
ICoreScriptDockSide side = ICoreScriptDockSide::Bottom;
int index = -1; // where in the area's order
};
// A point over this host's window. Near the code's left, right or bottom
// edge, or over an area that shows, it docks there; anywhere else in the
// window, `valid` is false.
[[nodiscard]] DropTarget dropTargetAt(const ICorePoint& screenPoint) const;
[[nodiscard]] bool containsScreenPoint(const ICorePoint& screenPoint) const;
// Highlights where dropTargetAt(screenPoint) would dock, or nothing.
void showDropHint(const ICorePoint& screenPoint);
void hideDropHint();
[[nodiscard]] bool isDropHintShown() const;
// A point on the code, at fractions of its width and height.
[[nodiscard]] ICorePoint codeScreenPoint(double fx, double fy) const;
// ---- the session -----------------------------------------------------------
// What session.ini keeps: each area's slots' sizes in order, and the
// areas' own with the code's beside them -- left width, right width,
// bottom height, code width, code height -- read back as proportions, as
// a splitter's sizes are. A closed slot or an area away is written at the
// size it comes back at. A set that does not match (a count, a zero) is
// ignored.
[[nodiscard]] std::vector<int> slotSizes(ICoreScriptDockSide side) const;
void restoreSlotSizes(ICoreScriptDockSide side, const std::vector<int>& sizes);
[[nodiscard]] std::vector<int> areaSizes() const;
void restoreAreaSizes(const std::vector<int>& sizes);
// A drag took an open slot -- or its whole area -- down to nothing, and
// put it away as its × would: its panel is hidden. The slot is closed
// already (S7.21).
ICoreSignal<ICoreWidget*> onSlotDraggedShut;
// Any divider here was dragged: time to save the sizes.
ICoreSignal<> onLayoutDragged;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
File-scope declarations#
// Where a panel docks around the code (S7.16).
enum class ICoreScriptDockSide { Left, Right, Bottom };
ICoreScriptEditorWindow.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreScriptEditorWindow.h
ICoreScriptEditorWindow#
ICoreScriptEditorWindow.h:31 · class · bases public ICoreWidget · pImpl · 15 declaration(s)
A secondary editor window of the ICore Script IDE (S7.2): what a script tab becomes when it is dragged out of the IDE's tab strip.
class ICoreScriptEditorWindow : public ICoreWidget {
public:
explicit ICoreScriptEditorWindow(ICoreWidget* parent = nullptr);
~ICoreScriptEditorWindow() override;
// A tab for `file` with an editor of its own, made current, and that
// editor -- still empty; the owner fills it.
ICoreScriptCodeEditor* addScript(const ICoreString& file);
// Its tab goes; its editor is hidden and kept for the next addScript.
void removeScript(const ICoreString& file);
void showScript(const ICoreString& file);
void renameScript(const ICoreString& from, const ICoreString& to);
void setScriptDirty(const ICoreString& file, bool dirty);
[[nodiscard]] ICoreScriptCodeEditor* editorFor(const ICoreString& file) const;
[[nodiscard]] ICoreString currentScript() const;
[[nodiscard]] std::vector<ICoreString> scripts() const; // tab order
[[nodiscard]] bool isEmpty() const;
// Whether the strip's run controls are live (the IDE's run state).
void setRunEnabled(bool enabled);
// The line under the tabs: the caret, the last run, a notice.
void setStatusText(const ICoreString& text);
// The strip's rectangle in screen coordinates: a tab dropped inside it
// joins this window.
[[nodiscard]] bool tabStripContains(const ICorePoint& screenPoint) const;
// The dock areas around this window's tabs and editors (S7.16): the IDE
// docks its panels here as it does in its own window.
[[nodiscard]] ICoreScriptDockHost* dockHost() const;
// ---- what the user did (every one is the IDE's to act on) ------------------
ICoreSignal<const ICoreString&, ICorePoint> onTabDetached; // (file, screen drop point)
ICoreSignal<const ICoreString&> onCloseRequested; // a tab's ×
ICoreSignal<const ICoreString&> onCurrentChanged;
ICoreSignal<const ICoreString&> onRunRequested; // Run, on the current script
ICoreSignal<const ICoreString&> onDebugRequested;
ICoreSignal<const ICoreString&> onSaveRequested;
ICoreSignal<const ICoreString&> onDockRequested; // Dock, on the current script
ICoreSignal<> onWindowClosing; // dock every tab back
protected:
bool closing() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreScriptOutputModel.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreScriptOutputModel.h
ICoreScriptOutputModel#
ICoreScriptOutputModel.h:17 · class · pImpl · nested Line · 13 declaration(s)
What the Script Runner's output pane holds, as lines rather than as HTML (S4.7): each line's text, its ink, and where it came from -- the statement that printed it (ICoreConsoleInterpreter::OutputL...
class ICoreScriptOutputModel {
public:
enum class Ink { Normal, Echo, Error, Separator };
struct Line {
ICoreString text; // one line: never contains '\n'
Ink ink = Ink::Normal;
ICoreString file; // where it came from; empty when unknown
int line = 0; // 1-based; 0 when unknown
};
ICoreScriptOutputModel();
~ICoreScriptOutputModel();
ICoreScriptOutputModel(const ICoreScriptOutputModel&) = delete;
ICoreScriptOutputModel& operator=(const ICoreScriptOutputModel&) = delete;
// `text` split on '\n', every piece with the same ink and origin. Answers
// how many of the new lines are VISIBLE (the filter may hide them), so the
// pane can append exactly those.
int append(const ICoreString& text, Ink ink, const ICoreString& file = ICoreString(),
int line = 0);
int append(const Line& line);
void clear();
[[nodiscard]] int lineCount() const;
// Oldest lines are dropped past this many (default 5000), so a long session
// does not grow the pane without bound. Answers whether anything was dropped
// by the last append -- the pane must then re-render.
void setMaximumLines(int count);
[[nodiscard]] bool droppedOnLastAppend() const;
// Errors only: failures and the run banners, nothing a successful
// statement printed.
void setErrorsOnly(bool errorsOnly);
[[nodiscard]] bool errorsOnly() const;
[[nodiscard]] std::vector<Line> visibleLines() const;
[[nodiscard]] ICoreString visibleText() const; // '\n'-joined, for Copy
// Where visible line `index` points: its origin when it has one, else the
// first `name.icore:N` in its text. False when it points nowhere.
bool targetOf(int index, ICoreString& file, int& line) const;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreScriptPanelTitle.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreScriptPanelTitle.h
ICoreScriptPanelTitle#
ICoreScriptPanelTitle.h:24 · class · bases public ICoreWidget · pImpl · 12 declaration(s)
The title of an ICore Script IDE panel -- Output, Problems, Variables, the debugger's pane -- and the handle that docks it (S7.7).
class ICoreScriptPanelTitle : public ICoreWidget {
public:
explicit ICoreScriptPanelTitle(const ICoreString& text, ICoreNativeWidget* parent = nullptr);
~ICoreScriptPanelTitle() override;
void setText(const ICoreString& text);
[[nodiscard]] ICoreString text() const;
// How far past its own row (above or below it, or off either end) the
// pointer must be let go for a drag to count.
static constexpr int DRAG_DISTANCE = 28;
static constexpr int HEIGHT = 22;
ICoreSignal<ICorePoint> onDragMoved; // screen point, while dragged (S7.16)
ICoreSignal<> onDragEnded; // released or cancelled, before onDragReleased
ICoreSignal<ICorePoint> onDragReleased; // screen point of the release
ICoreSignal<> onDoubleClicked;
protected:
void paintContent(ICorePainter& painter) override;
[[nodiscard]] ICoreSizeF preferredSize() const override;
bool mousePressed(const ICoreMouseEvent& event) override;
bool mouseMoved(const ICoreMouseEvent& event) override;
bool mouseReleased(const ICoreMouseEvent& event) override;
bool mouseDoubleClicked(const ICoreMouseEvent& event) override;
void mouseGestureCancelled() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreScriptPanelWindow.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/CommandWindow/ICoreScriptPanelWindow.h
ICoreScriptPanelWindow#
ICoreScriptPanelWindow.h:14 · class · bases public ICoreWidget · pImpl · 4 declaration(s)
A window of its own for one ICore Script IDE panel (S7.7): where Output, Problems, Variables or the debugger's pane goes when it is dragged off the IDE.
class ICoreScriptPanelWindow : public ICoreWidget {
public:
explicit ICoreScriptPanelWindow(ICoreWidget* parent = nullptr);
~ICoreScriptPanelWindow() override;
// Moves `body` in: out of whatever layout held it, into this window.
void adopt(ICoreNativeWidget* body);
ICoreSignal<> onWindowClosing;
protected:
bool closing() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};