9 #ifndef Guit_PropType_hpp
10 #define Guit_PropType_hpp
11 #include <gobject.hpp>
20 Modes = -8, States = -7, Holder = -6, Expr = -5, ExprWrapper = -4,
21 Notifier = -3, Cond = -2, Abstract = -1,
22 Align, Background, Border, Color, Flex, Flow, Font, Format, Gap, Hotkey,
23 Icon, Margin, Pos, Size, Text, Tip, RenderCount,
24 Bool, Number, Choice, Anim,
30 GString
const&
name()
const {
return name_;}
31 int role()
const {
return role_;}
38 virtual GProp&
newInstance(GString const& arg) noexcept(false);
42 static GProp*
createInstance(GString const& type_name, GString const& arg,
43 bool css_style = false);
46 static GPropType*
findType(GString const& type_name);
48 bool operator==(GPropType const& other) const;
49 bool operator!=(GPropType const& other) const;
52 void operator delete(
void*);
56 virtual ~GPropType() = default;
57 GPropType(GString const&
name,
int role);
58 GPropType(GString const& name, GPropType& parent);
63 friend class GPropList;
65 GPropType(GPropType&) = delete;
66 GPropType(GPropType&&) = delete;
67 GPropType& operator=(GPropType const&) = delete;
77 template <
class P,
class Super>
82 P& newInstance()
override {
return *
new P();}
83 P& newInstance(GString
const& arg)
override {
return *
new P(arg);}
87 P&
operator<<=(O& other) {P& p{(*this)()}; p <<= other;
return p;}
91 GPropType_(GString
const& name,
int role) : Super::GType(name, role) {}