24using namespace std::string_literals;
32 std::unique_ptr<Browsable::RHolder>
fObject;
36 Long_t offset = TCanvas::Class()->GetDataMemberOffset(
"fCanvasID");
39 if (*
id ==
fCanvas->GetCanvasID()) *
id = on_init ? 111222333 : -1;
41 printf(
"ERROR: Cannot modify TCanvas::fCanvasID data member\n");
44 offset = TCanvas::Class()->GetDataMemberOffset(
"fPixmapID");
47 if (*
id ==
fCanvas->GetPixmapID()) *
id = on_init ? 332211 : -1;
49 printf(
"ERROR: Cannot modify TCanvas::fPixmapID data member\n");
52 offset = TCanvas::Class()->GetDataMemberOffset(
"fMother");
57 printf(
"ERROR: Cannot set TCanvas::fMother data member\n");
108 std::string
GetKind()
const override {
return "tcanvas"s; }
115 void Show(
const std::string &arg)
override
130 bool DrawElement(std::shared_ptr<Browsable::RElement> &elem,
const std::string &opt)
override
157 std::shared_ptr<RBrowserWidget>
Create(
const std::string &
name)
final
159 return std::make_shared<RBrowserTCanvasWidget>(
name);
162 std::shared_ptr<RBrowserWidget>
CreateFor(
const std::string &
name, std::shared_ptr<Browsable::RElement> &elem)
final
164 auto holder = elem->GetObject();
165 if (!holder)
return nullptr;
167 auto canv = holder->get_unique<
TCanvas>();
168 if (!canv)
return nullptr;
170 return std::make_shared<RBrowserTCanvasWidget>(
name, canv);
~RBrowserTCanvasProvider()=default
std::shared_ptr< RBrowserWidget > Create(const std::string &name) final
RBrowserTCanvasProvider()
std::shared_ptr< RBrowserWidget > CreateFor(const std::string &name, std::shared_ptr< Browsable::RElement > &elem) final
@ kActDraw6
can be drawn inside ROOT6 canvas
static bool Draw6(TVirtualPad *subpad, std::unique_ptr< RHolder > &obj, const std::string &opt="")
Invoke drawing of object on TCanvas sub-pad All existing providers are checked, first checked are cla...
The most important graphics class in the ROOT system.
TVirtualPad * GetMother() const override
Basic TCanvasImp ABI implementation for Web-based GUI Provides painting of main ROOT6 classes in web ...
const std::shared_ptr< ROOT::Experimental::RWebWindow > & GetWebWindow() const
void ShowWebWindow(const ROOT::Experimental::RWebDisplayArgs &user_args="")
Show canvas in specified place.