Debian Codegraph @

gtk/src/fontbutton.hg

raw
1 /* Copyright (C) 2003 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/button.h>
18 //TODO: When we can break ABI: #include <gtkmm/fontchooser.h>
19
20 _DEFS(gtkmm,gtk)
21 _PINCLUDE(gtkmm/private/button_p.h)
22
23 #m4 _PUSH(SECTION_CC_PRE_INCLUDES)
24 #undef GTK_DISABLE_DEPRECATED
25 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
26 #m4 _POP()
27 // gtk_font_button_set/get_font_name() and property font-name are deprecated
28 // in gtk+ 3.22 in favor of gtk_font_chooser_set/get_font() and
29 // GtkFontChooser:font. They can't be deprecated here because FontChooser
30 // is not a base cvlass.
31
32 namespace Gtk
33 {
34
35 /** A button to launch a font selection dialog.
36 *
37 * The Gtk::FontButton is a button which displays the currently selected font and
38 * allows to open a font selection dialog to change the font. It is suitable widget
39 * for selecting a font in a preference dialog.
40 *
41 * The FontButton widget looks like this:
42 * @image html fontbutton1.png
43 *
44 * @ingroup Widgets
45 */
46 class GTKMM_API FontButton
47 : public Button
48 //TODO: When we can break ABI: public FontChooser
49 {
50 _CLASS_GTKOBJECT(FontButton, GtkFontButton, GTK_FONT_BUTTON, Gtk::Button, GtkButton, , , GTKMM_API)
51 //TODO: When we can break ABI: _IMPLEMENTS_INTERFACE(FontChooser)
52 public:
53 _CTOR_DEFAULT()
54 _WRAP_CTOR(FontButton(const Glib::ustring& font_name), gtk_font_button_new_with_font)
55
56 _WRAP_METHOD(Glib::ustring get_title() const, gtk_font_button_get_title)
57 _WRAP_METHOD(void set_title(const Glib::ustring& title), gtk_font_button_set_title)
58 _WRAP_METHOD(bool get_use_font() const, gtk_font_button_get_use_font)
59 _WRAP_METHOD(void set_use_font(bool use_font = true), gtk_font_button_set_use_font)
60 _WRAP_METHOD(bool get_use_size() const, gtk_font_button_get_use_size)
61 _WRAP_METHOD(void set_use_size(bool use_size = true), gtk_font_button_set_use_size)
62 _WRAP_METHOD(Glib::ustring get_font_name() const, gtk_font_button_get_font_name)
63 _WRAP_METHOD(bool set_font_name(const Glib::ustring& fontname), gtk_font_button_set_font_name)
64 _WRAP_METHOD(bool get_show_style() const, gtk_font_button_get_show_style)
65 _WRAP_METHOD(void set_show_style(bool show_style = true), gtk_font_button_set_show_style)
66 _WRAP_METHOD(bool get_show_size() const, gtk_font_button_get_show_size)
67 _WRAP_METHOD(void set_show_size(bool show_size = true), gtk_font_button_set_show_size)
68
69 _WRAP_PROPERTY("title", Glib::ustring)
70 _WRAP_PROPERTY("font-name", Glib::ustring)
71 _WRAP_PROPERTY("use-font", bool)
72 _WRAP_PROPERTY("use-size", bool)
73 _WRAP_PROPERTY("show-style", bool)
74 _WRAP_PROPERTY("show-size", bool)
75
76 _WRAP_SIGNAL(void font_set(), "font-set")
77 };
78
79 } // namespace Gtk