16 GItemSpec(
const char* spec) : spec_(spec) {}
17 GItemSpec(
const GString& spec) : spec_(spec) {}
19 mutable std::vector<gptr<GProp>> props_;
23 class GadgetHolder :
public GProp {
25 GadgetHolder(Gadget& g) : gadget_(g) {}
26 static GPropType& Type();
27 GPropType& type()
const override {
return Type();}
58 GItemSpec
const& operator<<(GItemSpec
const& item, GString
const& str);
59 GItemSpec
const& operator<<(GItemSpec
const& item, GProp& prop);
60 GItemSpec
const& operator<<(GItemSpec const& item, gptr<GProp> prop);
62 GItemSpec
const& operator<<(GItemSpec
const& item, GFunction
const& fun);
63 GItemSpec
const& operator<<(GItemSpec
const& item, GEventFunction
const& fun);
65 GItemSpec
const& operator<<(GItemSpec
const& item, GMenu& menu);
66 GItemSpec
const& operator<<(GItemSpec const& item, gptr<GMenu> menu);
68 GItemSpec
const& operator<<(GItemSpec
const& item, GWindow& win);
69 GItemSpec
const& operator<<(GItemSpec const& item, gptr<GWindow> win);
71 template <
class T,
class =
typename T::IsGadget>
72 inline T& operator<<(T& gadget,
const char* str) {
73 if (str) gadget.add(str);
77 template <
class T,
class =
typename T::IsGadget>
78 inline T& operator<<(T& gadget, GString
const& str) {
83 template <
class T,
class =
typename T::IsGadget>
84 inline T& operator<<(T& gadget, GStrings
const& str) {
89 template <
class T,
class =
typename T::IsGadget>
90 inline T& operator<<(T& gadget, GItemSpec
const& item) {
95 template <
class T,
class Child,
class =
typename T::IsGadget,
class =
typename Child::IsGadgetChild>
96 inline T& operator<<(T& gadget, Child& child) {
101 template <
class T,
class Child,
class =
typename T::IsGadget,
class =
typename Child::IsGadgetChild>
102 inline T& operator<<(T& gadget, Child* child) {
107 template <
class T,
class Child,
class =
typename T::IsGadget>
108 inline T& operator<<(T& gadget, gptr<Child> child) {
109 gadget.add(child.get());
113 template <
class T,
class =
typename T::IsGadgetOrVarProp>
114 inline T& operator<<(T& parent, GFunction
const& fun) {
119 template <
class T,
class =
typename T::IsGadgetOrVarProp>
120 inline T& operator<<(T& parent, GEventFunction
const& fun) {
125 template <
class T,
class =
typename T::IsGadgetOrVarProp>
126 inline T& operator<<(T& parent, GCaller& fun) {
131 template <
class T,
class Child,
class =
typename T::IsGadget>
132 inline T& operator<<(T& gadget, Child&(creator)(GString
const&)) {
133 gadget.add((creator)(
""));
137 template <
class T,
class =
typename T::IsGadget>
138 inline T& operator<<(T& (creator)(GString
const&), GString
const& str) {
139 return (creator)(
"") << str;
142 template <
class T,
class =
typename T::IsGadget>
143 inline T& operator<<(T& (creator)(GString
const&), GItemSpec
const& item) {
144 return (creator)(
"") << item;
147 template <
class T,
class Child,
class =
typename T::IsGadget,
class =
typename Child::IsGadgetChild>
148 inline T& operator<<(T& (creator)(GString
const&), Child& child) {
149 return (creator)(
"") << child;
152 template <
class T,
class Child,
class =
typename T::IsGadget>
153 inline T& operator<<(T& (creator)(GString const&), gptr<Child> child) {
154 return (creator)(
"") << child;
157 template <
class T,
class =
typename T::IsGadget>
158 inline T& operator<<(T& (creator)(GString
const&), GFunction
const& fun) {
159 return (creator)(
"") << fun;
162 template <
class T,
class =
typename T::IsGadget>
163 inline T& operator<<(T& (creator)(GString
const&), GEventFunction
const& fun) {
164 return (creator)(
"") << fun;