-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRectangle.hpp
79 lines (65 loc) · 2.11 KB
/
Rectangle.hpp
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
//
// AmigaOS MUI C++ wrapper
//
// (c) 2022-2024 TDolphin
//
#pragma once
#include "Area.hpp"
namespace MUI
{
class Rectangle : public Area
{
public:
explicit Rectangle(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_Rectangle_BarTitle ]
std::string getBarTitle() const;
/// @brief [ @b MUIA_Rectangle_HBar ]
bool isHBar() const;
/// @brief [ @b MUIA_Rectangle_VBar ]
bool isVBar() const;
};
template <typename T, typename U> class RectangleBuilderTemplate : public AreaBuilderTemplate<T, U>
{
public:
RectangleBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Rectangle)
: AreaBuilderTemplate<T, U>(uniqueId, muiClassName)
{
}
/// @brief [ @b MUIA_Rectangle_BarTitle ]
T &tagBarTitle(const char *barTitle);
/// @brief [ @b MUIA_Rectangle_HBar ]
T &tagHBar(const bool hBar);
/// @brief [ @b MUIA_Rectangle_VBar ]
T &tagVBar(const bool vBar);
};
class RectangleBuilder : public RectangleBuilderTemplate<RectangleBuilder, Rectangle>
{
public:
RectangleBuilder();
};
template <typename T, typename U> inline T &RectangleBuilderTemplate<T, U>::tagBarTitle(const char *barTitle)
{
this->PushTag(MUIA_Rectangle_BarTitle, barTitle);
return (T &)*this;
}
template <typename T, typename U> inline T &RectangleBuilderTemplate<T, U>::tagHBar(const bool hBar)
{
this->PushTag(MUIA_Rectangle_HBar, hBar);
return (T &)*this;
}
template <typename T, typename U> inline T &RectangleBuilderTemplate<T, U>::tagVBar(const bool vBar)
{
this->PushTag(MUIA_Rectangle_VBar, vBar);
return (T &)*this;
}
}