Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.0

0.6.0 / src / web / css / length_box.lucb

#==============================================================================================
#
#   length_box - LengthBox: four LengthPercentageOrAuto sides
#
#   DESCRIPTION:
#       Port of LibWeb/CSS/LengthBox.cpp (lines 1-31) and the inline members of LengthBox.h.
#       The destructor is defaulted and has no port; the defaulted operator== is
#       css_length_box_eq.
#
#       Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
#       Copyright (c) 2022, Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
#       Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
#       SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================

## Ported from Libraries/LibWeb/CSS/LengthBox.cpp:13 Web::CSS::LengthBox::LengthBox.
pub func css_length_box_construct(this: CssLengthBox*):
    this.m_top = css_length_percentage_or_auto_make_auto()
    this.m_right = css_length_percentage_or_auto_make_auto()
    this.m_bottom = css_length_percentage_or_auto_make_auto()
    this.m_left = css_length_percentage_or_auto_make_auto()

## Ported from Libraries/LibWeb/CSS/LengthBox.cpp:21 Web::CSS::LengthBox::LengthBox.
pub func css_length_box_construct_css_length_percentage_or_auto(this: CssLengthBox*, top: CssLengthPercentageOrAuto, right: CssLengthPercentageOrAuto, bottom: CssLengthPercentageOrAuto, left: CssLengthPercentageOrAuto):
    this.m_top = top
    this.m_right = right
    this.m_bottom = bottom
    this.m_left = left

## Ported from Libraries/LibWeb/CSS/LengthBox.h:20 Web::CSS::LengthBox::top.
pub func css_length_box_top(this: CssLengthBox*) -> CssLengthPercentageOrAuto*:
    return &this.m_top

## Ported from Libraries/LibWeb/CSS/LengthBox.h:21 Web::CSS::LengthBox::right.
pub func css_length_box_right(this: CssLengthBox*) -> CssLengthPercentageOrAuto*:
    return &this.m_right

## Ported from Libraries/LibWeb/CSS/LengthBox.h:22 Web::CSS::LengthBox::bottom.
pub func css_length_box_bottom(this: CssLengthBox*) -> CssLengthPercentageOrAuto*:
    return &this.m_bottom

## Ported from Libraries/LibWeb/CSS/LengthBox.h:23 Web::CSS::LengthBox::left.
pub func css_length_box_left(this: CssLengthBox*) -> CssLengthPercentageOrAuto*:
    return &this.m_left

## Ported from Libraries/LibWeb/CSS/LengthBox.h:24 Web::CSS::LengthBox::top.
pub func css_length_box_top_const(this: const CssLengthBox*) -> CssLengthPercentageOrAuto:
    return this.m_top

## Ported from Libraries/LibWeb/CSS/LengthBox.h:25 Web::CSS::LengthBox::right.
pub func css_length_box_right_const(this: const CssLengthBox*) -> CssLengthPercentageOrAuto:
    return this.m_right

## Ported from Libraries/LibWeb/CSS/LengthBox.h:26 Web::CSS::LengthBox::bottom.
pub func css_length_box_bottom_const(this: const CssLengthBox*) -> CssLengthPercentageOrAuto:
    return this.m_bottom

## Ported from Libraries/LibWeb/CSS/LengthBox.h:27 Web::CSS::LengthBox::left.
pub func css_length_box_left_const(this: const CssLengthBox*) -> CssLengthPercentageOrAuto:
    return this.m_left

## Ported from Libraries/LibWeb/CSS/LengthBox.h:29 Web::CSS::LengthBox::operator== (defaulted: side by side).
pub func css_length_box_eq(this: const CssLengthBox*, other: CssLengthBox) -> bool:
    return css_length_percentage_or_auto_eq(&this.m_top, other.m_top) and css_length_percentage_or_auto_eq(&this.m_right, other.m_right) and css_length_percentage_or_auto_eq(&this.m_bottom, other.m_bottom) and css_length_percentage_or_auto_eq(&this.m_left, other.m_left)