8 #ifndef Guit_GadgetType_hpp
9 #define Guit_GadgetType_hpp
18 GString
const&
name()
const {
return name_;}
19 GId id()
const {
return id_;}
20 GStyle& style()
const {
return *style_;}
24 virtual Gadget&
newInstance(GString
const& arg =
"") = 0;
29 static Gadget*
createInstance(GString
const& type_name, GString
const& arg);
32 static GadgetType*
findType(GString
const& type_name);
34 bool operator==(GadgetType
const& other)
const;
35 bool operator!=(GadgetType
const& other)
const;
38 void operator delete(
void*);
40 virtual ~GadgetType() =
default;
44 GadgetType(GString
const&
name);
45 GadgetType(GadgetType&) =
delete;
46 GadgetType(GadgetType&&) =
delete;
47 GadgetType& operator=(GadgetType
const&) =
delete;
56 template <
class T,
class Super>
62 T& newInstance(GString
const& arg =
"")
override {
return *
new T(arg);}
65 GadgetType_(GString
const& name) : Super::GType(name) {}
71 using Type = uint32_t;
72 Type dir:2, placement:3, menuLayout:1, unclippedLayers:1, stealTitle:1,
73 multiLine:1, richText:1,
74 shown:1, active:1, checked:1, enabled:1, focus:1,
75 activable:1, downActivable:1, checkable:1, focusable:1,
internal:1,
76 catchEvents:1, ignoreEvents:1, choiceBehavior:2,
77 hasTip:1, hasCheck:1, hasChoice:1;
82 struct GadgetSettings {
84 Type trulyEnabled:1, hotkeySet:1, modesSet:1, itemsSet:1, hasItems:1,
85 hasOpener:1, hasMenu:1, hasViews:1;
92 Type flexType:2, passivePos:1, activePos:1, activeSize:1, reshapeFrame:1,
95 int8_t flex1{}, flex2{};
101 class GBorderValue* border{};
102 float start{}, extent{};