11#ifndef ROOT_TWebCanvas
12#define ROOT_TWebCanvas
62 std::shared_ptr<ROOT::Experimental::RWebWindow>
fWindow;
135 void Close()
override;
136 void Show()
override;
194 void AddCustomClass(
const std::string &clname,
bool with_derived =
false);
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
#define ClassDefOverride(name, id)
include TDocParser_001 C image html pict1_TDocParser_001 png width
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.
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 wit for reply.
Int_t GetPrimitivesMerge() const
void AddCustomClass(const std::string &clname, bool with_derived=false)
Assign custom class.
Bool_t CheckPadModified(TPad *pad, Bool_t inc_version=kTRUE)
Returns true if any pad in the canvas were modified Reset modified flags, increment canvas version (i...
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
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)
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
static bool ProduceImage(TCanvas *c, const char *filename, Int_t width=0, Int_t height=0)
Create image using batch (headless) capability of Chrome browser Supported png, jpeg,...
void SetActivePadChangedHandler(PadSignal_t func)
void SetLongerPolling(Bool_t on)
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
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...
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 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)
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 SetUpdatedHandler(UpdatedSignal_t func)
std::function< void(TPad *, int, int)> PadClickedSignal_t
Function type for pad-click signals.
virtual Bool_t DecodePadOptions(const std::string &)
Decode all pad options, which includes ranges plus objects options.
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
Bool_t fAsyncMode
! when true, methods like TCanvas::Update will never block
void ShowEditor(Bool_t show=kTRUE) override
Bool_t fHasSpecials
! has special objects which may require pad ranges
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.
TPad * ProcessObjectOptions(TWebObjectOptions &item, TPad *pad)
Process data for single primitive Returns object pad if object was modified.
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)
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
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
Int_t GetPaletteDelivery() const
TObject * FindPrimitive(const std::string &id, TPad *pad=nullptr, TObjLink **padlnk=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.
std::queue< std::string > fSend
! send queue, processed after sending draw data
unsigned fConnId
! connection id
Long64_t fSendVersion
! canvas version send to the client
Long64_t fDrawVersion
! canvas version drawn (confirmed) by client