1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/viewport.h>
4 #include <gtkmm/private/viewport_p.h>
11 * Copyright 2002 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
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 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <gtkmm/viewport.h>
29 #include <gtkmm/adjustment.h>
30 #include <gtk/gtkviewport.h>
36 void Viewport_signal_set_scroll_adjustments_callback(GtkViewport* self, GtkAdjustment* p0,GtkAdjustment* p1,void* data)
39 typedef sigc::slot< void,Gtk::Adjustment*,Gtk::Adjustment* > SlotType;
41 // Do not try to call a signal on a disassociated wrapper.
42 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
46 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
47 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
53 Glib::exception_handlers_invoke();
58 const Glib::SignalProxyInfo Viewport_signal_set_scroll_adjustments_info =
60 "set_scroll_adjustments",
61 (GCallback) &Viewport_signal_set_scroll_adjustments_callback,
62 (GCallback) &Viewport_signal_set_scroll_adjustments_callback
65 } // anonymous namespace
71 Gtk::Viewport* wrap(GtkViewport* object, bool take_copy)
73 return dynamic_cast<Gtk::Viewport *> (Glib::wrap_auto ((GObject*)(object), take_copy));
76 } /* namespace Glib */
82 /* The *_Class implementation: */
84 const Glib::Class& Viewport_Class::init()
86 if(!gtype_) // create the GType if necessary
88 // Glib::Class has to know the class init function to clone custom types.
89 class_init_func_ = &Viewport_Class::class_init_function;
91 // This is actually just optimized away, apparently with no harm.
92 // Make sure that the parent type has been created.
93 //CppClassParent::CppObjectType::get_type();
95 // Create the wrapper type, with the same class/instance size as the base type.
96 register_derived_type(gtk_viewport_get_type());
98 // Add derived versions of interfaces, if the C type implements any interfaces:
104 void Viewport_Class::class_init_function(void* g_class, void* class_data)
106 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
107 CppClassParent::class_init_function(klass, class_data);
109 klass->set_scroll_adjustments = &set_scroll_adjustments_callback;
113 void Viewport_Class::set_scroll_adjustments_callback(GtkViewport* self, GtkAdjustment* p0, GtkAdjustment* p1)
115 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
116 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
118 // Non-gtkmmproc-generated custom classes implicitly call the default
119 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
120 // generated classes can use this optimisation, which avoids the unnecessary
121 // parameter conversions if there is no possibility of the virtual function
123 if(obj && obj->is_derived_())
125 try // Trap C++ exceptions which would normally be lost because this is a C callback.
127 // Call the virtual member method, which derived classes might override.
128 obj->on_set_scroll_adjustments(Glib::wrap(p0)
134 Glib::exception_handlers_invoke();
139 BaseClassType *const base = static_cast<BaseClassType*>(
140 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
143 // Call the original underlying C function:
144 if(base && base->set_scroll_adjustments)
145 (*base->set_scroll_adjustments)(self, p0, p1);
150 Glib::ObjectBase* Viewport_Class::wrap_new(GObject* o)
152 return manage(new Viewport((GtkViewport*)(o)));
157 /* The implementation: */
159 Viewport::Viewport(const Glib::ConstructParams& construct_params)
161 Gtk::Bin(construct_params)
165 Viewport::Viewport(GtkViewport* castitem)
167 Gtk::Bin((GtkBin*)(castitem))
171 Viewport::~Viewport()
176 Viewport::CppClassType Viewport::viewport_class_; // initialize static member
178 GType Viewport::get_type()
180 return viewport_class_.init().get_type();
183 GType Viewport::get_base_type()
185 return gtk_viewport_get_type();
189 Viewport::Viewport(Adjustment& hadjustment, Adjustment& vadjustment)
191 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
192 Gtk::Bin(Glib::ConstructParams(viewport_class_.init(), "hadjustment", (hadjustment).gobj(), "vadjustment", (vadjustment).gobj(), (char*) 0))
196 Gtk::Adjustment* Viewport::get_hadjustment()
198 return Glib::wrap(gtk_viewport_get_hadjustment(gobj()));
201 const Gtk::Adjustment* Viewport::get_hadjustment() const
203 return Glib::wrap(gtk_viewport_get_hadjustment(const_cast<GtkViewport*>(gobj())));
206 Gtk::Adjustment* Viewport::get_vadjustment()
208 return Glib::wrap(gtk_viewport_get_vadjustment(gobj()));
211 const Gtk::Adjustment* Viewport::get_vadjustment() const
213 return Glib::wrap(gtk_viewport_get_vadjustment(const_cast<GtkViewport*>(gobj())));
216 void Viewport::set_hadjustment(Gtk::Adjustment* adjustment)
218 gtk_viewport_set_hadjustment(gobj(), (GtkAdjustment*)Glib::unwrap(adjustment));
221 void Viewport::set_hadjustment(Gtk::Adjustment& adjustment)
223 gtk_viewport_set_hadjustment(gobj(), (adjustment).gobj());
226 void Viewport::set_vadjustment(Gtk::Adjustment* adjustment)
228 gtk_viewport_set_vadjustment(gobj(), (GtkAdjustment*)Glib::unwrap(adjustment));
231 void Viewport::set_vadjustment(Gtk::Adjustment& adjustment)
233 gtk_viewport_set_vadjustment(gobj(), (adjustment).gobj());
236 void Viewport::set_shadow_type(ShadowType type)
238 gtk_viewport_set_shadow_type(gobj(), ((GtkShadowType)(type)));
241 ShadowType Viewport::get_shadow_type() const
243 return ((ShadowType)(gtk_viewport_get_shadow_type(const_cast<GtkViewport*>(gobj()))));
247 Glib::SignalProxy2< void,Gtk::Adjustment*,Gtk::Adjustment* > Viewport::signal_set_scroll_adjustments()
249 return Glib::SignalProxy2< void,Gtk::Adjustment*,Gtk::Adjustment* >(this, &Viewport_signal_set_scroll_adjustments_info);
253 Glib::PropertyProxy<Gtk::Adjustment*> Viewport::property_hadjustment()
255 return Glib::PropertyProxy<Gtk::Adjustment*>(this, "hadjustment");
258 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> Viewport::property_hadjustment() const
260 return Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*>(this, "hadjustment");
263 Glib::PropertyProxy<Gtk::Adjustment*> Viewport::property_vadjustment()
265 return Glib::PropertyProxy<Gtk::Adjustment*>(this, "vadjustment");
268 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> Viewport::property_vadjustment() const
270 return Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*>(this, "vadjustment");
273 Glib::PropertyProxy<ShadowType> Viewport::property_shadow_type()
275 return Glib::PropertyProxy<ShadowType>(this, "shadow-type");
278 Glib::PropertyProxy_ReadOnly<ShadowType> Viewport::property_shadow_type() const
280 return Glib::PropertyProxy_ReadOnly<ShadowType>(this, "shadow-type");
284 void Gtk::Viewport::on_set_scroll_adjustments(Gtk::Adjustment* hadjustment, Gtk::Adjustment* vadjustment)
286 BaseClassType *const base = static_cast<BaseClassType*>(
287 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
290 if(base && base->set_scroll_adjustments)
291 (*base->set_scroll_adjustments)(gobj(),(GtkAdjustment*)Glib::unwrap(hadjustment),(GtkAdjustment*)Glib::unwrap(vadjustment));