2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_LAYOUT_H
4 #define _GTKMM_LAYOUT_H
12 * Copyright (C) 2002 The gtkmm Development Team
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.
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.
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.
29 #include <gtkmm/container.h>
30 #include <gtkmm/adjustment.h>
31 #include <gdkmm/window.h>
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkLayout GtkLayout;
36 typedef struct _GtkLayoutClass GtkLayoutClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41 { class Layout_Class; } // namespace Gtk
45 /** Infinite scrollable area containing child widgets and/or custom drawing.
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.
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.
62 class Layout : public Container
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 */
74 #ifndef DOXYGEN_SHOULD_SKIP_THIS
77 friend class Layout_Class;
78 static CppClassType layout_class_;
81 Layout(const Layout&);
82 Layout& operator=(const Layout&);
85 explicit Layout(const Glib::ConstructParams& construct_params);
86 explicit Layout(GtkLayout* castitem);
88 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
92 static GType get_type() G_GNUC_CONST;
93 static GType get_base_type() G_GNUC_CONST;
96 ///Provides access to the underlying C GtkObject.
97 GtkLayout* gobj() { return reinterpret_cast<GtkLayout*>(gobject_); }
99 ///Provides access to the underlying C GtkObject.
100 const GtkLayout* gobj() const { return reinterpret_cast<GtkLayout*>(gobject_); }
104 //C++ methods used to invoke GTK+ virtual functions:
107 //GTK+ Virtual Functions (override these to change behaviour):
109 //Default Signal Handlers::
110 virtual void on_set_scroll_adjustments(Adjustment* hadj, Adjustment* vadj);
118 Layout(Adjustment& hadjustment, Adjustment& vadjustment);
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.
127 void put(Widget& child_widget, int x, int y);
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.
134 void move(Widget& child_widget, int x, int y);
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.
140 void set_size(guint width, guint height);
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
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>.
148 void get_size(guint& width, guint& height) const;
151 /** Sets the horizontal scroll adjustment for the layout.
153 * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
154 * @param adjustment New scroll adjustment.
156 void set_hadjustment(Adjustment& adjustment);
158 /// Creates the Adjustment.
159 void set_hadjustment();
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 .
166 * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
167 * @return Horizontal scroll adjustment.
169 Adjustment* get_hadjustment();
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 .
176 * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
177 * @return Horizontal scroll adjustment.
179 const Adjustment* get_hadjustment() const;
181 /** Sets the vertical scroll adjustment for the layout.
183 * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
184 * @param adjustment New scroll adjustment.
186 void set_vadjustment(Adjustment& adjustment);
188 /// Creates the Adjustment.
189 void set_vadjustment();
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 .
196 * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
197 * @return Vertical scroll adjustment.
199 Adjustment* get_vadjustment();
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 .
206 * See Gtk::ScrolledWindow, Gtk::Scrollbar, Gtk::Adjustment for details.
207 * @return Vertical scroll adjustment.
209 const Adjustment* get_vadjustment() const;
211 Glib::RefPtr<Gdk::Window> get_bin_window();
212 Glib::RefPtr<const Gdk::Window> get_bin_window() const;
214 // See Gtk::Widget::set_scroll_adjustments()
217 Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments();
220 /** The GtkAdjustment for the horizontal position.
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.
226 Glib::PropertyProxy<Adjustment*> property_hadjustment() ;
228 /** The GtkAdjustment for the horizontal position.
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.
234 Glib::PropertyProxy_ReadOnly<Adjustment*> property_hadjustment() const;
236 /** The GtkAdjustment for the vertical position.
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.
242 Glib::PropertyProxy<Adjustment*> property_vadjustment() ;
244 /** The GtkAdjustment for the vertical position.
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.
250 Glib::PropertyProxy_ReadOnly<Adjustment*> property_vadjustment() const;
252 /** The width of the layout.
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.
258 Glib::PropertyProxy<guint> property_width() ;
260 /** The width of the layout.
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.
266 Glib::PropertyProxy_ReadOnly<guint> property_width() const;
268 /** The height of the layout.
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.
274 Glib::PropertyProxy<guint> property_height() ;
276 /** The height of the layout.
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.
282 Glib::PropertyProxy_ReadOnly<guint> property_height() const;
287 } /* namespace Gtk */
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.
297 Gtk::Layout* wrap(GtkLayout* object, bool take_copy = false);
299 #endif /* _GTKMM_LAYOUT_H */