neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
palette.hpp
Go to the documentation of this file.
1// palette.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
24
25namespace neogfx
26{
27 struct palette_proxy_t {};
28 inline const palette_proxy_t palette_proxy() { return palette_proxy_t{}; }
31
32 class palette : public i_palette
33 {
34 public:
36 public:
37 define_declared_event(Changed, changed)
38 public:
39 palette();
41 palette(const i_palette& aOther);
42 palette(const palette& aOther);
45 public:
46 palette& operator=(const i_palette& aOther);
47 palette& operator=(const palette& aOther);
48 public:
49 bool operator==(const palette& aOther) const;
50 bool operator!=(const palette& aOther) const;
51 bool operator==(const i_palette& aOther) const override;
52 bool operator!=(const i_palette& aOther) const override;
53 public:
54 bool has_color(color_role aRole) const override;
55 neogfx::color color(color_role aRole) const override;
56 const optional_color& maybe_color(color_role aRole) const override;
57 void set_color(color_role aRole, const optional_color& aColor) override;
58 public:
60 public:
61 bool has_proxy() const override;
62 const i_palette& proxy() const override;
63 protected:
64 virtual const i_palette* proxy_ptr() const override;
65 private:
66 std::optional<const i_palette*> iProxy;
67 optional_color iThemeColor;
68 optional_color iBackgroundColor;
69 optional_color iForegroundColor;
70 optional_color iBaseColor;
71 optional_color iAlternateBaseColor;
72 optional_color iTextColor;
73 optional_color iSelectionColor;
74 optional_color iAlternateSelectionColor;
75 optional_color iSelectedTextColor;
76 optional_color iFocusColor;
77 optional_color iHoverColor;
78 optional_color iPrimaryAccentColor;
79 optional_color iSecondaryAccentColor;
80 optional_color iVoidColor;
81 };
82}
friend class palette
Definition i_palette.hpp:50
i_palette abstract_type
Definition palette.hpp:35
palette(const i_palette &aOther, palette_proxy_t)
bool operator==(const i_palette &aOther) const override
neogfx::color default_text_color_for_widget(const i_widget &aWidget) const override
bool operator==(const palette &aOther) const
bool has_proxy() const override
neogfx::color color(color_role aRole) const override
palette(const palette &aOther)
bool has_color(color_role aRole) const override
palette(const i_palette &aOther)
virtual const i_palette * proxy_ptr() const override
palette & operator=(const i_palette &aOther)
bool operator!=(const palette &aOther) const
const i_palette & proxy() const override
void set_color(color_role aRole, const optional_color &aColor) override
define_declared_event(Changed, changed) public palette(current_style_palette_proxy_t)
palette & operator=(const palette &aOther)
bool operator!=(const i_palette &aOther) const override
const optional_color & maybe_color(color_role aRole) const override
palette(const palette &aOther, palette_proxy_t)
const palette_proxy_t palette_proxy()
Definition palette.hpp:28
const current_style_palette_proxy_t current_style_palette_proxy()
Definition palette.hpp:30
#define define_declared_event(name, declName,...)
Definition event.hpp:195