21 #ifndef GNOMEMM_APP_HELPER_H
22 #define GNOMEMM_APP_HELPER_H
25 #include <gtkmm/menushell.h>
26 #include <gtkmm/toolbar.h>
27 #include <gtkmm/accelgroup.h>
29 #include <libgnomeui/gnome-app.h>
30 #include <libgnomeui/gnome-app-helper.h>
48 template<
class T_Info>
62 void*
operator new(
size_t s);
64 void*
operator new(
size_t s,
void* v) {return ::operator
new(s, v);}
76 END = GNOME_APP_UI_ENDOFINFO,
92 void set_accel(
const Gtk::AccelKey& ak = Gtk::AccelKey());
99 const Glib::ustring& label,
const Callback& cb,
100 const Glib::ustring& tooltip);
102 const Glib::ustring& label,
const Array<Info>& sub,
103 const Glib::ustring& tooltip);
105 const Glib::ustring& label_,
const Glib::ustring& hint_);
125 const Glib::ustring& tip = Glib::ustring());
126 SubTree(
const Icon& icon,
const Glib::ustring& label,
127 const Array<Info>& uitree,
const Glib::ustring& tip = Glib::ustring());
136 #ifndef DOXYGEN_SHOULD_SKIP_THIS
138 class Begin :
public Info
144 static GnomeUIBuilderData build_data_;
148 class End :
public Info
155 namespace Array_Helpers
167 template<
class T_Info>
171 static iterator
begin(
const T_Info* t) {
return t;}
172 static iterator
end( T_Info* t) {
return t+64;}
175 template<
size_t N,
class T_Info>
188 template<
class T_Info>
196 template <
class I>
void create(I b, I e);
221 : data_(0), begin_(0), size_(0)
222 { create((T_Info*)0, (T_Info*)0); }
225 : data_(0), begin_(0), size_(0)
230 : data_(0), begin_(0), size_(0)
237 : data_(0), begin_(0), size_(0)
247 size_t size()
const {
return size_; }
250 {
return static_cast<T_Info*
>(begin_); }
253 {
return static_cast<T_Info*
>(begin_ + size_); }
256 {
return static_cast<T_Info&
>(begin_[n]); }
265 template <
class T_Info>
279 for (I b2 = b ; b2 != e; ++b2, ++size_)
288 begin_ = data_ =
new Info[size_+2];
289 new (begin_) Begin();
293 begin_ = data_ =
new Info[size_+1];
296 for (
int i = 0; b != e; ++b, ++i)
298 new (&begin_[i]) T_Info(*b);
301 new (&begin_[size_]) End();
308 #ifndef DOXYGEN_SHOULD_SKIP_THIS
317 InfoData(
const Glib::ustring& label,
const Glib::ustring& hint,
const Icon& icon = Icon());
320 InfoData(
const InfoData&);
329 virtual void connect(Info&);
333 void set_callback(
const Callback& callback);
340 Glib::ustring label_;
353 Items::Array<Info>
fill (Gtk::MenuShell &menu_shell,
354 const Items::Array<Info> &info,
355 const Glib::RefPtr<Gtk::AccelGroup> &accel_group,
356 bool uline_accels =
true,
363 Items::Array<Info>
fill (Gtk::Toolbar &toolbar,
364 const Items::Array<Info> &info,
365 const Glib::RefPtr<Gtk::AccelGroup> &accel_group);
385 #endif //GNOMEMM_APP_HELPER_H