Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RWebWindowsManager.cxx
Go to the documentation of this file.
1// Author: Sergey Linev <s.linev@gsi.de>
2// Date: 2017-10-16
3// Warning: This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
4
5/*************************************************************************
6 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
14
15#include <ROOT/RLogger.hxx>
18
20
21#include "THttpServer.h"
22
23#include "TSystem.h"
24#include "TRandom.h"
25#include "TString.h"
26#include "TApplication.h"
27#include "TTimer.h"
28#include "TROOT.h"
29#include "TEnv.h"
30
31#include <thread>
32#include <chrono>
33
34using namespace ROOT::Experimental;
35
36/** \class ROOT::Experimental::RWebWindowsManager
37\ingroup webdisplay
38
39Central instance to create and show web-based windows like Canvas or FitPanel.
40
41Manager responsible to creating THttpServer instance, which is used for RWebWindow's
42communication with clients.
43
44Method RWebWindowsManager::Show() used to show window in specified location.
45*/
46
47//////////////////////////////////////////////////////////////////////////////////////////
48/// Returns default window manager
49/// Used to display all standard ROOT elements like TCanvas or TFitPanel
50
51std::shared_ptr<RWebWindowsManager> &RWebWindowsManager::Instance()
52{
53 static std::shared_ptr<RWebWindowsManager> sInstance = std::make_shared<RWebWindowsManager>();
54 return sInstance;
55}
56
57//////////////////////////////////////////////////////////////////
58/// This thread id used to identify main application thread, where ROOT event processing runs
59/// To inject code in that thread, one should use TTimer (like THttpServer does)
60/// In other threads special run methods have to be invoked like RWebWindow::Run()
61///
62/// TODO: probably detection of main thread should be delivered by central ROOT instances like gApplication or gROOT
63/// Main thread can only make sense if special processing runs there and one can inject own functionality there
64
65static std::thread::id gWebWinMainThrd = std::this_thread::get_id();
66
67//////////////////////////////////////////////////////////////////////////////////////////
68/// Returns true when called from main process
69/// Main process recognized at the moment when library is loaded
70/// It supposed to be a thread where gApplication->Run() will be called
71/// If application runs in separate thread, one have to use AssignMainThrd() method
72/// to let RWebWindowsManager correctly recognize such situation
73
75{
76 return std::this_thread::get_id() == gWebWinMainThrd;
77}
78
79//////////////////////////////////////////////////////////////////////////////////////////
80/// Re-assigns main thread id
81/// Normally main thread id recognized at the moment when library is loaded
82/// It supposed to be a thread where gApplication->Run() will be called
83/// If application runs in separate thread, one have to call this method
84/// to let RWebWindowsManager correctly recognize such situation
85
87{
88 gWebWinMainThrd = std::this_thread::get_id();
89}
90
91
92//////////////////////////////////////////////////////////////////////////////////////////
93/// window manager constructor
94/// Required here for correct usage of unique_ptr<THttpServer>
95
97
98//////////////////////////////////////////////////////////////////////////////////////////
99/// window manager destructor
100/// Required here for correct usage of unique_ptr<THttpServer>
101
103{
104 if (gApplication && fServer && !fServer->IsTerminated()) {
105 gApplication->Disconnect("Terminate(Int_t)", fServer.get(), "SetTerminate()");
106 fServer->SetTerminate();
107 }
108}
109
110//////////////////////////////////////////////////////////////////////////////////////////
111/// Creates http server, if required - with real http engine (civetweb)
112/// One could configure concrete HTTP port, which should be used for the server,
113/// provide following entry in rootrc file:
114///
115/// WebGui.HttpPort: 8088
116///
117/// or specify range of http ports, which can be used:
118///
119/// WebGui.HttpPortMin: 8800
120/// WebGui.HttpPortMax: 9800
121///
122/// By default range [8800..9800] is used
123///
124/// One also can bind HTTP server socket to loopback address,
125/// In that case only connection from localhost will be available:
126///
127/// WebGui.HttpLoopback: yes
128///
129/// Or one could specify hostname which should be used for binding of server socket
130///
131/// WebGui.HttpBind: hostname | ipaddress
132///
133/// To use secured protocol, following parameter should be specified
134///
135/// WebGui.UseHttps: yes
136/// WebGui.ServerCert: sertificate_filename.pem
137///
138/// One also can configure usage of special thread of processing of http server requests
139///
140/// WebGui.HttpThrd: no
141///
142/// Extra threads can be used to send data to different clients via websocket (default no)
143///
144/// WebGui.SenderThrds: no
145///
146/// If required, one could change websocket timeouts (default is 10000 ms)
147///
148/// WebGui.HttpWSTmout: 10000
149///
150/// By default, THttpServer created in restricted mode which only allows websocket handlers
151/// and processes only very few other related http requests. For security reasons such mode
152/// should be always enabled. Only if it is really necessary to process all other kinds
153/// of HTTP requests, one could specify 0 for following parameter (default 1):
154///
155/// WebGui.WSOnly: 1
156///
157/// Following parameter controls browser max-age caching parameter for files (default 3600)
158///
159/// WebGui.HttpMaxAge: 3600
160///
161/// One also can configure usage of FastCGI server for web windows:
162///
163/// WebGui.FastCgiPort: 4000
164/// WebGui.FastCgiThreads: 10
165///
166/// To be able start web browser for such windows, one can provide real URL of the
167/// web server which will connect with that FastCGI instance:
168///
169/// WebGui.FastCgiServer: https://your_apache_server.com/root_cgi_path
170///
171
173{
174 // explicitly protect server creation
175 std::lock_guard<std::recursive_mutex> grd(fMutex);
176
177 if (!fServer) {
178
179 fServer = std::make_unique<THttpServer>("basic_sniffer");
180
181 const char *serv_thrd = gEnv->GetValue("WebGui.HttpThrd", "");
182 if (serv_thrd && strstr(serv_thrd, "yes"))
183 fUseHttpThrd = true;
184 else if (serv_thrd && strstr(serv_thrd, "no"))
185 fUseHttpThrd = false;
186
187 const char *send_thrds = gEnv->GetValue("WebGui.SenderThrds", "");
188 if (send_thrds && *send_thrds) {
189 if (strstr(send_thrds, "yes"))
190 fUseSenderThreads = true;
191 else if (strstr(send_thrds, "no"))
192 fUseSenderThreads = false;
193 else
194 R__LOG_ERROR(WebGUILog()) << "WebGui.SenderThrds has to be yes or no";
195 }
196
197 if (IsUseHttpThread())
198 fServer->CreateServerThread();
199
200 if (gApplication)
201 gApplication->Connect("Terminate(Int_t)", "THttpServer", fServer.get(), "SetTerminate()");
202
203 Int_t wsonly = gEnv->GetValue("WebGui.WSOnly", 1);
204 fServer->SetWSOnly(wsonly != 0);
205
206 // this is location where all ROOT UI5 sources are collected
207 // normally it is $ROOTSYS/ui5 or <prefix>/ui5 location
208 TString ui5dir = gSystem->Getenv("ROOTUI5SYS");
209 if (ui5dir.Length() == 0)
210 ui5dir = gEnv->GetValue("WebGui.RootUi5Path","");
211
212 if (ui5dir.Length() == 0)
213 ui5dir.Form("%s/ui5", TROOT::GetDataDir().Data());
214
215 if (gSystem->ExpandPathName(ui5dir)) {
216 R__LOG_ERROR(WebGUILog()) << "Path to ROOT ui5 sources " << ui5dir << " not found, set ROOTUI5SYS correctly";
217 ui5dir = ".";
218 }
219
220 fServer->AddLocation("rootui5sys/", ui5dir.Data());
221 }
222
223 if (!with_http || fServer->IsAnyEngine())
224 return true;
225
226 int http_port = gEnv->GetValue("WebGui.HttpPort", 0);
227 int http_min = gEnv->GetValue("WebGui.HttpPortMin", 8800);
228 int http_max = gEnv->GetValue("WebGui.HttpPortMax", 9800);
229 int http_wstmout = gEnv->GetValue("WebGui.HttpWSTmout", 10000);
230 int http_maxage = gEnv->GetValue("WebGui.HttpMaxAge", -1);
231 int fcgi_port = gEnv->GetValue("WebGui.FastCgiPort", 0);
232 int fcgi_thrds = gEnv->GetValue("WebGui.FastCgiThreads", 10);
233 const char *fcgi_serv = gEnv->GetValue("WebGui.FastCgiServer", "");
234 fLaunchTmout = gEnv->GetValue("WebGui.LaunchTmout", 30.);
235 const char *http_loopback = gEnv->GetValue("WebGui.HttpLoopback", "no");
236 const char *http_bind = gEnv->GetValue("WebGui.HttpBind", "");
237 const char *http_ssl = gEnv->GetValue("WebGui.UseHttps", "no");
238 const char *ssl_cert = gEnv->GetValue("WebGui.ServerCert", "rootserver.pem");
239
240 bool assign_loopback = http_loopback && strstr(http_loopback, "yes");
241 bool use_secure = http_ssl && strstr(http_ssl, "yes");
242 int ntry = 100;
243
244 if ((http_port < 0) && (fcgi_port <= 0)) {
245 R__LOG_ERROR(WebGUILog()) << "Not allowed to create HTTP server, check WebGui.HttpPort variable";
246 return false;
247 }
248
249 if (http_port < 0) {
250 ntry = 0;
251 } else {
252
253 if (http_port == 0)
254 gRandom->SetSeed(0);
255
256 if (http_max - http_min < ntry)
257 ntry = http_max - http_min;
258 }
259
260 if (fcgi_port > 0)
261 ntry++;
262
263 while (ntry-- >= 0) {
264 if ((http_port == 0) && (fcgi_port <= 0)) {
265 if ((http_min <= 0) || (http_max <= http_min)) {
266 R__LOG_ERROR(WebGUILog()) << "Wrong HTTP range configuration, check WebGui.HttpPortMin/Max variables";
267 return false;
268 }
269
270 http_port = (int)(http_min + (http_max - http_min) * gRandom->Rndm(1));
271 }
272
273 TString engine, url;
274
275 if (fcgi_port > 0) {
276 engine.Form("fastcgi:%d?thrds=%d", fcgi_port, fcgi_thrds);
277 if (!fServer->CreateEngine(engine)) return false;
278 if (fcgi_serv && (strlen(fcgi_serv) > 0)) fAddr = fcgi_serv;
279 if (http_port < 0) return true;
280 fcgi_port = 0;
281 } else if (http_port > 0) {
282 url = use_secure ? "https://" : "http://";
283 engine.Form("%s:%d?websocket_timeout=%d", (use_secure ? "https" : "http"), http_port, http_wstmout);
284 if (assign_loopback) {
285 engine.Append("&loopback");
286 url.Append("localhost");
287 } else if (http_bind && (strlen(http_bind) > 0)) {
288 engine.Append("&bind=");
289 engine.Append(http_bind);
290 url.Append(http_bind);
291 } else {
292 url.Append("localhost");
293 }
294
295 if (http_maxage >= 0)
296 engine.Append(TString::Format("&max_age=%d", http_maxage));
297
298 if (use_secure) {
299 engine.Append("&ssl_cert=");
300 engine.Append(ssl_cert);
301 }
302
303 if (fServer->CreateEngine(engine)) {
304 fAddr = url.Data();
305 fAddr.append(":");
306 fAddr.append(std::to_string(http_port));
307 return true;
308 }
309 http_port = 0;
310 }
311 }
312
313 return false;
314}
315
316//////////////////////////////////////////////////////////////////////////////////////////
317/// Creates new window
318/// To show window, RWebWindow::Show() have to be called
319
320std::shared_ptr<RWebWindow> RWebWindowsManager::CreateWindow()
321{
322
323 // we book manager mutex for a longer operation, locked again in server creation
324 std::lock_guard<std::recursive_mutex> grd(fMutex);
325
326 if (!CreateServer()) {
327 R__LOG_ERROR(WebGUILog()) << "Cannot create server when creating window";
328 return nullptr;
329 }
330
331 std::shared_ptr<RWebWindow> win = std::make_shared<RWebWindow>();
332
333 if (!win) {
334 R__LOG_ERROR(WebGUILog()) << "Fail to create RWebWindow instance";
335 return nullptr;
336 }
337
338 double dflt_tmout = gEnv->GetValue("WebGui.OperationTmout", 50.);
339
340 auto wshandler = win->CreateWSHandler(Instance(), ++fIdCnt, dflt_tmout);
341
342 if (gEnv->GetValue("WebGui.RecordData", 0) > 0) {
343 std::string fname, prefix;
344 if (fIdCnt > 1) {
345 prefix = std::string("f") + std::to_string(fIdCnt) + "_";
346 fname = std::string("protcol") + std::to_string(fIdCnt) + ".json";
347 } else {
348 fname = "protocol.json";
349 }
350 win->RecordData(fname, prefix);
351 }
352
353 const char *token = gEnv->GetValue("WebGui.ConnToken", "");
354 if (token && *token)
355 win->SetConnToken(token);
356
357 fServer->RegisterWS(wshandler);
358
359 return win;
360}
361
362//////////////////////////////////////////////////////////////////////////////////////////
363/// Release all references to specified window
364/// Called from RWebWindow destructor
365
367{
368 if (win.fWSHandler)
369 fServer->UnregisterWS(win.fWSHandler);
370}
371
372//////////////////////////////////////////////////////////////////////////
373/// Provide URL address to access specified window from inside or from remote
374
375std::string RWebWindowsManager::GetUrl(const RWebWindow &win, bool remote)
376{
377 if (!fServer) {
378 R__LOG_ERROR(WebGUILog()) << "Server instance not exists when requesting window URL";
379 return "";
380 }
381
382 std::string addr = "/";
383
384 addr.append(win.fWSHandler->GetName());
385
386 addr.append("/");
387
388 if (remote) {
389 if (!CreateServer(true)) {
390 R__LOG_ERROR(WebGUILog()) << "Fail to start real HTTP server when requesting URL";
391 return "";
392 }
393
394 addr = fAddr + addr;
395 }
396
397 return addr;
398}
399
400///////////////////////////////////////////////////////////////////////////////////////////////////
401/// Show web window in specified location.
402///
403/// \param batch_mode indicates that browser will run in headless mode
404/// \param user_args specifies where and how display web window
405///
406/// As display args one can use string like "firefox" or "chrome" - these are two main supported web browsers.
407/// See RWebDisplayArgs::SetBrowserKind() for all available options. Default value for the browser can be configured
408/// when starting root with --web argument like: "root --web=chrome"
409///
410/// If allowed, same window can be displayed several times (like for TCanvas)
411///
412/// Following parameters can be configured in rootrc file:
413///
414/// WebGui.Chrome: full path to Google Chrome executable
415/// WebGui.ChromeBatch: command to start chrome in batch
416/// WebGui.ChromeInteractive: command to start chrome in interactive mode
417/// WebGui.Firefox: full path to Mozialla Firefox executable
418/// WebGui.FirefoxBatch: command to start Firefox in batch mode
419/// WebGui.FirefoxInteractive: command to start Firefox in interactive mode
420/// WebGui.FirefoxProfile: name of Firefox profile to use
421/// WebGui.FirefoxProfilePath: file path to Firefox profile
422/// WebGui.FirefoxRandomProfile: usage of random Firefox profile -1 never, 0 - only for batch mode (dflt), 1 - always
423/// WebGui.LaunchTmout: time required to start process in seconds (default 30 s)
424/// WebGui.OperationTmout: time required to perform WebWindow operation like execute command or update drawings
425/// WebGui.RecordData: if specified enables data recording for each web window 0 - off, 1 - on
426/// WebGui.JsonComp: compression factor for JSON conversion, if not specified - each widget uses own default values
427/// WebGui.ForceHttp: 0 - off (default), 1 - always create real http server to run web window
428/// WebGui.Console: -1 - output only console.error(), 0 - add console.warn(), 1 - add console.log() output
429/// WebGui.ConnCredits: 10 - number of packets which can be send by server or client without acknowledge from receiving side
430/// WebGui.openui5src: alternative location for openui5 like https://openui5.hana.ondemand.com/
431/// WebGui.openui5libs: list of pre-loaded ui5 libs like sap.m, sap.ui.layout, sap.ui.unified
432/// WebGui.openui5theme: openui5 theme like sap_belize (default) or sap_fiori_3
433///
434/// HTTP-server related parameters documented in RWebWindowsManager::CreateServer() method
435
436unsigned RWebWindowsManager::ShowWindow(RWebWindow &win, bool batch_mode, const RWebDisplayArgs &user_args)
437{
438 // silently ignore regular Show() calls in batch mode
439 if (!batch_mode && gROOT->IsWebDisplayBatch())
440 return 0;
441
442 // for embedded window no any browser need to be started
444 return 0;
445
446 // place here while involves conn mutex
447 auto token = win.GetConnToken();
448
449 // we book manager mutex for a longer operation,
450 std::lock_guard<std::recursive_mutex> grd(fMutex);
451
452 if (!fServer) {
453 R__LOG_ERROR(WebGUILog()) << "Server instance not exists to show window";
454 return 0;
455 }
456
457 std::string key;
458 int ntry = 100000;
459
460 do {
461 key = std::to_string(gRandom->Integer(0x100000));
462 } while ((--ntry > 0) && win.HasKey(key));
463 if (ntry == 0) {
464 R__LOG_ERROR(WebGUILog()) << "Fail to create unique key for the window";
465 return 0;
466 }
467
468 RWebDisplayArgs args(user_args);
469
470 if (batch_mode && !args.IsSupportHeadless()) {
471 R__LOG_ERROR(WebGUILog()) << "Cannot use batch mode with " << args.GetBrowserName();
472 return 0;
473 }
474
475 args.SetHeadless(batch_mode);
476 if (args.GetWidth() <= 0) args.SetWidth(win.GetWidth());
477 if (args.GetHeight() <= 0) args.SetHeight(win.GetHeight());
478
479 bool normal_http = !args.IsLocalDisplay();
480 if (!normal_http && (gEnv->GetValue("WebGui.ForceHttp",0) == 1))
481 normal_http = true;
482
483 std::string url = GetUrl(win, normal_http);
484 if (url.empty()) {
485 R__LOG_ERROR(WebGUILog()) << "Cannot create URL for the window";
486 return 0;
487 }
488 if (normal_http && fAddr.empty()) {
489 R__LOG_WARNING(WebGUILog()) << "Full URL cannot be produced for window " << url << " to start web browser";
490 return 0;
491 }
492
493 args.SetUrl(url);
494
495 args.AppendUrlOpt(std::string("key=") + key);
496 if (batch_mode) args.AppendUrlOpt("batch_mode");
497 if (!token.empty())
498 args.AppendUrlOpt(std::string("token=") + token);
499
500 if (!normal_http)
501 args.SetHttpServer(GetServer());
502
503 auto handle = RWebDisplayHandle::Display(args);
504
505 if (!handle) {
506 R__LOG_ERROR(WebGUILog()) << "Cannot display window in " << args.GetBrowserName();
507 return 0;
508 }
509
510 return win.AddDisplayHandle(batch_mode, key, handle);
511}
512
513//////////////////////////////////////////////////////////////////////////
514/// Waits until provided check function or lambdas returns non-zero value
515/// Regularly calls WebWindow::Sync() method to let run event loop
516/// If call from the main thread, runs system events processing
517/// Check function has following signature: int func(double spent_tm)
518/// Parameter spent_tm is time in seconds, which already spent inside function
519/// Waiting will be continued, if function returns zero.
520/// First non-zero value breaks waiting loop and result is returned (or 0 if time is expired).
521/// If parameter timed is true, timelimit (in seconds) defines how long to wait
522
523int RWebWindowsManager::WaitFor(RWebWindow &win, WebWindowWaitFunc_t check, bool timed, double timelimit)
524{
525 int res = 0;
526 int cnt = 0;
527 double spent = 0;
528
529 auto start = std::chrono::high_resolution_clock::now();
530
531 win.Sync(); // in any case call sync once to ensure
532
533 while ((res = check(spent)) == 0) {
534
535 if (IsMainThrd())
537
538 win.Sync();
539
540 std::this_thread::sleep_for(std::chrono::milliseconds(1));
541
542 std::chrono::duration<double, std::milli> elapsed = std::chrono::high_resolution_clock::now() - start;
543
544 spent = elapsed.count() * 1e-3; // use ms precision
545
546 if (timed && (spent > timelimit))
547 return -3;
548
549 cnt++;
550 }
551
552 return res;
553}
554
555//////////////////////////////////////////////////////////////////////////
556/// Terminate http server and ROOT application
557
559{
560 if (fServer)
561 fServer->SetTerminate();
562
563 if (gApplication)
564 TTimer::SingleShot(100, "TApplication", gApplication, "Terminate()");
565}
#define R__LOG_WARNING(...)
Definition RLogger.hxx:363
#define R__LOG_ERROR(...)
Definition RLogger.hxx:362
#define e(i)
Definition RSha256.hxx:103
static std::thread::id gWebWinMainThrd
This thread id used to identify main application thread, where ROOT event processing runs To inject c...
R__EXTERN TApplication * gApplication
R__EXTERN TEnv * gEnv
Definition TEnv.h:171
#define gROOT
Definition TROOT.h:406
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
R__EXTERN TSystem * gSystem
Definition TSystem.h:559
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
std::string GetBrowserName() const
Returns configured browser name.
bool IsSupportHeadless() const
returns true if browser supports headless (batch) mode, used for image production
RWebDisplayArgs & SetUrl(const std::string &url)
set window url
int GetHeight() const
returns preferable web window height
void SetHeadless(bool on=true)
set headless mode
void SetHttpServer(THttpServer *serv)
set http server instance, used for window display
EBrowserKind GetBrowserKind() const
returns configured browser kind, see EBrowserKind for supported values
void AppendUrlOpt(const std::string &opt)
append extra url options, add "&" as separator if required
bool IsLocalDisplay() const
returns true if local display like CEF or Qt5 QWebEngine should be used
@ kEmbedded
window will be embedded into other, no extra browser need to be started
RWebDisplayArgs & SetHeight(int h=0)
set preferable web window height
int GetWidth() const
returns preferable web window width
RWebDisplayArgs & SetWidth(int w=0)
set preferable web window width
static std::unique_ptr< RWebDisplayHandle > Display(const RWebDisplayArgs &args)
Create web display.
Represents web window, which can be shown in web browser or any other supported environment.
unsigned AddDisplayHandle(bool batch_mode, const std::string &key, std::unique_ptr< RWebDisplayHandle > &handle)
Add display handle and associated key Key is random number generated when starting new window When cl...
void Sync()
Special method to process all internal activity when window runs in separate thread.
std::string GetConnToken() const
Returns configured connection token.
unsigned GetHeight() const
returns configured window height (0 - default)
bool HasKey(const std::string &key) const
Returns true if provided key value already exists (in processes map or in existing connections)
unsigned GetWidth() const
returns configured window width (0 - default) actual window width can be different
std::shared_ptr< RWebWindowWSHandler > fWSHandler
! specialize websocket handler for all incoming connections
std::unique_ptr< THttpServer > fServer
! central communication with the all used displays
std::string GetUrl(const RWebWindow &win, bool remote=false)
Provide URL address to access specified window from inside or from remote.
bool CreateServer(bool with_http=false)
Creates http server, if required - with real http engine (civetweb) One could configure concrete HTTP...
RWebWindowsManager()
window manager constructor Required here for correct usage of unique_ptr<THttpServer>
int WaitFor(RWebWindow &win, WebWindowWaitFunc_t check, bool timed=false, double tm=-1)
Waits until provided check function or lambdas returns non-zero value Regularly calls WebWindow::Sync...
std::recursive_mutex fMutex
! main mutex, used for window creations
unsigned fIdCnt
! counter for identifiers
std::string fAddr
! HTTP address of the server
bool fUseSenderThreads
! use extra threads for sending data from RWebWindow to clients
void Terminate()
Terminate http server and ROOT application.
~RWebWindowsManager()
window manager destructor Required here for correct usage of unique_ptr<THttpServer>
THttpServer * GetServer() const
Returns THttpServer instance.
static void AssignMainThrd()
Re-assigns main thread id Normally main thread id recognized at the moment when library is loaded It ...
bool IsUseHttpThread() const
Returns true if http server use special thread for requests processing (default off)
static bool IsMainThrd()
Returns true when called from main process Main process recognized at the moment when library is load...
static std::shared_ptr< RWebWindowsManager > & Instance()
Returns default window manager Used to display all standard ROOT elements like TCanvas or TFitPanel.
bool fUseHttpThrd
! use special thread for THttpServer
unsigned ShowWindow(RWebWindow &win, bool batch_mode, const RWebDisplayArgs &args)
Show window in specified location, see Show() method for more details.
void Unregister(RWebWindow &win)
Release all references to specified window Called from RWebWindow destructor.
float fLaunchTmout
! timeout in seconds to start browser process, default 30s
std::shared_ptr< RWebWindow > CreateWindow()
Creates new window To show window, RWebWindow::Show() have to be called.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:491
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
static const TString & GetDataDir()
Get the data directory in the installation. Static utility function.
Definition TROOT.cxx:2979
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition TRandom.cxx:608
virtual Double_t Rndm()
Machine independent random number generator.
Definition TRandom.cxx:552
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
Definition TRandom.cxx:360
Basic string class.
Definition TString.h:136
Ssiz_t Length() const
Definition TString.h:410
const char * Data() const
Definition TString.h:369
TString & Append(const char *cs)
Definition TString.h:564
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2331
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2309
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition TSystem.cxx:1272
virtual const char * Getenv(const char *env)
Get environment variable.
Definition TSystem.cxx:1661
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:417
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
Definition TTimer.cxx:256
RLogChannel & WebGUILog()
Log channel for WebGUI diagnostics.
std::function< int(double)> WebWindowWaitFunc_t
function signature for waiting call-backs Such callback used when calling thread need to waits for so...