Commit ec42955c authored by Paul Asmuth's avatar Paul Asmuth
Browse files

move core/core/{environment, format}.{h,cc} -> core/, fix includes

parent 70793e74
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -29,8 +29,8 @@ include_directories(${CAIRO_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS} ${HARFBUZZ_IN

# Build: PlotFX Library
# -----------------------------------------------------------------------------
file(GLOB source_files "core/graphics/*.cc" "core/utils/**.cc" "core/sexpr*.cc")
list(REMOVE_ITEM source_files "source/plotfx_cli.cc")
file(GLOB source_files "core/graphics/*.cc" "core/utils/**.cc" "core/sexpr*.cc" "core/plotfx.cc" "core/environment.cc")
list(REMOVE_ITEM source_files "core/plotfx_cli.cc")
add_library(plotfx STATIC ${source_files})
set_target_properties(plotfx PROPERTIES PUBLIC_HEADER "source/plotfx.h;source/plotfx_sdl.h")
set(PLOTFX_LDFLAGS plotfx ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} ${HARFBUZZ_ICU_LIBRARIES} ${PNG_LIBRARIES} ${FONTCONFIG_LIBRARIES})
@@ -38,15 +38,15 @@ set(PLOTFX_LDFLAGS plotfx ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LI

# Build: CLI
# -----------------------------------------------------------------------------
#add_executable(plotfx-cli source/plotfx_cli.cc)
#target_link_libraries(plotfx-cli ${PLOTFX_LDFLAGS})
#set_target_properties(plotfx-cli PROPERTIES OUTPUT_NAME plotfx)
add_executable(plotfx-cli core/plotfx_cli.cc)
target_link_libraries(plotfx-cli ${PLOTFX_LDFLAGS})
set_target_properties(plotfx-cli PROPERTIES OUTPUT_NAME plotfx)


# Installation
# -----------------------------------------------------------------------------
#install(TARGETS plotfx ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/plotfx)
#install(TARGETS plotfx-cli DESTINATION bin)
install(TARGETS plotfx ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/plotfx)
install(TARGETS plotfx-cli DESTINATION bin)


# Testing
+0 −2
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@
#include <graphics/color.h>
#include "graphics/layout.h"
#include "utils/return_code.h"
#include "source/data_model.h"
#include "source/dimension.h"
#include "core/layout.h"

namespace plotfx {
+2 −2
Original line number Diff line number Diff line
@@ -37,8 +37,8 @@
#include <unordered_map>
#include "utils/return_code.h"
#include "sexpr.h"
#include "source/color_scheme.h"
#include "source/data_model.h"
#include "color_scheme.h"
#include "data_model.h"

namespace plotfx {

+0 −20
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@
 */
#include "environment.h"
#include "core/format.h"
#include "core/scale.h"
#include "config_helpers.h"
#include "graphics/font_lookup.h"

using namespace std::placeholders;
@@ -41,8 +39,6 @@ Environment::Environment() :
    screen_width(Unit::UNIT, 1200),
    screen_height(Unit::UNIT, 480),
    dpi(96),
    scale_layout_x(bind(&scale_layout_subdivide, _1, _2, 8)),
    scale_layout_y(bind(&scale_layout_subdivide, _1, _2, 8)),
    background_color(Color::fromRGB(1,1,1)),
    text_color(Color::fromRGB(.2,.2,.2)),
    border_color(Color::fromRGB(.2,.2,.2)),
@@ -58,21 +54,5 @@ ReturnCode environment_setup_defaults(Environment* env) {
  return OK;
}

ReturnCode environment_configure(
    const plist::PropertyList& plist,
    Environment* env) {
  if (auto rc = environment_setup_defaults(env); !rc.isSuccess()) {
    return rc;
  }

  ParserDefinitions pdefs = {
    {"width", bind(&configure_measure, _1, &env->screen_width)},
    {"height", bind(&configure_measure, _1, &env->screen_height)},
  };

  return parseAll(plist, pdefs);
}

} // namespace plotfx
+1 −11
Original line number Diff line number Diff line
@@ -30,12 +30,10 @@
#pragma once
#include <memory>
#include "utils/return_code.h"
#include "source/color_scheme.h"
#include "source/data_model.h"
#include "color_scheme.h"
#include "graphics/measure.h"
#include "graphics/color.h"
#include "graphics/text.h"
#include "core/scale.h"
#include "sexpr.h"

namespace plotfx {
@@ -52,16 +50,8 @@ struct Environment {
  Color background_color;
  Color text_color;
  Color border_color;
  DomainConfig scale_x;
  DomainConfig scale_y;
  ScaleLayoutFn scale_layout_x;
  ScaleLayoutFn scale_layout_y;
};

ReturnCode environment_configure(
    const plist::PropertyList& plist,
    Environment* env);

} // namespace plotfx

Loading