Debian Codegraph @

gtk/src/misc.hg

raw
1 /* Copyright (C) 1998-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/widget.h>
18 _DEFS(gtkmm,gtk)
19 _PINCLUDE(gtkmm/private/widget_p.h)
20
21 #m4 _PUSH(SECTION_CC_PRE_INCLUDES)
22 #undef GTK_DISABLE_DEPRECATED
23 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
24 #m4 _POP()
25
26 //TODO: Do this when we can stop using this as a base class elsewhere, when we break ABI:
27 //_IS_DEPRECATED // This whole file is deprecated.
28
29 namespace Gtk
30 {
31
32 /** A base class for widgets with alignments and padding.
33 *
34 * This is an abstract for a set of utility widgets
35 * that lack a physical window. They do have
36 * alignment and padding within their defined space.
37 *
38 * Without a window, widgets of this type cannot capture events.
39 * To capture events place in Gtk::EventBox.
40 *
41 * @deprecated The desired effect can in most cases be achieved by using the
42 * Gtk::Widget::property_halign(), Gtk::Widget::property_valign() and
43 * Gtk::Widget::property_margin() properties on the child widget.
44 * Gtk::Misc should not be used in new code.
45 */
46 class GTKMM_API Misc : public Widget
47 {
48 _CLASS_GTKOBJECT(Misc,GtkMisc,GTK_MISC,Gtk::Widget,GtkWidget,,,GTKMM_API)
49 protected:
50 _CTOR_DEFAULT
51 public:
52
53 _WRAP_METHOD(void set_alignment(float xalign = 0.0, float yalign = 0.5), gtk_misc_set_alignment, deprecated "Use Widget::set_halign() and Widget::set_valign() instead.")
54 _WRAP_METHOD(void set_alignment(Align xalign = Gtk::ALIGN_START, Align yalign = Gtk::ALIGN_CENTER), gtk_misc_set_alignment, deprecated "Use Widget::set_halign() and Widget::set_valign() instead.")
55
56 _WRAP_METHOD(void get_alignment(float& xalign, float& yalign) const, gtk_misc_get_alignment, deprecated "Use Widget::get_halign() and Widget::get_valign() instead.")
57
58 _WRAP_METHOD(void set_padding(int xpad, int ypad), gtk_misc_set_padding, deprecated "Use Widget::set_margin_start(), Widget::set_margin_end(), Widget::set_margin_top(), Widget::set_margin_bottom() instead.")
59 _WRAP_METHOD(void get_padding(int& xpad, int& ypad) const, gtk_misc_get_padding, deprecated "Use Widget::get_margin_start(), Widget::get_margin_end(), Widget::get_margin_top(), Widget::get_margin_bottom() instead.")
60
61 _WRAP_PROPERTY("xalign", float, deprecated "Use Widget::property_halign() instead.")
62 _WRAP_PROPERTY("yalign", float, deprecated "Use Widget::property_valign() instead.")
63 _WRAP_PROPERTY("xpad", int, deprecated "Use Widget::property_margin_start(), Widget::property_margin_end(), Widget::property_margin() instead.")
64 _WRAP_PROPERTY("ypad", int, deprecated "Use Widget::property_margin_top(), Widget::property_margin_bottom(), Widget::property_margin() instead.")
65 };
66
67 } //namespace Gtk