neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_palette.hpp
Go to the documentation of this file.
1// i_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>
23#include <neogfx/core/event.hpp>
24#include <neogfx/gfx/color.hpp>
25
26namespace neogfx
27{
28 class i_widget;
29
47
49 {
50 friend class palette;
51 public:
52 declare_event(changed)
53 public:
54 struct no_proxy : std::logic_error { no_proxy() : std::logic_error{ "neogfx::i_palette::no_proxy" } {} };
55 public:
56 virtual ~i_palette() = default;
57 public:
58 virtual bool operator==(const i_palette& aOther) const = 0;
59 virtual bool operator!=(const i_palette& aOther) const = 0;
60 public:
61 virtual bool has_color(color_role aRole) const = 0;
62 virtual neogfx::color color(color_role aRole) const = 0;
63 virtual const optional_color& maybe_color(color_role aRole) const = 0;
64 virtual void set_color(color_role aRole, const optional_color& aColor) = 0;
65 public:
66 virtual neogfx::color default_text_color_for_widget(const i_widget& aWidget) const = 0;
67 public:
68 virtual bool has_proxy() const = 0;
69 virtual const i_palette& proxy() const = 0;
70 protected:
71 virtual const i_palette* proxy_ptr() const = 0;
72 };
73}
virtual neogfx::color color(color_role aRole) const =0
virtual const i_palette & proxy() const =0
virtual neogfx::color default_text_color_for_widget(const i_widget &aWidget) const =0
virtual bool operator==(const i_palette &aOther) const =0
virtual bool has_color(color_role aRole) const =0
virtual const i_palette * proxy_ptr() const =0
virtual const optional_color & maybe_color(color_role aRole) const =0
virtual ~i_palette()=default
virtual void set_color(color_role aRole, const optional_color &aColor)=0
virtual bool has_proxy() const =0
virtual bool operator!=(const i_palette &aOther) const =0
@ AlternateBase
Definition i_palette.hpp:36
@ AlternateSelection
Definition i_palette.hpp:39
@ SelectedText
Definition i_palette.hpp:40
@ Selection
Definition i_palette.hpp:38
@ Foreground
Definition i_palette.hpp:34
@ SecondaryAccent
Definition i_palette.hpp:44
@ Background
Definition i_palette.hpp:33
@ PrimaryAccent
Definition i_palette.hpp:43
Definition plf_hive.h:79
#define declare_event(declName,...)
Definition i_event.hpp:305