1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/scrolledwindow.h>
5 #include <gtkmm/private/scrolledwindow_p.h>
12 * Copyright 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/scrollbar.h>
30 #include <gtkmm/viewport.h>
31 #include <gtkmm/adjustment.h>
32 #include <gtk/gtkscrolledwindow.h>
38 void ScrolledWindow::add(Gtk::Widget& widget)
40 GtkWidget* gwidget = widget.gobj();
42 //This check is courtesy of James Henstridge on gtk-devel-list@gnome.org.
43 if( GTK_WIDGET_GET_CLASS(gwidget)->set_scroll_adjustments_signal == 0)
45 //It doesn't have native scrolling capability, so it should be put inside a viewport first:
46 gtk_scrolled_window_add_with_viewport(gobj(), gwidget);
50 //It can work directly with a GtkScrolledWindow, so just use the Container::add():
60 } // anonymous namespace
66 Gtk::ScrolledWindow* wrap(GtkScrolledWindow* object, bool take_copy)
68 return dynamic_cast<Gtk::ScrolledWindow *> (Glib::wrap_auto ((GObject*)(object), take_copy));
71 } /* namespace Glib */
77 /* The *_Class implementation: */
79 const Glib::Class& ScrolledWindow_Class::init()
81 if(!gtype_) // create the GType if necessary
83 // Glib::Class has to know the class init function to clone custom types.
84 class_init_func_ = &ScrolledWindow_Class::class_init_function;
86 // This is actually just optimized away, apparently with no harm.
87 // Make sure that the parent type has been created.
88 //CppClassParent::CppObjectType::get_type();
90 // Create the wrapper type, with the same class/instance size as the base type.
91 register_derived_type(gtk_scrolled_window_get_type());
93 // Add derived versions of interfaces, if the C type implements any interfaces:
99 void ScrolledWindow_Class::class_init_function(void* g_class, void* class_data)
101 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
102 CppClassParent::class_init_function(klass, class_data);
104 #ifdef GLIBMM_VFUNCS_ENABLED
105 #endif //GLIBMM_VFUNCS_ENABLED
107 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
108 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
111 #ifdef GLIBMM_VFUNCS_ENABLED
112 #endif //GLIBMM_VFUNCS_ENABLED
114 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
115 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
118 Glib::ObjectBase* ScrolledWindow_Class::wrap_new(GObject* o)
120 return manage(new ScrolledWindow((GtkScrolledWindow*)(o)));
125 /* The implementation: */
127 ScrolledWindow::ScrolledWindow(const Glib::ConstructParams& construct_params)
129 Gtk::Bin(construct_params)
133 ScrolledWindow::ScrolledWindow(GtkScrolledWindow* castitem)
135 Gtk::Bin((GtkBin*)(castitem))
139 ScrolledWindow::~ScrolledWindow()
144 ScrolledWindow::CppClassType ScrolledWindow::scrolledwindow_class_; // initialize static member
146 GType ScrolledWindow::get_type()
148 return scrolledwindow_class_.init().get_type();
151 GType ScrolledWindow::get_base_type()
153 return gtk_scrolled_window_get_type();
157 ScrolledWindow::ScrolledWindow()
159 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
161 Gtk::Bin(Glib::ConstructParams(scrolledwindow_class_.init()))
165 ScrolledWindow::ScrolledWindow(Adjustment& hadjustment, Adjustment& vadjustment)
167 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
169 Gtk::Bin(Glib::ConstructParams(scrolledwindow_class_.init(), "hadjustment", (hadjustment).gobj(), "vadjustment", (vadjustment).gobj(), static_cast<char*>(0)))
173 void ScrolledWindow::set_hadjustment(Gtk::Adjustment* hadjustment)
175 gtk_scrolled_window_set_hadjustment(gobj(), (GtkAdjustment*)Glib::unwrap(hadjustment));
178 void ScrolledWindow::set_vadjustment(Gtk::Adjustment* vadjustment)
180 gtk_scrolled_window_set_vadjustment(gobj(), (GtkAdjustment*)Glib::unwrap(vadjustment));
183 void ScrolledWindow::set_hadjustment(Gtk::Adjustment& hadjustment)
185 gtk_scrolled_window_set_hadjustment(gobj(), (hadjustment).gobj());
188 void ScrolledWindow::set_vadjustment(Gtk::Adjustment& vadjustment)
190 gtk_scrolled_window_set_vadjustment(gobj(), (vadjustment).gobj());
193 Gtk::Adjustment* ScrolledWindow::get_hadjustment()
195 return Glib::wrap(gtk_scrolled_window_get_hadjustment(gobj()));
198 const Gtk::Adjustment* ScrolledWindow::get_hadjustment() const
200 return const_cast<ScrolledWindow*>(this)->get_hadjustment();
203 Gtk::Adjustment* ScrolledWindow::get_vadjustment()
205 return Glib::wrap(gtk_scrolled_window_get_vadjustment(gobj()));
208 const Gtk::Adjustment* ScrolledWindow::get_vadjustment() const
210 return const_cast<ScrolledWindow*>(this)->get_vadjustment();
213 void ScrolledWindow::set_policy(PolicyType hscrollbar_policy, PolicyType vscrollbar_policy)
215 gtk_scrolled_window_set_policy(gobj(), ((GtkPolicyType)(hscrollbar_policy)), ((GtkPolicyType)(vscrollbar_policy)));
218 void ScrolledWindow::get_policy(PolicyType& hscrollbar_policy, PolicyType& vscrollbar_policy) const
220 gtk_scrolled_window_get_policy(const_cast<GtkScrolledWindow*>(gobj()), ((GtkPolicyType*) &(hscrollbar_policy)), ((GtkPolicyType*) &(vscrollbar_policy)));
223 void ScrolledWindow::set_placement(CornerType window_placement)
225 gtk_scrolled_window_set_placement(gobj(), ((GtkCornerType)(window_placement)));
228 void ScrolledWindow::unset_placement()
230 gtk_scrolled_window_unset_placement(gobj());
233 CornerType ScrolledWindow::get_placement() const
235 return ((CornerType)(gtk_scrolled_window_get_placement(const_cast<GtkScrolledWindow*>(gobj()))));
238 void ScrolledWindow::set_shadow_type(ShadowType type)
240 gtk_scrolled_window_set_shadow_type(gobj(), ((GtkShadowType)(type)));
243 ShadowType ScrolledWindow::get_shadow_type() const
245 return ((ShadowType)(gtk_scrolled_window_get_shadow_type(const_cast<GtkScrolledWindow*>(gobj()))));
248 VScrollbar* ScrolledWindow::get_vscrollbar()
250 return Glib::wrap((GtkVScrollbar*)gtk_scrolled_window_get_vscrollbar(gobj()));
253 const VScrollbar* ScrolledWindow::get_vscrollbar() const
255 return Glib::wrap((GtkVScrollbar*)gtk_scrolled_window_get_vscrollbar(const_cast<GtkScrolledWindow*>(gobj())));
258 HScrollbar* ScrolledWindow::get_hscrollbar()
260 return Glib::wrap((GtkHScrollbar*)gtk_scrolled_window_get_hscrollbar(gobj()));
263 const HScrollbar* ScrolledWindow::get_hscrollbar() const
265 return Glib::wrap((GtkHScrollbar*)gtk_scrolled_window_get_hscrollbar(const_cast<GtkScrolledWindow*>(gobj())));
268 bool ScrolledWindow::get_vscrollbar_visible() const
270 return gobj()->vscrollbar_visible;
273 bool ScrolledWindow::get_hscrollbar_visible() const
275 return gobj()->hscrollbar_visible;
279 #ifdef GLIBMM_PROPERTIES_ENABLED
280 Glib::PropertyProxy<Gtk::Adjustment*> ScrolledWindow::property_hadjustment()
282 return Glib::PropertyProxy<Gtk::Adjustment*>(this, "hadjustment");
284 #endif //GLIBMM_PROPERTIES_ENABLED
286 #ifdef GLIBMM_PROPERTIES_ENABLED
287 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> ScrolledWindow::property_hadjustment() const
289 return Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*>(this, "hadjustment");
291 #endif //GLIBMM_PROPERTIES_ENABLED
293 #ifdef GLIBMM_PROPERTIES_ENABLED
294 Glib::PropertyProxy<Gtk::Adjustment*> ScrolledWindow::property_vadjustment()
296 return Glib::PropertyProxy<Gtk::Adjustment*>(this, "vadjustment");
298 #endif //GLIBMM_PROPERTIES_ENABLED
300 #ifdef GLIBMM_PROPERTIES_ENABLED
301 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> ScrolledWindow::property_vadjustment() const
303 return Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*>(this, "vadjustment");
305 #endif //GLIBMM_PROPERTIES_ENABLED
307 #ifdef GLIBMM_PROPERTIES_ENABLED
308 Glib::PropertyProxy<PolicyType> ScrolledWindow::property_hscrollbar_policy()
310 return Glib::PropertyProxy<PolicyType>(this, "hscrollbar-policy");
312 #endif //GLIBMM_PROPERTIES_ENABLED
314 #ifdef GLIBMM_PROPERTIES_ENABLED
315 Glib::PropertyProxy_ReadOnly<PolicyType> ScrolledWindow::property_hscrollbar_policy() const
317 return Glib::PropertyProxy_ReadOnly<PolicyType>(this, "hscrollbar-policy");
319 #endif //GLIBMM_PROPERTIES_ENABLED
321 #ifdef GLIBMM_PROPERTIES_ENABLED
322 Glib::PropertyProxy<PolicyType> ScrolledWindow::property_vscrollbar_policy()
324 return Glib::PropertyProxy<PolicyType>(this, "vscrollbar-policy");
326 #endif //GLIBMM_PROPERTIES_ENABLED
328 #ifdef GLIBMM_PROPERTIES_ENABLED
329 Glib::PropertyProxy_ReadOnly<PolicyType> ScrolledWindow::property_vscrollbar_policy() const
331 return Glib::PropertyProxy_ReadOnly<PolicyType>(this, "vscrollbar-policy");
333 #endif //GLIBMM_PROPERTIES_ENABLED
335 #ifdef GLIBMM_PROPERTIES_ENABLED
336 Glib::PropertyProxy<CornerType> ScrolledWindow::property_window_placement()
338 return Glib::PropertyProxy<CornerType>(this, "window-placement");
340 #endif //GLIBMM_PROPERTIES_ENABLED
342 #ifdef GLIBMM_PROPERTIES_ENABLED
343 Glib::PropertyProxy_ReadOnly<CornerType> ScrolledWindow::property_window_placement() const
345 return Glib::PropertyProxy_ReadOnly<CornerType>(this, "window-placement");
347 #endif //GLIBMM_PROPERTIES_ENABLED
349 #ifdef GLIBMM_PROPERTIES_ENABLED
350 Glib::PropertyProxy<ShadowType> ScrolledWindow::property_shadow_type()
352 return Glib::PropertyProxy<ShadowType>(this, "shadow-type");
354 #endif //GLIBMM_PROPERTIES_ENABLED
356 #ifdef GLIBMM_PROPERTIES_ENABLED
357 Glib::PropertyProxy_ReadOnly<ShadowType> ScrolledWindow::property_shadow_type() const
359 return Glib::PropertyProxy_ReadOnly<ShadowType>(this, "shadow-type");
361 #endif //GLIBMM_PROPERTIES_ENABLED
364 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
365 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
367 #ifdef GLIBMM_VFUNCS_ENABLED
368 #endif //GLIBMM_VFUNCS_ENABLED