98 auto separ = str.find(
"x");
99 if ((
separ == std::string::npos) || (
separ == 0) || (
separ == str.length()-1))
return false;
122 auto separ = str.find(
",");
123 if ((
separ == std::string::npos) || (
separ == 0) || (
separ == str.length()-1))
return false;
128 x = std::stoi(str.substr(0,
separ));
129 y = std::stoi(str.substr(
separ+1));
134 if ((
x < 0) || (
y < 0))
161 std::string kind =
_kind;
163 auto pos = kind.find(
"?");
165 SetUrlOpt(kind.substr(1));
167 }
else if (pos != std::string::npos) {
168 SetUrlOpt(kind.substr(pos+1));
172 pos = kind.find(
"size:");
173 if (pos != std::string::npos) {
174 auto epos = kind.find_first_of(
" ;", pos+5);
175 if (
epos == std::string::npos)
epos = kind.length();
176 SetSizeAsStr(kind.substr(pos+5,
epos-pos-5));
177 kind.erase(pos,
epos-pos);
180 pos = kind.find(
"pos:");
181 if (pos != std::string::npos) {
182 auto epos = kind.find_first_of(
" ;", pos+4);
183 if (
epos == std::string::npos)
epos = kind.length();
184 SetPosAsStr(kind.substr(pos+4,
epos-pos-4));
185 kind.erase(pos,
epos-pos);
188 pos = kind.rfind(
"headless");
189 if ((pos != std::string::npos) && (pos == kind.length() - 8)) {
192 if ((pos > 0) && (kind[pos-1] ==
';')) kind.resize(pos-1);
196 if (kind.find(
"qt6:") == 0) {
197 SetDriverData((
void *) std::stoull(kind.substr(4)));
202 while ((kind.length() > 0) && (kind[kind.length()-1] ==
' '))
203 kind.resize(kind.length()-1);
209 kind =
gROOT->GetWebDisplay().Data();
212 SetBrowserKind(kLocal);
213 else if (kind ==
"native")
214 SetBrowserKind(kNative);
215 else if (kind.empty() || (kind ==
"on"))
217 else if ((kind ==
"dflt") || (kind ==
"default") || (kind ==
"browser"))
219 else if (kind ==
"firefox")
220 SetBrowserKind(kFirefox);
221 else if ((kind ==
"chrome") || (kind ==
"chromium"))
222 SetBrowserKind(kChrome);
224 else if (kind ==
"safari")
225 SetBrowserKind(kSafari);
228 else if ((kind ==
"edge") || (kind ==
"msedge"))
229 SetBrowserKind(kEdge);
231 else if ((kind ==
"cef") || (kind ==
"cef3"))
232 SetBrowserKind(kCEF);
233 else if ((kind ==
"qt") || (kind ==
"qt6"))
234 SetBrowserKind(kQt6);
235 else if ((kind ==
"embed") || (kind ==
"embedded"))
236 SetBrowserKind(kEmbedded);
237 else if (kind ==
"server")
238 SetBrowserKind(kServer);
239 else if (kind ==
"off")
240 SetBrowserKind(kOff);
241 else if (!SetSizeAsStr(kind))
252 switch (GetBrowserKind()) {
253 case kChrome:
return "chrome";
254 case kEdge:
return "edge";
255 case kSafari:
return "safari";
256 case kFirefox:
return "firefox";
257 case kNative:
return "native";
258 case kCEF:
return "cef";
259 case kQt6:
return "qt6";
260 case kLocal:
return "local";
262 case kServer:
return "server";
263 case kEmbedded:
return "embed";
264 case kOff:
return "off";
265 case kOn:
return "on";
267 auto pos = fExec.find(
" ");
268 return (pos == std::string::npos) ? fExec : fExec.substr(0,pos);
279 SetBrowserKind(kEmbedded);
281 fMasterConnection = connid;
282 fMasterChannel = channel;
291 if (opt.empty())
return;
293 if (!fUrlOpt.empty())
305 std::string
url = GetUrl(),
urlopt = GetUrlOpt();
309 if (
rpos == std::string::npos)
rpos =
url.length();
311 if (
url.find(
"?") != std::string::npos)
327 SetBrowserKind(kCustom);
336 if (GetBrowserKind() != kCustom)
340 if ((fExec ==
"safari") || (fExec ==
"Safari"))
341 return "open -a Safari";
#define R__LOG_ERROR(...)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
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.
bool SetPosAsStr(const std::string &str)
Set position of web browser window as string like "100,100".
static std::string GetQtEmbedQualifier(const void *qparent, const std::string &urlopt="", unsigned qtversion=0x60000)
Returns string which can be used as argument in RWebWindow::Show() method to display web window in pr...
void SetCustomExec(const std::string &exec)
set custom executable to start web browser
void SetMasterWindow(std::shared_ptr< RWebWindow > master, unsigned connid=0, int channel=-1)
Assign window, connection and channel id where other window will be embed.
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.
std::string GetCustomExec() const
returns custom executable to start web browser
static std::string GetQt5EmbedQualifier(const void *qparent, const std::string &urlopt="", unsigned qtversion=0x60000)
Returns string which can be used as argument in RWebWindow::Show() method to display web window in pr...
bool SetSizeAsStr(const std::string &str)
Set size of web browser window as string like "800x600".
RWebDisplayArgs()
Default constructor.
ROOT::RLogChannel & WebGUILog()
Log channel for WebGUI diagnostics.