2017-01-02 21:07:43 -05:00
|
|
|
// Copyright (c) Charles J. Cliffe
|
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
|
2015-01-14 22:14:57 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Gradient.h"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2016-09-29 21:57:23 -04:00
|
|
|
#include <wx/colour.h>
|
2015-01-14 22:14:57 -05:00
|
|
|
|
|
|
|
#define COLOR_THEME_DEFAULT 0
|
2019-09-23 01:24:04 -04:00
|
|
|
#define COLOR_THEME_DEFAULT_JET 1
|
|
|
|
#define COLOR_THEME_BW 2
|
|
|
|
#define COLOR_THEME_SHARP 3
|
|
|
|
#define COLOR_THEME_RAD 4
|
|
|
|
#define COLOR_THEME_TOUCH 5
|
|
|
|
#define COLOR_THEME_HD 6
|
|
|
|
#define COLOR_THEME_RADAR 7
|
|
|
|
#define COLOR_THEME_MAX 8
|
2015-01-14 22:14:57 -05:00
|
|
|
|
2015-08-17 21:52:38 -04:00
|
|
|
class RGBA4f {
|
2015-01-14 22:14:57 -05:00
|
|
|
public:
|
2015-08-17 21:52:38 -04:00
|
|
|
float r, g, b, a;
|
|
|
|
RGBA4f(float r, float g, float b, float a = 1.0) :
|
|
|
|
r(r), g(g), b(b), a(a) {
|
2015-01-14 22:14:57 -05:00
|
|
|
}
|
|
|
|
|
2015-08-17 21:52:38 -04:00
|
|
|
RGBA4f() :
|
|
|
|
RGBA4f(0, 0, 0) {
|
2015-01-14 22:14:57 -05:00
|
|
|
}
|
|
|
|
|
2015-08-17 21:52:38 -04:00
|
|
|
~RGBA4f() {
|
2015-01-14 22:14:57 -05:00
|
|
|
}
|
|
|
|
|
2015-08-17 21:52:38 -04:00
|
|
|
RGBA4f & operator=(const RGBA4f &other) {
|
2015-01-14 22:14:57 -05:00
|
|
|
r = other.r;
|
|
|
|
g = other.g;
|
|
|
|
b = other.b;
|
2015-08-17 21:52:38 -04:00
|
|
|
a = other.a;
|
2015-01-14 22:14:57 -05:00
|
|
|
return *this;
|
|
|
|
}
|
2015-08-09 12:51:01 -04:00
|
|
|
|
2015-08-17 21:52:38 -04:00
|
|
|
RGBA4f operator*(float v) { return RGBA4f(r*v, g*v, b*v); }
|
2016-09-29 21:57:23 -04:00
|
|
|
|
|
|
|
operator wxColour() {
|
|
|
|
return wxColour(
|
2016-12-27 14:46:50 -05:00
|
|
|
(unsigned char) std::min((r * 255.0), 255.0),
|
|
|
|
(unsigned char) std::min((g * 255.0), 255.0),
|
|
|
|
(unsigned char) std::min((b * 255.0), 255.0));
|
2016-09-29 21:57:23 -04:00
|
|
|
|
|
|
|
}
|
2015-08-09 12:51:01 -04:00
|
|
|
|
2015-01-14 22:14:57 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
class ColorTheme {
|
|
|
|
public:
|
2015-08-17 21:52:38 -04:00
|
|
|
RGBA4f waterfallHighlight;
|
|
|
|
RGBA4f waterfallNew;
|
|
|
|
RGBA4f wfHighlight;
|
|
|
|
RGBA4f waterfallHover;
|
|
|
|
RGBA4f waterfallDestroy;
|
|
|
|
RGBA4f fftLine;
|
|
|
|
RGBA4f fftHighlight;
|
|
|
|
RGBA4f scopeLine;
|
|
|
|
RGBA4f tuningBarLight;
|
|
|
|
RGBA4f tuningBarDark;
|
|
|
|
RGBA4f tuningBarUp;
|
|
|
|
RGBA4f tuningBarDown;
|
|
|
|
RGBA4f meterLevel;
|
|
|
|
RGBA4f meterValue;
|
|
|
|
RGBA4f text;
|
|
|
|
RGBA4f freqLine;
|
|
|
|
RGBA4f button;
|
|
|
|
RGBA4f buttonHighlight;
|
|
|
|
|
|
|
|
RGBA4f scopeBackground;
|
|
|
|
RGBA4f fftBackground;
|
|
|
|
RGBA4f generalBackground;
|
2015-01-15 00:59:33 -05:00
|
|
|
|
2015-01-14 22:14:57 -05:00
|
|
|
Gradient waterfallGradient;
|
|
|
|
|
|
|
|
std::string name;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ThemeMgr {
|
|
|
|
public:
|
|
|
|
ThemeMgr();
|
|
|
|
~ThemeMgr();
|
|
|
|
ColorTheme *currentTheme;
|
|
|
|
std::map<int, ColorTheme *> themes;
|
|
|
|
void setTheme(int themeId);
|
|
|
|
int getTheme();
|
|
|
|
int themeId;
|
|
|
|
|
|
|
|
static ThemeMgr mgr;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DefaultColorTheme: public ColorTheme {
|
|
|
|
public:
|
|
|
|
DefaultColorTheme();
|
|
|
|
};
|
|
|
|
|
2019-09-23 01:24:04 -04:00
|
|
|
class DefaultColorThemeJet : public DefaultColorTheme {
|
|
|
|
public:
|
|
|
|
DefaultColorThemeJet();
|
|
|
|
};
|
|
|
|
|
2015-01-14 22:14:57 -05:00
|
|
|
class BlackAndWhiteColorTheme: public ColorTheme {
|
|
|
|
public:
|
|
|
|
BlackAndWhiteColorTheme();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SharpColorTheme: public ColorTheme {
|
|
|
|
public:
|
|
|
|
SharpColorTheme();
|
|
|
|
};
|
|
|
|
|
|
|
|
class RadColorTheme: public ColorTheme {
|
|
|
|
public:
|
|
|
|
RadColorTheme();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TouchColorTheme: public ColorTheme {
|
|
|
|
public:
|
|
|
|
TouchColorTheme();
|
|
|
|
};
|
|
|
|
|
|
|
|
class HDColorTheme: public ColorTheme {
|
|
|
|
public:
|
|
|
|
HDColorTheme();
|
|
|
|
};
|
|
|
|
|
|
|
|
class RadarColorTheme: public ColorTheme {
|
|
|
|
public:
|
|
|
|
RadarColorTheme();
|
|
|
|
};
|
|
|
|
|