/* Copyright (C) 2014 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see . */ #include _DEFS(gtkmm,gtk) _PINCLUDE(gtkmm/private/bin_p.h) namespace Gtk { /** A container which overlays widgets on top of each other. * * Gtk::Overlay is a container which contains a single main child, on top * of which it can place “overlay” widgets. The * position of each overlay widget is determined by its Gtk::Widget:halign * and Gtk::Widget:valign properties. E.g. a widget with both alignments * set to Gtk::ALIGN_START will be placed at the top left corner of the * main widget, whereas an overlay with halign set to Gtk::ALIGN_CENTER * and valign set to Gtk::ALIGN_END will be placed a the bottom edge of * the main widget, horizontally centered. The position can be adjusted * by setting the margin properties of the child to non-zero values. * * More complicated placement of overlays is possible by connecting * to the Gtk::Overlay::get-child-position signal. * * The Gtk::Overlay implementation of the Gtk::Buildable interface * supports placing a child as an overlay by specifying “overlay” as * the “type” attribute of a `` element. * * @ingroup Containers * @newin{3,14} */ class GTKMM_API Overlay : public Bin { _CLASS_GTKOBJECT(Overlay, GtkOverlay, GTK_OVERLAY, Gtk::Bin, GtkBin, , , GTKMM_API) public: /** Creates a new Overlay. */ _CTOR_DEFAULT _WRAP_METHOD(void add_overlay(Gtk::Widget& widget), gtk_overlay_add_overlay) _WRAP_METHOD(void reorder_overlay(Widget& child, int position), gtk_overlay_reorder_overlay) _WRAP_METHOD(bool get_overlay_pass_through(Widget& widget) const, gtk_overlay_get_overlay_pass_through) _WRAP_METHOD(void set_overlay_pass_through(Widget& widget, bool pass_through = true), gtk_overlay_set_overlay_pass_through) #m4 _CONVERSION(`GdkRectangle*',`Gdk::Rectangle&',`Glib::wrap($3)') _WRAP_SIGNAL(bool get_child_position(Gtk::Widget* widget, Gdk::Rectangle& allocation), "get-child-position") _WRAP_CHILD_PROPERTY("pass-through", bool) _WRAP_CHILD_PROPERTY("index", int) }; } // namespace Gtk