rollback to 3428, before the mysterious removal of libs/* at 3431/3432
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / scrolledwindow.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/scrolledwindow.h>
5 #include <gtkmm/private/scrolledwindow_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* 
11  *
12  * Copyright 1998-2002 The gtkmm Development Team
13  *
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.
18  *
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.
23  *
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.
27  */
28
29 #include <gtkmm/scrollbar.h>
30 #include <gtkmm/viewport.h>
31 #include <gtkmm/adjustment.h>
32 #include <gtk/gtkscrolledwindow.h>
33
34
35 namespace Gtk
36 {
37
38 void ScrolledWindow::add(Gtk::Widget& widget)
39 {
40   GtkWidget* gwidget = widget.gobj();
41
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)
44   {
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);
47   }
48   else
49   {
50     //It can work directly with a GtkScrolledWindow, so just use the Container::add():
51     Bin::add(widget);
52   }
53 }
54
55 } //namespace Gtk
56
57
58 namespace
59 {
60 } // anonymous namespace
61
62
63 namespace Glib
64 {
65
66 Gtk::ScrolledWindow* wrap(GtkScrolledWindow* object, bool take_copy)
67 {
68   return dynamic_cast<Gtk::ScrolledWindow *> (Glib::wrap_auto ((GObject*)(object), take_copy));
69 }
70
71 } /* namespace Glib */
72
73 namespace Gtk
74 {
75
76
77 /* The *_Class implementation: */
78
79 const Glib::Class& ScrolledWindow_Class::init()
80 {
81   if(!gtype_) // create the GType if necessary
82   {
83     // Glib::Class has to know the class init function to clone custom types.
84     class_init_func_ = &ScrolledWindow_Class::class_init_function;
85
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();
89
90     // Create the wrapper type, with the same class/instance size as the base type.
91     register_derived_type(gtk_scrolled_window_get_type());
92
93     // Add derived versions of interfaces, if the C type implements any interfaces:
94   }
95
96   return *this;
97 }
98
99 void ScrolledWindow_Class::class_init_function(void* g_class, void* class_data)
100 {
101   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
102   CppClassParent::class_init_function(klass, class_data);
103
104 #ifdef GLIBMM_VFUNCS_ENABLED
105 #endif //GLIBMM_VFUNCS_ENABLED
106
107 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
108 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
109 }
110
111 #ifdef GLIBMM_VFUNCS_ENABLED
112 #endif //GLIBMM_VFUNCS_ENABLED
113
114 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
115 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
116
117
118 Glib::ObjectBase* ScrolledWindow_Class::wrap_new(GObject* o)
119 {
120   return manage(new ScrolledWindow((GtkScrolledWindow*)(o)));
121
122 }
123
124
125 /* The implementation: */
126
127 ScrolledWindow::ScrolledWindow(const Glib::ConstructParams& construct_params)
128 :
129   Gtk::Bin(construct_params)
130 {
131   }
132
133 ScrolledWindow::ScrolledWindow(GtkScrolledWindow* castitem)
134 :
135   Gtk::Bin((GtkBin*)(castitem))
136 {
137   }
138
139 ScrolledWindow::~ScrolledWindow()
140 {
141   destroy_();
142 }
143
144 ScrolledWindow::CppClassType ScrolledWindow::scrolledwindow_class_; // initialize static member
145
146 GType ScrolledWindow::get_type()
147 {
148   return scrolledwindow_class_.init().get_type();
149 }
150
151 GType ScrolledWindow::get_base_type()
152 {
153   return gtk_scrolled_window_get_type();
154 }
155
156
157 ScrolledWindow::ScrolledWindow()
158 :
159   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
160   Glib::ObjectBase(0),
161   Gtk::Bin(Glib::ConstructParams(scrolledwindow_class_.init()))
162 {
163   }
164
165 ScrolledWindow::ScrolledWindow(Adjustment& hadjustment, Adjustment& vadjustment)
166 :
167   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
168   Glib::ObjectBase(0),
169   Gtk::Bin(Glib::ConstructParams(scrolledwindow_class_.init(), "hadjustment", (hadjustment).gobj(), "vadjustment", (vadjustment).gobj(), static_cast<char*>(0)))
170 {
171   }
172
173 void ScrolledWindow::set_hadjustment(Gtk::Adjustment* hadjustment)
174 {
175 gtk_scrolled_window_set_hadjustment(gobj(), (GtkAdjustment*)Glib::unwrap(hadjustment)); 
176 }
177
178 void ScrolledWindow::set_vadjustment(Gtk::Adjustment* vadjustment)
179 {
180 gtk_scrolled_window_set_vadjustment(gobj(), (GtkAdjustment*)Glib::unwrap(vadjustment)); 
181 }
182
183 void ScrolledWindow::set_hadjustment(Gtk::Adjustment& hadjustment)
184 {
185 gtk_scrolled_window_set_hadjustment(gobj(), (hadjustment).gobj()); 
186 }
187
188 void ScrolledWindow::set_vadjustment(Gtk::Adjustment& vadjustment)
189 {
190 gtk_scrolled_window_set_vadjustment(gobj(), (vadjustment).gobj()); 
191 }
192
193 Gtk::Adjustment* ScrolledWindow::get_hadjustment()
194 {
195   return Glib::wrap(gtk_scrolled_window_get_hadjustment(gobj()));
196 }
197
198 const Gtk::Adjustment* ScrolledWindow::get_hadjustment() const
199 {
200   return const_cast<ScrolledWindow*>(this)->get_hadjustment();
201 }
202
203 Gtk::Adjustment* ScrolledWindow::get_vadjustment()
204 {
205   return Glib::wrap(gtk_scrolled_window_get_vadjustment(gobj()));
206 }
207
208 const Gtk::Adjustment* ScrolledWindow::get_vadjustment() const
209 {
210   return const_cast<ScrolledWindow*>(this)->get_vadjustment();
211 }
212
213 void ScrolledWindow::set_policy(PolicyType hscrollbar_policy, PolicyType vscrollbar_policy)
214 {
215 gtk_scrolled_window_set_policy(gobj(), ((GtkPolicyType)(hscrollbar_policy)), ((GtkPolicyType)(vscrollbar_policy))); 
216 }
217
218 void ScrolledWindow::get_policy(PolicyType& hscrollbar_policy, PolicyType& vscrollbar_policy) const
219 {
220 gtk_scrolled_window_get_policy(const_cast<GtkScrolledWindow*>(gobj()), ((GtkPolicyType*) &(hscrollbar_policy)), ((GtkPolicyType*) &(vscrollbar_policy))); 
221 }
222
223 void ScrolledWindow::set_placement(CornerType window_placement)
224 {
225 gtk_scrolled_window_set_placement(gobj(), ((GtkCornerType)(window_placement))); 
226 }
227
228 void ScrolledWindow::unset_placement()
229 {
230 gtk_scrolled_window_unset_placement(gobj()); 
231 }
232
233 CornerType ScrolledWindow::get_placement() const
234 {
235   return ((CornerType)(gtk_scrolled_window_get_placement(const_cast<GtkScrolledWindow*>(gobj()))));
236 }
237
238 void ScrolledWindow::set_shadow_type(ShadowType type)
239 {
240 gtk_scrolled_window_set_shadow_type(gobj(), ((GtkShadowType)(type))); 
241 }
242
243 ShadowType ScrolledWindow::get_shadow_type() const
244 {
245   return ((ShadowType)(gtk_scrolled_window_get_shadow_type(const_cast<GtkScrolledWindow*>(gobj()))));
246 }
247
248 VScrollbar* ScrolledWindow::get_vscrollbar()
249 {
250   return Glib::wrap((GtkVScrollbar*)gtk_scrolled_window_get_vscrollbar(gobj()));
251 }
252
253 const VScrollbar* ScrolledWindow::get_vscrollbar() const
254 {
255   return Glib::wrap((GtkVScrollbar*)gtk_scrolled_window_get_vscrollbar(const_cast<GtkScrolledWindow*>(gobj())));
256 }
257
258 HScrollbar* ScrolledWindow::get_hscrollbar()
259 {
260   return Glib::wrap((GtkHScrollbar*)gtk_scrolled_window_get_hscrollbar(gobj()));
261 }
262
263 const HScrollbar* ScrolledWindow::get_hscrollbar() const
264 {
265   return Glib::wrap((GtkHScrollbar*)gtk_scrolled_window_get_hscrollbar(const_cast<GtkScrolledWindow*>(gobj())));
266 }
267
268  bool ScrolledWindow::get_vscrollbar_visible() const
269 {
270   return gobj()->vscrollbar_visible;
271 }
272  
273  bool ScrolledWindow::get_hscrollbar_visible() const
274 {
275   return gobj()->hscrollbar_visible;
276 }
277  
278
279 #ifdef GLIBMM_PROPERTIES_ENABLED
280 Glib::PropertyProxy<Gtk::Adjustment*> ScrolledWindow::property_hadjustment() 
281 {
282   return Glib::PropertyProxy<Gtk::Adjustment*>(this, "hadjustment");
283 }
284 #endif //GLIBMM_PROPERTIES_ENABLED
285
286 #ifdef GLIBMM_PROPERTIES_ENABLED
287 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> ScrolledWindow::property_hadjustment() const
288 {
289   return Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*>(this, "hadjustment");
290 }
291 #endif //GLIBMM_PROPERTIES_ENABLED
292
293 #ifdef GLIBMM_PROPERTIES_ENABLED
294 Glib::PropertyProxy<Gtk::Adjustment*> ScrolledWindow::property_vadjustment() 
295 {
296   return Glib::PropertyProxy<Gtk::Adjustment*>(this, "vadjustment");
297 }
298 #endif //GLIBMM_PROPERTIES_ENABLED
299
300 #ifdef GLIBMM_PROPERTIES_ENABLED
301 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> ScrolledWindow::property_vadjustment() const
302 {
303   return Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*>(this, "vadjustment");
304 }
305 #endif //GLIBMM_PROPERTIES_ENABLED
306
307 #ifdef GLIBMM_PROPERTIES_ENABLED
308 Glib::PropertyProxy<PolicyType> ScrolledWindow::property_hscrollbar_policy() 
309 {
310   return Glib::PropertyProxy<PolicyType>(this, "hscrollbar-policy");
311 }
312 #endif //GLIBMM_PROPERTIES_ENABLED
313
314 #ifdef GLIBMM_PROPERTIES_ENABLED
315 Glib::PropertyProxy_ReadOnly<PolicyType> ScrolledWindow::property_hscrollbar_policy() const
316 {
317   return Glib::PropertyProxy_ReadOnly<PolicyType>(this, "hscrollbar-policy");
318 }
319 #endif //GLIBMM_PROPERTIES_ENABLED
320
321 #ifdef GLIBMM_PROPERTIES_ENABLED
322 Glib::PropertyProxy<PolicyType> ScrolledWindow::property_vscrollbar_policy() 
323 {
324   return Glib::PropertyProxy<PolicyType>(this, "vscrollbar-policy");
325 }
326 #endif //GLIBMM_PROPERTIES_ENABLED
327
328 #ifdef GLIBMM_PROPERTIES_ENABLED
329 Glib::PropertyProxy_ReadOnly<PolicyType> ScrolledWindow::property_vscrollbar_policy() const
330 {
331   return Glib::PropertyProxy_ReadOnly<PolicyType>(this, "vscrollbar-policy");
332 }
333 #endif //GLIBMM_PROPERTIES_ENABLED
334
335 #ifdef GLIBMM_PROPERTIES_ENABLED
336 Glib::PropertyProxy<CornerType> ScrolledWindow::property_window_placement() 
337 {
338   return Glib::PropertyProxy<CornerType>(this, "window-placement");
339 }
340 #endif //GLIBMM_PROPERTIES_ENABLED
341
342 #ifdef GLIBMM_PROPERTIES_ENABLED
343 Glib::PropertyProxy_ReadOnly<CornerType> ScrolledWindow::property_window_placement() const
344 {
345   return Glib::PropertyProxy_ReadOnly<CornerType>(this, "window-placement");
346 }
347 #endif //GLIBMM_PROPERTIES_ENABLED
348
349 #ifdef GLIBMM_PROPERTIES_ENABLED
350 Glib::PropertyProxy<ShadowType> ScrolledWindow::property_shadow_type() 
351 {
352   return Glib::PropertyProxy<ShadowType>(this, "shadow-type");
353 }
354 #endif //GLIBMM_PROPERTIES_ENABLED
355
356 #ifdef GLIBMM_PROPERTIES_ENABLED
357 Glib::PropertyProxy_ReadOnly<ShadowType> ScrolledWindow::property_shadow_type() const
358 {
359   return Glib::PropertyProxy_ReadOnly<ShadowType>(this, "shadow-type");
360 }
361 #endif //GLIBMM_PROPERTIES_ENABLED
362
363
364 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
365 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
366
367 #ifdef GLIBMM_VFUNCS_ENABLED
368 #endif //GLIBMM_VFUNCS_ENABLED
369
370
371 } // namespace Gtk
372
373