Ardour  9.0-pre0-1680-gd7af181037
tk/ytkmm/ytkmm/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 <ytk/ytk.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 <ytkmm/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 
412  void set_child_packing(Widget& child, bool expand, bool fill, guint padding = 0);
413 
421  void set_homogeneous(bool homogeneous = true);
422 
428  bool get_homogeneous() const;
429 
430 
436  void set_spacing(int spacing);
437 
442  int get_spacing() const;
443 
444 
461  void reorder_child(Widget& child, int pos);
462 
463  /* Get the child widgets.
464  * @result An STL-style container of pointers to the box's child widgets.
465  */
467 
468  /* Get the child widgets.
469  * @result An STL-style container of pointers to the box's child widgets.
470  */
471  const BoxList& children() const;
472 
478  Glib::PropertyProxy< int > property_spacing() ;
479 
485  Glib::PropertyProxy_ReadOnly< int > property_spacing() const;
486 
492  Glib::PropertyProxy< bool > property_homogeneous() ;
493 
499  Glib::PropertyProxy_ReadOnly< bool > property_homogeneous() const;
500 
501 
502 protected:
503 #ifndef DOXYGEN_SHOULD_SKIP_THIS
504  mutable BoxList children_proxy_;
505 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
506 
507 
508 };
509 
510 
522 class VBox : public Box
523 {
524  public:
525 #ifndef DOXYGEN_SHOULD_SKIP_THIS
526  typedef VBox CppObjectType;
527  typedef VBox_Class CppClassType;
528  typedef GtkVBox BaseObjectType;
529  typedef GtkVBoxClass BaseClassType;
530 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
531 
532  virtual ~VBox();
533 
534 #ifndef DOXYGEN_SHOULD_SKIP_THIS
535 
536 private:
537  friend class VBox_Class;
538  static CppClassType vbox_class_;
539 
540  // noncopyable
541  VBox(const VBox&);
542  VBox& operator=(const VBox&);
543 
544 protected:
545  explicit VBox(const Glib::ConstructParams& construct_params);
546  explicit VBox(GtkVBox* castitem);
547 
548 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
549 
550 public:
551 #ifndef DOXYGEN_SHOULD_SKIP_THIS
552  static GType get_type() G_GNUC_CONST;
553 
554 
555  static GType get_base_type() G_GNUC_CONST;
556 #endif
557 
559  GtkVBox* gobj() { return reinterpret_cast<GtkVBox*>(gobject_); }
560 
562  const GtkVBox* gobj() const { return reinterpret_cast<GtkVBox*>(gobject_); }
563 
564 
565 public:
566  //C++ methods used to invoke GTK+ virtual functions:
567 
568 protected:
569  //GTK+ Virtual Functions (override these to change behaviour):
570 
571  //Default Signal Handlers::
572 
573 
574 private:
575 
576 public:
577 
584  explicit VBox(bool homogeneous = false, int spacing = 0);
585 
586 
587 };
588 
605 class HBox : public Box
606 {
607  public:
608 #ifndef DOXYGEN_SHOULD_SKIP_THIS
609  typedef HBox CppObjectType;
610  typedef HBox_Class CppClassType;
611  typedef GtkHBox BaseObjectType;
612  typedef GtkHBoxClass BaseClassType;
613 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
614 
615  virtual ~HBox();
616 
617 #ifndef DOXYGEN_SHOULD_SKIP_THIS
618 
619 private:
620  friend class HBox_Class;
621  static CppClassType hbox_class_;
622 
623  // noncopyable
624  HBox(const HBox&);
625  HBox& operator=(const HBox&);
626 
627 protected:
628  explicit HBox(const Glib::ConstructParams& construct_params);
629  explicit HBox(GtkHBox* castitem);
630 
631 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
632 
633 public:
634 #ifndef DOXYGEN_SHOULD_SKIP_THIS
635  static GType get_type() G_GNUC_CONST;
636 
637 
638  static GType get_base_type() G_GNUC_CONST;
639 #endif
640 
642  GtkHBox* gobj() { return reinterpret_cast<GtkHBox*>(gobject_); }
643 
645  const GtkHBox* gobj() const { return reinterpret_cast<GtkHBox*>(gobject_); }
646 
647 
648 public:
649  //C++ methods used to invoke GTK+ virtual functions:
650 
651 protected:
652  //GTK+ Virtual Functions (override these to change behaviour):
653 
654  //Default Signal Handlers::
655 
656 
657 private:
658 
659 public:
660 
667  explicit HBox(bool homogeneous = false, int spacing = 0);
668 
669 
670 };
671 
672 } // namespace Gtk
673 
674 
675 namespace Glib
676 {
685  Gtk::Box* wrap(GtkBox* object, bool take_copy = false);
686 } //namespace Glib
687 
688 
689 namespace Glib
690 {
699  Gtk::VBox* wrap(GtkVBox* object, bool take_copy = false);
700 } //namespace Glib
701 
702 
703 namespace Glib
704 {
713  Gtk::HBox* wrap(GtkHBox* object, bool take_copy = false);
714 } //namespace Glib
715 
716 
717 #endif /* _GTKMM_BOX_H */
718 
void push_front(element_type &e)
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)
void push_back(element_type &e)
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
void set_child_packing(Widget &child, bool expand, bool fill, guint padding=0)
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()
@ PACK_EXPAND_PADDING
@ PACK_EXPAND_WIDGET
GtkWidget * gtk_widget_get_parent(GtkWidget *widget)
PBD::PropertyDescriptor< timepos_t > start
Definition: ardour_ui.h:192
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