1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <giomm/menu.h>
7 #include <giomm/private/menu_p.h>
8 
9 
10 /* Copyright (C) 2012 The giomm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #include <gio/gio.h>
27 
28 namespace Gio
29 {
30 
31 } // namespace Gio
32 
33 namespace
34 {
35 } // anonymous namespace
36 
37 
38 namespace Glib
39 {
40 
wrap(GMenu * object,bool take_copy)41 Glib::RefPtr<Gio::Menu> wrap(GMenu* object, bool take_copy)
42 {
43   return Glib::RefPtr<Gio::Menu>( dynamic_cast<Gio::Menu*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
44   //We use dynamic_cast<> in case of multiple inheritance.
45 }
46 
47 } /* namespace Glib */
48 
49 
50 namespace Gio
51 {
52 
53 
54 /* The *_Class implementation: */
55 
init()56 const Glib::Class& Menu_Class::init()
57 {
58   if(!gtype_) // create the GType if necessary
59   {
60     // Glib::Class has to know the class init function to clone custom types.
61     class_init_func_ = &Menu_Class::class_init_function;
62 
63     // This is actually just optimized away, apparently with no harm.
64     // Make sure that the parent type has been created.
65     //CppClassParent::CppObjectType::get_type();
66 
67     // Create the wrapper type, with the same class/instance size as the base type.
68     register_derived_type(g_menu_get_type());
69 
70     // Add derived versions of interfaces, if the C type implements any interfaces:
71 
72   }
73 
74   return *this;
75 }
76 
77 
class_init_function(void * g_class,void * class_data)78 void Menu_Class::class_init_function(void* g_class, void* class_data)
79 {
80   const auto klass = static_cast<BaseClassType*>(g_class);
81   CppClassParent::class_init_function(klass, class_data);
82 
83 
84 }
85 
86 
wrap_new(GObject * object)87 Glib::ObjectBase* Menu_Class::wrap_new(GObject* object)
88 {
89   return new Menu((GMenu*)object);
90 }
91 
92 
93 /* The implementation: */
94 
gobj_copy()95 GMenu* Menu::gobj_copy()
96 {
97   reference();
98   return gobj();
99 }
100 
Menu(const Glib::ConstructParams & construct_params)101 Menu::Menu(const Glib::ConstructParams& construct_params)
102 :
103   ::Gio::MenuModel(construct_params)
104 {
105 
106 }
107 
Menu(GMenu * castitem)108 Menu::Menu(GMenu* castitem)
109 :
110   ::Gio::MenuModel((GMenuModel*)(castitem))
111 {}
112 
113 
Menu(Menu && src)114 Menu::Menu(Menu&& src) noexcept
115 : ::Gio::MenuModel(std::move(src))
116 {}
117 
operator =(Menu && src)118 Menu& Menu::operator=(Menu&& src) noexcept
119 {
120   ::Gio::MenuModel::operator=(std::move(src));
121   return *this;
122 }
123 
124 
~Menu()125 Menu::~Menu() noexcept
126 {}
127 
128 
129 Menu::CppClassType Menu::menu_class_; // initialize static member
130 
get_type()131 GType Menu::get_type()
132 {
133   return menu_class_.init().get_type();
134 }
135 
136 
get_base_type()137 GType Menu::get_base_type()
138 {
139   return g_menu_get_type();
140 }
141 
142 
Menu()143 Menu::Menu()
144 :
145   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
146   Glib::ObjectBase(nullptr),
147   ::Gio::MenuModel(Glib::ConstructParams(menu_class_.init()))
148 {
149 
150 
151 }
152 
create()153 Glib::RefPtr<Menu> Menu::create()
154 {
155   return Glib::RefPtr<Menu>( new Menu() );
156 }
157 
freeze()158 void Menu::freeze()
159 {
160   g_menu_freeze(gobj());
161 }
162 
insert_item(int position,const Glib::RefPtr<MenuItem> & item)163 void Menu::insert_item(int position, const Glib::RefPtr<MenuItem>& item)
164 {
165   g_menu_insert_item(gobj(), position, const_cast<GMenuItem*>(Glib::unwrap(item)));
166 }
167 
prepend_item(const Glib::RefPtr<MenuItem> & item)168 void Menu::prepend_item(const Glib::RefPtr<MenuItem>& item)
169 {
170   g_menu_prepend_item(gobj(), const_cast<GMenuItem*>(Glib::unwrap(item)));
171 }
172 
append_item(const Glib::RefPtr<MenuItem> & item)173 void Menu::append_item(const Glib::RefPtr<MenuItem>& item)
174 {
175   g_menu_append_item(gobj(), const_cast<GMenuItem*>(Glib::unwrap(item)));
176 }
177 
remove(int position)178 void Menu::remove(int position)
179 {
180   g_menu_remove(gobj(), position);
181 }
182 
remove_all()183 void Menu::remove_all()
184 {
185   g_menu_remove_all(gobj());
186 }
187 
insert(int position,const Glib::ustring & label,const Glib::ustring & detailed_action)188 void Menu::insert(int position, const Glib::ustring& label, const Glib::ustring& detailed_action)
189 {
190   g_menu_insert(gobj(), position, label.c_str(), detailed_action.empty() ? nullptr : detailed_action.c_str());
191 }
192 
insert(int position,const Glib::ustring & label)193 void Menu::insert(int position, const Glib::ustring& label)
194 {
195   g_menu_insert(gobj(), position, label.c_str(), nullptr);
196 }
197 
prepend(const Glib::ustring & label,const Glib::ustring & detailed_action)198 void Menu::prepend(const Glib::ustring& label, const Glib::ustring& detailed_action)
199 {
200   g_menu_prepend(gobj(), label.c_str(), detailed_action.empty() ? nullptr : detailed_action.c_str());
201 }
202 
prepend(const Glib::ustring & label)203 void Menu::prepend(const Glib::ustring& label)
204 {
205   g_menu_prepend(gobj(), label.c_str(), nullptr);
206 }
207 
append(const Glib::ustring & label,const Glib::ustring & detailed_action)208 void Menu::append(const Glib::ustring& label, const Glib::ustring& detailed_action)
209 {
210   g_menu_append(gobj(), label.c_str(), detailed_action.empty() ? nullptr : detailed_action.c_str());
211 }
212 
append(const Glib::ustring & label)213 void Menu::append(const Glib::ustring& label)
214 {
215   g_menu_append(gobj(), label.c_str(), nullptr);
216 }
217 
insert_section(int position,const Glib::ustring & label,const Glib::RefPtr<MenuModel> & section)218 void Menu::insert_section(int position, const Glib::ustring& label, const Glib::RefPtr<MenuModel>& section)
219 {
220   g_menu_insert_section(gobj(), position, label.empty() ? nullptr : label.c_str(), const_cast<GMenuModel*>(Glib::unwrap(section)));
221 }
222 
insert_section(int position,const Glib::RefPtr<MenuModel> & section)223 void Menu::insert_section(int position, const Glib::RefPtr<MenuModel>& section)
224 {
225   g_menu_insert_section(gobj(), position, nullptr, const_cast<GMenuModel*>(Glib::unwrap(section)));
226 }
227 
prepend_section(const Glib::ustring & label,const Glib::RefPtr<MenuModel> & section)228 void Menu::prepend_section(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& section)
229 {
230   g_menu_prepend_section(gobj(), label.empty() ? nullptr : label.c_str(), const_cast<GMenuModel*>(Glib::unwrap(section)));
231 }
232 
prepend_section(const Glib::RefPtr<MenuModel> & section)233 void Menu::prepend_section(const Glib::RefPtr<MenuModel>& section)
234 {
235   g_menu_prepend_section(gobj(), nullptr, const_cast<GMenuModel*>(Glib::unwrap(section)));
236 }
237 
append_section(const Glib::ustring & label,const Glib::RefPtr<MenuModel> & section)238 void Menu::append_section(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& section)
239 {
240   g_menu_append_section(gobj(), label.empty() ? nullptr : label.c_str(), const_cast<GMenuModel*>(Glib::unwrap(section)));
241 }
242 
append_section(const Glib::RefPtr<MenuModel> & section)243 void Menu::append_section(const Glib::RefPtr<MenuModel>& section)
244 {
245   g_menu_append_section(gobj(), nullptr, const_cast<GMenuModel*>(Glib::unwrap(section)));
246 }
247 
insert_submenu(int position,const Glib::ustring & label,const Glib::RefPtr<MenuModel> & submenu)248 void Menu::insert_submenu(int position, const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu)
249 {
250   g_menu_insert_submenu(gobj(), position, label.c_str(), const_cast<GMenuModel*>(Glib::unwrap(submenu)));
251 }
252 
prepend_submenu(const Glib::ustring & label,const Glib::RefPtr<MenuModel> & submenu)253 void Menu::prepend_submenu(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu)
254 {
255   g_menu_prepend_submenu(gobj(), label.c_str(), const_cast<GMenuModel*>(Glib::unwrap(submenu)));
256 }
257 
append_submenu(const Glib::ustring & label,const Glib::RefPtr<MenuModel> & submenu)258 void Menu::append_submenu(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu)
259 {
260   g_menu_append_submenu(gobj(), label.c_str(), const_cast<GMenuModel*>(Glib::unwrap(submenu)));
261 }
262 
263 
264 } // namespace Gio
265 
266 
267