API — ICoreEssentials/UI/Icons
The public contract of 2 header(s) under src/ICoreEssentials/UI/Icons — 4 class/struct definition(s), 20 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 |
|---|---|---|---|
ICoreIconEngine.h | ICoreIconEngine | 1 | public QIconEngine |
ICoreThemedIcon.h | ICoreIcons, ICoreThemedIconEngine, ICoreBlockArtIconEngine | 19 | public ICoreIconEngine; public ICoreIconEngine |
ICoreIconEngine.h#
src/ICoreEssentials/UI/Icons/ICoreIconEngine.h
ICoreIconEngine#
ICoreIconEngine.h:19 · class · bases public QIconEngine · 1 declaration(s)
⚠ FROZEN QT LAYER (P8.5) — DO NOT EDIT, DO NOT ADD MEMBERS.
class ICoreIconEngine : public QIconEngine {
protected:
// Base only — engines are constructed as subclasses.
ICoreIconEngine() = default;
};
};
ICoreThemedIcon.h#
src/ICoreEssentials/UI/Icons/ICoreThemedIcon.h
ICoreIcons#
ICoreThemedIcon.h:42 · class · 6 declaration(s)
I-Core Themed Icons The icon registry is flat black line art (#000000 ..
class ICoreIcons {
public:
// A theme-following icon for `svgPath`. Colored art (see isMonochrome
// below) comes back as a plain QIcon, untouched in both themes.
static QIcon themed(const ICoreString& svgPath);
// The block library's art with its authored colours swapped for the active
// theme's — block.iconInk for the flat line work, block.iconAccent and
// block.iconAccentAlt for the few glyphs that carry a coloured part —
// ready to hand to a QSvgRenderer.
//
// Those icons are literal SVG registered next to each block
// (ICoreBlockFactory::registerIconSVG) rather than files in a registry, so
// they cannot go through themed() above — and QSvgRenderer has no
// current-colour hook in Qt 6, so the colour is substituted in the markup
// before the renderer ever parses it. That keeps the glyph vector: it is
// still rasterized on demand at the on-screen size, which a flood over an
// already-rendered pixmap would have cost.
//
// On the light theme the markup is returned untouched — the art is authored
// in that ink, so there is nothing to swap.
static ICoreByteArray themedBlockArt(const char* svg);
// A theme-following icon over that same literal block art, for the UI
// OUTSIDE the canvas — the tab strip, the navigation bar, the subsystem
// navigator, a toolbar button. Where themedBlockArt hands back markup for a
// caller that is already rendering (the block frame renderer, which draws
// into its own QPainter), this hands back a QIcon a widget can just be
// given, and the substitution happens inside the engine at paint time:
//
// button->setIcon(ICoreIcons::blockArt(ICoreBlockFactory::getBlockIconSVG(type)));
//
// so the icon is still correct after a Light/Dark switch without the call
// site rebuilding it. Null or unregistered art comes back as a null QIcon.
static QIcon blockArt(const char* svg);
// The Subsystem block's own art, which is what a subsystem looks like
// everywhere: the block on the canvas, the tab that opens it, the navigator
// row, the button that creates one. One accessor so those cannot drift
// apart again — the old ":/SVGs/SubsystemIcon.svg" registry entry was a
// second, separate drawing of the same thing.
//
// Falls back to that registry entry if the block library somehow has not
// registered the type, so the UI shows a subsystem rather than nothing.
static QIcon subsystemGlyph();
// How subsystemGlyph reaches the block library's art without this module
// depending on the block library (ESSENTIALS_INDEPENDENCE D2): the
// application installs a resolver at startup (Initialization.cpp forwards
// to ICoreBlockFactory::getBlockIconSVG). Maps a block-type path to its
// registered SVG markup, or nullptr for none. With no resolver installed
// subsystemGlyph uses its bundled fallback, which is the correct
// standalone-SDK behavior.
static void installBlockArtResolver(std::function<const char*(const std::string& type)> resolver);
// Whether the registry entry at `svgPath` is flat mono art and therefore
// safe to flood with a single colour. False for the brand logos, the
// language file-type icons under SVGs/Coding/, the gradient-filled art and
// the icons whose colour carries meaning (the run green, the colour
// picker's swatch) — flooding any of those would destroy them.
static bool isMonochrome(const ICoreString& svgPath);
};
};
ICoreThemedIconEngine#
ICoreThemedIcon.h:110 · class · final · bases public ICoreIconEngine · pImpl · 7 declaration(s)
The engine behind ICoreIcons::themed.
class ICoreThemedIconEngine final : public ICoreIconEngine {
public:
explicit ICoreThemedIconEngine(ICoreString svgPath);
void paint(QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state) override;
QPixmap pixmap(const QSize& size, QIcon::Mode mode, QIcon::State state) override;
QSize actualSize(const QSize& size, QIcon::Mode mode, QIcon::State state) override;
QIconEngine* clone() const override;
// Stays QString: this overrides QIconEngine::key(), and Qt owns that
// signature. A return type is not covariant for values, so renaming it
// would silently stop overriding and start hiding.
QString key() const override;
~ICoreThemedIconEngine() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreBlockArtIconEngine#
ICoreThemedIcon.h:145 · class · final · bases public ICoreIconEngine · pImpl · 6 declaration(s)
The engine behind ICoreIcons::blockArt.
class ICoreBlockArtIconEngine final : public ICoreIconEngine {
public:
explicit ICoreBlockArtIconEngine(ICoreByteArray svg);
void paint(QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state) override;
QPixmap pixmap(const QSize& size, QIcon::Mode mode, QIcon::State state) override;
QSize actualSize(const QSize& size, QIcon::Mode mode, QIcon::State state) override;
QIconEngine* clone() const override;
QString key() const override; // QIconEngine's signature — see above.
~ICoreBlockArtIconEngine() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};