#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DockPanel.hpp>
◆ CloseHandler
◆ MessageHandler
◆ DockPanel()
35{
36
37 browser()->Bind(wxEVT_WEBVIEW_NEWWINDOW, [](wxWebViewEvent& event) {
event.Veto(); });
38}
CloseHandler m_on_close
Definition DockPanel.hpp:53
std::string m_html
Definition DockPanel.hpp:50
MessageHandler m_on_message
Definition DockPanel.hpp:52
CloseHandler m_on_destroyed
Definition DockPanel.hpp:54
WebPanel(wxWindow *parent, const char *bridge_script)
Definition WebPanel.cpp:21
wxWebView * browser() const
Definition WebPanel.hpp:28
const char * orca_bridge_script()
Definition WebHosting.cpp:67
References Slic3r::GUI::WebPanel::WebPanel(), Slic3r::GUI::WebPanel::browser(), m_html, m_on_close, m_on_destroyed, and m_on_message.
◆ ~DockPanel()
| Slic3r::GUI::DockPanel::~DockPanel |
( |
| ) |
|
|
override |
◆ apply_theme()
| void Slic3r::GUI::WebPanel::apply_theme |
( |
| ) |
|
|
privateinherited |
◆ browser()
| wxWebView * Slic3r::GUI::WebPanel::browser |
( |
| ) |
const |
|
inlineprotectedinherited |
◆ destroy_silently()
| void Slic3r::GUI::DockPanel::destroy_silently |
( |
| ) |
|
◆ fire_close()
| void Slic3r::GUI::DockPanel::fire_close |
( |
| ) |
|
67{
69 return;
74 on_close();
75 }
76}
std::function< void()> CloseHandler
Definition DockPanel.hpp:22
References m_closing, and m_on_close.
Referenced by request_close().
◆ load_page_html()
| void Slic3r::GUI::WebPanel::load_page_html |
( |
| ) |
|
|
privateinherited |
◆ on_load_event()
| void Slic3r::GUI::WebPanel::on_load_event |
( |
wxWebViewEvent & | event | ) |
|
|
privateinherited |
◆ on_navigated()
| void Slic3r::GUI::WebPanel::on_navigated |
( |
wxWebViewEvent & | event | ) |
|
|
privateinherited |
◆ on_page_message()
| bool Slic3r::GUI::DockPanel::on_page_message |
( |
const std::string & | kind, |
|
|
const nlohmann::json & | data ) |
|
overrideprotectedvirtual |
Implements Slic3r::GUI::WebPanel.
47{
48 if (kind == "message") {
51 return true;
52 }
53 if (kind == "close") {
55 return true;
56 }
57 return false;
58}
void request_close()
Definition DockPanel.cpp:78
References m_on_message, and request_close().
◆ on_script_message()
| void Slic3r::GUI::WebPanel::on_script_message |
( |
wxWebViewEvent & | event | ) |
|
|
privateinherited |
84{
85 const nlohmann::json payload = nlohmann::json::parse(event.GetString().utf8_string(), nullptr, false);
86 if (!payload.is_object() || payload.value("channel", std::string()) != "orca")
87 return;
88
89 const std::string kind = payload.value("kind", std::string());
90 if (!
on_page_message(kind, payload.contains(
"data") ? payload[
"data"] : nlohmann::json()))
91 BOOST_LOG_TRIVIAL(warning) << "WebPanel ignored a window.orca '" << kind << "' call; this host does not support it";
92}
virtual bool on_page_message(const std::string &kind, const nlohmann::json &data)=0
References on_page_message().
Referenced by WebPanel().
◆ on_webview_recreated()
| void Slic3r::GUI::WebPanel::on_webview_recreated |
( |
wxCommandEvent & | event | ) |
|
|
privateinherited |
95{
96 SetBackgroundColour(wxGetApp().get_window_default_clr());
97 m_browser->SetBackgroundColour(GetBackgroundColour());
98 Refresh();
99
101}
References apply_theme(), and m_browser.
Referenced by WebPanel().
◆ page_html()
| std::optional< std::string > Slic3r::GUI::DockPanel::page_html |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
◆ post_to_page()
| void Slic3r::GUI::WebPanel::post_to_page |
( |
const std::string & | json | ) |
|
|
protectedinherited |
◆ push_message()
| void Slic3r::GUI::DockPanel::push_message |
( |
const nlohmann::json & | data | ) |
|
◆ remove_pane()
| void Slic3r::GUI::DockPanel::remove_pane |
( |
| ) |
|
|
private |
100{
103 else
104 Destroy();
105}
void remove_dock_pane(wxWindow *window)
Definition Plater.cpp:19169
static Plater * plater()
Definition GUI_Factories.cpp:400
@ Plater
Definition Shortcuts.hpp:21
References Slic3r::GUI::plater().
Referenced by destroy_silently().
◆ request_close()
| void Slic3r::GUI::DockPanel::request_close |
( |
| ) |
|
79{
81 return;
83
84
85 wxWeakRef<DockPanel> self(this);
86 CallAfter([self]() {
87 if (self)
88 self->remove_pane();
89 });
90}
void fire_close()
Definition DockPanel.cpp:66
References fire_close(), and m_closing.
Referenced by on_page_message().
◆ m_browser
| wxWebView* Slic3r::GUI::WebPanel::m_browser {nullptr} |
|
privateinherited |
◆ m_closing
| bool Slic3r::GUI::DockPanel::m_closing {false} |
|
private |
◆ m_content_loaded
| bool Slic3r::GUI::WebPanel::m_content_loaded {false} |
|
privateinherited |
◆ m_content_navigated
| bool Slic3r::GUI::WebPanel::m_content_navigated {false} |
|
privateinherited |
◆ m_html
| std::string Slic3r::GUI::DockPanel::m_html |
|
private |
◆ m_on_close
◆ m_on_destroyed
◆ m_on_message
◆ m_own_page_load
| bool Slic3r::GUI::WebPanel::m_own_page_load {false} |
|
privateinherited |
The documentation for this class was generated from the following files:
- /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DockPanel.hpp
- /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DockPanel.cpp