1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <gtkmm/assistant.h>
7 #include <gtkmm/private/assistant_p.h>
8 
9 
10 /*
11  * Copyright 2006 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public
15  * License as published by the Free Software Foundation; either
16  * version 2.1 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public
24  * License along with this library; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26  */
27 
28 #include <gtk/gtk.h>
29 
30 
SignalProxy_SlotForwardPage_gtk_callback(gint current_page,gpointer data)31 static gint SignalProxy_SlotForwardPage_gtk_callback(gint current_page, gpointer data)
32 {
33   auto the_slot = static_cast<Gtk::Assistant::SlotForwardPage*>(data);
34 
35   try
36   {
37     return (*the_slot)(current_page);
38   }
39   catch(...)
40   {
41     Glib::exception_handlers_invoke();
42     return gint();
43   }
44 }
45 
SignalProxy_SlotForwardPage_gtk_callback_destroy(void * data)46 static void SignalProxy_SlotForwardPage_gtk_callback_destroy(void* data)
47 {
48   delete static_cast<Gtk::Assistant::SlotForwardPage*>(data);
49 }
50 
51 
52 namespace Gtk
53 {
54 
set_forward_page_func(const SlotForwardPage & slot)55 void Assistant::set_forward_page_func(const SlotForwardPage& slot)
56 {
57   // Create a copy of the slot object. A pointer to this will be passed
58   // through the callback's data parameter.  It will be deleted
59   // when SignalProxy_SlotForwardPage_gtk_callback_destroy() is called.
60   auto slot_copy = new SlotForwardPage(slot);
61 
62   gtk_assistant_set_forward_page_func(gobj(),
63       &SignalProxy_SlotForwardPage_gtk_callback, slot_copy,
64       &SignalProxy_SlotForwardPage_gtk_callback_destroy);
65 }
66 
67 
68 } // namespace Gtk
69 
70 
71 namespace
72 {
73 
74 
Assistant_signal_prepare_callback(GtkAssistant * self,GtkWidget * p0,void * data)75 static void Assistant_signal_prepare_callback(GtkAssistant* self, GtkWidget* p0,void* data)
76 {
77   using namespace Gtk;
78   using SlotType = sigc::slot< void,Gtk::Widget* >;
79 
80   auto obj = dynamic_cast<Assistant*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
81   // Do not try to call a signal on a disassociated wrapper.
82   if(obj)
83   {
84     try
85     {
86       if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
87         (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
88 );
89     }
90     catch(...)
91     {
92        Glib::exception_handlers_invoke();
93     }
94   }
95 }
96 
97 static const Glib::SignalProxyInfo Assistant_signal_prepare_info =
98 {
99   "prepare",
100   (GCallback) &Assistant_signal_prepare_callback,
101   (GCallback) &Assistant_signal_prepare_callback
102 };
103 
104 
105 static const Glib::SignalProxyInfo Assistant_signal_apply_info =
106 {
107   "apply",
108   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
109   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
110 };
111 
112 
113 static const Glib::SignalProxyInfo Assistant_signal_close_info =
114 {
115   "close",
116   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
117   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
118 };
119 
120 
121 static const Glib::SignalProxyInfo Assistant_signal_cancel_info =
122 {
123   "cancel",
124   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
125   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
126 };
127 
128 
129 } // anonymous namespace
130 
131 // static
value_type()132 GType Glib::Value<Gtk::AssistantPageType>::value_type()
133 {
134   return gtk_assistant_page_type_get_type();
135 }
136 
137 
138 namespace Glib
139 {
140 
wrap(GtkAssistant * object,bool take_copy)141 Gtk::Assistant* wrap(GtkAssistant* object, bool take_copy)
142 {
143   return dynamic_cast<Gtk::Assistant *> (Glib::wrap_auto ((GObject*)(object), take_copy));
144 }
145 
146 } /* namespace Glib */
147 
148 namespace Gtk
149 {
150 
151 
152 /* The *_Class implementation: */
153 
init()154 const Glib::Class& Assistant_Class::init()
155 {
156   if(!gtype_) // create the GType if necessary
157   {
158     // Glib::Class has to know the class init function to clone custom types.
159     class_init_func_ = &Assistant_Class::class_init_function;
160 
161     // This is actually just optimized away, apparently with no harm.
162     // Make sure that the parent type has been created.
163     //CppClassParent::CppObjectType::get_type();
164 
165     // Create the wrapper type, with the same class/instance size as the base type.
166     register_derived_type(gtk_assistant_get_type());
167 
168     // Add derived versions of interfaces, if the C type implements any interfaces:
169 
170   }
171 
172   return *this;
173 }
174 
175 
class_init_function(void * g_class,void * class_data)176 void Assistant_Class::class_init_function(void* g_class, void* class_data)
177 {
178   const auto klass = static_cast<BaseClassType*>(g_class);
179   CppClassParent::class_init_function(klass, class_data);
180 
181 
182   klass->prepare = &prepare_callback;
183   klass->apply = &apply_callback;
184   klass->close = &close_callback;
185   klass->cancel = &cancel_callback;
186 }
187 
188 
prepare_callback(GtkAssistant * self,GtkWidget * p0)189 void Assistant_Class::prepare_callback(GtkAssistant* self, GtkWidget* p0)
190 {
191   const auto obj_base = static_cast<Glib::ObjectBase*>(
192       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
193 
194   // Non-gtkmmproc-generated custom classes implicitly call the default
195   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
196   // generated classes can use this optimisation, which avoids the unnecessary
197   // parameter conversions if there is no possibility of the virtual function
198   // being overridden:
199   if(obj_base && obj_base->is_derived_())
200   {
201     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
202     if(obj) // This can be NULL during destruction.
203     {
204       try // Trap C++ exceptions which would normally be lost because this is a C callback.
205       {
206         // Call the virtual member method, which derived classes might override.
207         obj->on_prepare(Glib::wrap(p0)
208 );
209         return;
210       }
211       catch(...)
212       {
213         Glib::exception_handlers_invoke();
214       }
215     }
216   }
217 
218   const auto base = static_cast<BaseClassType*>(
219         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
220     );
221 
222   // Call the original underlying C function:
223   if(base && base->prepare)
224     (*base->prepare)(self, p0);
225 }
apply_callback(GtkAssistant * self)226 void Assistant_Class::apply_callback(GtkAssistant* self)
227 {
228   const auto obj_base = static_cast<Glib::ObjectBase*>(
229       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
230 
231   // Non-gtkmmproc-generated custom classes implicitly call the default
232   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
233   // generated classes can use this optimisation, which avoids the unnecessary
234   // parameter conversions if there is no possibility of the virtual function
235   // being overridden:
236   if(obj_base && obj_base->is_derived_())
237   {
238     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
239     if(obj) // This can be NULL during destruction.
240     {
241       try // Trap C++ exceptions which would normally be lost because this is a C callback.
242       {
243         // Call the virtual member method, which derived classes might override.
244         obj->on_apply();
245         return;
246       }
247       catch(...)
248       {
249         Glib::exception_handlers_invoke();
250       }
251     }
252   }
253 
254   const auto base = static_cast<BaseClassType*>(
255         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
256     );
257 
258   // Call the original underlying C function:
259   if(base && base->apply)
260     (*base->apply)(self);
261 }
close_callback(GtkAssistant * self)262 void Assistant_Class::close_callback(GtkAssistant* self)
263 {
264   const auto obj_base = static_cast<Glib::ObjectBase*>(
265       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
266 
267   // Non-gtkmmproc-generated custom classes implicitly call the default
268   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
269   // generated classes can use this optimisation, which avoids the unnecessary
270   // parameter conversions if there is no possibility of the virtual function
271   // being overridden:
272   if(obj_base && obj_base->is_derived_())
273   {
274     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
275     if(obj) // This can be NULL during destruction.
276     {
277       try // Trap C++ exceptions which would normally be lost because this is a C callback.
278       {
279         // Call the virtual member method, which derived classes might override.
280         obj->on_close();
281         return;
282       }
283       catch(...)
284       {
285         Glib::exception_handlers_invoke();
286       }
287     }
288   }
289 
290   const auto base = static_cast<BaseClassType*>(
291         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
292     );
293 
294   // Call the original underlying C function:
295   if(base && base->close)
296     (*base->close)(self);
297 }
cancel_callback(GtkAssistant * self)298 void Assistant_Class::cancel_callback(GtkAssistant* self)
299 {
300   const auto obj_base = static_cast<Glib::ObjectBase*>(
301       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
302 
303   // Non-gtkmmproc-generated custom classes implicitly call the default
304   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
305   // generated classes can use this optimisation, which avoids the unnecessary
306   // parameter conversions if there is no possibility of the virtual function
307   // being overridden:
308   if(obj_base && obj_base->is_derived_())
309   {
310     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
311     if(obj) // This can be NULL during destruction.
312     {
313       try // Trap C++ exceptions which would normally be lost because this is a C callback.
314       {
315         // Call the virtual member method, which derived classes might override.
316         obj->on_cancel();
317         return;
318       }
319       catch(...)
320       {
321         Glib::exception_handlers_invoke();
322       }
323     }
324   }
325 
326   const auto base = static_cast<BaseClassType*>(
327         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
328     );
329 
330   // Call the original underlying C function:
331   if(base && base->cancel)
332     (*base->cancel)(self);
333 }
334 
335 
wrap_new(GObject * o)336 Glib::ObjectBase* Assistant_Class::wrap_new(GObject* o)
337 {
338   return new Assistant((GtkAssistant*)(o)); //top-level windows can not be manage()ed.
339 
340 }
341 
342 
343 /* The implementation: */
344 
Assistant(const Glib::ConstructParams & construct_params)345 Assistant::Assistant(const Glib::ConstructParams& construct_params)
346 :
347   Gtk::Window(construct_params)
348 {
349   }
350 
Assistant(GtkAssistant * castitem)351 Assistant::Assistant(GtkAssistant* castitem)
352 :
353   Gtk::Window((GtkWindow*)(castitem))
354 {
355   }
356 
357 
Assistant(Assistant && src)358 Assistant::Assistant(Assistant&& src) noexcept
359 : Gtk::Window(std::move(src))
360 {}
361 
operator =(Assistant && src)362 Assistant& Assistant::operator=(Assistant&& src) noexcept
363 {
364   Gtk::Window::operator=(std::move(src));
365   return *this;
366 }
367 
~Assistant()368 Assistant::~Assistant() noexcept
369 {
370   destroy_();
371 }
372 
373 Assistant::CppClassType Assistant::assistant_class_; // initialize static member
374 
get_type()375 GType Assistant::get_type()
376 {
377   return assistant_class_.init().get_type();
378 }
379 
380 
get_base_type()381 GType Assistant::get_base_type()
382 {
383   return gtk_assistant_get_type();
384 }
385 
386 
Assistant()387 Assistant::Assistant()
388 :
389   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
390   Glib::ObjectBase(nullptr),
391   Gtk::Window(Glib::ConstructParams(assistant_class_.init()))
392 {
393 
394 
395 }
396 
next_page()397 void Assistant::next_page()
398 {
399   gtk_assistant_next_page(gobj());
400 }
401 
previous_page()402 void Assistant::previous_page()
403 {
404   gtk_assistant_previous_page(gobj());
405 }
406 
get_current_page() const407 int Assistant::get_current_page() const
408 {
409   return gtk_assistant_get_current_page(const_cast<GtkAssistant*>(gobj()));
410 }
411 
set_current_page(int page_num)412 void Assistant::set_current_page(int page_num)
413 {
414   gtk_assistant_set_current_page(gobj(), page_num);
415 }
416 
get_n_pages() const417 int Assistant::get_n_pages() const
418 {
419   return gtk_assistant_get_n_pages(const_cast<GtkAssistant*>(gobj()));
420 }
421 
get_nth_page(int page_num)422 Widget* Assistant::get_nth_page(int page_num)
423 {
424   return Glib::wrap(gtk_assistant_get_nth_page(gobj(), page_num));
425 }
426 
get_nth_page(int page_num) const427 const Widget* Assistant::get_nth_page(int page_num) const
428 {
429   return const_cast<Assistant*>(this)->get_nth_page(page_num);
430 }
431 
prepend_page(Widget & page)432 int Assistant::prepend_page(Widget& page)
433 {
434   return gtk_assistant_prepend_page(gobj(), (page).gobj());
435 }
436 
append_page(Widget & page)437 int Assistant::append_page(Widget& page)
438 {
439   return gtk_assistant_append_page(gobj(), (page).gobj());
440 }
441 
insert_page(Widget & page,int position)442 int Assistant::insert_page(Widget& page, int position)
443 {
444   return gtk_assistant_insert_page(gobj(), (page).gobj(), position);
445 }
446 
remove_page(int page_num)447 void Assistant::remove_page(int page_num)
448 {
449   gtk_assistant_remove_page(gobj(), page_num);
450 }
451 
set_page_type(const Widget & page,AssistantPageType type)452 void Assistant::set_page_type(const Widget& page, AssistantPageType type)
453 {
454   gtk_assistant_set_page_type(gobj(), const_cast<GtkWidget*>((page).gobj()), ((GtkAssistantPageType)(type)));
455 }
456 
get_page_type(const Widget & page) const457 AssistantPageType Assistant::get_page_type(const Widget& page) const
458 {
459   return ((AssistantPageType)(gtk_assistant_get_page_type(const_cast<GtkAssistant*>(gobj()), const_cast<GtkWidget*>((page).gobj()))));
460 }
461 
set_page_title(const Widget & page,const Glib::ustring & title)462 void Assistant::set_page_title(const Widget& page, const Glib::ustring& title)
463 {
464   gtk_assistant_set_page_title(gobj(), const_cast<GtkWidget*>((page).gobj()), title.c_str());
465 }
466 
get_page_title(const Widget & page) const467 Glib::ustring Assistant::get_page_title(const Widget& page) const
468 {
469   return Glib::convert_const_gchar_ptr_to_ustring(gtk_assistant_get_page_title(const_cast<GtkAssistant*>(gobj()), const_cast<GtkWidget*>((page).gobj())));
470 }
471 
472 #ifndef GTKMM_DISABLE_DEPRECATED
473 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
set_page_header_image(const Widget & page,const Glib::RefPtr<Gdk::Pixbuf> & pixbuf)474 void Assistant::set_page_header_image(const Widget& page, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
475 {
476   gtk_assistant_set_page_header_image(gobj(), const_cast<GtkWidget*>((page).gobj()), Glib::unwrap(pixbuf));
477 }
478 G_GNUC_END_IGNORE_DEPRECATIONS
479 #endif // GTKMM_DISABLE_DEPRECATED
480 
481 #ifndef GTKMM_DISABLE_DEPRECATED
482 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_page_header_image(const Widget & page)483 Glib::RefPtr<Gdk::Pixbuf> Assistant::get_page_header_image(const Widget& page)
484 {
485   return Glib::wrap(gtk_assistant_get_page_header_image(gobj(), const_cast<GtkWidget*>((page).gobj())));
486 }
487 G_GNUC_END_IGNORE_DEPRECATIONS
488 #endif // GTKMM_DISABLE_DEPRECATED
489 
490 #ifndef GTKMM_DISABLE_DEPRECATED
491 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_page_header_image(const Widget & page) const492 Glib::RefPtr<const Gdk::Pixbuf> Assistant::get_page_header_image(const Widget& page) const
493 {
494   return const_cast<Assistant*>(this)->get_page_header_image(page);
495 }
496 G_GNUC_END_IGNORE_DEPRECATIONS
497 #endif // GTKMM_DISABLE_DEPRECATED
498 
499 #ifndef GTKMM_DISABLE_DEPRECATED
500 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
set_page_side_image(const Widget & page,const Glib::RefPtr<Gdk::Pixbuf> & pixbuf)501 void Assistant::set_page_side_image(const Widget& page, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
502 {
503   gtk_assistant_set_page_side_image(gobj(), const_cast<GtkWidget*>((page).gobj()), Glib::unwrap(pixbuf));
504 }
505 G_GNUC_END_IGNORE_DEPRECATIONS
506 #endif // GTKMM_DISABLE_DEPRECATED
507 
508 #ifndef GTKMM_DISABLE_DEPRECATED
509 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_page_side_image(const Widget & page)510 Glib::RefPtr<Gdk::Pixbuf> Assistant::get_page_side_image(const Widget& page)
511 {
512   return Glib::wrap(gtk_assistant_get_page_side_image(gobj(), const_cast<GtkWidget*>((page).gobj())));
513 }
514 G_GNUC_END_IGNORE_DEPRECATIONS
515 #endif // GTKMM_DISABLE_DEPRECATED
516 
517 #ifndef GTKMM_DISABLE_DEPRECATED
518 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_page_side_image(const Widget & page) const519 Glib::RefPtr<const Gdk::Pixbuf> Assistant::get_page_side_image(const Widget& page) const
520 {
521   return const_cast<Assistant*>(this)->get_page_side_image(page);
522 }
523 G_GNUC_END_IGNORE_DEPRECATIONS
524 #endif // GTKMM_DISABLE_DEPRECATED
525 
set_page_complete(const Widget & page,bool complete)526 void Assistant::set_page_complete(const Widget& page, bool complete)
527 {
528   gtk_assistant_set_page_complete(gobj(), const_cast<GtkWidget*>((page).gobj()), static_cast<int>(complete));
529 }
530 
get_page_complete(const Widget & page) const531 bool Assistant::get_page_complete(const Widget& page) const
532 {
533   return gtk_assistant_get_page_complete(const_cast<GtkAssistant*>(gobj()), const_cast<GtkWidget*>((page).gobj()));
534 }
535 
add_action_widget(Widget & child)536 void Assistant::add_action_widget(Widget& child)
537 {
538   gtk_assistant_add_action_widget(gobj(), (child).gobj());
539 }
540 
remove_action_widget(Widget & child)541 void Assistant::remove_action_widget(Widget& child)
542 {
543   gtk_assistant_remove_action_widget(gobj(), (child).gobj());
544 }
545 
update_buttons_state()546 void Assistant::update_buttons_state()
547 {
548   gtk_assistant_update_buttons_state(gobj());
549 }
550 
commit()551 void Assistant::commit()
552 {
553   gtk_assistant_commit(gobj());
554 }
555 
set_page_has_padding(const Widget & page,bool has_padding)556 void Assistant::set_page_has_padding(const Widget& page, bool has_padding)
557 {
558   gtk_assistant_set_page_has_padding(gobj(), const_cast<GtkWidget*>((page).gobj()), static_cast<int>(has_padding));
559 }
560 
get_page_has_padding(const Widget & page) const561 bool Assistant::get_page_has_padding(const Widget& page) const
562 {
563   return gtk_assistant_get_page_has_padding(const_cast<GtkAssistant*>(gobj()), const_cast<GtkWidget*>((page).gobj()));
564 }
565 
566 
signal_prepare()567 Glib::SignalProxy< void,Gtk::Widget* > Assistant::signal_prepare()
568 {
569   return Glib::SignalProxy< void,Gtk::Widget* >(this, &Assistant_signal_prepare_info);
570 }
571 
572 
signal_apply()573 Glib::SignalProxy< void > Assistant::signal_apply()
574 {
575   return Glib::SignalProxy< void >(this, &Assistant_signal_apply_info);
576 }
577 
578 
signal_close()579 Glib::SignalProxy< void > Assistant::signal_close()
580 {
581   return Glib::SignalProxy< void >(this, &Assistant_signal_close_info);
582 }
583 
584 
signal_cancel()585 Glib::SignalProxy< void > Assistant::signal_cancel()
586 {
587   return Glib::SignalProxy< void >(this, &Assistant_signal_cancel_info);
588 }
589 
590 
property_use_header_bar() const591 Glib::PropertyProxy_ReadOnly< bool > Assistant::property_use_header_bar() const
592 {
593   return Glib::PropertyProxy_ReadOnly< bool >(this, "use-header-bar");
594 }
595 
596 
on_prepare(Gtk::Widget * page)597 void Gtk::Assistant::on_prepare(Gtk::Widget* page)
598 {
599   const auto base = static_cast<BaseClassType*>(
600       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
601   );
602 
603   if(base && base->prepare)
604     (*base->prepare)(gobj(),(GtkWidget*)Glib::unwrap(page));
605 }
on_apply()606 void Gtk::Assistant::on_apply()
607 {
608   const auto base = static_cast<BaseClassType*>(
609       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
610   );
611 
612   if(base && base->apply)
613     (*base->apply)(gobj());
614 }
on_close()615 void Gtk::Assistant::on_close()
616 {
617   const auto base = static_cast<BaseClassType*>(
618       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
619   );
620 
621   if(base && base->close)
622     (*base->close)(gobj());
623 }
on_cancel()624 void Gtk::Assistant::on_cancel()
625 {
626   const auto base = static_cast<BaseClassType*>(
627       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
628   );
629 
630   if(base && base->cancel)
631     (*base->cancel)(gobj());
632 }
633 
634 
635 } // namespace Gtk
636 
637 
638