Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::RWebWindow Class Reference

Represents web window, which can be shown in web browser or any other supported environment.

Window can be configured to run either in the normal or in the batch (headless) mode. In second case no any graphical elements will be created. For the normal window one can configure geometry (width and height), which are applied when window shown.

Each window can be shown several times (if allowed) in different places - either as the CEF (chromium embedded) window or in the standard web browser. When started, window will open and show HTML page, configured with RWebWindow::SetDefaultPage() method.

Typically (but not necessarily) clients open web socket connection to the window and one can exchange data, using RWebWindow::Send() method and call-back function assigned via RWebWindow::SetDataCallBack().

Definition at line 52 of file RWebWindow.hxx.

Classes

struct  MasterConn
 
struct  QueueEntry
 
struct  QueueItem
 
struct  WebConn
 

Public Member Functions

 RWebWindow ()
 RWebWindow constructor Should be defined here because of std::unique_ptr<RWebWindowWSHandler>
 
 ~RWebWindow ()
 RWebWindow destructor Closes all connections and remove window from manager.
 
void AssignThreadId ()
 Assign thread id which has to be used for callbacks WARNING!!! only for expert use Automatically done at the moment when any callback function is invoked Can be invoked once again if window Run method will be invoked from other thread Normally should be invoked before Show() method is called.
 
bool CanSend (unsigned connid, bool direct=true) const
 Returns true if sending via specified connection can be performed.
 
void CloseConnection (unsigned connid)
 Close specified connection.
 
void CloseConnections ()
 Closes all connection to clients Normally leads to closing of all correspondent browser windows Some browsers (like firefox) do not allow by default to close window.
 
std::string GetAddr () const
 Returns window address which is used in URL.
 
std::string GetClientVersion () const
 Returns current client version.
 
unsigned GetConnectionId (int num=0) const
 Returns connection id for specified connection sequence number Only active connections are returned - where clients confirms connection Total number of connections can be retrieved with NumConnections() method.
 
std::vector< unsigned > GetConnections (unsigned excludeid=0) const
 returns vector with all existing connections ids One also can exclude specified connection from return result, which can be useful to be able reply too all but this connections
 
unsigned GetConnLimit () const
 returns configured connections limit (0 - default)
 
unsigned GetDisplayConnection () const
 Returns first connection id where window is displayed It could be that connection(s) not yet fully established - but also not timed out Batch jobs will be ignored here Returns 0 if connection not exists.
 
unsigned GetHeight () const
 returns configured window height (0 - default)
 
unsigned GetId () const
 Returns ID for the window - unique inside window manager.
 
std::shared_ptr< RWebWindowsManagerGetManager () const
 Returns window manager.
 
unsigned GetMaxQueueLength () const
 Return maximal queue length of data which can be held by window.
 
float GetOperationTmout () const
 Returns timeout for synchronous WebWindow operations.
 
std::string GetRelativeAddr (const RWebWindow &win) const
 Returns relative URL address for the specified window Address can be required if one needs to access data from one window into another window Used for instance when inserting panel into canvas.
 
std::string GetRelativeAddr (const std::shared_ptr< RWebWindow > &win) const
 Returns relative URL address for the specified window Address can be required if one needs to access data from one window into another window Used for instance when inserting panel into canvas.
 
int GetSendQueueLength (unsigned connid) const
 Returns send queue length for specified connection.
 
THttpServerGetServer ()
 Return THttpServer instance serving requests to the window.
 
std::string GetUrl (bool remote=true)
 Return URL string to connect web window URL typically includes extra parameters required for connection with the window like http://localhost:9635/win1/?key=<connection_key>#<session_key> When.
 
std::string GetUserArgs () const
 Returns configured user arguments for web window See SetUserArgs method for more details.
 
unsigned GetWidth () const
 returns configured window width (0 - default) actual window width can be different
 
int GetX () const
 returns configured window X position (-1 - default)
 
int GetY () const
 returns configured window Y position (-1 - default)
 
bool HasConnection (unsigned connid=0, bool only_active=true) const
 returns true if specified connection id exists
 
bool IsNativeOnlyConn () const
 returns true if only native (own-created) connections are allowed
 
bool IsRequireAuthKey () const
 returns true if authentication string is required
 
bool IsShown () const
 Returns true when window was shown at least once.
 
int NumConnections (bool with_pending=false) const
 Returns current number of active clients connections.
 
void RecordData (const std::string &fname="protocol.json", const std::string &fprefix="")
 Configures recording of communication data in protocol file Provided filename will be used to store JSON array with names of written files - text or binary If data was send from client, "send" entry will be placed.
 
void Run (double tm=0.)
 Run window functionality for specified time If no action can be performed - just sleep specified time.
 
void Send (unsigned connid, const std::string &data)
 Sends data to specified connection.
 
void SendBinary (unsigned connid, const void *data, std::size_t len)
 Send binary data to specified connection.
 
void SendBinary (unsigned connid, std::string &&data)
 Send binary data to specified connection.
 
void SetCallBacks (WebWindowConnectCallback_t conn, WebWindowDataCallback_t data, WebWindowConnectCallback_t disconn=nullptr)
 Set call-backs function for connect, data and disconnect events.
 
void SetClearOnClose (const std::shared_ptr< void > &handle=nullptr)
 Set handle which is cleared when last active connection is closed Typically can be used to destroy web-based widget at such moment.
 
void SetClientVersion (const std::string &vers)
 Set client version, used as prefix in scripts URL When changed, web browser will reload all related JS files while full URL will be different Default is empty value - no extra string in URL Version should be string like "1.2" or "ver1.subv2" and not contain any special symbols.
 
void SetConnectCallBack (WebWindowConnectCallback_t func)
 Set call-back function for new connection.
 
void SetConnLimit (unsigned lmt=0)
 Configure maximal number of allowed connections - 0 is unlimited Will not affect already existing connections Default is 1 - the only client is allowed.
 
void SetConnToken (const std::string &token="")
 Configures connection token (default none) When specified, in URL of webpage such token should be provided as &token=value parameter, otherwise web window will refuse connection.
 
void SetDataCallBack (WebWindowDataCallback_t func)
 Set call-back function for data, received from the clients via websocket.
 
void SetDefaultPage (const std::string &page)
 Set content of default window HTML page This page returns when URL address of the window will be requested Either HTML code or file name in the form "file:/home/user/data/file.htm" One also can using default locations like "file:rootui5sys/canv/canvas.html".
 
void SetDisconnectCallBack (WebWindowConnectCallback_t func)
 Set call-back function for disconnecting.
 
void SetGeometry (unsigned width, unsigned height)
 Set window geometry. Will be applied if supported by used web display (like CEF or Chromium)
 
void SetMaxQueueLength (unsigned len=10)
 configures maximal queue length of data which can be held by window
 
void SetNativeOnlyConn (bool on=true)
 configures that only native (own-created) connections are allowed
 
void SetOperationTmout (float tm=50.)
 Set timeout for synchronous WebWindow operations.
 
void SetPanelName (const std::string &name)
 Configure window to show some of existing JSROOT panels It uses "file:rootui5sys/panel/panel.html" as default HTML page At the moment only FitPanel is existing.
 
void SetPosition (unsigned x, unsigned y)
 Set window position. Will be applied if supported by used web display (like CEF or Chromium)
 
void SetRequireAuthKey (bool on)
 Configure if authentication key in connection string is required.
 
void SetUserArgs (const std::string &args)
 Set arbitrary JSON data, which is accessible via conn.getUserArgs() method in JavaScript This JSON code injected into main HTML document into connectWebWindow({}) Must be set before RWebWindow::Show() method is called.
 
unsigned Show (const RWebDisplayArgs &args="")
 Show window in specified location.
 
void StartThread ()
 Start special thread which will be used by the window to handle all callbacks One has to be sure, that access to global ROOT structures are minimized and protected with ROOT::EnableThreadSafety(); call.
 
void StopThread ()
 Stop special thread.
 
void Sync ()
 Special method to process all internal activity when window runs in separate thread.
 
void TerminateROOT ()
 Terminate ROOT session Tries to correctly close THttpServer, associated with RWebWindowsManager After that exit from process.
 
void UseServerThreads ()
 Let use THttpServer threads to process requests WARNING!!! only for expert use Should be only used when application provides proper locking and does not block.
 
int WaitFor (WebWindowWaitFunc_t check)
 Waits until provided check function or lambdas returns non-zero value Check function has following signature: int func(double spent_tm) Waiting will be continued, if function returns zero.
 
int WaitForTimed (WebWindowWaitFunc_t check)
 Waits until provided check function or lambdas returns non-zero value Check function has following signature: int func(double spent_tm) Waiting will be continued, if function returns zero.
 
int WaitForTimed (WebWindowWaitFunc_t check, double duration)
 Waits until provided check function or lambdas returns non-zero value Check function has following signature: int func(double spent_tm) Waiting will be continued, if function returns zero.
 

Static Public Member Functions

static std::shared_ptr< RWebWindowCreate ()
 Create new RWebWindow Using default RWebWindowsManager.
 
static bool EmbedFileDialog (const std::shared_ptr< RWebWindow > &window, unsigned connid, const std::string &args)
 Create dialog instance to use as embedded dialog inside provided widget Loads libROOTBrowserv7 and tries to call RFileDialog::Embedded() method Embedded dialog started on the client side where FileDialogController.SaveAs() method called Such method immediately send message with "FILEDIALOG:" prefix On the server side widget should detect such message and call RFileDialog::Embedded() providing received string as second argument.
 
static bool IsFileDialogMessage (const std::string &msg)
 Check if this could be the message send by client to start new file dialog If returns true, one can call RWebWindow::EmbedFileDialog() to really create file dialog instance inside existing widget.
 
static unsigned ShowWindow (std::shared_ptr< RWebWindow > window, const RWebDisplayArgs &args="")
 Static method to show web window Has to be used instead of RWebWindow::Show() when window potentially can be embed into other windows Soon RWebWindow::Show() method will be done protected.
 

Private Types

using ConnectionsList_t = std::vector< std::shared_ptr< WebConn > >
 
enum  EQueueEntryKind { kind_None , kind_Connect , kind_Data , kind_Disconnect }
 
using timestamp_t = std::chrono::time_point< std::chrono::system_clock >
 

Private Member Functions

bool _CanTrustIn (std::shared_ptr< WebConn > &conn, const std::string &key, const std::string &ntry, bool remote, bool test_first_time)
 Check if provided hash, ntry parameters from the connection request could be accepted.
 
std::shared_ptr< WebConn_FindConnWithKey (const std::string &key) const
 Find connection with specified key.
 
std::string _MakeSendHeader (std::shared_ptr< WebConn > &conn, bool txt, const std::string &data, int chid)
 Internal method to prepare text part of send data Should be called under locked connection mutex.
 
unsigned AddDisplayHandle (bool headless_mode, const std::string &key, std::unique_ptr< RWebDisplayHandle > &handle)
 Add display handle and associated key Key is large random string generated when starting new window When client is connected, key should be supplied to correctly identify it.
 
unsigned AddEmbedWindow (std::shared_ptr< RWebWindow > window, unsigned connid, int channel)
 Add embed window.
 
void AddMasterConnection (std::shared_ptr< RWebWindow > window, unsigned connid, int channel)
 Add new master connection If there are many connections - only same master is allowed.
 
void CheckDataToSend (bool only_once=false)
 Checks if new data can be send (internal use only) If necessary, provide credits to the client.
 
bool CheckDataToSend (std::shared_ptr< WebConn > &conn)
 Checks if one should send data for specified connection Returns true when send operation was performed.
 
void CheckInactiveConnections ()
 Check if there are connection which are inactive for longer time For instance, batch browser will be stopped if no activity for 30 sec is there.
 
void CheckPendingConnections ()
 Check if started process(es) establish connection.
 
void CompleteWSSend (unsigned wsid)
 Complete websocket send operation Clear "doing send" flag and check if next operation has to be started.
 
std::shared_ptr< RWebWindowWSHandlerCreateWSHandler (std::shared_ptr< RWebWindowsManager > mgr, unsigned id, double tmout)
 Assigns manager reference, window id and creates websocket handler, used for communication with the clients.
 
std::shared_ptr< WebConnFindConnection (unsigned wsid)
 Find connection with specified websocket id.
 
unsigned FindHeadlessConnection ()
 Returns connection id of window running in headless mode This can be special connection which may run picture production jobs in background Connection to that job may not be initialized yet If connection does not exists, returns 0.
 
std::string GenerateKey () const
 Generate new unique key for the window.
 
std::string GetConnToken () const
 Returns configured connection token.
 
std::vector< MasterConnGetMasterConnections (unsigned connid=0) const
 Get list of master connections.
 
ConnectionsList_t GetWindowConnections (unsigned connid=0, bool only_active=false) const
 returns connection list (or all active connections)
 
bool HasKey (const std::string &key) const
 Returns true if provided key value already exists (in processes map or in existing connections)
 
void InvokeCallbacks (bool force=false)
 Invoke callbacks with existing data Must be called from appropriate thread.
 
unsigned MakeHeadless (bool create_new=false)
 Start headless browser for specified window Normally only single instance is used, but many can be created See ROOT::RWebWindowsManager::Show() docu for more info returns (future) connection id (or 0 when fails)
 
bool ProcessBatchHolder (std::shared_ptr< THttpCallArg > &arg)
 Process special http request, used to hold headless browser running Such requests should not be replied for the long time Be aware that function called directly from THttpServer thread, which is not same thread as window.
 
bool ProcessWS (THttpCallArg &arg)
 Processing of websockets call-backs, invoked from RWebWindowWSHandler Method invoked from http server thread, therefore appropriate mutex must be used on all relevant data.
 
void ProvideQueueEntry (unsigned connid, EQueueEntryKind kind, std::string &&arg)
 Provide data to user callback User callback must be executed in the window thread.
 
std::shared_ptr< WebConnRemoveConnection (unsigned wsid)
 Remove connection with given websocket id.
 
void RemoveEmbedWindow (unsigned connid, int channel)
 Remove RWebWindow associated with the channelfEmbed.
 
void RemoveKey (const std::string &key)
 Removes all connections with the key.
 
void RemoveMasterConnection (unsigned connid=0)
 Remove master connection - if any.
 
void SubmitData (unsigned connid, bool txt, std::string &&data, int chid=1)
 Internal method to send data.
 

Static Private Member Functions

static std::string HMAC (const std::string &key, const std::string &sessionKey, const char *msg, int msglen)
 Calculate HMAC checksum for provided key and message Key combained from connection key and session key.
 
static void SetStartDialogFunc (std::function< bool(const std::shared_ptr< RWebWindow > &, unsigned, const std::string &)>)
 Configure func which has to be used for starting dialog.
 

Private Attributes

std::thread::id fCallbacksThrdId
 ! thread id where callbacks should be invoked
 
bool fCallbacksThrdIdSet {false}
 ! flag indicating that thread id is assigned
 
std::shared_ptr< void > fClearOnClose
 ! entry which is cleared when last connection is closed
 
std::string fClientVersion
 ! configured client version, used as prefix in scripts URL
 
ConnectionsList_t fConn
 ! list of all accepted connections
 
WebWindowConnectCallback_t fConnCallback
 ! callback for connect event
 
unsigned fConnCnt {0}
 ! counter of new connections to assign ids
 
unsigned fConnLimit {1}
 ! number of allowed active connections
 
std::mutex fConnMutex
 ! mutex used to protect connection list
 
std::string fConnToken
 ! value of "token" URL parameter which should be provided for connecting window
 
WebWindowDataCallback_t fDataCallback
 ! main callback when data over channel 1 is arrived
 
std::string fDefaultPage
 ! HTML page (or file name) returned when window URL is opened
 
WebWindowConnectCallback_t fDisconnCallback
 ! callback for disconnect event
 
bool fHasWindowThrd {false}
 ! indicate if special window thread was started
 
unsigned fHeight {0}
 ! initial window width and height when displayed, zeros are ignored
 
unsigned fId {0}
 ! unique identifier
 
std::queue< QueueEntryfInputQueue
 ! input queue for all callbacks
 
std::mutex fInputQueueMutex
 ! mutex to protect input queue
 
std::shared_ptr< RWebWindowfMaster
 ! master window where this window is embedded
 
std::vector< MasterConnfMasterConns
 ! master connections
 
unsigned fMaxQueueLength {10}
 ! maximal number of queue entries
 
std::shared_ptr< RWebWindowsManagerfMgr
 ! display manager
 
bool fNativeOnlyConn {false}
 ! only native connection are allowed, created by Show() method
 
float fOperationTmout {50.}
 ! timeout in seconds to perform synchronous operation, default 50s
 
std::string fPanelName
 ! panel name which should be shown in the window
 
ConnectionsList_t fPendingConn
 ! list of pending connection with pre-assigned keys
 
bool fProcessMT {false}
 ! if window event processing performed in dedicated thread
 
std::string fProtocol
 ! protocol
 
int fProtocolCnt {-1}
 ! counter for protocol recording
 
unsigned fProtocolConnId {0}
 ! connection id, which is used for writing protocol
 
std::string fProtocolFileName
 ! local file where communication protocol will be written
 
std::string fProtocolPrefix
 ! prefix for created files names
 
bool fRequireAuthKey {true}
 ! defines if authentication key always required when connect to the widget
 
bool fSendMT {false}
 ! true is special threads should be used for sending data
 
bool fUseProcessEvents {false}
 ! all window functionality will run through process events
 
std::string fUserArgs
 ! arbitrary JSON code, which is accessible via conn.getUserArgs() method
 
bool fUseServerThreads {false}
 ! indicates that server thread is using, no special window thread
 
unsigned fWidth {0}
 
std::thread fWindowThrd
 ! special thread for that window
 
std::shared_ptr< RWebWindowWSHandlerfWSHandler
 ! specialize websocket handler for all incoming connections
 
int fX {-1}
 
int fY {-1}
 ! initial window position, -1 ignored
 

Static Private Attributes

static std::function< bool(const std::shared_ptr< RWebWindow > &, unsigned, const std::string &)> gStartDialogFunc = nullptr
 

Friends

class RFileDialog
 
class RWebDisplayHandle
 
class RWebWindowsManager
 
class RWebWindowWSHandler
 

#include <ROOT/RWebWindow.hxx>

Member Typedef Documentation

◆ ConnectionsList_t

using ROOT::RWebWindow::ConnectionsList_t = std::vector<std::shared_ptr<WebConn> >
private

Definition at line 134 of file RWebWindow.hxx.

◆ timestamp_t

using ROOT::RWebWindow::timestamp_t = std::chrono::time_point<std::chrono::system_clock>
private

Definition at line 60 of file RWebWindow.hxx.

Member Enumeration Documentation

◆ EQueueEntryKind

Enumerator
kind_None 
kind_Connect 
kind_Data 
kind_Disconnect 

Definition at line 124 of file RWebWindow.hxx.

Constructor & Destructor Documentation

◆ RWebWindow()

RWebWindow::RWebWindow ( )

RWebWindow constructor Should be defined here because of std::unique_ptr<RWebWindowWSHandler>

Definition at line 76 of file RWebWindow.cxx.

◆ ~RWebWindow()

RWebWindow::~RWebWindow ( )

RWebWindow destructor Closes all connections and remove window from manager.

Definition at line 85 of file RWebWindow.cxx.

Member Function Documentation

◆ _CanTrustIn()

bool RWebWindow::_CanTrustIn ( std::shared_ptr< WebConn > &  conn,
const std::string &  hash,
const std::string &  ntry,
bool  remote,
bool  test_first_time 
)
private

Check if provided hash, ntry parameters from the connection request could be accepted.

Parameters
hash- provided hash value which should match with HMAC hash for generated before connection key
ntry- connection attempt number provided together with request, must come in increasing order
remote- boolean flag indicating if request comming from remote (via real http), for local displays like Qt5 or CEF simpler connection rules are applied
test_first_time- true if hash/ntry tested for the first time, false appears only with websocket when connection accepted by server

Definition at line 532 of file RWebWindow.cxx.

◆ _FindConnWithKey()

std::shared_ptr< RWebWindow::WebConn > RWebWindow::_FindConnWithKey ( const std::string &  key) const
private

Find connection with specified key.

Must be used under connection mutex lock

Definition at line 505 of file RWebWindow.cxx.

◆ _MakeSendHeader()

std::string RWebWindow::_MakeSendHeader ( std::shared_ptr< WebConn > &  conn,
bool  txt,
const std::string &  data,
int  chid 
)
private

Internal method to prepare text part of send data Should be called under locked connection mutex.

Definition at line 1111 of file RWebWindow.cxx.

◆ AddDisplayHandle()

unsigned RWebWindow::AddDisplayHandle ( bool  headless_mode,
const std::string &  key,
std::unique_ptr< RWebDisplayHandle > &  handle 
)
private

Add display handle and associated key Key is large random string generated when starting new window When client is connected, key should be supplied to correctly identify it.

Definition at line 480 of file RWebWindow.cxx.

◆ AddEmbedWindow()

unsigned RWebWindow::AddEmbedWindow ( std::shared_ptr< RWebWindow window,
unsigned  connid,
int  channel 
)
private

Add embed window.

Definition at line 1850 of file RWebWindow.cxx.

◆ AddMasterConnection()

void RWebWindow::AddMasterConnection ( std::shared_ptr< RWebWindow window,
unsigned  connid,
int  channel 
)
private

Add new master connection If there are many connections - only same master is allowed.

Definition at line 308 of file RWebWindow.cxx.

◆ AssignThreadId()

void RWebWindow::AssignThreadId ( )

Assign thread id which has to be used for callbacks WARNING!!! only for expert use Automatically done at the moment when any callback function is invoked Can be invoked once again if window Run method will be invoked from other thread Normally should be invoked before Show() method is called.

Definition at line 1649 of file RWebWindow.cxx.

◆ CanSend()

bool RWebWindow::CanSend ( unsigned  connid,
bool  direct = true 
) const

Returns true if sending via specified connection can be performed.

Parameters
connidconnection id, when 0 - all existing connections are checked
directwhen true, checks if direct sending (without queuing) is possible

Definition at line 1488 of file RWebWindow.cxx.

◆ CheckDataToSend() [1/2]

void RWebWindow::CheckDataToSend ( bool  only_once = false)
private

Checks if new data can be send (internal use only) If necessary, provide credits to the client.

Parameters
only_onceif true, data sending performed once or until there is no data to send

Definition at line 1220 of file RWebWindow.cxx.

◆ CheckDataToSend() [2/2]

bool RWebWindow::CheckDataToSend ( std::shared_ptr< WebConn > &  conn)
private

Checks if one should send data for specified connection Returns true when send operation was performed.

Definition at line 1162 of file RWebWindow.cxx.

◆ CheckInactiveConnections()

void RWebWindow::CheckInactiveConnections ( )
private

Check if there are connection which are inactive for longer time For instance, batch browser will be stopped if no activity for 30 sec is there.

Definition at line 663 of file RWebWindow.cxx.

◆ CheckPendingConnections()

void RWebWindow::CheckPendingConnections ( )
private

Check if started process(es) establish connection.

After timeout such processed will be killed Method invoked from http server thread, therefore appropriate mutex must be used on all relevant data

Definition at line 629 of file RWebWindow.cxx.

◆ CloseConnection()

void RWebWindow::CloseConnection ( unsigned  connid)

Close specified connection.

Parameters
connidconnection id, when 0 - all connections will be closed

Definition at line 1451 of file RWebWindow.cxx.

◆ CloseConnections()

void RWebWindow::CloseConnections ( )

Closes all connection to clients Normally leads to closing of all correspondent browser windows Some browsers (like firefox) do not allow by default to close window.

Definition at line 1442 of file RWebWindow.cxx.

◆ CompleteWSSend()

void RWebWindow::CompleteWSSend ( unsigned  wsid)
private

Complete websocket send operation Clear "doing send" flag and check if next operation has to be started.

Definition at line 1092 of file RWebWindow.cxx.

◆ Create()

std::shared_ptr< RWebWindow > RWebWindow::Create ( )
static

Create new RWebWindow Using default RWebWindowsManager.

Definition at line 1887 of file RWebWindow.cxx.

◆ CreateWSHandler()

std::shared_ptr< RWebWindowWSHandler > RWebWindow::CreateWSHandler ( std::shared_ptr< RWebWindowsManager mgr,
unsigned  id,
double  tmout 
)
private

Assigns manager reference, window id and creates websocket handler, used for communication with the clients.

Definition at line 150 of file RWebWindow.cxx.

◆ EmbedFileDialog()

bool RWebWindow::EmbedFileDialog ( const std::shared_ptr< RWebWindow > &  window,
unsigned  connid,
const std::string &  args 
)
static

Create dialog instance to use as embedded dialog inside provided widget Loads libROOTBrowserv7 and tries to call RFileDialog::Embedded() method Embedded dialog started on the client side where FileDialogController.SaveAs() method called Such method immediately send message with "FILEDIALOG:" prefix On the server side widget should detect such message and call RFileDialog::Embedded() providing received string as second argument.

Returned instance of shared_ptr<RFileDialog> may be used to assign callback when file is selected

Definition at line 1981 of file RWebWindow.cxx.

◆ FindConnection()

std::shared_ptr< RWebWindow::WebConn > RWebWindow::FindConnection ( unsigned  wsid)
private

Find connection with specified websocket id.

Find connection with given websocket id.

Definition at line 262 of file RWebWindow.cxx.

◆ FindHeadlessConnection()

unsigned RWebWindow::FindHeadlessConnection ( )
private

Returns connection id of window running in headless mode This can be special connection which may run picture production jobs in background Connection to that job may not be initialized yet If connection does not exists, returns 0.

Definition at line 219 of file RWebWindow.cxx.

◆ GenerateKey()

std::string RWebWindow::GenerateKey ( ) const
private

Generate new unique key for the window.

Definition at line 616 of file RWebWindow.cxx.

◆ GetAddr()

std::string RWebWindow::GetAddr ( ) const

Returns window address which is used in URL.

Definition at line 1254 of file RWebWindow.cxx.

◆ GetClientVersion()

std::string RWebWindow::GetClientVersion ( ) const

Returns current client version.

Definition at line 1302 of file RWebWindow.cxx.

◆ GetConnectionId()

unsigned RWebWindow::GetConnectionId ( int  num = 0) const

Returns connection id for specified connection sequence number Only active connections are returned - where clients confirms connection Total number of connections can be retrieved with NumConnections() method.

Parameters
numconnection sequence number

Definition at line 1374 of file RWebWindow.cxx.

◆ GetConnections()

std::vector< unsigned > RWebWindow::GetConnections ( unsigned  excludeid = 0) const

returns vector with all existing connections ids One also can exclude specified connection from return result, which can be useful to be able reply too all but this connections

Definition at line 1391 of file RWebWindow.cxx.

◆ GetConnLimit()

unsigned RWebWindow::GetConnLimit ( ) const

returns configured connections limit (0 - default)

Definition at line 708 of file RWebWindow.cxx.

◆ GetConnToken()

std::string RWebWindow::GetConnToken ( ) const
private

Returns configured connection token.

Definition at line 730 of file RWebWindow.cxx.

◆ GetDisplayConnection()

unsigned RWebWindow::GetDisplayConnection ( ) const

Returns first connection id where window is displayed It could be that connection(s) not yet fully established - but also not timed out Batch jobs will be ignored here Returns 0 if connection not exists.

Definition at line 242 of file RWebWindow.cxx.

◆ GetHeight()

unsigned ROOT::RWebWindow::GetHeight ( ) const
inline

returns configured window height (0 - default)

Definition at line 283 of file RWebWindow.hxx.

◆ GetId()

unsigned ROOT::RWebWindow::GetId ( ) const
inline

Returns ID for the window - unique inside window manager.

Definition at line 249 of file RWebWindow.hxx.

◆ GetManager()

std::shared_ptr< RWebWindowsManager > ROOT::RWebWindow::GetManager ( ) const
inline

Returns window manager.

Definition at line 252 of file RWebWindow.hxx.

◆ GetMasterConnections()

std::vector< RWebWindow::MasterConn > RWebWindow::GetMasterConnections ( unsigned  connid = 0) const
private

Get list of master connections.

Definition at line 323 of file RWebWindow.cxx.

◆ GetMaxQueueLength()

unsigned ROOT::RWebWindow::GetMaxQueueLength ( ) const
inline

Return maximal queue length of data which can be held by window.

Definition at line 305 of file RWebWindow.hxx.

◆ GetOperationTmout()

float ROOT::RWebWindow::GetOperationTmout ( ) const
inline

Returns timeout for synchronous WebWindow operations.

Definition at line 344 of file RWebWindow.hxx.

◆ GetRelativeAddr() [1/2]

std::string RWebWindow::GetRelativeAddr ( const RWebWindow win) const

Returns relative URL address for the specified window Address can be required if one needs to access data from one window into another window Used for instance when inserting panel into canvas.

Definition at line 1274 of file RWebWindow.cxx.

◆ GetRelativeAddr() [2/2]

std::string RWebWindow::GetRelativeAddr ( const std::shared_ptr< RWebWindow > &  win) const

Returns relative URL address for the specified window Address can be required if one needs to access data from one window into another window Used for instance when inserting panel into canvas.

Definition at line 1264 of file RWebWindow.cxx.

◆ GetSendQueueLength()

int RWebWindow::GetSendQueueLength ( unsigned  connid) const

Returns send queue length for specified connection.

Parameters
connidconnection id, 0 - maximal value for all connections is returned If wrong connection id specified, -1 is return

Definition at line 1513 of file RWebWindow.cxx.

◆ GetServer()

THttpServer * RWebWindow::GetServer ( )

Return THttpServer instance serving requests to the window.

Definition at line 179 of file RWebWindow.cxx.

◆ GetUrl()

std::string RWebWindow::GetUrl ( bool  remote = true)

Return URL string to connect web window URL typically includes extra parameters required for connection with the window like http://localhost:9635/win1/?key=<connection_key>#<session_key> When.

Parameters
remoteis true, real HTTP server will be started automatically and widget can be connected from the web browser. If
remoteis false, HTTP server will not be started and window can be connected only from ROOT application itself. !!! WARNING - do not invoke this method without real need, each URL consumes resources in widget and in http server

Definition at line 171 of file RWebWindow.cxx.

◆ GetUserArgs()

std::string RWebWindow::GetUserArgs ( ) const

Returns configured user arguments for web window See SetUserArgs method for more details.

Definition at line 1324 of file RWebWindow.cxx.

◆ GetWidth()

unsigned ROOT::RWebWindow::GetWidth ( ) const
inline

returns configured window width (0 - default) actual window width can be different

Definition at line 279 of file RWebWindow.hxx.

◆ GetWindowConnections()

RWebWindow::ConnectionsList_t RWebWindow::GetWindowConnections ( unsigned  connid = 0,
bool  only_active = false 
) const
private

returns connection list (or all active connections)

Parameters
connidconnection id, when 0 - all existing connections are returned
only_activewhen true, only active (already established) connections are returned

Definition at line 1462 of file RWebWindow.cxx.

◆ GetX()

int ROOT::RWebWindow::GetX ( ) const
inline

returns configured window X position (-1 - default)

Definition at line 287 of file RWebWindow.hxx.

◆ GetY()

int ROOT::RWebWindow::GetY ( ) const
inline

returns configured window Y position (-1 - default)

Definition at line 291 of file RWebWindow.hxx.

◆ HasConnection()

bool RWebWindow::HasConnection ( unsigned  connid = 0,
bool  only_active = true 
) const

returns true if specified connection id exists

Parameters
connidconnection id (0 - any)
only_activewhen true only active connection will be checked, otherwise also pending (not yet established) connections are checked

Definition at line 1417 of file RWebWindow.cxx.

◆ HasKey()

bool RWebWindow::HasKey ( const std::string &  key) const
private

Returns true if provided key value already exists (in processes map or in existing connections)

Definition at line 576 of file RWebWindow.cxx.

◆ HMAC()

std::string RWebWindow::HMAC ( const std::string &  key,
const std::string &  sessionKey,
const char *  msg,
int  msglen 
)
staticprivate

Calculate HMAC checksum for provided key and message Key combained from connection key and session key.

Definition at line 1996 of file RWebWindow.cxx.

◆ InvokeCallbacks()

void RWebWindow::InvokeCallbacks ( bool  force = false)
private

Invoke callbacks with existing data Must be called from appropriate thread.

Definition at line 436 of file RWebWindow.cxx.

◆ IsFileDialogMessage()

bool RWebWindow::IsFileDialogMessage ( const std::string &  msg)
static

Check if this could be the message send by client to start new file dialog If returns true, one can call RWebWindow::EmbedFileDialog() to really create file dialog instance inside existing widget.

Definition at line 1967 of file RWebWindow.cxx.

◆ IsNativeOnlyConn()

bool ROOT::RWebWindow::IsNativeOnlyConn ( ) const
inline

returns true if only native (own-created) connections are allowed

Definition at line 313 of file RWebWindow.hxx.

◆ IsRequireAuthKey()

bool ROOT::RWebWindow::IsRequireAuthKey ( ) const
inline

returns true if authentication string is required

Definition at line 321 of file RWebWindow.hxx.

◆ IsShown()

bool ROOT::RWebWindow::IsShown ( ) const
inline

Returns true when window was shown at least once.

Definition at line 362 of file RWebWindow.hxx.

◆ MakeHeadless()

unsigned RWebWindow::MakeHeadless ( bool  create_new = false)
private

Start headless browser for specified window Normally only single instance is used, but many can be created See ROOT::RWebWindowsManager::Show() docu for more info returns (future) connection id (or 0 when fails)

Definition at line 200 of file RWebWindow.cxx.

◆ NumConnections()

int RWebWindow::NumConnections ( bool  with_pending = false) const

Returns current number of active clients connections.

Parameters
with_pendingif true, also pending (not yet established) connection accounted

Definition at line 1334 of file RWebWindow.cxx.

◆ ProcessBatchHolder()

bool RWebWindow::ProcessBatchHolder ( std::shared_ptr< THttpCallArg > &  arg)
private

Process special http request, used to hold headless browser running Such requests should not be replied for the long time Be aware that function called directly from THttpServer thread, which is not same thread as window.

Definition at line 372 of file RWebWindow.cxx.

◆ ProcessWS()

bool RWebWindow::ProcessWS ( THttpCallArg arg)
private

Processing of websockets call-backs, invoked from RWebWindowWSHandler Method invoked from http server thread, therefore appropriate mutex must be used on all relevant data.

Definition at line 741 of file RWebWindow.cxx.

◆ ProvideQueueEntry()

void RWebWindow::ProvideQueueEntry ( unsigned  connid,
EQueueEntryKind  kind,
std::string &&  arg 
)
private

Provide data to user callback User callback must be executed in the window thread.

Definition at line 419 of file RWebWindow.cxx.

◆ RecordData()

void RWebWindow::RecordData ( const std::string &  fname = "protocol.json",
const std::string &  fprefix = "" 
)

Configures recording of communication data in protocol file Provided filename will be used to store JSON array with names of written files - text or binary If data was send from client, "send" entry will be placed.

JSON file will look like:

 ["send", "msg0.txt", "send", "msg1.txt", "msg2.txt"]

If empty file name is provided, data recording will be disabled Recorded data can be used in JSROOT directly to test client code without running C++ server

Definition at line 1359 of file RWebWindow.cxx.

◆ RemoveConnection()

std::shared_ptr< RWebWindow::WebConn > RWebWindow::RemoveConnection ( unsigned  wsid)
private

Remove connection with given websocket id.

Definition at line 277 of file RWebWindow.cxx.

◆ RemoveEmbedWindow()

void RWebWindow::RemoveEmbedWindow ( unsigned  connid,
int  channel 
)
private

Remove RWebWindow associated with the channelfEmbed.

Definition at line 1871 of file RWebWindow.cxx.

◆ RemoveKey()

void RWebWindow::RemoveKey ( const std::string &  key)
private

Removes all connections with the key.

Definition at line 588 of file RWebWindow.cxx.

◆ RemoveMasterConnection()

void RWebWindow::RemoveMasterConnection ( unsigned  connid = 0)
private

Remove master connection - if any.

Definition at line 341 of file RWebWindow.cxx.

◆ Run()

void RWebWindow::Run ( double  tm = 0.)

Run window functionality for specified time If no action can be performed - just sleep specified time.

Definition at line 1831 of file RWebWindow.cxx.

◆ Send()

void RWebWindow::Send ( unsigned  connid,
const std::string &  data 
)

Sends data to specified connection.

Parameters
connidconnection id, when 0 - data will be send to all connections
datadata to be copied to SubmitData function

Definition at line 1613 of file RWebWindow.cxx.

◆ SendBinary() [1/2]

void RWebWindow::SendBinary ( unsigned  connid,
const void *  data,
std::size_t  len 
)

Send binary data to specified connection.

Parameters
connidconnection id, when 0 - data will be send to all connections
datapointer to binary data
lennumber of bytes in data

Definition at line 1634 of file RWebWindow.cxx.

◆ SendBinary() [2/2]

void RWebWindow::SendBinary ( unsigned  connid,
std::string &&  data 
)

Send binary data to specified connection.

Parameters
connidconnection id, when 0 - data will be send to all connections
datadata to be std-moved to SubmitData function

Definition at line 1623 of file RWebWindow.cxx.

◆ SetCallBacks()

void RWebWindow::SetCallBacks ( WebWindowConnectCallback_t  conn,
WebWindowDataCallback_t  data,
WebWindowConnectCallback_t  disconn = nullptr 
)

Set call-backs function for connect, data and disconnect events.

Definition at line 1776 of file RWebWindow.cxx.

◆ SetClearOnClose()

void RWebWindow::SetClearOnClose ( const std::shared_ptr< void > &  handle = nullptr)

Set handle which is cleared when last active connection is closed Typically can be used to destroy web-based widget at such moment.

Definition at line 1768 of file RWebWindow.cxx.

◆ SetClientVersion()

void RWebWindow::SetClientVersion ( const std::string &  vers)

Set client version, used as prefix in scripts URL When changed, web browser will reload all related JS files while full URL will be different Default is empty value - no extra string in URL Version should be string like "1.2" or "ver1.subv2" and not contain any special symbols.

Definition at line 1293 of file RWebWindow.cxx.

◆ SetConnectCallBack()

void RWebWindow::SetConnectCallBack ( WebWindowConnectCallback_t  func)

Set call-back function for new connection.

Definition at line 1747 of file RWebWindow.cxx.

◆ SetConnLimit()

void RWebWindow::SetConnLimit ( unsigned  lmt = 0)

Configure maximal number of allowed connections - 0 is unlimited Will not affect already existing connections Default is 1 - the only client is allowed.

Definition at line 698 of file RWebWindow.cxx.

◆ SetConnToken()

void RWebWindow::SetConnToken ( const std::string &  token = "")

Configures connection token (default none) When specified, in URL of webpage such token should be provided as &token=value parameter, otherwise web window will refuse connection.

Definition at line 720 of file RWebWindow.cxx.

◆ SetDataCallBack()

void RWebWindow::SetDataCallBack ( WebWindowDataCallback_t  func)

Set call-back function for data, received from the clients via websocket.

Function should have signature like void func(unsigned connid, const std::string &data) First argument identifies connection (unique for each window), second argument is received data

At the moment when callback is assigned, RWebWindow working thread is detected. If called not from main application thread, RWebWindow::Run() function must be regularly called from that thread.

Most simple way to assign call-back - use of c++11 lambdas like:

win->SetDefaultPage("file:./page.htm");
win->SetDataCallBack(
[](unsigned connid, const std::string &data) {
printf("Conn:%u data:%s\n", connid, data.c_str());
}
);
win->Show();
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
static std::shared_ptr< RWebWindow > Create()
Create new RWebWindow Using default RWebWindowsManager.

Definition at line 1737 of file RWebWindow.cxx.

◆ SetDefaultPage()

void ROOT::RWebWindow::SetDefaultPage ( const std::string &  page)
inline

Set content of default window HTML page This page returns when URL address of the window will be requested Either HTML code or file name in the form "file:/home/user/data/file.htm" One also can using default locations like "file:rootui5sys/canv/canvas.html".

Definition at line 258 of file RWebWindow.hxx.

◆ SetDisconnectCallBack()

void RWebWindow::SetDisconnectCallBack ( WebWindowConnectCallback_t  func)

Set call-back function for disconnecting.

Definition at line 1757 of file RWebWindow.cxx.

◆ SetGeometry()

void ROOT::RWebWindow::SetGeometry ( unsigned  width,
unsigned  height 
)
inline

Set window geometry. Will be applied if supported by used web display (like CEF or Chromium)

Definition at line 263 of file RWebWindow.hxx.

◆ SetMaxQueueLength()

void ROOT::RWebWindow::SetMaxQueueLength ( unsigned  len = 10)
inline

configures maximal queue length of data which can be held by window

Definition at line 301 of file RWebWindow.hxx.

◆ SetNativeOnlyConn()

void ROOT::RWebWindow::SetNativeOnlyConn ( bool  on = true)
inline

configures that only native (own-created) connections are allowed

Definition at line 309 of file RWebWindow.hxx.

◆ SetOperationTmout()

void ROOT::RWebWindow::SetOperationTmout ( float  tm = 50.)
inline

Set timeout for synchronous WebWindow operations.

Definition at line 347 of file RWebWindow.hxx.

◆ SetPanelName()

void RWebWindow::SetPanelName ( const std::string &  name)

Configure window to show some of existing JSROOT panels It uses "file:rootui5sys/panel/panel.html" as default HTML page At the moment only FitPanel is existing.

Definition at line 132 of file RWebWindow.cxx.

◆ SetPosition()

void ROOT::RWebWindow::SetPosition ( unsigned  x,
unsigned  y 
)
inline

Set window position. Will be applied if supported by used web display (like CEF or Chromium)

Definition at line 270 of file RWebWindow.hxx.

◆ SetRequireAuthKey()

void ROOT::RWebWindow::SetRequireAuthKey ( bool  on)
inline

Configure if authentication key in connection string is required.

Definition at line 317 of file RWebWindow.hxx.

◆ SetStartDialogFunc()

void RWebWindow::SetStartDialogFunc ( std::function< bool(const std::shared_ptr< RWebWindow > &, unsigned, const std::string &)>  func)
staticprivate

Configure func which has to be used for starting dialog.

Definition at line 1957 of file RWebWindow.cxx.

◆ SetUserArgs()

void RWebWindow::SetUserArgs ( const std::string &  args)

Set arbitrary JSON data, which is accessible via conn.getUserArgs() method in JavaScript This JSON code injected into main HTML document into connectWebWindow({}) Must be set before RWebWindow::Show() method is called.

Parameters
args- arbitrary JSON data which can be provided to client side

Definition at line 1314 of file RWebWindow.cxx.

◆ Show()

unsigned RWebWindow::Show ( const RWebDisplayArgs args = "")

Show window in specified location.

See also
ROOT::RWebWindowsManager::Show for more info
Returns
(future) connection id (or 0 when fails)

Definition at line 189 of file RWebWindow.cxx.

◆ ShowWindow()

unsigned RWebWindow::ShowWindow ( std::shared_ptr< RWebWindow window,
const RWebDisplayArgs args = "" 
)
static

Static method to show web window Has to be used instead of RWebWindow::Show() when window potentially can be embed into other windows Soon RWebWindow::Show() method will be done protected.

Definition at line 1919 of file RWebWindow.cxx.

◆ StartThread()

void RWebWindow::StartThread ( )

Start special thread which will be used by the window to handle all callbacks One has to be sure, that access to global ROOT structures are minimized and protected with ROOT::EnableThreadSafety(); call.

Definition at line 1684 of file RWebWindow.cxx.

◆ StopThread()

void RWebWindow::StopThread ( )

Stop special thread.

Definition at line 1706 of file RWebWindow.cxx.

◆ SubmitData()

void RWebWindow::SubmitData ( unsigned  connid,
bool  txt,
std::string &&  data,
int  chid = 1 
)
private

Internal method to send data.

Parameters
connidconnection id, when 0 - data will be send to all connections
txtis text message that should be sent
datadata to be std-moved to SubmitData function
chidchannel id, 1 - normal communication, 0 - internal with highest priority

Definition at line 1533 of file RWebWindow.cxx.

◆ Sync()

void RWebWindow::Sync ( )

Special method to process all internal activity when window runs in separate thread.

Definition at line 1240 of file RWebWindow.cxx.

◆ TerminateROOT()

void RWebWindow::TerminateROOT ( )

Terminate ROOT session Tries to correctly close THttpServer, associated with RWebWindowsManager After that exit from process.

Definition at line 1897 of file RWebWindow.cxx.

◆ UseServerThreads()

void RWebWindow::UseServerThreads ( )

Let use THttpServer threads to process requests WARNING!!! only for expert use Should be only used when application provides proper locking and does not block.

Such mode provides minimal possible latency Must be called before callbacks are assigned

Definition at line 1671 of file RWebWindow.cxx.

◆ WaitFor()

int RWebWindow::WaitFor ( WebWindowWaitFunc_t  check)

Waits until provided check function or lambdas returns non-zero value Check function has following signature: int func(double spent_tm) Waiting will be continued, if function returns zero.

Parameter spent_tm is time in seconds, which already spent inside the function First non-zero value breaks loop and result is returned. Runs application mainloop and short sleeps in-between

Definition at line 1793 of file RWebWindow.cxx.

◆ WaitForTimed() [1/2]

int RWebWindow::WaitForTimed ( WebWindowWaitFunc_t  check)

Waits until provided check function or lambdas returns non-zero value Check function has following signature: int func(double spent_tm) Waiting will be continued, if function returns zero.

Parameter spent_tm in lambda is time in seconds, which already spent inside the function First non-zero value breaks waiting loop and result is returned (or 0 if time is expired). Runs application mainloop and short sleeps in-between WebGui.OperationTmout rootrc parameter defines waiting time in seconds

Definition at line 1807 of file RWebWindow.cxx.

◆ WaitForTimed() [2/2]

int RWebWindow::WaitForTimed ( WebWindowWaitFunc_t  check,
double  duration 
)

Waits until provided check function or lambdas returns non-zero value Check function has following signature: int func(double spent_tm) Waiting will be continued, if function returns zero.

Parameter spent_tm in lambda is time in seconds, which already spent inside the function First non-zero value breaks waiting loop and result is returned (or 0 if time is expired). Runs application mainloop and short sleeps in-between duration (in seconds) defines waiting time

Definition at line 1821 of file RWebWindow.cxx.

Friends And Related Symbol Documentation

◆ RFileDialog

friend class RFileDialog
friend

Definition at line 57 of file RWebWindow.hxx.

◆ RWebDisplayHandle

friend class RWebDisplayHandle
friend

Definition at line 56 of file RWebWindow.hxx.

◆ RWebWindowsManager

friend class RWebWindowsManager
friend

Definition at line 54 of file RWebWindow.hxx.

◆ RWebWindowWSHandler

friend class RWebWindowWSHandler
friend

Definition at line 55 of file RWebWindow.hxx.

Member Data Documentation

◆ fCallbacksThrdId

std::thread::id ROOT::RWebWindow::fCallbacksThrdId
private

! thread id where callbacks should be invoked

Definition at line 159 of file RWebWindow.hxx.

◆ fCallbacksThrdIdSet

bool ROOT::RWebWindow::fCallbacksThrdIdSet {false}
private

! flag indicating that thread id is assigned

Definition at line 160 of file RWebWindow.hxx.

◆ fClearOnClose

std::shared_ptr<void> ROOT::RWebWindow::fClearOnClose
private

! entry which is cleared when last connection is closed

Definition at line 175 of file RWebWindow.hxx.

◆ fClientVersion

std::string ROOT::RWebWindow::fClientVersion
private

! configured client version, used as prefix in scripts URL

Definition at line 168 of file RWebWindow.hxx.

◆ fConn

ConnectionsList_t ROOT::RWebWindow::fConn
private

! list of all accepted connections

Definition at line 150 of file RWebWindow.hxx.

◆ fConnCallback

WebWindowConnectCallback_t ROOT::RWebWindow::fConnCallback
private

! callback for connect event

Definition at line 156 of file RWebWindow.hxx.

◆ fConnCnt

unsigned ROOT::RWebWindow::fConnCnt {0}
private

! counter of new connections to assign ids

Definition at line 148 of file RWebWindow.hxx.

◆ fConnLimit

unsigned ROOT::RWebWindow::fConnLimit {1}
private

! number of allowed active connections

Definition at line 152 of file RWebWindow.hxx.

◆ fConnMutex

std::mutex ROOT::RWebWindow::fConnMutex
mutableprivate

! mutex used to protect connection list

Definition at line 151 of file RWebWindow.hxx.

◆ fConnToken

std::string ROOT::RWebWindow::fConnToken
private

! value of "token" URL parameter which should be provided for connecting window

Definition at line 153 of file RWebWindow.hxx.

◆ fDataCallback

WebWindowDataCallback_t ROOT::RWebWindow::fDataCallback
private

! main callback when data over channel 1 is arrived

Definition at line 157 of file RWebWindow.hxx.

◆ fDefaultPage

std::string ROOT::RWebWindow::fDefaultPage
private

! HTML page (or file name) returned when window URL is opened

Definition at line 139 of file RWebWindow.hxx.

◆ fDisconnCallback

WebWindowConnectCallback_t ROOT::RWebWindow::fDisconnCallback
private

! callback for disconnect event

Definition at line 158 of file RWebWindow.hxx.

◆ fHasWindowThrd

bool ROOT::RWebWindow::fHasWindowThrd {false}
private

! indicate if special window thread was started

Definition at line 161 of file RWebWindow.hxx.

◆ fHeight

unsigned ROOT::RWebWindow::fHeight {0}
private

! initial window width and height when displayed, zeros are ignored

Definition at line 165 of file RWebWindow.hxx.

◆ fId

unsigned ROOT::RWebWindow::fId {0}
private

! unique identifier

Definition at line 141 of file RWebWindow.hxx.

◆ fInputQueue

std::queue<QueueEntry> ROOT::RWebWindow::fInputQueue
private

! input queue for all callbacks

Definition at line 163 of file RWebWindow.hxx.

◆ fInputQueueMutex

std::mutex ROOT::RWebWindow::fInputQueueMutex
private

! mutex to protect input queue

Definition at line 164 of file RWebWindow.hxx.

◆ fMaster

std::shared_ptr<RWebWindow> ROOT::RWebWindow::fMaster
private

! master window where this window is embedded

Definition at line 137 of file RWebWindow.hxx.

◆ fMasterConns

std::vector<MasterConn> ROOT::RWebWindow::fMasterConns
private

! master connections

Definition at line 138 of file RWebWindow.hxx.

◆ fMaxQueueLength

unsigned ROOT::RWebWindow::fMaxQueueLength {10}
private

! maximal number of queue entries

Definition at line 155 of file RWebWindow.hxx.

◆ fMgr

std::shared_ptr<RWebWindowsManager> ROOT::RWebWindow::fMgr
private

! display manager

Definition at line 136 of file RWebWindow.hxx.

◆ fNativeOnlyConn

bool ROOT::RWebWindow::fNativeOnlyConn {false}
private

! only native connection are allowed, created by Show() method

Definition at line 154 of file RWebWindow.hxx.

◆ fOperationTmout

float ROOT::RWebWindow::fOperationTmout {50.}
private

! timeout in seconds to perform synchronous operation, default 50s

Definition at line 167 of file RWebWindow.hxx.

◆ fPanelName

std::string ROOT::RWebWindow::fPanelName
private

! panel name which should be shown in the window

Definition at line 140 of file RWebWindow.hxx.

◆ fPendingConn

ConnectionsList_t ROOT::RWebWindow::fPendingConn
private

! list of pending connection with pre-assigned keys

Definition at line 149 of file RWebWindow.hxx.

◆ fProcessMT

bool ROOT::RWebWindow::fProcessMT {false}
private

! if window event processing performed in dedicated thread

Definition at line 144 of file RWebWindow.hxx.

◆ fProtocol

std::string ROOT::RWebWindow::fProtocol
private

! protocol

Definition at line 173 of file RWebWindow.hxx.

◆ fProtocolCnt

int ROOT::RWebWindow::fProtocolCnt {-1}
private

! counter for protocol recording

Definition at line 170 of file RWebWindow.hxx.

◆ fProtocolConnId

unsigned ROOT::RWebWindow::fProtocolConnId {0}
private

! connection id, which is used for writing protocol

Definition at line 171 of file RWebWindow.hxx.

◆ fProtocolFileName

std::string ROOT::RWebWindow::fProtocolFileName
private

! local file where communication protocol will be written

Definition at line 169 of file RWebWindow.hxx.

◆ fProtocolPrefix

std::string ROOT::RWebWindow::fProtocolPrefix
private

! prefix for created files names

Definition at line 172 of file RWebWindow.hxx.

◆ fRequireAuthKey

bool ROOT::RWebWindow::fRequireAuthKey {true}
private

! defines if authentication key always required when connect to the widget

Definition at line 146 of file RWebWindow.hxx.

◆ fSendMT

bool ROOT::RWebWindow::fSendMT {false}
private

! true is special threads should be used for sending data

Definition at line 145 of file RWebWindow.hxx.

◆ fUseProcessEvents

bool ROOT::RWebWindow::fUseProcessEvents {false}
private

! all window functionality will run through process events

Definition at line 143 of file RWebWindow.hxx.

◆ fUserArgs

std::string ROOT::RWebWindow::fUserArgs
private

! arbitrary JSON code, which is accessible via conn.getUserArgs() method

Definition at line 174 of file RWebWindow.hxx.

◆ fUseServerThreads

bool ROOT::RWebWindow::fUseServerThreads {false}
private

! indicates that server thread is using, no special window thread

Definition at line 142 of file RWebWindow.hxx.

◆ fWidth

unsigned ROOT::RWebWindow::fWidth {0}
private

Definition at line 165 of file RWebWindow.hxx.

◆ fWindowThrd

std::thread ROOT::RWebWindow::fWindowThrd
private

! special thread for that window

Definition at line 162 of file RWebWindow.hxx.

◆ fWSHandler

std::shared_ptr<RWebWindowWSHandler> ROOT::RWebWindow::fWSHandler
private

! specialize websocket handler for all incoming connections

Definition at line 147 of file RWebWindow.hxx.

◆ fX

int ROOT::RWebWindow::fX {-1}
private

Definition at line 166 of file RWebWindow.hxx.

◆ fY

int ROOT::RWebWindow::fY {-1}
private

! initial window position, -1 ignored

Definition at line 166 of file RWebWindow.hxx.

◆ gStartDialogFunc

std::function< bool(const std::shared_ptr< RWebWindow > &, unsigned, const std::string &)> RWebWindow::gStartDialogFunc = nullptr
staticprivate

Definition at line 236 of file RWebWindow.hxx.

Libraries for ROOT::RWebWindow:

The documentation for this class was generated from the following files: