mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-15 11:51:33 +00:00
* feat: add orcacloud to homepage * feat: add OrcaCloud webview pane and session handoff from the app * feat: OrcaCloud pane crash, per-open re-sign-in, and web-session persistence * fix: clang-tidy
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
#ifndef slic3r_GUI_WebView_hpp_
|
|
#define slic3r_GUI_WebView_hpp_
|
|
|
|
#include <wx/string.h>
|
|
#include <wx/setup.h>
|
|
#include <wx/webview.h>
|
|
#include <wx/event.h>
|
|
|
|
class wxWebView;
|
|
class wxWindow;
|
|
|
|
wxDECLARE_EVENT(EVT_WEBVIEW_RECREATED, wxCommandEvent);
|
|
|
|
class WebView
|
|
{
|
|
public:
|
|
static wxWebView *CreateWebView(wxWindow *parent, wxString const &url);
|
|
#if wxUSE_WEBVIEW_EDGE
|
|
static bool CheckWebViewRuntime();
|
|
static bool DownloadAndInstallWebViewRuntime();
|
|
#endif
|
|
static void LoadUrl(wxWebView * webView, wxString const &url);
|
|
|
|
// Returns the URL truncated at the first '?' or '#', so a query/fragment carrying secrets
|
|
// (e.g. a session-handoff token) is never written to a log.
|
|
static wxString RedactUrl(const wxString& url);
|
|
|
|
static bool RunScript(wxWebView * webView, wxString const & msg);
|
|
|
|
// Marks "wx" as registered so CreateWebView's deferred add skips the duplicate.
|
|
static void MarkScriptMessageHandlerAdded(wxWebView * webView);
|
|
|
|
// On Windows, a WebView2 backend created during a GUI rebuild (language switch) can come up
|
|
// ignoring every navigation. A panel that gets true here recreates its view on first Show().
|
|
static bool NeedsRecreateOnShow();
|
|
|
|
static void RecreateAll();
|
|
};
|
|
|
|
#endif // !slic3r_GUI_WebView_hpp_
|