2015-07-07 11:15:24 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: PAINT for ReactOS
|
|
|
|
* LICENSE: LGPL
|
2015-09-09 13:13:35 +00:00
|
|
|
* FILE: base/applications/mspaint/palettemodel.h
|
2015-07-07 11:15:24 +00:00
|
|
|
* PURPOSE: Keep track of palette data, notify listeners
|
|
|
|
* PROGRAMMERS: Benedikt Freisen
|
|
|
|
*/
|
|
|
|
|
2017-12-09 12:36:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-12-28 10:01:31 +00: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 10:01:31 +00: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 10:01:31 +00: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
|
|
|
};
|