1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/printoperationpreview.h>
5 #include <gtkmm/private/printoperationpreview_p.h>
8 /* Copyright (C) 2006 The gtkmm Development Team
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
20 * You should have received a copy of the GNU Library General Public
21 * License along with this library; if not, write to the Free
22 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <gtk/gtkprintoperationpreview.h>
31 static void PrintOperationPreview_signal_ready_callback(GtkPrintOperationPreview* self, GtkPrintContext* p0,void* data)
34 typedef sigc::slot< void,const Glib::RefPtr<PrintContext>& > SlotType;
36 // Do not try to call a signal on a disassociated wrapper.
37 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
39 #ifdef GLIBMM_EXCEPTIONS_ENABLED
42 #endif //GLIBMM_EXCEPTIONS_ENABLED
43 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
44 (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
46 #ifdef GLIBMM_EXCEPTIONS_ENABLED
50 Glib::exception_handlers_invoke();
52 #endif //GLIBMM_EXCEPTIONS_ENABLED
56 static const Glib::SignalProxyInfo PrintOperationPreview_signal_ready_info =
59 (GCallback) &PrintOperationPreview_signal_ready_callback,
60 (GCallback) &PrintOperationPreview_signal_ready_callback
64 static void PrintOperationPreview_signal_got_page_size_callback(GtkPrintOperationPreview* self, GtkPrintContext* p0,GtkPageSetup* p1,void* data)
67 typedef sigc::slot< void,const Glib::RefPtr<PrintContext>&,const Glib::RefPtr<PageSetup>& > SlotType;
69 // Do not try to call a signal on a disassociated wrapper.
70 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
72 #ifdef GLIBMM_EXCEPTIONS_ENABLED
75 #endif //GLIBMM_EXCEPTIONS_ENABLED
76 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
77 (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
78 , Glib::wrap(p1, true)
80 #ifdef GLIBMM_EXCEPTIONS_ENABLED
84 Glib::exception_handlers_invoke();
86 #endif //GLIBMM_EXCEPTIONS_ENABLED
90 static const Glib::SignalProxyInfo PrintOperationPreview_signal_got_page_size_info =
93 (GCallback) &PrintOperationPreview_signal_got_page_size_callback,
94 (GCallback) &PrintOperationPreview_signal_got_page_size_callback
98 } // anonymous namespace
104 Glib::RefPtr<Gtk::PrintOperationPreview> wrap(GtkPrintOperationPreview* object, bool take_copy)
106 return Glib::RefPtr<Gtk::PrintOperationPreview>( dynamic_cast<Gtk::PrintOperationPreview*> (Glib::wrap_auto_interface<Gtk::PrintOperationPreview> ((GObject*)(object), take_copy)) );
107 //We use dynamic_cast<> in case of multiple inheritance.
117 /* The *_Class implementation: */
119 const Glib::Interface_Class& PrintOperationPreview_Class::init()
121 if(!gtype_) // create the GType if necessary
123 // Glib::Interface_Class has to know the interface init function
124 // in order to add interfaces to implementing types.
125 class_init_func_ = &PrintOperationPreview_Class::iface_init_function;
127 // We can not derive from another interface, and it is not necessary anyway.
128 gtype_ = gtk_print_operation_preview_get_type();
134 void PrintOperationPreview_Class::iface_init_function(void* g_iface, void*)
136 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
138 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
139 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
140 g_assert(klass != 0);
142 #ifdef GLIBMM_VFUNCS_ENABLED
143 klass->render_page = &render_page_vfunc_callback;
144 klass->end_preview = &end_preview_vfunc_callback;
145 klass->is_selected = &is_selected_vfunc_callback;
146 #endif //GLIBMM_VFUNCS_ENABLED
148 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
149 klass->ready = &ready_callback;
150 klass->got_page_size = &got_page_size_callback;
151 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
154 #ifdef GLIBMM_VFUNCS_ENABLED
155 void PrintOperationPreview_Class::render_page_vfunc_callback(GtkPrintOperationPreview* self, gint page_nr)
157 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
158 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
160 // Non-gtkmmproc-generated custom classes implicitly call the default
161 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
162 // generated classes can use this optimisation, which avoids the unnecessary
163 // parameter conversions if there is no possibility of the virtual function
165 if(obj_base && obj_base->is_derived_())
167 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
168 if(obj) // This can be NULL during destruction.
170 #ifdef GLIBMM_EXCEPTIONS_ENABLED
171 try // Trap C++ exceptions which would normally be lost because this is a C callback.
173 #endif //GLIBMM_EXCEPTIONS_ENABLED
174 // Call the virtual member method, which derived classes might override.
175 obj->render_page_vfunc(page_nr
178 #ifdef GLIBMM_EXCEPTIONS_ENABLED
182 Glib::exception_handlers_invoke();
184 #endif //GLIBMM_EXCEPTIONS_ENABLED
188 BaseClassType *const base = static_cast<BaseClassType*>(
189 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
190 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
193 // Call the original underlying C function:
194 if(base && base->render_page)
195 (*base->render_page)(self, page_nr);
198 void PrintOperationPreview_Class::end_preview_vfunc_callback(GtkPrintOperationPreview* self)
200 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
201 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
203 // Non-gtkmmproc-generated custom classes implicitly call the default
204 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
205 // generated classes can use this optimisation, which avoids the unnecessary
206 // parameter conversions if there is no possibility of the virtual function
208 if(obj_base && obj_base->is_derived_())
210 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
211 if(obj) // This can be NULL during destruction.
213 #ifdef GLIBMM_EXCEPTIONS_ENABLED
214 try // Trap C++ exceptions which would normally be lost because this is a C callback.
216 #endif //GLIBMM_EXCEPTIONS_ENABLED
217 // Call the virtual member method, which derived classes might override.
218 obj->end_preview_vfunc();
220 #ifdef GLIBMM_EXCEPTIONS_ENABLED
224 Glib::exception_handlers_invoke();
226 #endif //GLIBMM_EXCEPTIONS_ENABLED
230 BaseClassType *const base = static_cast<BaseClassType*>(
231 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
232 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
235 // Call the original underlying C function:
236 if(base && base->end_preview)
237 (*base->end_preview)(self);
240 gboolean PrintOperationPreview_Class::is_selected_vfunc_callback(GtkPrintOperationPreview* self, gint page_nr)
242 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
243 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
245 // Non-gtkmmproc-generated custom classes implicitly call the default
246 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
247 // generated classes can use this optimisation, which avoids the unnecessary
248 // parameter conversions if there is no possibility of the virtual function
250 if(obj_base && obj_base->is_derived_())
252 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
253 if(obj) // This can be NULL during destruction.
255 #ifdef GLIBMM_EXCEPTIONS_ENABLED
256 try // Trap C++ exceptions which would normally be lost because this is a C callback.
258 #endif //GLIBMM_EXCEPTIONS_ENABLED
259 // Call the virtual member method, which derived classes might override.
260 return static_cast<int>(obj->is_selected_vfunc(page_nr
262 #ifdef GLIBMM_EXCEPTIONS_ENABLED
266 Glib::exception_handlers_invoke();
268 #endif //GLIBMM_EXCEPTIONS_ENABLED
272 BaseClassType *const base = static_cast<BaseClassType*>(
273 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
274 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
277 // Call the original underlying C function:
278 if(base && base->is_selected)
279 return (*base->is_selected)(self, page_nr);
282 typedef gboolean RType;
285 #endif //GLIBMM_VFUNCS_ENABLED
287 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
288 void PrintOperationPreview_Class::ready_callback(GtkPrintOperationPreview* self, GtkPrintContext* p0)
290 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
291 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
293 // Non-gtkmmproc-generated custom classes implicitly call the default
294 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
295 // generated classes can use this optimisation, which avoids the unnecessary
296 // parameter conversions if there is no possibility of the virtual function
298 if(obj_base && obj_base->is_derived_())
300 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
301 if(obj) // This can be NULL during destruction.
303 #ifdef GLIBMM_EXCEPTIONS_ENABLED
304 try // Trap C++ exceptions which would normally be lost because this is a C callback.
306 #endif //GLIBMM_EXCEPTIONS_ENABLED
307 // Call the virtual member method, which derived classes might override.
308 obj->on_ready(Glib::wrap(p0, true)
311 #ifdef GLIBMM_EXCEPTIONS_ENABLED
315 Glib::exception_handlers_invoke();
317 #endif //GLIBMM_EXCEPTIONS_ENABLED
321 BaseClassType *const base = static_cast<BaseClassType*>(
322 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
323 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
326 // Call the original underlying C function:
327 if(base && base->ready)
328 (*base->ready)(self, p0);
330 void PrintOperationPreview_Class::got_page_size_callback(GtkPrintOperationPreview* self, GtkPrintContext* p0, GtkPageSetup* p1)
332 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
333 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
335 // Non-gtkmmproc-generated custom classes implicitly call the default
336 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
337 // generated classes can use this optimisation, which avoids the unnecessary
338 // parameter conversions if there is no possibility of the virtual function
340 if(obj_base && obj_base->is_derived_())
342 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
343 if(obj) // This can be NULL during destruction.
345 #ifdef GLIBMM_EXCEPTIONS_ENABLED
346 try // Trap C++ exceptions which would normally be lost because this is a C callback.
348 #endif //GLIBMM_EXCEPTIONS_ENABLED
349 // Call the virtual member method, which derived classes might override.
350 obj->on_got_page_size(Glib::wrap(p0, true)
351 , Glib::wrap(p1, true)
354 #ifdef GLIBMM_EXCEPTIONS_ENABLED
358 Glib::exception_handlers_invoke();
360 #endif //GLIBMM_EXCEPTIONS_ENABLED
364 BaseClassType *const base = static_cast<BaseClassType*>(
365 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
366 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
369 // Call the original underlying C function:
370 if(base && base->got_page_size)
371 (*base->got_page_size)(self, p0, p1);
373 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
376 Glib::ObjectBase* PrintOperationPreview_Class::wrap_new(GObject* object)
378 return new PrintOperationPreview((GtkPrintOperationPreview*)(object));
382 /* The implementation: */
384 PrintOperationPreview::PrintOperationPreview()
386 Glib::Interface(printoperationpreview_class_.init())
389 PrintOperationPreview::PrintOperationPreview(GtkPrintOperationPreview* castitem)
391 Glib::Interface((GObject*)(castitem))
394 PrintOperationPreview::~PrintOperationPreview()
398 void PrintOperationPreview::add_interface(GType gtype_implementer)
400 printoperationpreview_class_.init().add_interface(gtype_implementer);
403 PrintOperationPreview::CppClassType PrintOperationPreview::printoperationpreview_class_; // initialize static member
405 GType PrintOperationPreview::get_type()
407 return printoperationpreview_class_.init().get_type();
410 GType PrintOperationPreview::get_base_type()
412 return gtk_print_operation_preview_get_type();
416 void PrintOperationPreview::render_page(int page_nr)
418 gtk_print_operation_preview_render_page(gobj(), page_nr);
421 void PrintOperationPreview::end_preview()
423 gtk_print_operation_preview_end_preview(gobj());
426 bool PrintOperationPreview::is_selected(int page_nr) const
428 return gtk_print_operation_preview_is_selected(const_cast<GtkPrintOperationPreview*>(gobj()), page_nr);
432 Glib::SignalProxy1< void,const Glib::RefPtr<PrintContext>& > PrintOperationPreview::signal_ready()
434 return Glib::SignalProxy1< void,const Glib::RefPtr<PrintContext>& >(this, &PrintOperationPreview_signal_ready_info);
438 Glib::SignalProxy2< void,const Glib::RefPtr<PrintContext>&,const Glib::RefPtr<PageSetup>& > PrintOperationPreview::signal_got_page_size()
440 return Glib::SignalProxy2< void,const Glib::RefPtr<PrintContext>&,const Glib::RefPtr<PageSetup>& >(this, &PrintOperationPreview_signal_got_page_size_info);
444 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
445 void Gtk::PrintOperationPreview::on_ready(const Glib::RefPtr<PrintContext>& context)
447 BaseClassType *const base = static_cast<BaseClassType*>(
448 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
449 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
452 if(base && base->ready)
453 (*base->ready)(gobj(),Glib::unwrap(context));
455 void Gtk::PrintOperationPreview::on_got_page_size(const Glib::RefPtr<PrintContext>& context, const Glib::RefPtr<PageSetup>& page_setup)
457 BaseClassType *const base = static_cast<BaseClassType*>(
458 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
459 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
462 if(base && base->got_page_size)
463 (*base->got_page_size)(gobj(),Glib::unwrap(context),Glib::unwrap(page_setup));
465 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
467 #ifdef GLIBMM_VFUNCS_ENABLED
468 void Gtk::PrintOperationPreview::render_page_vfunc(int page_nr)
470 BaseClassType *const base = static_cast<BaseClassType*>(
471 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
472 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
475 if(base && base->render_page)
476 (*base->render_page)(gobj(),page_nr);
478 void Gtk::PrintOperationPreview::end_preview_vfunc()
480 BaseClassType *const base = static_cast<BaseClassType*>(
481 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
482 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
485 if(base && base->end_preview)
486 (*base->end_preview)(gobj());
488 bool Gtk::PrintOperationPreview::is_selected_vfunc(int page_nr) const
490 BaseClassType *const base = static_cast<BaseClassType*>(
491 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
492 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
495 if(base && base->is_selected)
496 return (*base->is_selected)(const_cast<GtkPrintOperationPreview*>(gobj()),page_nr);
501 #endif //GLIBMM_VFUNCS_ENABLED