Debian Codegraph @

gtk/src/layout.hg

raw
1 /* Copyright (C) 2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include <gtkmm/container.h>
18 #include <gtkmm/scrollable.h>
19 #include <gdkmm/window.h>
20
21 _DEFS(gtkmm,gtk)
22 _PINCLUDE(gtkmm/private/container_p.h)
23
24
25 namespace Gtk
26 {
27
28 /** Infinite scrollable area containing child widgets and/or custom drawing.
29 *
30 * Gtk::Layout is similar to Gtk::DrawingArea in that it's a "blank slate"
31 * and doesn't do anything but paint a blank background by default. It's
32 * different in that it supports scrolling natively (You can add it directly
33 * to a Gtk::ScrolledWindow), and it can contain child widgets, since it's a
34 * Gtk::Container. However if you're just going to draw, a Gtk::DrawingArea
35 * is a better choice since it has lower overhead.
36 *
37 * @ingroup Widgets
38 * @ingroup Containers
39 */
40 class GTKMM_API Layout
41 : public Container,
42 public Scrollable
43 {
44 _CLASS_GTKOBJECT(Layout,GtkLayout,GTK_LAYOUT,Gtk::Container,GtkContainer,,,GTKMM_API)
45 _IMPLEMENTS_INTERFACE(Scrollable)
46 public:
47 _CTOR_DEFAULT
48 _WRAP_CTOR(Layout(const Glib::RefPtr<Adjustment>& hadjustment, const Glib::RefPtr<Adjustment>& vadjustment), gtk_layout_new)
49
50 _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_bin_window(), gtk_layout_get_bin_window, refreturn)
51 _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_bin_window() const, gtk_layout_get_bin_window, refreturn, constversion)
52
53 _WRAP_METHOD(void put(Widget& child_widget, int x, int y), gtk_layout_put)
54 _WRAP_METHOD(void move(Widget& child_widget, int x, int y), gtk_layout_move)
55 _WRAP_METHOD(void set_size(guint width, guint height), gtk_layout_set_size)
56 _WRAP_METHOD(void get_size(guint& width, guint& height) const, gtk_layout_get_size)
57
58 _IGNORE(gtk_layout_get_hadjustment, gtk_layout_set_hadjustment,
59 gtk_layout_get_vadjustment, gtk_layout_set_vadjustment) //deprecated
60
61 _WRAP_PROPERTY("width", guint)
62 _WRAP_PROPERTY("height", guint)
63
64 _WRAP_CHILD_PROPERTY("x", int)
65 _WRAP_CHILD_PROPERTY("y", int)
66 };
67
68 } //namespace Gtk