28 static std::unordered_map<std::string, TStyle> ReadGlobalDefaultStyles()
34 static std::unordered_map<std::string, TStyle> &GetGlobalStyles()
36 static std::unordered_map<std::string, TStyle> sStyles = ReadGlobalDefaultStyles();
48 auto iStyle = GetGlobalStyles().find(std::string(name));
49 if (iStyle != GetGlobalStyles().end())
50 return &iStyle->second;
56 static TStyle GetInitialCurrent()
58 static constexpr
const char* kDefaultStyleName =
"plain";
59 auto iDefStyle = GetGlobalStyles().find(std::string(kDefaultStyleName));
60 if (iDefStyle == GetGlobalStyles().end()) {
61 R__ERROR_HERE(
"Gpad") <<
"Cannot find initial default style named \"" << kDefaultStyleName
62 <<
"\", using an empty one.";
63 TStyle defStyle(kDefaultStyleName);
67 return iDefStyle->second;
74 static TStyle sCurrentStyle = GetInitialCurrent();
static TStyle * Get(std::string_view name)
Get the TStyle named name from the global style collection, or nullptr if that doesn't exist...
basic_string_view< char > string_view
A set of defaults for graphics attributes, e.g.
static TStyle & GetCurrent()
Get the current TStyle.
const std::string & GetName() const
static void Register(const TStyle &style)
Register a copy of style in the global style collection, possibly replacing a global style with the s...
#define R__ERROR_HERE(GROUP)