Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced

Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes.

clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer.
This commit is contained in:
Hanif Koh
2026-10-05 11:02:06 +08:00
parent f3d0b8a553
commit e540bbcf35
562 changed files with 1420 additions and 560 deletions
+2
View File
@@ -28,6 +28,8 @@
#include "slic3r/GUI/DeviceCore/DevFilaSystem.h"
#include <nlohmann/json.hpp>
#include "slic3r/GUI/DeviceCore/DevFilaSwitch.h"
#include "slic3r/GUI/DeviceCore/DevUtil.h"
using json = nlohmann::json;
using namespace Slic3r;
@@ -1,7 +1,6 @@
#include <catch2/catch_all.hpp>
#include <exception>
#include <libslic3r/Utils.hpp>
#include <slic3r/plugin/PluginConfig.hpp>
#include <slic3r/plugin/PluginManager.hpp>
#include <slic3r/plugin/PythonInterpreter.hpp>
@@ -20,6 +19,7 @@
#include <memory>
#include <string>
#include <pybind11/cast.h>
namespace py = pybind11;
using namespace Slic3r;
@@ -3,7 +3,6 @@
#include <catch2/catch_all.hpp>
#include <ios>
#include <libslic3r/Utils.hpp>
#include <slic3r/plugin/PluginConfig.hpp>
#include <slic3r/plugin/PluginDescriptor.hpp>
#include <slic3r/plugin/PluginFsUtils.hpp>
-2
View File
@@ -3,9 +3,7 @@
#include <catch2/catch_all.hpp>
#include <ios>
#include <libslic3r/Utils.hpp>
#include <slic3r/plugin/PluginConfig.hpp>
#include <slic3r/plugin/PluginManager.hpp>
#include <catch2/catch_test_macros.hpp>
#include "plugin_test_utils.hpp"
+5 -1
View File
@@ -7,7 +7,6 @@
#include <slic3r/GUI/DockPanel.hpp>
#include <slic3r/GUI/AuiPaneLayout.hpp>
#include <slic3r/GUI/Widgets/WebHosting.hpp>
#include <slic3r/plugin/PythonPluginBridge.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_message.hpp>
@@ -25,6 +24,11 @@
#include <wx/string.h>
#include <wx/uri.h>
#include "libslic3r/ObjectID.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/Preset.hpp"
#include "libslic3r/PrintConfig.hpp"
#include <pybind11/detail/common.h>
namespace py = pybind11;
@@ -3,7 +3,6 @@
#include <catch2/catch_all.hpp>
#include <ios>
#include <libslic3r/Utils.hpp>
#include <slic3r/plugin/PluginLoader.hpp>
#include <slic3r/plugin/PluginDescriptor.hpp>
#include <slic3r/plugin/PluginFsUtils.hpp>
@@ -4,7 +4,6 @@
#include <ios>
#include <libslic3r/LifecycleEvents.hpp>
#include <libslic3r/Utils.hpp>
#include <memory>
#include <slic3r/Utils/NetworkAgentFactory.hpp>
#include <slic3r/plugin/PluginDescriptor.hpp>
@@ -18,6 +18,7 @@
#include <pybind11/pytypes.h>
#include <pybind11/eval.h>
#include <pybind11/gil.h>
#include <pybind11/cast.h>
namespace py = pybind11;
using namespace Slic3r;
@@ -10,6 +10,8 @@
#include <pybind11/embed.h>
#include <array>
#include <pybind11/detail/common.h>
#include <pybind11/pybind11.h>
namespace py = pybind11;
using namespace Slic3r;
+4 -3
View File
@@ -1,10 +1,7 @@
#include <catch2/catch_all.hpp>
#include <memory>
#include "slic3r/Utils/ICloudServiceAgent.hpp"
#include "slic3r/Utils/IPrinterAgent.hpp"
#include <slic3r/Utils/NetworkAgentFactory.hpp>
#include <slic3r/plugin/PythonPluginBridge.hpp>
#include <catch2/catch_test_macros.hpp>
#include <pybind11/pytypes.h>
@@ -15,6 +12,10 @@
#include <pybind11/pybind11.h>
#include <string>
#include <pybind11/cast.h>
namespace Slic3r { class ICloudServiceAgent; }
namespace Slic3r { class IPrinterAgent; }
using namespace Slic3r;
namespace py = pybind11;
+1
View File
@@ -18,6 +18,7 @@
#include "libslic3r/LifecycleEvents.hpp"
#include "slic3r/Utils/PrintHost.hpp"
#include "slic3r/Utils/Flashforge.hpp"
#include "slic3r/Utils/Http.hpp"
using namespace Slic3r;
@@ -9,6 +9,9 @@
#include <numeric>
#include <random>
#include <vector>
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers.hpp>
#include <catch2/matchers/catch_matchers_floating_point.hpp>
using Catch::Matchers::WithinAbs;
using Slic3r::GUI::frame_time_stats;
@@ -147,6 +147,10 @@ TEST_CASE("orca.slicing is workflow-only: context exposes raw print/object; view
#include <boost/filesystem.hpp>
#include <boost/nowide/fstream.hpp>
#include <sstream>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Polyline.hpp"
#include <pybind11/detail/common.h>
#include <pybind11/detail/descr.h>
// psGCodePostProcess is the merged post-processing seam: no live Print (print/object are None), the
// plugin edits the file at ctx.gcode_path in place, and ctx.config_value() falls back to the config
@@ -8,7 +8,6 @@
#include "libslic3r/Model.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/Config.hpp"
#include <libslic3r/Utils.hpp>
#include <slic3r/plugin/PluginConfig.hpp>
#include "slic3r/plugin/PluginFsUtils.hpp"
#include <slic3r/plugin/PluginManager.hpp>
@@ -15,6 +15,11 @@
#include <string>
#include <vector>
class wxColour;
class wxPoint;
class wxSize;
class wxWindow;
using namespace Slic3r;
using namespace Slic3r::GUI;