9#ifndef ROOT7_Browsable_RProvider
10#define ROOT7_Browsable_RProvider
21namespace Experimental {
57 static std::string
GetClassIcon(
const ClassArg &,
bool =
false);
63 static bool CanDraw6(
const ClassArg &);
64 static bool CanDraw7(
const ClassArg &);
67 static std::shared_ptr<RElement>
OpenFile(
const std::string &
extension,
const std::string &fullname);
68 static std::shared_ptr<RElement>
Browse(std::unique_ptr<RHolder> &obj);
69 static std::shared_ptr<RElement>
BrowseNTuple(
const std::string &tuplename,
const std::string &
filename);
70 static bool Draw6(
TVirtualPad *subpad, std::unique_ptr<RHolder> &obj,
const std::string &opt =
"");
71 static bool Draw7(std::shared_ptr<ROOT::Experimental::RPadBase> &subpad, std::unique_ptr<RHolder> &obj,
const std::string &opt =
"");
75 using FileFunc_t = std::function<std::shared_ptr<RElement>(
const std::string &)>;
76 using BrowseFunc_t = std::function<std::shared_ptr<RElement>(std::unique_ptr<RHolder> &)>;
77 using BrowseNTupleFunc_t = std::function<std::shared_ptr<RElement>(
const std::string &,
const std::string &)>;
79 using Draw7Func_t = std::function<
bool(std::shared_ptr<ROOT::Experimental::RPadBase> &, std::unique_ptr<RHolder> &,
const std::string &)>;
86 const std::string &iconname,
87 const std::string &browselib =
"",
88 const std::string &draw6lib =
"",
89 const std::string &draw7lib =
"",
90 const std::string &drawopt =
"");
107 using FileMap_t = std::multimap<std::string, StructFile>;
109 using Draw6Map_t = std::multimap<const TClass*, StructDraw6>;
110 using Draw7Map_t = std::multimap<const TClass*, StructDraw7>;
121 template<
class Map_t>
126 auto fiter = fmap.begin();
127 while (fiter != fmap.end()) {
128 if (fiter->second.provider ==
this)
129 fiter = fmap.erase(fiter);
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
const TClass * GetClass() const
ClassArg(const char *_name)
const std::string & GetName() const
ClassArg(const std::string &_name)
ClassArg(const TClass *_cl)
Provider of different browsing methods for supported classes.
void RegisterDraw7(const TClass *cl, Draw7Func_t func)
static std::shared_ptr< RElement > BrowseNTuple(const std::string &tuplename, const std::string &filename)
Start browsing of RNTuple.
void RegisterClass(const std::string &clname, const std::string &iconname, const std::string &browselib="", const std::string &draw6lib="", const std::string &draw7lib="", const std::string &drawopt="")
std::function< bool(std::shared_ptr< ROOT::Experimental::RPadBase > &, std::unique_ptr< RHolder > &, const std::string &)> Draw7Func_t
static bool CanDraw6(const ClassArg &)
Return true if provided class can be drawn on the TCanvas.
static ClassMap_t & GetClassMap()
static bool SetClassDrawOption(const ClassArg &, const std::string &)
Set draw option for the class Return true if entry for the class exists.
static FileMap_t & GetFileMap()
void RegisterDraw6(const TClass *cl, Draw6Func_t func)
static std::shared_ptr< RElement > Browse(std::unique_ptr< RHolder > &obj)
Create browsable element for the object Created element may take ownership over the object.
static bool CanDraw7(const ClassArg &)
Return true if provided class can be drawn on the RCanvas.
static BrowseNTupleFunc_t gNTupleFunc
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...
virtual ~RProvider()
Automatically unregister provider from all maps.
std::multimap< std::string, StructClass > ClassMap_t
static std::string GetClassIcon(const ClassArg &, bool=false)
Return icon name for the given class - either class name or TClass *.
std::multimap< std::string, StructFile > FileMap_t
static bool Draw7(std::shared_ptr< ROOT::Experimental::RPadBase > &subpad, std::unique_ptr< RHolder > &obj, const std::string &opt="")
Invoke drawing of object on RCanvas sub-pad All existing providers are checked, first checked are cla...
void RegisterFile(const std::string &extension, FileFunc_t func)
static bool IsFileFormatSupported(const std::string &extension)
static Draw7Map_t & GetDraw7Map()
std::function< std::shared_ptr< RElement >(const std::string &, const std::string &)> BrowseNTupleFunc_t
std::function< std::shared_ptr< RElement >(std::unique_ptr< RHolder > &)> BrowseFunc_t
std::multimap< const TClass *, StructBrowse > BrowseMap_t
void RegisterBrowse(const TClass *cl, BrowseFunc_t func)
void RegisterNTupleFunc(BrowseNTupleFunc_t func)
std::function< std::shared_ptr< RElement >(const std::string &)> FileFunc_t
static bool CanHaveChilds(const ClassArg &)
Return true if provided class can have childs.
std::function< bool(TVirtualPad *, std::unique_ptr< RHolder > &, const std::string &)> Draw6Func_t
static BrowseMap_t & GetBrowseMap()
static StructClass & GetClassEntry(const ClassArg &)
static std::shared_ptr< RElement > OpenFile(const std::string &extension, const std::string &fullname)
std::multimap< const TClass *, StructDraw7 > Draw7Map_t
static Draw6Map_t & GetDraw6Map()
static bool NotShowChilds(const ClassArg &)
Check if showing of sub-elements was disabled.
static std::string GetClassDrawOption(const ClassArg &)
Return configured draw option for the class.
void CleanThis(Map_t &fmap)
std::multimap< const TClass *, StructDraw6 > Draw6Map_t
TClass instances represent classes, structs and namespaces in the ROOT type system.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.