11#ifndef ROOT_TWebCanvas
12#define ROOT_TWebCanvas
80 std::shared_ptr<ROOT::Experimental::RWebWindow>
fWindow;
162 void Close()
override;
163 void Show()
override;
220 void AddCustomClass(
const std::string &clname,
bool with_derived =
false);
#define ClassDefOverride(name, id)
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 TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
ABC describing GUI independent main window (with menubar, scrollbars and a drawing area).
TClass instances represent classes, structs and namespaces in the ROOT type system.
TExec is a utility class that can be used to execute a C++ command when some event happens in a pad.
Wrapper around a TObject so it can be stored in a TList.
Mother of all ROOT objects.
The most important graphics class in the ROOT system.
To make it possible to use GL for 2D graphic in a TPad/TCanvas.
Basic TCanvasImp ABI implementation for Web-based GUI Provides painting of main ROOT6 classes in web ...
TVirtualPadPainter * CreatePadPainter() override
Creates web-based pad painter.
void ForceUpdate() override
Increment canvas version and force sending data to client - do not wait for reply.
Int_t GetPrimitivesMerge() const
void AddCustomClass(const std::string &clname, bool with_derived=false)
Assign custom class.
UInt_t fColorsHash
! last hash of colors/palette
void ShowCmd(const std::string &arg, Bool_t show)
Function used to send command to browser to toggle menu, toolbar, editors, ...
Bool_t fCanCreateObjects
! indicates if canvas allowed to create extra objects for interactive painting
Long64_t fColorsVersion
! current colors/palette version, checked every time when new snapshot created
std::string fCustomScripts
! custom JavaScript code or URL on JavaScript files to load before start drawing
virtual Bool_t IsReadOnly() const
virtual Bool_t IsJSSupportedClass(TObject *obj, Bool_t many_primitives=kFALSE)
Returns kTRUE when object is fully supported on JSROOT side In ROOT7 Paint function will just return ...
void SetCustomScripts(const std::string &src)
Configures custom script for canvas.
ObjectSelectSignal_t fObjSelectSignal
! signal emitted when new object selected in the pad
PadClickedSignal_t fPadClickedSignal
! signal emitted when simple mouse click performed on the pad
void SetActivePadChangedHandler(PadSignal_t func)
void SetLongerPolling(Bool_t on)
UInt_t fStyleHash
! last hash of gStyle
virtual Bool_t CanCreateObject(const std::string &)
void SetStyleDelivery(Int_t val)
const std::shared_ptr< ROOT::Experimental::RWebWindow > & GetWebWindow() const
Int_t fPrimitivesMerge
! number of PS primitives, which will be merged together
void ShowToolTips(Bool_t show=kTRUE) override
void SetAsyncMode(Bool_t on=kTRUE)
std::function< void()> UpdatedSignal_t
Function type for signals, invoked when canvas drawing or update is completed.
void Show() override
Show canvas in browser window.
Bool_t HasToolBar() const override
Bool_t WaitWhenCanvasPainted(Long64_t ver)
Wait when specified version of canvas was painted and confirmed by browser.
Bool_t IsWeb() const override
void ShowMenuBar(Bool_t show=kTRUE) override
std::vector< std::string > fCustomClasses
! list of custom classes, which can be delivered as is to client
static TString CreatePadJSON(TPad *pad, Int_t json_compression=0)
Bool_t IsAsyncMode() const
static TString CreateCanvasJSON(TCanvas *c, Int_t json_compression=0)
Create JSON painting output for given canvas Produce JSON can be used for offline drawing with JSROOT...
UInt_t CalculateColorsHash()
Calculate hash function for all colors and palette.
Bool_t HasStatusBar() const override
Returns kTRUE if web canvas has status bar.
void Close() override
Close web canvas - not implemented.
Bool_t HasMenuBar() const override
Returns kTRUE if web canvas has menu bar.
Int_t InitWindow() override
Initialize window for the web canvas At this place canvas is not yet register to the list of canvases...
void CheckPadModified(TPad *pad)
Returns true if any pad in the canvas were modified Reset modified flags, increment canvas version (i...
static bool ProduceImage(TPad *pad, const char *filename, Int_t width=0, Int_t height=0)
Create image using batch (headless) capability of Chrome or Firefox browsers Supported png,...
void SetPadDblClickedHandler(PadClickedSignal_t func)
void ActivateInEditor(TPad *pad, TObject *obj)
Activate object in editor in web browser.
std::vector< WebConn > fWebConn
! connections
PadSignal_t fActivePadChangedSignal
! signal emitted when active pad changed in the canvas
Bool_t GetLongerPolling() const
void ShowWebWindow(const ROOT::Experimental::RWebDisplayArgs &user_args="")
Show canvas in specified place.
UInt_t fClientBits
! latest status bits from client like editor visible or not
std::function< void(TPadWebSnapshot *)> PadPaintingReady_t
Function called when pad painting produced.
Int_t fPaletteDelivery
! colors palette delivery 0:never, 1:once, 2:always, 3:per subpad
void ShowToolBar(Bool_t show=kTRUE) override
Bool_t fProcessingData
! flag used to prevent blocking methods when process data is invoked
Bool_t HasToolTips() const override
Returns kTRUE if tooltips are activated in web canvas.
Bool_t AddToSendQueue(unsigned connid, const std::string &msg)
Add message to send queue for specified connection If connid == 0, message will be add to all connect...
Long64_t fCanvVersion
! actual canvas version, changed with every new Modified() call
bool IsCustomClass(const TClass *cl) const
Checks if class belongs to custom.
void SetPadClickedHandler(PadClickedSignal_t func)
TPad * ProcessObjectOptions(TWebObjectOptions &item, TPad *pad, int idcnt=1)
Process data for single primitive Returns object pad if object was modified.
void CreateObjectSnapshot(TPadWebSnapshot &master, TPad *pad, TObject *obj, const char *opt, TWebPS *masterps=nullptr)
Creates representation of the object for painting in web browser.
void AddColorsPalette(TPadWebSnapshot &master)
Add special canvas objects like colors list at selected palette.
void CheckCanvasModified(bool force_modified=false)
Check if any pad on the canvas was modified If yes, increment version of correspondent pad.
Long64_t fStyleVersion
! current gStyle object version, checked every time when new snapshot created
void SetUpdatedHandler(UpdatedSignal_t func)
std::function< void(TPad *, int, int)> PadClickedSignal_t
Function type for pad-click signals.
Bool_t PerformUpdate() override
if canvas or any subpad was modified, scan all primitives in the TCanvas and subpads and convert them...
Bool_t fLongerPolling
! when true, make longer polling in blocking operations
void ShowStatusBar(Bool_t show=kTRUE) override
void CheckDataToSend(unsigned connid=0)
Check if any data should be send to client If connid != 0, only selected connection will be checked.
UpdatedSignal_t fUpdatedSignal
! signal emitted when canvas updated or state is changed
Bool_t IsLocked() override
Int_t fJsonComp
! compression factor for messages send to the client
Bool_t IsFirstConn(unsigned connid) const
Bool_t fReadOnly
!< configured display
std::map< TPad *, PadStatus > fPadsStatus
! map of pads in canvas and their status flags
Bool_t fAsyncMode
! when true, methods like TCanvas::Update will never block
void ShowEditor(Bool_t show=kTRUE) override
void AssignStatusBits(UInt_t bits)
Assign clients bits.
virtual Bool_t ProcessData(unsigned connid, const std::string &arg)
Handle data from web browser Returns kFALSE if message was not processed.
std::function< void(TPad *)> PadSignal_t
Function type for pad-related signals - like activate pad signal.
void SetCanCreateObjects(Bool_t on=kTRUE)
static Int_t StoreCanvasJSON(TCanvas *c, const char *filename, const char *option="")
Create JSON painting output for given canvas and store into the file See TBufferJSON::ExportToFile() ...
void SetPrimitivesMerge(Int_t cnt)
UInt_t GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h) override
Returns window geometry including borders and menus.
std::shared_ptr< ROOT::Experimental::RWebWindow > fWindow
void SetPaletteDelivery(Int_t val)
static TCanvasImp * NewCanvas(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height)
Static method to create TWebCanvas instance Used by plugin manager.
void SetObjSelectHandler(ObjectSelectSignal_t func)
std::function< void(TPad *, TObject *)> ObjectSelectSignal_t
Function type for signals, invoked when object is selected.
Bool_t HasEditor() const override
Returns kTRUE if web canvas has graphical editor.
Int_t fStyleDelivery
! gStyle delivery to clients: 0:never, 1:once, 2:always
PadClickedSignal_t fPadDblClickedSignal
! signal emitted when simple mouse click performed on the pad
void ProcessExecs(TPad *pad, TExec *extra=nullptr)
Process TExec objects in the pad.
TList fPrimitivesLists
! list of lists of primitives, temporary collected during painting
void CreatePadSnapshot(TPadWebSnapshot &paddata, TPad *pad, Long64_t version, PadPaintingReady_t func)
Create snapshot for pad and all primitives Callback function is used to create JSON in the middle of ...
Bool_t GetCanCreateObjects() const
virtual Bool_t DecodePadOptions(const std::string &, bool process_execs=false)
Decode all pad options, which includes ranges plus objects options.
Int_t GetPaletteDelivery() const
TObject * FindPrimitive(const std::string &id, int idcnt=1, TPad *pad=nullptr, TObjLink **objlnk=nullptr, TPad **objpad=nullptr)
Search of object with given id in list of primitives One could specify pad where search could be star...
virtual ~TWebCanvas()=default
Int_t GetStyleDelivery() const
Class used to transport drawing options from the client.
bool _has_specials
! are there any special objects with painting
Long64_t fVersion
! last pad version
bool _modified
! if pad was modified during last scan
bool _detected
! if pad was detected during last scan
std::queue< std::string > fSend
! send queue, processed after sending draw data
UInt_t fLastSendHash
! hash of last send draw message, avoid looping
unsigned fConnId
! connection id
Long64_t fSendVersion
! canvas version send to the client
Long64_t fCheckedVersion
! canvas version checked before sending
Long64_t fDrawVersion
! canvas version drawn (confirmed) by client