From 001c59fa0eb8ddfc3f7995e3137882f0a9bfc167 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Thu, 30 May 2024 15:53:35 +0200 Subject: [PATCH 1/3] Removed dependency on xtl --- CMakeLists.txt | 6 ------ include/xleaflet/xicon.hpp | 15 +++++++-------- include/xleaflet/xlayer.hpp | 3 ++- include/xleaflet/xmap.hpp | 2 -- include/xleaflet/xmarker.hpp | 5 ++--- include/xleaflet/xmeasure_control.hpp | 5 +++-- include/xleaflet/xpopup.hpp | 3 ++- include/xleaflet/xwidget_control.hpp | 9 +++++---- include/xleaflet/xzoom_control.hpp | 3 ++- test/CMakeLists.txt | 1 - xleafletConfig.cmake.in | 1 - 11 files changed, 23 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d8b610..7b73f82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,14 +72,9 @@ option(XLEAFLET_BUILD_TESTS "xleaflet test suite" OFF) # Dependencies # ============ -set(xtl_REQUIRED_VERSION 0.7.0) set(xproperty_REQUIRED_VERSION 0.11.0) set(xwidgets_REQUIRED_VERSION 0.27.0) -if (NOT TARGET xtl) - find_package(xtl ${xtl_REQUIRED_VERSION} REQUIRED) -endif () - if (NOT TARGET xproperty) find_package(xproperty ${xproperty_REQUIRED_VERSION} REQUIRED) endif () @@ -173,7 +168,6 @@ target_include_directories(xleaflet PUBLIC $) target_link_libraries(xleaflet - PUBLIC xtl PUBLIC xproperty PUBLIC xwidgets) diff --git a/include/xleaflet/xicon.hpp b/include/xleaflet/xicon.hpp index 41dd0b8..f0890a2 100644 --- a/include/xleaflet/xicon.hpp +++ b/include/xleaflet/xicon.hpp @@ -10,10 +10,9 @@ #define XLEAFLET_ICON_HPP #include +#include #include -#include "xtl/xoptional.hpp" - #include "xwidgets/xmaterialize.hpp" #include "xwidgets/xwidget.hpp" @@ -41,12 +40,12 @@ namespace xlf void apply_patch(const nl::json&, const xeus::buffer_sequence&); XPROPERTY(std::string, derived_type, icon_url, ""); - XPROPERTY(xtl::xoptional, derived_type, shadow_url); - XPROPERTY(xtl::xoptional, derived_type, icon_size); - XPROPERTY(xtl::xoptional, derived_type, shadow_size); - XPROPERTY(xtl::xoptional, derived_type, icon_anchor); - XPROPERTY(xtl::xoptional, derived_type, shadow_anchor); - XPROPERTY(xtl::xoptional, derived_type, popup_anchor); + XPROPERTY(std::optional, derived_type, shadow_url); + XPROPERTY(std::optional, derived_type, icon_size); + XPROPERTY(std::optional, derived_type, shadow_size); + XPROPERTY(std::optional, derived_type, icon_anchor); + XPROPERTY(std::optional, derived_type, shadow_anchor); + XPROPERTY(std::optional, derived_type, popup_anchor); protected: diff --git a/include/xleaflet/xlayer.hpp b/include/xleaflet/xlayer.hpp index ea54bc0..d0a7e87 100644 --- a/include/xleaflet/xlayer.hpp +++ b/include/xleaflet/xlayer.hpp @@ -9,6 +9,7 @@ #ifndef XLEAFLET_LAYER_HPP #define XLEAFLET_LAYER_HPP +#include #include #include @@ -41,7 +42,7 @@ namespace xlf XPROPERTY(std::string, derived_type, name, ""); XPROPERTY(bool, derived_type, base, true); XPROPERTY(bool, derived_type, bottom, true); - XPROPERTY(xtl::xoptional, derived_type, popup); + XPROPERTY(std::optional, derived_type, popup); XPROPERTY(std::vector, derived_type, options); protected: diff --git a/include/xleaflet/xmap.hpp b/include/xleaflet/xmap.hpp index cf5c66f..bbd94f7 100644 --- a/include/xleaflet/xmap.hpp +++ b/include/xleaflet/xmap.hpp @@ -16,8 +16,6 @@ #include #include -#include "xtl/xoptional.hpp" - #include "xwidgets/xcolor.hpp" #include "xwidgets/xeither.hpp" #include "xwidgets/xholder.hpp" diff --git a/include/xleaflet/xmarker.hpp b/include/xleaflet/xmarker.hpp index 20fa90d..3d98431 100644 --- a/include/xleaflet/xmarker.hpp +++ b/include/xleaflet/xmarker.hpp @@ -12,10 +12,9 @@ #include #include #include +#include #include -#include "xtl/xoptional.hpp" - #include "xwidgets/xmaterialize.hpp" #include "xwidgets/xholder.hpp" #include "xwidgets/xwidget.hpp" @@ -61,7 +60,7 @@ namespace xlf // TODO: bounded between 0.0 and 1.0 XPROPERTY(double, derived_type, opacity, 1.0); XPROPERTY(bool, derived_type, visible, true); - XPROPERTY(xtl::xoptional, derived_type, icon); + XPROPERTY(std::optional, derived_type, icon); XPROPERTY(double, derived_type, rotation_angle, 0.); XPROPERTY(std::string, derived_type, rotation_origin, ""); XPROPERTY(int, derived_type, rise_offset, 250); diff --git a/include/xleaflet/xmeasure_control.hpp b/include/xleaflet/xmeasure_control.hpp index 215540f..d6cb0c9 100644 --- a/include/xleaflet/xmeasure_control.hpp +++ b/include/xleaflet/xmeasure_control.hpp @@ -10,6 +10,7 @@ #ifndef XLEAFLET_MEASURE_CONTROL_HPP #define XLEAFLET_MEASURE_CONTROL_HPP +#include #include #include "xwidgets/xcolor.hpp" @@ -44,9 +45,9 @@ namespace xlf XPROPERTY(std::string, derived_type, position, "topright", XEITHER("topright", "topleft", "bottomright", "bottomleft")); XPROPERTY(std::string, derived_type, primary_length_unit, "feet", XEITHER("feet", "meters", "miles", "kilometers")); - XPROPERTY(xtl::xoptional, derived_type, secondary_length_unit, {}, XEITHER_OPTIONAL("feet", "meters", "miles", "kilometers")); + XPROPERTY(std::optional, derived_type, secondary_length_unit, {}, XEITHER_OPTIONAL("feet", "meters", "miles", "kilometers")); XPROPERTY(std::string, derived_type, primary_area_unit, "acres", XEITHER("acres", "hectares", "sqfeet", "sqmeters", "sqmiles")); - XPROPERTY(xtl::xoptional, derived_type, secondary_area_unit, {}, XEITHER_OPTIONAL("acres", "hectares", "sqfeet", "sqmeters", "sqmiles")); + XPROPERTY(std::optional, derived_type, secondary_area_unit, {}, XEITHER_OPTIONAL("acres", "hectares", "sqfeet", "sqmeters", "sqmiles")); XPROPERTY(xw::html_color, derived_type, active_color, "#ABE67E"); XPROPERTY(xw::html_color, derived_type, completed_color, "#C8F2BE"); XPROPERTY(nl::json, derived_type, popup_options, R"({ diff --git a/include/xleaflet/xpopup.hpp b/include/xleaflet/xpopup.hpp index 2b2ff8c..2b462e6 100644 --- a/include/xleaflet/xpopup.hpp +++ b/include/xleaflet/xpopup.hpp @@ -11,6 +11,7 @@ #define XLEAFLET_POPUP_HPP #include +#include #include #include "xwidgets/xholder.hpp" @@ -43,7 +44,7 @@ namespace xlf void apply_patch(const nl::json&, const xeus::buffer_sequence&); XPROPERTY(point_type, derived_type, location); - XPROPERTY(xtl::xoptional, derived_type, child); + XPROPERTY(std::optional, derived_type, child); XPROPERTY(int, derived_type, max_width, 300); XPROPERTY(int, derived_type, min_width, 50); XPROPERTY(int, derived_type, max_height); diff --git a/include/xleaflet/xwidget_control.hpp b/include/xleaflet/xwidget_control.hpp index cb1978c..fe13b2f 100644 --- a/include/xleaflet/xwidget_control.hpp +++ b/include/xleaflet/xwidget_control.hpp @@ -10,6 +10,7 @@ #ifndef XLEAFLET_WIDGET_CONTROL_HPP #define XLEAFLET_WIDGET_CONTROL_HPP +#include #include #include "xwidgets/xholder.hpp" @@ -40,10 +41,10 @@ namespace xlf void apply_patch(const nl::json&, const xeus::buffer_sequence&); XPROPERTY(widget_type, derived_type, widget); - XPROPERTY(xtl::xoptional, derived_type, max_width); - XPROPERTY(xtl::xoptional, derived_type, min_width); - XPROPERTY(xtl::xoptional, derived_type, max_height); - XPROPERTY(xtl::xoptional, derived_type, min_height); + XPROPERTY(std::optional, derived_type, max_width); + XPROPERTY(std::optional, derived_type, min_width); + XPROPERTY(std::optional, derived_type, max_height); + XPROPERTY(std::optional, derived_type, min_height); protected: diff --git a/include/xleaflet/xzoom_control.hpp b/include/xleaflet/xzoom_control.hpp index 0a7540e..71ba053 100644 --- a/include/xleaflet/xzoom_control.hpp +++ b/include/xleaflet/xzoom_control.hpp @@ -10,6 +10,7 @@ #ifndef XLEAFLET_ZOOM_CONTROL_HPP #define XLEAFLET_ZOOM_CONTROL_HPP +#include #include #include "xwidgets/xcolor.hpp" @@ -41,7 +42,7 @@ namespace xlf XPROPERTY(std::string, derived_type, zoom_in_text, "+"); XPROPERTY(std::string, derived_type, zoom_in_title, "Zoom in"); - XPROPERTY(xtl::xoptional, derived_type, zoom_out_text, "-"); + XPROPERTY(std::optional, derived_type, zoom_out_text, "-"); XPROPERTY(std::string, derived_type, zoom_out_title, "Zoom out"); protected: diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 90b5fb9..a4df144 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -45,7 +45,6 @@ include_directories(${pybind11_INCLUDE_DIRS}) target_compile_features(test_xleaflet PRIVATE cxx_std_14) target_link_libraries(test_xleaflet - PUBLIC xtl PUBLIC xeus PUBLIC xwidgets PUBLIC xleaflet diff --git a/xleafletConfig.cmake.in b/xleafletConfig.cmake.in index 0ec00e8..86909bc 100644 --- a/xleafletConfig.cmake.in +++ b/xleafletConfig.cmake.in @@ -18,7 +18,6 @@ @XLEAFLET_CONFIG_CODE@ include(CMakeFindDependencyMacro) -find_dependency(xtl @xtl_REQUIRED_VERSION@) find_dependency(xproperty @xeus_REQUIRED_VERSION@) find_dependency(xwidgets @xeus_REQUIRED_VERSION@) From 6092f01feefd43c71125ef3d2345044c08f7e1aa Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Fri, 31 May 2024 17:45:04 +0200 Subject: [PATCH 2/3] Upgraded to xproperty 0.12 and xwidgets 0.29 --- CMakeLists.txt | 4 ++-- environment-dev.yml | 4 ++-- xleafletConfig.cmake.in | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b73f82..b9a1295 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,8 +72,8 @@ option(XLEAFLET_BUILD_TESTS "xleaflet test suite" OFF) # Dependencies # ============ -set(xproperty_REQUIRED_VERSION 0.11.0) -set(xwidgets_REQUIRED_VERSION 0.27.0) +set(xproperty_REQUIRED_VERSION 0.12.0) +set(xwidgets_REQUIRED_VERSION 0.29.0) if (NOT TARGET xproperty) find_package(xproperty ${xproperty_REQUIRED_VERSION} REQUIRED) diff --git a/environment-dev.yml b/environment-dev.yml index c179caf..142fda8 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -8,8 +8,8 @@ dependencies: - ninja # Host dependencies - cppzmq - - xproperty=0.11.0 - - xwidgets=0.27.1 + - xproperty=0.12.0 + - xwidgets=0.29.0 - xtensor=0.24.3 # Test dependencies - doctest diff --git a/xleafletConfig.cmake.in b/xleafletConfig.cmake.in index 86909bc..50b14a1 100644 --- a/xleafletConfig.cmake.in +++ b/xleafletConfig.cmake.in @@ -18,8 +18,8 @@ @XLEAFLET_CONFIG_CODE@ include(CMakeFindDependencyMacro) -find_dependency(xproperty @xeus_REQUIRED_VERSION@) -find_dependency(xwidgets @xeus_REQUIRED_VERSION@) +find_dependency(xproperty @xproperty_REQUIRED_VERSION@) +find_dependency(xwidgets @xwidgets_REQUIRED_VERSION@) if (NOT TARGET xleaflet) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") From 569a726a0b86fd2c783a28fe00921c16fc760d2b Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Fri, 31 May 2024 17:55:37 +0200 Subject: [PATCH 3/3] Upgraded to C++17 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9a1295..cb7868d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,7 +189,7 @@ set_target_properties(xleaflet PROPERTIES CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED 14) -target_compile_features(xleaflet PRIVATE cxx_std_14) +target_compile_features(xleaflet PRIVATE cxx_std_17) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") target_compile_options(xleaflet PUBLIC -Wunused-parameter -Wextra -Wreorder)