Audacity  3.0.3
Public Member Functions | Public Attributes | List of all members
Theme Class Referencefinal

Based on ThemeBase, Theme manages image and icon resources. More...

#include <Theme.h>

Inheritance diagram for Theme:
[legend]
Collaboration diagram for Theme:
[legend]

Public Member Functions

 Theme (void)
 
 ~Theme (void)
 
void EnsureInitialised () override
 
void RegisterImagesAndColours ()
 
- Public Member Functions inherited from ThemeBase
 ThemeBase (void)
 
 ThemeBase (const ThemeBase &)=delete
 
ThemeBaseoperator= (const ThemeBase &)=delete
 
virtual ~ThemeBase (void)
 
void LoadTheme (teThemeType Theme)
 
void RegisterImage (int &flags, int &iIndex, char const **pXpm, const wxString &Name)
 
void RegisterImage (int &flags, int &iIndex, const wxImage &Image, const wxString &Name)
 
void RegisterColour (int &iIndex, const wxColour &Clr, const wxString &Name)
 
teThemeType GetFallbackThemeType ()
 
void CreateImageCache (bool bBinarySave=true)
 
bool ReadImageCache (teThemeType type={}, bool bOkIfNotFound=false)
 
void LoadComponents (bool bOkIfNotFound=false)
 
void SaveComponents ()
 
void SaveThemeAsCode ()
 
void WriteImageDefs ()
 Writes a series of Macro definitions that can be used in the include file. More...
 
void WriteImageMap ()
 
bool IsUsingSystemTextColour ()
 
void RecolourBitmap (int iIndex, wxColour From, wxColour To)
 
void RecolourTheme ()
 
int ColourDistance (wxColour &From, wxColour &To)
 
wxColour & Colour (int iIndex)
 
wxBitmap & Bitmap (int iIndex)
 
wxImage & Image (int iIndex)
 
wxSize ImageSize (int iIndex)
 
void ReplaceImage (int iIndex, wxImage *pImage)
 Replaces both the image and the bitmap. More...
 
void RotateImageInto (int iTo, int iFrom, bool bClockwise)
 
void SetBrushColour (wxBrush &Brush, int iIndex)
 
void SetPenColour (wxPen &Pen, int iIndex)
 
wxImage MaskedImage (char const **pXpm, char const **pMask)
 
wxImage MakeImageWithAlpha (wxBitmap &Bmp)
 
OnPreferredSystemAppearanceChanged SetOnPreferredSystemAppearanceChanged (OnPreferredSystemAppearanceChanged handler)
 

Public Attributes

bool mbInitialised
 
- Public Attributes inherited from ThemeBase
bool bRecolourOnLoad
 
bool bIsUsingSystemTextColour
 

Additional Inherited Members

- Public Types inherited from ThemeBase
using OnPreferredSystemAppearanceChanged = std::function< void(PreferredSystemAppearance)>
 
- Static Public Member Functions inherited from ThemeBase
static bool LoadPreferredTheme ()
 
- Protected Attributes inherited from ThemeBase
std::vector< wxImage > mImages
 
std::vector< wxBitmap > mBitmaps
 
wxArrayString mBitmapNames
 
std::vector< int > mBitmapFlags
 
std::vector< wxColour > mColours
 
wxArrayString mColourNames
 
PreferredSystemAppearance mPreferredSystemAppearance { PreferredSystemAppearance::Light }
 
OnPreferredSystemAppearanceChanged mOnPreferredSystemAppearanceChanged
 

Detailed Description

Based on ThemeBase, Theme manages image and icon resources.

Theme is a class which manages theme resources. It maps sets of ids to the resources and to names of the resources, so that they can be loaded/saved from files.

Theme adds the Audacity specific images to ThemeBase.

See also
Themability of Audacity

Definition at line 177 of file Theme.h.

Constructor & Destructor Documentation

◆ Theme()

Theme::Theme ( void  )

Definition at line 81 of file Theme.cpp.

82 {
83  mbInitialised=false;
84 }

References mbInitialised.

◆ ~Theme()

Theme::~Theme ( void  )

Definition at line 86 of file Theme.cpp.

87 {
88 }

Member Function Documentation

◆ EnsureInitialised()

void Theme::EnsureInitialised ( )
overridevirtual

Implements ThemeBase.

Definition at line 91 of file Theme.cpp.

92 {
93  if( mbInitialised )
94  return;
96 
97 #ifdef EXPERIMENTAL_EXTRA_THEME_RESOURCES
98  extern void RegisterExtraThemeResources();
99  RegisterExtraThemeResources();
100 #endif
101 }

References mbInitialised, and RegisterImagesAndColours().

Here is the call graph for this function:

◆ RegisterImagesAndColours()

void Theme::RegisterImagesAndColours ( )

Definition at line 110 of file Theme.cpp.

111 {
112  if( mbInitialised )
113  return;
114  mbInitialised = true;
115 
116 // This initialises the variables e.g
117 // RegisterImage( myFlags, bmpRecordButton, some image, wxT("RecordButton"));
118  int myFlags = resFlagPaired;
119 #define THEME_INITS
120 #include "AllThemeResources.h"
121 
122 
123 }

References mbInitialised, and resFlagPaired.

Referenced by EnsureInitialised().

Here is the caller graph for this function:

Member Data Documentation

◆ mbInitialised

bool Theme::mbInitialised

Definition at line 186 of file Theme.h.

Referenced by EnsureInitialised(), RegisterImagesAndColours(), and Theme().


The documentation for this class was generated from the following files:
resFlagPaired
@ resFlagPaired
Definition: Theme.h:57
AllThemeResources.h
Theme::RegisterImagesAndColours
void RegisterImagesAndColours()
Definition: Theme.cpp:110
Theme::mbInitialised
bool mbInitialised
Definition: Theme.h:186