diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 02a07ffd3b..3bbc7314e3 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -204,16 +204,19 @@ else() endif() set(ZLIB_PKG "") +find_package(ZLIB) if (NOT ZLIB_FOUND) include(ZLIB/ZLIB.cmake) set(ZLIB_PKG dep_ZLIB) endif () set(PNG_PKG "") +find_package(PNG) if (NOT PNG_FOUND) include(PNG/PNG.cmake) set(PNG_PKG dep_PNG) endif () set(EXPAT_PKG "") +find_package(EXPAT) if (NOT EXPAT_FOUND) include(EXPAT/EXPAT.cmake) set(EXPAT_PKG dep_EXPAT) @@ -226,6 +229,7 @@ include(Boost/Boost.cmake) include(Cereal/Cereal.cmake) include(Qhull/Qhull.cmake) include(GLEW/GLEW.cmake) + include(GLFW/GLFW.cmake) include(OpenCSG/OpenCSG.cmake) @@ -241,23 +245,45 @@ include(CGAL/CGAL.cmake) include(NLopt/NLopt.cmake) -include(OpenSSL/OpenSSL.cmake) - set(CURL_PKG "") +find_package(CURL) if (NOT CURL_FOUND) + message(WARNING "no curl package found, building openssl and curl") + include(OpenSSL/OpenSSL.cmake) include(CURL/CURL.cmake) + set(OPENSSL_PKG dep_OpenSSL) set(CURL_PKG dep_CURL) endif () -include(JPEG/JPEG.cmake) -include(TIFF/TIFF.cmake) +set(JPEG_PKG "") +find_package(JPEG) +if (NOT JPEG_FOUND) + include(JPEG/JPEG.cmake) + set(JPEG_PKG dep_JPEG) +endif() + +set(TIFF_PKG "") +find_package(TIFF) +if (NOT TIFF_FOUND) + include(TIFF/TIFF.cmake) + set(TIFF_PKG "dep_TIFF") +endif() + include(wxWidgets/wxWidgets.cmake) + +set(FREETYPE_PKG "") +find_package(Freetype) +if(NOT FREETYPE_FOUND) + include(FREETYPE/FREETYPE.cmake) + set(FREETYPE_PKG "dep_FREETYPE") +endif() + include(OCCT/OCCT.cmake) -include(FREETYPE/FREETYPE.cmake) set(_dep_list dep_Boost dep_TBB + ${OPENSSL_PKG} ${CURL_PKG} dep_wxWidgets dep_Cereal @@ -265,8 +291,9 @@ set(_dep_list dep_OpenVDB dep_OpenCSG dep_CGAL - dep_OpenSSL dep_GLFW + dep_OCCT + ${FREETYPE_PKG} ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} @@ -281,9 +308,6 @@ else() #list(APPEND _dep_list "dep_libigl") endif() -list(APPEND _dep_list "dep_OCCT") -list(APPEND _dep_list "dep_FREETYPE") - add_custom_target(deps ALL DEPENDS ${_dep_list}) # Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands diff --git a/deps/OCCT/OCCT.cmake b/deps/OCCT/OCCT.cmake index 541412b1ca..651e40ec83 100644 --- a/deps/OCCT/OCCT.cmake +++ b/deps/OCCT/OCCT.cmake @@ -14,7 +14,7 @@ orcaslicer_add_cmake_project(OCCT #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch #DEPENDS dep_Boost - #DEPENDS dep_FREETYPE + DEPENDS ${FREETYPE_PKG} CMAKE_ARGS -DBUILD_LIBRARY_TYPE=${library_build_type} -DUSE_TK=OFF @@ -31,4 +31,4 @@ orcaslicer_add_cmake_project(OCCT -DBUILD_MODULE_Visualization=OFF ) -add_dependencies(dep_OCCT dep_FREETYPE) +# add_dependencies(dep_OCCT ${FREETYPE_PKG}) diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake index 50cf991a65..30b7196dda 100644 --- a/deps/wxWidgets/wxWidgets.cmake +++ b/deps/wxWidgets/wxWidgets.cmake @@ -31,7 +31,7 @@ orcaslicer_add_cmake_project( GIT_REPOSITORY "https://github.com/wxWidgets/wxWidgets" GIT_TAG ${_wx_git_tag} PATCH_COMMAND ${_patch_cmd} - DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} dep_TIFF dep_JPEG + DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${TIFF_PKG} ${JPEG_PKG} CMAKE_ARGS -DwxBUILD_PRECOMP=ON ${_wx_toolkit} @@ -62,4 +62,4 @@ orcaslicer_add_cmake_project( if (MSVC) add_debug_dep(dep_wxWidgets) -endif () \ No newline at end of file +endif () diff --git a/flatpak/.gitignore b/flatpak/.gitignore new file mode 100644 index 0000000000..1c882e3c63 --- /dev/null +++ b/flatpak/.gitignore @@ -0,0 +1,2 @@ +builddir +.flatpak-builder/* diff --git a/flatpak/README.md b/flatpak/README.md new file mode 100644 index 0000000000..4445f1e869 --- /dev/null +++ b/flatpak/README.md @@ -0,0 +1,3 @@ +# OrcaSlicer + +This is basically a copy of [com.bambulab.BambuStudio](https://github.com/flathub/com.bambulab.BambuStudio). As such, same rules apply here as does over there. diff --git a/flatpak/entrypoint b/flatpak/entrypoint new file mode 100644 index 0000000000..958d1cd130 --- /dev/null +++ b/flatpak/entrypoint @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +# Work-around https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/754 +grep -q org.freedesktop.Platform.GL.nvidia /.flatpak-info && export WEBKIT_DISABLE_DMABUF_RENDERER=1 + +# Work-around https://github.com/bambulab/BambuStudio/issues/3440 +export LC_ALL=C.UTF-8 + +if [ $BAMBU_STUDIO_DARK_THEME == true ]; then + export GTK_THEME='Adwaita:dark' + # echo "Message: $(date +%T): INFO: using dark theme variant" +fi + +exec /app/bin/orca-slicer "$@" & +$(/app/bin/set-dark-theme-variant.py) & diff --git a/flatpak/images/1.png b/flatpak/images/1.png new file mode 100644 index 0000000000..bf69169a02 Binary files /dev/null and b/flatpak/images/1.png differ diff --git a/flatpak/images/2.png b/flatpak/images/2.png new file mode 100644 index 0000000000..510b7564fb Binary files /dev/null and b/flatpak/images/2.png differ diff --git a/flatpak/io.github.softfever.OrcaSlicer.metainfo.xml b/flatpak/io.github.softfever.OrcaSlicer.metainfo.xml new file mode 100755 index 0000000000..1b2a60d743 --- /dev/null +++ b/flatpak/io.github.softfever.OrcaSlicer.metainfo.xml @@ -0,0 +1,48 @@ + + + io.github.softfever.OrcaSlicer + io.github.softfever.OrcaSlicer.desktop + + io.github.softfever.OrcaSlicer.desktop + + OrcaSlicer + + Get even more perfect prints! + SoftFever + https://github.com/SoftFever/OrcaSlicer + https://github.com/SoftFever/OrcaSlicer/wiki + https://github.com/SoftFever/OrcaSlicer/issues/ + https://ko-fi.com/SoftFever + 0BSD + AGPL-3.0-only + + + 768 + + + keyboard + pointing + + + + https://raw.githubusercontent.com/powpingdone/com.github.softfever.orcaslicer/master/images/1.png + A model ready to be sliced on a buildplate. + + + https://raw.githubusercontent.com/powpingdone/com.github.softfever.orcaslicer/master/images/2.png + + A calibration test ready to be printed out. + + + +

A 3D printer slicer forked from Bambu Studio, PrusaSlicer, and SuperSlicer with many more printer profiles, helpful calibration prints, and many more features to get your 3D printer printing perfectly!

+
+ + #009688 + + + https://github.com/SoftFever/OrcaSlicer/commit/951fc8e98a0d5ca0ccb254315646ce7889a44836 + + +
diff --git a/flatpak/io.github.softfever.OrcaSlicer.yml b/flatpak/io.github.softfever.OrcaSlicer.yml new file mode 100755 index 0000000000..f410c61054 --- /dev/null +++ b/flatpak/io.github.softfever.OrcaSlicer.yml @@ -0,0 +1,392 @@ +app-id: io.github.softfever.OrcaSlicer +runtime: org.gnome.Platform +runtime-version: "45" +sdk: org.gnome.Sdk +command: entrypoint +separate-locales: true +rename-icon: OrcaSlicer +finish-args: + - --share=ipc + - --socket=x11 + - --share=network + - --device=all + - --filesystem=home + - --filesystem=xdg-run/gvfs + - --filesystem=/run/media + - --filesystem=/media + # Allow OrcaSlicer to talk to other instances + - --talk-name=io.github.softfever.OrcaSlicer.InstanceCheck.* + - --system-talk-name=org.freedesktop.UDisks2 + # set dark theme + - --env=BAMBU_STUDIO_DARK_THEME=false + +modules: + + # JPEG codec for the liveview + - name: gst-plugins-good + buildsystem: meson + config-opts: + - -Dauto_features=disabled + - -Djpeg=enabled + - -Ddoc=disabled + - -Dexamples=disabled + - -Dtests=disabled + sources: + - type: archive + url: https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.22.8.tar.xz + sha256: e305b9f07f52743ca481da0a4e0c76c35efd60adaf1b0694eb3bb021e2137e39 + + # xprop, xlib is needed to manipulate the X11 window and set _GTK_THEME_VARIANT dark on X11 + # and paint the window dark when PRUSA_SLICER_DARK_THEME is true + # see: entrypoint & set-dark-theme-variant.py (originated from spotify client flatpak) + - name: xprop + sources: + - type: archive + url: http://mirrors.ircam.fr/pub/x.org/individual/app/xprop-1.2.5.tar.gz + sha256: b7bf6b6be6cf23e7966a153fc84d5901c14f01ee952fbd9d930aa48e2385d670 + - name: python-setuptools_scm + buildsystem: simple + build-commands: + - pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} . + sources: + - type: archive + url: https://files.pythonhosted.org/packages/57/38/930b1241372a9f266a7df2b184fb9d4f497c2cef2e016b014f82f541fe7c/setuptools_scm-6.0.1.tar.gz + sha256: d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92 + - name: python-xlib + buildsystem: simple + build-commands: + - pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} . + sources: + - type: archive + url: https://files.pythonhosted.org/packages/86/f5/8c0653e5bb54e0cbdfe27bf32d41f27bc4e12faa8742778c17f2a71be2c0/python-xlib-0.33.tar.gz + sha256: 55af7906a2c75ce6cb280a584776080602444f75815a7aff4d287bb2d7018b32 + + # For libOSMesa + - name: mesa + buildsystem: meson + config-opts: + - -Dosmesa=classic + - -Ddri-drivers=[] + - -Dgallium-drivers=[] + - -Dvulkan-drivers=[] + - -Dplatforms=[] + build-options: + arch: + aarch64: + config-opts: + - -Dlibunwind=disabled + cleanup: + - /share/drirc.d + - /include + - "*.a" + sources: + - type: archive + # url: https://archive.mesa3d.org/mesa-20.2.6.tar.xz + url: https://ftp.icm.edu.pl/pub/graphics/mesa/mesa-20.2.6.tar.xz + sha256: f12ca3c6c622f11cd79ad66b4220f04514fa96f795062fe92a37339ab19885db + + - name: glu + config-opts: + - --disable-static + sources: + - type: archive + url: https://ftp.osuosl.org/pub/blfs/conglomeration/glu/glu-9.0.2.tar.xz + sha256: 6e7280ff585c6a1d9dfcdf2fca489251634b3377bfc33c29e4002466a38d02d4 + cleanup: + - /include + - /lib/*.a + - /lib/*.la + - /lib/pkgconfig + + - name: kde-extra-cmake-modules + buildsystem: cmake + sources: + - type: git + url: https://github.com/KDE/extra-cmake-modules + tag: v5.249.0 + cleanup: + - / + + # - name: boost + # buildsystem: simple + # build-commands: + # - ./bootstrap.sh --prefix=/app --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time + # - ./b2 headers + # - ./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release cxxstd=17 --layout=system + # sources: + # - type: archive + # url: https://freefr.dl.sourceforge.net/project/boost/boost/1.78.0/boost_1_78_0.zip + # sha256: f22143b5528e081123c3c5ed437e92f648fe69748e95fa6e2bd41484e2986cc3 + # cleanup: + # - /include + # - /lib/cmake + + #- name: glfw + # buildsystem: cmake-ninja + # config-opts: + # - -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - -DBUILD_SHARED_LIBS:BOOL=ON + # - -DGLFW_USE_WAYLAND=OFF + # sources: + # - type: git + # url: https://github.com/glfw/glfw.git + # tag: 3.3.9 + # - type: patch + # path: patches/glfw-Don-t-crash-on-calls-to-focus-or-icon.patch + # cleanup: + # - /include + # - /lib/cmake + # - /lib/pkgconfig + + #- name: wxwidgets + # buildsystem: cmake-ninja + # config-opts: + # - -DwxBUILD_PRECOMP=ON + # - -DwxBUILD_TOOLKIT=gtk3 + # - -DwxBUILD_DEBUG_LEVEL=0 + # - -DwxBUILD_SAMPLES=OFF + # - -DwxBUILD_SHARED=OFF + # - -DwxUSE_MEDIACTRL=ON + # - -DwxUSE_DETECT_SM=OFF + # - -DwxUSE_UNICODE=ON + # - -DwxUSE_PRIVATE_FONTS=1 + # - -DwxUSE_OPENGL=ON + # - -DwxUSE_WEBREQUEST=ON + # - -DwxUSE_WEBVIEW=ON + # - -DwxUSE_REGEX=sys + # - -DwxUSE_LIBSDL=OFF + # - -DwxUSE_XTEST=OFF + # - -DwxUSE_STC=OFF + # - -DwxUSE_AUI=ON + # - -DwxUSE_LIBPNG=sys + # - -DwxUSE_ZLIB=sys + # - -DwxUSE_LIBJPEG=sys + # - -DwxUSE_LIBTIFF=sys + # - -DwxUSE_NANOSVG=OFF + # - -DwxUSE_EXPAT=sys + # sources: + # - type: archive + # url: https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.5/wxWidgets-3.1.5.tar.bz2 + # sha256: d7b3666de33aa5c10ea41bb9405c40326e1aeb74ee725bb88f90f1d50270a224 + # # https://github.com/bambulab/BambuStudio/issues/3279 + # - type: patch + # path: patches/disable-gstplayer.patch + # # https://github.com/wxWidgets/wxWidgets/issues/23630 + # - type: patch + # path: patches/0001-Add-support-for-building-WebView-with-libwebkit2gtk-.patch + # # wx-config/build fixes between 3.1.5 and 3.1.6 + # - type: patch + # path: patches/wxwidgets-not-found.patch + # #- type: patch + # # path: patches/wxwidgets-system-def.patch + # cleanup: + # - /include + # - /lib/cmake + + - name: orca_deps + buildsystem: simple + build-commands: + # start build + - | + mkdir deps/build && cd deps/build + cmake ../ \ + -DDEP_WX_GTK3=1 \ + -DDEP_DOWNLOAD_DIR=/run/build/orca_deps/external-packages \ + -DCMAKE_INSTALL_LIBDIR=/app/lib \ + -DCMAKE_INSTALL_PREFIX=/app + cmake --build . + + cleanup: + - /app/include + - "*.a" + - "*.la" + + sources: + # - + # Section bellow fetches all OrcaSlicer dependencies before the build process and stores them in external-packages/*/* . + # -DDEP_DOWNLOAD_DIR is set in the build process which has to match with dest. + # + # NOTE: The url, dest folder name and sha256 must match from OrcaSlicer's cmake scripts and folder names in OrcaSlicer/deps/ + # - + + # OrcaSlicer Source Archive + - type: dir + path: ../ + + # Blosc + - type: file + url: https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip + dest: external-packages/Blosc + sha256: dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3 + + # Cereal + - type: file + url: https://github.com/USCiLab/cereal/archive/refs/tags/v1.3.0.zip + dest: external-packages/Cereal + sha256: 71642cb54658e98c8f07a0f0d08bf9766f1c3771496936f6014169d3726d9657 + + # CGAL + - type: file + url: https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip + dest: external-packages/CGAL + sha256: d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0 + + # GMP + - type: file + url: https://github.com/SoftFever/OrcaSlicer_deps/releases/download/gmp-6.2.1/gmp-6.2.1.tar.bz2 + dest: external-packages/GMP + sha256: eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c + + # MPFR + - type: file + url: https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2 + dest: external-packages/MPFR + sha256: b9df93635b20e4089c29623b19420c4ac848a1b29df1cfd59f26cab0d2666aa0 + + # NLopt + - type: file + url: https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz + dest: external-packages/NLopt + sha256: c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae + + # OCCT + - type: file + url: https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip + dest: external-packages/OCCT + sha256: 28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc + + # OpenCSG + - type: file + url: https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip + dest: external-packages/OpenCSG + sha256: 51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5 + + # OpenEXR + - type: file + url: https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip + dest: external-packages/OpenEXR + sha256: 0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de + + # OpenVDB + - type: file + url: https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip + dest: external-packages/OpenVDB + sha256: f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81 + + # Qhull + - type: file + url: https://github.com/qhull/qhull/archive/v8.0.1.zip + dest: external-packages/Qhull + sha256: 5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b + + # TBB + - type: file + url: https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip + dest: external-packages/TBB + sha256: 83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47 + + # Patched TBB cmake to make build without lto flag + - type: file + dest: deps/TBB + path: patches/TBB/GNU.cmake + + # Apply TTB patches to fix linking failure. More info: https://github.com/prusa3d/PrusaSlicer/issues/8922 + - type: patch + path: patches/0001-Apply-TBB-LTO-patch.patch + + # Boost + - type: file + url: https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz + dest: external-packages/Boost + sha256: 4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95 + + # GLFW + - type: file + url: https://github.com/glfw/glfw/archive/refs/tags/3.3.7.zip + dest: external-packages/GLFW + sha256: e02d956935e5b9fb4abf90e2c2e07c9a0526d7eacae8ee5353484c69a2a76cd0 + + # wxWidgets + - type: git + url: https://github.com/wxWidgets/wxWidgets + dest: external-packages/wxWidgets + tag: v3.1.5 + + - name: OrcaSlicer + buildsystem: simple + build-commands: + - | + mkdir -p build && cd build + CXXFLAGS=-std=gnu++20 cmake ../ \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX=/app \ + -DCMAKE_INSTALL_LIBDIR=/app/lib \ + -DCMAKE_PREFIX_PATH=/run/build/OrcaSlicer/deps/build/destdir/usr/local \ + -DSLIC3R_PCH=OFF \ + -DSLIC3R_FHS=ON \ + -DSLIC3R_GTK=3 \ + -DSLIC3R_STATIC=ON \ + -DSLIC3R_BUILD_TESTS=OFF \ + -DSLIC3R_DESKTOP_INTEGRATION=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DBBL_RELEASE_TO_PUBLIC=1 + CXXFLAGS=-std=gnu++20 cmake --build . --target install -j$FLATPAK_BUILDER_N_JOBS + + cleanup: + - /include + + post-install: + + - | # Desktop Integration files + install -Dm644 -t /app/share/icons/hicolor/scalable/apps/ resources/images/OrcaSlicer.svg + install -Dm644 ${FLATPAK_ID}.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml + mv /app/share/applications/OrcaSlicer.desktop /app/share/applications/${FLATPAK_ID}.desktop + desktop-file-edit --set-key=Exec --set-value="entrypoint %U" /app/share/applications/${FLATPAK_ID}.desktop + install -Dm755 set-dark-theme-variant.py /app/bin + install -Dm755 entrypoint /app/bin + install -Dm755 umount /app/bin + + sources: + # - + # Section bellow fetches all OrcaSlicer dependencies before the build process and stores them in external-packages/*/* . + # -DDEP_DOWNLOAD_DIR is set in the build process which has to match with dest. + # + # NOTE: The url, dest folder name and sha256 must match from OrcaSlicer's cmake scripts and folder names in OrcaSlicer/deps/ + # - + + # OrcaSlicer Source Archive + - type: dir + path: ../ + + + - type: patch + path: patches/0001-Work-around-ClipperLib-union_-declaration-problem.patch + + # Use system deps instead of building them within BambuStudio + # https://github.com/hadess/BambuStudio/tree/wip/hadess/use-sysdeps , modified + - type: patch + path: patches/use-sysdeps.patch + + ## other patches to contrib + #- type: patch + # path: patches/0001-megapatch.patch + + # AppData metainfo for Gnome Software & Co. + - type: file + path: io.github.softfever.OrcaSlicer.metainfo.xml + + # script to set dark theme variant + - type: file + path: set-dark-theme-variant.py + + # start-up script + # README: workaround for the following issues, also enables dark theme variant: + # SEE: https://github.com/flathub/com.bambulab.BambuStudio/issues/27 + # SEE: https://github.com/flathub/com.bambulab.BambuStudio/issues/3 + # SEE: https://github.com/prusa3d/PrusaSlicer/issues/2365 + - type: file + path: entrypoint + + # umount wrapper used to redirect umount calls to udisk2 + - type: file + path: umount diff --git a/flatpak/local-build.sh b/flatpak/local-build.sh new file mode 100755 index 0000000000..cbf4945943 --- /dev/null +++ b/flatpak/local-build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +rm -rf _build ; mkdir _build +rm -rf _repo ; mkdir _repo + +BRANCH=test + +powerprofilesctl launch flatpak-builder --ccache --force-clean --default-branch=$BRANCH _build com.bambulab.BambuStudio.yml --repo=_repo diff --git a/flatpak/patches/0001-Add-support-for-building-WebView-with-libwebkit2gtk-.patch b/flatpak/patches/0001-Add-support-for-building-WebView-with-libwebkit2gtk-.patch new file mode 100644 index 0000000000..6bae9c168d --- /dev/null +++ b/flatpak/patches/0001-Add-support-for-building-WebView-with-libwebkit2gtk-.patch @@ -0,0 +1,167 @@ +From df46add1165314bce93d70e611ddc453561ffb60 Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Mon, 12 Jun 2023 20:28:35 -0400 +Subject: [PATCH] Add support for building WebView with libwebkit2gtk-4.1 + +libwebkit2gtk-4.1 has the same API as libwebkit2gtk-4.0, except that the +former links with libsoup-3.0 and the latter links with libsoup-2.4. + +Fixes #23630. + +(cherry picked from commit 1b8664426603376b68f8ca3c54de97ec630e5940) +--- + build/cmake/init.cmake | 10 ++- + build/cmake/modules/FindLIBSOUP.cmake | 14 +++- + build/cmake/modules/FindWEBKIT2.cmake | 5 +- + configure | 95 +++++++++++++++++++++++++-- + configure.in | 16 ++++- + src/gtk/webview_webkit2.cpp | 4 ++ + 6 files changed, 129 insertions(+), 15 deletions(-) + +diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake +index fc206cf2e03a..5d88a7e487cc 100644 +--- a/build/cmake/init.cmake ++++ b/build/cmake/init.cmake +@@ -453,15 +453,21 @@ if(wxUSE_GUI) + if(wxUSE_WEBVIEW) + if(WXGTK) + if(wxUSE_WEBVIEW_WEBKIT) +- find_package(LIBSOUP) ++ set(WEBKIT_LIBSOUP_VERSION 2.4) + if(WXGTK2) + find_package(WEBKIT 1.0) + elseif(WXGTK3) +- find_package(WEBKIT2) ++ find_package(WEBKIT2 4.1 QUIET) ++ if(WEBKIT2_FOUND) ++ set(WEBKIT_LIBSOUP_VERSION 3.0) ++ else() ++ find_package(WEBKIT2 4.0) ++ endif() + if(NOT WEBKIT2_FOUND) + find_package(WEBKIT 3.0) + endif() + endif() ++ find_package(LIBSOUP ${WEBKIT_LIBSOUP_VERSION}) + endif() + set(wxUSE_WEBVIEW_WEBKIT OFF) + set(wxUSE_WEBVIEW_WEBKIT2 OFF) +diff --git a/build/cmake/modules/FindLIBSOUP.cmake b/build/cmake/modules/FindLIBSOUP.cmake +index cbfba1cf9366..2433d141eaf7 100644 +--- a/build/cmake/modules/FindLIBSOUP.cmake ++++ b/build/cmake/modules/FindLIBSOUP.cmake +@@ -31,19 +31,27 @@ + # LibSoup does not provide an easy way to retrieve its version other than its + # .pc file, so we need to rely on PC_LIBSOUP_VERSION and REQUIRE the .pc file + # to be found. ++SET(LIBSOUP_VERSION 2.4) ++if(DEFINED LIBSOUP_FIND_VERSION) ++ SET(LIBSOUP_VERSION ${LIBSOUP_FIND_VERSION}) ++endif() ++ ++set(LIBSOUP_INCLUDE_DIRS LIBSOUP_INCLUDE_DIRS-NOTFOUND) ++set(LIBSOUP_LIBRARIES LIBSOUP_LIBRARIES-NOTFOUND) ++ + FIND_PACKAGE(PkgConfig) +-PKG_CHECK_MODULES(PC_LIBSOUP QUIET libsoup-2.4) ++PKG_CHECK_MODULES(PC_LIBSOUP QUIET libsoup-${LIBSOUP_VERSION}) + + if(PC_LIBSOUP_FOUND) + FIND_PATH(LIBSOUP_INCLUDE_DIRS + NAMES libsoup/soup.h + HINTS ${PC_LIBSOUP_INCLUDEDIR} + ${PC_LIBSOUP_INCLUDE_DIRS} +- PATH_SUFFIXES libsoup-2.4 ++ PATH_SUFFIXES libsoup-${LIBSOUP_VERSION} + ) + + FIND_LIBRARY(LIBSOUP_LIBRARIES +- NAMES soup-2.4 ++ NAMES soup-${LIBSOUP_VERSION} + HINTS ${PC_LIBSOUP_LIBDIR} + ${PC_LIBSOUP_LIBRARY_DIRS} + ) +diff --git a/build/cmake/modules/FindWEBKIT2.cmake b/build/cmake/modules/FindWEBKIT2.cmake +index 133e7a4563ea..e39077ac4a71 100644 +--- a/build/cmake/modules/FindWEBKIT2.cmake ++++ b/build/cmake/modules/FindWEBKIT2.cmake +@@ -5,7 +5,10 @@ + # WEBKIT2_LIBRARIES - List of libraries when using Webkit2. + # WEBKIT2_FOUND - True if Webkit2 found. + +-SET( WEBKIT2_VERSION 4.0) ++SET(WEBKIT2_VERSION 4.0) ++if(DEFINED WEBKIT2_FIND_VERSION) ++ SET(WEBKIT2_VERSION ${WEBKIT2_FIND_VERSION}) ++endif() + + set(WEBKIT2_INCLUDE_DIR WEBKIT2_INCLUDE_DIR-NOTFOUND) + set(WEBKIT2_LIBRARY WEBKIT2_LIBRARY-NOTFOUND) +diff --git a/configure.in b/configure.in +index 957be8dda34c..257c95a6009b 100644 +--- a/configure.in ++++ b/configure.in +@@ -7529,15 +7529,27 @@ if test "$wxUSE_WEBVIEW" = "yes"; then + if test "$wxUSE_GTK" = 1; then + if test "$WXGTK3" = 1; then + PKG_CHECK_MODULES([WEBKIT], +- [webkit2gtk-4.0], ++ [webkit2gtk-4.1], + [ + USE_WEBVIEW_WEBKIT2=1 + CXXFLAGS="$CXXFLAGS $WEBKIT_CFLAGS" + EXTRALIBS_WEBVIEW="$WEBKIT_LIBS" + ], + [ +- AC_MSG_WARN([webkit2gtk not found, falling back to webkitgtk]) ++ AC_MSG_WARN([webkit2gtk-4.1 not found, falling back to webkit2gtk-4.0]) + ]) ++ if test "$USE_WEBVIEW_WEBKIT2" = 0; then ++ PKG_CHECK_MODULES([WEBKIT], ++ [webkit2gtk-4.0], ++ [ ++ USE_WEBVIEW_WEBKIT2=1 ++ CXXFLAGS="$CXXFLAGS $WEBKIT_CFLAGS" ++ EXTRALIBS_WEBVIEW="$WEBKIT_LIBS" ++ ], ++ [ ++ AC_MSG_WARN([webkit2gtk-4.0 not found, falling back to webkitgtk]) ++ ]) ++ fi + fi + if test "$USE_WEBVIEW_WEBKIT2" = 0; then + webkitgtk=webkit-1.0 +diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp +index 191cbcf2cc18..87a9bd5ad3a8 100644 +--- a/src/gtk/webview_webkit2.cpp ++++ b/src/gtk/webview_webkit2.cpp +@@ -173,15 +173,18 @@ wxgtk_webview_webkit_load_failed(WebKitWebView *, + { + switch (error->code) + { ++#if SOUP_MAJOR_VERSION < 3 + case SOUP_STATUS_CANCELLED: + type = wxWEBVIEW_NAV_ERR_USER_CANCELLED; + break; + + case SOUP_STATUS_CANT_RESOLVE: ++#endif + case SOUP_STATUS_NOT_FOUND: + type = wxWEBVIEW_NAV_ERR_NOT_FOUND; + break; + ++#if SOUP_MAJOR_VERSION < 3 + case SOUP_STATUS_CANT_RESOLVE_PROXY: + case SOUP_STATUS_CANT_CONNECT: + case SOUP_STATUS_CANT_CONNECT_PROXY: +@@ -193,6 +196,7 @@ wxgtk_webview_webkit_load_failed(WebKitWebView *, + case SOUP_STATUS_MALFORMED: + type = wxWEBVIEW_NAV_ERR_REQUEST; + break; ++#endif + + case SOUP_STATUS_BAD_REQUEST: + type = wxWEBVIEW_NAV_ERR_REQUEST; +-- +2.43.0 + diff --git a/flatpak/patches/0001-Apply-TBB-LTO-patch.patch b/flatpak/patches/0001-Apply-TBB-LTO-patch.patch new file mode 100644 index 0000000000..9259b7ac4b --- /dev/null +++ b/flatpak/patches/0001-Apply-TBB-LTO-patch.patch @@ -0,0 +1,16 @@ +diff --git a/deps/TBB/TBB.cmake b/deps/TBB/TBB.cmake +index 6bf28ca2e..5bd158e30 100644 +--- a/deps/TBB/TBB.cmake ++++ b/deps/TBB/TBB.cmake +@@ -1,8 +1,10 @@ ++set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake cmake/compilers/GNU.cmake) ++ + orcaslicer_add_cmake_project( + TBB + URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip" + URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47 +- #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch ++ PATCH_COMMAND ${_patch_command} + CMAKE_ARGS + -DTBB_BUILD_SHARED=OFF + -DTBB_BUILD_TESTS=OFF diff --git a/flatpak/patches/0001-Work-around-ClipperLib-union_-declaration-problem.patch b/flatpak/patches/0001-Work-around-ClipperLib-union_-declaration-problem.patch new file mode 100644 index 0000000000..599053139f --- /dev/null +++ b/flatpak/patches/0001-Work-around-ClipperLib-union_-declaration-problem.patch @@ -0,0 +1,57 @@ +From 504e2a789502b76cf2553124a777e32e08bfa15c Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Wed, 13 Dec 2023 12:38:11 +0100 +Subject: [PATCH] Work-around ClipperLib/union_ declaration problem +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[116/471] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o +FAILED: src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o +/run/ccache/bin/c++ -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_NO_LIB -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_NO_LIB -DBOOST_IOSTREAMS_NO_LIB -DBOOST_LOCALE_NO_LIB -DBOOST_LOG_NO_LIB -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_NO_LIB -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DLIBNEST2D_GEOMETRIES_libslic3r -DLIBNEST2D_OPTIMIZER_nlopt -DLIBNEST2D_STATIC -DLIBNEST2D_THREADING_tbb -DOCC_CONVERT_SIGNALS -DOPENVDB_OPENEXR_STATICLIB -DOPENVDB_STATICLIB -DSLIC3R_GUI -DTBB_USE_CAPTURED_EXCEPTION=0 -DUNICODE -DUSE_TBB -DWXINTL_NO_GETTEXT_MACRO -D_UNICODE -DwxNO_UNSAFE_WXSTRING_CONV -DwxUSE_UNICODE -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/run/build/BambuStudio/src -I/run/build/BambuStudio/build/src/platform -I/run/build/BambuStudio/src/libslic3r -I/run/build/BambuStudio/build/src/libslic3r -I/run/build/BambuStudio/deps/build/destdir/usr/local/include/opencascade -I/run/build/BambuStudio/src/libnest2d/include -I/run/build/BambuStudio/src/miniz -I/run/build/BambuStudio/src/glu-libtess/include -I/run/build/BambuStudio/src/clipper2/Clipper2Lib/include -isystem /run/build/BambuStudio/src/eigen -isystem /run/build/BambuStudio/src/libigl -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include/boost-1_78 -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include/OpenEXR -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -fext-numeric-literals -Wall -Wno-reorder -O3 -DNDEBUG -std=gnu++17 -fPIC -fsigned-char -Werror=return-type -Wno-ignored-attributes -Wno-unknown-pragmas -DOPENVDB_ABI_VERSION_NUMBER=8 -MD -MT src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o -MF src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o.d -o src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o -c /run/build/BambuStudio/src/libslic3r/Format/svg.cpp +/run/build/BambuStudio/src/libslic3r/Format/svg.cpp:214:29: error: ‘Path’ is not a member of ‘Slic3r::ClipperLib’; did you mean ‘ClipperLib::Path’? + 214 | ClipperLib::Path pt_path; + | ^~~~ +In file included from /run/build/BambuStudio/src/libslic3r/Format/svg.cpp:22: +/run/build/BambuStudio/src/clipper/clipper.hpp:113:31: note: ‘ClipperLib::Path’ declared here + 113 | typedef std::vector Path; + | ^~~~ +/run/build/BambuStudio/src/libslic3r/Format/svg.cpp:240:28: error: ‘union_’ was not declared in this scope; did you mean ‘union’? + 240 | polygons = union_(polygons); + | ^~~~~~ + | union +--- + src/libslic3r/Format/svg.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/libslic3r/Format/svg.cpp b/src/libslic3r/Format/svg.cpp +index 4a96274b99e4..ff895402255d 100644 +--- a/src/libslic3r/Format/svg.cpp ++++ b/src/libslic3r/Format/svg.cpp +@@ -204,12 +204,14 @@ bool get_svg_profile(const char *path, std::vector &element_infos, + path_line_points.push_back(profile_line_points); + } + ++#if 0 + if (shape->fill.gradient == nullptr) { + double scale_size = 1e6; + std::vector>> new_path_line_points; + float stroke_width = shape->strokeWidth * scale_size; + Polygons polygons; + bool close_polygon = false; ++ + for (int i = 0; i < path_line_points.size(); ++i) { + ClipperLib::Path pt_path; + for (auto line_point : path_line_points[i]) { +@@ -253,7 +255,7 @@ bool get_svg_profile(const char *path, std::vector &element_infos, + + path_line_points = new_path_line_points; + } +- ++#endif + // generate all profile curves + std::vector wires; + int index = 0; +-- +2.43.0 + diff --git a/flatpak/patches/0001-megapatch.patch b/flatpak/patches/0001-megapatch.patch new file mode 100644 index 0000000000..45c1cec8dc --- /dev/null +++ b/flatpak/patches/0001-megapatch.patch @@ -0,0 +1,1711 @@ +diff --git a/src/libslic3r/Arrange.cpp b/src/libslic3r/Arrange.cpp +index 5b4aee507..2631b936e 100644 +--- a/src/libslic3r/Arrange.cpp ++++ b/src/libslic3r/Arrange.cpp +@@ -17,6 +17,7 @@ + #define BOOST_NO_CXX17_HDR_STRING_VIEW + #endif + ++#include + #include + #include + +diff --git a/src/libslic3r/Color.hpp b/src/libslic3r/Color.hpp +index a11174639..c13f0bd2c 100644 +--- a/src/libslic3r/Color.hpp ++++ b/src/libslic3r/Color.hpp +@@ -1,6 +1,8 @@ + #ifndef slic3r_Color_hpp_ + #define slic3r_Color_hpp_ + ++#include ++#include + #include + #include + +diff --git a/src/libslic3r/Format/bbs_3mf.hpp b/src/libslic3r/Format/bbs_3mf.hpp +index af6994b77..d2f46be3e 100644 +--- a/src/libslic3r/Format/bbs_3mf.hpp ++++ b/src/libslic3r/Format/bbs_3mf.hpp +@@ -8,6 +8,7 @@ + + namespace Slic3r { + class Model; ++class ModelObject; + struct ConfigSubstitutionContext; + class DynamicPrintConfig; + class Preset; +diff --git a/src/libslic3r/GCodeReader.cpp b/src/libslic3r/GCodeReader.cpp +index 1a660b4c1..116837828 100644 +--- a/src/libslic3r/GCodeReader.cpp ++++ b/src/libslic3r/GCodeReader.cpp +@@ -1,6 +1,7 @@ + #include "GCodeReader.hpp" + #include + #include ++#include + #include + #include + #include +diff --git a/src/libslic3r/Orient.cpp b/src/libslic3r/Orient.cpp +index a87694ad9..ce448fc7e 100644 +--- a/src/libslic3r/Orient.cpp ++++ b/src/libslic3r/Orient.cpp +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + #include + + #if defined(_MSC_VER) && defined(__clang__) +diff --git a/src/libslic3r/PNGReadWrite.cpp b/src/libslic3r/PNGReadWrite.cpp +index e4b7489b8..32b9a8f79 100644 +--- a/src/libslic3r/PNGReadWrite.cpp ++++ b/src/libslic3r/PNGReadWrite.cpp +@@ -5,6 +5,7 @@ + #include + #include + ++#include + #include + #include + +diff --git a/src/libslic3r/PNGReadWrite.hpp b/src/libslic3r/PNGReadWrite.hpp +index c76d7b168..9a27fed49 100644 +--- a/src/libslic3r/PNGReadWrite.hpp ++++ b/src/libslic3r/PNGReadWrite.hpp +@@ -1,6 +1,7 @@ + #ifndef PNGREAD_HPP + #define PNGREAD_HPP + ++#include + #include + #include + #include +diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp +index c9b1d5d98..0616ac5da 100644 +--- a/src/libslic3r/PerimeterGenerator.cpp ++++ b/src/libslic3r/PerimeterGenerator.cpp +@@ -23,6 +23,7 @@ + + #include + #include ++#include + + static const int overhang_sampling_number = 6; + static const double narrow_loop_length_threshold = 10; +diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp +index 7993f6a7b..da3a6da52 100644 +--- a/src/libslic3r/Print.cpp ++++ b/src/libslic3r/Print.cpp +@@ -40,6 +40,7 @@ + #include "Utils.hpp" + #include "PrintConfig.hpp" + #include "Model.hpp" ++#include "format.hpp" + #include + + #include +@@ -49,6 +50,10 @@ + #include + #include + #include ++#include ++ ++#include ++#include + + //BBS: add json support + #include "nlohmann/json.hpp" +@@ -1117,8 +1122,8 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* + return + // Test whether the last slicing plane is below or above the print volume. + { 0.5 * (layers[layers.size() - 2] + layers.back()) > this->config().printable_height + EPSILON ? +- format(_u8L("The object %1% exceeds the maximum build volume height."), print_object.model_object()->name) : +- format(_u8L("While the object %1% itself fits the build volume, its last layer exceeds the maximum build volume height."), print_object.model_object()->name) + ++ Slic3r::format(_u8L("The object %1% exceeds the maximum build volume height."), print_object.model_object()->name) : ++ Slic3r::format(_u8L("While the object %1% itself fits the build volume, its last layer exceeds the maximum build volume height."), print_object.model_object()->name) + + " " + _u8L("You might want to reduce the size of your model or change current print settings and retry.") }; + } + } +@@ -1401,7 +1406,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* + } + + StringObjectException except; +- except.string = format(L("Plate %d: %s does not support filament %s"), this->get_plate_index() + 1, L(bed_type_name), extruder_id + 1); ++ except.string = Slic3r::format(L("Plate %d: %s does not support filament %s"), this->get_plate_index() + 1, L(bed_type_name), extruder_id + 1); + except.string += "\n"; + except.type = STRING_EXCEPT_FILAMENT_NOT_MATCH_BED_TYPE; + except.params.push_back(std::to_string(this->get_plate_index() + 1)); +diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp +index 6664b28a3..76598cca2 100644 +--- a/src/libslic3r/PrintApply.cpp ++++ b/src/libslic3r/PrintApply.cpp +@@ -1,6 +1,7 @@ + #include "Model.hpp" + #include "Print.hpp" + ++#include + #include + + namespace Slic3r { +diff --git a/src/libslic3r/PrintBase.cpp b/src/libslic3r/PrintBase.cpp +index 5ba9306b5..25b282c7b 100644 +--- a/src/libslic3r/PrintBase.cpp ++++ b/src/libslic3r/PrintBase.cpp +@@ -3,6 +3,7 @@ + + #include + #include ++#include + + #include "I18N.hpp" + +diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp +index 45a7f926e..0e24a821f 100644 +--- a/src/libslic3r/PrintConfig.cpp ++++ b/src/libslic3r/PrintConfig.cpp +@@ -20,6 +20,7 @@ + ///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher + ///|/ + #include "PrintConfig.hpp" ++#include "ClipperUtils.hpp" + #include "Config.hpp" + #include "I18N.hpp" + +diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp +index 0dabd5ea0..8eada8cc4 100644 +--- a/src/libslic3r/PrintObject.cpp ++++ b/src/libslic3r/PrintObject.cpp +@@ -29,6 +29,7 @@ + #include "Fill/FillLightning.hpp" + #include "Format/STL.hpp" + #include "TreeSupport.hpp" ++#include "format.hpp" + + #include + #include +@@ -659,7 +660,7 @@ void PrintObject::generate_support_material() + {SharpTail,L("floating regions")}, + {Cantilever,L("floating cantilever")}, + {LargeOverhang,L("large overhangs")} }; +- std::string warning_message = format(L("It seems object %s has %s. Please re-orient the object or enable support generation."), ++ std::string warning_message = Slic3r::format(L("It seems object %s has %s. Please re-orient the object or enable support generation."), + this->model_object()->name, reasons[sntype]); + this->active_step_add_warning(PrintStateBase::WarningLevel::NON_CRITICAL, warning_message, PrintStateBase::SlicingNeedSupportOn); + } +diff --git a/src/libslic3r/ProjectTask.cpp b/src/libslic3r/ProjectTask.cpp +index 622a20a85..fe5fd36a4 100644 +--- a/src/libslic3r/ProjectTask.cpp ++++ b/src/libslic3r/ProjectTask.cpp +@@ -9,6 +9,7 @@ + #include + + #include ++#include + #include + #include + #include +diff --git a/src/libslic3r/SVG.cpp b/src/libslic3r/SVG.cpp +index 6377f405e..9ccddcd4f 100644 +--- a/src/libslic3r/SVG.cpp ++++ b/src/libslic3r/SVG.cpp +@@ -1,6 +1,7 @@ + #include "SVG.hpp" + #include + ++#include + #include + + namespace Slic3r { +diff --git a/src/libslic3r/Shape/TextShape.cpp b/src/libslic3r/Shape/TextShape.cpp +index e740905ce..63c5f96df 100644 +--- a/src/libslic3r/Shape/TextShape.cpp ++++ b/src/libslic3r/Shape/TextShape.cpp +@@ -28,6 +28,8 @@ + #include "BRepPrimAPI_MakePrism.hxx" + #include "Font_FontMgr.hxx" + ++#include ++ + namespace Slic3r { + + static std::map g_occt_fonts_maps; //map +diff --git a/src/libslic3r/Shape/TextShape.hpp b/src/libslic3r/Shape/TextShape.hpp +index 75c93bc64..d093c2da4 100644 +--- a/src/libslic3r/Shape/TextShape.hpp ++++ b/src/libslic3r/Shape/TextShape.hpp +@@ -1,6 +1,8 @@ + #ifndef slic3r_Text_Shape_hpp_ + #define slic3r_Text_Shape_hpp_ + ++#include "libslic3r/TriangleMesh.hpp" ++ + namespace Slic3r { + class TriangleMesh; + +@@ -17,4 +19,4 @@ std::map get_occt_fonts_maps(); + + }; // namespace Slic3r + +-#endif // slic3r_Text_Shape_hpp_ +\ No newline at end of file ++#endif // slic3r_Text_Shape_hpp_ +diff --git a/src/libslic3r/Support/SupportCommon.cpp b/src/libslic3r/Support/SupportCommon.cpp +index 9b2610a4b..c494507c7 100644 +--- a/src/libslic3r/Support/SupportCommon.cpp ++++ b/src/libslic3r/Support/SupportCommon.cpp +@@ -11,9 +11,11 @@ + #include "../MutablePolygon.hpp" + #include "../Geometry.hpp" + #include "../Point.hpp" ++#include "clipper/clipper_z.hpp" + + #include + #include ++#include + + #include + +diff --git a/src/libslic3r/TreeSupport.cpp b/src/libslic3r/TreeSupport.cpp +index 5b3ec7049..71080cf20 100644 +--- a/src/libslic3r/TreeSupport.cpp ++++ b/src/libslic3r/TreeSupport.cpp +@@ -12,6 +12,10 @@ + #include "I18N.hpp" + #include + ++#include ++#include ++#include ++ + #define _L(s) Slic3r::I18N::translate(s) + + #define USE_PLAN_LAYER_HEIGHTS 1 +diff --git a/src/libslic3r/TriangleSelector.cpp b/src/libslic3r/TriangleSelector.cpp +index 6499215b2..e78dd878d 100644 +--- a/src/libslic3r/TriangleSelector.cpp ++++ b/src/libslic3r/TriangleSelector.cpp +@@ -2,6 +2,7 @@ + #include "Model.hpp" + + #include ++#include + + #ifndef NDEBUG + // #define EXPENSIVE_DEBUG_CHECKS +diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp +index 1a5422b7b..dae1c13e5 100644 +--- a/src/libslic3r/utils.cpp ++++ b/src/libslic3r/utils.cpp +@@ -13,6 +13,7 @@ + #include + #include + ++#include "format.hpp" + #include "Platform.hpp" + #include "Time.hpp" + #include "libslic3r.h" +@@ -1510,7 +1511,7 @@ bool bbl_calc_md5(std::string &filename, std::string &md5_out) + // SoftFever: copy directory recursively + void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target) + { +- BOOST_LOG_TRIVIAL(info) << format("copy_directory_recursively %1% -> %2%", source, target); ++ BOOST_LOG_TRIVIAL(info) << Slic3r::format("copy_directory_recursively %1% -> %2%", source, target); + std::string error_message; + + if (boost::filesystem::exists(target)) +@@ -1530,7 +1531,7 @@ void copy_directory_recursively(const boost::filesystem::path &source, const boo + CopyFileResult cfr = copy_file(source_file, target_file, error_message, false); + if (cfr != CopyFileResult::SUCCESS) { + BOOST_LOG_TRIVIAL(error) << "Copying failed(" << cfr << "): " << error_message; +- throw Slic3r::CriticalException(format( ++ throw Slic3r::CriticalException(Slic3r::format( + ("Copying directory %1% to %2% failed: %3%"), + source, target, error_message)); + } +diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp +index 8e11493b3..ddbf120b2 100644 +--- a/src/slic3r/GUI/AMSMaterialsSetting.cpp ++++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp +@@ -4,6 +4,8 @@ + #include "GUI_App.hpp" + #include "libslic3r/Preset.hpp" + #include "I18N.hpp" ++#include ++#include + #include + #include "CalibUtils.hpp" + +diff --git a/src/slic3r/GUI/AMSMaterialsSetting.hpp b/src/slic3r/GUI/AMSMaterialsSetting.hpp +index 065198863..c66052a07 100644 +--- a/src/slic3r/GUI/AMSMaterialsSetting.hpp ++++ b/src/slic3r/GUI/AMSMaterialsSetting.hpp +@@ -5,6 +5,7 @@ + #include "wxExtensions.hpp" + #include "GUI_Utils.hpp" + #include "DeviceManager.hpp" ++#include "wx/colourdata.h" + #include "wx/clrpicker.h" + #include "Widgets/RadioBox.hpp" + #include "Widgets/Button.hpp" +diff --git a/src/slic3r/GUI/Auxiliary.cpp b/src/slic3r/GUI/Auxiliary.cpp +index 623d39736..c28457ea0 100644 +--- a/src/slic3r/GUI/Auxiliary.cpp ++++ b/src/slic3r/GUI/Auxiliary.cpp +@@ -21,6 +21,8 @@ + #include + #include + ++#include ++ + #include "wxExtensions.hpp" + #include "GUI_App.hpp" + #include "GUI_ObjectList.hpp" +diff --git a/src/slic3r/GUI/AuxiliaryDataViewModel.cpp b/src/slic3r/GUI/AuxiliaryDataViewModel.cpp +index 212566338..50368b854 100644 +--- a/src/slic3r/GUI/AuxiliaryDataViewModel.cpp ++++ b/src/slic3r/GUI/AuxiliaryDataViewModel.cpp +@@ -3,6 +3,11 @@ + #include "libslic3r/Model.hpp" + #include "libslic3r/Format/bbs_3mf.hpp" + ++ ++#include ++ ++#include ++ + const static std::array s_default_folders = { + _L("Model Pictures"), + _L("Bill of Materials"), +diff --git a/src/slic3r/GUI/AuxiliaryDataViewModel.hpp b/src/slic3r/GUI/AuxiliaryDataViewModel.hpp +index 109b74a25..76c046c5e 100644 +--- a/src/slic3r/GUI/AuxiliaryDataViewModel.hpp ++++ b/src/slic3r/GUI/AuxiliaryDataViewModel.hpp +@@ -8,7 +8,7 @@ + + #include "I18N.hpp" + +-#include ++#include + + class AuxiliaryModelNode; + WX_DEFINE_ARRAY_PTR(AuxiliaryModelNode*, AuxiliaryModelNodePtrArray); +diff --git a/src/slic3r/GUI/AuxiliaryDialog.cpp b/src/slic3r/GUI/AuxiliaryDialog.cpp +index 5fadbf7ff..0fce2cc83 100644 +--- a/src/slic3r/GUI/AuxiliaryDialog.cpp ++++ b/src/slic3r/GUI/AuxiliaryDialog.cpp +@@ -4,6 +4,8 @@ + + #include "libslic3r/Utils.hpp" + ++#include ++ + namespace pt = boost::property_tree; + typedef pt::ptree JSON; + +@@ -33,4 +35,4 @@ void AuxiliaryDialog::on_dpi_changed(const wxRect& suggested_rect) + } + + } // namespace GUI +-} // namespace Slic3r +\ No newline at end of file ++} // namespace Slic3r +diff --git a/src/slic3r/GUI/BBLStatusBar.hpp b/src/slic3r/GUI/BBLStatusBar.hpp +index 02a3af3ca..e643a9b53 100644 +--- a/src/slic3r/GUI/BBLStatusBar.hpp ++++ b/src/slic3r/GUI/BBLStatusBar.hpp +@@ -2,6 +2,7 @@ + #define BBLSTATUSBAR_HPP + + #include ++#include + #include + + #include +diff --git a/src/slic3r/GUI/BBLStatusBarSend.cpp b/src/slic3r/GUI/BBLStatusBarSend.cpp +index 35ebd0f1b..3976ae7bb 100644 +--- a/src/slic3r/GUI/BBLStatusBarSend.cpp ++++ b/src/slic3r/GUI/BBLStatusBarSend.cpp +@@ -12,7 +12,7 @@ + #include "I18N.hpp" + + #include +- ++#include + + namespace Slic3r { + +diff --git a/src/slic3r/GUI/BBLTopbar.cpp b/src/slic3r/GUI/BBLTopbar.cpp +index 7e33b8cd8..ee7c380a6 100644 +--- a/src/slic3r/GUI/BBLTopbar.cpp ++++ b/src/slic3r/GUI/BBLTopbar.cpp +@@ -1,6 +1,7 @@ + #include "BBLTopbar.hpp" + #include "wx/artprov.h" + #include "wx/aui/framemanager.h" ++#include "wx/display.h" + #include "I18N.hpp" + #include "GUI_App.hpp" + #include "GUI.hpp" +@@ -10,6 +11,8 @@ + #include "WebViewDialog.hpp" + #include "PartPlate.hpp" + ++#include ++ + #define TOPBAR_ICON_SIZE 18 + #define TOPBAR_TITLE_WIDTH 300 + +diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp +index 3c97fdf3d..df52d84b1 100644 +--- a/src/slic3r/GUI/BindDialog.cpp ++++ b/src/slic3r/GUI/BindDialog.cpp +@@ -5,6 +5,7 @@ + #include + #include + #include "wx/evtloop.h" ++#include + #include + #include + #include +diff --git a/src/slic3r/GUI/BitmapCache.cpp b/src/slic3r/GUI/BitmapCache.cpp +index 318160f11..d5facd3f3 100644 +--- a/src/slic3r/GUI/BitmapCache.cpp ++++ b/src/slic3r/GUI/BitmapCache.cpp +@@ -5,6 +5,7 @@ + #include "GUI.hpp" + #include "GUI_Utils.hpp" + ++#include + #include + + #ifdef __WXGTK2__ +diff --git a/src/slic3r/GUI/CameraPopup.hpp b/src/slic3r/GUI/CameraPopup.hpp +index a256f317b..8135f41fa 100644 +--- a/src/slic3r/GUI/CameraPopup.hpp ++++ b/src/slic3r/GUI/CameraPopup.hpp +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/src/slic3r/GUI/CreatePresetsDialog.cpp b/src/slic3r/GUI/CreatePresetsDialog.cpp +index 628af9deb..a5b363568 100644 +--- a/src/slic3r/GUI/CreatePresetsDialog.cpp ++++ b/src/slic3r/GUI/CreatePresetsDialog.cpp +@@ -6,6 +6,8 @@ + #include + #include + #include ++#include ++#include + #include "libslic3r/PresetBundle.hpp" + #include "I18N.hpp" + #include "GUI_App.hpp" +diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp +index 1e142a97c..1c3c5881b 100644 +--- a/src/slic3r/GUI/DeviceManager.hpp ++++ b/src/slic3r/GUI/DeviceManager.hpp +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + #include + #include + #include "nlohmann/json.hpp" +diff --git a/src/slic3r/GUI/ExtrusionCalibration.cpp b/src/slic3r/GUI/ExtrusionCalibration.cpp +index f4c17b5b7..8d5a939cb 100644 +--- a/src/slic3r/GUI/ExtrusionCalibration.cpp ++++ b/src/slic3r/GUI/ExtrusionCalibration.cpp +@@ -3,6 +3,7 @@ + #include "MsgDialog.hpp" + #include "libslic3r/Preset.hpp" + #include "I18N.hpp" ++#include + #include + + namespace Slic3r { namespace GUI { +diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp +index 96e296322..cec2f1e40 100644 +--- a/src/slic3r/GUI/GCodeViewer.cpp ++++ b/src/slic3r/GUI/GCodeViewer.cpp +@@ -2,6 +2,7 @@ + #include "GCodeViewer.hpp" + + #include "libslic3r/BuildVolume.hpp" ++#include "libslic3r/ClipperUtils.hpp" + #include "libslic3r/Print.hpp" + #include "libslic3r/Geometry.hpp" + #include "libslic3r/Model.hpp" +diff --git a/src/slic3r/GUI/GLTexture.cpp b/src/slic3r/GUI/GLTexture.cpp +index dba352349..fcd9045ce 100644 +--- a/src/slic3r/GUI/GLTexture.cpp ++++ b/src/slic3r/GUI/GLTexture.cpp +@@ -33,6 +33,7 @@ + + #include "libslic3r/Utils.hpp" + #include "GUI_App.hpp" ++#include + #include + namespace Slic3r { + namespace GUI { +diff --git a/src/slic3r/GUI/GLTexture.hpp b/src/slic3r/GUI/GLTexture.hpp +index 9af4f8a87..41068a9fb 100644 +--- a/src/slic3r/GUI/GLTexture.hpp ++++ b/src/slic3r/GUI/GLTexture.hpp +@@ -6,6 +6,9 @@ + #include + #include + ++#include ++#include ++ + class wxImage; + + namespace Slic3r { +diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp +index 42c19513c..41e8a2c30 100644 +--- a/src/slic3r/GUI/GUI_App.cpp ++++ b/src/slic3r/GUI/GUI_App.cpp +@@ -28,6 +28,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp +index bd7868dbd..893874ab3 100644 +--- a/src/slic3r/GUI/GUI_App.hpp ++++ b/src/slic3r/GUI/GUI_App.hpp +@@ -1,6 +1,13 @@ + #ifndef slic3r_GUI_App_hpp_ + #define slic3r_GUI_App_hpp_ + ++#include ++#include ++#include ++#include ++#include ++#include ++ + #include + #include + #include "ImGuiWrapper.hpp" +@@ -17,13 +24,6 @@ + #include "slic3r/GUI/HttpServer.hpp" + #include "../Utils/PrintHost.hpp" + +-#include +-#include +-#include +-#include +-#include +-#include +- + #include + #include + +diff --git a/src/slic3r/GUI/GUI_Colors.hpp b/src/slic3r/GUI/GUI_Colors.hpp +index 0395e997c..4da03360b 100644 +--- a/src/slic3r/GUI/GUI_Colors.hpp ++++ b/src/slic3r/GUI/GUI_Colors.hpp +@@ -3,6 +3,7 @@ + + #include "imgui/imgui.h" + #include "libslic3r/Color.hpp" ++#include + + enum RenderCol_ { + RenderCol_3D_Background = 0, +diff --git a/src/slic3r/GUI/GUI_ObjectTable.cpp b/src/slic3r/GUI/GUI_ObjectTable.cpp +index eda7c15b7..199be2062 100644 +--- a/src/slic3r/GUI/GUI_ObjectTable.cpp ++++ b/src/slic3r/GUI/GUI_ObjectTable.cpp +@@ -1,4 +1,5 @@ + #include "wx/clipbrd.h" ++#include "wx/display.h" + + #include "SelectMachine.hpp" + #include "I18N.hpp" +diff --git a/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp b/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp +index 9e7aa0520..4ed37d5ae 100644 +--- a/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp ++++ b/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp +@@ -15,6 +15,8 @@ + + #include + ++#include ++ + #define ENABLE_FIXED_GRABBER 1 + + class wxWindow; +diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +index ccf3956f3..0471d0235 100644 +--- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp ++++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +@@ -15,9 +15,9 @@ + #include "slic3r/GUI/GUI.hpp" + #include "slic3r/Utils/UndoRedo.hpp" + +- + #include + ++#include + + namespace Slic3r::GUI { + +diff --git a/src/slic3r/GUI/Gizmos/GLGizmoText.cpp b/src/slic3r/GUI/Gizmos/GLGizmoText.cpp +index e7793c017..7034b0eb2 100644 +--- a/src/slic3r/GUI/Gizmos/GLGizmoText.cpp ++++ b/src/slic3r/GUI/Gizmos/GLGizmoText.cpp +@@ -6,7 +6,7 @@ + #include "slic3r/GUI/ImGuiWrapper.hpp" + #include "slic3r/GUI/GUI_ObjectList.hpp" + #include "slic3r/GUI/Plater.hpp" +- ++#include "libslic3r/ClipperUtils.hpp" + #include "libslic3r/Geometry/ConvexHull.hpp" + #include "libslic3r/Model.hpp" + +@@ -14,6 +14,8 @@ + + #include + ++#include ++ + #include + + #ifndef IMGUI_DEFINE_MATH_OPERATORS +diff --git a/src/slic3r/GUI/HMS.cpp b/src/slic3r/GUI/HMS.cpp +index 2f9ad630d..3e87d1fd2 100644 +--- a/src/slic3r/GUI/HMS.cpp ++++ b/src/slic3r/GUI/HMS.cpp +@@ -1,5 +1,6 @@ + #include "HMS.hpp" + ++#include + + + namespace Slic3r { +diff --git a/src/slic3r/GUI/HttpServer.hpp b/src/slic3r/GUI/HttpServer.hpp +index 2a6a980ec..c545ab9b2 100644 +--- a/src/slic3r/GUI/HttpServer.hpp ++++ b/src/slic3r/GUI/HttpServer.hpp +@@ -1,6 +1,7 @@ + #ifndef slic3r_Http_App_hpp_ + #define slic3r_Http_App_hpp_ + ++#include + #include + #include + +@@ -12,7 +13,6 @@ + #include + #include + +-using namespace boost; + using namespace boost::system; + using namespace boost::asio; + +@@ -73,21 +73,21 @@ public: + + class session + { +- asio::streambuf buff; ++ boost::asio::streambuf buff; + http_headers headers; + + static void read_body(std::shared_ptr pThis) + { + int nbuffer = 1000; + std::shared_ptr> bufptr = std::make_shared>(nbuffer); +- asio::async_read(pThis->socket, boost::asio::buffer(*bufptr, nbuffer), [pThis](const boost::beast::error_code& e, std::size_t s) ++ boost::asio::async_read(pThis->socket, boost::asio::buffer(*bufptr, nbuffer), [pThis](const boost::beast::error_code& e, std::size_t s) + { + }); + } + + static void read_next_line(std::shared_ptr pThis) + { +- asio::async_read_until(pThis->socket, pThis->buff, '\r', [pThis](const boost::beast::error_code& e, std::size_t s) ++ boost::asio::async_read_until(pThis->socket, pThis->buff, '\r', [pThis](const boost::beast::error_code& e, std::size_t s) + { + std::string line, ignore; + std::istream stream{ &pThis->buff }; +@@ -100,7 +100,7 @@ class session + if (pThis->headers.content_length() == 0) + { + std::shared_ptr str = std::make_shared(pThis->headers.get_response()); +- asio::async_write(pThis->socket, boost::asio::buffer(str->c_str(), str->length()), [pThis, str](const boost::beast::error_code& e, std::size_t s) ++ boost::asio::async_write(pThis->socket, boost::asio::buffer(str->c_str(), str->length()), [pThis, str](const boost::beast::error_code& e, std::size_t s) + { + std::cout << "done" << std::endl; + }); +@@ -119,7 +119,7 @@ class session + + static void read_first_line(std::shared_ptr pThis) + { +- asio::async_read_until(pThis->socket, pThis->buff, '\r', [pThis](const boost::beast::error_code& e, std::size_t s) ++ boost::asio::async_read_until(pThis->socket, pThis->buff, '\r', [pThis](const boost::beast::error_code& e, std::size_t s) + { + std::string line, ignore; + std::istream stream{ &pThis->buff }; +diff --git a/src/slic3r/GUI/IMSlider.hpp b/src/slic3r/GUI/IMSlider.hpp +index 2bf700787..1b700d0d0 100644 +--- a/src/slic3r/GUI/IMSlider.hpp ++++ b/src/slic3r/GUI/IMSlider.hpp +@@ -3,6 +3,7 @@ + + #include "TickCode.hpp" + #include ++#include + + #include + +diff --git a/src/slic3r/GUI/IconManager.cpp b/src/slic3r/GUI/IconManager.cpp +index 896c5203f..f302f6ceb 100644 +--- a/src/slic3r/GUI/IconManager.cpp ++++ b/src/slic3r/GUI/IconManager.cpp +@@ -1,6 +1,9 @@ + #include "IconManager.hpp" + #include ++#include + #include ++#include ++#include + #include "nanosvg/nanosvg.h" + #include "nanosvg/nanosvgrast.h" + #include "libslic3r/Utils.hpp" // ScopeGuard +diff --git a/src/slic3r/GUI/ImGuiWrapper.hpp b/src/slic3r/GUI/ImGuiWrapper.hpp +index 07ca50990..c188f61cc 100644 +--- a/src/slic3r/GUI/ImGuiWrapper.hpp ++++ b/src/slic3r/GUI/ImGuiWrapper.hpp +@@ -7,6 +7,7 @@ + + #include + #include ++#include + + #include + +diff --git a/src/slic3r/GUI/ImageGrid.cpp b/src/slic3r/GUI/ImageGrid.cpp +index 2ab6748f4..770d46ec0 100644 +--- a/src/slic3r/GUI/ImageGrid.cpp ++++ b/src/slic3r/GUI/ImageGrid.cpp +@@ -8,6 +8,8 @@ + + #include + ++#include ++ + wxDEFINE_EVENT(EVT_ITEM_ACTION, wxCommandEvent); + + BEGIN_EVENT_TABLE(Slic3r::GUI::ImageGrid, wxPanel) +diff --git a/src/slic3r/GUI/ImageGrid.h b/src/slic3r/GUI/ImageGrid.h +index 34e016c06..4bc17e4b6 100644 +--- a/src/slic3r/GUI/ImageGrid.h ++++ b/src/slic3r/GUI/ImageGrid.h +@@ -9,6 +9,7 @@ + #define ImageGrid_h + + #include ++#include + #include + #include + +diff --git a/src/slic3r/GUI/Jobs/Job.hpp b/src/slic3r/GUI/Jobs/Job.hpp +index 6c251cac3..55c6196c3 100644 +--- a/src/slic3r/GUI/Jobs/Job.hpp ++++ b/src/slic3r/GUI/Jobs/Job.hpp +@@ -9,6 +9,8 @@ + #include + #include + ++#include ++ + #include "libslic3r/libslic3r.h" + #include "ProgressIndicator.hpp" + +diff --git a/src/slic3r/GUI/Jobs/PrintJob.hpp b/src/slic3r/GUI/Jobs/PrintJob.hpp +index e703f86fb..7806a8623 100644 +--- a/src/slic3r/GUI/Jobs/PrintJob.hpp ++++ b/src/slic3r/GUI/Jobs/PrintJob.hpp +@@ -3,6 +3,7 @@ + + #include + #include ++#include "libslic3r/PrintConfig.hpp" + #include "Job.hpp" + + namespace fs = boost::filesystem; +diff --git a/src/slic3r/GUI/Jobs/ProgressIndicator.hpp b/src/slic3r/GUI/Jobs/ProgressIndicator.hpp +index 4aa5757d2..4f7ec5d9f 100644 +--- a/src/slic3r/GUI/Jobs/ProgressIndicator.hpp ++++ b/src/slic3r/GUI/Jobs/ProgressIndicator.hpp +@@ -7,6 +7,7 @@ + + #include + #include ++#include + + namespace Slic3r { + +diff --git a/src/slic3r/GUI/Jobs/SLAImportJob.hpp b/src/slic3r/GUI/Jobs/SLAImportJob.hpp +index bb620c982..627452333 100644 +--- a/src/slic3r/GUI/Jobs/SLAImportJob.hpp ++++ b/src/slic3r/GUI/Jobs/SLAImportJob.hpp +@@ -6,6 +6,7 @@ + #define SLAIMPORTJOB_HPP + + #include "Job.hpp" ++#include "libslic3r/Point.hpp" + + namespace Slic3r { namespace GUI { + +diff --git a/src/slic3r/GUI/Jobs/UpgradeNetworkJob.hpp b/src/slic3r/GUI/Jobs/UpgradeNetworkJob.hpp +index 0af597d0f..5a531065f 100644 +--- a/src/slic3r/GUI/Jobs/UpgradeNetworkJob.hpp ++++ b/src/slic3r/GUI/Jobs/UpgradeNetworkJob.hpp +@@ -1,8 +1,11 @@ + #ifndef __UpgradeNetworkJob_HPP__ + #define __UpgradeNetworkJob_HPP__ + ++#include ++#include + #include + #include "Job.hpp" ++#include + + namespace fs = boost::filesystem; + +diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp +index 3b70614da..1dda42dbe 100644 +--- a/src/slic3r/GUI/MainFrame.cpp ++++ b/src/slic3r/GUI/MainFrame.cpp +@@ -27,6 +27,7 @@ + + #include + #include ++#include + + #include "libslic3r/Print.hpp" + #include "libslic3r/Polygon.hpp" +diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp +index 14f11f1a2..9ef81a8b0 100644 +--- a/src/slic3r/GUI/MainFrame.hpp ++++ b/src/slic3r/GUI/MainFrame.hpp +@@ -26,6 +26,8 @@ + #include "Widgets/SideButton.hpp" + #include "Widgets/SideMenuPopup.hpp" + ++#include ++ + // BBS + #include "BBLTopbar.hpp" + #include "PrinterWebView.hpp" +diff --git a/src/slic3r/GUI/MarkdownTip.cpp b/src/slic3r/GUI/MarkdownTip.cpp +index 63eafd361..7ffeae9e3 100644 +--- a/src/slic3r/GUI/MarkdownTip.cpp ++++ b/src/slic3r/GUI/MarkdownTip.cpp +@@ -7,6 +7,8 @@ + #include "libslic3r/Utils.hpp" + #include "I18N.hpp" + ++#include ++ + namespace fs = boost::filesystem; + + namespace Slic3r { namespace GUI { +diff --git a/src/slic3r/GUI/MediaFilePanel.h b/src/slic3r/GUI/MediaFilePanel.h +index 8b9d84ae4..1ae5df791 100644 +--- a/src/slic3r/GUI/MediaFilePanel.h ++++ b/src/slic3r/GUI/MediaFilePanel.h +@@ -10,7 +10,7 @@ + + #include "GUI_Utils.hpp" + #include "wxExtensions.hpp" +- ++#include + #include + + class Button; +diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp +index 7fb8392f6..b5ab46647 100644 +--- a/src/slic3r/GUI/MediaPlayCtrl.cpp ++++ b/src/slic3r/GUI/MediaPlayCtrl.cpp +@@ -8,6 +8,9 @@ + #include "MsgDialog.hpp" + #include "DownloadProgressDialog.hpp" + ++#include ++#include ++#include + #include + #undef pid_t + #include +@@ -18,6 +21,8 @@ + #include + #endif + ++#include ++ + namespace Slic3r { + namespace GUI { + +diff --git a/src/slic3r/GUI/MonitorPage.hpp b/src/slic3r/GUI/MonitorPage.hpp +index 9cb05eecc..3efaccda3 100644 +--- a/src/slic3r/GUI/MonitorPage.hpp ++++ b/src/slic3r/GUI/MonitorPage.hpp +@@ -2,6 +2,7 @@ + #define slic3r_MonitorPage_hpp_ + + #include ++#include + + namespace Slic3r { + namespace GUI { +diff --git a/src/slic3r/GUI/NetworkTestDialog.cpp b/src/slic3r/GUI/NetworkTestDialog.cpp +index 195c0d55b..69be995e6 100644 +--- a/src/slic3r/GUI/NetworkTestDialog.cpp ++++ b/src/slic3r/GUI/NetworkTestDialog.cpp +@@ -8,7 +8,7 @@ + #include "slic3r/Utils/Http.hpp" + #include "libslic3r/AppConfig.hpp" + #include +- ++#include + + namespace Slic3r { + namespace GUI { +diff --git a/src/slic3r/GUI/Notebook.hpp b/src/slic3r/GUI/Notebook.hpp +index d75898a7c..7e6e94da3 100644 +--- a/src/slic3r/GUI/Notebook.hpp ++++ b/src/slic3r/GUI/Notebook.hpp +@@ -4,6 +4,7 @@ + //#ifdef _WIN32 + + #include ++#include + + class ModeSizer; + class ScalableButton; +diff --git a/src/slic3r/GUI/ObjectDataViewModel.hpp b/src/slic3r/GUI/ObjectDataViewModel.hpp +index 872564519..47ac80d3d 100644 +--- a/src/slic3r/GUI/ObjectDataViewModel.hpp ++++ b/src/slic3r/GUI/ObjectDataViewModel.hpp +@@ -5,6 +5,7 @@ + #ifndef slic3r_GUI_ObjectDataViewModel_hpp_ + #define slic3r_GUI_ObjectDataViewModel_hpp_ + ++#include + #include + #include + #include +diff --git a/src/slic3r/GUI/ParamsPanel.hpp b/src/slic3r/GUI/ParamsPanel.hpp +index 1a20ec7d2..dfd3196f5 100644 +--- a/src/slic3r/GUI/ParamsPanel.hpp ++++ b/src/slic3r/GUI/ParamsPanel.hpp +@@ -20,6 +20,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp +index 940028bd7..fc63dfce3 100644 +--- a/src/slic3r/GUI/PartPlate.cpp ++++ b/src/slic3r/GUI/PartPlate.cpp +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + + #include "libslic3r/libslic3r.h" +diff --git a/src/slic3r/GUI/PresetComboBoxes.hpp b/src/slic3r/GUI/PresetComboBoxes.hpp +index 4598b3dc3..954c06862 100644 +--- a/src/slic3r/GUI/PresetComboBoxes.hpp ++++ b/src/slic3r/GUI/PresetComboBoxes.hpp +@@ -4,6 +4,7 @@ + //#include + #include + #include ++#include + + #include "libslic3r/Preset.hpp" + #include "wxExtensions.hpp" +diff --git a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp +index aeba24834..886421c65 100644 +--- a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp ++++ b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp +@@ -7,10 +7,14 @@ + #include "../../Utils/NetworkAgent.hpp" + #include "../BitmapCache.hpp" + ++#include ++#include + #include + #include + #include + ++#include ++ + #include "nlohmann/json.hpp" + + #include +diff --git a/src/slic3r/GUI/Printer/PrinterFileSystem.h b/src/slic3r/GUI/Printer/PrinterFileSystem.h +index 2900685f8..237378744 100644 +--- a/src/slic3r/GUI/Printer/PrinterFileSystem.h ++++ b/src/slic3r/GUI/Printer/PrinterFileSystem.h +@@ -4,6 +4,7 @@ + #define BAMBU_DYNAMIC + #include "BambuTunnel.h" + ++#include + #include + + #include +diff --git a/src/slic3r/GUI/PrivacyUpdateDialog.hpp b/src/slic3r/GUI/PrivacyUpdateDialog.hpp +index b737bcd48..084916619 100644 +--- a/src/slic3r/GUI/PrivacyUpdateDialog.hpp ++++ b/src/slic3r/GUI/PrivacyUpdateDialog.hpp +@@ -6,6 +6,7 @@ + #include "Widgets/Label.hpp" + #include "Widgets/WebView.hpp" + #include ++#include + #include + + namespace Slic3r { namespace GUI { +@@ -53,4 +54,4 @@ public: + + }} // namespace Slic3r::GUI + +-#endif +\ No newline at end of file ++#endif +diff --git a/src/slic3r/GUI/Project.cpp b/src/slic3r/GUI/Project.cpp +index 46e3c3442..003d0e4cd 100644 +--- a/src/slic3r/GUI/Project.cpp ++++ b/src/slic3r/GUI/Project.cpp +@@ -4,6 +4,8 @@ + #include "libslic3r/Model.hpp" + #include "libslic3r/Format/bbs_3mf.hpp" + ++#include ++ + #include + #include + #include +diff --git a/src/slic3r/GUI/SavePresetDialog.cpp b/src/slic3r/GUI/SavePresetDialog.cpp +index a4f5f2501..f3c8871e7 100644 +--- a/src/slic3r/GUI/SavePresetDialog.cpp ++++ b/src/slic3r/GUI/SavePresetDialog.cpp +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + #include + #include +diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp +index bb0127fe7..9c9bfb259 100644 +--- a/src/slic3r/GUI/SelectMachine.cpp ++++ b/src/slic3r/GUI/SelectMachine.cpp +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include "Plater.hpp" +diff --git a/src/slic3r/GUI/SliceInfoPanel.cpp b/src/slic3r/GUI/SliceInfoPanel.cpp +index ddf9eb647..9aeb5f25a 100644 +--- a/src/slic3r/GUI/SliceInfoPanel.cpp ++++ b/src/slic3r/GUI/SliceInfoPanel.cpp +@@ -1,5 +1,6 @@ + #include "SliceInfoPanel.hpp" + ++#include + #include "I18N.hpp" + #include "Widgets/Label.hpp" + #include "libslic3r/Utils.hpp" +@@ -344,4 +345,4 @@ void SliceInfoPanel::msw_rescale() + + + } +-} +\ No newline at end of file ++} +diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp +index 2557b0194..53394895f 100644 +--- a/src/slic3r/GUI/StatusPanel.cpp ++++ b/src/slic3r/GUI/StatusPanel.cpp +@@ -18,6 +18,8 @@ + #include "RecenterDialog.hpp" + #include "CalibUtils.hpp" + #include ++#include ++#include + #include + #include + +diff --git a/src/slic3r/GUI/TabButton.cpp b/src/slic3r/GUI/TabButton.cpp +index b972c1401..98525ee07 100644 +--- a/src/slic3r/GUI/TabButton.cpp ++++ b/src/slic3r/GUI/TabButton.cpp +@@ -1,6 +1,7 @@ + #include "TabButton.hpp" + #include "Widgets/Label.hpp" + ++#include + #include + + BEGIN_EVENT_TABLE(TabButton, StaticBox) +diff --git a/src/slic3r/GUI/WebUserLoginDialog.hpp b/src/slic3r/GUI/WebUserLoginDialog.hpp +index 6a820bef9..3d0e2629d 100644 +--- a/src/slic3r/GUI/WebUserLoginDialog.hpp ++++ b/src/slic3r/GUI/WebUserLoginDialog.hpp +@@ -24,6 +24,7 @@ + #include "wx/fs_mem.h" + #include "wx/stdpaths.h" + #include ++#include "wx/timer.h" + #include + #include "wx/textctrl.h" + +diff --git a/src/slic3r/GUI/WebViewDialog.cpp b/src/slic3r/GUI/WebViewDialog.cpp +index 98d24d417..9e9568544 100644 +--- a/src/slic3r/GUI/WebViewDialog.cpp ++++ b/src/slic3r/GUI/WebViewDialog.cpp +@@ -7,6 +7,9 @@ + #include "libslic3r_version.h" + #include "../Utils/Http.hpp" + ++#include ++#include ++ + #include + #include + #include +diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp +index f70d16a7f..9b39a4bb5 100644 +--- a/src/slic3r/GUI/Widgets/AMSControl.cpp ++++ b/src/slic3r/GUI/Widgets/AMSControl.cpp +@@ -4,6 +4,8 @@ + #include "../I18N.hpp" + #include "../GUI_App.hpp" + ++#include ++ + #include + #include + #include "CalibUtils.hpp" +diff --git a/src/slic3r/GUI/Widgets/AxisCtrlButton.cpp b/src/slic3r/GUI/Widgets/AxisCtrlButton.cpp +index 193dd682e..21a420f5e 100644 +--- a/src/slic3r/GUI/Widgets/AxisCtrlButton.cpp ++++ b/src/slic3r/GUI/Widgets/AxisCtrlButton.cpp +@@ -1,6 +1,8 @@ + #include "AxisCtrlButton.hpp" + #include "Label.hpp" ++#include "libslic3r/libslic3r.h" + ++#include + #include + + StateColor blank_bg(StateColor(std::make_pair(wxColour("#FFFFFF"), (int)StateColor::Normal))); +@@ -365,4 +367,4 @@ void AxisCtrlButton::sendButtonEvent() + event.SetEventObject(this); + event.SetInt(current_pos); + GetEventHandler()->ProcessEvent(event); +-} +\ No newline at end of file ++} +diff --git a/src/slic3r/GUI/Widgets/DropDown.cpp b/src/slic3r/GUI/Widgets/DropDown.cpp +index 03f8f366b..23a344e5a 100644 +--- a/src/slic3r/GUI/Widgets/DropDown.cpp ++++ b/src/slic3r/GUI/Widgets/DropDown.cpp +@@ -1,6 +1,8 @@ + #include "DropDown.hpp" + #include "Label.hpp" + ++#include ++#include + #include + + #ifdef __WXGTK__ +diff --git a/src/slic3r/GUI/Widgets/DropDown.hpp b/src/slic3r/GUI/Widgets/DropDown.hpp +index 4ff909c84..86f14aa27 100644 +--- a/src/slic3r/GUI/Widgets/DropDown.hpp ++++ b/src/slic3r/GUI/Widgets/DropDown.hpp +@@ -1,6 +1,7 @@ + #ifndef slic3r_GUI_DropDown_hpp_ + #define slic3r_GUI_DropDown_hpp_ + ++#include + #include + #include "../wxExtensions.hpp" + #include "StateHandler.hpp" +diff --git a/src/slic3r/GUI/Widgets/ErrorMsgStaticText.cpp b/src/slic3r/GUI/Widgets/ErrorMsgStaticText.cpp +index cdcbf489c..dc6c2fc9e 100644 +--- a/src/slic3r/GUI/Widgets/ErrorMsgStaticText.cpp ++++ b/src/slic3r/GUI/Widgets/ErrorMsgStaticText.cpp +@@ -1,4 +1,5 @@ + #include "ErrorMsgStaticText.hpp" ++#include + + ErrorMsgStaticText::ErrorMsgStaticText() {} + +@@ -51,4 +52,4 @@ void ErrorMsgStaticText::paintEvent(wxPaintEvent &evt) + SetMinSize(wxSize(-1, line_count * text_height)); + SetMaxSize(wxSize(-1, line_count * text_height)); + dc.DrawText(out_txt, 0, 0); +-} +\ No newline at end of file ++} +diff --git a/src/slic3r/GUI/Widgets/ErrorMsgStaticText.hpp b/src/slic3r/GUI/Widgets/ErrorMsgStaticText.hpp +index 6a455b208..735a118a2 100644 +--- a/src/slic3r/GUI/Widgets/ErrorMsgStaticText.hpp ++++ b/src/slic3r/GUI/Widgets/ErrorMsgStaticText.hpp +@@ -2,6 +2,7 @@ + #ifndef _WX_ERRORMSGSTATTEXT_H_ + #define _WX_ERRORMSGSTATTEXT_H_ + ++#include + #include "wx/stattext.h" + + class WXDLLIMPEXP_CORE ErrorMsgStaticText : public wxPanel +@@ -19,4 +20,4 @@ public: + void SetLabel(wxString msg){m_msg = msg;}; + + }; +-#endif +\ No newline at end of file ++#endif +diff --git a/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp b/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp +index 634d61e79..af48b6d27 100644 +--- a/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp ++++ b/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp +@@ -3,6 +3,7 @@ + #include "StaticBox.hpp" + #include "../wxExtensions.hpp" + ++#include + #include + + BEGIN_EVENT_TABLE(ImageSwitchButton, StaticBox) +@@ -369,4 +370,4 @@ void FanSwitchButton::sendButtonEvent() + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); + event.SetEventObject(this); + GetEventHandler()->ProcessEvent(event); +-} +\ No newline at end of file ++} +diff --git a/src/slic3r/GUI/Widgets/Label.cpp b/src/slic3r/GUI/Widgets/Label.cpp +index 8ac96e903..f981cfaee 100644 +--- a/src/slic3r/GUI/Widgets/Label.cpp ++++ b/src/slic3r/GUI/Widgets/Label.cpp +@@ -2,6 +2,10 @@ + #include "Label.hpp" + #include "StaticBox.hpp" + #include // For wxLocale ++#include ++#include ++#include ++ + + wxFont Label::sysFont(int size, bool bold) + { +diff --git a/src/slic3r/GUI/Widgets/ProgressBar.cpp b/src/slic3r/GUI/Widgets/ProgressBar.cpp +index 9f11b682d..214e76db8 100644 +--- a/src/slic3r/GUI/Widgets/ProgressBar.cpp ++++ b/src/slic3r/GUI/Widgets/ProgressBar.cpp +@@ -1,5 +1,6 @@ + #include "ProgressBar.hpp" + #include "../I18N.hpp" ++#include + #include + #include "Label.hpp" + +diff --git a/src/slic3r/GUI/Widgets/ProgressDialog.hpp b/src/slic3r/GUI/Widgets/ProgressDialog.hpp +index f67f6b89b..eb62d27bd 100644 +--- a/src/slic3r/GUI/Widgets/ProgressDialog.hpp ++++ b/src/slic3r/GUI/Widgets/ProgressDialog.hpp +@@ -2,6 +2,7 @@ + #define slic3r_GUI_PROGRESSDIALOG_hpp_ + + #include "wx/dialog.h" ++#include "wx/progdlg.h" + #include "wx/weakref.h" + #include "wx/simplebook.h" + #include "Button.hpp" +diff --git a/src/slic3r/GUI/Widgets/RoundedRectangle.cpp b/src/slic3r/GUI/Widgets/RoundedRectangle.cpp +index a3c7c139a..07f2aa0b3 100644 +--- a/src/slic3r/GUI/Widgets/RoundedRectangle.cpp ++++ b/src/slic3r/GUI/Widgets/RoundedRectangle.cpp +@@ -1,6 +1,7 @@ + #include "RoundedRectangle.hpp" + #include "../wxExtensions.hpp" + #include ++#include + + BEGIN_EVENT_TABLE(RoundedRectangle, wxPanel) + EVT_PAINT(RoundedRectangle::OnPaint) +@@ -32,4 +33,4 @@ void RoundedRectangle::OnPaint(wxPaintEvent &evt) + dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); + dc.DrawRoundedRectangle(0, 0, GetSize().GetWidth(), GetSize().GetHeight(), m_radius); + } +-} +\ No newline at end of file ++} +diff --git a/src/slic3r/GUI/Widgets/SideButton.cpp b/src/slic3r/GUI/Widgets/SideButton.cpp +index 4ea48d9a5..53d7725fb 100644 +--- a/src/slic3r/GUI/Widgets/SideButton.cpp ++++ b/src/slic3r/GUI/Widgets/SideButton.cpp +@@ -1,6 +1,7 @@ + #include "SideButton.hpp" + #include "Label.hpp" + ++#include + #include + + BEGIN_EVENT_TABLE(SideButton, wxPanel) +diff --git a/src/slic3r/GUI/Widgets/SideMenuPopup.cpp b/src/slic3r/GUI/Widgets/SideMenuPopup.cpp +index b50ed6b60..cde4fba39 100644 +--- a/src/slic3r/GUI/Widgets/SideMenuPopup.cpp ++++ b/src/slic3r/GUI/Widgets/SideMenuPopup.cpp +@@ -1,6 +1,7 @@ + #include "SideMenuPopup.hpp" + #include "Label.hpp" + ++#include + #include + #include "../GUI_App.hpp" + +diff --git a/src/slic3r/GUI/Widgets/SpinInput.hpp b/src/slic3r/GUI/Widgets/SpinInput.hpp +index 5b0868880..cc342276f 100644 +--- a/src/slic3r/GUI/Widgets/SpinInput.hpp ++++ b/src/slic3r/GUI/Widgets/SpinInput.hpp +@@ -1,7 +1,10 @@ + #ifndef slic3r_GUI_SpinInput_hpp_ + #define slic3r_GUI_SpinInput_hpp_ + ++#include ++#include + #include ++#include + #include "StaticBox.hpp" + + class Button; +diff --git a/src/slic3r/GUI/Widgets/StateHandler.cpp b/src/slic3r/GUI/Widgets/StateHandler.cpp +index eb3d3be71..7b2e4cf6e 100644 +--- a/src/slic3r/GUI/Widgets/StateHandler.cpp ++++ b/src/slic3r/GUI/Widgets/StateHandler.cpp +@@ -1,4 +1,5 @@ + #include "StateHandler.hpp" ++#include + + wxDEFINE_EVENT(EVT_ENABLE_CHANGED, wxCommandEvent); + +diff --git a/src/slic3r/GUI/Widgets/StateHandler.hpp b/src/slic3r/GUI/Widgets/StateHandler.hpp +index c231b8f63..a0af2cc28 100644 +--- a/src/slic3r/GUI/Widgets/StateHandler.hpp ++++ b/src/slic3r/GUI/Widgets/StateHandler.hpp +@@ -1,6 +1,7 @@ + #ifndef slic3r_GUI_StateHandler_hpp_ + #define slic3r_GUI_StateHandler_hpp_ + ++#include + #include + + #include "StateColor.hpp" +diff --git a/src/slic3r/GUI/Widgets/StaticBox.cpp b/src/slic3r/GUI/Widgets/StaticBox.cpp +index 00855eddf..6eae5b3d6 100644 +--- a/src/slic3r/GUI/Widgets/StaticBox.cpp ++++ b/src/slic3r/GUI/Widgets/StaticBox.cpp +@@ -1,5 +1,6 @@ + #include "StaticBox.hpp" + #include "../GUI.hpp" ++#include + #include + + BEGIN_EVENT_TABLE(StaticBox, wxWindow) +diff --git a/src/slic3r/GUI/Widgets/StaticLine.cpp b/src/slic3r/GUI/Widgets/StaticLine.cpp +index d9b74f0ad..3dd564c02 100644 +--- a/src/slic3r/GUI/Widgets/StaticLine.cpp ++++ b/src/slic3r/GUI/Widgets/StaticLine.cpp +@@ -2,6 +2,7 @@ + #include "Label.hpp" + #include "StateColor.hpp" + ++#include + #include + + BEGIN_EVENT_TABLE(StaticLine, wxWindow) +diff --git a/src/slic3r/GUI/Widgets/StepCtrl.cpp b/src/slic3r/GUI/Widgets/StepCtrl.cpp +index dfd38b140..73a3e80dd 100644 +--- a/src/slic3r/GUI/Widgets/StepCtrl.cpp ++++ b/src/slic3r/GUI/Widgets/StepCtrl.cpp +@@ -1,6 +1,9 @@ + #include "StepCtrl.hpp" + #include "Label.hpp" + ++#include ++#include ++ + wxDEFINE_EVENT( EVT_STEP_CHANGING, wxCommandEvent ); + wxDEFINE_EVENT( EVT_STEP_CHANGED, wxCommandEvent ); + +diff --git a/src/slic3r/GUI/Widgets/SwitchButton.cpp b/src/slic3r/GUI/Widgets/SwitchButton.cpp +index e3b7a5fc8..f362221cf 100644 +--- a/src/slic3r/GUI/Widgets/SwitchButton.cpp ++++ b/src/slic3r/GUI/Widgets/SwitchButton.cpp +@@ -5,6 +5,8 @@ + #include "../wxExtensions.hpp" + #include "../Utils/MacDarkMode.hpp" + ++#include ++#include + #include + + SwitchButton::SwitchButton(wxWindow* parent, wxWindowID id) +diff --git a/src/slic3r/GUI/Widgets/TabCtrl.cpp b/src/slic3r/GUI/Widgets/TabCtrl.cpp +index 4600014ba..36778f681 100644 +--- a/src/slic3r/GUI/Widgets/TabCtrl.cpp ++++ b/src/slic3r/GUI/Widgets/TabCtrl.cpp +@@ -1,5 +1,7 @@ + #include "TabCtrl.hpp" + ++#include ++ + wxDEFINE_EVENT( wxEVT_TAB_SEL_CHANGING, wxCommandEvent ); + wxDEFINE_EVENT( wxEVT_TAB_SEL_CHANGED, wxCommandEvent ); + +diff --git a/src/slic3r/GUI/Widgets/TempInput.hpp b/src/slic3r/GUI/Widgets/TempInput.hpp +index 7829b1082..09d89a724 100644 +--- a/src/slic3r/GUI/Widgets/TempInput.hpp ++++ b/src/slic3r/GUI/Widgets/TempInput.hpp +@@ -3,6 +3,7 @@ + + #include "../wxExtensions.hpp" + #include ++#include + #include "StaticBox.hpp" + + wxDECLARE_EVENT(wxCUSTOMEVT_SET_TEMP_FINISH, wxCommandEvent); +diff --git a/src/slic3r/GUI/Widgets/TextInput.cpp b/src/slic3r/GUI/Widgets/TextInput.cpp +index 5cda9cbf0..f8fb92939 100644 +--- a/src/slic3r/GUI/Widgets/TextInput.cpp ++++ b/src/slic3r/GUI/Widgets/TextInput.cpp +@@ -3,6 +3,7 @@ + #include "TextCtrl.h" + #include "slic3r/GUI/Widgets/Label.hpp" + ++#include + #include + + BEGIN_EVENT_TABLE(TextInput, wxPanel) +diff --git a/src/slic3r/GUI/Widgets/WebView.cpp b/src/slic3r/GUI/Widgets/WebView.cpp +index 5cb6eb450..11f431c30 100644 +--- a/src/slic3r/GUI/Widgets/WebView.cpp ++++ b/src/slic3r/GUI/Widgets/WebView.cpp +@@ -2,6 +2,8 @@ + #include "slic3r/GUI/GUI_App.hpp" + #include "slic3r/Utils/MacDarkMode.hpp" + ++#include ++ + #include + #include + #if wxUSE_WEBVIEW_EDGE +diff --git a/src/slic3r/GUI/WipeTowerDialog.cpp b/src/slic3r/GUI/WipeTowerDialog.cpp +index eb5ea701f..8df5270a4 100644 +--- a/src/slic3r/GUI/WipeTowerDialog.cpp ++++ b/src/slic3r/GUI/WipeTowerDialog.cpp +@@ -13,8 +13,6 @@ + #include "MainFrame.hpp" + #include "libslic3r/Config.hpp" + +-#include +- + using namespace Slic3r; + using namespace Slic3r::GUI; + +diff --git a/src/slic3r/GUI/WipeTowerDialog.hpp b/src/slic3r/GUI/WipeTowerDialog.hpp +index 71548eea3..ac58cf74f 100644 +--- a/src/slic3r/GUI/WipeTowerDialog.hpp ++++ b/src/slic3r/GUI/WipeTowerDialog.hpp +@@ -3,6 +3,7 @@ + + #include "GUI_Utils.hpp" + ++#include + #include + #include + #include +@@ -127,4 +128,4 @@ private: + std::unordered_map m_button_list; + }; + +-#endif // _WIPE_TOWER_DIALOG_H_ +\ No newline at end of file ++#endif // _WIPE_TOWER_DIALOG_H_ +diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp +index 3859fb26f..f388b52a6 100644 +--- a/src/slic3r/GUI/wxExtensions.hpp ++++ b/src/slic3r/GUI/wxExtensions.hpp +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + + #include + #include +diff --git a/src/slic3r/Utils/ColorSpaceConvert.cpp b/src/slic3r/Utils/ColorSpaceConvert.cpp +index b0292a515..2634d1c4c 100644 +--- a/src/slic3r/Utils/ColorSpaceConvert.cpp ++++ b/src/slic3r/Utils/ColorSpaceConvert.cpp +@@ -1,6 +1,7 @@ + #include "ColorSpaceConvert.hpp" + + #include ++#include + + const static float param_13 = 1.0f / 3.0f; + const static float param_16116 = 16.0f / 116.0f; +diff --git a/src/slic3r/Utils/ColorSpaceConvert.hpp b/src/slic3r/Utils/ColorSpaceConvert.hpp +index 4f05379f0..9c3a659a0 100644 +--- a/src/slic3r/Utils/ColorSpaceConvert.hpp ++++ b/src/slic3r/Utils/ColorSpaceConvert.hpp +@@ -1,6 +1,8 @@ + #ifndef slic3r_Utils_ColorSpaceConvert_hpp_ + #define slic3r_Utils_ColorSpaceConvert_hpp_ + ++#include ++ + std::tuple rgb_to_yuv(float r, float g, float b); + double PivotRGB(double n); + double PivotXYZ(double n); +diff --git a/src/slic3r/Utils/FileHelp.cpp b/src/slic3r/Utils/FileHelp.cpp +index c272112c7..5189635d7 100644 +--- a/src/slic3r/Utils/FileHelp.cpp ++++ b/src/slic3r/Utils/FileHelp.cpp +@@ -1,5 +1,6 @@ + #include "FileHelp.hpp" + #include ++#include + #include + namespace Slic3r { + namespace Utils { +@@ -23,4 +24,4 @@ void slash_to_back_slash(std::string &file_path) { + file_path = std::regex_replace(file_path, regex, "/"); + } + +-}} // namespace Slic3r::Utils +\ No newline at end of file ++}} // namespace Slic3r::Utils +diff --git a/src/slic3r/Utils/Http.hpp b/src/slic3r/Utils/Http.hpp +index e8e4f41c0..c7f7ac2cd 100644 +--- a/src/slic3r/Utils/Http.hpp ++++ b/src/slic3r/Utils/Http.hpp +@@ -1,11 +1,15 @@ + #ifndef __Http_hpp__ + #define __Http_hpp__ + ++#include + #include + #include + #include + #include + ++#include "libslic3r/Exception.hpp" ++#include "libslic3r_version.h" ++ + #define MAX_SIZE_TO_FILE 3*1024 + + namespace Slic3r { +diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp +index e09bcbe22..3ec79d17f 100644 +--- a/src/slic3r/Utils/PresetUpdater.cpp ++++ b/src/slic3r/Utils/PresetUpdater.cpp +@@ -818,9 +818,9 @@ void PresetUpdater::priv::sync_tooltip(std::string http_url, std::string languag + fs::path cache_root = fs::path(data_dir()) / "resources/tooltip"; + try { + auto vf = cache_root / "common" / "version"; +- if (fs::exists(vf)) load_string_file(vf, common_version); ++ if (fs::exists(vf)) Slic3r::load_string_file(vf, common_version); + vf = cache_root / language / "version"; +- if (fs::exists(vf)) load_string_file(vf, language_version); ++ if (fs::exists(vf)) Slic3r::load_string_file(vf, language_version); + } catch (...) {} + std::map resources + { +@@ -996,11 +996,11 @@ void PresetUpdater::priv::sync_printer_config(std::string http_url) + auto cache_folder = data_dir_path / "ota" / "printers"; + + try { +- load_string_file(config_folder / "version.txt", curr_version); ++ Slic3r::load_string_file(config_folder / "version.txt", curr_version); + boost::algorithm::trim(curr_version); + } catch (...) {} + try { +- load_string_file(cache_folder / "version.txt", cached_version); ++ Slic3r::load_string_file(cache_folder / "version.txt", cached_version); + boost::algorithm::trim(cached_version); + } catch (...) {} + if (!cached_version.empty()) { +@@ -1034,7 +1034,7 @@ void PresetUpdater::priv::sync_printer_config(std::string http_url) + + bool result = false; + try { +- load_string_file(cache_folder / "version.txt", cached_version); ++ Slic3r::load_string_file(cache_folder / "version.txt", cached_version); + boost::algorithm::trim(cached_version); + result = true; + } catch (...) {} +@@ -1137,11 +1137,11 @@ Updates PresetUpdater::priv::get_printer_config_updates(bool update) const + std::string curr_version; + std::string resc_version; + try { +- load_string_file(resc_folder / "version.txt", resc_version); ++ Slic3r::load_string_file(resc_folder / "version.txt", resc_version); + boost::algorithm::trim(resc_version); + } catch (...) {} + try { +- load_string_file(config_folder / "version.txt", curr_version); ++ Slic3r::load_string_file(config_folder / "version.txt", curr_version); + boost::algorithm::trim(curr_version); + } catch (...) {} + +diff --git a/src/slic3r/Utils/json_diff.cpp b/src/slic3r/Utils/json_diff.cpp +index d82ef2134..171a44c63 100644 +--- a/src/slic3r/Utils/json_diff.cpp ++++ b/src/slic3r/Utils/json_diff.cpp +@@ -12,6 +12,10 @@ + + #include + ++#include ++#include ++#include ++ + using namespace std; + using json = nlohmann::json; + diff --git a/flatpak/patches/TBB/GNU.cmake b/flatpak/patches/TBB/GNU.cmake new file mode 100644 index 0000000000..a0ba4e5df7 --- /dev/null +++ b/flatpak/patches/TBB/GNU.cmake @@ -0,0 +1,79 @@ +# Copyright (c) 2020-2021 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if (MINGW) + set(TBB_LINK_DEF_FILE_FLAG "") + set(TBB_DEF_FILE_PREFIX "") +elseif (APPLE) + set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,) + set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH}) + + # For correct ucontext.h structures layout + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -D_XOPEN_SOURCE) +else() + set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=) + set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH}) +endif() + +# Add -Wno-error=stringop-overflow to fix GCC 12+ build as suggested on https://github.com/oneapi-src/oneTBB/issues/843#issuecomment-1152646035 +set(TBB_WARNING_LEVEL -Wall -Wextra $<$:-Werror> -Wfatal-errors -Wno-error=stringop-overflow) +set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor) + +# Depfile options (e.g. -MD) are inserted automatically in some cases. +# Don't add -MMD to avoid conflicts in such cases. +if (NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT CMAKE_CXX_DEPENDS_USE_COMPILER) + set(TBB_MMD_FLAG -MMD) +endif() + +# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors +if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)") + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$>,$>>:-mwaitpkg>) +endif() + +if (NOT MINGW) + set(TBB_COMMON_LINK_LIBS dl) +endif() + +# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled. +if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag) + tbb_remove_compile_flag(-Werror) +endif() + +if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel) + # gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime + set(TBB_DSE_FLAG $<$>:-flifetime-dse=1>) +endif() + +# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16) +if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips") + set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$:-mxgot>) +endif() + +if (MINGW) + list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__) +endif() + +# For some reason GCC does not instrument code with Thread Sanitizer when lto is enabled and C linker is used. +if (NOT TBB_SANITIZE MATCHES "thread") + set(TBB_IPO_COMPILE_FLAGS $<$>:-flto>) + set(TBB_IPO_LINK_FLAGS $<$>:-flto>) +endif() + +# Disable lto flag +set(TBB_IPO_COMPILE_FLAGS "") +set(TBB_IPO_LINK_FLAGS "") + +# TBB malloc settings +set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions) +set(TBB_OPENMP_FLAG -fopenmp) diff --git a/flatpak/patches/disable-gstplayer.patch b/flatpak/patches/disable-gstplayer.patch new file mode 100644 index 0000000000..9826bfdfd9 --- /dev/null +++ b/flatpak/patches/disable-gstplayer.patch @@ -0,0 +1,26 @@ +From 2ef88023ba3eb323f47af89d92ce14a41f311c9e Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 2 Jan 2024 00:55:20 +0100 +Subject: [PATCH] Disable GstPlayer media player version + +--- + build/cmake/init.cmake | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake +index 5ba4b6165b45..1931277f11c8 100644 +--- a/build/cmake/init.cmake ++++ b/build/cmake/init.cmake +@@ -501,9 +501,6 @@ if(wxUSE_GUI) + + set(wxUSE_GSTREAMER ${GSTREAMER_FOUND}) + set(wxUSE_GSTREAMER_PLAYER OFF) +- if(GSTREAMER_PLAYER_INCLUDE_DIRS) +- set(wxUSE_GSTREAMER_PLAYER ON) +- endif() + + if(NOT GSTREAMER_FOUND) + message(WARNING "GStreamer not found, wxMediaCtrl won't be available") +-- +2.43.0 + diff --git a/flatpak/patches/glfw-Don-t-crash-on-calls-to-focus-or-icon.patch b/flatpak/patches/glfw-Don-t-crash-on-calls-to-focus-or-icon.patch new file mode 100644 index 0000000000..bc7eb194a0 --- /dev/null +++ b/flatpak/patches/glfw-Don-t-crash-on-calls-to-focus-or-icon.patch @@ -0,0 +1,45 @@ +From d8dcacd96df849760b41fb71667379a81659dafc Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Fri, 19 Jan 2024 11:34:47 +0100 +Subject: [PATCH] wayland: Downgrade runtime errors to warnings + +--- + src/wl_window.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/src/wl_window.c b/src/wl_window.c +index 985a57116816..19e5dac259d4 100644 +--- a/src/wl_window.c ++++ b/src/wl_window.c +@@ -2163,8 +2163,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) + void _glfwPlatformSetWindowIcon(_GLFWwindow* window, + int count, const GLFWimage* images) + { +- _glfwInputError(GLFW_PLATFORM_ERROR, +- "Wayland: Setting window icon not supported"); ++ fprintf(stderr, "!!! Ignoring Wayland error: Setting window icon not supported\n"); + } + + void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) +@@ -2172,16 +2171,14 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) + // A Wayland client is not aware of its position, so just warn and leave it + // as (0, 0) + +- _glfwInputError(GLFW_PLATFORM_ERROR, +- "Wayland: Window position retrieval not supported"); ++ fprintf(stderr, "!!! Ignoring Wayland error: Window position retrieval not supported\n"); + } + + void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos) + { + // A Wayland client can not set its position, so just warn + +- _glfwInputError(GLFW_PLATFORM_ERROR, +- "Wayland: Window position setting not supported"); ++ fprintf(stderr, "!!! Ignoring Wayland error: Window position setting not supported\n"); + } + + void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) +-- +2.43.0 + diff --git a/flatpak/patches/use-sysdeps.patch b/flatpak/patches/use-sysdeps.patch new file mode 100644 index 0000000000..0a726d73f4 --- /dev/null +++ b/flatpak/patches/use-sysdeps.patch @@ -0,0 +1,180 @@ +diff --git a/deps/CGAL/CGAL.cmake b/deps/CGAL/CGAL.cmake +index 18fee7c15..7b886e93d 100644 +--- a/deps/CGAL/CGAL.cmake ++++ b/deps/CGAL/CGAL.cmake +@@ -5,7 +5,7 @@ orcaslicer_add_cmake_project( + # For whatever reason, this keeps downloading forever (repeats downloads if finished) + URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip + URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0 +- DEPENDS dep_Boost dep_GMP dep_MPFR ++ DEPENDS dep_GMP dep_MPFR + ) + + include(GNUInstallDirs) +diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt +index 02a07ffd3..70ba0dcd4 100644 +--- a/deps/CMakeLists.txt ++++ b/deps/CMakeLists.txt +@@ -208,11 +208,6 @@ if (NOT ZLIB_FOUND) + include(ZLIB/ZLIB.cmake) + set(ZLIB_PKG dep_ZLIB) + endif () +-set(PNG_PKG "") +-if (NOT PNG_FOUND) +- include(PNG/PNG.cmake) +- set(PNG_PKG dep_PNG) +-endif () + set(EXPAT_PKG "") + if (NOT EXPAT_FOUND) + include(EXPAT/EXPAT.cmake) +@@ -220,13 +215,11 @@ if (NOT EXPAT_FOUND) + endif () + + set(DEP_Boost_COMPONENTS system iostreams filesystem thread log locale regex date_time) +-include(Boost/Boost.cmake) + + # The order of includes respects the dependencies between libraries + include(Cereal/Cereal.cmake) + include(Qhull/Qhull.cmake) + include(GLEW/GLEW.cmake) +-include(GLFW/GLFW.cmake) + include(OpenCSG/OpenCSG.cmake) + + include(TBB/TBB.cmake) +@@ -241,33 +234,22 @@ include(CGAL/CGAL.cmake) + + include(NLopt/NLopt.cmake) + +-include(OpenSSL/OpenSSL.cmake) +- + set(CURL_PKG "") + if (NOT CURL_FOUND) + include(CURL/CURL.cmake) + set(CURL_PKG dep_CURL) + endif () + +-include(JPEG/JPEG.cmake) +-include(TIFF/TIFF.cmake) +-include(wxWidgets/wxWidgets.cmake) + include(OCCT/OCCT.cmake) +-include(FREETYPE/FREETYPE.cmake) + + set(_dep_list +- dep_Boost + dep_TBB + ${CURL_PKG} +- dep_wxWidgets + dep_Cereal + dep_NLopt + dep_OpenVDB + dep_OpenCSG + dep_CGAL +- dep_OpenSSL +- dep_GLFW +- ${PNG_PKG} + ${ZLIB_PKG} + ${EXPAT_PKG} + ) +@@ -282,7 +264,6 @@ else() + endif() + + list(APPEND _dep_list "dep_OCCT") +-list(APPEND _dep_list "dep_FREETYPE") + + add_custom_target(deps ALL DEPENDS ${_dep_list}) + +diff --git a/deps/CURL/CURL.cmake b/deps/CURL/CURL.cmake +index 9846c7c9c..b5d924e6f 100644 +--- a/deps/CURL/CURL.cmake ++++ b/deps/CURL/CURL.cmake +@@ -72,10 +72,6 @@ orcaslicer_add_cmake_project(CURL + ${_curl_platform_flags} + ) + +-# if (APPLE OR (CMAKE_SYSTEM_NAME STREQUAL "Linux")) +- add_dependencies(dep_CURL dep_OpenSSL) +-# endif () +- + if (MSVC) + add_debug_dep(dep_CURL) + endif () +diff --git a/deps/OCCT/OCCT.cmake b/deps/OCCT/OCCT.cmake +index 541412b1c..363a9dda2 100644 +--- a/deps/OCCT/OCCT.cmake ++++ b/deps/OCCT/OCCT.cmake +@@ -14,7 +14,6 @@ orcaslicer_add_cmake_project(OCCT + #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch + PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch + #DEPENDS dep_Boost +- #DEPENDS dep_FREETYPE + CMAKE_ARGS + -DBUILD_LIBRARY_TYPE=${library_build_type} + -DUSE_TK=OFF +@@ -30,5 +29,3 @@ orcaslicer_add_cmake_project(OCCT + -DBUILD_MODULE_ModelingData=OFF + -DBUILD_MODULE_Visualization=OFF + ) +- +-add_dependencies(dep_OCCT dep_FREETYPE) +diff --git a/deps/OpenVDB/OpenVDB.cmake b/deps/OpenVDB/OpenVDB.cmake +index 7080b8b5d..e8b3695b2 100644 +--- a/deps/OpenVDB/OpenVDB.cmake ++++ b/deps/OpenVDB/OpenVDB.cmake +@@ -10,7 +10,7 @@ orcaslicer_add_cmake_project(OpenVDB + # support vs2022, update to 8.2 + URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip + URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81 +- DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost ++ DEPENDS dep_TBB dep_Blosc dep_OpenEXR + CMAKE_ARGS + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DOPENVDB_BUILD_PYTHON_MODULE=OFF +@@ -34,4 +34,4 @@ if (MSVC) + WORKING_DIRECTORY "${BINARY_DIR}" + ) + endif () +-endif () +\ No newline at end of file ++endif () +diff --git a/deps/TIFF/TIFF.cmake b/deps/TIFF/TIFF.cmake +index b9c004d65..f74775a9d 100644 +--- a/deps/TIFF/TIFF.cmake ++++ b/deps/TIFF/TIFF.cmake +@@ -5,7 +5,7 @@ if (APPLE) + orcaslicer_add_cmake_project(TIFF + URL https://gitlab.com/libtiff/libtiff/-/archive/v4.3.0/libtiff-v4.3.0.zip + URL_HASH SHA256=4fca1b582c88319f3ad6ecd5b46320eadaf5eb4ef6f6c32d44caaae4a03d0726 +- DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG ++ DEPENDS ${ZLIB_PKG} ${PNG_PKG} + CMAKE_ARGS + -Dlzma:BOOL=OFF + -Dwebp:BOOL=OFF +@@ -17,7 +17,7 @@ else() + orcaslicer_add_cmake_project(TIFF + URL https://gitlab.com/libtiff/libtiff/-/archive/v4.1.0/libtiff-v4.1.0.zip + URL_HASH SHA256=c56edfacef0a60c0de3e6489194fcb2f24c03dbb550a8a7de5938642d045bd32 +- DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG ++ DEPENDS ${ZLIB_PKG} ${PNG_PKG} + CMAKE_ARGS + -Dlzma:BOOL=OFF + -Dwebp:BOOL=OFF +diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake +index 50cf991a6..31f039bd8 100644 +--- a/deps/wxWidgets/wxWidgets.cmake ++++ b/deps/wxWidgets/wxWidgets.cmake +@@ -31,7 +31,7 @@ orcaslicer_add_cmake_project( + GIT_REPOSITORY "https://github.com/wxWidgets/wxWidgets" + GIT_TAG ${_wx_git_tag} + PATCH_COMMAND ${_patch_cmd} +- DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} dep_TIFF dep_JPEG ++ DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} + CMAKE_ARGS + -DwxBUILD_PRECOMP=ON + ${_wx_toolkit} +@@ -62,4 +62,4 @@ orcaslicer_add_cmake_project( + + if (MSVC) + add_debug_dep(dep_wxWidgets) +-endif () +\ No newline at end of file ++endif () diff --git a/flatpak/patches/wxwidgets-not-found.patch b/flatpak/patches/wxwidgets-not-found.patch new file mode 100644 index 0000000000..7421c28131 --- /dev/null +++ b/flatpak/patches/wxwidgets-not-found.patch @@ -0,0 +1,166 @@ +From 28f59e8900c3a54d4fe6bce43f62d1c4b0070e2c Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Mon, 11 Oct 2021 12:43:52 -0400 +Subject: [PATCH] cmake: also link with GLU when using EGL + +Fixes #19282 +--- + build/cmake/init.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake +index e1426afd428f..d5ecda9c98de 100644 +--- a/build/cmake/init.cmake ++++ b/build/cmake/init.cmake +@@ -411,7 +411,7 @@ if(wxUSE_GUI) + else() + find_package(OpenGL) + if(WXGTK3 AND OpenGL_EGL_FOUND AND wxUSE_GLCANVAS_EGL) +- set(OPENGL_LIBRARIES OpenGL::OpenGL OpenGL::EGL) ++ set(OPENGL_LIBRARIES OpenGL::OpenGL OpenGL::GLU OpenGL::EGL) + find_package(WAYLANDEGL) + if(WAYLANDEGL_FOUND AND wxHAVE_GDK_WAYLAND) + list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES}) +-- +2.43.0 + +From 0d6485797e23b5df5dded689fd63c86e3149abc9 Mon Sep 17 00:00:00 2001 +From: Maarten Bent +Date: Thu, 29 Apr 2021 21:39:15 +0200 +Subject: [PATCH 1/4] CMake: don't define WXUSINGDLL in wx-config for static + library + +--- + build/cmake/config.cmake | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake +index 91d11acba206..98b505cbef28 100644 +--- a/build/cmake/config.cmake ++++ b/build/cmake/config.cmake +@@ -153,10 +153,14 @@ function(wx_write_config) + set(WXCONFIG_CFLAGS "-pthread") + set(WXCONFIG_LDFLAGS "-pthread") + endif() +- set(WXCONFIG_CPPFLAGS "-DWXUSINGDLL") ++ set(WXCONFIG_CPPFLAGS) ++ if(wxBUILD_SHARED) ++ wx_string_append(WXCONFIG_CPPFLAGS " -DWXUSINGDLL") ++ endif() + foreach(flag IN LISTS wxTOOLKIT_DEFINITIONS) + wx_string_append(WXCONFIG_CPPFLAGS " -D${flag}") + endforeach() ++ string(STRIP "${WXCONFIG_CPPFLAGS}" WXCONFIG_CPPFLAGS) + set(WXCONFIG_CXXFLAGS ${WXCONFIG_CFLAGS}) + set(WXCONFIG_LDFLAGS_GUI) + set(WXCONFIG_RESFLAGS) +-- +2.43.0 + + +From ea6049598d806023cd7157600942ed78b719b74f Mon Sep 17 00:00:00 2001 +From: Maarten Bent +Date: Thu, 29 Apr 2021 21:41:06 +0200 +Subject: [PATCH 2/4] CMake: add '-l' prefix to all library dependencies + +--- + build/cmake/config.cmake | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake +index 98b505cbef28..d5ec8cf4fbad 100644 +--- a/build/cmake/config.cmake ++++ b/build/cmake/config.cmake +@@ -39,11 +39,10 @@ macro(wx_get_dependencies var lib) + else() + get_target_property(dep_name ${dep} OUTPUT_NAME) + endif() +- set(dep_name "-l${dep_name}") + else() + get_filename_component(dep_name ${dep} NAME) + endif() +- wx_string_append(${var} "${dep_name} ") ++ wx_string_append(${var} "-l${dep_name} ") + endforeach() + string(STRIP ${${var}} ${var}) + endif() +-- +2.43.0 + + +From 4fae03bdd774b65211d6515104305d1993179eb3 Mon Sep 17 00:00:00 2001 +From: Maarten Bent +Date: Tue, 4 May 2021 21:30:29 +0200 +Subject: [PATCH 3/4] CMake: Improve adding external libraries to wx-config + +Don't add -l to libraries already containing it (for example -lpthread). +Change libraries with format libName.so or libName.a to -lName, +configure also uses -l for these libraries. Account for possible invalid +libraries (Name-NOTFOUND) which could happen with imported libraries, +for example OpenGL::OpenGL. + +Closes https://github.com/wxWidgets/wxWidgets/pull/2359 +--- + build/cmake/config.cmake | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake +index d5ec8cf4fbad..c2aa026ef059 100644 +--- a/build/cmake/config.cmake ++++ b/build/cmake/config.cmake +@@ -42,7 +42,13 @@ macro(wx_get_dependencies var lib) + else() + get_filename_component(dep_name ${dep} NAME) + endif() +- wx_string_append(${var} "-l${dep_name} ") ++ if(dep_name MATCHES "^-l(.*)" OR dep_name STREQUAL "libc.so") ++ wx_string_append(${var} "${dep_name} ") ++ elseif(dep_name MATCHES "^lib(.*)(.so|.a)") ++ wx_string_append(${var} "-l${CMAKE_MATCH_1} ") ++ elseif(dep_name) ++ wx_string_append(${var} "-l${dep_name} ") ++ endif() + endforeach() + string(STRIP ${${var}} ${var}) + endif() +-- +2.43.0 + + +From 8455b3a48baf73e91f34ac9301642832aec9b544 Mon Sep 17 00:00:00 2001 +From: Vadim Zeitlin +Date: Wed, 25 Aug 2021 23:31:45 +0200 +Subject: [PATCH 4/4] Fix wx-config --libs output for static monolithic build + +Include all extra libraries we need (except for OpenGL ones, as there is +still a separate library for it, even in monolithic build) in wx-config +--libs output for static monolithic build as the application (may) need +all of them, as all the libraries are part of the single monolithic one +in this case. + +It seems that we had an attempt to fix this as far back as in 5719eab2bf +(Fix missing 3rd party builtin libs for static monolithic builds., +2006-09-17), but it was insufficient as it didn't take the dependencies +of the other GUI libraries (e.g. "media") into account. + +Closes #19175. +--- + wx-config.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/wx-config.in b/wx-config.in +index 441f88ce9203..e3f7d115bbbd 100755 +--- a/wx-config.in ++++ b/wx-config.in +@@ -1218,7 +1218,7 @@ if is_monolithic; then + # We still need the core lib deps for a static build though + if is_static; then + link_deps="${libdir}/libwx_@TOOLCHAIN_NAME@.a" +- wx_libs="$wx_libs $link_deps $ldlibs_core $ldlibs_base" ++ wx_libs="$wx_libs $link_deps $ldlibs_html $ldlibs_media $ldlibs_stc $ldlibs_webview $ldlibs_core $ldlibs_xml $ldlibs_base" + else + wx_libs="$wx_libs -lwx_@TOOLCHAIN_NAME@" + fi +-- +2.43.0 + diff --git a/flatpak/set-dark-theme-variant.py b/flatpak/set-dark-theme-variant.py new file mode 100644 index 0000000000..78bbf5d690 --- /dev/null +++ b/flatpak/set-dark-theme-variant.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 + +import Xlib +import Xlib.display +import time +import subprocess +import os +import sys + + +disp = Xlib.display.Display() +root = disp.screen().root + +NET_CLIENT_LIST = disp.intern_atom('_NET_CLIENT_LIST') + + +def set_theme_variant_by_window_id(id, variant): + # Use subprocess to call + # xprop and set the variant from id. + try: + s = subprocess.call(['xprop', '-f', '_GTK_THEME_VARIANT', '8u', '-set', '_GTK_THEME_VARIANT', variant, '-id', str(id)], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + if s == 0: + return True + return False + except Exception as ex: + return False + + +def set_theme_variant_from_win_id_collection(win_id_collection, variant): + # Loop though all of the collected + # window ids and set theme variant + for win_id in win_id_collection: + set_theme_variant_by_window_id(win_id, variant) + + +def collection_win_id_from_wm_class_name(win_class_name): + + collect = [] + + # Loop though all of the windows + # and collect id's those that match + # win_class: prusa-slicer + for win_id in root.get_full_property(NET_CLIENT_LIST, Xlib.X.AnyPropertyType).value: + try: + win = disp.create_resource_object('window', win_id) + if not win.get_wm_transient_for(): + win_class = win.get_wm_class() + if win_id and win_class_name in win_class: + collect.append( + win_id) if win_id not in collect else collect + except Xlib.error.BadWindow: + pass + + return collect + + +if __name__ == '__main__': + + if os.environ.get('PRUSA_SLICER_DARK_THEME', 'false') != 'true': + sys.exit(0) + + # Listen for X Property Change events. + root.change_attributes(event_mask=Xlib.X.PropertyChangeMask) + # the class name of the slicer window + win_class_name = 'prusa-slicer' + # the variant to set + variant = 'dark' + + start = time.time() + + while True: + # collect all of the window ids + collect = collection_win_id_from_wm_class_name(win_class_name) + # give PrusaSlicer window 2 secs to + # collect the wanted window ids + # set the theme variant and exit + if time.time() - start <= 2: + # disp.next_event() blocks if no events are + # queued. In combination with while True + # it creates a very simple event loop. + disp.next_event() + set_theme_variant_from_win_id_collection(collect, variant) + else: + break diff --git a/flatpak/umount b/flatpak/umount new file mode 100755 index 0000000000..5cbf32e6b8 --- /dev/null +++ b/flatpak/umount @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +if [ $# -eq 0 ]; then + echo "No arguments supplied" + exit 1 +fi + +DEVICE=$(basename $(findmnt -oSOURCE -n "$@") ) + +exec /usr/bin/gdbus call -y -d org.freedesktop.UDisks2 -o /org/freedesktop/UDisks2/block_devices/$DEVICE -m org.freedesktop.UDisks2.Filesystem.Unmount "{'b': <'false'>}" 1> /dev/null +