#include "ui/views/layout/flex_layout_types.h"
#include <algorithm>
#include <tuple>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/layout/layout_types.h"
#include "ui/views/view.h"
namespace views {
namespace {
constexpr MaximumFlexSizeRule kDefaultMaximumFlexSizeRule = …;
class LazySize;
class LazyDimension { … };
class LazySize { … };
int LazyDimension::get() const { … }
int InterpolateSize(MinimumFlexSizeRule minimum_size_rule,
MaximumFlexSizeRule maximum_size_rule,
int minimum_size,
int preferred_size,
LazyDimension maximum_size,
int available_size) { … }
gfx::Size GetPreferredSize(MinimumFlexSizeRule minimum_width_rule,
MaximumFlexSizeRule maximum_width_rule,
MinimumFlexSizeRule minimum_height_rule,
MaximumFlexSizeRule maximum_height_rule,
bool adjust_height_for_width,
const View* view,
const SizeBounds& size_bounds) { … }
}
FlexSpecification::FlexSpecification()
: … { … }
FlexSpecification::FlexSpecification(FlexRule rule)
: … { … }
FlexSpecification::FlexSpecification(MinimumFlexSizeRule minimum_size_rule,
MaximumFlexSizeRule maximum_size_rule,
bool adjust_height_for_width)
: … { … }
FlexSpecification::FlexSpecification(
LayoutOrientation orientation,
MinimumFlexSizeRule minimum_main_axis_rule,
MaximumFlexSizeRule maximum_main_axis_rule,
bool adjust_height_for_width,
MinimumFlexSizeRule minimum_cross_axis_rule)
: … { … }
FlexSpecification::FlexSpecification(const FlexSpecification& other) = default;
FlexSpecification& FlexSpecification::operator=(
const FlexSpecification& other) = default;
FlexSpecification::~FlexSpecification() = default;
FlexSpecification FlexSpecification::WithWeight(int weight) const { … }
FlexSpecification FlexSpecification::WithOrder(int order) const { … }
FlexSpecification FlexSpecification::WithAlignment(
LayoutAlignment alignment) const { … }
void Inset1D::SetInsets(int leading, int trailing) { … }
void Inset1D::Expand(int leading, int trailing) { … }
bool Inset1D::operator==(const Inset1D& other) const { … }
bool Inset1D::operator!=(const Inset1D& other) const { … }
bool Inset1D::operator<(const Inset1D& other) const { … }
std::string Inset1D::ToString() const { … }
void Span::SetSpan(int start, int length) { … }
void Span::Expand(int leading, int trailing) { … }
void Span::Inset(int leading, int trailing) { … }
void Span::Inset(const Inset1D& insets) { … }
void Span::Center(const Span& container, const Inset1D& margins) { … }
void Span::Align(const Span& container,
LayoutAlignment alignment,
const Inset1D& margins) { … }
bool Span::operator==(const Span& other) const { … }
bool Span::operator!=(const Span& other) const { … }
bool Span::operator<(const Span& other) const { … }
std::string Span::ToString() const { … }
}