Ardour  8.7-14-g57a6773833
tk/ytkmm/ytkmm/gtkmm/box.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_BOX_H
4 #define _GTKMM_BOX_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: box.hg,v 1.10 2006/01/28 18:49:13 jjongsma Exp $ */
11 
12 /* Copyright (C) 1998-2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 
30 // Temporarily undef GTK_DISABLE_DEPRECATED, redefining it later if appropriate.
31 // We need this to use _GtkBoxChild, which we use in our (deprecated) API.
32 #if defined(GTK_DISABLE_DEPRECATED) && !defined(GTKMM_GTK_DISABLE_DEPRECATED_UNDEFED)
33 #undef GTK_DISABLE_DEPRECATED
34 #define GTKMM_GTK_DISABLE_DEPRECATED_UNDEFED 1
35 #endif
36 
37 // This is needed for gdkregion.h, for GdkSpanFunc, which we indirectly include.
38 // Otherwise application code must be very careful of the include order.
39 #if defined(GDK_DISABLE_DEPRECATED) && !defined(GTKMM_GDK_DISABLE_DEPRECATED_UNDEFED)
40 #undef GDK_DISABLE_DEPRECATED
41 #define GTKMM_GDK_DISABLE_DEPRECATED_UNDEFED 1
42 #endif
43 
44 #include <gtk/gtk.h> /* For _GtkBoxChild */
45 
46 // Redefine GTK_DISABLE_DEPRECATED if it was defined before we temporarily undefed it:
47 #if defined(GTKMM_GTK_DISABLE_DEPRECATED_UNDEFED)
48 #define GTK_DISABLE_DEPRECATED 1
49 #undef GTKMM_GTK_DISABLE_DEPRECATED_UNDEFED
50 #endif
51 
52 // Redefine GDK_DISABLE_DEPRECATED if it was defined before we temporarily undefed it:
53 #if defined(GTKMM_GDK_DISABLE_DEPRECATED_UNDEFED)
54 #define GDK_DISABLE_DEPRECATED 1
55 #undef GTKMM_GDK_DISABLE_DEPRECATED_UNDEFED
56 #endif
57 
58 
59 #include <gtkmm/container.h>
60 #include <glibmm/helperlist.h>
61 
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 typedef struct _GtkBox GtkBox;
64 typedef struct _GtkBoxClass GtkBoxClass;
65 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
66 
67 
68 namespace Gtk
69 { class Box_Class; } // namespace Gtk
70 #ifndef DOXYGEN_SHOULD_SKIP_THIS
71 typedef struct _GtkVBox GtkVBox;
72 typedef struct _GtkVBoxClass GtkVBoxClass;
73 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
74 
75 
76 namespace Gtk
77 { class VBox_Class; } // namespace Gtk
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
79 typedef struct _GtkHBox GtkHBox;
80 typedef struct _GtkHBoxClass GtkHBoxClass;
81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 
83 
84 namespace Gtk
85 { class HBox_Class; } // namespace Gtk
86 namespace Gtk
87 {
88 
93 {
97 };
98 
99 class Box;
100 
101 namespace Box_Helpers
102 {
103 
104 //This may not have any data or virtual functions. See below.
105 class Child : protected _GtkBoxChild
106 {
107 private:
108  Child& operator=(const Child&); //Not implemented.
109  Child(const Child&); //Not implemented.
110 
111 public:
113  inline _GtkBoxChild* gobj() { return this; }
115  inline const _GtkBoxChild* gobj() const { return this; }
116 
117  Widget* get_widget() const;
118 
119  inline guint16 get_padding() const { return (gobj()->padding); }
120  inline bool get_expand() const { return (gobj()->expand); }
121  inline bool get_fill() const { return (gobj()->fill); }
122  inline bool get_pack() const { return (gobj()->pack); }
123 
124  void set_options(PackOptions options, guint padding = 0);
125  void set_options(bool expand, bool fill, guint padding = 0);
126 
128 
129 protected:
130  inline GtkBox* parent()
131  { return (GtkBox*) (gtk_widget_get_parent(gobj()->widget)); }
132 
133  void redraw();
134 
135 #ifndef DOXYGEN_SHOULD_SKIP_THIS
136  friend class Dummy_; // silence the compiler (Child has only private ctors)
137 #endif
138 };
139 
140 class Element
141 {
142 public:
143  Element(Widget& widget,
145  guint padding = 0,
146  PackType pack = PACK_START)
147  : widget_(&widget), options_(options),
148  padding_(padding), pack_(pack)
149  {}
150 
153  guint padding_;
155 };
156 
158 
159 struct EndElem : public Element
160 {
161  EndElem(Widget& widget,
163  guint padding = 0)
164  : Element (widget, options, padding, PACK_END)
165  {}
166 };
167 
168 
169 class BoxList : public Glib::HelperList< Child, const Element, Glib::List_Iterator< Child > >
170 {
171 public:
173  explicit BoxList(GtkBox* gparent);
174  BoxList(const BoxList& src);
175  virtual ~BoxList() {}
176 
177  BoxList& operator=(const BoxList& src);
178 
179  typedef Glib::HelperList< Child, const Element, Glib::List_Iterator< Child > > type_base;
180 
182  const GtkBox* gparent() const;
183 
184  virtual GList*& glist() const; // front of list
185 
186  virtual void erase(iterator start, iterator stop);
187  virtual iterator erase(iterator); //Implented as custom or by LIST_CONTAINER_REMOVE
188  virtual void remove(const_reference); //Implented as custom or by LIST_CONTAINER_REMOVE
189 
191  reference operator[](size_type l) const;
192 
193 public:
194  iterator insert(iterator position, element_type& e); //custom-implemented.
195 
196  template <class InputIterator>
197  inline void insert(iterator position, InputIterator first, InputIterator last)
198  {
199  for(;first != last; ++first)
200  position = insert(position, *first);
201  }
202 
203  inline void push_front(element_type& e)
204  { insert(begin(), e); }
205  inline void push_back(element_type& e)
206  { insert(end(), e); }
207 
208 
209  //The standard iterator, instead of List_Cpp_Iterator,
210  //only works because Child is derived from _GtkBoxChild.
211 
212 
213  iterator find(const_reference c);
214  iterator find(Widget&);
215 
216 
217 virtual void remove(Widget& w); //Implented as custom or by LIST_CONTAINER_REMOVE
218 
219  // Non-standard
220  void reorder(iterator loc,iterator pos);
221  };
222 
223 
224 } /* namespace Box_Helpers */
225 
226 
227 //TODO: Inherit/Implement Orientation when we can break ABI.
228 
260 class Box : public Container
261 {
262  public:
263 #ifndef DOXYGEN_SHOULD_SKIP_THIS
264  typedef Box CppObjectType;
265  typedef Box_Class CppClassType;
266  typedef GtkBox BaseObjectType;
267  typedef GtkBoxClass BaseClassType;
268 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
269 
270  virtual ~Box();
271 
272 #ifndef DOXYGEN_SHOULD_SKIP_THIS
273 
274 private:
275  friend class Box_Class;
276  static CppClassType box_class_;
277 
278  // noncopyable
279  Box(const Box&);
280  Box& operator=(const Box&);
281 
282 protected:
283  explicit Box(const Glib::ConstructParams& construct_params);
284  explicit Box(GtkBox* castitem);
285 
286 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
287 
288 public:
289 #ifndef DOXYGEN_SHOULD_SKIP_THIS
290  static GType get_type() G_GNUC_CONST;
291 
292 
293  static GType get_base_type() G_GNUC_CONST;
294 #endif
295 
297  GtkBox* gobj() { return reinterpret_cast<GtkBox*>(gobject_); }
298 
300  const GtkBox* gobj() const { return reinterpret_cast<GtkBox*>(gobject_); }
301 
302 
303 public:
304  //C++ methods used to invoke GTK+ virtual functions:
305 
306 protected:
307  //GTK+ Virtual Functions (override these to change behaviour):
308 
309  //Default Signal Handlers::
310 
311 
312 private:
313 
314 
315 public:
317 
318 protected:
319  Box();
320 public:
321 
322 
357  void pack_start(Widget& child, bool expand, bool fill, guint padding = 0);
358 
364  void pack_start(Widget& child, PackOptions options = PACK_EXPAND_WIDGET, guint padding = 0);
365 
366 
386  void pack_end(Widget& child, bool expand, bool fill, guint padding = 0);
387 
393  void pack_end(Widget& child, PackOptions options = PACK_EXPAND_WIDGET, guint padding = 0);
394 
395 
403  void set_homogeneous(bool homogeneous = true);
404 
410  bool get_homogeneous() const;
411 
412 
418  void set_spacing(int spacing);
419 
424  int get_spacing() const;
425 
426 
443  void reorder_child(Widget& child, int pos);
444 
445  /* Get the child widgets.
446  * @result An STL-style container of pointers to the box's child widgets.
447  */
449 
450  /* Get the child widgets.
451  * @result An STL-style container of pointers to the box's child widgets.
452  */
453  const BoxList& children() const;
454 
460  Glib::PropertyProxy< int > property_spacing() ;
461 
467  Glib::PropertyProxy_ReadOnly< int > property_spacing() const;
468 
474  Glib::PropertyProxy< bool > property_homogeneous() ;
475 
481  Glib::PropertyProxy_ReadOnly< bool > property_homogeneous() const;
482 
483 
484 protected:
485 #ifndef DOXYGEN_SHOULD_SKIP_THIS
486  mutable BoxList children_proxy_;
487 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
488 
489 
490 };
491 
492 
504 class VBox : public Box
505 {
506  public:
507 #ifndef DOXYGEN_SHOULD_SKIP_THIS
508  typedef VBox CppObjectType;
509  typedef VBox_Class CppClassType;
510  typedef GtkVBox BaseObjectType;
511  typedef GtkVBoxClass BaseClassType;
512 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
513 
514  virtual ~VBox();
515 
516 #ifndef DOXYGEN_SHOULD_SKIP_THIS
517 
518 private:
519  friend class VBox_Class;
520  static CppClassType vbox_class_;
521 
522  // noncopyable
523  VBox(const VBox&);
524  VBox& operator=(const VBox&);
525 
526 protected:
527  explicit VBox(const Glib::ConstructParams& construct_params);
528  explicit VBox(GtkVBox* castitem);
529 
530 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
531 
532 public:
533 #ifndef DOXYGEN_SHOULD_SKIP_THIS
534  static GType get_type() G_GNUC_CONST;
535 
536 
537  static GType get_base_type() G_GNUC_CONST;
538 #endif
539 
541  GtkVBox* gobj() { return reinterpret_cast<GtkVBox*>(gobject_); }
542 
544  const GtkVBox* gobj() const { return reinterpret_cast<GtkVBox*>(gobject_); }
545 
546 
547 public:
548  //C++ methods used to invoke GTK+ virtual functions:
549 
550 protected:
551  //GTK+ Virtual Functions (override these to change behaviour):
552 
553  //Default Signal Handlers::
554 
555 
556 private:
557 
558 public:
559 
566  explicit VBox(bool homogeneous = false, int spacing = 0);
567 
568 
569 };
570 
587 class HBox : public Box
588 {
589  public:
590 #ifndef DOXYGEN_SHOULD_SKIP_THIS
591  typedef HBox CppObjectType;
592  typedef HBox_Class CppClassType;
593  typedef GtkHBox BaseObjectType;
594  typedef GtkHBoxClass BaseClassType;
595 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
596 
597  virtual ~HBox();
598 
599 #ifndef DOXYGEN_SHOULD_SKIP_THIS
600 
601 private:
602  friend class HBox_Class;
603  static CppClassType hbox_class_;
604 
605  // noncopyable
606  HBox(const HBox&);
607  HBox& operator=(const HBox&);
608 
609 protected:
610  explicit HBox(const Glib::ConstructParams& construct_params);
611  explicit HBox(GtkHBox* castitem);
612 
613 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
614 
615 public:
616 #ifndef DOXYGEN_SHOULD_SKIP_THIS
617  static GType get_type() G_GNUC_CONST;
618 
619 
620  static GType get_base_type() G_GNUC_CONST;
621 #endif
622 
624  GtkHBox* gobj() { return reinterpret_cast<GtkHBox*>(gobject_); }
625 
627  const GtkHBox* gobj() const { return reinterpret_cast<GtkHBox*>(gobject_); }
628 
629 
630 public:
631  //C++ methods used to invoke GTK+ virtual functions:
632 
633 protected:
634  //GTK+ Virtual Functions (override these to change behaviour):
635 
636  //Default Signal Handlers::
637 
638 
639 private:
640 
641 public:
642 
649  explicit HBox(bool homogeneous = false, int spacing = 0);
650 
651 
652 };
653 
654 } // namespace Gtk
655 
656 
657 namespace Glib
658 {
667  Gtk::Box* wrap(GtkBox* object, bool take_copy = false);
668 } //namespace Glib
669 
670 
671 namespace Glib
672 {
681  Gtk::VBox* wrap(GtkVBox* object, bool take_copy = false);
682 } //namespace Glib
683 
684 
685 namespace Glib
686 {
695  Gtk::HBox* wrap(GtkHBox* object, bool take_copy = false);
696 } //namespace Glib
697 
698 
699 #endif /* _GTKMM_BOX_H */
700 
virtual void erase(iterator start, iterator stop)
iterator find(Widget &)
const GtkBox * gparent() const
BoxList(const BoxList &src)
void reorder(iterator loc, iterator pos)
BoxList & operator=(const BoxList &src)
virtual GList *& glist() const
virtual iterator erase(iterator)
BoxList(GtkBox *gparent)
iterator find(const_reference c)
Glib::HelperList< Child, const Element, Glib::List_Iterator< Child > > type_base
virtual void remove(Widget &w)
virtual void remove(const_reference)
void insert(iterator position, InputIterator first, InputIterator last)
iterator insert(iterator position, element_type &e)
reference operator[](size_type l) const
This is order n. (use at own risk)
_GtkBoxChild * gobj()
Provides access to the underlying C GObject.
void set_pack(PackType pack)
Widget * get_widget() const
void set_options(PackOptions options, guint padding=0)
void set_options(bool expand, bool fill, guint padding=0)
Child(const Child &)
const _GtkBoxChild * gobj() const
Provides access to the underlying C GObject.
Child & operator=(const Child &)
Element(Widget &widget, PackOptions options=PACK_EXPAND_WIDGET, guint padding=0, PackType pack=PACK_START)
GtkBox * gobj()
Provides access to the underlying C GtkObject.
Glib::PropertyProxy< int > property_spacing()
const BoxList & children() const
void set_homogeneous(bool homogeneous=true)
void pack_end(Widget &child, bool expand, bool fill, guint padding=0)
void pack_start(Widget &child, bool expand, bool fill, guint padding=0)
bool get_homogeneous() const
Box_Helpers::BoxList BoxList
Glib::PropertyProxy< bool > property_homogeneous()
Gtk::Box * wrap(GtkBox *object, bool take_copy=false)
virtual ~Box()
Glib::PropertyProxy_ReadOnly< bool > property_homogeneous() const
const GtkBox * gobj() const
Provides access to the underlying C GtkObject.
Glib::PropertyProxy_ReadOnly< int > property_spacing() const
void set_spacing(int spacing)
BoxList & children()
void pack_end(Widget &child, PackOptions options=PACK_EXPAND_WIDGET, guint padding=0)
void reorder_child(Widget &child, int pos)
void pack_start(Widget &child, PackOptions options=PACK_EXPAND_WIDGET, guint padding=0)
int get_spacing() const
GtkHBox * gobj()
Provides access to the underlying C GtkObject.
Gtk::HBox * wrap(GtkHBox *object, bool take_copy=false)
const GtkHBox * gobj() const
Provides access to the underlying C GtkObject.
HBox(bool homogeneous=false, int spacing=0)
virtual ~HBox()
VBox(bool homogeneous=false, int spacing=0)
GtkVBox * gobj()
Provides access to the underlying C GtkObject.
const GtkVBox * gobj() const
Provides access to the underlying C GtkObject.
Gtk::VBox * wrap(GtkVBox *object, bool take_copy=false)
virtual ~VBox()
GtkWidget * gtk_widget_get_parent(GtkWidget *widget)
PBD::PropertyDescriptor< timepos_t > start
Definition: ardour_ui.h:188
EndElem(Widget &widget, PackOptions options=PACK_EXPAND_WIDGET, guint padding=0)
guint pack
Definition: gtkbox.h:99
GtkWidget * widget
Definition: gtkbox.h:95
guint fill
Definition: gtkbox.h:98
guint16 padding
Definition: gtkbox.h:96
guint expand
Definition: gtkbox.h:97
Definition: gtkbox.h:53