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

101 lines
2.8 KiB
C++

#ifndef slic3r_SliceInfoPanel_hpp_
#define slic3r_SliceInfoPanel_hpp_
#include "slic3r/GUI/MonitorBasePanel.h"
#include "libslic3r/ProjectTask.hpp"
#include "DeviceManager.hpp"
#include "GUI.hpp"
#include <wx/gdicmn.h>
#include <cstddef>
#include <wx/event.h>
#include <memory>
#include "slic3r/GUI/wxExtensions.hpp"
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/scrolwin.h>
#include <wx/rtti.h>
#include <wx/sizer.h>
#include <wx/string.h>
#include <wx/webrequest.h>
#include "Widgets/PopupWindow.hpp"
namespace Slic3r {
namespace GUI {
class SliceInfoPopup : public PopupWindow
{
public:
SliceInfoPopup(wxWindow *parent, wxBitmap bmp= wxNullBitmap, BBLSliceInfo* info=nullptr);
virtual ~SliceInfoPopup() {}
// PopupWindow virtual methods are all overridden to log them
virtual void Popup(wxWindow *focus = NULL) wxOVERRIDE;
virtual void OnDismiss() wxOVERRIDE;
virtual bool ProcessLeftDown(wxMouseEvent &event) wxOVERRIDE;
virtual bool Show(bool show = true) wxOVERRIDE;
private:
wxScrolledWindow *m_panel;
void OnMouse(wxMouseEvent &event);
void OnSize(wxSizeEvent &event);
void OnSetFocus(wxFocusEvent &event);
void OnKillFocus(wxFocusEvent &event);
private:
wxDECLARE_ABSTRACT_CLASS(SliceInfoPopup);
wxDECLARE_EVENT_TABLE();
};
class SliceInfoPanel : public wxPanel
{
private:
protected:
wxWebRequest web_request;
std::shared_ptr<ImageTransientPopup> m_thumbnail_popup;
std::shared_ptr<SliceInfoPopup> m_slice_info_popup;
wxImage m_thumbnail_img;
wxBoxSizer * m_item_top_sizer;
wxStaticBitmap* m_bmp_item_thumbnail;
wxStaticBitmap* m_bmp_item_prediction;
wxStaticBitmap* m_bmp_item_print;
wxStaticText* m_text_item_prediction;
wxStaticBitmap* m_bmp_item_cost;
wxStaticText* m_text_item_cost;
wxGridSizer* m_filament_info_sizer;
wxStaticText* m_text_plate_index;
public:
SliceInfoPanel(wxWindow * parent,
wxBitmap &prediction,
wxBitmap &cost,
wxBitmap &print,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxTAB_TRAVERSAL,
const wxString &name = wxEmptyString);
~SliceInfoPanel();
void SetImages(wxBitmap &prediction, wxBitmap &cost, wxBitmap &printing);
void on_subtask_print(wxCommandEvent &evt);
void on_thumbnail_enter(wxMouseEvent &event);
void on_thumbnail_leave(wxMouseEvent &event);
void on_mouse_enter(wxMouseEvent &event);
void on_mouse_leave(wxMouseEvent &event);
void on_webrequest_state(wxWebRequestEvent &evt);
void update(BBLSliceInfo* info);
void msw_rescale();
};
}
}
#endif