14#ifndef __AUDACITY_THEME__
15#define __AUDACITY_THEME__
18#include <unordered_set>
74 void GetNextPosition(
int xSize,
int ySize );
75 void SetNewGroup(
int iGroupSize );
76 void SetColourGroup( );
79 void RectMid(
int &x,
int &y );
89 int iImageGroupSize = 1;
90 int iImageGroupIndex = -1;
95 int mComponentWidth = 0;
96 int mComponentHeight = 0;
131 void SetFilePath(
const FilePath &path);
137 const std::vector<unsigned char> &data
144 const std::vector<unsigned char>&
data;
153 void RegisterImage(
NameSet &allNames,
154 int &flags,
int &iIndex,
char const** pXpm,
const wxString & Name);
155 void RegisterImage(
NameSet &allNames,
156 int &flags,
int &iIndex,
const wxImage &Image,
const wxString & Name );
157 void RegisterColour(
NameSet &allNames,
158 int &iIndex,
const wxColour &Clr,
const wxString & Name );
161 void CreateImageCache();
162 bool CreateOneImageCache(
teThemeType id,
bool bBinarySave);
163 bool ReadImageCache(
teThemeType type = {},
bool bOkIfNotFound=
false);
164 void LoadThemeComponents(
bool bOkIfNotFound =
false);
165 void LoadOneThemeComponents(
teThemeType id,
bool bOkIfNotFound =
false);
169 void WriteImageDefs( );
170 void WriteImageMap( );
172 static bool LoadPreferredTheme();
173 void RecolourBitmap(
int iIndex, wxColour From, wxColour To );
175 int ColourDistance( wxColour & From, wxColour & To );
188 wxImage MaskedImage(
char const ** pXpm,
char const ** pMask );
204 std::map<Identifier, ThemeSet>
mSets;
216 void EnsureInitialised()
override;
217 void RegisterImagesAndColours();
THEME_API ChoiceSetting & GUITheme()
PreferredSystemAppearance
A system theme, that matches selected theme best (only works on macOS with builtin themes).
teResourceType
The index of a bitmap resource in Theme Resources.
AColor Manages color brushes and pens.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
A cursor for iterating the theme bitmap.
An explicitly nonlocalized string, not meant for the user to see.
An object that sends messages to an open-ended list of subscribed callbacks.
Theme management - Image loading and saving.
bool SaveOneThemeComponents(teThemeType id)
wxColour & Colour(int iIndex)
void SetBrushColour(wxBrush &Brush, int iIndex)
void DeleteUnusedThemes()
wxImage MakeImageWithAlpha(wxBitmap &Bmp)
wxImage & Image(int iIndex)
wxBitmap & Bitmap(int iIndex)
void ReplaceImage(int iIndex, wxImage *pImage)
void RotateImageInto(int iTo, int iFrom, bool bClockwise)
wxArrayString mBitmapNames
void SetPenColour(wxPen &Pen, int iIndex)
std::map< Identifier, ThemeSet > mSets
std::unordered_set< wxString > NameSet
wxArrayString mColourNames
std::vector< int > mBitmapFlags
virtual void EnsureInitialised()=0
wxSize ImageSize(int iIndex)
void SaveThemeComponents()
ThemeBase(const ThemeBase &)=delete
Based on ThemeBase, Theme manages image and icon resources.
RectType< float > Rect
Alias for rectangle with float data type.
const EnumValueSymbol symbol
const PreferredSystemAppearance preferredSystemAppearance
const std::vector< unsigned char > & data
std::optional< PreferredSystemAppearance > appearance
std::vector< wxImage > mImages
std::vector< wxBitmap > mBitmaps
std::vector< wxColour > mColours