Debian Codegraph @

gtk/src/action.ccg

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 <glibmm/vectorutils.h>
18
19 #include <gtk/gtk.h>
20
21 #include <gtkmm/menu.h>
22 #include <gtkmm/menuitem.h>
23 #include <gtkmm/toolitem.h>
24 #include <gtkmm/image.h>
25 #include <gtkmm/widget.h>
26
27 typedef Gtk::Action Action;
28
29 namespace Gtk
30 {
31
32 _DEPRECATE_IFDEF_START
33 Action::Action(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip)
34 :
35 _CONSTRUCT("name", name.c_str(), "stock_id", stock_id.get_c_str(), "label", (label.empty() ? nullptr : label.c_str()), "tooltip", (tooltip.empty() ? nullptr : tooltip.c_str()))
36 {}
37
38 Action::Action(const Glib::ustring& name, const Glib::ustring& icon_name, const Glib::ustring& label, const Glib::ustring& tooltip)
39 :
40 _CONSTRUCT("name", name.c_str(), "icon_name", icon_name.c_str(), "label", (label.empty() ? nullptr : label.c_str()), "tooltip", (tooltip.empty() ? nullptr : tooltip.c_str()))
41 {}
42 _DEPRECATE_IFDEF_END
43
44 _DEPRECATE_IFDEF_START
45 Glib::RefPtr<Action> Action::create(const Glib::ustring& name, const Glib::ustring& label, const Glib::ustring& tooltip)
46 {
47 return Glib::RefPtr<Action>( new Action(name, Gtk::StockID(), label, tooltip) );
48 }
49
50 Glib::RefPtr<Action> Action::create(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip)
51 {
52 return Glib::RefPtr<Action>( new Action(name, stock_id, label, tooltip) );
53 }
54
55 Glib::RefPtr<Action> Action::create_with_icon_name(const Glib::ustring& name, const Glib::ustring& icon_name, const Glib::ustring& label, const Glib::ustring& tooltip)
56 {
57 return Glib::RefPtr<Action>( new Action(name, icon_name, label, tooltip) );
58 }
59 _DEPRECATE_IFDEF_END
60
61 } // namespace Gtk