add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / handlebox.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/handlebox.h>
5 #include <gtkmm/private/handlebox_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 <gtk/gtkhandlebox.h>
30 #include <gdkmm/window.h>
31
32 namespace Gtk
33 {
34
35 bool HandleBox::is_child_detached() const
36 {
37   return gobj()->child_detached;
38 }
39
40 bool HandleBox::is_float_window_mapped() const
41 {
42   return gobj()->float_window_mapped;
43 }
44
45 bool HandleBox::is_in_drag() const
46 {
47   return gobj()->in_drag;
48 }
49
50 bool HandleBox::shrinks_on_detach() const
51 {
52   return gobj()->shrink_on_detach;
53 }
54
55 } /* namespace Gtk */
56
57
58 namespace
59 {
60
61
62 static void HandleBox_signal_child_attached_callback(GtkHandleBox* self, GtkWidget* p0,void* data)
63 {
64   using namespace Gtk;
65   typedef sigc::slot< void,Widget* > SlotType;
66
67   // Do not try to call a signal on a disassociated wrapper.
68   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
69   {
70     #ifdef GLIBMM_EXCEPTIONS_ENABLED
71     try
72     {
73     #endif //GLIBMM_EXCEPTIONS_ENABLED
74       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
75         (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
76 );
77     #ifdef GLIBMM_EXCEPTIONS_ENABLED
78     }
79     catch(...)
80     {
81       Glib::exception_handlers_invoke();
82     }
83     #endif //GLIBMM_EXCEPTIONS_ENABLED
84   }
85 }
86
87 static const Glib::SignalProxyInfo HandleBox_signal_child_attached_info =
88 {
89   "child_attached",
90   (GCallback) &HandleBox_signal_child_attached_callback,
91   (GCallback) &HandleBox_signal_child_attached_callback
92 };
93
94
95 static void HandleBox_signal_child_detached_callback(GtkHandleBox* self, GtkWidget* p0,void* data)
96 {
97   using namespace Gtk;
98   typedef sigc::slot< void,Widget* > SlotType;
99
100   // Do not try to call a signal on a disassociated wrapper.
101   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
102   {
103     #ifdef GLIBMM_EXCEPTIONS_ENABLED
104     try
105     {
106     #endif //GLIBMM_EXCEPTIONS_ENABLED
107       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
108         (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
109 );
110     #ifdef GLIBMM_EXCEPTIONS_ENABLED
111     }
112     catch(...)
113     {
114       Glib::exception_handlers_invoke();
115     }
116     #endif //GLIBMM_EXCEPTIONS_ENABLED
117   }
118 }
119
120 static const Glib::SignalProxyInfo HandleBox_signal_child_detached_info =
121 {
122   "child_detached",
123   (GCallback) &HandleBox_signal_child_detached_callback,
124   (GCallback) &HandleBox_signal_child_detached_callback
125 };
126
127
128 } // anonymous namespace
129
130
131 namespace Glib
132 {
133
134 Gtk::HandleBox* wrap(GtkHandleBox* object, bool take_copy)
135 {
136   return dynamic_cast<Gtk::HandleBox *> (Glib::wrap_auto ((GObject*)(object), take_copy));
137 }
138
139 } /* namespace Glib */
140
141 namespace Gtk
142 {
143
144
145 /* The *_Class implementation: */
146
147 const Glib::Class& HandleBox_Class::init()
148 {
149   if(!gtype_) // create the GType if necessary
150   {
151     // Glib::Class has to know the class init function to clone custom types.
152     class_init_func_ = &HandleBox_Class::class_init_function;
153
154     // This is actually just optimized away, apparently with no harm.
155     // Make sure that the parent type has been created.
156     //CppClassParent::CppObjectType::get_type();
157
158     // Create the wrapper type, with the same class/instance size as the base type.
159     register_derived_type(gtk_handle_box_get_type());
160
161     // Add derived versions of interfaces, if the C type implements any interfaces:
162   }
163
164   return *this;
165 }
166
167 void HandleBox_Class::class_init_function(void* g_class, void* class_data)
168 {
169   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
170   CppClassParent::class_init_function(klass, class_data);
171
172 #ifdef GLIBMM_VFUNCS_ENABLED
173 #endif //GLIBMM_VFUNCS_ENABLED
174
175 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
176   klass->child_attached = &child_attached_callback;
177   klass->child_detached = &child_detached_callback;
178 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
179 }
180
181 #ifdef GLIBMM_VFUNCS_ENABLED
182 #endif //GLIBMM_VFUNCS_ENABLED
183
184 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
185 void HandleBox_Class::child_attached_callback(GtkHandleBox* self, GtkWidget* p0)
186 {
187   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
188       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
189
190   // Non-gtkmmproc-generated custom classes implicitly call the default
191   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
192   // generated classes can use this optimisation, which avoids the unnecessary
193   // parameter conversions if there is no possibility of the virtual function
194   // being overridden:
195   if(obj_base && obj_base->is_derived_())
196   {
197     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
198     if(obj) // This can be NULL during destruction.
199     {
200       #ifdef GLIBMM_EXCEPTIONS_ENABLED
201       try // Trap C++ exceptions which would normally be lost because this is a C callback.
202       {
203       #endif //GLIBMM_EXCEPTIONS_ENABLED
204         // Call the virtual member method, which derived classes might override.
205         obj->on_child_attached(Glib::wrap(p0)
206 );
207         return;
208       #ifdef GLIBMM_EXCEPTIONS_ENABLED
209       }
210       catch(...)
211       {
212         Glib::exception_handlers_invoke();
213       }
214       #endif //GLIBMM_EXCEPTIONS_ENABLED
215     }
216   }
217   
218   BaseClassType *const base = static_cast<BaseClassType*>(
219         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
220     );
221
222   // Call the original underlying C function:
223   if(base && base->child_attached)
224     (*base->child_attached)(self, p0);
225 }
226 void HandleBox_Class::child_detached_callback(GtkHandleBox* self, GtkWidget* p0)
227 {
228   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
229       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
230
231   // Non-gtkmmproc-generated custom classes implicitly call the default
232   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
233   // generated classes can use this optimisation, which avoids the unnecessary
234   // parameter conversions if there is no possibility of the virtual function
235   // being overridden:
236   if(obj_base && obj_base->is_derived_())
237   {
238     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
239     if(obj) // This can be NULL during destruction.
240     {
241       #ifdef GLIBMM_EXCEPTIONS_ENABLED
242       try // Trap C++ exceptions which would normally be lost because this is a C callback.
243       {
244       #endif //GLIBMM_EXCEPTIONS_ENABLED
245         // Call the virtual member method, which derived classes might override.
246         obj->on_child_detached(Glib::wrap(p0)
247 );
248         return;
249       #ifdef GLIBMM_EXCEPTIONS_ENABLED
250       }
251       catch(...)
252       {
253         Glib::exception_handlers_invoke();
254       }
255       #endif //GLIBMM_EXCEPTIONS_ENABLED
256     }
257   }
258   
259   BaseClassType *const base = static_cast<BaseClassType*>(
260         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
261     );
262
263   // Call the original underlying C function:
264   if(base && base->child_detached)
265     (*base->child_detached)(self, p0);
266 }
267 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
268
269
270 Glib::ObjectBase* HandleBox_Class::wrap_new(GObject* o)
271 {
272   return manage(new HandleBox((GtkHandleBox*)(o)));
273
274 }
275
276
277 /* The implementation: */
278
279 HandleBox::HandleBox(const Glib::ConstructParams& construct_params)
280 :
281   Gtk::Bin(construct_params)
282 {
283   }
284
285 HandleBox::HandleBox(GtkHandleBox* castitem)
286 :
287   Gtk::Bin((GtkBin*)(castitem))
288 {
289   }
290
291 HandleBox::~HandleBox()
292 {
293   destroy_();
294 }
295
296 HandleBox::CppClassType HandleBox::handlebox_class_; // initialize static member
297
298 GType HandleBox::get_type()
299 {
300   return handlebox_class_.init().get_type();
301 }
302
303 GType HandleBox::get_base_type()
304 {
305   return gtk_handle_box_get_type();
306 }
307
308
309 HandleBox::HandleBox()
310 :
311   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
312   Glib::ObjectBase(0),
313   Gtk::Bin(Glib::ConstructParams(handlebox_class_.init()))
314 {
315   }
316
317 void HandleBox::set_shadow_type(ShadowType type)
318 {
319 gtk_handle_box_set_shadow_type(gobj(), ((GtkShadowType)(type))); 
320 }
321
322 ShadowType HandleBox::get_shadow_type() const
323 {
324   return ((ShadowType)(gtk_handle_box_get_shadow_type(const_cast<GtkHandleBox*>(gobj()))));
325 }
326
327 void HandleBox::set_handle_position(PositionType position)
328 {
329 gtk_handle_box_set_handle_position(gobj(), ((GtkPositionType)(position))); 
330 }
331
332 PositionType HandleBox::get_handle_position() const
333 {
334   return ((PositionType)(gtk_handle_box_get_handle_position(const_cast<GtkHandleBox*>(gobj()))));
335 }
336
337 void HandleBox::set_snap_edge(PositionType edge)
338 {
339 gtk_handle_box_set_snap_edge(gobj(), ((GtkPositionType)(edge))); 
340 }
341
342 PositionType HandleBox::get_snap_edge() const
343 {
344   return ((PositionType)(gtk_handle_box_get_snap_edge(const_cast<GtkHandleBox*>(gobj()))));
345 }
346
347  Glib::RefPtr<Gdk::Window> HandleBox::get_bin_window()
348 {
349   Glib::RefPtr<Gdk::Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->bin_window)));
350
351   if(ref_ptr)
352     ref_ptr->reference();
353
354   return ref_ptr;
355 }
356
357 Glib::RefPtr<const Gdk::Window> HandleBox::get_bin_window() const
358 {
359   Glib::RefPtr<const Gdk::Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->bin_window)));
360
361   if(ref_ptr)
362     ref_ptr->reference();
363
364   return ref_ptr;
365 }
366  
367  Glib::RefPtr<Gdk::Window> HandleBox::get_float_window()
368 {
369   Glib::RefPtr<Gdk::Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->float_window)));
370
371   if(ref_ptr)
372     ref_ptr->reference();
373
374   return ref_ptr;
375 }
376
377 Glib::RefPtr<const Gdk::Window> HandleBox::get_float_window() const
378 {
379   Glib::RefPtr<const Gdk::Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->float_window)));
380
381   if(ref_ptr)
382     ref_ptr->reference();
383
384   return ref_ptr;
385 }
386  
387
388 Glib::SignalProxy1< void,Widget* > HandleBox::signal_child_attached()
389 {
390   return Glib::SignalProxy1< void,Widget* >(this, &HandleBox_signal_child_attached_info);
391 }
392
393
394 Glib::SignalProxy1< void,Widget* > HandleBox::signal_child_detached()
395 {
396   return Glib::SignalProxy1< void,Widget* >(this, &HandleBox_signal_child_detached_info);
397 }
398
399
400 #ifdef GLIBMM_PROPERTIES_ENABLED
401 Glib::PropertyProxy<ShadowType> HandleBox::property_shadow_type() 
402 {
403   return Glib::PropertyProxy<ShadowType>(this, "shadow-type");
404 }
405 #endif //GLIBMM_PROPERTIES_ENABLED
406
407 #ifdef GLIBMM_PROPERTIES_ENABLED
408 Glib::PropertyProxy_ReadOnly<ShadowType> HandleBox::property_shadow_type() const
409 {
410   return Glib::PropertyProxy_ReadOnly<ShadowType>(this, "shadow-type");
411 }
412 #endif //GLIBMM_PROPERTIES_ENABLED
413
414 #ifdef GLIBMM_PROPERTIES_ENABLED
415 Glib::PropertyProxy<PositionType> HandleBox::property_handle_position() 
416 {
417   return Glib::PropertyProxy<PositionType>(this, "handle-position");
418 }
419 #endif //GLIBMM_PROPERTIES_ENABLED
420
421 #ifdef GLIBMM_PROPERTIES_ENABLED
422 Glib::PropertyProxy_ReadOnly<PositionType> HandleBox::property_handle_position() const
423 {
424   return Glib::PropertyProxy_ReadOnly<PositionType>(this, "handle-position");
425 }
426 #endif //GLIBMM_PROPERTIES_ENABLED
427
428 #ifdef GLIBMM_PROPERTIES_ENABLED
429 Glib::PropertyProxy<PositionType> HandleBox::property_snap_edge() 
430 {
431   return Glib::PropertyProxy<PositionType>(this, "snap-edge");
432 }
433 #endif //GLIBMM_PROPERTIES_ENABLED
434
435 #ifdef GLIBMM_PROPERTIES_ENABLED
436 Glib::PropertyProxy_ReadOnly<PositionType> HandleBox::property_snap_edge() const
437 {
438   return Glib::PropertyProxy_ReadOnly<PositionType>(this, "snap-edge");
439 }
440 #endif //GLIBMM_PROPERTIES_ENABLED
441
442
443 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
444 void Gtk::HandleBox::on_child_attached(Widget* child)
445 {
446   BaseClassType *const base = static_cast<BaseClassType*>(
447       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
448   );
449
450   if(base && base->child_attached)
451     (*base->child_attached)(gobj(),(GtkWidget*)Glib::unwrap(child));
452 }
453 void Gtk::HandleBox::on_child_detached(Widget* child)
454 {
455   BaseClassType *const base = static_cast<BaseClassType*>(
456       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
457   );
458
459   if(base && base->child_detached)
460     (*base->child_detached)(gobj(),(GtkWidget*)Glib::unwrap(child));
461 }
462 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
463
464 #ifdef GLIBMM_VFUNCS_ENABLED
465 #endif //GLIBMM_VFUNCS_ENABLED
466
467
468 } // namespace Gtk
469
470