Generated reference › API — ICoreEssentials/UI/Backends/WinUI/Layouts
kind: generated#api#icoreessentials-ui-backends-winui-layouts

API — ICoreEssentials/UI/Backends/WinUI/Layouts

The public contract of 2 header(s) under ICoreEssentials/UI/Backends/WinUI/Layouts — 1 class/struct definition(s), 0 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.

ICoreWinUILayoutAccess.h#

ICoreEssentials/UI/Backends/WinUI/Layouts/ICoreWinUILayoutAccess.h

This backend's answer to the thirteen questions the layout tier asks the toolkit. (This read "the ten questions", one short of the eleven asked even then; W10.71 added the height-for-width pair -- and the count is read off ICoreLayoutNativeAccess, never off this line.)

⚠ THERE IS ONE OF THESE FOR THE WHOLE BACKEND, and it is deliberate. The access holds no per-layout state -- every one of its members is a question about a widget it was handed -- so a second instance would be a second copy of nothing. The six wrappers therefore all construct their core against the same reference.

The decisions are one layer down in ICoreLayoutSeatCore, which names no toolkit and is where a reader should be looking for WHY a layout does something. This half only ever answers WHAT this toolkit says.

Declares no class of its own — see the file.

ICoreWinUILayoutFields.h#

ICoreEssentials/UI/Backends/WinUI/Layouts/ICoreWinUILayoutFields.h

The one part of this backend's layout access that DECIDES something: how a widget's several ways of stating a size become the one record the layout tier reads.

⚠⚠ IT NAMES NO TOOLKIT TYPE AND TAKES PLAIN NUMBERS, WHICH IS THE ENTIRE REASON IT IS A SEPARATE FILE. The rest of the access is forwarding -- setGeometry, setVisible, setParentWidget -- and forwarding is proved by compiling. This is not: it reads six numbers off a widget and three of the six mean something different from what they look like. A rule that can be got wrong needs a test, and a test needs something that can run without a XAML tree, a window or the Windows App SDK.

Its peers on this backend are the event-field unit and the drag-field unit, which exist for exactly the same reason and are split at exactly the same

ICoreWinUIWidgetNumbers#

ICoreWinUILayoutFields.h:29 · struct · 0 declaration(s)

Everything the access can read off a widget, in the units it reads them in.

struct ICoreWinUIWidgetNumbers {
public:
    // ICoreWidget::sizeHint() -- preferredSize() where the widget states one,
    // the INSTALLED LAYOUT's preferred where it does not, and nativeSizeHint()
    // where there is neither.
    double hintWidth = 0.0;
    double hintHeight = 0.0;

    // ⚠⚠ "THE HINT IS AN OPINION, NOT A READ-BACK" SAID OUT LOUD (W10.78).
    // Silence used to be detected by `hintWidth == nativeWidth`, because the
    // only way sizeHint() could equal the frame was by FALLING BACK to it.
    // That stopped being true the moment sizeHint() learned to measure the
    // installed layout: a settled container's layout preference and its current
    // frame are THE SAME NUMBER almost every pass, so the comparison would read
    // every container in the tree as silent -- and the tier resolves silence to
    // the minimum, which W10.78 has just narrowed to a real minimum. The two
    // changes together would have collapsed the tree.
    //
    // Set true by the access when the hint came from an opinion (a stated
    // preferredSize, or a layout that answered). Defaulting to FALSE is what
    // keeps every existing field-unit case meaning what it meant.
    //
    // 📌 *An inference that was sound only because a channel was broken stops
    // being sound the day the channel is repaired.*
    bool hintStated = false;

    // ICoreWidget::nativeSizeHint() -- the widget's CURRENT frame on this
    // backend, and therefore the value sizeHint() falls back to.
    double nativeWidth = 0.0;
    double nativeHeight = 0.0;

    // ICoreWidget::minimumSizeHint() -- minimumPreferredSize() where the
    // widget overrides it, and the stored minimum where it does not.
    double minimumHintWidth = 0.0;
    double minimumHintHeight = 0.0;

    // ICoreWinUIWidgetElement::sizeLimits() -- what the setters stored.
    // ⚠ A MAXIMUM OF 0 IS UNBOUNDED, in these and in what comes back.
    int limitMinimumWidth = 0;
    int limitMinimumHeight = 0;
    int limitMaximumWidth = 0;
    int limitMaximumHeight = 0;
    int limitHorizontalStretch = 0;
    int limitVerticalStretch = 0;
};
};