38 reader.ReadDefaults();
58 auto iStyle = GetGlobalStyles().find(std::string(
name));
59 if (iStyle != GetGlobalStyles().end())
60 return &iStyle->second;
66static RStyle GetInitialCurrent()
68 static constexpr const char* kDefaultStyleName =
"plain";
69 auto iDefStyle = GetGlobalStyles().find(std::string(kDefaultStyleName));
70 if (iDefStyle == GetGlobalStyles().end()) {
71 R__INFO_HERE(
"Gpad") <<
"Cannot find initial default style named \"" << kDefaultStyleName
72 <<
"\", using an empty one.";
73 RStyle defStyle(kDefaultStyleName);
76 return iDefStyle->second;
83 static RStyle sCurrentStyle = GetInitialCurrent();
88 std::string trailingPart(attrName);
89 while (!trailingPart.empty()) {
90 auto iter =
fAttrs.find(trailingPart);
93 auto posDot = trailingPart.find(
'.');
94 if (posDot != std::string::npos) {
95 trailingPart.erase(0, posDot + 1);
#define R__INFO_HERE(GROUP)
std::unordered_map< std::string, RStyle > AllStyles_t
Key is the style name.
A set of defaults for graphics attributes, e.g.
static RStyle & Register(RStyle &&style)
Move-register style in the global style collection, possibly replacing a global style with the same n...
static RStyle & GetCurrent()
Get the current RStyle.
static RStyle * Get(std::string_view name)
Get the RStyle named name from the global style collection, or nullptr if that doesn't exist.
std::string GetAttribute(const std::string &attrName, const std::string &className={}) const
Get the style value as a string, given an attribute name.
const char * GetName() const
Returns name of object.
basic_string_view< char > string_view