Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
16 namespace ROOT {
17 namespace Experimental {
18 
19 class 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 
30 class RStyle {
31 
32 public:
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 
52 private:
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