mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
f5200e6c25
According to Benedikt Freisen, he didn't port the code base to C++
until 2015. Addendum to 8f1f1c7a5a
. CORE-18867
41 lines
974 B
C++
41 lines
974 B
C++
/*
|
|
* 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);
|
|
};
|