Files
OrcaSlicer/src/slic3r/GUI/FilamentGroupPopup.hpp
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

96 lines
2.5 KiB
C++

#ifndef FILAMENT_GROUP_HOVER_HPP
#define FILAMENT_GROUP_HOVER_HPP
#include <vector>
#include <wx/bitmap.h>
#include <wx/bmpbuttn.h>
#include <wx/event.h>
#include <wx/sizer.h>
#include <wx/timer.h>
#include "libslic3r/PrintConfig.hpp"
#include "Widgets/PopupWindow.hpp"
#include "Widgets/Label.hpp"
#include "Widgets/SwitchButton.hpp"
#include "Widgets/StaticBox.hpp"
namespace Slic3r { namespace GUI {
class PartPlate;
class Plater;
bool play_dual_extruder_slice_video();
bool play_dual_extruder_print_tpu_video();
bool open_filament_group_wiki();
class FilamentGroupPopup : public PopupWindow
{
public:
FilamentGroupPopup(wxWindow *parent);
void tryPopup(Plater* plater,PartPlate* plate, bool slice_all);
void tryClose();
FilamentMapMode GetSelectedMode() const { return m_mode; }
private:
void OnPaint(wxPaintEvent&event);
void StartTimer();
void ResetTimer();
void OnRadioBtn(int idx);
void OnLeaveWindow(wxMouseEvent &);
void OnEnterWindow(wxMouseEvent &);
void OnTimer(wxTimerEvent &event);
void Dismiss();
void CreateBmps();
void Init();
void UpdateButtonStatus(int hover_idx = -1);
void DrawRoundedCorner(int radius);
void MakeSmartFilamentSection(wxSizer *top_sizer, int horizontal_margin, int vertical_padding);
void UpdateSmartFilamentSection();
void OnSmartFilamentToggle(wxCommandEvent &event);
private:
FilamentMapMode GetFilamentMapMode() const;
void SetFilamentMapMode(const FilamentMapMode mode);
private:
enum ButtonType { btForFlush, btForMatch, btManual, btCount };
const std::vector<FilamentMapMode> mode_list = {fmmAutoForFlush, fmmAutoForMatch, fmmManual};
bool m_connected{ false };
bool m_active{ false };
bool m_sync_plate{ false };
bool m_slice_all{ false };
FilamentMapMode m_mode;
wxTimer *m_timer;
std::vector<wxBitmapButton*> radio_btns;
std::vector<Label *> button_labels;
std::vector<Label *> button_desps;
std::vector<Label *> detail_infos;
wxBitmap checked_bmp;
wxBitmap unchecked_bmp;
wxBitmap disabled_bmp;
wxBitmap checked_hover_bmp;
wxBitmap unchecked_hover_bmp;
wxBitmap global_tag_bmp;
wxStaticText *wiki_link;
wxStaticText *video_link;
StaticBox *m_smart_filament_panel{nullptr};
wxSizerItem *m_smart_filament_spacer{nullptr};
SwitchButton *m_smart_filament_switch{nullptr};
PartPlate* partplate_ref{ nullptr };
Plater* plater_ref{ nullptr };
};
}} // namespace Slic3r::GUI
#endif