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