Skip to content

Commit

Permalink
Try fix Linux/Mac errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aybe committed Jul 14, 2024
1 parent 1c72881 commit 117ee50
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 96 deletions.
92 changes: 46 additions & 46 deletions src/gui/sdl_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3182,31 +3182,31 @@ class ConfigurationWindow : public GUI::ToplevelWindow {
// theme menu
{
bar->addMenu("Theme"); // TODO MSG_Get("THEME")
bar->addItem(2, GUI::ThemeWindows31WindowsDefault::Name);
bar->addItem(2, GUI::ThemeWindows31WindowsDefault::GetName());
bar->addItem(2, "");
bar->addItem(2, GUI::ThemeWindows31Arizona::Name);
bar->addItem(2, GUI::ThemeWindows31Bordeaux::Name);
bar->addItem(2, GUI::ThemeWindows31Cinnamon::Name);
bar->addItem(2, GUI::ThemeWindows31Designer::Name);
bar->addItem(2, GUI::ThemeWindows31EmeraldCity::Name);
bar->addItem(2, GUI::ThemeWindows31Fluorescent::Name);
bar->addItem(2, GUI::ThemeWindows31HotDogStand::Name);
bar->addItem(2, GUI::ThemeWindows31LCDDefaultScreenSettings::Name);
bar->addItem(2, GUI::ThemeWindows31LCDReversedDark::Name);
bar->addItem(2, GUI::ThemeWindows31LCDReversedLight::Name);
bar->addItem(2, GUI::ThemeWindows31BlackLeatherJacket::Name);
bar->addItem(2, GUI::ThemeWindows31Arizona::GetName());
bar->addItem(2, GUI::ThemeWindows31Bordeaux::GetName());
bar->addItem(2, GUI::ThemeWindows31Cinnamon::GetName());
bar->addItem(2, GUI::ThemeWindows31Designer::GetName());
bar->addItem(2, GUI::ThemeWindows31EmeraldCity::GetName());
bar->addItem(2, GUI::ThemeWindows31Fluorescent::GetName());
bar->addItem(2, GUI::ThemeWindows31HotDogStand::GetName());
bar->addItem(2, GUI::ThemeWindows31LCDDefaultScreenSettings::GetName());
bar->addItem(2, GUI::ThemeWindows31LCDReversedDark::GetName());
bar->addItem(2, GUI::ThemeWindows31LCDReversedLight::GetName());
bar->addItem(2, GUI::ThemeWindows31BlackLeatherJacket::GetName());
bar->addItem(2, "|");
bar->addItem(2, GUI::ThemeWindows31Mahogany::Name);
bar->addItem(2, GUI::ThemeWindows31Monochrome::Name);
bar->addItem(2, GUI::ThemeWindows31Ocean::Name);
bar->addItem(2, GUI::ThemeWindows31Pastel::Name);
bar->addItem(2, GUI::ThemeWindows31Patchwork::Name);
bar->addItem(2, GUI::ThemeWindows31PlasmaPowerSaver::Name);
bar->addItem(2, GUI::ThemeWindows31Rugby::Name);
bar->addItem(2, GUI::ThemeWindows31TheBlues::Name);
bar->addItem(2, GUI::ThemeWindows31Tweed::Name);
bar->addItem(2, GUI::ThemeWindows31Valentine::Name);
bar->addItem(2, GUI::ThemeWindows31Wingtips::Name);
bar->addItem(2, GUI::ThemeWindows31Mahogany::GetName());
bar->addItem(2, GUI::ThemeWindows31Monochrome::GetName());
bar->addItem(2, GUI::ThemeWindows31Ocean::GetName());
bar->addItem(2, GUI::ThemeWindows31Pastel::GetName());
bar->addItem(2, GUI::ThemeWindows31Patchwork::GetName());
bar->addItem(2, GUI::ThemeWindows31PlasmaPowerSaver::GetName());
bar->addItem(2, GUI::ThemeWindows31Rugby::GetName());
bar->addItem(2, GUI::ThemeWindows31TheBlues::GetName());
bar->addItem(2, GUI::ThemeWindows31Tweed::GetName());
bar->addItem(2, GUI::ThemeWindows31Valentine::GetName());
bar->addItem(2, GUI::ThemeWindows31Wingtips::GetName());
}

bar->addMenu(mainMenu.get_item("HelpMenu").get_text().c_str());
Expand Down Expand Up @@ -3349,51 +3349,51 @@ class ConfigurationWindow : public GUI::ToplevelWindow {

static void TryApplyTheme(const GUI::String& name)
{
if(name == GUI::ThemeWindows31WindowsDefault::Name)
if(name == GUI::ThemeWindows31WindowsDefault::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31WindowsDefault();
if(name == GUI::ThemeWindows31Arizona::Name)
if(name == GUI::ThemeWindows31Arizona::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Arizona();
if(name == GUI::ThemeWindows31Bordeaux::Name)
if(name == GUI::ThemeWindows31Bordeaux::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Bordeaux();
if(name == GUI::ThemeWindows31Cinnamon::Name)
if(name == GUI::ThemeWindows31Cinnamon::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Cinnamon();
if(name == GUI::ThemeWindows31Designer::Name)
if(name == GUI::ThemeWindows31Designer::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Designer();
if(name == GUI::ThemeWindows31EmeraldCity::Name)
if(name == GUI::ThemeWindows31EmeraldCity::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31EmeraldCity();
if(name == GUI::ThemeWindows31Fluorescent::Name)
if(name == GUI::ThemeWindows31Fluorescent::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Fluorescent();
if(name == GUI::ThemeWindows31HotDogStand::Name)
if(name == GUI::ThemeWindows31HotDogStand::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31HotDogStand();
if(name == GUI::ThemeWindows31LCDDefaultScreenSettings::Name)
if(name == GUI::ThemeWindows31LCDDefaultScreenSettings::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31LCDDefaultScreenSettings();
if(name == GUI::ThemeWindows31LCDReversedDark::Name)
if(name == GUI::ThemeWindows31LCDReversedDark::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31LCDReversedDark();
if(name == GUI::ThemeWindows31LCDReversedLight::Name)
if(name == GUI::ThemeWindows31LCDReversedLight::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31LCDReversedLight();
if(name == GUI::ThemeWindows31BlackLeatherJacket::Name)
if(name == GUI::ThemeWindows31BlackLeatherJacket::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31BlackLeatherJacket();
if(name == GUI::ThemeWindows31Mahogany::Name)
if(name == GUI::ThemeWindows31Mahogany::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Mahogany();
if(name == GUI::ThemeWindows31Monochrome::Name)
if(name == GUI::ThemeWindows31Monochrome::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Monochrome();
if(name == GUI::ThemeWindows31Ocean::Name)
if(name == GUI::ThemeWindows31Ocean::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Ocean();
if(name == GUI::ThemeWindows31Pastel::Name)
if(name == GUI::ThemeWindows31Pastel::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Pastel();
if(name == GUI::ThemeWindows31Patchwork::Name)
if(name == GUI::ThemeWindows31Patchwork::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Patchwork();
if(name == GUI::ThemeWindows31PlasmaPowerSaver::Name)
if(name == GUI::ThemeWindows31PlasmaPowerSaver::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31PlasmaPowerSaver();
if(name == GUI::ThemeWindows31Rugby::Name)
if(name == GUI::ThemeWindows31Rugby::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Rugby();
if(name == GUI::ThemeWindows31TheBlues::Name)
if(name == GUI::ThemeWindows31TheBlues::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31TheBlues();
if(name == GUI::ThemeWindows31Tweed::Name)
if(name == GUI::ThemeWindows31Tweed::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Tweed();
if(name == GUI::ThemeWindows31Valentine::Name)
if(name == GUI::ThemeWindows31Valentine::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Valentine();
if(name == GUI::ThemeWindows31Wingtips::Name)
if(name == GUI::ThemeWindows31Wingtips::GetName())
GUI::DefaultTheme = GUI::ThemeWindows31Wingtips();
}

Expand Down
73 changes: 23 additions & 50 deletions src/libs/gui_tk/gui_tk.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ extern ThemeWindows31 DefaultTheme;

struct ThemeWindows31WindowsDefault : ThemeWindows31
{
static constexpr const char* Name = "Windows Default";
static std::string GetName() { return "Windows Default"; };

ThemeWindows31WindowsDefault()
{
Expand Down Expand Up @@ -323,7 +323,7 @@ struct ThemeWindows31WindowsDefault : ThemeWindows31

struct ThemeWindows31Arizona : ThemeWindows31
{
static constexpr const char* Name = "Arizona";
static std::string GetName() { return "Arizona"; };

ThemeWindows31Arizona()
{
Expand Down Expand Up @@ -353,7 +353,7 @@ struct ThemeWindows31Arizona : ThemeWindows31

struct ThemeWindows31BlackLeatherJacket : ThemeWindows31
{
static constexpr const char* Name = "Black Leather Jacket";
static std::string GetName() { return "Black Leather Jacket"; };

ThemeWindows31BlackLeatherJacket()
{
Expand Down Expand Up @@ -383,7 +383,7 @@ struct ThemeWindows31BlackLeatherJacket : ThemeWindows31

struct ThemeWindows31Bordeaux : ThemeWindows31
{
static constexpr const char* Name = "Bordeaux";
static std::string GetName() { return "Bordeaux"; };

ThemeWindows31Bordeaux()
{
Expand Down Expand Up @@ -413,7 +413,7 @@ struct ThemeWindows31Bordeaux : ThemeWindows31

struct ThemeWindows31Cinnamon : ThemeWindows31
{
static constexpr const char* Name = "Cinnamon";
static std::string GetName() { return "Cinnamon"; };

ThemeWindows31Cinnamon()
{
Expand Down Expand Up @@ -443,7 +443,7 @@ struct ThemeWindows31Cinnamon : ThemeWindows31

struct ThemeWindows31Designer : ThemeWindows31
{
static constexpr const char* Name = "Designer";
static std::string GetName() { return "Designer"; };

ThemeWindows31Designer()
{
Expand Down Expand Up @@ -473,7 +473,7 @@ struct ThemeWindows31Designer : ThemeWindows31

struct ThemeWindows31EmeraldCity : ThemeWindows31
{
static constexpr const char* Name = "Emerald City";
static std::string GetName() { return "Emerald City"; };

ThemeWindows31EmeraldCity()
{
Expand Down Expand Up @@ -503,7 +503,7 @@ struct ThemeWindows31EmeraldCity : ThemeWindows31

struct ThemeWindows31Fluorescent : ThemeWindows31
{
static constexpr const char* Name = "Fluorescent";
static std::string GetName() { return "Fluorescent"; };

ThemeWindows31Fluorescent()
{
Expand Down Expand Up @@ -533,7 +533,7 @@ struct ThemeWindows31Fluorescent : ThemeWindows31

struct ThemeWindows31HotDogStand : ThemeWindows31
{
static constexpr const char* Name = "HotDog Stand";
static std::string GetName() { return "HotDog Stand"; };

ThemeWindows31HotDogStand()
{
Expand Down Expand Up @@ -563,7 +563,7 @@ struct ThemeWindows31HotDogStand : ThemeWindows31

struct ThemeWindows31LCDDefaultScreenSettings : ThemeWindows31
{
static constexpr const char* Name = "LCD Default Screen Settings";
static std::string GetName() { return "LCD Default Screen Settings"; };

ThemeWindows31LCDDefaultScreenSettings()
{
Expand Down Expand Up @@ -593,7 +593,7 @@ struct ThemeWindows31LCDDefaultScreenSettings : ThemeWindows31

struct ThemeWindows31LCDReversedDark : ThemeWindows31
{
static constexpr const char* Name = "LCD Reversed - Dark";
static std::string GetName() { return "LCD Reversed - Dark"; };

ThemeWindows31LCDReversedDark()
{
Expand Down Expand Up @@ -623,7 +623,7 @@ struct ThemeWindows31LCDReversedDark : ThemeWindows31

struct ThemeWindows31LCDReversedLight : ThemeWindows31
{
static constexpr const char* Name = "LCD Reversed - Light";
static std::string GetName() { return "LCD Reversed - Light"; };

ThemeWindows31LCDReversedLight()
{
Expand Down Expand Up @@ -653,7 +653,7 @@ struct ThemeWindows31LCDReversedLight : ThemeWindows31

struct ThemeWindows31Mahogany : ThemeWindows31
{
static constexpr const char* Name = "Mahogany";
static std::string GetName() { return "Mahogany"; };

ThemeWindows31Mahogany()
{
Expand Down Expand Up @@ -683,7 +683,7 @@ struct ThemeWindows31Mahogany : ThemeWindows31

struct ThemeWindows31Monochrome : ThemeWindows31
{
static constexpr const char* Name = "Monochrome";
static std::string GetName() { return "Monochrome"; };

ThemeWindows31Monochrome()
{
Expand Down Expand Up @@ -713,7 +713,7 @@ struct ThemeWindows31Monochrome : ThemeWindows31

struct ThemeWindows31Ocean : ThemeWindows31
{
static constexpr const char* Name = "Ocean";
static std::string GetName() { return "Ocean"; };

ThemeWindows31Ocean()
{
Expand Down Expand Up @@ -743,7 +743,7 @@ struct ThemeWindows31Ocean : ThemeWindows31

struct ThemeWindows31Pastel : ThemeWindows31
{
static constexpr const char* Name = "Pastel";
static std::string GetName() { return "Pastel"; };

ThemeWindows31Pastel()
{
Expand Down Expand Up @@ -773,7 +773,7 @@ struct ThemeWindows31Pastel : ThemeWindows31

struct ThemeWindows31Patchwork : ThemeWindows31
{
static constexpr const char* Name = "Patchwork";
static std::string GetName() { return "Patchwork"; };

ThemeWindows31Patchwork()
{
Expand Down Expand Up @@ -803,7 +803,7 @@ struct ThemeWindows31Patchwork : ThemeWindows31

struct ThemeWindows31PlasmaPowerSaver : ThemeWindows31
{
static constexpr const char* Name = "Plasma Power Saver";
static std::string GetName() { return "Plasma Power Saver"; };

ThemeWindows31PlasmaPowerSaver()
{
Expand Down Expand Up @@ -833,7 +833,7 @@ struct ThemeWindows31PlasmaPowerSaver : ThemeWindows31

struct ThemeWindows31Rugby : ThemeWindows31
{
static constexpr const char* Name = "Rugby";
static std::string GetName() { return "Rugby"; };

ThemeWindows31Rugby()
{
Expand Down Expand Up @@ -863,7 +863,7 @@ struct ThemeWindows31Rugby : ThemeWindows31

struct ThemeWindows31TheBlues : ThemeWindows31
{
static constexpr const char* Name = "The Blues";
static std::string GetName() { return "The Blues"; };

ThemeWindows31TheBlues()
{
Expand Down Expand Up @@ -893,7 +893,7 @@ struct ThemeWindows31TheBlues : ThemeWindows31

struct ThemeWindows31Tweed : ThemeWindows31
{
static constexpr const char* Name = "Tweed";
static std::string GetName() { return "Tweed"; };

ThemeWindows31Tweed()
{
Expand Down Expand Up @@ -923,7 +923,7 @@ struct ThemeWindows31Tweed : ThemeWindows31

struct ThemeWindows31Valentine : ThemeWindows31
{
static constexpr const char* Name = "Valentine";
static std::string GetName() { return "Valentine"; };

ThemeWindows31Valentine()
{
Expand Down Expand Up @@ -953,7 +953,7 @@ struct ThemeWindows31Valentine : ThemeWindows31

struct ThemeWindows31Wingtips : ThemeWindows31
{
static constexpr const char* Name = "Wingtips";
static std::string GetName() { return "Wingtips"; };

ThemeWindows31Wingtips()
{
Expand All @@ -980,33 +980,6 @@ struct ThemeWindows31Wingtips : ThemeWindows31
ButtonHighlight = 0xFFFFFFFF;
}
};

// for pre-C++17 Linux/Mac
// NOLINTBEGIN(readability-redundant-declaration, clang-diagnostic-deprecated-redundant-constexpr-static-def)
constexpr const char* ThemeWindows31WindowsDefault::Name;
constexpr const char* ThemeWindows31Arizona::Name;
constexpr const char* ThemeWindows31BlackLeatherJacket::Name;
constexpr const char* ThemeWindows31Bordeaux::Name;
constexpr const char* ThemeWindows31Cinnamon::Name;
constexpr const char* ThemeWindows31Designer::Name;
constexpr const char* ThemeWindows31EmeraldCity::Name;
constexpr const char* ThemeWindows31Fluorescent::Name;
constexpr const char* ThemeWindows31HotDogStand::Name;
constexpr const char* ThemeWindows31LCDDefaultScreenSettings::Name;
constexpr const char* ThemeWindows31LCDReversedDark::Name;
constexpr const char* ThemeWindows31LCDReversedLight::Name;
constexpr const char* ThemeWindows31Mahogany::Name;
constexpr const char* ThemeWindows31Monochrome::Name;
constexpr const char* ThemeWindows31Ocean::Name;
constexpr const char* ThemeWindows31Pastel::Name;
constexpr const char* ThemeWindows31Patchwork::Name;
constexpr const char* ThemeWindows31PlasmaPowerSaver::Name;
constexpr const char* ThemeWindows31Rugby::Name;
constexpr const char* ThemeWindows31TheBlues::Name;
constexpr const char* ThemeWindows31Tweed::Name;
constexpr const char* ThemeWindows31Valentine::Name;
constexpr const char* ThemeWindows31Wingtips::Name;
// NOLINTEND(readability-redundant-declaration, clang-diagnostic-deprecated-redundant-constexpr-static-def)

/// Identifies a mouse button.
enum MouseButton { NoButton, Left, Right, Middle, WheelUp, WheelDown, WheelLeft, WheelRight };
Expand Down

0 comments on commit 117ee50

Please sign in to comment.