Commit 1543b090 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add old files back to build

parent 529ef03f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -30,7 +30,7 @@
#pragma once
#pragma once
#include <string>
#include <string>
#include <vector>
#include <vector>
#include "source/utils/return_code.h"
#include "return_code.h"


namespace plotfx {
namespace plotfx {


+12 −3
Original line number Original line Diff line number Diff line
@@ -27,11 +27,12 @@
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 */
#include "format.h"
#include "data_model.h"
#include "utils/UnixTime.h"

#include <sstream>
#include <sstream>
#include <iomanip>
#include <iomanip>
#include "core/format.h"
#include "source/config_helpers.h"
#include "source/utils/UnixTime.h"


namespace plotfx {
namespace plotfx {


@@ -43,6 +44,7 @@ Formatter format_decimal_scientific(size_t precision) {
  };
  };
}
}


/*
ReturnCode confgure_format_decimal_scientific(
ReturnCode confgure_format_decimal_scientific(
    const plist::Property& prop,
    const plist::Property& prop,
    Formatter* formatter) {
    Formatter* formatter) {
@@ -64,6 +66,7 @@ ReturnCode confgure_format_decimal_scientific(
  *formatter = format_decimal_scientific(precision);
  *formatter = format_decimal_scientific(precision);
  return OK;
  return OK;
}
}
*/


Formatter format_decimal_fixed(size_t precision) {
Formatter format_decimal_fixed(size_t precision) {
  return [precision] (const std::string& v) -> std::string {
  return [precision] (const std::string& v) -> std::string {
@@ -73,6 +76,7 @@ Formatter format_decimal_fixed(size_t precision) {
  };
  };
}
}


/*
ReturnCode confgure_format_decimal_fixed(
ReturnCode confgure_format_decimal_fixed(
    const plist::Property& prop,
    const plist::Property& prop,
    Formatter* formatter) {
    Formatter* formatter) {
@@ -98,6 +102,7 @@ ReturnCode confgure_format_decimal_fixed(
  *formatter = format_decimal_fixed(precision);
  *formatter = format_decimal_fixed(precision);
  return OK;
  return OK;
}
}
*/


Formatter format_datetime(const std::string& fmt) {
Formatter format_datetime(const std::string& fmt) {
  return [fmt] (const std::string& v) -> std::string {
  return [fmt] (const std::string& v) -> std::string {
@@ -106,6 +111,7 @@ Formatter format_datetime(const std::string& fmt) {
  };
  };
}
}


/*
ReturnCode confgure_format_datetime(
ReturnCode confgure_format_datetime(
    const plist::Property& prop,
    const plist::Property& prop,
    Formatter* formatter) {
    Formatter* formatter) {
@@ -127,6 +133,7 @@ ReturnCode confgure_format_datetime(
  *formatter = format_datetime(fmtspec);
  *formatter = format_datetime(fmtspec);
  return OK;
  return OK;
}
}
*/


Formatter format_string() {
Formatter format_string() {
  return [] (const std::string& v) -> std::string {
  return [] (const std::string& v) -> std::string {
@@ -134,6 +141,7 @@ Formatter format_string() {
  };
  };
}
}


/*
ReturnCode confgure_format_string(
ReturnCode confgure_format_string(
    const plist::Property& prop,
    const plist::Property& prop,
    Formatter* formatter) {
    Formatter* formatter) {
@@ -173,6 +181,7 @@ ReturnCode confgure_format(
      "  - string\n",
      "  - string\n",
      prop.value);
      prop.value);
}
}
*/


} // namespace plotfx
} // namespace plotfx
+54 −54
Original line number Original line Diff line number Diff line
@@ -115,60 +115,60 @@ ReturnCode layout_element(
  return OK;
  return OK;
}
}


ReturnCode layout_elements(
//ReturnCode layout_elements(
    const Layer& layer,
//    const Layer& layer,
    const Rectangle& parent_bbox,
//    const Rectangle& parent_bbox,
    std::vector<ElementPlacement>* elements,
//    std::vector<ElementPlacement>* elements,
    Rectangle* content_box) {
//    Rectangle* content_box) {
  /* sort elements by z-index */
//  /* sort elements by z-index */
  std::stable_sort(
//  std::stable_sort(
      elements->begin(),
//      elements->begin(),
      elements->end(),
//      elements->end(),
      [] (const ElementPlacement& a, const ElementPlacement& b) {
//      [] (const ElementPlacement& a, const ElementPlacement& b) {
        return a.element->z_index() < b.element->z_index();
//        return a.element->z_index() < b.element->z_index();
      });
//      });

//
  /* compute bounding boxes */
//  /* compute bounding boxes */
  LayoutState layout_state;
//  LayoutState layout_state;
  layout_state.content_box = parent_bbox;
//  layout_state.content_box = parent_bbox;

//
  for (auto& e : *elements) {
//  for (auto& e : *elements) {
    double bbox_w = 0.0;
//    double bbox_w = 0.0;
    double bbox_h = 0.0;
//    double bbox_h = 0.0;

//
    if (e.element->reflow) {
//    if (e.element->reflow) {
      if (auto rc =
//      if (auto rc =
            e.element->reflow(
//            e.element->reflow(
                layer,
//                layer,
                layout_state.content_box.w,
//                layout_state.content_box.w,
                layout_state.content_box.h,
//                layout_state.content_box.h,
                &bbox_w,
//                &bbox_w,
                &bbox_h);
//                &bbox_h);
            !rc.isSuccess()) {
//            !rc.isSuccess()) {
        return rc;
//        return rc;
      }
//      }
    }
//    }

//
    if (auto rc =
//    if (auto rc =
          layout_element(
//          layout_element(
              e.element->layout_settings(),
//              e.element->layout_settings(),
              bbox_w,
//              bbox_w,
              bbox_h,
//              bbox_h,
              &layout_state,
//              &layout_state,
              &e.layout.content_box);
//              &e.layout.content_box);
          !rc.isSuccess()) {
//          !rc.isSuccess()) {
      return rc;
//      return rc;
    }
//    }
  }
//  }

//
  for (auto& e : *elements) {
//  for (auto& e : *elements) {
    e.layout.bounding_box = parent_bbox;
//    e.layout.bounding_box = parent_bbox;
    e.layout.inner_box = layout_state.content_box;
//    e.layout.inner_box = layout_state.content_box;
  }
//  }

//
  *content_box = layout_state.content_box;
//  *content_box = layout_state.content_box;
  return OK;
//  return OK;
}
//}


} // namespace plotfx
} // namespace plotfx
+0 −0

File moved.

+8 −0
Original line number Original line Diff line number Diff line
@@ -180,6 +180,8 @@ std::vector<double> domain_untranslate(
  return s;
  return s;
}
}


/*

ReturnCode domain_configure(
ReturnCode domain_configure(
    const plist::Property& prop,
    const plist::Property& prop,
    DomainConfig* domain) {
    DomainConfig* domain) {
@@ -214,6 +216,8 @@ ReturnCode domain_configure(
  return OK;
  return OK;
}
}


*/

ReturnCode scale_layout_linear(
ReturnCode scale_layout_linear(
    const DomainConfig& domain,
    const DomainConfig& domain,
    ScaleLayout* layout,
    ScaleLayout* layout,
@@ -287,6 +291,8 @@ ReturnCode scale_layout_discrete(
  return OK;
  return OK;
}
}


/*

ReturnCode configure_scale_layout_linear(
ReturnCode configure_scale_layout_linear(
    const plist::Property& prop,
    const plist::Property& prop,
    ScaleLayoutFn* layout) {
    ScaleLayoutFn* layout) {
@@ -387,5 +393,7 @@ ReturnCode configure_scale_layout(
      prop.value);
      prop.value);
}
}


*/

} // namespace plotfx
} // namespace plotfx
Loading