mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-07 15:51:08 +00:00
* 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.
118 lines
3.3 KiB
C++
118 lines
3.3 KiB
C++
#ifndef slic3r_MultiMachinePage_hpp_
|
|
#define slic3r_MultiMachinePage_hpp_
|
|
|
|
#include "libslic3r/libslic3r.h"
|
|
#include "GUI_App.hpp"
|
|
#include "GUI_Utils.hpp"
|
|
#include "MultiTaskManagerPage.hpp"
|
|
#include "MultiMachineManagerPage.hpp"
|
|
#include "Tabbook.hpp"
|
|
#include "Lazy.hpp"
|
|
|
|
#include "wx/button.h"
|
|
#include <wx/panel.h>
|
|
#include <wx/timer.h>
|
|
#include <wx/sizer.h>
|
|
#include <wx/string.h>
|
|
#include <wx/gdicmn.h>
|
|
#include "slic3r/GUI/MultiMachine.hpp"
|
|
#include <wx/dc.h>
|
|
#include <wx/event.h>
|
|
#include "slic3r/GUI/wxExtensions.hpp"
|
|
#include "slic3r/GUI/Widgets/Label.hpp"
|
|
#include <wx/scrolwin.h>
|
|
#include <map>
|
|
#include <string>
|
|
|
|
namespace Slic3r {
|
|
namespace GUI {
|
|
|
|
#define PICK_LEFT_PADDING_LEFT 15
|
|
#define PICK_LEFT_PRINTABLE 40
|
|
#define PICK_LEFT_DEV_NAME 250
|
|
#define PICK_LEFT_DEV_STATUS 250
|
|
#define PICK_DEVICE_MAX 6
|
|
|
|
class MultiMachinePage : public wxPanel, public LazyInstance<MultiMachinePage>
|
|
{
|
|
private:
|
|
wxTimer* m_refresh_timer = nullptr;
|
|
wxSizer* m_main_sizer{ nullptr };
|
|
LocalTaskManagerPage* m_local_task_manager{ nullptr };
|
|
CloudTaskManagerPage* m_cloud_task_manager{ nullptr };
|
|
MultiMachineManagerPage* m_machine_manager{ nullptr };
|
|
Tabbook* m_tabpanel{ nullptr };
|
|
|
|
public:
|
|
MultiMachinePage(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL);
|
|
~MultiMachinePage();
|
|
|
|
void jump_to_send_page();
|
|
|
|
void on_sys_color_changed();
|
|
void msw_rescale();
|
|
bool Show(bool show);
|
|
|
|
void init_tabpanel();
|
|
void init_timer();
|
|
void on_timer(wxTimerEvent& event);
|
|
|
|
void clear_page();
|
|
};
|
|
|
|
|
|
class DevicePickItem : public DeviceItem
|
|
{
|
|
|
|
public:
|
|
DevicePickItem(wxWindow* parent, MachineObject* obj);
|
|
~DevicePickItem() {};
|
|
|
|
void DrawTextWithEllipsis(wxDC& dc, const wxString& text, int maxWidth, int left, int top = 0);
|
|
void OnEnterWindow(wxMouseEvent& evt);
|
|
void OnLeaveWindow(wxMouseEvent& evt);
|
|
void OnSelectedDevice(wxCommandEvent& evt);
|
|
void OnLeftDown(wxMouseEvent& evt);
|
|
void OnMove(wxMouseEvent& evt);
|
|
|
|
void paintEvent(wxPaintEvent& evt);
|
|
void render(wxDC& dc);
|
|
void doRender(wxDC& dc);
|
|
void post_event(wxCommandEvent&& event);
|
|
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
|
|
|
public:
|
|
bool m_hover{ false };
|
|
ScalableBitmap m_bitmap_check_disable;
|
|
ScalableBitmap m_bitmap_check_off;
|
|
ScalableBitmap m_bitmap_check_on;
|
|
};
|
|
|
|
|
|
class MultiMachinePickPage : public DPIDialog
|
|
{
|
|
private:
|
|
AppConfig* app_config;
|
|
Label* m_label{ nullptr };
|
|
wxScrolledWindow* scroll_macine_list{ nullptr };
|
|
wxBoxSizer* sizer_machine_list{ nullptr };
|
|
std::map<std::string, DevicePickItem*> m_device_items;
|
|
int m_selected_count{0};
|
|
public:
|
|
MultiMachinePickPage(Plater* plater = nullptr);
|
|
~MultiMachinePickPage();
|
|
|
|
int get_selected_count();
|
|
void update_selected_count();
|
|
void on_dpi_changed(const wxRect& suggested_rect);
|
|
void on_sys_color_changed();
|
|
void refresh_user_device();
|
|
void on_confirm(wxCommandEvent& event);
|
|
bool Show(bool show);
|
|
};
|
|
|
|
} // namespace GUI
|
|
} // namespace Slic3r
|
|
|
|
#endif
|