1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/handlebox.h>
5 #include <gtkmm/private/handlebox_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 <gtk/gtkhandlebox.h>
30 #include <gdkmm/window.h>
35 bool HandleBox::is_child_detached() const
37 return gobj()->child_detached;
40 bool HandleBox::is_float_window_mapped() const
42 return gobj()->float_window_mapped;
45 bool HandleBox::is_in_drag() const
47 return gobj()->in_drag;
50 bool HandleBox::shrinks_on_detach() const
52 return gobj()->shrink_on_detach;
62 static void HandleBox_signal_child_attached_callback(GtkHandleBox* self, GtkWidget* p0,void* data)
65 typedef sigc::slot< void,Widget* > SlotType;
67 // Do not try to call a signal on a disassociated wrapper.
68 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
70 #ifdef GLIBMM_EXCEPTIONS_ENABLED
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)
77 #ifdef GLIBMM_EXCEPTIONS_ENABLED
81 Glib::exception_handlers_invoke();
83 #endif //GLIBMM_EXCEPTIONS_ENABLED
87 static const Glib::SignalProxyInfo HandleBox_signal_child_attached_info =
90 (GCallback) &HandleBox_signal_child_attached_callback,
91 (GCallback) &HandleBox_signal_child_attached_callback
95 static void HandleBox_signal_child_detached_callback(GtkHandleBox* self, GtkWidget* p0,void* data)
98 typedef sigc::slot< void,Widget* > SlotType;
100 // Do not try to call a signal on a disassociated wrapper.
101 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
103 #ifdef GLIBMM_EXCEPTIONS_ENABLED
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)
110 #ifdef GLIBMM_EXCEPTIONS_ENABLED
114 Glib::exception_handlers_invoke();
116 #endif //GLIBMM_EXCEPTIONS_ENABLED
120 static const Glib::SignalProxyInfo HandleBox_signal_child_detached_info =
123 (GCallback) &HandleBox_signal_child_detached_callback,
124 (GCallback) &HandleBox_signal_child_detached_callback
128 } // anonymous namespace
134 Gtk::HandleBox* wrap(GtkHandleBox* object, bool take_copy)
136 return dynamic_cast<Gtk::HandleBox *> (Glib::wrap_auto ((GObject*)(object), take_copy));
139 } /* namespace Glib */
145 /* The *_Class implementation: */
147 const Glib::Class& HandleBox_Class::init()
149 if(!gtype_) // create the GType if necessary
151 // Glib::Class has to know the class init function to clone custom types.
152 class_init_func_ = &HandleBox_Class::class_init_function;
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();
158 // Create the wrapper type, with the same class/instance size as the base type.
159 register_derived_type(gtk_handle_box_get_type());
161 // Add derived versions of interfaces, if the C type implements any interfaces:
167 void HandleBox_Class::class_init_function(void* g_class, void* class_data)
169 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
170 CppClassParent::class_init_function(klass, class_data);
172 #ifdef GLIBMM_VFUNCS_ENABLED
173 #endif //GLIBMM_VFUNCS_ENABLED
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
181 #ifdef GLIBMM_VFUNCS_ENABLED
182 #endif //GLIBMM_VFUNCS_ENABLED
184 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
185 void HandleBox_Class::child_attached_callback(GtkHandleBox* self, GtkWidget* p0)
187 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
188 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
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
195 if(obj_base && obj_base->is_derived_())
197 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
198 if(obj) // This can be NULL during destruction.
200 #ifdef GLIBMM_EXCEPTIONS_ENABLED
201 try // Trap C++ exceptions which would normally be lost because this is a C callback.
203 #endif //GLIBMM_EXCEPTIONS_ENABLED
204 // Call the virtual member method, which derived classes might override.
205 obj->on_child_attached(Glib::wrap(p0)
208 #ifdef GLIBMM_EXCEPTIONS_ENABLED
212 Glib::exception_handlers_invoke();
214 #endif //GLIBMM_EXCEPTIONS_ENABLED
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).
222 // Call the original underlying C function:
223 if(base && base->child_attached)
224 (*base->child_attached)(self, p0);
226 void HandleBox_Class::child_detached_callback(GtkHandleBox* self, GtkWidget* p0)
228 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
229 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
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
236 if(obj_base && obj_base->is_derived_())
238 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
239 if(obj) // This can be NULL during destruction.
241 #ifdef GLIBMM_EXCEPTIONS_ENABLED
242 try // Trap C++ exceptions which would normally be lost because this is a C callback.
244 #endif //GLIBMM_EXCEPTIONS_ENABLED
245 // Call the virtual member method, which derived classes might override.
246 obj->on_child_detached(Glib::wrap(p0)
249 #ifdef GLIBMM_EXCEPTIONS_ENABLED
253 Glib::exception_handlers_invoke();
255 #endif //GLIBMM_EXCEPTIONS_ENABLED
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).
263 // Call the original underlying C function:
264 if(base && base->child_detached)
265 (*base->child_detached)(self, p0);
267 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
270 Glib::ObjectBase* HandleBox_Class::wrap_new(GObject* o)
272 return manage(new HandleBox((GtkHandleBox*)(o)));
277 /* The implementation: */
279 HandleBox::HandleBox(const Glib::ConstructParams& construct_params)
281 Gtk::Bin(construct_params)
285 HandleBox::HandleBox(GtkHandleBox* castitem)
287 Gtk::Bin((GtkBin*)(castitem))
291 HandleBox::~HandleBox()
296 HandleBox::CppClassType HandleBox::handlebox_class_; // initialize static member
298 GType HandleBox::get_type()
300 return handlebox_class_.init().get_type();
303 GType HandleBox::get_base_type()
305 return gtk_handle_box_get_type();
309 HandleBox::HandleBox()
311 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
313 Gtk::Bin(Glib::ConstructParams(handlebox_class_.init()))
317 void HandleBox::set_shadow_type(ShadowType type)
319 gtk_handle_box_set_shadow_type(gobj(), ((GtkShadowType)(type)));
322 ShadowType HandleBox::get_shadow_type() const
324 return ((ShadowType)(gtk_handle_box_get_shadow_type(const_cast<GtkHandleBox*>(gobj()))));
327 void HandleBox::set_handle_position(PositionType position)
329 gtk_handle_box_set_handle_position(gobj(), ((GtkPositionType)(position)));
332 PositionType HandleBox::get_handle_position() const
334 return ((PositionType)(gtk_handle_box_get_handle_position(const_cast<GtkHandleBox*>(gobj()))));
337 void HandleBox::set_snap_edge(PositionType edge)
339 gtk_handle_box_set_snap_edge(gobj(), ((GtkPositionType)(edge)));
342 PositionType HandleBox::get_snap_edge() const
344 return ((PositionType)(gtk_handle_box_get_snap_edge(const_cast<GtkHandleBox*>(gobj()))));
347 Glib::RefPtr<Gdk::Window> HandleBox::get_bin_window()
349 Glib::RefPtr<Gdk::Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->bin_window)));
352 ref_ptr->reference();
357 Glib::RefPtr<const Gdk::Window> HandleBox::get_bin_window() const
359 Glib::RefPtr<const Gdk::Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->bin_window)));
362 ref_ptr->reference();
367 Glib::RefPtr<Gdk::Window> HandleBox::get_float_window()
369 Glib::RefPtr<Gdk::Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->float_window)));
372 ref_ptr->reference();
377 Glib::RefPtr<const Gdk::Window> HandleBox::get_float_window() const
379 Glib::RefPtr<const Gdk::Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->float_window)));
382 ref_ptr->reference();
388 Glib::SignalProxy1< void,Widget* > HandleBox::signal_child_attached()
390 return Glib::SignalProxy1< void,Widget* >(this, &HandleBox_signal_child_attached_info);
394 Glib::SignalProxy1< void,Widget* > HandleBox::signal_child_detached()
396 return Glib::SignalProxy1< void,Widget* >(this, &HandleBox_signal_child_detached_info);
400 #ifdef GLIBMM_PROPERTIES_ENABLED
401 Glib::PropertyProxy<ShadowType> HandleBox::property_shadow_type()
403 return Glib::PropertyProxy<ShadowType>(this, "shadow-type");
405 #endif //GLIBMM_PROPERTIES_ENABLED
407 #ifdef GLIBMM_PROPERTIES_ENABLED
408 Glib::PropertyProxy_ReadOnly<ShadowType> HandleBox::property_shadow_type() const
410 return Glib::PropertyProxy_ReadOnly<ShadowType>(this, "shadow-type");
412 #endif //GLIBMM_PROPERTIES_ENABLED
414 #ifdef GLIBMM_PROPERTIES_ENABLED
415 Glib::PropertyProxy<PositionType> HandleBox::property_handle_position()
417 return Glib::PropertyProxy<PositionType>(this, "handle-position");
419 #endif //GLIBMM_PROPERTIES_ENABLED
421 #ifdef GLIBMM_PROPERTIES_ENABLED
422 Glib::PropertyProxy_ReadOnly<PositionType> HandleBox::property_handle_position() const
424 return Glib::PropertyProxy_ReadOnly<PositionType>(this, "handle-position");
426 #endif //GLIBMM_PROPERTIES_ENABLED
428 #ifdef GLIBMM_PROPERTIES_ENABLED
429 Glib::PropertyProxy<PositionType> HandleBox::property_snap_edge()
431 return Glib::PropertyProxy<PositionType>(this, "snap-edge");
433 #endif //GLIBMM_PROPERTIES_ENABLED
435 #ifdef GLIBMM_PROPERTIES_ENABLED
436 Glib::PropertyProxy_ReadOnly<PositionType> HandleBox::property_snap_edge() const
438 return Glib::PropertyProxy_ReadOnly<PositionType>(this, "snap-edge");
440 #endif //GLIBMM_PROPERTIES_ENABLED
443 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
444 void Gtk::HandleBox::on_child_attached(Widget* child)
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).
450 if(base && base->child_attached)
451 (*base->child_attached)(gobj(),(GtkWidget*)Glib::unwrap(child));
453 void Gtk::HandleBox::on_child_detached(Widget* child)
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).
459 if(base && base->child_detached)
460 (*base->child_detached)(gobj(),(GtkWidget*)Glib::unwrap(child));
462 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
464 #ifdef GLIBMM_VFUNCS_ENABLED
465 #endif //GLIBMM_VFUNCS_ENABLED