-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathColorfield.hpp
More file actions
89 lines (75 loc) · 3.47 KB
/
Colorfield.hpp
File metadata and controls
89 lines (75 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//
// AmigaOS MUI C++ wrapper
//
// (c) 2022-2026 TDolphin
//
#pragma once
#include "Area.hpp"
#include "Core/RGBColor.hpp"
namespace MUI
{
/// @brief MUI Colorfield class wrapper.
/// Colorfield creates a rectangle filled with a specific color.
/// The color can be changed at runtime via RGB attributes.
class Colorfield : public Area
{
public:
explicit Colorfield(Object *pMuiObject)
: Area(pMuiObject)
{
}
// instanceOf
const static std::string className;
static inline bool instanceOf(Object *pMuiObject)
{
return MUI::instanceOf(pMuiObject, className.c_str());
}
// is/get/set (attributes), all setters return object reference
/// @brief [ @b MUIA_Colorfield_Blue ] Get the 32-bit blue component of the field color.
unsigned char getBlue() const;
/// @brief [ @b MUIA_Colorfield_Green ] Get the 32-bit green component of the field color.
unsigned char getGreen() const;
/// @brief [ @b MUIA_Colorfield_Pen ] Get the currently used pen index.
unsigned long getPen() const;
/// @brief [ @b MUIA_Colorfield_Red ] Get the 32-bit red component of the field color.
unsigned char getRed() const;
/// @brief [ @b MUIA_Colorfield_RGB ] Get all field color components at once as RGB values.
RGBColor getRGB() const;
/// @brief [ @b MUIA_Colorfield_Blue ] Set the 32-bit blue component of the field color.
Colorfield &setBlue(const unsigned char blue);
/// @brief [ @b MUIA_Colorfield_Green ] Set the 32-bit green component of the field color.
Colorfield &setGreen(const unsigned char green);
/// @brief [ @b MUIA_Colorfield_Red ] Set the 32-bit red component of the field color.
Colorfield &setRed(const unsigned char red);
/// @brief [ @b MUIA_Colorfield_RGB ] Set all field color components at once from 8-bit RGB values.
Colorfield &setRGB(const unsigned char red, const unsigned char green, const unsigned char blue);
/// @brief [ @b MUIA_Colorfield_RGB ] Set all field color components at once from RGBColor.
Colorfield &setRGB(const RGBColor &rgbColor);
};
template <typename T, typename U> class ColorfieldBuilderTemplate : public AreaBuilderTemplate<T, U>
{
public:
ColorfieldBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Colorfield)
: AreaBuilderTemplate<T, U>(uniqueId, muiClassName)
{
}
/// @brief [ @b MUIA_Colorfield_Blue ] Set initial 32-bit blue component.
T &tagBlue(const unsigned char blue);
/// @brief [ @b MUIA_Colorfield_Green ] Set initial 32-bit green component.
T &tagGreen(const unsigned char green);
/// @brief [ @b MUIA_Colorfield_Red ] Set initial 32-bit red component.
T &tagRed(const unsigned char red);
/// @brief [ @b MUIA_Colorfield_RGB ] Set initial color from 8-bit RGB components.
T &tagRGB(const unsigned char red, const unsigned char green, const unsigned char blue);
/// @brief [ @b MUIA_Colorfield_RGB ] Set initial color from RGBColor.
T &tagRGB(const RGBColor &rgbColor);
};
class ColorfieldBuilder : public ColorfieldBuilderTemplate<ColorfieldBuilder, Colorfield>
{
public:
ColorfieldBuilder();
};
}
#define MUI_COLORFIELD_TPP_INCLUDE
#include "Colorfield.tpp"
#undef MUI_COLORFIELD_TPP_INCLUDE