1 /*
2  * PROJECT:    PAINT for ReactOS
3  * LICENSE:    LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4  * PURPOSE:    Keep track of palette data, notify listeners
5  * COPYRIGHT:  Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
6  */
7 
8 #pragma once
9 
10 #define NUM_COLORS 28
11 
12 enum PAL_TYPE
13 {
14     PAL_MODERN = 1,
15     PAL_OLDTYPE = 2,
16 };
17 
18 /* CLASSES **********************************************************/
19 
20 class PaletteModel
21 {
22 private:
23     COLORREF m_colors[NUM_COLORS];
24     PAL_TYPE m_nSelectedPalette;
25     COLORREF m_fgColor;
26     COLORREF m_bgColor;
27 
28     void NotifyColorChanged();
29     void NotifyPaletteChanged();
30 
31 public:
32     PaletteModel();
33     PAL_TYPE SelectedPalette();
34     void SelectPalette(PAL_TYPE nPalette);
35     COLORREF GetColor(UINT nIndex) const;
36     void SetColor(UINT nIndex, COLORREF newColor);
37     COLORREF GetFgColor() const;
38     void SetFgColor(COLORREF newColor);
39     COLORREF GetBgColor() const;
40     void SetBgColor(COLORREF newColor);
41 };
42