API — ICoreBlocks/ICoreStudio/StudioObjects/StudioSurface/CanvasArea
The public contract of 3 header(s) under src/ICoreBlocks/ICoreStudio/StudioObjects/StudioSurface/CanvasArea — 3 class/struct definition(s), 33 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 |
|---|---|---|---|
ICoreCanvasObjectCreationMode.h | ICoreCanvasObjectCreationMode | 5 | — |
ICoreCanvasParent.h | ICoreCanvasParent | 22 | public ICoreGraphicsView |
ICoreNewTabPanel.h | ICoreNewTabPanel | 6 | public ICoreWidget |
ICoreCanvasObjectCreationMode.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/StudioSurface/CanvasArea/ICoreCanvasObjectCreationMode.h
ICoreCanvasObjectCreationMode#
ICoreCanvasObjectCreationMode.h:10 · class · 5 declaration(s)
Global "create by dragging" mode.
class ICoreCanvasObjectCreationMode {
public:
enum class ObjectKind {
None,
Subsystem,
Area,
TextBox,
Image
};
static void arm(ObjectKind kind);
static void disarm();
static bool isArmed();
static ObjectKind getArmedKind();
// Creates the armed object on the given canvas, positioned at areaOnCanvas'
// top-left and resized to its size, then disarms the mode. Rects smaller than
// minDragSize (a click rather than a drag) keep the object's default size.
static void createArmedObject(ICoreCanvas* canvas, const ICoreRect& areaOnCanvas);
};
};
ICoreCanvasParent.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/StudioSurface/CanvasArea/CanvasParent/ICoreCanvasParent.h
ICoreCanvasParent#
ICoreCanvasParent.h:27 · class · final · bases public ICoreGraphicsView · pImpl · 22 declaration(s)
No Q_OBJECT, and the Q_PROPERTY(zoomLevel) that sat beside it is gone too.
class ICoreCanvasParent final : public ICoreGraphicsView {
public:
explicit ICoreCanvasParent(ICoreWidget* parent, ICoreStudioSurface* parentStudioSurface);
void setZoomLevel(double zoom);
double getZoomLevel() const;
// True for a moment after any canvas zoom step, in any canvas. While it
// is, a block draws the icon raster it already has, scaled, instead of
// re-rasterising its SVG at every step of the gesture; the zoom asks for
// one repaint once it has settled, which re-rasterises them crisply.
static bool isZoomGestureActive();
ICoreRect getVisibleSceneRect() const;
double getCurrentZoom() const;
void loadCanvas(ICoreCanvas* newCanvasToLoad);
void checkoutCanvasIfLoaded(const ICoreCanvas* newCanvasToCheck);
ICoreGraphicsScene* getScene() const;
double getPanningLimitMargin() const;
// The scroll/size facade (horizontalScroll, viewWidth, centerViewOn,
// requestRepaint, ...) lives on ICoreGraphicsView -- it was never
// canvas-specific and the chart view wants the same vocabulary.
double zoomLevel() const;
// What a library entry carries -- a block type, a template or a user block
// -- inserted into the loaded subsystem, centred on `scenePos`. The one path
// behind both a drop and a double-click on the entry. Returns false when
// nothing could be inserted (no subsystem loaded, the model frozen, an
// unknown block type); a template or user block that fails says why itself.
bool insertLibraryPayload(const ICoreMimePayload& payload, const ICorePoint& scenePos);
// The same, at the centre of what the view shows now, into the canvas of
// the focused studio surface: what a double-click in the library does.
// Each insert in a row at the same centre steps down and right, so a
// second one is not hidden under the first.
static bool insertLibraryPayloadIntoFocusedCanvas(const ICoreMimePayload& payload);
~ICoreCanvasParent() override;
protected:
// ICoreGraphicsView's hooks, not the toolkit's handlers (P2.11b).
bool wheelScrolled(const ICoreWheelEvent& event) override;
bool mousePressed(const ICoreMouseEvent& event) override;
bool mouseMoved(const ICoreMouseEvent& event) override;
bool mouseReleased(const ICoreMouseEvent& event) override;
// These for receiving dragged blocks from library
bool dragEntered(const ICoreDragEvent& event) override;
bool dragMovedOver(const ICoreDragEvent& event) override;
bool payloadDropped(const ICoreDragEvent& event) override;
void resized(const ICoreRect& viewportBounds) override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreNewTabPanel.h#
src/ICoreBlocks/ICoreStudio/StudioObjects/StudioSurface/CanvasArea/NewTabPanel/ICoreNewTabPanel.h
Brings the tree view, and with it ICoreTreeRow -- the row handle the path lookup below is written in terms of. Same reason ICoreSubsystemPickerDialog includes it rather than forward-declaring: the handle is returned BY VALUE.
ICoreNewTabPanel#
ICoreNewTabPanel.h:52 · class · bases public ICoreWidget · pImpl · 6 declaration(s)
ICoreNewTabPanel What the canvas area shows when a tab is being started: either because the "+" was pressed, or because the last tab of the window was closed.
class ICoreNewTabPanel : public ICoreWidget {
public:
explicit ICoreNewTabPanel(ICoreWidget *parent = nullptr, ICoreStudioSurface* parentStudioSurface = nullptr);
// The Create action: a new empty subsystem under the selected path, opened in
// a fresh tab. Public because it is the panel's original entry point.
void handleCreatingNewTab();
// Called every time the page is raised: rebuilds the tree, clears the form and
// starts the selection on whatever the window was last looking at.
void resetAppearance();
~ICoreNewTabPanel() override;
protected:
// Escape backs out to the canvas -- but only when there is a canvas to back
// out to, which is not the case when the last tab was just closed.
bool keyPressed(const ICoreKeyEvent& event) override;
// The left panel's sliding menu floats over this page as it does over the
// canvas, so a click on the page folds it away exactly as a click on the
// canvas does. A pinned menu stays: hideMenuPanel() decides that itself.
//
// Clicks on the page's passive parts arrive here by propagation -- the
// labels, cards and containers do not take them. The ones that do (the tree,
// the buttons, the name field) are interactions with this page rather than
// with the menu, and leave it alone.
bool mousePressed(const ICoreMouseEvent& event) override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};