Debian Codegraph @

gtk/src/toolbar.ccg

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 <glib.h>
18 #include <gtkmm/button.h>
19 #include <gtkmm/togglebutton.h>
20 #include <gtkmm/radiobutton.h>
21 //#include <gtkmm/image.h>
22 #include <gtkmm/label.h>
23 #include <gtk/gtk.h>
24
25 namespace Gtk
26 {
27
28 void Toolbar::insert(ToolButton& item, int pos, const sigc::slot<void>& clicked_slot)
29 {
30 item.signal_clicked().connect(clicked_slot);
31 gtk_toolbar_insert(gobj(), (GtkToolItem*)((item).gobj()), pos);
32 }
33
34 void Toolbar::insert(ToggleToolButton& item, int pos, const sigc::slot<void>& toggled_slot)
35 {
36 item.signal_toggled().connect(toggled_slot);
37 gtk_toolbar_insert(gobj(), (GtkToolItem*)((item).gobj()), pos);
38 }
39
40 void Toolbar::append(ToolItem& item)
41 {
42 gtk_toolbar_insert(gobj(), (item).gobj(), -1 /* See GTK+ docs */);
43 }
44
45 void Toolbar::append(ToolButton& item, const sigc::slot<void>& clicked_slot)
46 {
47 item.signal_clicked().connect(clicked_slot);
48 gtk_toolbar_insert(gobj(), (GtkToolItem*)((item).gobj()), -1 /* See GTK+ docs */);
49 }
50
51 void Toolbar::append(ToggleToolButton& item, const sigc::slot<void>& toggled_slot)
52 {
53 item.signal_toggled().connect(toggled_slot);
54 gtk_toolbar_insert(gobj(), (GtkToolItem*)((item).gobj()), -1 /* See GTK+ docs */);
55 }
56
57 void Toolbar::prepend(ToolItem& item)
58 {
59 gtk_toolbar_insert(gobj(), (item).gobj(), 0 /* See GTK+ docs */);
60 }
61
62 void Toolbar::prepend(ToolButton& item, const sigc::slot<void>& clicked_slot)
63 {
64 item.signal_clicked().connect(clicked_slot);
65 gtk_toolbar_insert(gobj(), (GtkToolItem*)((item).gobj()), 0 /* See GTK+ docs */);
66 }
67
68 void Toolbar::prepend(ToggleToolButton& item, const sigc::slot<void>& toggled_slot)
69 {
70 item.signal_toggled().connect(toggled_slot);
71 gtk_toolbar_insert(gobj(), (GtkToolItem*)((item).gobj()), 0 /* See GTK+ docs */);
72 }
73
74 void Toolbar::unset_drop_highlight_item()
75 {
76 //See GTK+ docs.
77 gtk_toolbar_set_drop_highlight_item(gobj(), nullptr, 0);
78 }
79
80 } // namespace Gtk