93 auto separ = str.find(
"x");
94 if ((separ == std::string::npos) || (separ == 0) || (separ == str.length()-1))
return false;
96 int width = 0, height = 0;
99 width = std::stoi(str.substr(0,separ));
100 height = std::stoi(str.substr(separ+1));
105 if ((
width<=0) || (height<=0))
117 auto separ = str.find(
",");
118 if ((separ == std::string::npos) || (separ == 0) || (separ == str.length()-1))
return false;
123 x = std::stoi(str.substr(0,separ));
124 y = std::stoi(str.substr(separ+1));
152 std::string kind = _kind;
154 auto pos = kind.find(
"?");
158 }
else if (pos != std::string::npos) {
163 pos = kind.find(
"size:");
164 if (pos != std::string::npos) {
165 auto epos = kind.find_first_of(
" ;", pos+5);
166 if (epos == std::string::npos) epos = kind.length();
168 kind.erase(pos, epos-pos);
171 pos = kind.find(
"pos:");
172 if (pos != std::string::npos) {
173 auto epos = kind.find_first_of(
" ;", pos+4);
174 if (epos == std::string::npos) epos = kind.length();
176 kind.erase(pos, epos-pos);
179 pos = kind.rfind(
"headless");
180 if ((pos != std::string::npos) && (pos == kind.length() - 8)) {
183 if ((pos > 0) && (kind[pos-1] ==
';')) kind.resize(pos-1);
187 if ((kind.find(
"qt5:") == 0) || (kind.find(
"qt6:") == 0)) {
193 while ((kind.length() > 0) && (kind[kind.length()-1] ==
' '))
194 kind.resize(kind.length()-1);
200 kind =
gROOT->GetWebDisplay().Data();
204 else if (kind.empty() || (kind ==
"native"))
206 else if (kind ==
"firefox")
208 else if ((kind ==
"chrome") || (kind ==
"chromium"))
210 else if ((kind ==
"cef") || (kind ==
"cef3"))
212 else if ((kind ==
"qt") || (kind ==
"qt5"))
214 else if (kind ==
"qt6")
216 else if ((kind ==
"embed") || (kind ==
"embedded"))
218 else if (kind ==
"off")
235 case kCEF:
return "cef";
236 case kQt5:
return "qt5";
237 case kQt6:
return "qt6";
238 case kLocal:
return "local";
241 case kOff:
return "off";
243 auto pos =
fExec.find(
" ");
244 return (pos == std::string::npos) ?
fExec :
fExec.substr(0,pos);
266 if (opt.empty())
return;
281 if (url.empty() || urlopt.empty())
return url;
283 auto rpos = url.find(
"#");
284 if (rpos == std::string::npos) rpos = url.length();
286 if (url.find(
"?") != std::string::npos)
287 url.insert(rpos,
"&");
289 url.insert(rpos,
"?");
290 url.insert(rpos+1, urlopt);
315 if ((
fExec ==
"safari") || (
fExec ==
"Safari"))
316 return "open -a Safari";
330 std::string where =
"qt5";
333 where.append(std::to_string((uintptr_t) qparent));
335 if (!urlopt.empty()) {
337 where.append(urlopt);
include TDocParser_001 C image html pict1_TDocParser_001 png width
A log configuration for a channel, e.g.
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
std::string GetBrowserName() const
Returns configured browser name.
virtual ~RWebDisplayArgs()
Destructor must be defined in source code to correctly call RWebWindow destructor.
const std::string & GetUrlOpt() const
returns window url options
bool SetPosAsStr(const std::string &str)
Set position of web browser window as string like "100,100".
RWebDisplayArgs & SetPos(int x=-1, int y=-1)
set preferable web window x and y position, negative is default
static std::string GetQt5EmbedQualifier(const void *qparent, const std::string &urlopt="")
returns string which can be used as argument in RWebWindow::Show() method to display web window in pr...
void SetHeadless(bool on=true)
set headless mode
int fMasterChannel
! used master channel
void SetMasterWindow(std::shared_ptr< RWebWindow > master, int channel=-1)
Assign window and channel id where other window will be embed.
EBrowserKind GetBrowserKind() const
returns configured browser kind, see EBrowserKind for supported values
void SetCustomExec(const std::string &exec)
set custom executable to start web browser
std::shared_ptr< RWebWindow > fMaster
! master window
void AppendUrlOpt(const std::string &opt)
append extra url options, add "&" as separator if required
std::string GetFullUrl() const
returns window url with append options
RWebDisplayArgs & SetBrowserKind(const std::string &kind)
Set browser kind as string argument Recognized values: chrome - use Google Chrome web browser,...
std::string fExec
! string to run browser, used with kCustom type
std::string GetCustomExec() const
returns custom executable to start web browser
std::string fUrlOpt
! extra URL options, which are append to window URL
@ kFirefox
Mozilla Firefox browser.
@ kCEF
Chromium Embedded Framework - local display with CEF libs.
@ kChrome
Google Chrome browser.
@ kQt6
Qt6 QWebEngine libraries - Chromium code packed in qt6.
@ kCustom
custom web browser, execution string should be provided
@ kNative
either Chrome or Firefox - both support major functionality
@ kEmbedded
window will be embedded into other, no extra browser need to be started
@ kLocal
either CEF or Qt5 - both runs on local display without real http server
@ kOff
disable web display, do not start any browser
@ kStandard
standard system web browser, not recognized by ROOT, without batch mode
@ kQt5
Qt5 QWebEngine libraries - Chromium code packed in qt5.
RWebDisplayArgs & SetUrlOpt(const std::string &opt)
set window url options
void SetDriverData(void *data)
[internal] set web-driver data, used to start window
RWebDisplayArgs & SetSize(int w, int h)
set preferable web window width and height
const std::string & GetUrl() const
returns window url
bool SetSizeAsStr(const std::string &str)
Set size of web browser window as string like "800x600".
RWebDisplayArgs()
Default constructor - browser kind configured from gROOT->GetWebDisplay()
RLogChannel & WebGUILog()
Log channel for WebGUI diagnostics.