1 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
2 
3 //Allow us to use the struct fields.
4 //TODO: We need to remove these methods anyway in a future ABI break.
5 #undef GSEAL_ENABLE
6 
7 
8 #include <glibmm.h>
9 
10 #include <gtkmm/scrolledwindow.h>
11 #include <gtkmm/private/scrolledwindow_p.h>
12 
13 
14 // -*- c++ -*-
15 /* $Id: scrolledwindow.ccg,v 1.1 2003/01/21 13:40:36 murrayc Exp $ */
16 
17 /*
18  *
19  * Copyright 1998-2002 The gtkmm Development Team
20  *
21  * This library is free software; you can redistribute it and/or
22  * modify it under the terms of the GNU Lesser General Public
23  * License as published by the Free Software Foundation; either
24  * version 2.1 of the License, or (at your option) any later version.
25  *
26  * This library is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29  * Lesser General Public License for more details.
30  *
31  * You should have received a copy of the GNU Lesser General Public
32  * License along with this library; if not, write to the Free
33  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34  */
35 
36 #include <gtkmm/scrollbar.h>
37 #include <gtkmm/viewport.h>
38 #include <gtkmm/adjustment.h>
39 #include <gtk/gtk.h>
40 
41 
42 namespace Gtk
43 {
44 
add(Gtk::Widget & widget)45 void ScrolledWindow::add(Gtk::Widget& widget)
46 {
47   GtkWidget* gwidget = widget.gobj();
48 
49   //This check is courtesy of James Henstridge on gtk-devel-list@gnome.org.
50   if( GTK_WIDGET_GET_CLASS(gwidget)->set_scroll_adjustments_signal == 0)
51   {
52     //It doesn't have native scrolling capability, so it should be put inside a viewport first:
53     gtk_scrolled_window_add_with_viewport(gobj(), gwidget);
54   }
55   else
56   {
57     //It can work directly with a GtkScrolledWindow, so just use the Container::add():
58     Bin::add(widget);
59   }
60 }
61 
62 } //namespace Gtk
63 
64 
65 namespace
66 {
67 } // anonymous namespace
68 
69 
70 namespace Glib
71 {
72 
wrap(GtkScrolledWindow * object,bool take_copy)73 Gtk::ScrolledWindow* wrap(GtkScrolledWindow* object, bool take_copy)
74 {
75   return dynamic_cast<Gtk::ScrolledWindow *> (Glib::wrap_auto ((GObject*)(object), take_copy));
76 }
77 
78 } /* namespace Glib */
79 
80 namespace Gtk
81 {
82 
83 
84 /* The *_Class implementation: */
85 
init()86 const Glib::Class& ScrolledWindow_Class::init()
87 {
88   if(!gtype_) // create the GType if necessary
89   {
90     // Glib::Class has to know the class init function to clone custom types.
91     class_init_func_ = &ScrolledWindow_Class::class_init_function;
92 
93     // This is actually just optimized away, apparently with no harm.
94     // Make sure that the parent type has been created.
95     //CppClassParent::CppObjectType::get_type();
96 
97     // Create the wrapper type, with the same class/instance size as the base type.
98     register_derived_type(gtk_scrolled_window_get_type());
99 
100     // Add derived versions of interfaces, if the C type implements any interfaces:
101 
102   }
103 
104   return *this;
105 }
106 
107 
class_init_function(void * g_class,void * class_data)108 void ScrolledWindow_Class::class_init_function(void* g_class, void* class_data)
109 {
110   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
111   CppClassParent::class_init_function(klass, class_data);
112 
113 
114 }
115 
116 
wrap_new(GObject * o)117 Glib::ObjectBase* ScrolledWindow_Class::wrap_new(GObject* o)
118 {
119   return manage(new ScrolledWindow((GtkScrolledWindow*)(o)));
120 
121 }
122 
123 
124 /* The implementation: */
125 
ScrolledWindow(const Glib::ConstructParams & construct_params)126 ScrolledWindow::ScrolledWindow(const Glib::ConstructParams& construct_params)
127 :
128   Gtk::Bin(construct_params)
129 {
130   }
131 
ScrolledWindow(GtkScrolledWindow * castitem)132 ScrolledWindow::ScrolledWindow(GtkScrolledWindow* castitem)
133 :
134   Gtk::Bin((GtkBin*)(castitem))
135 {
136   }
137 
~ScrolledWindow()138 ScrolledWindow::~ScrolledWindow()
139 {
140   destroy_();
141 }
142 
143 ScrolledWindow::CppClassType ScrolledWindow::scrolledwindow_class_; // initialize static member
144 
get_type()145 GType ScrolledWindow::get_type()
146 {
147   return scrolledwindow_class_.init().get_type();
148 }
149 
150 
get_base_type()151 GType ScrolledWindow::get_base_type()
152 {
153   return gtk_scrolled_window_get_type();
154 }
155 
156 
ScrolledWindow()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 }
166 
ScrolledWindow(Adjustment & hadjustment,Adjustment & vadjustment)167 ScrolledWindow::ScrolledWindow(Adjustment& hadjustment, Adjustment& vadjustment)
168 :
169   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
170   Glib::ObjectBase(0),
171   Gtk::Bin(Glib::ConstructParams(scrolledwindow_class_.init(), "hadjustment", (hadjustment).gobj(), "vadjustment", (vadjustment).gobj(), static_cast<char*>(0)))
172 {
173 
174 
175 }
176 
set_hadjustment(Gtk::Adjustment * hadjustment)177 void ScrolledWindow::set_hadjustment(Gtk::Adjustment* hadjustment)
178 {
179   gtk_scrolled_window_set_hadjustment(gobj(), (GtkAdjustment*)Glib::unwrap(hadjustment));
180 }
181 
set_vadjustment(Gtk::Adjustment * vadjustment)182 void ScrolledWindow::set_vadjustment(Gtk::Adjustment* vadjustment)
183 {
184   gtk_scrolled_window_set_vadjustment(gobj(), (GtkAdjustment*)Glib::unwrap(vadjustment));
185 }
186 
set_hadjustment(Gtk::Adjustment & hadjustment)187 void ScrolledWindow::set_hadjustment(Gtk::Adjustment& hadjustment)
188 {
189   gtk_scrolled_window_set_hadjustment(gobj(), (hadjustment).gobj());
190 }
191 
set_vadjustment(Gtk::Adjustment & vadjustment)192 void ScrolledWindow::set_vadjustment(Gtk::Adjustment& vadjustment)
193 {
194   gtk_scrolled_window_set_vadjustment(gobj(), (vadjustment).gobj());
195 }
196 
get_hadjustment()197 Gtk::Adjustment* ScrolledWindow::get_hadjustment()
198 {
199   return Glib::wrap(gtk_scrolled_window_get_hadjustment(gobj()));
200 }
201 
get_hadjustment() const202 const Gtk::Adjustment* ScrolledWindow::get_hadjustment() const
203 {
204   return const_cast<ScrolledWindow*>(this)->get_hadjustment();
205 }
206 
get_vadjustment()207 Gtk::Adjustment* ScrolledWindow::get_vadjustment()
208 {
209   return Glib::wrap(gtk_scrolled_window_get_vadjustment(gobj()));
210 }
211 
get_vadjustment() const212 const Gtk::Adjustment* ScrolledWindow::get_vadjustment() const
213 {
214   return const_cast<ScrolledWindow*>(this)->get_vadjustment();
215 }
216 
set_policy(PolicyType hscrollbar_policy,PolicyType vscrollbar_policy)217 void ScrolledWindow::set_policy(PolicyType hscrollbar_policy, PolicyType vscrollbar_policy)
218 {
219   gtk_scrolled_window_set_policy(gobj(), ((GtkPolicyType)(hscrollbar_policy)), ((GtkPolicyType)(vscrollbar_policy)));
220 }
221 
get_policy(PolicyType & hscrollbar_policy,PolicyType & vscrollbar_policy) const222 void ScrolledWindow::get_policy(PolicyType& hscrollbar_policy, PolicyType& vscrollbar_policy) const
223 {
224   gtk_scrolled_window_get_policy(const_cast<GtkScrolledWindow*>(gobj()), ((GtkPolicyType*) &(hscrollbar_policy)), ((GtkPolicyType*) &(vscrollbar_policy)));
225 }
226 
set_placement(CornerType window_placement)227 void ScrolledWindow::set_placement(CornerType window_placement)
228 {
229   gtk_scrolled_window_set_placement(gobj(), ((GtkCornerType)(window_placement)));
230 }
231 
unset_placement()232 void ScrolledWindow::unset_placement()
233 {
234   gtk_scrolled_window_unset_placement(gobj());
235 }
236 
get_placement() const237 CornerType ScrolledWindow::get_placement() const
238 {
239   return ((CornerType)(gtk_scrolled_window_get_placement(const_cast<GtkScrolledWindow*>(gobj()))));
240 }
241 
set_shadow_type(ShadowType type)242 void ScrolledWindow::set_shadow_type(ShadowType type)
243 {
244   gtk_scrolled_window_set_shadow_type(gobj(), ((GtkShadowType)(type)));
245 }
246 
get_shadow_type() const247 ShadowType ScrolledWindow::get_shadow_type() const
248 {
249   return ((ShadowType)(gtk_scrolled_window_get_shadow_type(const_cast<GtkScrolledWindow*>(gobj()))));
250 }
251 
get_vscrollbar()252 VScrollbar* ScrolledWindow::get_vscrollbar()
253 {
254   return Glib::wrap((GtkVScrollbar*)gtk_scrolled_window_get_vscrollbar(gobj()));
255 }
256 
get_vscrollbar() const257 const VScrollbar* ScrolledWindow::get_vscrollbar() const
258 {
259   return Glib::wrap((GtkVScrollbar*)gtk_scrolled_window_get_vscrollbar(const_cast<GtkScrolledWindow*>(gobj())));
260 }
261 
get_hscrollbar()262 HScrollbar* ScrolledWindow::get_hscrollbar()
263 {
264   return Glib::wrap((GtkHScrollbar*)gtk_scrolled_window_get_hscrollbar(gobj()));
265 }
266 
get_hscrollbar() const267 const HScrollbar* ScrolledWindow::get_hscrollbar() const
268 {
269   return Glib::wrap((GtkHScrollbar*)gtk_scrolled_window_get_hscrollbar(const_cast<GtkScrolledWindow*>(gobj())));
270 }
271 
get_vscrollbar_visible() const272  bool ScrolledWindow::get_vscrollbar_visible() const
273 {
274   return gobj()->vscrollbar_visible;
275 }
276 
get_hscrollbar_visible() const277  bool ScrolledWindow::get_hscrollbar_visible() const
278 {
279   return gobj()->hscrollbar_visible;
280 }
281 
282 
property_hadjustment()283 Glib::PropertyProxy< Gtk::Adjustment* > ScrolledWindow::property_hadjustment()
284 {
285   return Glib::PropertyProxy< Gtk::Adjustment* >(this, "hadjustment");
286 }
287 
property_hadjustment() const288 Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* > ScrolledWindow::property_hadjustment() const
289 {
290   return Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* >(this, "hadjustment");
291 }
292 
property_vadjustment()293 Glib::PropertyProxy< Gtk::Adjustment* > ScrolledWindow::property_vadjustment()
294 {
295   return Glib::PropertyProxy< Gtk::Adjustment* >(this, "vadjustment");
296 }
297 
property_vadjustment() const298 Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* > ScrolledWindow::property_vadjustment() const
299 {
300   return Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* >(this, "vadjustment");
301 }
302 
property_hscrollbar_policy()303 Glib::PropertyProxy< PolicyType > ScrolledWindow::property_hscrollbar_policy()
304 {
305   return Glib::PropertyProxy< PolicyType >(this, "hscrollbar-policy");
306 }
307 
property_hscrollbar_policy() const308 Glib::PropertyProxy_ReadOnly< PolicyType > ScrolledWindow::property_hscrollbar_policy() const
309 {
310   return Glib::PropertyProxy_ReadOnly< PolicyType >(this, "hscrollbar-policy");
311 }
312 
property_vscrollbar_policy()313 Glib::PropertyProxy< PolicyType > ScrolledWindow::property_vscrollbar_policy()
314 {
315   return Glib::PropertyProxy< PolicyType >(this, "vscrollbar-policy");
316 }
317 
property_vscrollbar_policy() const318 Glib::PropertyProxy_ReadOnly< PolicyType > ScrolledWindow::property_vscrollbar_policy() const
319 {
320   return Glib::PropertyProxy_ReadOnly< PolicyType >(this, "vscrollbar-policy");
321 }
322 
property_window_placement()323 Glib::PropertyProxy< CornerType > ScrolledWindow::property_window_placement()
324 {
325   return Glib::PropertyProxy< CornerType >(this, "window-placement");
326 }
327 
property_window_placement() const328 Glib::PropertyProxy_ReadOnly< CornerType > ScrolledWindow::property_window_placement() const
329 {
330   return Glib::PropertyProxy_ReadOnly< CornerType >(this, "window-placement");
331 }
332 
property_window_placement_set()333 Glib::PropertyProxy< bool > ScrolledWindow::property_window_placement_set()
334 {
335   return Glib::PropertyProxy< bool >(this, "window-placement-set");
336 }
337 
property_window_placement_set() const338 Glib::PropertyProxy_ReadOnly< bool > ScrolledWindow::property_window_placement_set() const
339 {
340   return Glib::PropertyProxy_ReadOnly< bool >(this, "window-placement-set");
341 }
342 
property_shadow_type()343 Glib::PropertyProxy< ShadowType > ScrolledWindow::property_shadow_type()
344 {
345   return Glib::PropertyProxy< ShadowType >(this, "shadow-type");
346 }
347 
property_shadow_type() const348 Glib::PropertyProxy_ReadOnly< ShadowType > ScrolledWindow::property_shadow_type() const
349 {
350   return Glib::PropertyProxy_ReadOnly< ShadowType >(this, "shadow-type");
351 }
352 
353 
354 } // namespace Gtk
355 
356 
357