17using namespace std::string_literals;
26 name += std::tolower(
c);
46 name += std::tolower(
c);
48 for (
const auto &
block : fBlocks) {
49 if (
block.selector == selector) {
91 char current()
const {
return css_code[pos]; }
93 void shift() { ++pos; }
105 std::string res =
"\nLine "s + std::to_string(
nline) +
": "s;
118 if (current() ==
'\n') {
136 if ((current() ==
'/') && (pos+1 <
len)) {
141 }
else if (
css_code[pos+1] ==
'*') {
156 if (pos >=
len)
return ""s;
161 if (selector && ((current() ==
'.') || (current() ==
'#'))) shift();
169 std::transform(s.begin(), s.end(), s.begin(),
170 [](
unsigned char c){ return std::tolower(c); });
176 if (pos >=
len)
return ""s;
180 while ((pos <
len) && (current() !=
';') && current() !=
'\n') shift();
196 while (parser.more_data()) {
198 if (!parser.skip_empty())
201 auto sel = parser.scan_identifier(
true);
207 if (!parser.skip_empty())
210 if (parser.current() !=
'{') {
217 if (!parser.skip_empty())
222 while (parser.current() !=
'}') {
223 auto name = parser.scan_identifier();
229 if (!parser.skip_empty())
232 if (parser.current() !=
':') {
239 if (!parser.skip_empty())
242 if (parser.current() ==
';') {
244 map.AddNoValue(
name);
246 auto value = parser.scan_value();
255 if (!parser.skip_empty())
265 fBlocks.splice(fBlocks.end(),
newstyle.fBlocks);
276 auto style = std::make_shared<RStyle>();
#define R__LOG_ERROR(...)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Base class for drawable entities: objects that can be painted on a RPad.
bool MatchSelector(const std::string &selector) const
Preliminary method which checks if drawable matches with given selector Following selector are allowe...
A set of defaults for graphics attributes, e.g.
std::list< Block_t > fBlocks
const RAttrMap::Value_t * Eval(const std::string &field, const RDrawable &drawable) const
Evaluate attribute value for provided RDrawable.
void Clear()
Parse string with CSS code inside.
bool ParseString(const std::string &css_code)
Parse string with CSS code inside All data will be append to existing style records.
static std::shared_ptr< RStyle > Parse(const std::string &css_code)
Parse CSS code and returns std::shared_ptr<RStyle> when successful.
ROOT::RLogChannel & GPadLog()
Log channel for GPad diagnostics.