Logo ROOT  
Reference Guide
RStyle.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_RStyle
10#define ROOT7_RStyle
11
12#include <ROOT/RAttrMap.hxx>
13
14#include <string>
15
16namespace ROOT {
17namespace Experimental {
18
19class RDrawable;
20
21/** \class RStyle
22\ingroup GpadROOT7
23\brief A set of defaults for graphics attributes, e.g. for histogram fill color, line width, frame offsets etc. Uses CSS syntax.
24\author Axel Naumann <axel@cern.ch>
25\author Sergey Linev <s.linev@gsi.de>
26\date 2017-10-10
27\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
28*/
29
30class RStyle {
31
32public:
33
34 struct Block_t {
35 std::string selector;
36 RAttrMap map; ///< container
37 Block_t() = default;
38 Block_t(const std::string &_selector) : selector(_selector) {}
39
40 Block_t(const Block_t &) {} // dummy, should not be used, but appears in dictionary
41 Block_t& operator=(const Block_t &) = delete;
42 };
43
44 const RAttrMap::Value_t *Eval(const std::string &field, const RDrawable &drawable) const;
45
46 RAttrMap &AddBlock(const std::string &selector)
47 {
48 fBlocks.emplace_back(selector);
49 return fBlocks.back().map;
50 }
51
52private:
53
54 std::list<Block_t> fBlocks; // use std::list to avoid calling of Block_t copy constructor
55
56};
57
58} // namespace Experimental
59} // namespace ROOT
60
61#endif // ROOT7_RStyle
Base class for drawable entities: objects that can be painted on a RPad.
Definition: RDrawable.hxx:99
A set of defaults for graphics attributes, e.g.
Definition: RStyle.hxx:30
std::list< Block_t > fBlocks
Definition: RStyle.hxx:54
const RAttrMap::Value_t * Eval(const std::string &field, const RDrawable &drawable) const
Evaluate style.
Definition: RStyle.cxx:22
RAttrMap & AddBlock(const std::string &selector)
Definition: RStyle.hxx:46
VSD Structures.
Definition: StringConv.hxx:21
Block_t(const std::string &_selector)
Definition: RStyle.hxx:38
Block_t & operator=(const Block_t &)=delete