Initial revision
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / layout.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_LAYOUT_H
4 #define _GTKMM_LAYOUT_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* layout.h
11  * 
12  * Copyright (C) 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 Library General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 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  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library 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 #include <gtkmm/container.h>
30 #include <gtkmm/adjustment.h>
31 #include <gdkmm/window.h>
32
33
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkLayout GtkLayout;
36 typedef struct _GtkLayoutClass GtkLayoutClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38
39
40 namespace Gtk
41 { class Layout_Class; } // namespace Gtk
42 namespace Gtk
43 {
44
45 /** Infinite scrollable area containing child widgets and/or custom drawing.
46  *
47  * Gtk::Layout is similar to Gtk::DrawingArea in that it's a "blank slate"
48  * and doesn't do anything but paint a blank background by default. It's
49  * different in that it supports scrolling natively (You can add it directly
50  * to a Gtk::ScrolledWindow), and it can contain child widgets, since it's a
51  * Gtk::Container.  However if you're just going to draw, a Gtk::DrawingArea
52  * is a better choice since it has lower overhead.
53  *
54  * When handling expose_event signals, you must draw to the bin_window
55  * Gdk::Window - see get_bin_window() - rather than the normal Gdk::Window -
56  * see get_window() - as you would for a drawing area.
57  *
58  * @ingroup Widgets
59  * @ingroup Containers
60  */
61
62 class Layout : public Container
63 {
64   public:
65 #ifndef DOXYGEN_SHOULD_SKIP_THIS
66   typedef Layout CppObjectType;
67   typedef Layout_Class CppClassType;
68   typedef GtkLayout BaseObjectType;
69   typedef GtkLayoutClass BaseClassType;
70 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
71
72   virtual ~Layout();
73
74 #ifndef DOXYGEN_SHOULD_SKIP_THIS
75
76 private:
77   friend class Layout_Class;
78   static CppClassType layout_class_;
79
80   // noncopyable
81   Layout(const Layout&);
82   Layout& operator=(const Layout&);
83
84 protected:
85   explicit Layout(const Glib::ConstructParams& construct_params);
86   explicit Layout(GtkLayout* castitem);
87
88 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
89
90 public:
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
92   static GType get_type()      G_GNUC_CONST;
93   static GType get_base_type() G_GNUC_CONST;
94 #endif
95
96   ///Provides access to the underlying C GtkObject.
97   GtkLayout*       gobj()       { return reinterpret_cast<GtkLayout*>(gobject_); }
98
99   ///Provides access to the underlying C GtkObject.
100   const GtkLayout* gobj() const { return reinterpret_cast<GtkLayout*>(gobject_); }
101
102
103 public:
104   //C++ methods used to invoke GTK+ virtual functions:
105
106 protected:
107   //GTK+ Virtual Functions (override these to change behaviour):
108
109   //Default Signal Handlers::
110   virtual void on_set_scroll_adjustments(Adjustment* hadj, Adjustment* vadj);
111
112
113 private:
114
115   
116 public:
117   Layout();
118   Layout(Adjustment& hadjustment, Adjustment& vadjustment);
119
120   
121   /** Adds @a child_widget  to @a layout , at position ( @a x , @a y ).
122    *  @a layout  becomes the new parent container of @a child_widget .
123    * @param child_widget Child widget.
124    * @param x X position of child widget.
125    * @param y Y position of child widget.
126    */
127   void put(Widget& child_widget, int x, int y);
128   
129   /** Moves a current child of @a layout  to a new position.
130    * @param child_widget A current child of @a layout .
131    * @param x X position to move to.
132    * @param y Y position to move to.
133    */
134   void move(Widget& child_widget, int x, int y);
135   
136   /** Sets the size of the scrollable area of the layout.
137    * @param width Width of entire scrollable area.
138    * @param height Height of entire scrollable area.
139    */
140   void set_size(guint width, guint height);
141   
142   /** Gets the size that has been set on the layout, and that determines
143    * the total extents of the layout's scrollbar area. See
144    * set_size().
145    * @param width Location to store the width set on @a layout , or <tt>0</tt>.
146    * @param height Location to store the height set on @a layout , or <tt>0</tt>.
147    */
148   void get_size(guint& width, guint& height) const;
149
150   
151   /** Sets the horizontal scroll adjustment for the layout.
152    * 
153    * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
154    * @param adjustment New scroll adjustment.
155    */
156   void set_hadjustment(Adjustment& adjustment);
157
158   /// Creates the Adjustment.
159   void set_hadjustment();
160   
161   /** This function should only be called after the layout has been
162    * placed in a Gtk::ScrolledWindow or otherwise configured for
163    * scrolling. It returns the Gtk::Adjustment used for communication
164    * between the horizontal scrollbar and @a layout .
165    * 
166    * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
167    * @return Horizontal scroll adjustment.
168    */
169   Adjustment* get_hadjustment();
170   
171   /** This function should only be called after the layout has been
172    * placed in a Gtk::ScrolledWindow or otherwise configured for
173    * scrolling. It returns the Gtk::Adjustment used for communication
174    * between the horizontal scrollbar and @a layout .
175    * 
176    * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
177    * @return Horizontal scroll adjustment.
178    */
179   const Adjustment* get_hadjustment() const;
180   
181   /** Sets the vertical scroll adjustment for the layout.
182    * 
183    * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
184    * @param adjustment New scroll adjustment.
185    */
186   void set_vadjustment(Adjustment& adjustment);
187
188   /// Creates the Adjustment.
189   void set_vadjustment();
190   
191   /** This function should only be called after the layout has been
192    * placed in a Gtk::ScrolledWindow or otherwise configured for
193    * scrolling. It returns the Gtk::Adjustment used for communication
194    * between the vertical scrollbar and @a layout .
195    * 
196    * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
197    * @return Vertical scroll adjustment.
198    */
199   Adjustment* get_vadjustment();
200   
201   /** This function should only be called after the layout has been
202    * placed in a Gtk::ScrolledWindow or otherwise configured for
203    * scrolling. It returns the Gtk::Adjustment used for communication
204    * between the vertical scrollbar and @a layout .
205    * 
206    * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
207    * @return Vertical scroll adjustment.
208    */
209   const Adjustment* get_vadjustment() const;
210
211   Glib::RefPtr<Gdk::Window> get_bin_window();
212   Glib::RefPtr<const Gdk::Window> get_bin_window() const;
213
214   // See Gtk::Widget::set_scroll_adjustments()
215   
216
217   Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments();
218
219
220   /** The GtkAdjustment for the horizontal position.
221    *
222    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
223    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
224    * the value of the property changes.
225    */
226   Glib::PropertyProxy<Adjustment*> property_hadjustment() ;
227
228 /** The GtkAdjustment for the horizontal position.
229    *
230    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
231    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
232    * the value of the property changes.
233    */
234   Glib::PropertyProxy_ReadOnly<Adjustment*> property_hadjustment() const;
235
236   /** The GtkAdjustment for the vertical position.
237    *
238    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
239    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
240    * the value of the property changes.
241    */
242   Glib::PropertyProxy<Adjustment*> property_vadjustment() ;
243
244 /** The GtkAdjustment for the vertical position.
245    *
246    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
247    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
248    * the value of the property changes.
249    */
250   Glib::PropertyProxy_ReadOnly<Adjustment*> property_vadjustment() const;
251
252   /** The width of the layout.
253    *
254    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
255    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
256    * the value of the property changes.
257    */
258   Glib::PropertyProxy<guint> property_width() ;
259
260 /** The width of the layout.
261    *
262    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
263    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
264    * the value of the property changes.
265    */
266   Glib::PropertyProxy_ReadOnly<guint> property_width() const;
267
268   /** The height of the layout.
269    *
270    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
271    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
272    * the value of the property changes.
273    */
274   Glib::PropertyProxy<guint> property_height() ;
275
276 /** The height of the layout.
277    *
278    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
279    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
280    * the value of the property changes.
281    */
282   Glib::PropertyProxy_ReadOnly<guint> property_height() const;
283
284
285 };
286
287 } /* namespace Gtk */
288
289
290 namespace Glib
291 {
292   /** @relates Gtk::Layout
293    * @param object The C instance
294    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
295    * @result A C++ instance that wraps this C instance.
296    */
297   Gtk::Layout* wrap(GtkLayout* object, bool take_copy = false);
298 }
299 #endif /* _GTKMM_LAYOUT_H */
300