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>
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());
127 const Array<Info>& uitree,
const Glib::ustring& tip = Glib::ustring());
136#ifndef DOXYGEN_SHOULD_SKIP_THIS
138class Begin :
public Info
144 static GnomeUIBuilderData build_data_;
148class End :
public Info
155namespace Array_Helpers
167template<
class T_Info>
175template<
size_t N,
class T_Info>
188template<
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]); }
265template <
class T_Info>
268Array<T_Info>::create(I b, I e)
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);
334 void set_subtree(
const Array<Info>& subtree);
335 Array<Info>& get_subtree();
339 Array<Info> subtree_;
340 Glib::ustring label_;
355 const Glib::RefPtr<Gtk::AccelGroup> &accel_group,
356 bool uline_accels =
true,
365 const Glib::RefPtr<Gtk::AccelGroup> &accel_group);
Definition: app-helper.h:190
Array(const T &t)
Definition: app-helper.h:229
size_t size_type
Definition: app-helper.h:204
size_t size() const
Definition: app-helper.h:247
iterator begin() const
Definition: app-helper.h:249
T_Info *const const_iterator
Definition: app-helper.h:201
T_Info & reference_type
Definition: app-helper.h:199
ptrdiff_t difference_type
Definition: app-helper.h:205
Array(I b, I e)
Definition: app-helper.h:236
T_Info value_type
Definition: app-helper.h:198
GnomeUIInfo * gobj() const
Definition: app-helper.h:259
Array(Array &a)
Definition: app-helper.h:224
T_Info * iterator
Definition: app-helper.h:200
T_Info *const pointer
Definition: app-helper.h:202
reference_type operator[](size_t n) const
Definition: app-helper.h:255
~Array()
Definition: app-helper.h:240
Array()
Definition: app-helper.h:220
T_Info *const const_pointer
Definition: app-helper.h:203
Array & operator=(const Array &a)
Definition: app-helper.h:207
iterator end() const
Definition: app-helper.h:252
Icons represent a standard Pixmap with various states.
Definition: ui-items-icon.h:39
Definition: app-helper.h:57
Type
Definition: app-helper.h:75
@ HELP
Definition: app-helper.h:82
@ SEPARATOR
Definition: app-helper.h:81
@ SUBTREE
Definition: app-helper.h:80
@ BUILDER
Definition: app-helper.h:83
@ END
Definition: app-helper.h:76
@ TOGGLEITEM
Definition: app-helper.h:78
@ RADIOITEMS
Definition: app-helper.h:79
@ SUBTREE_STOCK
Definition: app-helper.h:85
@ ITEM
Definition: app-helper.h:77
@ CONFIGURABLE
Definition: app-helper.h:84
Gtk::Widget * get_widget()
friend class InfoData
Definition: app-helper.h:58
void set_data_(InfoData *infodata)
const gchar * debug_get_icon_info() const
const Gtk::Widget * get_widget() const
void init_cb(Type type_, const Icon &icon, const Glib::ustring &label, const Callback &cb, const Glib::ustring &tooltip)
InfoData * init_common(Type type_, const Icon &icon_, const Glib::ustring &label_, const Glib::ustring &hint_)
Info & operator=(const Info &src)
void set_accel(const Gtk::AccelKey &ak=Gtk::AccelKey())
sigc::slot< void > Callback
Definition: app-helper.h:94
void init_sub(Type type_, const Icon &icon, const Glib::ustring &label, const Array< Info > &sub, const Glib::ustring &tooltip)
const InfoData * get_data_() const
Definition: app-helper.h:120
SubTree(const Glib::ustring &label, const Array< Info > &uitree, const Glib::ustring &tip=Glib::ustring())
Array< Info > & get_uitree()
SubTree(const Icon &icon, const Glib::ustring &label, const Array< Info > &uitree, const Glib::ustring &tip=Glib::ustring())
Items::Array< Info > fill(Gtk::MenuShell &menu_shell, const Items::Array< Info > &info, const Glib::RefPtr< Gtk::AccelGroup > &accel_group, bool uline_accels=true, int pos=0)
Fill a menu with Items::Info items.
SubTree Menu
Definition: app-helper.h:132
sigc::slot< void > Callback
Definition: types.h:30
static iterator end(T_Info *t)
Definition: app-helper.h:172
static iterator begin(const T_Info *t)
Definition: app-helper.h:171
const T_Info * iterator
Definition: app-helper.h:170
static iterator begin(const T_Info *t)
Definition: app-helper.h:179
static iterator end(const T_Info *t)
Definition: app-helper.h:180
const T_Info * iterator
Definition: app-helper.h:178
Definition: app-helper.h:160
static iterator begin(const T &t)
Definition: app-helper.h:162
static iterator end(const T &t)
Definition: app-helper.h:163
T::const_iterator iterator
Definition: app-helper.h:161