Commit 00ee229b authored by Paul Asmuth's avatar Paul Asmuth
Browse files

rename LayoutInfo -> LayoutState

parent ad163bee
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -36,8 +36,8 @@ LayoutSettings::LayoutSettings() : position(Position::RELATIVE) {}

ReturnCode layout_compute(
    const LayoutSettings& config,
    LayoutInfo* parent_layout,
    LayoutInfo* layout) {
    LayoutState* parent_layout,
    LayoutState* layout) {
  layout->content_box = layout->bounding_box;
  auto width = config.width;
  auto width_min = width.value_or(from_unit(0));
+3 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@

namespace plotfx {

struct LayoutInfo {
struct LayoutState {

  /**
   * The elements bounding box
@@ -76,8 +76,8 @@ struct LayoutSettings {

ReturnCode layout_compute(
    const LayoutSettings& config,
    LayoutInfo* parent_layout,
    LayoutInfo* layout);
    LayoutState* parent_layout,
    LayoutState* layout);

} // namespace plotfx
+6 −6
Original line number Diff line number Diff line
@@ -39,17 +39,17 @@

namespace plotfx {
struct Layer;
struct LayoutInfo;
struct LayoutState;
struct Document;
struct DataContext;
struct Environment;

using plist::PropertyList;

using ElementDrawFn = std::function<ReturnCode (const LayoutInfo&, Layer*)>;
using ElementDrawFn = std::function<ReturnCode (const LayoutState&, Layer*)>;

template <typename T>
using ElementDrawAsFn = std::function<ReturnCode (const T&, const LayoutInfo&, Layer*)>;
using ElementDrawAsFn = std::function<ReturnCode (const T&, const LayoutState&, Layer*)>;

template <typename T>
using ElementConfigureAsFn = std::function<ReturnCode (
@@ -58,12 +58,12 @@ using ElementConfigureAsFn = std::function<ReturnCode (
    T*)>;

template <typename T>
using ElementDrawAsFn = std::function<ReturnCode (const T&, const LayoutInfo&, Layer*)>;
using ElementDrawAsFn = std::function<ReturnCode (const T&, const LayoutState&, Layer*)>;

using ElementLayoutFn = std::function<ReturnCode (const Layer&, LayoutInfo*)>;
using ElementLayoutFn = std::function<ReturnCode (const Layer&, LayoutState*)>;

template <typename T>
using ElementLayoutAsFn = std::function<ReturnCode (const T&, const Layer&, LayoutInfo*)>;
using ElementLayoutAsFn = std::function<ReturnCode (const T&, const Layer&, LayoutState*)>;

struct Element {
  virtual ~Element() = default;
+4 −4
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ PlotAreaConfig::PlotAreaConfig() :

ReturnCode draw_horizontal(
    PlotAreaConfig config,
    const LayoutInfo& layout,
    const LayoutState& layout,
    Layer* layer) {
  const auto& clip = layout.content_box;

@@ -126,7 +126,7 @@ ReturnCode draw_horizontal(

ReturnCode draw_vertical(
    PlotAreaConfig config,
    const LayoutInfo& layout,
    const LayoutState& layout,
    Layer* layer) {
  const auto& clip = layout.content_box;

@@ -203,14 +203,14 @@ ReturnCode draw_vertical(
ReturnCode layout(
    const PlotAreaConfig& config,
    const Layer& layer,
    LayoutInfo* layout) {
    LayoutState* layout) {
  /* nothing to do */
  return OK;
}

ReturnCode draw(
    const PlotAreaConfig& config,
    const LayoutInfo& layout,
    const LayoutState& layout,
    Layer* layer) {
  switch (config.direction) {
    case Direction::HORIZONTAL:
+2 −2
Original line number Diff line number Diff line
@@ -56,13 +56,13 @@ struct PlotAreaConfig {

ReturnCode draw(
    const PlotAreaConfig& config,
    const LayoutInfo& layout,
    const LayoutState& layout,
    Layer* layer);

ReturnCode layout(
    const PlotAreaConfig& config,
    const Layer& layer,
    LayoutInfo* layout);
    LayoutState* layout);

ReturnCode configure(
    const plist::PropertyList& plist,
Loading