src/colors.h

changeset 861
83426c5fa732
parent 844
11587d419d2f
child 927
409b82a4765e
child 945
c310073e4f22
equal deleted inserted replaced
860:a496e72af069 861:83426c5fa732
37 inline bool operator== (decltype(nullptr)) { return data() == nullptr; } \ 37 inline bool operator== (decltype(nullptr)) { return data() == nullptr; } \
38 inline bool operator!= (decltype(nullptr)) { return data() != nullptr; } \ 38 inline bool operator!= (decltype(nullptr)) { return data() != nullptr; } \
39 inline DataType* operator->() const = delete; 39 inline DataType* operator->() const = delete;
40 40
41 #define SHARED_POINTER_DATA_ACCESS(N) \ 41 #define SHARED_POINTER_DATA_ACCESS(N) \
42 public: inline decltype(DataType::_##N) const& N() const { return data()->_##N; } 42 public: inline decltype(DataType::m_##N) const& N() const { return data()->m_##N; }
43 43
44 class LDColor; 44 class LDColor;
45 45
46 struct LDColorData 46 struct LDColorData
47 { 47 {
48 QString _name; 48 QString m_name;
49 QString _hexcode; 49 QString m_hexcode;
50 QColor _faceColor; 50 QColor m_faceColor;
51 QColor _edgeColor; 51 QColor m_edgeColor;
52 qint32 _index; 52 qint32 m_index;
53 }; 53 };
54 54
55 class LDColor : public QSharedPointer<LDColorData> 55 class LDColor : public QSharedPointer<LDColorData>
56 { 56 {
57 SHARED_POINTER_DERIVATIVE (LDColor) 57 SHARED_POINTER_DERIVATIVE (LDColor)
68 bool operator== (Self const& other); 68 bool operator== (Self const& other);
69 static void addLDConfigColor (qint32 index, LDColor color); 69 static void addLDConfigColor (qint32 index, LDColor color);
70 static LDColor fromIndex (qint32 index); 70 static LDColor fromIndex (qint32 index);
71 }; 71 };
72 72
73 void initColors(); 73 void InitColors();
74 int luma (const QColor& col); 74 int Luma (const QColor& col);
75 int numLDConfigColors(); 75 int CountLDConfigColors();
76 76
77 // Main and edge colors 77 // Main and edge colors
78 LDColor maincolor(); 78 LDColor MainColor();
79 LDColor edgecolor(); 79 LDColor EdgeColor();
80 static constexpr int mainColorIndex = 16; 80
81 static constexpr int edgeColorIndex = 24; 81 enum
82 {
83 MainColorIndex = 16,
84 EdgeColorIndex = 24,
85 };

mercurial