Files
OrcaSlicer/src/slic3r/GUI/DeviceCore/DevExtensionTool.h
T
HanifKoh 1a5f91d727 Add Missing Includes Across src/slic3r/GUI (#16048)
* Add Missing Includes Across src/slic3r/GUI

Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained.

* Drop the OS-Specific Includes Added Outside Their Platform Guards

GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build.

* Add the clang-tidy Configuration That Generated These Includes

Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly.

* Match Windows Paths in the clang-tidy Ignore List

Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.
2026-10-02 14:56:56 +08:00

68 lines
1.4 KiB
C++

#pragma once
#include <memory>
#include <optional>
#include "libslic3r/CommonDefs.hpp"
#include "slic3r/Utils/json_diff.hpp"
#include <wx/string.h>
#include "DevDefs.h"
namespace Slic3r
{
//Previous definitions
class MachineObject;
// some extension tools for toolheads
class DevExtensionTool
{
friend class DevExtensionToolParser;
public:
static std::shared_ptr<DevExtensionTool> Create(MachineObject* obj) { return std::shared_ptr<DevExtensionTool>(new DevExtensionTool(obj)); }
public:
// tool type
bool IsToolTypeFanF000() const { return m_tool_type == TOOL_TYPE_FAN_F000; }
// mount state
bool IsMounted() const { return m_mount_3dp == MOUNT_MOUNTED; }
protected:
DevExtensionTool(MachineObject* obj);
private:
[[maybe_unused]] MachineObject* m_owner = nullptr;
enum MountState
{
MOUNT_NOT_MOUNTED = 0,
MOUNT_MOUNTED = 1,
MOUNT_NO_MODULE = 2,
MOUNT_NO_CABLE = 3
} m_mount_3dp;
enum CalibState
{
CALIB_NONE = 0,
CALIB_FIRST = 1,
CALIB_MOUNT = 2
} m_calib;
enum ToolType
{
TOOL_TYPE_EMPTY = 0,
TOOL_TYPE_CUT_CP00 = 1,
TOOL_TYPE_LASER_LB00 = 2,
TOOL_TYPE_FAN_F000 = 3,
} m_tool_type;
};
class DevExtensionToolParser
{
public:
static void ParseV2_0(const nlohmann::json& extension_tool_json, std::weak_ptr<DevExtensionTool> extension_tool);
};
};