96 auto separ = str.find(
"x");
97 if ((separ == std::string::npos) || (separ == 0) || (separ == str.length()-1))
return false;
99 int width = 0, height = 0;
102 width = std::stoi(str.substr(0,separ));
103 height = std::stoi(str.substr(separ+1));
108 if ((
width<=0) || (height<=0))
120 auto separ = str.find(
",");
121 if ((separ == std::string::npos) || (separ == 0) || (separ == str.length()-1))
return false;
126 x = std::stoi(str.substr(0,separ));
127 y = std::stoi(str.substr(separ+1));
154 std::string kind = _kind;
156 auto pos = kind.find(
"?");
160 }
else if (pos != std::string::npos) {
165 pos = kind.find(
"size:");
166 if (pos != std::string::npos) {
167 auto epos = kind.find_first_of(
" ;", pos+5);
168 if (epos == std::string::npos) epos = kind.length();
170 kind.erase(pos, epos-pos);
173 pos = kind.find(
"pos:");
174 if (pos != std::string::npos) {
175 auto epos = kind.find_first_of(
" ;", pos+4);
176 if (epos == std::string::npos) epos = kind.length();
178 kind.erase(pos, epos-pos);
182 if (kind.find(
"qt5:") == 0) {
188 while ((kind.length() > 0) && (kind[kind.length()-1] ==
' '))
189 kind.resize(kind.length()-1);
195 kind =
gROOT->GetWebDisplay().Data();
199 else if (kind.empty() || (kind ==
"native"))
201 else if (kind ==
"firefox")
203 else if ((kind ==
"chrome") || (kind ==
"chromium"))
205 else if ((kind ==
"cef") || (kind ==
"cef3"))
207 else if ((kind ==
"qt") || (kind ==
"qt5"))
209 else if ((kind ==
"embed") || (kind ==
"embedded"))
226 case kCEF:
return "cef";
227 case kQt5:
return "qt5";
228 case kLocal:
return "local";
232 auto pos =
fExec.find(
" ");
233 return (pos == std::string::npos) ?
fExec :
fExec.substr(0,pos);
255 if (opt.empty())
return;
270 if (url.empty() || urlopt.empty())
return url;
272 auto rpos = url.find(
"#");
273 if (rpos == std::string::npos) rpos = url.length();
275 if (url.find(
"?") != std::string::npos)
276 url.insert(rpos,
"&");
278 url.insert(rpos,
"?");
279 url.insert(rpos+1, urlopt);
304 if ((
fExec ==
"safari") || (
fExec ==
"Safari"))
305 return "open -a Safari";
319 std::string where =
"qt5";
322 where.append(std::to_string((
unsigned long) qparent));
324 if (!urlopt.empty()) {
326 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.
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)
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...
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.
@ 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
@ kStandard
standard system web browser, not recognized by ROOT, without batch mode
@ kQt5
QWebEngine libraries - Chrome 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)
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.