2015-07-07 11:15:24 +00:00
|
|
|
/*
|
2023-06-23 14:04:32 +03:00
|
|
|
* 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
|
2023-06-27 21:22:21 +03:00
|
|
|
* COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
|
2015-07-07 11:15:24 +00:00
|
|
|
*/
|
|
|
|
|
2017-12-09 13:36:45 +01:00
|
|
|
#pragma once
|
|
|
|
|
2021-12-28 19:01:31 +09:00
|
|
|
#define NUM_COLORS 28
|
|
|
|
|
|
|
|
enum PAL_TYPE
|
|
|
|
{
|
|
|
|
PAL_MODERN = 1,
|
|
|
|
PAL_OLDTYPE = 2,
|
|
|
|
};
|
|
|
|
|
2015-07-07 11:15:24 +00:00
|
|
|
/* CLASSES **********************************************************/
|
|
|
|
|
|
|
|
class PaletteModel
|
|
|
|
{
|
|
|
|
private:
|
2021-12-28 19:01:31 +09:00
|
|
|
COLORREF m_colors[NUM_COLORS];
|
|
|
|
PAL_TYPE m_nSelectedPalette;
|
|
|
|
COLORREF m_fgColor;
|
|
|
|
COLORREF m_bgColor;
|
2015-07-07 11:44:50 +00:00
|
|
|
|
|
|
|
void NotifyColorChanged();
|
|
|
|
void NotifyPaletteChanged();
|
|
|
|
|
2015-07-07 11:15:24 +00:00
|
|
|
public:
|
|
|
|
PaletteModel();
|
2021-12-28 19:01:31 +09:00
|
|
|
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);
|
2015-07-07 11:15:24 +00:00
|
|
|
};
|