comparison layer/SingleColourLayer.h @ 768:8b614632568c

SingleColourLayer: fix colour reference counting * Always unref/ref colour before/after changing. * Ref colour in constructor and unref in destructor.
author Jakob Leben <jakob.leben@gmail.com>
date Sat, 12 Apr 2014 01:07:05 -0700
parents 156a120345ae
children a5488775f880
comparison
equal deleted inserted replaced
767:e93c6ae12526 768:8b614632568c
73 73
74 virtual void setDefaultColourFor(View *v); 74 virtual void setDefaultColourFor(View *v);
75 75
76 protected: 76 protected:
77 SingleColourLayer(); 77 SingleColourLayer();
78 virtual ~SingleColourLayer();
78 79
79 virtual QColor getBaseQColor() const; 80 virtual QColor getBaseQColor() const;
80 virtual QColor getBackgroundQColor(View *v) const; 81 virtual QColor getBackgroundQColor(View *v) const;
81 virtual QColor getForegroundQColor(View *v) const; 82 virtual QColor getForegroundQColor(View *v) const;
82 std::vector<QColor> getPartialShades(View *v) const; 83 std::vector<QColor> getPartialShades(View *v) const;
89 static ColourRefCount m_colourRefCount; 90 static ColourRefCount m_colourRefCount;
90 91
91 int m_colour; 92 int m_colour;
92 bool m_colourExplicitlySet; 93 bool m_colourExplicitlySet;
93 bool m_defaultColourSet; 94 bool m_defaultColourSet;
95
96 private:
97 void refColor();
98 void unrefColor();
94 }; 99 };
95 100
96 #endif 101 #endif