#pragma once
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>
namespace float_pigment {
enum class MeasureMode {
Undefined,
Exactly,
AtMost,
};
struct NodePtr {
void *ptr;
};
using Baseline = float;
using Width = float;
using Height = float;
using BaselineFunc = Baseline(*)(NodePtr, Width, Height);
using DirtyCallback = void(*)(NodePtr);
struct Size {
float width;
float height;
};
using MeasureMaxWidth = float;
using MeasureMaxHeight = float;
using MeasureMinWidth = float;
using MeasureMinHeight = float;
using MeasureMaxContentWidth = float;
using MeasureMaxContentHeight = float;
using MeasureFunc = Size(*)(NodePtr,
MeasureMaxWidth,
MeasureMode,
MeasureMaxHeight,
MeasureMode,
MeasureMinWidth,
MeasureMinHeight,
MeasureMaxContentWidth,
MeasureMaxContentHeight);
using CalcHandle = int32_t;
using ResolveCalc = float(*)(CalcHandle, float);
extern "C" {
void FreeString(const char *str);
void NodeAppendChild(NodePtr node, NodePtr child);
void NodeCalculateDryLayout(NodePtr node,
float available_width,
float available_height,
float viewport_width,
float viewport_height);
void NodeCalculateDryLayoutWithContainingSize(NodePtr node,
float available_width,
float available_height,
float viewport_width,
float viewport_height,
float containing_width,
float containing_height);
void NodeCalculateLayout(NodePtr node,
float available_width,
float available_height,
float viewport_width,
float viewport_height);
void NodeCalculateLayoutWithContainingSize(NodePtr node,
float available_width,
float available_height,
float viewport_width,
float viewport_height,
float containing_width,
float containing_height);
void NodeClearDirtyCallback(NodePtr node);
void NodeClearMeasureCache(NodePtr node);
void NodeClearMeasureFunc(NodePtr node);
void NodeFree(NodePtr node);
NodePtr NodeGetChild(NodePtr node, size_t index);
size_t NodeGetChildCount(NodePtr node);
void *NodeGetExternalHost(NodePtr node);
NodePtr NodeGetParent(NodePtr node);
void NodeHasMeasureFunc(NodePtr node);
void NodeInsertBefore(NodePtr node, NodePtr child, NodePtr pivot);
void NodeInsertChild(NodePtr node, NodePtr child, size_t index);
bool NodeIsDirty(NodePtr node);
float NodeLayoutGetBorderBottom(NodePtr node);
float NodeLayoutGetBorderLeft(NodePtr node);
float NodeLayoutGetBorderRight(NodePtr node);
float NodeLayoutGetBorderTop(NodePtr node);
float NodeLayoutGetBottom(NodePtr node);
float NodeLayoutGetHeight(NodePtr node);
float NodeLayoutGetLeft(NodePtr node);
float NodeLayoutGetMarginBottom(NodePtr node);
float NodeLayoutGetMarginLeft(NodePtr node);
float NodeLayoutGetMarginRight(NodePtr node);
float NodeLayoutGetMarginTop(NodePtr node);
float NodeLayoutGetPaddingBottom(NodePtr node);
float NodeLayoutGetPaddingLeft(NodePtr node);
float NodeLayoutGetPaddingRight(NodePtr node);
float NodeLayoutGetPaddingTop(NodePtr node);
float NodeLayoutGetRight(NodePtr node);
float NodeLayoutGetTop(NodePtr node);
float NodeLayoutGetWidth(NodePtr node);
void NodeMarkDirty(NodePtr node);
void NodeMarkDirtyAndPropagateToDescendants(NodePtr node);
NodePtr NodeNew();
void NodeRemoveAllChildren(NodePtr node);
void NodeRemoveChild(NodePtr node, NodePtr child);
void NodeSetAsText(NodePtr node);
void NodeSetBaselineFunc(NodePtr node, BaselineFunc baseline_func);
void NodeSetDirtyCallback(NodePtr node, DirtyCallback dirty_cb);
void NodeSetExternalHost(NodePtr node, void *external_host);
void NodeSetMeasureFunc(NodePtr node, MeasureFunc measure_func);
void NodeSetResolveCalc(NodePtr node, ResolveCalc resolve_calc);
FlexDirectionType NodeStyleGetFlexDirection(NodePtr node);
void NodeStyleSetAlignContent(NodePtr node, AlignContentType value);
void NodeStyleSetAlignItems(NodePtr node, AlignItemsType value);
void NodeStyleSetAlignSelf(NodePtr node, AlignSelfType value);
void NodeStyleSetAspectRatio(NodePtr node, float x, float y);
void NodeStyleSetAspectRatioAuto(NodePtr node);
void NodeStyleSetBorderBottom(NodePtr node, float value);
void NodeStyleSetBorderBottomAuto(NodePtr node);
void NodeStyleSetBorderBottomCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetBorderBottomNone(NodePtr node);
void NodeStyleSetBorderBottomPercentage(NodePtr node, float value);
void NodeStyleSetBorderLeft(NodePtr node, float value);
void NodeStyleSetBorderLeftAuto(NodePtr node);
void NodeStyleSetBorderLeftCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetBorderLeftNone(NodePtr node);
void NodeStyleSetBorderLeftPercentage(NodePtr node, float value);
void NodeStyleSetBorderRight(NodePtr node, float value);
void NodeStyleSetBorderRightAuto(NodePtr node);
void NodeStyleSetBorderRightCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetBorderRightNone(NodePtr node);
void NodeStyleSetBorderRightPercentage(NodePtr node, float value);
void NodeStyleSetBorderTop(NodePtr node, float value);
void NodeStyleSetBorderTopAuto(NodePtr node);
void NodeStyleSetBorderTopCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetBorderTopNone(NodePtr node);
void NodeStyleSetBorderTopPercentage(NodePtr node, float value);
void NodeStyleSetBottom(NodePtr node, float value);
void NodeStyleSetBottomAuto(NodePtr node);
void NodeStyleSetBottomCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetBottomNone(NodePtr node);
void NodeStyleSetBottomPercentage(NodePtr node, float value);
void NodeStyleSetBoxSizing(NodePtr node, BoxSizingType value);
void NodeStyleSetColumnGap(NodePtr node, float value);
void NodeStyleSetColumnGapCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetColumnGapNormal(NodePtr node);
void NodeStyleSetColumnGapPercentage(NodePtr node, float value);
void NodeStyleSetDisplay(NodePtr node, DisplayType value);
void NodeStyleSetFlexBasis(NodePtr node, float value);
void NodeStyleSetFlexBasisAuto(NodePtr node);
void NodeStyleSetFlexBasisCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetFlexBasisNone(NodePtr node);
void NodeStyleSetFlexBasisPercentage(NodePtr node, float value);
void NodeStyleSetFlexDirection(NodePtr node, FlexDirectionType value);
void NodeStyleSetFlexGrow(NodePtr node, float value);
void NodeStyleSetFlexShrink(NodePtr node, float value);
void NodeStyleSetFlexWrap(NodePtr node, FlexWrapType value);
void NodeStyleSetHeight(NodePtr node, float value);
void NodeStyleSetHeightAuto(NodePtr node);
void NodeStyleSetHeightCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetHeightNone(NodePtr node);
void NodeStyleSetHeightPercentage(NodePtr node, float value);
void NodeStyleSetJustifyContent(NodePtr node, JustifyContentType value);
void NodeStyleSetLeft(NodePtr node, float value);
void NodeStyleSetLeftAuto(NodePtr node);
void NodeStyleSetLeftCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetLeftNone(NodePtr node);
void NodeStyleSetLeftPercentage(NodePtr node, float value);
void NodeStyleSetMarginBottom(NodePtr node, float value);
void NodeStyleSetMarginBottomAuto(NodePtr node);
void NodeStyleSetMarginBottomCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetMarginBottomNone(NodePtr node);
void NodeStyleSetMarginBottomPercentage(NodePtr node, float value);
void NodeStyleSetMarginLeft(NodePtr node, float value);
void NodeStyleSetMarginLeftAuto(NodePtr node);
void NodeStyleSetMarginLeftCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetMarginLeftNone(NodePtr node);
void NodeStyleSetMarginLeftPercentage(NodePtr node, float value);
void NodeStyleSetMarginRight(NodePtr node, float value);
void NodeStyleSetMarginRightAuto(NodePtr node);
void NodeStyleSetMarginRightCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetMarginRightNone(NodePtr node);
void NodeStyleSetMarginRightPercentage(NodePtr node, float value);
void NodeStyleSetMarginTop(NodePtr node, float value);
void NodeStyleSetMarginTopAuto(NodePtr node);
void NodeStyleSetMarginTopCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetMarginTopNone(NodePtr node);
void NodeStyleSetMarginTopPercentage(NodePtr node, float value);
void NodeStyleSetMaxHeight(NodePtr node, float value);
void NodeStyleSetMaxHeightAuto(NodePtr node);
void NodeStyleSetMaxHeightCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetMaxHeightNone(NodePtr node);
void NodeStyleSetMaxHeightPercentage(NodePtr node, float value);
void NodeStyleSetMaxWidth(NodePtr node, float value);
void NodeStyleSetMaxWidthAuto(NodePtr node);
void NodeStyleSetMaxWidthCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetMaxWidthNone(NodePtr node);
void NodeStyleSetMaxWidthPercentage(NodePtr node, float value);
void NodeStyleSetMinHeight(NodePtr node, float value);
void NodeStyleSetMinHeightAuto(NodePtr node);
void NodeStyleSetMinHeightCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetMinHeightNone(NodePtr node);
void NodeStyleSetMinHeightPercentage(NodePtr node, float value);
void NodeStyleSetMinWidth(NodePtr node, float value);
void NodeStyleSetMinWidthAuto(NodePtr node);
void NodeStyleSetMinWidthCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetMinWidthNone(NodePtr node);
void NodeStyleSetMinWidthPercentage(NodePtr node, float value);
void NodeStyleSetOrder(NodePtr node, int32_t value);
void NodeStyleSetOverflowX(NodePtr node, OverflowType value);
void NodeStyleSetOverflowY(NodePtr node, OverflowType value);
void NodeStyleSetPaddingBottom(NodePtr node, float value);
void NodeStyleSetPaddingBottomAuto(NodePtr node);
void NodeStyleSetPaddingBottomCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetPaddingBottomNone(NodePtr node);
void NodeStyleSetPaddingBottomPercentage(NodePtr node, float value);
void NodeStyleSetPaddingLeft(NodePtr node, float value);
void NodeStyleSetPaddingLeftAuto(NodePtr node);
void NodeStyleSetPaddingLeftCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetPaddingLeftNone(NodePtr node);
void NodeStyleSetPaddingLeftPercentage(NodePtr node, float value);
void NodeStyleSetPaddingRight(NodePtr node, float value);
void NodeStyleSetPaddingRightAuto(NodePtr node);
void NodeStyleSetPaddingRightCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetPaddingRightNone(NodePtr node);
void NodeStyleSetPaddingRightPercentage(NodePtr node, float value);
void NodeStyleSetPaddingTop(NodePtr node, float value);
void NodeStyleSetPaddingTopAuto(NodePtr node);
void NodeStyleSetPaddingTopCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetPaddingTopNone(NodePtr node);
void NodeStyleSetPaddingTopPercentage(NodePtr node, float value);
void NodeStyleSetPosition(NodePtr node, PositionType value);
void NodeStyleSetRight(NodePtr node, float value);
void NodeStyleSetRightAuto(NodePtr node);
void NodeStyleSetRightCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetRightNone(NodePtr node);
void NodeStyleSetRightPercentage(NodePtr node, float value);
void NodeStyleSetRowGap(NodePtr node, float value);
void NodeStyleSetRowGapCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetRowGapNormal(NodePtr node);
void NodeStyleSetRowGapPercentage(NodePtr node, float value);
void NodeStyleSetTextAlign(NodePtr node, TextAlignType value);
void NodeStyleSetTop(NodePtr node, float value);
void NodeStyleSetTopAuto(NodePtr node);
void NodeStyleSetTopCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetTopNone(NodePtr node);
void NodeStyleSetTopPercentage(NodePtr node, float value);
void NodeStyleSetWidth(NodePtr node, float value);
void NodeStyleSetWidthAuto(NodePtr node);
void NodeStyleSetWidthCalcHandle(NodePtr node, int32_t calc_handle);
void NodeStyleSetWidthNone(NodePtr node);
void NodeStyleSetWidthPercentage(NodePtr node, float value);
void NodeStyleSetWritingMode(NodePtr node, WritingModeType value);
const char *NodeToString(NodePtr node, bool recursive, bool layout, bool style);
}
}