1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <giomm/remoteactiongroup.h>
7 #include <giomm/private/remoteactiongroup_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 namespace Gio
27 {
28
29 } // namespace Gio
30
31 namespace
32 {
33 } // anonymous namespace
34
35
36 namespace Glib
37 {
38
wrap(GRemoteActionGroup * object,bool take_copy)39 Glib::RefPtr<Gio::RemoteActionGroup> wrap(GRemoteActionGroup* object, bool take_copy)
40 {
41 return Glib::RefPtr<Gio::RemoteActionGroup>( dynamic_cast<Gio::RemoteActionGroup*> (Glib::wrap_auto_interface<Gio::RemoteActionGroup> ((GObject*)(object), take_copy)) );
42 //We use dynamic_cast<> in case of multiple inheritance.
43 }
44
45 } // namespace Glib
46
47
48 namespace Gio
49 {
50
51
52 /* The *_Class implementation: */
53
init()54 const Glib::Interface_Class& RemoteActionGroup_Class::init()
55 {
56 if(!gtype_) // create the GType if necessary
57 {
58 // Glib::Interface_Class has to know the interface init function
59 // in order to add interfaces to implementing types.
60 class_init_func_ = &RemoteActionGroup_Class::iface_init_function;
61
62 // We can not derive from another interface, and it is not necessary anyway.
63 gtype_ = g_remote_action_group_get_type();
64 }
65
66 return *this;
67 }
68
iface_init_function(void * g_iface,void *)69 void RemoteActionGroup_Class::iface_init_function(void* g_iface, void*)
70 {
71 const auto klass = static_cast<BaseClassType*>(g_iface);
72
73 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
74 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
75 g_assert(klass != nullptr);
76
77 klass->activate_action_full = &activate_action_full_vfunc_callback;
78 klass->change_action_state_full = &change_action_state_full_vfunc_callback;
79
80 }
81
activate_action_full_vfunc_callback(GRemoteActionGroup * self,const gchar * action_name,GVariant * parameter,GVariant * platform_data)82 void RemoteActionGroup_Class::activate_action_full_vfunc_callback(GRemoteActionGroup* self, const gchar* action_name, GVariant* parameter, GVariant* platform_data)
83 {
84 const auto obj_base = static_cast<Glib::ObjectBase*>(
85 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
86
87 // Non-gtkmmproc-generated custom classes implicitly call the default
88 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
89 // generated classes can use this optimisation, which avoids the unnecessary
90 // parameter conversions if there is no possibility of the virtual function
91 // being overridden:
92 if(obj_base && obj_base->is_derived_())
93 {
94 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
95 if(obj) // This can be NULL during destruction.
96 {
97 try // Trap C++ exceptions which would normally be lost because this is a C callback.
98 {
99 // Call the virtual member method, which derived classes might override.
100 obj->activate_action_vfunc(Glib::convert_const_gchar_ptr_to_ustring(action_name)
101 , Glib::wrap(parameter, true)
102 , Glib::wrap(platform_data, true)
103 );
104 return;
105 }
106 catch(...)
107 {
108 Glib::exception_handlers_invoke();
109 }
110 }
111 }
112
113 BaseClassType *const base = static_cast<BaseClassType*>(
114 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
115 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
116 ) );
117
118 // Call the original underlying C function:
119 if(base && base->activate_action_full)
120 (*base->activate_action_full)(self, action_name, parameter, platform_data);
121 }
change_action_state_full_vfunc_callback(GRemoteActionGroup * self,const gchar * action_name,GVariant * value,GVariant * platform_data)122 void RemoteActionGroup_Class::change_action_state_full_vfunc_callback(GRemoteActionGroup* self, const gchar* action_name, GVariant* value, GVariant* platform_data)
123 {
124 const auto obj_base = static_cast<Glib::ObjectBase*>(
125 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
126
127 // Non-gtkmmproc-generated custom classes implicitly call the default
128 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
129 // generated classes can use this optimisation, which avoids the unnecessary
130 // parameter conversions if there is no possibility of the virtual function
131 // being overridden:
132 if(obj_base && obj_base->is_derived_())
133 {
134 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
135 if(obj) // This can be NULL during destruction.
136 {
137 try // Trap C++ exceptions which would normally be lost because this is a C callback.
138 {
139 // Call the virtual member method, which derived classes might override.
140 obj->change_action_state_vfunc(Glib::convert_const_gchar_ptr_to_ustring(action_name)
141 , Glib::wrap(value, true)
142 , Glib::wrap(platform_data, true)
143 );
144 return;
145 }
146 catch(...)
147 {
148 Glib::exception_handlers_invoke();
149 }
150 }
151 }
152
153 BaseClassType *const base = static_cast<BaseClassType*>(
154 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
155 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
156 ) );
157
158 // Call the original underlying C function:
159 if(base && base->change_action_state_full)
160 (*base->change_action_state_full)(self, action_name, value, platform_data);
161 }
162
163
wrap_new(GObject * object)164 Glib::ObjectBase* RemoteActionGroup_Class::wrap_new(GObject* object)
165 {
166 return new RemoteActionGroup((GRemoteActionGroup*)(object));
167 }
168
169
170 /* The implementation: */
171
RemoteActionGroup()172 RemoteActionGroup::RemoteActionGroup()
173 :
174 Glib::Interface(remoteactiongroup_class_.init())
175 {}
176
RemoteActionGroup(GRemoteActionGroup * castitem)177 RemoteActionGroup::RemoteActionGroup(GRemoteActionGroup* castitem)
178 :
179 Glib::Interface((GObject*)(castitem))
180 {}
181
RemoteActionGroup(const Glib::Interface_Class & interface_class)182 RemoteActionGroup::RemoteActionGroup(const Glib::Interface_Class& interface_class)
183 : Glib::Interface(interface_class)
184 {
185 }
186
RemoteActionGroup(RemoteActionGroup && src)187 RemoteActionGroup::RemoteActionGroup(RemoteActionGroup&& src) noexcept
188 : Glib::Interface(std::move(src))
189 {}
190
operator =(RemoteActionGroup && src)191 RemoteActionGroup& RemoteActionGroup::operator=(RemoteActionGroup&& src) noexcept
192 {
193 Glib::Interface::operator=(std::move(src));
194 return *this;
195 }
196
~RemoteActionGroup()197 RemoteActionGroup::~RemoteActionGroup() noexcept
198 {}
199
200 // static
add_interface(GType gtype_implementer)201 void RemoteActionGroup::add_interface(GType gtype_implementer)
202 {
203 remoteactiongroup_class_.init().add_interface(gtype_implementer);
204 }
205
206 RemoteActionGroup::CppClassType RemoteActionGroup::remoteactiongroup_class_; // initialize static member
207
get_type()208 GType RemoteActionGroup::get_type()
209 {
210 return remoteactiongroup_class_.init().get_type();
211 }
212
213
get_base_type()214 GType RemoteActionGroup::get_base_type()
215 {
216 return g_remote_action_group_get_type();
217 }
218
219
activate_action(const Glib::ustring & action_name,const Glib::VariantBase & parameter,const Glib::VariantBase & platform_data)220 void RemoteActionGroup::activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data)
221 {
222 g_remote_action_group_activate_action_full(gobj(), action_name.c_str(), const_cast<GVariant*>((parameter).gobj()), const_cast<GVariant*>((platform_data).gobj()));
223 }
224
change_action_state(const Glib::ustring & action_name,const Glib::VariantBase & value,const Glib::VariantBase & platform_data)225 void RemoteActionGroup::change_action_state(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data)
226 {
227 g_remote_action_group_change_action_state_full(gobj(), action_name.c_str(), const_cast<GVariant*>((value).gobj()), const_cast<GVariant*>((platform_data).gobj()));
228 }
229
230
activate_action_vfunc(const Glib::ustring & action_name,const Glib::VariantBase & parameter,const Glib::VariantBase & platform_data)231 void Gio::RemoteActionGroup::activate_action_vfunc(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data)
232 {
233 const auto base = static_cast<BaseClassType*>(
234 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
235 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
236 ) );
237
238 if(base && base->activate_action_full)
239 {
240 (*base->activate_action_full)(gobj(),action_name.c_str(),const_cast<GVariant*>((parameter).gobj()),const_cast<GVariant*>((platform_data).gobj()));
241 }
242 }
change_action_state_vfunc(const Glib::ustring & action_name,const Glib::VariantBase & value,const Glib::VariantBase & platform_data)243 void Gio::RemoteActionGroup::change_action_state_vfunc(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data)
244 {
245 const auto base = static_cast<BaseClassType*>(
246 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
247 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
248 ) );
249
250 if(base && base->change_action_state_full)
251 {
252 (*base->change_action_state_full)(gobj(),action_name.c_str(),const_cast<GVariant*>((value).gobj()),const_cast<GVariant*>((platform_data).gobj()));
253 }
254 }
255
256
257 } // namespace Gio
258
259
260