42 SetBrowserKind(browser);
51 SetBrowserKind(browser);
59 SetSize(
width, height);
61 SetBrowserKind(browser);
69 SetMasterWindow(master, channel);
86 auto separ = str.find(
"x");
87 if ((separ == std::string::npos) || (separ == 0) || (separ == str.length()-1))
return false;
89 int width = 0, height = 0;
92 width = std::stoi(str.substr(0,separ));
93 height = std::stoi(str.substr(separ+1));
98 if ((
width<=0) || (height<=0))
101 SetSize(
width, height);
110 auto separ = str.find(
",");
111 if ((separ == std::string::npos) || (separ == 0) || (separ == str.length()-1))
return false;
116 x = std::stoi(str.substr(0,separ));
117 y = std::stoi(str.substr(separ+1));
144 std::string kind = _kind;
146 auto pos = kind.find(
"?");
148 SetUrlOpt(kind.substr(1));
152 pos = kind.find(
"size:");
153 if (pos != std::string::npos) {
154 auto epos = kind.find_first_of(
" ;", pos+5);
155 if (epos == std::string::npos) epos = kind.length();
156 SetSizeAsStr(kind.substr(pos+5, epos-pos-5));
157 kind.erase(pos, epos-pos);
160 pos = kind.find(
"pos:");
161 if (pos != std::string::npos) {
162 auto epos = kind.find_first_of(
" ;", pos+4);
163 if (epos == std::string::npos) epos = kind.length();
164 SetPosAsStr(kind.substr(pos+4, epos-pos-4));
165 kind.erase(pos, epos-pos);
169 while ((kind.length() > 0) && (kind[kind.length()-1] ==
' '))
170 kind.resize(kind.length()-1);
176 kind =
gROOT->GetWebDisplay().Data();
179 SetBrowserKind(kLocal);
180 else if (kind.empty() || (kind ==
"native"))
181 SetBrowserKind(kNative);
182 else if (kind ==
"firefox")
183 SetBrowserKind(kFirefox);
184 else if ((kind ==
"chrome") || (kind ==
"chromium"))
185 SetBrowserKind(kChrome);
186 else if ((kind ==
"cef") || (kind ==
"cef3"))
187 SetBrowserKind(kCEF);
188 else if ((kind ==
"qt") || (kind ==
"qt5"))
189 SetBrowserKind(kQt5);
190 else if ((kind ==
"embed") || (kind ==
"embedded"))
191 SetBrowserKind(kEmbedded);
192 else if (!SetSizeAsStr(kind))
203 switch (GetBrowserKind()) {
204 case kChrome:
return "chrome";
205 case kFirefox:
return "firefox";
206 case kNative:
return "native";
207 case kCEF:
return "cef";
208 case kQt5:
return "qt5";
209 case kLocal:
return "local";
210 case kStandard:
return "default";
211 case kEmbedded:
return "embed";
213 auto pos = fExec.find(
" ");
214 return (pos == std::string::npos) ? fExec : fExec.substr(0,pos);
225 SetBrowserKind(kEmbedded);
227 fMasterChannel = channel;
236 if (opt.empty())
return;
238 if (!fUrlOpt.empty())
250 std::string url = GetUrl(), urlopt = GetUrlOpt();
251 if (url.empty() || urlopt.empty())
return url;
253 auto rpos = url.find(
"#");
254 if (rpos == std::string::npos) rpos = url.length();
256 if (url.find(
"?") != std::string::npos)
257 url.insert(rpos,
"&");
259 url.insert(rpos,
"?");
260 url.insert(rpos+1, urlopt);
272 SetBrowserKind(kCustom);
281 if (GetBrowserKind() != kCustom)
285 if ((fExec ==
"safari") || (fExec ==
"Safari"))
286 return "open -a Safari";
include TDocParser_001 C image html pict1_TDocParser_001 png width
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
std::string GetCustomExec() const
returns custom executable to start web browser
RWebDisplayArgs & SetBrowserKind(const std::string &kind)
Set browser kind as string argument Recognized values: chrome - use Google Chrome web browser,...
std::string GetFullUrl() const
returns window url with append options
bool SetPosAsStr(const std::string &str)
Set position of web browser window as string like "100,100".
std::string GetBrowserName() const
Returns configured browser name.
void SetCustomExec(const std::string &exec)
set custom executable to start web browser
virtual ~RWebDisplayArgs()
Destructor.
void AppendUrlOpt(const std::string &opt)
append extra url options, add "&" as separator if required
void SetMasterWindow(std::shared_ptr< RWebWindow > master, int channel=-1)
Assign window and channel id where other window will be embed.
RWebDisplayArgs()
Default constructor - browser kind configured from gROOT->GetWebDisplay()
bool SetSizeAsStr(const std::string &str)
Set size of web browser window as string like "800x600".